PageSourceSearch

https://livequizzing.com/assets/index-lXZhQDBO.js

js livequizzing.com collected 2026-10-05 07:14:14 UTC 2,200,221 bytes, 1,108 lines download raw bytes

vendor: 4,253 bytes, lines 1-9
1var SJ=Object.defineProperty;var H5=e=>{throw TypeError(e)};var kJ=(e,t,n)=>t in e?SJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var EJ=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Zn=(e,t,n)=>kJ(e,typeof t!="symbol"?t+"":t,n),tS=(e,t,n)=>t.has(e)||H5("Cannot "+n);var xe=(e,t,n)=>(tS(e,t,"read from private field"),n?n.call(e):t.get(e)),kt=(e,t,n)=>t.has(e)?H5("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ft=(e,t,n,r)=>(tS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),cn=(e,t,n)=>(tS(e,t,"access private method"),n);var Gw=(e,t,n,r)=>({set _(s){ft(e,t,s,n)},get _(){return xe(e,t,r)}});var kIe=EJ((ZIe,xb)=>{function PJ(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var bd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function En(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nS={exports:{}},Kx={},rS={exports:{}},pn={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var K5;function CJ(){if(K5)return pn;K5=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.iterator;function m(L){return L===null||typeof L!="object"?null:(L=d&&L[d]||L["@@iterator"],typeof L=="function"?L:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,v={};function b(L,W,Q){this.props=L,this.context=W,this.refs=v,this.updater=Q||g}b.prototype.isReactComponent={},b.prototype.setState=function(L,W){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,W,"setState")},b.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function y(){}y.prototype=b.prototype;function _(L,W,Q){this.props=L,this.context=W,this.refs=v,this.updater=Q||g}var N=_.prototype=new y;N.constructor=_,w(N,b.prototype),N.isPureReactComponent=!0;var j=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function A(L,W,Q){var J,ne={},Y=null,ee=null;if(W!=null)for(J in W.ref!==void 0&&(ee=W.ref),W.key!==void 0&&(Y=""+W.key),W)S.call(W,J)&&!P.hasOwnProperty(J)&&(ne[J]=W[J]);var le=arguments.length-2;if(le===1)ne.children=Q;else if(1<le){for(var re=Array(le),fe=0;fe<le;fe++)re[fe]=arguments[fe+2];ne.children=re}if(L&&L.defaultProps)for(J in le=L.defaultProps,le)ne[J]===void 0&&(ne[J]=le[J]);return{$$typeof:e,type:L,key:Y,ref:ee,props:ne,_owner:C.current}}function F(L,W){return{$$typeof:e,type:L.type,key:W,ref:L.ref,props:L.props,_owner:L._owner}}
vendor: 6,129 bytes, lines 9-25
9function I(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function R(L){var W={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(Q){return W[Q]})}var M=/\/+/g;function $(L,W){return typeof L=="object"&&L!==null&&L.key!=null?R(""+L.key):W.toString(36)}function B(L,W,Q,J,ne){var Y=typeof L;(Y==="undefined"||Y==="boolean")&&(L=null);var ee=!1;if(L===null)ee=!0;else switch(Y){case"string":case"number":ee=!0;break;case"object":switch(L.$$typeof){case e:case t:ee=!0}}if(ee)return ee=L,ne=ne(ee),L=J===""?"."+$(ee,0):J,j(ne)?(Q="",L!=null&&(Q=L.replace(M,"$&/")+"/"),B(ne,W,Q,"",function(fe){return fe})):ne!=null&&(I(ne)&&(ne=F(ne,Q+(!ne.key||ee&&ee.key===ne.key?"":(""+ne.key).replace(M,"$&/")+"/")+L)),W.push(ne)),1;if(ee=0,J=J===""?".":J+":",j(L))for(var le=0;le<L.length;le++){Y=L[le];var re=J+$(Y,le);ee+=B(Y,W,Q,re,ne)}else if(re=m(L),typeof re=="function")for(L=re.call(L),le=0;!(Y=L.next()).done;)Y=Y.value,re=J+$(Y,le++),ee+=B(Y,W,Q,re,ne);else if(Y==="object")throw W=String(L),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.");return ee}function U(L,W,Q){if(L==null)return L;var J=[],ne=0;return B(L,J,"","",function(Y){return W.call(Q,Y,ne++)}),J}function G(L){if(L._status===-1){var W=L._result;W=W(),W.then(function(Q){(L._status===0||L._status===-1)&&(L._status=1,L._result=Q)},function(Q){(L._status===0||L._status===-1)&&(L._status=2,L._result=Q)}),L._status===-1&&(L._status=0,L._result=W)}if(L._status===1)return L._result.default;throw L._result}var Z={current:null},X={transition:null},V={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:X,ReactCurrentOwner:C};function z(){throw Error("act(...) is not supported in production builds of React.")}return pn.Children={map:U,forEach:function(L,W,Q){U(L,function(){W.apply(this,arguments)},Q)},count:function(L){var W=0;return U(L,function(){W++}),W},toArray:function(L){return U(L,function(W){return W})||[]},only:function(L){if(!I(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},pn.Component=b,pn.Fragment=n,pn.Profiler=s,pn.PureComponent=_,pn.StrictMode=r,pn.Suspense=c,pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,pn.act=z,pn.cloneElement=function(L,W,Q){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var J=w({},L.props),ne=L.key,Y=L.ref,ee=L._owner;if(W!=null){if(W.ref!==void 0&&(Y=W.ref,ee=C.current),W.key!==void 0&&(ne=""+W.key),L.type&&L.type.defaultProps)var le=L.type.defaultProps;for(re in W)S.call(W,re)&&!P.hasOwnProperty(re)&&(J[re]=W[re]===void 0&&le!==void 0?le[re]:W[re])}var re=arguments.length-2;if(re===1)J.children=Q;else if(1<re){le=Array(re);for(var fe=0;fe<re;fe++)le[fe]=arguments[fe+2];J.children=le}return{$$typeof:e,type:L.type,key:ne,ref:Y,props:J,_owner:ee}},pn.createContext=function(L){return L={$$typeof:o,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:a,_context:L},L.Consumer=L},pn.createElement=A,pn.createFactory=function(L){var W=A.bind(null,L);return W.type=L,W},pn.createRef=function(){return{current:null}},pn.forwardRef=function(L){return{$$typeof:l,render:L}},pn.isValidElement=I,pn.lazy=function(L){return{$$typeof:h,_payload:{_status:-1,_result:L},_init:G}},pn.memo=function(L,W){return{$$typeof:u,type:L,compare:W===void 0?null:W}},pn.startTransition=function(L){var W=X.transition;X.transition={};try{L()}finally{X.transition=W}},pn.unstable_act=z,pn.useCallback=function(L,W){return Z.current.useCallback(L,W)},pn.useContext=function(L){return Z.current.useContext(L)},pn.useDebugValue=function(){},pn.useDeferredValue=function(L){return Z.current.useDeferredValue(L)},pn.useEffect=function(L,W){return Z.current.useEffect(L,W)},pn.useId=function(){return Z.current.useId()},pn.useImperativeHandle=function(L,W,Q){return Z.current.useImperativeHandle(L,W,Q)},pn.useInsertionEffect=function(L,W){return Z.current.useInsertionEffect(L,W)},pn.useLayoutEffect=function(L,W){return Z.current.useLayoutEffect(L,W)},pn.useMemo=function(L,W){return Z.current.useMemo(L,W)},pn.useReducer=function(L,W,Q){return Z.current.useReducer(L,W,Q)},pn.useRef=function(L){return Z.current.useRef(L)},pn.useState=function(L){return Z.current.useState(L)},pn.useSyncExternalStore=function(L,W,Q){return Z.current.useSyncExternalStore(L,W,Q)},pn.useTransition=function(){return Z.current.useTransition()},pn.version="18.3.1",pn}var G5;function Uy(){return G5||(G5=1,rS.exports=CJ()),rS.exports}/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var Q5;function AJ(){if(Q5)return Kx;Q5=1;var e=Uy(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(l,c,u){var h,d={},m=null,g=null;u!==void 0&&(m=""+u),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(g=c.ref);for(h in c)r.call(c,h)&&!a.hasOwnProperty(h)&&(d[h]=c[h]);if(l&&l.defaultProps)for(h in c=l.defaultProps,c)d[h]===void 0&&(d[h]=c[h]);return{$$typeof:t,type:l,key:m,ref:g,props:d,_owner:s.current}}return Kx.Fragment=n,Kx.jsx=o,Kx.jsxs=o,Kx}var Y5;function OJ(){return Y5||(Y5=1,nS.exports=AJ()),nS.exports}var i=OJ(),O=Uy();const se=En(O),FT=PJ({__proto__:null,default:se},[O]);var Qw={},iS={exports:{}},Bs={},sS={exports:{}},aS={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */var X5;function TJ(){return X5||(X5=1,(function(e){function t(X,V){var z=X.length;X.push(V);e:for(;0<z;){var L=z-1>>>1,W=X[L];if(0<s(W,V))X[L]=V,X[z]=W,z
vendor: 18,992 bytes, lines 25-37
25=L;else break e}}function n(X){return X.length===0?null:X[0]}function r(X){if(X.length===0)return null;var V=X[0],z=X.pop();if(z!==V){X[0]=z;e:for(var L=0,W=X.length,Q=W>>>1;L<Q;){var J=2*(L+1)-1,ne=X[J],Y=J+1,ee=X[Y];if(0>s(ne,z))Y<W&&0>s(ee,ne)?(X[L]=ee,X[Y]=z,L=Y):(X[L]=ne,X[J]=z,L=J);else if(Y<W&&0>s(ee,z))X[L]=ee,X[Y]=z,L=Y;else break e}}return V}function s(X,V){var z=X.sortIndex-V.sortIndex;return z!==0?z:X.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],h=1,d=null,m=3,g=!1,w=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(X){for(var V=n(u);V!==null;){if(V.callback===null)r(u);else if(V.startTime<=X)r(u),V.sortIndex=V.expirationTime,t(c,V);else break;V=n(u)}}function j(X){if(v=!1,N(X),!w)if(n(c)!==null)w=!0,G(S);else{var V=n(u);V!==null&&Z(j,V.startTime-X)}}function S(X,V){w=!1,v&&(v=!1,y(A),A=-1),g=!0;var z=m;try{for(N(V),d=n(c);d!==null&&(!(d.expirationTime>V)||X&&!R());){var L=d.callback;if(typeof L=="function"){d.callback=null,m=d.priorityLevel;var W=L(d.expirationTime<=V);V=e.unstable_now(),typeof W=="function"?d.callback=W:d===n(c)&&r(c),N(V)}else r(c);d=n(c)}if(d!==null)var Q=!0;else{var J=n(u);J!==null&&Z(j,J.startTime-V),Q=!1}return Q}finally{d=null,m=z,g=!1}}var C=!1,P=null,A=-1,F=5,I=-1;function R(){return!(e.unstable_now()-I<F)}function M(){if(P!==null){var X=e.unstable_now();I=X;var V=!0;try{V=P(!0,X)}finally{V?$():(C=!1,P=null)}}else C=!1}var $;if(typeof _=="function")$=function(){_(M)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,U=B.port2;B.port1.onmessage=M,$=function(){U.postMessage(null)}}else $=function(){b(M,0)};function G(X){P=X,C||(C=!0,$())}function Z(X,V){A=b(function(){X(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(X){X.callback=null},e.unstable_continueExecution=function(){w||g||(w=!0,G(S))},e.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<X?Math.floor(1e3/X):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(X){switch(m){case 1:case 2:case 3:var V=3;break;default:V=m}var z=m;m=V;try{return X()}finally{m=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(X,V){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var z=m;m=X;try{return V()}finally{m=z}},e.unstable_scheduleCallback=function(X,V,z){var L=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?L+z:L):z=L,X){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=z+W,X={id:h++,callback:V,priorityLevel:X,startTime:z,expirationTime:W,sortIndex:-1},z>L?(X.sortIndex=z,t(u,X),n(c)===null&&X===n(u)&&(v?(y(A),A=-1):v=!0,Z(j,z-L))):(X.sortIndex=W,t(c,X),w||g||(w=!0,G(S))),X},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(X){var V=m;return function(){var z=m;m=V;try{return X.apply(this,arguments)}finally{m=z}}}})(aS)),aS}var Z5;function RJ(){return Z5||(Z5=1,sS.exports=TJ()),sS.exports}/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var J5;function MJ(){if(J5)return Bs;J5=1;var e=Uy(),t=RJ();function n(f){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+f,E=1;E<arguments.length;E++)p+="&args[]="+encodeURIComponent(arguments[E]);return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function a(f,p){o(f,p),o(f+"Capture",p)}function o(f,p){for(s[f]=p,f=0;f<p.length;f++)r.add(p[f])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},d={};function m(f){return c.call(d,f)?!0:c.call(h,f)?!1:u.test(f)?d[f]=!0:(h[f]=!0,!1)}function g(f,p,E,T){if(E!==null&&E.type===0)return!1;switch(typeof p){case"function":case"symbol":return!0;case"boolean":return T?!1:E!==null?!E.acceptsBooleans:(f=f.toLowerCase().slice(0,5),f!=="data-"&&f!=="aria-");default:return!1}}function w(f,p,E,T){if(p===null||typeof p>"u"||g(f,p,E,T))return!0;if(T)return!1;if(E!==null)switch(E.type){case 3:return!p;case 4:return p===!1;case 5:return isNaN(p);case 6:return isNaN(p)||1>p}return!1}function v(f,p,E,T,q,H,ie){this.acceptsBooleans=p===2||p===3||p===4,this.attributeName=T,this.attributeNamespace=q,this.mustUseProperty=E,this.propertyName=f,this.type=p,this.sanitizeURL=H,this.removeEmptyString=ie}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(f){b[f]=new v(f,0,!1,f,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(f){var p=f[0];b[p]=new v(p,1,!1,f[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(f){b[f]=new v(f,2,!1,f.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(f){b[f]=new v(f,2,!1,f,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(f){b[f]=new v(f,3,!1,f.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(f){b[f]=new v(f,3,!0,f,null,!1,!1)}),["capture","download"].forEach(function(f){b[f]=new v(f,4,!1,f,null,!1,!1)}),["cols","rows","size","span"].forEach(function(f){b[f]=new v(f,6,!1,f,null,!1,!1)}),["rowSpan","start"].forEach(function(f){b[f]=new v(f,5,!1,f.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function _(f){return f[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(f){var p=f.replace(y,_);b[p]=new v(p,1,!1,f,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(f){var p=f.replace(y,_);b[p]=new v(p,1,!1,f,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(f){var p=f.replace(y,_);b[p]=new v(p,1,!1,f,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(f){b[f]=new v(f,1,!1,f.toLowerCase(),null,!1,!1)}),b.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(f){b[f]=new v(f,1,!1,f.toLowerCase(),null,!0,!0)});function N(f,p,E,T){var q=b.hasOwnProperty(p)?b[p]:null;(q!==null?q.type!==0:T||!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(w(p,E,q,T)&&(E=null),T||q===null?m(p)&&(E===null?f.removeAttribute(p):f.setAttribute(p,""+E)):q.mustUseProperty?f[q.propertyName]=E===null?q.type===3?!1:"":E:(p=q.attributeName,T=q.attributeNamespace,E===null?f.removeAttribute(p):(q=q.type,E=q===3||q===4&&E===!0?"":""+E,T?f.setAttributeNS(T,p,E):f.setAttribute(p,E))))}var j=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for("react.element"),C=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),R=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),X=Symbol.iterator;function V(f){return f===null||typeof f!="object"?null:(f=X&&f[X]||f["@@iterator"],typeof f=="function"?f:null)}var z=Object.assign,L;function W(f){if(L===void 0)try{throw Error()}catch(E){var p=E.stack.trim().match(/\n( *(at )?)/);L=p&&p[1]||""}return`
34`+L+f}var Q=!1;function J(f,p){if(!f||Q)return"";Q=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(p)if(p=function(){throw Error()},Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(Re){var T=Re}Reflect.construct(f,[],p)}else{try{p.call()}catch(Re){T=Re}f.call(p.prototype)}else{try{throw Error()}catch(Re){T=Re}f()}}catch(Re){if(Re&&T&&typeof Re.stack=="string"){for(var q=Re.stack.split(`
35`),H=T.stack.split(`
36`),ie=q.length-1,pe=H.length-1;1<=ie&&0<=pe&&q[ie]!==H[pe];)pe--;for(;1<=ie&&0<=pe;ie--,pe--)if(q[ie]!==H[pe]){if(ie!==1||pe!==1)do if(ie--,pe--,0>pe||q[ie]!==H[pe]){var ye=`
37`+q[ie].replace(" at new "," at ");return f.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",f.displayName)),ye}while(1<=ie&&0<=pe);break}}}finally{Q=!1,Error.prepareStackTrace=E}return(f=f?f.displayName||f.name:"")?W(f):""}function ne(f){switch(f.tag){case 5:return W(f.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return f=J(f.type,!1),f;case 11:return f=J(f.type.render,!1),f;case 1:return f=J(f.type,!0),f;default:return""}}function Y(f){if(f==null)return null;if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case P:return"Fragment";case C:return"Portal";case F:return"Profiler";case A:return"StrictMode";case $:return"Suspense";case B:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case R:return(f.displayName||"Context")+".Consumer";case I:return(f._context.displayName||"Context")+".Provider";case M:var p=f.render;return f=f.displayName,f||(f=p.displayName||p.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case U:return p=f.displayName||null,p!==null?p:Y(f.type)||"Memo";case G:p=f._payload,f=f._init;try{return Y(f(p))}catch{}}return null}function ee(f){var p=f.type;switch(f.tag){case 24:return"Cache";case 9:return(p.displayName||"Context")+".Consumer";case 10:return(p._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return f=p.render,f=f.displayName||f.name||"",p.displayName||(f!==""?"ForwardRef("+f+")":"ForwardRef");case 7:return"Fragment";case 5:return p;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Y(p);case 8:return p===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p}return null}function le(f){switch(typeof f){case"boolean":case"number":case"string":case"undefined":return f;case"object":return f;default:return""}}function re(f){var p=f.type;return(f=f.nodeName)&&f.toLowerCase()==="input"&&(p==="checkbox"||p==="radio")}function fe(f){var p=re(f)?"checked":"value",E=Object.getOwnPropertyDescriptor(f.constructor.prototype,p),T=""+f[p];if(!f.hasOwnProperty(p)&&typeof E<"u"&&typeof E.get=="function"&&typeof E.set=="function"){var q=E.get,H=E.set;return Object.defineProperty(f,p,{configurable:!0,get:function(){return q.call(this)},set:function(ie){T=""+ie,H.call(this,ie)}}),Object.defineProperty(f,p,{enumerable:E.enumerable}),{getValue:function(){return T},setValue:function(ie){T=""+ie},stopTracking:function(){f._valueTracker=null,delete f[p]}}}}function ge(f){f._valueTracker||(f._valueTracker=fe(f))}function he(f){if(!f)return!1;var p=f._valueTracker;if(!p)return!0;var E=p.getValue(),T="";return f&&(T=re(f)?f.checked?"true":"false":f.value),f=T,f!==E?(p.setValue(f),!0):!1}function De(f){if(f=f||(typeof document<"u"?document:void 0),typeof f>"u")return null;try{return f.activeElement||f.body}catch{return f.body}}function _e(f,p){var E=p.checked;return z({},p,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:E??f._wrapperState.initialChecked})}function We(f,p){var E=p.defaultValue==null?"":p.defaultValue,T=p.checked!=null?p.checked:p.defaultChecked;E=le(p.value!=null?p.value:E),f._wrapperState={initialChecked:T,initialValue:E,controlled:p.type==="checkbox"||p.type==="radio"?p.checked!=null:p.value!=null}}function ze(f,p){p=p.checked,p!=null&&N(f,"checked",p,!1)}function Xe(f,p){ze(f,p);var E=le(p.value),T=p.type;if(E!=null)T==="number"?(E===0&&f.value===""||f.value!=E)&&(f.value=""+E):f.value!==""+E&&(f.value=""+E);else if(T==="submit"||T==="reset"){f.removeAttribute("value");return}p.hasOwnProperty("value")?Ae(f,p.type,E):p.hasOwnProperty("defaultValue")&&Ae(f,p.type,le(p.defaultValue)),p.checked==null&&p.defaultChecked!=null&&(f.defaultChecked=!!p.defaultChecked)}function ke(f,p,E){if(p.hasOwnProperty("value")||p.hasOwnProperty("defaultValue")){var T=p.type;if(!(T!=="submit"&&T!=="reset"||p.value!==void 0&&p.value!==null))return;p=""+f._wrapperState.initialValue,E||p===f.value||(f.value=p),f.defaultValue=p}E=f.name,E!==""&&(f.name=""),f.defaultChecked=!!f._wrapperState.initialChecked,E!==""&&(f.name=E)}function Ae(f,p,E){(p!=="number"||De(f.ownerDocument)!==f)&&(E==null?f.defaultValue=""+f._wrapperState.initialValue:f.defaultValue!==""+E&&(f.defaultValue=""+E))}var Be=Array.isArray;function de(f,p,E,T){if(f=f.options,p){p={};for(var q=0;q<E.length;q++)p["$"+E[q]]=!0;for(E=0;E<f.length;E++)q=p.hasOwnProperty("$"+f[E].value),f[E].selected!==q&&(f[E].selected=q),q&&T&&(f[E].defaultSelected=!0)}else{for(E=""+le(E),p=null,q=0;q<f.length;q++){if(f[q].value===E){f[q].selected=!0,T&&(f[q].defaultSelected=!0);return}p!==null||f[q].disabled||(p=f[q])}p!==null&&(p.selected=!0)}}function Pe(f,p){if(p.dangerouslySetInnerHTML!=null)throw Error(n(91));return z({},p,{value:void 0,defaultValue:void 0,children:""+f._wrapperState.initialValue})}function Ze(f,p){var E=p.value;if(E==null){if(E=p.children,p=p.defaultValue,E!=null){if(p!=null)throw Error(n(92));if(Be(E)){if(1<E.length)throw Error(n(93));E=E[0]}p=E}p==null&&(p=""),E=p}f._wrapperState={initialValue:le(E)}}function ct(f,p){var E=le(p.value),T=le(p.defaultValue);E!=null&&(E=""+E,E!==f.value&&(f.value=E),p.defaultValue==null&&f.defaultValue!==E&&(f.defaultValue=E)),T!=null&&(f.defaultValue=""+T)}function pt(f){var p=f.textContent;p===f._wrapperState.initialValue&&p!==""&&p!==null&&(f.value=p)}function $t(f){switch(f){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function wn(f,p){return f==null||f==="http://www.w3.org/1999/xhtml"?$t(p):f==="http://www.w3.org/2000/svg"&&p==="foreignObject"?"http://www.w3.org/1999/xhtml":f}var an,is=(function(f){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(p,E,T,q){MSApp.execUnsafeLocalFunction(function(){return f(p,E,T,q)})}:f})(function(f,p){if(f.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in f)f.innerHTML=p;else{for(an=an||document.createElement("div"),an.innerHTML="<svg>"+p.valueOf().toString()+"</svg>",p=an.firstChild;f.firstChild;)f.removeChild(f.firstChild);for(;p.firstChild;)f.appendChild(p.firstChild)}});function on(f,p){if(p){var E=f.firstChild;if(E&&E===f.lastChild&&E.nodeType===3){E.nodeValue=p;return}}f.textContent=p}var ir={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ns=["Webkit","ms","Moz","O"];Object.keys(ir).forEach(function(f){Ns.forEach(function(p){p=p+f.charAt(0).toUpperCase()+f.substring(1),ir[p]=ir[f]})});function el(f,p,E){return p==null||typeof p=="boolean"||p===""?"":E||typeof p!="number"||p===0||ir.hasOwnProperty(f)&&ir[f]?(""+p).trim():p+"px"}function vu(f,p){f=f.style;for(var E in p)if(p.hasOwnProperty(E)){var T=E.indexOf("--")===0,q=el(E,p[E],T);E==="float"&&(E="cssFloat"),T?f.setProperty(E,q):f[E]=q}}var xu=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function tl(f,p){if(p){if(xu[f]&&(p.children!=null||p.dangerouslySetInnerHTML!=null))throw Error(n(137,f));if(p.dangerouslySetInnerHTML!=null){if(p.children!=null)throw Error(n(60));if(typeof p.dangerouslySetInnerHTML!="object"||!("__html"in p.dangerouslySetInnerHTML))throw Error(n(61))}if(p.style!=null&&typeof p.style!="object")throw Error(n(62))}}function ec(f,p){if(f.indexOf("-")===-1)return typeof p.is=="str
37ing";switch(f){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tc=null;function Ss(f){return f=f.target||f.srcElement||window,f.correspondingUseElement&&(f=f.correspondingUseElement),f.nodeType===3?f.parentNode:f}var Zd=null,ho=null,_a=null;function Jd(f){if(f=mi(f)){if(typeof Zd!="function")throw Error(n(280));var p=f.stateNode;p&&(p=Rm(p),Zd(f.stateNode,f.type,p))}}function Vt(f){ho?_a?_a.push(f):_a=[f]:ho=f}function fr(){if(ho){var f=ho,p=_a;if(_a=ho=null,Jd(f),p)for(f=0;f<p.length;f++)Jd(p[f])}}function Ar(f,p){return f(p)}function Qr(){}var nl=!1;function jr(f,p,E){if(nl)return f(p,E);nl=!0;try{return Ar(f,p,E)}finally{nl=!1,(ho!==null||_a!==null)&&(Qr(),fr())}}function $r(f,p){var E=f.stateNode;if(E===null)return null;var T=Rm(E);if(T===null)return null;E=T[p];e:switch(p){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(T=!T.disabled)||(f=f.type,T=!(f==="button"||f==="input"||f==="select"||f==="textarea")),f=!T;break e;default:f=!1}if(f)return null;if(E&&typeof E!="function")throw Error(n(231,p,typeof E));return E}var Na=!1;if(l)try{var Yr={};Object.defineProperty(Yr,"passive",{get:function(){Na=!0}}),window.addEventListener("test",Yr,Yr),window.removeEventListener("test",Yr,Yr)}catch{Na=!1}function Ei(f,p,E,T,q,H,ie,pe,ye){var Re=Array.prototype.slice.call(arguments,3);try{p.apply(E,Re)}catch(Ge){this.onError(Ge)}}var rl=!1,ks=null,ef=!1,Sv=null,XN={onError:function(f){rl=!0,ks=f}};function ZN(f,p,E,T,q,H,ie,pe,ye){rl=!1,ks=null,Ei.apply(XN,arguments)}function JN(f,p,E,T,q,H,ie,pe,ye){if(ZN.apply(this,arguments),rl){if(rl){var Re=ks;rl=!1,ks=null}else throw Error(n(198));ef||(ef=!0,Sv=Re)}}function nc(f){var p=f,E=f;if(f.alternate)for(;p.return;)p=p.return;else{f=p;do p=f,(p.flags&4098)!==0&&(E=p.return),f=p.return;while(f)}return p.tag===3?E:null}function kv(f){if(f.tag===13){var p=f.memoizedState;if(p===null&&(f=f.alternate,f!==null&&(p=f.memoizedState)),p!==null)return p.dehydrated}return null}function bb(f){if(nc(f)!==f)throw Error(n(188))}function e2(f){var p=f.alternate;if(!p){if(p=nc(f),p===null)throw Error(n(188));return p!==f?null:f}for(var E=f,T=p;;){var q=E.return;if(q===null)break;var H=q.alternate;if(H===null){if(T=q.return,T!==null){E=T;continue}break}if(q.child===H.child){for(H=q.child;H;){if(H===E)return bb(q),f;if(H===T)return bb(q),p;H=H.sibling}throw Error(n(188))}if(E.return!==T.return)E=q,T=H;else{for(var ie=!1,pe=q.child;pe;){if(pe===E){ie=!0,E=q,T=H;break}if(pe===T){ie=!0,T=q,E=H;break}pe=pe.sibling}if(!ie){for(pe=H.child;pe;){if(pe===E){ie=!0,E=H,T=q;break}if(pe===T){ie=!0,T=H,E=q;break}pe=pe.sibling}if(!ie)throw Error(n(189))}}if(E.alternate!==T)throw Error(n(190))}if(E.tag!==3)throw Error(n(188));return E.stateNode.current===E?f:p}function wb(f){return f=e2(f),f!==null?jb(f):null}function jb(f){if(f.tag===5||f.tag===6)return f;for(f=f.child;f!==null;){var p=jb(f);if(p!==null)return p;f=f.sibling}return null}var _b=t.unstable_scheduleCallback,Nb=t.unstable_cancelCallback,sm=t.unstable_shouldYield,t2=t.unstable_requestPaint,Gn=t.unstable_now,n2=t.unstable_getCurrentPriorityLevel,Ev=t.unstable_ImmediatePriority,Sb=t.unstable_UserBlockingPriority,tf=t.unstable_NormalPriority,kb=t.unstable_LowPriority,Pv=t.unstable_IdlePriority,am=null,Sa=null;function r2(f){if(Sa&&typeof Sa.onCommitFiberRoot=="function")try{Sa.onCommitFiberRoot(am,f,void 0,(f.current.flags&128)===128)}catch{}}var Ys=Math.clz32?Math.clz32:Cb,Eb=Math.log,Pb=Math.LN2;function Cb(f){return f>>>=0,f===0?32:31-(Eb(f)/Pb|0)|0}var yu=64,om=4194304;function bu(f){switch(f&-f){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function rc(f,p){var E=f.pendingLanes;if(E===0)return 0;var T=0,q=f.suspendedLanes,H=f.pingedLanes,ie=E&268435455;if(ie!==0){var pe=ie&~q;pe!==0?T=bu(pe):(H&=ie,H!==0&&(T=bu(H)))}else ie=E&~q,ie!==0?T=bu(ie):H!==0&&(T=bu(H));if(T===0)return 0;if(p!==0&&p!==T&&(p&q)===0&&(q=T&-T,H=p&-p,q>=H||q===16&&(H&4194240)!==0))return p;if((T&4)!==0&&(T|=E&16),p=f.entangledLanes,p!==0)for(f=f.entanglements,p&=T;0<p;)E=31-Ys(p),q=1<<E,T|=f[E],p&=~q;return T}function Ab(f,p){switch(f){case 1:case 2:case 4:return p+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return p+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function i2(f,p){for(var E=f.suspendedLanes,T=f.pingedLanes,q=f.expirationTimes,H=f.pendingLanes;0<H;){var ie=31-Ys(H),pe=1<<ie,ye=q[ie];ye===-1?((pe&E)===0||(pe&T)!==0)&&(q[ie]=Ab(pe,p)):ye<=p&&(f.expiredLanes|=pe),H&=~pe}}function lm(f){return f=f.pendingLanes&-1073741825,f!==0?f:f&1073741824?1073741824:0}function Cv(){var f=yu;return yu<<=1,(yu&4194240)===0&&(yu=64),f}function nf(f){for(var p=[],E=0;31>E;E++)p.push(f);return p}function rf(f,p,E){f.pendingLanes|=p,p!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,p=31-Ys(p),f[p]=E}function Ob(f,p){var E=f.pendingLanes&~p;f.pendingLanes=p,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=p,f.mutableReadLanes&=p,f.entangledLanes&=p,p=f.entanglements;var T=f.eventTimes;for(f=f.expirationTimes;0<E;){var q=31-Ys(E),H=1<<q;p[q]=0,T[q]=-1,f[q]=-1,E&=~H}}function sf(f,p){var E=f.entangledLanes|=p;for(f=f.entanglements;E;){var T=31-Ys(E),q=1<<T;q&p|f[T]&p&&(f[T]|=p),E&=~q}}var kn=0;function ic(f){return f&=-f,1<f?4<f?(f&268435455)!==0?16:536870912:4:1}var Av,cm,Tb,Ov,Tv,um=!1,af=[],il=null,sl=null,al=null,wu=new Map,of=new Map,ol=[],s2="mou
37sedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Rb(f,p){switch(f){case"focusin":case"focusout":il=null;break;case"dragenter":case"dragleave":sl=null;break;case"mouseover":case"mouseout":al=null;break;case"pointerover":case"pointerout":wu.delete(p.pointerId);break;case"gotpointercapture":case"lostpointercapture":of.delete(p.pointerId)}}function sc(f,p,E,T,q,H){return f===null||f.nativeEvent!==H?(f={blockedOn:p,domEventName:E,eventSystemFlags:T,nativeEvent:H,targetContainers:[q]},p!==null&&(p=mi(p),p!==null&&cm(p)),f):(f.eventSystemFlags|=T,p=f.targetContainers,q!==null&&p.indexOf(q)===-1&&p.push(q),f)}function a2(f,p,E,T,q){switch(p){case"focusin":return il=sc(il,f,p,E,T,q),!0;case"dragenter":return sl=sc(sl,f,p,E,T,q),!0;case"mouseover":return al=sc(al,f,p,E,T,q),!0;case"pointerover":var H=q.pointerId;return wu.set(H,sc(wu.get(H)||null,f,p,E,T,q)),!0;case"gotpointercapture":return H=q.pointerId,of.set(H,sc(of.get(H)||null,f,p,E,T,q)),!0}return!1}function Mb(f){var p=Ca(f.target);if(p!==null){var E=nc(p);if(E!==null){if(p=E.tag,p===13){if(p=kv(E),p!==null){f.blockedOn=p,Tv(f.priority,function(){Tb(E)});return}}else if(p===3&&E.stateNode.current.memoizedState.isDehydrated){f.blockedOn=E.tag===3?E.stateNode.containerInfo:null;return}}}f.blockedOn=null}function dm(f){if(f.blockedOn!==null)return!1;for(var p=f.targetContainers;0<p.length;){var E=mm(f.domEventName,f.eventSystemFlags,p[0],f.nativeEvent);if(E===null){E=f.nativeEvent;var T=new E.constructor(E.type,E);tc=T,E.target.dispatchEvent(T),tc=null}else return p=mi(E),p!==null&&cm(p),f.blockedOn=E,!1;p.shift()}return!0}function Ib(f,p,E){dm(f)&&E.delete(p)}function o2(){um=!1,il!==null&&dm(il)&&(il=null),sl!==null&&dm(sl)&&(sl=null),al!==null&&dm(al)&&(al=null),wu.forEach(Ib),of.forEach(Ib)}function On(f,p){f.blockedOn===p&&(f.blockedOn=null,um||(um=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,o2)))}function Pn(f){function p(q){return On(q,f)}if(0<af.length){On(af[0],f);for(var E=1;E<af.length;E++){var T=af[E];T.blockedOn===f&&(T.blockedOn=null)}}for(il!==null&&On(il,f),sl!==null&&On(sl,f),al!==null&&On(al,f),wu.forEach(p),of.forEach(p),E=0;E<ol.length;E++)T=ol[E],T.blockedOn===f&&(T.blockedOn=null);for(;0<ol.length&&(E=ol[0],E.blockedOn===null);)Mb(E),E.blockedOn===null&&ol.shift()}var ju=j.ReactCurrentBatchConfig,fm=!0;function l2(f,p,E,T){var q=kn,H=ju.transition;ju.transition=null;try{kn=1,Rv(f,p,E,T)}finally{kn=q,ju.transition=H}}function c2(f,p,E,T){var q=kn,H=ju.transition;ju.transition=null;try{kn=4,Rv(f,p,E,T)}finally{kn=q,ju.transition=H}}function Rv(f,p,E,T){if(fm){var q=mm(f,p,E,T);if(q===null)Yv(f,p,T,hm,E),Rb(f,T);else if(a2(q,f,p,E,T))T.stopPropagation();else if(Rb(f,T),p&4&&-1<s2.indexOf(f)){for(;q!==null;){var H=mi(q);if(H!==null&&Av(H),H=mm(f,p,E,T),H===null&&Yv(f,p,T,hm,E),H===q)break;q=H}q!==null&&T.stopPropagation()}else Yv(f,p,T,null,E)}}var hm=null;function mm(f,p,E,T){if(hm=null,f=Ss(T),f=Ca(f),f!==null)if(p=nc(f),p===null)f=null;else if(E=p.tag,E===13){if(f=kv(p),f!==null)return f;f=null}else if(E===3){if(p.stateNode.current.memoizedState.isDehydrated)return p.tag===3?p.stateNode.containerInfo:null;f=null}else p!==f&&(f=null);return hm=f,null}function Db(f){switch(f){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(n2()){case Ev:return 1;case Sb:return 4;case tf:case kb:return 16;case Pv:return 536870912;default:return 16}default:return 16}}var Qn=null,lf=null,ka=null;function Mv(){if(ka)return ka;var f,p=lf,E=p.length,T,q="value"in Qn?Qn.value:Qn.textContent,H=q.length;for(f=0;f<E&&p[f]===q[f];f++);var ie=E-f;for(T=1;
vendor: 11,245 bytes, line 37
37T<=ie&&p[E-T]===q[H-T];T++);return ka=q.slice(f,1<T?1-T:void 0)}function _u(f){var p=f.keyCode;return"charCode"in f?(f=f.charCode,f===0&&p===13&&(f=13)):f=p,f===10&&(f=13),32<=f||f===13?f:0}function Pi(){return!0}function Iv(){return!1}function zi(f){function p(E,T,q,H,ie){this._reactName=E,this._targetInst=q,this.type=T,this.nativeEvent=H,this.target=ie,this.currentTarget=null;for(var pe in f)f.hasOwnProperty(pe)&&(E=f[pe],this[pe]=E?E(H):H[pe]);return this.isDefaultPrevented=(H.defaultPrevented!=null?H.defaultPrevented:H.returnValue===!1)?Pi:Iv,this.isPropagationStopped=Iv,this}return z(p.prototype,{preventDefault:function(){this.defaultPrevented=!0;var E=this.nativeEvent;E&&(E.preventDefault?E.preventDefault():typeof E.returnValue!="unknown"&&(E.returnValue=!1),this.isDefaultPrevented=Pi)},stopPropagation:function(){var E=this.nativeEvent;E&&(E.stopPropagation?E.stopPropagation():typeof E.cancelBubble!="unknown"&&(E.cancelBubble=!0),this.isPropagationStopped=Pi)},persist:function(){},isPersistent:Pi}),p}var ac={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(f){return f.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pm=zi(ac),Nu=z({},ac,{view:0,detail:0}),Lb=zi(Nu),Ci,Dv,fi,gm=z({},Nu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zv,button:0,buttons:0,relatedTarget:function(f){return f.relatedTarget===void 0?f.fromElement===f.srcElement?f.toElement:f.fromElement:f.relatedTarget},movementX:function(f){return"movementX"in f?f.movementX:(f!==fi&&(fi&&f.type==="mousemove"?(Ci=f.screenX-fi.screenX,Dv=f.screenY-fi.screenY):Dv=Ci=0,fi=f),Ci)},movementY:function(f){return"movementY"in f?f.movementY:Dv}}),Lv=zi(gm),ll=z({},gm,{dataTransfer:0}),vm=zi(ll),Fv=z({},Nu,{relatedTarget:0}),zn=zi(Fv),cl=z({},ac,{animationName:0,elapsedTime:0,pseudoElement:0}),$v=zi(cl),u2=z({},ac,{clipboardData:function(f){return"clipboardData"in f?f.clipboardData:window.clipboardData}}),qv=zi(u2),d2=z({},ac,{data:0}),Fb=zi(d2),f2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$b={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Su(f){var p=this.nativeEvent;return p.getModifierState?p.getModifierState(f):(f=xm[f])?!!p[f]:!1}function zv(){return Su}var qb=z({},Nu,{key:function(f){if(f.key){var p=f2[f.key]||f.key;if(p!=="Unidentified")return p}return f.type==="keypress"?(f=_u(f),f===13?"Enter":String.fromCharCode(f)):f.type==="keydown"||f.type==="keyup"?$b[f.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zv,charCode:function(f){return f.type==="keypress"?_u(f):0},keyCode:function(f){return f.type==="keydown"||f.type==="keyup"?f.keyCode:0},which:function(f){return f.type==="keypress"?_u(f):f.type==="keydown"||f.type==="keyup"?f.keyCode:0}}),zb=zi(qb),Bv=z({},gm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ym=zi(Bv),Bb=z({},Nu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zv}),h2=zi(Bb),Uv=z({},ac,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vv=zi(Uv),m2=z({},gm,{deltaX:function(f){return"deltaX"in f?f.deltaX:"wheelDeltaX"in f?-f.wheelDeltaX:0},deltaY:function(f){return"deltaY"in f?f.deltaY:"wheelDeltaY"in f?-f.wheelDeltaY:"wheelDelta"in f?-f.wheelDelta:0},deltaZ:0,deltaMode:0}),Ub=zi(m2),ss=[9,13,27,32],cf=l&&"CompositionEvent"in window,mo=null;l&&"documentMode"in document&&(mo=document.documentMode);var Vb=l&&"TextEvent"in window&&!mo,Wv=l&&(!cf||mo&&8<mo&&11>=mo),Wb=" ",Hb=!1;function Kb(f,p){switch(f){case"keyup":return ss.indexOf(p.keyCode)!==-1;case"keydown":return p.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gb(f){return f=f.detail,typeof f=="object"&&"data"in f?f.data:null}var ku=!1;function Eu(f,p){switch(f){case"compositionend":return Gb(p);case"keypress":return p.which!==32?null:(Hb=!0,Wb);case"textInput":return f=p.data,f===Wb&&Hb?null:f;default:return null}}function p2(f,p){if(ku)return f==="compositionend"||!cf&&Kb(f,p)?(f=Mv(),ka=lf=Qn=null,ku=!1,f):null;switch(f){case"paste":return null;case"keypress":if(!(p.ctrlKey||p.altKey||p.metaKey)||p.ctrlKey&&p.altKey){if(p.char&&1<p.char.length)return p.char;if(p.which)return String.fromCharCode(p.which)}return null;case"compositionend":return Wv&&p.locale!=="ko"?null:p.data;default:return null}}var g2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function bm(f){var p=f&&f.nodeName&&f.nodeName.toLowerCase();return p==="input"?!!g2[f.type]:p==="textarea"}function Hv(f,p,E,T){Vt(T),p=Cm(p,"onChange"),0<p.length&&(E=new pm("onChange","change",null,E,T),f.push({event:E,listeners:p}))}var Es=null,ul=null;function v2(f){tw(f,0)}function wm(f){var p=Gt(f);if(he(p))return f}function x2(f,p){if(f==="change")return p}var oc=!1;if(l){var as;if(l){var jm="oninput"in document;if(!jm){var Qb=document.createElement("div");Qb.setAttribute("oninput","return;"),jm=typeof Qb.oninput=="function"}as=jm}else as=!1;oc=as&&(!document.documentMode||9<document.documentMode)}function Yb(){Es&&(Es.detachEvent("onpropertychange",Xb),ul=Es=null)}function Xb(f){if(f.propertyName==="value"&&wm(ul)){var p=[];Hv(p,ul,f,Ss(f)),jr(v2,p)}}function y2(f,p,E){f==="focusin"?(Yb(),Es=p,ul=E,Es.attachEvent("onpropertychange",Xb)):f==="focusout"&&Yb()}function b2(f){if(f==="selectionchange"||f==="keyup"||f==="keydown")return wm(ul)}function Pu(f,p){if(f==="click")return wm(p)}function Ne(f,p){if(f==="input"||f==="change")return wm(p)}function Le(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var Te=typeof Object.is=="function"?Object.is:Le;function ut(f,p){if(Te(f,p))return!0;if(typeof f!="object"||f===null||typeof p!="object"||p===null)return!1;var E=Object.keys(f),T=Object.keys(p);if(E.length!==T.length)return!1;for(T=0;T<E.length;T++){var q=E[T];if(!c.call(p,q)||!Te(f[q],p[q]))return!1}return!0}function Bt(f){for(;f&&f.firstChild;)f=f.firstChild;return f}function jn(f,p){var E=Bt(f);f=0;for(var T;E;){if(E.nodeType===3){if(T=f+E.textContent.length,f<=p&&T>=p)return{node:E,offset:p-f};f=T}e:{for(;E;){if(E.nextSibling){E=E.nextSibling;break e}E=E.parentNode}E=void 0}E=Bt(E)}}function _r(f,p){return f&&p?f===p?!0:f&&f.nodeType===3?!1:p&&p.nodeType===3?_r(f,p.parentNode):"contains"in f?f.contains(p):f.compareDocumentPosition?!!(f.compareDocumentPosition(p)&16):!1:!1}function Rn(){for(var f=window,p=De();p instanceof f.HTMLIFrameElement;){try{var E=typeof p.contentWindow.location.href=="string"}catch{E=!1}if(E)f=p.contentWindow;else break;p=De(f.document)}return p}function uf(f){var p=f&&f.nodeName&&f.nodeName.toLowerCase();return p&&(p==="input"&&(f.type==="text"||f.type==="search"||f.type==="tel"||f.type==="url"||f.type==="password")||p==="textarea"||f.contentEditable==="true")}function w2(f){var p=Rn(),E=f.focusedElem,T=f.selectionRange;if(p!==E&&E&&E.ownerDocument&&_r(E.ownerDocument.documentElement,E)){if(T!==null&&uf(E)){if(p=T.start,f=T.end,f===void 0&&(f=p),"selectionStart"in E)E.selectionStart=p,E.selectionEnd=Math.min(f,E.value.length);else if(f=(p=E.ownerDocument||document)&&p.defaultView||window,f.getSelection){f=f.getSelection();var q=E.textContent.length,H=Math.min(T.start,q);T=T.end===void 0?H:Math.min(T.end,q),!f.extend&&H>T&&(q=T,T=H,H=q),q=jn(E,H);var ie=jn(E,T);q&&ie&&(f.rangeCount!==1||f.anchorNode!==q.node||f.anchorOffset!==q.offset||f.focusNode!==ie.node||f.focusOffset!==ie.offset)&&(p=p.createRange(),p.setStart(q.node,q.offset),f.removeAllRanges(),H>T?(f.addRange(p),f.extend(ie.node,ie.offset)):(p.setEnd(ie.node,ie.offset),f.addRange(p)))}}for(p=[],f=E;f=f.parentNode;)f.nodeType===1&&p.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<p.length;E++)f=p[E],f.element.scrollLeft=f.left,f.element.scrollTop=f.top}}var Ps=l&&"documentMode"in document&&11>=document.documentMode,po=null,Kv=null,Ea=null,Cu=!1;function df(f,p,E){var T=E.window===E?E.document:E.nodeType===9?E:E.ownerDocument;Cu||po==null||po!==De(T)||(T=po,"selectionStart"in T&&uf(T)?T={start:T.selectionStart,end:T.selectionEnd}:(T=(T.ownerDocument&&T.ownerDocument.defaultView||window).getSelection(),T={anchorNode:T.anchorNode,anchorOffset:T.anchorOffset,focusNode:T.focusNode,focusOffset:T.focusOffset}),Ea&&ut(Ea,T)||(Ea=T,T=Cm(Kv,"onSelect"),0<T.length&&(p=new pm("onSelect","select",null,p,E),f.push({event:p,listeners:T}),p.target=po)))}function _n(f,p){var E={};return E[f.toLowerCase()]=p.toLowerCase(),E["Webkit"+f]="webkit"+p,E["Moz"+f]="moz"+p,E}var Au={animationend:_n("Animation","AnimationEnd"),animationiteration:_n("Animation","AnimationIteration"),animationstart:_n("Animation","AnimationStart"),transitionend:_n("Transition","TransitionEnd")},_m={},ff={};l&&(ff=document.createElement("div").style,"AnimationEvent"in window||(delete Au.animationend.animation,delete Au.animationiteration.animation,delete Au.animationstart.animation),"TransitionEvent"in window||delete Au.transitionend.transition);function Nm(f){if(_m[f])return _m[f];if(!Au[f])return f;var p=Au[f],E;for(E in p)if(p.hasOwnProperty(E)&&E in ff)return _m[f]=p[E];return f}var Zb=Nm("animationend"),Jb=Nm("animationiteration"),hf=Nm("animationstart"),go=Nm("transitionend"),mf=new Map,Gv="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Xs(f,p){mf.set(f,p),a(p,[f])}for(var Sm=0;Sm<Gv.length;Sm++){var km=Gv[Sm],Em=km.toLowerCase(),ew=km[0].toUpperCase()+km.slice(1);Xs(Em,"on"+ew)}Xs(Zb,"onAnimationEnd"),Xs(Jb,"onAnimationIteration"),Xs(hf,"onAnimationStart"),Xs("dblclick","onDoubleClick"),Xs("focusin","onFocus"),Xs("focusout","onBlur"),Xs(go,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focu
37sin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),lc=new Set("cancel close invalid load scroll toggle".split(" ").concat(vo));function pf(f,p,E){var T=f.type||"unknown-event";f.currentTarget=E,JN(T,p,void 0,f),f.currentTarget=null}function tw(f,p){p=(p&4)!==0;for(var E=0;E<f.length;E++){var T=f[E],q=T.event;T=T.listeners;e:{var H=void 0;if(p)for(var ie=T.length-1;0<=ie;ie--){var pe=T[ie],ye=pe.instance,Re=pe.currentTarget;if(pe=pe.listener,ye!==H&&q.isPropagationStopped())break e;pf(q,pe,Re),H=ye}else for(ie=0;ie<T.length;ie++){if(pe=T[ie],ye=pe.instance,Re=pe.currentTarget,pe=pe.listener,ye!==H&&q.isPropagationStopped())break e;pf(q,pe,Re),H=ye}}}if(ef)throw f=Sv,ef=!1,Sv=null,f}function Vn(f,p){var E=p[Tm];E===void 0&&(E=p[Tm]=new Set);var T=f+"__bubble";E.has(T)||(Pm(p,f,2,!1),E.add(T))}function Qv(f,p,E){var T=0;p&&(T|=4),Pm(E,f,T,p)}var cc="_reactListening"+Math.random().toString(36).slice(2);function dl(f){if(!f[cc]){f[cc]=!0,r.forEach(function(E){E!=="selectionchange"&&(lc.has(E)||Qv(E,!1,f),Qv(E,!0,f))});var p=f.nodeType===9?f:f.ownerDocument;p===null||p[cc]||(p[cc]=!0,Qv("selectionchange",!1,p))}}function Pm(f,p,E,T){switch(Db(p)){case 1:var q=l2;break;case 4:q=c2;break;default:q=Rv}E=q.bind(null,p,E,f),q=void 0,!Na||p!=="touchstart"&&p!=="touchmove"&&p!=="wheel"||(q=!0),T?q!==void 0?f.addEventListener(p,E,{capture:!0,passive:q}):f.addEventListener(p,E,!0):q!==void 0?f.addEventListener(p,E,{passive:q}):f.addEventListener(p,E,!1)}function Yv(f,p,E,T,q){var H=T;if((p&1)===0&&(p&2)===0&&T!==null)e:for(;;){if(T===null)return;var ie=T.tag;if(ie===3||ie===4){var pe=T.stateNode.containerInfo;if(pe===q||pe.nodeType===8&&pe.parentNode===q)break;if(ie===4)for(ie=T.return;ie!==null;){var ye=ie.tag;if((ye===3||ye===4)&&(ye=ie.stateNode.containerInfo,ye===q||ye.nodeType===8&&ye.parentNode===q))return;ie=ie.return}for(;pe!==null;){if(ie=Ca(pe),ie===null)return;if(ye=ie.tag,ye===5||ye===6){T=H=ie;continue e}pe=pe.parentNode}}T=T.return}jr(function(){var Re=H,Ge=Ss(E),Ye=[];e:{var Ke=mf.get(f);if(Ke!==void 0){var dt=pm,gt=f;switch(f){case"keypress":if(_u(E)===0)break e;case"keydown":case"keyup":dt=zb;break;case"focusin":gt="focus",dt=zn;break;case"focusout":gt="blur",dt=zn;break;case"beforeblur":case"afterblur":dt=zn;break;case"click":if(E.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":dt=Lv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":dt=vm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":dt=h2;break;case Zb:case Jb:case hf:dt=$v;break;case go:dt=Vv;break;case"scroll":dt=Lb;break;case"wheel":dt=Ub;break;case"copy":case"cut":case"paste":dt=qv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":dt=ym}var xt=(p&4)!==0,mr=!xt&&f==="scroll",Ce=xt?Ke!==null?Ke+"Capture":null:Ke;xt=[];for(var we=Re,Oe;we!==null;){Oe=we;var Je=Oe.stateNode;if(Oe.tag===5&&Je!==null&&(Oe=Je,Ce!==null&&(Je=$r(we,Ce),Je!=null&&xt.push(Ou(we,Je,Oe)))),mr)break;we=we.return}0<xt.length&&(Ke=new dt(Ke,gt,null,E,Ge),Ye.push({event:Ke,listeners:xt}))}}if((p&7)===0){e:{if(Ke=f==="mouseover"||f==="pointerover",dt=f==="mouseout"||f==="pointerout",Ke&&E!==tc&&(gt=E.relatedTarget||E.fromElement)&&(Ca(gt)||gt[os]))break e;if((dt||Ke)&&(Ke=Ge.window===Ge?Ge:(Ke=Ge.ownerDocument)?Ke.defaultView||Ke.parentWindow:window,dt?(gt=E.relatedTarget||E.toElement,dt=Re,gt=gt?Ca(gt):null,gt!==null&&(mr=nc(gt),gt!==mr||gt.tag!==5&&gt.tag!==6)&&(gt=null)):(dt=null,gt=
vendor: 8,430 bytes, lines 37-38
37Re),dt!==gt)){if(xt=Lv,Je="onMouseLeave",Ce="onMouseEnter",we="mouse",(f==="pointerout"||f==="pointerover")&&(xt=ym,Je="onPointerLeave",Ce="onPointerEnter",we="pointer"),mr=dt==null?Ke:Gt(dt),Oe=gt==null?Ke:Gt(gt),Ke=new xt(Je,we+"leave",dt,E,Ge),Ke.target=mr,Ke.relatedTarget=Oe,Je=null,Ca(Ge)===Re&&(xt=new xt(Ce,we+"enter",gt,E,Ge),xt.target=Oe,xt.relatedTarget=mr,Je=xt),mr=Je,dt&&gt)t:{for(xt=dt,Ce=gt,we=0,Oe=xt;Oe;Oe=Tu(Oe))we++;for(Oe=0,Je=Ce;Je;Je=Tu(Je))Oe++;for(;0<we-Oe;)xt=Tu(xt),we--;for(;0<Oe-we;)Ce=Tu(Ce),Oe--;for(;we--;){if(xt===Ce||Ce!==null&&xt===Ce.alternate)break t;xt=Tu(xt),Ce=Tu(Ce)}xt=null}else xt=null;dt!==null&&Nr(Ye,Ke,dt,xt,!1),gt!==null&&mr!==null&&Nr(Ye,mr,gt,xt,!0)}}e:{if(Ke=Re?Gt(Re):window,dt=Ke.nodeName&&Ke.nodeName.toLowerCase(),dt==="select"||dt==="input"&&Ke.type==="file")var jt=x2;else if(bm(Ke))if(oc)jt=Ne;else{jt=b2;var Ct=y2}else(dt=Ke.nodeName)&&dt.toLowerCase()==="input"&&(Ke.type==="checkbox"||Ke.type==="radio")&&(jt=Pu);if(jt&&(jt=jt(f,Re))){Hv(Ye,jt,E,Ge);break e}Ct&&Ct(f,Ke,Re),f==="focusout"&&(Ct=Ke._wrapperState)&&Ct.controlled&&Ke.type==="number"&&Ae(Ke,"number",Ke.value)}switch(Ct=Re?Gt(Re):window,f){case"focusin":(bm(Ct)||Ct.contentEditable==="true")&&(po=Ct,Kv=Re,Ea=null);break;case"focusout":Ea=Kv=po=null;break;case"mousedown":Cu=!0;break;case"contextmenu":case"mouseup":case"dragend":Cu=!1,df(Ye,E,Ge);break;case"selectionchange":if(Ps)break;case"keydown":case"keyup":df(Ye,E,Ge)}var St;if(cf)e:{switch(f){case"compositionstart":var Rt="onCompositionStart";break e;case"compositionend":Rt="onCompositionEnd";break e;case"compositionupdate":Rt="onCompositionUpdate";break e}Rt=void 0}else ku?Kb(f,E)&&(Rt="onCompositionEnd"):f==="keydown"&&E.keyCode===229&&(Rt="onCompositionStart");Rt&&(Wv&&E.locale!=="ko"&&(ku||Rt!=="onCompositionStart"?Rt==="onCompositionEnd"&&ku&&(St=Mv()):(Qn=Ge,lf="value"in Qn?Qn.value:Qn.textContent,ku=!0)),Ct=Cm(Re,Rt),0<Ct.length&&(Rt=new Fb(Rt,f,null,E,Ge),Ye.push({event:Rt,listeners:Ct}),St?Rt.data=St:(St=Gb(E),St!==null&&(Rt.data=St)))),(St=Vb?Eu(f,E):p2(f,E))&&(Re=Cm(Re,"onBeforeInput"),0<Re.length&&(Ge=new Fb("onBeforeInput","beforeinput",null,E,Ge),Ye.push({event:Ge,listeners:Re}),Ge.data=St))}tw(Ye,p)})}function Ou(f,p,E){return{instance:f,listener:p,currentTarget:E}}function Cm(f,p){for(var E=p+"Capture",T=[];f!==null;){var q=f,H=q.stateNode;q.tag===5&&H!==null&&(q=H,H=$r(f,E),H!=null&&T.unshift(Ou(f,H,q)),H=$r(f,p),H!=null&&T.push(Ou(f,H,q))),f=f.return}return T}function Tu(f){if(f===null)return null;do f=f.return;while(f&&f.tag!==5);return f||null}function Nr(f,p,E,T,q){for(var H=p._reactName,ie=[];E!==null&&E!==T;){var pe=E,ye=pe.alternate,Re=pe.stateNode;if(ye!==null&&ye===T)break;pe.tag===5&&Re!==null&&(pe=Re,q?(ye=$r(E,H),ye!=null&&ie.unshift(Ou(E,ye,pe))):q||(ye=$r(E,H),ye!=null&&ie.push(Ou(E,ye,pe)))),E=E.return}ie.length!==0&&f.push({event:p,listeners:ie})}var hi=/\r\n?/g,j2=/\u0000|\uFFFD/g;function nw(f){return(typeof f=="string"?f:""+f).replace(hi,`
38`).replace(j2,"")}function gf(f,p,E){if(p=nw(p),nw(f)!==p&&E)throw Error(n(425))}function Am(){}var vf=null,uc=null;function xf(f,p){return f==="textarea"||f==="noscript"||typeof p.children=="string"||typeof p.children=="number"||typeof p.dangerouslySetInnerHTML=="object"&&p.dangerouslySetInnerHTML!==null&&p.dangerouslySetInnerHTML.__html!=null}var fl=typeof setTimeout=="function"?setTimeout:void 0,yf=typeof clearTimeout=="function"?clearTimeout:void 0,Ru=typeof Promise=="function"?Promise:void 0,Om=typeof queueMicrotask=="function"?queueMicrotask:typeof Ru<"u"?function(f){return Ru.resolve(null).then(f).catch(Mu)}:fl;function Mu(f){setTimeout(function(){throw f})}function Xv(f,p){var E=p,T=0;do{var q=E.nextSibling;if(f.removeChild(E),q&&q.nodeType===8)if(E=q.data,E==="/$"){if(T===0){f.removeChild(q),Pn(p);return}T--}else E!=="$"&&E!=="$?"&&E!=="$!"||T++;E=q}while(E);Pn(p)}function hl(f){for(;f!=null;f=f.nextSibling){var p=f.nodeType;if(p===1||p===3)break;if(p===8){if(p=f.data,p==="$"||p==="$!"||p==="$?")break;if(p==="/$")return null}}return f}function rw(f){f=f.previousSibling;for(var p=0;f;){if(f.nodeType===8){var E=f.data;if(E==="$"||E==="$!"||E==="$?"){if(p===0)return f;p--}else E==="/$"&&p++}f=f.previousSibling}return null}var Iu=Math.random().toString(36).slice(2),Pa="__reactFiber$"+Iu,ml="__reactProps$"+Iu,os="__reactContainer$"+Iu,Tm="__reactEvents$"+Iu,oe="__reactListeners$"+Iu,Du="__reactHandles$"+Iu;function Ca(f){var p=f[Pa];if(p)return p;for(var E=f.parentNode;E;){if(p=E[os]||E[Pa]){if(E=p.alternate,p.child!==null||E!==null&&E.child!==null)for(f=rw(f);f!==null;){if(E=f[Pa])return E;f=rw(f)}return p}f=E,E=f.parentNode}return null}function mi(f){return f=f[Pa]||f[os],!f||f.tag!==5&&f.tag!==6&&f.tag!==13&&f.tag!==3?null:f}function Gt(f){if(f.tag===5||f.tag===6)return f.stateNode;throw Error(n(33))}function Rm(f){return f[ml]||null}var Zv=[],Lu=-1;function Bi(f){return{current:f}}function Wn(f){0>Lu||(f.current=Zv[Lu],Zv[Lu]=null,Lu--)}function Bn(f,p){Lu++,Zv[Lu]=f.current,f.current=p}var pl={},pi=Bi(pl),Ui=Bi(!1),Ai=pl;function Fu(f,p){var E=f.type.contextTypes;if(!E)return pl;var T=f.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===p)return T.__reactInternalMemoizedMaskedChildContext;var q={},H;for(H in E)q[H]=p[H];return T&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=p,f.__reactInternalMemoizedMaskedChildContext=q),q}function Vi(f){return f=f.childContextTypes,f!=null}function Mm(){Wn(Ui),Wn(pi)}function iw(f,p,E){if(pi.current!==pl)throw Error(n(168));Bn(pi,p),Bn(Ui,E)}function sw(f,p,E){var T=f.stateNode;if(p=p.childContextTypes,typeof T.getChildContext!="function")return E;T=T.getChildContext();for(var q in T)if(!(q in p))throw Error(n(108,ee(f)||"Unknown",q));return z({},E,T)}function Cs(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||pl,Ai=pi.current,Bn(pi,f),Bn(Ui,Ui.current),!0}function aw(f,p,E){var T=f.stateNode;if(!T)throw Error(n(169));E?(f=sw(f,p,Ai),T.__reactInternalMemoizedMergedChildContext=f,Wn(Ui),Wn(pi),Bn(pi,f)):Wn(Ui),Bn(Ui,E)}var xo=null,Im=!1,Jv=!1;function ow(f){xo===null?xo=[f]:xo.push(f)}function dc(f){Im=!0,ow(f)}function gl(){if(!Jv&&xo!==null){Jv=!0;var f=0,p=kn;try{var E=xo;for(kn=1;f<E.length;f++){var T=E[f];do T=T(!0);while(T!==null)}xo=null,Im=!1}catch(q){throw xo!==null&&(xo=xo.slice(f+1)),_b(Ev,gl),q}finally{kn=p,Jv=!1}}return null}var $u=[],gi=0,Dm=null,Lm=0,As=[],Os=0,fc=null,Aa=1,Oa="";function hc(f,p){$u[gi++]=Lm,$u[gi++]=Dm,Dm=f,Lm=p}function lw(f,p,E){As[Os++]=Aa,As[Os++]=Oa,As[Os++]=fc,fc=f;var T=Aa;f=Oa;var q=32-Ys(T)-1;T&=~(1<<q),E+=1;var H=32-Ys(p)+q;if(30<H){var ie=q-q%5;H=(T&(1<<ie)-1).toString(32),T>>=ie,q-=ie,Aa=1<<32-Ys(p)+q|E<<q|T,Oa=H+f}else Aa=1<<H|E<<q|T,Oa=f}function bf(f){f.return!==null&&(hc(f,1),lw(f,1,0))}function mc(f){for(;f===Dm;)Dm=$u[--gi],$u[gi]=null,Lm=$u[--gi],$u[gi]=null;for(;f===fc;)fc=As[--Os],As[Os]=null,Oa=As[--Os],As[Os]=null,Aa=As[--Os],As[Os]=null}var vi=null,ls=null,Hn=!1,Zs=null;function Ta(f,p){var E=Fs(5,null,null,0);E.elementType="DELETED",E.stateNode=p,E.return=f,p=f.deletions,p===null?(f.deletions=[E],f.flags|=16):p.push(E)}function Fm(f,p){switch(f.tag){case 5:var E=f.type;return p=p.nodeType!==1||E.toLowerCase()!==p.nodeName.toLowerCase()?null:p,p!==null?(f.stateNode=p,vi=f,ls=hl(p.firstChild),!0):!1;case 6:return p=f.pendingProps===""||p.nodeType!==3?null:p,p!==null?(f.stateNode=p,vi=f,ls=null,!0):!1;case 13:return p=p.nodeType!==8?null:p,p!==null?(E=fc!==null?{id:Aa,overflow:Oa}:null,f.memoizedState={dehydrated:p,treeContext:E,retryLane:1073741824},E=Fs(18,null,null,0),E.stateNode=p,E.return=f,f.child=E,vi=f,ls=null,!0):!1;default:return!1}}function yo(f){return(f.mode&1)!==0&&(f.flags&128)===0}function Wi(f){if(Hn){var p=ls;if(p){var E=p;if(!Fm(f,p)){if(yo(f))throw Error(n(418));p=hl(E.nextSibling);var T=vi;p&&Fm(f,p)?Ta(T,E):(f.flags=f.flags&-4097|2,Hn=!1,vi=f)}}else{if(yo(f))throw Error(n(418));f.flags=f.flags&-4097|2,Hn=!1,vi=f}}}function cw(f){for(f=f.return;f!==null&&f.tag!==5&&f.tag!==3&&f.tag!==13;)f=f.return;vi=f}function wf(f){if(f!==vi)return!1;if(!Hn)return cw(f),Hn=!0,!1;var p;if((p=f.tag!==3)&&!(p=f.tag!==5)&&(p=f.type,p=p!=="head"&&p!=="body"&&!xf(f.type,f.memoizedProps)),p&&(p=ls)){if(yo(f))throw ex(),Error(n(418));for(;p;)Ta(f,p),p=hl(p.nextSibling)}if(cw(f),f.tag===13){if(f=f.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(n(317));e:{for(f=f.nextSibling,p=0;f;
vendor: 6,352 bytes, line 38
38){if(f.nodeType===8){var E=f.data;if(E==="/$"){if(p===0){ls=hl(f.nextSibling);break e}p--}else E!=="$"&&E!=="$!"&&E!=="$?"||p++}f=f.nextSibling}ls=null}}else ls=vi?hl(f.stateNode.nextSibling):null;return!0}function ex(){for(var f=ls;f;)f=hl(f.nextSibling)}function Ra(){ls=vi=null,Hn=!1}function Ma(f){Zs===null?Zs=[f]:Zs.push(f)}var uw=j.ReactCurrentBatchConfig;function jf(f,p,E){if(f=E.ref,f!==null&&typeof f!="function"&&typeof f!="object"){if(E._owner){if(E=E._owner,E){if(E.tag!==1)throw Error(n(309));var T=E.stateNode}if(!T)throw Error(n(147,f));var q=T,H=""+f;return p!==null&&p.ref!==null&&typeof p.ref=="function"&&p.ref._stringRef===H?p.ref:(p=function(ie){var pe=q.refs;ie===null?delete pe[H]:pe[H]=ie},p._stringRef=H,p)}if(typeof f!="string")throw Error(n(284));if(!E._owner)throw Error(n(290,f))}return f}function pc(f,p){throw f=Object.prototype.toString.call(p),Error(n(31,f==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":f))}function dw(f){var p=f._init;return p(f._payload)}function tx(f){function p(Ce,we){if(f){var Oe=Ce.deletions;Oe===null?(Ce.deletions=[we],Ce.flags|=16):Oe.push(we)}}function E(Ce,we){if(!f)return null;for(;we!==null;)p(Ce,we),we=we.sibling;return null}function T(Ce,we){for(Ce=new Map;we!==null;)we.key!==null?Ce.set(we.key,we):Ce.set(we.index,we),we=we.sibling;return Ce}function q(Ce,we){return Ce=sa(Ce,we),Ce.index=0,Ce.sibling=null,Ce}function H(Ce,we,Oe){return Ce.index=Oe,f?(Oe=Ce.alternate,Oe!==null?(Oe=Oe.index,Oe<we?(Ce.flags|=2,we):Oe):(Ce.flags|=2,we)):(Ce.flags|=1048576,we)}function ie(Ce){return f&&Ce.alternate===null&&(Ce.flags|=2),Ce}function pe(Ce,we,Oe,Je){return we===null||we.tag!==6?(we=zx(Oe,Ce.mode,Je),we.return=Ce,we):(we=q(we,Oe),we.return=Ce,we)}function ye(Ce,we,Oe,Je){var jt=Oe.type;return jt===P?Ge(Ce,we,Oe.props.children,Je,Oe.key):we!==null&&(we.elementType===jt||typeof jt=="object"&&jt!==null&&jt.$$typeof===G&&dw(jt)===we.type)?(Je=q(we,Oe.props),Je.ref=jf(Ce,we,Oe),Je.return=Ce,Je):(Je=yp(Oe.type,Oe.key,Oe.props,null,Ce.mode,Je),Je.ref=jf(Ce,we,Oe),Je.return=Ce,Je)}function Re(Ce,we,Oe,Je){return we===null||we.tag!==4||we.stateNode.containerInfo!==Oe.containerInfo||we.stateNode.implementation!==Oe.implementation?(we=Bx(Oe,Ce.mode,Je),we.return=Ce,we):(we=q(we,Oe.children||[]),we.return=Ce,we)}function Ge(Ce,we,Oe,Je,jt){return we===null||we.tag!==7?(we=kc(Oe,Ce.mode,Je,jt),we.return=Ce,we):(we=q(we,Oe),we.return=Ce,we)}function Ye(Ce,we,Oe){if(typeof we=="string"&&we!==""||typeof we=="number")return we=zx(""+we,Ce.mode,Oe),we.return=Ce,we;if(typeof we=="object"&&we!==null){switch(we.$$typeof){case S:return Oe=yp(we.type,we.key,we.props,null,Ce.mode,Oe),Oe.ref=jf(Ce,null,we),Oe.return=Ce,Oe;case C:return we=Bx(we,Ce.mode,Oe),we.return=Ce,we;case G:var Je=we._init;return Ye(Ce,Je(we._payload),Oe)}if(Be(we)||V(we))return we=kc(we,Ce.mode,Oe,null),we.return=Ce,we;pc(Ce,we)}return null}function Ke(Ce,we,Oe,Je){var jt=we!==null?we.key:null;if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number")return jt!==null?null:pe(Ce,we,""+Oe,Je);if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case S:return Oe.key===jt?ye(Ce,we,Oe,Je):null;case C:return Oe.key===jt?Re(Ce,we,Oe,Je):null;case G:return jt=Oe._init,Ke(Ce,we,jt(Oe._payload),Je)}if(Be(Oe)||V(Oe))return jt!==null?null:Ge(Ce,we,Oe,Je,null);pc(Ce,Oe)}return null}function dt(Ce,we,Oe,Je,jt){if(typeof Je=="string"&&Je!==""||typeof Je=="number")return Ce=Ce.get(Oe)||null,pe(we,Ce,""+Je,jt);if(typeof Je=="object"&&Je!==null){switch(Je.$$typeof){case S:return Ce=Ce.get(Je.key===null?Oe:Je.key)||null,ye(we,Ce,Je,jt);case C:return Ce=Ce.get(Je.key===null?Oe:Je.key)||null,Re(we,Ce,Je,jt);case G:var Ct=Je._init;return dt(Ce,we,Oe,Ct(Je._payload),jt)}if(Be(Je)||V(Je))return Ce=Ce.get(Oe)||null,Ge(we,Ce,Je,jt,null);pc(we,Je)}return null}function gt(Ce,we,Oe,Je){for(var jt=null,Ct=null,St=we,Rt=we=0,Br=null;St!==null&&Rt<Oe.length;Rt++){St.index>Rt?(Br=St,St=null):Br=St.sibling;var Nn=Ke(Ce,St,Oe[Rt],Je);if(Nn===null){St===null&&(St=Br);break}f&&St&&Nn.alternate===null&&p(Ce,St),we=H(Nn,we,Rt),Ct===null?jt=Nn:Ct.sibling=Nn,Ct=Nn,St=Br}if(Rt===Oe.length)return E(Ce,St),Hn&&hc(Ce,Rt),jt;if(St===null){for(;Rt<Oe.length;Rt++)St=Ye(Ce,Oe[Rt],Je),St!==null&&(we=H(St,we,Rt),Ct===null?jt=St:Ct.sibling=St,Ct=St);return Hn&&hc(Ce,Rt),jt}for(St=T(Ce,St);Rt<Oe.length;Rt++)Br=dt(St,Ce,Rt,Oe[Rt],Je),Br!==null&&(f&&Br.alternate!==null&&St.delete(Br.key===null?Rt:Br.key),we=H(Br,we,Rt),Ct===null?jt=Br:Ct.sibling=Br,Ct=Br);return f&&St.forEach(function(Pl){return p(Ce,Pl)}),Hn&&hc(Ce,Rt),jt}function xt(Ce,we,Oe,Je){var jt=V(Oe);if(typeof jt!="function")throw Error(n(150));if(Oe=jt.call(Oe),Oe==null)throw Error(n(151));for(var Ct=jt=null,St=we,Rt=we=0,Br=null,Nn=Oe.next();St!==null&&!Nn.done;Rt++,Nn=Oe.next()){St.index>Rt?(Br=St,St=null):Br=St.sibling;var Pl=Ke(Ce,St,Nn.value,Je);if(Pl===null){St===null&&(St=Br);break}f&&St&&Pl.alternate===null&&p(Ce,St),we=H(Pl,we,Rt),Ct===null?jt=Pl:Ct.sibling=Pl,Ct=Pl,St=Br}if(Nn.done)return E(Ce,St),Hn&&hc(Ce,Rt),jt;if(St===null){for(;!Nn.done;Rt++,Nn=Oe.next())Nn=Ye(Ce,Nn.value,Je),Nn!==null&&(we=H(Nn,we,Rt),Ct===null?jt=Nn:Ct.sibling=Nn,Ct=Nn);return Hn&&hc(Ce,Rt),jt}for(St=T(Ce,St);!Nn.done;Rt++,Nn=Oe.next())Nn=dt(St,Ce,Rt,Nn.value,Je),Nn!==null&&(f&&Nn.alternate!==null&&St.delete(Nn.key===null?Rt:Nn.key),we=H(Nn,we,Rt),Ct===null?jt=Nn:Ct.sibling=Nn,Ct=Nn);return f&&St.forEach(function(U2){return p(Ce,U2)}),Hn&&hc(Ce,Rt),jt}function mr(Ce,we,Oe,Je){if(typeof Oe=="object"&&Oe!==null&&Oe.type===P&&Oe.key===null&&(Oe=Oe.props.children),typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case S:e:{for(var jt=Oe.key,Ct=we;Ct!==null;){if(Ct.key===jt){if(jt=Oe.type,jt===P){if(Ct.tag===7){E(Ce,Ct.sibling),we=q(Ct,Oe.props.children),we.return=Ce,Ce=we;break e}}else if(Ct.elementType===jt||typeof jt=="object"&&jt!==null&&jt.$$typeof===G&&dw(jt)===Ct.type){E(Ce,Ct.sibling),we=q(Ct,Oe.props),we.ref=jf(Ce,Ct,Oe),we.return=Ce,Ce=we;break e}E(Ce,Ct);break}else p(Ce,Ct);Ct=Ct.sibling}Oe.type===P?(we=kc(Oe.props.children,Ce.mode,Je,Oe.key),we.return=Ce,Ce=we):(Je=yp(Oe.type,Oe.key,Oe.props,null,Ce.mode,Je),Je.ref=jf(Ce,we,Oe),Je.return=Ce,Ce=Je)}return ie(Ce);case C:e:{for(Ct=Oe.key;we!==null;){if(we.key===Ct)if(we.tag===4&&we.stateNode.containerInfo===Oe.containerInfo&&we.stateNode.implementation===Oe.implementation){
vendor: 7,113 bytes, line 38
38E(Ce,we.sibling),we=q(we,Oe.children||[]),we.return=Ce,Ce=we;break e}else{E(Ce,we);break}else p(Ce,we);we=we.sibling}we=Bx(Oe,Ce.mode,Je),we.return=Ce,Ce=we}return ie(Ce);case G:return Ct=Oe._init,mr(Ce,we,Ct(Oe._payload),Je)}if(Be(Oe))return gt(Ce,we,Oe,Je);if(V(Oe))return xt(Ce,we,Oe,Je);pc(Ce,Oe)}return typeof Oe=="string"&&Oe!==""||typeof Oe=="number"?(Oe=""+Oe,we!==null&&we.tag===6?(E(Ce,we.sibling),we=q(we,Oe),we.return=Ce,Ce=we):(E(Ce,we),we=zx(Oe,Ce.mode,Je),we.return=Ce,Ce=we),ie(Ce)):E(Ce,we)}return mr}var cr=tx(!0),$m=tx(!1),_f=Bi(null),cs=null,vl=null,qu=null;function bo(){qu=vl=cs=null}function qm(f){var p=_f.current;Wn(_f),f._currentValue=p}function Xr(f,p,E){for(;f!==null;){var T=f.alternate;if((f.childLanes&p)!==p?(f.childLanes|=p,T!==null&&(T.childLanes|=p)):T!==null&&(T.childLanes&p)!==p&&(T.childLanes|=p),f===E)break;f=f.return}}function xl(f,p){cs=f,qu=vl=null,f=f.dependencies,f!==null&&f.firstContext!==null&&((f.lanes&p)!==0&&(Ti=!0),f.firstContext=null)}function Ts(f){var p=f._currentValue;if(qu!==f)if(f={context:f,memoizedValue:p,next:null},vl===null){if(cs===null)throw Error(n(308));vl=f,cs.dependencies={lanes:0,firstContext:f}}else vl=vl.next=f;return p}var gc=null;function nx(f){gc===null?gc=[f]:gc.push(f)}function zm(f,p,E,T){var q=p.interleaved;return q===null?(E.next=E,nx(p)):(E.next=q.next,q.next=E),p.interleaved=E,wo(f,T)}function wo(f,p){f.lanes|=p;var E=f.alternate;for(E!==null&&(E.lanes|=p),E=f,f=f.return;f!==null;)f.childLanes|=p,E=f.alternate,E!==null&&(E.childLanes|=p),E=f,f=f.return;return E.tag===3?E.stateNode:null}var Rs=!1;function Bm(f){f.updateQueue={baseState:f.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fw(f,p){f=f.updateQueue,p.updateQueue===f&&(p.updateQueue={baseState:f.baseState,firstBaseUpdate:f.firstBaseUpdate,lastBaseUpdate:f.lastBaseUpdate,shared:f.shared,effects:f.effects})}function jo(f,p){return{eventTime:f,lane:p,tag:0,payload:null,callback:null,next:null}}function Ms(f,p,E){var T=f.updateQueue;if(T===null)return null;if(T=T.shared,(xn&2)!==0){var q=T.pending;return q===null?p.next=p:(p.next=q.next,q.next=p),T.pending=p,wo(f,E)}return q=T.interleaved,q===null?(p.next=p,nx(T)):(p.next=q.next,q.next=p),T.interleaved=p,wo(f,E)}function Um(f,p,E){if(p=p.updateQueue,p!==null&&(p=p.shared,(E&4194240)!==0)){var T=p.lanes;T&=f.pendingLanes,E|=T,p.lanes=E,sf(f,E)}}function hw(f,p){var E=f.updateQueue,T=f.alternate;if(T!==null&&(T=T.updateQueue,E===T)){var q=null,H=null;if(E=E.firstBaseUpdate,E!==null){do{var ie={eventTime:E.eventTime,lane:E.lane,tag:E.tag,payload:E.payload,callback:E.callback,next:null};H===null?q=H=ie:H=H.next=ie,E=E.next}while(E!==null);H===null?q=H=p:H=H.next=p}else q=H=p;E={baseState:T.baseState,firstBaseUpdate:q,lastBaseUpdate:H,shared:T.shared,effects:T.effects},f.updateQueue=E;return}f=E.lastBaseUpdate,f===null?E.firstBaseUpdate=p:f.next=p,E.lastBaseUpdate=p}function zu(f,p,E,T){var q=f.updateQueue;Rs=!1;var H=q.firstBaseUpdate,ie=q.lastBaseUpdate,pe=q.shared.pending;if(pe!==null){q.shared.pending=null;var ye=pe,Re=ye.next;ye.next=null,ie===null?H=Re:ie.next=Re,ie=ye;var Ge=f.alternate;Ge!==null&&(Ge=Ge.updateQueue,pe=Ge.lastBaseUpdate,pe!==ie&&(pe===null?Ge.firstBaseUpdate=Re:pe.next=Re,Ge.lastBaseUpdate=ye))}if(H!==null){var Ye=q.baseState;ie=0,Ge=Re=ye=null,pe=H;do{var Ke=pe.lane,dt=pe.eventTime;if((T&Ke)===Ke){Ge!==null&&(Ge=Ge.next={eventTime:dt,lane:0,tag:pe.tag,payload:pe.payload,callback:pe.callback,next:null});e:{var gt=f,xt=pe;switch(Ke=p,dt=E,xt.tag){case 1:if(gt=xt.payload,typeof gt=="function"){Ye=gt.call(dt,Ye,Ke);break e}Ye=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=xt.payload,Ke=typeof gt=="function"?gt.call(dt,Ye,Ke):gt,Ke==null)break e;Ye=z({},Ye,Ke);break e;case 2:Rs=!0}}pe.callback!==null&&pe.lane!==0&&(f.flags|=64,Ke=q.effects,Ke===null?q.effects=[pe]:Ke.push(pe))}else dt={eventTime:dt,lane:Ke,tag:pe.tag,payload:pe.payload,callback:pe.callback,next:null},Ge===null?(Re=Ge=dt,ye=Ye):Ge=Ge.next=dt,ie|=Ke;if(pe=pe.next,pe===null){if(pe=q.shared.pending,pe===null)break;Ke=pe,pe=Ke.next,Ke.next=null,q.lastBaseUpdate=Ke,q.shared.pending=null}}while(!0);if(Ge===null&&(ye=Ye),q.baseState=ye,q.firstBaseUpdate=Re,q.lastBaseUpdate=Ge,p=q.shared.interleaved,p!==null){q=p;do ie|=q.lane,q=q.next;while(q!==p)}else H===null&&(q.shared.lanes=0);_l|=ie,f.lanes=ie,f.memoizedState=Ye}}function rx(f,p,E){if(f=p.effects,p.effects=null,f!==null)for(p=0;p<f.length;p++){var T=f[p],q=T.callback;if(q!==null){if(T.callback=null,T=E,typeof q!="function")throw Error(n(191,q));q.call(T)}}}var Nf={},Ia=Bi(Nf),Sf=Bi(Nf),Bu=Bi(Nf);function _o(f){if(f===Nf)throw Error(n(174));return f}function ix(f,p){switch(Bn(Bu,p),Bn(Sf,f),Bn(Ia,Nf),f=p.nodeType,f){case 9:case 11:p=(p=p.documentElement)?p.namespaceURI:wn(null,"");break;default:f=f===8?p.parentNode:p,p=f.namespaceURI||null,f=f.tagName,p=wn(p,f)}Wn(Ia),Bn(Ia,p)}function yl(){Wn(Ia),Wn(Sf),Wn(Bu)}function sx(f){_o(Bu.current);var p=_o(Ia.current),E=wn(p,f.type);p!==E&&(Bn(Sf,f),Bn(Ia,E))}function Vm(f){Sf.current===f&&(Wn(Ia),Wn(Sf))}var Yn=Bi(0);function vc(f){for(var p=f;p!==null;){if(p.tag===13){var E=p.memoizedState;if(E!==null&&(E=E.dehydrated,E===null||E.data==="$?"||E.data==="$!"))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if((p.flags&128)!==0)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===f)break;for(;p.sibling===null;){if(p.return===null||p.return===f)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var ax=[];function Wm(){for(var f=0;f<ax.length;f++)ax[f]._workInProgressVersionPrimary=null;ax.length=0}var kf=j.ReactCurrentDispatcher,ox=j.ReactCurrentBatchConfig,bl=0,sr=null,hr=null,Or=null,Uu=!1,Ef=!1,xc=0,tn=0;function xi(){throw Error(n(321))}function lx(f,p){if(p===null)return!1;for(var E=0;E<p.length&&E<f.length;E++)if(!Te(f[E],p[E]))return!1;return!0}function yc(f,p,E,T,q,H){if(bl=H,sr=p,p.memoizedState=null,p.updateQueue=null,p.lanes=0,kf.current=f===null||f.memoizedState===null?N2:Zm,f=E(T,q),Ef){H=0;do{if(Ef=!1,xc=0,25<=H)throw Error(n(301));H+=1,Or=hr=null,p.updateQueue=null,kf.current=Ku,f=E(T,q)}while(Ef)}if(kf.current=Xm,p=hr!==null&&hr.next!==null,bl=0,Or=hr=sr=null,Uu=!1,p)throw Error(n(300));return f}function Hm(){var f=xc!==0;return xc=0,f}function Da(){var f={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Or===null?sr.memoizedState=Or=f:Or=Or.next=f,Or}function Is(){if(hr===null){var f=sr.alternate;f=f!==null?f.memoizedState:null}else f=hr.next;var p=Or===null?sr.memoizedState:Or.next;if(p!==null)Or=p,hr=f;else{if(f===null)throw Error(n(310));hr=f,f={memoizedState:hr.memoizedState,baseState:hr.baseState,baseQueue:hr.baseQueue,queue:hr.queue,next:null},Or===null?sr.memoizedState=Or=f:Or=Or.next=f}return Or}function yi(f,p){return typeof p=="function"?p(f):p}function cx(f){var p=Is(),E=p.queue;if(E===null)throw Error(n(311));E.lastRenderedReducer=f;var T=hr,q=T.baseQueue,H=E.pending;if(H!==null){if(q!==null){var ie=q.next;q.next=H.next,H.next=ie}
vendor: 4,629 bytes, line 38
38T.baseQueue=q=H,E.pending=null}if(q!==null){H=q.next,T=T.baseState;var pe=ie=null,ye=null,Re=H;do{var Ge=Re.lane;if((bl&Ge)===Ge)ye!==null&&(ye=ye.next={lane:0,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null}),T=Re.hasEagerState?Re.eagerState:f(T,Re.action);else{var Ye={lane:Ge,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null};ye===null?(pe=ye=Ye,ie=T):ye=ye.next=Ye,sr.lanes|=Ge,_l|=Ge}Re=Re.next}while(Re!==null&&Re!==H);ye===null?ie=T:ye.next=pe,Te(T,p.memoizedState)||(Ti=!0),p.memoizedState=T,p.baseState=ie,p.baseQueue=ye,E.lastRenderedState=T}if(f=E.interleaved,f!==null){q=f;do H=q.lane,sr.lanes|=H,_l|=H,q=q.next;while(q!==f)}else q===null&&(E.lanes=0);return[p.memoizedState,E.dispatch]}function Vu(f){var p=Is(),E=p.queue;if(E===null)throw Error(n(311));E.lastRenderedReducer=f;var T=E.dispatch,q=E.pending,H=p.memoizedState;if(q!==null){E.pending=null;var ie=q=q.next;do H=f(H,ie.action),ie=ie.next;while(ie!==q);Te(H,p.memoizedState)||(Ti=!0),p.memoizedState=H,p.baseQueue===null&&(p.baseState=H),E.lastRenderedState=H}return[H,T]}function Km(){}function ux(f,p){var E=sr,T=Is(),q=p(),H=!Te(T.memoizedState,q);if(H&&(T.memoizedState=q,Ti=!0),T=T.queue,La(No.bind(null,E,T,f),[f]),T.getSnapshot!==p||H||Or!==null&&Or.memoizedState.tag&1){if(E.flags|=2048,Wu(9,Hi.bind(null,E,T,q,p),void 0,null),zr===null)throw Error(n(349));(bl&30)!==0||dx(E,p,q)}return q}function dx(f,p,E){f.flags|=16384,f={getSnapshot:p,value:E},p=sr.updateQueue,p===null?(p={lastEffect:null,stores:null},sr.updateQueue=p,p.stores=[f]):(E=p.stores,E===null?p.stores=[f]:E.push(f))}function Hi(f,p,E,T){p.value=E,p.getSnapshot=T,Gm(p)&&fx(f)}function No(f,p,E){return E(function(){Gm(p)&&fx(f)})}function Gm(f){var p=f.getSnapshot;f=f.value;try{var E=p();return!Te(f,E)}catch{return!0}}function fx(f){var p=wo(f,1);p!==null&&ia(p,f,1,-1)}function Pf(f){var p=Da();return typeof f=="function"&&(f=f()),p.memoizedState=p.baseState=f,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yi,lastRenderedState:f},p.queue=f,f=f.dispatch=yw.bind(null,sr,f),[p.memoizedState,f]}function Wu(f,p,E,T){return f={tag:f,create:p,destroy:E,deps:T,next:null},p=sr.updateQueue,p===null?(p={lastEffect:null,stores:null},sr.updateQueue=p,p.lastEffect=f.next=f):(E=p.lastEffect,E===null?p.lastEffect=f.next=f:(T=E.next,E.next=f,f.next=T,p.lastEffect=f)),f}function Qm(){return Is().memoizedState}function Cf(f,p,E,T){var q=Da();sr.flags|=f,q.memoizedState=Wu(1|p,E,void 0,T===void 0?null:T)}function Hu(f,p,E,T){var q=Is();T=T===void 0?null:T;var H=void 0;if(hr!==null){var ie=hr.memoizedState;if(H=ie.destroy,T!==null&&lx(T,ie.deps)){q.memoizedState=Wu(p,E,H,T);return}}sr.flags|=f,q.memoizedState=Wu(1|p,E,H,T)}function Ym(f,p){return Cf(8390656,8,f,p)}function La(f,p){return Hu(2048,8,f,p)}function mw(f,p){return Hu(4,2,f,p)}function So(f,p){return Hu(4,4,f,p)}function hx(f,p){if(typeof p=="function")return f=f(),p(f),function(){p(null)};if(p!=null)return f=f(),p.current=f,function(){p.current=null}}function mx(f,p,E){return E=E!=null?E.concat([f]):null,Hu(4,4,hx.bind(null,p,f),E)}function Af(){}function pw(f,p){var E=Is();p=p===void 0?null:p;var T=E.memoizedState;return T!==null&&p!==null&&lx(p,T[1])?T[0]:(E.memoizedState=[f,p],f)}function gw(f,p){var E=Is();p=p===void 0?null:p;var T=E.memoizedState;return T!==null&&p!==null&&lx(p,T[1])?T[0]:(f=f(),E.memoizedState=[f,p],f)}function vw(f,p,E){return(bl&21)===0?(f.baseState&&(f.baseState=!1,Ti=!0),f.memoizedState=E):(Te(E,p)||(E=Cv(),sr.lanes|=E,_l|=E,f.baseState=!0),p)}function xw(f,p){var E=kn;kn=E!==0&&4>E?E:4,f(!0);var T=ox.transition;ox.transition={};try{f(!1),p()}finally{kn=E,ox.transition=T}}function px(){return Is().memoizedState}function _2(f,p,E){var T=kl(f);if(E={lane:T,action:E,hasEagerState:!1,eagerState:null,next:null},gx(f))Oi(p,E);else if(E=zm(f,p,E,T),E!==null){var q=Ii();ia(E,f,T,q),Js(E,p,T)}}function yw(f,p,E){var T=kl(f),q={lane:T,action:E,hasEagerState:!1,eagerState:null,next:null};if(gx(f))Oi(p,q);else{var H=f.alternate;if(f.lanes===0&&(H===null||H.lanes===0)&&(H=p.lastRenderedReducer,H!==null))try{var ie=p.lastRenderedState,pe=H(ie,E);if(q.hasEagerState=!0,q.eagerState=pe,Te(pe,ie)){var ye=p.interleaved;ye===null?(q.next=q,nx(p)):(q.next=ye.next,ye.next=q),p.interleaved=q;return}}catch{}finally{}E=zm(f,p,q,T),E!==null&&(q=Ii(),ia(E,f,T,q),Js(E,p,T))}}function gx(f){var p=f.alternate;return f===sr||p!==null&&p===sr}function Oi(f,p){Ef=Uu=!0;var E=f.pending;E===null?p.next=p:(p.next=E.next,E.next=p),f.pending=p}function Js(f,p,E){if((E&4194240)!==0){var T=p.lanes;
vendor: 8,500 bytes, lines 38-40
38T&=f.pendingLanes,E|=T,p.lanes=E,sf(f,E)}}var Xm={readContext:Ts,useCallback:xi,useContext:xi,useEffect:xi,useImperativeHandle:xi,useInsertionEffect:xi,useLayoutEffect:xi,useMemo:xi,useReducer:xi,useRef:xi,useState:xi,useDebugValue:xi,useDeferredValue:xi,useTransition:xi,useMutableSource:xi,useSyncExternalStore:xi,useId:xi,unstable_isNewReconciler:!1},N2={readContext:Ts,useCallback:function(f,p){return Da().memoizedState=[f,p===void 0?null:p],f},useContext:Ts,useEffect:Ym,useImperativeHandle:function(f,p,E){return E=E!=null?E.concat([f]):null,Cf(4194308,4,hx.bind(null,p,f),E)},useLayoutEffect:function(f,p){return Cf(4194308,4,f,p)},useInsertionEffect:function(f,p){return Cf(4,2,f,p)},useMemo:function(f,p){var E=Da();return p=p===void 0?null:p,f=f(),E.memoizedState=[f,p],f},useReducer:function(f,p,E){var T=Da();return p=E!==void 0?E(p):p,T.memoizedState=T.baseState=p,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:p},T.queue=f,f=f.dispatch=_2.bind(null,sr,f),[T.memoizedState,f]},useRef:function(f){var p=Da();return f={current:f},p.memoizedState=f},useState:Pf,useDebugValue:Af,useDeferredValue:function(f){return Da().memoizedState=f},useTransition:function(){var f=Pf(!1),p=f[0];return f=xw.bind(null,f[1]),Da().memoizedState=f,[p,f]},useMutableSource:function(){},useSyncExternalStore:function(f,p,E){var T=sr,q=Da();if(Hn){if(E===void 0)throw Error(n(407));E=E()}else{if(E=p(),zr===null)throw Error(n(349));(bl&30)!==0||dx(T,p,E)}q.memoizedState=E;var H={value:E,getSnapshot:p};return q.queue=H,Ym(No.bind(null,T,H,f),[f]),T.flags|=2048,Wu(9,Hi.bind(null,T,H,E,p),void 0,null),E},useId:function(){var f=Da(),p=zr.identifierPrefix;if(Hn){var E=Oa,T=Aa;E=(T&~(1<<32-Ys(T)-1)).toString(32)+E,p=":"+p+"R"+E,E=xc++,0<E&&(p+="H"+E.toString(32)),p+=":"}else E=tn++,p=":"+p+"r"+E.toString(32)+":";return f.memoizedState=p},unstable_isNewReconciler:!1},Zm={readContext:Ts,useCallback:pw,useContext:Ts,useEffect:La,useImperativeHandle:mx,useInsertionEffect:mw,useLayoutEffect:So,useMemo:gw,useReducer:cx,useRef:Qm,useState:function(){return cx(yi)},useDebugValue:Af,useDeferredValue:function(f){var p=Is();return vw(p,hr.memoizedState,f)},useTransition:function(){var f=cx(yi)[0],p=Is().memoizedState;return[f,p]},useMutableSource:Km,useSyncExternalStore:ux,useId:px,unstable_isNewReconciler:!1},Ku={readContext:Ts,useCallback:pw,useContext:Ts,useEffect:La,useImperativeHandle:mx,useInsertionEffect:mw,useLayoutEffect:So,useMemo:gw,useReducer:Vu,useRef:Qm,useState:function(){return Vu(yi)},useDebugValue:Af,useDeferredValue:function(f){var p=Is();return hr===null?p.memoizedState=f:vw(p,hr.memoizedState,f)},useTransition:function(){var f=Vu(yi)[0],p=Is().memoizedState;return[f,p]},useMutableSource:Km,useSyncExternalStore:ux,useId:px,unstable_isNewReconciler:!1};function Ds(f,p){if(f&&f.defaultProps){p=z({},p),f=f.defaultProps;for(var E in f)p[E]===void 0&&(p[E]=f[E]);return p}return p}function Jm(f,p,E,T){p=f.memoizedState,E=E(T,p),E=E==null?p:z({},p,E),f.memoizedState=E,f.lanes===0&&(f.updateQueue.baseState=E)}var ep={isMounted:function(f){return(f=f._reactInternals)?nc(f)===f:!1},enqueueSetState:function(f,p,E){f=f._reactInternals;var T=Ii(),q=kl(f),H=jo(T,q);H.payload=p,E!=null&&(H.callback=E),p=Ms(f,H,q),p!==null&&(ia(p,f,q,T),Um(p,f,q))},enqueueReplaceState:function(f,p,E){f=f._reactInternals;var T=Ii(),q=kl(f),H=jo(T,q);H.tag=1,H.payload=p,E!=null&&(H.callback=E),p=Ms(f,H,q),p!==null&&(ia(p,f,q,T),Um(p,f,q))},enqueueForceUpdate:function(f,p){f=f._reactInternals;var E=Ii(),T=kl(f),q=jo(E,T);q.tag=2,p!=null&&(q.callback=p),p=Ms(f,q,T),p!==null&&(ia(p,f,T,E),Um(p,f,T))}};function vx(f,p,E,T,q,H,ie){return f=f.stateNode,typeof f.shouldComponentUpdate=="function"?f.shouldComponentUpdate(T,H,ie):p.prototype&&p.prototype.isPureReactComponent?!ut(E,T)||!ut(q,H):!0}function bc(f,p,E){var T=!1,q=pl,H=p.contextType;return typeof H=="object"&&H!==null?H=Ts(H):(q=Vi(p)?Ai:pi.current,T=p.contextTypes,H=(T=T!=null)?Fu(f,q):pl),p=new p(E,H),f.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=ep,f.stateNode=p,p._reactInternals=f,T&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=q,f.__reactInternalMemoizedMaskedChildContext=H),p}function Gu(f,p,E,T){f=p.state,typeof p.componentWillReceiveProps=="function"&&p.componentWillReceiveProps(E,T),typeof p.UNSAFE_componentWillReceiveProps=="function"&&p.UNSAFE_componentWillReceiveProps(E,T),p.state!==f&&ep.enqueueReplaceState(p,p.state,null)}function xx(f,p,E,T){var q=f.stateNode;q.props=E,q.state=f.memoizedState,q.refs={},Bm(f);var H=p.contextType;typeof H=="object"&&H!==null?q.context=Ts(H):(H=Vi(p)?Ai:pi.current,q.context=Fu(f,H)),q.state=f.memoizedState,H=p.getDerivedStateFromProps,typeof H=="function"&&(Jm(f,p,H,E),q.state=f.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof q.getSnapshotBeforeUpdate=="function"||typeof q.UNSAFE_componentWillMount!="function"&&typeof q.componentWillMount!="function"||(p=q.state,typeof q.componentWillMount=="function"&&q.componentWillMount(),typeof q.UNSAFE_componentWillMount=="function"&&q.UNSAFE_componentWillMount(),p!==q.state&&ep.enqueueReplaceState(q,q.state,null),zu(f,E,q,T),q.state=f.memoizedState),typeof q.componentDidMount=="function"&&(f.flags|=4194308)}function wc(f,p){try{var E="",T=p;do E+=ne(T),T=T.return;while(T);var q=E}catch(H){q=`
39Error generating stack: `+H.message+`
40`+H.stack}return{value:f,source:p,stack:q,digest:null}}function tp(f,p,E){return{value:f,source:null,stack:E??null,digest:p??null}}function Qu(f,p){try{console.error(p.value)}catch(E){setTimeout(function(){throw E})}}var bw=typeof WeakMap=="function"?WeakMap:Map;function Of(f,p,E){E=jo(-1,E),E.tag=3,E.payload={element:null};var T=p.value;return E.callback=function(){fp||(fp=!0,Mx=T),Qu(f,p)},E}function np(f,p,E){E=jo(-1,E),E.tag=3;var T=f.type.getDerivedStateFromError;if(typeof T=="function"){var q=p.value;E.payload=function(){return T(q)},E.callback=function(){Qu(f,p)}}var H=f.stateNode;return H!==null&&typeof H.componentDidCatch=="function"&&(E.callback=function(){Qu(f,p),typeof T!="function"&&(Nl===null?Nl=new Set([this]):Nl.add(this));var ie=p.stack;this.componentDidCatch(p.value,{componentStack:ie!==null?ie:""})}),E}function Tf(f,p,E){var T=f.pingCache;if(T===null){T=f.pingCache=new bw;var q=new Set;T.set(p,q)}else q=T.get(p),q===void 0&&(q=new Set,T.set(p,q));q.has(E)||(q.add(E),f=T2.bind(null,f,p,E),p.then(f,f))}function ww(f){do{var p;if((p=f.tag===13)&&(p=f.memoizedState,p=p!==null?p.dehydrated!==null:!0),p)return f;f=f.return}while(f!==null);return null}function yx(f,p,E,T,q){return(f.mode&1)===0?(f===p?f.flags|=65536:(f.flags|=128,E.flags|=131072,E.flags&=-52805,E.tag===1&&(E.alternate===null?E.tag=17:(p=jo(-1,1),p.tag=2,Ms(E,p,1))),E.lanes|=1),f):(f.flags|=65536,f.lanes=q,f)}var rp=j.ReactCurrentOwner,Ti=!1;function Zr(f,p,E,T){p.child=f===null?$m(p,null,E,T):cr(p,f.child,E,T)}function jw(f,p,E,T,q){E=E.render;var H=p.ref;return xl(p,q),T=yc(f,p,E,T,H,q),E=Hm(),f!==null&&!Ti?(p.updateQueue=f.updateQueue,p.flags&=-2053,f.lanes&=~q,ea(f,p,q)):(Hn&&E&&bf(p),p.flags|=1,Zr(f,p,T,q),p.child)}function bx(f,p,E,T,q){if(f===null){var H=E.type;return typeof H=="function"&&!xp(H)&&H.defaultProps===void 0&&E.compare===null&&E.defaultProps===void 0?(p.tag=15,p.type=H,Fa(f,p,H,T,q)):(f=yp(E.type,null,T,p,p.mode,q),f.ref=p.ref,f.return=p,p.child=f)}if(H=f.child,(f.lanes&q)===0){var ie=H.memoizedProps;if(E=E.compare,E=E!==null?E:ut,E(ie,T)&&f.ref===p.ref)return ea(f,p,q)}return p.flags|=1,f=sa(H,T),f.ref=p.ref,f.return=p,p.child=f}function Fa(f,p,E,T,q){if(f!==null){var H=f.memoizedProps;if(ut(H,T)&&f.ref===p.ref)if(Ti=!1,p.pendingProps=T=H,(f.lanes&q)!==0)(f.flags&131072)!==0&&(Ti=!0);else return p.lanes=f.lanes,ea(f,p,q)}return _x(f,p,E,T,q)}function wx(f,p,E){var T=p.pendingProps,q=T.children,H=f!==null?f.memoizedState:null;if(T.mode==="hidden")if((p.mode&1)===0)p.memoizedState={baseLanes:0,cachePool:null,transitions:null},Bn(Ju,ds),ds|=E;else{if((E&1073741824)===0)return f=H!==null?H.baseLanes|E:E,p.lanes=p.childLanes=1073741824,p.memoizedState={baseLanes:f,cachePool:null,transitions:null},p.updateQueue=null,Bn(Ju,ds),ds|=f,null;p.memoizedState={baseLanes:0,cachePool:null,transitions:null},T=H!==null?H.baseLanes:E,Bn(Ju,ds),ds|=T}else H!==null?(T=H.baseLanes|E,p.memoizedState=null):T=E,Bn(Ju,ds),ds|=T;return Zr(f,p,q,E),p.child}function jx(f,p){var E=p.ref;(f===null&&E!==null||f!==null&&f.ref!==E)&&(p.flags|=512,p.flags|=2097152)}
vendor: 13,981 bytes, line 40
40function _x(f,p,E,T,q){var H=Vi(E)?Ai:pi.current;return H=Fu(p,H),xl(p,q),E=yc(f,p,E,T,H,q),T=Hm(),f!==null&&!Ti?(p.updateQueue=f.updateQueue,p.flags&=-2053,f.lanes&=~q,ea(f,p,q)):(Hn&&T&&bf(p),p.flags|=1,Zr(f,p,E,q),p.child)}function Nx(f,p,E,T,q){if(Vi(E)){var H=!0;Cs(p)}else H=!1;if(xl(p,q),p.stateNode===null)sp(f,p),bc(p,E,T),xx(p,E,T,q),T=!0;else if(f===null){var ie=p.stateNode,pe=p.memoizedProps;ie.props=pe;var ye=ie.context,Re=E.contextType;typeof Re=="object"&&Re!==null?Re=Ts(Re):(Re=Vi(E)?Ai:pi.current,Re=Fu(p,Re));var Ge=E.getDerivedStateFromProps,Ye=typeof Ge=="function"||typeof ie.getSnapshotBeforeUpdate=="function";Ye||typeof ie.UNSAFE_componentWillReceiveProps!="function"&&typeof ie.componentWillReceiveProps!="function"||(pe!==T||ye!==Re)&&Gu(p,ie,T,Re),Rs=!1;var Ke=p.memoizedState;ie.state=Ke,zu(p,T,ie,q),ye=p.memoizedState,pe!==T||Ke!==ye||Ui.current||Rs?(typeof Ge=="function"&&(Jm(p,E,Ge,T),ye=p.memoizedState),(pe=Rs||vx(p,E,pe,T,Ke,ye,Re))?(Ye||typeof ie.UNSAFE_componentWillMount!="function"&&typeof ie.componentWillMount!="function"||(typeof ie.componentWillMount=="function"&&ie.componentWillMount(),typeof ie.UNSAFE_componentWillMount=="function"&&ie.UNSAFE_componentWillMount()),typeof ie.componentDidMount=="function"&&(p.flags|=4194308)):(typeof ie.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=T,p.memoizedState=ye),ie.props=T,ie.state=ye,ie.context=Re,T=pe):(typeof ie.componentDidMount=="function"&&(p.flags|=4194308),T=!1)}else{ie=p.stateNode,fw(f,p),pe=p.memoizedProps,Re=p.type===p.elementType?pe:Ds(p.type,pe),ie.props=Re,Ye=p.pendingProps,Ke=ie.context,ye=E.contextType,typeof ye=="object"&&ye!==null?ye=Ts(ye):(ye=Vi(E)?Ai:pi.current,ye=Fu(p,ye));var dt=E.getDerivedStateFromProps;(Ge=typeof dt=="function"||typeof ie.getSnapshotBeforeUpdate=="function")||typeof ie.UNSAFE_componentWillReceiveProps!="function"&&typeof ie.componentWillReceiveProps!="function"||(pe!==Ye||Ke!==ye)&&Gu(p,ie,T,ye),Rs=!1,Ke=p.memoizedState,ie.state=Ke,zu(p,T,ie,q);var gt=p.memoizedState;pe!==Ye||Ke!==gt||Ui.current||Rs?(typeof dt=="function"&&(Jm(p,E,dt,T),gt=p.memoizedState),(Re=Rs||vx(p,E,Re,T,Ke,gt,ye)||!1)?(Ge||typeof ie.UNSAFE_componentWillUpdate!="function"&&typeof ie.componentWillUpdate!="function"||(typeof ie.componentWillUpdate=="function"&&ie.componentWillUpdate(T,gt,ye),typeof ie.UNSAFE_componentWillUpdate=="function"&&ie.UNSAFE_componentWillUpdate(T,gt,ye)),typeof ie.componentDidUpdate=="function"&&(p.flags|=4),typeof ie.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof ie.componentDidUpdate!="function"||pe===f.memoizedProps&&Ke===f.memoizedState||(p.flags|=4),typeof ie.getSnapshotBeforeUpdate!="function"||pe===f.memoizedProps&&Ke===f.memoizedState||(p.flags|=1024),p.memoizedProps=T,p.memoizedState=gt),ie.props=T,ie.state=gt,ie.context=ye,T=Re):(typeof ie.componentDidUpdate!="function"||pe===f.memoizedProps&&Ke===f.memoizedState||(p.flags|=4),typeof ie.getSnapshotBeforeUpdate!="function"||pe===f.memoizedProps&&Ke===f.memoizedState||(p.flags|=1024),T=!1)}return Sx(f,p,E,T,H,q)}function Sx(f,p,E,T,q,H){jx(f,p);var ie=(p.flags&128)!==0;if(!T&&!ie)return q&&aw(p,E,!1),ea(f,p,H);T=p.stateNode,rp.current=p;var pe=ie&&typeof E.getDerivedStateFromError!="function"?null:T.render();return p.flags|=1,f!==null&&ie?(p.child=cr(p,f.child,null,H),p.child=cr(p,null,pe,H)):Zr(f,p,pe,H),p.memoizedState=T.state,q&&aw(p,E,!0),p.child}function _w(f){var p=f.stateNode;p.pendingContext?iw(f,p.pendingContext,p.pendingContext!==p.context):p.context&&iw(f,p.context,!1),ix(f,p.containerInfo)}function $a(f,p,E,T,q){return Ra(),Ma(q),p.flags|=256,Zr(f,p,E,T),p.child}var Rf={dehydrated:null,treeContext:null,retryLane:0};function Mf(f){return{baseLanes:f,cachePool:null,transitions:null}}function ip(f,p,E){var T=p.pendingProps,q=Yn.current,H=!1,ie=(p.flags&128)!==0,pe;if((pe=ie)||(pe=f!==null&&f.memoizedState===null?!1:(q&2)!==0),pe?(H=!0,p.flags&=-129):(f===null||f.memoizedState!==null)&&(q|=1),Bn(Yn,q&1),f===null)return Wi(p),f=p.memoizedState,f!==null&&(f=f.dehydrated,f!==null)?((p.mode&1)===0?p.lanes=1:f.data==="$!"?p.lanes=8:p.lanes=1073741824,null):(ie=T.children,f=T.fallback,H?(T=p.mode,H=p.child,ie={mode:"hidden",children:ie},(T&1)===0&&H!==null?(H.childLanes=0,H.pendingProps=ie):H=bp(ie,T,0,null),f=kc(f,T,E,null),H.return=p,f.return=p,H.sibling=f,p.child=H,p.child.memoizedState=Mf(E),p.memoizedState=Rf,f):Yu(p,ie));if(q=f.memoizedState,q!==null&&(pe=q.dehydrated,pe!==null))return Ot(f,p,ie,T,pe,q,E);if(H){H=T.fallback,ie=p.mode,q=f.child,pe=q.sibling;var ye={mode:"hidden",children:T.children};return(ie&1)===0&&p.child!==q?(T=p.child,T.childLanes=0,T.pendingProps=ye,p.deletions=null):(T=sa(q,ye),T.subtreeFlags=q.subtreeFlags&14680064),pe!==null?H=sa(pe,H):(H=kc(H,ie,E,null),H.flags|=2),H.return=p,T.return=p,T.sibling=H,p.child=T,T=H,H=p.child,ie=f.child.memoizedState,ie=ie===null?Mf(E):{baseLanes:ie.baseLanes|E,cachePool:null,transitions:ie.transitions},H.memoizedState=ie,H.childLanes=f.childLanes&~E,p.memoizedState=Rf,T}return H=f.child,f=H.sibling,T=sa(H,{mode:"visible",children:T.children}),(p.mode&1)===0&&(T.lanes=E),T.return=p,T.sibling=null,f!==null&&(E=p.deletions,E===null?(p.deletions=[f],p.flags|=16):E.push(f)),p.child=T,p.memoizedState=null,T}function Yu(f,p){return p=bp({mode:"visible",children:p},f.mode,0,null),p.return=f,f.child=p}function ko(f,p,E,T){return T!==null&&Ma(T),cr(p,f.child,null,E),f=Yu(p,p.pendingProps.children),f.flags|=2,p.memoizedState=null,f}function Ot(f,p,E,T,q,H,ie){if(E)return p.flags&256?(p.flags&=-257,T=tp(Error(n(422))),ko(f,p,ie,T)):p.memoizedState!==null?(p.child=f.child,p.flags|=128,null):(H=T.fallback,q=p.mode,T=bp({mode:"visible",children:T.children},q,0,null),H=kc(H,q,ie,null),H.flags|=2,T.return=p,H.return=p,T.sibling=H,p.child=T,(p.mode&1)!==0&&cr(p,f.child,null,ie),p.child.memoizedState=Mf(ie),p.memoizedState=Rf,H);if((p.mode&1)===0)return ko(f,p,ie,null);if(q.data==="$!"){if(T=q.nextSibling&&q.nextSibling.dataset,T)var pe=T.dgst;return T=pe,H=Error(n(419)),T=tp(H,T,void 0),ko(f,p,ie,T)}if(pe=(ie&f.childLanes)!==0,Ti||pe){if(T=zr,T!==null){switch(ie&-ie){case 4:q=2;break;case 16:q=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:q=32;break;case 536870912:q=268435456;break;default:q=0}q=(q&(T.suspendedLanes|ie))!==0?0:q,q!==0&&q!==H.retryLane&&(H.retryLane=q,wo(f,q),ia(T,f,q,-1))}return qx(),T=tp(Error(n(421))),ko(f,p,ie,T)}return q.data==="$?"?(p.flags|=128,p.child=f.child,p=R2.bind(null,f),q._reactRetry=p,null):(f=H.treeContext,ls=hl(q.nextSibling),vi=p,Hn=!0,Zs=null,f!==null&&(As[Os++]=Aa,As[Os++]=Oa,As[Os++]=fc,Aa=f.id,Oa=f.overflow,fc=p),p=Yu(p,T.children),p.flags|=4096,p)}function If(f,p,E){f.lanes|=p;var T=f.alternate;T!==null&&(T.lanes|=p),Xr(f.return,p,E)}function Df(f,p,E,T,q){var H=f.memoizedState;H===null?f.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:T,tail:E,tailMode:q}:(H.isBackwards=p,H.rendering=null,H.renderingStartTime=0,H.last=T,H.tail=E,H.tailMode=q)}function wl(f,p,E){var T=p.pendingProps,q=T.revealOrder,H=T.tail;if(Zr(f,p,T.children,E),T=Yn.current,(T&2)!==0)T=T&1|2,p.flags|=128;else{if(f!==null&&(f.flags&128)!==0)e:for(f=p.child;f!==null;){if(f.tag===13)f.memoizedState!==null&&If(f,E,p);else if(f.tag===19)If(f,E,p);else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===p)break e;for(;f.sibling===null;){if(f.return===null||f.return===p)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}T&=1}if(Bn(Yn,T),(p.mode&1)===0)p.memoizedState=null;else switch(q){case"forwards":for(E=p.child,q=null;E!==null;)f=E.alternate,f!==null&&vc(f)===null&&(q=E),E=E.sibling;E=q,E===null?(q=p.child,p.child=null):(q=E.sibling,E.sibling=null),Df(p,!1,q,E,H);break;case"backwards":for(E=null,q=p.child,p.child=null;q!==null;){if(f=q.alternate,f!==null&&vc(f)===null){p.child=q;break}f=q.sibling,q.sibling=E,E=q,q=f}Df(p,!0,E,null,H);break;case"together":Df(p,!1,null,null,void 0);break;default:p.memoizedState=null}return p.child}function sp(f,p){(p.mode&1)===0&&f!==null&&(f.alternate=null,p.alternate=null,p.flags|=2)}function ea(f,p,E){if(f!==null&&(p.dependencies=f.dependencies),_l|=p.lanes,(E&p.childLanes)===0)return null;if(f!==null&&p.child!==f.child)throw Error(n(153));if(p.child!==null){for(f=p.child,E=sa(f,f.pendingProps),p.child=E,E.return=p;f.sibling!==null;)f=f.sibling,E=E.sibling=sa(f,f.pendingProps),E.return=p;E.sibling=null}return p.child}function Nw(f,p,E){switch(p.tag){case 3:_w(p),Ra();break;case 5:sx(p);break;case 1:Vi(p.type)&&Cs(p);break;case 4:ix(p,p.stateNode.containerInfo);break;case 10:var T=p.type._context,q=p.memoizedProps.value;Bn(_f,T._currentValue),T._currentValue=q;break;case 13:if(T=p.memoizedState,T!==null)return T.dehydrated!==null?(Bn(Yn,Yn.current&1),p.flags|=128,null):(E&p.child.childLanes)!==0?ip(f,p,E):(Bn(Yn,Yn.current&1),f=ea(f,p,E),f!==null?f.sibling:null);Bn(Yn,Yn.current&1);break;case 19:if(T=(E&p.childLanes)!==0,(f.flags&128)!==0){if(T)return wl(f,p,E);p.flags|=128}if(q=p.memoizedState,q!==null&&(q.rendering=null,q.tail=null,q.lastEffect=null),Bn(Yn,Yn.current),T)break;return null;case 22:case 23:return p.lanes=0,wx(f,p,E)}return ea(f,p,E)}var Jr,kx,Sw,Ex;Jr=function(f,p){for(var E=p.child;E!==null;){if(E.tag===5||E.tag===6)f.appendChild(E.stateNode);else if(E.tag!==4&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===p)break;for(;E.sibling===null;){if(E.return===null||E.return===p)return;E=E.return}E.sibling.return=E.return,E=E.sibling}},kx=function(){},Sw=function(f,p,E,T){var q=f.memoizedProps;if(q!==T){f=p.stateNode,_o(Ia.current);var H=null;switch(E){case"input":q=_e(f,q),T=_e(f,T),H=[];break;case"select":q=z({},q,{value:void 0}),T=z({},T,{value:void 0}),H=[];break;case"textarea":q=Pe(f,q),T=Pe(f,T),H=[];break;default:typeof q.onClick!="function"&&typeof T.onClick=="function"&&(f.onclick=Am)}tl(E,T);var ie;E=null;for(Re in q)if(!T.hasOwnProperty(Re)&&q.hasOwnProperty(Re)&&q[Re]!=null)if(Re==="style"){var pe=q[Re];for(ie in pe)pe.hasOwnProperty(ie)&&(E||(E={}),E[ie]="")}else Re!=="dangerouslySetInnerHTML"&&Re!=="children"&&Re!=="suppressContentEditableWarning"&&Re!=="suppressHydrationWarning"&&Re!=="autoFocus"&&(s.hasOwnProperty(Re)?H||(H=[]):(H=H||[]).push(Re,null));for(Re in T){var ye=T[Re];if(pe=q!=null?q[Re]:void 0,T.hasOwnProperty(Re)&&ye!==pe&&(ye!=null||pe!=null))if(Re==="style")if(pe){for(ie in pe)!pe.hasOwnProperty(ie)||ye&&ye.hasOwnProperty(ie)||(E||(E={}),E[ie]="");for(ie in ye)ye.hasOwnProperty(ie)&&pe[ie]!==ye[ie]&&(E||(E={}),E[ie]=ye[ie])}else E||(H||(H=[]),H.push(Re,E)),E=ye;else Re==="dangerouslySetInnerHTML"?(ye=ye?ye.__html:void 0,pe=pe?pe.__html:void 0,ye!=null&&pe!==ye&&(H=H||[]).push(Re,ye)):Re==="children"?typeof ye!="string"&&typeof ye!="number"||(H=H||[]).push(Re,""+ye):Re!=="suppressContentEditableWarning"&&Re!=="suppressHydrationWarning"&&(s.hasOwnProperty(Re)?(ye!=null&&Re==="onScroll"&&Vn("scroll",f),H||pe===ye||(H=[])):(H=H||[]).push(Re,ye))}E&&(H=H||[]).push("style",E);var Re=H;(p.updateQueue=Re)&&(p.flags|=4)}},Ex=function(f,p,E,T){E!==T&&(p.flags|=4)};function Lf(f,p){if(!Hn)switch(f.tailMode){case"hidden":p=f.tail;for(var E=null;p!==null;)p.alternate!==null&&(E=p),p=p.sibling;E===null?f.tail=null:E.sibling=null;break;case"collapsed":E=f.tail;for(var T=null;E!==null;)E.alternate!==null&&(T=E),E=E.sibling;T===null?p||f.tail===null?f.tail=null:f.tail.sibling=null:T.sibling=null}}function ei(f){var p=f.alternate!==null&&f.alternate.child===f.child,E=0,T=0;if(p)for(var q=f.child;q!==null;)E|=q.lanes|q.childLanes,T|=q.subtreeFlags&14680064,T|=q.flags&14680064,q.return=f,q=q.sibling;else for(q=f.child;q!==null;)E|=q.lanes|q.childLanes,T|=q.subtreeFlags,T|=q.flags,q.return=f,q=q.sibling;return f.subtreeFlags|=T,f.childLanes=E,p}function S2(f,p,E){var T=p.pendingProps;switch(mc(p),p.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ei(p),null;case 1:return Vi(p.type)&&Mm(),ei(p),null;case 3:return T=p.stateNode,yl(),Wn(Ui),Wn(pi),Wm(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(f===null||f.child===null)&&(wf(p)?p.flags|=4:f===null||f.memoizedState.isDehydrated&&(p.flags&256)===0||(p.flags|=1024,Zs!==null&&(Lx(Zs),Zs=null))),kx(f,p),ei(p),null;case 5:Vm(p);var q=_o(Bu.current);if(E=p.type,f!==null&&p.stateNode!=null)Sw(f,p,E,T,q),f.ref!==p.ref&&(p.flags|=512,p.flags|=2097152);else{if(!T){if(p.stateNode===null)throw Error(n(166));return ei(p),null}if(f=_o(Ia.current),wf(p)){T=p.stateNode,E=p.type;var H=p.memoizedProps;switch(T[Pa]=p,T[ml]=H,f=(p.mode&1)!==0,E){case"dialog":Vn("cancel",T),Vn("close",T);break;case"iframe":case"object":case"embed":Vn("load",T);break;case"video":case"audio":for(q=0;q<vo.length;q++)Vn(vo[q],T);break;case"source":Vn("error",T);break;case"img":case"image":case"link":Vn("error",T),Vn("load",T);break;case"details":Vn("toggle",T);break;case"input":We(T,H),Vn("invalid",T);break;case"select":T._wrapperState={wasMultiple:!!H.multiple},Vn("invalid",T);break;case"textarea":Ze(T,H),Vn("invalid",T)}tl(E,H),q=null;for(var ie in H)if(H.hasOwnProperty(ie)){var pe=H[ie];ie==="children"?typeof pe=="string"?T.textContent!==pe&&(H.suppressHydrationWarning!==!0&&gf(T.textContent,pe,f),q=["children",pe]):typeof pe=="number"&&T.textContent!==""+pe&&(H.suppressHydrationWarning!==!0&&gf(T.textContent,pe,f),q=["children",""+pe]):s.hasOwnProperty(ie)&&pe!=null&&ie==="onScroll"&&Vn("scroll",T)}switch(E){case"input":ge(T),ke(T,H,!0);break;case"textarea":ge(T),pt(T);break;case"select":case"option":break;default:typeof H.onClick=="function"&&(T.onclick=Am)}T=q,p.updateQueue=T,T!==null&&(p.flags|=4)}else{ie=q.nodeType===9?q:q.ownerDocument,f==="http://www.w3.org/1999/xhtml"&&(f=$t(E)),f==="http://www.w3.org/1999/xhtml"?E==="script"?(f=ie.createElement("div"),f.innerHTML="<script><\/script>
40",f=f.removeChild(f.firstChild)):typeof T.is=="string"?f=ie.createElement(E,{is:T.is}):(f=ie.createElement(E),E==="select"&&(ie=f,T.multiple?ie.multiple=!0:T.size&&(ie.size=T.size))):f=ie.createElementNS(f,E),f[Pa]=p,f[ml]=T,Jr(f,p,!1,!1),p.stateNode=f;e:{switch(ie=ec(E,T),E){case"dialog":Vn("cancel",f),Vn("close",f),q=T;break;case"iframe":case"object":case"embed":Vn("load",f),q=T;break;case"video":case"audio":for(q=0;q<vo.length;q++)Vn(vo[q],f);q=T;break;case"source":Vn("error",f),q=T;break;case"img":case"image":case"link":Vn("error",f),Vn("load",f),q=T;break;case"details":Vn("toggle",f),q=T;break;case"input":We(f,T),q=_e(f,T),Vn("invalid",f);break;case"option":q=T;break;case"select":f._wrapperState={wasMultiple:!!T.multiple},q=z({},T,{value:void 0}),Vn("invalid",f);break;case"textarea":Ze(f,T),q=Pe(f,T),Vn("invalid",f);break;default:q=T}tl(E,q),pe=q;for(H in pe)if(pe.hasOwnProperty(H)){var ye=pe[H];H==="style"?vu(f,ye):H==="dangerouslySetInnerHTML"?(ye=ye?ye.__html:void 0,ye!=null&&is(f,ye)):H==="children"?typeof ye=="string"?(E!=="textarea"||ye!=="")&&on(f,ye):typeof ye=="number"&&on(f,""+ye):H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&H!=="autoFocus"&&(s.hasOwnProperty(H)?ye!=null&&H==="onScroll"&&Vn("scroll",f):ye!=null&&N(f,H,ye,ie))}switch(E){case"input":ge(f),ke(f,T,!1);break;case"textarea":ge(f),pt(f);break;case"option":T.value!=null&&f.setAttribute("value",""+le(T.value));break;case"select":f.multiple=!!T.multiple,H=T.value,H!=null?de(f,!!T.multiple,H,!1):T.defaultValue!=null&&de(f,!!T.multiple,T.defaultValue,!0);break;default:typeof q.onClick=="function"&&(f.onclick=Am)}switch(E){case"button":case"input":case"select":case"textarea":T=!!T.autoFocus;break e;case"img":T=!0;break e;default:T=!1}}T&&(p.flags|=4)}p.ref!==null&&(p.flags|=512,p.flags|=2097152)}return ei(p),null;case 6:if(f&&p.stateNode!=null)Ex(f,p,f.memoizedProps,T);else{if(typeof T!="string"&&p.stateNode===null)throw Error(n(166));if(E=_o(Bu.current),_o(Ia.current),wf(p)){if(T=p.stateNode,E=p.memoizedProps,T[Pa]=p,(H=T.nodeValue!==E)&&(f=vi,f!==null))switch(f.tag){case 3:gf(T.nodeValue,E,(f.mode&1)!==0);break;case 5:f.memoizedProps.suppressHydrationWarning!==!0&&gf(T.nodeValue,E,(f.mode&1)!==0)}H&&(p.flags|=4)}else T=(E.nodeType===9?E:E.ownerDocument).createTextNode(T),T[Pa]=p,p.stateNode=T}return ei(p),null;case 13:if(Wn(Yn),T=p.memoizedState,f===null||f.memoizedState!==null&&f.memoizedState.dehydrated!==null){if(Hn&&ls!==null&&(p.mode&1)!==0&&(p.flags&128)===0)ex(),Ra(),p.flags|=98560,H=!1;else if(H=wf(p),T!==null&&T.dehydrated!==null){if(f===null){if(!H)throw Error(n(318));if(H=p.memoizedState,H=H!==null?H.dehydrated:null,!H)throw Error(n(317));H[Pa]=p}else Ra(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;ei(p),H=!1}else Zs!==null&&(Lx(Zs),Zs=null),H=!0;if(!H)return p.flags&65536?p:null}return(p.flags&128)!==0?(p.lanes=E,p):(T=T!==null,T!==(f!==null&&f.memoizedState!==null)&&T&&(p.child.flags|=8192,(p.mode&1)!==0&&(f===null||(Yn.current&1)!==0?Tr===0&&(Tr=3):qx())),p.updateQueue!==null&&(p.flags|=4),ei(p),null);case 4:return yl(),kx(f,p),f===null&&dl(p.stateNode.containerInfo),ei(p),null;case 10:return qm(p.type._context),ei(p),null;case 17:return Vi(p.type)&&Mm(),ei(p),null;case 19:if(Wn(Yn),H=p.memoizedState,H===null)return ei(p),null;if(T=(p.flags&128)!==0,ie=H.rendering,ie===null)if(T)Lf(H,!1);else{if(Tr!==0||f!==null&&(f.flags&128)!==0)for(f=p.child;f!==null;){if(ie=vc(f),ie!==null){for(p.flags|=128,Lf(H,!1),T=ie.updateQueue,T!==null&&(p.updateQueue=T,p.flags|=4),p.subtreeFlags=0,T=E,E=p.child;E!==null;)H=E,f=T,H.flags&=14680066,ie=H.alternate,ie===null?(H.childLanes=0,H.lanes=f,H.child=null,H.subtreeFlags=0,H.memoizedProps=null,H.memoizedState=null,H.updateQueue=null,H.dependencies=null,H.stateNode=null):(H.childLanes=ie.childLanes,H.lanes=ie.lanes,H.child=ie.child,H.subtreeFlags=0,H.deletions=null,H.memoizedProps=ie.memoizedProps,H.memoizedState=ie.memoizedState,H.updateQueue=ie.updateQueue,H.type=ie.type,f=ie.dependencies,H.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),E=E.sibling;return Bn(Yn,Yn.current&1|2),p.child}f=f.sibling}H.tail!==null&&Gn()>jc&&(p.flags|=128,T=!0,Lf(H,!1),p.lanes=4194304)}else{if(!T)if(f=vc(ie),f!==null){if(p.flags|=128,T=!0,E=f.updateQueue,E!==null&&(p.updateQueue=E,p.flags|=4),Lf(H,!0),H.tail===null&&H.tailMode==="hidden"&&!ie.alternate&&!Hn)return ei(p),null}else 2*Gn()-H.renderingStartTime>jc&&E!==1073741824&&(p.flags|=128,T=!0,Lf(H,!1),p.lanes=4194304);H.isBackwards?(ie.sibling=p.child,p.child=ie):(E=H.last,E!==null?E.sibling=ie:p.child=ie,H.last=ie)}return H.tail!==null?(p=H.tail,H.rendering=p,H.tail=p.sibling,H.renderingStartTime=Gn(),p.sibling=null,E=Yn.current,Bn(Yn,T?E&1|2:E&1),p):(ei(p),null);case 22:case 23:return $x(),T=p.memoizedState!==null,f!==null&&f.memoizedState!==null!==T&&(p.flags|=8192),T&&(p.mode&1)!==0?(ds&1073741824)!==0&&(ei(p),p.subtreeFlags&6&&(p.flags|=8192)):ei(p),null;case 24:return null;case 25:return null}throw Error(n(156,p.tag))}function k2(f,p){switch(mc(p),p.tag){case 1:return Vi(p.type)&&Mm(),f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 3:return yl(),Wn(Ui),Wn(pi),Wm(),f=p.flags,(f&65536)!==0&&(f&128)===0?(p.flags=f&-65537|128,p):null;case 5:return Vm(p),null;case 13:if(Wn(Yn),f=p.memoizedState,f!==null&&f.dehydrated!==null){if(p.alternate===null)throw Error(n(340));Ra()}return f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 19:return Wn(Yn),null;case 4:return yl(),null;case 10:return qm(p.type._context),null;case 22:case 23:return $x(),null;case 24:return null;default:return null}}var ap=!1,Xn=!1,Ri=typeof WeakSet=="function"?WeakSet:Set,mt=null;function Xu(f,p){var E=f.ref;if(E!==null)if(typeof E=="function")try{E(null)}catch(T){ar(f,p,T)}else E.current=null}function Ff(f,p,E){try{E()}catch(T){ar(f,p,T)}}var kw=!1;function E2(f,p){if(vf=fm,f=Rn(),uf(f)){if("selectionStart"in f)var E={start:f.selectionStart,end:f.selectionEnd};else e:{E=(E=f.ownerDocument)&&E.defaultView||window;var T=E.getSelection&&E.getSelection();if(T&&T.rangeCount!==0){E=T.anchorNode;var q=T.anchorOffset,H=T.focusNode;T=T.focusOffset;try{E.nodeType,H.nodeType}catch{E=null;break e}var ie=0,pe=-1,ye=-1,Re=0,Ge=0,Ye=f,Ke=null;t:for(;;){for(var dt;Ye!==E||q!==0&&Ye.nodeType!==3||(pe=ie+q),Ye!==H||T!==0&&Ye.nodeType!==3||(ye=ie+T),Ye.nodeType===3&&(ie+=Ye.nodeValue.length),(dt=Ye.firstChild)!==null;)Ke=Ye,Ye=dt;for(;;){if(Ye===f)break t;if(Ke===E&&++Re===q&&(pe=ie),Ke===H&&++Ge===T&&(ye=ie),(dt=Ye.nextSibling)!==null)break;Ye=Ke,Ke=Ye.parentNode}Ye=dt}E=pe===-1||ye===-1?null:{start:pe,end:ye}}else E=null}E=E||{start:0,end:0}}else E=null;
vendor: 18,818 bytes, line 40
40for(uc={focusedElem:f,selectionRange:E},fm=!1,mt=p;mt!==null;)if(p=mt,f=p.child,(p.subtreeFlags&1028)!==0&&f!==null)f.return=p,mt=f;else for(;mt!==null;){p=mt;try{var gt=p.alternate;if((p.flags&1024)!==0)switch(p.tag){case 0:case 11:case 15:break;case 1:if(gt!==null){var xt=gt.memoizedProps,mr=gt.memoizedState,Ce=p.stateNode,we=Ce.getSnapshotBeforeUpdate(p.elementType===p.type?xt:Ds(p.type,xt),mr);Ce.__reactInternalSnapshotBeforeUpdate=we}break;case 3:var Oe=p.stateNode.containerInfo;Oe.nodeType===1?Oe.textContent="":Oe.nodeType===9&&Oe.documentElement&&Oe.removeChild(Oe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Je){ar(p,p.return,Je)}if(f=p.sibling,f!==null){f.return=p.return,mt=f;break}mt=p.return}return gt=kw,kw=!1,gt}function Eo(f,p,E){var T=p.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var q=T=T.next;do{if((q.tag&f)===f){var H=q.destroy;q.destroy=void 0,H!==void 0&&Ff(p,E,H)}q=q.next}while(q!==T)}}function $f(f,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var E=p=p.next;do{if((E.tag&f)===f){var T=E.create;E.destroy=T()}E=E.next}while(E!==p)}}function op(f){var p=f.ref;if(p!==null){var E=f.stateNode;switch(f.tag){case 5:f=E;break;default:f=E}typeof p=="function"?p(f):p.current=f}}function Ew(f){var p=f.alternate;p!==null&&(f.alternate=null,Ew(p)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(p=f.stateNode,p!==null&&(delete p[Pa],delete p[ml],delete p[Tm],delete p[oe],delete p[Du])),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Pw(f){return f.tag===5||f.tag===3||f.tag===4}function Cw(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Pw(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function Px(f,p,E){var T=f.tag;if(T===5||T===6)f=f.stateNode,p?E.nodeType===8?E.parentNode.insertBefore(f,p):E.insertBefore(f,p):(E.nodeType===8?(p=E.parentNode,p.insertBefore(f,E)):(p=E,p.appendChild(f)),E=E._reactRootContainer,E!=null||p.onclick!==null||(p.onclick=Am));else if(T!==4&&(f=f.child,f!==null))for(Px(f,p,E),f=f.sibling;f!==null;)Px(f,p,E),f=f.sibling}function lp(f,p,E){var T=f.tag;if(T===5||T===6)f=f.stateNode,p?E.insertBefore(f,p):E.appendChild(f);else if(T!==4&&(f=f.child,f!==null))for(lp(f,p,E),f=f.sibling;f!==null;)lp(f,p,E),f=f.sibling}var qr=null,ta=!1;function qa(f,p,E){for(E=E.child;E!==null;)Cx(f,p,E),E=E.sibling}function Cx(f,p,E){if(Sa&&typeof Sa.onCommitFiberUnmount=="function")try{Sa.onCommitFiberUnmount(am,E)}catch{}switch(E.tag){case 5:Xn||Xu(E,p);case 6:var T=qr,q=ta;qr=null,qa(f,p,E),qr=T,ta=q,qr!==null&&(ta?(f=qr,E=E.stateNode,f.nodeType===8?f.parentNode.removeChild(E):f.removeChild(E)):qr.removeChild(E.stateNode));break;case 18:qr!==null&&(ta?(f=qr,E=E.stateNode,f.nodeType===8?Xv(f.parentNode,E):f.nodeType===1&&Xv(f,E),Pn(f)):Xv(qr,E.stateNode));break;case 4:T=qr,q=ta,qr=E.stateNode.containerInfo,ta=!0,qa(f,p,E),qr=T,ta=q;break;case 0:case 11:case 14:case 15:if(!Xn&&(T=E.updateQueue,T!==null&&(T=T.lastEffect,T!==null))){q=T=T.next;do{var H=q,ie=H.destroy;H=H.tag,ie!==void 0&&((H&2)!==0||(H&4)!==0)&&Ff(E,p,ie),q=q.next}while(q!==T)}qa(f,p,E);break;case 1:if(!Xn&&(Xu(E,p),T=E.stateNode,typeof T.componentWillUnmount=="function"))try{T.props=E.memoizedProps,T.state=E.memoizedState,T.componentWillUnmount()}catch(pe){ar(E,p,pe)}qa(f,p,E);break;case 21:qa(f,p,E);break;case 22:E.mode&1?(Xn=(T=Xn)||E.memoizedState!==null,qa(f,p,E),Xn=T):qa(f,p,E);break;default:qa(f,p,E)}}function Zu(f){var p=f.updateQueue;if(p!==null){f.updateQueue=null;var E=f.stateNode;E===null&&(E=f.stateNode=new Ri),p.forEach(function(T){var q=M2.bind(null,f,T);E.has(T)||(E.add(T),T.then(q,q))})}}function us(f,p){var E=p.deletions;if(E!==null)for(var T=0;T<E.length;T++){var q=E[T];try{var H=f,ie=p,pe=ie;e:for(;pe!==null;){switch(pe.tag){case 5:qr=pe.stateNode,ta=!1;break e;case 3:qr=pe.stateNode.containerInfo,ta=!0;break e;case 4:qr=pe.stateNode.containerInfo,ta=!0;break e}pe=pe.return}if(qr===null)throw Error(n(160));Cx(H,ie,q),qr=null,ta=!1;var ye=q.alternate;ye!==null&&(ye.return=null),q.return=null}catch(Re){ar(q,p,Re)}}if(p.subtreeFlags&12854)for(p=p.child;p!==null;)Ax(p,f),p=p.sibling}function Ax(f,p){var E=f.alternate,T=f.flags;switch(f.tag){case 0:case 11:case 14:case 15:if(us(p,f),na(f),T&4){try{Eo(3,f,f.return),$f(3,f)}catch(xt){ar(f,f.return,xt)}try{Eo(5,f,f.return)}catch(xt){ar(f,f.return,xt)}}break;case 1:us(p,f),na(f),T&512&&E!==null&&Xu(E,E.return);break;case 5:if(us(p,f),na(f),T&512&&E!==null&&Xu(E,E.return),f.flags&32){var q=f.stateNode;try{on(q,"")}catch(xt){ar(f,f.return,xt)}}if(T&4&&(q=f.stateNode,q!=null)){var H=f.memoizedProps,ie=E!==null?E.memoizedProps:H,pe=f.type,ye=f.updateQueue;if(f.updateQueue=null,ye!==null)try{pe==="input"&&H.type==="radio"&&H.name!=null&&ze(q,H),ec(pe,ie);var Re=ec(pe,H);for(ie=0;ie<ye.length;ie+=2){var Ge=ye[ie],Ye=ye[ie+1];Ge==="style"?vu(q,Ye):Ge==="dangerouslySetInnerHTML"?is(q,Ye):Ge==="children"?on(q,Ye):N(q,Ge,Ye,Re)}switch(pe){case"input":Xe(q,H);break;case"textarea":ct(q,H);break;case"select":var Ke=q._wrapperState.wasMultiple;q._wrapperState.wasMultiple=!!H.multiple;var dt=H.value;dt!=null?de(q,!!H.multiple,dt,!1):Ke!==!!H.multiple&&(H.defaultValue!=null?de(q,!!H.multiple,H.defaultValue,!0):de(q,!!H.multiple,H.multiple?[]:"",!1))}q[ml]=H}catch(xt){ar(f,f.return,xt)}}break;case 6:if(us(p,f),na(f),T&4){if(f.stateNode===null)throw Error(n(162));q=f.stateNode,H=f.memoizedProps;try{q.nodeValue=H}catch(xt){ar(f,f.return,xt)}}break;case 3:if(us(p,f),na(f),T&4&&E!==null&&E.memoizedState.isDehydrated)try{Pn(p.containerInfo)}catch(xt){ar(f,f.return,xt)}break;case 4:us(p,f),na(f);break;case 13:us(p,f),na(f),q=f.child,q.flags&8192&&(H=q.memoizedState!==null,q.stateNode.isHidden=H,!H||q.alternate!==null&&q.alternate.memoizedState!==null||(Rx=Gn())),T&4&&Zu(f);break;case 22:if(Ge=E!==null&&E.memoizedState!==null,f.mode&1?(Xn=(Re=Xn)||Ge,us(p,f),Xn=Re):us(p,f),na(f),T&8192){if(Re=f.memoizedState!==null,(f.stateNode.isHidden=Re)&&!Ge&&(f.mode&1)!==0)for(mt=f,Ge=f.child;Ge!==null;){for(Ye=mt=Ge;mt!==null;){switch(Ke=mt,dt=Ke.child,Ke.tag){case 0:case 11:case 14:case 15:Eo(4,Ke,Ke.return);break;case 1:Xu(Ke,Ke.return);var gt=Ke.stateNode;if(typeof gt.componentWillUnmount=="function"){T=Ke,E=Ke.return;try{p=T,gt.props=p.memoizedProps,gt.state=p.memoizedState,gt.componentWillUnmount()}catch(xt){ar(T,E,xt)}}break;case 5:Xu(Ke,Ke.return);break;case 22:if(Ke.memoizedState!==null){jl(Ye);continue}}dt!==null?(dt.return=Ke,mt=dt):jl(Ye)}Ge=Ge.sibling}e:for(Ge=null,Ye=f;;){if(Ye.tag===5){if(Ge===null){Ge=Ye;try{q=Ye.stateNode,Re?(H=q.style,typeof H.setProperty=="function"?H.setProperty("display","none","important"):H.display="none"):(pe=Ye.stateNode,ye=Ye.memoizedProps.style,ie=ye!=null&&ye.hasOwnProperty("display")?ye.display:null,pe.style.display=el("display",ie))}catch(xt){ar(f,f.return,xt)}}}else if(Ye.tag===6){if(Ge===null)try{Ye.stateNode.nodeValue=Re?"":Ye.memoizedProps}catch(xt){ar(f,f.return,xt)}}else if((Ye.tag!==22&&Ye.tag!==23||Ye.memoizedState===null||Ye===f)&&Ye.child!==null){Ye.child.return=Ye,Ye=Ye.child;continue}if(Ye===f)break e;for(;Ye.sibling===null;){if(Ye.return===null||Ye.return===f)break e;Ge===Ye&&(Ge=null),Ye=Ye.return}Ge===Ye&&(Ge=null),Ye.sibling.return=Ye.return,Ye=Ye.sibling}}break;case 19:us(p,f),na(f),T&4&&Zu(f);break;case 21:break;default:us(p,f),na(f)}}function na(f){var p=f.flags;if(p&2){try{e:{for(var E=f.return;E!==null;){if(Pw(E)){var T=E;break e}E=E.return}throw Error(n(160))}switch(T.tag){case 5:var q=T.stateNode;T.flags&32&&(on(q,""),T.flags&=-33);var H=Cw(f);lp(f,H,q);break;case 3:case 4:var ie=T.stateNode.containerInfo,pe=Cw(f);Px(f,pe,ie);break;default:throw Error(n(161))}}catch(ye){ar(f,f.return,ye)}f.flags&=-3}p&4096&&(f.flags&=-4097)}function cp(f,p,E){mt=f,Ox(f)}function Ox(f,p,E){for(var T=(f.mode&1)!==0;mt!==null;){var q=mt,H=q.child;if(q.tag===22&&T){var ie=q.memoizedState!==null||ap;if(!ie){var pe=q.alternate,ye=pe!==null&&pe.memoizedState!==null||Xn;pe=ap;var Re=Xn;if(ap=ie,(Xn=ye)&&!Re)for(mt=q;mt!==null;)ie=mt,ye=ie.child,ie.tag===22&&ie.memoizedState!==null?Aw(q):ye!==null?(ye.return=ie,mt=ye):Aw(q);for(;H!==null;)mt=H,Ox(H),H=H.sibling;mt=q,ap=pe,Xn=Re}ra(f)}else(q.subtreeFlags&8772)!==0&&H!==null?(H.return=q,mt=H):ra(f)}}function ra(f){for(;mt!==null;){var p=mt;if((p.flags&8772)!==0){var E=p.alternate;try{if((p.flags&8772)!==0)switch(p.tag){case 0:case 11:case 15:Xn||$f(5,p);break;case 1:var T=p.stateNode;if(p.flags&4&&!Xn)if(E===null)T.componentDidMount();else{var q=p.elementType===p.type?E.memoizedProps:Ds(p.type,E.memoizedProps);T.componentDidUpdate(q,E.memoizedState,T.__reactInternalSnapshotBeforeUpdate)}var H=p.updateQueue;H!==null&&rx(p,H,T);break;case 3:var ie=p.updateQueue;if(ie!==null){if(E=null,p.child!==null)switch(p.child.tag){case 5:E=p.child.stateNode;break;case 1:E=p.child.stateNode}rx(p,ie,E)}break;case 5:var pe=p.stateNode;if(E===null&&p.flags&4){E=pe;var ye=p.memoizedProps;switch(p.type){case"button":case"input":case"select":case"textarea":ye.autoFocus&&E.focus();break;case"img":ye.src&&(E.src=ye.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(p.memoizedState===null){var Re=p.alternate;if(Re!==null){var Ge=Re.memoizedState;if(Ge!==null){var Ye=Ge.dehydrated;Ye!==null&&Pn(Ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Xn||p.flags&512&&op(p)}catch(Ke){ar(p,p.return,Ke)}}if(p===f){mt=null;break}if(E=p.sibling,E!==null){E.return=p.return,mt=E;break}mt=p.return}}function jl(f){for(;mt!==null;){var p=mt;if(p===f){mt=null;break}var E=p.sibling;if(E!==null){E.return=p.return,mt=E;break}mt=p.return}}function Aw(f){for(;mt!==null;){var p=mt;try{switch(p.tag){case 0:case 11:case 15:var E=p.return;try{$f(4,p)}catch(ye){ar(p,E,ye)}break;case 1:var T=p.stateNode;if(typeof T.componentDidMount=="function"){var q=p.return;try{T.componentDidMount()}catch(ye){ar(p,q,ye)}}var H=p.return;try{op(p)}catch(ye){ar(p,H,ye)}break;case 5:var ie=p.return;try{op(p)}catch(ye){ar(p,ie,ye)}}}catch(ye){ar(p,p.return,ye)}if(p===f){mt=null;break}var pe=p.sibling;if(pe!==null){pe.return=p.return,mt=pe;break}mt=p.return}}var Ow=Math.ceil,up=j.ReactCurrentDispatcher,Tx=j.ReactCurrentOwner,Ls=j.ReactCurrentBatchConfig,xn=0,zr=null,Sr=null,ti=0,ds=0,Ju=Bi(0),Tr=0,qf=null,_l=0,zf=0,dp=0,Bf=null,Ki=null,Rx=0,jc=1/0,Po=null,fp=!1,Mx=null,Nl=null,hp=!1,Sl=null,Mi=0,Uf=0,Ix=null,mp=-1,Vf=0;function Ii(){return(xn&6)!==0?Gn():mp!==-1?mp:mp=Gn()}function kl(f){return(f.mode&1)===0?1:(xn&2)!==0&&ti!==0?ti&-ti:uw.transition!==null?(Vf===0&&(Vf=Cv()),Vf):(f=kn,f!==0||(f=window.event,f=f===void 0?16:Db(f.type)),f)}function ia(f,p,E,T){if(50<Uf)throw Uf=0,Ix=null,Error(n(185));rf(f,E,T),((xn&2)===0||f!==zr)&&(f===zr&&((xn&2)===0&&(zf|=E),Tr===4&&El(f,ti)),Gi(f,T),E===1&&xn===0&&(p.mode&1)===0&&(jc=Gn()+500,Im&&gl()))}function Gi(f,p){var E=f.callbackNode;i2(f,p);var T=rc(f,f===zr?ti:0);if(T===0)E!==null&&Nb(E),f.callbackNode=null,f.callbackPriority=0;else if(p=T&-T,f.callbackPriority!==p){if(E!=null&&Nb(E),p===1)f.tag===0?dc(Tw.bind(null,f)):ow(Tw.bind(null,f)),Om(function(){(xn&6)===0&&gl()}),E=null;else{switch(ic(T)){case 1:E=Ev;break;case 4:E=Sb;break;case 16:E=tf;break;case 536870912:E=Pv;break;default:E=tf}E=$w(E,pp.bind(null,f))}f.callbackPriority=p,f.callbackNode=E}}function pp(f,p){if(mp=-1,Vf=0,(xn&6)!==0)throw Error(n(327));var E=f.callbackNode;if(ed()&&f.callbackNode!==E)return null;var T=rc(f,f===zr?ti:0);if(T===0)return null;if((T&30)!==0||(T&f.expiredLanes)!==0||p)p=gp(f,T);else{p=T;var q=xn;xn|=2;var H=Mw();(zr!==f||ti!==p)&&(Po=null,jc=Gn()+500,Nc(f,p));do try{A2();break}catch(pe){Rw(f,pe)}while(!0);bo(),up.current=H,xn=q,Sr!==null?p=0:(zr=null,ti=0,p=Tr)}if(p!==0){if(p===2&&(q=lm(f),q!==0&&(T=q,p=Dx(f,q))),p===1)throw E=qf,Nc(f,0),El(f,T),Gi(f,Gn()),E;if(p===6)El(f,T);else{if(q=f.current.alternate,(T&30)===0&&!P2(q)&&(p=gp(f,T),p===2&&(H=lm(f),H!==0&&(T=H,p=Dx(f,H))),p===1))throw E=qf,Nc(f,0),El(f,T),Gi(f,Gn()),E;switch(f.finishedWork=q,f.finishedLanes=T,p){case 0:case 1:throw Error(n(345));case 2:Sc(f,Ki,Po);break;case 3:if(El(f,T),(T&130023424)===T&&(p=Rx+500-Gn(),10<p)){if(rc(f,0)!==0)break;if(q=f.suspendedLanes,(q&T)!==T){Ii(),f.pingedLanes|=f.suspendedLanes&q;break}f.timeoutHandle=fl(Sc.bind(null,f,Ki,Po),p);break}Sc(f,Ki,Po);break;case 4:if(El(f,T),(T&4194240)===T)break;for(p=f.eventTimes,q=-1;0<T;){var ie=31-Ys(T);H=1<<ie,ie=p[ie],ie>q&&(q=ie),T&=~H}if(T=q,T=Gn()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*Ow(T/1960))-T,10<T){f.timeoutHandle=fl(Sc.bind(null,f,Ki,Po),T);break}Sc(f,Ki,Po);break;case 5:Sc(f,Ki,Po);break;default:throw Error(n(329))}}}return Gi(f,Gn()),f.callbackNode===E?pp.bind(null,f):null}function Dx(f,p){var E=Bf;return f.current.memoizedState.isDehydrated&&(Nc(f,p).flags|=256),f=gp(f,p),f!==2&&(p=Ki,Ki=E,p!==null&&Lx(p)),f}function Lx(f){Ki===null?Ki=f:Ki.push.apply(Ki,f)}function P2(f){for(var p=f;;){if(p.flags&16384){var E=p.updateQueue;if(E!==null&&(E=E.stores,E!==null))for(var T=0;T<E.length;T++){var q=E[T],H=q.getSnapshot;q=q.value;try{if(!Te(H(),q))return!1}catch{return!1}}}if(E=p.child,p.subtreeFlags&16384&&E!==null)E.return=p,p=E;else{if(p===f)break;for(;p.sibling===null;){if(p.return===null||p.return===f)return!0;p=p.return}p.sibling.return=p.return,p=p.sibling}}return!0}function El(f,p){for(p&=~dp,p&=~zf,f.suspendedLanes|=p,f.pingedLanes&=~p,f=f.expirationTimes;0<p;){var E=31-Ys(p),T=1<<E;f[E]=-1,p&=~T}}function Tw(f){if((xn&6)!==0)throw Error(n(327));ed();var p=rc(f,0);if((p&1)===0)return Gi(f,Gn()),null;var E=gp(f,p);if(f.tag!==0&&E===2){var T=lm(f);T!==0&&(p=T,E=Dx(f,T))}if(E===1)throw E=qf,Nc(f,0),El(f,p),Gi(f,Gn()),E;if(E===6)throw Error(n(345));return f.finishedWork=f.current.alternate,f.finishedLanes=p,Sc(f,Ki,Po),Gi(f,Gn()),null}function Fx(f,p){var E=xn;xn|=1;try{return f(p)}finally{xn=E,xn===0&&(jc=Gn()+500,Im&&gl())}}function _c(f){Sl!==null&&Sl.tag===0&&(xn&6)===0&&ed();var p=xn;xn|=1;var E=Ls.transition,T=kn;try{if(Ls.transition=null,kn=1,f)return f()}finally{kn=T,Ls.transition=E,xn=p,(xn&6)===0&&gl()}}function $x(){ds=Ju.current,Wn(Ju)}function Nc(f,p){f.finishedWork=null,f.finishedLanes=0;var E=f.timeoutHandle;if(E!==-1&&(f.timeoutHandle=-1,yf(E)),Sr!==null)for(E=Sr.return;E!==null;){var T=E;switch(mc(T),T.tag){case 1:T=T.type.childContextTypes,T!=null&&Mm();break;case 3:yl(),Wn(Ui),Wn(pi),Wm();break;case 5:Vm(T);break;case 4:yl();break;case 13:Wn(Yn);break;case 19:Wn(Yn);break;case 10:qm(T.type._context);break;case 22:case 23:$x()}E=E.return}if(zr=f,Sr=f=sa(f.current,null),ti=ds=p,Tr=0,qf=null,dp=zf=_l=0,Ki=Bf=null,gc!==null){for(p=0;p<gc.length;p++)if(E=gc[p],T=E.interleaved,T!==null){E.interleaved=null;var q=T.next,H=E.pending;if(H!==null){var ie=H.next;H.next=q,T.next=ie}E.pending=T}gc=null}return f}function Rw(f,p){do{var E=Sr;try{if(bo(),kf.current=Xm,Uu){for(var T=sr.memoizedState;T!==null;){var q=T.queue;q!==null&&(q.pending=null),T=T.next}Uu=!1}if(bl=0,Or=hr=sr=null,Ef=!1,xc=0,Tx.current=null,E===null||E.return===null){Tr=1,qf=p,Sr=null;break}e:{var H=f,ie=E.return,pe=E,ye=p;if(p=ti,pe.flags|=32768,ye!==null&&typeof ye=="object"&&typeof ye.then=="function"){var Re=ye,Ge=pe,Ye=Ge.tag;if((Ge.mode&1)===0&&(Ye===0||Ye===11||Ye===15)){var Ke=Ge.alternate;Ke?(Ge.updateQueue=Ke.updateQueue,Ge.memoizedState=Ke.memoizedState,Ge.lanes=Ke.lanes):(Ge.updateQueue=null,Ge.memoizedState=null)}var dt=ww(ie);if(dt!==null){dt.flags&=-257,yx(dt,ie,pe,H,p),dt.mode&1&&Tf(H,Re,p),p=dt,ye=Re;var gt=p.updateQueue;if(gt===null){var xt=new Set;xt.add(ye),p.updateQueue=xt}else gt.add(ye);break e}else{if((p&1)===0){Tf(H,Re,p),qx();break e}ye=Error(n(426))}}else if(Hn&&pe.mode&1){var mr=ww(ie);if(mr!==null){(mr.flags&65536)===0&&(mr.flags|=256),yx(mr,ie,pe,H,p),Ma(wc(ye,pe));break e}}H=ye=wc(ye,pe),Tr!==4&&(Tr=2),Bf===null?Bf=[H]:Bf.push(H),H=ie;do{switch(H.tag){case 3:H.flags|=65536,p&=-p,H.lanes|=p;var Ce=Of(H,ye,p);hw(H,Ce);break e;case 1:pe=ye;var we=H.type,Oe=H.stateNode;if((H.flags&128)===0&&(typeof we.getDerivedStateFromError=="function"||Oe!==null&&typeof Oe.componentDidCatch=="function"&&(Nl===null||!Nl.has(Oe)))){H.flags|=65536,p&=-p,H.lanes|=p;var Je=np(H,pe,p);hw(H,Je);break e}}H=H.return}while(H!==null)}Dw(E)}catch(jt){p=jt,Sr===E&&E!==null&&(Sr=E=E.return);continue}break}while(!0)}function Mw(){var f=up.current;return up.current=Xm,f===null?Xm:f}function qx(){(Tr===0||Tr===3||Tr===2)&&(Tr=4),zr===null||(_l&268435455)===0&&(zf&268435455)===0||El(zr,ti)}function gp(f,p){var E=xn;xn|=2;var T=Mw();(zr!==f||ti!==p)&&(Po=null,Nc(f,p));do try{C2();break}catch(q){Rw(f,q)}while(!0);if(bo(),xn=E,up.current=T,Sr!==null)throw Error(n(261));return zr=null,ti=0,Tr}function C2(){for(;Sr!==null;)Iw(Sr)}function A2(){for(;Sr!==null&&!sm();)Iw(Sr)}function Iw(f){var p=Fw(f.alternate,f,ds);f.memoizedProps=f.pendingProps,p===null?Dw(f):Sr=p,Tx.current=null}function Dw(f){var p=f;do{var E=p.alternate;if(f=p.return,(p.flags&32768)===0){if(E=S2(E,p,ds),E!==null){Sr=E;return}}else{if(E=k2(E,p),E!==null){E.flags&=32767,Sr=E;return}if(f!==null)f.flags|=32768,f.subtreeFlags=0,f.deletions=null;else{Tr=6,Sr=null;return}}if(p=p.sibling,p!==null){Sr=p;return}Sr=p=f}while(p!==null);Tr===0&&(Tr=5)}function Sc(f,p,E){var T=kn,q=Ls.transition;try{Ls.transition=null,kn=1,O2(f,p,E,T)}finally{Ls.transition=q,kn=T}return null}function O2(f,p,E,T){do ed();while(Sl!==null);if((xn&6)!==0)throw Error(n(327));E=f.finishedWork;var q=f.finishedLanes;if(E===null)return null;if(f.finishedWork=null,f.finishedLanes=0,E===f.current)throw Error(n(177));f.callbackNode=null,f.callbackPriority=0;var H=E.lanes|E.childLanes;if(Ob(f,H),f===zr&&(Sr=zr=null,ti=0),(E.subtreeFlags&2064)===0&&(E.flags&2064)===0||hp||(hp=!0,$w(tf,function(){return ed(),null})),H=(E.flags&15990)!==0,(E.subtreeFlags&15990)!==0||H){H=Ls.transition,Ls.transition=null;var ie=kn;kn=1;var pe=xn;xn|=4,Tx.current=null,E2(f,E),Ax(E,f),w2(uc),fm=!!vf,uc=vf=null,f.current=E,cp(E),t2(),xn=pe,kn=ie,Ls.transition=H}else f.current=E;if(hp&&(hp=!1,Sl=f,Mi=q),H=f.pendingLanes,H===0&&(Nl=null),r2(E.stateNode),Gi(f,Gn()),p!==null)for(T=f.onRecoverableError,E=0;E<p.length;E++)q=p[E],T(q.value,{componentStack:q.stack,digest:q.digest});if(fp)throw fp=!1,f=Mx,Mx=null,f;return(Mi&1)!==0&&f.tag!==0&&ed(),H=f.pendingLanes,(H&1)!==0?f===Ix?Uf++:(Uf=0,Ix=f):Uf=0,gl(),null}function ed(){if(Sl!==null){var f=ic(Mi),p=Ls.transition,E=kn;try{if(Ls.transition=null,kn=16>f?16:f,Sl===null)var T=!1;else{if(f=Sl,Sl=null,Mi=0,(xn&6)!==0)throw Error(n(331));var q=xn;for(xn|=4,mt=f.current;mt!==null;){var H=mt,ie=H.child;
vendor: 4,992 bytes, line 40
40if((mt.flags&16)!==0){var pe=H.deletions;if(pe!==null){for(var ye=0;ye<pe.length;ye++){var Re=pe[ye];for(mt=Re;mt!==null;){var Ge=mt;switch(Ge.tag){case 0:case 11:case 15:Eo(8,Ge,H)}var Ye=Ge.child;if(Ye!==null)Ye.return=Ge,mt=Ye;else for(;mt!==null;){Ge=mt;var Ke=Ge.sibling,dt=Ge.return;if(Ew(Ge),Ge===Re){mt=null;break}if(Ke!==null){Ke.return=dt,mt=Ke;break}mt=dt}}}var gt=H.alternate;if(gt!==null){var xt=gt.child;if(xt!==null){gt.child=null;do{var mr=xt.sibling;xt.sibling=null,xt=mr}while(xt!==null)}}mt=H}}if((H.subtreeFlags&2064)!==0&&ie!==null)ie.return=H,mt=ie;else e:for(;mt!==null;){if(H=mt,(H.flags&2048)!==0)switch(H.tag){case 0:case 11:case 15:Eo(9,H,H.return)}var Ce=H.sibling;if(Ce!==null){Ce.return=H.return,mt=Ce;break e}mt=H.return}}var we=f.current;for(mt=we;mt!==null;){ie=mt;var Oe=ie.child;if((ie.subtreeFlags&2064)!==0&&Oe!==null)Oe.return=ie,mt=Oe;else e:for(ie=we;mt!==null;){if(pe=mt,(pe.flags&2048)!==0)try{switch(pe.tag){case 0:case 11:case 15:$f(9,pe)}}catch(jt){ar(pe,pe.return,jt)}if(pe===ie){mt=null;break e}var Je=pe.sibling;if(Je!==null){Je.return=pe.return,mt=Je;break e}mt=pe.return}}if(xn=q,gl(),Sa&&typeof Sa.onPostCommitFiberRoot=="function")try{Sa.onPostCommitFiberRoot(am,f)}catch{}T=!0}return T}finally{kn=E,Ls.transition=p}}return!1}function vp(f,p,E){p=wc(E,p),p=Of(f,p,1),f=Ms(f,p,1),p=Ii(),f!==null&&(rf(f,1,p),Gi(f,p))}function ar(f,p,E){if(f.tag===3)vp(f,f,E);else for(;p!==null;){if(p.tag===3){vp(p,f,E);break}else if(p.tag===1){var T=p.stateNode;if(typeof p.type.getDerivedStateFromError=="function"||typeof T.componentDidCatch=="function"&&(Nl===null||!Nl.has(T))){f=wc(E,f),f=np(p,f,1),p=Ms(p,f,1),f=Ii(),p!==null&&(rf(p,1,f),Gi(p,f));break}}p=p.return}}function T2(f,p,E){var T=f.pingCache;T!==null&&T.delete(p),p=Ii(),f.pingedLanes|=f.suspendedLanes&E,zr===f&&(ti&E)===E&&(Tr===4||Tr===3&&(ti&130023424)===ti&&500>Gn()-Rx?Nc(f,0):dp|=E),Gi(f,p)}function Lw(f,p){p===0&&((f.mode&1)===0?p=1:(p=om,om<<=1,(om&130023424)===0&&(om=4194304)));var E=Ii();f=wo(f,p),f!==null&&(rf(f,p,E),Gi(f,E))}function R2(f){var p=f.memoizedState,E=0;p!==null&&(E=p.retryLane),Lw(f,E)}function M2(f,p){var E=0;switch(f.tag){case 13:var T=f.stateNode,q=f.memoizedState;q!==null&&(E=q.retryLane);break;case 19:T=f.stateNode;break;default:throw Error(n(314))}T!==null&&T.delete(p),Lw(f,E)}var Fw;Fw=function(f,p,E){if(f!==null)if(f.memoizedProps!==p.pendingProps||Ui.current)Ti=!0;else{if((f.lanes&E)===0&&(p.flags&128)===0)return Ti=!1,Nw(f,p,E);Ti=(f.flags&131072)!==0}else Ti=!1,Hn&&(p.flags&1048576)!==0&&lw(p,Lm,p.index);switch(p.lanes=0,p.tag){case 2:var T=p.type;sp(f,p),f=p.pendingProps;var q=Fu(p,pi.current);xl(p,E),q=yc(null,p,T,f,q,E);var H=Hm();return p.flags|=1,typeof q=="object"&&q!==null&&typeof q.render=="function"&&q.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,Vi(T)?(H=!0,Cs(p)):H=!1,p.memoizedState=q.state!==null&&q.state!==void 0?q.state:null,Bm(p),q.updater=ep,p.stateNode=q,q._reactInternals=p,xx(p,T,f,E),p=Sx(null,p,T,!0,H,E)):(p.tag=0,Hn&&H&&bf(p),Zr(null,p,q,E),p=p.child),p;case 16:T=p.elementType;e:{switch(sp(f,p),f=p.pendingProps,q=T._init,T=q(T._payload),p.type=T,q=p.tag=D2(T),f=Ds(T,f),q){case 0:p=_x(null,p,T,f,E);break e;case 1:p=Nx(null,p,T,f,E);break e;case 11:p=jw(null,p,T,f,E);break e;case 14:p=bx(null,p,T,Ds(T.type,f),E);break e}throw Error(n(306,T,""))}return p;case 0:return T=p.type,q=p.pendingProps,q=p.elementType===T?q:Ds(T,q),_x(f,p,T,q,E);case 1:return T=p.type,q=p.pendingProps,q=p.elementType===T?q:Ds(T,q),Nx(f,p,T,q,E);case 3:e:{if(_w(p),f===null)throw Error(n(387));T=p.pendingProps,H=p.memoizedState,q=H.element,fw(f,p),zu(p,T,null,E);var ie=p.memoizedState;if(T=ie.element,H.isDehydrated)if(H={element:T,isDehydrated:!1,cache:ie.cache,pendingSuspenseBoundaries:ie.pendingSuspenseBoundaries,transitions:ie.transitions},p.updateQueue.baseState=H,p.memoizedState=H,p.flags&256){q=wc(Error(n(423)),p),p=$a(f,p,T,E,q);break e}else if(T!==q){q=wc(Error(n(424)),p),p=$a(f,p,T,E,q);break e}else for(ls=hl(p.stateNode.containerInfo.firstChild),vi=p,Hn=!0,Zs=null,E=$m(p,null,T,E),p.child=E;E;)E.flags=E.flags&-3|4096,E=E.sibling;else{if(Ra(),T===q){p=ea(f,p,E);break e}Zr(f,p,T,E)}p=p.child}return p;case 5:return sx(p),f===null&&Wi(p),T=p.type,q=p.pendingProps,H=f!==null?f.memoizedProps:null,ie=q.children,xf(T,q)?ie=null:H!==null&&xf(T,H)&&(p.flags|=32),jx(f,p),Zr(f,p,ie,E),p.child;case 6:return f===null&&Wi(p),null;case 13:return ip(f,p,E);case 4:return ix(p,p.stateNode.containerInfo),T=p.pendingProps,f===null?p.child=cr(p,null,T,E):Zr(f,p,T,E),p.child;case 11:return T=p.type,q=p.pendingProps,q=p.elementType===T?q:Ds(T,q),jw(f,p,T,q,E);case 7:return Zr(f,p,p.pendingProps,E),p.child;case 8:return Zr(f,p,p.pendingProps.children,E),p.child;case 12:return Zr(f,p,p.pendingProps.children,E),p.child;case 10:e:{if(T=p.type._context,q=p.pendingProps,H=p.memoizedProps,ie=q.value,Bn(_f,T._currentValue),T._currentValue=ie,H!==null)if(Te(H.value,ie)){if(H.children===q.children&&!Ui.
vendor: 9,053 bytes, line 40
40current){p=ea(f,p,E);break e}}else for(H=p.child,H!==null&&(H.return=p);H!==null;){var pe=H.dependencies;if(pe!==null){ie=H.child;for(var ye=pe.firstContext;ye!==null;){if(ye.context===T){if(H.tag===1){ye=jo(-1,E&-E),ye.tag=2;var Re=H.updateQueue;if(Re!==null){Re=Re.shared;var Ge=Re.pending;Ge===null?ye.next=ye:(ye.next=Ge.next,Ge.next=ye),Re.pending=ye}}H.lanes|=E,ye=H.alternate,ye!==null&&(ye.lanes|=E),Xr(H.return,E,p),pe.lanes|=E;break}ye=ye.next}}else if(H.tag===10)ie=H.type===p.type?null:H.child;else if(H.tag===18){if(ie=H.return,ie===null)throw Error(n(341));ie.lanes|=E,pe=ie.alternate,pe!==null&&(pe.lanes|=E),Xr(ie,E,p),ie=H.sibling}else ie=H.child;if(ie!==null)ie.return=H;else for(ie=H;ie!==null;){if(ie===p){ie=null;break}if(H=ie.sibling,H!==null){H.return=ie.return,ie=H;break}ie=ie.return}H=ie}Zr(f,p,q.children,E),p=p.child}return p;case 9:return q=p.type,T=p.pendingProps.children,xl(p,E),q=Ts(q),T=T(q),p.flags|=1,Zr(f,p,T,E),p.child;case 14:return T=p.type,q=Ds(T,p.pendingProps),q=Ds(T.type,q),bx(f,p,T,q,E);case 15:return Fa(f,p,p.type,p.pendingProps,E);case 17:return T=p.type,q=p.pendingProps,q=p.elementType===T?q:Ds(T,q),sp(f,p),p.tag=1,Vi(T)?(f=!0,Cs(p)):f=!1,xl(p,E),bc(p,T,q),xx(p,T,q,E),Sx(null,p,T,!0,f,E);case 19:return wl(f,p,E);case 22:return wx(f,p,E)}throw Error(n(156,p.tag))};function $w(f,p){return _b(f,p)}function I2(f,p,E,T){this.tag=f,this.key=E,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fs(f,p,E,T){return new I2(f,p,E,T)}function xp(f){return f=f.prototype,!(!f||!f.isReactComponent)}function D2(f){if(typeof f=="function")return xp(f)?1:0;if(f!=null){if(f=f.$$typeof,f===M)return 11;if(f===U)return 14}return 2}function sa(f,p){var E=f.alternate;return E===null?(E=Fs(f.tag,p,f.key,f.mode),E.elementType=f.elementType,E.type=f.type,E.stateNode=f.stateNode,E.alternate=f,f.alternate=E):(E.pendingProps=p,E.type=f.type,E.flags=0,E.subtreeFlags=0,E.deletions=null),E.flags=f.flags&14680064,E.childLanes=f.childLanes,E.lanes=f.lanes,E.child=f.child,E.memoizedProps=f.memoizedProps,E.memoizedState=f.memoizedState,E.updateQueue=f.updateQueue,p=f.dependencies,E.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},E.sibling=f.sibling,E.index=f.index,E.ref=f.ref,E}function yp(f,p,E,T,q,H){var ie=2;if(T=f,typeof f=="function")xp(f)&&(ie=1);else if(typeof f=="string")ie=5;else e:switch(f){case P:return kc(E.children,q,H,p);case A:ie=8,q|=8;break;case F:return f=Fs(12,E,p,q|2),f.elementType=F,f.lanes=H,f;case $:return f=Fs(13,E,p,q),f.elementType=$,f.lanes=H,f;case B:return f=Fs(19,E,p,q),f.elementType=B,f.lanes=H,f;case Z:return bp(E,q,H,p);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case I:ie=10;break e;case R:ie=9;break e;case M:ie=11;break e;case U:ie=14;break e;case G:ie=16,T=null;break e}throw Error(n(130,f==null?f:typeof f,""))}return p=Fs(ie,E,p,q),p.elementType=f,p.type=T,p.lanes=H,p}function kc(f,p,E,T){return f=Fs(7,f,T,p),f.lanes=E,f}function bp(f,p,E,T){return f=Fs(22,f,T,p),f.elementType=Z,f.lanes=E,f.stateNode={isHidden:!1},f}function zx(f,p,E){return f=Fs(6,f,null,p),f.lanes=E,f}function Bx(f,p,E){return p=Fs(4,f.children!==null?f.children:[],f.key,p),p.lanes=E,p.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},p}function L2(f,p,E,T,q){this.tag=p,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=nf(0),this.expirationTimes=nf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nf(0),this.identifierPrefix=T,this.onRecoverableError=q,this.mutableSourceEagerHydrationData=null}function Ux(f,p,E,T,q,H,ie,pe,ye){return f=new L2(f,p,E,pe,ye),p===1?(p=1,H===!0&&(p|=8)):p=0,H=Fs(3,null,null,p),f.current=H,H.stateNode=f,H.memoizedState={element:T,isDehydrated:E,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bm(H),f}function F2(f,p,E){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:C,key:T==null?null:""+T,children:f,containerInfo:p,implementation:E}}function qw(f){if(!f)return pl;f=f._reactInternals;e:{if(nc(f)!==f||f.tag!==1)throw Error(n(170));var p=f;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(Vi(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(n(171))}if(f.tag===1){var E=f.type;if(Vi(E))return sw(f,E,p)}return p}function zw(f,p,E,T,q,H,ie,pe,ye){return f=Ux(E,T,!0,f,q,H,ie,pe,ye),f.context=qw(null),E=f.current,T=Ii(),q=kl(E),H=jo(T,q),H.callback=p??null,Ms(E,H,q),f.current.lanes=q,rf(f,q,T),Gi(f,T),f}function wp(f,p,E,T){var q=p.current,H=Ii(),ie=kl(q);return E=qw(E),p.context===null?p.context=E:p.pendingContext=E,p=jo(H,ie),p.payload={element:f},T=T===void 0?null:T,T!==null&&(p.callback=T),f=Ms(q,p,ie),f!==null&&(ia(f,q,ie,H),Um(f,q,ie)),ie}function jp(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return f.child.stateNode;default:return f.child.stateNode}}function Bw(f,p){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var E=f.retryLane;f.retryLane=E!==0&&E<p?E:p}}function Vx(f,p){Bw(f,p),(f=f.alternate)&&Bw(f,p)}function $2(){return null}var Uw=typeof reportError=="function"?reportError:function(f){console.error(f)};function _p(f){this._internalRoot=f}Wf.prototype.render=_p.prototype.render=function(f){var p=this._internalRoot;if(p===null)throw Error(n(409));wp(f,p,null,null)},Wf.prototype.unmount=_p.prototype.unmount=function(){var f=this._internalRoot;if(f!==null){this._internalRoot=null;var p=f.containerInfo;_c(function(){wp(null,f,null,null)}),p[os]=null}};function Wf(f){this._internalRoot=f}Wf.prototype.unstable_scheduleHydration=function(f){if(f){var p=Ov();f={blockedOn:null,target:f,priority:p};for(var E=0;E<ol.length&&p!==0&&p<ol[E].priority;E++);ol.splice(E,0,f),E===0&&Mb(f)}};function Wx(f){return!(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)}function Np(f){return!(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11&&(f.nodeType!==8||f.nodeValue!==" react-mount-point-unstable "))}function Vw(){}function q2(f,p,E,T,q){if(q){if(typeof T=="function"){var H=T;T=function(){var Re=jp(ie);H.call(Re)}}var ie=zw(p,T,f,0,null,!1,!1,"",Vw);return f._reactRootContainer=ie,f[os]=ie.current,dl(f.nodeType===8?f.parentNode:f),_c(),ie}for(;q=f.lastChild;)f.removeChild(q);if(typeof T=="function"){var pe=T;T=function(){var Re=jp(ye);pe.call(Re)}}var ye=Ux(f,0,!1,null,null,!1,!1,"",Vw);return f._reactRootContainer=ye,f[os]=ye.current,dl(f.nodeType===8?f.parentNode:f),_c(function(){wp(p,ye,E,T)}),ye}function Ec(f,p,E,T,q){var H=E._reactRootContainer;if(H){var ie=H;if(typeof q=="function"){var pe=q;q=function(){var ye=jp(ie);pe.call(ye)}}wp(p,ie,f,q)}else ie=q2(E,p,f,q,T);return jp(ie)}Av=function(f){switch(f.tag){case 3:var p=f.stateNode;if(p.current.memoizedState.isDehydrated){var E=bu(p.pendingLanes);E!==0&&(sf(p,E|1),Gi(p,Gn()),(xn&6)===0&&(jc=Gn()+500,gl()))}break;case 13:_c(function(){var T=wo(f,1);if(T!==null){var q=Ii();ia(T,f,1,q)}}),Vx(f,1)}},cm=function(f){if(f.tag===13){var p=wo(f,134217728);if(p!==null){var E=Ii();ia(p,f,134217728,E)}Vx(f,134217728)}},Tb=function(f){if(f.tag===13){var p=kl(f),E=wo(f,p);if(E!==null){var T=Ii();ia(E,f,p,T)}Vx(f,p)}},Ov=function(){return kn},Tv=function(f,p){var E=kn;try{return kn=f,p()}finally{kn=E}},Zd=function(f,p,E){switch(p){case"input":if(Xe(f,E),p=E.name,E.type==="radio"&&p!=null){for(E=f;E.parentNode;)E=E.parentNode;for(E=E.querySelectorAll("input[name="+JSON.stringify(""+p)+'][type="radio"]'),p=0;p<E.length;p++){var T=E[p];if(T!==f&&T.form===f.form){var q=Rm(T);if(!q)throw Error(n(90));he(T),Xe(T,q)}}}break;case"textarea":ct(f,E);break;case"select":p=E.value,p!=null&&de(f,!!E.multiple,p,!1)}},Ar=Fx,Qr=_c;var z2={usingClientEntryPoint:!1,Events:[mi,Gt,Rm,Vt,fr,Fx]},Hf={findFiberByHostInstance:Ca,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},B2={bundleType:Hf.bundleType,version:Hf.version,rendererPackageName:Hf.rendererPackageName,rendererConfig:Hf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(f){return f=wb(f),f===null?null:f.stateNode},findFiberByHostInstance:Hf.findFiberByHostInstance||$2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sp.isDisabled&&Sp.supportsFiber)try{am=Sp.inject(B2),Sa=Sp}catch{}}return Bs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=z2,Bs.createPortal=function(f,p){var E=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wx(p))throw Error(n(200));return F2(f,p,null,E)},Bs.createRoot=function(f,p){if(!Wx(f))throw Error(n(299));var E=!1,T="",q=Uw;return p!=null&&(p.unstable_strictMode===!0&&(E=!0),p.identifierPrefix!==void 0&&(T=p.identifierPrefix),p.onRecoverableError!==void 0&&(q=p.onRecoverableError)),p=Ux(f,1,!1,null,null,E,!1,T,q),f[os]=p.current,dl(f.nodeType===8?f.parentNode:f),new _p(p)},Bs.findDOMNode=function(f){if(f==null)return null;if(f.nodeType===1)return f;var p=f._reactInternals;if(p===void 0)throw typeof f.render=="function"?Error(n(188)):(f=Object.keys(f).join(","),Error(n(268,f)));return f=wb(p),f=f===null?null:f.stateNode,f},Bs.flushSync=function(f){return _c(f)},Bs.hydrate=function(f,p,E){if(!Np(p))throw Error(n(200));return Ec(null,f,p,!0,E)},Bs.hydrateRoot=function(f,p,E){if(!Wx(f))throw Error(n(405));var T=E!=null&&E.hydratedSources||null,q=!1,H="",ie=Uw;if(E!=null&&(E.unstable_strictMode===!0&&(q=!0),E.identifierPrefix!==void 0&&(H=E.identifierPrefix),E.onRecoverableError!==void 0&&(ie=E.onRecoverableError)),p=zw(p,null,f,1,E??null,q,!1,H,ie),f[os]=p.current,dl(f),T)for(f=0;f<T.length;f++)E=T[f],q=E._getVersion,q=q(E._source),p.mutableSourceEagerHydrationData==null?p.mutableSourceEagerHydrationData=[E,q]:p.mutableSourceEagerHydrationData.push(E,q);return new Wf(p)},Bs.render=function(f,p,E){if(!Np(p))throw Error(n(200));return Ec(null,f,p,!1,E)},Bs.unmountComponentAtNode=function(f){if(!Np(f))throw Error(n(40));return f._reactRootContainer?(_c(function(){Ec(null,null,f,!1,function(){f._reactRootContainer=null,f[os]=null})}),!0):!1},Bs.unstable_batchedUpdates=Fx,Bs.unstable_renderSubtreeIntoContainer=function(f,p,E,T){if(!Np(E))throw Error(n(200));if(f==null||f._reactInternals===void 0)throw Error(n(38));return Ec(f,p,E,!1,T)},Bs.version="18.3.1-next-f1338f8080-20240426",Bs}var eM;function $T(){if(eM)return iS.exports;eM=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),iS.exports=MJ(),iS.exports}var tM;function IJ(){if(tM)return Qw;tM=1;var e=$T();return Qw.createRoot=e.createRoot,Qw.hydrateRoot=e.hydrateRoot,Qw}var DJ=IJ();const LJ=En(DJ),FJ=20,$J=1e6,zc={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let oS=0;function qJ(){return oS=(oS+1)%Number.MAX_VALUE,oS.toString()}const lS=new Map,nM=e=>{if(lS.has(e))return;const t=setTimeout(()=>{lS.delete(e),S0({type:zc.REMOVE_TOAST,toastId:e})},$J);lS.set(e,t)},zJ=(e,t)=>{switch(t.type){case zc.ADD_TOAST:return{...e,toasts:[t.toast,...e.toasts].slice(0,FJ)};case zc.UPDATE_TOAST:return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case zc.DISMISS_TOAST:{const{toastId:n}=t;return n?nM(n):e.toasts.forEach(r=>{nM(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case zc.REMOVE_TOAST:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},T1=[];let R1={toasts:[]};function S0(e){R1=zJ(R1,e),T1.forEach(t=>{t(R1)})}function BJ({...e}){const t=qJ(),n=s=>S0({type:zc.UPDATE_TOAST,toast:{...s,id:t}}),r=()=>S0({type:zc.DISMISS_TOAST,toastId:t});return S0({type:zc.ADD_TOAST,toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function UJ(){const[e,t]=O.useState(R1);return O.useEffect(()=>(T1.push(t),()=>{const n=T1.indexOf(t);n>-1&&T1.splice(n,1)}),[e]),{...e,toast:BJ,dismiss:n=>S0({type:zc.DISMISS_TOAST,toastId:n})}}function Z8(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Z8(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Tt(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Z8(e))&&(r&&(r+=" "),r+=t);return r}const rM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,iM=Tt,Vy=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return iM(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:a}=t,o=Object.keys(s).map(u=>{const h=n==null?void 0:n[u],d=a==null?void 0:a[u];if(h===null)return null;const m=rM(h)||rM(d);return s[u][m]}),l=n&&Object.entries(n).reduce((u,h)=>{let[d,m]=h;return m===void 0||(u[d]=m),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,h)=>{let{class:d,className:m,...g}=h;return Object.entries(g).every(w=>{let[v,b]=w;return Array.isArray(b)?b.includes({...a,...l}[v]):{...a,...l}[v]===b})?[...u,d,m]:u},[]);return iM(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
41 * @license lucide-react v0.475.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const VJ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),J8=(...e)=>
vendor: 4,734 bytes, lines 45-105
45e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46 * @license lucide-react v0.475.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */var WJ={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"};/**
51 * @license lucide-react v0.475.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const HJ=O.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},c)=>O.createElement("svg",{ref:c,...WJ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:J8("lucide",s),...l},[...o.map(([u,h])=>O.createElement(u,h)),...Array.isArray(a)?a:[a]]));/**
56 * @license lucide-react v0.475.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const He=(e,t)=>{const n=O.forwardRef(({className:r,...s},a)=>O.createElement(HJ,{ref:a,iconNode:t,className:J8(`lucide-${VJ(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
61 * @license lucide-react v0.475.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const KJ=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],GJ=He("Activity",KJ);/**
66 * @license lucide-react v0.475.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const QJ=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],YJ=He("Archive",QJ);/**
71 * @license lucide-react v0.475.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const XJ=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],uu=He("ArrowLeft",XJ);/**
76 * @license lucide-react v0.475.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const ZJ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],X1=He("ArrowRight",ZJ);/**
81 * @license lucide-react v0.475.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const JJ=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],C_=He("Award",JJ);/**
86 * @license lucide-react v0.475.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const eee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],F0=He("Ban",eee);/**
91 * @license lucide-react v0.475.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const tee=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],qT=He("Bell",tee);/**
96 * @license lucide-react v0.475.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const nee=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],sM=He("BookOpen",nee);/**
101 * @license lucide-react v0.475.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const ree=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}
105],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],iee=He("BrainCircuit",ree);/**
106 * @license lucide-react v0.475.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const see=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],Z1=He("Brain",see);/**
111 * @license lucide-react v0.475.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const aee=[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],eB=He("CalendarDays",aee);/**
116 * @license lucide-react v0.475.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const oee=[["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"}]],Fn=He("Calendar",oee);/**
121 * @license lucide-react v0.475.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const lee=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Md=He("Camera",lee);/**
126 * @license lucide-react v0.475.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const cee=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],pg=He("ChartColumn",cee);/**
131 * @license lucide-react v0.475.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const uee=[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}
135],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]],dee=He("ChartNoAxesColumnIncreasing",uee);/**
136 * @license lucide-react v0.475.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const fee=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],hee=He("ChartPie",fee);/**
141 * @license lucide-react v0.475.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const mee=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Id=He("Check",mee);/**
146 * @license lucide-react v0.475.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const pee=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Yh=He("ChevronDown",pee);/**
151 * @license lucide-react v0.475.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const gee=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],vee=He("ChevronLeft",gee);/**
156 * @license lucide-react v0.475.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const xee=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yee=He("ChevronRight",xee);/**
161 * @license lucide-react v0.475.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const bee=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],A_=He("ChevronUp",bee);/**
166 * @license lucide-react v0.475.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const wee=[["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"}]],Sn=He("CircleAlert",wee);/**
171 * @license lucide-react v0.475.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const jee=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Ch=He("CircleCheckBig",jee);/**
176 * @license lucide-react v0.475.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const _ee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Cn=He("CircleCheck",_ee);/**
181 * @license lucide-react v0.475.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const Nee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],tB=He("CircleHelp",Nee);/**
186 * @license lucide-react v0.475.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const See=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ya=He("CircleX",See);/**
191 * @license lucide-react v0.475.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const kee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],rs=He("Clock",kee);/**
196 * @license lucide-react v0.475.0 - ISC
197 *
198 * This source code is licensed under the ISC license.
199 * See the LICENSE file in the root directory of this source tree.
200 */const Eee=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],$0=He("Copy",Eee);/**
201 * @license lucide-react v0.475.0 - ISC
202 *
203 * This source code is licensed under the ISC license.
204 * See the LICENSE file in the root directory of this source tree.
205 */const Pee=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],aM=He("CreditCard",Pee);/**
206 * @license lucide-react v0.475.0 - ISC
207 *
208 * This source code is licensed under the ISC license.
209 * See the LICENSE file in the root directory of this source tree.
210 */const Cee=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],nB=He("Crown",Cee);/**
211 * @license lucide-react v0.475.0 - ISC
212 *
213 * This source code is licensed under the ISC license.
214 * See the LICENSE file in the root directory of this source tree.
215 */const Aee=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],O_=He("DollarSign",Aee);
215/**
216 * @license lucide-react v0.475.0 - ISC
217 *
218 * This source code is licensed under the ISC license.
219 * See the LICENSE file in the root directory of this source tree.
220 */const Oee=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Wy=He("Download",Oee);/**
221 * @license lucide-react v0.475.0 - ISC
222 *
223 * This source code is licensed under the ISC license.
224 * See the LICENSE file in the root directory of this source tree.
225 */const Tee=[["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"}]],ws=He("ExternalLink",Tee);/**
226 * @license lucide-react v0.475.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const Ree=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],du=He("Eye",Ree);/**
231 * @license lucide-react v0.475.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const Mee=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Dd=He("FileText",Mee);/**
236 * @license lucide-react v0.475.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const Iee=[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]],nA=He("Flag",Iee);/**
241 * @license lucide-react v0.475.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const Dee=[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]],Sd=He("Flame",Dee);/**
246 * @license lucide-react v0.475.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const Lee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 16s-1.5-2-4-2-4 2-4 2",key:"epbg0q"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],zT=He("Frown",Lee);/**
251 * @license lucide-react v0.475.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const Fee=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],vs=He("Gamepad2",Fee);/**
256 * @license lucide-react v0.475.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const $ee=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],qee=He("Gift",$ee);/**
261 * @license lucide-react v0.475.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const zee=[["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"}]],q0=He("Globe",zee);/**
266 * @license lucide-react v0.475.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const Bee=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Uee=He("Grid3x3",Bee);/**
271 * @license lucide-react v0.475.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const Vee=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],oM=He("Hand",Vee);/**
276 * @license lucide-react v0.475.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const Wee=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],rB=He("History",Wee);/**
281 * @license lucide-react v0.475.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const Hee=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],BT=He("House",Hee);/**
286 * @license lucide-react v0.475.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const Kee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],iB=He("Info",Kee);/**
291 * @license lucide-react v0.475.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const Gee=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],cS=He("Key",Gee);/**
296 * @license lucide-react v0.475.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const Qee=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],rA=He("Link2",Qee);/**
301 * @license lucide-react v0.475.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const Yee=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],dr=He("LoaderCircle",Yee);/**
306 * @license lucide-react v0.475.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const Xee=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],no=He("Lock",Xee);/**
311 * @license lucide-react v0.475.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const Zee=[["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"}]],iA=He("LogOut",Zee);/**
316 * @license lucide-react v0.475.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const Jee=[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]],sB=He("MailOpen",Jee);/**
321 * @license lucide-react v0.475.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const ete=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],Vo=He("Mail",ete);/**
326 * @license lucide-react v0.475.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const tte=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],js=He("MapPin",tte);/**
331 * @license lucide-react v0.475.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const nte=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],rte=He("Maximize2",nte);/**
336 * @license lucide-react v0.475.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const ite=[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]],z0=He("Medal",ite);/**
341 * @license lucide-react v0.475.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const ste=[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]],gg=He("Megaphone",ste);/**
346 * @license lucide-react v0.475.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const ate=[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]],B0=He("Merge",ate);/**
351 * @license lucide-react v0.475.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const ote=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],Wo=He("MessageSquare",ote);
355/**
356 * @license lucide-react v0.475.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const lte=[["path",{d:"m11 7.601-5.994 8.19a1 1 0 0 0 .1 1.298l.817.818a1 1 0 0 0 1.314.087L15.09 12",key:"80a601"}],["path",{d:"M16.5 21.174C15.5 20.5 14.372 20 13 20c-2.058 0-3.928 2.356-6 2-2.072-.356-2.775-3.369-1.5-4.5",key:"j0ngtp"}],["circle",{cx:"16",cy:"7",r:"5",key:"d08jfb"}]],Bc=He("MicVocal",lte);/**
361 * @license lucide-react v0.475.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const cte=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],ute=He("Minimize2",cte);/**
366 * @license lucide-react v0.475.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const dte=[["path",{d:"M5 12h14",key:"1ays0h"}]],fte=He("Minus",dte);/**
371 * @license lucide-react v0.475.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const hte=[["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"}]],lM=He("Monitor",hte);/**
376 * @license lucide-react v0.475.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const mte=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],J1=He("Pause",mte);/**
381 * @license lucide-react v0.475.0 - ISC
382 *
383 * This source code is licensed under the ISC license.
384 * See the LICENSE file in the root directory of this source tree.
385 */const pte=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],cM=He("Pen",pte);/**
386 * @license lucide-react v0.475.0 - ISC
387 *
388 * This source code is licensed under the ISC license.
389 * See the LICENSE file in the root directory of this source tree.
390 */const gte=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],UT=He("Pencil",gte);/**
391 * @license lucide-react v0.475.0 - ISC
392 *
393 * This source code is licensed under the ISC license.
394 * See the LICENSE file in the root directory of this source tree.
395 */const vte=[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]],uM=He("Phone",vte);/**
396 * @license lucide-react v0.475.0 - ISC
397 *
398 * This source code is licensed under the ISC license.
399 * See the LICENSE file in the root directory of this source tree.
400 */const xte=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],_s=He("Play",xte);/**
401 * @license lucide-react v0.475.0 - ISC
402 *
403 * This source code is licensed under the ISC license.
404 * See the LICENSE file in the root directory of this source tree.
405 */const yte=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],li=He("Plus",yte);/**
406 * @license lucide-react v0.475.0 - ISC
407 *
408 * This source code is licensed under the ISC license.
409 * See the LICENSE file in the root directory of this source tree.
410 */const bte=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],aB=He("Power",bte);/**
411 * @license lucide-react v0.475.0 - ISC
412 *
413 * This source code is licensed under the ISC license.
414 * See the LICENSE file in the root directory of this source tree.
415 */const wte=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],jte=He("Printer",wte);/**
416 * @license lucide-react v0.475.0 - ISC
417 *
418 * This source code is licensed under the ISC license.
419 * See the LICENSE file in the root directory of this source tree.
420 */const _te=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],oB=He("QrCode",_te);/**
421 * @license lucide-react v0.475.0 - ISC
422 *
423 * This source code is licensed under the ISC license.
424 * See the LICENSE file in the root directory of this source tree.
425 */const Nte=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]],lB=He("Radio",Nte);/**
426 * @license lucide-react v0.475.0 - ISC
427 *
428 * This source code is licensed under the ISC license.
429 * See the LICENSE file in the root directory of this source tree.
430 */const Ste=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ah=He("RefreshCw",Ste);/**
431 * @license lucide-react v0.475.0 - ISC
432 *
433 * This source code is licensed under the ISC license.
434 * See the LICENSE file in the root directory of this source tree.
435 */const kte=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],M1=He("RotateCcw",kte);/**
436 * @license lucide-react v0.475.0 - ISC
437 *
438 * This source code is licensed under the ISC license.
439 * See the LICENSE file in the root directory of this source tree.
440 */const Ete=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Hy=He("Save",Ete);/**
441 * @license lucide-react v0.475.0 - ISC
442 *
443 * This source code is licensed under the ISC license.
444 * See the LICENSE file in the root directory of this source tree.
445 */const Pte=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],dM=He("ScanSearch",Pte);/**
446 * @license lucide-react v0.475.0 - ISC
447 *
448 * This source code is licensed under the ISC license.
449 * See the LICENSE file in the root directory of this source tree.
450 */const Cte=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Ld=He("Search",Cte);/**
451 * @license lucide-react v0.475.0 - ISC
452 *
453 * This source code is licensed under the ISC license.
454 * See the LICENSE file in the root directory of this source tree.
455 */const Ate=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],cB=He("Send",Ate);/**
456 * @license lucide-react v0.475.0 - ISC
457 *
458 * This source code is licensed under the ISC license.
459 * See the LICENSE file in the root directory of this source tree.
460 */const Ote=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],VT=He("Settings",Ote);/**
461 * @license lucide-react v0.475.0 - ISC
462 *
463 * This source code is licensed under the ISC license.
464 * See the LICENSE file in the root directory of this source tree.
465 */const Tte=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Ho=He("Share2",Tte);/**
466 * @license lucide-react v0.475.0 - ISC
467 *
468 * This source code is licensed under the ISC license.
469 * See the LICENSE file in the root directory of this source tree.
470 */const Rte=[["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",ke
470y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Mte=He("ShieldAlert",Rte);/**
471 * @license lucide-react v0.475.0 - ISC
472 *
473 * This source code is licensed under the ISC license.
474 * See the LICENSE file in the root directory of this source tree.
475 */const Ite=[["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"}]],uB=He("Shield",Ite);/**
476 * @license lucide-react v0.475.0 - ISC
477 *
478 * This source code is licensed under the ISC license.
479 * See the LICENSE file in the root directory of this source tree.
480 */const Dte=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],ej=He("ShoppingCart",Dte);/**
481 * @license lucide-react v0.475.0 - ISC
482 *
483 * This source code is licensed under the ISC license.
484 * See the LICENSE file in the root directory of this source tree.
485 */const Lte=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],sA=He("Smartphone",Lte);/**
486 * @license lucide-react v0.475.0 - ISC
487 *
488 * This source code is licensed under the ISC license.
489 * See the LICENSE file in the root directory of this source tree.
490 */const Fte=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],es=He("Sparkles",Fte);/**
491 * @license lucide-react v0.475.0 - ISC
492 *
493 * This source code is licensed under the ISC license.
494 * See the LICENSE file in the root directory of this source tree.
495 */const $te=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],qte=He("SquarePen",$te);/**
496 * @license lucide-react v0.475.0 - ISC
497 *
498 * This source code is licensed under the ISC license.
499 * See the LICENSE file in the root directory of this source tree.
500 */const zte=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Za=He("Star",zte);/**
501 * @license lucide-react v0.475.0 - ISC
502 *
503 * This source code is licensed under the ISC license.
504 * See the LICENSE file in the root directory of this source tree.
505 */const Bte=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Ute=He("Tag",Bte);/**
506 * @license lucide-react v0.475.0 - ISC
507 *
508 * This source code is licensed under the ISC license.
509 * See the LICENSE file in the root directory of this source tree.
510 */const Vte=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],vg=He("Target",Vte);/**
511 * @license lucide-react v0.475.0 - ISC
512 *
513 * This source code is licensed under the ISC license.
514 * See the LICENSE file in the root directory of this source tree.
515 */const Wte=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],Hte=He("ThumbsDown",Wte);/**
516 * @license lucide-react v0.475.0 - ISC
517 *
518 * This source code is licensed under the ISC license.
519 * See the LICENSE file in the root directory of this source tree.
520 */const Kte=[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]],Vr=He("Ticket",Kte);/**
521 * @license lucide-react v0.475.0 - ISC
522 *
523 * This source code is licensed under the ISC license.
524 * See the LICENSE file in the root directory of this source tree.
525 */const Gte=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Qte=He("Timer",Gte);/**
526 * @license lucide-react v0.475.0 - ISC
527 *
528 * This source code is licensed under the ISC license.
529 * See the LICENSE file in the root directory of this source tree.
530 */const Yte=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
530],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],ci=He("Trash2",Yte);/**
531 * @license lucide-react v0.475.0 - ISC
532 *
533 * This source code is licensed under the ISC license.
534 * See the LICENSE file in the root directory of this source tree.
535 */const Xte=[["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"}]],dB=He("TrendingDown",Xte);/**
536 * @license lucide-react v0.475.0 - ISC
537 *
538 * This source code is licensed under the ISC license.
539 * See the LICENSE file in the root directory of this source tree.
540 */const Zte=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],ro=He("TrendingUp",Zte);/**
541 * @license lucide-react v0.475.0 - ISC
542 *
543 * This source code is licensed under the ISC license.
544 * See the LICENSE file in the root directory of this source tree.
545 */const Jte=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ba=He("TriangleAlert",Jte);/**
546 * @license lucide-react v0.475.0 - ISC
547 *
548 * This source code is licensed under the ISC license.
549 * See the LICENSE file in the root directory of this source tree.
550 */const ene=[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]],Jt=He("Trophy",ene);/**
551 * @license lucide-react v0.475.0 - ISC
552 *
553 * This source code is licensed under the ISC license.
554 * See the LICENSE file in the root directory of this source tree.
555 */const tne=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],nne=He("Undo2",tne);/**
556 * @license lucide-react v0.475.0 - ISC
557 *
558 * This source code is licensed under the ISC license.
559 * See the LICENSE file in the root directory of this source tree.
560 */const rne=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],ma=He("Upload",rne);/**
561 * @license lucide-react v0.475.0 - ISC
562 *
563 * This source code is licensed under the ISC license.
564 * See the LICENSE file in the root directory of this source tree.
565 */const ine=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],zo=He("User",ine);/**
566 * @license lucide-react v0.475.0 - ISC
567 *
568 * This source code is licensed under the ISC license.
569 * See the LICENSE file in the root directory of this source tree.
570 */const sne=[["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"}]],Dr=He("Users",sne);/**
571 * @license lucide-react v0.475.0 - ISC
572 *
573 * This source code is licensed under the ISC license.
574 * See the LICENSE file in the root directory of this source tree.
575 */const ane=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],fB=He("WandSparkles",ane);/**
576 * @license lucide-react v0.475.0 - ISC
577 *
578 * This source code is licensed under the ISC license.
579 * See the LICENSE file in the root directory of this source tree.
580 */const one=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}
vendor: 4,905 bytes, lines 580-600
580],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],lne=He("WifiOff",one);/**
581 * @license lucide-react v0.475.0 - ISC
582 *
583 * This source code is licensed under the ISC license.
584 * See the LICENSE file in the root directory of this source tree.
585 */const cne=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],une=He("Wifi",cne);/**
586 * @license lucide-react v0.475.0 - ISC
587 *
588 * This source code is licensed under the ISC license.
589 * See the LICENSE file in the root directory of this source tree.
590 */const dne=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],WT=He("Wrench",dne);/**
591 * @license lucide-react v0.475.0 - ISC
592 *
593 * This source code is licensed under the ISC license.
594 * See the LICENSE file in the root directory of this source tree.
595 */const fne=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Si=He("X",fne);/**
596 * @license lucide-react v0.475.0 - ISC
597 *
598 * This source code is licensed under the ISC license.
599 * See the LICENSE file in the root directory of this source tree.
600 */const hne=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Kc=He("Zap",hne),HT="-",mne=e=>{const t=gne(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(HT);return l[0]===""&&l.length!==1&&l.shift(),hB(l,t)||pne(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},hB=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?hB(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(HT);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},fM=/^\[(.+)\]$/,pne=e=>{if(fM.test(e)){const t=fM.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},gne=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const s in n)aA(n[s],r,s,t);return r},aA=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:hM(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(vne(s)){aA(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,o])=>{aA(o,hM(t,a),n,r)})})},hM=(e,t)=>{let n=e;return t.split(HT).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},vne=e=>e.isThemeGetter,xne=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return s(a,o),o},set(a,o){n.has(a)?n.set(a,o):s(a,o)}}},oA="!",lA=":",yne=lA.length,bne=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let o=0,l=0,c=0,u;for(let w=0;w<s.length;w++){let v=s[w];if(o===0&&l===0){if(v===lA){a.push(s.slice(c,w)),c=w+yne;continue}if(v==="/"){u=w;continue}}v==="["?o++:v==="]"?o--:v==="("?l++:v===")"&&l--}const h=a.length===0?s:s.substring(c),d=wne(h),m=d!==h,g=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:m,baseClassName:d,maybePostfixModifierPosition:g}};if(t){const s=t+lA,a=r;r=o=>o.startsWith(s)?a(o.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},wne=e=>e.endsWith(oA)?e.substring(0,e.length-1):e.startsWith(oA)?e.substring(1):e,jne=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let a=[];return r.forEach(o=>{o[0]==="["||t[o]?(s.push(...a.sort(),o),a=[]):a.push(o)}),s.push(...a.sort()),s}},_ne=e=>({cache:xne(e.cacheSize),parseClassName:bne(e),sortModifiers:jne(e),...mne(e)}),Nne=/\s+/,Sne=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,o=[],l=e.trim().split(Nne);let c="";for(let u=l.length-1;u>=0;u-=1){const h=l[u],{isExternal:d,modifiers:m,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:v}=n(h);if(d){c=h+(c.length>0?" "+c:c);continue}let b=!!v,y=r(b?w.substring(0,v):w);if(!y){if(!b){c=h+(c.length>0?" "+c:c);continue}if(y=r(w),!y){c=h+(c.length>0?" "+c:c);continue}b=!1}const _=a(m).join(":"),N=g?_+oA:_,j=N+y;if(o.includes(j))continue;o.push(j);const S=s(y,b);for(let C=0;C<S.length;++C){const P=S[C];o.push(N+P)}c=h+(c.length>0?" "+c:c)}return c};
vendor: 4,261 bytes, line 600
600function kne(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=mB(t))&&(r&&(r+=" "),r+=n);return r}const mB=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=mB(e[r]))&&(n&&(n+=" "),n+=t);return n};function Ene(e,...t){let n,r,s,a=o;function o(c){const u=t.reduce((h,d)=>d(h),e());return n=_ne(u),r=n.cache.get,s=n.cache.set,a=l,l(c)}function l(c){const u=r(c);if(u)return u;const h=Sne(c,n);return s(c,h),h}return function(){return a(kne.apply(null,arguments))}}const ni=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},pB=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gB=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Pne=/^\d+\/\d+$/,Cne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ane=/\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$/,One=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Tne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Rne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pp=e=>Pne.test(e),hn=e=>!!e&&!Number.isNaN(Number(e)),nd=e=>!!e&&Number.isInteger(Number(e)),uS=e=>e.endsWith("%")&&hn(e.slice(0,-1)),Oc=e=>Cne.test(e),Mne=()=>!0,Ine=e=>Ane.test(e)&&!One.test(e),vB=()=>!1,Dne=e=>Tne.test(e),Lne=e=>Rne.test(e),Fne=e=>!yt(e)&&!bt(e),$ne=e=>tv(e,bB,vB),yt=e=>pB.test(e),Gf=e=>tv(e,wB,Ine),dS=e=>tv(e,Vne,hn),mM=e=>tv(e,xB,vB),qne=e=>tv(e,yB,Lne),Yw=e=>tv(e,jB,Dne),bt=e=>gB.test(e),Gx=e=>nv(e,wB),zne=e=>nv(e,Wne),pM=e=>nv(e,xB),Bne=e=>nv(e,bB),Une=e=>nv(e,yB),Xw=e=>nv(e,jB,!0),tv=(e,t,n)=>{const r=pB.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},nv=(e,t,n=!1)=>{const r=gB.exec(e);return r?r[1]?t(r[1]):n:!1},xB=e=>e==="position"||e==="percentage",yB=e=>e==="image"||e==="url",bB=e=>e==="length"||e==="size"||e==="bg-size",wB=e=>e==="length",Vne=e=>e==="number",Wne=e=>e==="family-name",jB=e=>e==="shadow",Hne=()=>{const e=ni("color"),t=ni("font"),n=ni("text"),r=ni("font-weight"),s=ni("tracking"),a=ni("leading"),o=ni("breakpoint"),l=ni("container"),c=ni("spacing"),u=ni("radius"),h=ni("shadow"),d=ni("inset-shadow"),m=ni("text-shadow"),g=ni("drop-shadow"),w=ni("blur"),v=ni("perspective"),b=ni("aspect"),y=ni("ease"),_=ni("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...j(),bt,yt],C=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],A=()=>[bt,yt,c],F=()=>[Pp,"full","auto",...A()],I=()=>[nd,"none","subgrid",bt,yt],R=()=>["auto",{span:["full",nd,bt,yt]},nd,bt,yt],M=()=>[nd,"auto",bt,yt],$=()=>["auto","min","max","fr",bt,yt],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...A()],Z=()=>[Pp,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],X=()=>[e,bt,yt],V=()=>[...j(),pM,mM,{position:[bt,yt]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",Bne,$ne,{size:[bt,yt]}],W=()=>[uS,Gx,Gf],Q=()=>["","none","full",u,bt,yt],J=()=>["",hn,Gx,Gf],ne=()=>["solid","dashed","dotted","double"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[hn,uS,pM,mM],le=()=>["","none",w,bt,yt],re=()=>["none",hn,bt,yt],fe=()=>["none",hn,bt,yt],ge=()=>[hn,bt,yt],he=()=>[Pp,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oc],breakpoint:[Oc],color:[Mne],container:[Oc],"drop-shadow":[Oc],ease:["in","out","in-out"],font:[Fne],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oc],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oc],shadow:[Oc],spacing:["px",hn],text:[Oc],"text-shadow":[Oc],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pp,yt,bt,b]}
vendor: 12,845 bytes, line 600
600],container:["container"],columns:[{columns:[hn,yt,bt,l]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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"],sr:["sr-only","not-sr-only"],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:S()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[nd,"auto",bt,yt]}],basis:[{basis:[Pp,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[hn,Pp,"auto","initial","none",yt]}],grow:[{grow:["",hn,bt,yt]}],shrink:[{shrink:["",hn,bt,yt]}],order:[{order:[nd,"first","last","none",bt,yt]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],w:[{w:[l,"screen",...Z()]}],"min-w":[{"min-w":[l,"screen","none",...Z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,Gx,Gf]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,bt,dS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",uS,yt]}],"font-family":[{font:[zne,yt,t]}],"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:[s,bt,yt]}],"line-clamp":[{"line-clamp":[hn,"none",bt,dS]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",bt,yt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",bt,yt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[hn,"from-font","auto",bt,Gf]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[hn,"auto",bt,yt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",bt,yt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",bt,yt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},nd,bt,yt],radial:["",bt,yt],conic:[nd,bt,yt]},Une,qne]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[hn,bt,yt]}],"outline-w":[{outline:["",hn,Gx,Gf]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",h,Xw,Yw]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",d,Xw,Yw]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[hn,Gf]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",m,Xw,Yw]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[hn,bt,yt]}],"mix-blend":[{"mix-blend":[...Y(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Y()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[hn]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[bt,yt]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[hn]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",bt,yt]}],filter:[{filter:["","none",bt,yt]}],blur:[{blur:le()}],brightness:[{brightness:[hn,bt,yt]}],contrast:[{contrast:[hn,bt,yt]}],"drop-shadow":[{"drop-shadow":["","none",g,Xw,Yw]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",hn,bt,yt]}],"hue-rotate":[{"hue-rotate":[hn,bt,yt]}],invert:[{invert:["",hn,bt,yt]}],saturate:[{saturate:[hn,bt,yt]}],sepia:[{sepia:["",hn,bt,yt]}],"backdrop-filter":[{"backdrop-filter":["","none",bt,yt]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[hn,bt,yt]}],"backdrop-contrast":[{"backdrop-contrast":[hn,bt,yt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",hn,bt,yt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[hn,bt,yt]}],"backdrop-invert":[{"backdrop-invert":["",hn,bt,yt]}],"backdrop-opacity":[{"backdrop-opacity":[hn,bt,yt]}],"backdrop-saturate":[{"backdrop-saturate":[hn,bt,yt]}],"backdrop-sepia":[{"backdrop-sepia":["",hn,bt,yt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",bt,yt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[hn,"initial",bt,yt]}],ease:[{ease:["linear","initial",y,bt,yt]}],delay:[{delay:[hn,bt,yt]}],animate:[{animate:["none",_,bt,yt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,bt,yt]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[bt,yt,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}
vendor: 6,528 bytes, line 600
600],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",bt,yt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",bt,yt]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[hn,Gx,Gf,dS]}],stroke:[{stroke:["none",...X()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},T_=Ene(Hne);function Nt(...e){return T_(Tt(e))}const _B=O.forwardRef(({...e},t)=>i.jsx("div",{ref:t,className:"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",...e}));_B.displayName="ToastProvider";const NB=O.forwardRef(({...e},t)=>i.jsx("div",{ref:t,className:"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",...e}));NB.displayName="ToastViewport";const Kne=Vy("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),SB=O.forwardRef(({className:e,variant:t,...n},r)=>i.jsx("div",{ref:r,className:Nt(Kne({variant:t}),e),...n}));SB.displayName="Toast";const Gne=O.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Nt("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Gne.displayName="ToastAction";
600const kB=O.forwardRef(({className:e,...t},n)=>i.jsx("button",{ref:n,className:Nt("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:i.jsx(Si,{className:"h-4 w-4"})}));kB.displayName="ToastClose";const EB=O.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Nt("text-sm font-semibold",e),...t}));EB.displayName="ToastTitle";const PB=O.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Nt("text-sm opacity-90",e),...t}));PB.displayName="ToastDescription";function Qne(){const{toasts:e}=UJ();return i.jsxs(_B,{children:[e.map(function({id:t,title:n,description:r,action:s,...a}){return i.jsxs(SB,{...a,children:[i.jsxs("div",{className:"grid gap-1",children:[n&&i.jsx(EB,{children:n}),r&&i.jsx(PB,{children:r})]}),s,i.jsx(kB,{})]},t)}),i.jsx(NB,{})]})}var rv=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Yne={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},dd,LT,q8,Xne=(q8=class{constructor(){kt(this,dd,Yne);kt(this,LT,!1)}setTimeoutProvider(e){ft(this,dd,e)}setTimeout(e,t){return xe(this,dd).setTimeout(e,t)}clearTimeout(e){xe(this,dd).clearTimeout(e)}setInterval(e,t){return xe(this,dd).setInterval(e,t)}clearInterval(e){xe(this,dd).clearInterval(e)}},dd=new WeakMap,LT=new WeakMap,q8),oh=new Xne;function Zne(e){setTimeout(e,0)}var Oh=typeof window>"u"||"Deno"in globalThis;function gs(){}function Jne(e,t){return typeof e=="function"?e(t):e}function cA(e){return typeof e=="number"&&e>=0&&e!==1/0}function CB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function kd(e,t){return typeof e=="function"?e(t):e}function Ga(e,t){return typeof e=="function"?e(t):e}function gM(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==KT(o,t.options))return!1}else if(!U0(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function vM(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Th(t.options.mutationKey)!==Th(a))return!1}else if(!U0(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function KT(e,t){return((t==null?void 0:t.queryKeyHashFn)||Th)(e)}function Th(e){return JSON.stringify(e,(t,n)=>uA(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function U0(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>U0(e[n],t[n])):!1}var ere=Object.prototype.hasOwnProperty;function AB(e,t){if(e===t)return e;const n=xM(e)&&xM(t);if(!n&&!(uA(e)&&uA(t)))return t;const s=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),o=a.length,l=n?new Array(o):{};let c=0;for(let u=0;u<o;u++){const h=n?u:a[u],d=e[h],m=t[h];if(d===m){l[h]=d,(n?u<s:ere.call(e,h))&&c++;continue}if(d===null||m===null||typeof d!="object"||typeof m!="object"){l[h]=m;continue}const g=AB(d,m);l[h]=g,g===d&&c++}return s===o&&c===s?e:l}function tj(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function xM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function uA(e){if(!yM(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!yM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function yM(e){return Object.prototype.toString.call(e)==="[object Object]"}function tre(e){return new Promise(t=>{oh.setTimeout(t,e)})}function dA(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?AB(e,t):t}function nre(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function rre(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var GT=Symbol();function OB(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===GT?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function TB(e,t){return typeof e=="function"?e(...t):!!e}var ph,fd,rg,z8,ire=(z8=class extends rv{constructor(){super();kt(this,ph);kt(this,fd);
vendor: 3,069 bytes, line 600
600kt(this,rg);ft(this,rg,t=>{if(!Oh&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){xe(this,fd)||this.setEventListener(xe(this,rg))}onUnsubscribe(){var t;this.hasListeners()||((t=xe(this,fd))==null||t.call(this),ft(this,fd,void 0))}setEventListener(t){var n;ft(this,rg,t),(n=xe(this,fd))==null||n.call(this),ft(this,fd,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){xe(this,ph)!==t&&(ft(this,ph,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof xe(this,ph)=="boolean"?xe(this,ph):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ph=new WeakMap,fd=new WeakMap,rg=new WeakMap,z8),QT=new ire;function fA(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var sre=Zne;function are(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=sre;const a=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var si=are(),ig,hd,sg,B8,ore=(B8=class extends rv{constructor(){super();kt(this,ig,!0);kt(this,hd);kt(this,sg);ft(this,sg,t=>{if(!Oh&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){xe(this,hd)||this.setEventListener(xe(this,sg))}onUnsubscribe(){var t;this.hasListeners()||((t=xe(this,hd))==null||t.call(this),ft(this,hd,void 0))}setEventListener(t){var n;ft(this,sg,t),(n=xe(this,hd))==null||n.call(this),ft(this,hd,t(this.setOnline.bind(this)))}setOnline(t){xe(this,ig)!==t&&(ft(this,ig,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return xe(this,ig)}},ig=new WeakMap,hd=new WeakMap,sg=new WeakMap,B8),nj=new ore;function lre(e){return Math.min(1e3*2**e,3e4)}function RB(e){return(e??"online")==="online"?nj.isOnline():!0}var hA=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function MB(e){let t=!1,n=0,r;const s=fA(),a=()=>s.status!=="pending",o=v=>{var b;if(!a()){const y=new hA(v);m(y),(b=e.onCancel)==null||b.call(e,y)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>QT.isFocused()&&(e.networkMode==="always"||nj.isOnline())&&e.canRun(),h=()=>RB(e.networkMode)&&e.canRun(),d=v=>{a()||(r==null||r(),s.resolve(v))},m=v=>{a()||(r==null||r(),s.reject(v))},g=()=>new Promise(v=>{var b;r=y=>{(a()||u())&&v(y)},(b=e.onPause)==null||b.call(e)}).then(()=>{var v;r=void 0,a()||(v=e.onContinue)==null||v.call(e)}),w=()=>
vendor: 4,401 bytes, line 600
600{if(a())return;let v;const b=n===0?e.initialPromise:void 0;try{v=b??e.fn()}catch(y){v=Promise.reject(y)}Promise.resolve(v).then(d).catch(y=>{var C;if(a())return;const _=e.retry??(Oh?0:3),N=e.retryDelay??lre,j=typeof N=="function"?N(n,y):N,S=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(t||!S){m(y);return}n++,(C=e.onFail)==null||C.call(e,n,y),tre(j).then(()=>u()?void 0:g()).then(()=>{t?m(y):w()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:l,continueRetry:c,canStart:h,start:()=>(h()?w():g().then(w),s)}}var gh,U8,IB=(U8=class{constructor(){kt(this,gh)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cA(this.gcTime)&&ft(this,gh,oh.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Oh?1/0:300*1e3))}clearGcTimeout(){xe(this,gh)&&(oh.clearTimeout(xe(this,gh)),ft(this,gh,void 0))}},gh=new WeakMap,U8),vh,ag,Ka,xh,wi,Fy,yh,Io,Rc,V8,cre=(V8=class extends IB{constructor(t){super();kt(this,Io);kt(this,vh);kt(this,ag);kt(this,Ka);kt(this,xh);kt(this,wi);kt(this,Fy);kt(this,yh);ft(this,yh,!1),ft(this,Fy,t.defaultOptions),this.setOptions(t.options),this.observers=[],ft(this,xh,t.client),ft(this,Ka,xe(this,xh).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ft(this,vh,bM(this.options)),this.state=t.state??xe(this,vh),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=xe(this,wi))==null?void 0:t.promise}setOptions(t){if(this.options={...xe(this,Fy),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=bM(this.options);n.data!==void 0&&(this.setData(n.data,{updatedAt:n.dataUpdatedAt,manual:!0}),ft(this,vh,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&xe(this,Ka).remove(this)}setData(t,n){const r=dA(this.state.data,t,this.options);return cn(this,Io,Rc).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){cn(this,Io,Rc).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=xe(this,wi))==null?void 0:r.promise;return(s=xe(this,wi))==null||s.cancel(t),n?n.then(gs).catch(gs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(xe(this,vh))}isActive(){return this.observers.some(t=>Ga(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===GT||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>kd(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!CB(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=xe(this,wi))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=xe(this,wi))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),xe(this,Ka).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(xe(this,wi)&&(xe(this,yh)?xe(this,wi).cancel({revert:!0}):xe(this,wi).cancelRetry()),this.scheduleGc()),xe(this,Ka).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||cn(this,Io,Rc).call(this,{type:"invalidate"})}async fetch(t,n){var c,u,h,d,m,g,w,v,b,y,_,N;if(this.state.fetchStatus!=="idle"&&((c=xe(this,wi))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(xe(this,wi))return xe(this,wi).continueRetry(),xe(this,wi).promise}if(t&&this.setOptions(t),!this.options.queryFn){const j=this.observers.find(S=>S.options.queryFn);j&&this.setOptions(j.options)}const r=new AbortController,s=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(ft(this,yh,!0),r.signal)}
vendor: 7,829 bytes, line 600
600)},a=()=>{const j=OB(this.options,n),C=(()=>{const P={client:xe(this,xh),queryKey:this.queryKey,meta:this.meta};return s(P),P})();return ft(this,yh,!1),this.options.persister?this.options.persister(j,C,this):j(C)},l=(()=>{const j={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:xe(this,xh),state:this.state,fetchFn:a};return s(j),j})();(u=this.options.behavior)==null||u.onFetch(l,this),ft(this,ag,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&cn(this,Io,Rc).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),ft(this,wi,MB({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:j=>{j instanceof hA&&j.revert&&this.setState({...xe(this,ag),fetchStatus:"idle"}),r.abort()},onFail:(j,S)=>{cn(this,Io,Rc).call(this,{type:"failed",failureCount:j,error:S})},onPause:()=>{cn(this,Io,Rc).call(this,{type:"pause"})},onContinue:()=>{cn(this,Io,Rc).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const j=await xe(this,wi).start();if(j===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(j),(g=(m=xe(this,Ka).config).onSuccess)==null||g.call(m,j,this),(v=(w=xe(this,Ka).config).onSettled)==null||v.call(w,j,this.state.error,this),j}catch(j){if(j instanceof hA){if(j.silent)return xe(this,wi).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw cn(this,Io,Rc).call(this,{type:"error",error:j}),(y=(b=xe(this,Ka).config).onError)==null||y.call(b,j,this),(N=(_=xe(this,Ka).config).onSettled)==null||N.call(_,this.state.data,j,this),j}finally{this.scheduleGc()}}},vh=new WeakMap,ag=new WeakMap,Ka=new WeakMap,xh=new WeakMap,wi=new WeakMap,Fy=new WeakMap,yh=new WeakMap,Io=new WeakSet,Rc=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...DB(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ft(this,ag,t.manual?s:void 0),s;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),si.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),xe(this,Ka).notify({query:this,type:"updated",action:t})})},V8);function DB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:RB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function bM(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Us,bn,$y,hs,bh,og,Ic,md,qy,lg,cg,wh,jh,pd,ug,$n,h0,mA,pA,gA,vA,xA,yA,bA,LB,W8,ure=(W8=class extends rv{constructor(t,n){super();kt(this,$n);kt(this,Us);kt(this,bn);kt(this,$y);kt(this,hs);kt(this,bh);kt(this,og);kt(this,Ic);kt(this,md);kt(this,qy);kt(this,lg);kt(this,cg);kt(this,wh);kt(this,jh);kt(this,pd);kt(this,ug,new Set);this.options=n,ft(this,Us,t),ft(this,md,null),ft(this,Ic,fA()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(xe(this,bn).addObserver(this),wM(xe(this,bn),this.options)?cn(this,$n,h0).call(this):this.updateResult(),cn(this,$n,vA).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wA(xe(this,bn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wA(xe(this,bn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,cn(this,$n,xA).call(this),cn(this,$n,yA).call(this),xe(this,bn).removeObserver(this)}setOptions(t){const n=this.options,r=xe(this,bn);if(this.options=xe(this,Us).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ga(this.options.enabled,xe(this,bn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");cn(this,$n,bA).call(this),xe(this,bn).setOptions(this.options),n._defaulted&&!tj(this.options,n)&&xe(this,Us).getQueryCache().notify({type:"observerOptionsUpdated",query:xe(this,bn),observer:this});const s=this.hasListeners();s&&jM(xe(this,bn),r,this.options,n)&&cn(this,$n,h0).call(this),this.updateResult(),s&&(xe(this,bn)!==r||Ga(this.options.enabled,xe(this,bn))!==Ga(n.enabled,xe(this,bn))||kd(this.options.staleTime,xe(this,bn))!==kd(n.staleTime,xe(this,bn)))&&cn(this,$n,mA).call(this);const a=cn(this,$n,pA).call(this);s&&(xe(this,bn)!==r||Ga(this.options.enabled,xe(this,bn))!==Ga(n.enabled,xe(this,bn))||a!==xe(this,pd))&&cn(this,$n,gA).call(this,a)}getOptimisticResult(t){const n=xe(this,Us).getQueryCache().build(xe(this,Us),t),r=this.createResult(n,t);return fre(this,r)&&(ft(this,hs,r),ft(this,og,this.options),ft(this,bh,xe(this,bn).state)),r}getCurrentResult(){return xe(this,hs)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&!this.options.experimental_prefetchInRender&&xe(this,Ic).status==="pending"&&xe(this,Ic).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,s))})}trackProp(t){xe(this,ug).add(t)}getCurrentQuery(){return xe(this,bn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=xe(this,Us).defaultQueryOptions(t),r=xe(this,Us).getQueryCache().build(xe(this,Us),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return cn(this,$n,h0).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),xe(this,hs)))}createResult(t,n){var F;const r=xe(this,bn),s=this.options,a=xe(this,hs),o=xe(this,bh),l=xe(this,og),u=t!==r?t.state:xe(this,$y),{state:h}=t;let d={...h},m=!1,g;if(n._optimisticResults){const I=this.hasListeners(),R=!I&&wM(t,n),M=I&&jM(t,r,n,s);(R||M)&&(d={...d,...DB(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:w,errorUpdatedAt:v,status:b}=d;g=d.data;let y=!1;if(n.placeholderData!==void 0&&g===void 0&&b==="pending"){let I;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=a.data,y=!0):I=typeof n.placeholderData=="function"?n.placeholderData((F=xe(this,cg))==null?void 0:F.state.data,xe(this,cg)):n.placeholderData,I!==void 0&&(b="success",g=dA(a==null?void 0:a.data,I,n),m=!0)}if(n.select&&g!==void 0&&!y)if(a&&g===(o==null?void 0:o.data)&&n.select===xe(this,qy))g=xe(this,lg);else try{ft(this,qy,n.select),g=n.select(g),g=dA(a==null?void 0:a.data,g,n),ft(this,lg,g),ft(this,md,null)}catch(I){ft(this,md,I)}xe(this,md)&&(w=xe(this,md),g=xe(this,lg),v=Date.now(),b="error");const _=d.fetchStatus==="fetching",N=b==="pending",j=b==="error",S=N&&_,C=g!==void 0,A={status:b,fetchStatus:d.fetchStatus,isPending:N,isSuccess:b==="success",isError:j,isInitialLoading:S,isLoading:S,data:g,dataUpdatedAt:d.dataUpdatedAt,error:w,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdate
vendor: 8,487 bytes, line 600
600Count:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:_,isRefetching:_&&!N,isLoadingError:j&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:j&&C,isStale:YT(t,n),refetch:this.refetch,promise:xe(this,Ic),isEnabled:Ga(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=$=>{A.status==="error"?$.reject(A.error):A.data!==void 0&&$.resolve(A.data)},R=()=>{const $=ft(this,Ic,A.promise=fA());I($)},M=xe(this,Ic);switch(M.status){case"pending":t.queryHash===r.queryHash&&I(M);break;case"fulfilled":(A.status==="error"||A.data!==M.value)&&R();break;case"rejected":(A.status!=="error"||A.error!==M.reason)&&R();break}}return A}updateResult(){const t=xe(this,hs),n=this.createResult(xe(this,bn),this.options);if(ft(this,bh,xe(this,bn).state),ft(this,og,this.options),xe(this,bh).data!==void 0&&ft(this,cg,xe(this,bn)),tj(n,t))return;ft(this,hs,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!xe(this,ug).size)return!0;const o=new Set(a??xe(this,ug));return this.options.throwOnError&&o.add("error"),Object.keys(xe(this,hs)).some(l=>{const c=l;return xe(this,hs)[c]!==t[c]&&o.has(c)})};cn(this,$n,LB).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&cn(this,$n,vA).call(this)}},Us=new WeakMap,bn=new WeakMap,$y=new WeakMap,hs=new WeakMap,bh=new WeakMap,og=new WeakMap,Ic=new WeakMap,md=new WeakMap,qy=new WeakMap,lg=new WeakMap,cg=new WeakMap,wh=new WeakMap,jh=new WeakMap,pd=new WeakMap,ug=new WeakMap,$n=new WeakSet,h0=function(t){cn(this,$n,bA).call(this);let n=xe(this,bn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(gs)),n},mA=function(){cn(this,$n,xA).call(this);const t=kd(this.options.staleTime,xe(this,bn));if(Oh||xe(this,hs).isStale||!cA(t))return;const r=CB(xe(this,hs).dataUpdatedAt,t)+1;ft(this,wh,oh.setTimeout(()=>{xe(this,hs).isStale||this.updateResult()},r))},pA=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(xe(this,bn)):this.options.refetchInterval)??!1},gA=function(t){cn(this,$n,yA).call(this),ft(this,pd,t),!(Oh||Ga(this.options.enabled,xe(this,bn))===!1||!cA(xe(this,pd))||xe(this,pd)===0)&&ft(this,jh,oh.setInterval(()=>{(this.options.refetchIntervalInBackground||QT.isFocused())&&cn(this,$n,h0).call(this)},xe(this,pd)))},vA=function(){cn(this,$n,mA).call(this),cn(this,$n,gA).call(this,cn(this,$n,pA).call(this))},xA=function(){xe(this,wh)&&(oh.clearTimeout(xe(this,wh)),ft(this,wh,void 0))},yA=function(){xe(this,jh)&&(oh.clearInterval(xe(this,jh)),ft(this,jh,void 0))},bA=function(){const t=xe(this,Us).getQueryCache().build(xe(this,Us),this.options);if(t===xe(this,bn))return;const n=xe(this,bn);ft(this,bn,t),ft(this,$y,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},LB=function(t){si.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(xe(this,hs))}),xe(this,Us).getQueryCache().notify({query:xe(this,bn),type:"observerResultsUpdated"})})},W8);function dre(e,t){return Ga(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function wM(e,t){return dre(e,t)||e.state.data!==void 0&&wA(e,t,t.refetchOnMount)}function wA(e,t,n){if(Ga(t.enabled,e)!==!1&&kd(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&YT(e,t)}return!1}function jM(e,t,n,r){return(e!==t||Ga(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&YT(e,n)}function YT(e,t){return Ga(t.enabled,e)!==!1&&e.isStaleByTime(kd(t.staleTime,e))}function fre(e,t){return!tj(e.getCurrentResult(),t)}function _M(e){return{onFetch:(t,n)=>{var h,d,m,g,w;const r=t.options,s=(m=(d=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:d.fetchMore)==null?void 0:m.direction,a=((g=t.state.data)==null?void 0:g.pages)||[],o=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let v=!1;const b=N=>{Object.defineProperty(N,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},y=OB(t.options,t.fetchOptions),_=async(N,j,S)=>{if(v)return Promise.reject();if(j==null&&N.pages.length)return Promise.resolve(N);const P=(()=>{const R={client:t.client,queryKey:t.queryKey,pageParam:j,direction:S?"backward":"forward",meta:t.options.meta};return b(R),R})(),A=await y(P),{maxPages:F}=t.options,I=S?rre:nre;return{pages:I(N.pages,A,F),pageParams:I(N.pageParams,j,F)}};if(s&&a.length){const N=s==="backward",j=N?hre:NM,S={pages:a,pageParams:o},C=j(r,S);l=await _(S,C,N)}else{const N=e??a.length;do{const j=c===0?o[0]??r.initialPageParam:NM(r,l);if(c>0&&j==null)break;l=await _(l,j),c++}while(c<N)}return l};t.options.persister?t.fetchFn=()=>{var v,b;return(b=(v=t.options).persister)==null?void 0:b.call(v,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function NM(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function hre(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var zy,Ol,ms,_h,Tl,sd,H8,mre=(H8=class extends IB{constructor(t){super();kt(this,Tl);kt(this,zy);kt(this,Ol);kt(this,ms);kt(this,_h);ft(this,zy,t.client),this.mutationId=t.mutationId,ft(this,ms,t.mutationCache),ft(this,Ol,[]),this.state=t.state||FB(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){xe(this,Ol).includes(t)||(xe(this,Ol).push(t),this.clearGcTimeout(),xe(this,ms).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ft(this,Ol,xe(this,Ol).filter(n=>n!==t)),this.scheduleGc(),xe(this,ms).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){xe(this,Ol).length||(this.state.status==="pending"?this.scheduleGc():xe(this,ms).remove(this))}continue(){var t;return((t=xe(this,_h))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,c,u,h,d,m,g,w,v,b,y,_,N,j,S,C,P,A,F;const n=()=>{cn(this,Tl,sd).call(this,{type:"continue"})},r={client:xe(this,zy),meta:this.options.meta,mutationKey:this.options.mutationKey};ft(this,_h,MB({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,R)=>{cn(this,Tl,sd).call(this,{type:"failed",failureCount:I,error:R})},onPause:()=>{cn(this,Tl,sd).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>xe(this,ms).canRun(this)}));const s=this.state.status==="pending",a=!xe(this,_h).canStart();try{if(s)n();else{cn(this,Tl,sd).call(this,{type:"pending",variables:t,isPaused:a}),await((l=(o=xe(this,ms).config).onMutate)==null?void 0:l.call(o,t,this,r));const R=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,t,r));R!==this.state.context&&cn(this,Tl,sd).call(this,{type:"pending",context:R,variables:t,isPaused:a})}const I=await xe(this,_h).start();return await((d=(h=xe(this,ms).config).onSuccess)==null?void 0:d.call(h,I,t,this.state.context,this,r)),await((g=(m=this.options).onSuccess)==null?void 0:g.call(m,I,t,this.state.context,r)),await((v=(w=xe(this,ms).config).onSettled)==null?void 0:v.call(w,I,null,this.state.variables,this.state.context,this,r)),await((y=(b=this.options).onSettled)==null?void 0:y.call(b,I,null,t,this.state.context,r)),cn(this,Tl,sd).call(this,{type:"success",data:I}),I}catch(I){try{throw await((N=(_=xe(this,ms).config).onError)==null?void 0:N.call(_,I,t,this.state.context,this,r)),await((S=(j=this.options).onError)==null?void 0:S.call(j,I,t,this.state.context,r)),await((P=(C=xe(this,ms).config).onSettled)==null?void 0:P.call(C,void 0,I,this.state.variables,this.state.context,this,r)),await((F=(A=this.options).onSettled)==null?void 0:F.call(A,void 0,I,t,this.state.context,r)),I}finally{cn(this,Tl,sd).call(this,{type:"error",error:I})}}finally{xe(this,ms).runNext(this)}}},zy=new WeakMap,Ol=new WeakMap,ms=new WeakMap,_h=new WeakMap,Tl=new WeakSet,sd=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};
600case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),si.batch(()=>{xe(this,Ol).forEach(r=>{r.onMutationUpdate(t)}),xe(this,ms).notify({mutation:this,type:"updated",action:t})})},H8);function FB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Dc,Do,By,K8,pre=(K8=class extends rv{constructor(t={}){super();kt(this,Dc);kt(this,Do);kt(this,By);this.config=t,ft(this,Dc,new Set),ft(this,Do,new Map),ft(this,By,0)}build(t,n,r){const s=new mre({client:t,mutationCache:this,mutationId:++Gw(this,By)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){xe(this,Dc).add(t);const n=Zw(t);if(typeof n=="string"){const r=xe(this,Do).get(n);r?r.push(t):xe(this,Do).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(xe(this,Dc).delete(t)){const n=Zw(t);if(typeof n=="string"){const r=xe(this,Do).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&xe(this,Do).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Zw(t);if(typeof n=="string"){const r=xe(this,Do).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Zw(t);if(typeof n=="string"){const s=(r=xe(this,Do).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){si.batch(()=>{xe(this,Dc).forEach(t=>{this.notify({type:"removed",mutation:t})}),xe(this,Dc).clear(),xe(this,Do).clear()})}getAll(){return Array.from(xe(this,Dc))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>vM(n,r))}findAll(t={}){return this.getAll().filter(n=>vM(t,n))}notify(t){si.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return si.batch(()=>Promise.all(t.map(n=>n.continue().catch(gs))))}},Dc=new WeakMap,Do=new WeakMap,By=new WeakMap,K8);function Zw(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Lc,gd,Vs,Fc,Jc,I1,jA,G8,gre=(G8=class extends rv{constructor(n,r){super();kt(this,Jc);kt(this,Lc);kt(this,gd);kt(this,Vs);kt(this,Fc);ft(this,Lc,n),this.setOptions(r),this.bindMethods(),cn(this,Jc,I1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=xe(this,Lc).defaultMutationOptions(n),tj(this.options,r)||xe(this,Lc).getMutationCache().notify({type:"observerOptionsUpdated",mutation:xe(this,Vs),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Th(r.mutationKey)!==Th(this.options.mutationKey)?this.reset():((s=xe(this,Vs))==null?void 0:s.state.status)==="pending"&&xe(this,Vs).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=xe(this,Vs))==null||n.removeObserver(this)}onMutationUpdate(n){cn(this,Jc,I1).call(this),cn(this,Jc,jA).call(this,n)}getCurrentResult(){return xe(this,gd)}reset(){var n;(n=xe(this,Vs))==null||n.removeObserver(this),ft(this,Vs,void 0),cn(this,Jc,I1).call(this),cn(this,Jc,jA).call(this)}mutate(n,r){var s;return ft(this,Fc,r),(s=xe(this,Vs))==null||s.removeObserver(this),ft(this,Vs,xe(this,Lc).getMutationCache().build(xe(this,Lc),this.options)),xe(this,Vs).addObserver(this),xe(this,Vs).execute(n)}},Lc=new WeakMap,gd=new WeakMap,Vs=new WeakMap,Fc=new WeakMap,Jc=new WeakSet,I1=function(){var r;const n=((r=xe(this,Vs))==null?void 0:r.state)??FB();ft(this,gd,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},jA=function(n){si.batch(()=>{var r,s,a,o,l,c,u,h;if(xe(this,Fc)&&this.hasListeners()){const d=xe(this,gd).variables,m=xe(this,gd).context,g={client:xe(this,Lc),meta:this.options.meta,mutationKey:this.options.mutationKey};(n==null?void 0:n.type)==="success"?((s=(r=xe(this,Fc)).onSuccess)==null||s.call(r,n.data,d,m,g),(o=(a=xe(this,Fc)).onSettled)==null||o.call(a,n.data,null,d,m,g)):(n==null?void 0:n.type)==="error"&&((c=(l=xe(this,Fc)).onError)==null||c.call(l,n.error,d,m,g),(h=(u=xe(this,Fc)).onSettled)==null||h.call(u,void 0,n.error,d,m,g))}
vendor: 6,246 bytes, line 600
600this.listeners.forEach(d=>{d(xe(this,gd))})})},G8),Rl,Q8,vre=(Q8=class extends rv{constructor(t={}){super();kt(this,Rl);this.config=t,ft(this,Rl,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??KT(s,n);let o=this.get(a);return o||(o=new cre({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){xe(this,Rl).has(t.queryHash)||(xe(this,Rl).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=xe(this,Rl).get(t.queryHash);n&&(t.destroy(),n===t&&xe(this,Rl).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){si.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return xe(this,Rl).get(t)}getAll(){return[...xe(this,Rl).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>gM(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>gM(t,r)):n}notify(t){si.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){si.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){si.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Rl=new WeakMap,Q8),Er,vd,xd,dg,fg,yd,hg,mg,Y8,xre=(Y8=class{constructor(e={}){kt(this,Er);kt(this,vd);kt(this,xd);kt(this,dg);kt(this,fg);kt(this,yd);kt(this,hg);kt(this,mg);ft(this,Er,e.queryCache||new vre),ft(this,vd,e.mutationCache||new pre),ft(this,xd,e.defaultOptions||{}),ft(this,dg,new Map),ft(this,fg,new Map),ft(this,yd,0)}mount(){Gw(this,yd)._++,xe(this,yd)===1&&(ft(this,hg,QT.subscribe(async e=>{e&&(await this.resumePausedMutations(),xe(this,Er).onFocus())})),ft(this,mg,nj.subscribe(async e=>{e&&(await this.resumePausedMutations(),xe(this,Er).onOnline())})))}unmount(){var e,t;Gw(this,yd)._--,xe(this,yd)===0&&((e=xe(this,hg))==null||e.call(this),ft(this,hg,void 0),(t=xe(this,mg))==null||t.call(this),ft(this,mg,void 0))}isFetching(e){return xe(this,Er).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return xe(this,vd).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=xe(this,Er).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=xe(this,Er).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(kd(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return xe(this,Er).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=xe(this,Er).get(r.queryHash),a=s==null?void 0:s.state.data,o=Jne(t,a);if(o!==void 0)return xe(this,Er).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return si.batch(()=>xe(this,Er).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=xe(this,Er).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=xe(this,Er);si.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=xe(this,Er);return si.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=si.batch(()=>xe(this,Er).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(gs).catch(gs)}invalidateQueries(e,t={}){return si.batch(()=>(xe(this,Er).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=si.batch(()=>xe(this,Er).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(gs)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(gs)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=xe(this,Er).build(this,t);return n.isStaleByTime(kd(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(gs).catch(gs)}fetchInfiniteQuery(e){return e.behavior=_M(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(gs).catch(gs)}ensureInfiniteQueryData(e){return e.behavior=_M(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return nj.isOnline()?xe(this,vd).resumePausedMutations():Promise.resolve()}getQueryCache(){return xe(this,Er)}getMutationCache(){return xe(this,vd)}getDefaultOptions(){return xe(this,xd)}setDefaultOptions(e){ft(this,xd,e)}setQueryDefaults(e,t){xe(this,dg).set(Th(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...xe(this,dg).values()],n={};return t.forEach(r=>{U0(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){xe(this,fg).set(Th(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...xe(this,fg).values()],n={};return t.forEach(r=>{U0(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...xe(this,xd).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=KT(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===GT&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...xe(this,xd).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){xe(this,Er).clear(),xe(this,vd).clear()}},Er=new WeakMap,vd=new WeakMap,xd=new WeakMap,dg=new WeakMap,fg=new WeakMap,yd=new WeakMap,hg=new WeakMap,mg=new WeakMap,Y8),$B=O.createContext(void 0),mn=e=>{const t=O.useContext($B);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},yre=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx($B.Provider,{value:e,children:t})),qB=O.createContext(!1),bre=()=>O.useContext(qB);qB.Provider;function wre(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}
600var jre=O.createContext(wre()),_re=()=>O.useContext(jre),Nre=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Sre=e=>{O.useEffect(()=>{e.clearReset()},[e])},kre=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||TB(n,[e.error,r])),Ere=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Pre=(e,t)=>e.isLoading&&e.isFetching&&!t,Cre=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,SM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Are(e,t,n){var d,m,g,w,v;const r=bre(),s=_re(),a=mn(),o=a.defaultQueryOptions(e);(m=(d=a.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||m.call(d,o),o._optimisticResults=r?"isRestoring":"optimistic",Ere(o),Nre(o,s),Sre(s);const l=!a.getQueryCache().get(o.queryHash),[c]=O.useState(()=>new t(a,o)),u=c.getOptimisticResult(o),h=!r&&e.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(b=>{const y=h?c.subscribe(si.batchCalls(b)):gs;return c.updateResult(),y},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),O.useEffect(()=>{c.setOptions(o)},[o,c]),Cre(o,u))throw SM(o,c,s);if(kre({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((w=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||w.call(g,o,u),o.experimental_prefetchInRender&&!Oh&&Pre(u,r)){const b=l?SM(o,c,s):(v=a.getQueryCache().get(o.queryHash))==null?void 0:v.promise;b==null||b.catch(gs).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function qe(e,t){return Are(e,ure)}function qt(e,t){const n=mn(),[r]=O.useState(()=>new gre(n,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);const s=O.useSyncExternalStore(O.useCallback(o=>r.subscribe(si.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=O.useCallback((o,l)=>{r.mutate(o,l).catch(gs)},[r]);if(s.error&&TB(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const Ore=new xre({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});function Tre(){const[e,t]=O.useState(!1),n=O.useRef(!1),[r,s]=O.useState(!1),a=O.useRef(!1),[o,l]=O.useState(!1),c=O.useRef(!1),u=O.useRef([]),h=O.useRef([]),d=O.useRef([]),m=O.useRef(null),g=(A=!1)=>{const F=document.createElement("div");return F.style.position="absolute",F.style.pointerEvents="none",F.style.transition="all 0.1s ease-in-out",F.style.zIndex="9999",A?F.style.border="2px solid #2563EB":(F.style.border="2px solid #95a5fc",F.style.backgroundColor="rgba(99, 102, 241, 0.05)"),F},w=(A,F,I=!1)=>{if(!F||!n.current)return;F.offsetWidth;const R=F.getBoundingClientRect();A.style.top=`${R.top+window.scrollY}px`,A.style.left=`${R.left+window.scrollX}px`,A.style.width=`${R.width}px`,A.style.height=`${R.height}px`;let M=A.querySelector("div");M||(M=document.createElement("div"),M.textContent=F.tagName.toLowerCase(),M.style.position="absolute",M.style.top="-27px",M.style.left="-2px",M.style.padding="2px 8px",M.style.fontSize="11px",M.style.fontWeight=I?"500":"400",M.style.color=I?"#ffffff":"#526cff",M.style.backgroundColor=I?"#526cff":"#DBEAFE",M.style.borderRadius="3px",M.style.boxShadow="none",M.style.minWidth="24px",M.style.textAlign="center",A.appendChild(M))},v=A=>{if(!A)return[];const F=[...document.querySelectorAll(`[data-source-location="${A}"]`)];return F.length>0?F:[...document.querySelectorAll(`[data-visual-selector-id="${A}"]`)]},b=()=>{u.current.forEach(A=>{A&&A.parentNode&&A.remove()}),u.current=[],d.current=[]},y=A=>{if(!n.current||a.current)return;if(c.current){b();return}if(A.target.tagName.toLowerCase()==="path"){b();return}const F=A.target.closest("[data-source-location], [data-visual-selector-id]");if(!F){b();return}const I=F.dataset.sourceLocation||F.dataset.visualSelectorId;if(F.dataset.sourceLocation,m.current===I){b();return}const R=v(I);b(),R.forEach(M=>{const $=g(!1);document.body.appendChild($),u.current.push($),w($,M)}),d.current=R},_=()=>{a.current||b()},N=A=>{var U;if(!n.current)return;if(c.current){A.preventDefault(),A.stopPropagation(),A.stopImmediatePropagation(),window.parent.postMessage({type:"close-dropdowns"},"*");return}if(A.target.tagName.toLowerCase()==="path")return;A.preventDefault(),A.stopPropagation(),A.stopImmediatePropagation();const F=A.target.closest("[data-source-location], [data-visual-selector-id]");if(!F)return;const I=F.dataset.sourceLocation||F.dataset.visualSelectorId;F.dataset.sourceLocation,h.current.forEach(G=>{G&&G.parentNode&&G.remove()}
600),h.current=[],v(I).forEach(G=>{const Z=g(!0);document.body.appendChild(Z),h.current.push(Z),w(Z,G,!0)}),m.current=I,b();const M=F.getBoundingClientRect(),$={top:M.top,left:M.left,right:M.right,bottom:M.bottom,width:M.width,height:M.height,centerX:M.left+M.width/2,centerY:M.top+M.height/2},B={type:"element-selected",tagName:F.tagName,classes:((U=F.className)==null?void 0:U.baseVal)||F.className||"",visualSelectorId:I,content:F.innerText,dataSourceLocation:F.dataset.sourceLocation,isDynamicContent:F.dataset.dynamicContent==="true",linenumber:F.dataset.linenumber,filename:F.dataset.filename,position:$};window.parent.postMessage(B,"*")},j=()=>{h.current.forEach(A=>{A&&A.parentNode&&A.remove()}),h.current=[],m.current=null},S=(A,F,I=!1)=>{const R=v(A);R.length!==0&&(R.forEach(M=>{var $;if(I)M.className=F;else{const B=(($=M.className)==null?void 0:$.baseVal)||M.className||"";M.className=T_(B,F)}}),setTimeout(()=>{var M,$;m.current===A&&h.current.forEach((B,U)=>{U<R.length&&w(B,R[U])}),d.current.length>0&&(($=(M=d.current[0])==null?void 0:M.dataset)==null?void 0:$.visualSelectorId)===A&&u.current.forEach((U,G)=>{G<d.current.length&&w(U,d.current[G])})},50))},C=(A,F)=>{const I=v(A);I.length!==0&&(I.forEach(R=>{R.innerText=F}),setTimeout(()=>{m.current===A&&h.current.forEach((R,M)=>{M<I.length&&w(R,I[M])})},50))},P=A=>{t(A),n.current=A,A?(document.body.style.cursor="crosshair",document.addEventListener("mouseover",y),document.addEventListener("mouseout",_),document.addEventListener("click",N,!0)):(b(),h.current.forEach(F=>{F&&F.parentNode&&F.remove()}),h.current=[],d.current=[],m.current=null,document.body.style.cursor="default",document.removeEventListener("mouseover",y),document.removeEventListener("mouseout",_),document.removeEventListener("click",N,!0))};return O.useEffect(()=>{document.querySelectorAll("[data-linenumber]:not([data-visual-selector-id])").forEach((R,M)=>{const $=`visual-id-${R.dataset.filename}-${R.dataset.linenumber}-${M}`;R.dataset.visualSelectorId=$});const F=()=>{if(m.current){const R=v(m.current);if(R.length>0){const $=R[0].getBoundingClientRect(),B=window.innerHeight,U=window.innerWidth,G=$.top<B&&$.bottom>0&&$.left<U&&$.right>0,Z={top:$.top,left:$.left,right:$.right,bottom:$.bottom,width:$.width,height:$.height,centerX:$.left+$.width/2,centerY:$.top+$.height/2};window.parent.postMessage({type:"element-position-update",position:Z,isInViewport:G,visualSelectorId:m.current},"*")}}},I=R=>{const M=R.data;switch(M.type){case"toggle-visual-edit-mode":P(M.data.enabled);break;case"update-classes":M.data&&M.data.classes!==void 0?S(M.data.visualSelectorId,M.data.classes,M.data.replace||!1):console.warn("[Agent] Invalid update-classes message:",M);break;case"unselect-element":j();break;case"refresh-page":window.location.reload();break;case"update-content":M.data&&M.data.content!==void 0?C(M.data.visualSelectorId,M.data.content):console.warn("[Agent] Invalid update-content message:",M);break;case"request-element-position":if(m.current){const $=v(m.current);if($.length>0){const U=$[0].getBoundingClientRect(),G=window.innerHeight,Z=window.innerWidth,X=U.top<G&&U.bottom>0&&U.left<Z&&U.right>
6000,V={top:U.top,left:U.left,right:U.right,bottom:U.bottom,width:U.width,height:U.height,centerX:U.left+U.width/2,centerY:U.top+U.height/2};window.parent.postMessage({type:"element-position-update",position:V,isInViewport:X,visualSelectorId:m.current},"*")}}break;case"popover-drag-state":M.data&&M.data.isDragging!==void 0&&(s(M.data.isDragging),a.current=M.data.isDragging,M.data.isDragging&&b());break;case"dropdown-state":M.data&&M.data.isOpen!==void 0&&(l(M.data.isOpen),c.current=M.data.isOpen,M.data.isOpen&&b());break}};return window.addEventListener("message",I),window.addEventListener("scroll",F,!0),document.addEventListener("scroll",F,!0),window.parent.postMessage({type:"visual-edit-agent-ready"},"*"),()=>{window.removeEventListener("message",I),window.removeEventListener("scroll",F,!0),document.removeEventListener("scroll",F,!0),document.removeEventListener("mouseover",y),document.removeEventListener("mouseout",_),document.removeEventListener("click",N,!0),b(),h.current.forEach(R=>{R&&R.parentNode&&R.remove()})}},[]),O.useEffect(()=>{n.current=e},[e]),O.useEffect(()=>{a.current=r},[r]),O.useEffect(()=>{c.current=o},[o]),O.useEffect(()=>{const A=()=>{if(m.current){const I=v(m.current);h.current.forEach((R,M)=>{M<I.length&&w(R,I[M])})}d.current.length>0&&u.current.forEach((I,R)=>{R<d.current.length&&w(I,d.current[R])})},F=new MutationObserver(I=>{I.some(M=>{const $=U=>{if(U.nodeType===Node.ELEMENT_NODE){if(U.dataset&&U.dataset.visualSelectorId)return!0;for(let G=0;G<U.children.length;G++)if($(U.children[G]))return!0}return!1};return M.type==="attributes"&&(M.attributeName==="style"||M.attributeName==="class"||M.attributeName==="width"||M.attributeName==="height")&&$(M.target)})&&setTimeout(A,50)});return F.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["style","class","width","height"]}),window.addEventListener("resize",A),window.addEventListener("scroll",A),()=>{window.removeEventListener("resize",A),window.removeEventListener("scroll",A),F.disconnect()}},[]),null}var Ky=$T();const zB=En(Ky);/**
601 * @remix-run/router v1.23.0
602 *
603 * Copyright (c) Remix Software Inc.
604 *
605 * This source code is licensed under the MIT license found in the
606 * LICENSE.md file in the root directory of this source tree.
607 *
608 * @license MIT
609 */function V0(){return V0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V0.apply(this,arguments)}var wd;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(wd||(wd={}));const kM="popstate";function Rre(e){e===void 0&&(e={});function t(r,s){let{pathname:a,search:o,hash:l}=r.location;return _A("",{pathname:a,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:rj(s)}return Ire(t,n,null,e)}function Hr(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function BB(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Mre(){return Math.random().toString(36).substr(2,8)}function EM(e,t){return{usr:e.state,key:e.key,idx:t}}function _A(e,t,n,r){return n===void 0&&(n=null),V0({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?iv(t):t,{state:n,key:t&&t.key||r||Mre()})}function rj(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function iv(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Ire(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:a=!1}=r,o=s.history,l=wd.Pop,c=null,u=h();u==null&&(u=0,o.replaceState(V0({},o.state,{idx:u}),""));function h(){return(o.state||{idx:null}).idx}function d(){l=wd.Pop;let b=h(),y=b==null?null:b-u;u=b,c&&c({action:l,location:v.location,delta:y})}function m(b,y){l=wd.Push;let _=_A(v.location,b,y);u=h()+1;let N=EM(_,u),j=v.createHref(_);try{o.pushState(N,"",j)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(j)}a&&c&&c({action:l,location:v.location,delta:1})}function g(b,y){l=wd.Replace;let _=_A(v.location,b,y);u=h();let N=EM(_,u),j=v.createHref(_);o.replaceState(N,"",j),a&&c&&c({action:l,location:v.location,delta:0})}function w(b){let y=s.location.origin!=="null"?s.location.origin:s.location.href,_=typeof b=="string"?b:rj(b);return _=_.replace(/ $/,"%20"),Hr(y,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,y)}let v={get action(){return l},get location(){return e(s,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(kM,d),c=b,()=>{s.removeEventListener(kM,d),c=null}},createHref(b){return t(s,b)},createURL:w,encodeLocation(b){let y=w(b);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:m,replace:g,go(b){return o.go(b)}};return v}var PM;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(PM||(PM={}));function Dre(e,t,n){return n===void 0&&(n="/"),Lre(e,t,n)}function Lre(e,t,n,r){let s=typeof t=="string"?iv(t):t,a=XT(s.pathname||"/",n);if(a==null)return null;let o=UB(e);Fre(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=Yre(a);l=Kre(o[c],u)}return l}function UB(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(Hr(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
609id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Ed([r,c.relativePath]),h=n.concat(c);a.children&&a.children.length>0&&(Hr(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),UB(a.children,t,h,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Wre(u,a.index),routesMeta:h})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let c of VB(a.path))s(a,o,c)}),t}function VB(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let o=VB(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Fre(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Hre(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const $re=/^:[\w-]+$/,qre=3,zre=2,Bre=1,Ure=10,Vre=-2,CM=e=>e==="*";function Wre(e,t){let n=e.split("/"),r=n.length;return n.some(CM)&&(r+=Vre),t&&(r+=zre),n.filter(s=>!CM(s)).reduce((s,a)=>s+($re.test(a)?qre:a===""?Bre:Ure),r)}function Hre(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function Kre(e,t,n){let{routesMeta:r}=e,s={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,h=a==="/"?t:t.slice(a.length)||"/",d=Gre({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},h),m=c.route;if(!d)return null;
vendor: 6,866 bytes, lines 609-618
609Object.assign(s,d.params),o.push({params:s,pathname:Ed([a,d.pathname]),pathnameBase:eie(Ed([a,d.pathnameBase])),route:m}),d.pathnameBase!=="/"&&(a=Ed([a,d.pathnameBase]))}return o}function Gre(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Qre(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],o=a.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((u,h,d)=>{let{paramName:m,isOptional:g}=h;if(m==="*"){let v=l[d]||"";o=a.slice(0,a.length-v.length).replace(/(.)\/+$/,"$1")}const w=l[d];return g&&!w?u[m]=void 0:u[m]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function Qre(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),BB(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function Yre(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return BB(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function XT(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Xre(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?iv(e):e;return{pathname:n?n.startsWith("/")?n:Zre(n,t):t,search:tie(r),hash:nie(s)}}function Zre(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function fS(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Jre(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function WB(e,t){let n=Jre(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function HB(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=iv(e):(s=V0({},e),Hr(!s.pathname||!s.pathname.includes("?"),fS("?","pathname","search",s)),Hr(!s.pathname||!s.pathname.includes("#"),fS("#","pathname","hash",s)),Hr(!s.search||!s.search.includes("#"),fS("#","search","hash",s)));let a=e===""||s.pathname==="",o=a?"/":s.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),d-=1;s.pathname=m.join("/")}l=d>=0?t[d]:"/"}let c=Xre(s,l),u=o&&o!=="/"&&o.endsWith("/"),h=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||h)&&(c.pathname+="/"),c}const Ed=e=>e.join("/").replace(/\/\/+/g,"/"),eie=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),tie=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,nie=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function rie(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const KB=["post","put","patch","delete"];new Set(KB);const iie=["get",...KB];new Set(iie);/**
610 * React Router v6.30.1
611 *
612 * Copyright (c) Remix Software Inc.
613 *
614 * This source code is licensed under the MIT license found in the
615 * LICENSE.md file in the root directory of this source tree.
616 *
617 * @license MIT
618 */function W0(){return W0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W0.apply(this,arguments)}const ZT=O.createContext(null),sie=O.createContext(null),Xh=O.createContext(null),R_=O.createContext(null),Zh=O.createContext({outlet:null,matches:[],isDataRoute:!1}),GB=O.createContext(null);function aie(e,t){let{relative:n}=t===void 0?{}:t;Gy()||Hr(!1);let{basename:r,navigator:s}=O.useContext(Xh),{hash:a,pathname:o,search:l}=YB(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Ed([r,o])),s.createHref({pathname:c,search:l,hash:a})}function Gy(){return O.useContext(R_)!=null}function oo(){return Gy()||Hr(!1),O.useContext(R_).location}function QB(e){O.useContext(Xh).static||O.useLayoutEffect(e)}function qi(){let{isDataRoute:e}=O.useContext(Zh);return e?yie():oie()}function oie(){Gy()||Hr(!1);let e=O.useContext(ZT),{basename:t,future:n,navigator:r}=O.useContext(Xh),{matches:s}=O.useContext(Zh),{pathname:a}=oo(),o=JSON.stringify(WB(s,n.v7_relativeSplatPath)),l=O.useRef(!1);return QB(()=>{l.current=!0}),O.useCallback(function(u,h){if(h===void 0&&(h={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let d=HB(u,JSON.parse(o),a,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Ed([t,d.pathname])),(h.replace?r.replace:r.push)(d,h.state,h)},[t,r,o,a,e])}function YB(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=O.useContext(Xh),{matches:s}=O.useContext(Zh),{pathname:a}=oo(),o=JSON.stringify(WB(s,r.v7_relativeSplatPath));return O.useMemo(()=>HB(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function lie(e,t){return cie(e,t)}function cie(e,t,n,r){Gy()||Hr(!1);let{navigator:s}=O.useContext(Xh),{matches:a}=O.useContext(Zh),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=oo(),h;if(t){var d;let b=typeof t=="string"?iv(t):t;c==="/"||(d=b.pathname)!=null&&d.startsWith(c)||Hr(!1),h=b}else h=u;let m=h.pathname||"/",g=m;if(c!=="/"){let b=c.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(b.length).join("/")}let w=Dre(e,{pathname:g}),v=mie(w&&w.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Ed([c,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Ed([c,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),a,n,r);return t&&v?O.createElement(R_.Provider,{value:{location:W0({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:wd.Pop}},v):v}function uie(){let e=xie(),t=rie(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application 
618Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},t),n?O.createElement("pre",{style:s},n):null,null)}const die=O.createElement(uie,null);class fie extends O.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?O.createElement(Zh.Provider,{value:this.props.routeContext},O.createElement(GB.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function hie(e){let{routeContext:t,match:n,children:r}=e,s=O.useContext(ZT);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),O.createElement(Zh.Provider,{value:t},r)}function mie(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let h=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);h>=0||Hr(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<o.length;h++){let d=o[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=h),d.route.id){let{loaderData:m,errors:g}=n,w=d.route.loader&&m[d.route.id]===void 0&&(!g||g[d.route.id]===void 0);if(d.route.lazy||w){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((h,d,m)=>{let g,w=!1,v=null,b=null;n&&(g=l&&d.route.id?l[d.route.id]:void 0,v=d.route.errorElement||die,c&&(u<0&&m===0?(bie("route-fallback"),w=!0,b=null):u===m&&(w=!0,b=d.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,m+1)),_=()=>{let N;return g?N=v:w?N=b:d.route.Component?N=O.createElement(d.route.Component,null):d.route.element?N=d.route.element:N=h,O.createElement(hie,{match:d,routeContext:{outlet:h,matches:y,isDataRoute:n!=null},children:N})};return n&&(d.route.ErrorBoundary||d.route.errorElement||m===0)?O.createElement(fie,{location:n.location,revalidation:n.revalidation,component:v,error:g,children:_(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):_()},null)}var XB=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(XB||{}),ZB=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(ZB||{});function pie(e){let t=O.useContext(ZT);return t||Hr(!1),t}function gie(e){let t=O.useContext(sie);return t||Hr(!1),t}function vie(e){let t=O.useContext(Zh);return t||Hr(!1),t}function JB(e){let t=vie(),n=t.matches[t.matches.length-1];return n.route.id||Hr(!1),n.route.id}function xie(){var e;let t=O.useContext(GB),n=gie(),r=JB();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function yie(){let{router:e}=pie(XB.UseNavigateStable),t=JB(ZB.UseNavigateStable),n=O.useRef(!1);return QB(()=>{n.current=!0}),O.useCallback(function(s,a){a===void 0&&(a={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,W0({fromRouteId:t},a)))},[e,t])}const AM={};function bie(e,t,n){AM[e]||(AM[e]=!0)}function wie(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Fp(e){Hr(!1)}function jie(e){let{basename:t="/",children:n=null,location:r,navigationType:s=wd.Pop,navigator:a,static:o=!1,future:l}=e;Gy()&&Hr(!1);let c=t.replace(/^\/*/,"/"),u=O.useMemo(()=>({basename:c,navigator:a,static:o,future:W0({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=iv(r));
618let{pathname:h="/",search:d="",hash:m="",state:g=null,key:w="default"}=r,v=O.useMemo(()=>{let b=XT(h,c);return b==null?null:{location:{pathname:b,search:d,hash:m,state:g,key:w},navigationType:s}},[c,h,d,m,g,w,s]);return v==null?null:O.createElement(Xh.Provider,{value:u},O.createElement(R_.Provider,{children:n,value:v}))}function _ie(e){let{children:t,location:n}=e;return lie(NA(t),n)}new Promise(()=>{});function NA(e,t){t===void 0&&(t=[]);let n=[];return O.Children.forEach(e,(r,s)=>{if(!O.isValidElement(r))return;let a=[...t,s];if(r.type===O.Fragment){n.push.apply(n,NA(r.props.children,a));return}r.type!==Fp&&Hr(!1),!r.props.index||!r.props.children||Hr(!1);let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=NA(r.props.children,a)),n.push(o)}),n}/**
619 * React Router DOM v6.30.1
620 *
621 * Copyright (c) Remix Software Inc.
622 *
623 * This source code is licensed under the MIT license found in the
624 * LICENSE.md file in the root directory of this source tree.
625 *
626 * @license MIT
627 */function SA(){return SA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SA.apply(this,arguments)}function Nie(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Sie(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function kie(e,t){return e.button===0&&(!t||t==="_self")&&!Sie(e)}function kA(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function Eie(e,t){let n=kA(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(a=>{n.append(s,a)})}),n}const Pie=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Cie="6";try{window.__reactRouterVersion=Cie}catch{}const Aie="startTransition",OM=FT[Aie];function Oie(e){let{basename:t,children:n,future:r,window:s}=e,a=O.useRef();a.current==null&&(a.current=Rre({window:s,v5Compat:!0}));let o=a.current,[l,c]=O.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},h=O.useCallback(d=>{u&&OM?OM(()=>c(d)):c(d)},[c,u]);return O.useLayoutEffect(()=>o.listen(h),[o,h]),O.useEffect(()=>wie(r),[r]),O.createElement(jie,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const Tie=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Rie=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lr=O.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:h,viewTransition:d}=t,m=Nie(t,Pie),{basename:g}=O.useContext(Xh),w,v=!1;if(typeof u=="string"&&Rie.test(u)&&(w=u,Tie))try{let N=new URL(window.location.href),j=u.startsWith("//")?new URL(N.protocol+u):new URL(u),S=XT(j.pathname,g);j.origin===N.origin&&S!=null?u=S+j.search+j.hash:v=!0}catch{}let b=aie(u,{relative:s}),y=Mie(u,{replace:o,state:l,target:c,preventScrollReset:h,relative:s,viewTransition:d});function _(N){r&&r(N),N.defaultPrevented||y(N)}return O.createElement("a",SA({},m,{href:w||b,onClick:v||a?r:_,ref:n,target:c}))});var TM;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(TM||(TM={}));var RM;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(RM||(RM={}));function Mie(e,t){let{target:n,replace:r,state:s,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=qi(),u=oo(),h=YB(e,{relative:o});return O.useCallback(d=>
vendor: 4,251 bytes, line 627
627{if(kie(d,n)){d.preventDefault();let m=r!==void 0?r:rj(u)===rj(h);c(e,{replace:m,state:s,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,h,r,s,n,e,a,o,l])}function e9(e){let t=O.useRef(kA(e)),n=O.useRef(!1),r=oo(),s=O.useMemo(()=>Eie(r.search,n.current?null:t.current),[r.search]),a=qi(),o=O.useCallback((l,c)=>{const u=kA(typeof l=="function"?l(s):l);n.current=!0,a("?"+u,c)},[a,s]);return[s,o]}function t9(e,t){return function(){return e.apply(t,arguments)}}const{toString:Iie}=Object.prototype,{getPrototypeOf:xg}=Object,{iterator:Qy,toStringTag:n9}=Symbol,ij=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),H0=(e,t)=>{let n=e;const r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),ij(n,t))return!0;n=xg(n)}return!1},Die=(e,t)=>e!=null&&H0(e,t)?e[t]:void 0,JT=(e=>t=>{const n=Iie.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),lo=e=>(e=e.toLowerCase(),t=>JT(t)===e),M_=e=>t=>typeof t===e,{isArray:Rh}=Array,Mh=M_("undefined");function sv(e){return e!==null&&!Mh(e)&&e.constructor!==null&&!Mh(e.constructor)&&Ks(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const r9=lo("ArrayBuffer");function Lie(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&r9(e.buffer),t}const Fie=M_("string"),Ks=M_("function"),i9=M_("number"),av=e=>e!==null&&typeof e=="object",$ie=e=>e===!0||e===!1,D1=e=>{if(!av(e))return!1;const t=xg(e);return(t===null||t===Object.prototype||xg(t)===null)&&!H0(e,n9)&&!H0(e,Qy)},qie=e=>{if(!av(e)||sv(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},zie=lo("Date"),Bie=lo("File"),Uie=e=>!!(e&&typeof e.uri<"u"),Vie=e=>e&&typeof e.getParts<"u",Wie=lo("Blob"),Hie=lo("FileList"),Kie=lo("Set"),Gie=e=>av(e)&&Ks(e.pipe);function Qie(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const MM=Qie(),IM=typeof MM.FormData<"u"?MM.FormData:void 0,Yie=e=>{if(!e)return!1;if(IM&&e instanceof IM)return!0;const t=xg(e);if(!t||t===Object.prototype||!Ks(e.append))return!1;const n=JT(e);return n==="formdata"||n==="object"&&Ks(e.toString)&&e.toString()==="[object FormData]"},Xie=lo("URLSearchParams"),[Zie,Jie,ese,tse]=["ReadableStream","Request","Response","Headers"].map(lo),nse=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Yy(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Rh(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(sv(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let l;for(r=0;r<o;r++)l=a[r],t.call(null,e[l],l,e)}}function s9(e,t){if(sv(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const lh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,a9=e=>!Mh(e)&&e!==lh;function EA(...e){const{caseless:t,skipUndefined:n}=a9(this)&&this||{},r={},s=(a,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const l=t&&typeof o=="string"&&s9(r,o)||o,c=ij(r,l)?r[l]:void 0;D1(c)&&D1(a)?r[l]=EA(c,a):D1(a)?r[l]=EA({},a):Rh(a)?r[l]=a.slice():(!n||!Mh(a))&&(r[l]=a)};for(let a=0,o=e.length;a<o;a++){const l=e[a];if(!l||sv(l)||(Yy(l,s),typeof l!="object"||Rh(l)))continue;const c=Object.getOwnPropertySymbols(l);for(let u=0;u<c.length;u++){const h=c[u];mse.call(l,h)&&s(l[h],h)}}return r}const rse=(e,t,n,{allOwnKeys:r}={})=>(Yy(t,(s,a)=>{n&&Ks(s)?Object.defineProperty(e,a,{__proto__:null,value:t9(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,a,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),ise=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sse=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},ase=(e,t,n,r)=>{let s,a,o;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;
vendor: 8,933 bytes, lines 627-629
627)o=s[a],(!r||r(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&xg(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ose=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},lse=e=>{if(!e)return null;if(Rh(e))return e;let t=e.length;if(!i9(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},cse=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&xg(Uint8Array)),use=(e,t)=>{const r=(e&&e[Qy]).call(e);let s;for(;(s=r.next())&&!s.done;){const a=s.value;t.call(e,a[0],a[1])}},dse=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},fse=lo("HTMLFormElement"),hse=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),{propertyIsEnumerable:mse}=Object.prototype,pse=lo("RegExp"),o9=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Yy(n,(s,a)=>{let o;(o=t(s,a,e))!==!1&&(r[a]=o||s)}),Object.defineProperties(e,r)},gse=e=>{o9(e,(t,n)=>{if(Ks(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];if(Ks(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},vse=(e,t)=>{const n={},r=s=>{s.forEach(a=>{n[a]=!0})};return Rh(e)?r(e):r(String(e).split(t)),n},xse=()=>{},yse=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function bse(e){return!!(e&&Ks(e.append)&&e[n9]==="FormData"&&e[Qy])}const wse=e=>{const t=new WeakSet,n=r=>{if(av(r)){if(t.has(r))return;if(sv(r))return r;if(!("toJSON"in r)){t.add(r);let s;if(Kie(r)){s=[];for(const a of r){const o=n(a);!Mh(o)&&s.push(o)}}else s=Rh(r)?[]:{},Yy(r,(a,o)=>{const l=n(a);!Mh(l)&&(s[o]=l)});return t.delete(r),s}}return r};return n(e)},jse=lo("AsyncFunction"),_se=e=>e&&(av(e)||Ks(e))&&Ks(e.then)&&Ks(e.catch),l9=((e,t)=>e?setImmediate:t?((n,r)=>(lh.addEventListener("message",({source:s,data:a})=>{s===lh&&a===n&&r.length&&r.shift()()},!1),s=>{r.push(s),lh.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ks(lh.postMessage)),Nse=typeof queueMicrotask<"u"?queueMicrotask.bind(lh):typeof process<"u"&&process.nextTick||l9,c9=e=>e!=null&&Ks(e[Qy]),Sse=e=>e!=null&&H0(e,Qy)&&c9(e),je={isArray:Rh,isArrayBuffer:r9,isBuffer:sv,isFormData:Yie,isArrayBufferView:Lie,isString:Fie,isNumber:i9,isBoolean:$ie,isObject:av,isPlainObject:D1,isEmptyObject:qie,isReadableStream:Zie,isRequest:Jie,isResponse:ese,isHeaders:tse,isUndefined:Mh,isDate:zie,isFile:Bie,isReactNativeBlob:Uie,isReactNative:Vie,isBlob:Wie,isRegExp:pse,isFunction:Ks,isStream:Gie,isURLSearchParams:Xie,isTypedArray:cse,isFileList:Hie,forEach:Yy,merge:EA,extend:rse,trim:nse,stripBOM:ise,inherits:sse,toFlatObject:ase,kindOf:JT,kindOfTest:lo,endsWith:ose,toArray:lse,forEachEntry:use,matchAll:dse,isHTMLForm:fse,hasOwnProperty:ij,hasOwnProp:ij,hasOwnInPrototypeChain:H0,getSafeProp:Die,reduceDescriptors:o9,freezeMethods:gse,toObjectSet:vse,toCamelCase:hse,noop:xse,toFiniteNumber:yse,findKey:s9,global:lh,isContextDefined:a9,isSpecCompliantForm:bse,toJSONObject:wse,isAsyncFn:jse,isThenable:_se,setImmediate:l9,asap:Nse,isIterable:c9,isSafeIterable:Sse},kse=je.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ese=e=>{const t={};let n,r,s;return e&&e.split(`
628`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim();const l=je.hasOwnProp(t,n);!n||l&&je.hasOwnProp(kse,n)||(n==="set-cookie"?l?t[n].push(r):t[n]=[r]:t[n]=l?t[n]+", "+r:r)}),t};function Pse(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const Cse=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Ase=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function e4(e,t){return je.isArray(e)?e.map(n=>e4(n,t)):Pse(String(e).replace(t,""))}const Ose=e=>e4(e,Cse),Tse=e=>e4(e,Ase);function u9(e){const t=Object.create(null);return je.forEach(e.toJSON(),(n,r)=>{t[r]=Tse(n)}),t}const DM=Symbol("internals");function Qx(e){return e&&String(e).trim().toLowerCase()}function L1(e){return e===!1||e==null?e:je.isArray(e)?e.map(L1):Ose(String(e))}function Rse(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Mse=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function hS(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function Ise(e){const t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n="";for(let r=1;r<t;r++){const s=e.charCodeAt(r);if(s===34||s===92&&(r+=1,r>=t))return e;n+=e[r]}return n}function Dse(e){const t=Object.create(null),n=String(e);let r=0,s=!1,a=!1;function o(l){const c=hS(n.slice(r,l)),u=c.indexOf("=");if(u<1)return;const h=hS(c.slice(0,u));if(!Mse.test(h))return;const d=h.toLowerCase();if(d==="__proto__"||d==="constructor"||d==="prototype")return;const m=hS(c.slice(u+1));t[d]=Ise(m)}for(let l=0;l<n.length;l++){const c=n.charCodeAt(l);s?a?a=!1:c===92?a=!0:c===34&&(s=!1):c===34?s=!0:(c===44||c===59)&&(o(l),r=l+1)}return o(n.length),t}const Lse=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function mS(e,t,n,r,s){if(je.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!je.isString(t)){if(je.isString(r))return t.indexOf(r)!==-1;if(je.isRegExp(r))return r.test(t)}}function Fse(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function $se(e,t){const n=je.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(s,a,o){return this[r].call(this,t,s,a,o)},configurable:!0})})}let ns=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function a(l,c,u){const h=Qx(c);if(!h)return;const d=je.findKey(s,h);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||c]=L1(l))}const o=(l,c)=>je.forEach(l,(u,h)=>a(u,h,c));if(je.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(je.isString(t)&&(t=t.trim())&&!Lse(t))o(Ese(t),n);else if(je.isObject(t)&&je.isSafeIterable(t)){let l=Object.create(null),c,u;for(const h of t){if(!je.isArray(h))throw new TypeError("Object iterator must return a key-value pair");u=h[0],je.hasOwnProp(l,u)?(c=l[u],l[u]=je.isArray(c)?[...c,h[1]]:[c,h[1]]):l[u]=h[1]}o(l,n)}else t!=null&&a(n,t,r);return this}get(t,n){if(t=Qx(t),t){const r=je.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Rse(s);if(je.isFunction(n))return n.call(this,s,r);if(je.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Qx(t),t){const r=je.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||mS(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function a(o){if(o=Qx(o),o){const l=je.findKey(r,o);l&&(!n||mS(r,r[l],l,n))&&(delete r[l],s=!0)}}return je.isArray(t)?t.forEach(a):a(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const a=n[r];(!t||mS(this,this[a],a,t,!0))&&(delete this[a],s=!0)}return s}normalize(t){const n=this,r={};return je.forEach(this,(s,a)=>{const o=je.findKey(r,a);if(o){n[o]=L1(s),delete n[a];return}const l=t?Fse(a):String(a).trim();l!==a&&delete n[a],n[l]=L1(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return je.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&je.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
629`)}getSetCookie(){const t=this.get("set-cookie");return je.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return Dse(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[DM]=this[DM]={accessors:{}}).accessors,s=this.prototype;function a(o){const l=Qx(o);r[l]||($se(s,o),r[l]=!0)}return je.isArray(t)?t.forEach(a):a(t),this}};ns.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);je.reduceDescriptors(ns.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});je.freezeMethods(ns);const sj="[REDACTED ****]";function qse(e){if(je.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(je.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function zse(e,t){const n=new Set(t.map(a=>String(a).toLowerCase())),r=[],s=a=>
vendor: 4,590 bytes, line 629
629{if(a===null||typeof a!="object"||je.isBuffer(a))return a;if(r.indexOf(a)!==-1)return;a instanceof ns&&(a=a.toJSON()),r.push(a);let o;if(je.isArray(a))o=[],a.forEach((l,c)=>{const u=s(l);je.isUndefined(u)||(o[c]=u)});else{if(!je.isPlainObject(a)&&qse(a))return r.pop(),a;o=Object.create(null);for(const[l,c]of Object.entries(a)){const u=n.has(l.toLowerCase())?sj:s(c);je.isUndefined(u)||(o[l]=u)}}return r.pop(),o};return s(e)}function LM(e){try{return String(e)}catch{return""}}function Bse(e){return e.errors.map(n=>{try{return n&&n.message?LM(n.message):LM(n)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}let lt=class d9 extends Error{static from(t,n,r,s,a,o){let l=t.message;!l&&je.isArray(t.errors)&&t.errors.length&&(l=Bse(t));const c=new d9(l,n||t.code,r,s,a);return Object.defineProperty(c,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),o&&Object.assign(c,o),c}constructor(t,n,r,s,a){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),a&&(this.response=a,this.status=a.status)}toJSON(){const t=this.config,n=t&&je.hasOwnProp(t,"redact")?t.redact:void 0,r=je.isArray(n)&&n.length>0?zse(t,n):je.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};lt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";lt.ERR_BAD_OPTION="ERR_BAD_OPTION";lt.ECONNABORTED="ECONNABORTED";lt.ETIMEDOUT="ETIMEDOUT";lt.ECONNREFUSED="ECONNREFUSED";lt.ERR_NETWORK="ERR_NETWORK";lt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";lt.ERR_DEPRECATED="ERR_DEPRECATED";lt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";lt.ERR_BAD_REQUEST="ERR_BAD_REQUEST";lt.ERR_CANCELED="ERR_CANCELED";lt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";lt.ERR_INVALID_URL="ERR_INVALID_URL";lt.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Use=null,f9=100;function PA(e){return je.isPlainObject(e)||je.isArray(e)}function h9(e){return je.endsWith(e,"[]")?e.slice(0,-2):e}function pS(e,t,n){return e?e.concat(t).map(function(s,a){return s=h9(s),!n&&a?"["+s+"]":s}).join(n?".":""):t}function Vse(e){return je.isArray(e)&&!e.some(PA)}const Wse=je.toFlatObject(je,{},null,function(t){return/^is[A-Z]/.test(t)});function I_(e,t,n){if(!je.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=je.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,N){return!je.isUndefined(N[_])});const r=n.metaTokens,s=n.visitor||w,a=n.dots,o=n.indexes,l=n.Blob||typeof Blob<"u"&&Blob,c=n.maxDepth===void 0?f9:n.maxDepth,u=l&&je.isSpecCompliantForm(t),h=[];if(!je.isFunction(s))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(je.isDate(y))return y.toISOString();if(je.isBoolean(y))return y.toString();if(!u&&je.isBlob(y))throw new lt("Blob is not supported. Use a Buffer instead.");if(je.isArrayBuffer(y)||je.isTypedArray(y)){if(u&&typeof l=="function")return new l([y]);throw new lt("Blob is not supported. Use a Buffer instead.",lt.ERR_NOT_SUPPORT)}return y}function m(y){if(y>c)throw new lt("Object is too deeply nested ("+y+" levels). Max depth: "+c,lt.ERR_FORM_DATA_DEPTH_EXCEEDED)}function g(y,_){if(c===1/0)return JSON.stringify(y);const N=[];return JSON.stringify(y,function(S,C){if(!je.isObject(C))return C;for(;N.length&&N[N.length-1]!==this;)N.pop();return N.push(C),m(_+N.length-1),C})}function w(y,_,N){let j=y;if(je.isReactNative(t)&&je.isReactNativeBlob(y))return t.append(pS(N,_,a),d(y)),!1;if(y&&!N&&typeof y=="object"){if(je.endsWith(_,"{}"))_=r?_:_.slice(0,-2),y=g(y,1);else if(je.isArray(y)&&Vse(y)||(je.isFileList(y)||je.endsWith(_,"[]"))&&(j=je.toArray(y)))return _=h9(_),j.forEach(function(C,P){!(je.isUndefined(C)||C===null)&&t.append(o===!0?pS([_],P,a):o===null?_:_+"[]",d(C))}),!1}return PA(y)?!0:(t.append(pS(N,_,a),d(y)),!1)}const v=Object.assign(Wse,{defaultVisitor:w,convertValue:d,isVisitable:PA});function b(y,_,N=0){if(!je.isUndefined(y)){if(m(N),h.indexOf(y)!==-1)throw new Error("Circular reference detected in "+_.join("."));h.push(y),je.forEach(y,function(S,C){(!(je.isUndefined(S)||S===null)&&s.call(t,S,je.isString(C)?C.trim():C,_,v))===!0&&b(S,_?_.concat(C):[C],N+1)}),h.pop()}}if(!je.isObject(e))throw new TypeError("data must be an object");return b(e),t}
vendor: 4,014 bytes, line 629
629function FM(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function t4(e,t){this._pairs=[],e&&I_(e,this,t)}const m9=t4.prototype;m9.append=function(t,n){this._pairs.push([t,n])};m9.toString=function(t){const n=t?r=>t.call(this,r,FM):FM;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Hse(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function p9(e,t,n){if(!t)return e;e=e||"";const r=je.isFunction(n)?{serialize:n}:n,s=je.getSafeProp(r,"encode")||Hse,a=je.getSafeProp(r,"serialize");let o;if(a?o=a(t,r):o=je.isURLSearchParams(t)?t.toString():new t4(t,r).toString(s),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class $M{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){je.forEach(this.handlers,function(r){r!==null&&t(r)})}}const n4={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Kse=typeof URLSearchParams<"u"?URLSearchParams:t4,Gse=typeof FormData<"u"?FormData:null,Qse=typeof Blob<"u"?Blob:null,Yse={isBrowser:!0,classes:{URLSearchParams:Kse,FormData:Gse,Blob:Qse},protocols:["http","https","file","blob","url","data"]},r4=typeof window<"u"&&typeof document<"u",CA=typeof navigator=="object"&&navigator||void 0,Xse=r4&&(!CA||["ReactNative","NativeScript","NS"].indexOf(CA.product)<0),Zse=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Jse=r4&&window.location.href||"http://localhost",eae=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:r4,hasStandardBrowserEnv:Xse,hasStandardBrowserWebWorkerEnv:Zse,navigator:CA,origin:Jse},Symbol.toStringTag,{value:"Module"})),$i={...eae,...Yse};function tae(e,t){return I_(e,new $i.classes.URLSearchParams,{visitor:function(n,r,s,a){return $i.isNode&&je.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}const qM=f9;function g9(e){if(e>qM)throw new lt("FormData field is too deeply nested ("+e+" levels). Max depth: "+qM,lt.ERR_FORM_DATA_DEPTH_EXCEEDED)}function nae(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;(r=n.exec(e))!==null;)g9(t.length),t.push(r[0]==="[]"?"":r[1]||r[0]);return t}function rae(e){const t={},n=Object.keys(e);let r;const s=n.length;let a;for(r=0;r<s;r++)a=n[r],t[a]=e[a];return t}function v9(e){function t(n,r,s,a){g9(a);let o=n[a++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),c=a>=n.length;return o=!o&&je.isArray(s)?s.length:o,c?(je.hasOwnProp(s,o)?s[o]=je.isArray(s[o])?s[o].concat(r):[s[o],r]:s[o]=r,!l):((!je.hasOwnProp(s,o)||!je.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],a)&&je.isArray(s[o])&&(s[o]=rae(s[o])),!l)}if(je.isFormData(e)&&je.isFunction(e.entries)){const n={};return je.forEachEntry(e,(r,s)=>{t(nae(r),s,n,0)}),n}return null}const Cp=(e,t)=>e!=null&&je.hasOwnProp(e,t)?e[t]:void 0;function iae(e,t,n){if(je.isString(e))try{return(t||JSON.parse)(e),je.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Xy={transitional:n4,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,a=je.isObject(t);if(a&&je.isHTMLForm(t)&&(t=new FormData(t)),je.isFormData(t))return s?JSON.stringify(v9(t)):t;if(je.isArrayBuffer(t)||je.isBuffer(t)||je.isStream(t)||je.isFile(t)||je.isBlob(t)||je.isReadableStream(t))return t;if(je.isArrayBufferView(t))return t.buffer;if(je.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;
vendor: 10,671 bytes, line 629
629if(a){const c=Cp(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return tae(t,c).toString();if((l=je.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=Cp(this,"env"),h=u&&u.FormData;return I_(l?{"files[]":t}:t,h&&new h,c)}}return a||s?(n.setContentType("application/json",!1),iae(t)):t}],transformResponse:[function(t){const n=Cp(this,"transitional")||Xy.transitional,r=n&&n.forcedJSONParsing,s=Cp(this,"responseType"),a=s==="json";if(je.isResponse(t)||je.isReadableStream(t))return t;if(t&&je.isString(t)&&(r&&!s||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,Cp(this,"parseReviver"))}catch(c){if(l)throw c.name==="SyntaxError"?lt.from(c,lt.ERR_BAD_RESPONSE,this,null,Cp(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$i.classes.FormData,Blob:$i.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};je.forEach(["delete","get","head","post","put","patch","query"],e=>{Xy.headers[e]={}});function gS(e,t){const n=this||Xy,r=t||n,s=ns.from(r.headers);let a=r.data;return je.forEach(e,function(l){a=l.call(n,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function x9(e){return!!(e&&e.__CANCEL__)}let Zy=class extends lt{constructor(t,n,r){super(t??"canceled",lt.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function y9(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new lt("Request failed with status code "+n.status,n.status>=400&&n.status<500?lt.ERR_BAD_REQUEST:lt.ERR_BAD_RESPONSE,n.config,n.request,n))}function sae(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function aae(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,a=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),h=r[a];o||(o=u),n[s]=c,r[s]=u;let d=a,m=0;for(;d!==s;)m+=n[d++],d=d%e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),u-o<t)return;const g=h&&u-h;return g?Math.round(m*1e3/g):void 0}}function oae(e,t){let n=0,r=1e3/t,s,a;const o=(u,h=Date.now())=>{n=h,s=null,a&&(clearTimeout(a),a=null),e(...u)};return[(...u)=>{const h=Date.now(),d=h-n;d>=r?o(u,h):(s=u,a||(a=setTimeout(()=>{a=null,o(s)},r-d)))},()=>s&&o(s)]}const aj=(e,t,n=3)=>{let r=0;const s=aae(50,250);return oae(a=>{if(!a||typeof a.loaded!="number")return;const o=a.loaded,l=a.lengthComputable?a.total:void 0,c=Math.max(0,l!=null?Math.min(o,l):o),u=Math.max(0,c-r),h=s(u);r=Math.max(r,c);const d={loaded:c,total:l,progress:l?c/l:void 0,bytes:u,rate:h||void 0,estimated:h&&l?(l-c)/h:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(d)},n)},zM=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},BM=(e,t=je.asap)=>(...n)=>t(()=>e(...n)),lae=$i.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,$i.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL($i.origin),$i.navigator&&/(msie|trident)/i.test($i.navigator.userAgent)):()=>!0,cae=$i.hasStandardBrowserEnv?{write(e,t,n,r,s,a,o){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];je.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),je.isString(r)&&l.push(`path=${r}`),je.isString(s)&&l.push(`domain=${s}`),a===!0&&l.push("secure"),je.isString(o)&&l.push(`SameSite=${o}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),s=r.indexOf("=");if(s!==-1&&r.slice(0,s)===e)try{return decodeURIComponent(r.slice(s+1))}catch{return r.slice(s+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function uae(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function dae(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}const fae=/^https?:(?!\/\/)/i,hae=/[\t\n\r]/g;function mae(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function pae(e){return mae(e).replace(hae,"")}function gae(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,n,r="")=>`${n}${r}${sj}`)}function vae(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${sj}@`),n=t.indexOf("#"),s=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${sj}`);return n===-1?s:`${s}#${gae(t.slice(n+1))}`}function UM(e,t){if(typeof e=="string"){const n=pae(e);if(fae.test(n))throw new lt(`Invalid URL ${JSON.stringify(vae(n))}: missing "//" after protocol`,lt.ERR_INVALID_URL,t)}}function b9(e,t,n,r){UM(t,r);let s=!uae(t);return e&&(s||n===!1)?(UM(e,r),dae(e,t)):t}const VM=e=>e instanceof ns?{...e}:e,xae=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function Ih(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(h,d,m,g){return je.isPlainObject(h)&&je.isPlainObject(d)?je.merge.call({caseless:g},h,d):je.isPlainObject(d)?je.merge({},d):je.isArray(d)?d.slice():d}function s(h,d,m,g){if(je.isUndefined(d)){if(!je.isUndefined(h))return r(void 0,h,m,g)}else return r(h,d,m,g)}function a(h,d){if(!je.isUndefined(d))return r(void 0,d)}function o(h,d){if(je.isUndefined(d)){if(!je.isUndefined(h))return r(void 0,h)}else return r(void 0,d)}function l(h){const d=je.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!je.isUndefined(d))if(je.isPlainObject(d)){if(je.hasOwnProp(d,h))return d[h]}else return;const m=je.hasOwnProp(e,"transitional")?e.transitional:void 0;if(je.isPlainObject(m)&&je.hasOwnProp(m,h))return m[h]}function c(h,d,m){if(je.hasOwnProp(t,m))return r(h,d);if(je.hasOwnProp(e,m))return r(void 0,h)}const u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(h,d,m)=>s(VM(h),VM(d),m,!0)};return je.forEach(xae({...e,...t}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;const m=je.hasOwnProp(u,d)?u[d]:s,g=je.hasOwnProp(e,d)?e[d]:void 0,w=je.hasOwnProp(t,d)?t[d]:void 0,v=m(g,w,d);je.isUndefined(v)&&m!==c||(n[d]=v)}),je.hasOwnProp(t,"validateStatus")&&je.isUndefined(t.validateStatus)&&l("validateStatusUndefinedResolves")===!1&&(je.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const yae=["content-type","content-length"];function bae(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([r,s])=>{yae.includes(r.toLowerCase())&&e.set(r,s)})}const wae=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16)));function w9(e){const t=Ih({},e),n=m=>je.hasOwnProp(t,m)?t[m]:void 0,r=n("data");let s=n("withXSRFToken");const a=n("xsrfHeaderName"),o=n("xsrfCookieName");let l=n("headers");const c=n("auth"),u=n("baseURL"),h=n("allowAbsoluteUrls"),d=n("url");if(t.headers=l=ns.from(l),t.url=p9(b9(u,d,h,t),n("params"),n("paramsSerializer")),c){const m=je.getSafeProp(c,"username")||"",g=je.getSafeProp(c,"password")||"";try{l.set("Authorization","Basic "+btoa(m+":"+(g?wae(g):"")))}catch(w){throw lt.from(w,lt.ERR_BAD_OPTION_VALUE,e)}}if(je.isFormData(r)&&($i.hasStandardBrowserEnv||$i.hasStandardBrowserWebWorkerEnv||je.isReactNative(r)?l.setContentType(void 0):je.isFunction(r.getHeaders)&&bae(l,r.getHeaders(),n("formDataHeaderPolicy"))),$i.hasStandardBrowserEnv&&(je.isFunction(s)&&(s=s(t)),s===!0||s==null&&lae(t.url))){const g=a&&o&&cae.read(o);g&&l.set(a,g)}return t}const jae=typeof XMLHttpRequest<"u",_ae=jae&&function(e){return new Promise(function(n,r){const s=w9(e);let a=s.data;const o=ns.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=s,h,d,m,g,w;function v(){g&&g(),w&&w(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let b=new XMLHttpRequest;b.open(s.method.toUpperCase(),s.url,!0),b.timeout=s.timeout;function y(){if(!b)return;const N=ns.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),S={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:N,config:e,request:b};y9(function(P){n(P),v()},function(P){r(P),v()},S),b=null}"onloadend"in b?b.onloadend=y:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.startsWith("file:"))||setTimeout(y)},b.onabort=function(){b&&(r(new lt("Request aborted",lt.ECONNABORTED,e,b)),v(),b=null)},b.onerror=function(j){const S=j&&j.message?j.message:"Network Error",C=new lt(S,lt.ERR_NETWORK,e,b);C.event=j||null,r(C),v(),b=null},b.ontimeout=function(){let j=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const S=s.transitional||n4;s.timeoutErrorMessage&&(j=s.timeoutErrorMessage),r(new lt(j,S.clarifyTimeoutError?lt.ETIMEDOUT:lt.ECONNABORTED,e,b)),v(),b=null},a===void 0&&o.setContentType(null),"setRequestHeader"in b&&je.forEach(u9(o),function(j,S){b.setRequestHeader(S,j)}),je.isUndefined(s.withCredentials)||(b.withCredentials=!!s.withCredentials),l&&l!=="json"&&(b.responseType=s.responseType),u&&([m,w]=aj(u,!0),b.addEventListener("progress",m)),c&&b.upload&&([d,g]=aj(c),b.upload.addEventListener("progress",d),b.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(h=N=>{b&&(r(!N||N.type?new Zy(null,e,b):N),b.abort(),v(),b=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const _=sae(s.url);if(_&&!$i.protocols.includes(_)){r(new lt("Unsupported protocol "+_+":",lt.ERR_BAD_REQUEST,e)),v();return}b.send(a||null)})},Nae=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const s=function(c){if(!r){r=!0,o();const u=c instanceof Error?c:this.reason;n.abort(u instanceof lt?u:new Zy(u instanceof Error?u.message:u))}};let a=t&&setTimeout(()=>{a=null,s(new lt(`timeout of ${t}ms exceeded`,lt.ETIMEDOUT))},t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>
629{if(!r){if(c.aborted){s.call(c);return}c.addEventListener("abort",s,{once:!0})}});const{signal:l}=n;return l.unsubscribe=()=>je.asap(o),l},Sae=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},kae=async function*(e,t){for await(const n of Eae(e))yield*Sae(n,t)},Eae=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},WM=(e,t,n,r)=>{const s=kae(e,t);let a=0,o,l=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:h}=await s.next();if(u){l(),c.close();return}let d=h.byteLength;if(n){let m=a+=d;n(m)}c.enqueue(new Uint8Array(h))}catch(u){throw l(u),u}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},HM=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,j9=(e,t,n)=>t+2<n&&HM(e.charCodeAt(t+1))&&HM(e.charCodeAt(t+2)),KM=e=>e<=57?e-48:(e&223)-55,Pae=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,Cae=e=>e===9||e===10||e===12||e===13||e===32,Aae=e=>{const t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},Oae=e=>{const t=e.length;let n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},Tae=e=>{const t=e.length;let n=0,r=0,s=!1;for(let a=0;a<t;a++){let o=e.charCodeAt(a);if(o===37&&j9(e,a,t)&&(o=KM(e.charCodeAt(a+1))*16+KM(e.charCodeAt(a+2)),a+=2),!Cae(o)){if(o===61){r++;continue}if(!Pae(o)||r>0){s=!0;continue}n++}}return s||r>2||r>0&&(n+r)%4!==0||n%4===1?Oae(e):Aae(n)},Rae=(e,t)=>{if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const r=e.slice(5,n),s=e.slice(n+1);if(/;base64/i.test(r))return t(s);let o=0;for(let l=0,c=s.length;l<c;l++){const u=s.charCodeAt(l);if(u===37&&j9(s,l,c))o+=1,l+=2;else if(u<128)o+=1;else if(u<2048)o+=2;else if(u>=55296&&u<=56319&&l+1<c){const h=s.charCodeAt(l+1);h>=56320&&h<=57343?(o+=4,l++):o+=3}else o+=3}return o};function Mae(e){const t=typeof e=="string"?e.indexOf("#"):-1;return Rae(t===-1?e:e.slice(0,t),Tae)}const i4="1.19.0",GM=64*1024,{isFunction:Jw}=je,Iae=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),QM=e=>{if(!je.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},YM=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Dae=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},Lae=e=>{const t=je.global!==void 0&&je.global!==null?je.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=je.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:a,Response:o}=e,l=s?Jw(s):typeof fetch=="function",c=Jw(a),u=Jw(o);if(!l)return!1;const h=l&&Jw(n),d=l&&(typeof r=="function"?(y=>_=>y.encode(_))(new r):async y=>new Uint8Array(await new a(y).arrayBuffer())),m=c&&h&&YM(()=>{let y=!1;const _=new a($i.origin,{body:new n,method:"POST",get duplex(){return y=!0,"half"}}),N=_.headers.has("Content-Type");return _.body!=null&&_.body.cancel(),y&&!N}),g=u&&h&&YM(()=>je.isReadableStream(new o("").body)),w={stream:g&&(y=>y.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!w[y]&&(w[y]=(_,N)=>{let j=_&&_[y];if(j)return j.call(_);throw new lt(`Response type '${y}' is not supported`,lt.ERR_NOT_SUPPORT,N)})});const v=async y=>{if(y==null)return 0;if(je.isBlob(y))return y.size;if(je.isSpecCompliantForm(y))return(await new a($i.origin,{method:"POST",body:y}
vendor: 9,609 bytes, lines 629-635
629).arrayBuffer()).byteLength;if(je.isArrayBufferView(y)||je.isArrayBuffer(y))return y.byteLength;if(je.isURLSearchParams(y)&&(y=y+""),je.isString(y))return(await d(y)).byteLength},b=async(y,_)=>{const N=je.toFiniteNumber(y.getContentLength());return N??v(_)};return async y=>{let{url:_,method:N,data:j,signal:S,cancelToken:C,timeout:P,onDownloadProgress:A,onUploadProgress:F,responseType:I,headers:R,withCredentials:M="same-origin",fetchOptions:$,maxContentLength:B,maxBodyLength:U}=w9(y);const G=je.isNumber(B)&&B>-1,Z=je.isNumber(U)&&U>-1,X=Y=>je.hasOwnProp(y,Y)?y[Y]:void 0;let V=s||fetch;I=I?(I+"").toLowerCase():"text";let z=Nae([S,C&&C.toAbortSignal()],P),L=null;const W=z&&z.unsubscribe&&(()=>{z.unsubscribe()});let Q,J=null;const ne=()=>new lt("Request body larger than maxBodyLength limit",lt.ERR_BAD_REQUEST,y,L);try{let Y;const ee=X("auth");if(ee){const ze=je.getSafeProp(ee,"username")||"",Xe=je.getSafeProp(ee,"password")||"";Y={username:ze,password:Xe}}if(Dae(_)){const ze=new URL(_,$i.origin);if(!Y&&(ze.username||ze.password)){const Xe=QM(ze.username),ke=QM(ze.password);Y={username:Xe,password:ke}}(ze.username||ze.password)&&(ze.username="",ze.password="",_=ze.href)}if(Y&&(R.delete("authorization"),R.set("Authorization","Basic "+btoa(Iae((Y.username||"")+":"+(Y.password||""))))),G&&typeof _=="string"&&_.startsWith("data:")&&Mae(_)>B)throw new lt("maxContentLength size of "+B+" exceeded",lt.ERR_BAD_RESPONSE,y,L);if(Z&&N!=="get"&&N!=="head"){const ze=await v(j);if(typeof ze=="number"&&isFinite(ze)&&(Q=ze,ze>U))throw ne()}const le=Z&&(je.isReadableStream(j)||je.isStream(j)),re=(ze,Xe,ke)=>WM(ze,GM,Ae=>{if(Z&&Ae>U)throw J=ne();Xe&&Xe(Ae)},ke);if(m&&N!=="get"&&N!=="head"&&(F||le)){if(Q=Q??await b(R,j),Q!==0||le){let ze=new a(_,{method:"POST",body:j,duplex:"half"}),Xe;if(je.isFormData(j)&&(Xe=ze.headers.get("content-type"))&&R.setContentType(Xe),ze.body){const[ke,Ae]=F&&zM(Q,aj(BM(F)))||[];j=re(ze.body,ke,Ae)}}}else if(le&&!c&&h&&N!=="get"&&N!=="head")j=re(j);else if(le&&c&&!m&&N!=="get"&&N!=="head")throw new lt("Stream request bodies are not supported by the current fetch implementation",lt.ERR_NOT_SUPPORT,y,L);je.isString(M)||(M=M?"include":"omit");const fe=c&&"credentials"in a.prototype;if(je.isFormData(j)){const ze=R.getContentType();ze&&/^multipart\/form-data/i.test(ze)&&!/boundary=/i.test(ze)&&R.delete("content-type")}R.set("User-Agent","axios/"+i4,!1);const ge={...$,signal:z,method:N.toUpperCase(),headers:u9(R.normalize()),body:j,duplex:"half",credentials:fe?M:void 0};L=c&&new a(_,ge);let he=await(c?V(L,$):V(_,ge));const De=ns.from(he.headers);if(G){const ze=je.toFiniteNumber(De.getContentLength());if(ze!=null&&ze>B)throw new lt("maxContentLength size of "+B+" exceeded",lt.ERR_BAD_RESPONSE,y,L)}const _e=g&&(I==="stream"||I==="response");if(g&&he.body&&(A||G||_e&&W)){const ze={};["status","statusText","headers"].forEach(Pe=>{ze[Pe]=he[Pe]});const Xe=je.toFiniteNumber(De.getContentLength()),[ke,Ae]=A&&zM(Xe,aj(BM(A),!0))||[];let Be=0;const de=Pe=>{if(G&&(Be=Pe,Be>B))throw new lt("maxContentLength size of "+B+" exceeded",lt.ERR_BAD_RESPONSE,y,L);ke&&ke(Pe)};he=new o(WM(he.body,GM,de,()=>{Ae&&Ae(),W&&W()}),ze)}I=I||"text";let We=await w[je.findKey(w,I)||"text"](he,y);if(G&&!g&&!_e){let ze;if(We!=null&&(typeof We.byteLength=="number"?ze=We.byteLength:typeof We.size=="number"?ze=We.size:typeof We=="string"&&(ze=typeof r=="function"?new r().encode(We).byteLength:We.length)),typeof ze=="number"&&ze>B)throw new lt("maxContentLength size of "+B+" exceeded",lt.ERR_BAD_RESPONSE,y,L)}return!_e&&W&&W(),await new Promise((ze,Xe)=>{y9(ze,Xe,{data:We,headers:ns.from(he.headers),status:he.status,statusText:he.statusText,config:y,request:L})})}catch(Y){if(W&&W(),z&&z.aborted&&z.reason instanceof lt){const ee=z.reason;throw ee.config=y,L&&(ee.request=L),Y!==ee&&Object.defineProperty(ee,"cause",{__proto__:null,value:Y,writable:!0,enumerable:!1,configurable:!0}),ee}if(J)throw L&&!J.request&&(J.request=L),J;if(Y instanceof lt)throw L&&!Y.request&&(Y.request=L),Y;if(Y&&Y.name==="TypeError"&&/Load failed|fetch/i.test(Y.message)){const ee=new lt("Network Error",lt.ERR_NETWORK,y,L,Y&&Y.response);throw Object.defineProperty(ee,"cause",{__proto__:null,value:Y.cause||Y,writable:!0,enumerable:!1,configurable:!0}),ee}throw lt.from(Y,Y&&Y.code,y,L,Y&&Y.response)}}},Fae=new Map,_9=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,a=[r,s,n];let o=a.length,l=o,c,u,h=Fae;for(;l--;)c=a[l],u=h.get(c),u===void 0&&h.set(c,u=l?new Map:Lae(t)),h=u;return u};_9();const s4={http:Use,xhr:_ae,fetch:{get:_9}};je.forEach(s4,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const XM=e=>`- ${e}`,$ae=e=>je.isFunction(e)||e===null||e===!1;function qae(e,t){e=je.isArray(e)?e:[e];const{length:n}=e;let r,s;const a={};for(let o=0;o<n;o++){r=e[o];let l;if(s=r,!$ae(r)&&(s=s4[(l=String(r)).toLowerCase()],s===void 0))throw new lt(`Unknown adapter '${l}'`);if(s&&(je.isFunction(s)||(s=s.get(t))))break;a[l||"#"+o]=s}if(!s){const o=Object.entries(a).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=n?o.length>1?`since :
630`+o.map(XM).join(`
631`):" "+XM(o[0]):"as no adapter specified";throw new lt("There is no suitable adapter to dispatch the request "+l,lt.ERR_NOT_SUPPORT)}return s}const N9={getAdapter:qae,adapters:s4};function vS(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Zy(null,e)}function xS(e){return vS(e),e.headers=ns.from(e.headers),e.data=gS.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),N9.getAdapter(e.adapter||Xy.adapter,e)(e).then(function(r){vS(e),e.response=r;try{r.data=gS.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=ns.from(r.headers),r},function(r){if(!x9(r)&&(vS(e),r&&r.response)){e.response=r.response;try{r.response.data=gS.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=ns.from(r.response.headers)}return Promise.reject(r)})}const D_={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{D_[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ZM={};D_.transitional=function(t,n,r){function s(a,o){return"[Axios v"+i4+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,l)=>{if(t===!1)throw new lt(s(o," has been removed"+(n?" in "+n:"")),lt.ERR_DEPRECATED);return n&&!ZM[o]&&(ZM[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,l):!0}};D_.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function zae(e,t,n){if(typeof e!="object"||e===null)throw new lt("options must be an object",lt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){const l=e[a],c=l===void 0||o(l,a,e);if(c!==!0)throw new lt("option "+a+" must be "+c,lt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new lt("Unknown option "+a,lt.ERR_BAD_OPTION)}}const F1={assertOptions:zae,validators:D_},Qi=F1.validators;let Nh=class{constructor(t){this.defaults=t||{},this.interceptors={request:new $M,response:new $M}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const a=(()=>{if(!s.stack)return"";const o=s.stack.indexOf(`
632`);return o===-1?"":s.stack.slice(o+1)})();try{if(!r.stack)r.stack=a;else if(a){const o=a.indexOf(`
633`),l=o===-1?-1:a.indexOf(`
634`,o+1),c=l===-1?"":a.slice(l+1);String(r.stack).endsWith(c)||(r.stack+=`
635`+a)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ih(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:a}=n;r!==void 0&&F1.assertOptions(r,{silentJSONParsing:Qi.transitional(Qi.boolean),forcedJSONParsing:Qi.transitional(Qi.boolean),clarifyTimeoutError:Qi.transitional(Qi.boolean),legacyInterceptorReqResOrdering:Qi.transitional(Qi.boolean),advertiseZstdAcceptEncoding:Qi.transitional(Qi.boolean),validateStatusUndefinedResolves:Qi.transitional(Qi.boolean)},!1),s!=null&&(je.isFunction(s)?n.paramsSerializer={serialize:s}:F1.assertOptions(s,{encode:Qi.function,serialize:Qi.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),F1.assertOptions(n,{baseUrl:Qi.spelling("baseURL"),withXsrfToken:Qi.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&je.merge(a.common,a[n.method]);a&&je.forEach(["delete","get","head","post","put","patch","query","common"],w=>{delete a[w]}),n.headers=ns.concat(o,a);const l=[];let c=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;c=c&&v.synchronous;const b=n.transitional||n4;b&&b.legacyInterceptorReqResOrdering?l.unshift(v.fulfilled,v.rejected):l.push(v.fulfilled,v.rejected)});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let h,d=0,m;if(!c){const w=[xS.bind(this),void 0];for(w.unshift(...l),w.push(...u),m=w.length,h=Promise.resolve(n);d<m;)h=h.then(w[d++],w[d++]);return h}m=l.length;let g=n;for(;d<m;){const w=l[d++],v=l[d++];try{g=w?w(g):g}catch(b){if(!v){h=Promise.reject(b);break}try{const y=v.call(this,b);je.isThenable(y)&&(h=Promise.resolve(y).then(()=>xS.call(this,g)))}
vendor: 1,997 bytes, line 635
635catch(y){h=Promise.reject(y)}break}}if(!h)try{h=xS.call(this,g)}catch(w){h=Promise.reject(w)}for(d=0,m=u.length;d<m;)h=h.then(u[d++],u[d++]);return h}getUri(t){t=Ih(this.defaults,t);const n=b9(t.baseURL,t.url,t.allowAbsoluteUrls,t);return p9(n,t.params,t.paramsSerializer)}};je.forEach(["delete","get","head","options"],function(t){Nh.prototype[t]=function(n,r){return this.request(Ih(r||{},{method:t,url:n,data:r&&je.hasOwnProp(r,"data")?r.data:void 0}))}});je.forEach(["post","put","patch","query"],function(t){function n(r){return function(a,o,l){return this.request(Ih(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}Nh.prototype[t]=n(),t!=="query"&&(Nh.prototype[t+"Form"]=n(!0))});let Bae=class S9{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(s=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](s);r._listeners=null}),this.promise.then=s=>{let a;const o=new Promise(l=>{r.subscribe(l),a=l}).then(s);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,l){r.reason||(r.reason=new Zy(a,o,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new S9(function(s){t=s}),cancel:t}}};function Uae(e){return function(n){return e.apply(null,n)}}function Vae(e){return je.isObject(e)&&e.isAxiosError===!0}const AA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
635alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(AA).forEach(([e,t])=>{AA[t]=e});function k9(e){const t=new Nh(e),n=t9(Nh.prototype.request,t);return je.extend(n,Nh.prototype,t,{allOwnKeys:!0}),je.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return k9(Ih(e,s))},n}const Lr=k9(Xy);Lr.Axios=Nh;Lr.CanceledError=Zy;Lr.CancelToken=Bae;Lr.isCancel=x9;Lr.VERSION=i4;Lr.toFormData=I_;Lr.AxiosError=lt;Lr.Cancel=Lr.CanceledError;Lr.all=function(t){return Promise.all(t)};Lr.spread=Uae;Lr.isAxiosError=Vae;Lr.mergeConfig=Ih;Lr.AxiosHeaders=ns;Lr.formToJSON=e=>v9(je.isHTMLForm(e)?new FormData(e):e);Lr.getAdapter=N9.getAdapter;Lr.HttpStatusCode=AA;Lr.default=Lr;const{Axios:TIe,AxiosError:RIe,CanceledError:MIe,isCancel:IIe,CancelToken:DIe,VERSION:LIe,all:FIe,Cancel:$Ie,isAxiosError:qIe,spread:zIe,toFormData:BIe,AxiosHeaders:UIe,HttpStatusCode:VIe,formToJSON:WIe,getAdapter:HIe,mergeConfig:KIe,create:GIe}=Lr,E9=typeof window>"u",JM=!E9&&window.self!==window.top,Wae=!E9&&typeof document>"u",P9=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),Di=[];for(let e=0;e<256;++e)Di.push((e+256).toString(16).slice(1));function Hae(e,t=0){return(Di[e[t+0]]+Di[e[t+1]]+Di[e[t+2]]+Di[e[t+3]]+"-"+Di[e[t+4]]+Di[e[t+5]]+"-"+Di[e[t+6]]+Di[e[t+7]]+"-"+Di[e[t+8]]+Di[e[t+9]]+"-"+Di[e[t+10]]+Di[e[t+11]]+Di[e[t+12]]+Di[e[t+13]]+Di[e[t+14]]+Di[e[t+15]]).toLowerCase()}let yS;const Kae=new Uint8Array(16);function Gae(){if(!yS){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");yS=crypto.getRandomValues.bind(crypto)}return yS(Kae)}const Qae=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),e3={randomUUID:Qae};function Yae(e,t,n){var s;e=e||{};const r=e.random??((s=e.rng)==null?void 0:s.call(e))??Gae();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Hae(r)}function Xae(e,t,n){return e3.randomUUID&&!e?e3.randomUUID():Yae(e)}const Yx=typeof window<"u"?window:{base44SharedInstances:{}};function Zae(e,t){return Yx.base44SharedInstances||(Yx.base44SharedInstances={}),Yx.base44SharedInstances[e]||(Yx.base44SharedInstances[e]={instance:t()}),Yx.base44SharedInstances[e].instance}const Jae="__user_heartbeat_event__",eoe="__initialization_event__",toe="__session_duration_event__",t3="analytics-enable",n3="base44_analytics_session_id",noe={enabled:!0,maxQueueSize:1e3,throttleTime:1e3,batchSize:30,heartBeatInterval:60*1e3},roe="analytics",Ln=Zae(roe,()=>({requestsQueue:[],isProcessing:!1,isHeartBeatProcessing:!1,wasInitializationTracked:!1,sessionContext:null,sessionStartTime:null,fallbackSessionId:null,config:{...noe,...doe()}})),ioe=({axiosClient:e,serverUrl:t,appId:n,userAuthModule:r,enabled:s})=>{var a;const{maxQueueSize:o,throttleTime:l,batchSize:c}=Ln.config;if(!s||!(!((a=Ln.config)===null||a===void 0)&&a.enabled)||Wae)return{track:()=>{},cleanup:()=>{}};let u;const h=`${t}/api/apps/${n}/analytics/track/batch`,d=async j=>{await e.request({method:"POST",url:`/apps/${n}/analytics/track/batch`,data:{events:j}})},m=j=>{try{const S=JSON.stringify({events:j}),C=new Blob([S],{type:"application/json"});return typeof navigator>"u"||S.length>6e4||!navigator.sendBeacon(h,C)}catch{return!1}},g=async(j,S={})=>
635{if(j.length===0)return;const C=await uoe(r),P=j.map(coe(C));try{(!S.isBeacon||!m(P))&&await d(P)}catch{}},w=()=>{i3(g,{throttleTime:l,batchSize:c})},v=j=>{if(Ln.requestsQueue.length>=o)return;const S=loe();Ln.requestsQueue.push({...j,...S}),w()},b=()=>{i3(g,{throttleTime:l,batchSize:c}),u=s3(v),aoe()},y=()=>{r3(),u==null||u(),ooe(v);const j=Ln.requestsQueue.splice(0);g(j,{isBeacon:!0})},_=()=>{typeof window>"u"||(document.visibilityState==="hidden"?y():document.visibilityState==="visible"&&b())},N=()=>{r3(),u==null||u(),typeof window<"u"&&window.removeEventListener("visibilitychange",_)};return w(),u=s3(v),soe(v),typeof window<"u"&&window.addEventListener("visibilitychange",_),{track:v,cleanup:N}};function r3(){Ln.isProcessing=!1}async function i3(e,t){if(Ln.isProcessing)return;Ln.isProcessing=!0;const{throttleTime:n=1e3,batchSize:r=30}=t??{};for(;Ln.isProcessing&&Ln.requestsQueue.length>0;){const s=Ln.requestsQueue.splice(0,r);s.length&&await e(s),await new Promise(a=>setTimeout(a,n))}Ln.isProcessing=!1}function s3(e){var t;if(typeof window>"u"||Ln.isHeartBeatProcessing||((t=Ln.config.heartBeatInterval)!==null&&t!==void 0?t:0)<10)return()=>{};Ln.isHeartBeatProcessing=!0;const n=setInterval(()=>{e({eventName:Jae})},Ln.config.heartBeatInterval);return()=>{clearInterval(n),Ln.isHeartBeatProcessing=!1}}function soe(e){typeof window>"u"||Ln.wasInitializationTracked||(Ln.wasInitializationTracked=!0,e({eventName:eoe,properties:{referrer:document==null?void 0:document.referrer}}))}function aoe(){typeof window>"u"||Ln.sessionStartTime!==null||(Ln.sessionStartTime=new Date().toISOString())}function ooe(e){if(typeof window>"u"||Ln.sessionStartTime===null)return;const t=new Date().getTime()-new Date(Ln.sessionStartTime).getTime();Ln.sessionStartTime=null,e({eventName:toe,properties:{sessionDuration:t}})}function loe(){var e,t;return{timestamp:new Date().toISOString(),pageUrl:typeof window<"u"&&(t=(e=window.location)===null||e===void 0?void 0:e.pathname)!==null&&t!==void 0?t:null}}function coe(e){return t=>({event_name:t.eventName,properties:t.properties,timestamp:t.timestamp,page_url:t.pageUrl,...e})}let m0=null;function a3(){Ln.sessionContext=null,m0=null}async function uoe(e){if(!Ln.sessionContext){if(!e.hasToken())return{user_id:null,session_id:oj()};if(!m0){const r=oj();m0=e.me().then(s=>({user_id:s.id,session_id:r})).catch(()=>({user_id:null,session_id:r}))}const t=m0,n=await t;return m0===t&&(Ln.sessionContext=n),n}return Ln.sessionContext}function doe(){if(typeof window>"u"||!window.location)return;const t=new URLSearchParams(window.location.search).get(t3);if(t==null||!t.length)return;const n=new URLSearchParams(window.location.search);n.delete(t3);const r=window.location.pathname+(n.toString()?"?"+n.toString():"");return window.history.replaceState({},"",r),{enabled:t==="true"}}function o3(){var e;return(e=Ln.fallbackSessionId)!==null&&e!==void 0?e:Ln.fallbackSessionId=P9()}function oj(){if(typeof window>"u")return o3();try{const e=localStorage.getItem(n3);if(!e){const t=P9();return localStorage.setItem(n3,t),t}return e}catch{return o3()}}class foe extends Error{constructor(t,n,r,s,a){super(t),this.name="Base44Error",this.status=n,this.code=r,this.data=s,this.originalError=a}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code,data:this.data}}}function $p({baseURL:e,headers:t={},token:n,interceptResponses:r=!0,onError:s}){const a=Lr.create({baseURL:e,headers:{"Content-Type":"application/json",Accept:"application/json",...t}});return n&&(a.defaults.headers.common.Authorization=`Bearer ${n}`),a.interceptors.request.use(o=>{typeof window<"u"&&(window.location&&o.headers.set("X-Origin-URL",window.location.href),o.headers.get("Authorization")||o.headers.set("X-Base44-Anonymous-Id",oj()));const l=Xae();if(o.requestId=l,JM)try{window.parent.postMessage({type:"api-request-start",requestId:l,data:{url:e+o.url,method:o.method,body:o.data instanceof FormData?"[FormData object]":o.data}},"*")}catch{}return o}),r&&a.interceptors.response.use(o=>{var l;const c=(l=o.config)===null||l===void 0?void 0:l.requestId;try{JM&&c&&window.parent.postMessage({type:"api-request-end",requestId:c,data:{statusCode:o.status,response:o.data}},"*")}catch{}return o.data},o=>{var l,c,u,h,d,m,g,w,v,b,y,_;const N=(l=o.response)===null||l===void 0?void 0:l.data,j=((c=N==null?void 0:N.error)===null||c===void 0?void 0:c.message)||(N==null?void 0:N.message)||(N==null?void 0:N.detail)||o.message,S=new foe(j,(u=o.response)===null||u===void 0?void 0:u.status,(b=(m=(d=(h=N==null?void 0:N.error)===null||h===void 0?void 0:h.code)!==null&&d!==void 0?d:N==null?void 0:N.co
635de)!==null&&m!==void 0?m:(v=(w=(g=o.response)===null||g===void 0?void 0:g.headers)===null||w===void 0?void 0:w.get)===null||v===void 0?void 0:v.call(w,"x-base44-connector-error"))!==null&&b!==void 0?b:(_=(y=o.response)===null||y===void 0?void 0:y.headers)===null||_===void 0?void 0:_["x-base44-connector-error"],N,o);return s==null||s(S),Promise.reject(S)}),a}function l3(e){const{axios:t,appId:n,getSocket:r}=e;return new Proxy({},{get(s,a){if(!(typeof a!="string"||a==="then"||a.startsWith("_")))return poe(t,n,a,r)}})}function hoe(e){var t;try{const n=JSON.parse(e);return{type:n.type,data:n.data,id:n.id||((t=n.data)===null||t===void 0?void 0:t.id),timestamp:n.timestamp||new Date().toISOString()}}catch(n){return console.warn("[Base44 SDK] Failed to parse realtime message:",n),null}}const moe=100;function c3(e){return typeof e=="object"&&e!==null}function poe(e,t,n,r){const s=`/apps/${t}/entities/${n}`,a=c=>Array.isArray(c)?c.join(","):c,o=(c,u,h,d,m)=>{const g={};return m&&(g.q=JSON.stringify(m)),c&&(g.sort=c),u&&(g.limit=u),h&&(g.skip=h),d&&(g.fields=a(d)),e.get(s,{params:g})},l=(c,u)=>{const h={};return u&&(h.q=JSON.stringify(u)),h.limit=c.limit||moe,c.cursor&&(h.cursor=c.cursor),"distinct"in c?h.distinct=c.distinct:(c.sort&&(h.sort=c.sort),c.fields&&(h.fields=a(c.fields))),e.get(`${s}/v2/list`,{params:h})};return{async list(...c){const[u,h,d,m]=c;return c3(u)?l(u):o(u,h,d,m)},async filter(c,...u){const[h,d,m,g]=u;return c3(h)?l(h,c):o(h,d,m,g,c)},async get(c){return e.get(`${s}/${c}`)},async create(c){return e.post(s,c)},async update(c,u){return e.put(`${s}/${c}`,u)},async delete(c){return e.delete(`${s}/${c}`)},async deleteMany(c){return e.delete(s,{data:c})},async bulkCreate(c){return e.post(`${s}/bulk`,c)},async updateMany(c,u){return e.patch(`${s}/update-many`,{query:c,data:u})},async count(c){const u={};return c&&(u.q=JSON.stringify(c)),(await e.get(`${s}/count`,{params:u})).count},async aggregate(c){return e.post(`${s}/aggregate`,c)},async upsert(c,u){return e.post(`${s}/upsert`,{records:c,key:u.key})},async bulkUpdate(c){return e.put(`${s}/bulk`,c)},async importEntities(c){const u=new FormData;return u.append("file",c,c.name),e.post(`${s}/import`,u,{headers:{"Content-Type":"multipart/form-data"}})},subscribe(c){const u=`entities:${t}:${n}`;return r().subscribeToRoom(u,{update_model:m=>{var g;const w=hoe(m.data);if(w){w.type!=="delete"&&(!((g=w.data)===null||g===void 0)&&g._oversize)&&console.error(`[Base44 SDK] Realtime broadcast for ${n}#${w.id} was oversize and got slimmed for transport. Fields >10 KB are empty and the rest of the record may be a stub. Call \`entities.${n}.get("${w.id}")\` to fetch the full record.`);try{c(w)}catch(v){console.error("[Base44 SDK] Subscription callback error:",v)}}}})}}}function goe(e,t){return{async call(n,r,s){if(!(n!=null&&n.trim()))throw new Error("Integration slug is required and cannot be empty");if(!(r!=null&&r.trim()))throw new Error("Operation ID is required and cannot be empty");const{pathParams:a,queryParams:o,...l}=s??{},c={...l,...a&&{path_params:a},...o&&{query_params:o}};return await e.post(`/apps/${t}/integrations/custom/${n}/${r}`,c)}}}function u3(e,t){const n=goe(e,t);return new Proxy({},{get(r,s){if(!(typeof s!="string"||s==="then"||s.startsWith("_")))return s==="custom"?n:new Proxy({},{get(a,o){if(!(typeof o!="string"||o==="then"||o.startsWith("_")))return async l=>{if(typeof l=="string")throw new Error(`Integration ${o} must receive an object with named parameters, received: ${l}`);let c,u;return l instanceof FormData||l&&Object.values(l).some(h=>h instanceof File)?(c=new FormData,Object.keys(l).forEach(h=>{l[h]instanceof File?c.append(h,l[h],l[h].name):typeof l[h]=="object"&&l[h]!==null?c.append(h,JSON.stringify(l[h])):c.append(h,l[h])}),u="multipart/form-data"):(c=l,u="application/json"),s==="Core"?e.post(`/apps/${t}/integration-endpoints/Core/${o}`,c||l,{headers:{"Content-Type":u}}):e.post(`/apps/${t}/integration-endpoints/installable/${s}/integration-endpoints/${o}`,c||l,{headers:{"Content-Type":u}})}}})}})}function voe(){return typeof window>"u"?!1:window!==window.parent}function xoe(e,t,n){const a=Math.round(window.screenX+(window.outerWidth-500)/2),o=Math.round(window.screenY+(window.outerHeight-600)/2),l=window.open(e,"base44_auth",`width=500,height=600,left=${a},top=${o},resizable=yes,scrollbars=yes`);if(!l)return;const c=()=>{window.removeEventListener("message",u),clearInterval(h),l.closed||l.close()},u=d=>{var m;if(d.origin!==n||d.source!==l||!(!((m=d.data)===null||m===void 0)&&m.access_token))return;c();const g=new URL(t),{access_token:w,is_new_user:v}=d.data;g.searchParams.set("access_token",w),v!=null&&g.searchParams.set("is_new_user",String(v)),window.location.href=g.toString()},h=setInterval(()=>{l.closed&&c()},500);window.addEventListener("message",u)}function yoe(e,t,n,r){let s=null;const a=()=>{s=null};let o=!!r.token;return{hasToken(){return o},async me(){const l=s??e.get(`/apps/${n}/entities/User/me`).finally(()=>{s===l&&(s=null)});return s=l,l},async updateMe(l){return e.put(`/apps/${n}/entities/User/me`,l)},redirectToLogin(l){if(typeof window>"u")throw new Error("Login method can only be used in a browser environment");const c=l?new URL(l,window.location.origin).toString():window.location.href,u=`${r.appBaseUrl}/login?from_url=${encodeURIComponent(c)}`;window.location.href=u},loginWithProvider(l,c="/"){const u=new URL(c,window.location.origin).toString(),h=`app_id=${n}&from_url=${encodeURIComponent(u)}`;let d;l==="sso"?d=`/apps/${n}/auth/sso/login`:d=`/apps/auth${l==="google"?"":`/${l}`}/login`;const m=`${r.appBaseUrl}/api${d}?${h}`;
635if(voe()){const g=`${m}&popup_origin=${encodeURIComponent(window.location.origin)}`;return xoe(g,u,window.location.origin)}window.location.href=m},logout(l){if(delete e.defaults.headers.common.Authorization,a(),a3(),o=!1,typeof window<"u"){if(window.localStorage)try{window.localStorage.removeItem("base44_access_token"),window.localStorage.removeItem("token")}catch(h){console.error("Failed to remove token from localStorage:",h)}const c=l||window.location.href,u=`${r.appBaseUrl}/api/apps/auth/logout?from_url=${encodeURIComponent(c)}`;window.location.href=u}},setToken(l,c=!0){if(l&&(a(),a3(),o=!0,e.defaults.headers.common.Authorization=`Bearer ${l}`,t.defaults.headers.common.Authorization=`Bearer ${l}`,c&&typeof window<"u"&&window.localStorage))try{window.localStorage.setItem("base44_access_token",l),window.localStorage.setItem("token",l)}catch(u){console.error("Failed to save token to localStorage:",u)}},async loginViaEmailPassword(l,c,u){var h;try{const d=await e.post(`/apps/${n}/auth/login`,{email:l,password:c,...u&&{turnstile_token:u}}),{access_token:m,user:g}=d;return m&&this.setToken(m),{access_token:m,user:g}}catch(d){throw((h=d.response)===null||h===void 0?void 0:h.status)===401&&await this.logout(),d}},async isAuthenticated(){try{return await this.me(),!0}catch{return!1}},inviteUser(l,c){return e.post(`/apps/${n}/users/invite-user`,{user_email:l,role:c})},register(l){return e.post(`/apps/${n}/auth/register`,l)},verifyOtp({email:l,otpCode:c}){return e.post(`/apps/${n}/auth/verify-otp`,{email:l,otp_code:c})},resendOtp(l){return e.post(`/apps/${n}/auth/resend-otp`,{email:l})},resetPasswordRequest(l){return e.post(`/apps/${n}/auth/reset-password-request`,{email:l})},resetPassword({resetToken:l,newPassword:c}){return e.post(`/apps/${n}/auth/reset-password`,{reset_token:l,new_password:c})},changePassword({userId:l,currentPassword:c,newPassword:u}){return e.post(`/apps/${n}/auth/change-password`,{user_id:l,current_password:c,new_password:u})}}}function boe(e,t){return{async getAccessToken(n){const r=`/apps/${t}/auth/sso/accesstoken/${n}`;return e.get(r)},async getIdToken(n){const r=`/apps/${t}/auth/sso/idtoken/${n}`;return e.get(r)}}}const woe=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD"]);function joe(e,t){return{async getAccessToken(n){if(!n||typeof n!="string")throw new Error("Integration type is required and must be a string");return(await e.get(`/apps/${t}/external-auth/tokens/${encodeURIComponent(n)}`)).access_token},async getConnection(n){var r;if(!n||typeof n!="string")throw new Error("Integration type is required and must be a string");const a=await e.get(`/apps/${t}/external-auth/tokens/${encodeURIComponent(n)}`);return{accessToken:a.access_token,connectionConfig:(r=a.connection_config)!==null&&r!==void 0?r:null}},async getWorkspaceConnection(n){var r;if(!n||typeof n!="string")throw new Error("Connector ID is required and must be a string");const a=await e.get(`/apps/${t}/external-auth/tokens/connectors/${encodeURIComponent(n)}`);return{accessToken:a.access_token,connectionConfig:(r=a.connection_config)!==null&&r!==void 0?r:null}},async getCurrentAppUserAccessToken(n){if(!n||typeof n!="string")throw new Error("Connector ID is required and must be a string");return(await e.get(`/apps/${t}/app-user-auth/connectors/${encodeURIComponent(n)}/token`)).access_token},async getCurrentAppUserConnection(n){var r;if(!n||typeof n!="string")throw new Error("Connector ID is required and must be a string");const a=await e.get(`/apps/${t}/app-user-auth/connectors/${encodeURIComponent(n)}/token`);return{accessToken:a.access_token,connectionConfig:(r=a.connection_config)!==null&&r!==void 0?r:null}},async callApi(n,r){return C9(n,"Integration type"),_oe(e,`/apps/${t}/connectors/${encodeURIComponent(n)}/call`,r)}}}function C9(e,t){if(!e||typeof e!="string")throw new Error(`${t} is required and must be a string`)}async function _oe(e,t,n){var r,s,a,o,l,c,u,h,d;if(!n||typeof n!="object")throw new Error("Request is required and must be an object");C9(n.path,"Request path");const m=(r=n.method)!==null&&r!==void 0?r:"GET";if(!woe.has(m))throw new Error("Request method must be one of GET, POST, PUT, PATCH, DELETE, or HEAD");const w=await e.post(t,{method:m,...n.host==null?{}:{host:n.host},path:n.path,query:(s=n.query)!==null&&s!==void 0?s:{},headers:(a=n.headers)!==null&&a!==void 0?a:{},body:(o=n.body)!==null&&o!==void 0?o:null});return{success:w.success,phase:w.phase,status:(l=w.status_code)!==null&&l!==void 0?l:null,data:w.data,dataBase64:(c=w.data_base64)!==null&&c!==void 0?c:null,contentType:(u=w.content_type)!==null&&u!==void 0?u:null,headers:(h=w.headers)!==null&&h!==void 0?h:{},creditsCharged:(d=w.credits_charged)!==null&&d!==void 0?d:0}}function Noe(e,t){return{async connectAppUser(n){if(!n||typeof n!="str
635ing")throw new Error("Connector ID is required and must be a string");return(await e.post(`/apps/${t}/app-user-auth/connectors/${encodeURIComponent(n)}/initiate`)).redirect_url},async disconnectAppUser(n){if(!n||typeof n!="string")throw new Error("Connector ID is required and must be a string");await e.delete(`/apps/${t}/app-user-auth/connectors/${encodeURIComponent(n)}`)}}}function jd(e={}){const{storageKey:t="base44_access_token",paramName:n="access_token",saveToStorage:r=!0,removeFromUrl:s=!0}=e;let a=null;if(typeof window<"u"&&window.location)try{const o=new URLSearchParams(window.location.search);if(a=o.get(n),a){if(r&&Soe(a,{storageKey:t}),s){o.delete(n);const l=`${window.location.pathname}${o.toString()?`?${o.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,l)}return a}}catch(o){console.error("Error retrieving token from URL:",o)}if(typeof window<"u"&&window.localStorage)try{return a=window.localStorage.getItem(t),a}catch(o){console.error("Error retrieving token from local storage:",o)}return null}function Soe(e,t){const{storageKey:n="base44_access_token"}=t;if(typeof window>"u"||!window.localStorage||!e)return!1;try{return window.localStorage.setItem(n,e),window.localStorage.setItem("token",e),!0}catch(r){return console.error("Error saving token to local storage:",r),!1}}function koe({axios:e,serviceRoleAxios:t,appId:n,serverUrl:r,functionsVersion:s,platformHeaders:a}){const o=new Headers(a),l=c=>{const u=c.defaults.headers.common.Authorization;return typeof u=="string"&&u.startsWith("Bearer ")?u:null};return async function(u,h={}){Eoe(u);const{fetch:d=fetch,...m}=h,g=new Headers(h.headers),w=(v,b)=>{b&&!g.has(v)&&g.set(v,b)};return w("Authorization",l(e)),w("Base44-Service-Authorization",l(t)),w("Base44-App-Id",n),w("Base44-Api-Url",r),w("Base44-Functions-Version",s),w("Base44-State",o.get("Base44-State")),w("X-Data-Env",o.get("X-Data-Env")),d(u,{...m,headers:g})}}function Eoe(e){if(typeof e!="string"||e==="")throw new Error("fetchWithAuth() requires a path, such as '/api/orders'.");const t=e.replace(/[\t\n\r]/g,"").replace(/^[\x00-\x20]+/,"");if(!t.startsWith("/")||t.startsWith("//")||t.startsWith("/\\"))throw new Error(`fetchWithAuth() only sends requests to your app's own origin, so your app's credentials never reach a third party. "${e}" is not a path on it — pass a relative path such as '/api/orders'. Use base44.functions.fetch() to call a Base44 backend function, or plain fetch() for another origin.`)}function d3(e,t,n){const r=(a,o)=>a?`${String(a).replace(/\/$/,"")}${o}`:o,s=a=>{const o=new Headers;if(n!=null&&n.getAuthHeaders){const l=n.getAuthHeaders();Object.entries(l).forEach(([c,u])=>{u!=null&&o.set(c,String(u))})}return a&&new Headers(a).forEach((l,c)=>{o.set(c,l)}),o};return{async invoke(a,o){if(typeof o=="string")throw new Error(`Function ${a} must receive an object with named parameters, received: ${o}`);let l,c;return o instanceof FormData||o&&Object.values(o).some(u=>u instanceof File)?(l=new FormData,Object.keys(o).forEach(u=>{o[u]instanceof File?l.append(u,o[u],o[u].name):typeof o[u]=="object"&&o[u]!==null?l.append(u,JSON.stringify(o[u])):l.append(u,o[u])}),c="multipart/form-data"):(l=o,c="application/json"),e.post(`/apps/${t}/functions/${a}`,l||o,{headers:{"Content-Type":c}})},async fetch(a,o={}){const c=`/functions${a.startsWith("/")?a:`/${a}`}`,u=s(o.headers),h={...o,headers:u};return await fetch(r(n==null?void 0:n.baseURL,c),h)}}}function f3({axios:e,getSocket:t,appId:n,serverUrl:r,token:s}){const a=`/apps/${n}/agents`,o={},l=()=>e.get(`${a}/conversations`),c=v=>e.get(`${a}/conversations/${v}`);return{getConversations:l,getConversation:c,listConversations:v=>e.get(`${a}/conversations`,{params:v}),createConversation:v=>e.post(`${a}/conversations`,v),addMessage:async(v,b)=>e.post(`${a}/conversations/v2/${v.id}/messages`,b),subscribeToConversation:(v,b)=>{const y=`/agent-conversations/${v}`,_=t(),N=c(v).then(j=>(o[v]=j,j));return _.subscribeToRoom(y,{connect:()=>{},update_model:async({data:j})=>{const S=JSON.parse(j);if(S._message){await N;const C=S._message,P=o[v];if(P){const A=P.messages||[],F=A.findIndex(R=>R.id===C.id),I=F!==-1?A.map((R,M)=>M===F?C:R):[...A,C];o[v]={...P,messages:I},b==null||b(o[v])}}}})},getWhatsAppConnectURL:v=>{const b=`${r}/api/apps/${n}/agents/${encodeURIComponent(v)}/whatsapp`,y=s??jd();return y?`${b}?token=${y}`:b},getTelegramConnectURL:v=>{const b=`${r}/api/apps/${n}/agents/${encodeURIComponent(v)}/telegram`,y=s??jd();return y?`${b}?token=${y}`:b}}}const h3={openai:"openai",typesafe:"typesafe"};function m3({serverUrl:e,token:t,appId:n,headers:r={}}){return{connection:({provider:a="openai"}={})=>{var o;if(!Object.prototype.hasOwnProperty.call(h3,a))throw new Error(`Unsupported AI Gateway provider: ${a}`);const l=h3[a];return{baseURL:`${e}/api/apps/${n}/ai/${l}/v1`,token:(o=t??jd())!==null&&o!==void 0?o:"",headers:{...r}}}}}function p3(e,t){const n=`/app-logs/${t}`;return{async logUserInApp(r){await e.post(`${n}/log-user-in-app/${r}`)},async fetchLogs(r={}){return await e.get(n,{params:r})},async getStats(r={}){return await e.get(`${n}/stats`,{params:r})}}}function Poe(e,t){return{async getPublicSettings(){return e.get(`/apps/public/prod/public-settings/by-id/${t}`)}}}function Coe(e,t){return{async inviteUser(n,r){if(r!=="user"&&r!=="admin")throw new Error(`Invalid role: "${r}". Role must be either "user" or "admin".`);return await e.post(`/apps/${t}/runtime/users/invite-user`,{user_email:n,role:r})}}}const Vl=Object.create(null);Vl.open="0";Vl.close="1";Vl.ping="2";Vl.pong="3";Vl.message="4";Vl.upgrade="5";Vl.noop="6";
vendor: 5,369 bytes, line 635
635const $1=Object.create(null);Object.keys(Vl).forEach(e=>{$1[Vl[e]]=e});const OA={type:"error",data:"parser error"},A9=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",O9=typeof ArrayBuffer=="function",T9=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,a4=({type:e,data:t},n,r)=>A9&&t instanceof Blob?n?r(t):g3(t,r):O9&&(t instanceof ArrayBuffer||T9(t))?n?r(t):g3(new Blob([t]),r):r(Vl[e]+(t||"")),g3=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function v3(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let bS;function Aoe(e,t){if(A9&&e.data instanceof Blob)return e.data.arrayBuffer().then(v3).then(t);if(O9&&(e.data instanceof ArrayBuffer||T9(e.data)))return t(v3(e.data));a4(e,!1,n=>{bS||(bS=new TextEncoder),t(bS.encode(n))})}const x3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p0=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<x3.length;e++)p0[x3.charCodeAt(e)]=e;const Ooe=e=>{let t=e.length*.75,n=e.length,r,s=0,a,o,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),h=new Uint8Array(u);for(r=0;r<n;r+=4)a=p0[e.charCodeAt(r)],o=p0[e.charCodeAt(r+1)],l=p0[e.charCodeAt(r+2)],c=p0[e.charCodeAt(r+3)],h[s++]=a<<2|o>>4,h[s++]=(o&15)<<4|l>>2,h[s++]=(l&3)<<6|c&63;return u},Toe=typeof ArrayBuffer=="function",o4=(e,t)=>{if(typeof e!="string")return{type:"message",data:R9(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Roe(e.substring(1),t)}:$1[n]?e.length>1?{type:$1[n],data:e.substring(1)}:{type:$1[n]}:OA},Roe=(e,t)=>{if(Toe){const n=Ooe(e);return R9(n,t)}else return{base64:!0,data:e}},R9=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},M9="�",Moe=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((a,o)=>{a4(a,!1,l=>{r[o]=l,++s===n&&t(r.join(M9))})})},Ioe=(e,t)=>{const n=e.split(M9),r=[];for(let s=0;s<n.length;s++){const a=o4(n[s],t);if(r.push(a),a.type==="error")break}return r};function Doe(){return new TransformStream({transform(e,t){Aoe(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const a=new DataView(s.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{s=new Uint8Array(9);const a=new DataView(s.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let wS;function e1(e){return e.reduce((t,n)=>t+n.length,0)}function t1(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Loe(e,t){wS||(wS=new TextDecoder);const n=[];let r=0,s=-1,a=!1;return new TransformStream({transform(o,l){for(n.push(o);;){if(r===0){if(e1(n)<1)break;const c=t1(n,1);a=(c[0]&128)===128,s=c[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(e1(n)<2)break;const c=t1(n,2);s=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(e1(n)<8)break;const c=t1(n,8),u=new DataView(c.buffer,c.byteOffset,c.length),h=u.getUint32(0);if(h>Math.pow(2,21)-1){l.enqueue(OA);break}s=h*Math.pow(2,32)+u.getUint32(4),r=3}else{if(e1(n)<s)break;const c=t1(n,s);l.enqueue(o4(a?c:wS.decode(c),t)),r=0}if(s===0||s>e){l.enqueue(OA);break}}}})}const I9=4;function Wr(e){if(e)return Foe(e)}function Foe(e){for(var t in Wr.prototype)e[t]=Wr.prototype[t];return e}Wr.prototype.on=Wr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Wr.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Wr.prototype.off=Wr.prototype.removeListener=Wr.prototype.removeAllListeners=Wr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Wr.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Wr.prototype.emitReserved=Wr.prototype.emit;Wr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Wr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const L_=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Qa=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),$oe="arraybuffer";function D9(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const qoe=Qa.setTimeout,zoe=Qa.clearTimeout;function F_(e,t){t.useNativeTimers?(e.setTimeoutFn=qoe.bind(Qa),e.clearTimeoutFn=zoe.b
vendor: 6,953 bytes, line 635
635ind(Qa)):(e.setTimeoutFn=Qa.setTimeout.bind(Qa),e.clearTimeoutFn=Qa.clearTimeout.bind(Qa))}const Boe=1.33;function Uoe(e){return typeof e=="string"?Voe(e):Math.ceil((e.byteLength||e.size)*Boe)}function Voe(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function L9(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Woe(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Hoe(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class Koe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class l4 extends Wr{constructor(t){super(),this.writable=!1,F_(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Koe(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=o4(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Woe(t);return n.length?"?"+n:""}}class Goe extends l4{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Ioe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Moe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=L9()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let F9=!1;try{F9=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Qoe=F9;function Yoe(){}class Xoe extends Goe{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,a)=>{this.onError("xhr post error",s,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Fl extends Wr{constructor(t,n,r){super(),this.createRequest=t,F_(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=D9(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Fl.requestsCount++,Fl.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Yoe,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Fl.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Fl.requestsCount=0;Fl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",y3);else if(typeof addEventListener=="function"){const e="onpagehide"in Qa?"pagehide":"unload";addEventListener(e,y3,!1)}}function y3(){for(let e in Fl.requests)Fl.requests.hasOwnProperty(e)&&Fl.requests[e].abort()}const Zoe=(function(){const e=$9({xdomain:!1});return e&&e.responseType!==null})();class Joe extends Xoe{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Zoe&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Fl($9,this.uri(),t)}}function $9(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Qoe))return new XMLHttpRequest}catch{}if(!t)try{return new Qa[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const q9=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ele extends l4{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=q9?{}:D9(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}
vendor: 10,345 bytes, line 635
635this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;a4(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}s&&L_(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=L9()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const jS=Qa.WebSocket||Qa.MozWebSocket;class tle extends ele{createSocket(t,n,r){return q9?new jS(t,n,r):n?new jS(t,n):new jS(t)}doWrite(t,n){this.ws.send(n)}}class nle extends l4{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Loe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=Doe();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const a=()=>{r.read().then(({done:l,value:c})=>{l||(this.onPacket(c),a())}).catch(l=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&L_(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const rle={websocket:tle,webtransport:nle,polling:Joe},ile=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,sle=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function TA(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=ile.exec(e||""),a={},o=14;for(;o--;)a[sle[o]]=s[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=ale(a,a.path),a.queryKey=ole(a,a.query),a}function ale(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function ole(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,a){s&&(n[s]=a)}),n}const RA=typeof addEventListener=="function"&&typeof removeEventListener=="function",q1=[];RA&&addEventListener("offline",()=>{q1.forEach(e=>e())},!1);class Pd extends Wr{constructor(t,n){if(super(),this.binaryType=$oe,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=TA(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=TA(n.host).host);F_(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Hoe(this.opts.query)),RA&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},q1.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=I9,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Pd.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Pd.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=Uoe(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,L_(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Pd.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),RA&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=q1.indexOf(this._offlineEventListener);r!==-1&&q1.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Pd.protocol=I9;class lle extends Pd{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Pd.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Pd.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}
vendor: 11,015 bytes, line 635
635]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function a(){r||(r=!0,h(),n.close(),n=null)}const o=d=>{const m=new Error("probe error: "+d);m.transport=n.name,a(),this.emitReserved("upgradeError",m)};function l(){o("transport closed")}function c(){o("socket closed")}function u(d){n&&d.name!==n.name&&a()}const h=()=>{n.removeListener("open",s),n.removeListener("error",o),n.removeListener("close",l),this.off("close",c),this.off("upgrading",u)};n.once("open",s),n.once("error",o),n.once("close",l),this.once("close",c),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let cle=class extends lle{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>rle[s]).filter(s=>!!s)),super(t,r)}};function ule(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=TA(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const dle=typeof ArrayBuffer=="function",fle=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,z9=Object.prototype.toString,hle=typeof Blob=="function"||typeof Blob<"u"&&z9.call(Blob)==="[object BlobConstructor]",mle=typeof File=="function"||typeof File<"u"&&z9.call(File)==="[object FileConstructor]";function c4(e){return dle&&(e instanceof ArrayBuffer||fle(e))||hle&&e instanceof Blob||mle&&e instanceof File}function z1(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(z1(e[n]))return!0;return!1}if(c4(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return z1(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&z1(e[n]))return!0;return!1}function ple(e){const t=[],n=e.data,r=e;return r.data=MA(n,t),r.attachments=t.length,{packet:r,buffers:t}}function MA(e,t){if(!e)return e;if(c4(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=MA(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=MA(e[r],t));return n}return e}function gle(e,t){return e.data=IA(e.data,t),delete e.attachments,e}function IA(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=IA(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=IA(e[n],t));return e}const B9=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],vle=5;var un;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(un||(un={}));class xle{constructor(t){this.replacer=t}encode(t){return(t.type===un.EVENT||t.type===un.ACK)&&z1(t)?this.encodeAsBinary({type:t.type===un.EVENT?un.BINARY_EVENT:un.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===un.BINARY_EVENT||t.type===un.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=ple(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class u4 extends Wr{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===un.BINARY_EVENT;r||n.type===un.BINARY_ACK?(n.type=r?un.EVENT:un.ACK,this.reconstructor=new yle(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(c4(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(un[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===un.BINARY_EVENT||r.type===un.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const l=Number(o);if(!U9(l)||l<0)throw new Error("Illegal attachments");if(l>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=l}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(u4.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case un.CONNECT:return lj(n);case un.DISCONNECT:return n===void 0;case un.CONNECT_ERROR:return typeof n=="string"||lj(n);case un.EVENT:case un.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&B9.indexOf(n[0])===-1);case un.ACK:case un.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class yle{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=gle(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function ble(e){return typeof e=="string"}const U9=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function wle(e){return e===void 0||U9(e)}function lj(e){return Object.prototype.toString.call(e)==="[object Object]"}function jle(e,t){switch(e){case un.CONNECT:return t===void 0||lj(t);case un.DISCONNECT:return t===void 0;case un.EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&B9.indexOf(t[0])===-1);case un.ACK:return Array.isArray(t);case un.CONNECT_ERROR:return typeof t=="string"||lj(t);default:return!1}}function _le(e){return ble(e.nsp)&&wle(e.id)&&jle(e.type,e.data)}const Nle=Object.freeze(Object.defineProperty({__proto__:null,Decoder:u4,Encoder:xle,get PacketType(){return un},isPacketValid:_le,protocol:vle},Symbol.toStringTag,{value:"Module"}));function Lo(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Sle=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class V9 extends Wr{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Lo(t,"open",this.onopen.bind(this)),Lo(t,"packet",this.onpacket.bind(this)),Lo(t,"error",this.onerror.bind(this)),Lo(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,a;if(Sle.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:un.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const h=this.ids++,d=n.pop();this._registerAckCallback(h,d),o.id=h}const l=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,c=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},s),o=(...l)=>{this.io.clearTimeoutFn(a),n.apply(this,l)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,s)=>{const a=(o,l)=>o?s(o):r(l);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...a)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:un.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}
vendor: 7,089 bytes, line 635
635_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case un.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case un.EVENT:case un.BINARY_EVENT:this.onevent(t);break;case un.ACK:case un.BINARY_ACK:this.onack(t);break;case un.DISCONNECT:this.ondisconnect();break;case un.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:un.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:un.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function ov(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ov.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};ov.prototype.reset=function(){this.attempts=0};ov.prototype.setMin=function(e){this.ms=e};ov.prototype.setMax=function(e){this.max=e};ov.prototype.setJitter=function(e){this.jitter=e};class DA extends Wr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,F_(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new ov({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||Nle;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new cle(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Lo(n,"open",function(){r.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=Lo(n,"error",a);if(this._timeout!==!1){const l=this._timeout,c=this.setTimeoutFn(()=>{s(),a(new Error("timeout")),n.close()},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(s),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Lo(t,"ping",this.onping.bind(this)),Lo(t,"data",this.ondata.bind(this)),Lo(t,"error",this.onerror.bind(this)),Lo(t,"close",this.onclose.bind(this)),Lo(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){L_(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new V9(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}
635cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Xx={};function B1(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=ule(e,t.path||"/socket.io"),r=n.source,s=n.id,a=n.path,o=Xx[s]&&a in Xx[s].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new DA(r,t):(Xx[s]||(Xx[s]=new DA(r,t)),c=Xx[s]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(B1,{Manager:DA,Socket:V9,io:B1,connect:B1});const kle=250;function b3(e,t){var n;const r=(n=e.token)!==null&&n!==void 0?n:jd(),s={app_id:e.appId};r?s.token=r:s.anonymous_id=oj();const a=B1(e.serverUrl,{path:e.mountPath,transports:e.transports,query:s});return a.on("connect",async()=>{var o;return console.log("connect",a.id),(o=t.connect)===null||o===void 0?void 0:o.call(t)}),a.on("update_model",async o=>{var l;return(l=t.update_model)===null||l===void 0?void 0:l.call(t,o)}),a.on("error",async o=>{var l;return(l=t.error)===null||l===void 0?void 0:l.call(t,o)}),a.on("connect_error",async o=>{var l;return console.error("connect_error",o),(l=t.error)===null||l===void 0?void 0:l.call(t,o)}),a}function Ele({config:e}){let t={...e};const n={},r={},s={connect:async()=>{const y=[];Object.keys(n).forEach(_=>{const N=m(_);
635N.length!==0&&(u(_),N.forEach(({connect:j})=>{const S=async()=>j==null?void 0:j();y.push(S())}))}),await Promise.all(y)},update_model:async y=>{const N=m(y.room).map(j=>{var S;return(S=j.update_model)===null||S===void 0?void 0:S.call(j,y)});await Promise.all(N)},error:async y=>{console.error("error",y);const _=Object.values(n).flat().map(N=>{var j;return(j=N.error)===null||j===void 0?void 0:j.call(N,y)});await Promise.all(_)}};let a=b3(e,s);function o(){l()}function l(){w(),a&&a.disconnect()}function c(y){o(),t={...t,...y},a=b3(t,s)}function u(y){a.emit("join",y)}function h(y){a.emit("leave",y)}async function d(y,_){var N;const j=JSON.stringify(_);return(N=s.update_model)===null||N===void 0?void 0:N.call(s,{room:y,data:j})}function m(y){var _;return(_=n[y])!==null&&_!==void 0?_:[]}function g(y){const _=r[y];_&&(clearTimeout(_),delete r[y])}function w(){Object.keys(r).forEach(y=>{var _,N;clearTimeout(r[y]),delete r[y],((N=(_=n[y])===null||_===void 0?void 0:_.length)!==null&&N!==void 0?N:0)===0&&delete n[y]})}function v(y){g(y),r[y]=setTimeout(()=>{var _,N;delete r[y],!(((N=(_=n[y])===null||_===void 0?void 0:_.length)!==null&&N!==void 0?N:0)>0)&&(h(y),delete n[y])},kle)}return{socket:a,subscribeToRoom:(y,_)=>{n[y]?g(y):(u(y),n[y]=[]),n[y].push(_);let N=!1;return()=>{var j,S;N||(N=!0,n[y]=(S=(j=n[y])===null||j===void 0?void 0:j.filter(C=>C!==_))!==null&&S!==void 0?S:[],n[y].length===0&&v(y))}},updateConfig:c,updateModel:d,disconnect:l}}(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
636  PartySocket requires a global 'EventTarget' class to be available!
637  You can polyfill this global by adding this to your code before any partysocket imports: 
638  
639  \`\`\`
640  import 'partysocket/event-target-polyfill';
641  \`\`\`
642  Please file an issue at https://github.com/partykit/partykit if you're still having trouble.
643`);var W9=class extends Event{constructor(t,n){super("error",n);Zn(this,"message");Zn(this,"error");this.message=t.message,this.error=t}},H9=class extends Event{constructor(t=1e3,n="",r){super("close",r);Zn(this,"code");Zn(this,"reason");Zn(this,"wasClean",!0);this.code=t,this.reason=n}},_S={Event,ErrorEvent:W9,CloseEvent:H9};function Ple(e,t){if(!e)throw new Error(t)}function Cle(e){return new e.constructor(e.type,e)}function Ale(e){return"data"in e?new MessageEvent(e.type,e):"code"in e||"reason"in e?new H9(e.code||1999,e.reason||"unknown reason",e):"error"in e?new W9(e.error,e):new Event(e.type,e)}var X8,Ole=typeof process<"u"&&typeof((X8=process.versions)==null?void 0:X8.node)<"u"&&typeof document>"u",n1=Ole?Ale:Cle,Qf={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0},w3=!1,Tle=class eh extends EventTarget{constructor(n,r,s={}){super();Zn(this,"_ws");Zn(this,"_retryCount",-1);Zn(this,"_uptimeTimeout");Zn(this,"_connectTimeout");Zn(this,"_shouldReconnect",!0);Zn(this,"_connectLock",!1);Zn(this,"_binaryType","blob");Zn(this,"_closeCalled",!1);Zn(this,"_messageQueue",[]);Zn(this,"_url");Zn(this,"_protocols");Zn(this,"_options");Zn(this,"onclose",null);Zn(this,"onerror",null);Zn(this,"onmessage",null);Zn(this,"onopen",null);Zn(this,"_handleOpen",n=>{this._debug("open event");const{minUptime:r=Qf.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),r),Ple(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(s=>{var a;return(a=this._ws)==null?void 0:a.send(s)}),this._messageQueue=[],this.onopen&&this.onopen(n),this.dispatchEvent(n1(n))});Zn(this,"_handleMessage",n=>{this._debug("message event"),this.onmessage&&this.onmessage(n),this.dispatchEvent(n1(n))});Zn(this,"_handleError",n=>{this._debug("error event",n.message),this._disconnect(void 0,n.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(n),this._debug("exec error listeners"),this.dispatchEvent(n1(n)),this._connect()});Zn(this,"_handleClose",n=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(n),this.dispatchEvent(n1(n))});this._url=n,this._protocols=r,this._options=s,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return eh.CONNECTING}get OPEN(){return eh.OPEN}get CLOSING(){return eh.CLOSING}get CLOSED(){return eh.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(n){this._binaryType=n,this._ws&&(this._ws.binaryType=n)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((r,s)=>(typeof s=="string"?r+=s.length:s instanceof Blob?r+=s.size:r+=s.byteLength,r),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?eh.CLOSED:eh.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}close(n=1e3,r){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(n,r)}reconnect(n,r){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(n,r),this._connect())}send(n){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",n),this._ws.send(n);else{const{maxEnqueuedMessages:r=Qf.maxEnqueuedMessages}=this._options;this._messageQueue.length<r&&(this._debug("enqueue",n),this._messageQueue.push(n))}}_debug(...n){this._options.debug&&console.log.apply(console,["RWS>",...n])}_getNextDelay(){const{reconnectionDelayGrowFactor:n=Qf.reconnectionDelayGrowFactor,minReconnectionDelay:r=Qf.minReconnectionDelay,maxReconnectionDelay:s=Qf.maxReconnectionDelay}=this._options;let a=0;return this._retryCount>0&&(a=r*Math.pow(n,this._retryCount-1),a>s&&(a=s)),this._debug("next delay",a),a}_wait(){return new Promise(n=>{setTimeout(n,this._getNextDelay())})}_getNextProtocols(n){if(!n)return Promise.resolve(null);if(typeof n=="string"||Array.isArray(n))return Promise.resolve(n);if(typeof n=="function"){const r=n();if(!r)return Promise.resolve(null);if(typeof r=="string"||Array.isArray(r))return Promise.resolve(r);if(r.then)return r}throw Error("Invalid protocols")}_getNextUrl(n){if(typeof n=="string")return Promise.resolve(n);if(typeof n=="function"){const r=n();if(typeof r=="string")return Promise.resolve(r);if(r.then)return r}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;
643const{maxRetries:n=Qf.maxRetries,connectionTimeout:r=Qf.connectionTimeout}=this._options;if(this._retryCount>=n){this._debug("max retries reached",this._retryCount,">=",n);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([s,a])=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!w3&&(console.error(`‼️ No WebSocket implementation available. You should define options.WebSocket. 
644
645For example, if you're using node.js, run \`npm install ws\`, and then in your code:
646
647import PartySocket from 'partysocket';
648import WS from 'ws';
649
650const partysocket = new PartySocket({
651  host: "127.0.0.1:1999",
652  room: "test-room",
653  WebSocket: WS
654});
655
656`),w3=!0);const o=this._options.WebSocket||WebSocket;this._debug("connect",{url:s,protocols:a}),this._ws=a?new o(s,a):new o(s),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),r)}).catch(s=>{this._connectLock=!1,this._handleError(new _S.ErrorEvent(Error(s.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new _S.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(n=1e3,r){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(n,r),this._handleClose(new _S.CloseEvent(n,r,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}};/*!
657 * Reconnecting WebSocket
658 * by Pedro Ladaria <[email protected]>
659 * https://github.com/pladaria/reconnecting-websocket
660 * License MIT
661 */const Rle=1e3,Mle=3e3,Ile=new Set([405,409,422,503]),Dle=new Set([400,403,404]);function Lle(e){const t=e&&typeof e=="object"?e.status:void 0;return typeof t=="number"?t:void 0}function Fle(e){return e instanceof Error?e:new Error(String(e))}class $le{constructor(t,n,r,s,a){var o;this.onClose=a,this.listeners=new Set,this.heartbeat=null,this.closed=!1,this.id=(o=s==null?void 0:s.id)!==null&&o!==void 0?o:crypto.randomUUID();let l=r.transport==="proxy";const c=async()=>{var m;if(this.closed)throw new Error("Actor connection is closed");if(!l)try{const{websocket_url:g,token:w}=await r.mintConnectionToken(t,n,this.id),v=g.includes("?")?"&":"?";return`${g}${v}token=${encodeURIComponent(w)}`}catch(g){const w=Lle(g);if(!(r.transport!=="direct"&&w!==void 0&&Ile.has(w))){w!==void 0&&Dle.has(w)&&this.close();try{(m=r.onMintError)===null||m===void 0||m.call(r,Fle(g))}catch{}throw g}l=!0}return zle(r.host,t,n,this.id,r.appId,r.getAuthToken(),r.functionsVersion)},u=new Tle(c);this.ws=u;let h=Date.now();const d=()=>{h=Date.now()};u.addEventListener("open",d),u.addEventListener("message",m=>{d();let g;try{g=JSON.parse(m.data)}catch{return}if((g&&typeof g=="object"?g.type:void 0)!=="__pong")for(const v of this.listeners)v(g)}),this.heartbeat=setInterval(()=>{if(Date.now()-h>Mle){d(),u.readyState===u.OPEN&&u.reconnect();return}try{u.send(JSON.stringify({type:"__ping"}))}catch{}},Rle)}subscribe(t){return this.listeners.add(t),{unsubscribe:()=>{this.listeners.delete(t)}}}send(t){this.closed||this.ws.send(JSON.stringify(t))}close(){this.closed||(this.closed=!0,this.heartbeat&&(clearInterval(this.heartbeat),this.heartbeat=null),this.listeners.clear(),this.ws.close(),this.onClose())}}function qle(e,t,n,r){let s=null;return{connect(a){if(s)return s;const o=new $le(e,t,n,a,()=>{r.delete(o),s===o&&(s=null)});return s=o,r.add(o),o}}}function zle(e,t,n,r,s,a,o){let l=e.replace(/^(http|https|ws|wss):\/\//,"");l.endsWith("/")&&(l=l.slice(0,-1));const c=l.startsWith("localhost:")||l.startsWith("127.0.0.1:")||l.startsWith("192.168.")||l.startsWith("10.")||l.startsWith("172.")&&l.split(".")[1]>="16"&&l.split(".")[1]<="31"||l.startsWith("[::ffff:7f00:1]:"),u=new URLSearchParams([["_pk",r],["app_id",s],["handler",t]]);return a&&u.append("token",a),o&&u.append("fv",o),`${c?"ws":"wss"}://${l}/parties/${t}/${n}?${u}`}function Ble(e,t){return e&&!e.startsWith("/")?e:t??e}function Ule(e){const t=new Set;return{module:new Proxy({}
661,{get(r,s){if(!(typeof s!="string"||s==="then"))return a=>qle(s,a,e,t)}}),closeAll:()=>{for(const r of[...t])r.close()}}}function Vle(e){var t,n,r,s;const{serverUrl:a="https://base44.app",appId:o,analytics:l,token:c,serviceToken:u,requiresAuth:h=!1,appBaseUrl:d,options:m,functionsVersion:g,headers:w}=e,v=typeof d=="string"?d:"",b={serverUrl:a,mountPath:"/ws-user-apps/socket.io/",transports:["websocket"],appId:o,token:c};let y=null;const _=()=>(y||(y=Ele({config:b})),y),N={...w,"X-App-Id":String(o)},j=w==null?void 0:w["Base44-State"],S=j?{"Base44-State":j}:{},C=g?{...N,"Base44-Functions-Version":g}:N,P=$p({baseURL:`${a}/api`,headers:N,token:c,onError:m==null?void 0:m.onError}),A=$p({baseURL:`${a}/api`,headers:C,token:c,interceptResponses:!1,onError:m==null?void 0:m.onError}),F={...N,...c?{"on-behalf-of":`Bearer ${c}`}:{}},I=$p({baseURL:`${a}/api`,headers:F,token:u,onError:m==null?void 0:m.onError}),R=$p({baseURL:`${a}/api`,headers:C,token:u,interceptResponses:!1}),M=$p({baseURL:`${a}/api`,headers:N}),$=yoe(P,A,o,{appBaseUrl:v,token:c});if(typeof window<"u"){const X=c||jd();X&&$.setToken(X)}const B=Ule({appId:o,host:Ble(a,typeof window<"u"?(t=window.location)===null||t===void 0?void 0:t.origin:void 0),functionsVersion:g,getAuthToken:()=>c||jd(),mintConnectionToken:async(X,V,z)=>{const L=c||jd();return await M.post(`/apps/${o}/actors/${encodeURIComponent(X)}/connection-token`,{room:V,connection_id:z},{headers:{...L?{Authorization:`Bearer ${L}`}:{},...g?{"Base44-Functions-Version":g}:{}}})},transport:m==null?void 0:m.actorsTransport,onMintError:m==null?void 0:m.onError}),U={entities:l3({axios:P,appId:o,getSocket:_}),integrations:u3(P,o),connectors:Noe(P,o),auth:$,functions:d3(A,o,{getAuthHeaders:()=>{const X={},V=c||jd();return V&&(X.Authorization=`Bearer ${V}`),X},baseURL:(n=A.defaults)===null||n===void 0?void 0:n.baseURL}),agents:f3({axios:P,getSocket:_,appId:o,serverUrl:a,token:c}),aiGateway:m3({serverUrl:a,token:c,appId:o,headers:S}),appLogs:p3(P,o),app:Poe(P,o),users:Coe(P,o),analytics:ioe({axiosClient:P,serverUrl:a,appId:o,userAuthModule:$,enabled:(r=l==null?void 0:l.enabled)!==null&&r!==void 0?r:!0}),actors:B.module,cleanup:()=>{U.analytics.cleanup(),B.closeAll(),y&&y.disconnect()}},G={entities:l3({axios:I,appId:o,getSocket:_}),integrations:u3(I,o),sso:boe(I,o),connectors:joe(I,o),functions:d3(R,o,{getAuthHeaders:()=>{const X={};return u&&(X.Authorization=`Bearer ${u}`),X},baseURL:(s=R.defaults)===null||s===void 0?void 0:s.baseURL}),agents:f3({axios:I,getSocket:_,appId:o,serverUrl:a,token:c}),aiGateway:m3({serverUrl:a,token:u,appId:o,headers:S}),appLogs:p3(I,o),cleanup:()=>{y&&y.disconnect()}};return h&&typeof window<"u"&&setTimeout(async()=>{try{await U.auth.isAuthenticated()||U.auth.redirectToLogin(window.location.href)}catch(X){console.error("Authentication check failed:",X),U.auth.redirectToLogin(window.location.href)}},0),{...U,fetchWithAuth:koe({axios:P,serviceRoleAxios:I,appId:String(o),serverUrl:a,functionsVersion:g,platformHeaders:w}),setToken(X){U.auth.setToken(X),y&&y.updateConfig({token:X}),b.token=X},getConfig(){return{serverUrl:a,appId:o,requiresAuth:h}},get asServiceRole(){if(!u)throw new Error("Service token is required to use asServiceRole. Please provide a serviceToken when creating the client.");return G}}}const K9=typeof window>"u",Wle=K9?{localStorage:new Map}:window,NS=Wle.localStorage,Hle=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase(),Zx=(e,{defaultValue:t=void 0,removeFromUrl:n=!1}={})=>{if(K9)return t;const r=`base44_${Hle(e)}`,s=new URLSearchParams(window.location.search),a=s.get(e);if(n){s.delete(e);const l=`${window.location.pathname}${s.toString()?`?${s.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,l)}if(a)return NS.setItem(r,a),a;if(t)return NS.setItem(r,t),t;const o=NS.getItem(r);return o||null},Kle=()=>({appId:Zx("app_id",{defaultValue:"69159eb1f2b08a81df520821"}),serverUrl:Zx("server_url",{defaultValue:"https://base44.app"}),token:Zx("access_token",{removeFromUrl:!0}),fromUrl:Zx("from_url",{defaultValue:window.location.href}),functionsVersion:Zx("functions_version")}),qp={...Kle()},{appId:Gle,serverUrl:Qle,token:Yle,functionsVersion:Xle}=qp,ae=Vle({appId:Gle,serverUrl:Qle,token:Yle,functionsVersion:Xle,requiresAuth:!1}),G9=O.createContext(),Zle=({children:e})=>{const[t,n]=O.useState(null),[r,s]=O.useState(!1),[a,o]=O.useState(!0),[l,c]=O.useState(!0),[u,h]=O.useState(null),[d,m]=O.useState(null);O.useEffect(()=>{g()},[]);const g=async()=>{var y,_;
661try{c(!0),h(null);const N=$p({baseURL:`${qp.serverUrl}/api/apps/public`,headers:{"X-App-Id":qp.appId},token:qp.token,interceptResponses:!0});try{const j=await N.get(`/prod/public-settings/by-id/${qp.appId}`);m(j),qp.token?await w():(o(!1),s(!1)),c(!1)}catch(j){if(console.error("App state check failed:",j),j.status===403&&((_=(y=j.data)==null?void 0:y.extra_data)!=null&&_.reason)){const S=j.data.extra_data.reason;h(S==="auth_required"?{type:"auth_required",message:"Authentication required"}:S==="user_not_registered"?{type:"user_not_registered",message:"User not registered for this app"}:{type:S,message:j.message})}else h({type:"unknown",message:j.message||"Failed to load app"});c(!1),o(!1)}}catch(N){console.error("Unexpected error:",N),h({type:"unknown",message:N.message||"An unexpected error occurred"}),c(!1),o(!1)}},w=async()=>{try{o(!0);const y=await ae.auth.me();n(y),s(!0),o(!1)}catch(y){console.error("User auth check failed:",y),o(!1),s(!1),(y.status===401||y.status===403)&&h({type:"auth_required",message:"Authentication required"})}},v=(y=!0)=>{n(null),s(!1),y?ae.auth.logout(window.location.href):ae.auth.logout()},b=()=>{ae.auth.redirectToLogin(window.location.href)};return i.jsx(G9.Provider,{value:{user:t,isAuthenticated:r,isLoadingAuth:a,isLoadingPublicSettings:l,authError:u,appPublicSettings:d,logout:v,navigateToLogin:b,checkAppState:g},children:e})},Q9=()=>{const e=O.useContext(G9);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e};function Ft(e){return"/"+e.toLowerCase().replace(/ /g,"-")}function Jle(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const ece=e=>{switch(e){case"success":return rce;case"info":return sce;case"warning":return ice;case"error":return ace;default:return null}},tce=Array(12).fill(0),nce=({visible:e,className:t})=>se.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},se.createElement("div",{className:"sonner-spinner"},tce.map((n,r)=>se.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),rce=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},se.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ice=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},se.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),sce=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},se.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ace=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},se.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),oce=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},se.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),se.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),lce=()=>{const[e,t]=se.useState(document.hidden);return se.useEffect(()=>{const n=()=>{t(document.hidden)};
vendor: 3,956 bytes, line 661
661return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let LA=1;class cce{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:LA++,o=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:r}),{...c,...t,id:a,dismissible:l,title:r}):c):this.addToast({title:r,...s,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,o;const l=s.then(async u=>{if(o=["resolve",u],se.isValidElement(u))a=!1,this.create({id:r,type:"default",message:u});else if(dce(u)&&!u.ok){a=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,w=typeof d=="object"&&!se.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:m,...w})}else if(u instanceof Error){a=!1;const d=typeof n.error=="function"?await n.error(u):n.error,m=typeof n.description=="function"?await n.description(u):n.description,w=typeof d=="object"&&!se.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:m,...w})}else if(n.success!==void 0){a=!1;const d=typeof n.success=="function"?await n.success(u):n.success,m=typeof n.description=="function"?await n.description(u):n.description,w=typeof d=="object"&&!se.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:m,...w})}}).catch(async u=>{if(o=["reject",u],n.error!==void 0){a=!1;const h=typeof n.error=="function"?await n.error(u):n.error,d=typeof n.description=="function"?await n.description(u):n.description,g=typeof h=="object"&&!se.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:d,...g})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,h)=>l.then(()=>o[0]==="reject"?h(o[1]):u(o[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||LA++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ws=new cce,uce=(e,t)=>{const n=(t==null?void 0:t.id)||LA++;return Ws.addToast({title:e,...t,id:n}),n},dce=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",fce=uce,hce=()=>Ws.toasts,mce=()=>Ws.getActiveToasts(),tt=Object.assign(fce,{success:Ws.success,info:Ws.info,warning:Ws.warning,error:Ws.error,custom:Ws.custom,message:Ws.message,promise:Ws.promise,dismiss:Ws.dismiss,loading:Ws.loading},{getHistory:hce,getToasts:mce});Jl
vendor: 4,788 bytes, line 661
661e("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;
vendor: 10,086 bytes, line 661
661left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function 
vendor: 948 bytes, line 661
661r1(e){return e.label!==void 0}const pce=3,gce="24px",vce="16px",j3=4e3,xce=356,yce=14,bce=45,wce=200;function Cl(...e){return e.filter(Boolean).join(" ")}function jce(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const _ce=e=>{var t,n,r,s,a,o,l,c,u;const{invert:h,toast:d,unstyled:m,interacting:g,setHeights:w,visibleToasts:v,heights:b,index:y,toasts:_,expanded:N,removeToast:j,defaultRichColors:S,closeButton:C,style:P,cancelButtonStyle:A,actionButtonStyle:F,className:I="",descriptionClassName:R="",duration:M,position:$,gap:B,expandByDefault:U,classNames:G,icons:Z,closeButtonAriaLabel:X="Close toast"}=e,[V,z]=se.useState(null),[L,W]=se.useState(null),[Q,J]=se.useState(!1),[ne,Y]=se.useState(!1),[ee,le]=se.useState(!1),[re,fe]=se.useState(!1),[ge,he]=se.useState(!1),[De,_e]=se.useState(0),[We,ze]=se.useState(0),Xe=se.useRef(d.duration||M||j3),ke=se.useRef(null),Ae=se.useRef(null),Be=y===0,de=y+1<=v,Pe=d.type,Ze=d.dism
vendor: 11,205 bytes, line 661
661issible!==!1,ct=d.className||"",pt=d.descriptionClassName||"",$t=se.useMemo(()=>b.findIndex(Vt=>Vt.toastId===d.id)||0,[b,d.id]),wn=se.useMemo(()=>{var Vt;return(Vt=d.closeButton)!=null?Vt:C},[d.closeButton,C]),an=se.useMemo(()=>d.duration||M||j3,[d.duration,M]),is=se.useRef(0),on=se.useRef(0),ir=se.useRef(0),Ns=se.useRef(null),[el,vu]=$.split("-"),xu=se.useMemo(()=>b.reduce((Vt,fr,Ar)=>Ar>=$t?Vt:Vt+fr.height,0),[b,$t]),tl=lce(),ec=d.invert||h,tc=Pe==="loading";on.current=se.useMemo(()=>$t*B+xu,[$t,xu]),se.useEffect(()=>{Xe.current=an},[an]),se.useEffect(()=>{J(!0)},[]),se.useEffect(()=>{const Vt=Ae.current;if(Vt){const fr=Vt.getBoundingClientRect().height;return ze(fr),w(Ar=>[{toastId:d.id,height:fr,position:d.position},...Ar]),()=>w(Ar=>Ar.filter(Qr=>Qr.toastId!==d.id))}},[w,d.id]),se.useLayoutEffect(()=>{if(!Q)return;const Vt=Ae.current,fr=Vt.style.height;Vt.style.height="auto";const Ar=Vt.getBoundingClientRect().height;Vt.style.height=fr,ze(Ar),w(Qr=>Qr.find(jr=>jr.toastId===d.id)?Qr.map(jr=>jr.toastId===d.id?{...jr,height:Ar}:jr):[{toastId:d.id,height:Ar,position:d.position},...Qr])},[Q,d.title,d.description,w,d.id,d.jsx,d.action,d.cancel]);const Ss=se.useCallback(()=>{Y(!0),_e(on.current),w(Vt=>Vt.filter(fr=>fr.toastId!==d.id)),setTimeout(()=>{j(d)},wce)},[d,j,w,on]);se.useEffect(()=>{if(d.promise&&Pe==="loading"||d.duration===1/0||d.type==="loading")return;let Vt;return N||g||tl?(()=>{if(ir.current<is.current){const Qr=new Date().getTime()-is.current;Xe.current=Xe.current-Qr}ir.current=new Date().getTime()})():(()=>{Xe.current!==1/0&&(is.current=new Date().getTime(),Vt=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Ss()},Xe.current))})(),()=>clearTimeout(Vt)},[N,g,d,Pe,tl,Ss]),se.useEffect(()=>{d.delete&&(Ss(),d.onDismiss==null||d.onDismiss.call(d,d))},[Ss,d.delete]);function Zd(){var Vt;if(Z!=null&&Z.loading){var fr;return se.createElement("div",{className:Cl(G==null?void 0:G.loader,d==null||(fr=d.classNames)==null?void 0:fr.loader,"sonner-loader"),"data-visible":Pe==="loading"},Z.loading)}return se.createElement(nce,{className:Cl(G==null?void 0:G.loader,d==null||(Vt=d.classNames)==null?void 0:Vt.loader),visible:Pe==="loading"})}const ho=d.icon||(Z==null?void 0:Z[Pe])||ece(Pe);var _a,Jd;return se.createElement("li",{tabIndex:0,ref:Ae,className:Cl(I,ct,G==null?void 0:G.toast,d==null||(t=d.classNames)==null?void 0:t.toast,G==null?void 0:G.default,G==null?void 0:G[Pe],d==null||(n=d.classNames)==null?void 0:n[Pe]),"data-sonner-toast":"","data-rich-colors":(_a=d.richColors)!=null?_a:S,"data-styled":!(d.jsx||d.unstyled||m),"data-mounted":Q,"data-promise":!!d.promise,"data-swiped":ge,"data-removed":ne,"data-visible":de,"data-y-position":el,"data-x-position":vu,"data-index":y,"data-front":Be,"data-swiping":ee,"data-dismissible":Ze,"data-type":Pe,"data-invert":ec,"data-swipe-out":re,"data-swipe-direction":L,"data-expanded":!!(N||U&&Q),"data-testid":d.testId,style:{"--index":y,"--toasts-before":y,"--z-index":_.length-y,"--offset":`${ne?De:on.current}px`,"--initial-height":U?"auto":`${We}px`,...P,...d.style},onDragEnd:()=>{le(!1),z(null),Ns.current=null},onPointerDown:Vt=>{Vt.button!==2&&(tc||!Ze||(ke.current=new Date,_e(on.current),Vt.target.setPointerCapture(Vt.pointerId),Vt.target.tagName!=="BUTTON"&&(le(!0),Ns.current={x:Vt.clientX,y:Vt.clientY})))},onPointerUp:()=>{var Vt,fr,Ar;if(re||!Ze)return;Ns.current=null;const Qr=Number(((Vt=Ae.current)==null?void 0:Vt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nl=Number(((fr=Ae.current)==null?void 0:fr.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),jr=new Date().getTime()-((Ar=ke.current)==null?void 0:Ar.getTime()),$r=V==="x"?Qr:nl,Na=Math.abs($r)/jr;if(Math.abs($r)>=bce||Na>.11){_e(on.current),d.onDismiss==null||d.onDismiss.call(d,d),W(V==="x"?Qr>0?"right":"left":nl>0?"down":"up"),Ss(),fe(!0);return}else{var Yr,Ei;(Yr=Ae.current)==null||Yr.style.setProperty("--swipe-amount-x","0px"),(Ei=Ae.current)==null||Ei.style.setProperty("--swipe-amount-y","0px")}he(!1),le(!1),z(null)},onPointerMove:Vt=>{var fr,Ar,Qr;if(!Ns.current||!Ze||((fr=window.getSelection())==null?void 0:fr.toString().length)>0)return;const jr=Vt.clientY-Ns.current.y,$r=Vt.clientX-Ns.current.x;var Na;const Yr=(Na=e.swipeDirections)!=null?Na:jce($);!V&&(Math.abs($r)>1||Math.abs(jr)>1)&&z(Math.abs($r)>Math.abs(jr)?"x":"y");let Ei={x:0,y:0};const rl=ks=>1/(1.5+Math.abs(ks)/20);if(V==="y"){if(Yr.includes("top")||Yr.includes("bottom"))if(Yr.includes("top")&&jr<0||Yr.includes("bottom")&&jr>0)Ei.y=jr;else{const ks=jr*rl(jr);Ei.y=Math.abs(ks)<Math.abs(jr)?ks:jr}}else if(V==="x"&&(Yr.includes("left")||Yr.includes("right")))if(Yr.includes("left")&&$r<0||Yr.includes("right")&&$r>0)Ei.x=$r;else{const ks=$r*rl($r);Ei.x=Math.abs(ks)<Math.abs($r)?ks:$r}(Math.abs(Ei.x)>0||Math.abs(Ei.y)>0)&&he(!0),(Ar=Ae.current)==null||Ar.style.setProperty("--swipe-amount-x",`${Ei.x}px`),(Qr=Ae.current)==null||Qr.style.setProperty("--swipe-amount-y",`${Ei.y}px`)}},wn&&!d.jsx&&Pe!=="loading"?se.createElement("button",{"aria-label":X,"data-disabled":tc,"data-close-button":!0,onClick:tc||!Ze?()=>{}:()=>{Ss(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Cl(G==null?void 0:G.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Jd=Z==null?void 0:Z.close)!=null?Jd:oce):null,(Pe||d.icon||d.promise)&&d.icon!==null&&((Z==null?void 0:Z[Pe])!==null||d.icon)?se.createElement("div",{"data-icon":"",className:Cl(G==null?void 0:G.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Zd():null,d.type!=="loading"?ho:null):null,se.createElement("div",{"data-content":"",className:Cl(G==null?void 0:G.content,d==null||(a=d.classNames)==null?void 0:a.content)},se.createElement("div",{"data-title":"",className:Cl(G==null?void 0:G.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?se.createElement("div",{"data-description":"",className:Cl(R,pt,G==null?void 0:G.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),se.isValidElement(d.cancel)?d.cancel:d.cancel&&r1(d.cancel)?se.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||A,onClick:Vt=>{r1(d.cancel)&&Ze&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,Vt),Ss())},className:Cl(G==null?void 0:G.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,se.isValidElement(d.action)?d.action:d.action&&r1(d.action)?se.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||F,onClick:Vt=>{r1(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,Vt),!Vt.defaultPrevented&&Ss())},className:Cl(G==null?void 0:G.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function _3(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Nce(e,t){const n={};return[e,t].forEach((r,s)=>{const a=s===1,o=a?"--mobile-offset":"--offset",l=a?vce:gce;function c(u){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(l)}),n}const Sce=se.forwardRef(function(t,n){const{id:r,invert:s,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:h,mobileOffset:d,theme:m="light",richColors:g,duration:w,style:v,visibleToasts:b=pce,toastOptions:y,dir:_=_3(),gap:N=yce,icons:j,containerAriaLabel:S="Notifications"}=t,[C,P]=se.useState([]),A=se.useMemo(()=>r?C.filter(Q=>Q.toasterId===r):C.filter(Q=>!Q.toasterId),[C,r]),F=se.useMemo(()=>Array.from(new Set([a].concat(A.filter(Q=>Q.position).map(Q=>Q.position)))),[A,a]),[I,R]=se.useState([]),[M,$]=se.useState(!1),[B,U]=se.useState(!1),[G,Z]=se.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=se.useRef(null),V=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=se.useRef(null),L=se.useRef(!1),W=se.useCallback(Q=>{P(J=>{var ne;return(ne=J.find(Y=>Y.id===Q.id))!=null&&ne.delete||Ws.dismiss(Q.id),J.filter(({id:Y})=>Y!==Q.id)})},[]);return se.useEffect(()=>Ws.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{P(J=>J.map(ne=>ne.id===Q.id?{...ne,delete:!0}:ne))});return}setTimeout(()=>{zB.flushSync(()=>{P(J=>{const ne=J.findIndex(Y=>Y.id===Q.id);return ne!==-1?[...J.slice(0,ne),{...J[ne],...Q},...J.slice(ne+1)]:[Q,...J]})})})}),[C]),se.useEffect(()=>{if(m!=="system"){Z(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:J})=>{Z(J?"dark":"light")})}catch{Q.addListener(({matches:ne})=>{try{Z(ne?"dark":"light")}catch(Y){console.error(Y)}})}},[m]),se.useEffect(()=>{C.length<=1&&$(!1)},[C]),se.useEffect(()=>{const Q=J=>{var ne;if(o.every(le=>J[le]||J.code===le)){var ee;$(!0),(ee=X.current)==null||ee.focus()}J.code==="Escape"&&(document.activeElement===X.current||(ne=X.current)!=null&&ne.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[o]),se.useEffect(()=>{if(X.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,L.current=!1)}},[X.current]),se.createElement("section",{ref:n,"aria-label":`${S} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},F.map((Q,J)=>{var ne;const[Y,ee]=Q.split("-");return A.length?se.createElement("ol",{key:Q,dir:_==="auto"?_3():_,tabIndex:-1,ref:X,className:u,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":Y,"data-x-position":ee,style:{"--front-toast-height":`${((ne=I[0])==null?void 0:ne.height)||0}px`,"--width":`${xce}px`,"--gap":`${N}px`,...v,...Nce(h,d)},onBlur:le=>{L.current&&!le.currentTarget.contains(le.relatedTarget)&&(L.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||L.current||(L.current=!0,z.current=le.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{B||$(!1)},onDragEnd:()=>$(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},A.filter(le=>!le.position&&J===0||le.position===Q).map((le,re)=>{var fe,ge;return se.createElement(_ce,{key:le.id,icons:j,index:re,toast:le,defaultRichColors:g,duration:(fe=y==null?void 0:y.duration)!=null?fe:w,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:s,visibleToasts:b,closeButton:(ge=y==null?void 0:y.closeButton)!=null?ge:c,interacting:
vendor: 3,474 bytes, line 661
661B,position:Q,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,closeButtonAriaLabel:y==null?void 0:y.closeButtonAriaLabel,removeToast:W,toasts:A.filter(he=>he.position==le.position),heights:I.filter(he=>he.position==le.position),setHeights:R,expandByDefault:l,gap:N,expanded:M,swipeDirections:t.swipeDirections})})):null}))});function N3(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Y9(...e){return t=>{let n=!1;const r=e.map(s=>{const a=N3(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():N3(e[s],null)}}}}function fn(...e){return O.useCallback(Y9(...e),e)}function Dh(e){const t=Ece(e),n=O.forwardRef((r,s)=>{const{children:a,...o}=r,l=O.Children.toArray(a),c=l.find(Cce);if(c){const u=c.props.children,h=l.map(d=>d===c?O.Children.count(u)>1?O.Children.only(null):O.isValidElement(u)?u.props.children:null:d);return i.jsx(t,{...o,ref:s,children:O.isValidElement(u)?O.cloneElement(u,void 0,h):null})}return i.jsx(t,{...o,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}var kce=Dh("Slot");function Ece(e){const t=O.forwardRef((n,r)=>{const{children:s,...a}=n;if(O.isValidElement(s)){const o=Oce(s),l=Ace(a,s.props);return s.type!==O.Fragment&&(l.ref=r?Y9(r,o):o),O.cloneElement(s,l)}return O.Children.count(s)>1?O.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pce=Symbol("radix.slottable");function Cce(e){return O.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pce}function Ace(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...l)=>{const c=a(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function Oce(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Tce=Vy("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-slate-900 text-slate-50 hover:bg-slate-900/90",destructive:"bg-red-500 text-slate-50 hover:bg-red-500/90",outline:"border border-slate-200 bg-white hover:bg-slate-100 hover:text-slate-900",secondary:"bg-slate-100 text-slate-900 hover:bg-slate-100/80",ghost:"hover:bg-slate-100 hover:text-slate-900",link:"text-slate-900 underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ue=O.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},a)=>{const o=r?kce:"button";return i.jsx(o,{className:Nt(Tce({variant:t,size:n,className:e})),ref:a,...s})});ue.displayName="Button";const Ee=O.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:Nt("flex h-10 w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-sm r
661ing-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Ee.displayName="Input";const nr=O.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{className:Nt("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));nr.displayName="Textarea";var Rce=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pt=Rce.reduce((e,t)=>{const n=Dh(`Primitive.${t}`),r=O.forwardRef((s,a)=>{const{asChild:o,...l}=s,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Mce(e,t){e&&Ky.flushSync(()=>e.dispatchEvent(t))}var Ice="Label",X9=O.forwardRef((e,t)=>i.jsx(Pt.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));X9.displayName=Ice;var Z9=X9;const Dce=Vy("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),me=O.forwardRef(({className:e,...t},n)=>i.jsx(Z9,{ref:n,className:Nt(Dce(),e),...t}));me.displayName=Z9.displayName;function Lce(){const[e,t]=O.useState({name:"",email:"",message:""}),[n,r]=O.useState(!1),[s,a]=O.useState(!1),o=async l=>{if(l.preventDefault(),!e.name||!e.email||!e.message){tt.error("Please fill in all fields.");return}a(!0);try{await ae.integrations.Core.SendEmail({to:"[email protected]",subject:`Website Enquiry from ${e.name}`,body:`Name: ${e.name}
662Email: ${e.email}
663
664Message:
665${e.message}`}),r(!0)}catch{tt.error("Failed to send message. Please email us directly.")}a(!1)};return i.jsx("div",{className:"min-h-screen bg-slate-50",children:i.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-12",children:[i.jsxs(lr,{to:Ft("Public"),className:"inline-flex items-center gap-2 text-indigo-600 hover:text-indigo-800 mb-8 font-medium",children:[i.jsx(uu,{className:"w-4 h-4"}),"Back to Home"]}),i.jsxs("div",{className:"bg-gradient-to-br from-indigo-900 via-slate-900 to-slate-900 rounded-2xl p-10 text-white mb-8 text-center",children:[i.jsx("div",{className:"w-16 h-16 bg-amber-400 rounded-2xl flex items-center justify-center mx-auto mb-6",children:i.jsx(Jt,{className:"w-9 h-9 text-slate-900"})}),i.jsx("h1",{className:"text-4xl font-bold mb-4",children:"About Live Quizzing"}),i.jsx("p",{className:"text-slate-300 text-lg max-w-2xl mx-auto",children:"Ireland's home for live quiz nights — tracking standings, celebrating teams, and bringing communities together one question at a time."})]}),i.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-200 p-8 mb-6",children:[i.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-6",children:"What We Do"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[i.jsxs("div",{className:"text-center p-4",children:[i.jsx("div",{className:"w-12 h-12 bg-indigo-100 rounded-xl flex items-center justify-center mx-auto mb-3",children:i.jsx(Jt,{className:"w-6 h-6 text-indigo-600"})}),i.jsx("h3",{className:"font-bold text-slate-900 mb-2",children:"League Standings"}),i.jsx("p",{className:"text-sm text-slate-600",children:"We run a competitive quiz league with weekly results, handicap scoring, and live leaderboards updated after every event."})]}),i.jsxs("div",{className:"text-center p-4",children:[i.jsx("div",{className:"w-12 h-12 bg-amber-100 rounded-xl flex items-center justify-center mx-auto mb-3",children:i.jsx(Dr,{className:"w-6 h-6 text-amber-600"})}),i.jsx("h3",{className:"font-bold text-slate-900 mb-2",children:"Community"}),i.jsx("p",{className:"text-sm text-slate-600",children:"A thriving community of quiz teams, community quizzes, forums, raffles and events — all in one place."})]}),i.jsxs("div",{className:"text-center p-4",children:[i.jsx("div",{className:"w-12 h-12 bg-green-100 rounded-xl flex items-center justify-center mx-auto mb-3",children:i.jsx(Fn,{className:"w-6 h-6 text-green-600"})}),i.jsx("h3",{className:"font-bold text-slate-900 mb-2",children:"Live Events"}),i.jsx("p",{className:"text-sm text-slate-600",children:"Regular quiz nights, special events, and live sessions with real-time participation and instant results."})]})]})]}),i.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-200 p-8",children:[i.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Get in Touch"}),i.jsx("p",{className:"text-slate-600 mb-6",children:"Questions, bookings, or feedback? We'd love to hear from you."}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3 text-slate-700",children:[i.jsx("div",{className:"w-10 h-10 bg-indigo-100 rounded-lg flex items-center justify-center",children:i.jsx(Vo,{className:"w-5 h-5 text-indigo-600"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-slate-500 font-medium uppercase tracking-wide",children:"Email"}),i.jsx("a",{href:"mailto:[email protected]",className:"font-semibold text-indigo-600 hover:underline",children:"[email protected]"})]})]}),i.jsxs("div",{className:"flex items-center gap-3 text-slate-700",children:[i.jsx("div",{className:"w-10 h-10 bg-indigo-100 rounded-lg flex items-center justify-center",children:i.jsx(js,{className:"w-5 h-5 text-indigo-600"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-slate-500 font-medium uppercase tracking-wide",children:"Location"}),i.jsx("p",{className:"font-semibold",children:"Ireland"})]})]}),i.jsxs("div",{className:"flex items-center gap-3 text-slate-700",children:[i.jsx("div",{className:"w-10 h-10 bg-indigo-100 rounded-lg flex items-center justify-center",children:i.jsx(Wo,{className:"w-5 h-5 text-indigo-600"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-slate-500 font-medium uppercase tracking-wide",children:"Bookings"}),i.jsx(lr,{to:Ft("BookingPortal"),className:"font-semibold text-indigo-600 hover:underline",children:"Book a Quiz Night"})]})]}),i.jsxs("div",{className:"mt-6 bg-indigo-50 rounded-xl p-4 border border-indigo-100",children:[i.jsx("p",{className:"text-sm text-indigo-800 font-medium",children:"🎯 Looking to host a quiz night?"}),i.jsx("p",{className:"text-sm text-indigo-700 mt-1",children:"We offer in-venue and online quiz hosting for corporate events, fundraisers, and private functions."}),i.jsx(lr,{to:Ft("BookingPortal"),className:"inline-block mt-3 text-sm font-bold text-indigo-600 hover:underline",children:"Make an enquiry →"})]})]}),i.jsx("div",{children:n?i.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center py-8",children:[i.jsx(Cn,{className:"w-14 h-14 text-green-500 mb-4"}),i.jsx("h3",{className:"text-xl font-bold text-slate-900 mb-2",children:"Message Sent!"}),i.jsx("p",{className:"text-slate-600",children:"Thanks for reaching out. We'll get back to you soon."})]}):i.jsxs("form",{onSubmit:o,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(me,{htmlFor:"name",children:"Your Name"}),i.jsx(Ee,{id:"name",value:e.name,onChange:l=>t({...e,name:l.target.value}),placeholder:"John Smith",className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx(me,{htmlFor:"email",children:"Email Address"}),i.jsx(Ee,{id:"email",type:"email",value:e.email,onChange:l=>t({...e,email:l.target.value}),placeholder:"[email protected]",className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx(me,{htmlFor:"message",children:"Message"}),i.jsx(nr,{id:"message",value:e.message,onChange:l=>t({...e,message:l.target.value}),placeholder:"How can we help?",rows:4,className:"mt-1"})]}),i.jsx(ue,{type:"submit",className:"w-full bg-indigo-600 hover:bg-indigo-700",disabled:s,children:s?"Sending...":"Send Message"})]})})]})]}),i.jsxs("div",{className:"text-center mt-8 text-sm text-slate-500 space-x-4",children:[i.jsx(lr,{to:Ft("PrivacyPolicy"),className:"hover:text-indigo-600",children:"Privacy Policy"}),i.jsx("span",{children:"·"}),i.jsx(lr,{to:"/TermsOfService",className:"hover:text-indigo-600",children:"Terms of Service"}),i.jsx("span",{children:"·"}),i.jsx("a",{href:"mailto:[email protected]",className:"hover:text-indigo-600",children:"[email protected]"}),i.jsx("span",{children:"·"}),i.jsxs("span",{children:["© ",new Date().getFullYear()," Live Quizzing"]})]})]})})}function Et(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Fce(e,t){const n=O.createContext(t),r=a=>{const{children:o,...l}=a,c=O.useMemo(()=>l,Object.values(l));return i.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(a){const o=O.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,s]}function ja(e,t=[]){let n=[];function r(a,o){const l=O.createContext(o),c=n.length;n=[...n,o];const u=d=>{var y;const{scope:m,children:g,...w}=d,v=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,b=O.useMemo(()=>w,Object.values(w));return i.jsx(v.Provider,{value:b,children:g})};u.displayName=a+"Provider";function h(d,m){var v;const g=((v=m==null?void 0:m[e])==null?void 0:v[c])||l,w=O.useContext(g);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[u,h]}const s=()=>{const a=n.map(o=>O.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return O.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,$ce(s,...t)]}function $ce(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));
vendor: 8,691 bytes, line 665
665return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const d=c(a)[`__scope${u}`];return{...l,...d}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function d4(e){const t=e+"CollectionProvider",[n,r]=ja(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=v=>{const{scope:b,children:y}=v,_=se.useRef(null),N=se.useRef(new Map).current;return i.jsx(s,{scope:b,itemMap:N,collectionRef:_,children:y})};o.displayName=t;const l=e+"CollectionSlot",c=Dh(l),u=se.forwardRef((v,b)=>{const{scope:y,children:_}=v,N=a(l,y),j=fn(b,N.collectionRef);return i.jsx(c,{ref:j,children:_})});u.displayName=l;const h=e+"CollectionItemSlot",d="data-radix-collection-item",m=Dh(h),g=se.forwardRef((v,b)=>{const{scope:y,children:_,...N}=v,j=se.useRef(null),S=fn(b,j),C=a(h,y);return se.useEffect(()=>(C.itemMap.set(j,{ref:j,...N}),()=>void C.itemMap.delete(j))),i.jsx(m,{[d]:"",ref:S,children:_})});g.displayName=h;function w(v){const b=a(e+"CollectionConsumer",v);return se.useCallback(()=>{const _=b.collectionRef.current;if(!_)return[];const N=Array.from(_.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((C,P)=>N.indexOf(C.ref.current)-N.indexOf(P.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:o,Slot:u,ItemSlot:g},w,r]}var Gr=globalThis!=null&&globalThis.document?O.useLayoutEffect:()=>{},qce=FT[" useId ".trim().toString()]||(()=>{}),zce=0;function Gc(e){const[t,n]=O.useState(qce());return Gr(()=>{n(r=>r??String(zce++))},[e]),t?`radix-${t}`:""}function Ji(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Bce=FT[" useInsertionEffect ".trim().toString()]||Gr;function eu({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,o]=Uce({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const h=O.useRef(e!==void 0);O.useEffect(()=>{const d=h.current;d!==l&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,r])}const u=O.useCallback(h=>{var d;if(l){const m=Vce(h)?h(e):h;m!==e&&((d=o.current)==null||d.call(o,m))}else a(h)},[l,e,a,o]);return[c,u]}function Uce({defaultProp:e,onChange:t}){const[n,r]=O.useState(e),s=O.useRef(n),a=O.useRef(t);return Bce(()=>{a.current=t},[t]),O.useEffect(()=>{var o;s.current!==n&&((o=a.current)==null||o.call(a,n),s.current=n)},[n,s]),[n,r,a]}function Vce(e){return typeof e=="function"}var Wce=O.createContext(void 0);function Jy(e){const t=O.useContext(Wce);return e||t||"ltr"}var SS="rovingFocusGroup.onEntryFocus",Hce={bubbles:!1,cancelable:!0},eb="RovingFocusGroup",[FA,J9,Kce]=d4(eb),[Gce,eU]=ja(eb,[Kce]),[Qce,Yce]=Gce(eb),tU=O.forwardRef((e,t)=>i.jsx(FA.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(FA.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Xce,{...e,ref:t})})}));tU.displayName=eb;var Xce=O.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:h=!1,...d}=e,m=O.useRef(null),g=fn(t,m),w=Jy(a),[v,b]=eu({prop:o,defaultProp:l??null,onChange:c,caller:eb}),[y,_]=O.useState(!1),N=Ji(u),j=J9(n),S=O.useRef(!1),[C,P]=O.useState(0);return O.useEffect(()=>{const A=m.current;if(A)return A.addEventListener(SS,N),()=>A.removeEventListener(SS,N)},[N]),i.jsx(Qce,{scope:n,orientation:r,dir:w,loop:s,currentTabStopId:v,onItemFocus:O.useCallback(A=>b(A),[b]),onItemShiftTab:O.useCallback(()=>_(!0),[]),onFocusableItemAdd:O.useCallback(()=>P(A=>A+1),[]),onFocusableItemRemove:O.useCallback(()=>P(A=>A-1),[]),children:i.jsx(Pt.div,{tabIndex:y||C===0?-1:0,"data-orientation":r,...d,ref:g,style:{outline:"none",...e.style},onMouseDown:Et(e.onMouseDown,()=>{S.current=!0}),onFocus:Et(e.onFocus,A=>{const F=!S.current;if(A.target===A.currentTarget&&F&&!y){const I=new CustomEvent(SS,Hce);if(A.currentTarget.dispatchEvent(I),!I.defaultPrevented){const R=j().filter(G=>G.focusable),M=R.find(G=>G.active),$=R.find(G=>G.id===v),U=[M,$,...R].filter(Boolean).map(G=>G.ref.current);iU(U,h)}}S.current=!1}),onBlur:Et(e.onBlur,()=>_(!1))})})}),nU="RovingFocusGroupItem",rU=O.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:o,...l}=e,c=Gc(),u=a||c,h=Yce(nU,n),d=h.currentTabStopId===u,m=J9(n),{onFocusableItemAdd:g,onFocusableItemRemove:w,currentTabStopId:v}=h;return O.useEffect(()=>{if(r)return g(),()=>w()},[r,g,w]),i.jsx(FA.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:i.jsx(Pt.span,{tabIndex:d?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:Et(e.onMouseDown,b=>{r?h.onItemFocus(u):b.preventDefault()}),onFocus:Et(e.onFocus,()=>h.onItemFocus(u)),onKeyDown:Et(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){h.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=eue(b,h.orientation,h.dir);if(y!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let N=m().filter(j=>j.focusable).map(j=>j.ref.current);if(y==="last")N.reverse();else if(y==="prev"||y==="next"){y==="prev"&&N.reverse();const j=N.indexOf(b.currentTarget);N=h.loop?tue(N,j+1):N.slice(j+1)}setTimeout(()=>iU(N))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:v!=null}):o})})});rU.displayName=nU;var Zce={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jce(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function eue(e,t,n){const r=Jce(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Zce[r]}function iU(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function tue(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var nue=tU,rue=rU;function iue(e,t){return O.useReducer((n,r)=>t[n][r]??n,e)}var co=e=>{const{present:t,children:n}=e,r=sue(t),s=typeof n=="function"?n({present:r.isPresent}):O.Children.only(n),a=fn(r.ref,aue(s));return typeof n=="function"||r.isPresent?O.cloneElement(s,{ref:a}):null};co.displayName="Presence";function sue(e){const[t,n]=O.useState(),r=O.useRef(null),s=O.useRef(e),a=O.useRef("none"),o=e?"mounted":"unmounted",[l,c]=iue(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return O.useEffect(()=>{const u=i1(r.current);a.current=l==="mounted"?u:"none"},[l]),Gr(()=>{const u=r.current,h=s.current;if(h!==e){const m=a.current,g=i1(u);e?c("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(h&&m!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Gr(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,d=g=>{const v=i1(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(c("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=g=>{g.target===t&&(a.current=i1(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:O.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function i1(e){return(e==null?void 0:e.animationName)||"none"}function aue(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $_="Tabs",[oue]=ja($_,[eU]),sU=eU(),[lue,f4]=oue($_),aU=O.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,h=Jy(l),[d,m]=eu({prop:r,onChange:s,defaultProp:a??"",caller:$_});return i.jsx(lue,{scope:n,baseId:Gc(),value:d,onValueChange:m,orientation:o,dir:h,activationMode:c,children:i.jsx(Pt.div,{dir:h,"data-orientation":o,...u,ref:t})})});aU.displayName=$_;var oU="TabsList",lU=O.forwardRef((e,t)=>
vendor: 4,176 bytes, line 665
665{const{__scopeTabs:n,loop:r=!0,...s}=e,a=f4(oU,n),o=sU(n);return i.jsx(nue,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:i.jsx(Pt.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:t})})});lU.displayName=oU;var cU="TabsTrigger",uU=O.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...a}=e,o=f4(cU,n),l=sU(n),c=hU(o.baseId,r),u=mU(o.baseId,r),h=r===o.value;return i.jsx(rue,{asChild:!0,...l,focusable:!s,active:h,children:i.jsx(Pt.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":u,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...a,ref:t,onMouseDown:Et(e.onMouseDown,d=>{!s&&d.button===0&&d.ctrlKey===!1?o.onValueChange(r):d.preventDefault()}),onKeyDown:Et(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&o.onValueChange(r)}),onFocus:Et(e.onFocus,()=>{const d=o.activationMode!=="manual";!h&&!s&&d&&o.onValueChange(r)})})})});uU.displayName=cU;var dU="TabsContent",fU=O.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:a,...o}=e,l=f4(dU,n),c=hU(l.baseId,r),u=mU(l.baseId,r),h=r===l.value,d=O.useRef(h);return O.useEffect(()=>{const m=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(m)},[]),i.jsx(co,{present:s||h,children:({present:m})=>i.jsx(Pt.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:m&&a})})});fU.displayName=dU;function hU(e,t){return`${e}-trigger-${t}`}function mU(e,t){return`${e}-content-${t}`}var cue=aU,pU=lU,gU=uU,vU=fU;const tu=cue,Wl=O.forwardRef(({className:e,...t},n)=>i.jsx(pU,{ref:n,className:Nt("inline-flex h-10 items-center justify-center rounded-md bg-slate-100 p-1 text-slate-500",e),...t}));Wl.displayName=pU.displayName;const Wt=O.forwardRef(({className:e,...t},n)=>i.jsx(gU,{ref:n,className:Nt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white data-[state=active]:text-slate-950 data-[state=active]:shadow-sm",e),...t}));Wt.displayName=gU.displayName;const Yt=O.forwardRef(({className:e,...t},n)=>i.jsx(vU,{ref:n,className:Nt("mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2",e),...t}));Yt.displayName=vU.displayName;function uue(...e){return T_(Tt(e))}const due=Vy("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-slate-900 text-slate-50 hover:bg-slate-900/80",secondary:"border-transparent bg-slate-100 text-slate-900 hover:bg-slate-100/80",destructive:"border-transparent bg-red-500 text-slate-50 hover:bg-red-500/80",outline:"text-slate-950 border-slate-200"}},defaultVariants:{variant:"default"}});function nt({className:e,variant:t,...n}){return i.jsx("div",{className:uue(due({variant:t}),e),...n})}const Me=O.forwardRef(({className:e,children:t,...n},r)=>i.jsx("div",{ref:r,className:Nt("rounded-lg border border-slate-200 bg-white text-slate-950 shadow-sm",e),...n,children:t}));Me.displayName="Card";const st=O.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Nt("flex flex-col space-y-1.5 p-6",e),...t}));st.displayName="CardHeader";const at=O.forwardRef(({className:e,...t},n)=>i.jsx("h3",{ref:n,className:Nt("text-2xl font-semibold leading-none tracking-tight",e),...t}));at.displayName="CardTitle";const Ja=O.forwardRef(({className:e,...t},n)=>i.jsx("p",{ref:n,className:Nt("text-sm text-slate-500",e),...t}));Ja.displayName="CardDescription";const Fe=O.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Nt("p-6 pt-0",e),...t}));Fe.displayName="CardContent";const h4=O.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Nt("flex items-center p-6 pt-0",e),...t}));
vendor: 27,028 bytes, line 665
665h4.displayName="CardFooter";function K0(e,[t,n]){return Math.min(n,Math.max(t,e))}function fue(e,t=globalThis==null?void 0:globalThis.document){const n=Ji(e);O.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var hue="DismissableLayer",$A="dismissableLayer.update",mue="dismissableLayer.pointerDownOutside",pue="dismissableLayer.focusOutside",S3,xU=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),q_=O.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=O.useContext(xU),[h,d]=O.useState(null),m=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=O.useState({}),w=fn(t,P=>d(P)),v=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(b),_=h?v.indexOf(h):-1,N=u.layersWithOutsidePointerEventsDisabled.size>0,j=_>=y,S=xue(P=>{const A=P.target,F=[...u.branches].some(I=>I.contains(A));!j||F||(s==null||s(P),o==null||o(P),P.defaultPrevented||l==null||l())},m),C=yue(P=>{const A=P.target;[...u.branches].some(I=>I.contains(A))||(a==null||a(P),o==null||o(P),P.defaultPrevented||l==null||l())},m);return fue(P=>{_===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&l&&(P.preventDefault(),l()))},m),O.useEffect(()=>{if(h)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(S3=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),k3(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=S3)}},[h,m,n,u]),O.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),k3())},[h,u]),O.useEffect(()=>{const P=()=>g({});return document.addEventListener($A,P),()=>document.removeEventListener($A,P)},[]),i.jsx(Pt.div,{...c,ref:w,style:{pointerEvents:N?j?"auto":"none":void 0,...e.style},onFocusCapture:Et(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Et(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Et(e.onPointerDownCapture,S.onPointerDownCapture)})});q_.displayName=hue;var gue="DismissableLayerBranch",vue=O.forwardRef((e,t)=>{const n=O.useContext(xU),r=O.useRef(null),s=fn(t,r);return O.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(Pt.div,{...e,ref:s})});vue.displayName=gue;function xue(e,t=globalThis==null?void 0:globalThis.document){const n=Ji(e),r=O.useRef(!1),s=O.useRef(()=>{});return O.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){yU(mue,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yue(e,t=globalThis==null?void 0:globalThis.document){const n=Ji(e),r=O.useRef(!1);return O.useEffect(()=>{const s=a=>{a.target&&!r.current&&yU(pue,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function k3(){const e=new CustomEvent($A);document.dispatchEvent(e)}function yU(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Mce(s,a):s.dispatchEvent(a)}var kS=0;function m4(){O.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??E3()),document.body.insertAdjacentElement("beforeend",e[1]??E3()),kS++,()=>{kS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),kS--}},[])}function E3(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ES="focusScope.autoFocusOnMount",PS="focusScope.autoFocusOnUnmount",P3={bubbles:!1,cancelable:!0},bue="FocusScope",z_=O.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=O.useState(null),u=Ji(s),h=Ji(a),d=O.useRef(null),m=fn(t,v=>c(v)),g=O.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;O.useEffect(()=>{if(r){let v=function(N){if(g.paused||!l)return;const j=N.target;l.contains(j)?d.current=j:ad(d.current,{select:!0})},b=function(N){if(g.paused||!l)return;const j=N.relatedTarget;j!==null&&(l.contains(j)||ad(d.current,{select:!0}))},y=function(N){if(document.activeElement===document.body)for(const S of N)S.removedNodes.length>0&&ad(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const _=new MutationObserver(y);return l&&_.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),_.disconnect()}}},[r,l,g.paused]),O.useEffect(()=>{if(l){A3.add(g);const v=document.activeElement;if(!l.contains(v)){const y=new CustomEvent(ES,P3);l.addEventListener(ES,u),l.dispatchEvent(y),y.defaultPrevented||(wue(kue(bU(l)),{select:!0}),document.activeElement===v&&ad(l))}return()=>{l.removeEventListener(ES,u),setTimeout(()=>{const y=new CustomEvent(PS,P3);l.addEventListener(PS,h),l.dispatchEvent(y),y.defaultPrevented||ad(v??document.body,{select:!0}),l.removeEventListener(PS,h),A3.remove(g)},0)}}},[l,u,h,g]);const w=O.useCallback(v=>{if(!n&&!r||g.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(b&&y){const _=v.currentTarget,[N,j]=jue(_);N&&j?!v.shiftKey&&y===j?(v.preventDefault(),n&&ad(N,{select:!0})):v.shiftKey&&y===N&&(v.preventDefault(),n&&ad(j,{select:!0})):y===_&&v.preventDefault()}},[n,r,g.paused]);return i.jsx(Pt.div,{tabIndex:-1,...o,ref:m,onKeyDown:w})});z_.displayName=bue;function wue(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ad(r,{select:t}),document.activeElement!==n)return}function jue(e){const t=bU(e),n=C3(t,e),r=C3(t.reverse(),e);return[n,r]}function bU(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function C3(e,t){for(const n of e)if(!_ue(n,{upTo:t}))return n}function _ue(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Nue(e){return e instanceof HTMLInputElement&&"select"in e}function ad(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Nue(e)&&t&&e.select()}}var A3=Sue();function Sue(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=O3(e,t),e.unshift(t)},remove(t){var n;e=O3(e,t),(n=e[0])==null||n.resume()}}}function O3(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function kue(e){return e.filter(t=>t.tagName!=="A")}const Eue=["top","right","bottom","left"],Fd=Math.min,fa=Math.max,cj=Math.round,s1=Math.floor,$l=e=>({x:e,y:e}),Pue={left:"right",right:"left",bottom:"top",top:"bottom"},Cue={start:"end",end:"start"};function qA(e,t,n){return fa(e,Fd(t,n))}function nu(e,t){return typeof e=="function"?e(t):e}function ru(e){return e.split("-")[0]}function lv(e){return e.split("-")[1]}function p4(e){return e==="x"?"y":"x"}function g4(e){return e==="y"?"height":"width"}const Aue=new Set(["top","bottom"]);function Il(e){return Aue.has(ru(e))?"y":"x"}function v4(e){return p4(Il(e))}function Oue(e,t,n){n===void 0&&(n=!1);const r=lv(e),s=v4(e),a=g4(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=uj(o)),[o,uj(o)]}function Tue(e){const t=uj(e);return[zA(e),t,zA(t)]}function zA(e){return e.replace(/start|end/g,t=>Cue[t])}const T3=["left","right"],R3=["right","left"],Rue=["top","bottom"],Mue=["bottom","top"];function Iue(e,t,n){switch(e){case"top":case"bottom":return n?t?R3:T3:t?T3:R3;case"left":case"right":return t?Rue:Mue;default:return[]}}function Due(e,t,n,r){const s=lv(e);let a=Iue(ru(e),n==="start",r);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(zA)))),a}function uj(e){return e.replace(/left|right|bottom|top/g,t=>Pue[t])}function Lue(e){return{top:0,right:0,bottom:0,left:0,...e}}function wU(e){return typeof e!="number"?Lue(e):{top:e,right:e,bottom:e,left:e}}function dj(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function M3(e,t,n){let{reference:r,floating:s}=e;const a=Il(t),o=v4(t),l=g4(o),c=ru(t),u=a==="y",h=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,m=r[l]/2-s[l]/2;let g;switch(c){case"top":g={x:h,y:r.y-s.height};break;case"bottom":g={x:h,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-s.width,y:d};break;default:g={x:r.x,y:r.y}}switch(lv(t)){case"start":g[o]-=m*(n&&u?-1:1);break;case"end":g[o]+=m*(n&&u?-1:1);break}return g}const Fue=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:o}=n,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:d}=M3(u,r,c),m=r,g={},w=0;for(let v=0;v<l.length;v++){const{name:b,fn:y}=l[v],{x:_,y:N,data:j,reset:S}=await y({x:h,y:d,initialPlacement:r,placement:m,strategy:s,middlewareData:g,rects:u,platform:o,elements:{reference:e,floating:t}});h=_??h,d=N??d,g={...g,[b]:{...g[b],...j}},S&&w<=50&&(w++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(u=S.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):S.rects),{x:h,y:d}=M3(u,m,c)),v=-1)}return{x:h,y:d,placement:m,strategy:s,middlewareData:g}};async function G0(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:m=!1,padding:g=0}=nu(t,e),w=wU(g),b=l[m?d==="floating"?"reference":"floating":d],y=dj(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(b)))==null||n?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:h,strategy:c})),_=d==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),j=await(a.isElement==null?void 0:a.isElement(N))?await(a.getScale==null?void 0:a.getScale(N))||{x:1,y:1}:{x:1,y:1},S=dj(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:N,strategy:c}):_);return{top:(y.top-S.top+w.top)/j.y,bottom:(S.bottom-y.bottom+w.bottom)/j.y,left:(y.left-S.left+w.left)/j.x,right:(S.right-y.right+w.right)/j.x}}const $ue=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:h=0}=nu(e,t)||{};if(u==null)return{};const d=wU(h),m={x:n,y:r},g=v4(s),w=g4(g),v=await o.getDimensions(u),b=g==="y",y=b?"top":"left",_=b?"bottom":"right",N=b?"clientHeight":"clientWidth",j=a.reference[w]+a.reference[g]-m[g]-a.floating[w],S=m[g]-a.reference[g],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let P=C?C[N]:0;(!P||!await(o.isElement==null?void 0:o.isElement(C)))&&(P=l.floating[N]||a.floating[w]);const A=j/2-S/2,F=P/2-v[w]/2-1,I=Fd(d[y],F),R=Fd(d[_],F),M=I,$=P-v[w]-R,B=P/2-v[w]/2+A,U=qA(M,B,$),G=!c.arrow&&lv(s)!=null&&B!==U&&a.reference[w]/2-(B<M?I:R)-v[w]/2<0,Z=G?B<M?B-M:B-$:0;return{[g]:m[g]+Z,data:{[g]:U,centerOffset:B-U-Z,...G&&{alignmentOffset:Z}},reset:G}}}),que=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:v=!0,...b}=nu(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const y=ru(s),_=Il(l),N=ru(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(u.floating)),S=m||(N||!v?[uj(l)]:Tue(l)),C=w!=="none";!m&&C&&S.push(...Due(l,v,w,j));const P=[l,...S],A=await G0(t,b),F=[];let I=((r=a.flip)==null?void 0:r.overflows)||[];if(h&&F.push(A[y]),d){const B=Oue(s,o,j);F.push(A[B[0]],A[B[1]])}if(I=[...I,{placement:s,overflows:F}],!F.every(B=>B<=0)){var R,M;const B=(((R=a.flip)==null?void 0:R.index)||0)+1,U=P[B];if(U&&(!(d==="alignment"?_!==Il(U):!1)||I.every(X=>Il(X.placement)===_?X.overflows[0]>0:!0)))return{data:{index:B,overflows:I},reset:{placement:U}};let G=(M=I.filter(Z=>Z.overflows[0]<=0).sort((Z,X)=>Z.overflows[1]-X.overflows[1])[0])==null?void 0:M.placement;if(!G)switch(g){case"bestFit":{var $;const Z=($=I.filter(X=>{if(C){const V=Il(X.placement);return V===_||V==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(V=>V>0).reduce((V,z)=>V+z,0)]).sort((X,V)=>X[1]-V[1])[0])==null?void 0:$[0];Z&&(G=Z);break}case"initialPlacement":G=l;break}if(s!==G)return{reset:{placement:G}}}return{}}}};function I3(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function D3(e){return Eue.some(t=>e[t]>=0)}const zue=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=nu(e,t);switch(r){case"referenceHidden":{const a=await G0(t,{...s,elementContext:"reference"}),o=I3(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:D3(o)}}}case"escaped":{const a=await G0(t,{...s,altBoundary:!0}),o=I3(a,n.floating);return{data:{escapedOffsets:o,escaped:D3(o)}}}default:return{}}}}},jU=new Set(["left","top"]);async function Bue(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=ru(n),l=lv(n),c=Il(n)==="y",u=jU.has(o)?-1:1,h=a&&c?-1:1,d=nu(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof w=="number"&&(g=l==="end"?w*-1:w),c?{x:g*h,y:m*u}:{x:m*u,y:g*h}}const Uue=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:o,middlewareData:l}=t,c=await Bue(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:o}}}}},Vue=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:b=>{let{x:y,y:_}=b;return{x:y,y:_}}},...c}=nu(e,t),u={x:n,y:r},h=await G0(t,c),d=Il(ru(s)),m=p4(d);let g=u[m],w=u[d];if(a){const b=m==="y"?"top":"left",y=m==="y"?"bottom":"right",_=g+h[b],N=g-h[y];g=qA(_,g,N)}if(o){const b=d==="y"?"top":"left",y=d==="y"?"bottom":"right",_=w+h[b],N=w-h[y];w=qA(_,w,N)}const v=l.fn({...t,[m]:g,[d]:w});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:a,[d]:o}}}}}},Wue=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=nu(e,t),h={x:n,y:r},d=Il(s),m=p4(d);let g=h[m],w=h[d];const v=nu(l,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const N=m==="y"?"height":"width",j=a.reference[m]-a.floating[N]+b.mainAxis,S=a.reference[m]+a.reference[N]-b.mainAxis;g<j?g=j:g>S&&(g=S)}if(u){var y,_;const N=m==="y"?"width":"height",j=jU.has(ru(s)),S=a.reference[d]-a.floating[N]+(j&&((y=o.offset)==null?void 0:y[d])||0)+(j?0:b.crossAxis),C=a.reference[d]+a.reference[N]+(j?0:((_=o.offset)==null?void 0:_[d])||0)-(j?b.crossAxis:0);w<S?w=S:w>C&&(w=C)}return{[m]:g,[d]:w}}}},Hue=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=nu(e,t),h=await G0(t,u),d=ru(s),m=lv(s),g=Il(s)==="y",{width:w,height:v}=a.floating;let b,y;d==="top"||d==="bottom"?(b=d,y=m===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(y=d,b=m==="end"?"top":"bottom");const _=v-h.top-h.bottom,N=w-h.left-h.right,j=Fd(v-h[b],_),S=Fd(w-h[y],N),C=!t.middlewareData.shift;let P=j,A=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=_),C&&!m){const I=fa(h.left,0),R=fa(h.right,0),M=fa(h.top,0),$=fa(h.bottom,0);g?A=w-2*(I!==0||R!==0?I+R:fa(h.left,h.right)):P=v-2*(M!==0||$!==0?M+$:fa(h.top,h.bottom))}await c({...t,availableWidth:A,availableHeight:P});const F=await o.getDimensions(l.floating);return w!==F.width||v!==F.height?{reset:{rects:!0}}:{}}}};function B_(){return typeof window<"u"}function cv(e){return _U(e)?(e.nodeName||"").toLowerCase():"#document"}function pa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yl(e){var t;return(t=(_U(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _U(e){return B_()?e instanceof Node||e instanceof pa(e).Node:!1}function Ko(e){return B_()?e instanceof Element||e instanceof pa(e).Element:!1}function Hl(e){return B_()?e instanceof HTMLElement||e instanceof pa(e).HTMLElement:!1}function L3(e){return!B_()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pa(e).ShadowRoot}const Kue=new Set(["inline","contents"]);function tb(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Go(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Kue.has(s)}const Gue=new Set(["table","td","th"]);function Que(e){return Gue.has(cv(e))}const Yue=[":popover-open",":modal"];function U_(e){return Yue.some(t=>{try{return e.matches(t)}catch{return!1}})}const Xue=["transform","translate","scale","rotate","perspective"],Zue=["transform","translate","scale","rotate","perspective","filter"],Jue=["paint","layout","strict","content"];function x4(e){const t=y4(),n=Ko(e)?Go(e):e;return Xue.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Zue.some(r=>(n.willChange||"").includes(r))||Jue.some(r=>(n.contain||"").includes(r))}function ede(e){let t=$d(e);for(;Hl(t)&&!yg(t);){if(x4(t))return t;if(U_(t))return null;t=$d(t)}return null}function y4(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tde=new Set(["html","body","#document"]);function yg(e){return tde.has(cv(e))}function Go(e){return pa(e).getComputedStyle(e)}function V_(e){return Ko(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $d(e){if(cv(e)==="html")return e;const t=e.assignedSlot||e.parentNode||L3(e)&&e.host||Yl(e);return L3(t)?t.host:t}function NU(e){const t=$d(e);return yg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hl(t)&&tb(t)?t:NU(t)}function Q0(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=NU(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=pa(s);if(a){const l=BA(o);return t.concat(o,o.visualViewport||[],tb(s)?s:[],l&&n?Q0(l):[])}return t.concat(s,Q0(s,[],n))}function BA(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function SU(e){const t=Go(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Hl(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=cj(n)!==a||cj(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function b4(e){return Ko(e)?e:e.contextElement}function Zp(e){const t=b4(e);if(!Hl(t))return $l(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=SU(t);let o=(a?cj(n.width):n.width)/r,l=(a?cj(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const nde=$l(0);function kU(e){const t=pa(e);return!y4()||!t.visualViewport?nde:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rde(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pa(e)?!1:t}function Lh(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=b4(e);let o=$l(1);t&&(r?Ko(r)&&(o=Zp(r)):o=Zp(e));const l=rde(a,n,r)?kU(a):$l(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,h=s.width/o.x,d=s.height/o.y;if(a){const m=pa(a),g=r&&Ko(r)?pa(r):r;let w=m,v=BA(w);for(;v&&r&&g!==w;){const b=Zp(v),y=v.getBoundingClientRect(),_=Go(v),N=y.left+(v.clientLeft+parseFloat(_.paddingLeft))*b.x,j=y.top+(v.clientTop+parseFloat(_.paddingTop))*b.y;c*=b.x,u*=b.y,h*=b.x,d*=b.y,c+=N,u+=j,w=pa(v),v=BA(w)}}return dj({width:h,height:d,x:c,y:u})}function W_(e,t){const n=V_(e).scrollLeft;return t?t.left+n:Lh(Yl(e)).left+n}function EU(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-W_(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function ide(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",o=Yl(r),l=t?U_(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=$l(1);const h=$l(0),d=Hl(r);if((d||!d&&!a)&&((cv(r)!=="body"||tb(o))&&(c=V_(r)),Hl(r))){const g=Lh(r);u=Zp(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const m=o&&!d&&!a?EU(o,c):$l(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+h.x+m.x,y:n.y*u.y-c.scrollTop*u.y+h.y+m.y}}function sde(e){return Array.from(e.getClientRects())}function ade(e){const t=Yl(e),n=V_(e),r=e.ownerDocument.body,s=fa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=fa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+W_(e);const l=-n.scrollTop;return Go(r).direction==="rtl"&&(o+=fa(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:o,y:l}}const F3=25;function ode(e,t){const n=pa(e),r=Yl(e),s=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;const h=y4();(!h||h&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}const u=W_(r);if(u<=0){const h=r.ownerDocument,d=h.body,m=getComputedStyle(d),g=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,w=Math.abs(r.clientWidth-d.clientWidth-g);w<=F3&&(a-=w)}else u<=F3&&(a+=u);return{width:a,height:o,x:l,y:c}}const lde=new Set(["absolute","fixed"]);function cde(e,t){const n=Lh(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Hl(e)?Zp(e):$l(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,u=r*a.y;return{width:o,height:l,x:c,y:u}}function $3(e,t,n){let r;if(t==="viewport")r=ode(e,n);else if(t==="document")r=ade(Yl(e));else if(Ko(t))r=cde(t,n);else{const s=kU(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return dj(r)}function PU(e,t){const n=$d(e);return n===t||!Ko(n)||yg(n)?!1:Go(n).position==="fixed"||PU(n,t)}function ude(e,t){const n=t.get(e);if(n)return n;let r=Q0(e,[],!1).filter(l=>Ko(l)&&cv(l)!=="body"),s=null;const a=Go(e).position==="fixed";let o=a?$d(e):e;for(;Ko(o)&&!yg(o);){const l=Go(o),c=x4(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&lde.has(s.position)||tb(o)&&!c&&PU(e,o))?r=r.filter(h=>h!==o):s=l,o=$d(o)}return t.set(e,r),r}function dde(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?U_(t)?[]:ude(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,h)=>{const d=$3(t,h,s);return u.top=fa(d.top,u.top),u.right=Fd(d.right,u.right),u.bottom=Fd(d.bottom,u.bottom),u.left=fa(d.left,u.left),u},$3(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function fde(e){const{width:t,height:n}=SU(e);return{width:t,height:n}}function hde(e,t,n){const r=Hl(t),s=Yl(t),a=n==="fixed",o=Lh(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=$l(0);function u(){c.x=W_(s)}if(r||!r&&!a)if((cv(t)!=="body"||tb(s))&&(l=V_(t)),r){const g=Lh(t,!0,a,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else s&&u();a&&!r&&s&&u();const h=s&&!r&&!a?EU(s,l):$l(0),d=o.left+l.scrollLeft-c.x-h.x,m=o.top+l.scrollTop-c.y-h.y;return{x:d,y:m,width:o.width,height:o.height}}function CS(e){return Go(e).position==="static"}function q3(e,t){if(!Hl(e)||Go(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yl(e)===n&&(n=n.ownerDocument.body),n}function CU(e,t){const n=pa(e);if(U_(e))return n;if(!Hl(e)){let s=$d(e);for(;s&&!yg(s);){if(Ko(s)&&!CS(s))return s;s=$d(s)}return n}let r=q3(e,t);for(;r&&Que(r)&&CS(r);)r=q3(r,t);return r&&yg(r)&&CS(r)&&!x4(r)?n:r||ede(e)||n}const mde=async function(e){const t=this.getOffsetParent||CU,n=this.getDimensions,r=await n(e.floating);return{reference:hde(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pde(e){return Go(e).direction==="rtl"}const gde={convertOffsetParentRelativeRectToViewportRelativeRect:ide,getDocumentElement:Yl,getClippingRect:dde,getOffsetParent:CU,getElementRects:mde,getClientRects:sde,getDimensions:fde,getScale:Zp,isElement:Ko,isRTL:pde};function AU(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vde(e,t){let n=null,r;const s=Yl(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:h,top:d,width:m,height:g}=u;if(l||t(),!m||!g)return;const w=s1(d),v=s1(s.clientWidth-(h+m)),b=s1(s.clientHeight-(d+g)),y=s1(h),N={rootMargin:-w+"px "+-v+"px "+-b+"px "+-y+"px",threshold:fa(0,Fd(1,c))||1};let j=!0;function S(C){const P=C[0].intersectionRatio;if(P!==c){if(!j)return o();P?o(!1,P):r=setTimeout(()=>{o(!1,1e-7)},1e3)}P===1&&!AU(u,e.getBoundingClientRect())&&o(),j=!1}try{n=new IntersectionObserver(S,{...N,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,N)}n.observe(e)}return o(!0),a}function xde(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=b4(e),h=s||a?[...u?Q0(u):[],...Q0(t)]:[];h.forEach(y=>{s&&y.addEventListener("scroll",n,{passive:!0}),a&&y.addEventListener("resize",n)});const d=u&&l?vde(u,n):null;let m=-1,g=null;o&&(g=new ResizeObserver(y=>{let[_]=y;_&&_.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var N;(N=g)==null||N.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let w,v=c?Lh(e):null;c&&b();function b(){const y=Lh(e);v&&!AU(v,y)&&n(),v=y,w=requestAnimationFrame(b)}return n(),()=>{var y;h.forEach(_=>{s&&_.removeEventListener("scroll",n),a&&_.removeEventListener("resize",n)}),d==null||d(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(w)}}
vendor: 4,166 bytes, line 665
665const yde=Uue,bde=Vue,wde=que,jde=Hue,_de=zue,z3=$ue,Nde=Wue,Sde=(e,t,n)=>{const r=new Map,s={platform:gde,...n},a={...s.platform,_c:r};return Fue(e,t,{...s,platform:a})};var kde=typeof document<"u",Ede=function(){},U1=kde?O.useLayoutEffect:Ede;function fj(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!fj(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!fj(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function OU(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function B3(e,t){const n=OU(e);return Math.round(t*n)/n}function AS(e){const t=O.useRef(e);return U1(()=>{t.current=e}),t}function Pde(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[h,d]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=O.useState(r);fj(m,r)||g(r);const[w,v]=O.useState(null),[b,y]=O.useState(null),_=O.useCallback(X=>{X!==C.current&&(C.current=X,v(X))},[]),N=O.useCallback(X=>{X!==P.current&&(P.current=X,y(X))},[]),j=a||w,S=o||b,C=O.useRef(null),P=O.useRef(null),A=O.useRef(h),F=c!=null,I=AS(c),R=AS(s),M=AS(u),$=O.useCallback(()=>{if(!C.current||!P.current)return;const X={placement:t,strategy:n,middleware:m};R.current&&(X.platform=R.current),Sde(C.current,P.current,X).then(V=>{const z={...V,isPositioned:M.current!==!1};B.current&&!fj(A.current,z)&&(A.current=z,Ky.flushSync(()=>{d(z)}))})},[m,t,n,R,M]);U1(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(X=>({...X,isPositioned:!1})))},[u]);const B=O.useRef(!1);U1(()=>(B.current=!0,()=>{B.current=!1}),[]),U1(()=>{if(j&&(C.current=j),S&&(P.current=S),j&&S){if(I.current)return I.current(j,S,$);$()}},[j,S,$,I,F]);const U=O.useMemo(()=>({reference:C,floating:P,setReference:_,setFloating:N}),[_,N]),G=O.useMemo(()=>({reference:j,floating:S}),[j,S]),Z=O.useMemo(()=>{const X={position:n,left:0,top:0};if(!G.floating)return X;const V=B3(G.floating,h.x),z=B3(G.floating,h.y);return l?{...X,transform:"translate("+V+"px, "+z+"px)",...OU(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:z}},[n,l,G.floating,h.x,h.y]);return O.useMemo(()=>({...h,update:$,refs:U,elements:G,floatingStyles:Z}),[h,$,U,G,Z])}const Cde=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?z3({element:r.current,padding:s}).fn(n):{}:r?z3({element:r,padding:s}).fn(n):{}}}},Ade=(e,t)=>({...yde(e),options:[e,t]}),Ode=(e,t)=>({...bde(e),options:[e,t]}),Tde=(e,t)=>({...Nde(e),options:[e,t]}),Rde=(e,t)=>({...wde(e),options:[e,t]}),Mde=(e,t)=>({...jde(e),options:[e,t]}),Ide=(e,t)=>({..._de(e),options:[e,t]}),Dde=(e,t)=>({...Cde(e),options:[e,t]});var Lde="Arrow",TU=O.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return i.jsx(Pt.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});TU.displayName=Lde;var Fde=TU;function H_(e){const[t,n]=O.useState(void 0);return Gr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var w4="Popper",[RU,K_]=ja(w4),[$de,MU]=RU(w4),IU=e=>{const{__scopePopper:t,children:n}=e,[r,s]=O.useState(null);return i.jsx($de,{scope:t,anchor:r,onAnchorChange:s,children:n})};IU.displayName=w4;var DU="PopperAnchor",LU=O.forwardRef((e,t)=>
vendor: 4,690 bytes, line 665
665{const{__scopePopper:n,virtualRef:r,...s}=e,a=MU(DU,n),o=O.useRef(null),l=fn(t,o),c=O.useRef(null);return O.useEffect(()=>{const u=c.current;c.current=(r==null?void 0:r.current)||o.current,u!==c.current&&a.onAnchorChange(c.current)}),r?null:i.jsx(Pt.div,{...s,ref:l})});LU.displayName=DU;var j4="PopperContent",[qde,zde]=RU(j4),FU=O.forwardRef((e,t)=>{var ee,le,re,fe,ge,he;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:w,...v}=e,b=MU(j4,n),[y,_]=O.useState(null),N=fn(t,De=>_(De)),[j,S]=O.useState(null),C=H_(j),P=(C==null?void 0:C.width)??0,A=(C==null?void 0:C.height)??0,F=r+(a!=="center"?"-"+a:""),I=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},R=Array.isArray(u)?u:[u],M=R.length>0,$={padding:I,boundary:R.filter(Ude),altBoundary:M},{refs:B,floatingStyles:U,placement:G,isPositioned:Z,middlewareData:X}=Pde({strategy:"fixed",placement:F,whileElementsMounted:(...De)=>xde(...De,{animationFrame:g==="always"}),elements:{reference:b.anchor},middleware:[Ade({mainAxis:s+A,alignmentAxis:o}),c&&Ode({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Tde():void 0,...$}),c&&Rde({...$}),Mde({...$,apply:({elements:De,rects:_e,availableWidth:We,availableHeight:ze})=>{const{width:Xe,height:ke}=_e.reference,Ae=De.floating.style;Ae.setProperty("--radix-popper-available-width",`${We}px`),Ae.setProperty("--radix-popper-available-height",`${ze}px`),Ae.setProperty("--radix-popper-anchor-width",`${Xe}px`),Ae.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),j&&Dde({element:j,padding:l}),Vde({arrowWidth:P,arrowHeight:A}),m&&Ide({strategy:"referenceHidden",...$})]}),[V,z]=zU(G),L=Ji(w);Gr(()=>{Z&&(L==null||L())},[Z,L]);const W=(ee=X.arrow)==null?void 0:ee.x,Q=(le=X.arrow)==null?void 0:le.y,J=((re=X.arrow)==null?void 0:re.centerOffset)!==0,[ne,Y]=O.useState();return Gr(()=>{y&&Y(window.getComputedStyle(y).zIndex)},[y]),i.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:Z?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(fe=X.transformOrigin)==null?void 0:fe.x,(ge=X.transformOrigin)==null?void 0:ge.y].join(" "),...((he=X.hide)==null?void 0:he.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(qde,{scope:n,placedSide:V,onArrowChange:S,arrowX:W,arrowY:Q,shouldHideArrow:J,children:i.jsx(Pt.div,{"data-side":V,"data-align":z,...v,ref:N,style:{...v.style,animation:Z?void 0:"none"}})})})});FU.displayName=j4;var $U="PopperArrow",Bde={top:"bottom",right:"left",bottom:"top",left:"right"},qU=O.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=zde($U,r),o=Bde[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(Fde,{...s,ref:n,style:{...s.style,display:"block"}})})});qU.displayName=$U;function Ude(e){return e!==null}var Vde=e=>({name:"transformOrigin",options:e,fn(t){var b,y,_;const{placement:n,rects:r,middlewareData:s}=t,o=((b=s.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,h]=zU(n),d={start:"0%",center:"50%",end:"100%"}[h],m=(((y=s.arrow)==null?void 0:y.x)??0)+l/2,g=(((_=s.arrow)==null?void 0:_.y)??0)+c/2;let w="",v="";return u==="bottom"?(w=o?d:`${m}px`,v=`${-c}px`):u==="top"?(w=o?d:`${m}px`,v=`${r.floating.height+c}px`):u==="right"?(w=`${-c}px`,v=o?d:`${g}px`):u==="left"&&(w=`${r.floating.width+c}px`,v=o?d:`${g}px`),{data:{x:w,y:v}}}});function zU(e){const[t,n="center"]=e.split("-");return[t,n]}var BU=IU,_4=LU,UU=FU,VU=qU,Wde="Portal",G_=O.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=O.useState(!1);Gr(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?zB.createPortal(i.jsx(Pt.div,{...r,ref:t}),o):null});G_.displayName=Wde;function Q_(e){const t=O.useRef({value:e,previous:e});return O.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var WU=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Hde="VisuallyHidden",HU=O.forwardRef((e,t)=>
vendor: 14,368 bytes, lines 665-705
665i.jsx(Pt.span,{...e,ref:t,style:{...WU,...e.style}}));HU.displayName=Hde;var Kde=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ap=new WeakMap,a1=new WeakMap,o1={},OS=0,KU=function(e){return e&&(e.host||KU(e.parentNode))},Gde=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=KU(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Qde=function(e,t,n,r){var s=Gde(t,Array.isArray(e)?e:[e]);o1[n]||(o1[n]=new WeakMap);var a=o1[n],o=[],l=new Set,c=new Set(s),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};s.forEach(u);var h=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(m){if(l.has(m))h(m);else try{var g=m.getAttribute(r),w=g!==null&&g!=="false",v=(Ap.get(m)||0)+1,b=(a.get(m)||0)+1;Ap.set(m,v),a.set(m,b),o.push(m),v===1&&w&&a1.set(m,!0),b===1&&m.setAttribute(n,"true"),w||m.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return h(t),l.clear(),OS++,function(){o.forEach(function(d){var m=Ap.get(d)-1,g=a.get(d)-1;Ap.set(d,m),a.set(d,g),m||(a1.has(d)||d.removeAttribute(r),a1.delete(d)),g||d.removeAttribute(n)}),OS--,OS||(Ap=new WeakMap,Ap=new WeakMap,a1=new WeakMap,o1={})}},N4=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Kde(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),Qde(r,s,n,"aria-hidden")):function(){return null}},Ml=function(){return Ml=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ml.apply(this,arguments)};function GU(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Yde(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var V1="right-scroll-bar-position",W1="width-before-scroll-bar",Xde="with-scroll-bars-hidden",Zde="--removed-body-scroll-bar-size";function TS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Jde(e,t){var n=O.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var efe=typeof window<"u"?O.useLayoutEffect:O.useEffect,U3=new WeakMap;function tfe(e,t){var n=Jde(null,function(r){return e.forEach(function(s){return TS(s,r)})});return efe(function(){var r=U3.get(n);if(r){var s=new Set(r),a=new Set(e),o=n.current;s.forEach(function(l){a.has(l)||TS(l,null)}),a.forEach(function(l){s.has(l)||TS(l,o)})}U3.set(n,e)},[e]),n}function nfe(e){return e}function rfe(e,t){t===void 0&&(t=nfe);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var h=o;o=[],h.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(h){o.push(h),u()},filter:function(h){return o=o.filter(h),n}}}};return s}function ife(e){e===void 0&&(e={});var t=rfe(null);return t.options=Ml({async:!0,ssr:!1},e),t}var QU=function(e){var t=e.sideCar,n=GU(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return O.createElement(r,Ml({},n))};QU.isSideCarExport=!0;function sfe(e,t){return e.useMedium(t),QU}var YU=ife(),RS=function(){},Y_=O.forwardRef(function(e,t){var n=O.useRef(null),r=O.useState({onScrollCapture:RS,onWheelCapture:RS,onTouchMoveCapture:RS}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,h=e.enabled,d=e.shards,m=e.sideCar,g=e.noRelative,w=e.noIsolation,v=e.inert,b=e.allowPinchZoom,y=e.as,_=y===void 0?"div":y,N=e.gapMode,j=GU(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,C=tfe([n,t]),P=Ml(Ml({},j),s);return O.createElement(O.Fragment,null,h&&O.createElement(S,{sideCar:YU,removeScrollBar:u,shards:d,noRelative:g,noIsolation:w,inert:v,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:N}),o?O.cloneElement(O.Children.only(l),Ml(Ml({},P),{ref:C})):O.createElement(_,Ml({},P,{className:c,ref:C}),l))});Y_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Y_.classNames={fullWidth:W1,zeroRight:V1};var afe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ofe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=afe();return t&&e.setAttribute("nonce",t),e}function lfe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cfe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ufe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ofe())&&(lfe(t,n),cfe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},dfe=function(){var e=ufe();return function(t,n){O.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},XU=function(){var e=dfe(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},ffe={left:0,top:0,right:0,gap:0},MS=function(e){return parseInt(e||"",10)||0},hfe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[MS(n),MS(r),MS(s)]},mfe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ffe;var t=hfe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},pfe=XU(),Jp="data-scroll-locked",gfe=function(e,t,n,r){var s=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
666  .`.concat(Xde,` {
667   overflow: hidden `).concat(r,`;
668   padding-right: `).concat(l,"px ").concat(r,`;
669  }
670  body[`).concat(Jp,`] {
671    overflow: hidden `).concat(r,`;
672    overscroll-behavior: contain;
673    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
674    padding-left: `.concat(s,`px;
675    padding-top: `).concat(a,`px;
676    padding-right: `).concat(o,`px;
677    margin-left:0;
678    margin-top:0;
679    margin-right: `).concat(l,"px ").concat(r,`;
680    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
681  }
682  
683  .`).concat(V1,` {
684    right: `).concat(l,"px ").concat(r,`;
685  }
686  
687  .`).concat(W1,` {
688    margin-right: `).concat(l,"px ").concat(r,`;
689  }
690  
691  .`).concat(V1," .").concat(V1,` {
692    right: 0 `).concat(r,`;
693  }
694  
695  .`).concat(W1," .").concat(W1,` {
696    margin-right: 0 `).concat(r,`;
697  }
698  
699  body[`).concat(Jp,`] {
700    `).concat(Zde,": ").concat(l,`px;
701  }
702`)},V3=function(){var e=parseInt(document.body.getAttribute(Jp)||"0",10);return isFinite(e)?e:0},vfe=function(){O.useEffect(function(){return document.body.setAttribute(Jp,(V3()+1).toString()),function(){var e=V3()-1;e<=0?document.body.removeAttribute(Jp):document.body.setAttribute(Jp,e.toString())}},[])},xfe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;vfe();var a=O.useMemo(function(){return mfe(s)},[s]);return O.createElement(pfe,{styles:gfe(a,!t,s,n?"":"!important")})},UA=!1;if(typeof window<"u")try{var l1=Object.defineProperty({},"passive",{get:function(){return UA=!0,!0}});window.addEventListener("test",l1,l1),window.removeEventListener("test",l1,l1)}catch{UA=!1}var Op=UA?{passive:!1}:!1,yfe=function(e){return e.tagName==="TEXTAREA"},ZU=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!yfe(e)&&n[t]==="visible")},bfe=function(e){return ZU(e,"overflowY")},wfe=function(e){return ZU(e,"overflowX")},W3=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=JU(e,r);if(s){var a=e7(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jfe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_fe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},JU=function(e,t){return e==="v"?bfe(t):wfe(t)},e7=function(e,t){return e==="v"?jfe(t):_fe(t)},Nfe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Sfe=function(e,t,n,r,s){var a=Nfe(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,h=o>0,d=0,m=0;do{if(!l)break;var g=e7(e,l),w=g[0],v=g[1],b=g[2],y=v-b-a*w;(w||y)&&JU(e,l)&&(d+=y,m+=w);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(m)<1)&&(u=!0),u},c1=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},H3=function(e){return[e.deltaX,e.deltaY]},K3=function(e){return e&&"current"in e?e.current:e},kfe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Efe=function(e){return`
703  .block-interactivity-`.concat(e,` {pointer-events: none;}
704  .allow-interactivity-`).concat(e,` {pointer-events: all;}
705`)},Pfe=0,Tp=[];function Cfe(e){var t=O.useRef([]),n=O.useRef([0,0]),r=O.useRef(),s=O.useState(Pfe++)[0],a=O.useState(XU)[0],o=O.useRef(e);O.useEffect(function(){o.current=e},[e]),O.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var v=Yde([e.lockRef.current],(e.shards||[]).map(K3),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=O.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var y=c1(v),_=n.current,N="deltaX"in v?v.deltaX:_[0]-y[0],j="deltaY"in v?v.deltaY:_[1]-y[1],S,C=v.target,P=Math.abs(N)>Math.abs(j)?"h":"v";if("touches"in v&&P==="h"&&C.type==="range")return!1;var A=W3(P,C);if(!A)return!0;if(A?S=P:(S=P==="v"?"h":"v",A=W3(P,C)),!A)return!1;if(!r.current&&"changedTouches"in v&&(N||j)&&(r.current=S),!S)return!0;var F=r.current||S;return Sfe(F,b,v,F==="h"?N:j)},[]),c=O.useCallback(function(v){var b=v;if(!(!Tp.length||Tp[Tp.length-1]!==a)){var y="deltaY"in b?H3(b):c1(b),_=t.current.filter(function(S){return S.name===b.type&&(S.target===b.target||b.target===S.shadowParent)&&kfe(S.delta,y)})[0];if(_&&_.should){b.cancelable&&b.preventDefault();return}if(!_){var N=(o.current.shards||[]).map(K3).filter(Boolean).filter(function(S){return S.contains(b.target)}),j=N.length>0?l(b,N[0]):!o.current.noIsolation;j&&b.cancelable&&b.preventDefault()}}},[]),u=O.useCallback(function(v,b,y,_){var N={name:v,delta:b,target:y,should:_,shadowParent:Afe(y)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(j){return j!==N})},1)},[]),h=O.useCallback(function(v){n.current=c1(v),r.current=void 0},[]),d=O.useCallback(function(v){u(v.type,H3(v),v.target,l(v,e.lockRef.current))},[]),m=O.useCallback(function(v){u(v.type,c1(v),v.target,l(v,e.lockRef.current))},[]);O.useEffect(function(){return Tp.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Op),document.addEventListener("touchmove",c,Op),document.addEventListener("touchstart",h,Op),function(){Tp=Tp.filter(function(v){return v!==a}),document.removeEventListener("wheel",c,Op),document.removeEventListener("touchmove",c,Op),document.removeEventListener("touchstart",h,Op)}},[]);var g=e.removeScrollBar,w=e.inert;return O.createElement(O.Fragment,null,w?O.createElement(a,{styles:Efe(s)}):null,g?O.createElement(xfe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Afe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ofe=sfe(YU,Cfe);var X_=O.forwardRef(function(e,t){return O.createElement(Y_,Ml({},e,{ref:t,sideCar:Ofe}))});X_.classNames=Y_.classNames;var Tfe=[" ","Enter","ArrowUp","ArrowDown"],Rfe=[" ","Enter"],Fh="Select",[Z_,J_,Mfe]=d4(Fh),[uv]=ja(Fh,[Mfe,K_]),eN=K_(),[Ife,Ud]=uv(Fh),[Dfe,Lfe]=uv(Fh),t7=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:u,name:h,autoComplete:d,disabled:m,required:g,form:w}=e,v=eN(t),[b,y]=O.useState(null),[_,N]=O.useState(null),[j,S]=O.useState(!1),C=Jy(u),[P,A]=eu({prop:r,defaultProp:s??!1,onChange:a,caller:Fh}),[F,I]=eu({prop:o,defaultProp:l,onChange:c,caller:Fh}),R=O.useRef(null),M=b?w||!!b.closest("form"):!0,[$,B]=O.useState(new Set),U=Array.from($).map(G=>G.props.value).join(";");return i.jsx(BU,{...v,children:i.jsxs(Ife,{required:g,scope:t,trigger:b,onTriggerChange:y,valueNode:_,onValueNodeChange:N,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:Gc(),value:F,onValueChange:I,open:P,onOpenChange:A,dir:C,triggerPointerDownPosRef:R,disabled:m,children:[i.jsx(Z_.Provider,{scope:t,children:i.jsx(Dfe,{scope:e.__scopeSelect,onNativeOptionAdd:O.useCallback(G=>{B(Z=>new Set(Z).add(G))},[]),onNativeOptionRemove:O.useCallback(G=>{B(Z=>{const X=new Set(Z);return X.delete(G),X})},[]),children:n})}),M?i.jsxs(S7,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:d,value:F,onChange:G=>I(G.target.value),disabled:m,form:w,children:[F===void 0?i.jsx("option",{value:""}):null,Array.from($)]},U):null]})})};t7.displayName=Fh;var n7="SelectTrigger",r7=O.forwardRef((e,t)=>
vendor: 16,891 bytes, line 705
705{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=eN(n),o=Ud(n7,n),l=o.disabled||r,c=fn(t,o.onTriggerChange),u=J_(n),h=O.useRef("touch"),[d,m,g]=E7(v=>{const b=u().filter(N=>!N.disabled),y=b.find(N=>N.value===o.value),_=P7(b,v,y);_!==void 0&&o.onValueChange(_.value)}),w=v=>{l||(o.onOpenChange(!0),g()),v&&(o.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return i.jsx(_4,{asChild:!0,...a,children:i.jsx(Pt.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":k7(o.value)?"":void 0,...s,ref:c,onClick:Et(s.onClick,v=>{v.currentTarget.focus(),h.current!=="mouse"&&w(v)}),onPointerDown:Et(s.onPointerDown,v=>{h.current=v.pointerType;const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(w(v),v.preventDefault())}),onKeyDown:Et(s.onKeyDown,v=>{const b=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(b&&v.key===" ")&&Tfe.includes(v.key)&&(w(),v.preventDefault())})})})});r7.displayName=n7;var i7="SelectValue",s7=O.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:o="",...l}=e,c=Ud(i7,n),{onValueNodeHasChildrenChange:u}=c,h=a!==void 0,d=fn(t,c.onValueNodeChange);return Gr(()=>{u(h)},[u,h]),i.jsx(Pt.span,{...l,ref:d,style:{pointerEvents:"none"},children:k7(c.value)?i.jsx(i.Fragment,{children:o}):a})});s7.displayName=i7;var Ffe="SelectIcon",a7=O.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return i.jsx(Pt.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});a7.displayName=Ffe;var $fe="SelectPortal",o7=e=>i.jsx(G_,{asChild:!0,...e});o7.displayName=$fe;var $h="SelectContent",l7=O.forwardRef((e,t)=>{const n=Ud($h,e.__scopeSelect),[r,s]=O.useState();if(Gr(()=>{s(new DocumentFragment)},[]),!n.open){const a=r;return a?Ky.createPortal(i.jsx(c7,{scope:e.__scopeSelect,children:i.jsx(Z_.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),a):null}return i.jsx(u7,{...e,ref:t})});l7.displayName=$h;var Ro=10,[c7,Vd]=uv($h),qfe="SelectContentImpl",zfe=Dh("SelectContent.RemoveScroll"),u7=O.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:h,arrowPadding:d,collisionBoundary:m,collisionPadding:g,sticky:w,hideWhenDetached:v,avoidCollisions:b,...y}=e,_=Ud($h,n),[N,j]=O.useState(null),[S,C]=O.useState(null),P=fn(t,ee=>j(ee)),[A,F]=O.useState(null),[I,R]=O.useState(null),M=J_(n),[$,B]=O.useState(!1),U=O.useRef(!1);O.useEffect(()=>{if(N)return N4(N)},[N]),m4();const G=O.useCallback(ee=>{const[le,...re]=M().map(he=>he.ref.current),[fe]=re.slice(-1),ge=document.activeElement;for(const he of ee)if(he===ge||(he==null||he.scrollIntoView({block:"nearest"}),he===le&&S&&(S.scrollTop=0),he===fe&&S&&(S.scrollTop=S.scrollHeight),he==null||he.focus(),document.activeElement!==ge))return},[M,S]),Z=O.useCallback(()=>G([A,N]),[G,A,N]);O.useEffect(()=>{$&&Z()},[$,Z]);const{onOpenChange:X,triggerPointerDownPosRef:V}=_;O.useEffect(()=>{if(N){let ee={x:0,y:0};const le=fe=>{var ge,he;ee={x:Math.abs(Math.round(fe.pageX)-(((ge=V.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(fe.pageY)-(((he=V.current)==null?void 0:he.y)??0))}},re=fe=>{ee.x<=10&&ee.y<=10?fe.preventDefault():N.contains(fe.target)||X(!1),document.removeEventListener("pointermove",le),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",le),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",re,{capture:!0})}}},[N,X,V]),O.useEffect(()=>{const ee=()=>X(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[X]);const[z,L]=E7(ee=>{const le=M().filter(ge=>!ge.disabled),re=le.find(ge=>ge.ref.current===document.activeElement),fe=P7(le,ee,re);fe&&setTimeout(()=>fe.ref.current.focus())}),W=O.useCallback((ee,le,re)=>{const fe=!U.current&&!re;(_.value!==void 0&&_.value===le||fe)&&(F(ee),fe&&(U.current=!0))},[_.value]),Q=O.useCallback(()=>N==null?void 0:N.focus(),[N]),J=O.useCallback((ee,le,re)=>{const fe=!U.current&&!re;(_.value!==void 0&&_.value===le||fe)&&R(ee)},[_.value]),ne=r==="popper"?VA:d7,Y=ne===VA?{side:l,sideOffset:c,align:u,alignOffset:h,arrowPadding:d,collisionBoundary:m,collisionPadding:g,sticky:w,hideWhenDetached:v,avoidCollisions:b}:{};return i.jsx(c7,{scope:n,content:N,viewport:S,onViewportChange:C,itemRefCallback:W,selectedItem:A,onItemLeave:Q,itemTextRefCallback:J,focusSelectedItem:Z,selectedItemText:I,position:r,isPositioned:$,searchRef:z,children:i.jsx(X_,{as:zfe,allowPinchZoom:!0,children:i.jsx(z_,{asChild:!0,trapped:_.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Et(s,ee=>{var le;(le=_.trigger)==null||le.focus({preventScroll:!0}),ee.preventDefault()}),children:i.jsx(q_,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:i.jsx(ne,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:ee=>ee.preventDefault(),...y,...Y,onPlaced:()=>B(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Et(y.onKeyDown,ee=>{const le=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!le&&ee.key.length===1&&L(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let fe=M().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const ge=ee.target,he=fe.indexOf(ge);fe=fe.slice(he+1)}setTimeout(()=>G(fe)),ee.preventDefault()}})})})})})})});u7.displayName=qfe;var Bfe="SelectItemAlignedPosition",d7=O.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=Ud($h,n),o=Vd($h,n),[l,c]=O.useState(null),[u,h]=O.useState(null),d=fn(t,P=>h(P)),m=J_(n),g=O.useRef(!1),w=O.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:y,focusSelectedItem:_}=o,N=O.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&v&&b&&y){const P=a.trigger.getBoundingClientRect(),A=u.getBoundingClientRect(),F=a.valueNode.getBoundingClientRect(),I=y.getBoundingClientRect();if(a.dir!=="rtl"){const ge=I.left-A.left,he=F.left-ge,De=P.left-he,_e=P.width+De,We=Math.max(_e,A.width),ze=window.innerWidth-Ro,Xe=K0(he,[Ro,Math.max(Ro,ze-We)]);l.style.minWidth=_e+"px",l.style.left=Xe+"px"}else{const ge=A.right-I.right,he=window.innerWidth-F.right-ge,De=window.innerWidth-P.right-he,_e=P.width+De,We=Math.max(_e,A.width),ze=window.innerWidth-Ro,Xe=K0(he,[Ro,Math.max(Ro,ze-We)]);l.style.minWidth=_e+"px",l.style.right=Xe+"px"}const R=m(),M=window.innerHeight-Ro*2,$=v.scrollHeight,B=window.getComputedStyle(u),U=parseInt(B.borderTopWidth,10),G=parseInt(B.paddingTop,10),Z=parseInt(B.borderBottomWidth,10),X=parseInt(B.paddingBottom,10),V=U+G+$+X+Z,z=Math.min(b.offsetHeight*5,V),L=window.getComputedStyle(v),W=parseInt(L.paddingTop,10),Q=parseInt(L.paddingBottom,10),J=P.top+P.height/2-Ro,ne=M-J,Y=b.offsetHeight/2,ee=b.offsetTop+Y,le=U+G+ee,re=V-le;if(le<=J){const ge=R.length>0&&b===R[R.length-1].ref.current;l.style.bottom="0px";const he=u.clientHeight-v.offsetTop-v.offsetHeight,De=Math.max(ne,Y+(ge?Q:0)+he+Z),_e=le+De;l.style.height=_e+"px"}else{const ge=R.length>0&&b===R[0].ref.current;l.style.top="0px";const De=Math.max(J,U+v.offsetTop+(ge?W:0)+Y)+re;l.style.height=De+"px",v.scrollTop=le-J+v.offsetTop}l.style.margin=`${Ro}px 0`,l.style.minHeight=z+"px",l.style.maxHeight=M+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[m,a.trigger,a.valueNode,l,u,v,b,y,a.dir,r]);Gr(()=>N(),[N]);const[j,S]=O.useState();Gr(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const C=O.useCallback(P=>{P&&w.current===!0&&(N(),_==null||_(),w.current=!1)},[N,_]);return i.jsx(Vfe,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:C,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:i.jsx(Pt.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});d7.displayName=Bfe;var Ufe="SelectPopperPosition",VA=O.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ro,...a}=e,o=eN(n);return i.jsx(UU,{...o,...a,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});VA.displayName=Ufe;var[Vfe,S4]=uv($h,{}),WA="SelectViewport",f7=O.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,a=Vd(WA,n),o=S4(WA,n),l=fn(t,a.onViewportChange),c=O.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),i.jsx(Z_.Slot,{scope:n,children:i.jsx(Pt.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Et(s.onScroll,u=>{const h=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:m}=o;if(m!=null&&m.current&&d){const g=Math.abs(c.current-h.scrollTop);if(g>0){const w=window.innerHeight-Ro*2,v=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),y=Math.max(v,b);if(y<w){const _=y+g,N=Math.min(w,_),j=_-N;d.style.height=N+"px",d.style.bottom==="0px"&&(h.scrollTop=j>0?j:0,d.style.justifyContent="flex-end")}}}c.current=h.scrollTop})})})]})});f7.displayName=WA;var h7="SelectGroup",[Wfe,Hfe]=uv(h7),Kfe=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Gc();return i.jsx(Wfe,{scope:n,id:s,children:i.jsx(Pt.div,{role:"group","aria-labelledby":s,...r,ref:t})})});Kfe.displayName=h7;var m7="SelectLabel",p7=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Hfe(m7,n);return i.jsx(Pt.div,{id:s.id,...r,ref:t})});p7.displayName=m7;var hj="SelectItem",[Gfe,g7]=uv(hj),v7=O.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...o}=e,l=Ud(hj,n),c=Vd(hj,n),u=l.value===r,[h,d]=O.useState(a??""),[m,g]=O.useState(!1),w=fn(t,_=>{var N;return(N=c.itemRefCallback)==null?void 0:N.call(c,_,r,s)}),v=Gc(),b=O.useRef("touch"),y=()=>{s||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(Gfe,{scope:n,value:r,disabled:s,textId:v,isSelected:u,onItemTextChange:O.useCallback(_=>{d(N=>N||((_==null?void 0:_.textContent)??"").trim())},[]),children:i.jsx(Z_.ItemSlot,{scope:n,value:r,disabled:s,textValue:h,children:i.jsx(Pt.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:w,onFocus:Et(o.onFocus,()=>g(!0)),onBlur:Et(o.onBlur,()=>g(!1)),onClick:Et(o.onClick,()=>{b.current!=="mouse"&&y()}),onPointerUp:Et(o.onPointerUp,()=>{b.current==="mouse"&&y()}),onPointerDown:Et(o.onPointerDown,_=>{b.current=_.pointerType}),onPointerMove:Et(o.onPointerMove,_=>{var N;b.current=_.pointerType,s?(N=c.onItemLeave)==null||N.call(c):b.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Et(o.onPointerLeave,_=>{var N;_.currentTarget===document.activeElement&&((N=c.onItemLeave)==null||N.call(c))}),onKeyDown:Et(o.onKeyDown,_=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&_.key===" "||(Rfe.includes(_.key)&&y(),_.key===" "&&_.preventDefault())})})})})});v7.displayName=hj;var g0="SelectItemText",x7=O.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,o=Ud(g0,n),l=Vd(g0,n),c=g7(g0,n),u=Lfe(g0,n),[h,d]=O.useState(null),m=fn(t,y=>d(y),c.onItemTextChange,y=>{var _;return(_=l.itemTextRefCallback)==null?void 0:_.call(l,y,c.value,c.disabled)}),g=h==null?void 0:h.textContent,w=O.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=u;return Gr(()=>(v(w),()=>b(w)),[v,b,w]),i.jsxs(i.Fragment,{children:[i.jsx(Pt.span,{id:c.textId,...a,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ky.createPortal(a.children,o.valueNode):null]})});x7.displayName=g0;var y7="SelectItemIndicator",b7=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g7(y7,n).isSelected?i.jsx(Pt.span,{"aria-hidden":!0,...r,ref:t}):null});b7.displayName=y7;var HA="SelectScrollUpButton",w7=O.forwardRef((e,t)=>{const n=Vd(HA,e.__scopeSelect),r=S4(HA,e.__scopeSelect),[s,a]=O.useState(!1),o=fn(t,r.onScrollButtonChange);return Gr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(_7,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});w7.displayName=HA;var KA="SelectScrollDownButton",j7=O.forwardRef((e,t)=>{const n=Vd(KA,e.__scopeSelect),r=S4(KA,e.__scopeSelect),[s,a]=O.useState(!1),o=fn(t,r.onScrollButtonChange);return Gr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,h=Math.ceil(c.scrollTop)<u;a(h)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(_7,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});j7.displayName=KA;var _7=O.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=Vd("SelectScrollButton",n),o=O.useRef(null),l=J_(n),c=O.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return O.useEffect(()=>()=>c(),[c]),Gr(()=>{var h;const u=l().find(d=>d.ref.current===document.activeElement);(h=u==null?void 0:u.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),i.jsx(Pt.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Et(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Et(s.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Et(s.onPointerLeave,()=>{c()})})}),Qfe="SelectSeparator",N7=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(Pt.div,{"aria-hidden":!0,...r,ref:t})});N7.displayName=Qfe;var GA="SelectArrow",Yfe=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=eN(n),a=Ud(GA,n),o=Vd(GA,n);return a.open&&o.position==="popper"?i.jsx(VU,{...s,...r,ref:t}):null});Yfe.displayName=GA;var Xfe="SelectBubbleInput",S7=O.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=O.useRef(null),a=fn(r,s),o=Q_(t);return O.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&h){const d=new Event("change",{bubbles:!0});h.call(l,t),l.dispatchEvent(d)}},[o,t]),i.jsx(Pt.select,{...n,style:{...WU,...n.style},ref:a,defaultValue:t})});S7.displayName=Xfe;function k7(e){return e===""||e===void 0}function E7(e){const t=Ji(e),n=O.useRef(""),r=O.useRef(0),s=O.useCallback(o=>{const l=n.current+o;t(l),(function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),a=O.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return O.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function P7(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=Zfe(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function Zfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Jfe=t7,C7=r7,ehe=s7,the=a7,nhe=o7,A7=l7,rhe=f7,O7=p7,T7=v7,ihe=x7,she=b7,R7=w7,M7=j7,I7=N7;const Xt=Jfe,Zt=ehe,Ht=O.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(C7,{ref:r,className:Nt("flex h-10 w-full items-center justify-between rounded-md border border-slate-200 bg-white px-3 py-2 text-sm r
705ing-offset-white placeholder:text-slate-500 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(the,{asChild:!0,children:i.jsx(Yh,{className:"h-4 w-4 opacity-50"})})]}));Ht.displayName=C7.displayName;const D7=O.forwardRef(({className:e,...t},n)=>i.jsx(R7,{ref:n,className:Nt("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(A_,{className:"h-4 w-4"})}));D7.displayName=R7.displayName;const L7=O.forwardRef(({className:e,...t},n)=>i.jsx(M7,{ref:n,className:Nt("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(Yh,{className:"h-4 w-4"})}));L7.displayName=M7.displayName;const Kt=O.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>i.jsx(nhe,{children:i.jsxs(A7,{ref:s,className:Nt("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white text-slate-950 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(D7,{}),i.jsx(rhe,{className:Nt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(L7,{})]})}));Kt.displayName=A7.displayName;const ahe=O.forwardRef(({className:e,...t},n)=>i.jsx(O7,{ref:n,className:Nt("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));ahe.displayName=O7.displayName;const Ie=O.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(T7,{ref:r,className:Nt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(she,{children:i.jsx(Id,{className:"h-4 w-4"})})}),i.jsx(ihe,{children:t})]}));Ie.displayName=T7.displayName;const ohe=O.forwardRef(({className:e,...t},n)=>i.jsx(I7,{ref:n,className:Nt("-mx-1 my-1 h-px bg-slate-100",e),...t}));ohe.displayName=I7.displayName;var tN="Checkbox",[lhe]=ja(tN),[che,k4]=lhe(tN);function uhe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:a,form:o,name:l,onCheckedChange:c,required:u,value:h="on",internal_do_not_use_render:d}=e,[m,g]=eu({prop:n,defaultProp:s??!1,onChange:c,caller:tN}),[w,v]=O.useState(null),[b,y]=O.useState(null),_=O.useRef(!1),N=w?!!o||!!w.closest("form"):!0,j={checked:m,disabled:a,setChecked:g,control:w,setControl:v,name:l,form:o,value:h,hasConsumerStoppedPropagationRef:_,required:u,defaultChecked:Cd(s)?!1:s,isFormControl:N,bubbleInput:b,setBubbleInput:y};return i.jsx(che,{scope:t,...j,children:dhe(d)?d(j):r})}var F7="CheckboxTrigger",$7=O.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:a,value:o,disabled:l,checked:c,required:u,setControl:h,setChecked:d,hasConsumerStoppedPropagationRef:m,isFormControl:g,bubbleInput:w}=k4(F7,e),v=fn(s,h),b=O.useRef(c);return O.useEffect(()=>{const y=a==null?void 0:a.form;if(y){const _=()=>d(b.current);return y.addEventListener("reset",_),()=>y.removeEventListener("reset",_)}},[a,d]),i.jsx(Pt.button,{type:"button",role:"checkbox","aria-checked":Cd(c)?"mixed":c,"aria-required":u,"data-state":V7(c),"data-disabled":l?"":void 0,disabled:l,value:o,...r,ref:v,onKeyDown:Et(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:Et(n,y=>{d(_=>Cd(_)?!0:!_),w&&g&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})})});$7.displayName=F7;var E4=O.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:a,required:o,disabled:l,value:c,onCheckedChange:u,form:h,...d}=e;return i.jsx(uhe,{__scopeCheckbox:n,checked:s,defaultChecked:a,disabled:l,required:o,onCheckedChange:u,name:r,form:h,value:c,internal_do_not_use_render:({isFormControl:m})=>i.jsxs(i.Fragment,{children:[i.jsx($7,{...d,ref:t,__scopeCheckbox:n}),m&&i.jsx(U7,{__scopeCheckbox:n})]})})});E4.displayName=tN;var q7="CheckboxIndicator",z7=O.forwardRef((e,t)=>
vendor: 8,668 bytes, lines 705-709
705{const{__scopeCheckbox:n,forceMount:r,...s}=e,a=k4(q7,n);return i.jsx(co,{present:r||Cd(a.checked)||a.checked===!0,children:i.jsx(Pt.span,{"data-state":V7(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});z7.displayName=q7;var B7="CheckboxBubbleInput",U7=O.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:a,defaultChecked:o,required:l,disabled:c,name:u,value:h,form:d,bubbleInput:m,setBubbleInput:g}=k4(B7,e),w=fn(n,g),v=Q_(a),b=H_(r);O.useEffect(()=>{const _=m;if(!_)return;const N=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(N,"checked").set,C=!s.current;if(v!==a&&S){const P=new Event("click",{bubbles:C});_.indeterminate=Cd(a),S.call(_,Cd(a)?!1:a),_.dispatchEvent(P)}},[m,v,a,s]);const y=O.useRef(Cd(a)?!1:a);return i.jsx(Pt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??y.current,required:l,disabled:c,name:u,value:h,form:d,...t,tabIndex:-1,ref:w,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});U7.displayName=B7;function dhe(e){return typeof e=="function"}function Cd(e){return e==="indeterminate"}function V7(e){return Cd(e)?"indeterminate":e?"checked":"unchecked"}const qh=O.forwardRef(({className:e,...t},n)=>i.jsx(E4,{ref:n,className:Nt("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:i.jsx(z7,{className:Nt("flex items-center justify-center text-current"),children:i.jsx(Id,{className:"h-4 w-4"})})}));qh.displayName=E4.displayName;const fhe=Vy("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),vr=O.forwardRef(({className:e,variant:t,...n},r)=>i.jsx("div",{ref:r,role:"alert",className:Nt(fhe({variant:t}),e),...n}));vr.displayName="Alert";const hhe=O.forwardRef(({className:e,...t},n)=>i.jsx("h5",{ref:n,className:Nt("mb-1 font-medium leading-none tracking-tight",e),...t}));hhe.displayName="AlertTitle";const xr=O.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Nt("text-sm [&_p]:leading-relaxed",e),...t}));xr.displayName="AlertDescription";var nN="Dialog",[W7]=ja(nN),[mhe,Zo]=W7(nN),H7=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=O.useRef(null),c=O.useRef(null),[u,h]=eu({prop:r,defaultProp:s??!1,onChange:a,caller:nN});return i.jsx(mhe,{scope:t,triggerRef:l,contentRef:c,contentId:Gc(),titleId:Gc(),descriptionId:Gc(),open:u,onOpenChange:h,onOpenToggle:O.useCallback(()=>h(d=>!d),[h]),modal:o,children:n})};H7.displayName=nN;var K7="DialogTrigger",G7=O.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Zo(K7,n),a=fn(t,s.triggerRef);return i.jsx(Pt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":A4(s.open),...r,ref:a,onClick:Et(e.onClick,s.onOpenToggle)})});G7.displayName=K7;var P4="DialogPortal",[phe,Q7]=W7(P4,{forceMount:void 0}),Y7=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=Zo(P4,t);return i.jsx(phe,{scope:t,forceMount:n,children:O.Children.map(r,o=>i.jsx(co,{present:n||a.open,children:i.jsx(G_,{asChild:!0,container:s,children:o})}))})};Y7.displayName=P4;var mj="DialogOverlay",X7=O.forwardRef((e,t)=>{const n=Q7(mj,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=Zo(mj,e.__scopeDialog);return a.modal?i.jsx(co,{present:r||a.open,children:i.jsx(vhe,{...s,ref:t})}):null});X7.displayName=mj;var ghe=Dh("DialogOverlay.RemoveScroll"),vhe=O.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Zo(mj,n);return i.jsx(X_,{as:ghe,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(Pt.div,{"data-state":A4(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),zh="DialogContent",Z7=O.forwardRef((e,t)=>{const n=Q7(zh,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=Zo(zh,e.__scopeDialog);return i.jsx(co,{present:r||a.open,children:a.modal?i.jsx(xhe,{...s,ref:t}):i.jsx(yhe,{...s,ref:t})})});Z7.displayName=zh;var xhe=O.forwardRef((e,t)=>{const n=Zo(zh,e.__scopeDialog),r=O.useRef(null),s=fn(t,n.contentRef,r);return O.useEffect(()=>{const a=r.current;if(a)return N4(a)},[]),i.jsx(J7,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Et(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Et(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:Et(e.onFocusOutside,a=>a.preventDefault())})}),yhe=O.forwardRef((e,t)=>{const n=Zo(zh,e.__scopeDialog),r=O.useRef(!1),s=O.useRef(!1);return i.jsx(J7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),J7=O.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...o}=e,l=Zo(zh,n),c=O.useRef(null),u=fn(t,c);return m4(),i.jsxs(i.Fragment,{children:[i.jsx(z_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(q_,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":A4(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(bhe,{titleId:l.titleId}),i.jsx(jhe,{contentRef:c,descriptionId:l.descriptionId})]})]})}),C4="DialogTitle",eV=O.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Zo(C4,n);return i.jsx(Pt.h2,{id:s.titleId,...r,ref:t})});eV.displayName=C4;var tV="DialogDescription",nV=O.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Zo(tV,n);return i.jsx(Pt.p,{id:s.descriptionId,...r,ref:t})});nV.displayName=tV;var rV="DialogClose",iV=O.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Zo(rV,n);return i.jsx(Pt.button,{type:"button",...r,ref:t,onClick:Et(e.onClick,()=>s.onOpenChange(!1))})});iV.displayName=rV;function A4(e){return e?"open":"closed"}var sV="DialogTitleWarning",[YIe,aV]=Fce(sV,{contentName:zh,titleName:C4,docsSlug:"dialog"}),bhe=({titleId:e})=>{const t=aV(sV),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
706
707If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
708
709For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return O.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},whe="DialogDescriptionWarning",jhe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${aV(whe).contentName}}.`;return O.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},_he=H7,Nhe=G7,She=Y7,oV=X7,lV=Z7,cV=eV,uV=nV,khe=iV;const rn=_he,bg=Nhe,Ehe=She,dV=O.forwardRef(({className:e,...t},n)=>i.jsx(oV,{ref:n,className:Nt("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));dV.displayName=oV.displayName;const en=O.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(Ehe,{children:[i.jsx(dV,{}),i.jsxs(lV,{ref:r,className:Nt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
709nded-lg",e),...n,children:[t,i.jsxs(khe,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[i.jsx(Si,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));en.displayName=lV.displayName;const vn=({className:e,...t})=>i.jsx("div",{className:Nt("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});vn.displayName="DialogHeader";const Fr=({className:e,...t})=>i.jsx("div",{className:Nt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Fr.displayName="DialogFooter";const sn=O.forwardRef(({className:e,...t},n)=>i.jsx(cV,{ref:n,className:Nt("text-lg font-semibold leading-none tracking-tight",e),...t}));sn.displayName=cV.displayName;const Kl=O.forwardRef(({className:e,...t},n)=>i.jsx(uV,{ref:n,className:Nt("text-sm text-muted-foreground",e),...t}));Kl.displayName=uV.displayName;function Phe(){const[e,t]=O.useState(!1),[n,r]=O.useState(""),[s,a]=O.useState(""),[o,l]=O.useState(!1),c=mn(),{data:u}=qe({queryKey:["lastImport"],queryFn:async()=>(await ae.entities.ImportBatch.list("-import_timestamp",1)).find(w=>w.can_undo)||null}),{data:h}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]}),d=()=>{r(""),a(""),t(!0)},m=async()=>{if(!u)return;const g=(h==null?void 0:h.admin_pin)||"3190";if(n!==g){a("Incorrect PIN");return}l(!0),a("");try{const w=u.changes||{};if(w.team_updates&&w.team_updates.length>0&&await Promise.all(w.team_updates.map(v=>ae.entities.Team.update(v.team_id,v.previous_state))),w.created_team_ids&&w.created_team_ids.length>
7090&&await Promise.all(w.created_team_ids.map(v=>ae.entities.Team.delete(v))),h&&u.week_number){const v=Math.max(0,u.week_number-1);await ae.entities.Settings.update(h.id,{current_week:v})}await ae.entities.ImportBatch.update(u.id,{can_undo:!1}),await c.invalidateQueries(["teams"]),await c.invalidateQueries(["settings"]),await c.invalidateQueries(["lastImport"]),alert(`Successfully reverted import from ${u.quiz_date}`),t(!1)}catch(w){console.error("Failed to undo import:",w),a(`Failed to undo: ${w.message}`)}finally{l(!1)}};return u?i.jsxs(i.Fragment,{children:[i.jsxs(ue,{onClick:d,variant:"outline",className:"border-orange-300 text-orange-700 hover:bg-orange-50",children:[i.jsx(M1,{className:"w-4 h-4 mr-2"}),"Undo Last Import"]}),i.jsx(rn,{open:e,onOpenChange:t,children:i.jsxs(en,{children:[i.jsxs(vn,{children:[i.jsxs(sn,{className:"flex items-center gap-2 text-orange-700",children:[i.jsx(ba,{className:"w-5 h-5"}),"Undo Last CSV Import"]}),i.jsxs(Kl,{children:["This will revert all changes from the import on ",i.jsx("strong",{children:u.quiz_date})," (Week ",u.week_number,")."]})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-3 text-sm",children:[i.jsx("p",{className:"font-semibold text-orange-900 mb-2",children:"What will be reverted:"}),i.jsxs("ul",{className:"text-orange-800 space-y-1 ml-4 list-disc",children:[i.jsxs("li",{children:[u.total_teams," team results will be removed"]}),i.jsx("li",{children:"Team stats will return to their previous values"}),i.jsxs("li",{children:["Current week will be decremented to Week ",Math.max(0,u.week_number-1)]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"undo-pin",children:"Enter Admin PIN to Confirm"}),i.jsx(Ee,{id:"undo-pin",type:"password",value:n,onChange:g=>{r(g.target.value),a("")},onKeyDown:g=>{g.key==="Enter"&&!o&&m()},placeholder:"****",className:s?"border-red-500":"",disabled:o,autoFocus:!0}),s&&i.jsx("p",{className:"text-sm text-red-600",children:s})]})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:()=>t(!1),disabled:o,children:"Cancel"}),i.jsx(ue,{onClick:m,disabled:o,className:"bg-orange-600 hover:bg-orange-700",children:o?"Reverting...":"Confirm Undo"})]})]})})]}):null}function Che({onImportComplete:e}){const[t,n]=O.useState(null),[r,s]=O.useState(null),[a,o]=O.useState({name:"Participant Name",points:"Points",email:"Email",participantId:"Participant ID",team:"Team"}),[l,c]=O.useState(null),[u,h]=O.useState(!1),[d,m]=O.useState(null),[g,w]=O.useState(null),[v,b]=O.useState(null),[y,_]=O.useState(!1);mn();const{data:N=[]}=qe({queryKey:["uploadLogs"],queryFn:()=>ae.entities.UploadLog.list("-uploaded_at",500),staleTime:1e4}),j=M=>{const $=M.match(/(\d{8})/);if(!$)return null;const B=$[1],U=parseInt(B.slice(0,2)),G=parseInt(B.slice(2,4)),Z=parseInt(B.slice(4,8));return U<1||U>12||G<1||G>31?null:`${Z}-${String(U).padStart(2,"0")}-${String(G).padStart(2,"0")}`},S=async M=>{const $=M.target.files[0];if(!$)return;n($),m(null),b(null),_(!1);const B=j($.name);w(B);const U=$.name.toLowerCase().trim(),G=N.find(V=>V.filename&&V.filename.toLowerCase().trim()===U),Z=B?N.find(V=>V.quiz_date===B):null;if(G||Z){const V=G||Z,z=G?"exact filename":"same quiz date",L=V.uploaded_at?new Date(V.uploaded_at).toLocaleString("en-IE",{dateStyle:"medium",timeStyle:"short"}):"previously";b({type:z,filename:V.filename,quizDate:V.quiz_date,uploadedAt:L,totalTeams:V.total_teams,matchSource:G?"filename":"date"})}const X=new FileReader;X.onload=V=>{try{const z=V.target.result,L=ne=>{const Y=[];let ee="",le=!1;for(let re=0;re<ne.length;re++)ne[re]==='"'?le=!le:ne[re]===","&&!le?(Y.push(ee.trim()),ee=""):ee+=ne[re];return Y.push(ee.trim()),Y},W=z.split(`
710`).filter(ne=>ne.trim()),Q=L(W[0]),J=W.slice(1).map(ne=>{const Y=L(ne),ee={};return Q.forEach((le,re)=>{ee[le]=Y[re]||""}),ee});s({headers:Q,rows:J}),o(ne=>({name:Q.find(Y=>/participant.?name/i.test(Y))||ne.name,points:Q.find(Y=>/^points$/i.test(Y))||ne.points,email:Q.find(Y=>/^email$/i.test(Y))||ne.email,participantId:Q.find(Y=>/participant.?id/i.test(Y))||ne.participantId,team:Q.find(Y=>/^team$/i.test(Y))||null}))}catch{m("Failed to parse CSV file. Please check the format.")}},X.readAsText($)},C=M=>M?M.toLowerCase().trim().replace(/^the\s+/i,"").replace(/[^\w\s]/g,"").replace(/\s+/g," ").trim():"",P=(M,$)=>{const B=M.length>$.length?M:$,U=M.length>$.length?$:M;if(B.length===0)return 1;const G=A(B,U);return(B.length-G)/B.length},A=(M,$)=>{const B=[];for(let U=0;U<=$.length;U++)B[U]=[U];for(let U=0;U<=M.length;U++)B[0][U]=U;for(let U=1;U<=$.length;U++)for(let G=1;G<=M.length;G++)$.charAt(U-1)===M.charAt(G-1)?B[U][G]=B[U-1][G-1]:B[U][G]=Math.min(B[U-1][G-1]+1,B[U][G-1]+1,B[U-1][G]+1);return B[$.length][M.length]},F=async()=>
710{if(r){h(!0),m(null);try{const[M,$]=await Promise.all([ae.entities.Team.list(),ae.entities.NameMapping.list()]),B=r.rows.map(Y=>{const ee=Y[a.name],le=parseFloat(Y[a.points])||0,re=Y[a.email]||"",fe=Y[a.participantId]||"",ge=Y[a.team]||"",he=ee==null?void 0:ee.trim().toLowerCase(),De=C(ee),_e=ge.toLowerCase().includes("playing online"),We=$.find(de=>de.raw_name.toLowerCase()===he||de.normalized_name===he||re&&de.email&&de.email.toLowerCase()===re.toLowerCase()),ze=M.find(de=>de.team_name.toLowerCase()===he||re&&de.team_email&&de.team_email.toLowerCase()===re.toLowerCase());let Xe=null,ke=0,Ae=!1;if(!We&&!ze)for(const de of M){if(re&&de.team_email&&de.team_email.toLowerCase()===re.toLowerCase()){Xe=de,ke=1,Ae=!0;break}const Pe=C(de.team_name),Ze=P(De,Pe);Ze>.85&&Ze>ke&&(Xe=de,ke=Ze)}const Be=Ae||re&&ze&&ze.team_email&&ze.team_email.toLowerCase()===re.toLowerCase();return{rawName:ee,normalized:he,normalizedForComparison:De,points:le,email:re,participantId:fe,teamColumn:ge,isOnlineOnly:_e,leagueEligible:!_e,existingMapping:We,existingTeam:ze,similarTeam:Xe,similarityScore:ke,emailMatch:Be,isMatched:!!(We||ze||Be),isPotentialDuplicate:!!(Xe&&ke>.85&&!Be)}}).filter(Y=>Y.rawName);B.sort((Y,ee)=>ee.points-Y.points);const U=[...new Set(B.map(Y=>Y.points))].sort((Y,ee)=>ee-Y),G=U[0],Z=U[1],X=U[2],V=B.map(Y=>{let ee,le,re;Y.points===G?(ee=1,le=4,re="1st"):Y.points===Z?(ee=2,le=3,re="2nd"):Y.points===X?(ee=3,le=2,re="3rd"):(ee=4,le=0,re=null);const fe=1,ge=le+fe;return{...Y,place:ee,bonus:le,attendance:fe,totalPoints:ge,podiumFinish:re}}),z=V.filter(Y=>Y.place===1),L=V.filter(Y=>Y.place===2),W=V.filter(Y=>Y.place===3),Q=V.filter(Y=>!Y.isMatched),J=V.filter(Y=>Y.isPotentialDuplicate),ne=V.filter(Y=>Y.isOnlineOnly).length;c({totalTeams:V.length,quizDate:g||new Date().toISOString().split("T")[0],first:z.map(Y=>`${Y.rawName} (+${Y.totalPoints}pts)`),second:L.map(Y=>`${Y.rawName} (+${Y.totalPoints}pts)`),third:W.map(Y=>`${Y.rawName} (+${Y.totalPoints}pts)`),newTeams:Q.length,potentialDuplicates:J.length,onlineOnlyCount:ne,placements:V,unmatchedTeams:Q,allTeams:V,existingTeamCount:M.length})}catch(M){console.error("Preview generation error:",M),m(`Failed to process CSV data: ${M.message||"Network error"}`)}finally{h(!1)}}},I=()=>{l&&e({...l,quizDate:l.quizDate,sourceFilename:(t==null?void 0:t.name)||"unknown",unmatchedTeams:l.placements.filter(M=>M.leagueEligible)})},R=M=>{c($=>({...$,placements:$.placements.map((B,U)=>U===M?{...B,leagueEligible:!B.leagueEligible}:B)}))};return i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Dd,{className:"w-5 h-5"}),"Upload Weekly Results CSV"]}),i.jsx(Phe,{})]})}),i.jsxs(Fe,{className:"space-y-6",children:[d&&i.jsxs(vr,{variant:"destructive",children:[i.jsx(Sn,{className:"h-4 w-4"}),i.jsx(xr,{children:d})]}),i.jsxs("div",{children:[i.jsx(me,{htmlFor:"csv-file",children:"Choose CSV File"}),i.jsxs("div",{className:"mt-2 flex items-center gap-4",children:[i.jsx(Ee,{id:"csv-file",type:"file",accept:".csv",onChange:S,className:"flex-1"}),t&&i.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[i.jsx(Cn,{className:"w-4 h-4"}),t.name]})]}),g&&i.jsxs("div",{className:"mt-2 flex items-center gap-2 text-sm bg-indigo-50 border border-indigo-200 rounded-lg px-3 py-2",children:[i.jsx(eB,{className:"w-4 h-4 text-indigo-600"}),i.jsxs("span",{className:"text-indigo-900",children:[i.jsx("strong",{children:"Quiz Date from filename:"})," ",new Date(g+"T00:00:00").toLocaleDateString("en-IE",{weekday:"short",day:"numeric",month:"long",year:"numeric"})," (",g,")"]})]})]}),v&&i.jsxs(vr,{className:"border-red-500 bg-red-50",children:[i.jsx(Mte,{className:"h-5 w-5 text-red-600"}),i.jsx(xr,{children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"font-bold text-red-800 text-base flex items-center gap-2",children:[i.jsx(ba,{className:"w-4 h-4"}),"Duplicate Upload Detected — ",v.matchSource==="filename"?"Same Filename":"Same Quiz Date"]}),i.jsxs("div",{className:"text-sm text-red-700 space-y-1",children:[i.jsxs("p",{children:["This file was ",i.jsx("strong",{children:"already imported"})," on ",v.uploadedAt,"."]}),i.jsxs("p",{children:["Matched by ",i.jsx("strong",{children:v.matchSource}),":",v.matchSource==="filename"?` "${v.filename}"`:` Quiz date ${v.quizDate}`]}),v.totalTeams!=null&&i.jsxs("p",{children:["Previous import contained ",v.totalTeams," teams."]}),i.jsx("p",{className:"font-semibold pt-1",children:"Importing the same file again will create duplicate records and inflate team statistics. Only proceed if you know 
710what you're doing."})]}),i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer bg-white rounded-lg p-2 border border-red-300",children:[i.jsx(qh,{checked:y,onCheckedChange:M=>_(!!M)}),i.jsx("span",{className:"text-sm text-red-800 font-medium",children:"I understand the risks — allow this duplicate import anyway"})]})]})})]}),r&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Team Name Column"}),i.jsxs(Xt,{value:a.name,onValueChange:M=>o({...a,name:M}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsx(Kt,{children:r.headers.map(M=>i.jsx(Ie,{value:M,children:M},M))})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Points Column"}),i.jsxs(Xt,{value:a.points,onValueChange:M=>o({...a,points:M}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsx(Kt,{children:r.headers.map(M=>i.jsx(Ie,{value:M,children:M},M))})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Email Column (Optional)"}),i.jsxs(Xt,{value:a.email,onValueChange:M=>o({...a,email:M}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:null,children:"None"}),r.headers.map(M=>i.jsx(Ie,{value:M,children:M},M))]})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Participant ID Column (Optional)"}),i.jsxs(Xt,{value:a.participantId,onValueChange:M=>o({...a,participantId:M}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:null,children:"None"}),r.headers.map(M=>i.jsx(Ie,{value:M,children:M},M))]})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Team Column (for Online/Pub detection)"}),i.jsxs(Xt,{value:a.team,onValueChange:M=>o({...a,team:M}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:null,children:"None"}),r.headers.map(M=>i.jsx(Ie,{value:M,children:M},M))]})]})]})]}),i.jsx(ue,{onClick:F,disabled:u,className:"w-full",children:u?"Processing...":"Generate Preview"})]}),l&&i.jsxs("div",{className:"bg-slate-50 rounded-lg p-6 space-y-4",children:[i.jsx("h3",{className:"font-semibold text-lg",children:"Import Preview"}),i.jsxs(vr,{className:"bg-blue-50 border-blue-200",children:[i.jsx(Sn,{className:"h-4 w-4 text-blue-600"}),i.jsxs(xr,{className:"text-blue-900",children:[i.jsx("strong",{children:"Scoring:"})," 1st = 5pts (4 bonus + 1 ATT) • 2nd = 4pts (3 bonus + 1 ATT) • 3rd = 3pts (2 bonus + 1 ATT) • Others = 1pt (ATT only)",i.jsx("br",{}),i.jsx("strong",{children:"Note:"})," Places are based on unique score tiers. All teams with the same score get the same place."]})]}),l.potentialDuplicates>0&&i.jsxs(vr,{className:"bg-orange-50 border-orange-300",children:[i.jsx(Sn,{className:"h-4 w-4 text-orange-600"}),i.jsxs(xr,{className:"text-orange-900",children:[i.jsxs("strong",{children:["⚠️ ",l.potentialDuplicates," potential duplicate",l.potentialDuplicates!==1?"s":""," detected!"]})," Review these carefully in the Name Matching tab to avoid creating duplicate teams for minor name variations."]})]}),l.onlineOnlyCount>0&&i.jsxs(vr,{className:"bg-amber-50 border-amber-300",children:[i.jsx(Sn,{className:"h-4 w-4 text-amber-600"}),i.jsxs(xr,{className:"text-amber-900",children:["This file contains ",i.jsx("strong",{children:l.onlineOnlyCount})," online-only player",l.onlineOnlyCount!==1?"s":"","/team",l.onlineOnlyCount!==1?"s":""," that will not be added to the league table by default."]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"bg-white p-4 rounded-lg border",children:[i.jsx("div",{className:"text-2xl font-bold text-slate-900",children:l.totalTeams}),i.jsx("div",{className:"text-sm text-slate-600",children:"Total Teams/Players"})]}),i.jsxs("div",{className:"bg-white p-4 rounded-lg border",children:[i.jsx("div",{className:"text-2xl font-bold text-orange-600",children:l.newTeams}),i.jsx("div",{className:"text-sm text-slate-600",children:"New/Unmatched Teams"})]})]}),l.existingTeamCount>0&&l.placements.filter(M=>M.place<=3&&!M.isMatched&&M.leagueEligible).length>0&&i.jsxs("div",{className:"bg-red-50 border-2 border-red-400 rounded-lg p-4",children:[i.jsx("div",{className:"font-bold text-red-800 text-base mb-2",children:"⚠️ PODIUM TEAMS NOT MATCHED TO EXISTING TEAMS!"}),i.jsx("div",{className:"text-sm text-red-700 mb-2",children:"These teams placed 1st/2nd/3rd but are NOT matched to any existing team record. They will create new entries instead of updating existing ones — meaning their existing records won't receive these points:"}),i.jsx("ul",{className:"list-disc ml-4",children:l.placements.filter(M=>M.place<=3&&!M.isMatched&&M.leagueEligible).map((M,$)=>i.jsxs("li",{className:"text-red-800 font-semibold",children:[M.rawName," (",M.podiumFinish," place)"]},$))}),i.jsx("div",{className:"text-sm text-red-700 mt-2 font-semibold",children:'→ On the next screen, change their action to "Match to Existing Team" and select the correct team.'})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"bg-amber-50 p-3 rounded-lg border border-amber-200",children:[i.jsxs("div",{className:"font-semibold text-amber-900",children:["🥇 1st Place (",l.first.length," team",l.first.length!==1?"s":"",")"]}),i.jsx("div",{className:"text-sm text-amber-800",children:l.first.join(", ")})]}),i.jsxs("div",{className:"bg-slate-50 p-3 rounded-lg border border-slate-200",children:[i.jsxs("div",{className:"font-semibold text-slate-900",children:["🥈 2nd Place (",l.second.length," team",l.second.length!==1?"s":"",")"]}),i.jsx("div",{className:"text-sm text-slate-700",children:l.second.join(", ")||"None"})]}),i.jsxs("div",{className:"bg-orange-50 p-3 rounded-lg border border-orange-200",children:[i.jsxs("div",{className:"font-semibold text-orange-900",children:["🥉 3rd Place (",l.third.length," team",l.third.length!==1?"s":"",")"]}),i.jsx("div",{className:"text-sm text-orange-800",children:l.third.join(", ")||"None"})]})]}),i.jsxs("div",{className:"bg-white rounded-lg border",children:[i.jsx("div",{className:"p-3 border-b bg-slate-50",children:i.jsx("h4",{className:"font-semibold text-sm",children:"Detailed Team List"})}),i.jsx("div",{className:"max-h-96 overflow-y-auto",children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{className:"bg-slate-100 sticky top-0",children:i.jsxs("tr",{children:[i.jsx("th",{className:"text-left p-2",children:"Include"}),i.jsx("th",{className:"text-left p-2",children:"Name"}),i.jsx("th",{className:"text-left p-2",children:"Points"}),i.jsx("th",{className:"text-left p-2",children:"Place"}),i.jsx("th",{className:"text-left p-2",children:"Status"})]})}),i.jsx("tbody",{children:l.placements.map((M,$)=>i.jsxs("tr",{className:M.isOnlineOnly?"bg-yellow-50":"",children:[i.jsx("td",{className:"p-2",children:i.jsx(qh,{checked:M.leagueEligible,onCheckedChange:()=>R($)})}),i.jsx("td",{className:"p-2",children:M.rawName}),i.jsx("td",{className:"p-2",children:M.points}),i.jsx("td",{className:"p-2",children:M.podiumFinish||"-"}),i.jsx("td",{className:"p-2",children:M.isOnlineOnly?i.jsx("span",{className:"text-xs bg-amber-200 text-amber-900 px-2 py-1 rounded",children:"Online Only - Excluded"}):i.jsx("span",{className:"text-xs bg-green-100 text-green-800 px-2 py-1 rounded",children:"League Team"})})]},$))})]})})]}),i.jsx(ue,{onClick:I,disabled:v&&!y,className:`w-full ${v&&!y?"bg-gray-400 cursor-not-allowed":v&&y?"bg-red-600 hover:bg-red-700":"bg-indigo-600 hover:bg-indigo-700"}`,children:v&&y?"Proceed with Duplicate Import (Override)":v?"Duplicate Detected — Confirm Override Above to Proceed":"Proceed to Name Matching"})]})]})]})}function Ahe({importData:e,pendingMatches:t,setPendingMatches:n,onComplete:r}){const[s,a]=O.useState([]),[o,l]=O.useState([]),[c,u]=O.useState(!1),h=mn(),{data:d=[]}
710=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list()}),{data:m}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]});O.useEffect(()=>{a(t.map(_=>{var N,j,S;return _.isMatched?{action:"match",teamId:((N=_.existingMapping)==null?void 0:N.mapped_team_id)||((j=_.existingTeam)==null?void 0:j.id)||_.emailMatch&&((S=_.similarTeam)==null?void 0:S.id)||null}:_.isPotentialDuplicate&&_.similarTeam?{action:"match",teamId:_.similarTeam.id}:{action:"create",teamId:null}})),l(t.map(()=>!0))},[t]);const g=_=>d.map(N=>({team:N,similarity:w(_,N.team_name.toLowerCase())})).filter(N=>N.similarity>.5).sort((N,j)=>j.similarity-N.similarity).slice(0,5),w=(_,N)=>{const j=_.length>N.length?_:N,S=_.length>N.length?N:_;if(j.length===0)return 1;const C=v(j,S);return(j.length-C)/j.length},v=(_,N)=>{const j=[];for(let S=0;S<=N.length;S++)j[S]=[S];for(let S=0;S<=_.length;S++)j[0][S]=S;for(let S=1;S<=N.length;S++)for(let C=1;C<=_.length;C++)N.charAt(S-1)===_.charAt(C-1)?j[S][C]=j[S-1][C-1]:j[S][C]=Math.min(j[S-1][C-1]+1,j[S][C-1]+1,j[S-1][C]+1);return j[N.length][_.length]},b=_=>{const N=_||0;return N<=3?-1*N:-3-2*(N-3)},y=async()=>{var N;const _=t.filter((j,S)=>{var C,P;return j.leagueEligible&&((C=s[S])==null?void 0:C.action)==="match"&&!((P=s[S])!=null&&P.teamId)});if(_.length>0){alert(`Please select a team to match for: ${_.map(j=>j.rawName).join(", ")}`);return}u(!0);try{const j=((m==null?void 0:m.current_week)||0)+1,S=/^\d{4}-\d{2}-\d{2}$/,C=e!=null&&e.quizDate&&S.test(e.quizDate)?e.quizDate:new Date().toISOString().split("T")[0],P=[],A=await ae.entities.Team.list(),F=await ae.entities.Weekly
710Result.filter({quiz_date:C}),I=new Set(F.map(J=>J.team_id)),R=await ae.entities.NameMapping.list(),M=new Map;R.forEach(J=>{M.has(J.raw_name)||M.set(J.raw_name,[]),M.get(J.raw_name).push(J)});const $=[],B=new Map,U=new Map,G=[],Z=[],X=[],V=[],z={};for(let J=0;J<t.length;J++){const ne=t[J],Y=s[J],ee=o[J];if(!ne.leagueEligible)continue;const le=ne.totalPoints!=null&&ne.totalPoints>0?ne.totalPoints:1;let re=Y.teamId,fe="";if(Y.action==="create"){const ge=ne.place===1?1:0,he=b(ge);$.push({idx:J,team_name:ne.rawName,appearances:1,finishes_1st:ge,finishes_2nd:ne.place===2?1:0,finishes_3rd:ne.place===3?1:0,last_attendance_date:C,base_points:le,handicap:he,total_points:le,active:!0}),z[J]={pending:!0,pointsEarned:le}}else{let ge=A.find(De=>De.id===re);if(!ge){const De=(N=ne.rawName)==null?void 0:N.trim().toLowerCase();if(ge=A.find(_e=>_e.team_name.trim().toLowerCase()===De),ge)re=ge.id;else throw new Error(`Could not find team for "${ne.rawName}" — the saved mapping may be stale. Please undo this import, go to Name Mappings, delete the old mapping for this team, and re-import.`)}fe=ge.team_name,re=ge.id,U.has(re)||U.set(re,{team_id:re,previous_state:{appearances:ge.appearances,finishes_1st:ge.finishes_1st,finishes_2nd:ge.finishes_2nd,finishes_3rd:ge.finishes_3rd,base_points:ge.base_points,handicap:ge.handicap,total_points:ge.total_points,last_attendance_date:ge.last_attendance_date}});let he=B.get(re);he||(he={id:re,appearances:ge.appearances,finishes_1st:ge.finishes_1st,finishes_2nd:ge.finishes_2nd,finishes_3rd:ge.finishes_3rd,base_points:ge.base_points,last_attendance_date:ge.last_attendance_date},B.set(re,he)),he.appearances+=1,he.finishes_1st+=ne.place===1?1:0,he.finishes_2nd+=ne.place===2?1:0,he.finishes_3rd+=ne.place===3?1:0,he.base_points+=le,he.last_attendance_date=C,z[J]={teamId:re,teamName:fe,pointsEarned:le,pending:ne}}ee&&(z[J].wantsMapping=!0)}const L=Array.from(B.values()).map(J=>({id:J.id,appearances:J.appearances,finishes_1st:J.finishes_1st,finishes_2nd:J.finishes_2nd,finishes_3rd:J.finishes_3rd,last_attendance_date:J.last_attendance_date,base_points:J.base_points,handicap:b(J.finishes_1st),total_points:J.base_points})),W=Array.from(U.values());if($.length>0){const J=await ae.entities.Team.bulkCreate($.map(({idx:ne,...Y})=>Y));$.forEach((ne,Y)=>{const ee=J[Y];P.push(ee.id),z[ne.idx].teamId=ee.id,z[ne.idx].teamName=ee.team_name})}L.length>0&&await ae.entities.Team.bulkUpdate(L);for(let J=0;J<t.length;J++){const ne=t[J],Y=z[J];if(!(!Y||!Y.teamId)&&(I.has(Y.teamId)||(I.add(Y.teamId),G.push({quiz_date:C,week_number:j,team_id:Y.teamId,team_name:Y.teamName,team_email:ne.email||"",placement:ne.place<=3?ne.place:0,points_earned:Y.pointsEarned,is_voided:!1,raw_data:{rawName:ne.rawName,points:ne.points,place:ne.place,participantId:ne.participantId||""}})),Y.wantsMapping)){const ee=M.get(ne.rawName)||[];if(ee.length>0){X.push({id:ee[0].id,mapped_team_id:Y.teamId,mapped_team_name:Y.teamName,email:ne.email||"",participant_id:ne.participantId||""});for(let le=1;le<ee.length;le++)V.push(ee[le].id)}else Z.push({raw_name:ne.rawName,normalized_name:ne.normalized,mapped_team_id:Y.teamId,mapped_team_name:Y.teamName,email:ne.email||"",participant_id:ne.participantId||""})}}G.length>
7100&&await ae.entities.WeeklyResult.bulkCreate(G),Z.length>0&&await ae.entities.NameMapping.bulkCreate(Z);for(const J of X)await ae.entities.NameMapping.update(J.id,J);for(const J of V)await ae.entities.NameMapping.delete(J);const Q=await ae.entities.ImportBatch.create({quiz_date:C,import_timestamp:new Date().toISOString(),total_teams:t.length,week_number:j,changes:{team_updates:W,created_team_ids:P},can_undo:!0});await ae.entities.UploadLog.create({filename:(e==null?void 0:e.sourceFilename)||"unknown",quiz_date:C,uploaded_at:new Date().toISOString(),total_teams:t.length,import_batch_id:Q.id}),m&&await ae.entities.Settings.update(m.id,{current_week:j}),h.invalidateQueries(["teams"]),h.invalidateQueries(["settings"]),h.invalidateQueries(["importBatches"]),h.invalidateQueries(["weeklyResults"]),h.invalidateQueries(["uploadLogs"]),r()}catch(j){console.error("Failed to apply matches:",j),alert(`Error applying results: ${j.message}`)}u(!1)};return!e||t.length===0?i.jsx(Me,{children:i.jsxs(Fe,{className:"p-12 text-center",children:[i.jsx(rA,{className:"w-12 h-12 text-slate-300 mx-auto mb-4"}),i.jsx("p",{className:"text-slate-600",children:"No unmatched teams to process. Import a CSV first."})]})}):i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(rA,{className:"w-5 h-5"}),"Review & Apply Results (",t.filter(_=>!_.isMatched).length," new, ",t.filter(_=>_.isMatched).length," existing)"]})}),i.jsxs(Fe,{className:"space-y-4",children:[i.jsxs(vr,{children:[i.jsx(Sn,{className:"h-4 w-4"}),i.jsx(xr,{children:"Review all teams from this week's results. Existing teams are auto-matched and will have their stats updated. New teams can be matched or created."})]}),t.map((_,N)=>{var S,C,P;const j=g(_.normalized);return i.jsxs("div",{className:`p-4 rounded-lg border space-y-3 ${_.leagueEligible?_.isPotentialDuplicate?"bg-orange-50 border-orange-300":_.isMatched?"bg-blue-50 border-blue-300":"bg-slate-50":"bg-yellow-50 border-amber-300"}`,children:[i.jsx("div",{className:"flex justify-between items-start",children:i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"font-semibold text-slate-900",children:_.rawName}),_.isMatched&&_.leagueEligible&&i.jsxs("span",{className:"text-xs bg-blue-600 text-white px-2 py-1 rounded font-semibold",children:["✓ Existing Team - Will Update Stats",_.emailMatch?" (email match)":""]}),_.isPotentialDuplicate&&_.leagueEligible&&i.jsx("span",{className:"text-xs bg-orange-600 text-white px-2 py-1 rounded font-semibold",children:"⚠️ Potential Duplicate - Review Required"}),!_.leagueEligible&&i.jsx("span",{className:"text-xs bg-amber-200 text-amber-900 px-2 py-1 rounded font-semibold",children:"Online Only - Not Counted in League"})]}),i.jsxs("div",{className:"text-sm text-slate-600",children:["Place: ",_.place," • +",_.totalPoints||1,"pts",_.podiumFinish&&i.jsxs("span",{className:"ml-2 text-amber-600 font-semibold",children:["(",_.podiumFinish," place finish)"]})]}),_.email&&i.jsxs("div",{className:"text-xs text-slate-500",children:["Email: ",_.email]}),_.isPotentialDuplicate&&_.similarTeam&&i.jsxs("div",{className:"mt-2 p-3 bg-orange-100 border border-orange-300 rounded-lg",children:[i.jsx("div",{className:"text-sm font-semibold text-orange-900 mb-1",children:"⚠️ This looks very similar to existing team:"}),i.jsxs("div",{className:"text-sm text-orange-800 font-semibold",children:['"',_.similarTeam.team_name,'" (',Math.round(_.similarityScore*100),"% match)"]}),i.jsxs("div",{className:"text-xs text-orange-700 mt-2",children:["Choose below: ",i.jsx("strong",{children:"Match to same team"})," (updates existing) or ",i.jsx("strong",{children:"Create new team"})," (separate entry)"]})]})]})}),_.leagueEligible&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Action"}),i.jsxs(Xt,{value:((S=s[N])==null?void 0:S.action)||"create",onValueChange:A=>{const F=[...s];F[N]={action:A,teamId:null},a(F)},children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"create",children:"Create New Team"}),i.jsx(Ie,{value:"match",children:"Match to Existing Team"})]})]})]}),_.leagueEligible&&((C=s[N])==null?void 0:C.action)==="match"&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Select Team"}),i.jsxs(Xt,{value:((P=s[N])==null?void 0:P.teamId)||"",onValueChange:A=>{const F=[...s];F[N]={...F[N],teamId:A},a(F)},children:[i.jsx(Ht,{children:i.jsx(Zt,{placeholder:"Choose a team..."})}),i.jsxs(Kt,{children:[j.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-slate-500",children:"Suggested"}),j.map(A=>
710i.jsxs(Ie,{value:A.team.id,children:[A.team.team_name," (",Math.round(A.similarity*100),"% match)"]},A.team.id)),i.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-slate-500 border-t",children:"All Teams"})]}),d.map(A=>i.jsx(Ie,{value:A.id,children:A.team_name},A.id))]})]})]}),_.leagueEligible&&i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(qh,{id:`remember-${N}`,checked:o[N],onCheckedChange:A=>{const F=[...o];F[N]=A,l(F)}}),i.jsx(me,{htmlFor:`remember-${N}`,className:"text-sm",children:"Remember this mapping for future imports"})]}),!_.leagueEligible&&i.jsx("div",{className:"text-sm text-amber-800 bg-amber-100 p-2 rounded",children:"This online-only player will be visible in the import preview but will not affect league standings or create a team record."})]},N)}),i.jsxs(ue,{onClick:y,disabled:c,className:"w-full bg-green-600 hover:bg-green-700",children:[i.jsx(Hy,{className:"w-4 h-4 mr-2"}),c?"Applying...":"Apply Results & Update League"]})]})]})}const Qo=O.forwardRef(({className:e,...t},n)=>i.jsx("div",{className:"relative w-full overflow-auto",children:i.jsx("table",{ref:n,className:Nt("w-full caption-bottom text-sm",e),...t})}));Qo.displayName="Table";const Yo=O.forwardRef(({className:e,...t},n)=>i.jsx("thead",{ref:n,className:Nt("[&_tr]:border-b",e),...t}));Yo.displayName="TableHeader";const Xo=O.forwardRef(({className:e,...t},n)=>i.jsx("tbody",{ref:n,className:Nt("[&_tr:last-child]:border-0",e),...t}));Xo.displayName="TableBody";const Ohe=O.forwardRef(({className:e,...t},n)=>i.jsx("tfoot",{ref:n,className:Nt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Ohe.displayName="TableFooter";const tr=O.forwardRef(({className:e,...t},n)=>i.jsx("tr",{ref:n,className:Nt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));tr.displayName="TableRow";const ht=O.forwardRef(({className:e,...t},n)=>i.jsx("th",{ref:n,className:Nt("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));ht.displayName="TableHead";const it=O.forwardRef(({className:e,...t},n)=>i.jsx("td",{ref:n,className:Nt("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));it.displayName="TableCell";const The=O.forwardRef(({className:e,...t},n)=>i.jsx("caption",{ref:n,className:Nt("mt-4 text-sm text-muted-foreground",e),...t}));The.displayName="TableCaption";function Rhe({team:e,open:t,onClose:n,onPhotoUpdated:r}){const[s,a]=O.useState(!1),[o,l]=O.useState(null),c=d=>{const m=d.target.files[0];m&&m.type.startsWith("image/")&&l(m)},u=async()=>{if(o){a(!0);try{const{file_url:d}=await ae.integrations.Core.UploadFile({file:o});await ae.entities.Team.update(e.id,{team_photo_url:d}),r(),l(null),n()}catch(d){console.error("Failed to upload photo:",d)}a(!1)}},h=async()=>{if(confirm("Remove this team's photo?")){a(!0);try{await ae.entities.Team.update(e.id,{team_photo_url:null}),r(),n()}catch(d){console.error("Failed to remove photo:",d)}a(!1)}};return e?i.jsx(rn,{open:t,onOpenChange:n,children:i.jsxs(en,{children:[i.jsx(vn,{children:i.jsxs(sn,{className:"flex items-center gap-2",children:[i.jsx(Md,{className:"w-5 h-5"}),"Team Photo - ",e.team_name]})}),i.jsxs("div",{className:"space-y-4 py-4",children:[e.team_photo_url&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Current Photo"}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("img",{src:e.team_photo_url,alt:e.team_name,className:"w-24 h-24 rounded-full object-cover border-2 border-slate-200"}),i.jsxs(ue,{variant:"destructive",size:"sm",onClick:h,disabled:s,children:[i.jsx(ci,{className:"w-4 h-4 mr-2"}),"Remove Photo"]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"photo-upload",children:e.team_photo_url?"Upload New Photo":"Upload Photo"}),i.jsx(Ee,{id:"photo-upload",type:"file",accept:"image/*",onChange:c,disabled:s})]})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:n,disabled:s,children:"Cancel"}),i.jsxs(ue,{onClick:u,disabled:!o||s,children:[i.jsx(ma,{className:"w-4 h-4 mr-2"}),s?"Uploading...":"Upload Photo"]})]})]})}):null}const Mhe=e=>{const t=e||0;return t<=3?-1*t:-3-2*(t-3)},Ihe=(e,t,n,r)=>{const s=t||0,a=n||0,o=r||0,c=(e||0)+4*s+3*a+2*o,u=Mhe(s);return{basePoints:c,handicap:u,totalPoints:c}};function Dhe({open:e,onClose:t,teams:n,onMerged:r}){const[s,a]=O.useState(!1),[o,l]=O.useState(null),c=O.useMemo(()=>{const h={};for(const d of n){const m=(d.team_email||"").trim().toLowerCase();m&&(h[m]||(h[m]=[]),h[m].push(d))}return Object.entries(h).filter(([,d])=>d.length>1).map(([d,m])=>({email:d,group:m}))},[n]),u=async()=>{a(!0),l(null);let h=0;try{for(const{group:d}of c){const m=[...d].sort((P,A)=>(A.appearances||0)!==(P.appearances||0)?(A.appearances||0)-(P.appearances||0):(P.team_name||"").localeCompare(A.team_name||"")),g=m[0],w=m.slice(1);let v=g.appearances||0,b=g.finishes_1st||0,y=g.finishes_2nd||0,_=g.finishes_3rd||0;for(const P of w)v+=P.appearances||0,b+=P.finishes_1st||0,y+=P.finishes_2nd||0,_+=P.finishes_3rd||0;const{basePoints:N,handicap:j,totalPoints:S}=Ihe(v,b,y,_),C=[g,...w].map(P=>
710P.last_attendance_date).filter(Boolean).sort().reverse();await ae.entities.Team.update(g.id,{appearances:v,finishes_1st:b,finishes_2nd:y,finishes_3rd:_,base_points:N,handicap:j,total_points:S,last_attendance_date:C[0]||g.last_attendance_date});for(const P of w){const F=(await ae.entities.NameMapping.list()).filter(I=>I.mapped_team_id===P.id);for(const I of F)await ae.entities.NameMapping.update(I.id,{mapped_team_id:g.id,mapped_team_name:g.team_name});await ae.entities.Team.delete(P.id),h++}}l({type:"success",message:`Merged ${h} duplicate team(s) successfully.`}),r()}catch(d){l({type:"error",message:`Merge failed: ${d.message}`})}a(!1)};return i.jsx(rn,{open:e,onOpenChange:h=>{!h&&!s&&(l(null),t())},children:i.jsxs(en,{className:"max-w-lg",children:[i.jsx(vn,{children:i.jsxs(sn,{className:"flex items-center gap-2",children:[i.jsx(B0,{className:"w-5 h-5 text-orange-600"}),"Merge Duplicate Teams by Email"]})}),i.jsxs("div",{className:"space-y-4 py-2",children:[c.length===0?i.jsxs(vr,{className:"bg-green-50 border-green-200",children:[i.jsx(Cn,{className:"h-4 w-4 text-green-600"}),i.jsx(xr,{className:"text-green-900",children:"No duplicate teams found sharing the same email address. Your database looks clean!"})]}):i.jsxs(i.Fragment,{children:[i.jsxs(vr,{className:"bg-orange-50 border-orange-200",children:[i.jsx(Sn,{className:"h-4 w-4 text-orange-600"}),i.jsxs(xr,{className:"text-orange-900",children:["Found ",i.jsx("strong",{children:c.length})," email(s) with duplicate teams. Stats will be combined and the team with most appearances is kept. NameMappings will be updated automatically."]})]}),i.jsx("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:c.map(({email:h,group:d})=>{const m=[...d].sort((v,b)=>(b.appearances||0)-(v.appearances||0)),g=m[0],w=m.slice(1);return i.jsxs("div",{className:"border border-orange-200 rounded-lg p-3 bg-white text-sm",children:[i.jsxs("div",{className:"text-xs text-slate-500 mb-1",children:["Email: ",i.jsx("strong",{children:h})]}),i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsxs("span",{className:"bg-green-100 text-green-800 px-2 py-0.5 rounded font-semibold",children:["✓ Keep: ",g.team_name]}),w.map(v=>i.jsx("span",{className:"bg-red-100 text-red-800 px-2 py-0.5 rounded line-through",children:v.team_name},v.id))]})]},h)})})]}),o&&i.jsxs(vr,{className:o.type==="error"?"bg-red-50 border-red-300":"bg-green-50 border-green-300",children:[o.type==="error"?i.jsx(Sn,{className:"h-4 w-4 text-red-600"}):i.jsx(Cn,{className:"h-4 w-4 text-green-600"}),i.jsx(xr,{className:o.type==="error"?"text-red-900":"text-green-900",children:o.message})]})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:()=>{l(null),t()},disabled:s,children:(o==null?void 0:o.type)==="success"?"Close":"Cancel"}),c.length>0&&!(o!=null&&o.type)==="success"&&i.jsx(ue,{onClick:u,disabled:s||c.length===0,className:"bg-orange-600 hover:bg-orange-700",children:s?i.jsxs(i.Fragment,{children:[i.jsx(dr,{className:"w-4 h-4 mr-2 animate-spin"}),"Merging..."]}):i.jsxs(i.Fragment,{children:[i.jsx(B0,{className:"w-4 h-4 mr-2"}),"Merge ",c.reduce((h,d)=>h+d.group.length-1,0)," Duplicate(s)"]})})]})]})})}const rN=O.createContext(null);function nb(e){const t=O.useRef(null);return t.current===null&&(t.current=e()),t.current}const iN=O.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Lhe extends O.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Fhe({children:e,isPresent:t}){const n=O.useId(),r=O.useRef(null),s=O.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=O.useContext(iN);return O.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=s.current;if(t||!r.current||!o||!l)return;r.current.dataset.motionPopId=n;const h=document.createElement("style");return a&&(h.nonce=a),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
711          [data-motion-pop-id="${n}"] {
712            position: absolute !important;
713            width: ${o}px !important;
714            height: ${l}px !important;
715            top: ${c}px !important;
716            left: ${u}px !important;
717          }
718        `),()=>{document.head.removeChild(h)}},[t]),i.jsx(Lhe,{isPresent:t,childRef:r,sizeRef:s,children:O.cloneElement(e,{ref:r})})}const $he=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:o})=>{const l=nb(qhe),c=O.useId(),u=O.useCallback(d=>{l.set(d,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),h=O.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:d=>(l.set(d,!1),()=>l.delete(d))}),a?[Math.random(),u]:[n,u]);return O.useMemo(()=>{l.forEach((d,m)=>l.set(m,!1))},[n]),O.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=i.jsx(Fhe,{isPresent:n,children:e})),i.jsx(rN.Provider,{value:h,children:e})};function qhe(){return new Map}const O4=O.createContext({}),ga=e=>e;let fV=ga;function T4(e){let t;return()=>(t===void 0&&(t=e()),t)}
vendor: 9,646 bytes, line 718
718const wg=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Qc=e=>e*1e3,Yc=e=>e/1e3,u1=e=>e.key||"";function G3(e){const t=[];return O.Children.forEach(e,n=>{O.isValidElement(n)&&t.push(n)}),t}const R4=typeof window<"u",M4=R4?O.useLayoutEffect:O.useEffect,Gs=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:s,presenceAffectsLayout:a=!0,mode:o="sync"})=>{const l=O.useMemo(()=>G3(e),[e]),c=l.map(u1),u=O.useRef(!0),h=O.useRef(l),d=nb(()=>new Map),[m,g]=O.useState(l),[w,v]=O.useState(l);M4(()=>{u.current=!1,h.current=l;for(let _=0;_<w.length;_++){const N=u1(w[_]);c.includes(N)?d.delete(N):d.get(N)!==!0&&d.set(N,!1)}},[w,c.length,c.join("-")]);const b=[];if(l!==m){let _=[...l];for(let N=0;N<w.length;N++){const j=w[N],S=u1(j);c.includes(S)||(_.splice(N,0,j),b.push(j))}o==="wait"&&b.length&&(_=b),v(G3(_)),g(l);return}const{forceRender:y}=O.useContext(O4);return i.jsx(i.Fragment,{children:w.map(_=>{const N=u1(_),j=l===w||c.includes(N),S=()=>{if(d.has(N))d.set(N,!0);else return;let C=!0;d.forEach(P=>{P||(C=!1)}),C&&(y==null||y(),v(h.current),s&&s())};return i.jsx($he,{isPresent:j,initial:!u.current||r?void 0:!1,custom:j?void 0:n,presenceAffectsLayout:a,mode:o,onExitComplete:j?void 0:S,children:_},N)})})},zhe={useManualTiming:!1};function Bhe(e){let t=new Set,n=new Set,r=!1,s=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){a.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,h=!1,d=!1)=>{const g=d&&r?t:n;return h&&a.add(u),g.has(u)||g.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(o=u,r){s=!0;return}r=!0,[t,n]=[n,t],t.forEach(l),t.clear(),r=!1,s&&(s=!1,c.process(u))}};return c}const d1=["read","resolveKeyframes","update","preRender","render","postRender"],Uhe=40;function hV(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=d1.reduce((y,_)=>(y[_]=Bhe(a),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:h,render:d,postRender:m}=o,g=()=>{const y=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(y-s.timestamp,Uhe),1),s.timestamp=y,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},w=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:d1.reduce((y,_)=>{const N=o[_];return y[_]=(j,S=!1,C=!1)=>(n||w(),N.schedule(j,S,C)),y},{}),cancel:y=>{for(let _=0;_<d1.length;_++)o[d1[_]].cancel(y)},state:s,steps:o}}const{schedule:rr,cancel:iu,state:Fi,steps:IS}=hV(typeof requestAnimationFrame<"u"?requestAnimationFrame:ga,!0),mV=O.createContext({strict:!1}),Q3={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},jg={};for(const e in Q3)jg[e]={isEnabled:t=>Q3[e].some(n=>!!t[n])};function Vhe(e){for(const t in e)jg[t]={...jg[t],...e[t]}}const Whe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function pj(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Whe.has(e)}let pV=e=>!pj(e);function Hhe(e){e&&(pV=t=>t.startsWith("on")?!pj(t):e(t))}try{Hhe(require("@emotion/is-prop-valid").default)}catch{}function Khe(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(pV(s)||n===!0&&pj(s)||!t&&!pj(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function Ghe(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const sN=O.createContext({});function Y0(e){return typeof e=="string"||Array.isArray(e)}function aN(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const I4=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],D4=["initial",...I4];function oN(e){return aN(e.animate)||D4.some(t=>Y0(e[t]))}function gV(e){return!!(oN(e)||e.variants)}function Qhe(e,t){if(oN(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Y0(n)?n:void 0,animate:Y0(r)?r:void 0}}return e.inherit!==!1?t:{}}function Yhe(e){const{initial:t,animate:n}=Qhe(e,O.useContext(sN));return O.useMemo(()=>({initial:t,animate:n}),[Y3(t),Y3(n)])}function Y3(e){return Array.isArray(e)?e.join(" "):e}const Xhe=Symbol.for("motionComponentSymbol");function Bp(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Zhe(e,t,n){return O.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Bp(n)&&(n.current=r))},[t])}const L4=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Jhe="framerAppearId",vV="data-"+L4(Jhe),{schedule:F4}=hV(queueMicrotask,!1),xV=O.createContext({});function eme(e,t,n,r,s){var a,o;const{visualElement:l}=O.useContext(sN),c=O.useContext(mV),u=O.useContext(rN),h=O.useContext(iN).reducedMotion,d=O.useRef(null);r=r||c.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h}));const m=d.current,g=O.useContext(xV);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&tme(d.current,n,s,g);const w=O.useRef(!1);O.useInsertionEffect(()=>{m&&w.current&&m.update(n,u)});const v=n[vV],b=O.useRef(!!v&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,v))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,v)));return M4(()=>{m&&(w.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),F4.render(m.render),b.current&&m.animationState&&m.animationState.animateChanges())}),O.useEffect(()=>{m&&(!b.current&&m.animationState&&m.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,v)}),b.current=!1))}),m}function tme(e,t,n,r){const{layoutId:s,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:yV(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&Bp(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function yV(e){if(e)return e.options.allowProjection!==!1?e.projection:yV(e.parent)}function nme({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var a,o;e&&Vhe(e);function l(u,h){let d;const m={...O.useContext(iN),...u,layoutId:rme(u)},{isStatic:g}=m,w=Yhe(u),v=r(u,g);if(!g&&R4){ime();const b=sme(m);d=b.MeasureLayout,w.visualElement=eme(s,v,m,t,b.ProjectionNode)}return i.jsxs(sN.Provider,{value:w,children:[d&&w.visualElement?i.jsx(d,{visualElement:w.visualElement,...m}):null,n(s,u,Zhe(v,w.visualElement,h),v,g,w.visualElement)]})}l.displayName=`motion.${typeof s=="string"?s:`create(${(o=(a=s.displayName)!==null&&a!==void 0?a:s.name)!==null&&o!==void 0?o:""})`}`;const c=O.forwardRef(l);return c[Xhe]=s,c}function rme({layoutId:e}){const t=O.useContext(O4).id;return t&&e!==void 0?t+"-"+e:e}function ime(e,t){O.useContext(mV).strict}function sme(e){const{drag:t,layout:n}=jg;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const ame=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function $4(e){return typeof e!="string"||e.includes("-")?!1:!!(ame.indexOf(e)>-1||/[A-Z]/u.test(e))}function bV(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const a in n)e.style.setProperty(a,n[a])}const wV=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function jV(e,t,n,r){bV(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(wV.has(s)?s:L4(s),t.attrs[s])}const ts=e=>!!(e&&e.getVelocity),gj={};function ome(e){Object.assign(gj,e)}const rb=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Jh=new Set(rb);function _V(e,{layout:t,layoutId:n}){return Jh.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!gj[e]||e==="opacity")}function q4(e,t,n){var r;const{style:s}=e,a={};for(const o in s)(ts(s[o])||t.style&&ts(t.style[o])||_V(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[o]=s[o]);return a}function NV(e,t,n){const r=q4(e,t,n);for(const s in e)if(ts(e[s])||ts(t[s])){const a=rb.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}function X3(e){const t=[{},{}];
vendor: 4,325 bytes, line 718
718return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function z4(e,t,n,r){if(typeof t=="function"){const[s,a]=X3(r);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=X3(r);t=t(n!==void 0?n:e.custom,s,a)}return t}const QA=e=>Array.isArray(e),lme=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),cme=e=>QA(e)?e[e.length-1]||0:e;function H1(e){const t=ts(e)?e.get():e;return lme(t)?t.toValue():t}function ume({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,s,a){const o={latestValues:dme(r,s,a,e),renderState:t()};return n&&(o.mount=l=>n(r,l,o)),o}const SV=e=>(t,n)=>{const r=O.useContext(sN),s=O.useContext(rN),a=()=>ume(e,t,r,s);return n?a():nb(a)};function dme(e,t,n,r){const s={},a=r(e,{});for(const m in a)s[m]=H1(a[m]);let{initial:o,animate:l}=e;const c=oN(e),u=gV(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let h=n?n.initial===!1:!1;h=h||o===!1;const d=h?l:o;if(d&&typeof d!="boolean"&&!aN(d)){const m=Array.isArray(d)?d:[d];for(let g=0;g<m.length;g++){const w=z4(e,m[g]);if(w){const{transitionEnd:v,transition:b,...y}=w;for(const _ in y){let N=y[_];if(Array.isArray(N)){const j=h?N.length-1:0;N=N[j]}N!==null&&(s[_]=N)}for(const _ in v)s[_]=v[_]}}}return s}const B4=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),kV=()=>({...B4(),attrs:{}}),EV=(e,t)=>t&&typeof e=="number"?t.transform(e):e,su=(e,t,n)=>n>t?t:n<e?e:n,dv={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},X0={...dv,transform:e=>su(0,1,e)},f1={...dv,default:1},ib=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),od=ib("deg"),ql=ib("%"),Lt=ib("px"),fme=ib("vh"),hme=ib("vw"),Z3={...ql,parse:e=>ql.parse(e)/100,transform:e=>ql.transform(e*100)},mme={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,backgroundPositionX:Lt,backgroundPositionY:Lt},pme={rotate:od,rotateX:od,rotateY:od,rotateZ:od,scale:f1,scaleX:f1,scaleY:f1,scaleZ:f1,skew:od,skewX:od,skewY:od,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:X0,originX:Z3,originY:Z3,originZ:Lt},J3={...dv,transform:Math.round},U4={...mme,...pme,zIndex:J3,size:Lt,fillOpacity:X0,strokeOpacity:X0,numOctaves:J3},gme={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vme=rb.length;function xme(e,t,n){let r="",s=!0;for(let a=0;a<vme;a++){const o=rb[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=EV(l,U4[o]);if(!c){s=!1;const h=gme[o]||o;r+=`${h}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}const PV=e=>t=>typeof t=="string"&&t.startsWith(e),CV=PV("--"),yme=PV("var(--"),V4=e=>yme(e)?bme.test(e.split("/*")[0].trim()):!1,bme=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function W4(e,t,n){const{style:r,vars:s,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(Jh.has(c)){o=!0;continue}else if(CV(c)){s[c]=u;continue}else{const h=EV(u,U4[c]);c.startsWith("origin")?(l=!0,a[c]=h):r[c]=h}}if(t.transform||(o||n?r.transform=xme(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:h=0}=a;r.transformOrigin=`${c} ${u} ${h}`}}function eI(e,t,n){return typeof e=="string"?e:Lt.transform(t+n*e)}function wme(e,t,n){const r=eI(t,e.x,e.width),s=eI(n,e.y,e.height);return`${r} ${s}`}const jme={offset:"stroke-dashoffset",array:"stroke-dasharray"},_me={offset:"strokeDashoffset",array:"strokeDasharray"};function Nme(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?jme:_me;e[a.offset]=Lt.transform(-r);const o=Lt.transform(t),l=Lt.transform(n);e[a.array]=`${o} ${l}`}function H4(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:a,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...u}
vendor: 12,802 bytes, line 718
718,h,d){if(W4(e,u,d),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:g,dimensions:w}=e;m.transform&&(w&&(g.transform=m.transform),delete m.transform),w&&(s!==void 0||a!==void 0||g.transform)&&(g.transformOrigin=wme(w,s!==void 0?s:.5,a!==void 0?a:.5)),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),o!==void 0&&Nme(m,o,l,c,!1)}const K4=e=>typeof e=="string"&&e.toLowerCase()==="svg",Sme={useVisualState:SV({scrapeMotionValuesFromProps:NV,createRenderState:kV,onMount:(e,t,{renderState:n,latestValues:r})=>{rr.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),rr.render(()=>{H4(n,r,K4(t.tagName),e.transformTemplate),jV(t,n)})}})},kme={useVisualState:SV({scrapeMotionValuesFromProps:q4,createRenderState:B4})};function AV(e,t,n){for(const r in t)!ts(t[r])&&!_V(r,n)&&(e[r]=t[r])}function Eme({transformTemplate:e},t){return O.useMemo(()=>{const n=B4();return W4(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Pme(e,t){const n=e.style||{},r={};return AV(r,n,e),Object.assign(r,Eme(e,t)),r}function Cme(e,t){const n={},r=Pme(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function Ame(e,t,n,r){const s=O.useMemo(()=>{const a=kV();return H4(a,t,K4(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};AV(a,e.style,e),s.style={...a,...s.style}}return s}function Ome(e=!1){return(n,r,s,{latestValues:a},o)=>{const c=($4(n)?Ame:Cme)(r,a,o,n),u=Khe(r,typeof n=="string",e),h=n!==O.Fragment?{...u,...c,ref:s}:{},{children:d}=r,m=O.useMemo(()=>ts(d)?d.get():d,[d]);return O.createElement(n,{...h,children:m})}}function Tme(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...$4(r)?Sme:kme,preloadedFeatures:e,useRender:Ome(s),createVisualElement:t,Component:r};return nme(o)}}function OV(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function lN(e,t,n){const r=e.getProps();return z4(r,t,n!==void 0?n:r.custom,e)}const Rme=T4(()=>window.ScrollTimeline!==void 0);class Mme{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(Rme()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,a)=>{s&&s(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Ime extends Mme{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function G4(e,t){return e?e[t]||e.default||e:void 0}const YA=2e4;function TV(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<YA;)t+=n,r=e.next(t);return t>=YA?1/0:t}function Q4(e){return typeof e=="function"}function tI(e,t){e.timeline=t,e.onfinish=null}const Y4=e=>Array.isArray(e)&&typeof e[0]=="number",Dme={linearEasing:void 0};function Lme(e,t){const n=T4(e);return()=>{var r;return(r=Dme[t])!==null&&r!==void 0?r:n()}}const vj=Lme(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),RV=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)r+=e(wg(0,s-1,a))+", ";return`linear(${r.substring(0,r.length-2)})`};function MV(e){return!!(typeof e=="function"&&vj()||!e||typeof e=="string"&&(e in XA||vj())||Y4(e)||Array.isArray(e)&&e.every(MV))}const v0=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,XA={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:v0([0,.65,.55,1]),circOut:v0([.55,0,1,.45]),backIn:v0([.31,.01,.66,-.59]),backOut:v0([.33,1.53,.69,.99])};function IV(e,t){if(e)return typeof e=="function"&&vj()?RV(e,t):Y4(e)?v0(e):Array.isArray(e)?e.map(n=>IV(n,t)||XA.easeOut):XA[e]}const Mo={x:!1,y:!1};function DV(){return Mo.x||Mo.y}function Fme(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let s=document;const a=(r=void 0)!==null&&r!==void 0?r:s.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function LV(e,t){const n=Fme(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function nI(e){return t=>{t.pointerType==="touch"||DV()||e(t)}}function $me(e,t,n={}){const[r,s,a]=LV(e,n),o=nI(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const h=nI(d=>{u(d),c.removeEventListener("pointerleave",h)});c.addEventListener("pointerleave",h,s)});return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),a}const FV=(e,t)=>t?e===t?!0:FV(e,t.parentElement):!1,X4=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,qme=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zme(e){return qme.has(e.tagName)||e.tabIndex!==-1}const x0=new WeakSet;function rI(e){return t=>{t.key==="Enter"&&e(t)}}function DS(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Bme=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=rI(()=>{if(x0.has(n))return;DS(n,"down");const s=rI(()=>{DS(n,"up")}),a=()=>DS(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function iI(e){return X4(e)&&!DV()}function Ume(e,t,n={}){const[r,s,a]=LV(e,n),o=l=>{const c=l.currentTarget;if(!iI(l)||x0.has(c))return;x0.add(c);const u=t(l),h=(g,w)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",m),!(!iI(g)||!x0.has(c))&&(x0.delete(c),typeof u=="function"&&u(g,{success:w}))},d=g=>{h(g,n.useGlobalTarget||FV(c,g.target))},m=g=>{h(g,!1)};window.addEventListener("pointerup",d,s),window.addEventListener("pointercancel",m,s)};return r.forEach(l=>{!zme(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),l.addEventListener("focus",u=>Bme(u,s),s)}),a}function Vme(e){return e==="x"||e==="y"?Mo[e]?null:(Mo[e]=!0,()=>{Mo[e]=!1}):Mo.x||Mo.y?null:(Mo.x=Mo.y=!0,()=>{Mo.x=Mo.y=!1})}let K1;function Wme(){K1=void 0}const zl={now:()=>(K1===void 0&&zl.set(Fi.isProcessing||zhe.useManualTiming?Fi.timestamp:performance.now()),K1),set:e=>{K1=e,queueMicrotask(Wme)}};function Z4(e,t){e.indexOf(t)===-1&&e.push(t)}function J4(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class eR{constructor(){this.subscriptions=[]}add(t){return Z4(this.subscriptions,t),()=>J4(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let a=0;a<s;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function $V(e,t){return t?e*(1e3/t):0}const sI=30,Hme=e=>!isNaN(parseFloat(e)),k0={current:void 0};class Kme{constructor(t,n={}){this.version="11.16.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const a=zl.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=zl.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Hme(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new eR);const r=this.events[t].add(n);return t==="change"?()=>{r(),rr.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return k0.current&&k0.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=zl.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>sI)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,sI);return $V(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _g(e,t){return new Kme(e,t)}function Gme(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_g(n))}function Qme(e,t){const n=lN(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const o in a){const l=cme(a[o]);Gme(e,o,l)}}function Yme(e){return!!(ts(e)&&e.add)}function ZA(e,t){const n=e.getValue("willChange");if(Yme(n))return n.add(t)}function qV(e){return e.props[vV]}const zV=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Xme=1e-7,Zme=12;function Jme(e,t,n,r,s){let a,o,l=0;do o=t+(n-t)/2,a=zV(o,r,s)-e,a>0?n=o:t=o;while(Math.abs(a)>Xme&&++l<Zme);return o}function sb(e,t,n,r){if(e===t&&n===r)return ga;const s=a=>Jme(a,0,1,e,n);return a=>a===0||a===1?a:zV(s(a),t,r)}const BV=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,UV=e=>t=>1-e(1-t),VV=sb(.33,1.53,.69,.99),tR=UV(VV),WV=BV(tR),HV=e=>(e*=2)<1?.5*tR(e):.5*(2-Math.pow(2,-10*(e-1))),nR=e=>1-Math.sin(Math.acos(e)),KV=UV(nR),GV=BV(nR),QV=e=>/^0[^.\s]+$/u.test(e);function epe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||QV(e):!0}const YV=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),tpe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function npe(e){const t=tpe.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function XV(e,t,n=1){const[r,s]=npe(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return YV(o)?parseFloat(o):o}return V4(s)?XV(s,t,n+1):s}const rpe=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),aI=e=>e===dv||e===Lt,oI=(e,t)=>parseFloat(e.split(", ")[t]),lI=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return oI(s[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?oI(a[1],e):0}},ipe=new Set(["x","y","z"]),spe=rb.filter(e=>!ipe.has(e));function ape(e){const t=[];return spe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ng={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:lI(4,13),y:lI(5,14)};Ng.translateX=Ng.x;Ng.translateY=Ng.y;const ZV=e=>t=>t.test(e),ope={test:e=>e==="auto",parse:e=>e},JV=[dv,Lt,ql,od,hme,fme,ope],cI=e=>JV.find(ZV(e)),Sh=new Set;let JA=!1,eO=!1;function eW(){if(eO){const e=Array.from(Sh).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=ape(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);
vendor: 4,966 bytes, line 718
718s&&s.forEach(([a,o])=>{var l;(l=r.getValue(a))===null||l===void 0||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}eO=!1,JA=!1,Sh.forEach(e=>e.complete()),Sh.clear()}function tW(){Sh.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(eO=!0)})}function lpe(){tW(),eW()}class rR{constructor(t,n,r,s,a,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Sh.add(this),JA||(JA=!0,rr.read(tW),rr.resolveKeyframes(eW))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const o=s==null?void 0:s.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),s&&o===void 0&&s.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Sh.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Sh.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const E0=e=>Math.round(e*1e5)/1e5,iR=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function cpe(e){return e==null}const upe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,sR=(e,t)=>n=>!!(typeof n=="string"&&upe.test(n)&&n.startsWith(e)||t&&!cpe(n)&&Object.prototype.hasOwnProperty.call(n,t)),nW=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(iR);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},dpe=e=>su(0,255,e),LS={...dv,transform:e=>Math.round(dpe(e))},ch={test:sR("rgb","red"),parse:nW("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+LS.transform(e)+", "+LS.transform(t)+", "+LS.transform(n)+", "+E0(X0.transform(r))+")"};function fpe(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const tO={test:sR("#"),parse:fpe,transform:ch.transform},Up={test:sR("hsl","hue"),parse:nW("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ql.transform(E0(t))+", "+ql.transform(E0(n))+", "+E0(X0.transform(r))+")"},Yi={test:e=>ch.test(e)||tO.test(e)||Up.test(e),parse:e=>ch.test(e)?ch.parse(e):Up.test(e)?Up.parse(e):tO.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ch.transform(e):Up.transform(e)},hpe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function mpe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(iR))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(hpe))===null||n===void 0?void 0:n.length)||0)>0}const rW="number",iW="color",ppe="var",gpe="var(",uI="${}",vpe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Z0(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(vpe,c=>(Yi.test(c)?(r.color.push(a),s.push(iW),n.push(Yi.parse(c))):c.startsWith(gpe)?(r.var.push(a),s.push(ppe),n.push(c)):(r.number.push(a),s.push(rW),n.push(parseFloat(c))),++a,uI)).split(uI);return{values:n,split:l,indexes:r,types:s}}function sW(e){return Z0(e).values}function aW(e){const{split:t,types:n}=Z0(e),r=t.length;return s=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],s[o]!==void 0){const l=n[o];l===rW?a+=E0(s[o]):l===iW?a+=Yi.transform(s[o]):a+=s[o]}return a}}const xpe=e=>typeof e=="number"?0:e;function ype(e){const t=sW(e);return aW(e)(t.map(xpe))}const qd={test:mpe,parse:sW,createTransformer:aW,getAnimatableNone:ype},bpe=new Set(["brightness","contrast","saturate","opacity"]);function wpe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(iR)||[];if(!r)return e;const s=n.replace(r,"");let a=bpe.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const jpe=/\b([a-z-]*)\(.*?\)/gu,nO={...qd,getAnimatableNone:e=>{const t=e.match(jpe);return t?t.map(wpe).join(" "):e}},_pe={...U4,color:Yi,backgroundColor:Yi,outlineColor:Yi,fill:Yi,stroke:Yi,borderColor:Yi,borderTopColor:Yi,borderRightColor:Yi,borderBottomColor:Yi,borderLeftColor:Yi,filter:nO,WebkitFilter:nO},aR=e=>_pe[e];function oW(e,t){let n=aR(e);return n!==nO&&(n=qd),n.getAnimatableNone?n.getAnimatableNone(t):void 0}
vendor: 7,602 bytes, line 718
718const Npe=new Set(["auto","none","0"]);function Spe(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!Npe.has(a)&&Z0(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=oW(n,s)}class lW extends rR{constructor(t,n,r,s,a){super(t,n,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),V4(u))){const h=XV(u,n.current);h!==void 0&&(t[c]=h),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!rpe.has(r)||t.length!==2)return;const[s,a]=t,o=cI(s),l=cI(a);if(o!==l)if(aI(o)&&aI(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)epe(t[s])&&r.push(s);r.length&&Spe(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ng[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const o=s.length-1,l=s[o];s[o]=Ng[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,u])=>{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const dI=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(qd.test(e)||e==="0")&&!e.startsWith("url("));function kpe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Epe(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=dI(s,t),l=dI(a,t);return!o||!l?!1:kpe(e)||(n==="spring"||Q4(n))&&r}const Ppe=e=>e!==null;function cN(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Ppe),a=t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const Cpe=40;class cW{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=zl.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:a,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Cpe?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&lpe(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=zl.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:a,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!Epe(t,r,s,a))if(o)this.options.duration=0;else{c==null||c(cN(t,this.options,n)),l==null||l(),this.resolveFinishedPromise();return}const h=this.initPlayback(t,n);h!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...h},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const br=(e,t,n)=>e+(t-e)*n;function FS(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ape({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,a=0,o=0;if(!t)s=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=FS(c,l,e+1/3),a=FS(c,l,e),o=FS(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function xj(e,t){return n=>n>0?t:e}const $S=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Ope=[tO,ch,Up],Tpe=e=>Ope.find(t=>t.test(e));function fI(e){const t=Tpe(e);if(!t)return!1;let n=t.parse(e);return t===Up&&(n=Ape(n)),n}const hI=(e,t)=>{const n=fI(e),r=fI(t);if(!n||!r)return xj(e,t);const s={...n};return a=>(s.red=$S(n.red,r.red,a),s.green=$S(n.green,r.green,a),s.blue=$S(n.blue,r.blue,a),s.alpha=br(n.alpha,r.alpha,a),ch.transform(s))},Rpe=(e,t)=>n=>t(e(n)),ab=(...e)=>e.reduce(Rpe),rO=new Set(["none","hidden"]);function Mpe(e,t){return rO.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Ipe(e,t){return n=>br(e,t,n)}function oR(e){return typeof e=="number"?Ipe:typeof e=="string"?V4(e)?xj:Yi.test(e)?hI:Fpe:Array.isArray(e)?uW:typeof e=="object"?Yi.test(e)?hI:Dpe:xj}function uW(e,t){const n=[...e],r=n.length,s=e.map((a,o)=>oR(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=s[o](a);return n}}function Dpe(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=oR(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function Lpe(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],l=e.indexes[o][s[o]],c=(n=e.values[l])!==null&&n!==void 0?n:0;r[a]=c,s[o]++}return r}const Fpe=(e,t)=>{const n=qd.createTransformer(t),r=Z0(e),s=Z0(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?rO.has(e)&&!s.values.length||rO.has(t)&&!r.values.length?Mpe(e,t):ab(uW(Lpe(r,s),s.values),n):xj(e,t)};function dW(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?br(e,t,n):oR(e)(e,t)}const $pe=5;function fW(e,t,n){const r=Math.max(t-$pe,0);return $V(n-e(r),t-r)}const Pr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},qS=.001;function qpe({duration:e=Pr.duration,bounce:t=Pr.bounce,velocity:n=Pr.velocity,mass:r=Pr.mass}){let s,a,o=1-t;o=su(Pr.minDamping,Pr.maxDamping,o),e=su(Pr.minDuration,Pr.maxDuration,Yc(e)),o<1?(s=u=>{const h=u*o,d=h*e,m=h-n,g=iO(u,o),w=Math.exp(-d);return qS-m/g*w},a=u=>{const d=u*o*e,m=d*n+n,g=Math.pow(o,2)*Math.pow(u,2)*e,w=Math.exp(-d),v=iO(Math.pow(u,2),o);return(-s(u)+qS>0?-1:1)*((m-g)*w)/v}):(s=u=>{const h=Math.exp(-u*e),d=(u-n)*e+1;return-qS+h*d},a=u=>{const h=Math.exp(-u*e),d=(n-u)*(e*e);return h*d});const l=5/e,c=Bpe(s,a,l);if(e=Qc(e),isNaN(c))return{stiffness:Pr.stiffness,damping:Pr.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const zpe=12;function Bpe(e,t,n){let r=n;for(let s=1;s<zpe;s++)r=r-e(r)/t(r);return r}function iO(e,t){return e*Math.sqrt(1-t*t)}const Upe=["duration","bounce"],Vpe=["stiffness","damping","mass"];function mI(e,t){return t.some(n=>e[n]!==void 0)}function Wpe(e){let t={velocity:Pr.velocity,stiffness:Pr.stiffness,damping:Pr.damping,mass:Pr.mass,isResolvedFromDuration:!1,...e};if(!mI(e,Vpe)&&mI(e,Upe))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*su(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Pr.mass,stiffness:s,damping:a}}else{const n=qpe(e);t={...t,...n,mass:Pr.mass},t.isResolvedFromDuration=!0}return t}function hW(e=Pr.visualDuration,t=Pr.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:h,duration:d,velocity:m,isResolvedFromDuration:g}=Wpe({...n,velocity:-Yc(n.velocity||0)}
vendor: 5,943 bytes, line 718
718),w=m||0,v=u/(2*Math.sqrt(c*h)),b=o-a,y=Yc(Math.sqrt(c/h)),_=Math.abs(b)<5;r||(r=_?Pr.restSpeed.granular:Pr.restSpeed.default),s||(s=_?Pr.restDelta.granular:Pr.restDelta.default);let N;if(v<1){const S=iO(y,v);N=C=>{const P=Math.exp(-v*y*C);return o-P*((w+v*y*b)/S*Math.sin(S*C)+b*Math.cos(S*C))}}else if(v===1)N=S=>o-Math.exp(-y*S)*(b+(w+y*b)*S);else{const S=y*Math.sqrt(v*v-1);N=C=>{const P=Math.exp(-v*y*C),A=Math.min(S*C,300);return o-P*((w+v*y*b)*Math.sinh(A)+S*b*Math.cosh(A))/S}}const j={calculatedDuration:g&&d||null,next:S=>{const C=N(S);if(g)l.done=S>=d;else{let P=0;v<1&&(P=S===0?Qc(w):fW(N,S,C));const A=Math.abs(P)<=r,F=Math.abs(o-C)<=s;l.done=A&&F}return l.value=l.done?o:C,l},toString:()=>{const S=Math.min(TV(j),YA),C=RV(P=>j.next(S*P).value,S,30);return S+"ms "+C}};return j}function pI({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:h}){const d=e[0],m={done:!1,value:d},g=A=>l!==void 0&&A<l||c!==void 0&&A>c,w=A=>l===void 0?c:c===void 0||Math.abs(l-A)<Math.abs(c-A)?l:c;let v=n*t;const b=d+v,y=o===void 0?b:o(b);y!==b&&(v=y-d);const _=A=>-v*Math.exp(-A/r),N=A=>y+_(A),j=A=>{const F=_(A),I=N(A);m.done=Math.abs(F)<=u,m.value=m.done?y:I};let S,C;const P=A=>{g(m.value)&&(S=A,C=hW({keyframes:[m.value,w(m.value)],velocity:fW(N,A,m.value),damping:s,stiffness:a,restDelta:u,restSpeed:h}))};return P(0),{calculatedDuration:null,next:A=>{let F=!1;return!C&&S===void 0&&(F=!0,j(A),P(A)),S!==void 0&&A>=S?C.next(A-S):(!F&&j(A),m)}}}const Hpe=sb(.42,0,1,1),Kpe=sb(0,0,.58,1),mW=sb(.42,0,.58,1),Gpe=e=>Array.isArray(e)&&typeof e[0]!="number",Qpe={linear:ga,easeIn:Hpe,easeInOut:mW,easeOut:Kpe,circIn:nR,circInOut:GV,circOut:KV,backIn:tR,backInOut:WV,backOut:VV,anticipate:HV},gI=e=>{if(Y4(e)){fV(e.length===4);const[t,n,r,s]=e;return sb(t,n,r,s)}else if(typeof e=="string")return Qpe[e];return e};function Ype(e,t,n){const r=[],s=n||dW,a=e.length-1;for(let o=0;o<a;o++){let l=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||ga:t;l=ab(c,l)}r.push(l)}return r}function pW(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(fV(a===t.length),a===1)return()=>t[0];if(a===2&&e[0]===e[1])return()=>t[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=Ype(t,r,s),l=o.length,c=u=>{let h=0;if(l>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const d=wg(e[h],e[h+1],u);return o[h](d)};return n?u=>c(su(e[0],e[a-1],u)):c}function Xpe(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=wg(0,t,r);e.push(br(n,1,s))}}function Zpe(e){const t=[0];return Xpe(t,e.length-1),t}function Jpe(e,t){return e.map(n=>n*t)}function ege(e,t){return e.map(()=>t||mW).splice(0,e.length-1)}function yj({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Gpe(r)?r.map(gI):gI(r),a={done:!1,value:t[0]},o=Jpe(n&&n.length===t.length?n:Zpe(t),e),l=pW(o,t,{ease:Array.isArray(s)?s:ege(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const tge=e=>{const t=({timestamp:n})=>e(n);return{start:()=>rr.update(t,!0),stop:()=>iu(t),now:()=>Fi.isProcessing?Fi.timestamp:zl.now()}},nge={decay:pI,inertia:pI,tween:yj,keyframes:yj,spring:hW},rge=e=>e/100;class lR extends cW{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:s,keyframes:a}=this.options,o=(s==null?void 0:s.KeyframeResolver)||rR,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(a,l,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=this.options,l=Q4(n)?n:nge[n]||yj;let c,u;l!==yj&&typeof t[0]!="number"&&(c=ab(rge,dW(t[0],t[1])),t=[0,100]);const h=l({...this.options,keyframes:t});a==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),h.calculatedDuration===null&&(h.calculatedDuration=TV(h));const{calculatedDuration:d}=h,m=d+s,g=m*(r+1)-s;return{generator:h,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:d,resolvedDuration:m,totalDuration:g}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:s,generator:a,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:h,resolvedDuration:d}=r;if(this.startTime===null)return a.next(0);const{delay:m,repeat:g,repeatType:w,repeatDelay:v,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-h/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-m*(this.speed>=0?1:-1),_=this.speed>=0?y<0:y>h;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=h);let N=this.currentTime,j=a;if(g){const A=Math.min(this.currentTime,h)/d;let F=Math.floor(A),I=A%1;!I&&A>=1&&(I=1),I===1&&F--,F=Math.min(F,g+1),!!(F%2)&&(w==="reverse"?(I=1-I,v&&(I-=v/d)):w==="mirror"&&(j=o)),N=su(0,1,I)*d}const S=_?{done:!1,value:c[0]}:j.next(N);l&&(S.value=l(S.value));let{done:C}=S;!_&&u!==null&&(C=this.speed>=0?this.currentTime>=h:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return P&&s!==void 0&&(S.value=cN(c,this.options,s)),b&&b(S.value),P&&this.finish(),S}get duration(){const{resolved:t}=this;return t?Yc(t.calculatedDuration):0}
vendor: 61,378 bytes, line 718
718get time(){return Yc(this.currentTime)}set time(t){t=Qc(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Yc(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=tge,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const ige=new Set(["opacity","clipPath","filter","transform"]);function sge(e,t,n,{delay:r=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const h=IV(l,s);return Array.isArray(h)&&(u.easing=h),e.animate(u,{delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}const age=T4(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),bj=10,oge=2e4;function lge(e){return Q4(e.type)||e.type==="spring"||!MV(e.ease)}function cge(e,t){const n=new lR({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let a=0;for(;!r.done&&a<oge;)r=n.sample(a),s.push(r.value),a+=bj;return{times:void 0,keyframes:s,duration:a-bj,ease:"linear"}}const gW={anticipate:HV,backInOut:WV,circInOut:GV};function uge(e){return e in gW}class vI extends cW{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:a}=this.options;this.resolver=new lW(a,(o,l)=>this.onKeyframesResolved(o,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:s=300,times:a,ease:o,type:l,motionValue:c,name:u,startTime:h}=this.options;if(!(!((r=c.owner)===null||r===void 0)&&r.current))return!1;if(typeof o=="string"&&vj()&&uge(o)&&(o=gW[o]),lge(this.options)){const{onComplete:m,onUpdate:g,motionValue:w,element:v,...b}=this.options,y=cge(t,b);t=y.keyframes,t.length===1&&(t[1]=t[0]),s=y.duration,a=y.times,o=y.ease,l="keyframes"}const d=sge(c.owner.current,u,t,{...this.options,duration:s,times:a,ease:o});return d.startTime=h??this.calcStartTime(),this.pendingTimeline?(tI(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:m}=this.options;c.set(cN(t,this.options,n)),m&&m(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:s,times:a,type:l,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Yc(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Yc(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Qc(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return ga;const{animation:r}=n;tI(r,t)}return ga}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:a,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:h,onComplete:d,element:m,...g}=this.options,w=new lR({...g,keyframes:r,duration:s,type:a,ease:o,times:l,isGenerator:!0}),v=Qc(this.time);u.setWithVelocity(w.sample(v-bj).value,w.sample(v).value,bj)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:a,damping:o,type:l}=t;return age()&&r&&ige.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!s&&a!=="mirror"&&o!==0&&l!=="inertia"}}const dge={type:"spring",stiffness:500,damping:25,restSpeed:10},fge=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),hge={type:"keyframes",duration:.8},mge={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},pge=(e,{keyframes:t})=>t.length>2?hge:Jh.has(e)?e.startsWith("scale")?fge(t[1]):dge:mge;function gge({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...h}){return!!Object.keys(h).length}const cR=(e,t,n,r={},s,a)=>o=>{const l=G4(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Qc(c);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:s};gge(l)||(h={...h,...pge(e,h)}),h.duration&&(h.duration=Qc(h.duration)),h.repeatDelay&&(h.repeatDelay=Qc(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let d=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(h.duration=0,h.delay===0&&(d=!0)),d&&!a&&t.get()!==void 0){const m=cN(h.keyframes,l);if(m!==void 0)return rr.update(()=>{h.onUpdate(m),h.onComplete()}),new Ime([])}return!a&&vI.supports(h)?new vI(h):new lR(h)};function vge({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function vW(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;r&&(o=r);const u=[],h=s&&e.animationState&&e.animationState.getState()[s];for(const d in c){const m=e.getValue(d,(a=e.latestValues[d])!==null&&a!==void 0?a:null),g=c[d];if(g===void 0||h&&vge(h,d))continue;const w={delay:n,...G4(o||{},d)};let v=!1;if(window.MotionHandoffAnimation){const y=qV(e);if(y){const _=window.MotionHandoffAnimation(y,d,rr);_!==null&&(w.startTime=_,v=!0)}}ZA(e,d),m.start(cR(d,m,g,e.shouldReduceMotion&&Jh.has(d)?{type:!1}:w,e,v));const b=m.animation;b&&u.push(b)}return l&&Promise.all(u).then(()=>{rr.update(()=>{l&&Qme(e,l)})}),u}function sO(e,t,n={}){var r;const s=lN(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(a=n.transitionOverride);const o=s?()=>Promise.all(vW(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:h=0,staggerChildren:d,staggerDirection:m}=a;return xge(e,t,h+u,d,m,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[u,h]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>h())}else return Promise.all([o(),l(n.delay)])}function xge(e,t,n=0,r=0,s=1,a){const o=[],l=(e.variantChildren.size-1)*r,c=s===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(yge).forEach((u,h)=>{u.notify("AnimationStart",t),o.push(sO(u,t,{...a,delay:n+c(h)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function yge(e,t){return e.sortNodePosition(t)}function bge(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>sO(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=sO(e,t,n);else{const s=typeof t=="function"?lN(e,t,n.custom):t;r=Promise.all(vW(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const wge=D4.length;function xW(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?xW(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<wge;n++){const r=D4[n],s=e.props[r];(Y0(s)||s===!1)&&(t[r]=s)}return t}const jge=[...I4].reverse(),_ge=I4.length;function Nge(e){return t=>Promise.all(t.map(({animation:n,options:r})=>bge(e,n,r)))}function Sge(e){let t=Nge(e),n=xI(),r=!0;const s=c=>(u,h)=>{var d;const m=lN(e,h,c==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(m){const{transition:g,transitionEnd:w,...v}=m;u={...u,...v,...w}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,h=xW(e.parent)||{},d=[],m=new Set;let g={},w=1/0;for(let b=0;b<_ge;b++){const y=jge[b],_=n[y],N=u[y]!==void 0?u[y]:h[y],j=Y0(N),S=y===c?_.isActive:null;S===!1&&(w=b);let C=N===h[y]&&N!==u[y]&&j;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),_.protectedKeys={...g},!_.isActive&&S===null||!N&&!_.prevProp||aN(N)||typeof N=="boolean")continue;const P=kge(_.prevProp,N);let A=P||y===c&&_.isActive&&!C&&j||b>w&&j,F=!1;const I=Array.isArray(N)?N:[N];let R=I.reduce(s(y),{});S===!1&&(R={});const{prevResolvedValues:M={}}=_,$={...M,...R},B=Z=>{A=!0,m.has(Z)&&(F=!0,m.delete(Z)),_.needsAnimating[Z]=!0;const X=e.getValue(Z);X&&(X.liveStyle=!1)};for(const Z in $){const X=R[Z],V=M[Z];if(g.hasOwnProperty(Z))continue;let z=!1;QA(X)&&QA(V)?z=!OV(X,V):z=X!==V,z?X!=null?B(Z):m.add(Z):X!==void 0&&m.has(Z)?B(Z):_.protectedKeys[Z]=!0}_.prevProp=N,_.prevResolvedValues=R,_.isActive&&(g={...g,...R}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(C&&P)||F)&&d.push(...I.map(Z=>({animation:Z,options:{type:y}})))}if(m.size){const b={};m.forEach(y=>{const _=e.getBaseTarget(y),N=e.getValue(y);N&&(N.liveStyle=!0),b[y]=_??null}),d.push({animation:b})}let v=!!d.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,v?t(d):Promise.resolve()}function l(c,u){var h;if(n[c].isActive===u)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(m=>{var g;return(g=m.animationState)===null||g===void 0?void 0:g.setActive(c,u)}),n[c].isActive=u;const d=o(c);for(const m in n)n[m].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=xI(),r=!0}}}function kge(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!OV(t,e):!1}function Yf(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xI(){return{animate:Yf(!0),whileInView:Yf(),whileHover:Yf(),whileTap:Yf(),whileDrag:Yf(),whileFocus:Yf(),exit:Yf()}}class Wd{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Ege extends Wd{constructor(t){super(t),t.animationState||(t.animationState=Sge(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();aN(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let Pge=0;class Cge extends Wd{constructor(){super(...arguments),this.id=Pge++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const Age={animation:{Feature:Ege},exit:{Feature:Cge}};function J0(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ob(e){return{point:{x:e.pageX,y:e.pageY}}}const Oge=e=>t=>X4(t)&&e(t,ob(t));function P0(e,t,n,r){return J0(e,t,Oge(n),r)}const yI=(e,t)=>Math.abs(e-t);function Tge(e,t){const n=yI(e.x,t.x),r=yI(e.y,t.y);return Math.sqrt(n**2+r**2)}class yW{constructor(t,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=BS(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=Tge(d.offset,{x:0,y:0})>=3;if(!m&&!g)return;const{point:w}=d,{timestamp:v}=Fi;this.history.push({...w,timestamp:v});const{onStart:b,onMove:y}=this.handlers;m||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=zS(m,this.transformPagePoint),rr.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:g,onSessionEnd:w,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=BS(d.type==="pointercancel"?this.lastMoveEventInfo:zS(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,b),w&&w(d,b)},!X4(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const o=ob(t),l=zS(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Fi;this.history=[{...c,timestamp:u}];const{onSessionStart:h}=n;h&&h(t,BS(l,this.history)),this.removeListeners=ab(P0(this.contextWindow,"pointermove",this.handlePointerMove),P0(this.contextWindow,"pointerup",this.handlePointerUp),P0(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),iu(this.updatePoint)}}function zS(e,t){return t?{point:t(e.point)}:e}function bI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function BS({point:e},t){return{point:e,delta:bI(e,bW(t)),offset:bI(e,Rge(t)),velocity:Mge(t,.1)}}function Rge(e){return e[0]}function bW(e){return e[e.length-1]}function Mge(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=bW(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Qc(t)));)n--;if(!r)return{x:0,y:0};const a=Yc(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const wW=1e-4,Ige=1-wW,Dge=1+wW,jW=.01,Lge=0-jW,Fge=0+jW;function wa(e){return e.max-e.min}function $ge(e,t,n){return Math.abs(e-t)<=n}function wI(e,t,n,r=.5){e.origin=r,e.originPoint=br(t.min,t.max,e.origin),e.scale=wa(n)/wa(t),e.translate=br(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Ige&&e.scale<=Dge||isNaN(e.scale))&&(e.scale=1),(e.translate>=Lge&&e.translate<=Fge||isNaN(e.translate))&&(e.translate=0)}function C0(e,t,n,r){wI(e.x,t.x,n.x,r?r.originX:void 0),wI(e.y,t.y,n.y,r?r.originY:void 0)}function jI(e,t,n){e.min=n.min+t.min,e.max=e.min+wa(t)}function qge(e,t,n){jI(e.x,t.x,n.x),jI(e.y,t.y,n.y)}function _I(e,t,n){e.min=t.min-n.min,e.max=e.min+wa(t)}function A0(e,t,n){_I(e.x,t.x,n.x),_I(e.y,t.y,n.y)}function zge(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?br(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?br(n,e,r.max):Math.min(e,n)),e}function NI(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Bge(e,{top:t,left:n,bottom:r,right:s}){return{x:NI(e.x,n,s),y:NI(e.y,t,r)}}function SI(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Uge(e,t){return{x:SI(e.x,t.x),y:SI(e.y,t.y)}}function Vge(e,t){let n=.5;const r=wa(e),s=wa(t);return s>r?n=wg(t.min,t.max-r,e.min):r>s&&(n=wg(e.min,e.max-s,t.min)),su(0,1,n)}function Wge(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const aO=.35;function Hge(e=aO){return e===!1?e=0:e===!0&&(e=aO),{x:kI(e,"left","right"),y:kI(e,"top","bottom")}}function kI(e,t,n){return{min:EI(e,t),max:EI(e,n)}}function EI(e,t){return typeof e=="number"?e:e[t]||0}const PI=()=>({translate:0,scale:1,origin:0,originPoint:0}),Vp=()=>({x:PI(),y:PI()}),CI=()=>({min:0,max:0}),Ir=()=>({x:CI(),y:CI()});function Ha(e){return[e("x"),e("y")]}function _W({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Kge({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gge(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function US(e){return e===void 0||e===1}function oO({scale:e,scaleX:t,scaleY:n}){return!US(e)||!US(t)||!US(n)}function th(e){return oO(e)||NW(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function NW(e){return AI(e.x)||AI(e.y)}function AI(e){return e&&e!=="0%"}function wj(e,t,n){const r=e-n,s=t*r;return n+s}function OI(e,t,n,r,s){return s!==void 0&&(e=wj(e,s,r)),wj(e,n,r)+t}function lO(e,t=0,n=1,r,s){e.min=OI(e.min,t,n,r,s),e.max=OI(e.max,t,n,r,s)}function SW(e,{x:t,y:n}){lO(e.x,t.translate,t.scale,t.originPoint),lO(e.y,n.translate,n.scale,n.originPoint)}const TI=.999999999999,RI=1.0000000000001;function Qge(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,o;for(let l=0;l<s;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Hp(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,SW(e,o)),r&&th(a.latestValues)&&Hp(e,a.latestValues))}t.x<RI&&t.x>TI&&(t.x=1),t.y<RI&&t.y>TI&&(t.y=1)}function Wp(e,t){e.min=e.min+t,e.max=e.max+t}function MI(e,t,n,r,s=.5){const a=br(e.min,e.max,s);lO(e,t,n,a,r)}function Hp(e,t){MI(e.x,t.x,t.scaleX,t.scale,t.originX),MI(e.y,t.y,t.scaleY,t.scale,t.originY)}function kW(e,t){return _W(Gge(e.getBoundingClientRect(),t))}function Yge(e,t,n){const r=kW(e,n),{scroll:s}=t;return s&&(Wp(r.x,s.offset.x),Wp(r.y,s.offset.y)),r}const EW=({current:e})=>e?e.ownerDocument.defaultView:null,Xge=new WeakMap;class Zge{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ir(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=h=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ob(h).point)},a=(h,d)=>{const{drag:m,dragPropagation:g,onDragStart:w}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Vme(m),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ha(b=>{let y=this.getAxisMotionValue(b).get()||0;if(ql.test(y)){const{projection:_}=this.visualElement;if(_&&_.layout){const N=_.layout.layoutBox[b];N&&(y=wa(N)*(parseFloat(y)/100))}}this.originPoint[b]=y}),w&&rr.postRender(()=>w(h,d)),ZA(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(h,d)=>{const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:w,onDrag:v}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:b}=d;if(g&&this.currentDirection===null){this.currentDirection=Jge(b),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",d.point,b),this.updateAxis("y",d.point,b),this.visualElement.render(),v&&v(h,d)},l=(h,d)=>this.stop(h,d),c=()=>Ha(h=>{var d;return this.getAnimationState(h)==="paused"&&((d=this.getAxisMotionValue(h).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new yW(t,{onSessionStart:s,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:EW(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&rr.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!h1(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=zge(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&Bp(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=Bge(s.layoutBox,n):this.constraints=!1,this.elastic=Hge(r),a!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ha(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Wge(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Bp(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=Yge(r,s.root,this.visualElement.getTransformPagePoint());let o=Uge(s.layout.layoutBox,a);if(n){const l=n(Kge(o));this.hasMutatedConstraints=!!l,l&&(o=_W(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ha(h=>{if(!h1(h,n,this.currentDirection))return;let d=c&&c[h]||{};o&&(d={min:0,max:0});const m=s?200:1e6,g=s?40:1e7,w={type:"inertia",velocity:r?t[h]:0,bounceStiffness:m,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(h,w)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ZA(this.visualElement,t),r.start(cR(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ha(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ha(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ha(n=>{const{drag:r}=this.getProps();if(!h1(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];a.set(t[n]-br(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Bp(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ha(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=Vge({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ha(o=>{if(!h1(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(br(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;Xge.set(this.visualElement,this);const t=this.visualElement.current,n=P0(t,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps();u&&h&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Bp(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,a=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),rr.read(r);const o=J0(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ha(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=c[h].translate,d.set(d.get()+c[h].translate))}),this.visualElement.render())}));return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:o=aO,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function h1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Jge(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class eve extends Wd{constructor(t){super(t),this.removeGroupControls=ga,this.removeListeners=ga,this.controls=new Zge(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ga}unmount(){this.removeGroupControls(),this.removeListeners()}}const II=e=>(t,n)=>{e&&rr.postRender(()=>e(t,n))};class tve extends Wd{constructor(){super(...arguments),this.removePointerDownListener=ga}onPointerDown(t){this.session=new yW(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:EW(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:II(t),onStart:II(n),onMove:r,onEnd:(a,o)=>{delete this.session,s&&rr.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=P0(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function nve(){const e=O.useContext(rN);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,s=O.useId();O.useEffect(()=>r(s),[]);const a=O.useCallback(()=>n&&n(s),[s,n]);return!t&&n?[!1,a]:[!0]}const G1={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function DI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Jx={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Lt.test(e))e=parseFloat(e);else return e;const n=DI(e,t.target.x),r=DI(e,t.target.y);return`${n}% ${r}%`}},rve={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=qd.parse(e);if(s.length>5)return r;const a=qd.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const u=br(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),a(s)}};class ive extends O.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;ome(sve),a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),G1.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,o=r.projection;return o&&(o.isPresent=a,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||rr.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),F4.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function PW(e){const[t,n]=nve(),r=O.useContext(O4);return i.jsx(ive,{...e,layoutGroup:r,switchLayoutGroup:O.useContext(xV),isPresent:t,safeToRemove:n})}const sve={borderRadius:{...Jx,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Jx,borderTopRightRadius:Jx,borderBottomLeftRadius:Jx,borderBottomRightRadius:Jx,boxShadow:rve};function ave(e,t,n){const r=ts(e)?e:_g(e);return r.start(cR("",r,t,n)),r.animation}function ove(e){return e instanceof SVGElement&&e.tagName!=="svg"}const lve=(e,t)=>e.depth-t.depth;class cve{constructor(){this.children=[],this.isDirty=!1}add(t){Z4(this.children,t),this.isDirty=!0}remove(t){J4(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lve),this.isDirty=!1,this.children.forEach(t)}}function uve(e,t){const n=zl.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(iu(r),e(a-t))};return rr.read(r,!0),()=>iu(r)}const CW=["TopLeft","TopRight","BottomLeft","BottomRight"],dve=CW.length,LI=e=>typeof e=="string"?parseFloat(e):e,FI=e=>typeof e=="number"||Lt.test(e);function fve(e,t,n,r,s,a){s?(e.opacity=br(0,n.opacity!==void 0?n.opacity:1,hve(r)),e.opacityExit=br(t.opacity!==void 0?t.opacity:1,0,mve(r))):a&&(e.opacity=br(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<dve;o++){const l=`border${CW[o]}Radius`;let c=$I(t,l),u=$I(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||FI(c)===FI(u)?(e[l]=Math.max(br(LI(c),LI(u),r),0),(ql.test(u)||ql.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=br(t.rotate||0,n.rotate||0,r))}function $I(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const hve=AW(0,.5,KV),mve=AW(.5,.95,ga);function AW(e,t,n){return r=>r<e?0:r>t?1:n(wg(e,t,r))}function qI(e,t){e.min=t.min,e.max=t.max}function Ba(e,t){qI(e.x,t.x),qI(e.y,t.y)}function zI(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function BI(e,t,n,r,s){return e-=t,e=wj(e,1/n,r),s!==void 0&&(e=wj(e,1/s,r)),e}function pve(e,t=0,n=1,r=.5,s,a=e,o=e){if(ql.test(t)&&(t=parseFloat(t),t=br(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=br(a.min,a.max,r);e===a&&(l-=t),e.min=BI(e.min,t,n,l,s),e.max=BI(e.max,t,n,l,s)}function UI(e,t,[n,r,s],a,o){pve(e,t[n],t[r],t[s],t.scale,a,o)}const gve=["x","scaleX","originX"],vve=["y","scaleY","originY"];function VI(e,t,n,r){UI(e.x,t,gve,n?n.x:void 0,r?r.x:void 0),UI(e.y,t,vve,n?n.y:void 0,r?r.y:void 0)}function WI(e){return e.translate===0&&e.scale===1}function OW(e){return WI(e.x)&&WI(e.y)}function HI(e,t){return e.min===t.min&&e.max===t.max}function xve(e,t){return HI(e.x,t.x)&&HI(e.y,t.y)}function KI(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function TW(e,t){return KI(e.x,t.x)&&KI(e.y,t.y)}function GI(e){return wa(e.x)/wa(e.y)}function QI(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class yve{constructor(){this.members=[]}add(t){Z4(this.members,t),t.scheduleRender()}remove(t){if(J4(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const a=this.members[s];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function bve(e,t,n){let r="";const s=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||a||o)&&(r=`translate3d(${s}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:h,rotateX:d,rotateY:m,skewX:g,skewY:w}=n;u&&(r=`perspective(${u}px) ${r}`),h&&(r+=`rotate(${h}deg) `),d&&(r+=`rotateX(${d}deg) `),m&&(r+=`rotateY(${m}deg) `),g&&(r+=`skewX(${g}deg) `),w&&(r+=`skewY(${w}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const nh={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},y0=typeof window<"u"&&window.MotionDebug!==void 0,VS=["","X","Y","Z"],wve={visibility:"hidden"},YI=1e3;let jve=0;function WS(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function RW(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=qV(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",rr,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&RW(r)}function MW({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=jve++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,y0&&(nh.totalNodes=nh.resolvedTargetDeltas=nh.recalculatedProjection=0),this.nodes.forEach(Sve),this.nodes.forEach(Ave),this.nodes.forEach(Ove),this.nodes.forEach(kve),y0&&window.MotionDebug.record(nh)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new cve)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new eR),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=ove(o),this.instance=o;const{layoutId:c,layout:u,visualElement:h}=this.options;if(h&&!h.current&&h.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(u||c)&&(this.isLayoutDirty=!0),e){let d;const m=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=uve(m,250),G1.hasAnimatedSinceResize&&(G1.hasAnimatedSinceResize=!1,this.nodes.forEach(ZI))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:m,hasRelativeTargetChanged:g,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||h.getDefaultTransition()||Dve,{onLayoutAnimationStart:b,onLayoutAnimationComplete:y}=h.getProps(),_=!this.targetLayout||!TW(this.targetLayout,w)||g,N=!m&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||N||m&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,N);const j={...G4(v,"layout"),onPlay:b,onComplete:y};(h.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j)}else m||ZI(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,iu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Tve),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&RW(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const d=this.path[h];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(XI);return}this.isUpdating||this.nodes.forEach(Pve),this.isUpdating=!1,this.nodes.forEach(Cve),this.nodes.forEach(_ve),this.nodes.forEach(Nve),this.clearAllSnapshots();const l=zl.now();Fi.delta=su(0,1e3/60,l-Fi.timestamp),Fi.timestamp=l,Fi.isProcessing=!0,IS.update.process(Fi),IS.preRender.process(Fi),IS.render.process(Fi),Fi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,F4.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Eve),this.sharedNodes.forEach(Rve)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ir(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!OW(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,h=u!==this.prevTransformTemplateValue;o&&(l||th(this.latestValues)||h)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),Lve(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return Ir();const c=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(Fve))){const{scroll:h}=this.root;h&&(Wp(c.x,h.offset.x),Wp(c.y,h.offset.y))}return c}removeElementScroll(o){var l;const c=Ir();if(Ba(c,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let u=0;u<this.path.length;u++){const h=this.path[u],{scroll:d,options:m}=h;h!==this.root&&d&&m.layoutScroll&&(d.wasRoot&&Ba(c,o),Wp(c.x,d.offset.x),Wp(c.y,d.offset.y))}return c}applyTransform(o,l=!1){const c=Ir();Ba(c,o);for(let u=0;u<this.path.length;u++){const h=this.path[u];!l&&h.options.layoutScroll&&h.scroll&&h!==h.root&&Hp(c,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),th(h.latestValues)&&Hp(c,h.latestValues)}return th(this.latestValues)&&Hp(c,this.latestValues),c}removeTransform(o){const l=Ir();Ba(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!th(u.latestValues))continue;oO(u.latestValues)&&u.updateSnapshot();const h=Ir(),d=u.measurePageBox();Ba(h,d),VI(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,h)}return th(this.latestValues)&&VI(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Fi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:m}=this.options;if(!(!this.layout||!(d||m))){if(this.resolvedRelativeTargetAt=Fi.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ir(),this.relativeTargetOrigin=Ir(),A0(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),Ba(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Ir(),this.targetWithTransforms=Ir()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),qge(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ba(this.target,this.layout.layoutBox),SW(this.target,this.targetDelta)):Ba(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ir(),this.relativeTargetOrigin=Ir(),A0(this.relativeTargetOrigin,this.target,g.target),Ba(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}y0&&nh.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||oO(this.parent.latestValues)||NW(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Fi.timestamp&&(u=!1),u)return;const{layout:h,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||d))return;Ba(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,g=this.treeScale.y;Qge(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Ir());const{target:w}=l;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(zI(this.prevProjectionDelta.x,this.projectionDelta.x),zI(this.prevProjectionDelta.y,this.projectionDelta.y)),C0(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==g||!QI(this.projectionDelta.x,this.prevProjectionDelta.x)||!QI(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w)),y0&&nh.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Vp(),this.projectionDelta=Vp(),this.projectionDeltaWithTransform=Vp()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},h={...this.latestValues},d=Vp();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const m=Ir(),g=c?c.source:void 0,w=this.layout?this.layout.source:void 0,v=g!==w,b=this.getStack(),y=!b||b.members.length<=1,_=!!(v&&!y&&this.options.crossfade===!0&&!this.path.some(Ive));this.animationProgress=0;let N;this.mixTargetDelta=j=>{const S=j/1e3;JI(d.x,o.x,S),JI(d.y,o.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(A0(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Mve(this.relativeTarget,this.relativeTargetOrigin,m,S),N&&xve(this.relativeTarget,N)&&(this.isProjectionDirty=!1),N||(N=Ir()),Ba(N,this.relativeTarget)),v&&(this.animationValues=h,fve(h,u,this.latestValues,S,_,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(iu(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rr.update(()=>{G1.hasAnimatedSinceResize=!0,this.currentAnimation=ave(0,YI,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(YI),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:h}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&IW(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Ir();const d=wa(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+d;const m=wa(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+m}Ba(l,c),Hp(l,h),C0(this.projectionDeltaWithTransform,this.layoutCorrected,l,h)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new yve),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&WS("z",o,u,this.animationValues);for(let h=0;h<VS.length;h++)WS(`rotate${VS[h]}`,o,u,this.animationValues),WS(`skew${VS[h]}`,o,u,this.animationValues);o.render();for(const h in u)o.setStaticValue(h,u[h]),this.animationValues&&(this.animationValues[h]=u[h]);o.scheduleRender()}getProjectionStyles(o){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return wve;const u={visibility:""},h=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=H1(o==null?void 0:o.pointerEvents)||"",u.transform=h?h(this.latestValues,""):"none",u;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const v={};return this.options.layoutId&&(v.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,v.pointerEvents=H1(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!th(this.latestValues)&&(v.transform=h?h({},""):"none",this.hasProjected=!1),v}const m=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=bve(this.projectionDeltaWithTransform,this.treeScale,m),h&&(u.transform=h(m,u.transform));const{x:g,y:w}=this.projectionDelta;u.transformOrigin=`${g.origin*100}% ${w.origin*100}% 0`,d.animationValues?u.opacity=d===this?(c=(l=m.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:u.opacity=d===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const v in gj){if(m[v]===void 0)continue;const{correct:b,applyTo:y}=gj[v],_=u.transform==="none"?m[v]:b(m[v],d);if(y){const N=y.length;for(let j=0;j<N;j++)u[y[j]]=_}else u[v]=_}return this.options.layoutId&&(u.pointerEvents=d===this?H1(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(XI),this.root.sharedNodes.clear()}}}function _ve(e){e.updateLayout()}function Nve(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;a==="size"?Ha(d=>{const m=o?n.measuredBox[d]:n.layoutBox[d],g=wa(m);m.min=r[d].min,m.max=m.min+g}):IW(a,n.layoutBox,r)&&Ha(d=>{const m=o?n.measuredBox[d]:n.layoutBox[d],g=wa(r[d]);m.max=m.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+g)});const l=Vp();C0(l,r,n.layoutBox);const c=Vp();o?C0(c,e.applyTransform(s,!0),n.measuredBox):C0(c,r,n.layoutBox);const u=!OW(l);let h=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:m,layout:g}=d;if(m&&g){const w=Ir();A0(w,n.layoutBox,m.layoutBox);const v=Ir();A0(v,r,g.layoutBox),TW(w,v)||(h=!0),d.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=w,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:h})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Sve(e){y0&&nh.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function kve(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Eve(e){e.clearSnapshot()}function XI(e){e.clearMeasurements()}function Pve(e){e.isLayoutDirty=!1}function Cve(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ZI(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ave(e){e.resolveTargetDelta()}function Ove(e){e.calcProjection()}function Tve(e){e.resetSkewAndRotation()}function Rve(e){e.removeLeadSnapshot()}function JI(e,t,n){e.translate=br(t.translate,0,n),e.scale=br(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function eD(e,t,n,r){e.min=br(t.min,n.min,r),e.max=br(t.max,n.max,r)}function Mve(e,t,n,r){eD(e.x,t.x,n.x,r),eD(e.y,t.y,n.y,r)}function Ive(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Dve={duration:.45,ease:[.4,0,.1,1]},tD=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nD=tD("applewebkit/")&&!tD("chrome/")?Math.round:ga;function rD(e){e.min=nD(e.min),e.max=nD(e.max)}function Lve(e){rD(e.x),rD(e.y)}function IW(e,t,n){return e==="position"||e==="preserve-aspect"&&!$ge(GI(t),GI(n),.2)}function Fve(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const $ve=MW({attachResizeListener:(e,t)=>J0(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),HS={current:void 0},DW=MW({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!HS.current){const e=new $ve({});e.mount(window),e.setOptions({layoutScroll:!0}),HS.current=e}return HS.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),qve={pan:{Feature:tve},drag:{Feature:eve,ProjectionNode:DW,MeasureLayout:PW}};function iD(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=r[s];a&&rr.postRender(()=>a(t,ob(t)))}class zve extends Wd{mount(){const{current:t}=this.node;t&&(this.unmount=$me(t,n=>(iD(this.node,n,"Start"),r=>iD(this.node,r,"End"))))}unmount(){}}class Bve extends Wd{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ab(J0(this.node.current,"focus",()=>this.onFocus()),J0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function sD(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=r[s];a&&rr.postRender(()=>a(t,ob(t)))}class Uve extends Wd{mount(){const{current:t}=this.node;t&&(this.unmount=Ume(t,n=>(sD(this.node,n,"Start"),(r,{success:s})=>sD(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cO=new WeakMap,KS=new WeakMap,Vve=e=>{const t=cO.get(e.target);t&&t(e)},Wve=e=>{e.forEach(Vve)};function Hve({root:e,...t}){const n=e||document;KS.has(n)||KS.set(n,{});const r=KS.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Wve,{root:e,...t})),r[s]}function Kve(e,t,n){const r=Hve(t);return cO.set(e,n),r.observe(e),()=>{cO.delete(e),r.unobserve(e)}}const Gve={some:0,all:1};class Qve extends Wd{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Gve[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:d}=this.node.getProps(),m=u?h:d;m&&m(c)};return Kve(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Yve(t,n))&&this.startObserver()}unmount(){}}function Yve({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Xve={inView:{Feature:Qve},tap:{Feature:Uve},focus:{Feature:Bve},hover:{Feature:zve}},Zve={layout:{ProjectionNode:DW,MeasureLayout:PW}},uO={current:null},LW={current:!1};function Jve(){if(LW.current=!0,!!R4)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>uO.current=e.matches;e.addListener(t),t()}else uO.current=!1}function exe(e,t,n){for(const r in t){const s=t[r],a=n[r];if(ts(s))e.addValue(r,s);else if(ts(a))e.addValue(r,_g(s,{owner:e}));else if(a!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,_g(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const aD=new WeakMap,txe=[...JV,Yi,qd],nxe=e=>txe.find(ZV(e)),oD=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class rxe{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rR,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=zl.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,rr.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=oN(n),this.isVariantNode=gV(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in d){const g=d[m];c[m]!==void 0&&ts(g)&&g.set(c[m],!1)}}mount(t){this.current=t,aD.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
718h((n,r)=>this.bindToMotionValue(r,n)),LW.current||Jve(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:uO.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){aD.delete(this.current),this.projection&&this.projection.unmount(),iu(this.notifyUpdate),iu(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Jh.has(t),s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&rr.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in jg){const n=jg[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ir()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<oD.length;r++){const s=oD[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,o=t[a];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=exe(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=_g(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(YV(s)||QV(s))?s=parseFloat(s):!nxe(s)&&qd.test(n)&&(s=oW(t,n)),this.setBaseTarget(t,ts(s)?s.get():s)),ts(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=z4(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!ts(a)?a:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new eR),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class FW extends rxe{constructor(){super(...arguments),this.KeyframeResolver=lW}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ts(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function ixe(e){return window.getComputedStyle(e)}class sxe extends FW{constructor(){super(...arguments),this.type="html",this.renderInstance=bV}readValueFromInstance(t,n){if(Jh.has(n)){const r=aR(n);return r&&r.default||0}else{const r=ixe(t),s=(CV(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return kW(t,n)}build(t,n,r){W4(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return q4(t,n,r)}}class axe extends FW{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ir}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Jh.has(n)){const r=aR(n);return r&&r.default||0}return n=wV.has(n)?n:L4(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return NV(t,n,r)}build(t,n,r){H4(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){jV(t,n,r,s)}mount(t){this.isSVGTag=K4(t.tagName),super.mount(t)}}const oxe=(e,t)=>$4(e)?new axe(t):new sxe(t,{allowProjection:e!==O.Fragment}),lxe=Tme({...Age,...Xve,...qve,...Zve},oxe),rt=Ghe(lxe);function $W(e){const t=nb(()=>_g(e)),{isStatic:n}=O.useContext(iN);if(n){const[,r]=O.useState(e);O.useEffect(()=>t.on("change",r),[])}return t}function qW(e,t){const n=$W(t()),r=()=>n.set(t());return r(),M4(()=>{const s=()=>rr.preRender(r,!1,!0),a=e.map(o=>o.on("change",s));return()=>{a.forEach(o=>o()),iu(r)}}),n}const cxe=e=>e&&typeof e=="object"&&e.mix,uxe=e=>cxe(e)?e.mix:void 0;function dxe(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],s=e[1+n],a=e[2+n],o=e[3+n],l=pW(s,a,{mixer:uxe(a[0]),...o});return t?l(r):l}function fxe(e){k0.current=[],e();const t=qW(k0.current,e);return k0.current=void 0,t}function GS(e,t,n,r){if(typeof e=="function")return fxe(e);const s=typeof t=="function"?t:dxe(t,n,r);return Array.isArray(e)?lD(e,s):lD([e],([a])=>s(a))}function lD(e,t){const n=nb(()=>[]);return qW(e,()=>{n.length=0;const r=e.length;for(let s=0;s<r;s++)n[s]=e[s].get();return t(n)})}const hxe=e=>{if(!e)return"";const[t,n]=e.split("@");if(!n)return e;const r=n.split("."),s=r.pop(),a=r.join(".")||n,o=t&&t.length>3?t.slice(0,3)+"***":(t||"")+"***",l=a.length>2?a.slice(0,2)+"***":a+"***";return`${o}@${l}.${s}`},mxe=e=>e===1?"bg-gradient-to-br from-amber-300 to-yellow-500 text-amber-950 border-amber-200":e===2?"bg-gradient-to-br from-slate-200 to-slate-400 text-slate-800 border-slate-100":e===3?"bg-gradient-to-br from-orange-400 to-amber-700 text-orange-50 border-orange-300":"bg-white/10 text-slate-400 border-white/20";function zW({voidedWeeks:e=[]}){const[t,n]=O.useState(null),r=se.useRef(null),s=d=>{r.current&&r.current.scrollBy({left:d*r.current.clientWidth*.8,behavior:"smooth"})};se.useEffect(()=>{if(!r.current||!t)return;const d=r.current.querySelector(`[data-date="${t}"]`);d&&d.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[t]);const{data:a=[],isLoading:o}=qe({queryKey:["weeklyResults"],queryFn:()=>
718ae.entities.WeeklyResult.list("-quiz_date",500),refetchInterval:3e4,staleTime:15e3}),l=O.useMemo(()=>{const d=new Map;for(const g of a)d.has(g.quiz_date)||d.set(g.quiz_date,{quiz_date:g.quiz_date,results:[]}),d.get(g.quiz_date).results.push(g);const m=Array.from(d.values()).sort((g,w)=>g.quiz_date.localeCompare(w.quiz_date));return m.forEach((g,w)=>{g.week_number=w+1}),m.reverse()},[a]),c=O.useMemo(()=>new Set(e.map(d=>d.quiz_date)),[e]);se.useEffect(()=>{l.length&&!t&&n(l[0].quiz_date)},[l,t]);const u=l.find(d=>d.quiz_date===t),h=u?[...u.results].sort((d,m)=>{var v,b;const g=Number((v=d.raw_data)==null?void 0:v.points)||0;return(Number((b=m.raw_data)==null?void 0:b.points)||0)-g}):[];return i.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl border border-white/20 p-3 sm:p-6 mt-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-4 sm:mb-5",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-9 h-9 sm:w-10 sm:h-10 rounded-xl bg-gradient-to-br from-pink-500 via-amber-400 to-cyan-400 shrink-0",children:i.jsx(Fn,{className:"w-4 h-4 sm:w-5 sm:h-5 text-white"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-xl sm:text-2xl font-black text-white",children:"Weekly Results"}),i.jsx("p",{className:"text-slate-300 text-xs sm:text-sm",children:"Browse every week's results — emails are masked for privacy"})]})]}),o?i.jsx("div",{className:"text-center py-12 text-slate-300",children:"Loading weekly results…"}):l.length===0?i.jsxs("div",{className:"text-center py-12 text-slate-400",children:[i.jsx(Fn,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),i.jsx("p",{children:"No weekly results have been uploaded yet."}),i.jsx("p",{className:"text-sm mt-1",children:"Results will appear here once they're added from the admin area."})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[i.jsx("button",{onClick:()=>s(-1),className:"flex-shrink-0 w-9 h-9 rounded-lg bg-white/10 border border-white/20 text-white flex items-center justify-center hover:bg-white/20 active:scale-90 transition",children:i.jsx(vee,{className:"w-4 h-4"})}),i.jsx("div",{ref:r,className:"flex-1 flex gap-2 overflow-x-auto scroll-smooth snap-x snap-mandatory custom-scrollbar pb-1",children:l.map(d=>{const m=c.has(d.quiz_date),g=t===d.quiz_date;return i.jsxs("button",{"data-date":d.quiz_date,onClick:()=>n(d.quiz_date),className:`snap-start flex-shrink-0 px-4 py-2.5 rounded-xl border-2 font-semibold text-sm transition-all min-w-[120px] ${g?"bg-gradient-to-r from-pink-500 via-amber-400 to-cyan-400 text-white border-white/40 shadow-lg scale-105":m?"bg-red-950/40 text-red-300 border-red-500/30 line-through":"bg-white/10 text-white border-white/20 hover:bg-white/20"}`,children:[i.jsx("div",{className:"text-xs opacity-80",children:d.week_number?`Week ${d.week_number}`:"Quiz"}),i.jsx("div",{className:"text-sm",children:d.quiz_date}),m&&i.jsxs("div",{className:"flex items-center justify-center gap-1 mt-0.5",children:[i.jsx(F0,{className:"w-3 h-3"}),i.jsx("span",{className:"text-[10px] font-bold",children:"VOID"})]})]},d.quiz_date)})}),i.jsx("button",{onClick:()=>s(1),className:"flex-shrink-0 w-9 h-9 rounded-lg bg-white/10 border border-white/20 text-white flex items-center justify-center hover:bg-white/20 active:scale-90 transition",children:i.jsx(yee,{className:"w-4 h-4"})})]}),i.jsx(Gs,{mode:"wait",children:u&&i.jsxs(rt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.25},children:[c.has(t)&&i.jsxs("div",{className:"bg-red-950/40 border border-red-500/30 rounded-lg p-3 mb-4 flex items-center gap-2",children:[i.jsx(F0,{className:"w-4 h-4 text-red-400"}),i.jsx("span",{className:"text-red-300 text-sm font-semibold",children:"This quiz week has been voided and excluded from the standings."})]}),i.jsx("div",{className:"overflow-x-auto rounded-xl border border-white/10",children:i.jsxs("table",{className:"w-full min-w-[480px]",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-white/5 border-b border-white/10",children:[i.jsx("th",{className:"text-left p-2 sm:p-3 text-slate-200 font-semibold text-xs sm:text-sm",children:"Place"}),i.jsx("th",{className:"text-left p-2 sm:p-3 text-slate-200 font-semibold text-xs sm:text-sm",children:"Team"}),i.jsx("th",{className:"text-left p-2 sm:p-3 text-slate-200 font-semibold text-xs sm:text-sm",children:"Email (masked)"}),i.jsx("th",{className:"text-center p-2 sm:p-3 text-slate-200 font-semibold text-xs sm:text-sm",children:"Pts"}),i.jsx("th",{className:"text-center p-2 sm:p-3 text-slate-200 font-semibold text-xs sm:text-sm",children:"Score"})]})}),i.jsx("tbody",{children:h.map((d,m)=>{var v;const g=m+1,w=d.placement||(g<=3?g:0);return i.jsxs("tr",{className:"border-b border-white/5 hover:bg-white/5 transition",children:[i.jsx("td",{className:"p-2 sm:p-3",children:i.jsx("span",{className:`inline-flex items-center justify-center w-8 h-8 sm:w-9 sm:h-9 rounded-full text-xs sm:text-sm font-bold border-2 ${mxe(w)}`,children:g})}),i.jsx("td",{className:"p-2 sm:p-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[d.placement===1&&i.jsx(Jt,{className:"w-4 h-4 text-amber-400 shrink-0"}),i.jsx("span",{className:"text-white font-semibold text-sm sm:text-base",children:d.team_name})]})}),i.jsx("td",{className:"p-2 sm:p-3",children:d.team_email?i.jsxs("span",{className:"text-slate-300 text-xs sm:text-sm font-mono flex items-center gap-1.5",children:[i.jsx(Vo,{className:"w-3 h-3 opacity-50 shrink-0"}),hxe(d.team_email)]}):i.jsx("span",{className:"text-slate-500 text-sm",children:"—"})}),i.jsx("td",{className:"p-2 sm:p-3 text-center",children:i.jsx("span",{className:"text-white font-bold text-sm sm:text-base",children:d.points_earned||0})}),i.jsx("td",{className:"p-2 sm:p-3 text-center",children:i.jsx("span",{className:"text-cyan-300 font-bold text-sm sm:text-base",children:((v=
718d.raw_data)==null?void 0:v.points)??"—"})})]},d.id||m)})})]})}),i.jsxs("p",{className:"text-slate-400 text-xs mt-3",children:[h.length," team",h.length!==1?"s":""," on ",t,". Email addresses are partially masked for GDPR compliance."]})]},t)})]})]})}function pxe(){const[e,t]=O.useState(null),[n,r]=O.useState({}),[s,a]=O.useState(!1),[o,l]=O.useState({team_name:"",appearances:0,finishes_1st:0,finishes_2nd:0,finishes_3rd:0,notes:""}),[c,u]=O.useState(""),[h,d]=O.useState(null),[m,g]=O.useState(!1),[w,v]=O.useState(!1),[b,y]=O.useState(!1),_=mn(),{data:N=[]}=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list()}),j=[...N].sort((V,z)=>z.total_points!==V.total_points?z.total_points-V.total_points:z.finishes_1st!==V.finishes_1st?z.finishes_1st-V.finishes_1st:(V.team_name||"").localeCompare(z.team_name||"")),S=V=>V<=3?-1*V:-3-2*(V-3),C=(V,z,L,W)=>{const Q=z||0,J=L||0,ne=W||0,ee=(V||0)+4*Q+3*J+2*ne,le=S(Q);return{basePoints:ee,handicap:le,totalPoints:ee}},P=V=>{t(V.id),r(V)},A=async()=>{try{const{basePoints:V,handicap:z,totalPoints:L}=C(n.appearances,n.finishes_1st,n.finishes_2nd,n.finishes_3rd);await ae.entities.Team.update(e,{...n,base_points:V,handicap:z,total_points:L}),_.invalidateQueries(["teams"]),t(null),r({})}catch(V){console.error("Failed to save team:",V),alert("Failed to save team. Please try again.")}},F=async()=>{if(confirm(`Recalculate totals for all ${N.length} teams? This may take a moment.`)){g(!0);try{await Promise.all(N.map(async V=>{const{basePoints:z,handicap:L,totalPoints:W}=C(V.appearances,V.finishes_1st,V.finishes_2nd,V.finishes_3rd);return ae.entities.Team.update(V.id,{base_points:z,handicap:L,total_points:W})})),_.invalidateQueries(["teams"]),alert(`Successfully recalculated totals for ${N.length} teams!`)}catch(V){console.error("Failed to recalculate all teams:",V),alert("Some teams failed to update. Please try again.")}finally{g(!1)}}},I=()=>{l({team_name:"",appearances:0,finishes_1st:0,finishes_2nd:0,finishes_3rd:0,notes:""}),u(""),v(!1),a(!0)},R=()=>{a(!1),l({team_name:"",appearances:0,finishes_1st:0,finishes_2nd:0,finishes_3rd:0,notes:""}),u(""),v(!1)},M=async()=>{if(!o.team_name.trim()){u("Team name is required");return}v(!0),u("");try{const{basePoints:V,handicap:z,totalPoints:L}=C(o.appearances,o.finishes_1st,o.finishes_2nd,o.finishes_3rd);await ae.entities.Team.create({team_name:o.team_name.trim(),appearances:o.appearances,finishes_1st:o.finishes_1st,finishes_2nd:o.finishes_2nd,finishes_3rd:o.finishes_3rd,base_points:V,handicap:z,total_points:L,active:!0,notes:o.notes.trim()||""}),await _.invalidateQueries(["teams"]),R()}catch(V){console.error("Failed to add team:",V),u(`Failed to add team: ${V.message||"Please try again"}`),v(!1)}},$=async V=>{if(confirm("Are you sure you want to delete this team?"))try{await ae.entities.Team.delete(V),_.invalidateQueries(["teams"])}catch(z){console.error("Failed to delete team:",z),alert("Failed to delete team. Please try again.")}},B=V=>V.split(" ").map(z=>z[0]).filter(Boolean).slice(0,2).join("").toUpperCase(),U=V=>e?C(V.appearances,V.finishes_1st,V.finishes_2nd,V.finishes_3rd):null,Z=C(o.appearances,o.finishes_1st,o.finishes_2nd,o.finishes_3rd),X=()=>{const V=["Rank","Team Name","Appearances","1st","2nd","3rd","Base Points","Handicap","Total Points","Active","Last Attendance Date"],z=j.map((ne,Y)=>[Y+1,`"${(ne.team_name||"").replace(/"/g,'""')}"`,ne.appearances||0,ne.finishes_1st||0,ne.finishes_2nd||0,ne.finishes_3rd||0,ne.base_points||0,ne.handicap||0,ne.total_points||0,ne.active?"Yes":"No",ne.last_attendance_date||""]),L=[V.join(","),...z.map(ne=>ne.join(","))].join(`
719`),W=new Blob([L],{type:"text/csv"}),Q=URL.createObjectURL(W),J=document.createElement("a");J.href=Q,J.download=`league-table-${new Date().toISOString().slice(0,10)}.csv`,J.click(),URL.revokeObjectURL(Q)};return i.jsxs(i.Fragment,{children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center justify-between",children:[i.jsx("span",{children:"Teams & Statistics"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{onClick:F,variant:"outline",size:"sm",disabled:m,children:[i.jsx(Ah,{className:`w-4 h-4 mr-2 ${m?"animate-spin":""}`}),m?"Recalculating...":"Recalculate All Totals"]}),i.jsxs(ue,{onClick:()=>y(!0),variant:"outline",size:"sm",className:"border-orange-300 text-orange-700 hover:bg-orange-50",children:[i.jsx(B0,{className:"w-4 h-4 mr-2"}),"Merge Duplicates"]}),i.jsxs(ue,{onClick:X,variant:"outline",size:"sm",children:[i.jsx(Wy,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),i.jsxs(ue,{onClick:I,size:"sm",children:[i.jsx(li,{className:"w-4 h-4 mr-2"}),"Add Team"]})]})]})}),i.jsxs(Fe,{children:[i.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3 mb-4",children:i.jsxs("p",{className:"text-sm text-blue-900",children:[i.jsx("strong",{children:"Note:"}),' Total Points are automatically calculated (Base Points + Handicap). Use "Recalculate All Totals" to fix any existing records.']})}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs(Qo,{children:[i.jsx(Yo,{children:i.jsxs(tr,{children:[i.jsx(ht,{children:"Rank"}),i.jsx(ht,{children:"Photo"}),i.jsx(ht,{children:"Team Name"}),i.jsx(ht,{children:"ATT"}),i.jsx(ht,{children:"1st"}),i.jsx(ht,{children:"2nd"}),i.jsx(ht,{children:"3rd"}),i.jsx(ht,{children:"Base Pts"}),i.jsx(ht,{children:"Handicap"}),i.jsx(ht,{children:"Total Pts"}),i.jsx(ht,{children:"Champion"}),i.jsx(ht,{children:"Active"}),i.jsx(ht,{children:"Last Date"}),i.jsx(ht,{children:"Actions"})]})}),i.jsx(Xo,{children:j.map((V,z)=>{const L=e===V.id,W=L?n:V,Q=L?U(W):null;return i.jsxs(tr,{children:[i.jsx(it,{className:"font-semibold",children:z+1}),i.jsx(it,{children:i.jsxs("div",{className:"flex items-center gap-2",children:[V.team_photo_url?i.jsx("img",{src:V.team_photo_url,alt:V.team_name,className:"w-10 h-10 rounded-full object-cover border-2 border-slate-200"}):i.jsx("div",{className:"w-10 h-10 rounded-full bg-slate-200 flex items-center justify-center text-slate-600 text-xs font-semibold",children:B(V.team_name)}),i.jsx(ue,{size:"icon",variant:"ghost",onClick:()=>d(V),className:"h-8 w-8",children:i.jsx(Md,{className:"w-4 h-4"})})]})}),i.jsx(it,{children:L?i.jsx(Ee,{value:W.team_name,onChange:J=>r({...W,team_name:J.target.value}),className:"w-full"}):V.team_name}),i.jsx(it,{children:L?i.jsx(Ee,{type:"number",value:W.appearances,onChange:J=>r({...W,appearances:parseInt(J.target.value)||0}),className:"w-20"}):V.appearances}),i.jsx(it,{children:L?i.jsx(Ee,{type:"number",value:W.finishes_1st,onChange:J=>r({...W,finishes_1st:parseInt(J.target.value)||0}),className:"w-16"}):V.finishes_1st}),i.jsx(it,{children:L?i.jsx(Ee,{type:"number",value:W.finishes_2nd,onChange:J=>r({...W,finishes_2nd:parseInt(J.target.value)||0}),className:"w-16"}):V.finishes_2nd}),i.jsx(it,{children:L?i.jsx(Ee,{type:"number",value:W.finishes_3rd,onChange:J=>r({...W,finishes_3rd:parseInt(J.target.value)||0}),className:"w-16"}):V.finishes_3rd}),i.jsx(it,{className:"font-semibold",children:L&&Q?i.jsx("span",{className:"text-green-600",children:Q.basePoints}):V.base_points}),i.jsx(it,{className:V.handicap<0?"text-red-600 font-semibold":"",children:L&&Q?i.jsx("span",{className:"text-green-600",children:Q.handicap}):V.handicap}),i.jsx(it,{className:"font-bold text-lg",children:L&&Q?i.jsx("span",{className:"text-green-600",children:Q.totalPoints}):V.total_points}),i.jsx(it,{children:i.jsx(ue,{size:"sm",variant:V.is_champion?"default":"outline",className:V.is_champion?"bg-amber-500 hover:bg-amber-600 text-white border-amber-500":"",onClick:async()=>{await ae.entities.Team.update(V.id,{is_champion:!V.is_champion}
719),_.invalidateQueries(["teams"])},title:V.is_champion?"Remove Champions tag":"Tag as Champions",children:i.jsx(Jt,{className:"w-4 h-4"})})}),i.jsx(it,{children:L?i.jsx(qh,{checked:W.active,onCheckedChange:J=>r({...W,active:J})}):V.active?"✓":"✗"}),i.jsx(it,{className:"text-sm text-slate-600",children:V.last_attendance_date||"-"}),i.jsx(it,{children:i.jsxs("div",{className:"flex gap-2",children:[L?i.jsx(ue,{size:"sm",onClick:A,variant:"default",children:i.jsx(Hy,{className:"w-4 h-4"})}):i.jsx(ue,{size:"sm",onClick:()=>P(V),variant:"outline",children:"Edit"}),i.jsx(ue,{size:"sm",onClick:()=>$(V.id),variant:"destructive",children:i.jsx(ci,{className:"w-4 h-4"})})]})})]},V.id)})})]})})]})]}),i.jsx("div",{className:"mt-6 rounded-2xl bg-gradient-to-br from-[#363161] to-[#262145] p-1",children:i.jsx(zW,{})}),i.jsx(rn,{open:s,onOpenChange:V=>!V&&R(),children:i.jsxs(en,{className:"max-w-2xl",children:[i.jsx(vn,{children:i.jsx(sn,{children:"Add New Team"})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"team-name",children:"Team Name *"}),i.jsx(Ee,{id:"team-name",value:o.team_name,onChange:V=>{l({...o,team_name:V.target.value}),u("")},onKeyDown:V=>{V.key==="Enter"&&!w&&M()},placeholder:"Enter team name",className:c?"border-red-500":"",disabled:w,autoFocus:!0}),c&&i.jsx("p",{className:"text-sm text-red-600",children:c})]}),i.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:[i.jsx("p",{className:"text-sm text-blue-900 font-semibold mb-2",children:"Enter Current Results (if applicable)"}),i.jsx("p",{className:"text-xs text-blue-800",children:"Leave at 0 if this is a brand new team with no history."})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"appearances",children:"Attendance"}),i.jsx(Ee,{id:"appearances",type:"number",min:"0",value:o.appearances,onChange:V=>l({...o,appearances:parseInt(V.target.value)||0}),disabled:w})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"finishes-1st",children:"1st Place Finishes"}),i.jsx(Ee,{id:"finishes-1st",type:"number",min:"0",value:o.finishes_1st,onChange:V=>l({...o,finishes_1st:parseInt(V.target.value)||0}),disabled:w})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"finishes-2nd",children:"2nd Place Finishes"}),i.jsx(Ee,{id:"finishes-2nd",type:"number",min:"0",value:o.finishes_2nd,onChange:V=>l({...o,finishes_2nd:parseInt(V.target.value)||0}),disabled:w})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"finishes-3rd",children:"3rd Place Finishes"}),i.jsx(Ee,{id:"finishes-3rd",type:"number",min:"0",value:o.finishes_3rd,onChange:V=>l({...o,finishes_3rd:parseInt(V.target.value)||0}),disabled:w})]})]}),i.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3",children:[i.jsx("p",{className:"text-sm text-green-900 font-semibold mb-1",children:"Points Preview:"}),i.jsxs("div",{className:"flex gap-4 text-sm text-green-800",children:[i.jsxs("span",{children:["Base Points: ",i.jsx("strong",{children:Z.basePoints})]}),i.jsx("span",{children:"•"}),i.jsxs("span",{children:["Handicap: ",i.jsx("strong",{children:Z.handicap})]}),i.jsx("span",{children:"•"}),i.jsxs("span",{children:["Total Points: ",i.jsx("strong",{children:Z.totalPoints})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"team-notes",children:"Notes (Optional)"}),i.jsx(nr,{id:"team-notes",value:o.notes,onChange:V=>l({...o,notes:V.target.value}),placeholder:"Add any notes about this team",rows:3,disabled:w})]})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:R,disabled:w,children:"Cancel"}),i.jsxs(ue,{onClick:M,disabled:w,children:[i.jsx(li,{className:"w-4 h-4 mr-2"}),w?"Creating...":"Create Team"]})]})]})}),i.jsx(Dhe,{open:b,onClose:()=>y(!1),teams:N,onMerged:()=>{_.invalidateQueries(["teams"]),y(!1)}}),i.jsx(Rhe,{team:h,open:!!h,onClose:()=>d(null),onPhotoUpdated:()=>_.invalidateQueries(["teams"])})]})}var uN="Switch",[gxe]=ja(uN),[vxe,xxe]=gxe(uN),BW=O.forwardRef((e,t)=>
719{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:u,form:h,...d}=e,[m,g]=O.useState(null),w=fn(t,N=>g(N)),v=O.useRef(!1),b=m?h||!!m.closest("form"):!0,[y,_]=eu({prop:s,defaultProp:a??!1,onChange:u,caller:uN});return i.jsxs(vxe,{scope:n,checked:y,disabled:l,children:[i.jsx(Pt.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":HW(y),"data-disabled":l?"":void 0,disabled:l,value:c,...d,ref:w,onClick:Et(e.onClick,N=>{_(j=>!j),b&&(v.current=N.isPropagationStopped(),v.current||N.stopPropagation())})}),b&&i.jsx(WW,{control:m,bubbles:!v.current,name:r,value:c,checked:y,required:o,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});BW.displayName=uN;var UW="SwitchThumb",VW=O.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=xxe(UW,n);return i.jsx(Pt.span,{"data-state":HW(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});VW.displayName=UW;var yxe="SwitchBubbleInput",WW=O.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},a)=>{const o=O.useRef(null),l=fn(o,a),c=Q_(n),u=H_(t);return O.useEffect(()=>{const h=o.current;if(!h)return;const d=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&g){const w=new Event("click",{bubbles:r});g.call(h,n),h.dispatchEvent(w)}},[c,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});WW.displayName=yxe;function HW(e){return e?"checked":"unchecked"}var KW=BW,bxe=VW;const ai=O.forwardRef(({className:e,...t},n)=>i.jsx(KW,{className:Nt("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:i.jsx(bxe,{className:Nt("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));ai.displayName=KW.displayName;const cD=[{icon:"🗑️",label:"All teams deleted (names, scores, photos — everything)"},{icon:"🗂️",label:"All import history & batch records deleted"},{icon:"🔗",label:"All name mappings cleared"},{icon:"📊",label:"All weekly results history cleared"},{icon:"📅",label:"Current week reset to 0"}];function wxe({settings:e}){const[t,n]=O.useState(!1),[r,s]=O.useState(""),[a,o]=O.useState(""),[l,c]=O.useState(""),[u,h]=O.useState(!1),[d,m]=O.useState(!1),g=mn(),w=()=>{n(!0),s(""),o(""),c(""),m(!1)},v=async()=>{const b=(e==null?void 0:e.admin_pin)||"3190";if(r!==b){c("Incorrect PIN. Please try again.");return}if(a.toUpperCase()!=="NEW SEASON"){c('Please type "NEW SEASON" exactly to confirm.');return}c(""),h(!0);try{await Promise.all([ae.entities.Team.deleteMany({}),ae.entities.NameMapping.deleteMany({}),ae.entities.ImportBatch.deleteMany({}),ae.entities.QuestionResult.deleteMany({}
719),ae.entities.WeeklyResult.deleteMany({}),ae.entities.UploadLog.deleteMany({})]),e!=null&&e.id&&await ae.entities.Settings.update(e.id,{current_week:0}),g.invalidateQueries(["teams"]),g.invalidateQueries(["settings"]),g.invalidateQueries(["nameMappings"]),g.invalidateQueries(["importBatches"]),g.invalidateQueries(["weeklyResults"]),g.invalidateQueries(["uploadLogs"]),m(!0),h(!1),tt.success("🎉 New season started! All stats have been reset.",{duration:5e3})}catch(y){console.error("Season reset failed:",y),c((y==null?void 0:y.message)||"Something went wrong. Please try again."),h(!1)}};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"rounded-2xl border-2 border-red-200 bg-gradient-to-br from-red-50 to-orange-50 overflow-hidden",children:[i.jsxs("div",{className:"bg-gradient-to-r from-red-600 to-orange-600 px-6 py-4 flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-white/20 flex items-center justify-center flex-shrink-0",children:i.jsx(M1,{className:"w-5 h-5 text-white"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-white font-black text-lg leading-tight",children:"Start a New Season"}),i.jsx("p",{className:"text-red-100 text-sm",children:"One button resets everything for the next season"})]})]}),i.jsxs("div",{className:"px-6 py-5",children:[i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mb-5",children:cD.map((b,y)=>i.jsxs("div",{className:"flex items-start gap-2 text-sm text-slate-700",children:[i.jsx("span",{className:"text-base leading-none mt-0.5",children:b.icon}),i.jsx("span",{children:b.label})]},y))}),i.jsxs(ue,{onClick:w,className:"w-full bg-gradient-to-r from-red-600 to-orange-600 hover:from-red-700 hover:to-orange-700 text-white font-black text-base py-6 rounded-xl shadow-lg shadow-red-200 transition-all hover:scale-[1.01] active:scale-[0.99]",children:[i.jsx(M1,{className:"w-5 h-5 mr-2"}),"Start New Season"]})]})]}),i.jsx(rn,{open:t,onOpenChange:b=>{u||n(b)},children:i.jsxs(en,{className:"max-w-md",children:[i.jsx(vn,{children:i.jsxs(sn,{className:"flex items-center gap-2 text-red-600 text-xl",children:[i.jsx(ba,{className:"w-6 h-6"}),"Start New Season?"]})}),d?i.jsxs("div",{className:"py-6 flex flex-col items-center gap-3 text-center",children:[i.jsx("div",{className:"w-16 h-16 rounded-full bg-green-100 flex items-center justify-center",children:i.jsx(Cn,{className:"w-8 h-8 text-green-600"})}),i.jsx("h3",{className:"text-lg font-bold text-green-800",children:"New Season Started!"}),i.jsx("p",{className:"text-sm text-slate-600",children:"All stats have been reset. Team names and photos are intact."}),i.jsx(ue,{onClick:()=>n(!1),className:"mt-2 bg-green-600 hover:bg-green-700 text-white",children:"Done"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"py-4 space-y-5",children:[i.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-xl p-4 space-y-2",children:[i.jsxs("p",{className:"text-sm font-bold text-red-800 flex items-center gap-1.5",children:[i.jsx(ci,{className:"w-4 h-4"})," This will permanently:"]}),i.jsx("ul",{className:"space-y-1",children:cD.map((b,y)=>i.jsxs("li",{className:"text-sm text-red-700 flex items-start gap-1.5",children:[i.jsx("span",{children:b.icon})," ",b.label]},y))})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Admin PIN"}),i.jsx(Ee,{type:"password",placeholder:"Enter your PIN",value:r,onChange:b=>{s(b.target.value),c("")},className:l&&!r?"border-red-400":""})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(me,{children:["Type ",i.jsx("span",{className:"font-black text-red-600",children:"NEW SEASON"})," to confirm"]}),i.jsx(Ee,{placeholder:"NEW SEASON",value:a,onChange:b=>{o(b.target.value),c("")},className:l&&a.toUpperCase()!=="NEW SEASON"?"border-red-400":""})]}),l&&i.jsxs("p",{className:"text-sm text-red-600 font-medium flex items-center gap-1.5",children:[i.jsx(ba,{className:"w-4 h-4"})," ",l]})]}),i.jsxs(Fr,{className:"gap-2",children:[i.jsx(ue,{variant:"outline",onClick:()=>n(!1),disabled:u,children:"Cancel"}),i.jsx(ue,{onClick:v,disabled:u,className:"bg-red-600 hover:bg-red-700 text-white font-bold",children:u?i.jsxs(i.Fragment,{children:[i.jsx(dr,{className:"w-4 h-4 mr-2 animate-spin"}),"Resetting..."]}):i.jsxs(i.Fragment,{children:[i.jsx(M1,{className:"w-4 h-4 mr-2"}),"Confirm New Season"]})})]})]})]})})]})}function m1(e){if(!e)return"";const t=new Date(e),n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function p1(e){return e?new Date(e).toISOString():""}function jxe(){const[e,t]=O.useState(!1),[n,r]=O.useState(!1),[s,a]=O.useState(!1),[o,l]=O.useState(""),[c,u]=O.useState(""),[h,d]=O.useState(""),[m,g]=O.useState(""),w=mn(),{data:v,isLoading:b}=qe({queryKey:["settings"],queryFn:async()=>{const P=await ae.entities.Settings.list();return P.length===0?await ae.entities.Settings.create({season_name:"Quiz League Season",total_weeks:10,current_week:0,show_handicap_coloring:!0,carousel_visible_rows:5,carousel_scroll_interval:3e3,carousel_pause_duration:2e3,admin_pin:"3190",permanent_app_url:"https://quizleague.base44.app",show_welcome_splash:!0,welcome_message:"Welcome to your ultimate quiz night companion",show_live_visitor_count:!1}):P[0]}}),[y,_]=O.useState({});se.useEffect(()=>{v&&_({...v,permanent_app_url:v.permanent_app_url||"https://quizleague.base44.app",show_welcome_splash:v.show_welcome_splash??!0,welcome_message:v.welcome_message||"Welcome to your ultimate quiz night companion",show_live_visitor_count:v.show_live_visitor_count??!1})},[v]);const N=async()=>
719{if(v!=null&&v.id){t(!0);try{await ae.entities.Settings.update(v.id,y),w.invalidateQueries(["settings"])}catch(P){console.error("Failed to save settings:",P)}t(!1)}},j=async P=>{const A=P.target.files[0];if(A){r(!0);try{const{file_url:F}=await ae.integrations.Core.UploadFile({file:A});_({...y,logo_url:F})}catch(F){console.error("Failed to upload logo:",F)}r(!1)}},S=()=>{a(!0),l(""),u(""),d(""),g("")},C=async()=>{const P=(v==null?void 0:v.admin_pin)||"3190";if(o!==P){g("Current PIN is incorrect");return}if(!c||c.length<4){g("New PIN must be at least 4 characters");return}if(c!==h){g("New PINs do not match");return}if(!(v!=null&&v.id)){g("Settings not loaded");return}try{await ae.entities.Settings.update(v.id,{admin_pin:c}),w.invalidateQueries(["settings"]),a(!1),l(""),u(""),d(""),g(""),alert("Admin PIN changed successfully!")}catch(A){console.error("Failed to change PIN:",A),g("Failed to update PIN. Please try again.")}};return b||!v?i.jsx(Me,{children:i.jsx(Fe,{className:"p-12 text-center",children:i.jsx("p",{className:"text-slate-600",children:"Loading settings..."})})}):i.jsxs(i.Fragment,{children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(VT,{className:"w-5 h-5"}),"League Settings"]})}),i.jsxs(Fe,{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Season Name"}),i.jsx(Ee,{value:y.season_name||"",onChange:P=>_({...y,season_name:P.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Total Weeks in Season"}),i.jsx(Ee,{type:"number",value:y.total_weeks||10,onChange:P=>_({...y,total_weeks:parseInt(P.target.value)||10})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Current Week Number"}),i.jsx(Ee,{type:"number",value:y.current_week||0,onChange:P=>_({...y,current_week:parseInt(P.target.value)||0})}),i.jsx("p",{className:"text-xs text-slate-600",children:"This auto-increments when you import CSV data. Update manually if needed."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Carousel Visible Rows"}),i.jsx(Ee,{type:"number",value:y.carousel_visible_rows||5,onChange:P=>_({...y,carousel_visible_rows:parseInt(P.target.value)||5})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Carousel Scroll Interval (ms)"}),i.jsx(Ee,{type:"number",value:y.carousel_scroll_interval||3e3,onChange:P=>_({...y,carousel_scroll_interval:parseInt(P.target.value)||3e3})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Carousel Pause Duration (ms)"}),i.jsx(Ee,{type:"number",value:y.carousel_pause_duration||2e3,onChange:P=>_({...y,carousel_pause_duration:parseInt(P.target.value)||2e3})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"League Logo"}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Ee,{type:"file",accept:"image/*",onChange:j,disabled:n}),y.logo_url&&i.jsx("img",{src:y.logo_url,alt:"Logo",className:"h-16 object-contain"})]})]}),i.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Show Handicap Coloring"}),i.jsx("p",{className:"text-sm text-slate-600",children:"Color-code teams based on handicap values"})]}),i.jsx(ai,{checked:y.show_handicap_coloring,onCheckedChange:P=>_({...y,show_handicap_coloring:P})})]}),i.jsxs("div",{className:"border-t pt-6",children:[i.jsxs("div",{className:"bg-indigo-50 border border-indigo-200 rounded-lg p-4 mb-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-indigo-900 mb-2",children:"Welcome Splash Screen"}),i.jsx("p",{className:"text-sm text-indigo-800",children:"Configure the welcome screen that appears when users first visit the app."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Show Welcome Splash"}),i.jsx("p",{className:"text-sm text-slate-600",children:"Display welcome screen on first visit"})]}),i.jsx(ai,{checked:y.show_welcome_splash??!0,onCheckedChange:P=>_({...y,show_welcome_splash:P})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"welcome-message",children:"Welcome Message"}),i.jsx(Ee,{id:"welcome-message",value:y.welcome_message||"Welcome to your ultimate quiz night companion",onChange:P=>_({...y,welcome_message:P.target.value}),placeholder:"Welcome to your ultimate quiz night companion"}),i.jsx("p",{className:"text-xs text-slate-600",children:"Customize the welcome message shown below the app title."})]})]})]}),i.jsxs("div",{className:"border-t pt-6",children:[i.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4 mb-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-green-900 mb-2",children:"Analytics & Visitor Tracking"}),i.jsx("p",{className:"text-sm text-green-800",children:"Control visibility of live visitor counts in the app."})]}),i.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Show Live Visitor Count in Hub"}),i.jsx("p",{className:"text-sm text-slate-600",children:'Display "👀 X people viewing now" in Central Hub'})]}),i.jsx(ai,{checked:y.show_live_visitor_count??!1,onCheckedChange:P=>_({...y,show_live_visitor_count:P})})]}),i.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg",children:[i.jsxs("div",{children:[i.jsx(me,{children:'Show "Open in New Tab" Button in Quiz Modal'}),i.jsx("p",{className:"text-sm text-slate-600",children:"Display external link icon to open quiz in separate tab"}),i.jsx("div",{className:`mt-2 inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold transition-all ${y.show_quiz_external_link??!1?"bg-green-100 text-green-700":"bg-slate-100 text-slate-600"}`,children:y.show_quiz_external_link??!1?i.jsxs(i.Fragment,{children:[i.jsx(Id,{className:"w-3 h-3"})," BUTTON VISIBLE"]}):i.jsxs(i.Fragment,{children:[i.jsx(Si,{className:"w-3 h-3"})," BUTTON HIDDEN"]})})]}),i.jsxs("div",{className:"flex items-center bg-white rounded-lg border p-1 shadow-sm",children:[i.jsx("button",{onClick:async()=>
719{if(_(A=>({...A,show_quiz_external_link:!0})),v!=null&&v.id)try{await ae.entities.Settings.update(v.id,{show_quiz_external_link:!0}),w.invalidateQueries(["settings"])}catch(A){console.error(A)}},className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-bold transition-all ${y.show_quiz_external_link??!1?"bg-green-600 text-white shadow-md":"text-slate-500 hover:bg-slate-50"}`,children:"ON"}),i.jsx("button",{onClick:async()=>{if(_(A=>({...A,show_quiz_external_link:!1})),v!=null&&v.id)try{await ae.entities.Settings.update(v.id,{show_quiz_external_link:!1}),w.invalidateQueries(["settings"])}catch(A){console.error(A)}},className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-bold transition-all ${y.show_quiz_external_link??!1?"text-slate-500 hover:bg-slate-50":"bg-red-600 text-white shadow-md"}`,children:"OFF"})]})]}),i.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Show Game Pass Promo Notification"}),i.jsx("p",{className:"text-sm text-slate-600",children:"Display promotional notification for Game Pass purchases"}),i.jsx("div",{className:`mt-2 inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold transition-all ${y.show_game_pass_promo??!1?"bg-green-100 text-green-700":"bg-slate-100 text-slate-600"}`,children:y.show_game_pass_promo??!1?i.jsxs(i.Fragment,{children:[i.jsx(Id,{className:"w-3 h-3"})," PROMO ACTIVE"]}):i.jsxs(i.Fragment,{children:[i.jsx(Si,{className:"w-3 h-3"})," PROMO HIDDEN"]})})]}),i.jsxs("div",{className:"flex items-center bg-white rounded-lg border p-1 shadow-sm",children:[i.jsx("button",{onClick:async()=>{if(_(A=>({...A,show_game_pass_promo:!0})),v!=null&&v.id)try{await ae.entities.Settings.update(v.id,{show_game_pass_promo:!0}),w.invalidateQueries(["settings"])}catch(A){console.error(A)}},className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-bold transition-all ${y.show_game_pass_promo??!1?"bg-green-600 text-white shadow-md":"text-slate-500 hover:bg-slate-50"}`,children:"ON"}),i.jsx("button",{onClick:async()=>{if(_(A=>({...A,show_game_pass_promo:!1})),v!=null&&v.id)try{await ae.entities.Settings.update(v.id,{show_game_pass_promo:!1}),w.invalidateQueries(["settings"])}catch(A){console.error(A)}},className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-bold transition-all ${y.show_game_pass_promo??!1?"text-slate-500 hover:bg-slate-50":"bg-red-600 text-white shadow-md"}`,children:"OFF"})]})]})]}),i.jsxs("div",{className:"border-t pt-6",children:[i.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 mb-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-amber-900 mb-2",children:"🎯 Advertisement Controls"}),i.jsx("p",{className:"text-sm text-amber-800",children:"Control when and how often ads appear to users. Pause ads during live quizzes to avoid distractions."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Enable Advertisements"}),i.jsx("p",{className:"text-sm text-slate-600",children:"Master switch to show/hide all ads globally"})]}),i.jsx(ai,{checked:y.ads_enabled??!0,onCheckedChange:P=>_({...y,ads_enabled:P})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Ad Rotation Interval (seconds)"}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Ee,{type:"number",value:y.ads_rotation_interval||300,onChange:P=>_({...y,ads_rotation_interval:parseInt(P.target.value)||300}),className:"w-32"}),i.jsxs("span",{className:"text-sm text-slate-600",children:["(",Math.floor((y.ads_rotation_interval||300)/60)," minutes ",(y.ads_rotation_interval||300)%60," seconds)"]})]}),i.jsx("p",{className:"text-xs text-slate-600",children:"How often ads rotate/refresh for users. Minimum 60 seconds recommended."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Pause Ads Until (for live quizzes)"}),i.jsx(Ee,{type:"datetime-local",value:m1(y.ads_paused_until),onChange:P=>_({...y,ads_paused_until:p1(P.target.value)||null})}),i.jsx("p",{className:"text-xs text-slate-600",children:"Set a time until which all ads will be hidden. Useful during live quiz sessions."}),y.ads_paused_until&&new Date(y.ads_paused_until)>new Date&&i.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-amber-700 bg-amber-100 px-3 py-2 rounded",children:["⏸️ Ads currently paused until ",new Date(y.ads_paused_until).toLocaleStr
719ing()]})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx(ue,{variant:"outline",onClick:()=>{const P=new Date(Date.now()+36e5).toISOString();_({...y,ads_paused_until:P})},className:"flex-1",children:"⏸️ Pause for 1 Hour"}),i.jsx(ue,{variant:"outline",onClick:()=>{const P=new Date(Date.now()+72e5).toISOString();_({...y,ads_paused_until:P})},className:"flex-1",children:"⏸️ Pause for 2 Hours"}),i.jsx(ue,{variant:"outline",onClick:()=>_({...y,ads_paused_until:null}),className:"flex-1",children:"▶️ Resume Now"})]}),i.jsxs("div",{className:"border-t pt-4 mt-4 space-y-3",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsx(ue,{className:"flex-1 bg-gradient-to-r from-green-600 to-emerald-600 hover:from-green-700 hover:to-emerald-700 text-white font-bold",onClick:async()=>{if(v!=null&&v.id)try{await ae.entities.Settings.update(v.id,{ad_push_active:!0,ad_trigger_timestamp:new Date().toISOString()}),w.invalidateQueries(["settings"]),window.dispatchEvent(new CustomEvent("force-show-ad")),tt.success("🚀 Ad pushed live to all users!",{description:"Your advertisement is now showing to everyone",duration:4e3})}catch(P){tt.error("Failed to push ad: "+P.message)}},children:"🚀 PUSH AD LIVE"}),i.jsx(ue,{variant:"destructive",className:"flex-1",onClick:async()=>{if(v!=null&&v.id)try{await ae.entities.Settings.update(v.id,{ad_push_active:!1,force_close_trigger:new Date().toISOString()}),w.invalidateQueries(["settings"]),tt.success("🛑 Ad retracted from all users",{description:"All active advertisements have been closed",duration:4e3})}catch(P){tt.error("Failed to retract ad: "+P.message)}},children:"🛑 RETRACT AD"})]}),i.jsx("p",{className:"text-xs text-slate-600 text-center",children:"Push shows ad to all users immediately. Retract closes all active ads."})]})]})]}),i.jsxs("div",{className:"border-t pt-6",children:[i.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(oB,{className:"w-5 h-5 text-indigo-600"}),i.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Live Quiz Settings"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(me,{htmlFor:"show-live-tile",className:"text-sm font-medium",children:"Show Live Quiz Tile"}),i.jsx(ai,{id:"show-live-tile",checked:y.show_live_quiz_tile??!1,onCheckedChange:P=>_({...y,show_live_quiz_tile:P})})]})]}),i.jsx("div",{className:"bg-indigo-50 border border-indigo-200 rounded-lg p-4 mb-4",children:i.jsx("p",{className:"text-sm text-indigo-900",children:"Configure the QR codes and countdown that appear on the public leaderboard. Update the quiz URL weekly."})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"quiz-title",children:"Quiz Title"}),i.jsx(Ee,{id:"quiz-title",value:y.quiz_title||"",onChange:P=>_({...y,quiz_title:P.target.value}),placeholder:"e.g. Monday's Quiz, Thursday Night Special"}),i.jsx("p",{className:"text-xs text-slate-600",children:"Custom title displayed above the QR code. Leave empty to auto-generate from next quiz time."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"current-quiz-url",children:"Current Quiz URL (Updated Weekly)"}),i.jsx(Ee,{id:"current-quiz-url",type:"url",value:y.current_quiz_url||"",onChange:P=>_({...y,current_quiz_url:P.target.value}),placeholder:"https://playvgn.com/quiz/abc123"}),i.jsx("p",{className:"text-xs text-slate-600",children:"Paste the URL for this week's live quiz. QR code appears in bottom-left of leaderboard when set."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"next-quiz-time",children:"Next Quiz Start Time (Leaderboard Countdown)"}),i.jsx(Ee,{id:"next-quiz-time",type:"datetime-local",value:m1(y.next_quiz_start_time),onChange:P=>_({...y,next_quiz_start_time:p1(P.target.value)})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"live-quiz-start",children:"Live Quiz Start Time (Hub Pulse)"}),i.jsx(Ee,{id:"live-quiz-start",type:"datetime-local",value:m1(y.live_quiz_start_time),onChange:P=>_({...y,live_quiz_start_time:p1(P.target.value)})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"live-quiz-end",children:"Live Quiz End Time (Hub Pulse)"}),i.jsx(Ee,{id:"live-quiz-end",type:"datetime-local",value:m1(y.live_quiz_end_time),onChange:P=>_({...y,live_quiz_end_time:p1(P.target.value)})})]})]}),i.jsx("p",{className:"text-xs text-slate-600",children:'Set the start and end times for the "Live Quiz" button in the Hub to pulse. The URL used is the "Current Quiz URL" above.'}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"permanent-app-url",children:"Permanent App 
719URL"}),i.jsx(Ee,{id:"permanent-app-url",type:"url",value:y.permanent_app_url||"https://quizleague.base44.app",onChange:P=>_({...y,permanent_app_url:P.target.value}),placeholder:"https://quizleague.base44.app"}),i.jsx("p",{className:"text-xs text-slate-600",children:"QR code for the Quiz League app itself (bottom-right). Defaults to https://quizleague.base44.app"})]})]})]}),i.jsx("div",{className:"flex gap-4",children:i.jsxs(ue,{onClick:N,disabled:e,className:"flex-1",children:[i.jsx(Hy,{className:"w-4 h-4 mr-2"}),e?"Saving...":"Save Settings"]})}),i.jsx("div",{className:"border-t pt-6",children:i.jsxs("div",{className:"flex items-center justify-between p-4 bg-blue-50 rounded-lg border border-blue-200",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 font-semibold text-blue-900 mb-1",children:[i.jsx(cS,{className:"w-4 h-4"}),"Change Admin PIN"]}),i.jsx("p",{className:"text-sm text-blue-700",children:"Update the PIN required to access admin dashboard"})]}),i.jsxs(ue,{onClick:S,variant:"outline",children:[i.jsx(no,{className:"w-4 h-4 mr-2"}),"Change PIN"]})]})}),i.jsx("div",{className:"border-t pt-6",children:i.jsx(wxe,{settings:v})})]})]}),i.jsx(rn,{open:s,onOpenChange:a,children:i.jsxs(en,{children:[i.jsx(vn,{children:i.jsxs(sn,{className:"flex items-center gap-2",children:[i.jsx(cS,{className:"w-5 h-5"}),"Change Admin PIN"]})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"current-pin",children:"Current PIN *"}),i.jsx(Ee,{id:"current-pin",type:"password",value:o,onChange:P=>{l(P.target.value),g("")},placeholder:"****"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"new-pin",children:"New PIN *"}),i.jsx(Ee,{id:"new-pin",type:"password",value:c,onChange:P=>{u(P.target.value),g("")},placeholder:"****"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"confirm-pin",children:"Confirm New PIN *"}),i.jsx(Ee,{id:"confirm-pin",type:"password",value:h,onChange:P=>{d(P.target.value),g("")},placeholder:"****"})]}),m&&i.jsx(vr,{variant:"destructive",children:i.jsx(xr,{children:m})})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),i.jsxs(ue,{onClick:C,children:[i.jsx(cS,{className:"w-4 h-4 mr-2"}),"Update PIN"]})]})]})})]})}function ui(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function zd(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function GW(e,t){const n=ui(e);return isNaN(t)?zd(e,NaN):(t&&n.setDate(n.getDate()+t),n)}const QW=6048e5,_xe=864e5,YW=6e4,XW=36e5;let Nxe={};function dN(){return Nxe}function ey(e,t){var l,c,u,h;const n=dN(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,s=ui(e),a=s.getDay(),o=(a<r?7:0)+a-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function jj(e){return ey(e,{weekStartsOn:1})}function ZW(e){const t=ui(e),n=t.getFullYear(),r=zd(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=jj(r),a=zd(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const o=jj(a);return t.getTime()>=s.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Ad(e){const t=ui(e);return t.setHours(0,0,0,0),t}function uD(e){const t=ui(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function JW(e,t){const n=Ad(e),r=Ad(t),s=+n-uD(n),a=+r-uD(r);return Math.round((s-a)/_xe)}function Sxe(e){const t=ZW(e),n=zd(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),jj(n)}function kxe(e,t){const n=Ad(e),r=Ad(t);return+n==+r}function Exe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}
vendor: 18,876 bytes, line 719
719function Pxe(e){if(!Exe(e)&&typeof e!="number")return!1;const t=ui(e);return!isNaN(Number(t))}function Cxe(e,t){const n=ui(e),r=ui(t),s=dD(n,r),a=Math.abs(JW(n,r));n.setDate(n.getDate()-s*a);const o=+(dD(n,r)===-s),l=s*(a-o);return l===0?0:l}function dD(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function fD(e){const t=ui(e);return t.setHours(23,59,59,999),t}function Axe(e){const t=ui(e),n=zd(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Oxe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Txe=(e,t,n)=>{let r;const s=Oxe[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function QS(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Rxe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Mxe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ixe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Dxe={date:QS({formats:Rxe,defaultWidth:"full"}),time:QS({formats:Mxe,defaultWidth:"full"}),dateTime:QS({formats:Ixe,defaultWidth:"full"})},Lxe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Fxe=(e,t,n,r)=>Lxe[e];function e0(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;s=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return s[a]}}const $xe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qxe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},zxe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Bxe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Uxe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Vxe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Wxe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Hxe={ordinalNumber:Wxe,era:e0({values:$xe,defaultWidth:"wide"}),quarter:e0({values:qxe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:e0({values:zxe,defaultWidth:"wide"}),day:e0({values:Bxe,defaultWidth:"wide"}),dayPeriod:e0({values:Uxe,defaultWidth:"wide",formattingValues:Vxe,defaultFormattingWidth:"wide"})};function t0(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(s);if(!a)return null;const o=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?Gxe(l,d=>d.test(o)):Kxe(l,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const h=t.slice(o.length);return{value:u,rest:h}}}function Kxe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Gxe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Qxe(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(s.length);return{value:o,rest:l}}}const Yxe=/^(\d+)(th|st|nd|rd)?/i,Xxe=/\d+/i,Zxe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Jxe={any:[/^b/i,/^(a|c)/i]},e0e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},t0e={any:[/1/i,/2/i,/3/i,/4/i]},n0e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},r0e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},i0e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},s0e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},a0e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},o0e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},l0e={ordinalNumber:Qxe({matchPattern:Yxe,parsePattern:Xxe,valueCallback:e=>parseInt(e,10)}),era:t0({matchPatterns:Zxe,defaultMatchWidth:"wide",parsePatterns:Jxe,defaultParseWidth:"any"}),quarter:t0({matchPatterns:e0e,defaultMatchWidth:"wide",parsePatterns:t0e,defaultParseWidth:"any",valueCallback:e=>e+1}),month:t0({matchPatterns:n0e,defaultMatchWidth:"wide",parsePatterns:r0e,defaultParseWidth:"any"}),day:t0({matchPatterns:i0e,defaultMatchWidth:"wide",parsePatterns:s0e,defaultParseWidth:"any"}),dayPeriod:t0({matchPatterns:a0e,defaultMatchWidth:"any",parsePatterns:o0e,defaultParseWidth:"any"})},c0e={code:"en-US",formatDistance:Txe,formatLong:Dxe,formatRelative:Fxe,localize:Hxe,match:l0e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function u0e(e){const t=ui(e);return JW(t,Axe(t))+1}function d0e(e){const t=ui(e),n=+jj(t)-+Sxe(t);return Math.round(n/QW)+1}function eH(e,t){var h,d,m,g;const n=ui(e),r=n.getFullYear(),s=dN(),a=(t==null?void 0:t.firstWeekContainsDate)??((d=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(m=s.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??1,o=zd(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);const l=ey(o,t),c=zd(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);const u=ey(c,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function f0e(e,t){var l,c,u,h;const n=dN(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,s=eH(e,t),a=zd(e,0);return a.setFullYear(s,0,r),a.setHours(0,0,0,0),ey(a,t)}function h0e(e,t){const n=ui(e),r=+ey(n,t)-+f0e(n,t);return Math.round(r/QW)+1}function qn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const rd={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return qn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):qn(n+1,2)},d(e,t){return qn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return qn(e.getHours()%12||12,t.length)},H(e,t){return qn(e.getHours(),t.length)},m(e,t){return qn(e.getMinutes(),t.length)},s(e,t){return qn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return qn(s,t.length)}},Rp={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},hD={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return rd.y(e,t)},Y:function(e,t,n,r){const s=eH(e,r),a=s>0?s:1-s;if(t==="YY"){const o=a%100;return qn(o,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):qn(a,t.length)},R:function(e,t){const n=ZW(e);return qn(n,t.length)},u:function(e,t){const n=e.getFullYear();return qn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return qn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return qn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return rd.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return qn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=h0e(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):qn(s,t.length)},I:function(e,t,n){const r=d0e(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):qn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):rd.d(e,t)},D:function(e,t,n){const r=u0e(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):qn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),a=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return qn(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),a=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return qn(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return qn(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=Rp.noon:r===0?s=Rp.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=Rp.evening:r>=12?s=Rp.afternoon:r>=4?s=Rp.morning:s=Rp.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return rd.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):rd.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):qn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):qn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):rd.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):rd.s(e,t)},S:function(e,t){return rd.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return pD(r);case"XXXX":case"XX":return rh(r);case"XXXXX":case"XXX":default:return rh(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return pD(r);case"xxxx":case"xx":return rh(r);case"xxxxx":case"xxx":default:return rh(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+mD(r,":");case"OOOO":default:return"GMT"+rh(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+mD(r,":");case"zzzz":default:return"GMT"+rh(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return qn(r,t.length)},T:function(e,t,n){const r=e.getTime();return qn(r,t.length)}};function mD(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),a=r%60;return a===0?n+String(s):n+String(s)+t+qn(a,2)}function pD(e,t){return e%60===0?(e>0?"-":"+")+qn(Math.abs(e)/60,2):rh(e,t)}function rh(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=qn(Math.trunc(r/60),2),a=qn(r%60,2);return n+s+t+a}const gD=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},tH=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},m0e=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return gD(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",gD(r,t)).replace("{{time}}",tH(s,t))},p0e={p:tH,P:m0e},g0e=/^D+$/,v0e=/^Y+$/,x0e=["D","DD","YY","YYYY"];function y0e(e){return g0e.test(e)}function b0e(e){return v0e.test(e)}function w0e(e,t,n){const r=j0e(e,t,n);if(console.warn(r),x0e.includes(e))throw new RangeError(r)}function j0e(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const _0e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,N0e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,S0e=/^'([^]*?)'?$/,k0e=/''/g,E0e=/[a-zA-Z]/;function Ut(e,t,n){var h,d,m,g;const r=dN(),s=r.locale??c0e,a=r.firstWeekContainsDate??((d=(h=r.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??1,o=r.weekStartsOn??((g=(m=r.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,l=ui(e);if(!Pxe(l))throw new RangeError("Invalid time value");let c=t.match(N0e).map(w=>{const v=w[0];if(v==="p"||v==="P"){const b=p0e[v];return b(w,s.formatLong)}return w}).join("").match(_0e).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const v=w[0];if(v==="'")return{isToken:!1,value:P0e(w)};if(hD[v])return{isToken:!0,value:w};
719if(v.match(E0e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:w}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const u={firstWeekContainsDate:a,weekStartsOn:o,locale:s};return c.map(w=>{if(!w.isToken)return w.value;const v=w.value;(b0e(v)||y0e(v))&&w0e(v,t,String(e));const b=hD[v[0]];return b(l,v,s.localize,u)}).join("")}function P0e(e){const t=e.match(S0e);return t?t[1].replace(k0e,"'"):e}function C0e(e,t){const n=ui(e),r=ui(t);return n.getTime()>r.getTime()}function A0e(e,t){const n=ui(e),r=ui(t);return+n<+r}function b0(e,t){return GW(e,-t)}function zp(e,t){const r=M0e(e);let s;if(r.date){const c=I0e(r.date,2);s=D0e(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const a=s.getTime();let o=0,l;if(r.time&&(o=L0e(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(l=F0e(r.timezone),isNaN(l))return new Date(NaN)}else{const c=new Date(a+o),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(a+o+l)}const g1={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},O0e=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,T0e=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,R0e=/^([+-])(\d{2})(?::?(\d{2}))?$/;function M0e(e){const t={},n=e.split(g1.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],g1.timeZoneDelimiter.test(t.date)&&(t.date=e.split(g1.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const s=g1.timezone.exec(r);s?(t.time=r.replace(s[1],""),t.timezone=s[1]):t.time=r}return t}function I0e(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const s=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?s:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function D0e(e,t){if(t===null)return new Date(NaN);const n=e.match(O0e);if(!n)return new Date(NaN);const r=!!n[4],s=n0(n[1]),a=n0(n[2])-1,o=n0(n[3]),l=n0(n[4]),c=n0(n[5])-1;if(r)return U0e(t,l,c)?$0e(t,l,c):new Date(NaN);{const u=new Date(0);return!z0e(t,a,o)||!B0e(t,s)?new Date(NaN):(u.setUTCFullYear(t,a,Math.max(s,o)),u)}}function n0(e){return e?parseInt(e):1}function L0e(e){const t=e.match(T0e);if(!t)return NaN;const n=YS(t[1]),r=YS(t[2]),s=YS(t[3]);return V0e(n,r,s)?n*XW+r*YW+s*1e3:NaN}function YS(e){return e&&parseFloat(e.replace(",","."))||0}function F0e(e){if(e==="Z")return 0;const t=e.match(R0e);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return W0e(r,s)?n*(r*XW+s*YW):NaN}function $0e(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const s=r.getUTCDay()||7,a=(t-1)*7+n+1-s;return r.setUTCDate(r.getUTCDate()+a),r}const q0e=[31,null,31,30,31,30,31,31,30,31,30,31];function nH(e){return e%400===0||e%4===0&&e%100!==0}function z0e(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(q0e[t]||(nH(e)?29:28))}function B0e(e,t){return t>=1&&t<=(nH(e)?366:365)}function U0e(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function V0e(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function W0e(e,t){return t>=0&&t<=59}function H0e(){const[e,t]=O.useState("all"),[n,r]=O.useState(""),[s,a]=O.useState(null),[o,l]=O.useState(""),[c,u]=O.useState(""),h=mn(),{data:d=[]}=qe({queryKey:["teamIssues"],queryFn:()=>ae.entities.TeamIssue.list()}),{data:m=[]}=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list()}),g=d.filter(N=>{var C,P;const j=e==="all"||N.status===e,S=!n||((C=N.team_name_snapshot)==null?void 0:C.toLowerCase().includes(n.toLowerCase()))||((P=N.email)==null?void 0:P.toLowerCase().includes(n.toLowerCase()));return j&&S}).sort((N,j)=>new Date(j.created_date)-new Date(N.created_date)),w=d.filter(N=>N.status==="open").length,v=N=>{const j={open:{color:"bg-red-100 text-red-800",icon:Sn},in_progress:{color:"bg-blue-100 text-blue-800",icon:rs},resolved:{color:"bg-green-100 text-green-800",icon:Cn},rejected:{color:"bg-slate-100 text-slate-800",icon:ya}},{color:S,icon:C}=j[N]||j.open;return i.jsxs(nt,{className:`${S} flex items-center gap-1`,children:[i.jsx(C,{className:"w-3 h-3"}),N]})},b=N=>{a(N),l(N.admin_notes||""),u(N.status)},y=async()=>
719{if(!s)return;const N={status:c,admin_notes:o};c==="resolved"&&s.status!=="resolved"&&(N.resolved_at=new Date().toISOString()),await ae.entities.TeamIssue.update(s.id,N),h.invalidateQueries(["teamIssues"]),a(null)},_=async()=>{s&&(await ae.entities.TeamIssue.update(s.id,{status:"resolved",resolved_at:new Date().toISOString(),admin_notes:o}),h.invalidateQueries(["teamIssues"]),a(null))};return i.jsxs(i.Fragment,{children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsx(at,{className:"flex items-center justify-between",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{children:"Team Issues"}),w>0&&i.jsxs(nt,{className:"bg-red-500 text-white",children:[w," Open"]})]})})}),i.jsxs(Fe,{className:"space-y-4",children:[i.jsxs("div",{className:"flex gap-4 items-center",children:[i.jsx("div",{className:"flex-1",children:i.jsx(Ee,{placeholder:"Search by team name or email...",value:n,onChange:N=>r(N.target.value)})}),i.jsxs(Xt,{value:e,onValueChange:t,children:[i.jsx(Ht,{className:"w-48",children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"all",children:"All Status"}),i.jsx(Ie,{value:"open",children:"Open"}),i.jsx(Ie,{value:"in_progress",children:"In Progress"}),i.jsx(Ie,{value:"resolved",children:"Resolved"}),i.jsx(Ie,{value:"rejected",children:"Rejected"})]})]})]}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs(Qo,{children:[i.jsx(Yo,{children:i.jsxs(tr,{children:[i.jsx(ht,{children:"Created"}),i.jsx(ht,{children:"Team Name"}),i.jsx(ht,{children:"Email"}),i.jsx(ht,{children:"Category"}),i.jsx(ht,{children:"Status"}),i.jsx(ht,{children:"Actions"})]})}),i.jsx(Xo,{children:g.length===0?i.jsx(tr,{children:i.jsx(it,{colSpan:6,className:"text-center text-slate-500 py-8",children:"No issues found"})}):g.map(N=>i.jsxs(tr,{className:"hover:bg-slate-50",children:[i.jsx(it,{className:"text-sm",children:Ut(new Date(N.created_date),"MMM d, yyyy")}),i.jsx(it,{className:"font-semibold",children:N.team_name_snapshot}),i.jsx(it,{className:"text-sm",children:N.email}),i.jsx(it,{children:i.jsx(nt,{variant:"outline",children:N.category})}),i.jsx(it,{children:v(N.status)}),i.jsx(it,{children:i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>b(N),children:"View Details"})})]},N.id))})]})})]})]}),i.jsx(rn,{open:!!s,onOpenChange:()=>a(null),children:i.jsxs(en,{className:"max-w-3xl",children:[i.jsx(vn,{children:i.jsx(sn,{children:"Issue Details"})}),s&&i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{className:"text-slate-600",children:"Team Name"}),i.jsxs("div",{className:"font-semibold text-lg flex items-center gap-2",children:[s.team_name_snapshot,i.jsx(ue,{size:"icon",variant:"ghost",className:"h-6 w-6",title:"View team in Teams & Stats",children:i.jsx(ws,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{children:[i.jsx(me,{className:"text-slate-600",children:"Status"}),i.jsx("div",{className:"mt-1",children:v(s.status)})]}),i.jsxs("div",{children:[i.jsx(me,{className:"text-slate-600",children:"Email"}),i.jsx("div",{className:"font-medium",children:s.email})]}),i.jsxs("div",{children:[i.jsx(me,{className:"text-slate-600",children:"Category"}),i.jsx("div",{className:"font-medium",children:s.category})]}),i.jsxs("div",{children:[i.jsx(me,{className:"text-slate-600",children:"Created"}),i.jsx("div",{className:"text-sm",children:Ut(new Date(s.created_date),"MMM d, yyyy h:mm a")})]}),s.quiz_date&&i.jsxs("div",{children:[i.jsx(me,{className:"text-slate-600",children:"Quiz Date"}),i.jsx("div",{className:"font-medium",children:Ut(new Date(s.quiz_date),"MMM d, yyyy")})]})]}),i.jsxs("div",{children:[i.jsx(me,{className:"text-slate-600",children:"Message"}),i.jsx("div",{className:"mt-2 p-4 bg-slate-50 rounded-lg border",children:s.message})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"status",children:"Update Status"}),i.jsxs(Xt,{value:c,onValueChange:u,children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"open",children:"Open"}),i.jsx(Ie,{value:"in_progress",children:"In Progress"}),i.jsx(Ie,{value:"resolved",children:"Resolved"}),i.jsx(Ie,{value:"rejected",children:"Rejected"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"admin-notes",children:"Admin Notes (Internal)"}),i.jsx(nr,{id:"admin-notes",value:o,onChange:N=>l(N.target.value),placeholder:"Add internal notes about this issue...",rows:3})]}),s.resolved_at&&i.jsxs("div",{className:"text-sm text-slate-600",children:["Resolved: ",Ut(new Date(s.resolved_at),"MMM d, yyyy h:mm a")]})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:()=>a(null),children:"Close"}),i.jsx(ue,{onClick:y,children:"Update Issue"}),(s==null?void 0:s.status)!=="resolved"&&i.jsxs(ue,{onClick:_,className:"bg-green-600 hover:bg-green-700",children:[i.jsx(Cn,{className:"w-4 h-4 mr-2"}),"Mark as Resolved"]})]})]})})]})}const fN=({event:e,isOpen:t,onClose:n,currentUser:r,onPurchase:s})=>{var h;const[a,o]=O.useState(!1),[l,c]=O.useState(null),u=async()=>{o(!0),c(null);try{await s(e)}catch(d){c(d.message),o(!1)}};return i.jsx(rn,{open:t,onOpenChange:n,children:i.jsxs(en,{className:"sm:max-w-md bg-slate-900 text-white border-slate-700 z-[10010] [&>button]:hidden",children:[i.jsx("div",{className:"absolute right-0 top-0 pr-2 pt-2 z-50",children:i.jsx("button",{onClick:n,className:"p-3 rounded-full hover:bg-white/10 text-slate-400 hover:text-white transition-colors focus:outline-none","aria-label":"Close",children:i.jsx(Si,{className:"w-6 h-6"})})}),i.jsxs(vn,{children:[i.jsxs(sn,{className:"text-xl font-bold flex items-center gap-2",children:[i.jsx(_s,{className:"w-5 h-5 text-amber-500"}),"Unlock Event Access"]}),i.jsx(Kl,{className:"text-slate-400",children:e.title})]}),r?i.jsxs("div",{className:"py-4 space-y-6",children:[i.jsxs("div",{className:"flex flex-col items-center justify-center space-y-2",children:[i.jsx("div",{className:"text-3xl font-bold text-amber-400",children:e.price===0?"FREE":`€${(h=e.price)==null?void 0:h.toFixed(2)}`}),i.jsx("div",{className:"text-xs text-slate-400",children:e.price===0?"Free event access":"One-time access fee"})]}),l&&i.jsxs("div",{className:"bg-red-900/20 border border-red-900/50 p-3 rounded-lg text-red-400 text-sm flex items-center gap-2",children:[i.jsx(Sn,{className:"w-4 h-4"}),l]}),i.jsx(ue,{onClick:u,disabled:a,className:`w-full h-12 text-lg font-medium transition-all text-white ${e.price===0?"bg-green-600 hover:bg-green-700":"bg-[#635BFF] hover:bg-[#5851DB]"}`,children:a?i.jsxs(i.Fragment,{children:[i.jsx(dr,{className:"w-5 h-5 mr-2 animate-spin"})," ",e.price===0?"Joining...":"Redirecting..."]}):i.jsxs(i.Fragment,{children:[e.price===0?"Join Event Now":"Pay & Play",e.price===0?i.jsx(_s,{className:"w-4 h-4 ml-2 opacity-70"}):i.jsx(no,{className:"w-4 h-4 ml-2 opacity-70"})]})}),e.price>0&&i.jsx("p",{className:"text-center text-xs text-slate-500",children:"Secure payment processing powered by Stripe"})]}):i.jsxs("div",{className:"py-6 space-y-6",children:[i.jsxs("div",{className:"text-center space-y-2",children:[i.jsx("p",{className:"text-slate-200 text-lg font-medium",children:"Sign in to continue"}
719),i.jsx("p",{className:"text-slate-400 text-sm",children:"Quick and secure with Google"})]}),i.jsxs("div",{className:"bg-slate-800/50 rounded-lg p-4 space-y-2 border border-slate-700/50",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-300",children:[i.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Secure Google authentication"]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-300",children:[i.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Your data is never sold or shared"]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-300",children:[i.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Bank-level encryption"]})]}),i.jsx(ue,{onClick:()=>ae.auth.redirectToLogin(),className:"w-full bg-indigo-600 hover:bg-indigo-700 h-12 text-base font-semibold",children:"Continue with Google"})]})]})})};function K0e(){const[e,t]=O.useState(!1),[n,r]=O.useState(null),[s,a]=O.useState(null),[o,l]=O.useState(!1),[c,u]=O.useState({title:"",description:"",category:"Other",start_datetime:"",end_datetime:"",venue_name:"",location:"",external_link:"",image_url:"",price:0,game_url:"",repeat_type:"none",repeat_day_of_week:"",repeat_days_of_week:[],repeat_end_date:"",status:"upcoming",is_active:!0}),h=mn(),{data:d=[]}=qe({queryKey:["events"],queryFn:()=>ae.entities.Event.list()}),m=d.filter(j=>j.status!=="completed"&&j.status!=="cancelled").sort((j,S)=>new Date(j.start_datetime)-new Date(S.start_datetime)),g=d.filter(j=>j.status==="completed"||j.status==="cancelled").sort((j,S)=>new Date(S.start_datetime)-new Date(j.start_datetime)),w=(j=null)=>{j?(r(j),u({title:j.title||"",description:j.description||"",category:j.category||"Other",start_datetime:j.start_datetime||"",end_datetime:j.end_datetime||"",venue_name:j.venue_name||"",location:j.location||"",external_link:j.external_link||"",image_url:j.image_url||"",price:j.price||0,game_url:j.game_url||"",repeat_type:j.repeat_type||"none",repeat_day_of_week:j.repeat_day_of_week||"",repeat_days_of_week:j.repeat_days_of_week||[],repeat_end_date:j.repeat_end_date||"",status:j.status||"upcoming",is_active:j.is_active!==!1})):(r(null),u({title:"",description:"",category:"Other",start_datetime:"",end_datetime:"",venue_name:"",location:"",external_link:"",image_url:"",price:0,game_url:"",repeat_type:"none",repeat_day_of_week:"",repeat_days_of_week:[],repeat_end_date:"",status:"upcoming",is_active:!0})),t(!0)},v=async j=>{const S=j.target.files[0];if(S){l(!0);try{const{file_url:C}=await ae.integrations.Core.UploadFile({file:S});u({...c,image_url:C})}catch(C){console.error("Failed to upload image:",C)}l(!1)}},b=async()=>{var S;if(!c.title||!c.start_datetime){alert("Please fill in the title and start date/time");return}const j={...c};j.repeat_type==="none"?(delete j.repeat_day_of_week,delete j.repeat_days_of_week,delete j.repeat_end_date):j.repeat_type==="weekly"&&((S=j.repeat_days_of_week)==null?void 0:S.length)>0?delete j.repeat_day_of_week:j.repeat_type==="weekly"&&j.repeat_day_of_week&&delete j.repeat_days_of_week,n?await ae.entities.Event.update(n.id,j):await ae.entities.Event.create(j),h.invalidateQueries(["events"]),t(!1)},y=async j=>{confirm("Are you sure you want to delete this event?")&&(await ae.entities.Event.delete(j),h.invalidateQueries(["events"]))},_=async j=>{confirm(`Mark "${j.title}" as completed?`)&&(await ae.entities.Event.update(j.id,{status:"completed",completed_date:new Date().toISOString()}),h.invalidateQueries(["events"]))},N=async j=>{var S;if(confirm(`Promote "${j.title}" across the app? This will replace any current promo.`)){const P=(S=(await ae.entities.Settings.list())[0])==null?void 0:S.id;P&&(await ae.entities.Settings.update(P,{promo_active:!0,promo_event_id:j.id,promo_raffle_id:null,promo_trigger_timestamp:new Date().toISOString()}),alert("Promo pushed successfully!"))}};return i.jsxs(i.Fragment,{children:[s&&i.jsx(fN,{event:s,isOpen:!!s,onClose:()=>a(null),currentUser:{email:"[email protected]",id:"admin"},onPurchase:()=>alert("This is just a preview.")}),i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Fn,{className:"w-5 h-5"}),"Upcoming Events"]}),i.jsxs(ue,{onClick:()=>w(),size:"sm",children:[i.jsx(li,{className:"w-4 h-4 mr-2"}),"Add Event"]})]})}),i.jsx(Fe,{children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs(Qo,{children:[i.jsx(Yo,{children:i.jsxs(tr,{children:[i.jsx(ht,{children:"Title"}),i.jsx(ht,{children:"Category"}),i.jsx(ht,{children:"Start Date/Time"}),i.jsx(ht,{children:"Price"}),i.jsx(ht,{children:"Venue"}),i.jsx(ht,{children:"Repeat"}),i.jsx(ht,{children:"Status"}),i.jsx(ht,{children:"Actions"})]})}),i.jsx(Xo,{children:m.length===0?i.jsx(tr,{children:i.jsx(it,{colSpan:8,className:"text-center text-slate-500 py-8",children:"No upcoming events. Add your first event!"})}):m.map(j=>{var S;return i.jsxs(tr,{children:[i.jsx(it,{className:"font-semibold",children:j.title}),i.jsx(it,{children:i.jsx(nt,{variant:"outline",children:j.category})}),i.jsx(it,{children:Ut(new Date(j.start_datetime),"MMM d, yyyy h:mm a")}),i.jsx(it,{children:j.price>0?`€${j.price}`:"Free"}),i.jsx(it,{children:j.venue_name||"-"}),i.jsx(it,{children:j.repeat_type==="weekly"?((S=j.repeat_days_of_week)==null?void 0:S.length)>0?i.jsxs(nt,{variant:"outline",children:["Weekly - ",j.repeat_days_of_week.join(", ")
719]}):i.jsxs(nt,{variant:"outline",children:["Weekly - ",j.repeat_day_of_week]}):j.repeat_type==="daily"?i.jsx(nt,{variant:"outline",children:"Daily"}):j.repeat_type==="monthly"?i.jsx(nt,{variant:"outline",children:"Monthly"}):i.jsx(nt,{variant:"outline",children:"One-time"})}),i.jsx(it,{children:i.jsx(nt,{className:j.status==="live"?"bg-green-600":j.status==="completed"?"bg-slate-600":j.status==="cancelled"?"bg-red-600":"bg-blue-600",children:j.status})}),i.jsx(it,{children:i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{size:"sm",variant:"outline",title:"Mark Complete",onClick:()=>_(j),className:"text-green-600 border-green-200 hover:bg-green-50",children:i.jsx(Cn,{className:"w-4 h-4"})}),i.jsx(ue,{size:"sm",variant:"outline",title:"Preview",onClick:()=>a(j),className:"text-indigo-600 border-indigo-200 hover:bg-indigo-50",children:i.jsx(du,{className:"w-4 h-4"})}),i.jsx(ue,{size:"sm",variant:"outline",title:"Push Promo",onClick:()=>N(j),className:"text-amber-600 border-amber-200 hover:bg-amber-50",children:i.jsx(gg,{className:"w-4 h-4"})}),i.jsx(ue,{size:"sm",variant:"outline",title:"Edit",onClick:()=>w(j),children:i.jsx(cM,{className:"w-4 h-4"})}),i.jsx(ue,{size:"sm",variant:"destructive",title:"Delete",onClick:()=>y(j.id),children:i.jsx(ci,{className:"w-4 h-4"})})]})})]},j.id)})})]})})})]}),g.length>0&&i.jsxs(Me,{className:"mt-6",children:[i.jsx(st,{children:i.jsxs(at,{className:"text-lg",children:["Past Events (",g.length,")"]})}),i.jsx(Fe,{children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs(Qo,{children:[i.jsx(Yo,{children:i.jsxs(tr,{children:[i.jsx(ht,{children:"Title"}),i.jsx(ht,{children:"Category"}),i.jsx(ht,{children:"Date"}),i.jsx(ht,{children:"Status"}),i.jsx(ht,{children:"Actions"})]})}),i.jsx(Xo,{children:g.map(j=>i.jsxs(tr,{className:"opacity-60",children:[i.jsx(it,{className:"font-semibold",children:j.title}),i.jsx(it,{children:i.jsx(nt,{variant:"outline",children:j.category})}),i.jsx(it,{children:Ut(new Date(j.start_datetime),"MMM d, yyyy")}),i.jsx(it,{children:i.jsx(nt,{className:j.status==="completed"?"bg-slate-600":"bg-red-600",children:j.status})}),i.jsx(it,{children:i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{size:"sm",variant:"outline",title:"Edit",onClick:()=>w(j),children:i.jsx(cM,{className:"w-4 h-4"})}),i.jsx(ue,{size:"sm",variant:"destructive",title:"Delete",onClick:()=>y(j.id),children:i.jsx(ci,{className:"w-4 h-4"})})]})})]},j.id))})]})})})]}),i.jsx(rn,{open:e,onOpenChange:t,children:i.jsxs(en,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[i.jsx(vn,{children:i.jsx(sn,{children:n?"Edit Event":"Add New Event"})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"title",children:"Title *"}),i.jsx(Ee,{id:"title",value:c.title,onChange:j=>u({...c,title:j.target.value}),placeholder:"e.g. Cove Monday Quiz"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"category",children:"Category"}),i.jsxs(Xt,{value:c.category,onValueChange:j=>u({...c,category:j}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"Quiz Night",children:"Quiz Night"}),i.jsx(Ie,{value:"Live Music",children:"Live Music"}),i.jsx(Ie,{value:"Sports Event",children:"Sports Event"}),i.jsx(Ie,{value:"Special Event",children:"Special Event"}),i.jsx(Ie,{value:"Private Function",children:"Private Function"}),i.jsx(Ie,{value:"Other",children:"Other"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"description",children:"Description"}),i.jsx(nr,{id:"description",value:c.description,onChange:j=>u({...c,description:j.target.value}),placeholder:"Event details...",rows:3})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"status",children:"Status"}),i.jsxs(Xt,{value:c.status,onValueChange:j=>u({...c,status:j}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"upcoming",children:"Upcoming"}),i.jsx(Ie,{value:"live",children:"Live"}),i.jsx(Ie,{value:"completed",children:"Completed"}),i.jsx(Ie,{value:"cancelled",children:"Cancelled"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"start_datetime",children:"Start Date/Time *"}),i.jsx(Ee,{id:"start_datetime",type:"datetime-local",value:c.start_datetime,onChange:j=>u({...c,start_datetime:j.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"end_datetime",children:"End Date/Time"}),i.jsx(Ee,{id:"end_datetime",type:"datetime-local",value:c.end_datetime,onChange:j=>u({...c,end_datetime:j.target.value})})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"venue_name",children:"Venue Name"}),i.jsx(Ee,{id:"venue_name",value:c.venue_name,onChange:j=>u({...c,venue_name:j.target.value}),placeholder:"e.g. The Cove Bar"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"location",children:"Location"}),i.jsx(Ee,{id:"location",value:c.location,onChange:j=>u({...c,location:j.target.value}),placeholder:"e.g. Town name"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"external_link",children:"Exter
719nal Link (Info/Booking)"}),i.jsx(Ee,{id:"external_link",type:"url",value:c.external_link,onChange:j=>u({...c,external_link:j.target.value}),placeholder:"https://..."})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"price",children:"Price (€)"}),i.jsx(Ee,{id:"price",type:"number",min:"0",step:"0.50",value:c.price,onChange:j=>u({...c,price:parseFloat(j.target.value)})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"game_url",children:"Game URL (After Payment)"}),i.jsx(Ee,{id:"game_url",type:"url",value:c.game_url,onChange:j=>u({...c,game_url:j.target.value}),placeholder:"https://..."})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"image",children:"Event Image"}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Ee,{id:"image",type:"file",accept:"image/*",onChange:v,disabled:o}),c.image_url&&i.jsx("img",{src:c.image_url,alt:"Preview",className:"h-16 object-contain"})]})]}),i.jsxs("div",{className:"border-t pt-4",children:[i.jsx("h3",{className:"font-semibold mb-3",children:"Repeat Settings"}),i.jsxs("div",{className:"space-y-2 mb-4",children:[i.jsx(me,{htmlFor:"repeat_type",children:"Repeat Type"}),i.jsxs(Xt,{value:c.repeat_type,onValueChange:j=>u({...c,repeat_type:j}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"none",children:"One-time Event"}),i.jsx(Ie,{value:"daily",children:"Daily"}),i.jsx(Ie,{value:"weekly",children:"Weekly"}),i.jsx(Ie,{value:"monthly",children:"Monthly"})]})]})]}),(c.repeat_type==="daily"||c.repeat_type==="monthly")&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"repeat_end_date",children:"Repeat Until (Optional)"}),i.jsx(Ee,{id:"repeat_end_date",type:"date",value:c.repeat_end_date,onChange:j=>u({...c,repeat_end_date:j.target.value})})]}),c.repeat_type==="weekly"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Days of Week (Select Multiple)"}),i.jsx("div",{className:"grid grid-cols-2 gap-3 p-4 bg-slate-50 rounded-lg",children:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"].map(j=>{var S;return i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(qh,{id:`day-${j}`,checked:(S=c.repeat_days_of_week)==null?void 0:S.includes(j),onCheckedChange:C=>{var P;u(C?{...c,repeat_days_of_week:[...c.repeat_days_of_week||[],j]}:{...c,repeat_days_of_week:((P=c.repeat_days_of_week)==null?void 0:P.filter(A=>A!==j))||[]})}}),i.jsx("label",{htmlFor:`day-${j}`,className:"text-sm cursor-pointer",children:j})]},j)})}),i.jsx("p",{className:"text-xs text-slate-500",children:"Or use single day below for simple weekly events"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"repeat_day",children:"Single Day (Alternative)"}),i.jsxs(Xt,{value:c.repeat_day_of_week,onValueChange:j=>u({...c,repeat_day_of_week:j,repeat_days_of_week:[]}),children:[i.jsx(Ht,{children:i.jsx(Zt,{placeholder:"Select day..."})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"Monday",children:"Monday"}),i.jsx(Ie,{value:"Tuesday",children:"Tuesday"}),i.jsx(Ie,{value:"Wednesday",children:"Wednesday"}),i.jsx(Ie,{value:"Thursday",children:"Thursday"}),i.jsx(Ie,{value:"Friday",children:"Friday"}),i.jsx(Ie,{value:"Saturday",children:"Saturday"}),i.jsx(Ie,{value:"Sunday",children:"Sunday"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"repeat_end_date",children:"Repeat Until (Optional)"}),i.jsx(Ee,{id:"repeat_end_date",type:"date",value:c.repeat_end_date,onChange:j=>u({...c,repeat_end_date:j.target.value})})]})]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ai,{id:"is_active",checked:c.is_active,onCheckedChange:j=>u({...c,is_active:j})}),i.jsx(me,{htmlFor:"is_active",children:"Active"})]})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),i.jsx(ue,{onClick:b,children:n?"Update Event":"Create Event"})]})]})})]})}var XS,vD;function G0e(){if(vD)return XS;vD=1;function e(){this.__data__=[],this.size=0}return XS=e,XS}var ZS,xD;function uR(){if(xD)return ZS;xD=1;function e(t,n){return t===n||t!==t&&n!==n}return ZS=e,ZS}var JS,yD;function hN(){if(yD)return JS;
vendor: 9,295 bytes, line 719
719yD=1;var e=uR();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return JS=t,JS}var ek,bD;function Q0e(){if(bD)return ek;bD=1;var e=hN(),t=Array.prototype,n=t.splice;function r(s){var a=this.__data__,o=e(a,s);if(o<0)return!1;var l=a.length-1;return o==l?a.pop():n.call(a,o,1),--this.size,!0}return ek=r,ek}var tk,wD;function Y0e(){if(wD)return tk;wD=1;var e=hN();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return tk=t,tk}var nk,jD;function X0e(){if(jD)return nk;jD=1;var e=hN();function t(n){return e(this.__data__,n)>-1}return nk=t,nk}var rk,_D;function Z0e(){if(_D)return rk;_D=1;var e=hN();function t(n,r){var s=this.__data__,a=e(s,n);return a<0?(++this.size,s.push([n,r])):s[a][1]=r,this}return rk=t,rk}var ik,ND;function mN(){if(ND)return ik;ND=1;var e=G0e(),t=Q0e(),n=Y0e(),r=X0e(),s=Z0e();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,ik=a,ik}var sk,SD;function J0e(){if(SD)return sk;SD=1;var e=mN();function t(){this.__data__=new e,this.size=0}return sk=t,sk}var ak,kD;function eye(){if(kD)return ak;kD=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return ak=e,ak}var ok,ED;function tye(){if(ED)return ok;ED=1;function e(t){return this.__data__.get(t)}return ok=e,ok}var lk,PD;function nye(){if(PD)return lk;PD=1;function e(t){return this.__data__.has(t)}return lk=e,lk}var ck,CD;function rH(){if(CD)return ck;CD=1;var e=typeof bd=="object"&&bd&&bd.Object===Object&&bd;return ck=e,ck}var uk,AD;function Xl(){if(AD)return uk;AD=1;var e=rH(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return uk=n,uk}var dk,OD;function lb(){if(OD)return dk;OD=1;var e=Xl(),t=e.Symbol;return dk=t,dk}var fk,TD;function rye(){if(TD)return fk;TD=1;var e=lb(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function a(o){var l=n.call(o,s),c=o[s];try{o[s]=void 0;var u=!0}catch{}var h=r.call(o);return u&&(l?o[s]=c:delete o[s]),h}return fk=a,fk}var hk,RD;function iye(){if(RD)return hk;RD=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return hk=n,hk}var mk,MD;function fu(){if(MD)return mk;MD=1;var e=lb(),t=rye(),n=iye(),r="[object Null]",s="[object Undefined]",a=e?e.toStringTag:void 0;function o(l){return l==null?l===void 0?s:r:a&&a in Object(l)?t(l):n(l)}return mk=o,mk}var pk,ID;function Hd(){if(ID)return pk;ID=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return pk=e,pk}var gk,DD;function dR(){if(DD)return gk;DD=1;var e=fu(),t=Hd(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",a="[object Proxy]";function o(l){if(!t(l))return!1;var c=e(l);return c==r||c==s||c==n||c==a}return gk=o,gk}var vk,LD;function sye(){if(LD)return vk;LD=1;var e=Xl(),t=e["__core-js_shared__"];return vk=t,vk}var xk,FD;function aye(){if(FD)return xk;FD=1;var e=sye(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return xk=n,xk}var yk,$D;function iH(){if($D)return yk;$D=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return yk=n,yk}var bk,qD;function oye(){if(qD)return bk;qD=1;var e=dR(),t=aye(),n=Hd(),r=iH(),s=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,u=l.hasOwnProperty,h=RegExp("^"+c.call(u).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(m){if(!n(m)||t(m))return!1;var g=e(m)?h:a;return g.test(r(m))}return bk=d,bk}var wk,zD;function lye(){if(zD)return wk;zD=1;function e(t,n){return t==null?void 0:t[n]}return wk=e,wk}var jk,BD;function em(){if(BD)return jk;BD=1;var e=oye(),t=lye();function n(r,s){var a=t(r,s);return e(a)?a:void 0}return jk=n,jk}var _k,UD;function fR(){if(UD)return _k;UD=1;var e=em(),t=Xl(),n=e(t,"Map");return _k=n,_k}var Nk,VD;function pN(){if(VD)return Nk;VD=1;var e=em(),t=e(Object,"create");return Nk=t,Nk}var Sk,WD;function cye(){if(WD)return Sk;WD=1;var e=pN();function t(){this.__data__=e?e(null):{},this.size=0}return Sk=t,Sk}var kk,HD;function uye(){if(HD)return kk;HD=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return kk=e,kk}var Ek,KD;function dye(){if(KD)return Ek;KD=1;var e=pN(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(a){var o=this.__data__;if(e){var l=o[a];return l===t?void 0:l}return r.call(o,a)?o[a]:void 0}return Ek=s,Ek}var Pk,GD;function fye(){if(GD)return Pk;GD=1;var e=pN(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var a=this.__data__;return e?a[s]!==void 0:n.call(a,s)}return Pk=r,Pk}var Ck,QD;function hye(){if(QD)return Ck;QD=1;var e=pN(),t="__lodash_hash_undefined__";function n(r,s){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=e&&s===void 0?t:s,this}return Ck=n,Ck}var Ak,YD;function mye(){if(YD)return Ak;YD=1;var e=cye(),t=uye(),n=dye(),r=fye(),s=hye();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,Ak=a,Ak}var Ok,XD;function pye(){if(XD)return Ok;XD=1;var e=mye(),t=mN(),n=fR();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Ok=r,Ok}var Tk,ZD;function gye(){if(ZD)return Tk;ZD=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Tk=e,Tk}var Rk,JD;function gN(){if(JD)return Rk;JD=1;var e=gye();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return Rk=t,Rk}var Mk,eL;function vye(){if(eL)return Mk;eL=1;var e=gN();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Mk=t,Mk}var Ik,tL;function xye(){if(tL)return Ik;tL=1;var e=gN();function t(n){return e(this,n).get(n)}return Ik=t,Ik}var Dk,nL;function yye(){if(nL)return Dk;nL=1;var e=gN();function t(n){return e(this,n).has(n)}return Dk=t,Dk}var Lk,rL;function bye(){if(rL)return Lk;rL=1;var e=gN();function t(n,r){var s=e(this,n),a=s.size;return s.set(n,r),this.size+=s.size==a?0:1,this}return Lk=t,Lk}var Fk,iL;function hR(){if(iL)return Fk;iL=1;var e=pye(),t=vye(),n=xye(),r=yye(),s=bye();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,Fk=a,Fk}var $k,sL;function wye(){if(sL)return $k;sL=1;var e=mN(),t=fR(),n=hR(),r=200;function s(a,o){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!t||c.length<r-1)return c.push([a,o]),this.size=++l.size,this;l=this.__data__=new n(c)}return l.set(a,o),this.size=l.size,this}return $k=s,$k}var qk,aL;function sH(){if(aL)return qk;aL=1;var e=mN(),t=J0e(),n=eye(),r=tye(),s=nye(),a=wye();function o(l){var c=this.__data__=new e(l);this.size=c.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=s,o.prototype.set=a,qk=o,qk}var zk,oL;function jye(){if(oL)return zk;oL=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return zk=t,zk}var Bk,lL;function _ye(){if(lL)return Bk;lL=1;function e(t){return this.__data__.has(t)}return Bk=e,Bk}var Uk,cL;function aH(){if(cL)return Uk;cL=1;var e=hR(),t=jye(),n=_ye();function r(s){var a=-1,o=s==null?0:s.length;for(this.__data__=new e;++a<o;)this.add(s[a])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,Uk=r,Uk}var Vk,uL;function oH(){if(uL)return Vk;uL=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(n(t[r],r,t))return!0;return!1}return Vk=e,Vk}var Wk,dL;function lH(){if(dL)return Wk;dL=1;function e(t,n){return t.has(n)}return Wk=e,Wk}var Hk,fL;function cH(){if(fL)return Hk;fL=1;var e=aH(),t=oH(),n=lH(),r=1,s=2;function a(o,l,c,u,h,d){var m=c&r,g=o.length,w=l.length;if(g!=w&&!(m&&w>g))return!1;var v=d.get(o),b=d.get(l);if(v&&b)return v==l&&b==o;var y=-1,_=!0,N=c&s?new e:void 0;for(d.set(o,l),d.set(l,o);++y<g;){var j=o[y],S=l[y];if(u)var C=m?u(S,j,y,l,o,d):u(j,S,y,o,l,d);if(C!==void 0){if(C)continue;_=!1;break}if(N){if(!t(l,function(P,A){if(!n(N,A)&&(j===P||h(j,P,c,u,d)))return N.push(A)})){_=!1;break}}else if(!(j===S||h(j,S,c,u,d))){_=!1;break}}return d.delete(o),d.delete(l),_}return Hk=a,Hk}var Kk,hL;function Nye(){if(hL)return Kk;hL=1;var e=Xl(),t=e.Uint8Array;return Kk=t,Kk}var Gk,mL;function Sye(){if(mL)return Gk;mL=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,a){r[++n]=[a,s]}),r}return Gk=e,Gk}var Qk,pL;function mR(){if(pL)return Qk;pL=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return Qk=e,Qk}var Yk,gL;function kye(){if(gL)return Yk;gL=1;var e=lb(),t=Nye(),n=uR(),r=cH(),s=Sye(),a=mR(),o=1,l=2,c="[object Boolean]",u="[object Date]",h="[object Error]",d="[object Map]",m="[object Number]",g="[object RegExp]",w="[object Set]",v="[object String]",b="[object Symbol]",y="[object ArrayBuffer]",_="[object DataView]",N=e?e.prototype:void 0,j=N?N.valueOf
vendor: 4,328 bytes, line 719
719:void 0;function S(C,P,A,F,I,R,M){switch(A){case _:if(C.byteLength!=P.byteLength||C.byteOffset!=P.byteOffset)return!1;C=C.buffer,P=P.buffer;case y:return!(C.byteLength!=P.byteLength||!R(new t(C),new t(P)));case c:case u:case m:return n(+C,+P);case h:return C.name==P.name&&C.message==P.message;case g:case v:return C==P+"";case d:var $=s;case w:var B=F&o;if($||($=a),C.size!=P.size&&!B)return!1;var U=M.get(C);if(U)return U==P;F|=l,M.set(C,P);var G=r($(C),$(P),F,I,R,M);return M.delete(C),G;case b:if(j)return j.call(C)==j.call(P)}return!1}return Yk=S,Yk}var Xk,vL;function uH(){if(vL)return Xk;vL=1;function e(t,n){for(var r=-1,s=n.length,a=t.length;++r<s;)t[a+r]=n[r];return t}return Xk=e,Xk}var Zk,xL;function Qs(){if(xL)return Zk;xL=1;var e=Array.isArray;return Zk=e,Zk}var Jk,yL;function Eye(){if(yL)return Jk;yL=1;var e=uH(),t=Qs();function n(r,s,a){var o=s(r);return t(r)?o:e(o,a(r))}return Jk=n,Jk}var eE,bL;function Pye(){if(bL)return eE;bL=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,a=0,o=[];++r<s;){var l=t[r];n(l,r,t)&&(o[a++]=l)}return o}return eE=e,eE}var tE,wL;function Cye(){if(wL)return tE;wL=1;function e(){return[]}return tE=e,tE}var nE,jL;function Aye(){if(jL)return nE;jL=1;var e=Pye(),t=Cye(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(o){return o==null?[]:(o=Object(o),e(s(o),function(l){return r.call(o,l)}))}:t;return nE=a,nE}var rE,_L;function Oye(){if(_L)return rE;_L=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return rE=e,rE}var iE,NL;function hu(){if(NL)return iE;NL=1;function e(t){return t!=null&&typeof t=="object"}return iE=e,iE}var sE,SL;function Tye(){if(SL)return sE;SL=1;var e=fu(),t=hu(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return sE=r,sE}var aE,kL;function pR(){if(kL)return aE;kL=1;var e=Tye(),t=hu(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,a=e((function(){return arguments})())?e:function(o){return t(o)&&r.call(o,"callee")&&!s.call(o,"callee")};return aE=a,aE}var w0={exports:{}},oE,EL;function Rye(){if(EL)return oE;EL=1;function e(){return!1}return oE=e,oE}w0.exports;var PL;function dH(){return PL||(PL=1,(function(e,t){var n=Xl(),r=Rye(),s=t&&!t.nodeType&&t,a=s&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===s,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u})(w0,w0.exports)),w0.exports}var lE,CL;function gR(){if(CL)return lE;CL=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var a=typeof r;return s=s??e,!!s&&(a=="number"||a!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return lE=n,lE}var cE,AL;function vR(){if(AL)return cE;AL=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return cE=t,cE}var uE,OL;function Mye(){if(OL)return uE;OL=1;var e=fu(),t=vR(),n=hu(),r="[object Arguments]",s="[object Array]",a="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",h="[object Number]",d="[object Object]",m="[object RegExp]",g="[object Set]",w="[object String]",v="[object WeakMap]",b="[object ArrayBuffer]",y="[object DataView]",_="[object Float32Array]",N="[object Float64Array]",j="[object Int8Array]",S="[object Int16Array]",C="[object Int32Array]",P="[object Uint8Array]",A="[object Uint8ClampedArray]",F="[object Uint16Array]",I="[object Uint32Array]",R={};R[_]=R[N]=R[j]=R[S]=R[C]=R[P]=R[A]=R[F]=R[I]=!0,R[r]=R[s]=R[b]=R[a]=R[y]=R[o]=R[l]=R[c]=R[u]=R[h]=R[d]=R[m]=R[g]=R[w]=R[v]=!1;function M($){return n($)&&t($.length)&&!!R[e($)]}return uE=M,uE}var dE,TL;function fH(){if(TL)return dE;TL=1;function e(t){return function(n){return t(n)}}return dE=e,dE}var j0={exports:{}};j0.exports;var RL;function Iye(){return RL||(RL=1,(function(e,t){var n=rH(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===r,o=a&&n.process,l=(function(){try{var c=s&&s.require&&s.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}})();e.exports=l})(j0,j0.exports)),j0.exports}var fE,ML;function hH(){if(ML)return fE;ML=1;var e=Mye(),t=fH(),n=Iye(),r=n&&n.isTypedArray,s=r?t(r):e;return fE=s,fE}var hE,IL;function Dye(){if(IL)return hE;IL=1;var e=Oye(),t=pR(),n=Qs(),r=dH(),s=gR(),a=hH(),o=Object.prototype,l=o.hasOwnProperty;function c(u,h){var d=n(u),m=!d&&t(u),g=!d&&!m&&r(u),w=!d&&!m&&!g&&a(u),v=d||m||g||w,b=v?e(u.length,String):[],y=b.length;
vendor: 3,328 bytes, line 719
719for(var _ in u)(h||l.call(u,_))&&!(v&&(_=="length"||g&&(_=="offset"||_=="parent")||w&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||s(_,y)))&&b.push(_);return b}return hE=c,hE}var mE,DL;function Lye(){if(DL)return mE;DL=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return mE=t,mE}var pE,LL;function mH(){if(LL)return pE;LL=1;function e(t,n){return function(r){return t(n(r))}}return pE=e,pE}var gE,FL;function Fye(){if(FL)return gE;FL=1;var e=mH(),t=e(Object.keys,Object);return gE=t,gE}var vE,$L;function $ye(){if($L)return vE;$L=1;var e=Lye(),t=Fye(),n=Object.prototype,r=n.hasOwnProperty;function s(a){if(!e(a))return t(a);var o=[];for(var l in Object(a))r.call(a,l)&&l!="constructor"&&o.push(l);return o}return vE=s,vE}var xE,qL;function cb(){if(qL)return xE;qL=1;var e=dR(),t=vR();function n(r){return r!=null&&t(r.length)&&!e(r)}return xE=n,xE}var yE,zL;function vN(){if(zL)return yE;zL=1;var e=Dye(),t=$ye(),n=cb();function r(s){return n(s)?e(s):t(s)}return yE=r,yE}var bE,BL;function qye(){if(BL)return bE;BL=1;var e=Eye(),t=Aye(),n=vN();function r(s){return e(s,n,t)}return bE=r,bE}var wE,UL;function zye(){if(UL)return wE;UL=1;var e=qye(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(a,o,l,c,u,h){var d=l&t,m=e(a),g=m.length,w=e(o),v=w.length;if(g!=v&&!d)return!1;for(var b=g;b--;){var y=m[b];if(!(d?y in o:r.call(o,y)))return!1}var _=h.get(a),N=h.get(o);if(_&&N)return _==o&&N==a;var j=!0;h.set(a,o),h.set(o,a);for(var S=d;++b<g;){y=m[b];var C=a[y],P=o[y];if(c)var A=d?c(P,C,y,o,a,h):c(C,P,y,a,o,h);if(!(A===void 0?C===P||u(C,P,l,c,h):A)){j=!1;break}S||(S=y=="constructor")}if(j&&!S){var F=a.constructor,I=o.constructor;F!=I&&"constructor"in a&&"constructor"in o&&!(typeof F=="function"&&F instanceof F&&typeof I=="function"&&I instanceof I)&&(j=!1)}return h.delete(a),h.delete(o),j}return wE=s,wE}var jE,VL;function Bye(){if(VL)return jE;VL=1;var e=em(),t=Xl(),n=e(t,"DataView");return jE=n,jE}var _E,WL;function Uye(){if(WL)return _E;WL=1;var e=em(),t=Xl(),n=e(t,"Promise");return _E=n,_E}var NE,HL;function pH(){if(HL)return NE;HL=1;var e=em(),t=Xl(),n=e(t,"Set");return NE=n,NE}var SE,KL;function Vye(){if(KL)return SE;KL=1;var e=em(),t=Xl(),n=e(t,"WeakMap");return SE=n,SE}var kE,GL;function Wye(){if(GL)return kE;GL=1;var e=Bye(),t=fR(),n=Uye(),r=pH(),s=Vye(),a=fu(),o=iH(),l="[object Map]",c="[object Object]",u="[object Promise]",h="[object Set]",d="[object WeakMap]",m="[object DataView]",g=o(e),w=o(t),v=o(n),b=o(r),y=o(s),_=a;return(e&&_(new e(new ArrayBuffer(1)))!=m||t&&_(new t)!=l||n&&_(n.resolve())!=u||r&&_(new r)!=h||s&&_(new s)!=d)&&(_=function(N){var j=a(N),S=j==c?N.constructor:void 0,C=S?o(S):"";if(C)switch(C){case g:return m;case w:return l;case v:return u;case b:return h;case y:return d}return j}),kE=_,kE}var EE,QL;function Hye(){if(QL)return EE;QL=1;var e=sH(),t=cH(),n=kye(),r=zye(),s=Wye(),a=Qs(),o=dH(),l=hH(),c=1,u="[object Arguments]",h="[object Array]",d="[object Object]",m=Object.prototype,g=m.hasOwnProperty;function w(v,b,y,_,N,j){var S=a(v),C=a(b),P=S?h:s(v),A=C?h:s(b);P=P==u?d:P,A=A==u?d:A;var F=P==d,I=A==d,R=P==A;if(R&&o(v)){if(!o(b))return!1;S=!0,F=!1}if(R&&!F)return j||(j=new e),S||l(v)?t(v,b,y,_,N,j):n(v,b,P,y,_,N,j);if(!(y&c)){var M=F&&g.call(v,"__wrapped__"),$=I&&g.call(b,"__wrapped__");
vendor: 99,546 bytes, lines 719-749
719if(M||$){var B=M?v.value():v,U=$?b.value():b;return j||(j=new e),N(B,U,y,_,j)}}return R?(j||(j=new e),r(v,b,y,_,N,j)):!1}return EE=w,EE}var PE,YL;function xR(){if(YL)return PE;YL=1;var e=Hye(),t=hu();function n(r,s,a,o,l){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,a,o,n,l)}return PE=n,PE}var CE,XL;function gH(){if(XL)return CE;XL=1;var e=xR();function t(n,r){return e(n,r)}return CE=t,CE}var Q1={exports:{}};/*!
720 * Quill Editor v1.3.7
721 * https://quilljs.com/
722 * Copyright (c) 2014, Jason Chen
723 * Copyright (c) 2013, salesforce.com
724 */var Kye=Q1.exports,ZL;function Gye(){return ZL||(ZL=1,(function(e,t){(function(r,s){e.exports=s()})(typeof self<"u"?self:Kye,function(){return(function(n){var r={};function s(a){if(r[a])return r[a].exports;var o=r[a]={i:a,l:!1,exports:{}};return n[a].call(o.exports,o,o.exports,s),o.l=!0,o.exports}return s.m=n,s.c=r,s.d=function(a,o,l){s.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:l})},s.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return s.d(o,"a",o),o},s.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},s.p="",s(s.s=109)})([(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(17),o=s(18),l=s(19),c=s(45),u=s(46),h=s(47),d=s(48),m=s(49),g=s(12),w=s(32),v=s(33),b=s(31),y=s(1),_={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:d.default,Scroll:c.default,Block:h.default,Inline:u.default,Text:m.default,Attributor:{Attribute:g.default,Class:w.default,Style:v.default,Store:b.default}};r.default=_}),(function(n,r,s){var a=this&&this.__extends||(function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,_){y.__proto__=_}||function(y,_){for(var N in _)_.hasOwnProperty(N)&&(y[N]=_[N])};return function(y,_){b(y,_);function N(){this.constructor=y}y.prototype=_===null?Object.create(_):(N.prototype=_.prototype,new N)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=(function(b){a(y,b);function y(_){var N=this;return _="[Parchment] "+_,N=b.call(this,_)||this,N.message=_,N.name=N.constructor.name,N}return y})(Error);r.ParchmentError=o;var l={},c={},u={},h={};r.DATA_KEY="__blot";var d;(function(b){b[b.TYPE=3]="TYPE",b[b.LEVEL=12]="LEVEL",b[b.ATTRIBUTE=13]="ATTRIBUTE",b[b.BLOT=14]="BLOT",b[b.INLINE=7]="INLINE",b[b.BLOCK=11]="BLOCK",b[b.BLOCK_BLOT=10]="BLOCK_BLOT",b[b.INLINE_BLOT=6]="INLINE_BLOT",b[b.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",b[b.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",b[b.ANY=15]="ANY"})(d=r.Scope||(r.Scope={}));function m(b,y){var _=w(b);if(_==null)throw new o("Unable to create "+b+" blot");var N=_,j=b instanceof Node||b.nodeType===Node.TEXT_NODE?b:N.create(y);return new N(j,y)}r.create=m;function g(b,y){return y===void 0&&(y=!1),b==null?null:b[r.DATA_KEY]!=null?b[r.DATA_KEY].blot:y?g(b.parentNode,y):null}r.find=g;function w(b,y){y===void 0&&(y=d.ANY);var _;if(typeof b=="string")_=h[b]||l[b];else if(b instanceof Text||b.nodeType===Node.TEXT_NODE)_=h.text;else if(typeof b=="number")b&d.LEVEL&d.BLOCK?_=h.block:b&d.LEVEL&d.INLINE&&(_=h.inline);else if(b instanceof HTMLElement){var N=(b.getAttribute("class")||"").split(/\s+/);for(var j in N)if(_=c[N[j]],_)break;_=_||u[b.tagName]}return _==null?null:y&d.LEVEL&_.scope&&y&d.TYPE&_.scope?_:null}r.query=w;function v(){for(var b=[],y=0;y<arguments.length;y++)b[y]=arguments[y];if(b.length>1)return b.map(function(j){return v(j)});var _=b[0];if(typeof _.blotName!="string"&&typeof _.attrName!="string")throw new o("Invalid definition");if(_.blotName==="abstract")throw new o("Cannot register abstract class");if(h[_.blotName||_.attrName]=_,typeof _.keyName=="string")l[_.keyName]=_;else if(_.className!=null&&(c[_.className]=_),_.tagName!=null){Array.isArray(_.tagName)?_.tagName=_.tagName.map(function(j){return j.toUpperCase()}):_.tagName=_.tagName.toUpperCase();var N=Array.isArray(_.tagName)?_.tagName:[_.tagName];N.forEach(function(j){(u[j]==null||_.className==null)&&(u[j]=_)})}return _}r.register=v}),(function(n,r,s){var a=s(51),o=s(11),l=s(3),c=s(20),u="\0",h=function(d){Array.isArray(d)?this.ops=d:d!=null&&Array.isArray(d.ops)?this.ops=d.ops:this.ops=[]};h.prototype.insert=function(d,m){var g={};return d.length===0?this:(g.insert=d,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(g.attributes=m),this.push(g))},h.prototype.delete=function(d){return d<=0?this:this.push({delete:d})},h.prototype.retain=function(d,m){if(d<=0)return this;var g={retain:d};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(g.attributes=m),this.push(g)},h.prototype.push=function(d){var m=this.ops.length,g=this.ops[m-1];if(d=l(!0,{},d),typeof g=="object"){if(typeof d.delete=="number"&&typeof g.delete=="number")return this.ops[m-1]={delete:g.delete+d.delete},this;if(typeof g.delete=="number"&&d.insert!=null&&(m-=1,g=this.ops[m-1],typeof g!="object"))return this.ops.unshift(d),this;if(o(d.attributes,g.attributes)){if(typeof d.insert=="string"&&typeof g.insert=="string")return this.ops[m-1]={insert:g.insert+d.insert},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this;if(typeof d.retain=="number"&&typeof g.retain=="number")return this.ops[m-1]={retain:g.retain+d.retain},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this}}return m===this.ops.length?this.ops.push(d):this.ops.splice(m,0,d),this},h.prototype.chop=function(){var d=this.ops[this.ops.length-1];return d&&d.retain&&!d.attributes&&this.ops.pop(),this},h.prototype.filter=function(d){return this.ops.filter(d)},h.prototype.forEach=function(d){this.ops.forEach(d)},h.prototype.map=function(d){return this.ops.map(d)},h.prototype.partition=function(d){var m=[],g=[];return this.forEach(function(w){var v=d(w)?m:g;v.push(w)}),[m,g]},h.prototype.reduce=function(d,m){return this.ops.reduce(d,m)},h.prototype.changeLength=function(){return this.reduce(function(d,m){return m.insert?d+c.length(m):m.delete?d-m.delete:d},0)},h.prototype.length=function(){return this.reduce(function(d,m){return d+c.length(m)},0)},h.prototype.slice=function(d,m){d=d||0,typeof m!="number"&&(m=1/0);for(var g=[],w=c.iterator(this.ops),v=0;v<m&&w.hasNext();){var b;v<d?b=w.next(d-v):(b=w.next(m-v),g.push(b)),v+=c.length(b)}return new h(g)},h.prototype.compose=function(d){var m=c.iterator(this.ops),g=c.iterator(d.ops),w=[],v=g.peek();if(v!=null&&typeof v.retain=="number"&&v.attributes==null){for(var b=v.retain;m.peekType()==="insert"&&m.peekLength()<=b;)b-=m.peekLength(),w.push(m.next());v.retain-b>0&&g.next(v.retain-b)}for(var y=new h(w);m.hasNext()||g.hasNext();)if(g.peekType()==="insert")y.push(g.next());else if(m.peekType()==="delete")y.push(m.next());else{var _=Math.min(m.peekLength(),g.peekLength()),N=m.next(_),j=g.next(_);if(typeof j.retain=="number"){var S={};typeof N.retain=="number"?S.retain=_:S.insert=N.insert;var C=c.attributes.compose(N.attributes,j.attributes,typeof N.retain=="number");if(C&&(S.attributes=C),y.push(S),!g.hasNext()&&o(y.ops[y.ops.length-1],S)){var P=new h(m.rest());return y.concat(P).chop()}}else typeof j.delete=="number"&&typeof N.retain=="number"&&y.push(j)}return y.chop()},h.prototype.concat=function(d){var m=new h(this.ops.slice());return d.ops.length>0&&(m.push(d.ops[0]),m.ops=m.ops.concat(d.ops.slice(1))),m},h.prototype.diff=function(d,m){if(this.ops===d.ops)return new h;var g=[this,d].map(function(_){return _.map(function(N){if(N.insert!=null)return typeof N.insert=="string"?N.insert:u;var j=_===d?"on":"with";throw new Error("diff() called "+j+" non-document")}).join("")}),w=new h,v=a(g[0],g[1],m),b=c.iterator(this.ops),y=c.iterator(d.ops);return v.forEach(function(_){for(var N=_[1].length;N>0;){var j=0;switch(_[0]){case a.INSERT:j=Math.min(y.peekLength(),N),w.push(y.next(j));break;case a.DELETE:j=Math.min(N,b.peekLength()),b.next(j),w.delete(j);break;case a.EQUAL:j=Math.min(b.peekLength(),y.peekLength(),N);var S=b.next(j),C=y.next(j);o(S.insert,C.insert)?w.retain(j,c.attributes.diff(S.attributes,C.attributes)):w.push(C).delete(j);break}N-=j}}),w.chop()},h.prototype.eachLine=function(d,m){m=m||`
725`;for(var g=c.iterator(this.ops),w=new h,v=0;g.hasNext();){if(g.peekType()!=="insert")return;var b=g.peek(),y=c.length(b)-g.peekLength(),_=typeof b.insert=="string"?b.insert.indexOf(m,y)-y:-1;if(_<0)w.push(g.next());else if(_>0)w.push(g.next(_));else{if(d(w,g.next(1).attributes||{},v)===!1)return;v+=1,w=new h}}w.length()>0&&d(w,{},v)},h.prototype.transform=function(d,m){if(m=!!m,typeof d=="number")return this.transformPosition(d,m);for(var g=c.iterator(this.ops),w=c.iterator(d.ops),v=new h;g.hasNext()||w.hasNext();)if(g.peekType()==="insert"&&(m||w.peekType()!=="insert"))v.retain(c.length(g.next()));else if(w.peekType()==="insert")v.push(w.next());else{var b=Math.min(g.peekLength(),w.peekLength()),y=g.next(b),_=w.next(b);if(y.delete)continue;_.delete?v.push(_):v.retain(b,c.attributes.transform(y.attributes,_.attributes,m))}return v.chop()},h.prototype.transformPosition=function(d,m){m=!!m;for(var g=c.iterator(this.ops),w=0;g.hasNext()&&w<=d;){var v=g.peekLength(),b=g.peekType();if(g.next(),b==="delete"){d-=Math.min(v,d-w);continue}else b==="insert"&&(w<d||!m)&&(d+=v);w+=v}return d},n.exports=h}),(function(n,r){var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=function(g){return typeof Array.isArray=="function"?Array.isArray(g):a.call(g)==="[object Array]"},u=function(g){if(!g||a.call(g)!=="[object Object]")return!1;var w=s.call(g,"constructor"),v=g.constructor&&g.constructor.prototype&&s.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!w&&!v)return!1;var b;for(b in g);return typeof b>"u"||s.call(g,b)},h=function(g,w){o&&w.name==="__proto__"?o(g,w.name,{enumerable:!0,configurable:!0,value:w.newValue,writable:!0}):g[w.name]=w.newValue},d=function(g,w){if(w==="__proto__")if(s.call(g,w)){if(l)return l(g,w).value}else return;return g[w]};n.exports=function m(){var g,w,v,b,y,_,N=arguments[0],j=1,S=arguments.length,C=!1;for(typeof N=="boolean"&&(C=N,N=arguments[1]||{},j=2),(N==null||typeof N!="object"&&typeof N!="function")&&(N={});j<S;++j)if(g=arguments[j],g!=null)for(w in g)v=d(N,w),b=d(g,w),N!==b&&(C&&b&&(u(b)||(y=c(b)))?(y?(y=!1,_=v&&c(v)?v:[]):_=v&&u(v)?v:{},h(N,{name:w,newValue:m(C,_,b)})):typeof b<"u"&&h(N,{name:w,newValue:b}));return N}}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BlockEmbed=r.bubbleFormats=void 0;var a=(function(){function R(M,$){for(var B=0;B<$.length;B++){var U=$[B];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(M,U.key,U)}}return function(M,$,B){return $&&R(M.prototype,$),B&&R(M,B),M}})(),o=function R(M,$,B){M===null&&(M=Function.prototype);var U=Object.getOwnPropertyDescriptor(M,$);if(U===void 0){var G=Object.getPrototypeOf(M);return G===null?void 0:R(G,$,B)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(B)}},l=s(3),c=N(l),u=s(2),h=N(u),d=s(0),m=N(d),g=s(16),w=N(g),v=s(6),b=N(v),y=s(7),_=N(y);function N(R){return R&&R.__esModule?R:{default:R}}function j(R,M){if(!(R instanceof M))throw new TypeError("Cannot call a class as a function")}function S(R,M){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:R}function C(R,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);R.prototype=Object.create(M&&M.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(R,M):R.__proto__=M)}var P=1,A=(function(R){C(M,R);function M(){return j(this,M),S(this,(M.__proto__||Object.getPrototypeOf(M)).apply(this,arguments))}return a(M,[{key:"attach",value:function(){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"attach",this).call(this),this.attributes=new m.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,c.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(B,U){var G=m.default.query(B,m.default.Scope.BLOCK_ATTRIBUTE);G!=null&&this.attributes.attribute(G,U)}},{key:"formatAt",value:function(B,U,G,Z){this.format(G,Z)}},{key:"insertAt",value:function(B,U,G){if(typeof U=="string"&&U.endsWith(`
726`)){var Z=m.default.create(F.blotName);this.parent.insertBefore(Z,B===0?this:this.next),Z.insertAt(0,U.slice(0,-1))}else o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,B,U,G)}}]),M})(m.default.Embed);A.scope=m.default.Scope.BLOCK_BLOT;var F=(function(R){C(M,R);function M($){j(this,M);var B=S(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,$));return B.cache={},B}return a(M,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(m.default.Leaf).reduce(function(B,U){return U.length()===0?B:B.insert(U.value(),I(U))},new h.default).insert(`
727`,I(this))),this.cache.delta}},{key:"deleteAt",value:function(B,U){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"deleteAt",this).call(this,B,U),this.cache={}}},{key:"formatAt",value:function(B,U,G,Z){U<=0||(m.default.query(G,m.default.Scope.BLOCK)?B+U===this.length()&&this.format(G,Z):o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"formatAt",this).call(this,B,Math.min(U,this.length()-B-1),G,Z),this.cache={})}},{key:"insertAt",value:function(B,U,G){if(G!=null)return o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,B,U,G);if(U.length!==0){var Z=U.split(`
728`),X=Z.shift();X.length>0&&(B<this.length()-1||this.children.tail==null?o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,Math.min(B,this.length()-1),X):this.children.tail.insertAt(this.children.tail.length(),X),this.cache={});var V=this;Z.reduce(function(z,L){return V=V.split(z,!0),V.insertAt(0,L),L.length},B+X.length)}}},{key:"insertBefore",value:function(B,U){var G=this.children.head;o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertBefore",this).call(this,B,U),G instanceof w.default&&G.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"length",this).call(this)+P),this.cache.length}},{key:"moveChildren",value:function(B,U){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"moveChildren",this).call(this,B,U),this.cache={}}},{key:"optimize",value:function(B){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"optimize",this).call(this,B),this.cache={}}},{key:"path",value:function(B){return o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"path",this).call(this,B,!0)}},{key:"removeChild",value:function(B){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"removeChild",this).call(this,B),this.cache={}}},{key:"split",value:function(B){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(U&&(B===0||B>=this.length()-P)){var G=this.clone();return B===0?(this.parent.insertBefore(G,this),this):(this.parent.insertBefore(G,this.next),G)}else{var Z=o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"split",this).call(this,B,U);return this.cache={},Z}}}]),M})(m.default.Block);F.blotName="block",F.tagName="P",F.defaultChild="break",F.allowedChildren=[b.default,m.default.Embed,_.default];function I(R){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return R==null||(typeof R.formats=="function"&&(M=(0,c.default)(M,R.formats())),R.parent==null||R.parent.blotName=="scroll"||R.parent.statics.scope!==R.statics.scope)?M:I(R.parent,M)}r.bubbleFormats=I,r.BlockEmbed=A,r.default=F}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.overload=r.expandConfig=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},o=(function(){function V(z,L){var W=[],Q=!0,J=!1,ne=void 0;try{for(var Y=z[Symbol.iterator](),ee;!(Q=(ee=Y.next()).done)&&(W.push(ee.value),!(L&&W.length===L));Q=!0);}catch(le){J=!0,ne=le}finally{try{!Q&&Y.return&&Y.return()}finally{if(J)throw ne}}return W}return function(z,L){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return V(z,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function V(z,L){for(var W=0;W<L.length;W++){var Q=L[W];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(z,Q.key,Q)}}return function(z,L,W){return L&&V(z.prototype,L),W&&V(z,W),z}})();s(50);var c=s(2),u=I(c),h=s(14),d=I(h),m=s(8),g=I(m),w=s(9),v=I(w),b=s(0),y=I(b),_=s(15),N=I(_),j=s(3),S=I(j),C=s(10),P=I(C),A=s(34),F=I(A);function I(V){return V&&V.__esModule?V:{default:V}}function R(V,z,L){return z in V?Object.defineProperty(V,z,{value:L,enumerable:!0,configurable:!0,writable:!0}):V[z]=L,V}function M(V,z){if(!(V instanceof z))throw new TypeError("Cannot call a class as a function")}var $=(0,P.default)("quill"),B=(function(){l(V,null,[{key:"debug",value:function(L){L===!0&&(L="log"),P.default.level(L)}},{key:"find",value:function(L){return L.__quill||y.default.find(L)}},{key:"import",value:function(L){return this.imports[L]==null&&$.error("Cannot import "+L+". Are you sure it was registered?"),this.imports[L]}},{key:"register",value:function(L,W){var Q=this,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof L!="string"){var ne=L.attrName||L.blotName;typeof ne=="string"?this.register("formats/"+ne,L,W):Object.keys(L).forEach(function(Y){Q.register(Y,L[Y],W)})}else this.imports[L]!=null&&!J&&$.warn("Overwriting "+L+" with",W),this.imports[L]=W,(L.startsWith("blots/")||L.startsWith("formats/"))&&W.blotName!=="abstract"?y.default.register(W):L.startsWith("modules")&&typeof W.register=="function"&&W.register()}}]);function V(z){var L=this,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(M(this,V),this.options=U(z,W),this.container=this.options.container,this.container==null)return $.error("Invalid Quill container",z);this.options.debug&&V.debug(this.options.debug);var Q=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new g.default,this.scroll=y.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new d.default(this.scroll),this.selection=new N.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(g.default.events.EDITOR_CHANGE,function(ne){ne===g.default.events.TEXT_CHANGE&&L.root.classList.toggle("ql-blank",L.editor.isBlank())}),this.emitter.on(g.default.events.SCROLL_UPDATE,function(ne,Y){var ee=L.selection.lastRange,le=ee&&ee.length===0?ee.index:void 0;G.call(L,function(){return L.editor.update(null,Y,le)},ne)});var J=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+Q+"<p><br></p></div>");this.setContents(J),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(V,[{key:"addContainer",value:function(L){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof L=="string"){var Q=L;L=document.createElement("div"),L.classList.add(Q)}return this.container.insertBefore(L,W),L}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(L,W,Q){var J=this,ne=Z(L,W,Q),Y=o(ne,4);return L=Y[0],W=Y[1],Q=Y[3],G.call(this,function(){return J.editor.deleteText(L,W)},Q,L,-1*W)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(L),this.container.classList.toggle("ql-disabled",!L)}},{key:"focus",value:function(){var L=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=L,this.scrollIntoView()}},{key:"format",value:function(L,W){var Q=this,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.default.sources.API;return G.call(this,function(){var ne=Q.getSelection(!0),Y=new u.default;if(ne==null)return Y;if(y.default.query(L,y.default.Scope.BLOCK))Y=Q.editor.formatLine(ne.index,ne.length,R({},L,W));else{if(ne.length===0)return Q.selection.format(L,W),Y;Y=Q.editor.formatText(ne.index,ne.length,R({},L,W))}return Q.setSelection(ne,g.default.sources.SILENT),Y},J)}},{key:"formatLine",value:function(L,W,Q,J,ne){var Y=this,ee=void 0,le=Z(L,W,Q,J,ne),re=o(le,4);return L=re[0],W=re[1],ee=re[2],ne=re[3],G.call(this,function(){return Y.editor.formatLine(L,W,ee)},ne,L,0)}},{key:"formatText",value:function(L,W,Q,J,ne){var Y=this,ee=void 0,le=Z(L,W,Q,J,ne),re=o(le,4);return L=re[0],W=re[1],ee=re[2],ne=re[3],G.call(this,function(){return Y.editor.formatText(L,W,ee)},ne,L,0)}},{key:"getBounds",value:function(L){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Q=void 0;typeof L=="number"?Q=this.selection.getBounds(L,W):Q=this.selection.getBounds(L.index,L.length);var J=this.container.getBoundingClientRect();return{bottom:Q.bottom-J.top,height:Q.height,left:Q.left-J.left,right:Q.right-J.left,top:Q.top-J.top,width:Q.width}}},{key:"getContents",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,Q=Z(L,W),J=o(Q,2);return L=J[0],W=J[1],this.editor.getContents(L,W)}},{key:"getFormat",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof L=="number"?this.editor.getFormat(L,W):this.editor.getFormat(L.index,L.length)}},{key:"getIndex",value:function(L){return L.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(L){return this.scroll.leaf(L)}},{key:"getLine",value:function(L){return this.scroll.line(L)}},{key:"getLines",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof L!="number"?this.scroll.lines(L.index,L.length):this.scroll.lines(L,W)}},{key:"getModule",value:function(L){return this.theme.modules[L]}},{key:"getSelection",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return L&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,Q=Z(L,W),J=o(Q,2);return L=J[0],W=J[1],this.editor.getText(L,W)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(L,W,Q){var J=this,ne=arguments.length>3&&arguments[3]!==void 0?arguments[3]:V.sources.API;return G.call(this,function(){return J.editor.insertEmbed(L,W,Q)},ne,L)}},{key:"insertText",value:function(L,W,Q,J,ne){var Y=this,ee=void 0,le=Z(L,0,Q,J,ne),re=o(le,4);return L=re[0],ee=re[2],ne=re[3],G.call(this,function(){return Y.editor.insertText(L,W,ee)},ne,L,W.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(L,W,Q){this.clipboard.dangerouslyPasteHTML(L,W,Q)}},{key:"removeFormat",value:function(L,W,Q){var J=this,ne=Z(L,W,Q),Y=o(ne,4);return L=Y[0],W=Y[1],Q=Y[3],G.call(this,function(){return J.editor.removeFormat(L,W)},Q,L)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(L){var W=this,Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g.default.sources.API;return G.call(this,function(){L=new u.default(L);var J=W.getLength(),ne=W.editor.deleteText(0,J),Y=W.editor.applyDelta(L),ee=Y.ops[Y.ops.length-1];ee!=null&&typeof ee.insert=="string"&&ee.insert[ee.insert.length-1]===`
729`&&(W.editor.deleteText(W.getLength()-1,1),Y.delete(1));var le=ne.compose(Y);return le},Q)}},{key:"setSelection",value:function(L,W,Q){if(L==null)this.selection.setRange(null,W||V.sources.API);else{var J=Z(L,W,Q),ne=o(J,4);L=ne[0],W=ne[1],Q=ne[3],this.selection.setRange(new _.Range(L,W),Q),Q!==g.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(L){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g.default.sources.API,Q=new u.default().insert(L);return this.setContents(Q,W)}},{key:"update",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g.default.sources.USER,W=this.scroll.update(L);return this.selection.update(L),W}},{key:"updateContents",value:function(L){var W=this,Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g.default.sources.API;return G.call(this,function(){return L=new u.default(L),W.editor.applyDelta(L,Q)},Q,!0)}}]),V})();B.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},B.events=g.default.events,B.sources=g.default.sources,B.version="1.3.7",B.imports={delta:u.default,parchment:y.default,"core/module":v.default,"core/theme":F.default};function U(V,z){if(z=(0,S.default)(!0,{container:V,modules:{clipboard:!0,keyboard:!0,history:!0}},z),!z.theme||z.theme===B.DEFAULTS.theme)z.theme=F.default;else if(z.theme=B.import("themes/"+z.theme),z.theme==null)throw new Error("Invalid theme "+z.theme+". Did you register it?");var L=(0,S.default)(!0,{},z.theme.DEFAULTS);[L,z].forEach(function(J){J.modules=J.modules||{},Object.keys(J.modules).forEach(function(ne){J.modules[ne]===!0&&(J.modules[ne]={})})});var W=Object.keys(L.modules).concat(Object.keys(z.modules)),Q=W.reduce(function(J,ne){var Y=B.import("modules/"+ne);return Y==null?$.error("Cannot load "+ne+" module. Are you sure you registered it?"):J[ne]=Y.DEFAULTS||{},J},{});return z.modules!=null&&z.modules.toolbar&&z.modules.toolbar.constructor!==Object&&(z.modules.toolbar={container:z.modules.toolbar}),z=(0,S.default)(!0,{},B.DEFAULTS,{modules:Q},L,z),["bounds","container","scrollingContainer"].forEach(function(J){typeof z[J]=="string"&&(z[J]=document.querySelector(z[J]))}),z.modules=Object.keys(z.modules).reduce(function(J,ne){return z.modules[ne]&&(J[ne]=z.modules[ne]),J},{}),z}function G(V,z,L,W){if(this.options.strict&&!this.isEnabled()&&z===g.default.sources.USER)return new u.default;var Q=L==null?null:this.getSelection(),J=this.editor.delta,ne=V();if(Q!=null&&(L===!0&&(L=Q.index),W==null?Q=X(Q,ne,z):W!==0&&(Q=X(Q,L,W,z)),this.setSelection(Q,g.default.sources.SILENT)),ne.length()>0){var Y,ee=[g.default.events.TEXT_CHANGE,ne,J,z];if((Y=this.emitter).emit.apply(Y,[g.default.events.EDITOR_CHANGE].concat(ee)),z!==g.default.sources.SILENT){var le;(le=this.emitter).emit.apply(le,ee)}}return ne}function Z(V,z,L,W,Q){var J={};return typeof V.index=="number"&&typeof V.length=="number"?typeof z!="number"?(Q=W,W=L,L=z,z=V.length,V=V.index):(z=V.length,V=V.index):typeof z!="number"&&(Q=W,W=L,L=z,z=0),(typeof L>"u"?"undefined":a(L))==="object"?(J=L,Q=W):typeof L=="string"&&(W!=null?J[L]=W:Q=L),Q=Q||g.default.sources.API,[V,z,J,Q]}function X(V,z,L,W){if(V==null)return null;var Q=void 0,J=void 0;if(z instanceof u.default){var ne=[V.index,V.index+V.length].map(function(re){return z.transformPosition(re,W!==g.default.sources.USER)}),Y=o(ne,2);Q=Y[0],J=Y[1]}else{var ee=[V.index,V.index+V.length].map(function(re){return re<z||re===z&&W===g.default.sources.USER?re:L>=0?re+L:Math.max(z,re+L)}),le=o(ee,2);Q=le[0],J=le[1]}return new _.Range(Q,J-Q)}r.expandConfig=U,r.overload=Z,r.default=B}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function b(y,_){for(var N=0;N<_.length;N++){var j=_[N];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(y,j.key,j)}}return function(y,_,N){return _&&b(y.prototype,_),N&&b(y,N),y}})(),o=function b(y,_,N){y===null&&(y=Function.prototype);var j=Object.getOwnPropertyDescriptor(y,_);if(j===void 0){var S=Object.getPrototypeOf(y);return S===null?void 0:b(S,_,N)}else{if("value"in j)return j.value;var C=j.get;return C===void 0?void 0:C.call(N)}},l=s(7),c=d(l),u=s(0),h=d(u);function d(b){return b&&b.__esModule?b:{default:b}}function m(b,y){if(!(b instanceof y))throw new TypeError("Cannot call a class as a function")}function g(b,y){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:b}function w(b,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);b.prototype=Object.create(y&&y.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(b,y):b.__proto__=y)}var v=(function(b){w(y,b);function y(){return m(this,y),g(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"formatAt",value:function(N,j,S,C){if(y.compare(this.statics.blotName,S)<0&&h.default.query(S,h.default.Scope.BLOT)){var P=this.isolate(N,j);C&&P.wrap(S,C)}else o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"formatAt",this).call(this,N,j,S,C)}},{key:"optimize",value:function(N){if(o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"optimize",this).call(this,N),this.parent instanceof y&&y.compare(this.statics.blotName,this.parent.statics.blotName)>0){var j=this.parent.isolate(this.offset(),this.length());this.moveChildren(j),j.wrap(this)}}}],[{key:"compare",value:function(N,j){var S=y.order.indexOf(N),C=y.order.indexOf(j);return S>=0||C>=0?S-C:N===j?0:N<j?-1:1}}]),y})(h.default.Inline);v.allowedChildren=[v,h.default.Embed,c.default],v.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],r.default=v}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(0),o=l(a);function l(m){return m&&m.__esModule?m:{default:m}}function c(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function u(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function h(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var d=(function(m){h(g,m);function g(){return c(this,g),u(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g})(o.default.Text);r.default=d}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function _(N,j){for(var S=0;S<j.length;S++){var C=j[S];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(N,C.key,C)}}return function(N,j,S){return j&&_(N.prototype,j),S&&_(N,S),N}})(),o=function _(N,j,S){N===null&&(N=Function.prototype);var C=Object.getOwnPropertyDescriptor(N,j);if(C===void 0){var P=Object.getPrototypeOf(N);return P===null?void 0:_(P,j,S)}else{if("value"in C)return C.value;var A=C.get;return A===void 0?void 0:A.call(S)}},l=s(54),c=d(l),u=s(10),h=d(u);function d(_){return _&&_.__esModule?_:{default:_}}function m(_,N){if(!(_ instanceof N))throw new TypeError("Cannot call a class as a function")}function g(_,N){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:_}function w(_,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);_.prototype=Object.create(N&&N.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(_,N):_.__proto__=N)}var v=(0,h.default)("quill:events"),b=["selectionchange","mousedown","mouseup","click"];b.forEach(function(_){document.addEventListener(_,function(){for(var N=arguments.length,j=Array(N),S=0;S<N;S++)j[S]=arguments[S];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(C){if(C.__quill&&C.__quill.emitter){var P;(P=C.__quill.emitter).handleDOM.apply(P,j)}})})});var y=(function(_){w(N,_);function N(){m(this,N);var j=g(this,(N.__proto__||Object.getPrototypeOf(N)).call(this));return j.listeners={},j.on("error",v.error),j}return a(N,[{key:"emit",value:function(){v.log.apply(v,arguments),o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(S){for(var C=arguments.length,P=Array(C>1?C-1:0),A=1;A<C;A++)P[A-1]=arguments[A];(this.listeners[S.type]||[]).forEach(function(F){var I=F.node,R=F.handler;(S.target===I||I.contains(S.target))&&R.apply(void 0,[S].concat(P))})}},{key:"listenDOM",value:function(S,C,P){this.listeners[S]||(this.listeners[S]=[]),this.listeners[S].push({node:C,handler:P})}}]),N})(c.default);y.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},y.sources={API:"api",SILENT:"silent",USER:"user"},r.default=y}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});function a(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}var o=function l(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,l),this.quill=c,this.options=u};o.DEFAULTS={},r.default=o}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function l(u){if(a.indexOf(u)<=a.indexOf(o)){for(var h,d=arguments.length,m=Array(d>1?d-1:0),g=1;g<d;g++)m[g-1]=arguments[g];(h=console)[u].apply(h,m)}}function c(u){return a.reduce(function(h,d){return h[d]=l.bind(console,d,u),h},{})}l.level=c.level=function(u){o=u},r.default=c}),(function(n,r,s){var a=Array.prototype.slice,o=s(52),l=s(53),c=n.exports=function(m,g,w){return w||(w={}),m===g?!0:m instanceof Date&&g instanceof Date?m.getTime()===g.getTime():!m||!g||typeof m!="object"&&typeof g!="object"?w.strict?m===g:m==g:d(m,g,w)};function u(m){return m==null}function h(m){return!(!m||typeof m!="object"||typeof m.length!="number"||typeof m.copy!="function"||typeof m.slice!="function"||m.length>0&&typeof m[0]!="number")}function d(m,g,w){var v,b;if(u(m)||u(g)||m.prototype!==g.prototype)return!1;if(l(m))return l(g)?(m=a.call(m),g=a.call(g),c(m,g,w)):!1;if(h(m)){if(!h(g)||m.length!==g.length)return!1;for(v=0;v<m.length;v++)if(m[v]!==g[v])return!1;return!0}try{var y=o(m),_=o(g)}catch{return!1}if(y.length!=_.length)return!1;for(y.sort(),_.sort(),v=y.length-1;v>=0;v--)if(y[v]!=_[v])return!1;for(v=y.length-1;v>=0;v--)if(b=y[v],!c(m[b],g[b],w))return!1;return typeof m==typeof g}}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(1),o=(function(){function l(c,u,h){h===void 0&&(h={}),this.attrName=c,this.keyName=u;var d=a.Scope.TYPE&a.Scope.ATTRIBUTE;h.scope!=null?this.scope=h.scope&a.Scope.LEVEL|d:this.scope=a.Scope.ATTRIBUTE,h.whitelist!=null&&(this.whitelist=h.whitelist)}return l.keys=function(c){return[].map.call(c.attributes,function(u){return u.name})},l.prototype.add=function(c,u){return this.canAdd(c,u)?(c.setAttribute(this.keyName,u),!0):!1},l.prototype.canAdd=function(c,u){var h=a.query(c,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return h==null?!1:this.whitelist==null?!0:typeof u=="string"?this.whitelist.indexOf(u.replace(/["']/g,""))>-1:this.whitelist.indexOf(u)>-1},l.prototype.remove=function(c){c.removeAttribute(this.keyName)},l.prototype.value=function(c){var u=c.getAttribute(this.keyName);return this.canAdd(c,u)&&u?u:""},l})();r.default=o}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Code=void 0;var a=(function(){function A(F,I){var R=[],M=!0,$=!1,B=void 0;try{for(var U=F[Symbol.iterator](),G;!(M=(G=U.next()).done)&&(R.push(G.value),!(I&&R.length===I));M=!0);}catch(Z){$=!0,B=Z}finally{try{!M&&U.return&&U.return()}finally{if($)throw B}}return R}return function(F,I){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return A(F,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function A(F,I){for(var R=0;R<I.length;R++){var M=I[R];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(F,M.key,M)}}return function(F,I,R){return I&&A(F.prototype,I),R&&A(F,R),F}})(),l=function A(F,I,R){F===null&&(F=Function.prototype);var M=Object.getOwnPropertyDescriptor(F,I);if(M===void 0){var $=Object.getPrototypeOf(F);return $===null?void 0:A($,I,R)}else{if("value"in M)return M.value;var B=M.get;return B===void 0?void 0:B.call(R)}},c=s(2),u=_(c),h=s(0),d=_(h),m=s(4),g=_(m),w=s(6),v=_(w),b=s(7),y=_(b);function _(A){return A&&A.__esModule?A:{default:A}}function N(A,F){if(!(A instanceof F))throw new TypeError("Cannot call a class as a function")}function j(A,F){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:A}function S(A,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);A.prototype=Object.create(F&&F.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(A,F):A.__proto__=F)}var C=(function(A){S(F,A);function F(){return N(this,F),j(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return F})(v.default);C.blotName="code",C.tagName="CODE";var P=(function(A){S(F,A);function F(){return N(this,F),j(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return o(F,[{key:"delta",value:function(){var R=this,M=this.domNode.textContent;return M.endsWith(`
730`)&&(M=M.slice(0,-1)),M.split(`
731`).reduce(function($,B){return $.insert(B).insert(`
732`,R.formats())},new u.default)}},{key:"format",value:function(R,M){if(!(R===this.statics.blotName&&M)){var $=this.descendant(y.default,this.length()-1),B=a($,1),U=B[0];U!=null&&U.deleteAt(U.length()-1,1),l(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"format",this).call(this,R,M)}}},{key:"formatAt",value:function(R,M,$,B){if(M!==0&&!(d.default.query($,d.default.Scope.BLOCK)==null||$===this.statics.blotName&&B===this.statics.formats(this.domNode))){var U=this.newlineIndex(R);if(!(U<0||U>=R+M)){var G=this.newlineIndex(R,!0)+1,Z=U-G+1,X=this.isolate(G,Z),V=X.next;X.format($,B),V instanceof F&&V.formatAt(0,R-G+M-Z,$,B)}}}},{key:"insertAt",value:function(R,M,$){if($==null){var B=this.descendant(y.default,R),U=a(B,2),G=U[0],Z=U[1];G.insertAt(Z,M)}}},{key:"length",value:function(){var R=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
733`)?R:R+1}},{key:"newlineIndex",value:function(R){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(M)return this.domNode.textContent.slice(0,R).lastIndexOf(`
734`);var $=this.domNode.textContent.slice(R).indexOf(`
735`);return $>-1?R+$:-1}},{key:"optimize",value:function(R){this.domNode.textContent.endsWith(`
736`)||this.appendChild(d.default.create("text",`
737`)),l(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"optimize",this).call(this,R);var M=this.next;M!=null&&M.prev===this&&M.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===M.statics.formats(M.domNode)&&(M.optimize(R),M.moveChildren(this),M.remove())}},{key:"replace",value:function(R){l(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"replace",this).call(this,R),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(M){var $=d.default.find(M);$==null?M.parentNode.removeChild(M):$ instanceof d.default.Embed?$.remove():$.unwrap()})}}],[{key:"create",value:function(R){var M=l(F.__proto__||Object.getPrototypeOf(F),"create",this).call(this,R);return M.setAttribute("spellcheck",!1),M}},{key:"formats",value:function(){return!0}}]),F})(g.default);P.blotName="code-block",P.tagName="PRE",P.TAB="  ",r.Code=C,r.default=P}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},o=(function(){function V(z,L){var W=[],Q=!0,J=!1,ne=void 0;try{for(var Y=z[Symbol.iterator](),ee;!(Q=(ee=Y.next()).done)&&(W.push(ee.value),!(L&&W.length===L));Q=!0);}catch(le){J=!0,ne=le}finally{try{!Q&&Y.return&&Y.return()}finally{if(J)throw ne}}return W}return function(z,L){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return V(z,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function V(z,L){for(var W=0;W<L.length;W++){var Q=L[W];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(z,Q.key,Q)}}return function(z,L,W){return L&&V(z.prototype,L),W&&V(z,W),z}})(),c=s(2),u=M(c),h=s(20),d=M(h),m=s(0),g=M(m),w=s(13),v=M(w),b=s(24),y=M(b),_=s(4),N=M(_),j=s(16),S=M(j),C=s(21),P=M(C),A=s(11),F=M(A),I=s(3),R=M(I);function M(V){return V&&V.__esModule?V:{default:V}}function $(V,z,L){return z in V?Object.defineProperty(V,z,{value:L,enumerable:!0,configurable:!0,writable:!0}):V[z]=L,V}function B(V,z){if(!(V instanceof z))throw new TypeError("Cannot call a class as a function")}var U=/^[ -~]*$/,G=(function(){function V(z){B(this,V),this.scroll=z,this.delta=this.getDelta()}return l(V,[{key:"applyDelta",value:function(L){var W=this,Q=!1;this.scroll.update();var J=this.scroll.length();return this.scroll.batchStart(),L=X(L),L.reduce(function(ne,Y){var ee=Y.retain||Y.delete||Y.insert.length||1,le=Y.attributes||{};if(Y.insert!=null){if(typeof Y.insert=="string"){var re=Y.insert;re.endsWith(`
738`)&&Q&&(Q=!1,re=re.slice(0,-1)),ne>=J&&!re.endsWith(`
739`)&&(Q=!0),W.scroll.insertAt(ne,re);var fe=W.scroll.line(ne),ge=o(fe,2),he=ge[0],De=ge[1],_e=(0,R.default)({},(0,_.bubbleFormats)(he));if(he instanceof N.default){var We=he.descendant(g.default.Leaf,De),ze=o(We,1),Xe=ze[0];_e=(0,R.default)(_e,(0,_.bubbleFormats)(Xe))}le=d.default.attributes.diff(_e,le)||{}}else if(a(Y.insert)==="object"){var ke=Object.keys(Y.insert)[0];if(ke==null)return ne;W.scroll.insertAt(ne,ke,Y.insert[ke])}J+=ee}return Object.keys(le).forEach(function(Ae){W.scroll.formatAt(ne,ee,Ae,le[Ae])}),ne+ee},0),L.reduce(function(ne,Y){return typeof Y.delete=="number"?(W.scroll.deleteAt(ne,Y.delete),ne):ne+(Y.retain||Y.insert.length||1)},0),this.scroll.batchEnd(),this.update(L)}},{key:"deleteText",value:function(L,W){return this.scroll.deleteAt(L,W),this.update(new u.default().retain(L).delete(W))}},{key:"formatLine",value:function(L,W){var Q=this,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(J).forEach(function(ne){if(!(Q.scroll.whitelist!=null&&!Q.scroll.whitelist[ne])){var Y=Q.scroll.lines(L,Math.max(W,1)),ee=W;Y.forEach(function(le){var re=le.length();if(!(le instanceof v.default))le.format(ne,J[ne]);else{var fe=L-le.offset(Q.scroll),ge=le.newlineIndex(fe+ee)-fe+1;le.formatAt(fe,ge,ne,J[ne])}ee-=re})}}),this.scroll.optimize(),this.update(new u.default().retain(L).retain(W,(0,P.default)(J)))}},{key:"formatText",value:function(L,W){var Q=this,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(J).forEach(function(ne){Q.scroll.formatAt(L,W,ne,J[ne])}),this.update(new u.default().retain(L).retain(W,(0,P.default)(J)))}},{key:"getContents",value:function(L,W){return this.delta.slice(L,L+W)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(L,W){return L.concat(W.delta())},new u.default)}},{key:"getFormat",value:function(L){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Q=[],J=[];W===0?this.scroll.path(L).forEach(function(Y){var ee=o(Y,1),le=ee[0];le instanceof N.default?Q.push(le):le instanceof g.default.Leaf&&J.push(le)}):(Q=this.scroll.lines(L,W),J=this.scroll.descendants(g.default.Leaf,L,W));var ne=[Q,J].map(function(Y){if(Y.length===0)return{};for(var ee=(0,_.bubbleFormats)(Y.shift());Object.keys(ee).length>0;){var le=Y.shift();if(le==null)return ee;ee=Z((0,_.bubbleFormats)(le),ee)}return ee});return R.default.apply(R.default,ne)}},{key:"getText",value:function(L,W){return this.getContents(L,W).filter(function(Q){return typeof Q.insert=="string"}).map(function(Q){return Q.insert}).join("")}},{key:"insertEmbed",value:function(L,W,Q){return this.scroll.insertAt(L,W,Q),this.update(new u.default().retain(L).insert($({},W,Q)))}},{key:"insertText",value:function(L,W){var Q=this,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return W=W.replace(/\r\n/g,`
740`).replace(/\r/g,`
741`),this.scroll.insertAt(L,W),Object.keys(J).forEach(function(ne){Q.scroll.formatAt(L,W.length,ne,J[ne])}),this.update(new u.default().retain(L).insert(W,(0,P.default)(J)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var L=this.scroll.children.head;return L.statics.blotName!==N.default.blotName||L.children.length>1?!1:L.children.head instanceof S.default}},{key:"removeFormat",value:function(L,W){var Q=this.getText(L,W),J=this.scroll.line(L+W),ne=o(J,2),Y=ne[0],ee=ne[1],le=0,re=new u.default;Y!=null&&(Y instanceof v.default?le=Y.newlineIndex(ee)-ee+1:le=Y.length()-ee,re=Y.delta().slice(ee,ee+le-1).insert(`
742`));var fe=this.getContents(L,W+le),ge=fe.diff(new u.default().insert(Q).concat(re)),he=new u.default().retain(L).concat(ge);return this.applyDelta(he)}},{key:"update",value:function(L){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,J=this.delta;if(W.length===1&&W[0].type==="characterData"&&W[0].target.data.match(U)&&g.default.find(W[0].target)){var ne=g.default.find(W[0].target),Y=(0,_.bubbleFormats)(ne),ee=ne.offset(this.scroll),le=W[0].oldValue.replace(y.default.CONTENTS,""),re=new u.default().insert(le),fe=new u.default().insert(ne.value()),ge=new u.default().retain(ee).concat(re.diff(fe,Q));L=ge.reduce(function(he,De){return De.insert?he.insert(De.insert,Y):he.push(De)},new u.default),this.delta=J.compose(L)}else this.delta=this.getDelta(),(!L||!(0,F.default)(J.compose(L),this.delta))&&(L=J.diff(this.delta,Q));return L}}]),V})();function Z(V,z){return Object.keys(z).reduce(function(L,W){return V[W]==null||(z[W]===V[W]?L[W]=z[W]:Array.isArray(z[W])?z[W].indexOf(V[W])<0&&(L[W]=z[W].concat([V[W]])):L[W]=[z[W],V[W]]),L},{})}function X(V){return V.reduce(function(z,L){if(L.insert===1){var W=(0,P.default)(L.attributes);return delete W.image,z.insert({image:L.attributes.image},W)}if(L.attributes!=null&&(L.attributes.list===!0||L.attributes.bullet===!0)&&(L=(0,P.default)(L),L.attributes.list?L.attributes.list="ordered":(L.attributes.list="bullet",delete L.attributes.bullet)),typeof L.insert=="string"){var Q=L.insert.replace(/\r\n/g,`
743`).replace(/\r/g,`
744`);return z.insert(Q,L.attributes)}return z.push(L)},new u.default)}r.default=G}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Range=void 0;var a=(function(){function A(F,I){var R=[],M=!0,$=!1,B=void 0;try{for(var U=F[Symbol.iterator](),G;!(M=(G=U.next()).done)&&(R.push(G.value),!(I&&R.length===I));M=!0);}catch(Z){$=!0,B=Z}finally{try{!M&&U.return&&U.return()}finally{if($)throw B}}return R}return function(F,I){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return A(F,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function A(F,I){for(var R=0;R<I.length;R++){var M=I[R];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(F,M.key,M)}}return function(F,I,R){return I&&A(F.prototype,I),R&&A(F,R),F}})(),l=s(0),c=y(l),u=s(21),h=y(u),d=s(11),m=y(d),g=s(8),w=y(g),v=s(10),b=y(v);function y(A){return A&&A.__esModule?A:{default:A}}function _(A){if(Array.isArray(A)){for(var F=0,I=Array(A.length);F<A.length;F++)I[F]=A[F];return I}else return Array.from(A)}function N(A,F){if(!(A instanceof F))throw new TypeError("Cannot call a class as a function")}var j=(0,b.default)("quill:selection"),S=function A(F){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;N(this,A),this.index=F,this.length=I},C=(function(){function A(F,I){var R=this;N(this,A),this.emitter=I,this.scroll=F,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=c.default.create("cursor",this),this.lastRange=this.savedRange=new S(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){R.mouseDown||setTimeout(R.update.bind(R,w.default.sources.USER),1)}),this.emitter.on(w.default.events.EDITOR_CHANGE,function(M,$){M===w.default.events.TEXT_CHANGE&&$.length()>0&&R.update(w.default.sources.SILENT)}),this.emitter.on(w.default.events.SCROLL_BEFORE_UPDATE,function(){if(R.hasFocus()){var M=R.getNativeRange();M!=null&&M.start.node!==R.cursor.textNode&&R.emitter.once(w.default.events.SCROLL_UPDATE,function(){try{R.setNativeRange(M.start.node,M.start.offset,M.end.node,M.end.offset)}catch{}})}}),this.emitter.on(w.default.events.SCROLL_OPTIMIZE,function(M,$){if($.range){var B=$.range,U=B.startNode,G=B.startOffset,Z=B.endNode,X=B.endOffset;R.setNativeRange(U,G,Z,X)}}),this.update(w.default.sources.SILENT)}return o(A,[{key:"handleComposition",value:function(){var I=this;this.root.addEventListener("compositionstart",function(){I.composing=!0}),this.root.addEventListener("compositionend",function(){if(I.composing=!1,I.cursor.parent){var R=I.cursor.restore();if(!R)return;setTimeout(function(){I.setNativeRange(R.startNode,R.startOffset,R.endNode,R.endOffset)},1)}})}},{key:"handleDragging",value:function(){var I=this;this.emitter.listenDOM("mousedown",document.body,function(){I.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){I.mouseDown=!1,I.update(w.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(I,R){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[I])){this.scroll.update();var M=this.getNativeRange();if(!(M==null||!M.native.collapsed||c.default.query(I,c.default.Scope.BLOCK))){if(M.start.node!==this.cursor.textNode){var $=c.default.find(M.start.node,!1);if($==null)return;if($ instanceof c.default.Leaf){var B=$.split(M.start.offset);$.parent.insertBefore(this.cursor,B)}else $.insertBefore(this.cursor,M.start.node);this.cursor.attach()}this.cursor.format(I,R),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=this.scroll.length();I=Math.min(I,M-1),R=Math.min(I+R,M-1)-I;var $=void 0,B=this.scroll.leaf(I),U=a(B,2),G=U[0],Z=U[1];if(G==null)return null;var X=G.position(Z,!0),V=a(X,2);$=V[0],Z=V[1];var z=document.createRange();if(R>0){z.setStart($,Z);var L=this.scroll.leaf(I+R),W=a(L,2);if(G=W[0],Z=W[1],G==null)return null;var Q=G.position(Z,!0),J=a(Q,2);return $=J[0],Z=J[1],z.setEnd($,Z),z.getBoundingClientRect()}else{var ne="left",Y=void 0;return $ instanceof Text?(Z<$.data.length?(z.setStart($,Z),z.setEnd($,Z+1)):(z.setStart($,Z-1),z.setEnd($,Z),ne="right"),Y=z.getBoundingClientRect()):(Y=G.domNode.getBoundingClientRect(),Z>0&&(ne="right")),{bottom:Y.top+Y.height,height:Y.height,left:Y[ne],right:Y[ne],top:Y.top,width:0}}}},{key:"getNativeRange",value:function(){var I=document.getSelection();if(I==null||I.rangeCount<=0)return null;var R=I.getRangeAt(0);if(R==null)return null;var M=this.normalizeNative(R);return j.info("getNativeRange",M),M}},{key:"getRange",value:function(){var I=this.getNativeRange();if(I==null)return[null,null];var R=this.normalizedToRange(I);return[R,I]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(I){var R=this,M=[[I.start.node,I.start.offset]];I.native.collapsed||M.push([I.end.node,I.end.offset]);var $=M.map(function(G){var Z=a(G,2),X=Z[0],V=Z[1],z=c.default.find(X,!0),L=z.offset(R.scroll);return V===0?L:z instanceof c.default.Container?L+z.length():L+z.index(X,V)}),B=Math.min(Math.max.apply(Math,_($)),this.scroll.length()-1),U=Math.min.apply(Math,[B].concat(_($)));return new S(U,B-U)}},{key:"normalizeNative",value:function(I){if(!P(this.root,I.startContainer)||!I.collapsed&&!P(this.root,I.endContainer))return null;var R={start:{node:I.startContainer,offset:I.startOffset},end:{node:I.endContainer,offset:I.endOffset},native:I};return[R.start,R.end].forEach(function(M){for(var $=M.node,B=M.offset;!($ instanceof Text)&&$.childNodes.length>0;)if($.childNodes.length>B)$=$.childNodes[B],B=0;else if($.childNodes.length===B)$=$.lastChild,B=$ instanceof Text?$.data.length:$.childNodes.length+1;else break;M.node=$,M.offset=B}),R}},{key:"rangeToNative",value:function(I){var R=this,M=I.collapsed?[I.index]:[I.index,I.index+I.length],$=[],B=this.scroll.length();return M.forEach(function(U,G){U=Math.min(B-1,U);var Z=void 0,X=R.scroll.leaf(U),V=a(X,2),z=V[0],L=V[1],W=z.position(L,G!==0),Q=a(W,2);Z=Q[0],L=Q[1],$.push(Z,L)}),$.length<2&&($=$.concat($)),$}},{key:"scrollIntoView",value:function(I){var R=this.lastRange;if(R!=null){var M=this.getBounds(R.index,R.length);if(M!=null){var $=this.scroll.length()-1,B=this.scroll.line(Math.min(R.index,$)),U=a(B,1),G=U[0],Z=G;if(R.length>0){var X=this.scroll.line(Math.min(R.index+R.length,$)),V=a(X,1);Z=V[0]}if(!(G==null||Z==null)){var z=I.getBoundingClientRect();M.top<z.top?I.scrollTop-=z.top-M.top:M.bottom>z.bottom&&(I.scrollTop+=M.bottom-z.bottom)}}}}},{key:"setNativeRange",value:function(I,R){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:I,$=arguments.length>3&&arguments[3]!==void 0?arguments[3]:R,B=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(j.info("setNativeRange",I,R,M,$),!(I!=null&&(this.root.parentNode==null||I.parentNode==null||M.parentNode==null))){var U=document.getSelection();if(U!=null)if(I!=null){this.hasFocus()||this.root.focus();var G=(this.getNativeRange()||{}).native;if(G==null||B||I!==G.startContainer||R!==G.startOffset||M!==G.endContainer||$!==G.endOffset){I.tagName=="BR"&&(R=[].indexOf.call(I.parentNode.childNodes,I),I=I.parentNode),M.tagName=="BR"&&($=[].indexOf.call(M.parentNode.childNodes,M),M=M.parentNode);var Z=document.createRange();Z.setStart(I,R),Z.setEnd(M,$),U.removeAllRanges(),U.addRange(Z)}}else U.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:w.default.sources.API;if(typeof R=="string"&&(M=R,R=!1),j.info("setRange",I),I!=null){var $=this.rangeToNative(I);this.setNativeRange.apply(this,_($).concat([R]))}else this.setNativeRange(null);this.update(M)}},{key:"update",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w.default.sources.USER,R=this.lastRange,M=this.getRange(),$=a(M,2),B=$[0],U=$[1];if(this.lastRange=B,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,m.default)(R,this.lastRange)){var G;!this.composing&&U!=null&&U.native.collapsed&&U.start.node!==this.cursor.textNode&&this.cursor.restore();var Z=[w.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(R),I];if((G=this.emitter).emit.apply(G,[w.default.events.EDITOR_CHANGE].concat(Z)),I!==w.default.sources.SILENT){var X;(X=this.emitter).emit.apply(X,Z)}}}}]),A})();function P(A,F){try{F.parentNode}catch{return!1}return F instanceof Text&&(F=F.parentNode),A.contains(F)}r.Range=S,r.default=C}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function w(v,b){for(var y=0;y<b.length;y++){var _=b[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}return function(v,b,y){return b&&w(v.prototype,b),y&&w(v,y),v}})(),o=function w(v,b,y){v===null&&(v=Function.prototype);var _=Object.getOwnPropertyDescriptor(v,b);if(_===void 0){var N=Object.getPrototypeOf(v);return N===null?void 0:w(N,b,y)}else{if("value"in _)return _.value;var j=_.get;return j===void 0?void 0:j.call(y)}},l=s(0),c=u(l);function u(w){return w&&w.__esModule?w:{default:w}}function h(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function d(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function m(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var g=(function(w){m(v,w);function v(){return h(this,v),d(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"insertInto",value:function(y,_){y.children.length===0?o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertInto",this).call(this,y,_):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),v})(c.default.Embed);g.blotName="break",g.tagName="BR",r.default=g}),(function(n,r,s){var a=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,g){m.__proto__=g}||function(m,g){for(var w in g)g.hasOwnProperty(w)&&(m[w]=g[w])};return function(m,g){d(m,g);function w(){this.constructor=m}m.prototype=g===null?Object.create(g):(w.prototype=g.prototype,new w)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=s(44),l=s(30),c=s(1),u=(function(d){a(m,d);function m(g){var w=d.call(this,g)||this;return w.build(),w}return m.prototype.appendChild=function(g){this.insertBefore(g)},m.prototype.attach=function(){d.prototype.attach.call(this),this.children.forEach(function(g){g.attach()})},m.prototype.build=function(){var g=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(w){try{var v=h(w);g.insertBefore(v,g.children.head||void 0)}catch(b){if(b instanceof c.ParchmentError)return;throw b}})},m.prototype.deleteAt=function(g,w){if(g===0&&w===this.length())return this.remove();this.children.forEachAt(g,w,function(v,b,y){v.deleteAt(b,y)})},m.prototype.descendant=function(g,w){var v=this.children.find(w),b=v[0],y=v[1];return g.blotName==null&&g(b)||g.blotName!=null&&b instanceof g?[b,y]:b instanceof m?b.descendant(g,y):[null,-1]},m.prototype.descendants=function(g,w,v){w===void 0&&(w=0),v===void 0&&(v=Number.MAX_VALUE);var b=[],y=v;return this.children.forEachAt(w,v,function(_,N,j){(g.blotName==null&&g(_)||g.blotName!=null&&_ instanceof g)&&b.push(_),_ instanceof m&&(b=b.concat(_.descendants(g,N,y))),y-=j}),b},m.prototype.detach=function(){this.children.forEach(function(g){g.detach()}),d.prototype.detach.call(this)},m.prototype.formatAt=function(g,w,v,b){this.children.forEachAt(g,w,function(y,_,N){y.formatAt(_,N,v,b)})},m.prototype.insertAt=function(g,w,v){var b=this.children.find(g),y=b[0],_=b[1];if(y)y.insertAt(_,w,v);else{var N=v==null?c.create("text",w):c.create(w,v);this.appendChild(N)}},m.prototype.insertBefore=function(g,w){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(v){return g instanceof v}))throw new c.ParchmentError("Cannot insert "+g.statics.blotName+" into "+this.statics.blotName);g.insertInto(this,w)},m.prototype.length=function(){return this.children.reduce(function(g,w){return g+w.length()},0)},m.prototype.moveChildren=function(g,w){this.children.forEach(function(v){g.insertBefore(v,w)})},m.prototype.optimize=function(g){if(d.prototype.optimize.call(this,g),this.children.length===0)if(this.statics.defaultChild!=null){var w=c.create(this.statics.defaultChild);this.appendChild(w),w.optimize(g)}else this.remove()},m.prototype.path=function(g,w){w===void 0&&(w=!1);var v=this.children.find(g,w),b=v[0],y=v[1],_=[[this,g]];return b instanceof m?_.concat(b.path(y,w)):(b!=null&&_.push([b,y]),_)},m.prototype.removeChild=function(g){this.children.remove(g)},m.prototype.replace=function(g){g instanceof m&&g.moveChildren(this),d.prototype.replace.call(this,g)},m.prototype.split=function(g,w){if(w===void 0&&(w=!1),!w){if(g===0)return this;if(g===this.length())return this.next}var v=this.clone();return this.parent.insertBefore(v,this.next),this.children.forEachAt(g,this.length(),function(b,y,_){b=b.split(y,w),v.appendChild(b)}),v},m.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},m.prototype.update=function(g,w){var v=this,b=[],y=[];g.forEach(function(_){_.target===v.domNode&&_.type==="childList"&&(b.push.apply(b,_.addedNodes),y.push.apply(y,_.removedNodes))}),y.forEach(function(_){if(!(_.parentNode!=null&&_.tagName!=="IFRAME"&&document.body.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var N=c.find(_);N!=null&&(N.domNode.parentNode==null||N.domNode.parentNode===v.domNode)&&N.detach()}}),b.filter(function(_){return _.parentNode==v.domNode}).sort(function(_,N){return _===N?0:_.compareDocumentPosition(N)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(_){var N=null;_.nextSibling!=null&&(N=c.find(_.nextSibling));var j=h(_);(j.next!=N||j.next==null)&&(j.parent!=null&&j.parent.removeChild(v),v.insertBefore(j,N||void 0))})},m})(l.default);function h(d){var m=c.find(d);if(m==null)try{m=c.create(d)}catch{m=c.create(c.Scope.INLINE),[].slice.call(d.childNodes).forEach(function(w){m.domNode.appendChild(w)}),d.parentNode&&d.parentNode.replaceChild(m.domNode,d),m.attach()}return m}r.default=u}),(function(n,r,s){var a=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,g){m.__proto__=g}||function(m,g){for(var w in g)g.hasOwnProperty(w)&&(m[w]=g[w])};return function(m,g){d(m,g);function w(){this.constructor=m}m.prototype=g===null?Object.create(g):(w.prototype=g.prototype,new w)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=s(12),l=s(31),c=s(17),u=s(1),h=(function(d){a(m,d);function m(g){var w=d.call(this,g)||this;return w.attributes=new l.default(w.domNode),w}return m.formats=function(g){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return g.tagName.toLowerCase()},m.prototype.format=function(g,w){var v=u.query(g);v instanceof o.default?this.attributes.attribute(v,w):w&&v!=null&&(g!==this.statics.blotName||this.formats()[g]!==w)&&this.replaceWith(g,w)},m.prototype.formats=function(){var g=this.attributes.values(),w=this.statics.formats(this.domNode);return w!=null&&(g[this.statics.blotName]=w),g},m.prototype.replaceWith=function(g,w){var v=d.prototype.replaceWith.call(this,g,w);return this.attributes.copy(v),v},m.prototype.update=function(g,w){var v=this;d.prototype.update.call(this,g,w),g.some(function(b){return b.target===v.domNode&&b.type==="attributes"})&&this.attributes.build()},m.prototype.wrap=function(g,w){var v=d.prototype.wrap.call(this,g,w);return v instanceof m&&v.statics.scope===this.statics.scope&&this.attributes.move(v),v},m})(c.default);r.default=h}),(function(n,r,s){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m])};return function(h,d){u(h,d);function m(){this.constructor=h}h.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=s(30),l=s(1),c=(function(u){a(h,u);function h(){return u!==null&&u.apply(this,arguments)||this}return h.value=function(d){return!0},h.prototype.index=function(d,m){return this.domNode===d||this.domNode.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(m,1):-1},h.prototype.position=function(d,m){var g=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return d>0&&(g+=1),[this.parent.domNode,g]},h.prototype.value=function(){var d;return d={},d[this.statics.blotName]=this.statics.value(this.domNode)||!0,d},h.scope=l.Scope.INLINE_BLOT,h})(o.default);r.default=c}),(function(n,r,s){var a=s(11),o=s(3),l={attributes:{compose:function(u,h,d){typeof u!="object"&&(u={}),typeof h!="object"&&(h={});var m=o(!0,{},h);d||(m=Object.keys(m).reduce(function(w,v){return m[v]!=null&&(w[v]=m[v]),w},{}));for(var g in u)u[g]!==void 0&&h[g]===void 0&&(m[g]=u[g]);return Object.keys(m).length>0?m:void 0},diff:function(u,h){typeof u!="object"&&(u={}),typeof h!="object"&&(h={});var d=Object.keys(u).concat(Object.keys(h)).reduce(function(m,g){return a(u[g],h[g])||(m[g]=h[g]===void 0?null:h[g]),m},{});return Object.keys(d).length>0?d:void 0},transform:function(u,h,d){if(typeof u!="object")return h;if(typeof h=="object"){if(!d)return h;var m=Object.keys(h).reduce(function(g,w){return u[w]===void 0&&(g[w]=h[w]),g},{});return Object.keys(m).length>0?m:void 0}}},iterator:function(u){return new c(u)},length:function(u){return typeof u.delete=="number"?u.delete:typeof u.retain=="number"?u.retain:typeof u.insert=="string"?u.insert.length:1}};function c(u){this.ops=u,this.index=0,this.offset=0}c.prototype.hasNext=function(){return this.peekLength()<1/0},c.prototype.next=function(u){u||(u=1/0);var h=this.ops[this.index];if(h){var d=this.offset,m=l.length(h);if(u>=m-d?(u=m-d,this.index+=1,this.offset=0):this.offset+=u,typeof h.delete=="number")return{delete:u};var g={};return h.attributes&&(g.attributes=h.attributes),typeof h.retain=="number"?g.retain=u:typeof h.insert=="string"?g.insert=h.insert.substr(d,u):g.insert=h.insert,g}else return{retain:1/0}},c.prototype.peek=function(){return this.ops[this.index]},c.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},c.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},c.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var u=this.offset,h=this.index,d=this.next(),m=this.ops.slice(this.index);return this.offset=u,this.index=h,[d].concat(m)}else return[]},n.exports=l}),(function(n,r){var s=(function(){function a(v,b){return b!=null&&v instanceof b}var o;try{o=Map}catch{o=function(){}}var l;try{l=Set}catch{l=function(){}}var c;try{c=Promise}catch{c=function(){}}function u(v,b,y,_,N){typeof b=="object"&&(y=b.depth,_=b.prototype,N=b.includeNonEnumerable,b=b.circular);var j=[],S=[],C=typeof Buffer<"u";typeof b>"u"&&(b=!0),typeof y>"u"&&(y=1/0);function P(A,F){if(A===null)return null;if(F===0)return A;var I,R;if(typeof A!="object")return A;if(a(A,o))I=new o;else if(a(A,l))I=new l;else if(a(A,c))I=new c(function(z,L){A.then(function(W){z(P(W,F-1))},function(W){L(P(W,F-1))})});else if(u.__isArray(A))I=[];else if(u.__isRegExp(A))I=new RegExp(A.source,w(A)),A.lastIndex&&(I.lastIndex=A.lastIndex);else if(u.__isDate(A))I=new Date(A.getTime());else{if(C&&Buffer.isBuffer(A))return Buffer.allocUnsafe?I=Buffer.allocUnsafe(A.length):I=new Buffer(A.length),A.copy(I),I;a(A,Error)?I=Object.create(A):typeof _>"u"?(R=Object.getPrototypeOf(A),I=Object.create(R)):(I=Object.create(_),R=_)}if(b){var M=j.indexOf(A);if(M!=-1)return S[M];j.push(A),S.push(I)}a(A,o)&&A.forEach(function(z,L){var W=P(L,F-1),Q=P(z,F-1);I.set(W,Q)}),a(A,l)&&A.forEach(function(z){var L=P(z,F-1);I.add(L)});for(var $ in A){var B;R&&(B=Object.getOwnPropertyDescriptor(R,$)),!(B&&B.set==null)&&(I[$]=P(A[$],F-1))}if(Object.getOwnPropertySymbols)for(var U=Object.getOwnPropertySymbols(A),$=0;$<U.length;$++){var G=U[$],Z=Object.getOwnPropertyDescriptor(A,G);Z&&!Z.enumerable&&!N||(I[G]=P(A[G],F-1),Z.enumerable||Object.defineProperty(I,G,{enumerable:!1}))}if(N)for(var X=Object.getOwnPropertyNames(A),$=0;$<X.length;$++){var V=X[$],Z=Object.getOwnPropertyDescriptor(A,V);Z&&Z.enumerable||(I[V]=P(A[V],F-1),Object.defineProperty(I,V,{enumerable:!1}))}return I}return P(v,y)}u.clonePrototype=function(b){if(b===null)return null;var y=function(){};return y.prototype=b,new y};function h(v){return Object.prototype.toString.call(v)}u.__objToStr=h;function d(v){return typeof v=="object"&&h(v)==="[object Date]"}u.__isDate=d;function m(v){return typeof v=="object"&&h(v)==="[object Array]"}u.__isArray=m;function g(v){return typeof v=="object"&&h(v)==="[object RegExp]"}u.__isRegExp=g;function w(v){var b="";return v.global&&(b+="g"),v.ignoreCase&&(b+="i"),v.multiline&&(b+="m"),b}return u.__getRegExpFlags=w,u})();typeof n=="object"&&n.exports&&(n.exports=s)}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function I(R,M){var $=[],B=!0,U=!1,G=void 0;try{for(var Z=R[Symbol.iterator](),X;!(B=(X=Z.next()).done)&&($.push(X.value),!(M&&$.length===M));B=!0);}catch(V){U=!0,G=V}finally{try{!B&&Z.return&&Z.return()}finally{if(U)throw G}}return $}return function(R,M){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return I(R,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function I(R,M){for(var $=0;$<M.length;$++){var B=M[$];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(R,B.key,B)}}return function(R,M,$){return M&&I(R.prototype,M),$&&I(R,$),R}})(),l=function I(R,M,$){R===null&&(R=Function.prototype);var B=Object.getOwnPropertyDescriptor(R,M);if(B===void 0){var U=Object.getPrototypeOf(R);return U===null?void 0:I(U,M,$)}else{if("value"in B)return B.value;var G=B.get;return G===void 0?void 0:G.call($)}},c=s(0),u=j(c),h=s(8),d=j(h),m=s(4),g=j(m),w=s(16),v=j(w),b=s(13),y=j(b),_=s(25),N=j(_);function j(I){return I&&I.__esModule?I:{default:I}}function S(I,R){if(!(I instanceof R))throw new TypeError("Cannot call a class as a function")}function C(I,R){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:I}function P(I,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);I.prototype=Object.create(R&&R.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(I,R):I.__proto__=R)}function A(I){return I instanceof g.default||I instanceof m.BlockEmbed}var F=(function(I){P(R,I);function R(M,$){S(this,R);var B=C(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,M));return B.emitter=$.emitter,Array.isArray($.whitelist)&&(B.whitelist=$.whitelist.reduce(function(U,G){return U[G]=!0,U},{})),B.domNode.addEventListener("DOMNodeInserted",function(){}),B.optimize(),B.enable(),B}return o(R,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function($,B){var U=this.line($),G=a(U,2),Z=G[0],X=G[1],V=this.line($+B),z=a(V,1),L=z[0];if(l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"deleteAt",this).call(this,$,B),L!=null&&Z!==L&&X>0){if(Z instanceof m.BlockEmbed||L instanceof m.BlockEmbed){this.optimize();return}if(Z instanceof y.default){var W=Z.newlineIndex(Z.length(),!0);if(W>-1&&(Z=Z.split(W+1),Z===L)){this.optimize();return}}else if(L instanceof y.default){var Q=L.newlineIndex(0);Q>-1&&L.split(Q+1)}var J=L.children.head instanceof v.default?null:L.children.head;Z.moveChildren(L,J),Z.remove()}this.optimize()}},{key:"enable",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",$)}},{key:"formatAt",value:function($,B,U,G){this.whitelist!=null&&!this.whitelist[U]||(l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"formatAt",this).call(this,$,B,U,G),this.optimize())}},{key:"insertAt",value:function($,B,U){if(!(U!=null&&this.whitelist!=null&&!this.whitelist[B])){if($>=this.length())if(U==null||u.default.query(B,u.default.Scope.BLOCK)==null){var G=u.default.create(this.statics.defaultChild);this.appendChild(G),U==null&&B.endsWith(`
745`)&&(B=B.slice(0,-1)),G.insertAt(0,B,U)}else{var Z=u.default.create(B,U);this.appendChild(Z)}else l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,$,B,U);this.optimize()}}},{key:"insertBefore",value:function($,B){if($.statics.scope===u.default.Scope.INLINE_BLOT){var U=u.default.create(this.statics.defaultChild);U.appendChild($),$=U}l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertBefore",this).call(this,$,B)}},{key:"leaf",value:function($){return this.path($).pop()||[null,-1]}},{key:"line",value:function($){return $===this.length()?this.line($-1):this.descendant(A,$)}},{key:"lines",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,U=function G(Z,X,V){var z=[],L=V;return Z.children.forEachAt(X,V,function(W,Q,J){A(W)?z.push(W):W instanceof u.default.Container&&(z=z.concat(G(W,Q,L))),L-=J}),z};return U(this,$,B)}},{key:"optimize",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,$,B),$.length>0&&this.emitter.emit(d.default.events.SCROLL_OPTIMIZE,$,B))}},{key:"path",value:function($){return l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"path",this).call(this,$).slice(1)}},{key:"update",value:function($){if(this.batch!==!0){var B=d.default.sources.USER;typeof $=="string"&&(B=$),Array.isArray($)||($=this.observer.takeRecords()),$.length>0&&this.emitter.emit(d.default.events.SCROLL_BEFORE_UPDATE,B,$),l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"update",this).call(this,$.concat([])),$.length>0&&this.emitter.emit(d.default.events.SCROLL_UPDATE,B,$)}}}]),R})(u.default.Scroll);F.blotName="scroll",F.className="ql-editor",F.tagName="DIV",F.defaultChild="block",F.allowedChildren=[g.default,m.BlockEmbed,N.default],r.default=F}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.SHORTKEY=r.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},o=(function(){function Y(ee,le){var re=[],fe=!0,ge=!1,he=void 0;try{for(var De=ee[Symbol.iterator](),_e;!(fe=(_e=De.next()).done)&&(re.push(_e.value),!(le&&re.length===le));fe=!0);}catch(We){ge=!0,he=We}finally{try{!fe&&De.return&&De.return()}finally{if(ge)throw he}}return re}return function(ee,le){if(Array.isArray(ee))return ee;if(Symbol.iterator in Object(ee))return Y(ee,le);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function Y(ee,le){for(var re=0;re<le.length;re++){var fe=le[re];fe.enumerable=fe.enumerable||!1,fe.configurable=!0,"value"in fe&&(fe.writable=!0),Object.defineProperty(ee,fe.key,fe)}}return function(ee,le,re){return le&&Y(ee.prototype,le),re&&Y(ee,re),ee}})(),c=s(21),u=I(c),h=s(11),d=I(h),m=s(3),g=I(m),w=s(2),v=I(w),b=s(20),y=I(b),_=s(0),N=I(_),j=s(5),S=I(j),C=s(10),P=I(C),A=s(9),F=I(A);function I(Y){return Y&&Y.__esModule?Y:{default:Y}}function R(Y,ee,le){return ee in Y?Object.defineProperty(Y,ee,{value:le,enumerable:!0,configurable:!0,writable:!0}):Y[ee]=le,Y}function M(Y,ee){if(!(Y instanceof ee))throw new TypeError("Cannot call a class as a function")}function $(Y,ee){if(!Y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ee&&(typeof ee=="object"||typeof ee=="function")?ee:Y}function B(Y,ee){if(typeof ee!="function"&&ee!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ee);Y.prototype=Object.create(ee&&ee.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}}),ee&&(Object.setPrototypeOf?Object.setPrototypeOf(Y,ee):Y.__proto__=ee)}var U=(0,P.default)("quill:keyboard"),G=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",Z=(function(Y){B(ee,Y),l(ee,null,[{key:"match",value:function(re,fe){return fe=ne(fe),["altKey","ctrlKey","metaKey","shiftKey"].some(function(ge){return!!fe[ge]!==re[ge]&&fe[ge]!==null})?!1:fe.key===(re.which||re.keyCode)}}]);function ee(le,re){M(this,ee);var fe=$(this,(ee.__proto__||Object.getPrototypeOf(ee)).call(this,le,re));return fe.bindings={},Object.keys(fe.options.bindings).forEach(function(ge){ge==="list autofill"&&le.scroll.whitelist!=null&&!le.scroll.whitelist.list||fe.options.bindings[ge]&&fe.addBinding(fe.options.bindings[ge])}),fe.addBinding({key:ee.keys.ENTER,shiftKey:null},W),fe.addBinding({key:ee.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(fe.addBinding({key:ee.keys.BACKSPACE},{collapsed:!0},V),fe.addBinding({key:ee.keys.DELETE},{collapsed:!0},z)):(fe.addBinding({key:ee.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},V),fe.addBinding({key:ee.keys.DELETE},{collapsed:!0,suffix:/^.?$/},z)),fe.addBinding({key:ee.keys.BACKSPACE},{collapsed:!1},L),fe.addBinding({key:ee.keys.DELETE},{collapsed:!1},L),fe.addBinding({key:ee.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},V),fe.listen(),fe}return l(ee,[{key:"addBinding",value:function(re){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},he=ne(re);if(he==null||he.key==null)return U.warn("Attempted to add invalid keyboard binding",he);typeof fe=="function"&&(fe={handler:fe}),typeof ge=="function"&&(ge={handler:ge}),he=(0,g.default)(he,fe,ge),this.bindings[he.key]=this.bindings[he.key]||[],this.bindings[he.key].push(he)}},{key:"listen",value:function(){var re=this;this.quill.root.addEventListener("keydown",function(fe){if(!fe.defaultPrevented){var ge=fe.which||fe.keyCode,he=(re.bindings[ge]||[]).filter(function(on){return ee.match(fe,on)});if(he.length!==0){var De=re.quill.getSelection();if(!(De==null||!re.quill.hasFocus())){var _e=re.quill.getLine(De.index),We=o(_e,2),ze=We[0],Xe=We[1],ke=re.quill.getLeaf(De.index),Ae=o(ke,2),Be=Ae[0],de=Ae[1],Pe=De.length===0?[Be,de]:re.quill.getLeaf(De.index+De.length),Ze=o(Pe,2),ct=Ze[0],pt=Ze[1],$t=Be instanceof N.default.Text?Be.value().slice(0,de):"",wn=ct instanceof N.default.Text?ct.value().slice(pt):"",an={collapsed:De.length===0,empty:De.length===0&&ze.length()<=1,format:re.quill.getFormat(De),offset:Xe,prefix:$t,suffix:wn},is=he.some(function(on){if(on.collapsed!=null&&on.collapsed!==an.collapsed||on.empty!=null&&on.empty!==an.empty||on.offset!=null&&on.offset!==an.offset)return!1;if(Array.isArray(on.format)){if(on.format.every(function(ir){return an.format[ir]==null}))return!1}else if(a(on.format)==="object"&&!Object.keys(on.format).every(function(ir){return on.format[ir]===!0?an.format[ir]!=null:on.format[ir]===!1?an.format[ir]==null:(0,d.default)(on.format[ir],an.format[ir])}))return!1;return on.prefix!=null&&!on.prefix.test(an.prefix)||on.suffix!=null&&!on.suffix.test(an.suffix)?!1:on.handler.call(re,De,an)!==!0});is&&fe.preventDefault()}}}})}}]),ee})(F.default);Z.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},Z.DEFAULTS={bindings:{bold:J("bold"),italic:J("italic"),underline:J("underline"),indent:{key:Z.keys.TAB,format:["blockquote","indent","list"],handler:function(ee,le){if(le.collapsed&&le.offset!==0)return!0;this.quill.format("indent","+1",S.default.sources.USER)}},outdent:{key:Z.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(ee,le){if(le.collapsed&&le.offset!==0)return!0;this.quill.format("indent","-1",S.default.sources.USER)}},"outdent backspace":{key:Z.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(ee,le){le.format.indent!=null?this.quill.format("indent","-1",S.default.sources.USER):le.format.list!=null&&this.quill.format("list",!1,S.default.sources.USER)}},"indent code-block":Q(!0),"outdent code-block":Q(!1),"remove tab":{key:Z.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(ee){this.quill.deleteText(ee.index-1,1,S.default.sources.USER)}},tab:{key:Z.keys.TAB,handler:function(ee){this.quill.history.cutoff();var le=new v.default().retain(ee.index).delete(ee.length).insert("	");this.quill.updateContents(le,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(ee.index+1,S.default.sources.SILENT)}},"list empty enter":{key:Z.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(ee,le){this.quill.format("list",!1,S.default.sources.USER),le.format.indent&&this.quill.format("indent",!1,S.default.sources.USER)}},"checklist enter":{key:Z.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(ee){var le=this.quill.getLine(ee.index),re=o(le,2),fe=re[0],ge=re[1],he=(0,g.default)({},fe.formats(),{list:"checked"}),De=new v.default().retain(ee.index).insert(`
746`,he).retain(fe.length()-ge-1).retain(1,{list:"unchecked"});this.quill.updateContents(De,S.default.sources.USER),this.quill.setSelection(ee.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:Z.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(ee,le){var re=this.quill.getLine(ee.index),fe=o(re,2),ge=fe[0],he=fe[1],De=new v.default().retain(ee.index).insert(`
747`,le.format).retain(ge.length()-he-1).retain(1,{header:null});this.quill.updateContents(De,S.default.sources.USER),this.quill.setSelection(ee.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(ee,le){var re=le.prefix.length,fe=this.quill.getLine(ee.index),ge=o(fe,2),he=ge[0],De=ge[1];if(De>re)return!0;var _e=void 0;switch(le.prefix.trim()){case"[]":case"[ ]":_e="unchecked";break;case"[x]":_e="checked";break;case"-":case"*":_e="bullet";break;default:_e="ordered"}this.quill.insertText(ee.index," ",S.default.sources.USER),this.quill.history.cutoff();var We=new v.default().retain(ee.index-De).delete(re+1).retain(he.length()-2-De).retain(1,{list:_e});this.quill.updateContents(We,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(ee.index-re,S.default.sources.SILENT)}},"code exit":{key:Z.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(ee){var le=this.quill.getLine(ee.index),re=o(le,2),fe=re[0],ge=re[1],he=new v.default().retain(ee.index+fe.length()-ge-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(he,S.default.sources.USER)}},"embed left":X(Z.keys.LEFT,!1),"embed left shift":X(Z.keys.LEFT,!0),"embed right":X(Z.keys.RIGHT,!1),"embed right shift":X(Z.keys.RIGHT,!0)}};function X(Y,ee){var le,re=Y===Z.keys.LEFT?"prefix":"suffix";return le={key:Y,shiftKey:ee,altKey:null},R(le,re,/^$/),R(le,"handler",function(ge){var he=ge.index;Y===Z.keys.RIGHT&&(he+=ge.length+1);var De=this.quill.getLeaf(he),_e=o(De,1),We=_e[0];return We instanceof N.default.Embed?(Y===Z.keys.LEFT?ee?this.quill.setSelection(ge.index-1,ge.length+1,S.default.sources.USER):this.quill.setSelection(ge.index-1,S.default.sources.USER):ee?this.quill.setSelection(ge.index,ge.length+1,S.default.sources.USER):this.quill.setSelection(ge.index+ge.length+1,S.default.sources.USER),!1):!0}),le}function V(Y,ee){if(!(Y.index===0||this.quill.getLength()<=1)){var le=this.quill.getLine(Y.index),re=o(le,1),fe=re[0],ge={};if(ee.offset===0){var he=this.quill.getLine(Y.index-1),De=o(he,1),_e=De[0];if(_e!=null&&_e.length()>1){var We=fe.formats(),ze=this.quill.getFormat(Y.index-1,1);ge=y.default.attributes.diff(We,ze)||{}}}var Xe=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(ee.prefix)?2:1;this.quill.deleteText(Y.index-Xe,Xe,S.default.sources.USER),Object.keys(ge).length>0&&this.quill.formatLine(Y.index-Xe,Xe,ge,S.default.sources.USER),this.quill.focus()}}function z(Y,ee){var le=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(ee.suffix)?2:1;if(!(Y.index>=this.quill.getLength()-le)){var re={},fe=0,ge=this.quill.getLine(Y.index),he=o(ge,1),De=he[0];if(ee.offset>=De.length()-1){var _e=this.quill.getLine(Y.index+1),We=o(_e,1),ze=We[0];if(ze){var Xe=De.formats(),ke=this.quill.getFormat(Y.index,1);re=y.default.attributes.diff(Xe,ke)||{},fe=ze.length()}}this.quill.deleteText(Y.index,le,S.default.sources.USER),Object.keys(re).length>0&&this.quill.formatLine(Y.index+fe-1,le,re,S.default.sources.USER)}}function L(Y){var ee=this.quill.getLines(Y),le={};if(ee.length>1){var re=ee[0].formats(),fe=ee[ee.length-1].formats();le=y.default.attributes.diff(fe,re)||{}}this.quill.deleteText(Y,S.default.sources.USER),Object.keys(le).length>0&&this.quill.formatLine(Y.index,1,le,S.default.sources.USER),this.quill.setSelection(Y.index,S.default.sources.SILENT),this.quill.focus()}function W(Y,ee){var le=this;Y.length>0&&this.quill.scroll.deleteAt(Y.index,Y.length);var re=Object.keys(ee.format).reduce(function(fe,ge){return N.default.query(ge,N.default.Scope.BLOCK)&&!Array.isArray(ee.format[ge])&&(fe[ge]=ee.format[ge]),fe},{});this.quill.insertText(Y.index,`
748`,re,S.default.sources.USER),this.quill.setSelection(Y.index+1,S.default.sources.SILENT),this.quill.focus(),Object.keys(ee.format).forEach(function(fe){re[fe]==null&&(Array.isArray(ee.format[fe])||fe!=="link"&&le.quill.format(fe,ee.format[fe],S.default.sources.USER))})}function Q(Y){return{key:Z.keys.TAB,shiftKey:!Y,format:{"code-block":!0},handler:function(le){var re=N.default.query("code-block"),fe=le.index,ge=le.length,he=this.quill.scroll.descendant(re,fe),De=o(he,2),_e=De[0],We=De[1];if(_e!=null){var ze=this.quill.getIndex(_e),Xe=_e.newlineIndex(We,!0)+1,ke=_e.newlineIndex(ze+We+ge),Ae=_e.domNode.textContent.slice(Xe,ke).split(`
749`);We=0,Ae.forEach(function(Be,de){Y?(_e.insertAt(Xe+We,re.TAB),We+=re.TAB.length,de===0?fe+=re.TAB.length:ge+=re.TAB.length):Be.startsWith(re.TAB)&&(_e.deleteAt(Xe+We,re.TAB.length),We-=re.TAB.length,de===0?fe-=re.TAB.length:ge-=re.TAB.length),We+=Be.length+1}),this.quill.update(S.default.sources.USER),this.quill.setSelection(fe,ge,S.default.sources.SILENT)}}}}function J(Y){return{key:Y[0].toUpperCase(),shortKey:!0,handler:function(le,re){this.quill.format(Y,!re.format[Y],S.default.sources.USER)}}}function ne(Y){if(typeof Y=="string"||typeof Y=="number")return ne({key:Y});if((typeof Y>"u"?"undefined":a(Y))==="object"&&(Y=(0,u.default)(Y,!1)),typeof Y.key=="string")if(Z.keys[Y.key.toUpperCase()]!=null)Y.key=Z.keys[Y.key.toUpperCase()];else if(Y.key.length===1)Y.key=Y.key.toUpperCase().charCodeAt(0);else return null;return Y.shortKey&&(Y[G]=Y.shortKey,delete Y.shortKey),Y}r.default=Z,r.SHORTKEY=G}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,N){var j=[],S=!0,C=!1,P=void 0;try{for(var A=_[Symbol.iterator](),F;!(S=(F=A.next()).done)&&(j.push(F.value),!(N&&j.length===N));S=!0);}catch(I){C=!0,P=I}finally{try{!S&&A.return&&A.return()}finally{if(C)throw P}}return j}return function(_,N){if(Array.isArray(_))return _;if(Symbol.iterator in Object(_))return y(_,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=function y(_,N,j){_===null&&(_=Function.prototype);var S=Object.getOwnPropertyDescriptor(_,N);if(S===void 0){var C=Object.getPrototypeOf(_);return C===null?void 0:y(C,N,j)}else{if("value"in S)return S.value;var P=S.get;return P===void 0?void 0:P.call(j)}},l=(function(){function y(_,N){for(var j=0;j<N.length;j++){var S=N[j];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}return function(_,N,j){return N&&y(_.prototype,N),j&&y(_,j),_}})(),c=s(0),u=m(c),h=s(7),d=m(h);function m(y){return y&&y.__esModule?y:{default:y}}function g(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function w(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var b=(function(y){v(_,y),l(_,null,[{key:"value",value:function(){}}]);function _(N,j){g(this,_);var S=w(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,N));return S.selection=j,S.textNode=document.createTextNode(_.CONTENTS),S.domNode.appendChild(S.textNode),S._length=0,S}return l(_,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(j,S){if(this._length!==0)return o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,j,S);for(var C=this,P=0;C!=null&&C.statics.scope!==u.default.Scope.BLOCK_BLOT;)P+=C.offset(C.parent),C=C.parent;C!=null&&(this._length=_.CONTENTS.length,C.optimize(),C.formatAt(P,_.CONTENTS.length,j,S),this._length=0)}},{key:"index",value:function(j,S){return j===this.textNode?0:o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"index",this).call(this,j,S)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var j=this.textNode,S=this.selection.getNativeRange(),C=void 0,P=void 0,A=void 0;if(S!=null&&S.start.node===j&&S.end.node===j){var F=[j,S.start.offset,S.end.offset];C=F[0],P=F[1],A=F[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==_.CONTENTS){var I=this.textNode.data.split(_.CONTENTS).join("");this.next instanceof d.default?(C=this.next.domNode,this.next.insertAt(0,I),this.textNode.data=_.CONTENTS):(this.textNode.data=I,this.parent.insertBefore(u.default.create(this.textNode),this),this.textNode=document.createTextNode(_.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),P!=null){var R=[P,A].map(function($){return Math.max(0,Math.min(C.data.length,$-1))}),M=a(R,2);return P=M[0],A=M[1],{startNode:C,startOffset:P,endNode:C,endOffset:A}}}}},{key:"update",value:function(j,S){var C=this;if(j.some(function(A){return A.type==="characterData"&&A.target===C.textNode})){var P=this.restore();P&&(S.range=P)}}},{key:"value",value:function(){return""}}]),_})(u.default.Embed);b.blotName="cursor",b.className="ql-cursor",b.tagName="span",b.CONTENTS="\uFEFF",r.default=b}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(0),o=u(a),l=s(4),c=u(l);function u(w){return w&&w.__esModule?w:{default:w}}function h(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function d(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function m(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var g=(function(w){m(v,w);function v(){return h(this,v),d(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v})(o.default.Container);g.allowedChildren=[c.default,l.BlockEmbed,g],r.default=g}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.ColorStyle=r.ColorClass=r.ColorAttributor=void 0;var a=(function(){function b(y,_){for(var N=0;N<_.length;N++){var j=_[N];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(y,j.key,j)}}return function(y,_,N){return _&&b(y.prototype,_),N&&b(y,N),y}})(),o=function b(y,_,N){y===null&&(y=Function.prototype);var j=Object.getOwnPropertyDescriptor(y,_);if(j===void 0){var S=Object.getPrototypeOf(y);return S===null?void 0:b(S,_,N)}else{if("value"in j)return j.value;var C=j.get;return C===void 0?void 0:C.call(N)}},l=s(0),c=u(l);function u(b){return b&&b.__esModule?b:{default:b}}function h(b,y){if(!(b instanceof y))throw new TypeError("Cannot call a class as a function")}function d(b,y){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:b}function m(b,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);b.prototype=Object.create(y&&y.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(b,y):b.__proto__=y)}var g=(function(b){m(y,b);function y(){return h(this,y),d(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"value",value:function(N){var j=o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,N);return j.startsWith("rgb(")?(j=j.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+j.split(",").map(function(S){return("00"+parseInt(S).toString(16)).slice(-2)}).join("")):j}}]),y})(c.default.Attributor.Style),w=new c.default.Attributor.Class("color","ql-color",{scope:c.default.Scope.INLINE}),v=new g("color","color",{scope:c.default.Scope.INLINE});r.ColorAttributor=g,r.ColorClass=w,r.ColorStyle=v}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.sanitize=r.default=void 0;var a=(function(){function v(b,y){for(var _=0;_<y.length;_++){var N=y[_];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(b,N.key,N)}}return function(b,y,_){return y&&v(b.prototype,y),_&&v(b,_),b}})(),o=function v(b,y,_){b===null&&(b=Function.prototype);var N=Object.getOwnPropertyDescriptor(b,y);if(N===void 0){var j=Object.getPrototypeOf(b);return j===null?void 0:v(j,y,_)}else{if("value"in N)return N.value;var S=N.get;return S===void 0?void 0:S.call(_)}},l=s(6),c=u(l);function u(v){return v&&v.__esModule?v:{default:v}}function h(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")}function d(v,b){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:v}function m(v,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(v,b):v.__proto__=b)}var g=(function(v){m(b,v);function b(){return h(this,b),d(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(_,N){if(_!==this.statics.blotName||!N)return o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,_,N);N=this.constructor.sanitize(N),this.domNode.setAttribute("href",N)}}],[{key:"create",value:function(_){var N=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,_);return _=this.sanitize(_),N.setAttribute("href",_),N.setAttribute("rel","noopener noreferrer"),N.setAttribute("target","_blank"),N}},{key:"formats",value:function(_){return _.getAttribute("href")}},{key:"sanitize",value:function(_){return w(_,this.PROTOCOL_WHITELIST)?_:this.SANITIZED_URL}}]),b})(c.default);g.blotName="link",g.tagName="A",g.SANITIZED_URL="about:blank",g.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function w(v,b){var y=document.createElement("a");y.href=v;var _=y.href.slice(0,y.href.indexOf(":"));return b.indexOf(_)>-1}r.default=g,r.sanitize=w}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},o=(function(){function b(y,_){for(var N=0;N<_.length;N++){var j=_[N];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(y,j.key,j)}}return function(y,_,N){return _&&b(y.prototype,_),N&&b(y,N),y}})(),l=s(23),c=d(l),u=s(107),h=d(u);function d(b){return b&&b.__esModule?b:{default:b}}function m(b,y){if(!(b instanceof y))throw new TypeError("Cannot call a class as a function")}var g=0;function w(b,y){b.setAttribute(y,b.getAttribute(y)!=="true")}var v=(function(){function b(y){var _=this;m(this,b),this.select=y,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){_.togglePicker()}),this.label.addEventListener("keydown",function(N){switch(N.keyCode){case c.default.keys.ENTER:_.togglePicker();break;case c.default.keys.ESCAPE:_.escape(),N.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(b,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),w(this.label,"aria-expanded"),w(this.options,"aria-hidden")}},{key:"buildItem",value:function(_){var N=this,j=document.createElement("span");return j.tabIndex="0",j.setAttribute("role","button"),j.classList.add("ql-picker-item"),_.hasAttribute("value")&&j.setAttribute("data-value",_.getAttribute("value")),_.textContent&&j.setAttribute("data-label",_.textContent),j.addEventListener("click",function(){N.selectItem(j,!0)}),j.addEventListener("keydown",function(S){switch(S.keyCode){case c.default.keys.ENTER:N.selectItem(j,!0),S.preventDefault();break;case c.default.keys.ESCAPE:N.escape(),S.preventDefault();break}}),j}},{key:"buildLabel",value:function(){var _=document.createElement("span");return _.classList.add("ql-picker-label"),_.innerHTML=h.default,_.tabIndex="0",_.setAttribute("role","button"),_.setAttribute("aria-expanded","fal
749se"),this.container.appendChild(_),_}},{key:"buildOptions",value:function(){var _=this,N=document.createElement("span");N.classList.add("ql-picker-options"),N.setAttribute("aria-hidden","true"),N.tabIndex="-1",N.id="ql-picker-options-"+g,g+=1,this.label.setAttribute("aria-controls",N.id),this.options=N,[].slice.call(this.select.options).forEach(function(j){var S=_.buildItem(j);N.appendChild(S),j.selected===!0&&_.selectItem(S)}),this.container.appendChild(N)}},{key:"buildPicker",value:function(){var _=this;[].slice.call(this.select.attributes).forEach(function(N){_.container.setAttribute(N.name,N.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var _=this;this.close(),setTimeout(function(){return _.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(_){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,j=this.container.querySelector(".ql-selected");if(_!==j&&(j!=null&&j.classList.remove("ql-selected"),_!=null&&(_.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(_.parentNode.children,_),_.hasAttribute("data-value")?this.label.setAttribute("data-value",_.getAttribute("data-value")):this.label.removeAttribute("data-value"),_.hasAttribute("data-label")?this.label.setAttribute("data-label",_.getAttribute("data-label")):this.label.removeAttribute("data-label"),N))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var S=document.createEvent("Event");S.initEvent("change",!0,!0),this.select.dispatchEvent(S)}this.close()}}},{key:"update",value:function(){var _=void 0;if(this.select.selectedIndex>-1){var N=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];_=this.select.options[this.select.selectedIndex],this.selectItem(N)}else this.selectItem(null);var j=_!=null&&_!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",j)}}]),b})();r.default=v}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(0),o=U(a),l=s(5),c=U(l),u=s(4),h=U(u),d=s(16),m=U(d),g=s(25),w=U(g),v=s(24),b=U(v),y=s(35),_=U(y),N=s(6),j=U(N),S=s(22),C=U(S),P=s(7),A=U(P),F=s(55),I=U(F),R=s(42),M=U(R),$=s(23),B=U($);function U(G){return G&&G.__esModule?G:{default:G}}c.default.register({"blots/block":h.default,"blots/block/embed":u.BlockEmbed,"blots/break":m.default,"blots/container":w.default,"blots/cursor":b.default,"blots/embed":_.default,"blots/inline":j.default,"blots/scroll":C.default,"blots/text":A.default,"modules/clipboard":I.default,"modules/history":M.default,"modules/keyboard":B.default}),o.default.register(h.default,m.default,b.default,j.default,C.default,A.default),r.default=c.default}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(1),o=(function(){function l(c){this.domNode=c,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(c){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var u;return Array.isArray(this.tagName)?(typeof c=="string"&&(c=c.toUpperCase(),parseInt(c).toString()===c&&(c=parseInt(c))),typeof c=="number"?u=document.createElement(this.tagName[c-1]):this.tagName.indexOf(c)>-1?u=document.createElement(c):u=document.createElement(this.tagName[0])):u=document.createElement(this.tagName),this.className&&u.classList.add(this.className),u},l.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},l.prototype.clone=function(){var c=this.domNode.cloneNode(!1);return a.create(c)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},l.prototype.deleteAt=function(c,u){var h=this.isolate(c,u);h.remove()},l.prototype.formatAt=function(c,u,h,d){var m=this.isolate(c,u);if(a.query(h,a.Scope.BLOT)!=null&&d)m.wrap(h,d);else if(a.query(h,a.Scope.ATTRIBUTE)!=null){var g=a.create(this.statics.scope);m.wrap(g),g.format(h,d)}},l.prototype.insertAt=function(c,u,h){var d=h==null?a.create("text",u):a.create(u,h),m=this.split(c);this.parent.insertBefore(d,m)},l.prototype.insertInto=function(c,u){u===void 0&&(u=null),this.parent!=null&&this.parent.children.remove(this);var h=null;
vendor: 94,961 bytes, lines 749-759
749c.children.insertBefore(this,u),u!=null&&(h=u.domNode),(this.domNode.parentNode!=c.domNode||this.domNode.nextSibling!=h)&&c.domNode.insertBefore(this.domNode,h),this.parent=c,this.attach()},l.prototype.isolate=function(c,u){var h=this.split(c);return h.split(u),h},l.prototype.length=function(){return 1},l.prototype.offset=function(c){return c===void 0&&(c=this.parent),this.parent==null||this==c?0:this.parent.children.offset(this)+this.parent.offset(c)},l.prototype.optimize=function(c){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(c){c.parent!=null&&(c.parent.insertBefore(this,c.next),c.remove())},l.prototype.replaceWith=function(c,u){var h=typeof c=="string"?a.create(c,u):c;return h.replace(this),h},l.prototype.split=function(c,u){return c===0?this:this.next},l.prototype.update=function(c,u){},l.prototype.wrap=function(c,u){var h=typeof c=="string"?a.create(c,u):c;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},l.blotName="abstract",l})();r.default=o}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(12),o=s(32),l=s(33),c=s(1),u=(function(){function h(d){this.attributes={},this.domNode=d,this.build()}return h.prototype.attribute=function(d,m){m?d.add(this.domNode,m)&&(d.value(this.domNode)!=null?this.attributes[d.attrName]=d:delete this.attributes[d.attrName]):(d.remove(this.domNode),delete this.attributes[d.attrName])},h.prototype.build=function(){var d=this;this.attributes={};var m=a.default.keys(this.domNode),g=o.default.keys(this.domNode),w=l.default.keys(this.domNode);m.concat(g).concat(w).forEach(function(v){var b=c.query(v,c.Scope.ATTRIBUTE);b instanceof a.default&&(d.attributes[b.attrName]=b)})},h.prototype.copy=function(d){var m=this;Object.keys(this.attributes).forEach(function(g){var w=m.attributes[g].value(m.domNode);d.format(g,w)})},h.prototype.move=function(d){var m=this;this.copy(d),Object.keys(this.attributes).forEach(function(g){m.attributes[g].remove(m.domNode)}),this.attributes={}},h.prototype.values=function(){var d=this;return Object.keys(this.attributes).reduce(function(m,g){return m[g]=d.attributes[g].value(d.domNode),m},{})},h})();r.default=u}),(function(n,r,s){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m])};return function(h,d){u(h,d);function m(){this.constructor=h}h.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=s(12);function l(u,h){var d=u.getAttribute("class")||"";return d.split(/\s+/).filter(function(m){return m.indexOf(h+"-")===0})}var c=(function(u){a(h,u);function h(){return u!==null&&u.apply(this,arguments)||this}return h.keys=function(d){return(d.getAttribute("class")||"").split(/\s+/).map(function(m){return m.split("-").slice(0,-1).join("-")})},h.prototype.add=function(d,m){return this.canAdd(d,m)?(this.remove(d),d.classList.add(this.keyName+"-"+m),!0):!1},h.prototype.remove=function(d){var m=l(d,this.keyName);m.forEach(function(g){d.classList.remove(g)}),d.classList.length===0&&d.removeAttribute("class")},h.prototype.value=function(d){var m=l(d,this.keyName)[0]||"",g=m.slice(this.keyName.length+1);return this.canAdd(d,g)?g:""},h})(o.default);r.default=c}),(function(n,r,s){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m])};return function(h,d){u(h,d);function m(){this.constructor=h}h.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=s(12);function l(u){var h=u.split("-"),d=h.slice(1).map(function(m){return m[0].toUpperCase()+m.slice(1)}).join("");return h[0]+d}var c=(function(u){a(h,u);function h(){return u!==null&&u.apply(this,arguments)||this}return h.keys=function(d){return(d.getAttribute("style")||"").split(";").map(function(m){var g=m.split(":");return g[0].trim()})},h.prototype.add=function(d,m){return this.canAdd(d,m)?(d.style[l(this.keyName)]=m,!0):!1},h.prototype.remove=function(d){d.style[l(this.keyName)]="",d.getAttribute("style")||d.removeAttribute("style")},h.prototype.value=function(d){var m=d.style[l(this.keyName)];return this.canAdd(d,m)?m:""},h})(o.default);r.default=c}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function c(u,h){for(var d=0;d<h.length;d++){var m=h[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,h,d){return h&&c(u.prototype,h),d&&c(u,d),u}})();function o(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}var l=(function(){function c(u,h){o(this,c),this.quill=u,this.options=h,this.modules={}}return a(c,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(d){h.modules[d]==null&&h.addModule(d)})}},{key:"addModule",value:function(h){var d=this.quill.constructor.import("modules/"+h);return this.modules[h]=new d(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),c})();l.DEFAULTS={modules:{}},l.themes={default:l},r.default=l}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,N){for(var j=0;j<N.length;j++){var S=N[j];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}return function(_,N,j){return N&&y(_.prototype,N),j&&y(_,j),_}})(),o=function y(_,N,j){_===null&&(_=Function.prototype);var S=Object.getOwnPropertyDescriptor(_,N);if(S===void 0){var C=Object.getPrototypeOf(_);return C===null?void 0:y(C,N,j)}else{if("value"in S)return S.value;var P=S.get;return P===void 0?void 0:P.call(j)}},l=s(0),c=d(l),u=s(7),h=d(u);function d(y){return y&&y.__esModule?y:{default:y}}function m(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function w(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var v="\uFEFF",b=(function(y){w(_,y);function _(N){m(this,_);var j=g(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,N));return j.contentNode=document.createElement("span"),j.contentNode.setAttribute("contenteditable",!1),[].slice.call(j.domNode.childNodes).forEach(function(S){j.contentNode.appendChild(S)}),j.leftGuard=document.createTextNode(v),j.rightGuard=document.createTextNode(v),j.domNode.appendChild(j.leftGuard),j.domNode.appendChild(j.contentNode),j.domNode.appendChild(j.rightGuard),j}return a(_,[{key:"index",value:function(j,S){return j===this.leftGuard?0:j===this.rightGuard?1:o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"index",this).call(this,j,S)}},{key:"restore",value:function(j){var S=void 0,C=void 0,P=j.data.split(v).join("");if(j===this.leftGuard)if(this.prev instanceof h.default){var A=this.prev.length();this.prev.insertAt(A,P),S={startNode:this.prev.domNode,startOffset:A+P.length}}else C=document.createTextNode(P),this.parent.insertBefore(c.default.create(C),this),S={startNode:C,startOffset:P.length};else j===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,P),S={startNode:this.next.domNode,startOffset:P.length}):(C=document.createTextNode(P),this.parent.insertBefore(c.default.create(C),this.next),S={startNode:C,startOffset:P.length}));return j.data=v,S}},{key:"update",value:function(j,S){var C=this;j.forEach(function(P){if(P.type==="characterData"&&(P.target===C.leftGuard||P.target===C.rightGuard)){var A=C.restore(P.target);A&&(S.range=A)}})}}]),_})(c.default.Embed);r.default=b}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.AlignStyle=r.AlignClass=r.AlignAttribute=void 0;var a=s(0),o=l(a);function l(m){return m&&m.__esModule?m:{default:m}}var c={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},u=new o.default.Attributor.Attribute("align","align",c),h=new o.default.Attributor.Class("align","ql-align",c),d=new o.default.Attributor.Style("align","text-align",c);r.AlignAttribute=u,r.AlignClass=h,r.AlignStyle=d}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.BackgroundStyle=r.BackgroundClass=void 0;var a=s(0),o=c(a),l=s(26);function c(d){return d&&d.__esModule?d:{default:d}}var u=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),h=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});r.BackgroundClass=u,r.BackgroundStyle=h}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.DirectionStyle=r.DirectionClass=r.DirectionAttribute=void 0;var a=s(0),o=l(a);function l(m){return m&&m.__esModule?m:{default:m}}var c={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},u=new o.default.Attributor.Attribute("direction","dir",c),h=new o.default.Attributor.Class("direction","ql-direction",c),d=new o.default.Attributor.Style("direction","direction",c);r.DirectionAttribute=u,r.DirectionClass=h,r.DirectionStyle=d}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.FontClass=r.FontStyle=void 0;var a=(function(){function y(_,N){for(var j=0;j<N.length;j++){var S=N[j];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}return function(_,N,j){return N&&y(_.prototype,N),j&&y(_,j),_}})(),o=function y(_,N,j){_===null&&(_=Function.prototype);var S=Object.getOwnPropertyDescriptor(_,N);if(S===void 0){var C=Object.getPrototypeOf(_);return C===null?void 0:y(C,N,j)}else{if("value"in S)return S.value;var P=S.get;return P===void 0?void 0:P.call(j)}},l=s(0),c=u(l);function u(y){return y&&y.__esModule?y:{default:y}}function h(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function d(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function m(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var g={scope:c.default.Scope.INLINE,whitelist:["serif","monospace"]},w=new c.default.Attributor.Class("font","ql-font",g),v=(function(y){m(_,y);function _(){return h(this,_),d(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"value",value:function(j){return o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"value",this).call(this,j).replace(/["']/g,"")}}]),_})(c.default.Attributor.Style),b=new v("font","font-family",g);r.FontStyle=b,r.FontClass=w}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.SizeStyle=r.SizeClass=void 0;var a=s(0),o=l(a);function l(h){return h&&h.__esModule?h:{default:h}}var c=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),u=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});r.SizeClass=c,r.SizeStyle=u}),(function(n,r,s){n.exports={align:{"":s(76),center:s(77),right:s(78),justify:s(79)},background:s(80),blockquote:s(81),bold:s(82),clean:s(83),code:s(58),"code-block":s(58),color:s(84),direction:{"":s(85),rtl:s(86)},float:{center:s(87),full:s(88),left:s(89),right:s(90)},formula:s(91),header:{1:s(92),2:s(93)},italic:s(94),image:s(95),indent:{"+1":s(96),"-1":s(97)},link:s(98),list:{ordered:s(99),bullet:s(100),check:s(101)},script:{sub:s(102),super:s(103)},strike:s(104),underline:s(105),video:s(106)}}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.getLastChangeIndex=r.default=void 0;var a=(function(){function N(j,S){for(var C=0;C<S.length;C++){var P=S[C];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(j,P.key,P)}}return function(j,S,C){return S&&N(j.prototype,S),C&&N(j,C),j}})(),o=s(0),l=m(o),c=s(5),u=m(c),h=s(9),d=m(h);function m(N){return N&&N.__esModule?N:{default:N}}function g(N,j){if(!(N instanceof j))throw new TypeError("Cannot call a class as a function")}function w(N,j){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j&&(typeof j=="object"||typeof j=="function")?j:N}function v(N,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof j);N.prototype=Object.create(j&&j.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),j&&(Object.setPrototypeOf?Object.setPrototypeOf(N,j):N.__proto__=j)}var b=(function(N){v(j,N);function j(S,C){g(this,j);var P=w(this,(j.__proto__||Object.getPrototypeOf(j)).call(this,S,C));return P.lastRecorded=0,P.ignoreChange=!1,P.clear(),P.quill.on(u.default.events.EDITOR_CHANGE,function(A,F,I,R){A!==u.default.events.TEXT_CHANGE||P.ignoreChange||(!P.options.userOnly||R===u.default.sources.USER?P.record(F,I):P.transform(F))}),P.quill.keyboard.addBinding({key:"Z",shortKey:!0},P.undo.bind(P)),P.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},P.redo.bind(P)),/Win/i.test(navigator.platform)&&P.quill.keyboard.addBinding({key:"Y",shortKey:!0},P.redo.bind(P)),P}return a(j,[{key:"change",value:function(C,P){if(this.stack[C].length!==0){var A=this.stack[C].pop();this.stack[P].push(A),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(A[C],u.default.sources.USER),this.ignoreChange=!1;var F=_(A[C]);this.quill.setSelection(F)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(C,P){if(C.ops.length!==0){this.stack.redo=[];var A=this.quill.getContents().diff(P),F=Date.now();if(this.lastRecorded+this.options.delay>F&&this.stack.undo.length>0){var I=this.stack.undo.pop();A=A.compose(I.undo),C=I.redo.compose(C)}else this.lastRecorded=F;this.stack.undo.push({redo:C,undo:A}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(C){this.stack.undo.forEach(function(P){P.undo=C.transform(P.undo,!0),P.redo=C.transform(P.redo,!0)}),this.stack.redo.forEach(function(P){P.undo=C.transform(P.undo,!0),P.redo=C.transform(P.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),j})(d.default);b.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function y(N){var j=N.ops[N.ops.length-1];return j==null?!1:j.insert!=null?typeof j.insert=="string"&&j.insert.endsWith(`
750`):j.attributes!=null?Object.keys(j.attributes).some(function(S){return l.default.query(S,l.default.Scope.BLOCK)!=null}):!1}function _(N){var j=N.reduce(function(C,P){return C+=P.delete||0,C},0),S=N.length()-j;return y(N)&&(S-=1),S}r.default=b,r.getLastChangeIndex=_}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BaseTooltip=void 0;var a=(function(){function W(Q,J){for(var ne=0;ne<J.length;ne++){var Y=J[ne];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(Q,Y.key,Y)}}return function(Q,J,ne){return J&&W(Q.prototype,J),ne&&W(Q,ne),Q}})(),o=function W(Q,J,ne){Q===null&&(Q=Function.prototype);var Y=Object.getOwnPropertyDescriptor(Q,J);if(Y===void 0){var ee=Object.getPrototypeOf(Q);return ee===null?void 0:W(ee,J,ne)}else{if("value"in Y)return Y.value;var le=Y.get;return le===void 0?void 0:le.call(ne)}},l=s(3),c=F(l),u=s(2),h=F(u),d=s(8),m=F(d),g=s(23),w=F(g),v=s(34),b=F(v),y=s(59),_=F(y),N=s(60),j=F(N),S=s(28),C=F(S),P=s(61),A=F(P);function F(W){return W&&W.__esModule?W:{default:W}}function I(W,Q){if(!(W instanceof Q))throw new TypeError("Cannot call a class as a function")}function R(W,Q){if(!W)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Q&&(typeof Q=="object"||typeof Q=="function")?Q:W}function M(W,Q){if(typeof Q!="function"&&Q!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Q);W.prototype=Object.create(Q&&Q.prototype,{constructor:{value:W,enumerable:!1,writable:!0,configurable:!0}}),Q&&(Object.setPrototypeOf?Object.setPrototypeOf(W,Q):W.__proto__=Q)}var $=[!1,"center","right","justify"],B=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],U=[!1,"serif","monospace"],G=["1","2","3",!1],Z=["small",!1,"large","huge"],X=(function(W){M(Q,W);function Q(J,ne){I(this,Q);var Y=R(this,(Q.__proto__||Object.getPrototypeOf(Q)).call(this,J,ne)),ee=function le(re){if(!document.body.contains(J.root))return document.body.removeEventListener("click",le);Y.tooltip!=null&&!Y.tooltip.root.contains(re.target)&&document.activeElement!==Y.tooltip.textbox&&!Y.quill.hasFocus()&&Y.tooltip.hide(),Y.pickers!=null&&Y.pickers.forEach(function(fe){fe.container.contains(re.target)||fe.close()})};return J.emitter.listenDOM("click",document.body,ee),Y}return a(Q,[{key:"addModule",value:function(ne){var Y=o(Q.prototype.__proto__||Object.getPrototypeOf(Q.prototype),"addModule",this).call(this,ne);return ne==="toolbar"&&this.extendToolbar(Y),Y}},{key:"buildButtons",value:function(ne,Y){ne.forEach(function(ee){var le=ee.getAttribute("class")||"";le.split(/\s+/).forEach(function(re){if(re.startsWith("ql-")&&(re=re.slice(3),Y[re]!=null))if(re==="direction")ee.innerHTML=Y[re][""]+Y[re].rtl;else if(typeof Y[re]=="string")ee.innerHTML=Y[re];else{var fe=ee.value||"";fe!=null&&Y[re][fe]&&(ee.innerHTML=Y[re][fe])}})})}},{key:"buildPickers",value:function(ne,Y){var ee=this;this.pickers=ne.map(function(re){if(re.classList.contains("ql-align"))return re.querySelector("option")==null&&L(re,$),new j.default(re,Y.align);if(re.classList.contains("ql-background")||re.classList.contains("ql-color")){var fe=re.classList.contains("ql-background")?"background":"color";return re.querySelector("option")==null&&L(re,B,fe==="background"?"#ffffff":"#000000"),new _.default(re,Y[fe])}else return re.querySelector("option")==null&&(re.classList.contains("ql-font")?L(re,U):re.classList.contains("ql-header")?L(re,G):re.classList.contains("ql-size")&&L(re,Z)),new C.default(re)});var le=function(){ee.pickers.forEach(function(fe){fe.update()})};this.quill.on(m.default.events.EDITOR_CHANGE,le)}}]),Q})(b.default);X.DEFAULTS=(0,c.default)(!0,{},b.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var Q=this,J=this.container.querySelector("input.ql-image[type=file]");J==null&&(J=document.createElement("input"),J.setAttribute("type","file"),J.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),J.classList.add("ql-image"),J.addEventListener("change",function(){if(J.files!=null&&J.files[0]!=null){var ne=new FileReader;ne.onload=function(Y){var ee=Q.quill.getSelection(!0);Q.quill.updateContents(new h.default().retain(ee.index).delete(ee.length).insert({image:Y.target.result}),m.default.sources.USER),Q.quill.setSelection(ee.index+1,m.default.sources.SILENT),J.value=""},ne.readAsDataURL(J.files[0])}}),this.container.appendChild(J)),J.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var V=(function(W){M(Q,W);function Q(J,ne){I(this,Q);var Y=R(this,(Q.__proto__||Object.getPrototypeOf(Q)).call(this,J,ne));return Y.textbox=Y.root.querySelector('input[type="text"]'),Y.listen(),Y}return a(Q,[{key:"listen",value:function(){var ne=this;this.textbox.addEventListener("keydown",function(Y){w.default.match(Y,"enter")?(ne.save(),Y.preventDefault()):w.default.match(Y,"escape")&&(ne.cancel(),Y.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),Y!=null?this.textbox.value=Y:ne!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+ne)||""),this.root.setAttribute("data-mode",ne)}},{key:"restoreFocus",value:function(){var ne=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=ne}},{key:"save",value:function(){var ne=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var Y=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",ne,m.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",ne,m.default.sources.USER)),this.quill.root.scrollTop=Y;break}case"video":ne=z(ne);case"formula":{if(!ne)break;var ee=this.quill.getSelection(!0);if(ee!=null){var le=ee.index+ee.length;this.quill.insertEmbed(le,this.root.getAttribute("data-mode"),ne,m.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(le+1," ",m.default.sources.USER),this.quill.setSelection(le+2,m.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),Q})(A.default);function z(W){var Q=W.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||W.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return Q?(Q[1]||"https")+"://www.youtube.com/embed/"+Q[2]+"?showinfo=0":(Q=W.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(Q[1]||"https")+"://player.vimeo.com/video/"+Q[2]+"/":W}function L(W,Q){var J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Q.forEach(function(ne){var Y=document.createElement("option");ne===J?Y.setAttribute("selected","selected"):Y.setAttribute("value",ne),W.appendChild(Y)})}r.BaseTooltip=V,r.default=X}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},o.prototype.contains=function(l){for(var c,u=this.iterator();c=u();)if(c===l)return!0;return!1},o.prototype.insertBefore=function(l,c){l&&(l.next=c,c!=null?(l.prev=c.prev,c.prev!=null&&(c.prev.next=l),c.prev=l,c===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},o.prototype.offset=function(l){for(var c=0,u=this.head;u!=null;){if(u===l)return c;c+=u.length(),u=u.next}return-1},o.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},o.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var c=l;return l!=null&&(l=l.next),c}},o.prototype.find=function(l,c){c===void 0&&(c=!1);for(var u,h=this.iterator();u=h();){var d=u.length();if(l<d||c&&l===d&&(u.next==null||u.next.length()!==0))return[u,l];l-=d}return[null,0]},o.prototype.forEach=function(l){for(var c,u=this.iterator();c=u();)l(c)},o.prototype.forEachAt=function(l,c,u){if(!(c<=0))for(var h=this.find(l),d=h[0],m=h[1],g,w=l-m,v=this.iterator(d);(g=v())&&w<l+c;){var b=g.length();l>w?u(g,l-w,Math.min(c,w+b-l)):u(g,0,Math.min(b,l+c-w)),w+=b}},o.prototype.map=function(l){return this.reduce(function(c,u){return c.push(l(u)),c},[])},o.prototype.reduce=function(l,c){for(var u,h=this.iterator();u=h();)c=l(c,u);return c},o})();r.default=a}),(function(n,r,s){var a=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,g){m.__proto__=g}||function(m,g){for(var w in g)g.hasOwnProperty(w)&&(m[w]=g[w])};return function(m,g){d(m,g);function w(){this.constructor=m}m.prototype=g===null?Object.create(g):(w.prototype=g.prototype,new w)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=s(17),l=s(1),c={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},u=100,h=(function(d){a(m,d);function m(g){var w=d.call(this,g)||this;return w.scroll=w,w.observer=new MutationObserver(function(v){w.update(v)}),w.observer.observe(w.domNode,c),w.attach(),w}return m.prototype.detach=function(){d.prototype.detach.call(this),this.observer.disconnect()},m.prototype.deleteAt=function(g,w){this.update(),g===0&&w===this.length()?this.children.forEach(function(v){v.remove()}):d.prototype.deleteAt.call(this,g,w)},m.prototype.formatAt=function(g,w,v,b){this.update(),d.prototype.formatAt.call(this,g,w,v,b)},m.prototype.insertAt=function(g,w,v){this.update(),d.prototype.insertAt.call(this,g,w,v)},m.prototype.optimize=function(g,w){var v=this;g===void 0&&(g=[]),w===void 0&&(w={}),d.prototype.optimize.call(this,w);for(var b=[].slice.call(this.observer.takeRecords());b.length>0;)g.push(b.pop());for(var y=function(S,C){C===void 0&&(C=!0),!(S==null||S===v)&&S.domNode.parentNode!=null&&(S.domNode[l.DATA_KEY].mutations==null&&(S.domNode[l.DATA_KEY].mutations=[]),C&&y(S.parent))},_=function(S){S.domNode[l.DATA_KEY]==null||S.domNode[l.DATA_KEY].mutations==null||(S instanceof o.default&&S.children.forEach(_),S.optimize(w))},N=g,j=0;N.length>0;j+=1){if(j>=u)throw new Error("[Parchment] Maximum optimize iterations reached");for(N.forEach(function(S){var C=l.find(S.target,!0);C!=null&&(C.domNode===S.target&&(S.type==="childList"?(y(l.find(S.previousSibling,!1)),[].forEach.call(S.addedNodes,function(P){var A=l.find(P,!1);y(A,!1),A instanceof o.default&&A.children.forEach(function(F){y(F,!1)})})):S.type==="attributes"&&y(C.prev)),y(C))}),this.children.forEach(_),N=[].slice.call(this.observer.takeRecords()),b=N.slice();b.length>0;)g.push(b.pop())}},m.prototype.update=function(g,w){var v=this;w===void 0&&(w={}),g=g||this.observer.takeRecords(),g.map(function(b){var y=l.find(b.target,!0);return y==null?null:y.domNode[l.DATA_KEY].mutations==null?(y.domNode[l.DATA_KEY].mutations=[b],y):(y.domNode[l.DATA_KEY].mutations.push(b),null)}).forEach(function(b){b==null||b===v||b.domNode[l.DATA_KEY]==null||b.update(b.domNode[l.DATA_KEY].mutations||[],w)}),this.domNode[l.DATA_KEY].mutations!=null&&d.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,w),this.optimize(g,w)},m.blotName="scroll",m.defaultChild="block",m.scope=l.Scope.BLOCK_BLOT,m.tagName="DIV",m})(o.default);r.default=h}),(function(n,r,s){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,m){d.__proto__=m}||function(d,m){for(var g in m)m.hasOwnProperty(g)&&(d[g]=m[g])};return function(d,m){h(d,m);function g(){this.constructor=d}d.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=s(18),l=s(1);function c(h,d){if(Object.keys(h).length!==Object.keys(d).length)return!1;for(var m in h)if(h[m]!==d[m])return!1;return!0}var u=(function(h){a(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.formats=function(m){if(m.tagName!==d.tagName)return h.formats.call(this,m)},d.prototype.format=function(m,g){var w=this;m===this.statics.blotName&&!g?(this.children.forEach(function(v){v instanceof o.default||(v=v.wrap(d.blotName,!0)),w.attributes.copy(v)}),this.unwrap()):h.prototype.format.call(this,m,g)},d.prototype.formatAt=function(m,g,w,v){if(this.formats()[w]!=null||l.query(w,l.Scope.ATTRIBUTE)){var b=this.isolate(m,g);b.format(w,v)}else h.prototype.formatAt.call(this,m,g,w,v)},d.prototype.optimize=function(m){h.prototype.optimize.call(this,m);var g=this.formats();if(Object.keys(g).length===0)return this.unwrap();var w=this.next;w instanceof d&&w.prev===this&&c(g,w.formats())&&(w.moveChildren(this),w.remove())},d.blotName="inline",d.scope=l.Scope.INLINE_BLOT,d.tagName="SPAN",d})(o.default);r.default=u}),(function(n,r,s){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m])};return function(h,d){u(h,d);function m(){this.constructor=h}h.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=s(18),l=s(1),c=(function(u){a(h,u);function h(){return u!==null&&u.apply(this,arguments)||this}return h.formats=function(d){var m=l.query(h.blotName).tagName;if(d.tagName!==m)return u.formats.call(this,d)},h.prototype.format=function(d,m){l.query(d,l.Scope.BLOCK)!=null&&(d===this.statics.blotName&&!m?this.replaceWith(h.blotName):u.prototype.format.call(this,d,m))},h.prototype.formatAt=function(d,m,g,w){l.query(g,l.Scope.BLOCK)!=null?this.format(g,w):u.prototype.formatAt.call(this,d,m,g,w)},h.prototype.insertAt=function(d,m,g){if(g==null||l.query(m,l.Scope.INLINE)!=null)u.prototype.insertAt.call(this,d,m,g);else{var w=this.split(d),v=l.create(m,g);w.parent.insertBefore(v,w)}},h.prototype.update=function(d,m){navigator.userAgent.match(/Trident/)?this.build():u.prototype.update.call(this,d,m)},h.blotName="block",h.scope=l.Scope.BLOCK_BLOT,h.tagName="P",h})(o.default);r.default=c}),(function(n,r,s){var a=this&&this.__extends||(function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var d in h)h.hasOwnProperty(d)&&(u[d]=h[d])};return function(u,h){c(u,h);function d(){this.constructor=u}u.prototype=h===null?Object.create(h):(d.prototype=h.prototype,new d)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=s(19),l=(function(c){a(u,c);function u(){return c!==null&&c.apply(this,arguments)||this}return u.formats=function(h){},u.prototype.format=function(h,d){c.prototype.formatAt.call(this,0,this.length(),h,d)},u.prototype.formatAt=function(h,d,m,g){h===0&&d===this.length()?this.format(m,g):c.prototype.formatAt.call(this,h,d,m,g)},u.prototype.formats=function(){return this.statics.formats(this.domNode)},u})(o.default);r.default=l}),(function(n,r,s){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m])};return function(h,d){u(h,d);function m(){this.constructor=h}h.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=s(19),l=s(1),c=(function(u){a(h,u);function h(d){var m=u.call(this,d)||this;return m.text=m.statics.value(m.domNode),m}return h.create=function(d){return document.createTextNode(d)},h.value=function(d){var m=d.data;return m.normalize&&(m=m.normalize()),m},h.prototype.deleteAt=function(d,m){this.domNode.data=this.text=this.text.slice(0,d)+this.text.slice(d+m)},h.prototype.index=function(d,m){return this.domNode===d?m:-1},h.prototype.insertAt=function(d,m,g){g==null?(this.text=this.text.slice(0,d)+m+this.text.slice(d),this.domNode.data=this.text):u.prototype.insertAt.call(this,d,m,g)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(d){u.prototype.optimize.call(this,d),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof h&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},h.prototype.position=function(d,m){return[this.domNode,d]},h.prototype.split=function(d,m){if(m===void 0&&(m=!1),!m){if(d===0)return this;if(d===this.length())return this.next}var g=l.create(this.domNode.splitText(d));return this.parent.insertBefore(g,this.next),this.text=this.statics.value(this.domNode),g},h.prototype.update=function(d,m){var g=this;d.some(function(w){return w.type==="characterData"&&w.target===g.domNode})&&(this.text=this.statics.value(this.domNode))},h.prototype.value=function(){return this.text},h.blotName="text",h.scope=l.Scope.INLINE_BLOT,h})(o.default);r.default=c}),(function(n,r,s){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,c){return arguments.length>1&&!this.contains(l)==!c?c:o.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,c){return c=c||0,this.substr(c,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,c){var u=this.toString();(typeof c!="number"||!isFinite(c)||Math.floor(c)!==c||c>u.length)&&(c=u.length),c-=l.length;var h=u.indexOf(l,c);return h!==-1&&h===c}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(c){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof c!="function")throw new TypeError("predicate must be a function");for(var u=Object(this),h=u.length>>>0,d=arguments[1],m,g=0;g<h;g++)if(m=u[g],c.call(d,m,g,u))return m}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})}),(function(n,r){var s=-1,a=1,o=0;function l(j,S,C){if(j==S)return j?[[o,j]]:[];(C<0||j.length<C)&&(C=null);var P=d(j,S),A=j.substring(0,P);j=j.substring(P),S=S.substring(P),P=m(j,S);var F=j.substring(j.length-P);j=j.substring(0,j.length-P),S=S.substring(0,S.length-P);var I=c(j,S);return A&&I.unshift([o,A]),F&&I.push([o,F]),w(I),C!=null&&(I=y(I,C)),I=_(I),I}function c(j,S){var C;if(!j)return[[a,S]];if(!S)return[[s,j]];var P=j.length>S.length?j:S,A=j.length>S.length?S:j,F=P.indexOf(A);if(F!=-1)return C=[[a,P.substring(0,F)],[o,A],[a,P.substring(F+A.length)]],j.length>S.length&&(C[0][0]=C[2][0]=s),C;if(A.length==1)return[[s,j],[a,S]];var I=g(j,S);if(I){var R=I[0],M=I[1],$=I[2],B=I[3],U=I[4],G=l(R,$),Z=l(M,B);return G.concat([[o,U]],Z)}return u(j,S)}function u(j,S){for(var C=j.length,P=S.length,A=Math.ceil((C+P)/2),F=A,I=2*A,R=new Array(I),M=new Array(I),$=0;$<I;$++)R[$]=-1,M[$]=-1;R[F+1]=0,M[F+1]=0;for(var B=C-P,U=B%2!=0,G=0,Z=0,X=0,V=0,z=0;z<A;z++){for(var L=-z+G;L<=z-Z;L+=2){var W=F+L,Q;L==-z||L!=z&&R[W-1]<R[W+1]?Q=R[W+1]:Q=R[W-1]+1;for(var J=Q-L;Q<C&&J<P&&j.charAt(Q)==S.charAt(J);)Q++,J++;if(R[W]=Q,Q>C)Z+=2;else if(J>P)G+=2;else if(U){var ne=F+B-L;if(ne>=0&&ne<I&&M[ne]!=-1){var Y=C-M[ne];if(Q>=Y)return h(j,S,Q,J)}}}for(var ee=-z+X;ee<=z-V;ee+=2){var ne=F+ee,Y;ee==-z||ee!=z&&M[ne-1]<M[ne+1]?Y=M[ne+1]:Y=M[ne-1]+1;for(var le=Y-ee;Y<C&&le<P&&j.charAt(C-Y-1)==S.charAt(P-le-1);)Y++,le++;if(M[ne]=Y,Y>C)V+=2;else if(le>P)X+=2;else if(!U){var W=F+B-ee;if(W>=0&&W<I&&R[W]!=-1){var Q=R[W],J=F+Q-W;if(Y=C-Y,Q>=Y)return h(j,S,Q,J)}}}}return[[s,j],[a,S]]}function h(j,S,C,P){var A=j.substring(0,C),F=S.substring(0,P),I=j.substring(C),R=S.substring(P),M=l(A,F),$=l(I,R);return M.concat($)}function d(j,S){if(!j||!S||j.charAt(0)!=S.charAt(0))return 0;for(var C=0,P=Math.min(j.length,S.length),A=P,F=0;C<A;)j.substring(F,A)==S.substring(F,A)?(C=A,F=C):P=A,A=Math.floor((P-C)/2+C);return A}function m(j,S){if(!j||!S||j.charAt(j.length-1)!=S.charAt(S.length-1))return 0;for(var C=0,P=Math.min(j.length,S.length),A=P,F=0;C<A;)j.substring(j.length-A,j.length-F)==S.substring(S.length-A,S.length-F)?(C=A,F=C):P=A,A=Math.floor((P-C)/2+C);return A}function g(j,S){var C=j.length>S.length?j:S,P=j.length>S.length?S:j;if(C.length<4||P.length*2<C.length)return null;function A(Z,X,V){for(var z=Z.substring(V,V+Math.floor(Z.length/4)),L=-1,W="",Q,J,ne,Y;(L=X.indexOf(z,L+1))!=-1;){var ee=d(Z.substring(V),X.substring(L)),le=m(Z.substring(0,V),X.substring(0,L));W.length<le+ee&&(W=X.substring(L-le,L)+X.substring(L,L+ee),Q=Z.substring(0,V-le),J=Z.substring(V+ee),ne=X.substring(0,L-le),Y=X.substring(L+ee))}return W.length*2>=Z.length?[Q,J,ne,Y,W]:null}var F=A(C,P,Math.ceil(C.length/4)),I=A(C,P,Math.ceil(C.length/2)),R;if(!F&&!I)return null;I?F?R=F[4].length>I[4].length?F:I:R=I:R=F;var M,$,B,U;j.length>S.length?(M=R[0],$=R[1],B=R[2],U=R[3]):(B=R[0],U=R[1],M=R[2],$=R[3]);var G=R[4];return[M,$,B,U,G]}function w(j){j.push([o,""]);for(var S=0,C=0,P=0,A="",F="",I;S<j.length;)switch(j[S][0]){case a:P++,F+=j[S][1],S++;break;case s:C++,A+=j[S][1],S++;break;case o:C+P>1?(C!==0&&P!==0&&(I=d(F,A),I!==0&&(S-C-P>0&&j[S-C-P-1][0]==o?j[S-C-P-1][1]+=F.substring(0,I):(j.splice(0,0,[o,F.substring(0,I)]),S++),F=F.substring(I),A=A.substring(I)),I=m(F,A),I!==0&&(j[S][1]=F.substring(F.length-I)+j[S][1],F=F.substring(0,F.length-I),A=A.substring(0,A.length-I))),C===0?j.splice(S-P,C+P,[a,F]):P===0?j.splice(S-C,C+P,[s,A]):j.splice(S-C-P,C+P,[s,A],[a,F]),S=S-C-P+(C?1:0)+(P?1:0)+1):S!==0&&j[S-1][0]==o?(j[S-1][1]+=j[S][1],j.splice(S,1)):S++,P=0,C=0,A="",F="";break}j[j.length-1][1]===""&&j.pop();var R=!1;for(S=1;S<j.length-1;)j[S-1][0]==o&&j[S+1][0]==o&&(j[S][1].substring(j[S][1].length-j[S-1][1].length)==j[S-1][1]?(j[S][1]=j[S-1][1]+j[S][1].substring(0,j[S][1].length-j[S-1][1].length),j[S+1][1]=j[S-1][1]+j[S+1][1],j.splice(S-1,1),R=!0):j[S][1].substring(0,j[S+1][1].length)==j[S+1][1]&&(j[S-1][1]+=j[S+1][1],j[S][1]=j[S][1].substring(j[S+1][1].length)+j[S+1][1],j.splice(S+1,1),R=!0)),S++;R&&w(j)}var v=l;v.INSERT=a,v.DELETE=s,v.EQUAL=o,n.exports=v;function b(j,S){if(S===0)return[o,j];for(var C=0,P=0;P<j.length;P++){var A=j[P];if(A[0]===s||A[0]===o){var F=C+A[1].length;if(S===F)return[P+1,j];if(S<F){j=j.slice();var I=S-C,R=[A[0],A[1].slice(0,I)],M=[A[0],A[1].slice(I)];return j.splice(P,1,R,M),[P+1,j]}else C=F}}throw new Error("cursor_pos is out of bounds!")}function y(j,S){var C=b(j,S),P=C[1],A=C[0],F=P[A],I=P[A+1];if(F==null)return j;if(F[0]!==o)return j;if(I!=null&&F[1]+I[1]===I[1]+F[1])return P.splice(A,2,I,F),N(P,A,2);if(I!=null&&I[1].indexOf(F[1])===0){P.splice(A,2,[I[0],F[1]],[0,F[1]]);var R=I[1].slice(F[1].length);return R.length>0&&P.splice(A+2,0,[I[0],R]),N(P,A,3)}else return j}function _(j){for(var S=!1,C=function(I){return I.charCodeAt(0)>=56320&&I.charCodeAt(0)<=57343},P=function(I){return I.charCodeAt(I.length-1)>=55296&&I.charCodeAt(I.length-1)<=56319},A=2;A<j.length;A+=1)j[A-2][0]===o&&P(j[A-2][1])&&j[A-1][0]===s&&C(j[A-1][1])&&j[A][0]===a&&C(j[A][1])&&(S=!0,j[A-1][1]=j[A-2][1].slice(-1)+j[A-1][1],j[A][1]=j[A-2][1].slice(-1)+j[A][1],j[A-2][1]=j[A-2][1].slice(0,-1));if(!S)return j;for(var F=[],A=0;A<j.length;A+=1)j[A][1].length>0&&F.push(j[A]);return F}function N(j,S,C){for(var P=S+C-1;P>=0&&P>=S-1;P--)if(P+1<j.length){var A=j[P],F=j[P+1];A[0]===F[1]&&j.splice(P,2,[A[0],A[1]+F[1]])}return j}}),(function(n,r){r=n.exports=typeof Object.keys=="function"?Object.keys:s,r.shim=s;function s(a){var o=[];for(var l in a)o.push(l);return o}}),(function(n,r){var s=(function(){return Object.prototype.toString.call(arguments)})()=="[object Arguments]";r=n.exports=s?a:o,r.supported=a;function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}r.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}}),(function(n,r){var s=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function l(u,h,d){this.fn=u,this.context=h,this.once=d||!1}function c(){this._events=new o,this._eventsCount=0}c.prototype.eventNames=function(){var h=[],d,m;if(this._eventsCount===0)return h;for(m in d=this._events)s.call(d,m)&&h.push(a?m.slice(1):m);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(d)):h},c.prototype.listeners=function(h,d){var m=a?a+h:h,g=this._events[m];if(d)return!!g;if(!g)return[];if(g.fn)return[g.fn];for(var w=0,v=g.length,b=new Array(v);w<v;w++)b[w]=g[w].fn;return b},c.prototype.emit=function(h,d,m,g,w,v){var b=a?a+h:h;if(!this._events[b])return!1;var y=this._events[b],_=arguments.length,N,j;if(y.fn){switch(y.once&&this.removeListener(h,y.fn,void 0,!0),_){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,m),!0;case 4:return y.fn.call(y.context,d,m,g),!0;case 5:return y.fn.call(y.context,d,m,g,w),!0;case 6:return y.fn.call(y.context,d,m,g,w,v),!0}for(j=1,N=new Array(_-1);j<_;j++)N[j-1]=arguments[j];y.fn.apply(y.context,N)}else{var S=y.length,C;for(j=0;j<S;j++)switch(y[j].once&&this.removeListener(h,y[j].fn,void 0,!0),_){case 1:y[j].fn.call(y[j].context);break;case 2:y[j].fn.call(y[j].context,d);break;case 3:y[j].fn.call(y[j].context,d,m);break;case 4:y[j].fn.call(y[j].context,d,m,g);break;default:if(!N)for(C=1,N=new Array(_-1);C<_;C++)N[C-1]=arguments[C];y[j].fn.apply(y[j].context,N)}}return!0},c.prototype.on=function(h,d,m){var g=new l(d,m||this),w=a?a+h:h;return this._events[w]?this._events[w].fn?this._events[w]=[this._events[w],g]:this._events[w].push(g):(this._events[w]=g,this._eventsCount++),this},c.prototype.once=function(h,d,m){var g=new l(d,m||this,!0),w=a?a+h:h;return this._events[w]?this._events[w].fn?this._events[w]=[this._events[w],g]:this._events[w].push(g):(this._events[w]=g,this._eventsCount++),this},c.prototype.removeListener=function(h,d,m,g){var w=a?a+h:h;if(!this._events[w])return this;if(!d)return--this._eventsCount===0?this._events=new o:delete this._events[w],this;var v=this._events[w];if(v.fn)v.fn===d&&(!g||v.once)&&(!m||v.context===m)&&(--this._eventsCount===0?this._events=new o:delete this._events[w]);else{for(var b=0,y=[],_=v.length;b<_;b++)(v[b].fn!==d||g&&!v[b].once||m&&v[b].context!==m)&&y.push(v[b]);y.length?this._events[w]=y.length===1?y[0]:y:--this._eventsCount===0?this._events=new o:delete this._events[w]}return this},c.prototype.removeAllListeners=function(h){var d;return h?(d=a?a+h:h,this._events[d]&&(--this._eventsCount===0?this._events=new o:delete this._events[d])):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prototype.setMaxListeners=function(){return this},c.prefixed=a,c.EventEmitter=c,typeof n<"u"&&(n.exports=c)}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.matchText=r.matchSpacing=r.matchNewline=r.matchBlot=r.matchAttributor=r.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ke){return typeof ke}:function(ke){return ke&&typeof Symbol=="function"&&ke.constructor===Symbol&&ke!==Symbol.prototype?"symbol":typeof ke},o=(function(){function ke(Ae,Be){var de=[],Pe=!0,Ze=!1,ct=void 0;try{for(var pt=Ae[Symbol.iterator](),$t;!(Pe=($t=pt.next()).done)&&(de.push($t.value),!(Be&&de.length===Be));Pe=!0);}catch(wn){Ze=!0,ct=wn}finally{try{!Pe&&pt.return&&pt.return()}finally{if(Ze)throw ct}}return de}return function(Ae,Be){if(Array.isArray(Ae))return Ae;if(Symbol.iterator in Object(Ae))return ke(Ae,Be);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function ke(Ae,Be){for(var de=0;de<Be.length;de++){var Pe=Be[de];Pe.enumerable=Pe.enumerable||!1,Pe.configurable=!0,"value"in Pe&&(Pe.writable=!0),Object.defineProperty(Ae,Pe.key,Pe)}}return function(Ae,Be,de){return Be&&ke(Ae.prototype,Be),de&&ke(Ae,de),Ae}})(),c=s(3),u=M(c),h=s(2),d=M(h),m=s(0),g=M(m),w=s(5),v=M(w),b=s(10),y=M(b),_=s(9),N=M(_),j=s(36),S=s(37),C=s(13),P=M(C),A=s(26),F=s(38),I=s(39),R=s(40);function M(ke){return ke&&ke.__esModule?ke:{default:ke}}function $(ke,Ae,Be){return Ae in ke?Object.defineProperty(ke,Ae,{value:Be,enumerable:!0,configurable:!0,writable:!0}):ke[Ae]=Be,ke}function B(ke,Ae){if(!(ke instanceof Ae))throw new TypeError("Cannot call a class as a function")}function U(ke,Ae){if(!ke)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ae&&(typeof Ae=="object"||typeof Ae=="function")?Ae:ke}function G(ke,Ae){if(typeof Ae!="function"&&Ae!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Ae);ke.prototype=Object.create(Ae&&Ae.prototype,{constructor:{value:ke,enumerable:!1,writable:!0,configurable:!0}}),Ae&&(Object.setPrototypeOf?Object.setPrototypeOf(ke,Ae):ke.__proto__=Ae)}var Z=(0,y.default)("quill:clipboard"),X="__ql-matcher",V=[[Node.TEXT_NODE,Xe],[Node.TEXT_NODE,_e],["br",ge],[Node.ELEMENT_NODE,_e],[Node.ELEMENT_NODE,fe],[Node.ELEMENT_NODE,We],[Node.ELEMENT_NODE,re],[Node.ELEMENT_NODE,ze],["li",De],["b",le.bind(le,"bold")],["i",le.bind(le,"italic")],["style",he]],z=[j.AlignAttribute,F.DirectionAttribute].reduce(function(ke,Ae){return ke[Ae.keyName]=Ae,ke},{}),L=[j.AlignStyle,S.BackgroundStyle,A.ColorStyle,F.DirectionStyle,I.FontStyle,R.SizeStyle].reduce(function(ke,Ae){return ke[Ae.keyName]=Ae,ke},{}),W=(function(ke){G(Ae,ke);function Ae(Be,de){B(this,Ae);var Pe=U(this,(Ae.__proto__||Object.getPrototypeOf(Ae)).call(this,Be,de));return Pe.quill.root.addEventListener("paste",Pe.onPaste.bind(Pe)),Pe.container=Pe.quill.addContainer("ql-clipboard"),Pe.container.setAttribute("contenteditable",!0),Pe.container.setAttribute("tabindex",-1),Pe.matchers=[],V.concat(Pe.options.matchers).forEach(function(Ze){var ct=o(Ze,2),pt=ct[0],$t=ct[1];!de.matchVisual&&$t===We||Pe.addMatcher(pt,$t)}),Pe}return l(Ae,[{key:"addMatcher",value:function(de,Pe){this.matchers.push([de,Pe])}},{key:"convert",value:function(de){if(typeof de=="string")return this.container.innerHTML=de.replace(/\>\r?\n +\</g,"><"),this.convert();var Pe=this.quill.getFormat(this.quill.selection.savedRange.index);if(Pe[P.default.blotName]){var Ze=this.container.innerText;return this.container.innerHTML="",new d.default().insert(Ze,$({},P.default.blotName,Pe[P.default.blotName]))}var ct=this.prepareMatching(),pt=o(ct,2),$t=pt[0],wn=pt[1],an=ee(this.container,$t,wn);return ne(an,`
751`)&&an.ops[an.ops.length-1].attributes==null&&(an=an.compose(new d.default().retain(an.length()-1).delete(1))),Z.log("convert",this.container.innerHTML,an),this.container.innerHTML="",an}},{key:"dangerouslyPasteHTML",value:function(de,Pe){var Ze=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.default.sources.API;if(typeof de=="string")this.quill.setContents(this.convert(de),Pe),this.quill.setSelection(0,v.default.sources.SILENT);else{var ct=this.convert(Pe);this.quill.updateContents(new d.default().retain(de).concat(ct),Ze),this.quill.setSelection(de+ct.length(),v.default.sources.SILENT)}}},{key:"onPaste",value:function(de){var Pe=this;if(!(de.defaultPrevented||!this.quill.isEnabled())){var Ze=this.quill.getSelection(),ct=new d.default().retain(Ze.index),pt=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(v.default.sources.SILENT),setTimeout(function(){ct=ct.concat(Pe.convert()).delete(Ze.length),Pe.quill.updateContents(ct,v.default.sources.USER),Pe.quill.setSelection(ct.length()-Ze.length,v.default.sources.SILENT),Pe.quill.scrollingContainer.scrollTop=pt,Pe.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var de=this,Pe=[],Ze=[];return this.matchers.forEach(function(ct){var pt=o(ct,2),$t=pt[0],wn=pt[1];switch($t){case Node.TEXT_NODE:Ze.push(wn);break;case Node.ELEMENT_NODE:Pe.push(wn);break;default:[].forEach.call(de.container.querySelectorAll($t),function(an){an[X]=an[X]||[],an[X].push(wn)});break}}),[Pe,Ze]}}]),Ae})(N.default);W.DEFAULTS={matchers:[],matchVisual:!0};function Q(ke,Ae,Be){return(typeof Ae>"u"?"undefined":a(Ae))==="object"?Object.keys(Ae).reduce(function(de,Pe){return Q(de,Pe,Ae[Pe])},ke):ke.reduce(function(de,Pe){return Pe.attributes&&Pe.attributes[Ae]?de.push(Pe):de.insert(Pe.insert,(0,u.default)({},$({},Ae,Be),Pe.attributes))},new d.default)}function J(ke){if(ke.nodeType!==Node.ELEMENT_NODE)return{};var Ae="__ql-computed-style";return ke[Ae]||(ke[Ae]=window.getComputedStyle(ke))}function ne(ke,Ae){for(var Be="",de=ke.ops.length-1;de>=0&&Be.length<Ae.length;--de){var Pe=ke.ops[de];if(typeof Pe.insert!="string")break;Be=Pe.insert+Be}return Be.slice(-1*Ae.length)===Ae}function Y(ke){if(ke.childNodes.length===0)return!1;var Ae=J(ke);return["block","list-item"].indexOf(Ae.display)>-1}function ee(ke,Ae,Be){return ke.nodeType===ke.TEXT_NODE?Be.reduce(function(de,Pe){return Pe(ke,de)},new d.default):ke.nodeType===ke.ELEMENT_NODE?[].reduce.call(ke.childNodes||[],function(de,Pe){var Ze=ee(Pe,Ae,Be);return Pe.nodeType===ke.ELEMENT_NODE&&(Ze=Ae.reduce(function(ct,pt){return pt(Pe,ct)},Ze),Ze=(Pe[X]||[]).reduce(function(ct,pt){return pt(Pe,ct)},Ze)),de.concat(Ze)},new d.default):new d.default}function le(ke,Ae,Be){return Q(Be,ke,!0)}function re(ke,Ae){var Be=g.default.Attributor.Attribute.keys(ke),de=g.default.Attributor.Class.keys(ke),Pe=g.default.Attributor.Style.keys(ke),Ze={};return Be.concat(de).concat(Pe).forEach(function(ct){var pt=g.default.query(ct,g.default.Scope.ATTRIBUTE);pt!=null&&(Ze[pt.attrName]=pt.value(ke),Ze[pt.attrName])||(pt=z[ct],pt!=null&&(pt.attrName===ct||pt.keyName===ct)&&(Ze[pt.attrName]=pt.value(ke)||void 0),pt=L[ct],pt!=null&&(pt.attrName===ct||pt.keyName===ct)&&(pt=L[ct],Ze[pt.attrName]=pt.value(ke)||void 0))}),Object.keys(Ze).length>0&&(Ae=Q(Ae,Ze)),Ae}function fe(ke,Ae){var Be=g.default.query(ke);if(Be==null)return Ae;if(Be.prototype instanceof g.default.Embed){var de={},Pe=Be.value(ke);Pe!=null&&(de[Be.blotName]=Pe,Ae=new d.default().insert(de,Be.formats(ke)))}else typeof Be.formats=="function"&&(Ae=Q(Ae,Be.blotName,Be.formats(ke)));return Ae}function ge(ke,Ae){return ne(Ae,`
752`)||Ae.insert(`
753`),Ae}function he(){return new d.default}function De(ke,Ae){var Be=g.default.query(ke);if(Be==null||Be.blotName!=="list-item"||!ne(Ae,`
754`))return Ae;for(var de=-1,Pe=ke.parentNode;!Pe.classList.contains("ql-clipboard");)(g.default.query(Pe)||{}).blotName==="list"&&(de+=1),Pe=Pe.parentNode;return de<=0?Ae:Ae.compose(new d.default().retain(Ae.length()-1).retain(1,{indent:de}))}function _e(ke,Ae){return ne(Ae,`
755`)||(Y(ke)||Ae.length()>0&&ke.nextSibling&&Y(ke.nextSibling))&&Ae.insert(`
756`),Ae}function We(ke,Ae){if(Y(ke)&&ke.nextElementSibling!=null&&!ne(Ae,`
757
758`)){var Be=ke.offsetHeight+parseFloat(J(ke).marginTop)+parseFloat(J(ke).marginBottom);ke.nextElementSibling.offsetTop>ke.offsetTop+Be*1.5&&Ae.insert(`
759`)}return Ae}function ze(ke,Ae){var Be={},de=ke.style||{};return de.fontStyle&&J(ke).fontStyle==="italic"&&(Be.italic=!0),de.fontWeight&&(J(ke).fontWeight.startsWith("bold")||parseInt(J(ke).fontWeight)>=700)&&(Be.bold=!0),Object.keys(Be).length>0&&(Ae=Q(Ae,Be)),parseFloat(de.textIndent||0)>0&&(Ae=new d.default().insert("	").concat(Ae)),Ae}function Xe(ke,Ae){var Be=ke.data;if(ke.parentNode.tagName==="O:P")return Ae.insert(Be.trim());if(Be.trim().length===0&&ke.parentNode.classList.contains("ql-clipboard"))return Ae;if(!J(ke.parentNode).whiteSpace.startsWith("pre")){var de=function(Ze,ct){return ct=ct.replace(/[^\u00a0]/g,""),ct.length<1&&Ze?" ":ct};Be=Be.replace(/\r\n/g," ").replace(/\n/g," "),Be=Be.replace(/\s\s+/g,de.bind(de,!0)),(ke.previousSibling==null&&Y(ke.parentNode)||ke.previousSibling!=null&&Y(ke.previousSibling))&&(Be=Be.replace(/^\s+/,de.bind(de,!1))),(ke.nextSibling==null&&Y(ke.parentNode)||ke.nextSibling!=null&&Y(ke.nextSibling))&&(Be=Be.replace(/\s+$/,de.bind(de,!1)))}return Ae.insert(Be)}r.default=W,r.matchAttributor=re,r.matchBlot=fe,r.matchNewline=_e,r.matchSpacing=We,r.matchText=Xe}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function w(v,b){for(var y=0;y<b.length;y++){var _=b[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}return function(v,b,y){return b&&w(v.prototype,b),y&&w(v,y),v}})(),o=function w(v,b,y){v===null&&(v=Function.prototype);var _=Object.getOwnPropertyDescriptor(v,b);if(_===void 0){var N=Object.getPrototypeOf(v);return N===null?void 0:w(N,b,y)}else{if("value"in _)return _.value;var j=_.get;return j===void 0?void 0:j.call(y)}},l=s(6),c=u(l);function u(w){return w&&w.__esModule?w:{default:w}}function h(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function d(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function m(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var g=(function(w){m(v,w);function v(){return h(this,v),d(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"optimize",value:function(y){o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,y),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),v})(c.default);g.blotName="bold",g.tagName=["STRONG","B"],r.default=g}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.addControls=r.default=void 0;var a=(function(){function R(M,$){var B=[],U=!0,G=!1,Z=void 0;try{for(var X=M[Symbol.iterator](),V;!(U=(V=X.next()).done)&&(B.push(V.value),!($&&B.length===$));U=!0);}catch(z){G=!0,Z=z}finally{try{!U&&X.return&&X.return()}finally{if(G)throw Z}}return B}return function(M,$){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return R(M,$);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function R(M,$){for(var B=0;B<$.length;B++){var U=$[B];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(M,U.key,U)}}return function(M,$,B){return $&&R(M.prototype,$),B&&R(M,B),M}})(),l=s(2),c=y(l),u=s(0),h=y(u),d=s(5),m=y(d),g=s(10),w=y(g),v=s(9),b=y(v);function y(R){return R&&R.__esModule?R:{default:R}}function _(R,M,$){return M in R?Object.defineProperty(R,M,{value:$,enumerable:!0,configurable:!0,writable:!0}):R[M]=$,R}function N(R,M){if(!(R instanceof M))throw new TypeError("Cannot call a class as a function")}function j(R,M){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:R}function S(R,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);R.prototype=Object.create(M&&M.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(R,M):R.__proto__=M)}var C=(0,w.default)("quill:toolbar"),P=(function(R){S(M,R);function M($,B){N(this,M);var U=j(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,$,B));if(Array.isArray(U.options.container)){var G=document.createElement("div");F(G,U.options.container),$.container.parentNode.insertBefore(G,$.container),U.container=G}else typeof U.options.container=="string"?U.container=document.querySelector(U.options.container):U.container=U.options.container;if(!(U.container instanceof HTMLElement)){var Z;return Z=C.error("Container required for toolbar",U.options),j(U,Z)}return U.container.classList.add("ql-toolbar"),U.controls=[],U.handlers={},Object.keys(U.options.handlers).forEach(function(X){U.addHandler(X,U.options.handlers[X])}),[].forEach.call(U.container.querySelectorAll("button, select"),function(X){U.attach(X)}),U.quill.on(m.default.events.EDITOR_CHANGE,function(X,V){X===m.default.events.SELECTION_CHANGE&&U.update(V)}),U.quill.on(m.default.events.SCROLL_OPTIMIZE,function(){var X=U.quill.selection.getRange(),V=a(X,1),z=V[0];U.update(z)}),U}return o(M,[{key:"addHandler",value:function(B,U){this.handlers[B]=U}},{key:"attach",value:function(B){var U=this,G=[].find.call(B.classList,function(X){return X.indexOf("ql-")===0});if(G){if(G=G.slice(3),B.tagName==="BUTTON"&&B.setAttribute("type","button"),this.handlers[G]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[G]==null){C.warn("ignoring attaching to disabled format",G,B);return}if(h.default.query(G)==null){C.warn("ignoring attaching to nonexistent format",G,B);return}}var Z=B.tagName==="SELECT"?"change":"click";B.addEventListener(Z,function(X){var V=void 0;if(B.tagName==="SELECT"){if(B.selectedIndex<0)return;var z=B.options[B.selectedIndex];z.hasAttribute("selected")?V=!1:V=z.value||!1}else B.classList.contains("ql-active")?V=!1:V=B.value||!B.hasAttribute("value"),X.preventDefault();U.quill.focus();var L=U.quill.selection.getRange(),W=a(L,1),Q=W[0];if(U.handlers[G]!=null)U.handlers[G].call(U,V);else if(h.default.query(G).prototype instanceof h.default.Embed){if(V=prompt("Enter "+G),!V)return;U.quill.updateContents(new c.default().retain(Q.index).delete(Q.length).insert(_({},G,V)),m.default.sources.USER)}else U.quill.format(G,V,m.default.sources.USER);U.update(Q)}),this.controls.push([G,B])}}},{key:"update",value:function(B){var U=B==null?{}:this.quill.getFormat(B);this.controls.forEach(function(G){var Z=a(G,2),X=Z[0],V=Z[1];if(V.tagName==="SELECT"){var z=void 0;if(B==null)z=null;else if(U[X]==null)z=V.querySelector("option[selected]");else if(!Array.isArray(U[X])){var L=U[X];typeof L=="string"&&(L=L.replace(/\"/g,'\\"')),z=V.querySelector('option[value="'+L+'"]')}z==null?(V.value="",V.selectedIndex=-1):z.selected=!0}else if(B==null)V.classList.remove("ql-active");else if(V.hasAttribute("value")){var W=U[X]===V.getAttribute("value")||U[X]!=null&&U[X].toString()===V.getAttribute("value")||U[X]==null&&!V.getAttribute("value");V.classList.toggle("ql-active",W)}else V.classList.toggle("ql-active",U[X]!=null)})}}]),M})(b.default);P.DEFAULTS={};function A(R,M,$){var B=document.createElement("button");B.setAttribute("type","button"),B.classList.add("ql-"+M),$!=null&&(B.value=$),R.appendChild(B)}function F(R,M){Array.isArray(M[0])||(M=[M]),M.forEach(function($){var B=document.createElement("span");B.classList.add("ql-formats"),$.forEach(function(U){if(typeof U=="string")A(B,U);else{var G=Object.keys(U)[0],Z=U[G];Array.isArray(Z)?I(B,G,Z):A(B,G,Z)}}),R.appendChild(B)})}function I(R,M,$){var B=document.createElement("select");B.classList.add("ql-"+M),$.forEach(function(U){var G=document.createElement("option");U!==!1?G.setAttribute("value",U):G.setAttribute("selected","selected"),B.appendChild(G)}),R.appendChild(B)}P.DEFAULTS={container:null,handlers:{clean:function(){var M=this,$=this.quill.getSelection();if($!=null)if($.length==0){var B=this.quill.getFormat();Object.keys(B).forEach(function(U){h.default.query(U,h.default.Scope.INLINE)!=null&&M.quill.format(U,!1)})}else this.quill.removeFormat($,m.default.sources.USER)},direction:function(M){var $=this.quill.getFormat().align;M==="rtl"&&$==null?this.quill.format("align","right",m.default.sources.USER):!M&&$==="right"&&this.quill.format("align",!1,m.default.sources.USER),this.quill.format("direction",M,m.default.sources.USER)},indent:function(M){var $=this.quill.getSelection(),B=this.quill.getFormat($),U=parseInt(B.indent||0);if(M==="+1"||M==="-1"){var G=M==="+1"?1:-1;B.direction==="rtl"&&(G*=-1),this.quill.format("indent",U+G,m.default.sources.USER)}},link:function(M){M===!0&&(M=prompt("Enter link URL:")),this.quill.format("link",M,m.default.sources.USER)},list:function(M){var $=this.quill.getSelection(),B=this.quill.getFormat($);M==="check"?B.list==="checked"||B.list==="unchecked"?this.quill.format("list",!1,m.default.sources.USER):this.quill.format("list","unchecked",m.default.sources.USER):this.quill.format("list",M,m.default.sources.USER)}}},r.default=P,r.addControls=F}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function w(v,b){for(var y=0;y<b.length;y++){var _=b[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}return function(v,b,y){return b&&w(v.prototype,b),y&&w(v,y),v}})(),o=function w(v,b,y){v===null&&(v=Function.prototype);var _=Object.getOwnPropertyDescriptor(v,b);if(_===void 0){var N=Object.getPrototypeOf(v);return N===null?void 0:w(N,b,y)}else{if("value"in _)return _.value;var j=_.get;return j===void 0?void 0:j.call(y)}},l=s(28),c=u(l);function u(w){return w&&w.__esModule?w:{default:w}}function h(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function d(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function m(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var g=(function(w){m(v,w);function v(b,y){h(this,v);var _=d(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,b));return _.label.innerHTML=y,_.container.classList.add("ql-color-picker"),[].slice.call(_.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(N){N.classList.add("ql-primary")}),_}return a(v,[{key:"buildItem",value:function(y){var _=o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"buildItem",this).call(this,y);return _.style.backgroundColor=y.getAttribute("value")||"",_}},{key:"selectItem",value:function(y,_){o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,y,_);var N=this.label.querySelector(".ql-color-label"),j=y&&y.getAttribute("data-value")||"";N&&(N.tagName==="line"?N.style.stroke=j:N.style.fill=j)}}]),v})(c.default);r.default=g}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function w(v,b){for(var y=0;y<b.length;y++){var _=b[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}return function(v,b,y){return b&&w(v.prototype,b),y&&w(v,y),v}})(),o=function w(v,b,y){v===null&&(v=Function.prototype);var _=Object.getOwnPropertyDescriptor(v,b);if(_===void 0){var N=Object.getPrototypeOf(v);return N===null?void 0:w(N,b,y)}else{if("value"in _)return _.value;var j=_.get;return j===void 0?void 0:j.call(y)}},l=s(28),c=u(l);function u(w){return w&&w.__esModule?w:{default:w}}function h(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function d(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function m(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var g=(function(w){m(v,w);function v(b,y){h(this,v);var _=d(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,b));return _.container.classList.add("ql-icon-picker"),[].forEach.call(_.container.querySelectorAll(".ql-picker-item"),function(N){N.innerHTML=y[N.getAttribute("data-value")||""]}),_.defaultItem=_.container.querySelector(".ql-selected"),_.selectItem(_.defaultItem),_}return a(v,[{key:"selectItem",value:function(y,_){o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,y,_),y=y||this.defaultItem,this.label.innerHTML=y.innerHTML}}]),v})(c.default);r.default=g}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function c(u,h){for(var d=0;d<h.length;d++){var m=h[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}return function(u,h,d){return h&&c(u.prototype,h),d&&c(u,d),u}})();function o(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}var l=(function(){function c(u,h){var d=this;o(this,c),this.quill=u,this.boundsContainer=h||document.body,this.root=u.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){d.root.style.marginTop=-1*d.quill.root.scrollTop+"px"}),this.hide()}return a(c,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(h){var d=h.left+h.width/2-this.root.offsetWidth/2,m=h.bottom+this.quill.root.scrollTop;this.root.style.left=d+"px",this.root.style.top=m+"px",this.root.classList.remove("ql-flip");var g=this.boundsContainer.getBoundingClientRect(),w=this.root.getBoundingClientRect(),v=0;if(w.right>g.right&&(v=g.right-w.right,this.root.style.left=d+v+"px"),w.left<g.left&&(v=g.left-w.left,this.root.style.left=d+v+"px"),w.bottom>g.bottom){var b=w.bottom-w.top,y=h.bottom-h.top+b;this.root.style.top=m-y+"px",this.root.classList.add("ql-flip")}return v}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),c})();r.default=l}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function I(R,M){var $=[],B=!0,U=!1,G=void 0;try{for(var Z=R[Symbol.iterator](),X;!(B=(X=Z.next()).done)&&($.push(X.value),!(M&&$.length===M));B=!0);}catch(V){U=!0,G=V}finally{try{!B&&Z.return&&Z.return()}finally{if(U)throw G}}return $}return function(R,M){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return I(R,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=function I(R,M,$){R===null&&(R=Function.prototype);var B=Object.getOwnPropertyDescriptor(R,M);if(B===void 0){var U=Object.getPrototypeOf(R);return U===null?void 0:I(U,M,$)}else{if("value"in B)return B.value;var G=B.get;return G===void 0?void 0:G.call($)}},l=(function(){function I(R,M){for(var $=0;$<M.length;$++){var B=M[$];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(R,B.key,B)}}return function(R,M,$){return M&&I(R.prototype,M),$&&I(R,$),R}})(),c=s(3),u=N(c),h=s(8),d=N(h),m=s(43),g=N(m),w=s(27),v=N(w),b=s(15),y=s(41),_=N(y);function N(I){return I&&I.__esModule?I:{default:I}}function j(I,R){if(!(I instanceof R))throw new TypeError("Cannot call a class as a function")}function S(I,R){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:I}function C(I,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);I.prototype=Object.create(R&&R.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(I,R):I.__proto__=R)}var P=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],A=(function(I){C(R,I);function R(M,$){j(this,R),$.modules.toolbar!=null&&$.modules.toolbar.container==null&&($.modules.toolbar.container=P);var B=S(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,M,$));return B.quill.container.classList.add("ql-snow"),B}return l(R,[{key:"extendToolbar",value:function($){$.container.classList.add("ql-snow"),this.buildButtons([].slice.call($.container.querySelectorAll("button")),_.default),this.buildPickers([].slice.call($.container.querySelectorAll("select")),_.default),this.tooltip=new F(this.quill,this.options.bounds),$.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(B,U){$.handlers.link.call($,!U.format.link)})}}]),R})(g.default);A.DEFAULTS=(0,u.default)(!0,{},g.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(R){if(R){var M=this.quill.getSelection();if(M==null||M.length==0)return;var $=this.quill.getText(M);/^\S+@\S+\.\S+$/.test($)&&$.indexOf("mailto:")!==0&&($="mailto:"+$);var B=this.quill.theme.tooltip;B.edit("link",$)}else this.quill.format("link",!1)}}}}});var F=(function(I){C(R,I);function R(M,$){j(this,R);var B=S(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,M,$));return B.preview=B.root.querySelector("a.ql-preview"),B}return l(R,[{key:"listen",value:function(){var $=this;o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(B){$.root.classList.contains("ql-editing")?$.save():$.edit("link",$.preview.textContent),B.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(B){if($.linkRange!=null){var U=$.linkRange;$.restoreFocus(),$.quill.formatText(U,"link",!1,d.default.sources.USER),delete $.linkRange}B.preventDefault(),$.hide()}),this.quill.on(d.default.events.SELECTION_CHANGE,function(B,U,G){if(B!=null){if(B.length===0&&G===d.default.sources.USER){var Z=$.quill.scroll.descendant(v.default,B.index),X=a(Z,2),V=X[0],z=X[1];if(V!=null){$.linkRange=new b.Range(B.index-z,V.length());var L=v.default.formats(V.domNode);$.preview.textContent=L,$.preview.setAttribute("href",L),$.show(),$.position($.quill.getBounds($.linkRange));return}}else delete $.linkRange;$.hide()}})}},{key:"show",value:function(){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),R})(m.BaseTooltip);F.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),r.default=A}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(29),o=Pe(a),l=s(36),c=s(38),u=s(64),h=s(65),d=Pe(h),m=s(66),g=Pe(m),w=s(67),v=Pe(w),b=s(37),y=s(26),_=s(39),N=s(40),j=s(56),S=Pe(j),C=s(68),P=Pe(C),A=s(27),F=Pe(A),I=s(69),R=Pe(I),M=s(70),$=Pe(M),B=s(71),U=Pe(B),G=s(72),Z=Pe(G),X=s(73),V=Pe(X),z=s(13),L=Pe(z),W=s(74),Q=Pe(W),J=s(75),ne=Pe(J),Y=s(57),ee=Pe(Y),le=s(41),re=Pe(le),fe=s(28),ge=Pe(fe),he=s(59),De=Pe(he),_e=s(60),We=Pe(_e),ze=s(61),Xe=Pe(ze),ke=s(108),Ae=Pe(ke),Be=s(62),de=Pe(Be);function Pe(Ze){return Ze&&Ze.__esModule?Ze:{default:Ze}}o.default.register({"attributors/attribute/direction":c.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":b.BackgroundClass,"attributors/class/color":y.ColorClass,"attributors/class/direction":c.DirectionClass,"attributors/class/font":_.FontClass,"attributors/class/size":N.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":b.BackgroundStyle,"attributors/style/color":y.ColorStyle,"attributors/style/direction":c.DirectionStyle,"attributors/style/font":_.FontStyle,"attributors/style/size":N.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":c.DirectionClass,"formats/indent":u.IndentClass,"formats/background":b.BackgroundStyle,"formats/color":y.ColorStyle,"formats/font":_.FontClass,"formats/size":N.SizeClass,"formats/blockquote":d.default,"formats/code-block":L.default,"formats/header":g.default,"formats/list":v.default,"formats/bold":S.default,"formats/code":z.Code,"formats/italic":P.default,"formats/link":F.default,"formats/script":R.default,"formats/strike":$.default,"formats/underline":U.default,"formats/image":Z.default,"formats/video":V.default,"formats/list/item":w.ListItem,"modules/formula":Q.default,"modules/syntax":ne.default,"modules/toolbar":ee.default,"themes/bubble":Ae.default,"themes/snow":de.default,"ui/icons":re.default,"ui/picker":ge.default,"ui/icon-picker":We.default,"ui/color-picker":De.default,"ui/tooltip":Xe.default},!0),r.default=o.default}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var a=(function(){function v(b,y){for(var _=0;_<y.length;_++){var N=y[_];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(b,N.key,N)}}return function(b,y,_){return y&&v(b.prototype,y),_&&v(b,_),b}})(),o=function v(b,y,_){b===null&&(b=Function.prototype);var N=Object.getOwnPropertyDescriptor(b,y);if(N===void 0){var j=Object.getPrototypeOf(b);return j===null?void 0:v(j,y,_)}else{if("value"in N)return N.value;var S=N.get;return S===void 0?void 0:S.call(_)}},l=s(0),c=u(l);function u(v){return v&&v.__esModule?v:{default:v}}function h(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")}function d(v,b){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:v}function m(v,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(v,b):v.__proto__=b)}var g=(function(v){m(b,v);function b(){return h(this,b),d(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"add",value:function(_,N){if(N==="+1"||N==="-1"){var j=this.value(_)||0;N=N==="+1"?j+1:j-1}return N===0?(this.remove(_),!0):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"add",this).call(this,_,N)}},{key:"canAdd",value:function(_,N){return o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,_,N)||o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,_,parseInt(N))}},{key:"value",value:function(_){return parseInt(o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,_))||void 0}}]),b})(c.default.Attributor.Class),w=new g("indent","ql-indent",{scope:c.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});r.IndentClass=w}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(4),o=l(a);function l(m){return m&&m.__esModule?m:{default:m}}function c(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function u(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function h(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var d=(function(m){h(g,m);function g(){return c(this,g),u(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g})(o.default);d.blotName="blockquote",d.tagName="blockquote",r.default=d}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function g(w,v){for(var b=0;b<v.length;b++){var y=v[b];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(w,y.key,y)}}return function(w,v,b){return v&&g(w.prototype,v),b&&g(w,b),w}})(),o=s(4),l=c(o);function c(g){return g&&g.__esModule?g:{default:g}}function u(g,w){if(!(g instanceof w))throw new TypeError("Cannot call a class as a function")}function h(g,w){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:g}function d(g,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);g.prototype=Object.create(w&&w.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(g,w):g.__proto__=w)}var m=(function(g){d(w,g);function w(){return u(this,w),h(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return a(w,null,[{key:"formats",value:function(b){return this.tagName.indexOf(b.tagName)+1}}]),w})(l.default);m.blotName="header",m.tagName=["H1","H2","H3","H4","H5","H6"],r.default=m}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.ListItem=void 0;var a=(function(){function j(S,C){for(var P=0;P<C.length;P++){var A=C[P];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(S,A.key,A)}}return function(S,C,P){return C&&j(S.prototype,C),P&&j(S,P),S}})(),o=function j(S,C,P){S===null&&(S=Function.prototype);var A=Object.getOwnPropertyDescriptor(S,C);if(A===void 0){var F=Object.getPrototypeOf(S);return F===null?void 0:j(F,C,P)}else{if("value"in A)return A.value;var I=A.get;return I===void 0?void 0:I.call(P)}},l=s(0),c=g(l),u=s(4),h=g(u),d=s(25),m=g(d);function g(j){return j&&j.__esModule?j:{default:j}}function w(j,S,C){return S in j?Object.defineProperty(j,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):j[S]=C,j}function v(j,S){if(!(j instanceof S))throw new TypeError("Cannot call a class as a function")}function b(j,S){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:j}function y(j,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);j.prototype=Object.create(S&&S.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(j,S):j.__proto__=S)}var _=(function(j){y(S,j);function S(){return v(this,S),b(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"format",value:function(P,A){P===N.blotName&&!A?this.replaceWith(c.default.create(this.statics.scope)):o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"format",this).call(this,P,A)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(P,A){return this.parent.isolate(this.offset(this.parent),this.length()),P===this.parent.statics.blotName?(this.parent.replaceWith(P,A),this):(this.parent.unwrap(),o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"replaceWith",this).call(this,P,A))}}],[{key:"formats",value:function(P){return P.tagName===this.tagName?void 0:o(S.__proto__||Object.getPrototypeOf(S),"formats",this).call(this,P)}}]),S})(h.default);_.blotName="list-item",_.tagName="LI";var N=(function(j){y(S,j),a(S,null,[{key:"create",value:function(P){var A=P==="ordered"?"OL":"UL",F=o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,A);return(P==="checked"||P==="unchecked")&&F.setAttribute("data-checked",P==="checked"),F}},{key:"formats",value:function(P){if(P.tagName==="OL")return"ordered";if(P.tagName==="UL")return P.hasAttribute("data-checked")?P.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function S(C){v(this,S);var P=b(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,C)),A=function(I){if(I.target.parentNode===C){var R=P.statics.formats(C),M=c.default.find(I.target);R==="checked"?M.format("list","unchecked"):R==="unchecked"&&M.format("list","checked")}};return C.addEventListener("touchstart",A),C.addEventListener("mousedown",A),P}return a(S,[{key:"format",value:function(P,A){this.children.length>0&&this.children.tail.format(P,A)}},{key:"formats",value:function(){return w({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(P,A){if(P instanceof _)o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"insertBefore",this).call(this,P,A);else{var F=A==null?this.length():A.offset(this),I=this.split(F);I.parent.insertBefore(P,I)}}},{key:"optimize",value:function(P){o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"optimize",this).call(this,P);var A=this.next;A!=null&&A.prev===this&&A.statics.blotName===this.statics.blotName&&A.domNode.tagName===this.domNode.tagName&&A.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(A.moveChildren(this),A.remove())}},{key:"replace",value:function(P){if(P.statics.blotName!==this.statics.blotName){var A=c.default.create(this.statics.defaultChild);P.moveChildren(A),this.appendChild(A)}o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"replace",this).call(this,P)}}]),S})(m.default);N.blotName="list",N.scope=c.default.Scope.BLOCK_BLOT,N.tagName=["OL","UL"],N.defaultChild="list-item",N.allowedChildren=[_],r.ListItem=_,r.default=N}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(56),o=l(a);function l(m){return m&&m.__esModule?m:{default:m}}function c(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function u(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function h(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var d=(function(m){h(g,m);function g(){return c(this,g),u(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g})(o.default);d.blotName="italic",d.tagName=["EM","I"],r.default=d}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function w(v,b){for(var y=0;y<b.length;y++){var _=b[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}return function(v,b,y){return b&&w(v.prototype,b),y&&w(v,y),v}})(),o=function w(v,b,y){v===null&&(v=Function.prototype);var _=Object.getOwnPropertyDescriptor(v,b);if(_===void 0){var N=Object.getPrototypeOf(v);return N===null?void 0:w(N,b,y)}else{if("value"in _)return _.value;var j=_.get;return j===void 0?void 0:j.call(y)}},l=s(6),c=u(l);function u(w){return w&&w.__esModule?w:{default:w}}function h(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function d(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function m(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var g=(function(w){m(v,w);function v(){return h(this,v),d(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,null,[{key:"create",value:function(y){return y==="super"?document.createElement("sup"):y==="sub"?document.createElement("sub"):o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,y)}},{key:"formats",value:function(y){if(y.tagName==="SUB")return"sub";if(y.tagName==="SUP")return"super"}}]),v})(c.default);g.blotName="script",g.tagName=["SUB","SUP"],r.default=g}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(6),o=l(a);function l(m){return m&&m.__esModule?m:{default:m}}function c(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function u(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function h(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var d=(function(m){h(g,m);function g(){return c(this,g),u(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g})(o.default);d.blotName="strike",d.tagName="S",r.default=d}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=s(6),o=l(a);function l(m){return m&&m.__esModule?m:{default:m}}function c(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function u(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function h(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var d=(function(m){h(g,m);function g(){return c(this,g),u(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g})(o.default);d.blotName="underline",d.tagName="U",r.default=d}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function b(y,_){for(var N=0;N<_.length;N++){var j=_[N];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(y,j.key,j)}}return function(y,_,N){return _&&b(y.prototype,_),N&&b(y,N),y}})(),o=function b(y,_,N){y===null&&(y=Function.prototype);var j=Object.getOwnPropertyDescriptor(y,_);if(j===void 0){var S=Object.getPrototypeOf(y);return S===null?void 0:b(S,_,N)}else{if("value"in j)return j.value;var C=j.get;return C===void 0?void 0:C.call(N)}},l=s(0),c=h(l),u=s(27);function h(b){return b&&b.__esModule?b:{default:b}}function d(b,y){if(!(b instanceof y))throw new TypeError("Cannot call a class as a function")}function m(b,y){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:b}function g(b,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);b.prototype=Object.create(y&&y.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(b,y):b.__proto__=y)}var w=["alt","height","width"],v=(function(b){g(y,b);function y(){return d(this,y),m(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"format",value:function(N,j){w.indexOf(N)>-1?j?this.domNode.setAttribute(N,j):this.domNode.removeAttribute(N):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,N,j)}}],[{key:"create",value:function(N){var j=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,N);return typeof N=="string"&&j.setAttribute("src",this.sanitize(N)),j}},{key:"formats",value:function(N){return w.reduce(function(j,S){return N.hasAttribute(S)&&(j[S]=N.getAttribute(S)),j},{})}},{key:"match",value:function(N){return/\.(jpe?g|gif|png)$/.test(N)||/^data:image\/.+;base64/.test(N)}},{key:"sanitize",value:function(N){return(0,u.sanitize)(N,["http","https","data"])?N:"//:0"}},{key:"value",value:function(N){return N.getAttribute("src")}}]),y})(c.default.Embed);v.blotName="image",v.tagName="IMG",r.default=v}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function b(y,_){for(var N=0;N<_.length;N++){var j=_[N];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(y,j.key,j)}}return function(y,_,N){return _&&b(y.prototype,_),N&&b(y,N),y}})(),o=function b(y,_,N){y===null&&(y=Function.prototype);var j=Object.getOwnPropertyDescriptor(y,_);if(j===void 0){var S=Object.getPrototypeOf(y);return S===null?void 0:b(S,_,N)}else{if("value"in j)return j.value;var C=j.get;return C===void 0?void 0:C.call(N)}},l=s(4),c=s(27),u=h(c);function h(b){return b&&b.__esModule?b:{default:b}}function d(b,y){if(!(b instanceof y))throw new TypeError("Cannot call a class as a function")}function m(b,y){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:b}function g(b,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);b.prototype=Object.create(y&&y.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(b,y):b.__proto__=y)}var w=["height","width"],v=(function(b){g(y,b);function y(){return d(this,y),m(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"format",value:function(N,j){w.indexOf(N)>-1?j?this.domNode.setAttribute(N,j):this.domNode.removeAttribute(N):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,N,j)}}],[{key:"create",value:function(N){var j=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,N);return j.setAttribute("frameborder","0"),j.setAttribute("allowfullscreen",!0),j.setAttribute("src",this.sanitize(N)),j}},{key:"formats",value:function(N){return w.reduce(function(j,S){return N.hasAttribute(S)&&(j[S]=N.getAttribute(S)),j},{})}},{key:"sanitize",value:function(N){return u.default.sanitize(N)}},{key:"value",value:function(N){return N.getAttribute("src")}}]),y})(l.BlockEmbed);v.blotName="video",v.className="ql-video",v.tagName="IFRAME",r.default=v}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.FormulaBlot=void 0;var a=(function(){function N(j,S){for(var C=0;C<S.length;C++){var P=S[C];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(j,P.key,P)}}return function(j,S,C){return S&&N(j.prototype,S),C&&N(j,C),j}})(),o=function N(j,S,C){j===null&&(j=Function.prototype);var P=Object.getOwnPropertyDescriptor(j,S);if(P===void 0){var A=Object.getPrototypeOf(j);return A===null?void 0:N(A,S,C)}else{if("value"in P)return P.value;var F=P.get;return F===void 0?void 0:F.call(C)}},l=s(35),c=g(l),u=s(5),h=g(u),d=s(9),m=g(d);function g(N){return N&&N.__esModule?N:{default:N}}function w(N,j){if(!(N instanceof j))throw new TypeError("Cannot call a class as a function")}function v(N,j){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j&&(typeof j=="object"||typeof j=="function")?j:N}function b(N,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof j);N.prototype=Object.create(j&&j.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),j&&(Object.setPrototypeOf?Object.setPrototypeOf(N,j):N.__proto__=j)}var y=(function(N){b(j,N);function j(){return w(this,j),v(this,(j.__proto__||Object.getPrototypeOf(j)).apply(this,arguments))}return a(j,null,[{key:"create",value:function(C){var P=o(j.__proto__||Object.getPrototypeOf(j),"create",this).call(this,C);return typeof C=="string"&&(window.katex.render(C,P,{throwOnError:!1,errorColor:"#f00"}),P.setAttribute("data-value",C)),P}},{key:"value",value:function(C){return C.getAttribute("data-value")}}]),j})(c.default);y.blotName="formula",y.className="ql-formula",y.tagName="SPAN";var _=(function(N){b(j,N),a(j,null,[{key:"register",value:function(){h.default.register(y,!0)}}]);function j(){w(this,j);var S=v(this,(j.__proto__||Object.getPrototypeOf(j)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return S}return j})(m.default);r.FormulaBlot=y,r.default=_}),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.CodeToken=r.CodeBlock=void 0;var a=(function(){function C(P,A){for(var F=0;F<A.length;F++){var I=A[F];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(P,I.key,I)}}return function(P,A,F){return A&&C(P.prototype,A),F&&C(P,F),P}})(),o=function C(P,A,F){P===null&&(P=Function.prototype);var I=Object.getOwnPropertyDescriptor(P,A);if(I===void 0){var R=Object.getPrototypeOf(P);return R===null?void 0:C(R,A,F)}else{if("value"in I)return I.value;var M=I.get;return M===void 0?void 0:M.call(F)}},l=s(0),c=v(l),u=s(5),h=v(u),d=s(9),m=v(d),g=s(13),w=v(g);function v(C){return C&&C.__esModule?C:{default:C}}function b(C,P){if(!(C instanceof P))throw new TypeError("Cannot call a class as a function")}function y(C,P){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:C}function _(C,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);C.prototype=Object.create(P&&P.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(C,P):C.__proto__=P)}var N=(function(C){_(P,C);function P(){return b(this,P),y(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return a(P,[{key:"replaceWith",value:function(F){this.domNode.textContent=this.domNode.textContent,this.attach(),o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replaceWith",this).call(this,F)}},{key:"highlight",value:function(F){var I=this.domNode.textContent;this.cachedText!==I&&((I.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=F(I),this.domNode.normalize(),this.attach()),this.cachedText=I)}}]),P})(w.default);N.className="ql-syntax";var j=new c.default.Attributor.Class("token","hljs",{scope:c.default.Scope.INLINE}),S=(function(C){_(P,C),a(P,null,[{key:"register",value:function(){h.default.register(j,!0),h.default.register(N,!0)}}]);function P(A,F){b(this,P);var I=y(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,A,F));if(typeof I.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var R=null;return I.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(R),R=setTimeout(function(){I.highlight(),R=null},I.options.interval)}),I.highlight(),I}return a(P,[{key:"highlight",value:function(){var F=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var I=this.quill.getSelection();
759this.quill.scroll.descendants(N).forEach(function(R){R.highlight(F.options.highlight)}),this.quill.update(h.default.sources.SILENT),I!=null&&this.quill.setSelection(I,h.default.sources.SILENT)}}}]),P})(m.default);S.DEFAULTS={highlight:(function(){return window.hljs==null?null:function(C){var P=window.hljs.highlightAuto(C);return P.value}})(),interval:1e3},r.CodeBlock=N,r.CodeToken=j,r.default=S}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'}),(function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line>
759 <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'}),(function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'}),(function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'}),(function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'}
vendor: 11,448 bytes, line 759
759),(function(n,r,s){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BubbleTooltip=void 0;var a=function P(A,F,I){A===null&&(A=Function.prototype);var R=Object.getOwnPropertyDescriptor(A,F);if(R===void 0){var M=Object.getPrototypeOf(A);return M===null?void 0:P(M,F,I)}else{if("value"in R)return R.value;var $=R.get;return $===void 0?void 0:$.call(I)}},o=(function(){function P(A,F){for(var I=0;I<F.length;I++){var R=F[I];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(A,R.key,R)}}return function(A,F,I){return F&&P(A.prototype,F),I&&P(A,I),A}})(),l=s(3),c=b(l),u=s(8),h=b(u),d=s(43),m=b(d),g=s(15),w=s(41),v=b(w);function b(P){return P&&P.__esModule?P:{default:P}}function y(P,A){if(!(P instanceof A))throw new TypeError("Cannot call a class as a function")}function _(P,A){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:P}function N(P,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);P.prototype=Object.create(A&&A.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(P,A):P.__proto__=A)}var j=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],S=(function(P){N(A,P);function A(F,I){y(this,A),I.modules.toolbar!=null&&I.modules.toolbar.container==null&&(I.modules.toolbar.container=j);var R=_(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,F,I));return R.quill.container.classList.add("ql-bubble"),R}return o(A,[{key:"extendToolbar",value:function(I){this.tooltip=new C(this.quill,this.options.bounds),this.tooltip.root.appendChild(I.container),this.buildButtons([].slice.call(I.container.querySelectorAll("button")),v.default),this.buildPickers([].slice.call(I.container.querySelectorAll("select")),v.default)}}]),A})(m.default);S.DEFAULTS=(0,c.default)(!0,{},m.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(A){A?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var C=(function(P){N(A,P);function A(F,I){y(this,A);var R=_(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,F,I));return R.quill.on(h.default.events.EDITOR_CHANGE,function(M,$,B,U){if(M===h.default.events.SELECTION_CHANGE)if($!=null&&$.length>0&&U===h.default.sources.USER){R.show(),R.root.style.left="0px",R.root.style.width="",R.root.style.width=R.root.offsetWidth+"px";var G=R.quill.getLines($.index,$.length);if(G.length===1)R.position(R.quill.getBounds($));else{var Z=G[G.length-1],X=R.quill.getIndex(Z),V=Math.min(Z.length()-1,$.index+$.length-X),z=R.quill.getBounds(new g.Range(X,V));R.position(z)}}else document.activeElement!==R.textbox&&R.quill.hasFocus()&&R.hide()}),R}return o(A,[{key:"listen",value:function(){var I=this;a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){I.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!I.root.classList.contains("ql-hidden")){var R=I.quill.getSelection();R!=null&&I.position(I.quill.getBounds(R))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(I){var R=a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"position",this).call(this,I),M=this.root.querySelector(".ql-tooltip-arrow");if(M.style.marginLeft="",R===0)return R;M.style.marginLeft=-1*R-M.offsetWidth/2+"px"}}]),A})(d.BaseTooltip);C.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),r.BubbleTooltip=C,r.default=S}),(function(n,r,s){n.exports=s(63)})]).default})})(Q1)),Q1.exports}var Oo,JL;function Qye(){if(JL)return Oo;JL=1;var e=Oo&&Oo.__extends||(function(){var h=function(d,m){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,w){g.__proto__=w}||function(g,w){for(var v in w)w.hasOwnProperty(v)&&(g[v]=w[v])},h(d,m)};return function(d,m){h(d,m);function g(){this.constructor=d}d.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}})(),t=Oo&&Oo.__assign||function(){return t=Object.assign||function(h){for(var d,m=1,g=arguments.length;m<g;m++){d=arguments[m];for(var w in d)Object.prototype.hasOwnProperty.call(d,w)&&(h[w]=d[w])}return h},t.apply(this,arguments)},n=Oo&&Oo.__spreadArrays||function(){for(var h=0,d=0,m=arguments.length;d<m;d++)h+=arguments[d].length;for(var g=Array(h),w=0,d=0;d<m;d++)for(var v=arguments[d],b=0,y=v.length;b<y;b++,w++)g[w]=v[b];return g},r=Oo&&Oo.__importDefault||function(h){return h&&h.__esModule?h:{default:h}},s=r(Uy()),a=r($T()),o=r(gH()),l=r(Gye()),c=(function(h){e(d,h);function d(m){var g=h.call(this,m)||this;g.dirtyProps=["modules","formats","bounds","theme","children"],g.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],g.state={generation:0},g.selection=null,g.onEditorChange=function(v,b,y,_){var N,j,S,C;v==="text-change"?(j=(N=g).onEditorChangeText)===null||j===void 0||j.call(N,g.editor.root.innerHTML,b,_,g.unprivilegedEditor):v==="selection-change"&&((C=(S=g).onEditorChangeSelection)===null||C===void 0||C.call(S,b,_,g.unprivilegedEditor))};var w=g.isControlled()?m.value:m.defaultValue;return g.value=w??"",g}return d.prototype.validateProps=function(m){var g;if(s.default.Children.count(m.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(s.default.Children.count(m.children)){var w=s.default.Children.only(m.children);if(((g=w)===null||g===void 0?void 0:g.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&m.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")},d.prototype.shouldComponentUpdate=function(m,g){var w=this,v;if(this.validateProps(m),!this.editor||this.state.generation!==g.generation)return!0;if("value"in m){var b=this.getEditorContents(),y=(v=m.value,v??"");this.isEqualValue(y,b)||this.setEditorContents(this.editor,y)}return m.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,m.readOnly),n(this.cleanProps,this.dirtyProps).some(function(_){return!o.default(m[_],w.props[_])})},d.prototype.shouldComponentRegenerate=function(m){var g=this;return this.dirtyProps.some(function(w){return!o.default(m[w],g.props[w])})},d.prototype.componentDidMount=function(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())},d.prototype.componentWillUnmount=function(){this.destroyEditor()},d.prototype.componentDidUpdate=function(m,g){var w=this;if(this.editor&&this.shouldComponentRegenerate(m)){var v=this.editor.getContents(),b=this.editor.getSelection();this.regenerationSnapshot={delta:v,selection:b},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==g.generation){var y=this.regenerationSnapshot,v=y.delta,_=y.selection;delete this.regenerationSnapshot,this.instantiateEditor();var N=this.editor;N.setContents(v),u(function(){return w.setEditorSelection(N,_)})}},d.prototype.instantiateEditor=function(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())},d.prototype.destroyEditor=function(){this.editor&&this.unhookEditor(this.editor)},d.prototype.isControlled=function(){return"value"in this.props},d.prototype.getEditorConfig=function(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,scrollingContainer:this.props.scrollingContainer,tabIndex:this.props.tabIndex,theme:this.props.theme}},d.prototype.getEditor=function(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor},d.prototype.createEditor=function(m,g){var w=new l.default(m,g);return g.tabIndex!=null&&this.setEditorTabIndex(w,g.tabIndex),this.hookEditor(w),w},d.prototype.hookEditor=function(m){this.unprivilegedEditor=this.makeUnprivilegedEditor(m),m.on("editor-change",this.onEditorChange)},d.prototype.unhookEditor=function(m){m.off("editor-change",this.onEditorChange)},d.prototype.getEditorContents=function(){return this.value},d.prototype.getEditorSelection=function(){return this.selection},d.prototype.isDelta=function(m){return m&&m.ops},d.prototype.isEqualValue=function(m,g){return this.isDelta(m)&&this.isDelta(g)?o.default(m.ops,g.ops):o.default(m,g)},d.prototype.setEditorContents=function(m,g){var w=this;this.value=g;var v=this.getEditorSelection();typeof g=="string"?m.setContents(m.clipboard.convert(g)):m.setContents(g),u(function(){return w.setEditorSelection(m,v)})},d.prototype.setEditorSelection=function(m,g){if(this.selection=g,g){var w=m.getLength();g.index=Math.max(0,Math.min(g.index,w-1)),g.length=Math.max(0,Math.min(g.length,w-1-g.index)),m.setSelection(g)}},d.prototype.setEditorTabIndex=function(m,g){var w,v;!((v=(w=m)===null||w===void 0?void 0:w.scroll)===null||v===void 0)&&v.domNode&&(m.scroll.domNode.tabIndex=g)},d.prototype.setEditorReadOnly=function(m,g){g?m.disable():m.enable()},d.prototype.makeUnprivilegedEditor=function(m){var g=m;return{getHTML:function(){return g.root.innerHTML},getLength:g.getLength.bind(g),getText:g.getText.bind(g),getContents:g.getContents.bind(g),getSelection:g.getSelection.bind(g),getBounds:g.getBounds.bind(g)}},d.prototype.getEditingArea=function(){if(!this.editingArea)throw new Error("Instantiating on missing editing area");var m=a.default.findDOMNode(this.editingArea);if(!m)throw new Error("Cannot find element for editing area");if(m.nodeType===3)throw new Error("Editing area cannot be a text node");return m},d.prototype.renderEditingArea=function(){var m=this,g=this.props,w=g.children,v=g.preserveWhitespace,b=this.state.generation,y={key:b,ref:function(_){m.editingArea=_}};return s.default.Children.count(w)?s.default.cloneElement(s.default.Children.only(w),y):v?s.default.createElement("pre",t({},y)):s.default.createElement("div",t({},y))},d.prototype.render=function(){var m;return s.default.createElement("div",{id:this.props.id,style:this.props.style,key:this.state.generation,className:"quill "+(m=this.props.className,m??""),onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())},d.prototype.onEditorChangeText=function(m,g,w,v){var b,y;if(this.editor){var _=this.isDelta(this.value)?v.getContents():v.getHTML();_!==this.getEditorContents()&&(this.lastDeltaChangeSet=g,this.value=_,(y=(b=this.props).onChange)===null||y===void 0||y.call(b,m,g,w,v))}},d.prototype.onEditorChangeSelection=function(m,g,w){var v,b,y,_,N,j;if(this.editor){var S=this.getEditorSelection(),C=!S&&m,P=S&&!m;o.default(m,S)||(this.selection=m,(b=(v=this.props).onChangeSelection)===null||b===void 0||b.call(v,m,g,w),C?(_=(y=this.props).onFocus)===null||_===void 0||_.call(y,m,g,w):P&&((j=(N=this.props).onBlur)===null||j===void 0||j.call(N,S,g,w)))}}
759,d.prototype.focus=function(){this.editor&&this.editor.focus()},d.prototype.blur=function(){this.editor&&(this.selection=null,this.editor.blur())},d.displayName="React Quill",d.Quill=l.default,d.defaultProps={theme:"snow",modules:{},readOnly:!1},d})(s.default.Component);function u(h){Promise.resolve().then(h)}return Oo=c,Oo}var Yye=Qye();const Xye=En(Yye);function Zye(){const[e,t]=O.useState(!1),[n,r]=O.useState(null),[s,a]=O.useState(!1),o=mn(),[l,c]=O.useState({title:"",image_url:"",content:"",publish_date:new Date().toISOString().split("T")[0],is_published:!0}),{data:u=[]}=qe({queryKey:["newsletters"],queryFn:async()=>(await ae.entities.Newsletter.list()).sort((b,y)=>new Date(y.publish_date)-new Date(b.publish_date))}),h=(v=null)=>{v?(r(v),c({title:v.title,image_url:v.image_url||"",content:v.content,publish_date:v.publish_date,is_published:v.is_published})):(r(null),c({title:"",image_url:"",content:"",publish_date:new Date().toISOString().split("T")[0],is_published:!0})),t(!0)},d=()=>{t(!1),r(null),c({title:"",image_url:"",content:"",publish_date:new Date().toISOString().split("T")[0],is_published:!0})},m=async v=>{const b=v.target.files[0];if(b){a(!0);try{const{file_url:y}=await ae.integrations.Core.UploadFile({file:b});c({...l,image_url:y})}catch(y){console.error("Failed to upload image:",y),alert("Failed to upload image. Please try again.")}a(!1)}},g=async()=>{if(!l.title.trim()||!l.content.trim()){alert("Title and content are required");return}try{n?await ae.entities.Newsletter.update(n.id,l):await ae.entities.Newsletter.create(l),o.invalidateQueries(["newsletters"]),d()}catch(v){console.error("Failed to save newsletter:",v),alert("Failed to save newsletter. Please try again.")}},w=async v=>{if(confirm("Are you sure you want to delete this newsletter?"))try{await ae.entities.Newsletter.delete(v),o.invalidateQueries(["newsletters"])}catch(b){console.error("Failed to delete newsletter:",b),alert("Failed to delete newsletter. Please try again.")}};return i.jsxs(i.Fragment,{children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center justify-between",children:[i.jsx("span",{children:"Newsletter Management"}),i.jsxs(ue,{onClick:()=>h(),children:[i.jsx(li,{className:"w-4 h-4 mr-2"}),"New Newsletter"]})]})}),i.jsx(Fe,{children:u.length===0?i.jsx("div",{className:"text-center py-12",children:i.jsx("p",{className:"text-slate-600",children:"No newsletters yet. Create your first one!"})}):i.jsx("div",{className:"space-y-4",children:u.map(v=>i.jsxs("div",{className:"flex items-center gap-4 p-4 bg-slate-50 rounded-lg border",children:[v.image_url&&i.jsx("img",{src:v.image_url,alt:v.title,className:"w-20 h-20 object-cover rounded"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-semibold text-lg",children:v.title}),i.jsxs("p",{className:"text-sm text-slate-600",children:[Ut(new Date(v.publish_date),"MMM d, yyyy"),v.is_published?i.jsx("span",{className:"ml-2 text-green-600 font-semibold",children:"• Published"}):i.jsx("span",{className:"ml-2 text-orange-600 font-semibold",children:"• Draft"})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>h(v),children:i.jsx(qte,{className:"w-4 h-4"})}),i.jsx(ue,{size:"sm",variant:"destructive",onClick:()=>w(v.id),children:i.jsx(ci,{className:"w-4 h-4"})})]})]},v.id))})})]}),i.jsx(rn,{open:e,onOpenChange:v=>!v&&d(),children:i.jsxs(en,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[i.jsx(vn,{children:i.jsx(sn,{children:n?"Edit Newsletter":"New Newsletter"})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"title",children:"Title *"}),i.jsx(Ee,{id:"title",value:l.title,onChange:v=>c({...l,title:v.target.value}),placeholder:"Newsletter title"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"publish-date",children:"Publish Date *"}),i.jsx(Ee,{id:"publish-date",type:"date",value:l.publish_date,onChange:v=>c({...l,publish_date:v.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"image",children:"Header Image (Optional)"}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Ee,{id:"image",type:"file",accept:"image/*",onChange:m,disabled:s}
759),l.image_url&&i.jsx("img",{src:l.image_url,alt:"Preview",className:"h-20 object-contain rounded"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Content *"}),i.jsx(Xye,{value:l.content,onChange:v=>c({...l,content:v}),theme:"snow",className:"bg-white",style:{minHeight:"300px"}})]}),i.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Published"}),i.jsx("p",{className:"text-sm text-slate-600",children:"Make this newsletter visible to the public"})]}),i.jsx(ai,{checked:l.is_published,onCheckedChange:v=>c({...l,is_published:v})})]})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:d,children:"Cancel"}),i.jsx(ue,{onClick:g,children:n?"Update Newsletter":"Create Newsletter"})]})]})})]})}function Jye(){var S;const[e,t]=O.useState(null),[n,r]=O.useState(!1),[s,a]=O.useState(!1),[o,l]=O.useState(""),[c,u]=O.useState(""),[h,d]=O.useState(null),[m,g]=O.useState(""),w=mn(),{data:v=[]}=qe({queryKey:["allCommunityEvents"],queryFn:async()=>(await ae.entities.CommunityEvent.list()).sort((P,A)=>new Date(A.created_date)-new Date(P.created_date))}),{data:b}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{admin_pin:"3190"}}),y=C=>{t(C),g(C.admin_note||""),r(!0)},_=C=>{d(C),a(!0),l(""),u("")},N=async()=>{const C=(b==null?void 0:b.admin_pin)||"3190";if(o!==C){u("Incorrect PIN. Action cancelled.");return}a(!1);try{await ae.entities.CommunityEvent.update(e.id,{status:h,admin_note:m});const P=h==="approved"?"approved":"rejected";await ae.integrations.Core.SendEmail({to:e.submitted_by_email,subject:`Your Event "${e.title}" has been ${P}`,body:`
760          <h2>Event Submission Update</h2>
761          <p>Your community event submission has been ${P}.</p>
762          <p><strong>Event:</strong> ${e.title}</p>
763          ${m?`<p><strong>Admin Note:</strong> ${m}</p>`:""}
764          <p>Thank you for your submission!</p>
765        `}).catch(console.error),w.invalidateQueries(["allCommunityEvents"]),w.invalidateQueries(["communityEvents"]),r(!1),t(null),d(null),g("")}catch(P){console.error("Failed to update event:",P),alert("Failed to update event. Please try again.")}},j=C=>{switch(C){case"approved":return i.jsx(nt,{className:"bg-green-500",children:"Approved"});case"rejected":return i.jsx(nt,{className:"bg-red-500",children:"Rejected"});default:return i.jsx(nt,{className:"bg-orange-500",children:"Pending"})}};return i.jsxs(i.Fragment,{children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsx(at,{children:"Community Event Submissions"})}),i.jsx(Fe,{children:v.length===0?i.jsx("div",{className:"text-center py-12",children:i.jsx("p",{className:"text-slate-600",children:"No community events submitted yet."})}):i.jsx("div",{className:"overflow-x-auto",children:i.jsxs(Qo,{children:[i.jsx(Yo,{children:i.jsxs(tr,{children:[i.jsx(ht,{children:"Title"}),i.jsx(ht,{children:"Date"}),i.jsx(ht,{children:"Submitted By"}),i.jsx(ht,{children:"AI Score"}),i.jsx(ht,{children:"Status"}),i.jsx(ht,{children:"Actions"})]})}),i.jsx(Xo,{children:v.map(C=>i.jsxs(tr,{className:"cursor-pointer hover:bg-slate-50",children:[i.jsx(it,{className:"font-medium",children:C.title}),i.jsx(it,{children:Ut(new Date(C.date_time),"MMM d, yyyy")}),i.jsx(it,{children:i.jsxs("div",{children:[i.jsx("div",{className:"font-medium",children:C.submitted_by_name}),i.jsx("div",{className:"text-sm text-slate-600",children:C.submitted_by_email})]})}),i.jsx(it,{children:C.ai_score!==void 0?i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:`font-bold ${C.ai_score>=90?"text-green-600":C.ai_score>=70?"text-yellow-600":"text-red-600"}`,children:[C.ai_score,"/100"]}),C.ai_flagged&&i.jsx(ba,{className:"w-4 h-4 text-orange-500"})]}):i.jsx("span",{className:"text-slate-400 text-sm",children:"N/A"})}),i.jsx(it,{children:j(C.status)}),i.jsx(it,{children:i.jsxs(ue,{size:"sm",variant:"outline",onClick:()=>y(C),children:[i.jsx(du,{className:"w-4 h-4 mr-2"}),"View"]})})]},C.id))})]})})})]}),i.jsx(rn,{open:n,onOpenChange:r,children:i.jsxs(en,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[i.jsx(vn,{children:i.jsx(sn,{children:"Event Details"})}),e&&i.jsxs("div",{className:"space-y-4 py-4",children:[e.image_url&&i.jsx("img",{src:e.image_url,alt:e.title,className:"w-full h-64 object-cover rounded-lg"}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-2xl font-bold mb-2",children:e.title}),i.jsxs("div",{className:"flex items-center gap-2",children:[j(e.status),e.ai_score!==void 0&&i.jsxs(nt,{variant:"outline",className:`${e.ai_score>=90?"border-green-500 text-green-700":e.ai_score>=70?"border-yellow-500 text-yellow-700":"border-red-500 text-red-700"}`,children:[i.jsx(uB,{className:"w-3 h-3 mr-1"}),"AI: ",e.ai_score,"/100"]})]})]}),e.ai_flagged&&i.jsx("div",{className:`p-4 rounded-lg border ${e.ai_severity==="critical"?"bg-red-50 border-red-200":e.ai_severity==="high"?"bg-orange-50 border-orange-200":"bg-yellow-50 border-yellow-200"}`,children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(ba,{className:`w-5 h-5 mt-0.5 ${e.ai_severity==="critical"?"text-red-600":e.ai_severity==="high"?"text-orange-600":"text-yellow-600"}`}),i.jsxs("div",{className:"flex-1",children:[i.jsxs("h4",{className:"font-bold text-sm mb-1",children:["AI Moderation Alert - ",(S=e.ai_severity)==null?void 0:S.toUpperCase()," Severity"]}),i.jsx("p",{className:"text-sm text-slate-700",children:e.ai_reason}),e.ai_violations&&e.ai_violations.length>0&&i.jsxs("div",{className:"mt-2",children:[i.jsx("p",{className:"text-xs font-semibold",children:"Detected Issues:"}),i.jsx("ul",{className:"list-disc list-inside text-xs text-slate-600",children:e.ai_violations.map((C,P)=>i.jsx("li",{children:C},P))})]}),i.jsxs("p",{className:"text-xs mt-2 font-medium",children:["AI Recommendation: ",i.jsx("span",{className:"uppercase",children:e.ai_recommended_action})]})]})]})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2 text-slate-700",children:[i.jsx(Fn,{className:"w-4 h-4"}),i.jsx("span",{children:Ut(new Date(e.date_time),"MMM d, yyyy • h:mm a")})]}),e.location&&i.jsxs("div",{className:"flex items-center gap-2 text-slate-700",children:[i.jsx(js,{className:"w-4 h-4"}),i.jsx("span",{children:e.location})]})]}),e.description&&i.jsxs("div",{children:[i.jsx(me,{children:"Description"}),i.jsx("p",{className:"text-slate-700 mt-1",children:e.description})]}),e.external_link&&i.jsxs("div",{children:[i.jsx(me,{children:"Exter
765nal Link"}),i.jsxs("a",{href:e.external_link,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-purple-600 hover:text-purple-700 mt-1",children:[i.jsx(ws,{className:"w-4 h-4"}),e.external_link]})]}),i.jsxs("div",{className:"border-t pt-4",children:[i.jsx(me,{children:"Submitted By"}),i.jsxs("div",{className:"mt-1",children:[i.jsx("div",{className:"font-medium",children:e.submitted_by_name}),i.jsx("div",{className:"text-sm text-slate-600",children:e.submitted_by_email})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"admin-note",children:"Admin Note"}),i.jsx(nr,{id:"admin-note",value:m,onChange:C=>g(C.target.value),placeholder:"Optional note about this event...",rows:3})]}),e.status==="pending"&&i.jsxs("div",{className:"flex gap-3 pt-4",children:[i.jsxs(ue,{onClick:()=>_("approved"),className:"flex-1 bg-green-600 hover:bg-green-700",children:[i.jsx(Ch,{className:"w-4 h-4 mr-2"}),"Approve Event"]}),i.jsxs(ue,{onClick:()=>_("rejected"),variant:"destructive",className:"flex-1",children:[i.jsx(ya,{className:"w-4 h-4 mr-2"}),"Reject Event"]})]})]}),i.jsx(Fr,{children:i.jsx(ue,{variant:"outline",onClick:()=>r(!1),children:"Close"})})]})}),i.jsx(rn,{open:s,onOpenChange:a,children:i.jsxs(en,{children:[i.jsx(vn,{children:i.jsx(sn,{children:"Confirm Action"})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("p",{className:"text-slate-700",children:["Please enter your admin PIN to ",h==="approved"?"approve":"reject"," this event."]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"pin",children:"Admin PIN"}),i.jsx(Ee,{id:"pin",type:"password",value:o,onChange:C=>{l(C.target.value),u("")},onKeyDown:C=>{C.key==="Enter"&&N()},placeholder:"****",className:c?"border-red-500":"",autoFocus:!0}),c&&i.jsx("p",{className:"text-sm text-red-600",children:c})]})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),i.jsx(ue,{onClick:N,children:"Confirm"})]})]})})]})}var AE,e6;function fv(){if(e6)return AE;e6=1;var e=fu(),t=hu(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return AE=r,AE}var OE,t6;function yR(){if(t6)return OE;t6=1;var e=Qs(),t=fv(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(a,o){if(e(a))return!1;var l=typeof a;return l=="number"||l=="symbol"||l=="boolean"||a==null||t(a)?!0:r.test(a)||!n.test(a)||o!=null&&a in Object(o)}return OE=s,OE}var TE,n6;function vH(){if(n6)return TE;n6=1;var e=hR(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var a=function(){var o=arguments,l=s?s.apply(this,o):o[0],c=a.cache;if(c.has(l))return c.get(l);var u=r.apply(this,o);return a.cache=c.set(l,u)||c,u};return a.cache=new(n.Cache||e),a}return n.Cache=e,TE=n,TE}var RE,r6;function ebe(){if(r6)return RE;r6=1;var e=vH(),t=500;function n(r){var s=e(r,function(o){return a.size===t&&a.clear(),o}),a=s.cache;return s}return RE=n,RE}var ME,i6;function tbe(){if(i6)return ME;i6=1;var e=ebe(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(t,function(o,l,c,u){a.push(c?u.replace(n,"$1"):l||o)}),a});return ME=r,ME}var IE,s6;function bR(){if(s6)return IE;s6=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,a=Array(s);++r<s;)a[r]=n(t[r],r,t);return a}return IE=e,IE}var DE,a6;function nbe(){if(a6)return DE;a6=1;var e=lb(),t=bR(),n=Qs(),r=fv(),s=e?e.prototype:void 0,a=s?s.toString:void 0;function o(l){if(typeof l=="string")return l;if(n(l))return t(l,o)+"";if(r(l))return a?a.call(l):"";var c=l+"";return c=="0"&&1/l==-1/0?"-0":c}return DE=o,DE}var LE,o6;function xH(){if(o6)return LE;o6=1;var e=nbe();function t(n){return n==null?"":e(n)}return LE=t,LE}var FE,l6;function yH(){if(l6)return FE;l6=1;var e=Qs(),t=yR(),n=tbe(),r=xH();function s(a,o){return e(a)?a:t(a,o)?[a]:n(r(a))}return FE=s,FE}var $E,c6;function xN(){if(c6)return $E;c6=1;var e=fv();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return $E=t,$E}var qE,u6;function wR(){if(u6)return qE;u6=1;var e=yH(),t=xN();function n(r,s){s=e(s,r);for(var a=0,o=s.length;r!=null&&a<o;)r=r[t(s[a++])];return a&&a==o?r:void 0}return qE=n,qE}var zE,d6;function bH(){if(d6)return zE;d6=1;var e=wR();function t(n,r,s){var a=n==null?void 0:e(n,r);return a===void 0?s:a}return zE=t,zE}var rbe=bH();const va=En(rbe);var BE,f6;function ibe(){if(f6)return BE;f6=1;function e(t){return t==null}return BE=e,BE}var sbe=ibe();
vendor: 5,763 bytes, lines 765-773
765const zt=En(sbe);var UE,h6;function abe(){if(h6)return UE;h6=1;var e=fu(),t=Qs(),n=hu(),r="[object String]";function s(a){return typeof a=="string"||!t(a)&&n(a)&&e(a)==r}return UE=s,UE}var obe=abe();const Bh=En(obe);var lbe=dR();const At=En(lbe);var cbe=Hd();const hv=En(cbe);var VE={exports:{}},In={};/**
766 * @license React
767 * react-is.production.min.js
768 *
769 * Copyright (c) Facebook, Inc. and its affiliates.
770 *
771 * This source code is licensed under the MIT license found in the
772 * LICENSE file in the root directory of this source tree.
773 */var m6;function ube(){if(m6)return In;m6=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),w;w=Symbol.for("react.module.reference");function v(b){if(typeof b=="object"&&b!==null){var y=b.$$typeof;switch(y){case e:switch(b=b.type,b){case n:case s:case r:case u:case h:return b;default:switch(b=b&&b.$$typeof,b){case l:case o:case c:case m:case d:case a:return b;default:return y}}case t:return y}}}return In.ContextConsumer=o,In.ContextProvider=a,In.Element=e,In.ForwardRef=c,In.Fragment=n,In.Lazy=m,In.Memo=d,In.Portal=t,In.Profiler=s,In.StrictMode=r,In.Suspense=u,In.SuspenseList=h,In.isAsyncMode=function(){return!1},In.isConcurrentMode=function(){return!1},In.isContextConsumer=function(b){return v(b)===o},In.isContextProvider=function(b){return v(b)===a},In.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},In.isForwardRef=function(b){return v(b)===c},In.isFragment=function(b){return v(b)===n},In.isLazy=function(b){return v(b)===m},In.isMemo=function(b){return v(b)===d},In.isPortal=function(b){return v(b)===t},In.isProfiler=function(b){return v(b)===s},In.isStrictMode=function(b){return v(b)===r},In.isSuspense=function(b){return v(b)===u},In.isSuspenseList=function(b){return v(b)===h},In.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===s||b===r||b===u||b===h||b===g||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===d||b.$$typeof===a||b.$$typeof===o||b.$$typeof===c||b.$$typeof===w||b.getModuleId!==void 0)},In.typeOf=v,In}var p6;function dbe(){return p6||(p6=1,VE.exports=ube()),VE.exports}var fbe=dbe(),WE,g6;function wH(){if(g6)return WE;g6=1;var e=fu(),t=hu(),n="[object Number]";function r(s){return typeof s=="number"||t(s)&&e(s)==n}return WE=r,WE}var HE,v6;function hbe(){if(v6)return HE;v6=1;var e=wH();function t(n){return e(n)&&n!=+n}return HE=t,HE}var mbe=hbe();const mv=En(mbe);var pbe=wH();const gbe=En(pbe);var xs=function(t){return t===0?0:t>0?1:-1},uh=function(t){return Bh(t)&&t.indexOf("%")===t.length-1},et=function(t){return gbe(t)&&!mv(t)},vbe=function(t){return zt(t)},oi=function(t){return et(t)||Bh(t)},xbe=0,tm=function(t){var n=++xbe;return"".concat(t||"").concat(n)},ys=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!et(t)&&!Bh(t))return r;var a;if(uh(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return mv(a)&&(a=r),s&&a>n&&(a=n),a},ud=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},ybe=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},s=0;s<n;s++)if(!r[t[s]])r[t[s]]=!0;else return!0;return!1},yr=function(t,n){return et(t)&&et(n)?function(r){return t+r*(n-t)}:function(){return n}};function _j(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):va(r,t))===n})}var bbe=function(t,n){return et(t)&&et(n)?t-n:Bh(t)&&Bh(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function eg(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function dO(e){"@babel/helpers - typeof";return dO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dO(e)}var wbe=["viewBox","children"],jbe=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRen
773dering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],x6=["points","pathLength"],KE={svg:wbe,polygon:x6,polyline:x6},jR=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDrag
773Capture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Nj=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(O.isValidElement(t)&&(r=t.props),!hv(r))return null;var s={};return Object.keys(r).forEach(function(a){jR.includes(a)&&(s[a]=n||function(o){return r[a](r,o)})}),s},_be=function(t,n,r){return function(s){return t(n,r,s),null}},Uh=function(t,n,r){if(!hv(t)||dO(t)!=="object")return null;var s=null;return Object.keys(t).forEach(function(a){var o=t[a];jR.includes(a)&&typeof o=="function"&&(s||(s={}),s[a]=_be(o,n,r))}),s},Nbe=["children"],Sbe=["children"];function y6(e,t){if(e==null)return{};var n=kbe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kbe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function fO(e){"@babel/helpers - typeof";return fO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fO(e)}var b6={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Xc=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},w6=null,GE=null,_R=function e(t){if(t===w6&&Array.isArray(GE))return GE;var n=[];return O.Children.forEach(t,function(r){zt(r)||(fbe.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),GE=n,w6=t,n};function xa(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return Xc(s)}):r=[Xc(t)],_R(e).forEach(function(s){var a=va(s,"type.displayName")||va(s,"type.name");r.indexOf(a)!==-1&&n.push(s)}),n}function da(e,t){var n=xa(e,t);return n&&n[0]}var j6=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!et(r)||r<=0||!et(s)||s<=0)},Ebe=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Pbe=function(t){return t&&t.type&&Bh(t.type)&&Ebe.indexOf(t.type)>=0},jH=function(t){return t&&fO(t)==="object"&&"clipDot"in t},Cbe=function(t,n,r,s){var a,o=(a=KE==null?void 0:KE[s])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!At(t)&&(s&&o.includes(n)||jbe.includes(n))||r&&jR.includes(n)},wt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(O.isValidElement(t)&&(s=t.props),!hv(s))return null;var a={};
vendor: 4,367 bytes, line 773
773return Object.keys(s).forEach(function(o){var l;Cbe((l=s)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=s[o])}),a},hO=function e(t,n){if(t===n)return!0;var r=O.Children.count(t);if(r!==O.Children.count(n))return!1;if(r===0)return!0;if(r===1)return _6(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var s=0;s<r;s++){var a=t[s],o=n[s];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!_6(a,o))return!1}return!0},_6=function(t,n){if(zt(t)&&zt(n))return!0;if(!zt(t)&&!zt(n)){var r=t.props||{},s=r.children,a=y6(r,Nbe),o=n.props||{},l=o.children,c=y6(o,Sbe);return s&&l?eg(a,c)&&hO(s,l):!s&&!l?eg(a,c):!1}return!1},N6=function(t,n){var r=[],s={};return _R(t).forEach(function(a,o){if(Pbe(a))r.push(a);else if(a){var l=Xc(a.type),c=n[l]||{},u=c.handler,h=c.once;if(u&&(!h||!s[l])){var d=u(a,l,o);r.push(d),s[l]=!0}}}),r},Abe=function(t){var n=t&&t.type;return n&&b6[n]?b6[n]:null},Obe=function(t,n){return _R(n).indexOf(t)},Tbe=["children","width","height","viewBox","className","style","title","desc"];function mO(){return mO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mO.apply(this,arguments)}function Rbe(e,t){if(e==null)return{};var n=Mbe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Mbe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function pO(e){var t=e.children,n=e.width,r=e.height,s=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,u=Rbe(e,Tbe),h=s||{width:n,height:r,x:0,y:0},d=Tt("recharts-surface",a);return se.createElement("svg",mO({},wt(u,!0,"svg"),{className:d,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),se.createElement("title",null,l),se.createElement("desc",null,c),t)}var Ibe=["children","className"];function gO(){return gO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gO.apply(this,arguments)}function Dbe(e,t){if(e==null)return{};var n=Lbe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lbe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var dn=se.forwardRef(function(e,t){var n=e.children,r=e.className,s=Dbe(e,Ibe),a=Tt("recharts-layer",r);return se.createElement("g",gO({className:a},wt(s,!0),{ref:t}),n)}),Bo=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a<r;a++)s[a-2]=arguments[a]},QE,S6;function Fbe(){if(S6)return QE;S6=1;function e(t,n,r){var s=-1,a=t.length;n<0&&(n=-n>a?0:a+n),r=r>a?a:r,r<0&&(r+=a),a=n>r?0:r-n>>>0,n>>>=0;for(var o=Array(a);++s<a;)o[s]=t[s+n];return o}return QE=e,QE}var YE,k6;function $be(){if(k6)return YE;k6=1;var e=Fbe();function t(n,r,s){var a=n.length;return s=s===void 0?a:s,!r&&s>=a?n:e(n,r,s)}return YE=t,YE}var XE,E6;function _H(){if(E6)return XE;E6=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,a="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+e+s+a+"]");function c(u){return l.test(u)}return XE=c,XE}var ZE,P6;function qbe(){if(P6)return ZE;P6=1;function e(t){return t.split("")}return ZE=e,ZE}var JE,C6;function zbe(){if(C6)return JE;C6=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,a="\\ufe0e\\ufe0f",o="["+e+"]",l="["+s+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+l+"|"+c+")",h="[^"+e+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",w=u+"?",v="["+a+"]?",b="(?:"+g+"(?:"+[h,d,m].join("|")+")"+v+w+")*",y=v+w+b,_="(?:"+[h+l+"?",l,d,m,o].join("|")+")",N=RegExp(c+"(?="+c+")|"+_+y,"g");function j(S){return S.match(N)||[]}return JE=j,JE}var eP,A6;function Bbe(){if(A6)return eP;A6=1;var e=qbe(),t=_H(),n=zbe();function r(s){return t(s)?n(s):e(s)}return eP=r,eP}var tP,O6;
vendor: 5,866 bytes, line 773
773function Ube(){if(O6)return tP;O6=1;var e=$be(),t=_H(),n=Bbe(),r=xH();function s(a){return function(o){o=r(o);var l=t(o)?n(o):void 0,c=l?l[0]:o.charAt(0),u=l?e(l,1).join(""):o.slice(1);return c[a]()+u}}return tP=s,tP}var nP,T6;function Vbe(){if(T6)return nP;T6=1;var e=Ube(),t=e("toUpperCase");return nP=t,nP}var Wbe=Vbe();const yN=En(Wbe);function er(e){return function(){return e}}const NH=Math.cos,Sj=Math.sin,Jo=Math.sqrt,kj=Math.PI,bN=2*kj,vO=Math.PI,xO=2*vO,ih=1e-6,Hbe=xO-ih;function SH(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Kbe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return SH;const n=10**t;return function(r){this._+=r[0];for(let s=1,a=r.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}class Gbe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?SH:Kbe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,s){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+s}`}bezierCurveTo(t,n,r,s,a,o){this._append`C${+t},${+n},${+r},${+s},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,s,a){if(t=+t,n=+n,r=+r,s=+s,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=r-t,u=s-n,h=o-t,d=l-n,m=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(m>ih)if(!(Math.abs(d*c-u*h)>ih)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,w=s-l,v=c*c+u*u,b=g*g+w*w,y=Math.sqrt(v),_=Math.sqrt(m),N=a*Math.tan((vO-Math.acos((v+m-b)/(2*y*_)))/2),j=N/_,S=N/y;Math.abs(j-1)>ih&&this._append`L${t+j*h},${n+j*d}`,this._append`A${a},${a},0,0,${+(d*g>h*w)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,s,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(s),c=r*Math.sin(s),u=t+l,h=n+c,d=1^o,m=o?s-a:a-s;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>ih||Math.abs(this._y1-h)>ih)&&this._append`L${u},${h}`,r&&(m<0&&(m=m%xO+xO),m>Hbe?this._append`A${r},${r},0,1,${d},${t-l},${n-c}A${r},${r},0,1,${d},${this._x1=u},${this._y1=h}`:m>ih&&this._append`A${r},${r},0,${+(m>=vO)},${d},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function NR(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Gbe(t)}function SR(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function kH(e){this._context=e}kH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function wN(e){return new kH(e)}function EH(e){return e[0]}function PH(e){return e[1]}function CH(e,t){var n=er(!0),r=null,s=wN,a=null,o=NR(l);e=typeof e=="function"?e:e===void 0?EH:er(e),t=typeof t=="function"?t:t===void 0?PH:er(t);function l(c){var u,h=(c=SR(c)).length,d,m=!1,g;for(r==null&&(a=s(g=o())),u=0;u<=h;++u)!(u<h&&n(d=c[u],u,c))===m&&((m=!m)?a.lineStart():a.lineEnd()),m&&a.point(+e(d,u,c),+t(d,u,c));if(g)return a=null,g+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:er(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:er(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:er(!!c),l):n},l.curve=function(c){return arguments.length?(s=c,r!=null&&(a=s(r)),l):s},l.context=function(c){return arguments.length?(c==null?r=a=null:a=s(r=c),l):r},l}function v1(e,t,n){var r=null,s=er(!0),a=null,o=wN,l=null,c=NR(u);e=typeof e=="function"?e:e===void 0?EH:er(+e),t=typeof t=="function"?t:er(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?PH:er(+n);function u(d){var m,g,w,v=(d=SR(d)).length,b,y=!1,_,N=new Array(v),j=new Array(v);for(a==null&&(l=o(_=c())),m=0;m<=v;++m){if(!(m<v&&s(b=d[m],m,d))===y)if(y=!y)g=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),w=m-1;w>=g;--w)l.point(N[w],j[w]);l.lineEnd(),l.areaEnd()}y&&(N[m]=+e(b,m,d),j[m]=+t(b,m,d),l.point(r?+r(b,m,d):N[m],n?+n(b,m,d):j[m]))}if(_)return l=null,_+""||null}function h(){return CH().defined(s).curve(o).context(a)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:er(+d),r=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:er(+d),u):e},u.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:er(+d),u):r},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:er(+d),n=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:er(+d),u):t},u.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:er(+d),u):n},u.lineX0=u.lineY0=function(){return h().x(e).y(t)},u.lineY1=function(){return h().x(e).y(n)},u.lineX1=function(){return h().x(r).y(t)},u.defined=function(d){return arguments.length?(s=typeof d=="function"?d:er(!!d),u):s},u.curve=function(d){return arguments.length?(o=d,a!=null&&(l=o(a)),u):o},u.context=function(d){return arguments.length?(d==null?a=l=null:l=o(a=d),u):a},u}class AH{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}
vendor: 8,443 bytes, line 773
773point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Qbe(e){return new AH(e,!0)}function Ybe(e){return new AH(e,!1)}const kR={draw(e,t){const n=Jo(t/kj);e.moveTo(n,0),e.arc(0,0,n,0,bN)}},Xbe={draw(e,t){const n=Jo(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},OH=Jo(1/3),Zbe=OH*2,Jbe={draw(e,t){const n=Jo(t/Zbe),r=n*OH;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ewe={draw(e,t){const n=Jo(t),r=-n/2;e.rect(r,r,n,n)}},twe=.8908130915292852,TH=Sj(kj/10)/Sj(7*kj/10),nwe=Sj(bN/10)*TH,rwe=-NH(bN/10)*TH,iwe={draw(e,t){const n=Jo(t*twe),r=nwe*n,s=rwe*n;e.moveTo(0,-n),e.lineTo(r,s);for(let a=1;a<5;++a){const o=bN*a/5,l=NH(o),c=Sj(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*s,c*r+l*s)}e.closePath()}},rP=Jo(3),swe={draw(e,t){const n=-Jo(t/(rP*3));e.moveTo(0,n*2),e.lineTo(-rP*n,-n),e.lineTo(rP*n,-n),e.closePath()}},Ua=-.5,Va=Jo(3)/2,yO=1/Jo(12),awe=(yO/2+1)*3,owe={draw(e,t){const n=Jo(t/awe),r=n/2,s=n*yO,a=r,o=n*yO+n,l=-a,c=o;e.moveTo(r,s),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(Ua*r-Va*s,Va*r+Ua*s),e.lineTo(Ua*a-Va*o,Va*a+Ua*o),e.lineTo(Ua*l-Va*c,Va*l+Ua*c),e.lineTo(Ua*r+Va*s,Ua*s-Va*r),e.lineTo(Ua*a+Va*o,Ua*o-Va*a),e.lineTo(Ua*l+Va*c,Ua*c-Va*l),e.closePath()}};function lwe(e,t){let n=null,r=NR(s);e=typeof e=="function"?e:er(e||kR),t=typeof t=="function"?t:er(t===void 0?64:+t);function s(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return s.type=function(a){return arguments.length?(e=typeof a=="function"?a:er(a),s):e},s.size=function(a){return arguments.length?(t=typeof a=="function"?a:er(+a),s):t},s.context=function(a){return arguments.length?(n=a??null,s):n},s}function Ej(){}function Pj(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function RH(e){this._context=e}RH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Pj(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Pj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cwe(e){return new RH(e)}function MH(e){this._context=e}MH.prototype={areaStart:Ej,areaEnd:Ej,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Pj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uwe(e){return new MH(e)}function IH(e){this._context=e}IH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Pj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dwe(e){return new IH(e)}function DH(e){this._context=e}DH.prototype={areaStart:Ej,areaEnd:Ej,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function fwe(e){return new DH(e)}function R6(e){return e<0?-1:1}function M6(e,t,n){var r=e._x1-e._x0,s=t-e._x1,a=(e._y1-e._y0)/(r||s<0&&-0),o=(n-e._y1)/(s||r<0&&-0),l=(a*s+o*r)/(r+s);return(R6(a)+R6(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function I6(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function iP(e,t,n){var r=e._x0,s=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,s+l*t,a-l,o-l*n,a,o)}function Cj(e){this._context=e}Cj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:iP(this,this._t0,I6(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,iP(this,I6(this,n=M6(this,e,t)),n);break;default:iP(this,this._t0,n=M6(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function LH(e){this._context=new FH(e)}(LH.prototype=Object.create(Cj.prototype)).point=function(e,t){Cj.prototype.point.call(this,t,e)};function FH(e){this._context=e}FH.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,s,a){this._context.bezierCurveTo(t,e,r,n,a,s)}};function hwe(e){return new Cj(e)}function mwe(e){return new LH(e)}function $H(e){this._context=e}$H.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=D6(e),s=D6(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],s[0][a],r[1][a],s[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function D6(e){var t,n=e.length-1,r,s=new Array(n),a=new Array(n),o=new Array(n);for(s[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)s[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=s[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(s[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)s[t]=(o[t]-s[t+1])/a[t];for(a[n-1]=(e[n]+s[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-s[t+1];return[s,a]}function pwe(e){return new $H(e)}function jN(e,t){this._context=e,this._t=t}jN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 54,890 bytes, lines 773-783
773default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function gwe(e){return new jN(e,.5)}function vwe(e){return new jN(e,0)}function xwe(e){return new jN(e,1)}function Sg(e,t){if((o=e.length)>1)for(var n=1,r,s,a=e[t[0]],o,l=a.length;n<o;++n)for(s=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(s[r][1])?s[r][0]:s[r][1]}function bO(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function ywe(e,t){return e[t]}function bwe(e){const t=[];return t.key=e,t}function wwe(){var e=er([]),t=bO,n=Sg,r=ywe;function s(a){var o=Array.from(e.apply(this,arguments),bwe),l,c=o.length,u=-1,h;for(const d of a)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(d,o[l].key,u,a)]).data=d;for(l=0,h=SR(t(o));l<c;++l)o[h[l]].index=l;return n(o,h),o}return s.keys=function(a){return arguments.length?(e=typeof a=="function"?a:er(Array.from(a)),s):e},s.value=function(a){return arguments.length?(r=typeof a=="function"?a:er(+a),s):r},s.order=function(a){return arguments.length?(t=a==null?bO:typeof a=="function"?a:er(Array.from(a)),s):t},s.offset=function(a){return arguments.length?(n=a??Sg,s):n},s}function jwe(e,t){if((r=e.length)>0){for(var n,r,s=0,a=e[0].length,o;s<a;++s){for(o=n=0;n<r;++n)o+=e[n][s][1]||0;if(o)for(n=0;n<r;++n)e[n][s][1]/=o}Sg(e,t)}}function _we(e,t){if((s=e.length)>0){for(var n=0,r=e[t[0]],s,a=r.length;n<a;++n){for(var o=0,l=0;o<s;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}Sg(e,t)}}function Nwe(e,t){if(!(!((o=e.length)>0)||!((a=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,a,o;r<a;++r){for(var l=0,c=0,u=0;l<o;++l){for(var h=e[t[l]],d=h[r][1]||0,m=h[r-1][1]||0,g=(d-m)/2,w=0;w<l;++w){var v=e[t[w]],b=v[r][1]||0,y=v[r-1][1]||0;g+=b-y}c+=d,u+=g*d}s[r-1][1]+=s[r-1][0]=n,c&&(n-=u/c)}s[r-1][1]+=s[r-1][0]=n,Sg(e,t)}}function ty(e){"@babel/helpers - typeof";return ty=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ty(e)}var Swe=["type","size","sizeType"];function wO(){return wO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wO.apply(this,arguments)}function L6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function F6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L6(Object(n),!0).forEach(function(r){kwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L6(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kwe(e,t,n){return t=Ewe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ewe(e){var t=Pwe(e,"string");return ty(t)=="symbol"?t:t+""}function Pwe(e,t){if(ty(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ty(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cwe(e,t){if(e==null)return{};var n=Awe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Awe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var qH={symbolCircle:kR,symbolCross:Xbe,symbolDiamond:Jbe,symbolSquare:ewe,symbolStar:iwe,symbolTriangle:swe,symbolWye:owe},Owe=Math.PI/180,Twe=function(t){var n="symbol".concat(yN(t));return qH[n]||kR},Rwe=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var s=18*Owe;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Mwe=function(t,n){qH["symbol".concat(yN(t))]=n},ER=function(t){var n=t.type,r=n===void 0?"circle":n,s=t.size,a=s===void 0?64:s,o=t.sizeType,l=o===void 0?"area":o,c=Cwe(t,Swe),u=F6(F6({},c),{},{type:r,size:a,sizeType:l}),h=function(){var b=Twe(r),y=lwe().type(b).size(Rwe(a,l,r));return y()},d=u.className,m=u.cx,g=u.cy,w=wt(u,!0);return m===+m&&g===+g&&a===+a?se.createElement("path",wO({},w,{className:Tt("recharts-symbols",d),transform:"translate(".concat(m,", ").concat(g,")"),d:h()})):null};ER.registerSymbol=Mwe;function kg(e){"@babel/helpers - typeof";return kg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kg(e)}function jO(){return jO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jO.apply(this,arguments)}function $6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Iwe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$6(Object(n),!0).forEach(function(r){ny(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$6(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lwe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,BH(r.key),r)}}function Fwe(e,t,n){return t&&Lwe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $we(e,t,n){return t=Aj(t),qwe(e,zH()?Reflect.construct(t,n||[],Aj(e).constructor):t.apply(e,n))}function qwe(e,t){if(t&&(kg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zwe(e)}function zwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zH=function(){return!!e})()}function Aj(e){return Aj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Aj(e)}function Bwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_O(e,t)}function _O(e,t){return _O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},_O(e,t)}function ny(e,t,n){return t=BH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BH(e){var t=Uwe(e,"string");return kg(t)=="symbol"?t:t+""}function Uwe(e,t){if(kg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(kg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Wa=32,PR=(function(e){function t(){return Dwe(this,t),$we(this,t,arguments)}return Bwe(t,e),Fwe(t,[{key:"renderIcon",value:function(r){var s=this.props.inactiveColor,a=Wa/2,o=Wa/6,l=Wa/3,c=r.inactive?s:r.color;if(r.type==="plainline")return se.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:Wa,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return se.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,`
774            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(a,`
775            H`).concat(Wa,"M").concat(2*l,",").concat(a,`
776            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return se.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Wa/8,"h").concat(Wa,"v").concat(Wa*3/4,"h").concat(-Wa,"z"),className:"recharts-legend-icon"});if(se.isValidElement(r.legendIcon)){var u=Iwe({},r);return delete u.legendIcon,se.cloneElement(r.legendIcon,u)}return se.createElement(ER,{fill:c,cx:a,cy:a,size:Wa,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,s=this.props,a=s.payload,o=s.iconSize,l=s.layout,c=s.formatter,u=s.inactiveColor,h={x:0,y:0,width:Wa,height:Wa},d={display:l==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(g,w){var v=g.formatter||c,b=Tt(ny(ny({"recharts-legend-item":!0},"legend-item-".concat(w),!0),"inactive",g.inactive));if(g.type==="none")return null;var y=At(g.value)?null:g.value;Bo(!At(g.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var _=g.inactive?u:g.color;return se.createElement("li",jO({className:b,style:d,key:"legend-item-".concat(w)},Uh(r.props,g,w)),se.createElement(pO,{width:o,height:o,viewBox:h,style:m},r.renderIcon(g)),se.createElement("span",{className:"recharts-legend-item-text",style:{color:_}},v?v(y,g,w):y))})}},{key:"render",value:function(){var r=this.props,s=r.payload,a=r.layout,o=r.align;if(!s||!s.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return se.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])})(O.PureComponent);ny(PR,"displayName","Legend");ny(PR,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var sP,q6;function Vwe(){if(q6)return sP;q6=1;var e=sH(),t=xR(),n=1,r=2;function s(a,o,l,c){var u=l.length,h=u,d=!c;if(a==null)return!h;for(a=Object(a);u--;){var m=l[u];if(d&&m[2]?m[1]!==a[m[0]]:!(m[0]in a))return!1}for(;++u<h;){m=l[u];var g=m[0],w=a[g],v=m[1];if(d&&m[2]){if(w===void 0&&!(g in a))return!1}else{var b=new e;if(c)var y=c(w,v,g,a,o,b);if(!(y===void 0?t(v,w,n|r,c,b):y))return!1}}return!0}return sP=s,sP}var aP,z6;function UH(){if(z6)return aP;z6=1;var e=Hd();function t(n){return n===n&&!e(n)}return aP=t,aP}var oP,B6;function Wwe(){if(B6)return oP;B6=1;var e=UH(),t=vN();function n(r){for(var s=t(r),a=s.length;a--;){var o=s[a],l=r[o];s[a]=[o,l,e(l)]}return s}return oP=n,oP}var lP,U6;function VH(){if(U6)return lP;U6=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return lP=e,lP}var cP,V6;function Hwe(){if(V6)return cP;V6=1;var e=Vwe(),t=Wwe(),n=VH();function r(s){var a=t(s);return a.length==1&&a[0][2]?n(a[0][0],a[0][1]):function(o){return o===s||e(o,s,a)}}return cP=r,cP}var uP,W6;function Kwe(){if(W6)return uP;W6=1;function e(t,n){return t!=null&&n in Object(t)}return uP=e,uP}var dP,H6;function Gwe(){if(H6)return dP;H6=1;var e=yH(),t=pR(),n=Qs(),r=gR(),s=vR(),a=xN();function o(l,c,u){c=e(c,l);for(var h=-1,d=c.length,m=!1;++h<d;){var g=a(c[h]);if(!(m=l!=null&&u(l,g)))break;l=l[g]}return m||++h!=d?m:(d=l==null?0:l.length,!!d&&s(d)&&r(g,d)&&(n(l)||t(l)))}return dP=o,dP}var fP,K6;function Qwe(){if(K6)return fP;K6=1;var e=Kwe(),t=Gwe();function n(r,s){return r!=null&&t(r,s,e)}return fP=n,fP}var hP,G6;function Ywe(){if(G6)return hP;G6=1;var e=xR(),t=bH(),n=Qwe(),r=yR(),s=UH(),a=VH(),o=xN(),l=1,c=2;function u(h,d){return r(h)&&s(d)?a(o(h),d):function(m){var g=t(m,h);return g===void 0&&g===d?n(m,h):e(d,g,l|c)}}return hP=u,hP}var mP,Q6;function pv(){if(Q6)return mP;Q6=1;function e(t){return t}return mP=e,mP}var pP,Y6;function Xwe(){if(Y6)return pP;Y6=1;function e(t){return function(n){return n==null?void 0:n[t]}}return pP=e,pP}var gP,X6;function Zwe(){if(X6)return gP;X6=1;var e=wR();function t(n){return function(r){return e(r,n)}}return gP=t,gP}var vP,Z6;function Jwe(){if(Z6)return vP;Z6=1;var e=Xwe(),t=Zwe(),n=yR(),r=xN();function s(a){return n(a)?e(r(a)):t(a)}return vP=s,vP}var xP,J6;function Zl(){if(J6)return xP;J6=1;var e=Hwe(),t=Ywe(),n=pv(),r=Qs(),s=Jwe();function a(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):s(o)}return xP=a,xP}var yP,eF;function WH(){if(eF)return yP;eF=1;function e(t,n,r,s){for(var a=t.length,o=r+(s?1:-1);s?o--:++o<a;)if(n(t[o],o,t))return o;return-1}return yP=e,yP}var bP,tF;function e1e(){if(tF)return bP;tF=1;function e(t){return t!==t}return bP=e,bP}var wP,nF;function t1e(){if(nF)return wP;nF=1;function e(t,n,r){for(var s=r-1,a=t.length;++s<a;)if(t[s]===n)return s;return-1}return wP=e,wP}var jP,rF;function n1e(){if(rF)return jP;rF=1;var e=WH(),t=e1e(),n=t1e();function r(s,a,o){return a===a?n(s,a,o):e(s,t,o)}return jP=r,jP}var _P,iF;function r1e(){if(iF)return _P;iF=1;var e=n1e();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return _P=t,_P}var NP,sF;function i1e(){if(sF)return NP;sF=1;function e(t,n,r){for(var s=-1,a=t==null?0:t.length;++s<a;)if(r(n,t[s]))return!0;return!1}return NP=e,NP}var SP,aF;function s1e(){if(aF)return SP;aF=1;function e(){}return SP=e,SP}var kP,oF;function a1e(){if(oF)return kP;oF=1;var e=pH(),t=s1e(),n=mR(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(a){return new e(a)}:t;return kP=s,kP}var EP,lF;function o1e(){if(lF)return EP;lF=1;var e=aH(),t=r1e(),n=i1e(),r=lH(),s=a1e(),a=mR(),o=200;function l(c,u,h){var d=-1,m=t,g=c.length,w=!0,v=[],b=v;if(h)w=!1,m=n;else if(g>=o){var y=u?null:s(c);if(y)return a(y);w=!1,m=r,b=new e}else b=u?[]:v;e:for(;++d<g;){var _=c[d],N=u?u(_):_;if(_=h||_!==0?_:0,w&&N===N){for(var j=b.length;j--;)if(b[j]===N)continue e;u&&b.push(N),v.push(_)}else m(b,N,h)||(b!==v&&b.push(N),v.push(_))}return v}return EP=l,EP}var PP,cF;function l1e(){if(cF)return PP;cF=1;var e=Zl(),t=o1e();function n(r,s){return r&&r.length?t(r,e(s,2)):[]}return PP=n,PP}var c1e=l1e();const uF=En(c1e);function HH(e,t,n){return t===!0?uF(e,n):At(t)?uF(e,t):e}function Eg(e){"@babel/helpers - typeof";return Eg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eg(e)}var u1e=["ref"];function dF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Tc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dF(Object(n),!0).forEach(function(r){_N(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function d1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fF(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,GH(r.key),r)}}function f1e(e,t,n){return t&&fF(e.prototype,t),n&&fF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function h1e(e,t,n){return t=Oj(t),m1e(e,KH()?Reflect.construct(t,n||[],Oj(e).constructor):t.apply(e,n))}function m1e(e,t){if(t&&(Eg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p1e(e)}function p1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KH=function(){return!!e})()}function Oj(e){return Oj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Oj(e)}function g1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NO(e,t)}function NO(e,t){return NO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},NO(e,t)}function _N(e,t,n){return t=GH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GH(e){var t=v1e(e,"string");return Eg(t)=="symbol"?t:t+""}function v1e(e,t){if(Eg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Eg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function x1e(e,t){if(e==null)return{};var n=y1e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function y1e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function b1e(e){return e.value}function w1e(e,t){if(se.isValidElement(e))return se.cloneElement(e,t);if(typeof e=="function")return se.createElement(e,t);t.ref;var n=x1e(t,u1e);return se.createElement(PR,n)}var hF=1,Od=(function(e){function t(){var n;d1e(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=h1e(this,t,[].concat(s)),_N(n,"lastBoundingBox",{width:-1,height:-1}),n}return g1e(t,e),f1e(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,s=this.getBBox();s?(Math.abs(s.width-this.lastBoundingBox.width)>hF||Math.abs(s.height-this.lastBoundingBox.height)>hF)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,r&&r(s)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Tc({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var s=this.props,a=s.layout,o=s.align,l=s.verticalAlign,c=s.margin,u=s.chartWidth,h=s.chartHeight,d,m;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var g=this.getBBoxSnapshot();d={left:((u||0)-g.width)/2}}else d=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var w=this.getBBoxSnapshot();m={top:((h||0)-w.height)/2}}else m=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Tc(Tc({},d),m)}},{key:"render",value:function(){var r=this,s=this.props,a=s.content,o=s.width,l=s.height,c=s.wrapperStyle,u=s.payloadUniqBy,h=s.payload,d=Tc(Tc({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return se.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(g){r.wrapperNode=g}},w1e(a,Tc(Tc({},this.props),{},{payload:HH(h,u,b1e)})))}}],[{key:"getWithHeight",value:function(r,s){var a=Tc(Tc({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&et(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||s}:null}}])})(O.PureComponent);_N(Od,"displayName","Legend");_N(Od,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var CP,mF;function j1e(){if(mF)return CP;mF=1;var e=lb(),t=pR(),n=Qs(),r=e?e.isConcatSpreadable:void 0;function s(a){return n(a)||t(a)||!!(r&&a&&a[r])}return CP=s,CP}var AP,pF;function QH(){if(pF)return AP;pF=1;var e=uH(),t=j1e();function n(r,s,a,o,l){var c=-1,u=r.length;for(a||(a=t),l||(l=[]);++c<u;){var h=r[c];s>0&&a(h)?s>1?n(h,s-1,a,o,l):e(l,h):o||(l[l.length]=h)}return l}return AP=n,AP}var OP,gF;function _1e(){if(gF)return OP;gF=1;function e(t){return function(n,r,s){for(var a=-1,o=Object(n),l=s(n),c=l.length;c--;){var u=l[t?c:++a];if(r(o[u],u,o)===!1)break}return n}}return OP=e,OP}var TP,vF;function N1e(){if(vF)return TP;vF=1;var e=_1e(),t=e();return TP=t,TP}var RP,xF;function YH(){if(xF)return RP;xF=1;var e=N1e(),t=vN();function n(r,s){return r&&e(r,s,t)}return RP=n,RP}var MP,yF;function S1e(){if(yF)return MP;yF=1;var e=cb();function t(n,r){return function(s,a){if(s==null)return s;if(!e(s))return n(s,a);for(var o=s.length,l=r?o:-1,c=Object(s);(r?l--:++l<o)&&a(c[l],l,c)!==!1;);return s}}return MP=t,MP}var IP,bF;function CR(){if(bF)return IP;bF=1;var e=YH(),t=S1e(),n=t(e);return IP=n,IP}var DP,wF;function XH(){if(wF)return DP;wF=1;var e=CR(),t=cb();function n(r,s){var a=-1,o=t(r)?Array(r.length):[];return e(r,function(l,c,u){o[++a]=s(l,c,u)}),o}return DP=n,DP}var LP,jF;function k1e(){if(jF)return LP;jF=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return LP=e,LP}var FP,_F;function E1e(){if(_F)return FP;_F=1;var e=fv();function t(n,r){if(n!==r){var s=n!==void 0,a=n===null,o=n===n,l=e(n),c=r!==void 0,u=r===null,h=r===r,d=e(r);if(!u&&!d&&!l&&n>r||l&&c&&h&&!u&&!d||a&&c&&h||!s&&h||!o)return 1;if(!a&&!l&&!d&&n<r||d&&s&&o&&!a&&!l||u&&s&&o||!c&&o||!h)return-1}return 0}return FP=t,FP}var $P,NF;function P1e(){if(NF)return $P;NF=1;var e=E1e();function t(n,r,s){for(var a=-1,o=n.criteria,l=r.criteria,c=o.length,u=s.length;++a<c;){var h=e(o[a],l[a]);if(h){if(a>=u)return h;var d=s[a];return h*(d=="desc"?-1:1)}}return n.index-r.index}return $P=t,$P}var qP,SF;function C1e(){if(SF)return qP;SF=1;var e=bR(),t=wR(),n=Zl(),r=XH(),s=k1e(),a=fH(),o=P1e(),l=pv(),c=Qs();function u(h,d,m){d.length?d=e(d,function(v){return c(v)?function(b){return t(b,v.length===1?v[0]:v)}:v}):d=[l];var g=-1;d=e(d,a(n));var w=r(h,function(v,b,y){var _=e(d,function(N){return N(v)});return{criteria:_,index:++g,value:v}});return s(w,function(v,b){return o(v,b,m)})}return qP=u,qP}var zP,kF;function A1e(){if(kF)return zP;kF=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return zP=e,zP}var BP,EF;function O1e(){if(EF)return BP;EF=1;var e=A1e(),t=Math.max;function n(r,s,a){return s=t(s===void 0?r.length-1:s,0),function(){for(var o=arguments,l=-1,c=t(o.length-s,0),u=Array(c);++l<c;)u[l]=o[s+l];l=-1;for(var h=Array(s+1);++l<s;)h[l]=o[l];return h[s]=a(u),e(r,this,h)}}return BP=n,BP}var UP,PF;function T1e(){if(PF)return UP;PF=1;function e(t){return function(){return t}}return UP=e,UP}var VP,CF;function ZH(){if(CF)return VP;CF=1;var e=em(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return VP=t,VP}var WP,AF;function R1e(){if(AF)return WP;AF=1;var e=T1e(),t=ZH(),n=pv(),r=t?function(s,a){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:n;return WP=r,WP}var HP,OF;function M1e(){if(OF)return HP;OF=1;var e=800,t=16,n=Date.now;function r(s){var a=0,o=0;return function(){var l=n(),c=t-(l-o);if(o=l,c>0){if(++a>=e)return arguments[0]}else a=0;return s.apply(void 0,arguments)}}return HP=r,HP}var KP,TF;function I1e(){if(TF)return KP;TF=1;var e=R1e(),t=M1e(),n=t(e);return KP=n,KP}var GP,RF;function D1e(){if(RF)return GP;RF=1;var e=pv(),t=O1e(),n=I1e();function r(s,a){return n(t(s,a,e),s+"")}return GP=r,GP}var QP,MF;function NN(){if(MF)return QP;MF=1;var e=uR(),t=cb(),n=gR(),r=Hd();function s(a,o,l){if(!r(l))return!1;var c=typeof o;return(c=="number"?t(l)&&n(o,l.length):c=="string"&&o in l)?e(l[o],a):!1}return QP=s,QP}var YP,IF;function L1e(){if(IF)return YP;IF=1;var e=QH(),t=C1e(),n=D1e(),r=NN(),s=n(function(a,o){if(a==null)return[];var l=o.length;return l>1&&r(a,o[0],o[1])?o=[]:l>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return YP=s,YP}var F1e=L1e();const AR=En(F1e);function ry(e){"@babel/helpers - typeof";return ry=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ry(e)}function SO(){return SO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SO.apply(this,arguments)}function $1e(e,t){return U1e(e)||B1e(e,t)||z1e(e,t)||q1e()}function q1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
777In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z1e(e,t){if(e){if(typeof e=="string")return DF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DF(e,t)}}function DF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function B1e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function U1e(e){if(Array.isArray(e))return e}function LF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function XP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LF(Object(n),!0).forEach(function(r){V1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V1e(e,t,n){return t=W1e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W1e(e){var t=H1e(e,"string");return ry(t)=="symbol"?t:t+""}function H1e(e,t){if(ry(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ry(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K1e(e){return Array.isArray(e)&&oi(e[0])&&oi(e[1])?e.join(" ~ "):e}var G1e=function(t){var n=t.separator,r=n===void 0?" : ":n,s=t.contentStyle,a=s===void 0?{}:s,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,h=t.payload,d=t.formatter,m=t.itemSorter,g=t.wrapperClassName,w=t.labelClassName,v=t.label,b=t.labelFormatter,y=t.accessibilityLayer,_=y===void 0?!1:y,N=function(){if(h&&h.length){var M={padding:0,margin:0},$=(m?AR(h,m):h).map(function(B,U){if(B.type==="none")return null;var G=XP({display:"block",paddingTop:4,paddingBottom:4,color:B.color||"#000"},l),Z=B.formatter||d||K1e,X=B.value,V=B.name,z=X,L=V;if(Z&&z!=null&&L!=null){var W=Z(X,V,B,U,h);if(Array.isArray(W)){var Q=$1e(W,2);z=Q[0],L=Q[1]}else z=W}return se.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(U),style:G},oi(L)?se.createElement("span",{className:"recharts-tooltip-item-name"},L):null,oi(L)?se.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,se.createElement("span",{className:"recharts-tooltip-item-value"},z),se.createElement("span",{className:"recharts-tooltip-item-unit"},B.unit||""))});return se.createElement("ul",{className:"recharts-tooltip-item-list",style:M},$)}return null},j=XP({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),S=XP({margin:0},u),C=!zt(v),P=C?v:"",A=Tt("recharts-default-tooltip",g),F=Tt("recharts-tooltip-label",w);C&&b&&h!==void 0&&h!==null&&(P=b(v,h));var I=_?{role:"status","aria-live":"assertive"}:{};return se.createElement("div",SO({className:A,style:j},I),se.createElement("p",{className:F,style:S},se.isValidElement(P)?P:"".concat(P)),N())};function iy(e){"@babel/helpers - typeof";return iy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iy(e)}function x1(e,t,n){return t=Q1e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q1e(e){var t=Y1e(e,"string");return iy(t)=="symbol"?t:t+""}function Y1e(e,t){if(iy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(iy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var r0="recharts-tooltip-wrapper",X1e={visibility:"hidden"};function Z1e(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Tt(r0,x1(x1(x1(x1({},"".concat(r0,"-right"),et(n)&&t&&et(t.x)&&n>=t.x),"".concat(r0,"-left"),et(n)&&t&&et(t.x)&&n<t.x),"".concat(r0,"-bottom"),et(r)&&t&&et(t.y)&&r>=t.y),"".concat(r0,"-top"),et(r)&&t&&et(t.y)&&r<t.y))}function FF(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,s=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&et(a[r]))return a[r];var h=n[r]-l-s,d=n[r]+s;if(t[r])return o[r]?h:d;if(o[r]){var m=h,g=c[r];return m<g?Math.max(d,c[r]):Math.max(h,c[r])}var w=d+l,v=c[r]+u;return w>v?Math.max(h,c[r]):Math.max(d,c[r])}function J1e(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function eje(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,s=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,h,d;return o.height>0&&o.width>0&&n?(h=FF({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=FF({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=J1e({translateX:h,translateY:d,useTranslate3d:l})):u=X1e,{cssProperties:u,cssClasses:Z1e({translateX:h,translateY:d,coordinate:n})}}function Pg(e){"@babel/helpers - typeof";return Pg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pg(e)}function $F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function qF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$F(Object(n),!0).forEach(function(r){EO(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$F(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nje(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eK(r.key),r)}}function rje(e,t,n){return t&&nje(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ije(e,t,n){return t=Tj(t),sje(e,JH()?Reflect.construct(t,n||[],Tj(e).constructor):t.apply(e,n))}function sje(e,t){if(t&&(Pg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aje(e)}function aje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JH=function(){return!!e})()}function Tj(e){return Tj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Tj(e)}function oje(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kO(e,t)}function kO(e,t){return kO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},kO(e,t)}function EO(e,t,n){return t=eK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eK(e){var t=lje(e,"string");return Pg(t)=="symbol"?t:t+""}function lje(e,t){if(Pg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var zF=1,cje=(function(e){function t(){var n;tje(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=ije(this,t,[].concat(s)),EO(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),EO(n,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,h;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(h=n.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&u!==void 0?u:0}})}}),n}return oje(t,e),rje(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>zF||Math.abs(r.height-this.state.lastBoundingBox.height)>zF)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.children,h=s.coordinate,d=s.hasPayload,m=s.isAnimationActive,g=s.offset,w=s.position,v=s.reverseDirection,b=s.useTranslate3d,y=s.viewBox,_=s.wrapperStyle,N=eje({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:g,position:w,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:y}),j=N.cssClasses,S=N.cssProperties,C=qF(qF({transition:m&&a?"transform ".concat(l,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&d?"visible":"hidden",position:"absolute",top:0,left:0},_);return se.createElement("div",{tabIndex:-1,className:j,style:C,ref:function(A){r.wrapperNode=A}},u)}}])})(O.PureComponent),uje=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},mu={isSsr:uje()};function Cg(e){"@babel/helpers - typeof";return Cg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cg(e)}function BF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function UF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BF(Object(n),!0).forEach(function(r){OR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fje(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nK(r.key),r)}}function hje(e,t,n){return t&&fje(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function mje(e,t,n){return t=Rj(t),pje(e,tK()?Reflect.construct(t,n||[],Rj(e).constructor):t.apply(e,n))}function pje(e,t){if(t&&(Cg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gje(e)}function gje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tK=function(){return!!e})()}function Rj(e){return Rj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Rj(e)}function vje(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&PO(e,t)}function PO(e,t){return PO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},PO(e,t)}function OR(e,t,n){return t=nK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nK(e){var t=xje(e,"string");return Cg(t)=="symbol"?t:t+""}function xje(e,t){if(Cg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function yje(e){return e.dataKey}function bje(e,t){return se.isValidElement(e)?se.cloneElement(e,t):typeof e=="function"?se.createElement(e,t):se.createElement(G1e,t)}var _i=(function(e){function t(){return dje(this,t),mje(this,t,arguments)}return vje(t,e),hje(t,[{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.content,h=s.coordinate,d=s.filterNull,m=s.isAnimationActive,g=s.offset,w=s.payload,v=s.payloadUniqBy,b=s.position,y=s.reverseDirection,_=s.useTranslate3d,N=s.viewBox,j=s.wrapperStyle,S=w??[];d&&S.length&&(S=HH(w.filter(function(P){return P.value!=null&&(P.hide!==!0||r.props.includeHidden)}),v,yje));var C=S.length>0;return se.createElement(cje,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:m,active:a,coordinate:h,hasPayload:C,offset:g,position:b,reverseDirection:y,useTranslate3d:_,viewBox:N,wrapperStyle:j},bje(u,UF(UF({},this.props),{},{payload:S})))}}])})(O.PureComponent);OR(_i,"displayName","Tooltip");OR(_i,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!mu.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var ZP,VF;function wje(){if(VF)return ZP;VF=1;var e=Xl(),t=function(){return e.Date.now()};return ZP=t,ZP}var JP,WF;function jje(){if(WF)return JP;WF=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return JP=t,JP}var eC,HF;function _je(){if(HF)return eC;HF=1;var e=jje(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return eC=n,eC}var tC,KF;function rK(){if(KF)return tC;KF=1;var e=_je(),t=Hd(),n=fv(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function c(u){if(typeof u=="number")return u;if(n(u))return r;if(t(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=t(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=e(u);var d=a.test(u);return d||o.test(u)?l(u.slice(2),d?2:8):s.test(u)?r:+u}return tC=c,tC}var nC,GF;function Nje(){if(GF)return nC;GF=1;var e=Hd(),t=wje(),n=rK(),r="Expected a function",s=Math.max,a=Math.min;function o(l,c,u){var h,d,m,g,w,v,b=0,y=!1,_=!1,N=!0;if(typeof l!="function")throw new TypeError(r);c=n(c)||0,e(u)&&(y=!!u.leading,_="maxWait"in u,m=_?s(n(u.maxWait)||0,c):m,N="trailing"in u?!!u.trailing:N);function j($){var B=h,U=d;return h=d=void 0,b=$,g=l.apply(U,B),g}function S($){return b=$,w=setTimeout(A,c),y?j($):g}function C($){var B=$-v,U=$-b,G=c-B;return _?a(G,m-U):G}function P($){var B=$-v,U=$-b;return v===void 0||B>=c||B<0||_&&U>=m}function A(){var $=t();if(P($))return F($);w=setTimeout(A,C($))}function F($){return w=void 0,N&&h?j($):(h=d=void 0,g)}function I(){w!==void 0&&clearTimeout(w),b=0,h=v=d=w=void 0}function R(){return w===void 0?g:F(t())}function M(){var $=t(),B=P($);if(h=arguments,d=this,v=$,B){if(w===void 0)return S(v);if(_)return clearTimeout(w),w=setTimeout(A,c),j(v)}return w===void 0&&(w=setTimeout(A,c)),g}return M.cancel=I,M.flush=R,M}return nC=o,nC}var rC,QF;function Sje(){if(QF)return rC;QF=1;var e=Nje(),t=Hd(),n="Expected a function";function r(s,a,o){var l=!0,c=!0;if(typeof s!="function")throw new TypeError(n);return t(o)&&(l="leading"in o?!!o.leading:l,c="trailing"in o?!!o.trailing:c),e(s,a,{leading:l,maxWait:a,trailing:c})}return rC=r,rC}var kje=Sje();const iK=En(kje);function sy(e){"@babel/helpers - typeof";return sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sy(e)}function YF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function y1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YF(Object(n),!0).forEach(function(r){Eje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eje(e,t,n){return t=Pje(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pje(e){var t=Cje(e,"string");return sy(t)=="symbol"?t:t+""}function Cje(e,t){if(sy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Aje(e,t){return Mje(e)||Rje(e,t)||Tje(e,t)||Oje()}function Oje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
778In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tje(e,t){if(e){if(typeof e=="string")return XF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XF(e,t)}}function XF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rje(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function Mje(e){if(Array.isArray(e))return e}var Uc=O.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,s=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?"100%":a,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,h=u===void 0?0:u,d=e.minHeight,m=e.maxHeight,g=e.children,w=e.debounce,v=w===void 0?0:w,b=e.id,y=e.className,_=e.onResize,N=e.style,j=N===void 0?{}:N,S=O.useRef(null),C=O.useRef();C.current=_,O.useImperativeHandle(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),S.current},configurable:!0})});var P=O.useState({containerWidth:s.width,containerHeight:s.height}),A=Aje(P,2),F=A[0],I=A[1],R=O.useCallback(function($,B){I(function(U){var G=Math.round($),Z=Math.round(B);return U.containerWidth===G&&U.containerHeight===Z?U:{containerWidth:G,containerHeight:Z}})},[]);O.useEffect(function(){var $=function(V){var z,L=V[0].contentRect,W=L.width,Q=L.height;R(W,Q),(z=C.current)===null||z===void 0||z.call(C,W,Q)};v>0&&($=iK($,v,{trailing:!0,leading:!1}));var B=new ResizeObserver($),U=S.current.getBoundingClientRect(),G=U.width,Z=U.height;return R(G,Z),B.observe(S.current),function(){B.disconnect()}},[R,v]);var M=O.useMemo(function(){var $=F.containerWidth,B=F.containerHeight;if($<0||B<0)return null;Bo(uh(o)||uh(c),`The width(%s) and height(%s) are both fixed numbers,
779       maybe you don't need to use a ResponsiveContainer.`,o,c),Bo(!n||n>0,"The aspect(%s) must be greater than zero.",n);var U=uh(o)?$:o,G=uh(c)?B:c;n&&n>0&&(U?G=U/n:G&&(U=G*n),m&&G>m&&(G=m)),Bo(U>0||G>0,`The width(%s) and height(%s) of chart should be greater than 0,
780       please check the style of container, or the props width(%s) and height(%s),
781       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
782       height and width.`,U,G,o,c,h,d,n);var Z=!Array.isArray(g)&&Xc(g.type).endsWith("Chart");return se.Children.map(g,function(X){return se.isValidElement(X)?O.cloneElement(X,y1({width:U,height:G},Z?{style:y1({height:"100%",width:"100%",maxHeight:G,maxWidth:U},X.props.style)}:{})):X})},[n,g,c,m,d,h,F,o]);return se.createElement("div",{id:b?"".concat(b):void 0,className:Tt("recharts-responsive-container",y),style:y1(y1({},j),{},{width:o,height:c,minWidth:h,minHeight:d,maxHeight:m}),ref:S},M)}),SN=function(t){return null};SN.displayName="Cell";function ay(e){"@babel/helpers - typeof";return ay=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ay(e)}function ZF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function CO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZF(Object(n),!0).forEach(function(r){Ije(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ije(e,t,n){return t=Dje(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dje(e){var t=Lje(e,"string");return ay(t)=="symbol"?t:t+""}function Lje(e,t){if(ay(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ay(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mp={widthCache:{},cacheCount:0},Fje=2e3,$je={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},JF="recharts_measurement_span";function qje(e){var t=CO({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var O0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||mu.isSsr)return{width:0,height:0};var r=qje(n),s=JSON.stringify({text:t,copyStyle:r});if(Mp.widthCache[s])return Mp.widthCache[s];try{var a=document.getElementById(JF);a||(a=document.createElement("span"),a.setAttribute("id",JF),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=CO(CO({},$je),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return Mp.widthCache[s]=c,++Mp.cacheCount>Fje&&(Mp.cacheCount=0,Mp.widthCache={}),c}catch{return{width:0,height:0}}},zje=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function oy(e){"@babel/helpers - typeof";return oy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oy(e)}function Mj(e,t){return Wje(e)||Vje(e,t)||Uje(e,t)||Bje()}function Bje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
783In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uje(e,t){if(e){if(typeof e=="string")return e$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e$(e,t)}}function e$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vje(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function Wje(e){if(Array.isArray(e))return e}function Hje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t$(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gje(r.key),r)}}function Kje(e,t,n){return t&&t$(e.prototype,t),n&&t$(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gje(e){var t=Qje(e,"string");return oy(t)=="symbol"?t:t+""}function Qje(e,t){if(oy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var n$=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,r$=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Yje=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Xje=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,sK={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Zje=Object.keys(sK),Kp="NaN";function Jje(e,t){return e*sK[t]}var b1=(function(){function e(t,n){Hje(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!Yje.test(n)&&(this.num=NaN,this.unit=""),Zje.includes(n)&&(this.num=Jje(t,n),this.unit="px")}return Kje(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,s=(r=Xje.exec(n))!==null&&r!==void 0?r:[],a=Mj(s,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])})();function aK(e){if(e.includes(Kp))return Kp;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=n$.exec(t))!==null&&n!==void 0?n:[],s=Mj(r,4),a=s[1],o=s[2],l=s[3],c=b1.parse(a??""),u=b1.parse(l??""),h=o==="*"?c.multiply(u):c.divide(u);if(h.isNaN())return Kp;t=t.replace(n$,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,m=(d=r$.exec(t))!==null&&d!==void 0?d:[],g=Mj(m,4),w=g[1],v=g[2],b=g[3],y=b1.parse(w??""),_=b1.parse(b??""),N=v==="+"?y.add(_):y.subtract(_);if(N.isNaN())return Kp;t=t.replace(r$,N.toString())}return t}var i$=/\(([^()]*)\)/;function e_e(e){for(var t=e;t.includes("(");){var n=i$.exec(t),r=Mj(n,2),s=r[1];t=t.replace(i$,aK(s))}return t}function t_e(e){var t=e.replace(/\s+/g,"");return t=e_e(t),t=aK(t),t}function n_e(e){try{return t_e(e)}catch{return Kp}}function iC(e){var t=n_e(e.slice(5,-1));return t===Kp?"":t}var r_e=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],i_e=["dx","dy","angle","className","breakAll"];function AO(){return AO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AO.apply(this,arguments)}function s$(e,t){if(e==null)return{};var n=s_e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function s_e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function a$(e,t){return c_e(e)||l_e(e,t)||o_e(e,t)||a_e()}
783function a_e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
784In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o_e(e,t){if(e){if(typeof e=="string")return o$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o$(e,t)}}function o$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l_e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function c_e(e){if(Array.isArray(e))return e}var oK=/[ \f\n\r\t\v\u2028\u2029]+/,lK=function(t){var n=t.children,r=t.breakAll,s=t.style;try{var a=[];zt(n)||(r?a=n.toString().split(""):a=n.toString().split(oK));var o=a.map(function(c){return{word:c,width:O0(c,s).width}}),l=r?0:O0(" ",s).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},u_e=function(t,n,r,s,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,h=et(o),d=l,m=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(G,Z){var X=Z.word,V=Z.width,z=G[G.length-1];if(z&&(s==null||a||z.width+V+r<Number(s)))z.words.push(X),z.width+=V+r;else{var L={words:[X],width:V};G.push(L)}return G},[])},g=m(n),w=function(U){return U.reduce(function(G,Z){return G.width>Z.width?G:Z})};if(!h)return g;for(var v="…",b=function(U){var G=d.slice(0,U),Z=lK({breakAll:u,style:c,children:G+v}).wordsWithComputedWidth,X=m(Z),V=X.length>o||w(X).width>Number(s);return[V,X]},y=0,_=d.length-1,N=0,j;y<=_&&N<=d.length-1;){var S=Math.floor((y+_)/2),C=S-1,P=b(C),A=a$(P,2),F=A[0],I=A[1],R=b(S),M=a$(R,1),$=M[0];if(!F&&!$&&(y=S+1),F&&$&&(_=S-1),!F&&$){j=I;break}N++}return j||g},l$=function(t){var n=zt(t)?[]:t.toString().split(oK);return[{words:n}]},d_e=function(t){var n=t.width,r=t.scaleToFit,s=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!mu.isSsr){var c,u,h=lK({breakAll:o,children:s,style:a});if(h){var d=h.wordsWithComputedWidth,m=h.spaceWidth;c=d,u=m}else return l$(s);return u_e({breakAll:o,children:s,maxLines:l,style:a},c,u,n,r)}return l$(s)},c$="#808080",Vh=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,h=t.scaleToFit,d=h===void 0?!1:h,m=t.textAnchor,g=m===void 0?"start":m,w=t.verticalAnchor,v=w===void 0?"end":w,b=t.fill,y=b===void 0?c$:b,_=s$(t,r_e),N=O.useMemo(function(){return d_e({breakAll:_.breakAll,children:_.children,maxLines:_.maxLines,scaleToFit:d,style:_.style,width:_.width})},[_.breakAll,_.children,_.maxLines,d,_.style,_.width]),j=_.dx,S=_.dy,C=_.angle,P=_.className,A=_.breakAll,F=s$(_,i_e);if(!oi(r)||!oi(a))return null;var I=r+(et(j)?j:0),R=a+(et(S)?S:0),M;switch(v){case"start":M=iC("calc(".concat(u,")"));break;case"middle":M=iC("calc(".concat((N.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:M=iC("calc(".concat(N.length-1," * -").concat(l,")"));break}var $=[];if(d){var B=N[0].width,U=_.width;$.push("scale(".concat((et(U)?U/B:1)/B,")"))}return C&&$.push("rotate(".concat(C,", ").concat(I,", ").concat(R,")")),$.length&&(F.transform=$.join(" ")),se.createElement("text",AO({},wt(F,!0),{x:I,y:R,className:Tt("recharts-text",P),textAnchor:g,fill:y.includes("url")?c$:y}),N.map(function(G,Z){var X=G.words.join(A?"":" ");return se.createElement("tspan",{x:I,dy:Z===0?M:l,key:"".concat(X,"-").concat(Z)},X)}))};function Td(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function f_e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function TR(e){let t,n,r;e.length!==2?(t=Td,n=(l,c)=>Td(e(l),c),r=(l,c)=>e(l)-c):(t=e===Td||e===f_e?e:h_e,n=e,r=e);function s(l,c,u=0,h=l.length){if(u<h){if(t(c,c)!==0)return h;do{const d=u+h>>>1;n(l[d],c)<0?u=d+1:h=d}while(u<h)}return u}function a(l,c,u=0,h=l.length){if(u<h){if(t(c,c)!==0)return h;do{const d=u+h>>>1;n(l[d],c)<=0?u=d+1:h=d}while(u<h)}return u}function o(l,c,u=0,h=l.length){const d=s(l,c,u,h-1);return d>u&&r(l[d-1],c)>-r(l[d],c)?d-1:d}return{left:s,center:o,right:a}}function h_e(){return 0}function cK(e){return e===null?NaN:+e}function*m_e(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const p_e=TR(Td),ub=p_e.right;TR(cK).center;class u$ extends Map{constructor(t,n=x_e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(d$(this,t))}has(t){return super.has(d$(this,t))}set(t,n){return super.set(g_e(this,t),n)}delete(t){return super.delete(v_e(this,t))}}function d$({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function g_e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function v_e({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function x_e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function y_e(e=Td){if(e===Td)return uK;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function uK(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const b_e=Math.sqrt(50),w_e=Math.sqrt(10),j_e=Math.sqrt(2);function Ij(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),a=r/Math.pow(10,s),o=a>=b_e?10:a>=w_e?5:a>=j_e?2:1;let l,c,u;return s<0?(u=Math.pow(10,-s)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,s)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?Ij(e,t,n*2):[l,c,u]}function OO(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[s,a,o]=r?Ij(t,e,n):Ij(e,t,n);if(!(a>=s))return[];const l=a-s+1,c=new Array(l);if(r)if(o<0)for(let u=0;u<l;++u)c[u]=(a-u)/-o;else for(let u=0;u<l;++u)c[u]=(a-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(s+u)/-o;else for(let u=0;u<l;++u)c[u]=(s+u)*o;return c}function TO(e,t,n){return t=+t,e=+e,n=+n,Ij(e,t,n)[2]}function RO(e,t,n){t=+t,e=+e,n=+n;const r=t<e,s=r?TO(t,e,n):TO(e,t,n);return(r?-1:1)*(s<0?1/-s:s)}function f$(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function h$(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function dK(e,t,n=0,r=1/0,s){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(s=s===void 0?uK:y_e(s);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,h=Math.log(c),d=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*d*(c-d)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*d/c+m)),w=Math.min(r,Math.floor(t+(c-u)*d/c+m));dK(e,t,g,w,s)}const a=e[t];let o=n,l=r;
784for(i0(e,n,t),s(e[r],a)>0&&i0(e,n,r);o<l;){for(i0(e,o,l),++o,--l;s(e[o],a)<0;)++o;for(;s(e[l],a)>0;)--l}s(e[n],a)===0?i0(e,n,l):(++l,i0(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function i0(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function __e(e,t,n){if(e=Float64Array.from(m_e(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return h$(e);if(t>=1)return f$(e);var r,s=(r-1)*t,a=Math.floor(s),o=f$(dK(e,a).subarray(0,a+1)),l=h$(e.subarray(a+1));return o+(l-o)*(s-a)}}function N_e(e,t,n=cK){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,a=Math.floor(s),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(s-a)}}function S_e(e,t,n){e=+e,t=+t,n=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+n;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(s);++r<s;)a[r]=e+r*n;return a}function uo(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function pu(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const MO=Symbol("implicit");function RR(){var e=new u$,t=[],n=[],r=MO;function s(a){let o=e.get(a);if(o===void 0){if(r!==MO)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return s.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new u$;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(a){return arguments.length?(n=Array.from(a),s):n.slice()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return RR(t,n).unknown(r)},uo.apply(s,arguments),s}function ly(){var e=RR().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,a,o,l=!1,c=0,u=0,h=.5;delete e.unknown;function d(){var m=t().length,g=s<r,w=g?s:r,v=g?r:s;a=(v-w)/Math.max(1,m-c+u*2),l&&(a=Math.floor(a)),w+=(v-w-a*(m-c))*h,o=a*(1-c),l&&(w=Math.round(w),o=Math.round(o));var b=S_e(m).map(function(y){return w+a*y});return n(g?b.reverse():b)}return e.domain=function(m){return arguments.length?(t(m),d()):t()},e.range=function(m){return arguments.length?([r,s]=m,r=+r,s=+s,d()):[r,s]},e.rangeRound=function(m){return[r,s]=m,r=+r,s=+s,l=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(m){return arguments.length?(l=!!m,d()):l},e.padding=function(m){return arguments.length?(c=Math.min(1,u=+m),d()):c},e.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),d()):c},e.paddingOuter=function(m){return arguments.length?(u=+m,d()):u},e.align=function(m){return arguments.length?(h=Math.max(0,Math.min(1,m)),d()):h},e.copy=function(){return ly(t(),[r,s]).round(l).paddingInner(c).paddingOuter(u).align(h)},uo.apply(d(),arguments)}function fK(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return fK(t())},e}function T0(){return fK(ly.apply(null,arguments).paddingInner(1))}function MR(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hK(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function db(){}var cy=.7,Dj=1/cy,tg="\\s*([+-]?\\d+)\\s*",uy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",k_e=/^#([0-9a-f]{3,8})$/,E_e=new RegExp(`^rgb\\(${tg},${tg},${tg}\\)$`),P_e=new RegExp(`^rgb\\(${Bl},${Bl},${Bl}\\)$`),C_e=new RegExp(`^rgba\\(${tg},${tg},${tg},${uy}\\)$`),A_e=new RegExp(`^rgba\\(${Bl},${Bl},${Bl},${uy}\\)$`),O_e=new RegExp(`^hsl\\(${uy},${Bl},${Bl}\\)$`),T_e=new RegExp(`^hsla\\(${uy},${Bl},${Bl},${uy}\\)$`),m$={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};MR(db,dy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:p$,formatHex:p$,formatHex8:R_e,formatHsl:M_e,formatRgb:g$,toString:g$});function p$(){return this.rgb().formatHex()}
vendor: 5,707 bytes, line 784
784function R_e(){return this.rgb().formatHex8()}function M_e(){return mK(this).formatHsl()}function g$(){return this.rgb().formatRgb()}function dy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=k_e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?v$(t):n===3?new Hs(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?w1(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?w1(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=E_e.exec(e))?new Hs(t[1],t[2],t[3],1):(t=P_e.exec(e))?new Hs(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=C_e.exec(e))?w1(t[1],t[2],t[3],t[4]):(t=A_e.exec(e))?w1(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=O_e.exec(e))?b$(t[1],t[2]/100,t[3]/100,1):(t=T_e.exec(e))?b$(t[1],t[2]/100,t[3]/100,t[4]):m$.hasOwnProperty(e)?v$(m$[e]):e==="transparent"?new Hs(NaN,NaN,NaN,0):null}function v$(e){return new Hs(e>>16&255,e>>8&255,e&255,1)}function w1(e,t,n,r){return r<=0&&(e=t=n=NaN),new Hs(e,t,n,r)}function I_e(e){return e instanceof db||(e=dy(e)),e?(e=e.rgb(),new Hs(e.r,e.g,e.b,e.opacity)):new Hs}function IO(e,t,n,r){return arguments.length===1?I_e(e):new Hs(e,t,n,r??1)}function Hs(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}MR(Hs,IO,hK(db,{brighter(e){return e=e==null?Dj:Math.pow(Dj,e),new Hs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?cy:Math.pow(cy,e),new Hs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Hs(kh(this.r),kh(this.g),kh(this.b),Lj(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:x$,formatHex:x$,formatHex8:D_e,formatRgb:y$,toString:y$}));function x$(){return`#${dh(this.r)}${dh(this.g)}${dh(this.b)}`}function D_e(){return`#${dh(this.r)}${dh(this.g)}${dh(this.b)}${dh((isNaN(this.opacity)?1:this.opacity)*255)}`}function y$(){const e=Lj(this.opacity);return`${e===1?"rgb(":"rgba("}${kh(this.r)}, ${kh(this.g)}, ${kh(this.b)}${e===1?")":`, ${e})`}`}function Lj(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function kh(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dh(e){return e=kh(e),(e<16?"0":"")+e.toString(16)}function b$(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new qo(e,t,n,r)}function mK(e){if(e instanceof qo)return new qo(e.h,e.s,e.l,e.opacity);if(e instanceof db||(e=dy(e)),!e)return new qo;if(e instanceof qo)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-s,c=(a+s)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+s:2-a-s,o*=60):l=c>0&&c<1?0:o,new qo(o,l,c,e.opacity)}function L_e(e,t,n,r){return arguments.length===1?mK(e):new qo(e,t,n,r??1)}function qo(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}MR(qo,L_e,hK(db,{brighter(e){return e=e==null?Dj:Math.pow(Dj,e),new qo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cy:Math.pow(cy,e),new qo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new Hs(sC(e>=240?e-240:e+120,s,r),sC(e,s,r),sC(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new qo(w$(this.h),j1(this.s),j1(this.l),Lj(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Lj(this.opacity);return`${e===1?"hsl(":"hsla("}${w$(this.h)}, ${j1(this.s)*100}%, ${j1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function w$(e){return e=(e||0)%360,e<0?e+360:e}function j1(e){return Math.max(0,Math.min(1,e||0))}function sC(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const IR=e=>()=>e;function F_e(e,t){return function(n){return e+n*t}}function $_e(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function q_e(e){return(e=+e)==1?pK:function(t,n){return n-t?$_e(t,n,e):IR(isNaN(t)?n:t)}}function pK(e,t){var n=t-e;return n?F_e(e,n):IR(isNaN(e)?t:e)}const j$=(function e(t){var n=q_e(t);function r(s,a){var o=n((s=IO(s)).r,(a=IO(a)).r),l=n(s.g,a.g),c=n(s.b,a.b),u=pK(s.opacity,a.opacity);return function(h){return s.r=o(h),s.g=l(h),s.b=c(h),s.opacity=u(h),s+""}}return r.gamma=e,r})(1);function z_e(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(a){for(s=0;s<n;++s)r[s]=e[s]*(1-a)+t[s]*a;return r}}function B_e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function U_e(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)s[o]=gv(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=s[o](l);return a}}function V_e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Fj(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function W_e(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=gv(e[s],t[s]):r[s]=t[s];return function(a){for(s in n)r[s]=n[s](a);return r}}var DO=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,aC=new RegExp(DO.source,"g");function H_e(e){return function(){return e}}function K_e(e){return function(t){return e(t)+""}}function G_e(e,t){var n=DO.lastIndex=aC.lastIndex=0,r,s,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=DO.exec(e))&&(s=aC.exec(t));)(a=s.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:Fj(r,s)})),n=aC.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?K_e(c[0].x):H_e(t):(t=c.length,function(u){for(var h=0,d;h<t;++h)l[(d=c[h]).i]=d.x(u);return l.join("")})}
vendor: 4,442 bytes, line 784
784function gv(e,t){var n=typeof t,r;return t==null||n==="boolean"?IR(t):(n==="number"?Fj:n==="string"?(r=dy(t))?(t=r,j$):G_e:t instanceof dy?j$:t instanceof Date?V_e:B_e(t)?z_e:Array.isArray(t)?U_e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?W_e:Fj)(e,t)}function DR(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Q_e(e,t){t===void 0&&(t=e,e=gv);for(var n=0,r=t.length-1,s=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(s,s=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function Y_e(e){return function(){return e}}function $j(e){return+e}var _$=[0,1];function bs(e){return e}function LO(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Y_e(isNaN(t)?NaN:.5)}function X_e(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Z_e(e,t,n){var r=e[0],s=e[1],a=t[0],o=t[1];return s<r?(r=LO(s,r),a=n(o,a)):(r=LO(r,s),a=n(a,o)),function(l){return a(r(l))}}function J_e(e,t,n){var r=Math.min(e.length,t.length)-1,s=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)s[o]=LO(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=ub(e,l,1,r)-1;return a[c](s[c](l))}}function fb(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function kN(){var e=_$,t=_$,n=gv,r,s,a,o=bs,l,c,u;function h(){var m=Math.min(e.length,t.length);return o!==bs&&(o=X_e(e[0],e[m-1])),l=m>2?J_e:Z_e,c=u=null,d}function d(m){return m==null||isNaN(m=+m)?a:(c||(c=l(e.map(r),t,n)))(r(o(m)))}return d.invert=function(m){return o(s((u||(u=l(t,e.map(r),Fj)))(m)))},d.domain=function(m){return arguments.length?(e=Array.from(m,$j),h()):e.slice()},d.range=function(m){return arguments.length?(t=Array.from(m),h()):t.slice()},d.rangeRound=function(m){return t=Array.from(m),n=DR,h()},d.clamp=function(m){return arguments.length?(o=m?!0:bs,h()):o!==bs},d.interpolate=function(m){return arguments.length?(n=m,h()):n},d.unknown=function(m){return arguments.length?(a=m,d):a},function(m,g){return r=m,s=g,h()}}function LR(){return kN()(bs,bs)}function eNe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function qj(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Ag(e){return e=qj(Math.abs(e)),e?e[1]:NaN}function tNe(e,t){return function(n,r){for(var s=n.length,a=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(s-=l,s+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function nNe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var rNe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function fy(e){if(!(t=rNe.exec(e)))throw new Error("invalid format: "+e);var t;return new FR({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}fy.prototype=FR.prototype;function FR(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}FR.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function iNe(e){e:for(var t=e.length,n=1,r=-1,s;n<t;++n)switch(e[n]){case".":r=s=n;break;case"0":r===0&&(r=n),s=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var gK;function sNe(e,t){var n=qj(e,t);if(!n)return e+"";var r=n[0],s=n[1],a=s-(gK=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+qj(e,Math.max(0,t+a-1))[0]}function N$(e,t){var n=qj(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const S$={"%":(e,t)=>
vendor: 5,608 bytes, line 784
784(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:eNe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>N$(e*100,t),r:N$,s:sNe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function k$(e){return e}var E$=Array.prototype.map,P$=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function aNe(e){var t=e.grouping===void 0||e.thousands===void 0?k$:tNe(E$.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?k$:nNe(E$.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d){d=fy(d);var m=d.fill,g=d.align,w=d.sign,v=d.symbol,b=d.zero,y=d.width,_=d.comma,N=d.precision,j=d.trim,S=d.type;S==="n"?(_=!0,S="g"):S$[S]||(N===void 0&&(N=12),j=!0,S="g"),(b||m==="0"&&g==="=")&&(b=!0,m="0",g="=");var C=v==="$"?n:v==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",P=v==="$"?r:/[%p]/.test(S)?o:"",A=S$[S],F=/[defgprs%]/.test(S);N=N===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function I(R){var M=C,$=P,B,U,G;if(S==="c")$=A(R)+$,R="";else{R=+R;var Z=R<0||1/R<0;if(R=isNaN(R)?c:A(Math.abs(R),N),j&&(R=iNe(R)),Z&&+R==0&&w!=="+"&&(Z=!1),M=(Z?w==="("?w:l:w==="-"||w==="("?"":w)+M,$=(S==="s"?P$[8+gK/3]:"")+$+(Z&&w==="("?")":""),F){for(B=-1,U=R.length;++B<U;)if(G=R.charCodeAt(B),48>G||G>57){$=(G===46?s+R.slice(B+1):R.slice(B))+$,R=R.slice(0,B);break}}}_&&!b&&(R=t(R,1/0));var X=M.length+R.length+$.length,V=X<y?new Array(y-X+1).join(m):"";switch(_&&b&&(R=t(V+R,V.length?y-$.length:1/0),V=""),g){case"<":R=M+R+$+V;break;case"=":R=M+V+R+$;break;case"^":R=V.slice(0,X=V.length>>1)+M+R+$+V.slice(X);break;default:R=V+M+R+$;break}return a(R)}return I.toString=function(){return d+""},I}function h(d,m){var g=u((d=fy(d),d.type="f",d)),w=Math.max(-8,Math.min(8,Math.floor(Ag(m)/3)))*3,v=Math.pow(10,-w),b=P$[8+w/3];return function(y){return g(v*y)+b}}return{format:u,formatPrefix:h}}var _1,$R,vK;oNe({thousands:",",grouping:[3],currency:["$",""]});function oNe(e){return _1=aNe(e),$R=_1.format,vK=_1.formatPrefix,_1}function lNe(e){return Math.max(0,-Ag(Math.abs(e)))}function cNe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ag(t)/3)))*3-Ag(Math.abs(e)))}function uNe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ag(t)-Ag(e))+1}function xK(e,t,n,r){var s=RO(e,t,n),a;switch(r=fy(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=cNe(s,o))&&(r.precision=a),vK(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=uNe(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=lNe(s))&&(r.precision=a-(r.type==="%")*2);break}}return $R(r)}function Kd(e){var t=e.domain;return e.ticks=function(n){var r=t();return OO(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return xK(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,a=r.length-1,o=r[s],l=r[a],c,u,h=10;for(l<o&&(u=o,o=l,l=u,u=s,s=a,a=u);h-- >0;){if(u=TO(o,l,n),u===c)return r[s]=o,r[a]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function zj(){var e=LR();return e.copy=function(){return fb(e,zj())},uo.apply(e,arguments),Kd(e)}function yK(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,$j),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return yK(e).unknown(t)},e=arguments.length?Array.from(e,$j):[0,1],Kd(n)}function bK(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],a=e[r],o;return a<s&&(o=n,n=r,r=o,o=s,s=a,a=o),e[n]=t.floor(s),e[r]=t.ceil(a),e}function C$(e){return Math.log(e)}function A$(e){return Math.exp(e)}function dNe(e){return-Math.log(-e)}function fNe(e){return-Math.exp(-e)}function hNe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function mNe(e){return e===10?hNe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function pNe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function O$(e){return(t,n)=>-e(-t,n)}function qR(e){const t=e(C$,A$),n=t.domain;let r=10,s,a;function o(){return s=pNe(r),a=mNe(r),n()[0]<0?(s=O$(s),a=O$(a),e(dNe,fNe)):e(C$,A$),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],h=c[c.length-1];const d=h<u;d&&([u,h]=[h,u]);let m=s(u),g=s(h),w,v;const b=l==null?10:+l;let y=[];if(!(r%1)&&g-m<b){if(m=Math.floor(m),g=Math.ceil(g),u>0){for(;m<=g;++m)for(w=1;w<r;++w)if(v=m<0?w/a(-m):w*a(m),!(v<u)){if(v>h)break;y.push(v)}}else for(;m<=g;++m)for(w=r-1;w>=1;--w)if(v=m>0?w/a(-m):w*a(m),!(v<u)){if(v>h)break;y.push(v)}y.length*2<b&&(y=OO(u,h,b))}else y=OO(m,g,Math.min(g-m,b)).map(a);return d?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=fy(c)).precision==null&&(c.trim=!0),c=$R(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return h=>{let d=h/a(Math.round(s(h)));return d*r<r-.5&&(d*=r),d<=u?c(h):""}},t.nice=()=>n(bK(n(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function wK(){const e=qR(kN()).domain([1,10]);return e.copy=()=>fb(e,wK()).base(e.base()),uo.apply(e,arguments),e}
784function T$(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function R$(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function zR(e){var t=1,n=e(T$(t),R$(t));return n.constant=function(r){return arguments.length?e(T$(t=+r),R$(t)):t},Kd(n)}function jK(){var e=zR(kN());return e.copy=function(){return fb(e,jK()).constant(e.constant())},uo.apply(e,arguments)}function M$(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function gNe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function vNe(e){return e<0?-e*e:e*e}function BR(e){var t=e(bs,bs),n=1;function r(){return n===1?e(bs,bs):n===.5?e(gNe,vNe):e(M$(n),M$(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},Kd(t)}function UR(){var e=BR(kN());return e.copy=function(){return fb(e,UR()).exponent(e.exponent())},uo.apply(e,arguments),e}function xNe(){return UR.apply(null,arguments).exponent(.5)}function I$(e){return Math.sign(e)*e*e}function yNe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function _K(){var e=LR(),t=[0,1],n=!1,r;function s(a){var o=yNe(e(a));return isNaN(o)?r:n?Math.round(o):o}return s.invert=function(a){return e.invert(I$(a))},s.domain=function(a){return arguments.length?(e.domain(a),s):e.domain()},s.range=function(a){return arguments.length?(e.range((t=Array.from(a,$j)).map(I$)),s):t.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(n=!!a,s):n},s.clamp=function(a){return arguments.length?(e.clamp(a),s):e.clamp()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return _K(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},uo.apply(s,arguments),Kd(s)}function NK(){var e=[],t=[],n=[],r;function s(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=N_e(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[ub(n,o)]}return a.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Td),s()},a.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return NK().domain(e).range(t).unknown(r)},uo.apply(a,arguments)}function SK(){var e=0,t=1,n=1,r=[.5],s=[0,1],a;function o(c){return c!=null&&c<=c?s[ub(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(s=Array.from(c)).length-1,l()):s.slice()},o.invertExtent=function(c){var u=s.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return SK().domain([e,t]).range(s).unknown(a)},uo.apply(Kd(o),arguments)}function kK(){var e=[.5],t=[0,1],n,r=1;function s(a){return a!=null&&a<=a?t[ub(e,a,0,r)]:n}return s.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return kK().domain(e).range(t).unknown(n)},uo.apply(s,arguments)}const oC=new Date,lC=new Date;function di(e,t,n,r){function s(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return s.floor=a=>(e(a=new Date(+a)),a),s.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),s.round=a=>{const o=s(a),l=s.ceil(a);return a-o<l-a?o:l},s.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),s.range=(a,o,l)=>{const c=[];if(a=s.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<o);return c},s.filter=a=>di(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(s.count=(a,o)=>(oC.setTime(+a),lC.setTime(+o),e(oC),e(lC),Math.floor(n(oC,lC))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(r?o=>r(o)%a===0:o=>s.count(0,o)%a===0):s)),s}const Bj=di(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Bj.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?di(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Bj);Bj.range;
vendor: 4,884 bytes, line 784
784const Vc=1e3,Xa=Vc*60,Wc=Xa*60,au=Wc*24,VR=au*7,D$=au*30,cC=au*365,fh=di(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Vc)},(e,t)=>(t-e)/Vc,e=>e.getUTCSeconds());fh.range;const WR=di(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Vc)},(e,t)=>{e.setTime(+e+t*Xa)},(e,t)=>(t-e)/Xa,e=>e.getMinutes());WR.range;const HR=di(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Xa)},(e,t)=>(t-e)/Xa,e=>e.getUTCMinutes());HR.range;const KR=di(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Vc-e.getMinutes()*Xa)},(e,t)=>{e.setTime(+e+t*Wc)},(e,t)=>(t-e)/Wc,e=>e.getHours());KR.range;const GR=di(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Wc)},(e,t)=>(t-e)/Wc,e=>e.getUTCHours());GR.range;const hb=di(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Xa)/au,e=>e.getDate()-1);hb.range;const EN=di(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/au,e=>e.getUTCDate()-1);EN.range;const EK=di(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/au,e=>Math.floor(e/au));EK.range;function nm(e){return di(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Xa)/VR)}const PN=nm(0),Uj=nm(1),bNe=nm(2),wNe=nm(3),Og=nm(4),jNe=nm(5),_Ne=nm(6);PN.range;Uj.range;bNe.range;wNe.range;Og.range;jNe.range;_Ne.range;function rm(e){return di(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/VR)}const CN=rm(0),Vj=rm(1),NNe=rm(2),SNe=rm(3),Tg=rm(4),kNe=rm(5),ENe=rm(6);CN.range;Vj.range;NNe.range;SNe.range;Tg.range;kNe.range;ENe.range;const QR=di(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());QR.range;const YR=di(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());YR.range;const ou=di(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());ou.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:di(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});ou.range;const lu=di(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());lu.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:di(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});lu.range;function PK(e,t,n,r,s,a){const o=[[fh,1,Vc],[fh,5,5*Vc],[fh,15,15*Vc],[fh,30,30*Vc],[a,1,Xa],[a,5,5*Xa],[a,15,15*Xa],[a,30,30*Xa],[s,1,Wc],[s,3,3*Wc],[s,6,6*Wc],[s,12,12*Wc],[r,1,au],[r,2,2*au],[n,1,VR],[t,1,D$],[t,3,3*D$],[e,1,cC]];function l(u,h,d){const m=h<u;m&&([u,h]=[h,u]);const g=d&&typeof d.range=="function"?d:c(u,h,d),w=g?g.range(u,+h+1):[];return m?w.reverse():w}function c(u,h,d){const m=Math.abs(h-u)/d,g=TR(([,,b])=>b).right(o,m);if(g===o.length)return e.every(RO(u/cC,h/cC,d));if(g===0)return Bj.every(Math.max(RO(u,h,d),1));const[w,v]=o[m/o[g-1][2]<o[g][2]/m?g-1:g];return w.every(v)}return[l,c]}const[PNe,CNe]=PK(lu,YR,CN,EK,GR,HR),[ANe,ONe]=PK(ou,QR,PN,hb,KR,WR);function uC(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function dC(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function s0(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function TNe(e){var t=e.dateTime,n=e.date,r=e.time,s=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=a0(s),h=o0(s),d=a0(a),m=o0(a),g=a0(o),w=o0(o),v=a0(l),b=o0(l),y=a0(c),_=o0(c),N={a:Z,A:X,b:V,B:z,c:null,d:B$,e:B$,f:t2e,g:d2e,G:h2e,H:ZNe,I:JNe,j:e2e,L:CK,m:n2e,M:r2e,p:L,q:W,Q:W$,s:H$,S:i2e,u:s2e,U:a2e,V:o2e,w:l2e,W:c2e,x:null,X:null,y:u2e,Y:f2e,Z:m2e,"%":V$},j={a:Q,A:J,b:ne,B:Y,c:null,d:U$,e:U$,f:x2e,g:P2e,G:A2e,H:p2e,I:g2e,j:v2e,L:OK,m:y2e,M:b2e,p:ee,q:le,Q:W$,s:H$,S:w2e,u:j2e,U:_2e,V:N2e,w:S2e,W:k2e,x:null,X:null,y:E2e,Y:C2e,Z:O2e,"%":V$},S={a:I,A:R,b:M,B:$,c:B,d:q$,e:q$,f:GNe,g:$$,G:F$,H:z$,I:z$,j:VNe,L:KNe,m:UNe,M:WNe,p:F,q:BNe,Q:YNe,s:XNe,S:HNe,u:LNe,U:FNe,V:$Ne,w:DNe,W:qNe,x:U,X:G,y:$$,Y:F$,Z:zNe,"%":QNe};N.x=C(n,N),N.X=C(r,N),N.c=C(t,N),j.x=C(n,j),j.X=C(r,j),j.c=C(t,j);function C(re,fe){return function(ge){var he=[],De=-1,_e=0,We=re.length,ze,Xe,ke;for(ge instanceof Date||(ge=new Date(+ge));++De<We;
vendor: 7,728 bytes, line 784
784)re.charCodeAt(De)===37&&(he.push(re.slice(_e,De)),(Xe=L$[ze=re.charAt(++De)])!=null?ze=re.charAt(++De):Xe=ze==="e"?" ":"0",(ke=fe[ze])&&(ze=ke(ge,Xe)),he.push(ze),_e=De+1);return he.push(re.slice(_e,De)),he.join("")}}function P(re,fe){return function(ge){var he=s0(1900,void 0,1),De=A(he,re,ge+="",0),_e,We;if(De!=ge.length)return null;if("Q"in he)return new Date(he.Q);if("s"in he)return new Date(he.s*1e3+("L"in he?he.L:0));if(fe&&!("Z"in he)&&(he.Z=0),"p"in he&&(he.H=he.H%12+he.p*12),he.m===void 0&&(he.m="q"in he?he.q:0),"V"in he){if(he.V<1||he.V>53)return null;"w"in he||(he.w=1),"Z"in he?(_e=dC(s0(he.y,0,1)),We=_e.getUTCDay(),_e=We>4||We===0?Vj.ceil(_e):Vj(_e),_e=EN.offset(_e,(he.V-1)*7),he.y=_e.getUTCFullYear(),he.m=_e.getUTCMonth(),he.d=_e.getUTCDate()+(he.w+6)%7):(_e=uC(s0(he.y,0,1)),We=_e.getDay(),_e=We>4||We===0?Uj.ceil(_e):Uj(_e),_e=hb.offset(_e,(he.V-1)*7),he.y=_e.getFullYear(),he.m=_e.getMonth(),he.d=_e.getDate()+(he.w+6)%7)}else("W"in he||"U"in he)&&("w"in he||(he.w="u"in he?he.u%7:"W"in he?1:0),We="Z"in he?dC(s0(he.y,0,1)).getUTCDay():uC(s0(he.y,0,1)).getDay(),he.m=0,he.d="W"in he?(he.w+6)%7+he.W*7-(We+5)%7:he.w+he.U*7-(We+6)%7);return"Z"in he?(he.H+=he.Z/100|0,he.M+=he.Z%100,dC(he)):uC(he)}}function A(re,fe,ge,he){for(var De=0,_e=fe.length,We=ge.length,ze,Xe;De<_e;){if(he>=We)return-1;if(ze=fe.charCodeAt(De++),ze===37){if(ze=fe.charAt(De++),Xe=S[ze in L$?fe.charAt(De++):ze],!Xe||(he=Xe(re,ge,he))<0)return-1}else if(ze!=ge.charCodeAt(he++))return-1}return he}function F(re,fe,ge){var he=u.exec(fe.slice(ge));return he?(re.p=h.get(he[0].toLowerCase()),ge+he[0].length):-1}function I(re,fe,ge){var he=g.exec(fe.slice(ge));return he?(re.w=w.get(he[0].toLowerCase()),ge+he[0].length):-1}function R(re,fe,ge){var he=d.exec(fe.slice(ge));return he?(re.w=m.get(he[0].toLowerCase()),ge+he[0].length):-1}function M(re,fe,ge){var he=y.exec(fe.slice(ge));return he?(re.m=_.get(he[0].toLowerCase()),ge+he[0].length):-1}function $(re,fe,ge){var he=v.exec(fe.slice(ge));return he?(re.m=b.get(he[0].toLowerCase()),ge+he[0].length):-1}function B(re,fe,ge){return A(re,t,fe,ge)}function U(re,fe,ge){return A(re,n,fe,ge)}function G(re,fe,ge){return A(re,r,fe,ge)}function Z(re){return o[re.getDay()]}function X(re){return a[re.getDay()]}function V(re){return c[re.getMonth()]}function z(re){return l[re.getMonth()]}function L(re){return s[+(re.getHours()>=12)]}function W(re){return 1+~~(re.getMonth()/3)}function Q(re){return o[re.getUTCDay()]}function J(re){return a[re.getUTCDay()]}function ne(re){return c[re.getUTCMonth()]}function Y(re){return l[re.getUTCMonth()]}function ee(re){return s[+(re.getUTCHours()>=12)]}function le(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var fe=C(re+="",N);return fe.toString=function(){return re},fe},parse:function(re){var fe=P(re+="",!1);return fe.toString=function(){return re},fe},utcFormat:function(re){var fe=C(re+="",j);return fe.toString=function(){return re},fe},utcParse:function(re){var fe=P(re+="",!0);return fe.toString=function(){return re},fe}}}var L$={"-":"",_:" ",0:"0"},ki=/^\s*\d+/,RNe=/^%/,MNe=/[\\^$*+?|[\]().{}]/g;function An(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",a=s.length;return r+(a<n?new Array(n-a+1).join(t)+s:s)}function INe(e){return e.replace(MNe,"\\$&")}function a0(e){return new RegExp("^(?:"+e.map(INe).join("|")+")","i")}function o0(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function DNe(e,t,n){var r=ki.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function LNe(e,t,n){var r=ki.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function FNe(e,t,n){var r=ki.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function $Ne(e,t,n){var r=ki.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function qNe(e,t,n){var r=ki.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function F$(e,t,n){var r=ki.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function $$(e,t,n){var r=ki.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function zNe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function BNe(e,t,n){var r=ki.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function UNe(e,t,n){var r=ki.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function q$(e,t,n){var r=ki.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function VNe(e,t,n){var r=ki.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function z$(e,t,n){var r=ki.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function WNe(e,t,n){var r=ki.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function HNe(e,t,n){var r=ki.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function KNe(e,t,n){var r=ki.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function GNe(e,t,n){var r=ki.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function QNe(e,t,n){var r=RNe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function YNe(e,t,n){var r=ki.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function XNe(e,t,n){var r=ki.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function B$(e,t){return An(e.getDate(),t,2)}function ZNe(e,t){return An(e.getHours(),t,2)}function JNe(e,t){return An(e.getHours()%12||12,t,2)}function e2e(e,t){return An(1+hb.count(ou(e),e),t,3)}function CK(e,t){return An(e.getMilliseconds(),t,3)}function t2e(e,t){return CK(e,t)+"000"}function n2e(e,t){return An(e.getMonth()+1,t,2)}function r2e(e,t){return An(e.getMinutes(),t,2)}function i2e(e,t){return An(e.getSeconds(),t,2)}function s2e(e){var t=e.getDay();return t===0?7:t}function a2e(e,t){return An(PN.count(ou(e)-1,e),t,2)}function AK(e){var t=e.getDay();return t>=4||t===0?Og(e):Og.ceil(e)}function o2e(e,t){return e=AK(e),An(Og.count(ou(e),e)+(ou(e).getDay()===4),t,2)}function l2e(e){return e.getDay()}function c2e(e,t){return An(Uj.count(ou(e)-1,e),t,2)}function u2e(e,t){return An(e.getFullYear()%100,t,2)}function d2e(e,t){return e=AK(e),An(e.getFullYear()%100,t,2)}function f2e(e,t){return An(e.getFullYear()%1e4,t,4)}function h2e(e,t){var n=e.getDay();return e=n>=4||n===0?Og(e):Og.ceil(e),An(e.getFullYear()%1e4,t,4)}function m2e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+An(t/60|0,"0",2)+An(t%60,"0",2)}function U$(e,t){return An(e.getUTCDate(),t,2)}function p2e(e,t){return An(e.getUTCHours(),t,2)}function g2e(e,t){return An(e.getUTCHours()%12||12,t,2)}function v2e(e,t){return An(1+EN.count(lu(e),e),t,3)}function OK(e,t){return An(e.getUTCMilliseconds(),t,3)}function x2e(e,t){return OK(e,t)+"000"}function y2e(e,t){return An(e.getUTCMonth()+1,t,2)}function b2e(e,t){return An(e.getUTCMinutes(),t,2)}function w2e(e,t){return An(e.getUTCSeconds(),t,2)}function j2e(e){var t=e.getUTCDay();return t===0?7:t}function _2e(e,t){return An(CN.count(lu(e)-1,e),t,2)}function TK(e){var t=e.getUTCDay();return t>=4||t===0?Tg(e):Tg.ceil(e)}function N2e(e,t){return e=TK(e),An(Tg.count(lu(e),e)+(lu(e).getUTCDay()===4),t,2)}function S2e(e){return e.getUTCDay()}function k2e(e,t){return An(Vj.count(lu(e)-1,e),t,2)}function E2e(e,t){return An(e.getUTCFullYear()%100,t,2)}function P2e(e,t){return e=TK(e),An(e.getUTCFullYear()%100,t,2)}function C2e(e,t){return An(e.getUTCFullYear()%1e4,t,4)}function A2e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Tg(e):Tg.ceil(e),An(e.getUTCFullYear()%1e4,t,4)}function O2e(){return"+0000"}function V$(){return"%"}function W$(e){return+e}function H$(e){return Math.floor(+e/1e3)}var Ip,RK,MK;T2e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
784ay","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function T2e(e){return Ip=TNe(e),RK=Ip.format,Ip.parse,MK=Ip.utcFormat,Ip.utcParse,Ip}function R2e(e){return new Date(e)}function M2e(e){return e instanceof Date?+e:+new Date(+e)}function XR(e,t,n,r,s,a,o,l,c,u){var h=LR(),d=h.invert,m=h.domain,g=u(".%L"),w=u(":%S"),v=u("%I:%M"),b=u("%I %p"),y=u("%a %d"),_=u("%b %d"),N=u("%B"),j=u("%Y");function S(C){return(c(C)<C?g:l(C)<C?w:o(C)<C?v:a(C)<C?b:r(C)<C?s(C)<C?y:_:n(C)<C?N:j)(C)}return h.invert=function(C){return new Date(d(C))},h.domain=function(C){return arguments.length?m(Array.from(C,M2e)):m().map(R2e)},h.ticks=function(C){var P=m();return e(P[0],P[P.length-1],C??10)},h.tickFormat=function(C,P){return P==null?S:u(P)},h.nice=function(C){var P=m();return(!C||typeof C.range!="function")&&(C=t(P[0],P[P.length-1],C??10)),C?m(bK(P,C)):h},h.copy=function(){return fb(h,XR(e,t,n,r,s,a,o,l,c,u))},h}function I2e(){return uo.apply(XR(ANe,ONe,ou,QR,PN,hb,KR,WR,fh,RK).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function D2e(){return uo.apply(XR(PNe,CNe,lu,YR,CN,EN,GR,HR,fh,MK).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function AN(){var e=0,t=1,n,r,s,a,o=bs,l=!1,c;function u(d){return d==null||isNaN(d=+d)?c:o(s===0?.5:(d=(a(d)-n)*s,l?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,n=a(e=+e),r=a(t=+t),s=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(d){return arguments.length?(l=!!d,u):l},u.interpolator=function(d){return arguments.length?(o=d,u):o};function h(d){return function(m){var g,w;return arguments.length?([g,w]=m,o=d(g,w),u):[o(0),o(1)]}}return u.range=h(gv),u.rangeRound=h(DR),u.unknown=function(d){return arguments.length?(c=d,u):c},function(d){return a=d,n=d(e),r=d(t),s=n===r?0:1/(r-n),u}}function Gd(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function IK(){var e=Kd(AN()(bs));return e.copy=function(){return Gd(e,IK())},pu.apply(e,arguments)}function DK(){var e=qR(AN()).domain([1,10]);return e.copy=function(){return Gd(e,DK()).base(e.base())},pu.apply(e,arguments)}function LK(){var e=zR(AN());return e.copy=function(){return Gd(e,LK()).constant(e.constant())},pu.apply(e,arguments)}function ZR(){var e=BR(AN());return e.copy=function(){return Gd(e,ZR()).exponent(e.exponent())},pu.apply(e,arguments)}function L2e(){return ZR.apply(null,arguments).exponent(.5)}function FK(){var e=[],t=bs;function n(r){if(r!=null&&!isNaN(r=+r))return t((ub(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let s of r)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Td),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,s)=>t(s/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(s,a)=>__e(e,a/r))},n.copy=function(){return FK(t).domain(e)},pu.apply(n,arguments)}function ON(){var e=0,t=.5,n=1,r=1,s,a,o,l,c,u=bs,h,d=!1,m;function g(v){return isNaN(v=+v)?m:(v=.5+((v=+h(v))-a)*(r*v<r*a?l:c),u(d?Math.max(0,Math.min(1,v)):v))}g.domain=function(v){return arguments.length?([e,t,n]=v,s=h(e=+e),a=h(t=+t),o=h(n=+n),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r=a<s?-1:1,g):[e,t,n]},g.clamp=function(v){return arguments.length?(d=!!v,g):d},g.interpolator=function(v){return arguments.length?(u=v,g):u};function w(v){return function(b){var y,_,N;return arguments.length?([y,_,N]=b,u=Q_e(v,[y,_,N]),g):[u(0),u(.5),u(1)]}}return g.range=w(gv),g.rangeRound=w(DR),g.unknown=function(v){return arguments.length?(m=v,g):m},function(v){return h=v,s=v(e),a=v(t),o=v(n),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r=a<s?-1:1,g}}function $K(){var e=Kd(ON()(bs));return e.copy=function(){return Gd(e,$K())},pu.apply(e,arguments)}function qK(){var e=qR(ON()).domain([.1,1,10]);return e.copy=function(){return Gd(e,qK()).base(e.base())},pu.apply(e,arguments)}function zK(){var e=zR(ON());return e.copy=function(){return Gd(e,zK()).constant(e.constant())},pu.apply(e,arguments)}function JR(){var e=BR(ON());return e.copy=function(){return Gd(e,JR()).exponent(e.exponent())},pu.apply(e,arguments)}function F2e(){return JR.apply(null,arguments).exponent(.5)}const K$=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:ly,scaleDiverging:$K,scaleDivergingLog:qK,scaleDivergingPow:JR,scaleDivergingSqrt:F2e,scaleDivergingSymlog:zK,scaleIdentity:yK,scaleImplicit:
vendor: 69,746 bytes, lines 784-811
784MO,scaleLinear:zj,scaleLog:wK,scaleOrdinal:RR,scalePoint:T0,scalePow:UR,scaleQuantile:NK,scaleQuantize:SK,scaleRadial:_K,scaleSequential:IK,scaleSequentialLog:DK,scaleSequentialPow:ZR,scaleSequentialQuantile:FK,scaleSequentialSqrt:L2e,scaleSequentialSymlog:LK,scaleSqrt:xNe,scaleSymlog:jK,scaleThreshold:kK,scaleTime:I2e,scaleUtc:D2e,tickFormat:xK},Symbol.toStringTag,{value:"Module"}));var fC,G$;function TN(){if(G$)return fC;G$=1;var e=fv();function t(n,r,s){for(var a=-1,o=n.length;++a<o;){var l=n[a],c=r(l);if(c!=null&&(u===void 0?c===c&&!e(c):s(c,u)))var u=c,h=l}return h}return fC=t,fC}var hC,Q$;function BK(){if(Q$)return hC;Q$=1;function e(t,n){return t>n}return hC=e,hC}var mC,Y$;function $2e(){if(Y$)return mC;Y$=1;var e=TN(),t=BK(),n=pv();function r(s){return s&&s.length?e(s,n,t):void 0}return mC=r,mC}var q2e=$2e();const _d=En(q2e);var pC,X$;function UK(){if(X$)return pC;X$=1;function e(t,n){return t<n}return pC=e,pC}var gC,Z$;function z2e(){if(Z$)return gC;Z$=1;var e=TN(),t=UK(),n=pv();function r(s){return s&&s.length?e(s,n,t):void 0}return gC=r,gC}var B2e=z2e();const RN=En(B2e);var vC,J$;function U2e(){if(J$)return vC;J$=1;var e=bR(),t=Zl(),n=XH(),r=Qs();function s(a,o){var l=r(a)?e:n;return l(a,t(o,3))}return vC=s,vC}var xC,eq;function V2e(){if(eq)return xC;eq=1;var e=QH(),t=U2e();function n(r,s){return e(t(r,s),1)}return xC=n,xC}var W2e=V2e();const H2e=En(W2e);var K2e=gH();const Bd=En(K2e);var vv=1e9,G2e={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},t5,ur=!0,io="[DecimalError] ",Eh=io+"Invalid argument: ",e5=io+"Exponent out of range: ",xv=Math.floor,sh=Math.pow,Q2e=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ha,ji=1e7,or=7,VK=9007199254740991,Wj=xv(VK/or),vt={};vt.absoluteValue=vt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};vt.comparedTo=vt.cmp=function(e){var t,n,r,s,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,s=e.d.length,t=0,n=r<s?r:s;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===s?0:r>s^a.s<0?1:-1};vt.decimalPlaces=vt.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*or;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};vt.dividedBy=vt.div=function(e){return Zc(this,new this.constructor(e))};vt.dividedToIntegerBy=vt.idiv=function(e){var t=this,n=t.constructor;return Kn(Zc(t,new n(e),0,1),n.precision)};vt.equals=vt.eq=function(e){return!this.cmp(e)};vt.exponent=function(){return Kr(this)};vt.greaterThan=vt.gt=function(e){return this.cmp(e)>0};vt.greaterThanOrEqualTo=vt.gte=function(e){return this.cmp(e)>=0};vt.isInteger=vt.isint=function(){return this.e>this.d.length-2};vt.isNegative=vt.isneg=function(){return this.s<0};vt.isPositive=vt.ispos=function(){return this.s>0};vt.isZero=function(){return this.s===0};vt.lessThan=vt.lt=function(e){return this.cmp(e)<0};vt.lessThanOrEqualTo=vt.lte=function(e){return this.cmp(e)<1};vt.logarithm=vt.log=function(e){var t,n=this,r=n.constructor,s=r.precision,a=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ha))throw Error(io+"NaN");if(n.s<1)throw Error(io+(n.s?"NaN":"-Infinity"));return n.eq(ha)?new r(0):(ur=!1,t=Zc(hy(n,a),hy(e,a),a),ur=!0,Kn(t,s))};vt.minus=vt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?KK(t,e):WK(t,(e.s=-e.s,e))};vt.modulo=vt.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(io+"NaN");return n.s?(ur=!1,t=Zc(n,e,0,1).times(e),ur=!0,n.minus(t)):Kn(new r(n),s)};vt.naturalExponential=vt.exp=function(){return HK(this)};vt.naturalLogarithm=vt.ln=function(){return hy(this)};vt.negated=vt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};vt.plus=vt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?WK(t,e):KK(t,(e.s=-e.s,e))};vt.precision=vt.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Eh+e);if(t=Kr(s)+1,r=s.d.length-1,n=r*or+1,r=s.d[r],r){for(;r%10==0;r/=10)n--;for(r=s.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};vt.squareRoot=vt.sqrt=function(){var e,t,n,r,s,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(io+"NaN")}for(e=Kr(l),ur=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Dl(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=xv((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(s.toString()),n=c.precision,s=o=n+3;;)if(a=r,r=a.plus(Zc(l,a,o+2)).times(.5),Dl(a.d).slice(0,o)===(t=Dl(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(Kn(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return ur=!0,Kn(r,n)};vt.times=vt.mul=function(e){var t,n,r,s,a,o,l,c,u,h=this,d=h.constructor,m=h.d,g=(e=new d(e)).d;if(!h.s||!e.s)return new d(0);for(e.s*=h.s,n=h.e+e.e,c=m.length,u=g.length,c<u&&(a=m,m=g,g=a,o=c,c=u,u=o),a=[],o=c+u,r=o;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,s=c+r;s>r;)l=a[s]+g[r]*m[s-r-1]+t,a[s--]=l%ji|0,t=l/ji|0;a[s]=(a[s]+t)%ji|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,ur?Kn(e,d.precision):e};vt.toDecimalPlaces=vt.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Gl(e,0,vv),t===void 0?t=r.rounding:Gl(t,0,8),Kn(n,e+Kr(n)+1,t))};vt.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=Wh(r,!0):(Gl(e,0,vv),t===void 0?t=s.rounding:Gl(t,0,8),r=Kn(new s(r),e+1,t),n=Wh(r,!0,e+1)),n};vt.toFixed=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?Wh(s):(Gl(e,0,vv),t===void 0?t=a.rounding:Gl(t,0,8),r=Kn(new a(s),e+Kr(s)+1,t),n=Wh(r.abs(),!1,e+Kr(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};vt.toInteger=vt.toint=function(){var e=this,t=e.constructor;return Kn(new t(e),Kr(e)+1,t.rounding)};vt.toNumber=function(){return+this};vt.toPower=vt.pow=function(e){var t,n,r,s,a,o,l=this,c=l.constructor,u=12,h=+(e=new c(e));if(!e.s)return new c(ha);if(l=new c(l),!l.s){if(e.s<1)throw Error(io+"Infinity");return l}if(l.eq(ha))return l;if(r=c.precision,e.eq(ha))return Kn(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=h<0?-h:h)<=VK){for(s=new c(ha),t=Math.ceil(r/or+4),ur=!1;n%2&&(s=s.times(l),nq(s.d,t)),n=xv(n/2),n!==0;)l=l.times(l),nq(l.d,t);return ur=!0,e.s<0?new c(ha).div(s):Kn(s,r)}}else if(a<0)throw Error(io+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,ur=!1,s=e.times(hy(l,r+u)),ur=!0,s=HK(s),s.s=a,s};vt.toPrecision=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?(n=Kr(s),r=Wh(s,n<=a.toExpNeg||n>=a.toExpPos)):(Gl(e,1,vv),t===void 0?t=a.rounding:Gl(t,0,8),s=Kn(new a(s),e,t),n=Kr(s),r=Wh(s,e<=n||n<=a.toExpNeg,e)),r};vt.toSignificantDigits=vt.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Gl(e,1,vv),t===void 0?t=r.rounding:Gl(t,0,8)),Kn(new r(n),e,t)};vt.toString=vt.valueOf=vt.val=vt.toJSON=vt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Kr(e),n=e.constructor;return Wh(e,t<=n.toExpNeg||t>=n.toExpPos)};function WK(e,t){var n,r,s,a,o,l,c,u,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),ur?Kn(t,d):t;if(c=e.d,u=t.d,o=e.e,s=t.e,c=c.slice(),a=o-s,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,s=o,l=c.length),o=Math.ceil(d/or),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/ji|0,c[a]%=ji;for(n&&(c.unshift(n),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,ur?Kn(t,d):t}function Gl(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Eh+e)}function Dl(e){var t,n,r,s=e.length-1,a="",o=e[0];if(s>0){for(a+=o,t=1;t<s;t++)r=e[t]+"",n=or-r.length,n&&(a+=cd(n)),a+=r;o=e[t],r=o+"",n=or-r.length,n&&(a+=cd(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Zc=(function(){function e(r,s){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*s+o,r[l]=a%ji|0,o=a/ji|0;return o&&r.unshift(o),r}function t(r,s,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=s[l]){c=r[l]>s[l]?1:-1;break}return c}function n(r,s,a){for(var o=0;a--;)r[a]-=o,o=r[a]<s[a]?1:0,r[a]=o*ji+r[a]-s[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,s,a,o){var l,c,u,h,d,m,g,w,v,b,y,_,N,j,S,C,P,A,F=r.constructor,I=r.s==s.s?1:-1,R=r.d,M=s.d;if(!r.s)return new F(r);if(!s.s)throw Error(io+"Division by zero");for(c=r.e-s.e,P=M.length,S=R.length,g=new F(I),w=g.d=[],u=0;M[u]==(R[u]||0);)++u;if(M[u]>(R[u]||0)&&--c,a==null?_=a=F.precision:o?_=a+(Kr(r)-Kr(s))+1:_=a,_<0)return new F(0);if(_=_/or+2|0,u=0,P==1)for(h=0,M=M[0],_++;(u<S||h)&&_--;u++)N=h*ji+(R[u]||0),w[u]=N/M|0,h=N%M|0;else{for(h=ji/(M[0]+1)|0,h>1&&(M=e(M,h),R=e(R,h),P=M.length,S=R.length),j=P,v=R.slice(0,P),b=v.length;b<P;)v[b++]=0;A=M.slice(),A.unshift(0),C=M[0],M[1]>=ji/2&&++C;do h=0,l=t(M,v,P,b),l<0?(y=v[0],P!=b&&(y=y*ji+(v[1]||0)),h=y/C|0,h>1?(h>=ji&&(h=ji-1),d=e(M,h),m=d.length,b=v.length,l=t(d,v,m,b),l==1&&(h--,n(d,P<m?A:M,m))):(h==0&&(l=h=1),d=M.slice()),m=d.length,m<b&&d.unshift(0),n(v,d,b),l==-1&&(b=v.length,l=t(M,v,P,b),l<1&&(h++,n(v,P<b?A:M,b))),b=v.length):l===0&&(h++,v=[0]),w[u++]=h,l&&v[0]?v[b++]=R[j]||0:(v=[R[j]],b=1);while((j++<S||v[0]!==void 0)&&_--)}return w[0]||w.shift(),g.e=c,Kn(g,o?a+Kr(g)+1:a)}})();function HK(e,t){var n,r,s,a,o,l,c=0,u=0,h=e.constructor,d=h.precision;if(Kr(e)>16)throw Error(e5+Kr(e));if(!e.s)return new h(ha);for(ur=!1,l=d,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(sh(2,u))/Math.LN10*2+5|0,l+=r,n=s=a=new h(ha),h.precision=l;;){if(s=Kn(s.times(e),l),n=n.times(++c),o=a.plus(Zc(s,n,l)),Dl(o.d).slice(0,l)===Dl(a.d).slice(0,l)){for(;u--;)a=Kn(a.times(a),l);return h.precision=d,t==null?(ur=!0,Kn(a,d)):a}a=o}}function Kr(e){for(var t=e.e*or,n=e.d[0];n>=10;n/=10)t++;return t}function yC(e,t,n){if(t>e.LN10.sd())throw ur=!0,n&&(e.precision=n),Error(io+"LN10 precision limit exceeded");return Kn(new e(e.LN10),t)}function cd(e){for(var t="";e--;)t+="0";return t}function hy(e,t){var n,r,s,a,o,l,c,u,h,d=1,m=10,g=e,w=g.d,v=g.constructor,b=v.precision;if(g.s<1)throw Error(io+(g.s?"NaN":"-Infinity"));if(g.eq(ha))return new v(0);if(t==null?(ur=!1,u=b):u=t,g.eq(10))return t==null&&(ur=!0),yC(v,u);if(u+=m,v.precision=u,n=Dl(w),r=n.charAt(0),a=Kr(g),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=Dl(g.d),r=n.charAt(0),d++;a=Kr(g),r>1?(g=new v("0."+n),a++):g=new v(r+"."+n.slice(1))}else return c=yC(v,u+2,b).times(a+""),g=hy(new v(r+"."+n.slice(1)),u-m).plus(c),v.precision=b,t==null?(ur=!0,Kn(g,b)):g;for(l=o=g=Zc(g.minus(ha),g.plus(ha),u),h=Kn(g.times(g),u),s=3;;){if(o=Kn(o.times(h),u),c=l.plus(Zc(o,new v(s),u)),Dl(c.d).slice(0,u)===Dl(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(yC(v,u+2,b).times(a+""))),l=Zc(l,new v(d),u),v.precision=b,t==null?(ur=!0,Kn(l,b)):l;l=c,s+=2}}function tq(e,t){var n,r,s;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(r,s),t){if(s-=r,n=n-r-1,e.e=xv(n/or),e.d=[],r=(n+1)%or,n<0&&(r+=or),r<s){for(r&&e.d.push(+t.slice(0,r)),s-=or;r<s;)e.d.push(+t.slice(r,r+=or));t=t.slice(r),r=or-t.length}else r-=s;for(;r--;)t+="0";if(e.d.push(+t),ur&&(e.e>Wj||e.e<-Wj))throw Error(e5+n)}else e.s=0,e.e=0,e.d=[0];return e}function Kn(e,t,n){var r,s,a,o,l,c,u,h,d=e.d;for(o=1,a=d[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=or,s=t,u=d[h=0];else{if(h=Math.ceil((r+1)/or),a=d.length,h>=a)return e;for(u=a=d[h],o=1;a>=10;a/=10)o++;r%=or,s=r-or+o}if(n!==void 0&&(a=sh(10,o-s-1),l=u/a%10|0,c=t<0||d[h+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?s>0?u/sh(10,o-s):0:d[h-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return c?(a=Kr(e),d.length=1,t=t-a-1,d[0]=sh(10,(or-t%or)%or),e.e=xv(-t/or)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(r==0?(d.length=h,a=1,h--):(d.length=h+1,a=sh(10,or-r),d[h]=s>0?(u/sh(10,o-s)%sh(10,s)|0)*a:0),c)for(;;)if(h==0){(d[0]+=a)==ji&&(d[0]=1,++e.e);break}else{if(d[h]+=a,d[h]!=ji)break;d[h--]=0,a=1}for(r=d.length;d[--r]===0;)d.pop();if(ur&&(e.e>Wj||e.e<-Wj))throw Error(e5+Kr(e));return e}function KK(e,t){var n,r,s,a,o,l,c,u,h,d,m=e.constructor,g=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),ur?Kn(t,g):t;if(c=e.d,d=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(h=o<0,h?(n=c,o=-o,l=d.length):(n=d,r=u,l=c.length),s=Math.max(Math.ceil(g/or),l)+2,o>s&&(o=s,n.length=1),n.reverse(),s=o;s--;)n.push(0);n.reverse()}else{for(s=c.length,l=d.length,h=s<l,h&&(l=s),s=0;s<l;s++)if(c[s]!=d[s]){h=c[s]<d[s];break}o=0}for(h&&(n=c,c=d,d=n,t.s=-t.s),l=c.length,s=d.length-l;s>0;--s)c[l++]=0;for(s=d.length;s>o;){if(c[--s]<d[s]){for(a=s;a&&c[--a]===0;)c[a]=ji-1;--c[a],c[s]+=ji}c[s]-=d[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,ur?Kn(t,g):t):new m(0)}function Wh(e,t,n){var r,s=Kr(e),a=Dl(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+cd(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+cd(-s-1)+a,n&&(r=n-o)>0&&(a+=cd(r))):s>=o?(a+=cd(s+1-o),n&&(r=n-s-1)>0&&(a=a+"."+cd(r))):((r=s+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(s+1===o&&(a+="."),a+=cd(r))),e.s<0?"-"+a:a}function nq(e,t){if(e.length>t)return e.length=t,!0}function GK(e){var t,n,r;function s(a){var o=this;if(!(o instanceof s))return new s(a);if(o.constructor=s,a instanceof s){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Eh+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return tq(o,a.toString())}else if(typeof a!="string")throw Error(Eh+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Q2e.test(a))tq(o,a);else throw Error(Eh+a)}if(s.prototype=vt,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=GK,s.config=s.set=Y2e,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return s.config(e),s}function Y2e(e){if(!e||typeof e!="object")throw Error(io+"Object expected");var t,n,r,s=["precision",1,vv,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((r=e[n=s[t]])!==void 0)if(xv(r)===r&&r>=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(Eh+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Eh+n+": "+r);return this}var t5=GK(G2e);ha=new t5(1);const Un=t5;function X2e(e){return tSe(e)||eSe(e)||J2e(e)||Z2e()}function Z2e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
785In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J2e(e,t){if(e){if(typeof e=="string")return FO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return FO(e,t)}}function eSe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function tSe(e){if(Array.isArray(e))return FO(e)}function FO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var nSe=function(t){return t},QK={},YK=function(t){return t===QK},rq=function(t){return function n(){return arguments.length===0||arguments.length===1&&YK(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},rSe=function e(t,n){return t===1?n:rq(function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];var o=s.filter(function(l){return l!==QK}).length;return o>=t?n.apply(void 0,s):e(t-o,rq(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var h=s.map(function(d){return YK(d)?c.shift():d});return n.apply(void 0,X2e(h).concat(c))}))})},MN=function(t){return rSe(t.length,t)},$O=function(t,n){for(var r=[],s=t;s<n;++s)r[s-t]=s;return r},iSe=MN(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),sSe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return nSe;var s=n.reverse(),a=s[0],o=s.slice(1);return function(){return o.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},qO=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},XK=function(t){var n=null,r=null;return function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return n&&a.every(function(l,c){return l===n[c]})||(n=a,r=t.apply(void 0,a)),r}};function aSe(e){var t;return e===0?t=1:t=Math.floor(new Un(e).abs().log(10).toNumber())+1,t}function oSe(e,t,n){for(var r=new Un(e),s=0,a=[];r.lt(t)&&s<1e5;)a.push(r.toNumber()),r=r.add(n),s++;return a}var lSe=MN(function(e,t,n){var r=+e,s=+t;return r+n*(s-r)}),cSe=MN(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),uSe=MN(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const IN={rangeStep:oSe,getDigitCount:aSe,interpolateNumber:lSe,uninterpolateNumber:cSe,uninterpolateTruncation:uSe};function zO(e){return hSe(e)||fSe(e)||ZK(e)||dSe()}function dSe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
786In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fSe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function hSe(e){if(Array.isArray(e))return BO(e)}function my(e,t){return gSe(e)||pSe(e,t)||ZK(e,t)||mSe()}function mSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
787In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZK(e,t){if(e){if(typeof e=="string")return BO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BO(e,t)}}function BO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pSe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!1,a=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){s=!0,a=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(s)throw a}}return n}}function gSe(e){if(Array.isArray(e))return e}function JK(e){var t=my(e,2),n=t[0],r=t[1],s=n,a=r;return n>r&&(s=r,a=n),[s,a]}function eG(e,t,n){if(e.lte(0))return new Un(0);var r=IN.getDigitCount(e.toNumber()),s=new Un(10).pow(r),a=e.div(s),o=r!==1?.05:.1,l=new Un(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(s);return t?c:new Un(Math.ceil(c))}function vSe(e,t,n){var r=1,s=new Un(e);if(!s.isint()&&n){var a=Math.abs(e);a<1?(r=new Un(10).pow(IN.getDigitCount(e)-1),s=new Un(Math.floor(s.div(r).toNumber())).mul(r)):a>1&&(s=new Un(Math.floor(e)))}else e===0?s=new Un(Math.floor((t-1)/2)):n||(s=new Un(Math.floor(e)));var o=Math.floor((t-1)/2),l=sSe(iSe(function(c){return s.add(new Un(c-o).mul(r)).toNumber()}),$O);return l(0,t)}function tG(e,t,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Un(0),tickMin:new Un(0),tickMax:new Un(0)};var a=eG(new Un(t).sub(e).div(n-1),r,s),o;e<=0&&t>=0?o=new Un(0):(o=new Un(e).add(t).div(2),o=o.sub(new Un(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new Un(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?tG(e,t,n,r,s+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:a,tickMin:o.sub(new Un(l).mul(a)),tickMax:o.add(new Un(c).mul(a))})}function xSe(e){var t=my(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),l=JK([n,r]),c=my(l,2),u=c[0],h=c[1];if(u===-1/0||h===1/0){var d=h===1/0?[u].concat(zO($O(0,s-1).map(function(){return 1/0}))):[].concat(zO($O(0,s-1).map(function(){return-1/0})),[h]);return n>r?qO(d):d}if(u===h)return vSe(u,s,a);var m=tG(u,h,o,a),g=m.step,w=m.tickMin,v=m.tickMax,b=IN.rangeStep(w,v.add(new Un(.1).mul(g)),g);return n>r?qO(b):b}function ySe(e,t){var n=my(e,2),r=n[0],s=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=JK([r,s]),l=my(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,s];if(c===u)return[c];var h=Math.max(t,2),d=eG(new Un(u).sub(c).div(h-1),a,0),m=[].concat(zO(IN.rangeStep(new Un(c),new Un(u).sub(new Un(.99).mul(d)),d)),[u]);return r>s?qO(m):m}var bSe=XK(xSe),wSe=XK(ySe),jSe="Invariant failed";function Hh(e,t){throw new Error(jSe)}var _Se=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Rg(e){"@babel/helpers - typeof";return Rg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rg(e)}function Hj(){return Hj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hj.apply(this,arguments)}function NSe(e,t){return PSe(e)||ESe(e,t)||kSe(e,t)||SSe()}function SSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
788In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kSe(e,t){if(e){if(typeof e=="string")return iq(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iq(e,t)}}function iq(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ESe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function PSe(e){if(Array.isArray(e))return e}function CSe(e,t){if(e==null)return{};var n=ASe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ASe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function OSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TSe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iG(r.key),r)}}function RSe(e,t,n){return t&&TSe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function MSe(e,t,n){return t=Kj(t),ISe(e,nG()?Reflect.construct(t,n||[],Kj(e).constructor):t.apply(e,n))}function ISe(e,t){if(t&&(Rg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DSe(e)}function DSe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nG=function(){return!!e})()}function Kj(e){return Kj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Kj(e)}function LSe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&UO(e,t)}function UO(e,t){return UO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},UO(e,t)}function rG(e,t,n){return t=iG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iG(e){var t=FSe(e,"string");return Rg(t)=="symbol"?t:t+""}function FSe(e,t){if(Rg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var mb=(function(e){function t(){return OSe(this,t),MSe(this,t,arguments)}return LSe(t,e),RSe(t,[{key:"render",value:function(){var r=this.props,s=r.offset,a=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,h=r.xAxis,d=r.yAxis,m=CSe(r,_Se),g=wt(m,!1);this.props.direction==="x"&&h.type!=="number"&&Hh();var w=c.map(function(v){var b=u(v,l),y=b.x,_=b.y,N=b.value,j=b.errorVal;if(!j)return null;var S=[],C,P;if(Array.isArray(j)){var A=NSe(j,2);C=A[0],P=A[1]}else C=P=j;if(a==="vertical"){var F=h.scale,I=_+s,R=I+o,M=I-o,$=F(N-C),B=F(N+P);S.push({x1:B,y1:R,x2:B,y2:M}),S.push({x1:$,y1:I,x2:B,y2:I}),S.push({x1:$,y1:R,x2:$,y2:M})}else if(a==="horizontal"){var U=d.scale,G=y+s,Z=G-o,X=G+o,V=U(N-C),z=U(N+P);S.push({x1:Z,y1:z,x2:X,y2:z}),S.push({x1:G,y1:V,x2:G,y2:z}),S.push({x1:Z,y1:V,x2:X,y2:V})}return se.createElement(dn,Hj({className:"recharts-errorBar",key:"bar-".concat(S.map(function(L){return"".concat(L.x1,"-").concat(L.x2,"-").concat(L.y1,"-").concat(L.y2)}))},g),S.map(function(L){return se.createElement("line",Hj({},L,{key:"line-".concat(L.x1,"-").concat(L.x2,"-").concat(L.y1,"-").concat(L.y2)}))}))});return se.createElement(dn,{className:"recharts-errorBars"},w)}}])})(se.Component);rG(mb,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});rG(mb,"displayName","ErrorBar");function py(e){"@babel/helpers - typeof";return py=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},py(e)}function sq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Xf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sq(Object(n),!0).forEach(function(r){$Se(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Se(e,t,n){return t=qSe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qSe(e){var t=zSe(e,"string");return py(t)=="symbol"?t:t+""}function zSe(e,t){if(py(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(py(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sG=function(t){var n=t.children,r=t.formattedGraphicalItems,s=t.legendWidth,a=t.legendContent,o=da(n,Od);if(!o)return null;var l=Od.defaultProps,c=l!==void 0?Xf(Xf({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:a==="children"?u=(r||[]).reduce(function(h,d){var m=d.item,g=d.props,w=g.sectors||g.data||[];return h.concat(w.map(function(v){return{type:o.props.iconType||m.props.legendType,value:v.name,color:v.fill,payload:v}}))},[]):u=(r||[]).map(function(h){var d=h.item,m=d.type.defaultProps,g=m!==void 0?Xf(Xf({},m),d.props):{},w=g.dataKey,v=g.name,b=g.legendType,y=g.hide;return{inactive:y,dataKey:w,type:c.iconType||b||"square",color:n5(d),value:v||w,payload:g}}),Xf(Xf(Xf({},c),Od.getWithHeight(o,s)),{},{payload:u,item:o})};function gy(e){"@babel/helpers - typeof";return gy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gy(e)}function aq(e){return WSe(e)||VSe(e)||USe(e)||BSe()}function BSe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
789In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function USe(e,t){if(e){if(typeof e=="string")return VO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VO(e,t)}}function VSe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function WSe(e){if(Array.isArray(e))return VO(e)}function VO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oq(Object(n),!0).forEach(function(r){ng(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ng(e,t,n){return t=HSe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HSe(e){var t=KSe(e,"string");return gy(t)=="symbol"?t:t+""}function KSe(e,t){if(gy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wr(e,t,n){return zt(e)||zt(t)?n:oi(t)?va(e,t,n):At(t)?t(e):n}function R0(e,t,n,r){var s=H2e(e,function(l){return wr(l,t)});if(n==="number"){var a=s.filter(function(l){return et(l)||parseFloat(l)});return a.length?[RN(a),_d(a)]:[1/0,-1/0]}var o=r?s.filter(function(l){return!zt(l)}):s;return o.map(function(l){return oi(l)||l instanceof Date?l:""})}var GSe=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u<l;u++){var h=u>0?s[u-1].coordinate:s[l-1].coordinate,d=s[u].coordinate,m=u>=l-1?s[0].coordinate:s[u+1].coordinate,g=void 0;if(xs(d-h)!==xs(m-d)){var w=[];if(xs(m-d)===xs(c[1]-c[0])){g=m;var v=d+c[1]-c[0];w[0]=Math.min(v,(v+h)/2),w[1]=Math.max(v,(v+h)/2)}else{g=h;var b=m+c[1]-c[0];w[0]=Math.min(d,(b+d)/2),w[1]=Math.max(d,(b+d)/2)}var y=[Math.min(d,(g+d)/2),Math.max(d,(g+d)/2)];if(t>y[0]&&t<=y[1]||t>=w[0]&&t<=w[1]){o=s[u].index;break}}else{var _=Math.min(h,m),N=Math.max(h,m);if(t>(_+d)/2&&t<=(N+d)/2){o=s[u].index;break}}}else for(var j=0;j<l;j++)if(j===0&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j>0&&j<l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j===l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2){o=r[j].index;break}return o},n5=function(t){var n,r=t,s=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Cr(Cr({},t.type.defaultProps),t.props):t.props,o=a.stroke,l=a.fill,c;switch(s){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},QSe=function(t){var n=t.barSize,r=t.totalSize,s=t.stackGroups,a=s===void 0?{}:s;if(!a)return{};for(var o={},l=Object.keys(a),c=0,u=l.length;c<u;c++)for(var h=a[l[c]].stackGroups,d=Object.keys(h),m=0,g=d.length;m<g;m++){var w=h[d[m]],v=w.items,b=w.cateAxisId,y=v.filter(function(P){return Xc(P.type).indexOf("Bar")>=0});if(y&&y.length){var _=y[0].type.defaultProps,N=_!==void 0?Cr(Cr({},_),y[0].props):y[0].props,j=N.barSize,S=N[b];o[S]||(o[S]=[]);var C=zt(j)?n:j;o[S].push({item:y[0],stackList:y.slice(1),barSize:zt(C)?void 0:ys(C,r,0)})}}return o},YSe=function(t){var n=t.barGap,r=t.barCategoryGap,s=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=ys(n,s,0,!0),h,d=[];if(o[0].barSize===+o[0].barSize){var m=!1,g=s/c,w=o.reduce(function(j,S){return j+S.barSize||0},0);w+=(c-1)*u,w>=s&&(w-=(c-1)*u,u=0),w>=s&&g>0&&(m=!0,g*=.9,w=c*g);var v=(s-w)/2>>0,b={offset:v-u,size:0};h=o.reduce(function(j,S){var C={item:S.item,position:{offset:b.offset+b.size+u,size:m?g:S.barSize}},P=[].concat(aq(j),[C]);return b=P[P.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(A){P.push({item:A,position:b})}),P},d)}else{var y=ys(r,s,0,!0);s-2*y-(c-1)*u<=0&&(u=0);var _=(s-2*y-(c-1)*u)/c;_>1&&(_>>=0);var N=l===+l?Math.min(_,l):_;h=o.reduce(function(j,S,C){var P=[].concat(aq(j),[{item:S.item,position:{offset:y+(_+u)*C+(_-N)/2,size:N}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(A){P.push({item:A,position:P[P.length-1].position})}),P},d)}return h},XSe=function(t,n,r,s){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=sG({children:a,legendWidth:c});if(u){var h=s||{},d=h.width,m=h.height,g=u.align,w=u.verticalAlign,v=u.layout;if((v==="vertical"||v==="horizontal"&&w==="middle")&&g!=="center"&&et(t[g]))return Cr(Cr({},t),{},ng({},g,t[g]+(d||0)));if((v==="horizontal"||v==="vertical"&&g==="center")&&w!=="middle"&&et(t[w]))return Cr(Cr({},t),{},ng({},w,t[w]+(m||0)))}return t},ZSe=function(t,n,r){return zt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},aG=function(t,n,r,s,a){var o=n.props.children,l=xa(o,mb).filter(function(u){return ZSe(s,a,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,h){var d=wr(h,r);if(zt(d))return u;var m=Array.isArray(d)?[RN(d),_d(d)]:[d,d],g=c.reduce(function(w,v){var b=wr(h,v,0),y=m[0]-Math.abs(Array.isArray(b)?b[0]:b),_=m[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(y,w[0]),Math.max(_,w[1])]},[1/0,-1/0]);return[Math.min(g[0],u[0]),Math.max(g[1],u[1])]},[1/0,-1/0])}return null},JSe=function(t,n,r,s,a){var o=n.map(function(l){return aG(t,l,r,a,s)}).filter(function(l){return!zt(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},oG=function(t,n,r,s,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&aG(t,c,u,s)||R0(t,u,r,a)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var h=0,d=u.length;h<d;h++)l[u[h]]||(l[u[h]]=!0,c.push(u[h]));return c},[])},lG=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},cG=function(t,n,r,s){if(s)return t.map(function(c){return c.coordinate});var a,o,l=t.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(o=!0),c.coordinate});return a||l.push(n),o||l.push(r),l},Hc=function(t,n,r){if(!t)return null;var s=t.scale,a=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?s.bandwidth()/2:2,u=(n||r)&&o==="category"&&s.bandwidth?s.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?xs(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(d){var m=a?a.indexOf(d):d;return{coordinate:s(m)+u,value:d,offset:u}});return h.filter(function(d){return!mv(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,m){return{coordinate:s(d)+u,value:d,index:m,offset:u}}):s.ticks&&!r?s.ticks(t.tickCount).map(function(d){return{coordinate:s(d)+u,value:d,offset:u}}):s.domain().map(function(d,m){return{coordinate:s(d)+u,value:a?a[d]:d,index:m,offset:u}})},bC=new WeakMap,N1=function(t,n){if(typeof n!="function")return t;bC.has(t)||bC.set(t,new WeakMap);var r=bC.get(t);if(r.has(n))return r.get(n);var s=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,s),s},uG=function(t,n,r){var s=t.scale,a=t.type,o=t.layout,l=t.axisType;if(s==="auto")return o==="radial"&&l==="radiusAxis"?{scale:ly(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:zj(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:T0(),realScaleType:"point"}:a==="category"?{scale:ly(),realScaleType:"band"}:{scale:zj(),realScaleType:"linear"};if(Bh(s)){var c="scale".concat(yN(s));return{scale:(K$[c]||T0)(),realScaleType:K$[c]?c:"point"}}return At(s)?{scale:s}:{scale:T0(),realScaleType:"point"}},lq=1e-4,dG=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,s=t.range(),a=Math.min(s[0],s[1])-lq,o=Math.max(s[0],s[1])+lq,l=t(n[0]),c=t(n[r-1]);(l<a||l>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},eke=function(t,n){if(!t)return null;for(var r=0,s=t.length;r<s;r++)if(t[r].item===n)return t[r].position;return null},tke=function(t,n){if(!n||n.length!==2||!et(n[0])||!et(n[1]))return t;var r=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]),a=[t[0],t[1]];return(!et(t[0])||t[0]<r)&&(a[0]=r),(!et(t[1])||t[1]>s)&&(a[1]=s),a[0]>s&&(a[0]=s),a[1]<r&&(a[1]=r),a},nke=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var a=0,o=0,l=0;l<n;++l){var c=mv(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=a,t[l][r][1]=a+c,a=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},rke=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var a=0,o=0;o<n;++o){var l=mv(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=a,t[o][r][1]=a+l,a=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},ike={sign:nke,expand:jwe,none:Sg,silhouette:_we,wiggle:Nwe,positive:rke},ske=function(t,n,r){var s=n.map(function(l){return l.props.dataKey}),a=ike[r],o=wwe().keys(s).value(function(l,c){return+wr(l,c,0)}).order(bO).offset(a);return o(t)},ake=function(t,n,r,s,a,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(d,m){var g,w=(g=m.type)!==null&&g!==void 0&&g.defaultProps?Cr(Cr({},m.type.defaultProps),m.props):m.props,v=w.stackId,b=w.hide;if(b)return d;var y=w[r],_=d[y]||{hasStack:!1,stackGroups:{}};if(oi(v)){var N=_.stackGroups[v]||{numericAxisId:r,cateAxisId:s,items:[]};N.items.push(m),_.hasStack=!0,_.stackGroups[v]=N}else _.stackGroups[tm("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[m]};return Cr(Cr({},d),{},ng({},y,_))},c),h={};return Object.keys(u).reduce(function(d,m){var g=u[m];if(g.hasStack){var w={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(v,b){var y=g.stackGroups[b];return Cr(Cr({},v),{},ng({},b,{numericAxisId:r,cateAxisId:s,items:y.items,stackedData:ske(t,y.items,a)}))},w)}return Cr(Cr({},d),{},ng({},m,g))},h)},fG=function(t,n){var r=n.realScaleType,s=n.type,a=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var h=bSe(u,a,l);return t.domain([RN(h),_d(h)]),{niceTicks:h}}if(a&&s==="number"){var d=t.domain(),m=wSe(d,a,l);return{niceTicks:m}}return null};function Gj(e){var t=e.axis,n=e.ticks,r=e.bandSize,s=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!zt(s[t.dataKey])){var l=_j(n,"value",s[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=wr(s,zt(o)?t.dataKey:o);return zt(c)?null:t.scale(c)}var cq=function(t){var n=t.axis,r=t.ticks,s=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+s:null;var c=wr(o,n.dataKey,n.domain[l]);return zt(c)?null:n.scale(c)-a/2+s},oke=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var s=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return s<=0&&a>=0?0:a<0?a:s}return r[0]},lke=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Cr(Cr({},t.type.defaultProps),t.props):t.props,a=s.stackId;if(oi(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},cke=function(t){return t.reduce(function(n,r){return[RN(r.concat([n[0]]).filter(et)),_d(r.concat([n[1]]).filter(et))]},[1/0,-1/0])},hG=function(t,n,r){return Object.keys(t).reduce(function(s,a){var o=t[a],l=o.stackedData,c=l.reduce(function(u,h){var d=cke(h.slice(n,r+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},uq=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,dq=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,WO=function(t,n,r){if(At(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(et(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(uq.test(t[0])){var a=+uq.exec(t[0])[1];s[0]=n[0]-a}else At(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(et(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if(dq.test(t[1])){var o=+dq.exec(t[1])[1];s[1]=n[1]+o}else At(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},Qj=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!r||s>0)return s}if(t&&n&&n.length>=2){for(var a=AR(n,function(d){return d.coordinate}),o=1/0,l=1,c=a.length;l<c;l++){var u=a[l],h=a[l-1];o=Math.min((u.coordinate||0)-(h.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},fq=function(t,n,r){return!t||!t.length||Bd(t,va(r,"type.defaultProps.domain"))?n:t},mG=function(t,n){var r=t.type.defaultProps?Cr(Cr({},t.type.defaultProps),t.props):t.props,s=r.dataKey,a=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,h=r.hide;return Cr(Cr({},wt(t,!1)),{},{dataKey:s,unit:o,formatter:l,name:a||s,color:n5(t),value:wr(n,s),type:c,payload:n,chartType:u,hide:h})};function vy(e){"@babel/helpers - typeof";return vy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vy(e)}function hq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Mc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hq(Object(n),!0).forEach(function(r){pG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pG(e,t,n){return t=uke(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uke(e){var t=dke(e,"string");return vy(t)=="symbol"?t:t+""}function dke(e,t){if(vy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fke(e,t){return gke(e)||pke(e,t)||mke(e,t)||hke()}function hke(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
790In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mke(e,t){if(e){if(typeof e=="string")return mq(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mq(e,t)}}function mq(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pke(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function gke(e){if(Array.isArray(e))return e}var Yj=Math.PI/180,vke=function(t){return t*180/Math.PI},Tn=function(t,n,r,s){return{x:t+Math.cos(-Yj*s)*r,y:n+Math.sin(-Yj*s)*r}},gG=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},vG=function(t,n,r,s,a){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,h=ys(t.cx,o,o/2),d=ys(t.cy,l,l/2),m=gG(o,l,r),g=ys(t.innerRadius,m,0),w=ys(t.outerRadius,m,m*.8),v=Object.keys(n);return v.reduce(function(b,y){var _=n[y],N=_.domain,j=_.reversed,S;if(zt(_.range))s==="angleAxis"?S=[c,u]:s==="radiusAxis"&&(S=[g,w]),j&&(S=[S[1],S[0]]);else{S=_.range;var C=S,P=fke(C,2);c=P[0],u=P[1]}var A=uG(_,a),F=A.realScaleType,I=A.scale;I.domain(N).range(S),dG(I);var R=fG(I,Mc(Mc({},_),{},{realScaleType:F})),M=Mc(Mc(Mc({},_),R),{},{range:S,radius:w,realScaleType:F,scale:I,cx:h,cy:d,innerRadius:g,outerRadius:w,startAngle:c,endAngle:u});return Mc(Mc({},b),{},pG({},y,M))},{})},xke=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(s-o,2))},yke=function(t,n){var r=t.x,s=t.y,a=n.cx,o=n.cy,l=xke({x:r,y:s},{x:a,y:o});if(l<=0)return{radius:l};var c=(r-a)/l,u=Math.acos(c);return s>o&&(u=2*Math.PI-u),{radius:l,angle:vke(u),angleInRadian:u}},bke=function(t){var n=t.startAngle,r=t.endAngle,s=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(s,a);return{startAngle:n-o*360,endAngle:r-o*360}},wke=function(t,n){var r=n.startAngle,s=n.endAngle,a=Math.floor(r/360),o=Math.floor(s/360),l=Math.min(a,o);return t+l*360},pq=function(t,n){var r=t.x,s=t.y,a=yke({x:r,y:s},n),o=a.radius,l=a.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var h=bke(n),d=h.startAngle,m=h.endAngle,g=l,w;if(d<=m){for(;g>m;)g-=360;for(;g<d;)g+=360;w=g>=d&&g<=m}else{for(;g>d;)g-=360;for(;g<m;)g+=360;w=g>=m&&g<=d}return w?Mc(Mc({},n),{},{radius:o,angle:wke(g,n)}):null},xG=function(t){return!O.isValidElement(t)&&!At(t)&&typeof t!="boolean"?t.className:""};function xy(e){"@babel/helpers - typeof";return xy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xy(e)}var jke=["offset"];function _ke(e){return Eke(e)||kke(e)||Ske(e)||Nke()}function Nke(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
791In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ske(e,t){if(e){if(typeof e=="string")return HO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HO(e,t)}}function kke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Eke(e){if(Array.isArray(e))return HO(e)}function HO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Pke(e,t){if(e==null)return{};var n=Cke(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cke(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function gq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ii(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gq(Object(n),!0).forEach(function(r){Ake(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ake(e,t,n){return t=Oke(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oke(e){var t=Tke(e,"string");return xy(t)=="symbol"?t:t+""}function Tke(e,t){if(xy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yy(){return yy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yy.apply(this,arguments)}var Rke=function(t){var n=t.value,r=t.formatter,s=zt(t.children)?n:t.children;return At(r)?r(s):s},Mke=function(t,n){var r=xs(n-t),s=Math.min(Math.abs(n-t),360);return r*s},Ike=function(t,n,r){var s=t.position,a=t.viewBox,o=t.offset,l=t.className,c=a,u=c.cx,h=c.cy,d=c.innerRadius,m=c.outerRadius,g=c.startAngle,w=c.endAngle,v=c.clockWise,b=(d+m)/2,y=Mke(g,w),_=y>=0?1:-1,N,j;s==="insideStart"?(N=g+_*o,j=v):s==="insideEnd"?(N=w-_*o,j=!v):s==="end"&&(N=w+_*o,j=v),j=y<=0?j:!j;var S=Tn(u,h,b,N),C=Tn(u,h,b,N+(j?1:-1)*359),P="M".concat(S.x,",").concat(S.y,`
792    A`).concat(b,",").concat(b,",0,1,").concat(j?0:1,`,
793    `).concat(C.x,",").concat(C.y),A=zt(t.id)?tm("recharts-radial-line-"):t.id;return se.createElement("text",yy({},r,{dominantBaseline:"central",className:Tt("recharts-radial-bar-label",l)}),se.createElement("defs",null,se.createElement("path",{id:A,d:P})),se.createElement("textPath",{xlinkHref:"#".concat(A)},n))},Dke=function(t){var n=t.viewBox,r=t.offset,s=t.position,a=n,o=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,h=a.startAngle,d=a.endAngle,m=(h+d)/2;if(s==="outside"){var g=Tn(o,l,u+r,m),w=g.x,v=g.y;return{x:w,y:v,textAnchor:w>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var b=(c+u)/2,y=Tn(o,l,b,m),_=y.x,N=y.y;return{x:_,y:N,textAnchor:"middle",verticalAnchor:"middle"}},Lke=function(t){var n=t.viewBox,r=t.parentViewBox,s=t.offset,a=t.position,o=n,l=o.x,c=o.y,u=o.width,h=o.height,d=h>=0?1:-1,m=d*s,g=d>0?"end":"start",w=d>0?"start":"end",v=u>=0?1:-1,b=v*s,y=v>0?"end":"start",_=v>0?"start":"end";if(a==="top"){var N={x:l+u/2,y:c-d*s,textAnchor:"middle",verticalAnchor:g};return ii(ii({},N),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var j={x:l+u/2,y:c+h+m,textAnchor:"middle",verticalAnchor:w};return ii(ii({},j),r?{height:Math.max(r.y+r.height-(c+h),0),width:u}:{})}if(a==="left"){var S={x:l-b,y:c+h/2,textAnchor:y,verticalAnchor:"middle"};return ii(ii({},S),r?{width:Math.max(S.x-r.x,0),height:h}:{})}if(a==="right"){var C={x:l+u+b,y:c+h/2,textAnchor:_,verticalAnchor:"middle"};return ii(ii({},C),r?{width:Math.max(r.x+r.width-C.x,0),height:h}:{})}var P=r?{width:u,height:h}:{};return a==="insideLeft"?ii({x:l+b,y:c+h/2,textAnchor:_,verticalAnchor:"middle"},P):a==="insideRight"?ii({x:l+u-b,y:c+h/2,textAnchor:y,verticalAnchor:"middle"},P):a==="insideTop"?ii({x:l+u/2,y:c+m,textAnchor:"middle",verticalAnchor:w},P):a==="insideBottom"?ii({x:l+u/2,y:c+h-m,textAnchor:"middle",verticalAnchor:g},P):a==="insideTopLeft"?ii({x:l+b,y:c+m,textAnchor:_,verticalAnchor:w},P):a==="insideTopRight"?ii({x:l+u-b,y:c+m,textAnchor:y,verticalAnchor:w},P):a==="insideBottomLeft"?ii({x:l+b,y:c+h-m,textAnchor:_,verticalAnchor:g},P):a==="insideBottomRight"?ii({x:l+u-b,y:c+h-m,textAnchor:y,verticalAnchor:g},P):hv(a)&&(et(a.x)||uh(a.x))&&(et(a.y)||uh(a.y))?ii({x:l+ys(a.x,u),y:c+ys(a.y,h),textAnchor:"end",verticalAnchor:"end"},P):ii({x:l+u/2,y:c+h/2,textAnchor:"middle",verticalAnchor:"middle"},P)},Fke=function(t){return"cx"in t&&et(t.cx)};function Ni(e){var t=e.offset,n=t===void 0?5:t,r=Pke(e,jke),s=ii({offset:n},r),a=s.viewBox,o=s.position,l=s.value,c=s.children,u=s.content,h=s.className,d=h===void 0?"":h,m=s.textBreakAll;if(!a||zt(l)&&zt(c)&&!O.isValidElement(u)&&!At(u))return null;if(O.isValidElement(u))return O.cloneElement(u,s);var g;if(At(u)){if(g=O.createElement(u,s),O.isValidElement(g))return g}else g=Rke(s);var w=Fke(a),v=wt(s,!0);if(w&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Ike(s,g,v);var b=w?Dke(s):Lke(s);return se.createElement(Vh,yy({className:Tt("recharts-label",d)},v,b,{breakAll:m}),g)}Ni.displayName="Label";var yG=function(t){var n=t.cx,r=t.cy,s=t.angle,a=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,h=t.outerRadius,d=t.x,m=t.y,g=t.top,w=t.left,v=t.width,b=t.height,y=t.clockWise,_=t.labelViewBox;if(_)return _;if(et(v)&&et(b)){if(et(d)&&et(m))return{x:d,y:m,width:v,height:b};if(et(g)&&et(w))return{x:g,y:w,width:v,height:b}}return et(d)&&et(m)?{x:d,y:m,width:0,height:0}:et(n)&&et(r)?{cx:n,cy:r,startAngle:a||s||0,endAngle:o||s||0,innerRadius:u||0,outerRadius:h||c||l||0,clockWise:y}:t.viewBox?t.viewBox:{}},$ke=function(t,n){return t?t===!0?se.createElement(Ni,{key:"label-implicit",viewBox:n}):oi(t)?se.createElement(Ni,{key:"label-implicit",viewBox:n,value:t}):O.isValidElement(t)?t.type===Ni?O.cloneElement(t,{key:"label-implicit",viewBox:n}):se.createElement(Ni,{key:"label-implicit",content:t,viewBox:n}):At(t)?se.createElement(Ni,{key:"label-implicit",content:t,viewBox:n}):hv(t)?se.createElement(Ni,yy({viewBox:n},t,{key:"label-implicit"})):null:null},qke=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var s=t.children,a=yG(t),o=xa(s,Ni).map(function(c,u){return O.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=$ke(t.label,n||a);return[l].concat(_ke(o))};Ni.parseViewBox=yG;Ni.renderCallByParent=qke;var wC,vq;function zke(){if(vq)return wC;vq=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return wC=e,wC}var Bke=zke();const bG=En(Bke);function by(e){"@babel/helpers - typeof";return by=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},by(e)}var Uke=["valueAccessor"],Vke=["data","dataKey","clockWise","id","textBreakAll"];function Wke(e){return Qke(e)||Gke(e)||Kke(e)||Hke()}function Hke(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
794In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kke(e,t){if(e){if(typeof e=="string")return KO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KO(e,t)}}function Gke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qke(e){if(Array.isArray(e))return KO(e)}function KO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xj(){return Xj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xj.apply(this,arguments)}function xq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function yq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xq(Object(n),!0).forEach(function(r){Yke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yke(e,t,n){return t=Xke(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xke(e){var t=Zke(e,"string");return by(t)=="symbol"?t:t+""}function Zke(e,t){if(by(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(by(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bq(e,t){if(e==null)return{};var n=Jke(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jke(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var eEe=function(t){return Array.isArray(t.value)?bG(t.value):t.value};function Uo(e){var t=e.valueAccessor,n=t===void 0?eEe:t,r=bq(e,Uke),s=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=bq(r,Vke);return!s||!s.length?null:se.createElement(dn,{className:"recharts-label-list"},s.map(function(h,d){var m=zt(a)?n(h,d):wr(h&&h.payload,a),g=zt(l)?{}:{id:"".concat(l,"-").concat(d)};return se.createElement(Ni,Xj({},wt(h,!0),u,g,{parentViewBox:h.parentViewBox,value:m,textBreakAll:c,viewBox:Ni.parseViewBox(zt(o)?h:yq(yq({},h),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}Uo.displayName="LabelList";function tEe(e,t){return e?e===!0?se.createElement(Uo,{key:"labelList-implicit",data:t}):se.isValidElement(e)||At(e)?se.createElement(Uo,{key:"labelList-implicit",data:t,content:e}):hv(e)?se.createElement(Uo,Xj({data:t},e,{key:"labelList-implicit"})):null:null}function nEe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,s=xa(r,Uo).map(function(o,l){return O.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return s;var a=tEe(e.label,t);return[a].concat(Wke(s))}Uo.renderCallByParent=nEe;function wy(e){"@babel/helpers - typeof";return wy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wy(e)}function GO(){return GO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GO.apply(this,arguments)}function wq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function jq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wq(Object(n),!0).forEach(function(r){rEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rEe(e,t,n){return t=iEe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iEe(e){var t=sEe(e,"string");return wy(t)=="symbol"?t:t+""}function sEe(e,t){if(wy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aEe=function(t,n){var r=xs(n-t),s=Math.min(Math.abs(n-t),359.999);return r*s},S1=function(t){var n=t.cx,r=t.cy,s=t.radius,a=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,h=c*(l?1:-1)+s,d=Math.asin(c/h)/Yj,m=u?a:a+o*d,g=Tn(n,r,h,m),w=Tn(n,r,s,m),v=u?a-o*d:a,b=Tn(n,r,h*Math.cos(d*Yj),v);return{center:g,circleTangency:w,lineTangency:b,theta:d}},wG=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=aEe(o,l),u=o+c,h=Tn(n,r,a,o),d=Tn(n,r,a,u),m="M ".concat(h.x,",").concat(h.y,`
795    A `).concat(a,",").concat(a,`,0,
796    `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
797    `).concat(d.x,",").concat(d.y,`
798  `);if(s>0){var g=Tn(n,r,s,o),w=Tn(n,r,s,u);m+="L ".concat(w.x,",").concat(w.y,`
799            A `).concat(s,",").concat(s,`,0,
800            `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
801            `).concat(g.x,",").concat(g.y," Z")}else m+="L ".concat(n,",").concat(r," Z");return m},oEe=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,h=t.endAngle,d=xs(h-u),m=S1({cx:n,cy:r,radius:a,angle:u,sign:d,cornerRadius:o,cornerIsExternal:c}),g=m.circleTangency,w=m.lineTangency,v=m.theta,b=S1({cx:n,cy:r,radius:a,angle:h,sign:-d,cornerRadius:o,cornerIsExternal:c}),y=b.circleTangency,_=b.lineTangency,N=b.theta,j=c?Math.abs(u-h):Math.abs(u-h)-v-N;if(j<0)return l?"M ".concat(w.x,",").concat(w.y,`
802        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
803        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
804      `):wG({cx:n,cy:r,innerRadius:s,outerRadius:a,startAngle:u,endAngle:h});var S="M ".concat(w.x,",").concat(w.y,`
805    A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(g.x,",").concat(g.y,`
806    A`).concat(a,",").concat(a,",0,").concat(+(j>180),",").concat(+(d<0),",").concat(y.x,",").concat(y.y,`
807    A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(_.x,",").concat(_.y,`
808  `);if(s>0){var C=S1({cx:n,cy:r,radius:s,angle:u,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),P=C.circleTangency,A=C.lineTangency,F=C.theta,I=S1({cx:n,cy:r,radius:s,angle:h,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),R=I.circleTangency,M=I.lineTangency,$=I.theta,B=c?Math.abs(u-h):Math.abs(u-h)-F-$;if(B<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(M.x,",").concat(M.y,`
809      A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(R.x,",").concat(R.y,`
810      A`).concat(s,",").concat(s,",0,").concat(+(B>180),",").concat(+(d>0),",").concat(P.x,",").concat(P.y,`
811      A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(A.x,",").concat(A.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},lEe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},jG=function(t){var n=jq(jq({},lEe),t),r=n.cx,s=n.cy,a=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,h=n.startAngle,d=n.endAngle,m=n.className;if(o<a||h===d)return null;var g=Tt("recharts-sector",m),w=o-a,v=ys(l,w,0,!0),b;return v>0&&Math.abs(h-d)<360?b=oEe({cx:r,cy:s,innerRadius:a,outerRadius:o,cornerRadius:Math.min(v,w/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:h,endAngle:d}):b=wG({cx:r,cy:s,innerRadius:a,outerRadius:o,startAngle:h,endAngle:d}),se.createElement("path",GO({},wt(n,!0),{className:g,d:b,role:"img"}))};function jy(e){"@babel/helpers - typeof";return jy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jy(e)}function QO(){return QO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QO.apply(this,arguments)}function _q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Nq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_q(Object(n),!0).forEach(function(r){cEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_q(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cEe(e,t,n){return t=uEe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uEe(e){var t=dEe(e,"string");return jy(t)=="symbol"?t:t+""}function dEe(e,t){if(jy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sq={curveBasisClosed:uwe,curveBasisOpen:dwe,curveBasis:cwe,curveBumpX:Qbe,curveBumpY:Ybe,curveLinearClosed:fwe,curveLinear:wN,curveMonotoneX:hwe,curveMonotoneY:mwe,curveNatural:pwe,curveStep:gwe,curveStepAfter:xwe,curveStepBefore:vwe},k1=function(t){return t.x===+t.x&&t.y===+t.y},l0=function(t){return t.x},c0=function(t){return t.y},fEe=function(t,n){if(At(t))return t;var r="curve".concat(yN(t));return(r==="curveMonotone"||r==="curveBump")&&n?Sq["".concat(r).concat(n==="vertical"?"Y":"X")]:Sq[r]||wN},hEe=function(t){var n=t.type,r=n===void 0?"linear":n,s=t.points,a=s===void 0?[]:s,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,h=fEe(r,l),d=u?a.filter(function(v){return k1(v)}):a,m;if(Array.isArray(o)){var g=u?o.filter(function(v){return k1(v)}):o,w=d.map(function(v,b){return Nq(Nq({},v),{},{base:g[b]})});return l==="vertical"?m=v1().y(c0).x1(l0).x0(function(v){return v.base.x}):m=v1().x(l0).y1(c0).y0(function(v){return v.base.y}),m.defined(k1).curve(h),m(w)}return l==="vertical"&&et(o)?m=v1().y(c0).x1(l0).x0(o):et(o)?m=v1().x(l0).y1(c0).y0(o):m=CH().x(l0).y(c0),m.defined(k1).curve(h),m(d)},Ph=function(t){var n=t.className,r=t.points,s=t.path,a=t.pathRef;if((!r||!r.length)&&!s)return null;var o=r&&r.length?hEe(t):s;return O.createElement("path",QO({},wt(t,!1),Nj(t),{className:Tt("recharts-curve",n),d:o,ref:a}))},jC={exports:{}},_C,kq;function mEe(){if(kq)return _C;kq=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return _C=e,_C}var NC,Eq;function pEe(){if(Eq)return NC;Eq=1;var e=mEe();function t(){}function n(){}return n.resetWarningCache=t,NC=function(){function r(o,l,c,u,h,d){if(d!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function s(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},NC}var Pq;function gEe(){return Pq||(Pq=1,jC.exports=pEe()()),jC.exports}var vEe=gEe();const Dn=En(vEe);var xEe=Object.getOwnPropertyNames,yEe=Object.getOwnPropertySymbols,bEe=Object.prototype.hasOwnProperty;function Cq(e,t){return function(r,s,a){return e(r,s,a)&&t(r,s,a)}}function E1(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);var a=s.cache,o=a.get(n),l=a.get(r);if(o&&l)return o===r&&l===n;a.set(n,r),a.set(r,n);var c=e(n,r,s);return a.delete(n),a.delete(r),c}}function Aq(e){return xEe(e).concat(yEe(e))}var wEe=Object.hasOwn||(function(e,t){return bEe.call(e,t)});function im(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var jEe="__v",_Ee="__o",NEe="_owner",Oq=Object.getOwnPropertyDescriptor,Tq=Object.keys;function SEe(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function kEe(e,t){return im(e.getTime(),t.getTime())}function EEe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function PEe(e,t){return e===t}function Rq(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),a=e.entries(),o,l,c=0;(o=a.next())&&!o.done;){for(var u=t.entries(),h=!1,d=0;(l=u.next())&&!l.done;){if(s[d]){d++;continue}var m=o.value,g=l.value;if(n.equals(m[0],g[0],c,d,e,t,n)&&n.equals(m[1],g[1],m[0],g[0],e,t,n)){h=s[d]=!0;break}d++}if(!h)return!1;c++}return!0}var CEe=im;function AEe(e,t,n){var r=Tq(e),s=r.length;if(Tq(t).length!==s)return!1;for(;s-- >0;)if(!_G(e,t,n,r[s]))return!1;return!0}function u0(e,t,n){var r=Aq(e),s=r.length;if(Aq(t).length!==s)return!1;for(var a,o,l;s-- >0;)if(a=r[s],!_G(e,t,n,a)||(o=Oq(e,a),l=Oq(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function OEe(e,t){return im(e.valueOf(),t.valueOf())}function TEe(e,t){return e.source===t.source&&e.flags===t.flags}function Mq(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),a=e.values(),o,l;(o=a.next())&&!o.done;){for(var c=t.values(),u=!1,h=0;(l=c.next())&&!l.done;){if(!s[h]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=s[h]=!0;break}h++}if(!u)return!1}return!0}function REe(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function MEe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function _G(e,t,n,r){return(r===NEe||r===_Ee||r===jEe)&&(e.$$typeof||t.$$typeof)?!0:wEe(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var IEe="[object Arguments]",DEe="[object Boolean]",LEe="[object Date]",FEe="[object Error]",$Ee="[object Map]",qEe="[object Number]",zEe="[object Object]",BEe
811="[object RegExp]",UEe="[object Set]",VEe="[object String]",WEe="[object URL]",HEe=Array.isArray,Iq=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Dq=Object.assign,KEe=Object.prototype.toString.call.bind(Object.prototype.toString);function GEe(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,s=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,h=e.areSetsEqual,d=e.areTypedArraysEqual,m=e.areUrlsEqual;return function(w,v,b){if(w===v)return!0;if(w==null||v==null)return!1;var y=typeof w;if(y!==typeof v)return!1;if(y!=="object")return y==="number"?o(w,v,b):y==="function"?s(w,v,b):!1;var _=w.constructor;if(_!==v.constructor)return!1;if(_===Object)return l(w,v,b);if(HEe(w))return t(w,v,b);if(Iq!=null&&Iq(w))return d(w,v,b);if(_===Date)return n(w,v,b);if(_===RegExp)return u(w,v,b);if(_===Map)return a(w,v,b);if(_===Set)return h(w,v,b);var N=KEe(w);return N===LEe?n(w,v,b):N===BEe?u(w,v,b):N===$Ee?a(w,v,b):N===UEe?h(w,v,b):N===zEe?typeof w.then!="function"&&typeof v.then!="function"&&l(w,v,b):N===WEe?m(w,v,b):N===FEe?r(w,v,b):N===IEe?l(w,v,b):N===DEe||N===qEe||N===VEe?c(w,v,b):!1}}function QEe(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,s={areArraysEqual:r?u0:SEe,areDatesEqual:kEe,areErrorsEqual:EEe,areFunctionsEqual:PEe,areMapsEqual:r?Cq(Rq,u0):Rq,areNumbersEqual:CEe,areObjectsEqual:r?u0:AEe,arePrimitiveWrappersEqual:OEe,areRegExpsEqual:TEe,areSetsEqual:r?Cq(Mq,u0):Mq,areTypedArraysEqual:r?u0:REe,areUrlsEqual:MEe};if(n&&(s=Dq({},s,n(s))),t){var a=E1(s.areArraysEqual),o=E1(s.areMapsEqual),l=E1(s.areObjectsEqual),c=E1(s.areSetsEqual);s=Dq({},s,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return s}function YEe(e){return function(t,n,r,s,a,o,l){return e(t,n,l)}}function XEe(e){var t=e.circular,n=e.comparator,r=e.createState,s=e.equals,a=e.strict;if(r)return function(c,u){var h=r(),d=h.cache,m=d===void 0?t?new WeakMap:void 0:d,g=h.meta;return n(c,u,{cache:m,equals:s,meta:g,strict:a})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:s,meta:void 0,strict:a})};var o={cache:void 0,equals:s,meta:void 0,strict:a};return function(c,u){return n(c,u,o)}}var ZEe=Qd();Qd({strict:!0});Qd({circular:!0});Qd({circular:!0,strict:!0});Qd({createInternalComparator:function(){return im}});Qd({strict:!0,createInternalComparator:function(){return im}});Qd({circular:!0,createInternalComparator:function(){return im}});Qd({circular:!0,createInternalComparator:function(){return im},strict:!0});function Qd(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,s=e.createState,a=e.strict,o=a===void 0?!1:a,l=QEe(e),c=GEe(l),u=r?r(c):YEe(c);return XEe({circular:n,comparator:c,createState:s,equals:u,strict:o})}function JEe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Lq(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function s(a){n<0&&(n=a),a-n>t?(e(a),n=-1):JEe(s)};requestAnimationFrame(r)}function YO(e){"@babel/helpers - typeof";return YO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},YO(e)}function ePe(e){return iPe(e)||rPe(e)||nPe(e)||tPe()}function tPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
812In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nPe(e,t){if(e){if(typeof e=="string")return Fq(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fq(e,t)}}function Fq(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rPe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iPe(e){if(Array.isArray(e))return e}function sPe(){var e={},t=function(){return null}
vendor: 63,652 bytes, lines 812-830
812,n=!1,r=function s(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var o=a,l=ePe(o),c=l[0],u=l.slice(1);if(typeof c=="number"){Lq(s.bind(null,u),c);return}s(c),Lq(s.bind(null,u));return}YO(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){n=!0},start:function(a){n=!1,r(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function _y(e){"@babel/helpers - typeof";return _y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_y(e)}function $q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function qq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$q(Object(n),!0).forEach(function(r){NG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$q(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NG(e,t,n){return t=aPe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aPe(e){var t=oPe(e,"string");return _y(t)==="symbol"?t:String(t)}function oPe(e,t){if(_y(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_y(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lPe=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,s){return r.filter(function(a){return s.includes(a)})})},cPe=function(t){return t},uPe=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},M0=function(t,n){return Object.keys(n).reduce(function(r,s){return qq(qq({},r),{},NG({},s,t(s,n[s])))},{})},zq=function(t,n,r){return t.map(function(s){return"".concat(uPe(s)," ").concat(n,"ms ").concat(r)}).join(",")};function dPe(e,t){return mPe(e)||hPe(e,t)||SG(e,t)||fPe()}function fPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
813In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hPe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function mPe(e){if(Array.isArray(e))return e}function pPe(e){return xPe(e)||vPe(e)||SG(e)||gPe()}function gPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
814In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SG(e,t){if(e){if(typeof e=="string")return XO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XO(e,t)}}function vPe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xPe(e){if(Array.isArray(e))return XO(e)}function XO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Zj=1e-4,kG=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},EG=function(t,n){return t.map(function(r,s){return r*Math.pow(n,s)}).reduce(function(r,s){return r+s})},Bq=function(t,n){return function(r){var s=kG(t,n);return EG(s,r)}},yPe=function(t,n){return function(r){var s=kG(t,n),a=[].concat(pPe(s.map(function(o,l){return o*l}).slice(1)),[0]);return EG(a,r)}},Uq=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0],a=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":s=0,a=0,o=1,l=1;break;case"ease":s=.25,a=.1,o=.25,l=1;break;case"ease-in":s=.42,a=0,o=1,l=1;break;case"ease-out":s=.42,a=0,o=.58,l=1;break;case"ease-in-out":s=0,a=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),h=dPe(u,4);s=h[0],a=h[1],o=h[2],l=h[3]}}}var d=Bq(s,o),m=Bq(a,l),g=yPe(s,o),w=function(y){return y>1?1:y<0?0:y},v=function(y){for(var _=y>1?1:y,N=_,j=0;j<8;++j){var S=d(N)-_,C=g(N);if(Math.abs(S-_)<Zj||C<Zj)return m(N);N=w(N-S/C)}return m(N)};return v.isStepper=!1,v},bPe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,s=t.damping,a=s===void 0?8:s,o=t.dt,l=o===void 0?17:o,c=function(h,d,m){var g=-(h-d)*r,w=m*a,v=m+(g-w)*l/1e3,b=m*l/1e3+h;return Math.abs(b-d)<Zj&&Math.abs(v)<Zj?[d,0]:[b,v]};return c.isStepper=!0,c.dt=l,c},wPe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0];if(typeof s=="string")switch(s){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Uq(s);case"spring":return bPe();default:if(s.split("(")[0]==="cubic-bezier")return Uq(s)}return typeof s=="function"?s:null};function Ny(e){"@babel/helpers - typeof";return Ny=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ny(e)}function Vq(e){return NPe(e)||_Pe(e)||PG(e)||jPe()}function jPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
815In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Pe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NPe(e){if(Array.isArray(e))return JO(e)}function Wq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Li(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wq(Object(n),!0).forEach(function(r){ZO(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZO(e,t,n){return t=SPe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SPe(e){var t=kPe(e,"string");return Ny(t)==="symbol"?t:String(t)}function kPe(e,t){if(Ny(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ny(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EPe(e,t){return APe(e)||CPe(e,t)||PG(e,t)||PPe()}function PPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
816In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PG(e,t){if(e){if(typeof e=="string")return JO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JO(e,t)}}function JO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function CPe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function APe(e){if(Array.isArray(e))return e}var Jj=function(t,n,r){return t+(n-t)*r},eT=function(t){var n=t.from,r=t.to;return n!==r},OPe=function e(t,n,r){var s=M0(function(a,o){if(eT(o)){var l=t(o.from,o.to,o.velocity),c=EPe(l,2),u=c[0],h=c[1];return Li(Li({},o),{},{from:u,velocity:h})}return o},n);return r<1?M0(function(a,o){return eT(o)?Li(Li({},o),{},{velocity:Jj(o.velocity,s[a].velocity,r),from:Jj(o.from,s[a].from,r)}):o},n):e(t,s,r-1)};const TPe=(function(e,t,n,r,s){var a=lPe(e,t),o=a.reduce(function(b,y){return Li(Li({},b),{},ZO({},y,[e[y],t[y]]))},{}),l=a.reduce(function(b,y){return Li(Li({},b),{},ZO({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,h,d=function(){return null},m=function(){return M0(function(y,_){return _.from},l)},g=function(){return!Object.values(l).filter(eT).length},w=function(y){u||(u=y);var _=y-u,N=_/n.dt;l=OPe(n,l,N),s(Li(Li(Li({},e),t),m())),u=y,g()||(c=requestAnimationFrame(d))},v=function(y){h||(h=y);var _=(y-h)/r,N=M0(function(S,C){return Jj.apply(void 0,Vq(C).concat([n(_)]))},o);if(s(Li(Li(Li({},e),t),N)),_<1)c=requestAnimationFrame(d);else{var j=M0(function(S,C){return Jj.apply(void 0,Vq(C).concat([n(1)]))},o);s(Li(Li(Li({},e),t),j))}};return d=n.isStepper?w:v,function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}});function Mg(e){"@babel/helpers - typeof";return Mg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mg(e)}var RPe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function MPe(e,t){if(e==null)return{};var n=IPe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function IPe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function SC(e){return $Pe(e)||FPe(e)||LPe(e)||DPe()}function DPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
817In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LPe(e,t){if(e){if(typeof e=="string")return tT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tT(e,t)}}function FPe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $Pe(e){if(Array.isArray(e))return tT(e)}function tT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function To(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hq(Object(n),!0).forEach(function(r){_0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _0(e,t,n){return t=CG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qPe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zPe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CG(r.key),r)}}function BPe(e,t,n){return t&&zPe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function CG(e){var t=UPe(e,"string");return Mg(t)==="symbol"?t:String(t)}function UPe(e,t){if(Mg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VPe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nT(e,t)}function nT(e,t){return nT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},nT(e,t)}function WPe(e){var t=HPe();return function(){var r=e_(e),s;if(t){var a=e_(this).constructor;s=Reflect.construct(r,arguments,a)}else s=r.apply(this,arguments);return rT(this,s)}}function rT(e,t){if(t&&(Mg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iT(e)}function iT(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HPe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e_(e){return e_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},e_(e)}var so=(function(e){VPe(n,e);var t=WPe(n);function n(r,s){var a;qPe(this,n),a=t.call(this,r,s);var o=a.props,l=o.isActive,c=o.attributeName,u=o.from,h=o.to,d=o.steps,m=o.children,g=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(iT(a)),a.changeStyle=a.changeStyle.bind(iT(a)),!l||g<=0)return a.state={style:{}},typeof m=="function"&&(a.state={style:h}),rT(a);if(d&&d.length)a.state={style:d[0].style};else if(u){if(typeof m=="function")return a.state={style:u},rT(a);a.state={style:c?_0({},c,u):u}}else a.state={style:{}};return a}return BPe(n,[{key:"componentDidMount",value:function(){var s=this.props,a=s.isActive,o=s.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,h=a.to,d=a.from,m=this.state.style;if(l){if(!o){var g={style:c?_0({},c,h):h};this.state&&m&&(c&&m[c]!==h||!c&&m!==h)&&this.setState(g);return}if(!(ZEe(s.to,h)&&s.canBegin&&s.isActive)){var w=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=w||u?d:s.to;if(this.state&&m){var b={style:c?_0({},c,v):v};(c&&m[c]!==v||!c&&m!==v)&&this.setState(b)}this.runAnimation(To(To({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var a=this,o=s.from,l=s.to,c=s.duration,u=s.easing,h=s.begin,d=s.onAnimationEnd,m=s.onAnimationStart,g=TPe(o,l,wPe(u),c,this.changeStyle),w=function(){a.stopJSAnimation=g()};this.manager.start([m,h,w,c,d])}},{key:"runStepAnimation",value:function(s){var a=this,o=s.steps,l=s.begin,c=s.onAnimationStart,u=o[0],h=u.style,d=u.duration,m=d===void 0?0:d,g=function(v,b,y){if(y===0)return v;var _=b.duration,N=b.easing,j=N===void 0?"ease":N,S=b.style,C=b.properties,P=b.onAnimationEnd,A=y>0?o[y-1]:b,F=C||Object.keys(S);if(typeof j=="function"||j==="spring")return[].concat(SC(v),[a.runJSAnimation.bind(a,{from:A.style,to:S,duration:_,easing:j}),_]);var I=zq(F,_,j),R=To(To(To({},A.style),S),{},{transition:I});return[].concat(SC(v),[R,_,P]).filter(cPe)};return this.manager.start([c].concat(SC(o.reduce(g,[h,Math.max(m,l)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=sPe());var a=s.begin,o=s.duration,l=s.attributeName,c=s.to,u=s.easing,h=s.onAnimationStart,d=s.onAnimationEnd,m=s.steps,g=s.children,w=this.manager;if(this.unSubscribe=w.subscribe(this.handleStyleChange),typeof u=="function"||typeof g=="function"||u==="spring"){this.runJSAnimation(s);return}if(m.length>1){this.runStepAnimation(s);return}var v=l?_0({},l,c):c,b=zq(Object.keys(v),o,u);w.start([h,a,To(To({},v),{},{transition:b}),o,d])}},{key:"render",value:function(){var s=this.props,a=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var l=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var c=MPe(s,RPe),u=O.Children.count(a),h=this.state.style;if(typeof a=="function")return a(h);if(!l||u===0||o<=0)return a;var d=function(g){var w=g.props,v=w.style,b=v===void 0?{}:v,y=w.className,_=O.cloneElement(g,To(To({},c),{},{style:To(To({},b),h),className:y}));return _};return u===1?d(O.Children.only(a)):se.createElement("div",null,O.Children.map(a,function(m){return d(m)}))}}]),n})(O.PureComponent);so.displayName="Animate";so.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};so.propTypes={from:Dn.oneOfType([Dn.object,Dn.string]),to:Dn.oneOfType([Dn.object,Dn.string]),attributeName:Dn.string,duration:Dn.number,begin:Dn.number,easing:Dn.oneOfType([Dn.string,Dn.func]),steps:Dn.arrayOf(Dn.shape({duration:Dn.number.isRequired,style:Dn.object.isRequired,easing:Dn.oneOfType([Dn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Dn.func]),properties:Dn.arrayOf("string"),onAnimationEnd:Dn.func})),children:Dn.oneOfType([Dn.node,Dn.func]),isActive:Dn.bool,canBegin:Dn.bool,onAnimationEnd:Dn.func,shouldReAnimate:Dn.bool,onAnimationStart:Dn.func,onAnimationReStart:Dn.func};function Sy(e){"@babel/helpers - typeof";return Sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sy(e)}function t_(){return t_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t_.apply(this,arguments)}function KPe(e,t){return XPe(e)||YPe(e,t)||QPe(e,t)||GPe()}function GPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
818In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QPe(e,t){if(e){if(typeof e=="string")return Kq(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kq(e,t)}}function Kq(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function YPe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function XPe(e){if(Array.isArray(e))return e}function Gq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Qq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gq(Object(n),!0).forEach(function(r){ZPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZPe(e,t,n){return t=JPe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JPe(e){var t=eCe(e,"string");return Sy(t)=="symbol"?t:t+""}function eCe(e,t){if(Sy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Sy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yq=function(t,n,r,s,a){var o=Math.min(Math.abs(r)/2,Math.abs(s)/2),l=s>=0?1:-1,c=r>=0?1:-1,u=s>=0&&r>=0||s<0&&r<0?1:0,h;if(o>0&&a instanceof Array){for(var d=[0,0,0,0],m=0,g=4;m<g;m++)d[m]=a[m]>o?o:a[m];h="M".concat(t,",").concat(n+l*d[0]),d[0]>0&&(h+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+c*d[0],",").concat(n)),h+="L ".concat(t+r-c*d[1],",").concat(n),d[1]>0&&(h+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`,
819        `).concat(t+r,",").concat(n+l*d[1])),h+="L ".concat(t+r,",").concat(n+s-l*d[2]),d[2]>0&&(h+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`,
820        `).concat(t+r-c*d[2],",").concat(n+s)),h+="L ".concat(t+c*d[3],",").concat(n+s),d[3]>0&&(h+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`,
821        `).concat(t,",").concat(n+s-l*d[3])),h+="Z"}else if(o>0&&a===+a&&a>0){var w=Math.min(o,a);h="M ".concat(t,",").concat(n+l*w,`
822            A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t+c*w,",").concat(n,`
823            L `).concat(t+r-c*w,",").concat(n,`
824            A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*w,`
825            L `).concat(t+r,",").concat(n+s-l*w,`
826            A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t+r-c*w,",").concat(n+s,`
827            L `).concat(t+c*w,",").concat(n+s,`
828            A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t,",").concat(n+s-l*w," Z")}else h="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(s," h ").concat(-r," Z");return h},tCe=function(t,n){if(!t||!n)return!1;var r=t.x,s=t.y,a=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),h=Math.max(a,a+l),d=Math.min(o,o+c),m=Math.max(o,o+c);return r>=u&&r<=h&&s>=d&&s<=m}return!1},nCe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},r5=function(t){var n=Qq(Qq({},nCe),t),r=O.useRef(),s=O.useState(-1),a=KPe(s,2),o=a[0],l=a[1];O.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var j=r.current.getTotalLength();j&&l(j)}catch{}},[]);var c=n.x,u=n.y,h=n.width,d=n.height,m=n.radius,g=n.className,w=n.animationEasing,v=n.animationDuration,b=n.animationBegin,y=n.isAnimationActive,_=n.isUpdateAnimationActive;if(c!==+c||u!==+u||h!==+h||d!==+d||h===0||d===0)return null;var N=Tt("recharts-rectangle",g);return _?se.createElement(so,{canBegin:o>0,from:{width:h,height:d,x:c,y:u},to:{width:h,height:d,x:c,y:u},duration:v,animationEasing:w,isActive:_},function(j){var S=j.width,C=j.height,P=j.x,A=j.y;return se.createElement(so,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:v,isActive:y,easing:w},se.createElement("path",t_({},wt(n,!0),{className:N,d:Yq(P,A,S,C,m),ref:r})))}):se.createElement("path",t_({},wt(n,!0),{className:N,d:Yq(c,u,h,d,m)}))},rCe=["points","className","baseLinePoints","connectNulls"];function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gp.apply(this,arguments)}function iCe(e,t){if(e==null)return{};var n=sCe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sCe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Xq(e){return cCe(e)||lCe(e)||oCe(e)||aCe()}function aCe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
829In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oCe(e,t){if(e){if(typeof e=="string")return sT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sT(e,t)}}function lCe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cCe(e){if(Array.isArray(e))return sT(e)}function sT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Zq=function(t){return t&&t.x===+t.x&&t.y===+t.y},uCe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){Zq(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),Zq(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},I0=function(t,n){var r=uCe(t);n&&(r=[r.reduce(function(a,o){return[].concat(Xq(a),Xq(o))},[])]);var s=r.map(function(a){return a.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return r.length===1?"".concat(s,"Z"):s},dCe=function(t,n,r){var s=I0(t,r);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(I0(n.reverse(),r).slice(1))},AG=function(t){var n=t.points,r=t.className,s=t.baseLinePoints,a=t.connectNulls,o=iCe(t,rCe);if(!n||!n.length)return null;var l=Tt("recharts-polygon",r);if(s&&s.length){var c=o.stroke&&o.stroke!=="none",u=dCe(n,s,a);return se.createElement("g",{className:l},se.createElement("path",Gp({},wt(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?se.createElement("path",Gp({},wt(o,!0),{fill:"none",d:I0(n,a)})):null,c?se.createElement("path",Gp({},wt(o,!0),{fill:"none",d:I0(s,a)})):null)}var h=I0(n,a);return se.createElement("path",Gp({},wt(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:l,d:h}))};function aT(){return aT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aT.apply(this,arguments)}var yv=function(t){var n=t.cx,r=t.cy,s=t.r,a=t.className,o=Tt("recharts-dot",a);return n===+n&&r===+r&&s===+s?O.createElement("circle",aT({},wt(t,!1),Nj(t),{className:o,cx:n,cy:r,r:s})):null};function ky(e){"@babel/helpers - typeof";return ky=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ky(e)}var fCe=["x","y","top","left","width","height","className"];function oT(){return oT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oT.apply(this,arguments)}function Jq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function hCe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jq(Object(n),!0).forEach(function(r){mCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mCe(e,t,n){return t=pCe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pCe(e){var t=gCe(e,"string");return ky(t)=="symbol"?t:t+""}function gCe(e,t){if(ky(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ky(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vCe(e,t){if(e==null)return{};var n=xCe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xCe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var yCe=function(t,n,r,s,a,o){return"M".concat(t,",").concat(a,"v").concat(s,"M").concat(o,",").concat(n,"h").concat(r)},bCe=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,h=t.width,d=h===void 0?0:h,m=t.height,g=m===void 0?0:m,w=t.className,v=vCe(t,fCe),b=hCe({x:r,y:a,top:l,left:u,width:d,height:g},v);return!et(r)||!et(a)||!et(d)||!et(g)||!et(l)||!et(u)?null:se.createElement("path",oT({},wt(b,!0),{className:Tt("recharts-cross",w),d:yCe(r,a,d,g,l,u)}))},wCe=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function Ey(e){"@babel/helpers - typeof";return Ey=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ey(e)}function jCe(e,t){if(e==null)return{};var n=_Ce(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _Ce(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function cu(){return cu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cu.apply(this,arguments)}function ez(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Py(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ez(Object(n),!0).forEach(function(r){NCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ez(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NCe(e,t,n){return t=SCe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SCe(e){var t=kCe(e,"string");return Ey(t)=="symbol"?t:t+""}function kCe(e,t){if(Ey(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ey(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ECe=function(t,n,r,s){var a="";return s.forEach(function(o,l){var c=Tn(n,r,t,o);l?a+="L ".concat(c.x,",").concat(c.y):a+="M ".concat(c.x,",").concat(c.y)}),a+="Z",a},PCe=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.polarAngles,l=t.radialLines;if(!o||!o.length||!l)return null;var c=Py({stroke:"#ccc"},wt(t,!1));return se.createElement("g",{className:"recharts-polar-grid-angle"},o.map(function(u){var h=Tn(n,r,s,u),d=Tn(n,r,a,u);return se.createElement("line",cu({},c,{key:"line-".concat(u),x1:h.x,y1:h.y,x2:d.x,y2:d.y}))}))},CCe=function(t){var n=t.cx,r=t.cy,s=t.radius,a=t.index,o=Py(Py({stroke:"#ccc"},wt(t,!1)),{},{fill:"none"});return se.createElement("circle",cu({},o,{className:Tt("recharts-polar-grid-concentric-circle",t.className),key:"circle-".concat(a),cx:n,cy:r,r:s}))},ACe=function(t){var n=t.radius,r=t.index,s=Py(Py({stroke:"#ccc"},wt(t,!1)),{},{fill:"none"});return se.createElement("path",cu({},s,{className:Tt("recharts-polar-grid-concentric-polygon",t.className),key:"path-".concat(r),d:ECe(n,t.cx,t.cy,t.polarAngles)}))},OCe=function(t){var n=t.polarRadius,r=t.gridType;return!n||!n.length?null:se.createElement("g",{className:"recharts-polar-grid-concentric"},n.map(function(s,a){var o=a;return r==="circle"?se.createElement(CCe,cu({key:o},t,{radius:s,index:a})):se.createElement(ACe,cu({key:o},t,{radius:s,index:a}))}))},OG=function(t){var n=t.cx,r=n===void 0?0:n,s=t.cy,a=s===void 0?0:s,o=t.innerRadius,l=o===void 0?0:o,c=t.outerRadius,u=c===void 0?0:c,h=t.gridType,d=h===void 0?"polygon":h,m=t.radialLines,g=m===void 0?!0:m,w=jCe(t,wCe);return u<=0?null:se.createElement("g",{className:"recharts-polar-grid"},se.createElement(PCe,cu({cx:r,cy:a,innerRadius:l,outerRadius:u,gridType:d,radialLines:g},w)),se.createElement(OCe,cu({cx:r,cy:a,innerRadius:l,outerRadius:u,gridType:d,radialLines:g},w)))};OG.displayName="PolarGrid";var kC,tz;function TCe(){if(tz)return kC;tz=1;var e=TN(),t=BK(),n=Zl();function r(s,a){return s&&s.length?e(s,n(a,2),t):void 0}return kC=r,kC}var RCe=TCe();const MCe=En(RCe);var EC,nz;function ICe(){if(nz)return EC;nz=1;var e=TN(),t=Zl(),n=UK();function r(s,a){return s&&s.length?e(s,t(a,2),n):void 0}return EC=r,EC}var DCe=ICe();const LCe=En(DCe);var FCe=["cx","cy","angle","ticks","axisLine"],$Ce=["ticks","tick","angle","tickFormatter","stroke"];function Ig(e){"@babel/helpers - typeof";return Ig=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ig(e)}function D0(){return D0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D0.apply(this,arguments)}function rz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Zf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rz(Object(n),!0).forEach(function(r){DN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iz(e,t){if(e==null)return{};var n=qCe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qCe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function zCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sz(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,RG(r.key),r)}}function BCe(e,t,n){return t&&sz(e.prototype,t),n&&sz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function UCe(e,t,n){return t=n_(t),VCe(e,TG()?Reflect.construct(t,n||[],n_(e).constructor):t.apply(e,n))}function VCe(e,t){if(t&&(Ig(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WCe(e)}function WCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TG=function(){return!!e})()}function n_(e){return n_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},n_(e)}function HCe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lT(e,t)}function lT(e,t){return lT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},lT(e,t)}function DN(e,t,n){return t=RG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RG(e){var t=KCe(e,"string");return Ig(t)=="symbol"?t:t+""}function KCe(e,t){if(Ig(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ig(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var bv=(function(e){function t(){return zCe(this,t),UCe(this,t,arguments)}return HCe(t,e),BCe(t,[{key:"getTickValueCoord",value:function(r){var s=r.coordinate,a=this.props,o=a.angle,l=a.cx,c=a.cy;return Tn(l,c,s,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,s;switch(r){case"left":s="end";break;case"right":s="start";break;default:s="middle";break}return s}},{key:"getViewBox",value:function(){var r=this.props,s=r.cx,a=r.cy,o=r.angle,l=r.ticks,c=MCe(l,function(h){return h.coordinate||0}),u=LCe(l,function(h){return h.coordinate||0});return{cx:s,cy:a,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,a=r.cy,o=r.angle,l=r.ticks,c=r.axisLine,u=iz(r,FCe),h=l.reduce(function(w,v){return[Math.min(w[0],v.coordinate),Math.max(w[1],v.coordinate)]},[1/0,-1/0]),d=Tn(s,a,h[0],o),m=Tn(s,a,h[1],o),g=Zf(Zf(Zf({},wt(u,!1)),{},{fill:"none"},wt(c,!1)),{},{x1:d.x,y1:d.y,x2:m.x,y2:m.y});return se.createElement("line",D0({className:"recharts-polar-radius-axis-line"},g))}},{key:"renderTicks",value:function(){var r=this,s=this.props,a=s.ticks,o=s.tick,l=s.angle,c=s.tickFormatter,u=s.stroke,h=iz(s,$Ce),d=this.getTickTextAnchor(),m=wt(h,!1),g=wt(o,!1),w=a.map(function(v,b){var y=r.getTickValueCoord(v),_=Zf(Zf(Zf(Zf({textAnchor:d,transform:"rotate(".concat(90-l,", ").concat(y.x,", ").concat(y.y,")")},m),{},{stroke:"none",fill:u},g),{},{index:b},y),{},{payload:v});return se.createElement(dn,D0({className:Tt("recharts-polar-radius-axis-tick",xG(o)),key:"tick-".concat(v.coordinate)},Uh(r.props,v,b)),t.renderTickItem(o,_,c?c(v.value,b):v.value))});return se.createElement(dn,{className:"recharts-polar-radius-axis-ticks"},w)}},{key:"render",value:function(){var r=this.props,s=r.ticks,a=r.axisLine,o=r.tick;return!s||!s.length?null:se.createElement(dn,{className:Tt("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),o&&this.renderTicks(),Ni.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,s,a){var o;return se.isValidElement(r)?o=se.cloneElement(r,s):At(r)?o=r(s):o=se.createElement(Vh,D0({},s,{className:"recharts-polar-radius-axis-tick-value"}),a),o}}])})(O.PureComponent);DN(bv,"displayName","PolarRadiusAxis");DN(bv,"axisType","radiusAxis");DN(bv,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Dg(e){"@babel/helpers - typeof";return Dg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dg(e)}function ah(){return ah=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ah.apply(this,arguments)}function az(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Jf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?az(Object(n),!0).forEach(function(r){LN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):az(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oz(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,IG(r.key),r)}}function QCe(e,t,n){return t&&oz(e.prototype,t),n&&oz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function YCe(e,t,n){return t=r_(t),XCe(e,MG()?Reflect.construct(t,n||[],r_(e).constructor):t.apply(e,n))}function XCe(e,t){if(t&&(Dg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZCe(e)}function ZCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(MG=function(){return!!e})()}function r_(e){return r_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},r_(e)}function JCe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cT(e,t)}function cT(e,t){return cT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},cT(e,t)}function LN(e,t,n){return t=IG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IG(e){var t=eAe(e,"string");return Dg(t)=="symbol"?t:t+""}function eAe(e,t){if(Dg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var tAe=Math.PI/180,lz=1e-5,wv=(function(e){function t(){return GCe(this,t),YCe(this,t,arguments)}return JCe(t,e),QCe(t,[{key:"getTickLineCoord",value:function(r){var s=this.props,a=s.cx,o=s.cy,l=s.radius,c=s.orientation,u=s.tickSize,h=u||8,d=Tn(a,o,l,r.coordinate),m=Tn(a,o,l+(c==="inner"?-1:1)*h,r.coordinate);return{x1:d.x,y1:d.y,x2:m.x,y2:m.y}}},{key:"getTickTextAnchor",value:function(r){var s=this.props.orientation,a=Math.cos(-r.coordinate*tAe),o;return a>lz?o=s==="outer"?"start":"end":a<-lz?o=s==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,a=r.cy,o=r.radius,l=r.axisLine,c=r.axisLineType,u=Jf(Jf({},wt(this.props,!1)),{},{fill:"none"},wt(l,!1));if(c==="circle")return se.createElement(yv,ah({className:"recharts-polar-angle-axis-line"},u,{cx:s,cy:a,r:o}));var h=this.props.ticks,d=h.map(function(m){return Tn(s,a,o,m.coordinate)});return se.createElement(AG,ah({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var r=this,s=this.props,a=s.ticks,o=s.tick,l=s.tickLine,c=s.tickFormatter,u=s.stroke,h=wt(this.props,!1),d=wt(o,!1),m=Jf(Jf({},h),{},{fill:"none"},wt(l,!1)),g=a.map(function(w,v){var b=r.getTickLineCoord(w),y=r.getTickTextAnchor(w),_=Jf(Jf(Jf({textAnchor:y},h),{},{stroke:"none",fill:u},d),{},{index:v,payload:w,x:b.x2,y:b.y2});return se.createElement(dn,ah({className:Tt("recharts-polar-angle-axis-tick",xG(o)),key:"tick-".concat(w.coordinate)},Uh(r.props,w,v)),l&&se.createElement("line",ah({className:"recharts-polar-angle-axis-tick-line"},m,b)),o&&t.renderTickItem(o,_,c?c(w.value,v):w.value))});return se.createElement(dn,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var r=this.props,s=r.ticks,a=r.radius,o=r.axisLine;return a<=0||!s||!s.length?null:se.createElement(dn,{className:Tt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,s,a){var o;return se.isValidElement(r)?o=se.cloneElement(r,s):At(r)?o=r(s):o=se.createElement(Vh,ah({},s,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])})(O.PureComponent);LN(wv,"displayName","PolarAngleAxis");LN(wv,"axisType","angleAxis");LN(wv,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var PC,cz;function nAe(){if(cz)return PC;cz=1;var e=mH(),t=e(Object.getPrototypeOf,Object);return PC=t,PC}var CC,uz;function rAe(){if(uz)return CC;uz=1;var e=fu(),t=nAe(),n=hu(),r="[object Object]",s=Function.prototype,a=Object.prototype,o=s.toString,l=a.hasOwnProperty,c=o.call(Object);function u(h){if(!n(h)||e(h)!=r)return!1;var d=t(h);if(d===null)return!0;var m=l.call(d,"constructor")&&d.constructor;return typeof m=="function"&&m instanceof m&&o.call(m)==c}return CC=u,CC}var iAe=rAe();const sAe=En(iAe);var AC,dz;function aAe(){if(dz)return AC;dz=1;var e=fu(),t=hu(),n="[object Boolean]";function r(s){return s===!0||s===!1||t(s)&&e(s)==n}return AC=r,AC}var oAe=aAe();const lAe=En(oAe);function Cy(e){"@babel/helpers - typeof";return Cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cy(e)}function i_(){return i_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i_.apply(this,arguments)}function cAe(e,t){return hAe(e)||fAe(e,t)||dAe(e,t)||uAe()}function uAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
830In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dAe(e,t){if(e){if(typeof e=="string")return fz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fz(e,t)}}function fz(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fAe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function hAe(e){if(Array.isArray(e))return e}function hz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function mz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hz(Object(n),!0).forEach(function(r){mAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mAe(e,t,n){return t=pAe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pAe(e){var t=gAe(e,"string");return Cy(t)=="symbol"?t:t+""}function gAe(e,t){if(Cy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pz=function(t,n,r,s,a){var o=r-s,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+a),l+="L ".concat(t+r-o/2-s,",").concat(n+a),l+="L ".concat(t,",").concat(n," Z"),l},vAe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},xAe=function(t){var n=mz(mz({},vAe),t),r=O.useRef(),s=O.useState(-1),a=cAe(s,2),o=a[0],l=a[1];O.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var N=r.current.getTotalLength();N&&l(N)}catch{}},[]);var c=n.x,u=n.y,h=n.upperWidth,d=n.lowerWidth,m=n.height,g=n.className,w=n.animationEasing,v=n.animationDuration,b=n.animationBegin,y=n.isUpdateAnimationActive;if(c!==+c||u!==+u||h!==+h||d!==+d||m!==+m||h===0&&d===0||m===0)return null;var _=Tt("recharts-trapezoid",g);return y?se.createElement(so,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:m,x:c,y:u},to:{upperWidth:h,lowerWidth:d,height:m,x:c,y:u},duration:v,animationEasing:w,isActive:y},function(N){var j=N.upperWidth,S=N.lowerWidth,C=N.height,P=N.x,A=N.y;return se.createElement(so,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:v,easing:w},se.createElement("path",i_({},wt(n,!0),{className:_,d:pz(P,A,j,S,C),ref:r})))}):se.createElement("g",null,se.createElement("path",i_({},wt(n,!0),{className:_,d:pz(c,u,h,d,m)})))},yAe=["option","shapeType","propTransformer","activeClassName","isActive"];function Ay(e){"@babel/helpers - typeof";return Ay=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ay(e)}function bAe(e,t){if(e==null)return{};var n=wAe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wAe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function gz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function s_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gz(Object(n),!0).forEach(function(r){jAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jAe(e,t,n){return t=_Ae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Ae(e){var t=NAe(e,"string");return Ay(t)=="symbol"?t:t+""}function NAe(e,t){if(Ay(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ay(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SAe(e,t){return s_(s_({},t),e)}function kAe(e,t){return e==="symbols"}function vz(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return se.createElement(r5,n);case"trapezoid":return se.createElement(xAe,n);case"sector":return se.createElement(jG,n);case"symbols":if(kAe(t))return se.createElement(ER,n);break;default:return null}}function EAe(e){return O.isValidElement(e)?e.props:e}function DG(e){var t=e.option,n=e.shapeType,r=e.propTransformer,s=r===void 0?SAe:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=bAe(e,yAe),u;if(O.isValidElement(t))u=O.cloneElement(t,s_(s_({},c),EAe(t)));else if(At(t))u=t(c);else if(sAe(t)&&!lAe(t)){var h=s(t,c);u=se.createElement(vz,{shapeType:n,elementProps:h})}else{var d=c;u=se.createElement(vz,{shapeType:n,elementProps:d})}return l?se.createElement(dn,{className:o},u):u}function FN(e,t){return t!=null&&"trapezoids"in e.props}function $N(e,t){return t!=null&&"sectors"in e.props}function Oy(e,t){return t!=null&&"points"in e.props}function PAe(e,t){var n,r,s=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return s&&a}function CAe(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function AAe(e,t){var n=e.x===t.x,r=e.y===t.y,s=e.z===t.z;return n&&r&&s}function OAe(e,t){var n;return FN(e,t)?n=PAe:$N(e,t)?n=CAe:Oy(e,t)&&(n=AAe),n}function TAe(e,t){var n;return FN(e,t)?n="trapezoids":$N(e,t)?n="sectors":Oy(e,t)&&(n="points"),n}function RAe(e,t){if(FN(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if($N(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return Oy(e,t)?t.payload:{}}function MAe(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,s=TAe(n,t),a=RAe(n,t),o=r.filter(function(c,u){var h=Bd(a,c),d=n.props[s].filter(function(w){var v=OAe(n,t);return v(w,t)}),m=n.props[s].indexOf(d[d.length-1]),g=u===m;return h&&g}),l=r.indexOf(o[o.length-1]);return l}var Y1;function Lg(e){"@babel/helpers - typeof";return Lg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lg(e)}function Qp(){return Qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qp.apply(this,arguments)}function xz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xz(Object(n),!0).forEach(function(r){Ya(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yz(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,FG(r.key),r)}}function DAe(e,t,n){return t&&yz(e.prototype,t),n&&yz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function LAe(e,t,n){return t=a_(t),FAe(e,LG()?Reflect.construct(t,n||[],a_(e).constructor):t.apply(e,n))}function FAe(e,t){if(t&&(Lg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $Ae(e)}function $Ae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(LG=function(){return!!e})()}function a_(e){return a_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},a_(e)}function qAe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uT(e,t)}function uT(e,t){return uT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},uT(e,t)}function Ya(e,t,n){return t=FG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FG(e){var t=zAe(e,"string");return Lg(t)=="symbol"?t:t+""}function zAe(e,t){if(Lg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var gu=(function(e){function t(n){var r;return IAe(this,t),r=LAe(this,t,[n]),Ya(r,"pieRef",null),Ya(r,"sectorRefs",[]),Ya(r,"id",tm("recharts-pie-")),Ya(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),At(s)&&s()}),Ya(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),At(s)&&s()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return qAe(t,e),DAe(t,[{key:"isActiveIndex",value:function(r){var s=this.props.activeIndex;return Array.isArray(s)?s.indexOf(r)!==-1:r===s}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.label,l=a.labelLine,c=a.dataKey,u=a.valueKey,h=wt(this.props,!1),d=wt(o,!1),m=wt(l,!1),g=o&&o.offsetRadius||20,w=r.map(function(v,b){var y=(v.startAngle+v.endAngle)/2,_=Tn(v.cx,v.cy,v.outerRadius+g,y),N=Jn(Jn(Jn(Jn({},h),v),{},{stroke:"none"},d),{},{index:b,textAnchor:t.getTextAnchor(_.x,v.cx)},_),j=Jn(Jn(Jn(Jn({},h),v),{},{fill:"none",stroke:v.fill},m),{},{index:b,points:[Tn(v.cx,v.cy,v.outerRadius,y),_]}),S=c;return zt(c)&&zt(u)?S="value":zt(c)&&(S=u),se.createElement(dn,{key:"label-".concat(v.startAngle,"-").concat(v.endAngle,"-").concat(v.midAngle,"-").concat(b)},l&&t.renderLabelLineItem(l,j,"line"),t.renderLabelItem(o,N,wr(v,S)))});return se.createElement(dn,{className:"recharts-pie-labels"},w)}},{key:"renderSectorsStatically",value:function(r){var s=this,a=this.props,o=a.activeShape,l=a.blendStroke,c=a.inactiveShape;return r.map(function(u,h){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&r.length!==1)return null;var d=s.isActiveIndex(h),m=c&&s.hasActiveIndex()?c:null,g=d?o:m,w=Jn(Jn({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return se.createElement(dn,Qp({ref:function(b){b&&!s.sectorRefs.includes(b)&&s.sectorRefs.push(b)},tabIndex:-1,className:"recharts-pie-sector"},Uh(s.props,u,h),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(h)}),se.createElement(DG,Qp({option:g,isActive:d,shapeType:"sector"},w)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,s=this.props,a=s.sectors,o=s.isAnimationActive,l=s.animationBegin,c=s.animationDuration,u=s.animationEasing,h=s.animationId,d=this.state,m=d.prevSectors,g=d.prevIsAnimationActive;return se.createElement(so,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(g),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(w){var v=w.t,b=[],y=a&&a[0],_=y.startAngle;return a.forEach(function(N,j){var S=m&&m[j],C=j>0?va(N,"paddingAngle",0):0;if(S){var P=yr(S.endAngle-S.startAngle,N.endAngle-N.startAngle),A=Jn(Jn({},N),{},{startAngle:_+C,endAngle:_+P(v)+C});b.push(A),_=A.endAngle}else{var F=N.endAngle,I=N.startAngle,R=yr(0,F-I),M=R(v),$=Jn(Jn({},N),{},{startAngle:_+C,endAngle:_+M+C});b.push($),_=$.endAngle}}),se.createElement(dn,null,r.renderSectorsStatically(b))})}},{key:"attachKeyboardHandlers",value:function(r){var s=this;r.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[o].focus(),s.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[l].focus(),s.setState({sectorToFocus:l});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,s=r.sectors,a=r.isAnimationActive,o=this.state.prevSectors;return a&&s&&s.length&&(!o||!Bd(o,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,s=this.props,a=s.hide,o=s.sectors,l=s.className,c=s.label,u=s.cx,h=s.cy,d=s.innerRadius,m=s.outerRadius,g=s.isAnimationActive,w=this.state.isAnimationFinished;if(a||!o||!o.length||!et(u)||!et(h)||!et(d)||!et(m))return null;var v=Tt("recharts-pie",l);return se.createElement(dn,{tabIndex:this.props.rootTabIndex,className:v,ref:function(y){r.pieRef=y}},this.renderSectors(),c&&this.renderLabels(o),Ni.renderCallByParent(this.props,null,!1),(!g||w)&&Uo.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return s.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:r.sectors!==s.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,s){return r>s?"start":r<s?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,s,a){if(se.isValidElement(r))return se.cloneElement(r,s);if(At(r))return r(s);var o=Tt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return se.createElement(Ph,Qp({},s,{key:a,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,s,a){if(se.isValidElement(r))return se.cloneElement(r,s);var o=a;if(At(r)&&(o=r(s),se.isValidElement(o)))return o;var l=Tt("recharts-pie-label-text",typeof r!="boolean"&&!At(r)?r.className:"");return se.createElement(Vh,Qp({},s,{alignmentBaseline:"middle",className:l}),o)}}])})(O.PureComponent);Y1=gu;Ya(gu,"displayName","Pie");Ya(gu,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!mu.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Ya(gu,"parseDeltaAngle",function(e,t){var n=xs(t-e),r=Math.min(Math.abs(t-e),360);return n*r});Ya(gu,"getRealPieData",function(e){var t=e.data,n=e.children,r=wt(e,!1),s=xa(n,SN);return t&&t.length?t.map(function(a,o){return Jn(Jn(Jn({payload:a},r),a),s&&s[o]&&s[o].props)}):s&&s.length?s.map(function(a){return Jn(Jn({},r),a.props)}):[]});Ya(gu,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,s=t.width,a=t.height,o=gG(s,a),l=r+ys(e.cx,s,s/2),c=n+ys(e.cy,a,a/2),u=ys(e.innerRadius,o,0),h=ys(e.outerRadius,o,o*.8),d=e.maxRadius||Math.sqrt(s*s+a*a)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:h,maxRadius:d}});Ya(gu,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?Jn(Jn({},t.type.defaultProps),t.props):t.props,s=Y1.getRealPieData(r);if(!s||!s.length)return null;var a=r.cornerRadius,o=r.startAngle,l=r.endAngle,c=r.paddingAngle,u=r.dataKey,h=r.nameKey,d=r.valueKey,m=r.tooltipType,g=Math.abs(r.minAngle),w=Y1.parseCoordinateOfPie(r,n),v=Y1.parseDeltaAngle(o,l),b=Math.abs(v),y=u;zt(u)&&zt(d)?(Bo(!1,`Use "dataKey" to specify the value of pie,
831      the props "valueKey" will be deprecated in 1.1.0`),y="value"):zt(u)&&(Bo(!1,`Use "dataKey" to specify the value of pie,
832      the props "valueKey" will be deprecated in 1.1.0`),y=d);var _=s.filter(function(A){return wr(A,y,0)!==0}).length,N=(b>=360?_:_-1)*c,j=b-_*g-N,S=s.reduce(function(A,F){var I=wr(F,y,0);return A+(et(I)?I:0)},0),C;if(S>0){var P;C=s.map(function(A,F){var I=wr(A,y,0),R=wr(A,h,F),M=(et(I)?I:0)/S,$;F?$=P.endAngle+xs(v)*c*(I!==0?1:0):$=o;var B=$+xs(v)*((I!==0?g:0)+M*j),U=($+B)/2,G=(w.innerRadius+w.outerRadius)/2,Z=[{name:R,value:I,payload:A,dataKey:y,type:m}],X=Tn(w.cx,w.cy,G,U);return P=Jn(Jn(Jn({percent:M,cornerRadius:a,name:R,tooltipPayload:Z,midAngle:U,middleRadius:G,tooltipPosition:X},A),w),{},{value:wr(A,y),startAngle:$,endAngle:B,payload:A,paddingAngle:xs(v)*c}),P})}return Jn(Jn({},w),{},{sectors:C,data:s})});var OC,bz;function BAe(){if(bz)return OC;bz=1;function e(t){return t&&t.length?t[0]:void 0}return OC=e,OC}var TC,wz;function UAe(){return wz||(wz=1,TC=BAe()),TC}var VAe=UAe();const WAe=En(VAe);var HAe=["key"];function Fg(e){"@babel/helpers - typeof";return Fg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fg(e)}function KAe(e,t){if(e==null)return{};var n=GAe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GAe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function o_(){return o_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o_.apply(this,arguments)}function jz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ps(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jz(Object(n),!0).forEach(function(r){$c(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qG(r.key),r)}}function YAe(e,t,n){return t&&_z(e.prototype,t),n&&_z(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function XAe(e,t,n){return t=l_(t),ZAe(e,$G()?Reflect.construct(t,n||[],l_(e).constructor):t.apply(e,n))}function ZAe(e,t){if(t&&(Fg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JAe(e)}function JAe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $G(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($G=function(){return!!e})()}function l_(e){return l_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},l_(e)}function eOe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dT(e,t)}function dT(e,t){return dT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},dT(e,t)}function $c(e,t,n){return t=qG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qG(e){var t=tOe(e,"string");return Fg(t)=="symbol"?t:t+""}function tOe(e,t){if(Fg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var pb=(function(e){function t(){var n;QAe(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=XAe(this,t,[].concat(s)),$c(n,"state",{isAnimationFinished:!1}),$c(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),At(o)&&o()}),$c(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),At(o)&&o()}),$c(n,"handleMouseEnter",function(o){var l=n.props.onMouseEnter;l&&l(n.props,o)}),$c(n,"handleMouseLeave",function(o){var l=n.props.onMouseLeave;l&&l(n.props,o)}),n}return eOe(t,e),YAe(t,[{key:"renderDots",value:function(r){var s=this.props,a=s.dot,o=s.dataKey,l=wt(this.props,!1),c=wt(a,!0),u=r.map(function(h,d){var m=ps(ps(ps({key:"dot-".concat(d),r:3},l),c),{},{dataKey:o,cx:h.x,cy:h.y,index:d,payload:h});return t.renderDotItem(a,m)});return se.createElement(dn,{className:"recharts-radar-dots"},u)}},{key:"renderPolygonStatically",value:function(r){var s=this.props,a=s.shape,o=s.dot,l=s.isRange,c=s.baseLinePoints,u=s.connectNulls,h;return se.isValidElement(a)?h=se.cloneElement(a,ps(ps({},this.props),{},{points:r})):At(a)?h=a(ps(ps({},this.props),{},{points:r})):h=se.createElement(AG,o_({},wt(this.props,!0),{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,points:r,baseLinePoints:l?c:null,connectNulls:u})),se.createElement(dn,{className:"recharts-radar-polygon"},h,o?this.renderDots(r):null)}},{key:"renderPolygonWithAnimation",value:function(){var r=this,s=this.props,a=s.points,o=s.isAnimationActive,l=s.animationBegin,c=s.animationDuration,u=s.animationEasing,h=s.animationId,d=this.state.prevPoints;return se.createElement(so,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"radar-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var g=m.t,w=d&&d.length/a.length,v=a.map(function(b,y){var _=d&&d[Math.floor(y*w)];if(_){var N=yr(_.x,b.x),j=yr(_.y,b.y);return ps(ps({},b),{},{x:N(g),y:j(g)})}var S=yr(b.cx,b.x),C=yr(b.cy,b.y);return ps(ps({},b),{},{x:S(g),y:C(g)})});return r.renderPolygonStatically(v)})}},{key:"renderPolygon",value:function(){var r=this.props,s=r.points,a=r.isAnimationActive,o=r.isRange,l=this.state.prevPoints;return a&&s&&s.length&&!o&&(!l||!Bd(l,s))?this.renderPolygonWithAnimation():this.renderPolygonStatically(s)}},{key:"render",value:function(){var r=this.props,s=r.hide,a=r.className,o=r.points,l=r.isAnimationActive;if(s||!o||!o.length)return null;var c=this.state.isAnimationFinished,u=Tt("recharts-radar",a);return se.createElement(dn,{className:u},this.renderPolygon(),(!l||c)&&Uo.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:s.curPoints}:r.points!==s.curPoints?{curPoints:r.points}:null}},{key:"renderDotItem",value:function(r,s){var a;if(se.isValidElement(r))a=se.cloneElement(r,s);else if(At(r))a=r(s);else{var o=s.key,l=KAe(s,HAe);a=se.createElement(yv,o_({},l,{key:o,className:Tt("recharts-radar-dot",typeof r!="boolean"?r.className:"")}))}return a}}])})(O.PureComponent);$c(pb,"displayName","Radar");$c(pb,"defaultProps",{angleAxisId:0,radiusAxisId:0,hide:!1,activeDot:!0,dot:!1,legendT
vendor: 136,108 bytes, lines 832-837
832ype:"rect",isAnimationActive:!mu.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});$c(pb,"getComposedData",function(e){var t=e.radiusAxis,n=e.angleAxis,r=e.displayedData,s=e.dataKey,a=e.bandSize,o=n.cx,l=n.cy,c=!1,u=[],h=n.type!=="number"?a??0:0;r.forEach(function(m,g){var w=wr(m,n.dataKey,g),v=wr(m,s),b=n.scale(w)+h,y=Array.isArray(v)?bG(v):v,_=zt(y)?void 0:t.scale(y);Array.isArray(v)&&v.length>=2&&(c=!0),u.push(ps(ps({},Tn(o,l,_,b)),{},{name:w,value:v,cx:o,cy:l,radius:_,angle:b,payload:m}))});var d=[];return c&&u.forEach(function(m){if(Array.isArray(m.value)){var g=WAe(m.value),w=zt(g)?void 0:t.scale(g);d.push(ps(ps({},m),{},{radius:w},Tn(o,l,w,m.angle)))}else d.push(m)}),{points:u,isRange:c,baseLinePoints:d}});var RC,Nz;function nOe(){if(Nz)return RC;Nz=1;var e=Math.ceil,t=Math.max;function n(r,s,a,o){for(var l=-1,c=t(e((s-r)/(a||1)),0),u=Array(c);c--;)u[o?c:++l]=r,r+=a;return u}return RC=n,RC}var MC,Sz;function zG(){if(Sz)return MC;Sz=1;var e=rK(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var a=s<0?-1:1;return a*n}return s===s?s:0}return MC=r,MC}var IC,kz;function rOe(){if(kz)return IC;kz=1;var e=nOe(),t=NN(),n=zG();function r(s){return function(a,o,l){return l&&typeof l!="number"&&t(a,o,l)&&(o=l=void 0),a=n(a),o===void 0?(o=a,a=0):o=n(o),l=l===void 0?a<o?1:-1:n(l),e(a,o,l,s)}}return IC=r,IC}var DC,Ez;function iOe(){if(Ez)return DC;Ez=1;var e=rOe(),t=e();return DC=t,DC}var sOe=iOe();const c_=En(sOe);function Ty(e){"@babel/helpers - typeof";return Ty=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ty(e)}function Pz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Cz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pz(Object(n),!0).forEach(function(r){BG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BG(e,t,n){return t=aOe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aOe(e){var t=oOe(e,"string");return Ty(t)=="symbol"?t:t+""}function oOe(e,t){if(Ty(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ty(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lOe=["Webkit","Moz","O","ms"],cOe=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),s=lOe.reduce(function(a,o){return Cz(Cz({},a),{},BG({},o+r,n))},{});return s[t]=n,s};function $g(e){"@babel/helpers - typeof";return $g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$g(e)}function u_(){return u_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u_.apply(this,arguments)}function Az(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function LC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Az(Object(n),!0).forEach(function(r){ua(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Az(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uOe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oz(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,VG(r.key),r)}}function dOe(e,t,n){return t&&Oz(e.prototype,t),n&&Oz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fOe(e,t,n){return t=d_(t),hOe(e,UG()?Reflect.construct(t,n||[],d_(e).constructor):t.apply(e,n))}function hOe(e,t){if(t&&($g(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mOe(e)}function mOe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UG=function(){return!!e})()}function d_(e){return d_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},d_(e)}function pOe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fT(e,t)}function fT(e,t){return fT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},fT(e,t)}function ua(e,t,n){return t=VG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VG(e){var t=gOe(e,"string");return $g(t)=="symbol"?t:t+""}function gOe(e,t){if($g(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($g(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var vOe=function(t){var n=t.data,r=t.startIndex,s=t.endIndex,a=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=T0().domain(c_(0,c)).range([a,a+o-l]),h=u.domain().map(function(d){return u(d)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(s),scale:u,scaleValues:h}},Tz=function(t){return t.changedTouches&&!!t.changedTouches.length},qg=(function(e){function t(n){var r;return uOe(this,t),r=fOe(this,t,[n]),ua(r,"handleDrag",function(s){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(s):r.state.isSlideMoving&&r.handleSlideDrag(s)}),ua(r,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&r.handleDrag(s.changedTouches[0])}),ua(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=r.props,a=s.endIndex,o=s.onDragEnd,l=s.startIndex;o==null||o({endIndex:a,startIndex:l})}),r.detachDragEndListener()}),ua(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),ua(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),ua(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),ua(r,"handleSlideDragStart",function(s){var a=Tz(s)?s.changedTouches[0]:s;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return pOe(t,e),dOe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=r.startX,a=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,h=u.length-1,d=Math.min(s,a),m=Math.max(s,a),g=t.getIndexInRange(o,d),w=t.getIndexInRange(o,m);return{startIndex:g-g%c,endIndex:w===h?h:w-w%c}}},{key:"getTextOfTick",value:function(r){var s=this.props,a=s.data,o=s.tickFormatter,l=s.dataKey,c=wr(a[r],l,r);return At(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var s=this.state,a=s.slideMoveStartX,o=s.startX,l=s.endX,c=this.props,u=c.x,h=c.width,d=c.travellerWidth,m=c.startIndex,g=c.endIndex,w=c.onChange,v=r.pageX-a;v>0?v=Math.min(v,u+h-d-l,u+h-d-o):v<0&&(v=Math.max(v,u-o,u-l));var b=this.getIndex({startX:o+v,endX:l+v});(b.startIndex!==m||b.endIndex!==g)&&w&&w(b),this.setState({startX:o+v,endX:l+v,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var a=Tz(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var s=this.state,a=s.brushMoveStartX,o=s.movingTravellerId,l=s.endX,c=s.startX,u=this.state[o],h=this.props,d=h.x,m=h.width,g=h.travellerWidth,w=h.onChange,v=h.gap,b=h.data,y={startX:this.state.startX,endX:this.state.endX},_=r.pageX-a;_>0?_=Math.min(_,d+m-g-u):_<0&&(_=Math.max(_,d-u)),y[o]=u+_;var N=this.getIndex(y),j=N.startIndex,S=N.endIndex,C=function(){var A=b.length-1;return o==="startX"&&(l>c?j%v===0:S%v===0)||l<c&&S===A||o==="endX"&&(l>c?S%v===0:j%v===0)||l>c&&S===A};this.setState(ua(ua({},o,u+_),"brushMoveStartX",r.pageX),function(){w&&C()&&w(N)})}},{key:"handleTravellerMoveKeyboard",value:function(r,s){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,h=this.state[s],d=l.indexOf(h);if(d!==-1){var m=d+r;if(!(m===-1||m>=l.length)){var g=l[m];s==="startX"&&g>=u||s==="endX"&&g<=c||this.setState(ua({},s,g),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return se.createElement("rect",{stroke:u,fill:c,x:s,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.data,u=r.children,h=r.padding,d=O.Children.only(u);return d?se.cloneElement(d,{x:s,y:a,width:o,height:l,margin:h,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,s){var a,o,l=this,c=this.props,u=c.y,h=c.travellerWidth,d=c.height,m=c.traveller,g=c.ariaLabel,w=c.data,v=c.startIndex,b=c.endIndex,y=Math.max(r,this.props.x),_=LC(LC({},wt(this.props,!1)),{},{x:y,y:u,width:h,height:d}),N=g||"Min value: ".concat((a=w[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=w[b])===null||o===void 0?void 0:o.name);return se.createElement(dn,{tabIndex:0,role:"slider","aria-label":N,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,s))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,_))}},{key:"renderSlide",value:function(r,s){var a=this.props,o=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,h=Math.min(r,s)+u,d=Math.max(Math.abs(s-r)-u,0);return se.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:h,y:o,width:d,height:l})}},{key:"renderText",value:function(){var r=this.props,s=r.startIndex,a=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,h=this.state,d=h.startX,m=h.endX,g=5,w={pointerEvents:"none",fill:u};return se.createElement(dn,{className:"recharts-brush-texts"},se.createElement(Vh,u_({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,m)-g,y:o+l/2},w),this.getTextOfTick(s)),se.createElement(Vh,u_({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,m)+c+g,y:o+l/2},w),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,s=r.data,a=r.className,o=r.children,l=r.x,c=r.y,u=r.width,h=r.height,d=r.alwaysShowText,m=this.state,g=m.startX,w=m.endX,v=m.isTextActive,b=m.isSlideMoving,y=m.isTravellerMoving,_=m.isTravellerFocused;if(!s||!s.length||!et(l)||!et(c)||!et(u)||!et(h)||u<=0||h<=0)return null;var N=Tt("recharts-brush",a),j=se.Children.count(o)===1,S=cOe("userSelect","none");return se.createElement(dn,{className:N,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),j&&this.renderPanorama(),this.renderSlide(g,w),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(w,"endX"),(v||b||y||_||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var s=r.x,a=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(a+l/2)-1;return se.createElement(se.Fragment,null,se.createElement("rect",{x:s,y:a,width:o,height:l,fill:c,stroke:"none"}),se.createElement("line",{x1:s+1,y1:u,x2:s+o-1,y2:u,fill:"none",stroke:"#fff"}),se.createElement("line",{x1:s+1,y1:u+2,x2:s+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,s){var a;return se.isValidElement(r)?a=se.cloneElement(r,s):At(r)?a=r(s):a=t.renderDefaultTraveller(s),a}},{key:"getDerivedStateFromProps",value:function(r,s){var a=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,h=r.startIndex,d=r.endIndex;if(a!==s.prevData||u!==s.prevUpdateId)return LC({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?vOe({data:a,width:o,x:l,travellerWidth:c,startIndex:h,endIndex:d}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||l!==s.prevX||c!==s.prevTravellerWidth)){s.scale.range([l,l+o-c]);var m=s.scale.domain().map(function(g){return s.scale(g)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(r,s){for(var a=r.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>s?l=c:o=c}return s>=r[l]?l:o}}])})(O.PureComponent);ua(qg,"displayName","Brush");ua(qg,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var FC,Rz;function xOe(){if(Rz)return FC;Rz=1;var e=CR();function t(n,r){var s;return e(n,function(a,o,l){return s=r(a,o,l),!s}),!!s}return FC=t,FC}var $C,Mz;function yOe(){if(Mz)return $C;Mz=1;var e=oH(),t=Zl(),n=xOe(),r=Qs(),s=NN();function a(o,l,c){var u=r(o)?e:n;return c&&s(o,l,c)&&(l=void 0),u(o,t(l,3))}return $C=a,$C}var bOe=yOe();const wOe=En(bOe);var Ul=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},qC,Iz;function jOe(){if(Iz)return qC;Iz=1;var e=ZH();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return qC=t,qC}var zC,Dz;function _Oe(){if(Dz)return zC;Dz=1;var e=jOe(),t=YH(),n=Zl();function r(s,a){var o={};return a=n(a,3),t(s,function(l,c,u){e(o,c,a(l,c,u))}),o}return zC=r,zC}var NOe=_Oe();const SOe=En(NOe);var BC,Lz;function kOe(){if(Lz)return BC;Lz=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(!n(t[r],r,t))return!1;return!0}return BC=e,BC}var UC,Fz;function EOe(){if(Fz)return UC;Fz=1;var e=CR();function t(n,r){var s=!0;return e(n,function(a,o,l){return s=!!r(a,o,l),s}),s}return UC=t,UC}var VC,$z;function POe(){if($z)return VC;$z=1;var e=kOe(),t=EOe(),n=Zl(),r=Qs(),s=NN();function a(o,l,c){var u=r(o)?e:t;return c&&s(o,l,c)&&(l=void 0),u(o,n(l,3))}return VC=a,VC}var COe=POe();const WG=En(COe);var AOe=["x","y"];function Ry(e){"@babel/helpers - typeof";return Ry=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ry(e)}function hT(){return hT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hT.apply(this,arguments)}function qz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function d0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qz(Object(n),!0).forEach(function(r){OOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OOe(e,t,n){return t=TOe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TOe(e){var t=ROe(e,"string");return Ry(t)=="symbol"?t:t+""}function ROe(e,t){if(Ry(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ry(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MOe(e,t){if(e==null)return{};var n=IOe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function IOe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function DOe(e,t){var n=e.x,r=e.y,s=MOe(e,AOe),a="".concat(n),o=parseInt(a,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||s.height),h=parseInt(u,10),d="".concat(t.width||s.width),m=parseInt(d,10);return d0(d0(d0(d0(d0({},t),s),o?{x:o}:{}),c?{y:c}:{}),{},{height:h,width:m,name:t.name,radius:t.radius})}function zz(e){return se.createElement(DG,hT({shapeType:"rectangle",propTransformer:DOe,activeClassName:"recharts-active-bar"},e))}var LOe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,s){if(typeof t=="number")return t;var a=et(r)||vbe(r);return a?t(r,s):(a||Hh(),n)}},FOe=["value","background"],HG;function zg(e){"@babel/helpers - typeof";return zg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zg(e)}function $Oe(e,t){if(e==null)return{};var n=qOe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qOe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function f_(){return f_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f_.apply(this,arguments)}function Bz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bz(Object(n),!0).forEach(function(r){Nd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zOe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uz(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,GG(r.key),r)}}function BOe(e,t,n){return t&&Uz(e.prototype,t),n&&Uz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function UOe(e,t,n){return t=h_(t),VOe(e,KG()?Reflect.construct(t,n||[],h_(e).constructor):t.apply(e,n))}function VOe(e,t){if(t&&(zg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WOe(e)}function WOe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KG=function(){return!!e})()}function h_(e){return h_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},h_(e)}function HOe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mT(e,t)}function mT(e,t){return mT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},mT(e,t)}function Nd(e,t,n){return t=GG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GG(e){var t=KOe(e,"string");return zg(t)=="symbol"?t:t+""}function KOe(e,t){if(zg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ql=(function(e){function t(){var n;zOe(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=UOe(this,t,[].concat(s)),Nd(n,"state",{isAnimationFinished:!1}),Nd(n,"id",tm("recharts-bar-")),Nd(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Nd(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return HOe(t,e),BOe(t,[{key:"renderRectanglesStatically",value:function(r){var s=this,a=this.props,o=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,h=wt(this.props,!1);return r&&r.map(function(d,m){var g=m===c,w=g?u:o,v=Ur(Ur(Ur({},h),d),{},{isActive:g,option:w,index:m,dataKey:l,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return se.createElement(dn,f_({className:"recharts-bar-rectangle"},Uh(s.props,d,m),{key:"rectangle-".concat(d==null?void 0:d.x,"-").concat(d==null?void 0:d.y,"-").concat(d==null?void 0:d.value,"-").concat(m)}),se.createElement(zz,v))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,s=this.props,a=s.data,o=s.layout,l=s.isAnimationActive,c=s.animationBegin,u=s.animationDuration,h=s.animationEasing,d=s.animationId,m=this.state.prevData;return se.createElement(so,{begin:c,duration:u,isActive:l,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var w=g.t,v=a.map(function(b,y){var _=m&&m[y];if(_){var N=yr(_.x,b.x),j=yr(_.y,b.y),S=yr(_.width,b.width),C=yr(_.height,b.height);return Ur(Ur({},b),{},{x:N(w),y:j(w),width:S(w),height:C(w)})}if(o==="horizontal"){var P=yr(0,b.height),A=P(w);return Ur(Ur({},b),{},{y:b.y+b.height-A,height:A})}var F=yr(0,b.width),I=F(w);return Ur(Ur({},b),{},{width:I})});return se.createElement(dn,null,r.renderRectanglesStatically(v))})}},{key:"renderRectangles",value:function(){var r=this.props,s=r.data,a=r.isAnimationActive,o=this.state.prevData;return a&&s&&s.length&&(!o||!Bd(o,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}},{key:"renderBackground",value:function(){var r=this,s=this.props,a=s.data,o=s.dataKey,l=s.activeIndex,c=wt(this.props.background,!1);return a.map(function(u,h){u.value;var d=u.background,m=$Oe(u,FOe);if(!d)return null;var g=Ur(Ur(Ur(Ur(Ur({},m),{},{fill:"#eee"},d),c),Uh(r.props,u,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return se.createElement(zz,f_({key:"background-bar-".concat(h),option:r.props.background,isActive:h===l},g))})}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,h=a.children,d=xa(h,mb);if(!d)return null;var m=u==="vertical"?o[0].height/2:o[0].width/2,g=function(b,y){var _=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:_,errorVal:wr(b,y)}},w={clipPath:r?"url(#clipPath-".concat(s,")"):null};return se.createElement(dn,w,d.map(function(v){return se.cloneElement(v,{key:"error-bar-".concat(s,"-").concat(v.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:m,dataPointFormatter:g})}))}},{key:"render",value:function(){var r=this.props,s=r.hide,a=r.data,o=r.className,l=r.xAxis,c=r.yAxis,u=r.left,h=r.top,d=r.width,m=r.height,g=r.isAnimationActive,w=r.background,v=r.id;if(s||!a||!a.length)return null;var b=this.state.isAnimationFinished,y=Tt("recharts-bar",o),_=l&&l.allowDataOverflow,N=c&&c.allowDataOverflow,j=_||N,S=zt(v)?this.id:v;return se.createElement(dn,{className:y},_||N?se.createElement("defs",null,se.createElement("clipPath",{id:"clipPath-".concat(S)},se.createElement("rect",{x:_?u:u-d/2,y:N?h:h-m/2,width:_?d:d*2,height:N?m:m*2}))):null,se.createElement(dn,{className:"recharts-bar-rectangles",clipPath:j?"url(#clipPath-".concat(S,")"):null},w?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(j,S),(!g||b)&&Uo.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:s.curData}:r.data!==s.curData?{curData:r.data}:null}}])})(O.PureComponent);HG=Ql;Nd(Ql,"displayName","Bar");Nd(Ql,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!mu.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Nd(Ql,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,s=e.bandSize,a=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,h=e.dataStartIndex,d=e.displayedData,m=e.offset,g=eke(r,n);if(!g)return null;var w=t.layout,v=n.type.defaultProps,b=v!==void 0?Ur(Ur({},v),n.props):n.props,y=b.dataKey,_=b.children,N=b.minPointSize,j=w==="horizontal"?o:a,S=u?j.scale.domain():null,C=oke({numericAxis:j}),P=xa(_,SN),A=d.map(function(F,I){var R,M,$,B,U,G;u?R=tke(u[h+I],S):(R=wr(F,y),Array.isArray(R)||(R=[C,R]));var Z=LOe(N,HG.defaultProps.minPointSize)(R[1],I);if(w==="horizontal"){var X,V=[o.scale(R[0]),o.scale(R[1])],z=V[0],L=V[1];M=cq({axis:a,ticks:l,bandSize:s,offset:g.offset,entry:F,index:I}),$=(X=L??z)!==null&&X!==void 0?X:void 0,B=g.size;var W=z-L;if(U=Number.isNaN(W)?0:W,G={x:M,y:o.y,width:B,height:o.height},Math.abs(Z)>0&&Math.abs(U)<Math.abs(Z)){var Q=xs(U||Z)*(Math.abs(Z)-Math.abs(U));$-=Q,U+=Q}}else{var J=[a.scale(R[0]),a.scale(R[1])],ne=J[0],Y=J[1];if(M=ne,$=cq({axis:o,ticks:c,bandSize:s,offset:g.offset,entry:F,index:I}),B=Y-ne,U=g.size,G={x:a.x,y:$,width:a.width,height:U},Math.abs(Z)>0&&Math.abs(B)<Math.abs(Z)){var ee=xs(B||Z)*(Math.abs(Z)-Math.abs(B));B+=ee}}return Ur(Ur(Ur({},F),{},{x:M,y:$,width:B,height:U,value:u?R:R[1],payload:F,background:G},P&&P[I]&&P[I].props),{},{tooltipPayload:[mG(n,F)],tooltipPosition:{x:M+B/2,y:$+U/2}})});return Ur({data:A,layout:w},m)});function My(e){"@babel/helpers - typeof";return My=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},My(e)}function GOe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vz(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,QG(r.key),r)}}function QOe(e,t,n){return t&&Vz(e.prototype,t),n&&Vz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Fo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wz(Object(n),!0).forEach(function(r){qN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qN(e,t,n){return t=QG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QG(e){var t=YOe(e,"string");return My(t)=="symbol"?t:t+""}function YOe(e,t){if(My(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(My(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var i5=function(t,n,r,s,a){var o=t.width,l=t.height,c=t.layout,u=t.children,h=Object.keys(n),d={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},m=!!da(u,Ql);return h.reduce(function(g,w){var v=n[w],b=v.orientation,y=v.domain,_=v.padding,N=_===void 0?{}:_,j=v.mirror,S=v.reversed,C="".concat(b).concat(j?"Mirror":""),P,A,F,I,R;if(v.type==="number"&&(v.padding==="gap"||v.padding==="no-gap")){var M=y[1]-y[0],$=1/0,B=v.categoricalDomain.sort(bbe);if(B.forEach(function(J,ne){ne>0&&($=Math.min((J||0)-(B[ne-1]||0),$))}),Number.isFinite($)){var U=$/M,G=v.layout==="vertical"?r.height:r.width;if(v.padding==="gap"&&(P=U*G/2),v.padding==="no-gap"){var Z=ys(t.barCategoryGap,U*G),X=U*G/2;P=X-Z-(X-Z)/G*Z}}}s==="xAxis"?A=[r.left+(N.left||0)+(P||0),r.left+r.width-(N.right||0)-(P||0)]:s==="yAxis"?A=c==="horizontal"?[r.top+r.height-(N.bottom||0),r.top+(N.top||0)]:[r.top+(N.top||0)+(P||0),r.top+r.height-(N.bottom||0)-(P||0)]:A=v.range,S&&(A=[A[1],A[0]]);var V=uG(v,a,m),z=V.scale,L=V.realScaleType;z.domain(y).range(A),dG(z);var W=fG(z,Fo(Fo({},v),{},{realScaleType:L}));s==="xAxis"?(R=b==="top"&&!j||b==="bottom"&&j,F=r.left,I=d[C]-R*v.height):s==="yAxis"&&(R=b==="left"&&!j||b==="right"&&j,F=d[C]-R*v.width,I=r.top);var Q=Fo(Fo(Fo({},v),W),{},{realScaleType:L,x:F,y:I,scale:z,width:s==="xAxis"?r.width:v.width,height:s==="yAxis"?r.height:v.height});return Q.bandSize=Qj(Q,W),!v.hide&&s==="xAxis"?d[C]+=(R?-1:1)*Q.height:v.hide||(d[C]+=(R?-1:1)*Q.width),Fo(Fo({},g),{},qN({},w,Q))},{})},YG=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return{x:Math.min(r,a),y:Math.min(s,o),width:Math.abs(a-r),height:Math.abs(o-s)}},XOe=function(t){var n=t.x1,r=t.y1,s=t.x2,a=t.y2;return YG({x:n,y:r},{x:s,y:a})},XG=(function(){function e(t){GOe(this,e),this.scale=t}return QOe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(s){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),s=r[0],a=r[r.length-1];return s<=a?n>=s&&n<=a:n>=a&&n<=s}}],[{key:"create",value:function(n){return new e(n)}}])})();qN(XG,"EPS",1e-4);var s5=function(t){var n=Object.keys(t).reduce(function(r,s){return Fo(Fo({},r),{},qN({},s,XG.create(t[s])))},{});return Fo(Fo({},n),{},{apply:function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return SOe(s,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(s){return WG(s,function(a,o){return n[o].isInRange(a)})}})};function ZOe(e){return(e%180+180)%180}var JOe=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=ZOe(s),o=a*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},WC,Hz;function eTe(){if(Hz)return WC;Hz=1;var e=Zl(),t=cb(),n=vN();function r(s){return function(a,o,l){var c=Object(a);if(!t(a)){var u=e(o,3);a=n(a),o=function(d){return u(c[d],d,c)}}var h=s(a,o,l);return h>-1?c[u?a[h]:h]:void 0}}return WC=r,WC}var HC,Kz;function tTe(){if(Kz)return HC;Kz=1;var e=zG();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return HC=t,HC}var KC,Gz;function nTe(){if(Gz)return KC;Gz=1;var e=WH(),t=Zl(),n=tTe(),r=Math.max;function s(a,o,l){var c=a==null?0:a.length;if(!c)return-1;var u=l==null?0:n(l);return u<0&&(u=r(c+u,0)),e(a,t(o,3),u)}return KC=s,KC}var GC,Qz;function rTe(){if(Qz)return GC;Qz=1;var e=eTe(),t=nTe(),n=e(t);return GC=n,GC}var iTe=rTe();const sTe=En(iTe);var aTe=vH();const oTe=En(aTe);var lTe=oTe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),a5=O.createContext(void 0),o5=O.createContext(void 0),ZG=O.createContext(void 0),JG=O.createContext({}),eQ=O.createContext(void 0),tQ=O.createContext(0),nQ=O.createContext(0),Yz=function(t){var n=t.state,r=n.xAxisMap,s=n.yAxisMap,a=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,h=lTe(a);return se.createElement(a5.Provider,{value:r},se.createElement(o5.Provider,{value:s},se.createElement(JG.Provider,{value:a},se.createElement(ZG.Provider,{value:h},se.createElement(eQ.Provider,{value:o},se.createElement(tQ.Provider,{value:u},se.createElement(nQ.Provider,{value:c},l)))))))},cTe=function(){return O.useContext(eQ)},rQ=function(t){var n=O.useContext(a5);n==null&&Hh();var r=n[t];return r==null&&Hh(),r},uTe=function(){var t=O.useContext(a5);return ud(t)},dTe=function(){var t=O.useContext(o5),n=sTe(t,function(r){return WG(r.domain,Number.isFinite)});return n||ud(t)},iQ=function(t){var n=O.useContext(o5);n==null&&Hh();var r=n[t];return r==null&&Hh(),r},fTe=function(){var t=O.useContext(ZG);return t},hTe=function(){return O.useContext(JG)},l5=function(){return O.useContext(nQ)},c5=function(){return O.useContext(tQ)};function Bg(e){"@babel/helpers - typeof";return Bg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bg(e)}function mTe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pTe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,aQ(r.key),r)}}function gTe(e,t,n){return t&&pTe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vTe(e,t,n){return t=m_(t),xTe(e,sQ()?Reflect.construct(t,n||[],m_(e).constructor):t.apply(e,n))}function xTe(e,t){if(t&&(Bg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yTe(e)}function yTe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sQ=function(){return!!e})()}function m_(e){return m_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},m_(e)}function bTe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pT(e,t)}function pT(e,t){return pT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},pT(e,t)}function Xz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Zz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xz(Object(n),!0).forEach(function(r){u5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u5(e,t,n){return t=aQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aQ(e){var t=wTe(e,"string");return Bg(t)=="symbol"?t:t+""}function wTe(e,t){if(Bg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function jTe(e,t){return kTe(e)||STe(e,t)||NTe(e,t)||_Te()}function _Te(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
833In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NTe(e,t){if(e){if(typeof e=="string")return Jz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jz(e,t)}}function Jz(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function STe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function kTe(e){if(Array.isArray(e))return e}function gT(){return gT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gT.apply(this,arguments)}var ETe=function(t,n){var r;return se.isValidElement(t)?r=se.cloneElement(t,n):At(t)?r=t(n):r=se.createElement("line",gT({},n,{className:"recharts-reference-line-line"})),r},PTe=function(t,n,r,s,a,o,l,c,u){var h=a.x,d=a.y,m=a.width,g=a.height;if(r){var w=u.y,v=t.y.apply(w,{position:o});if(Ul(u,"discard")&&!t.y.isInRange(v))return null;var b=[{x:h+m,y:v},{x:h,y:v}];return c==="left"?b.reverse():b}if(n){var y=u.x,_=t.x.apply(y,{position:o});if(Ul(u,"discard")&&!t.x.isInRange(_))return null;var N=[{x:_,y:d+g},{x:_,y:d}];return l==="top"?N.reverse():N}if(s){var j=u.segment,S=j.map(function(C){return t.apply(C,{position:o})});return Ul(u,"discard")&&wOe(S,function(C){return!t.isInRange(C)})?null:S}return null};function CTe(e){var t=e.x,n=e.y,r=e.segment,s=e.xAxisId,a=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=cTe(),h=rQ(s),d=iQ(a),m=fTe();if(!u||!m)return null;Bo(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=s5({x:h.scale,y:d.scale}),w=oi(t),v=oi(n),b=r&&r.length===2,y=PTe(g,w,v,b,m,e.position,h.orientation,d.orientation,e);if(!y)return null;var _=jTe(y,2),N=_[0],j=N.x,S=N.y,C=_[1],P=C.x,A=C.y,F=Ul(e,"hidden")?"url(#".concat(u,")"):void 0,I=Zz(Zz({clipPath:F},wt(e,!0)),{},{x1:j,y1:S,x2:P,y2:A});return se.createElement(dn,{className:Tt("recharts-reference-line",l)},ETe(o,I),Ni.renderCallByParent(e,XOe({x1:j,y1:S,x2:P,y2:A})))}var d5=(function(e){function t(){return mTe(this,t),vTe(this,t,arguments)}return bTe(t,e),gTe(t,[{key:"render",value:function(){return se.createElement(CTe,this.props)}}])})(se.Component);u5(d5,"displayName","ReferenceLine");u5(d5,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function vT(){return vT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vT.apply(this,arguments)}function Ug(e){"@babel/helpers - typeof";return Ug=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ug(e)}function e8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function t8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e8(Object(n),!0).forEach(function(r){zN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ATe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OTe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lQ(r.key),r)}}function TTe(e,t,n){return t&&OTe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function RTe(e,t,n){return t=p_(t),MTe(e,oQ()?Reflect.construct(t,n||[],p_(e).constructor):t.apply(e,n))}function MTe(e,t){if(t&&(Ug(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ITe(e)}function ITe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oQ=function(){return!!e})()}function p_(e){return p_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},p_(e)}function DTe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xT(e,t)}function xT(e,t){return xT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},xT(e,t)}function zN(e,t,n){return t=lQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lQ(e){var t=LTe(e,"string");return Ug(t)=="symbol"?t:t+""}function LTe(e,t){if(Ug(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ug(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var FTe=function(t){var n=t.x,r=t.y,s=t.xAxis,a=t.yAxis,o=s5({x:s.scale,y:a.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return Ul(t,"discard")&&!o.isInRange(l)?null:l},BN=(function(e){function t(){return ATe(this,t),RTe(this,t,arguments)}return DTe(t,e),TTe(t,[{key:"render",value:function(){var r=this.props,s=r.x,a=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=oi(s),h=oi(a);if(Bo(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!h)return null;var d=FTe(this.props);if(!d)return null;var m=d.x,g=d.y,w=this.props,v=w.shape,b=w.className,y=Ul(this.props,"hidden")?"url(#".concat(c,")"):void 0,_=t8(t8({clipPath:y},wt(this.props,!0)),{},{cx:m,cy:g});return se.createElement(dn,{className:Tt("recharts-reference-dot",b)},t.renderDot(v,_),Ni.renderCallByParent(this.props,{x:m-o,y:g-o,width:2*o,height:2*o}))}}])})(se.Component);zN(BN,"displayName","ReferenceDot");zN(BN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});zN(BN,"renderDot",function(e,t){var n;return se.isValidElement(e)?n=se.cloneElement(e,t):At(e)?n=e(t):n=se.createElement(yv,vT({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function yT(){return yT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yT.apply(this,arguments)}function Vg(e){"@babel/helpers - typeof";return Vg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vg(e)}function n8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function r8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n8(Object(n),!0).forEach(function(r){UN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qTe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,uQ(r.key),r)}}function zTe(e,t,n){return t&&qTe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function BTe(e,t,n){return t=g_(t),UTe(e,cQ()?Reflect.construct(t,n||[],g_(e).constructor):t.apply(e,n))}function UTe(e,t){if(t&&(Vg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VTe(e)}function VTe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cQ=function(){return!!e})()}function g_(e){return g_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},g_(e)}function WTe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bT(e,t)}function bT(e,t){return bT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},bT(e,t)}function UN(e,t,n){return t=uQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uQ(e){var t=HTe(e,"string");return Vg(t)=="symbol"?t:t+""}function HTe(e,t){if(Vg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var KTe=function(t,n,r,s,a){var o=a.x1,l=a.x2,c=a.y1,u=a.y2,h=a.xAxis,d=a.yAxis;if(!h||!d)return null;var m=s5({x:h.scale,y:d.scale}),g={x:t?m.x.apply(o,{position:"start"}):m.x.rangeMin,y:r?m.y.apply(c,{position:"start"}):m.y.rangeMin},w={x:n?m.x.apply(l,{position:"end"}):m.x.rangeMax,y:s?m.y.apply(u,{position:"end"}):m.y.rangeMax};return Ul(a,"discard")&&(!m.isInRange(g)||!m.isInRange(w))?null:YG(g,w)},VN=(function(e){function t(){return $Te(this,t),BTe(this,t,arguments)}return WTe(t,e),zTe(t,[{key:"render",value:function(){var r=this.props,s=r.x1,a=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,h=r.clipPathId;Bo(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var d=oi(s),m=oi(a),g=oi(o),w=oi(l),v=this.props.shape;if(!d&&!m&&!g&&!w&&!v)return null;var b=KTe(d,m,g,w,this.props);if(!b&&!v)return null;var y=Ul(this.props,"hidden")?"url(#".concat(h,")"):void 0;return se.createElement(dn,{className:Tt("recharts-reference-area",c)},t.renderRect(v,r8(r8({clipPath:y},wt(this.props,!0)),b)),Ni.renderCallByParent(this.props,b))}}])})(se.Component);UN(VN,"displayName","ReferenceArea");UN(VN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});UN(VN,"renderRect",function(e,t){var n;return se.isValidElement(e)?n=se.cloneElement(e,t):At(e)?n=e(t):n=se.createElement(r5,yT({},t,{className:"recharts-reference-area-rect"})),n});function dQ(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],s=0;s<e.length;s+=t)r.push(e[s]);return r}function GTe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return JOe(r,n)}function QTe(e,t,n){var r=n==="width",s=e.x,a=e.y,o=e.width,l=e.height;return t===1?{start:r?s:a,end:r?s+o:a+l}:{start:r?s+o:a+l,end:r?s:a}}function v_(e,t,n,r,s){if(e*t<e*r||e*t>e*s)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-s)<=0}function YTe(e,t){return dQ(e,t+1)}function XTe(e,t,n,r,s){for(var a=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,h=o,d=function(){var w=r==null?void 0:r[c];if(w===void 0)return{v:dQ(r,u)};var v=c,b,y=function(){return b===void 0&&(b=n(w,v)),b},_=w.coordinate,N=c===0||v_(e,_,y,h,l);N||(c=0,h=o,u+=1),N&&(h=_+e*(y()/2+s),c+=u)},m;u<=a.length;)if(m=d(),m)return m.v;return[]}function Iy(e){"@babel/helpers - typeof";return Iy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iy(e)}function i8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Xi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i8(Object(n),!0).forEach(function(r){ZTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZTe(e,t,n){return t=JTe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JTe(e){var t=e4e(e,"string");return Iy(t)=="symbol"?t:t+""}function e4e(e,t){if(Iy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Iy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function t4e(e,t,n,r,s){for(var a=(r||[]).slice(),o=a.length,l=t.start,c=t.end,u=function(m){var g=a[m],w,v=function(){return w===void 0&&(w=n(g,m)),w};if(m===o-1){var b=e*(g.coordinate+e*v()/2-c);a[m]=g=Xi(Xi({},g),{},{tickCoord:b>0?g.coordinate-b*e:g.coordinate})}else a[m]=g=Xi(Xi({},g),{},{tickCoord:g.coordinate});var y=v_(e,g.tickCoord,v,l,c);y&&(c=g.tickCoord-e*(v()/2+s),a[m]=Xi(Xi({},g),{},{isShow:!0}))},h=o-1;h>=0;h--)u(h);return a}function n4e(e,t,n,r,s,a){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(a){var h=r[l-1],d=n(h,l-1),m=e*(h.coordinate+e*d/2-u);o[l-1]=h=Xi(Xi({},h),{},{tickCoord:m>0?h.coordinate-m*e:h.coordinate});var g=v_(e,h.tickCoord,function(){return d},c,u);g&&(u=h.tickCoord-e*(d/2+s),o[l-1]=Xi(Xi({},h),{},{isShow:!0}))}for(var w=a?l-1:l,v=function(_){var N=o[_],j,S=function(){return j===void 0&&(j=n(N,_)),j};if(_===0){var C=e*(N.coordinate-e*S()/2-c);o[_]=N=Xi(Xi({},N),{},{tickCoord:C<0?N.coordinate-C*e:N.coordinate})}else o[_]=N=Xi(Xi({},N),{},{tickCoord:N.coordinate});var P=v_(e,N.tickCoord,S,c,u);P&&(c=N.tickCoord+e*(S()/2+s),o[_]=Xi(Xi({},N),{},{isShow:!0}))},b=0;b<w;b++)v(b);return o}function f5(e,t,n){var r=e.tick,s=e.ticks,a=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,h=e.unit,d=e.angle;if(!s||!s.length||!r)return[];if(et(c)||mu.isSsr)return YTe(s,typeof c=="number"&&et(c)?c:0);var m=[],g=l==="top"||l==="bottom"?"width":"height",w=h&&g==="width"?O0(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},v=function(N,j){var S=At(u)?u(N.value,j):N.value;return g==="width"?GTe(O0(S,{fontSize:t,letterSpacing:n}),w,d):O0(S,{fontSize:t,letterSpacing:n})[g]},b=s.length>=2?xs(s[1].coordinate-s[0].coordinate):1,y=QTe(a,b,g);return c==="equidistantPreserveStart"?XTe(b,y,v,s,o):(c==="preserveStart"||c==="preserveStartEnd"?m=n4e(b,y,v,s,o,c==="preserveStartEnd"):m=t4e(b,y,v,s,o),m.filter(function(_){return _.isShow}))}var r4e=["viewBox"],i4e=["viewBox"],s4e=["ticks"];function Wg(e){"@babel/helpers - typeof";return Wg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wg(e)}function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yp.apply(this,arguments)}function s8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ri(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s8(Object(n),!0).forEach(function(r){h5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QC(e,t){if(e==null)return{};var n=a4e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function a4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function o4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a8(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hQ(r.key),r)}}function l4e(e,t,n){return t&&a8(e.prototype,t),n&&a8(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c4e(e,t,n){return t=x_(t),u4e(e,fQ()?Reflect.construct(t,n||[],x_(e).constructor):t.apply(e,n))}function u4e(e,t){if(t&&(Wg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d4e(e)}function d4e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fQ=function(){return!!e})()}function x_(e){return x_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},x_(e)}function f4e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wT(e,t)}function wT(e,t){return wT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},wT(e,t)}function h5(e,t,n){return t=hQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hQ(e){var t=h4e(e,"string");return Wg(t)=="symbol"?t:t+""}function h4e(e,t){if(Wg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jv=(function(e){function t(n){var r;return o4e(this,t),r=c4e(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return f4e(t,e),l4e(t,[{key:"shouldComponentUpdate",value:function(r,s){var a=r.viewBox,o=QC(r,r4e),l=this.props,c=l.viewBox,u=QC(l,i4e);return!eg(a,c)||!eg(o,u)||!eg(s,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var s=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];s&&this.setState({fontSize:window.getComputedStyle(s).fontSize,letterSpacing:window.getComputedStyle(s).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var s=this.props,a=s.x,o=s.y,l=s.width,c=s.height,u=s.orientation,h=s.tickSize,d=s.mirror,m=s.tickMargin,g,w,v,b,y,_,N=d?-1:1,j=r.tickSize||h,S=et(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":g=w=r.coordinate,b=o+ +!d*c,v=b-N*j,_=v-N*m,y=S;break;case"left":v=b=r.coordinate,w=a+ +!d*l,g=w-N*j,y=g-N*m,_=S;break;case"right":v=b=r.coordinate,w=a+ +d*l,g=w+N*j,y=g+N*m,_=S;break;default:g=w=r.coordinate,b=o+ +d*c,v=b+N*j,_=v+N*m,y=S;break}return{line:{x1:g,y1:v,x2:w,y2:b},tick:{x:y,y:_}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,s=r.orientation,a=r.mirror,o;switch(s){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,s=r.orientation,a=r.mirror,o="end";switch(s){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,h=r.axisLine,d=ri(ri(ri({},wt(this.props,!1)),wt(h,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var m=+(c==="top"&&!u||c==="bottom"&&u);d=ri(ri({},d),{},{x1:s,y1:a+m*l,x2:s+o,y2:a+m*l})}else{var g=+(c==="left"&&!u||c==="right"&&u);d=ri(ri({},d),{},{x1:s+g*o,y1:a,x2:s+g*o,y2:a+l})}return se.createElement("line",Yp({},d,{className:Tt("recharts-cartesian-axis-line",va(h,"className"))}))}},{key:"renderTicks",value:function(r,s,a){var o=this,l=this.props,c=l.tickLine,u=l.stroke,h=l.tick,d=l.tickFormatter,m=l.unit,g=f5(ri(ri({},this.props),{},{ticks:r}),s,a),w=this.getTickTextAnchor(),v=this.getTickVerticalAnchor(),b=wt(this.props,!1),y=wt(h,!1),_=ri(ri({},b),{},{fill:"none"},wt(c,!1)),N=g.map(function(j,S){var C=o.getTickLineCoord(j),P=C.line,A=C.tick,F=ri(ri(ri(ri({textAnchor:w,verticalAnchor:v},b),{},{stroke:"none",fill:u},y),A),{},{index:S,payload:j,visibleTicksCount:g.length,tickFormatter:d});return se.createElement(dn,Yp({className:"recharts-cartesian-axis-tick",key:"tick-".concat(j.value,"-").concat(j.coordinate,"-").concat(j.tickCoord)},Uh(o.props,j,S)),c&&se.createElement("line",Yp({},_,P,{className:Tt("recharts-cartesian-axis-tick-line",va(c,"className"))})),h&&t.renderTickItem(h,F,"".concat(At(d)?d(j.value,S):j.value).concat(m||"")))});return se.createElement("g",{className:"recharts-cartesian-axis-ticks"},N)}},{key:"render",value:function(){var r=this,s=this.props,a=s.axisLine,o=s.width,l=s.height,c=s.ticksGenerator,u=s.className,h=s.hide;if(h)return null;var d=this.props,m=d.ticks,g=QC(d,s4e),w=m;return At(c)&&(w=m&&m.length>0?c(this.props):c(g)),o<=0||l<=0||!w||!w.length?null:se.createElement(dn,{className:Tt("recharts-cartesian-axis",u),ref:function(b){r.layerReference=b}},a&&this.renderAxisLine(),this.renderTicks(w,this.state.fontSize,this.state.letterSpacing),Ni.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,a){var o,l=Tt(s.className,"recharts-cartesian-axis-tick-value");return se.isValidElement(r)?o=se.cloneElement(r,ri(ri({},s),{},{className:l})):At(r)?o=r(ri(ri({},s),{},{className:l})):o=se.createElement(Vh,Yp({},s,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(O.Component);h5(jv,"displayName","CartesianAxis");h5(jv,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var m4e=["x1","y1","x2","y2","key"],p4e=["offset"];function Kh(e){"@babel/helpers - typeof";return Kh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kh(e)}function o8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Zi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o8(Object(n),!0).forEach(function(r){g4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g4e(e,t,n){return t=v4e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v4e(e){var t=x4e(e,"string");return Kh(t)=="symbol"?t:t+""}function x4e(e,t){if(Kh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hh(){return hh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hh.apply(this,arguments)}function l8(e,t){if(e==null)return{};var n=y4e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function y4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var b4e=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,s=t.x,a=t.y,o=t.width,l=t.height,c=t.ry;return se.createElement("rect",{x:s,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function mQ(e,t){var n;if(se.isValidElement(e))n=se.cloneElement(e,t);else if(At(e))n=e(t);else{var r=t.x1,s=t.y1,a=t.x2,o=t.y2,l=t.key,c=l8(t,m4e),u=wt(c,!1);u.offset;var h=l8(u,p4e);n=se.createElement("line",hh({},h,{x1:r,y1:s,x2:a,y2:o,fill:"none",key:l}))}return n}function w4e(e){var t=e.x,n=e.width,r=e.horizontal,s=r===void 0?!0:r,a=e.horizontalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=Zi(Zi({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return mQ(s,u)});return se.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function j4e(e){var t=e.y,n=e.height,r=e.vertical,s=r===void 0?!0:r,a=e.verticalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=Zi(Zi({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return mQ(s,u)});return se.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function _4e(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,s=e.y,a=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var h=l.map(function(m){return Math.round(m+s-s)}).sort(function(m,g){return m-g});s!==h[0]&&h.unshift(0);var d=h.map(function(m,g){var w=!h[g+1],v=w?s+o-m:h[g+1]-m;if(v<=0)return null;var b=g%t.length;return se.createElement("rect",{key:"react-".concat(g),y:m,x:r,height:v,width:a,stroke:"none",fill:t[b],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return se.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function N4e(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,s=e.fillOpacity,a=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var h=u.map(function(m){return Math.round(m+a-a)}).sort(function(m,g){return m-g});a!==h[0]&&h.unshift(0);var d=h.map(function(m,g){var w=!h[g+1],v=w?a+l-m:h[g+1]-m;if(v<=0)return null;var b=g%r.length;return se.createElement("rect",{key:"react-".concat(g),x:m,y:o,width:v,height:c,stroke:"none",fill:r[b],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return se.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var S4e=function(t,n){var r=t.xAxis,s=t.width,a=t.height,o=t.offset;return cG(f5(Zi(Zi(Zi({},jv.defaultProps),r),{},{ticks:Hc(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.left,o.left+o.width,n)},k4e=function(t,n){var r=t.yAxis,s=t.width,a=t.height,o=t.offset;return cG(f5(Zi(Zi(Zi({},jv.defaultProps),r),{},{ticks:Hc(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.top,o.top+o.height,n)},Dp={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Rd(e){var t,n,r,s,a,o,l=l5(),c=c5(),u=hTe(),h=Zi(Zi({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Dp.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Dp.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:Dp.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:Dp.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Dp.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Dp.verticalFill,x:et(e.x)?e.x:u.left,y:et(e.y)?e.y:u.top,width:et(e.width)?e.width:u.width,height:et(e.height)?e.height:u.height}),d=h.x,m=h.y,g=h.width,w=h.height,v=h.syncWithTicks,b=h.horizontalValues,y=h.verticalValues,_=uTe(),N=dTe();if(!et(g)||g<=0||!et(w)||w<=0||!et(d)||d!==+d||!et(m)||m!==+m)return null;var j=h.verticalCoordinatesGenerator||S4e,S=h.horizontalCoordinatesGenerator||k4e,C=h.horizontalPoints,P=h.verticalPoints;if((!C||!C.length)&&At(S)){var A=b&&b.length,F=S({yAxis:N?Zi(Zi({},N),{},{ticks:A?b:N.ticks}):void 0,width:l,height:c,offset:u},A?!0:v);Bo(Array.isArray(F),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Kh(F),"]")),Array.isArray(F)&&(C=F)}if((!P||!P.length)&&At(j)){var I=y&&y.length,R=j({xAxis:_?Zi(Zi({},_),{},{ticks:I?y:_.ticks}):void 0,width:l,height:c,offset:u},I?!0:v);Bo(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Kh(R),"]")),Array.isArray(R)&&(P=R)}return se.createElement("g",{className:"recharts-cartesian-grid"},se.createElement(b4e,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),se.createElement(w4e,hh({},h,{offset:u,horizontalPoints:C,xAxis:_,yAxis:N})),se.createElement(j4e,hh({},h,{offset:u,verticalPoints:P,xAxis:_,yAxis:N})),se.createElement(_4e,hh({},h,{horizontalPoints:C})),se.createElement(N4e,hh({},h,{verticalPoints:P})))}Rd.displayName="CartesianGrid";var E4e=["type","layout","connectNulls","ref"],P4e=["key"];function Hg(e){"@babel/helpers - typeof";return Hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hg(e)}function c8(e,t){if(e==null)return{};var n=C4e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function C4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function L0(){return L0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L0.apply(this,arguments)}function u8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ca(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u8(Object(n),!0).forEach(function(r){$o(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lp(e){return R4e(e)||T4e(e)||O4e(e)||A4e()}function A4e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
834In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O4e(e,t){if(e){if(typeof e=="string")return jT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jT(e,t)}}function T4e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function R4e(e){if(Array.isArray(e))return jT(e)}function jT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d8(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gQ(r.key),r)}}function I4e(e,t,n){return t&&d8(e.prototype,t),n&&d8(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function D4e(e,t,n){return t=y_(t),L4e(e,pQ()?Reflect.construct(t,n||[],y_(e).constructor):t.apply(e,n))}function L4e(e,t){if(t&&(Hg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F4e(e)}function F4e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pQ=function(){return!!e})()}function y_(e){return y_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},y_(e)}function $4e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_T(e,t)}function _T(e,t){return _T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},_T(e,t)}function $o(e,t,n){return t=gQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gQ(e){var t=q4e(e,"string");return Hg(t)=="symbol"?t:t+""}function q4e(e,t){if(Hg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var _v=(function(e){function t(){var n;M4e(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=D4e(this,t,[].concat(s)),$o(n,"state",{isAnimationFinished:!0,totalLength:0}),$o(n,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),$o(n,"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(y,_){return y+_});if(!u)return n.generateSimpleStrokeDasharray(l,o);for(var h=Math.floor(o/u),d=o%u,m=l-o,g=[],w=0,v=0;w<c.length;v+=c[w],++w)if(v+c[w]>d){g=[].concat(Lp(c.slice(0,w)),[d-v]);break}var b=g.length%2===0?[0,m]:[m];return[].concat(Lp(t.repeat(c,h)),Lp(g),b).map(function(y){return"".concat(y,"px")}).join(", ")}),$o(n,"id",tm("recharts-line-")),$o(n,"pathRef",function(o){n.mainCurve=o}),$o(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),$o(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return $4e(t,e),I4e(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,h=a.children,d=xa(h,mb);if(!d)return null;var m=function(v,b){return{x:v.x,y:v.y,value:v.value,errorVal:wr(v.payload,b)}},g={clipPath:r?"url(#clipPath-".concat(s,")"):null};return se.createElement(dn,g,d.map(function(w){return se.cloneElement(w,{key:"bar-".concat(w.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:m})}))}},{key:"renderDots",value:function(r,s,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,h=l.dataKey,d=wt(this.props,!1),m=wt(c,!0),g=u.map(function(v,b){var y=ca(ca(ca({key:"dot-".concat(b),r:3},d),m),{},{index:b,cx:v.x,cy:v.y,value:v.value,dataKey:h,payload:v.payload,points:u});return t.renderDotItem(c,y)}),w={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(a,")"):null};return se.createElement(dn,L0({className:"recharts-line-dots",key:"dots"},w),g)}},{key:"renderCurveStatically",value:function(r,s,a,o){var l=this.props,c=l.type,u=l.layout,h=l.connectNulls;l.ref;var d=c8(l,E4e),m=ca(ca(ca({},wt(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(a,")"):null,points:r},o),{},{type:c,layout:u,connectNulls:h});return se.createElement(Ph,L0({},m,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,s){var a=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,h=o.animationBegin,d=o.animationDuration,m=o.animationEasing,g=o.animationId,w=o.animateNewValues,v=o.width,b=o.height,y=this.state,_=y.prevPoints,N=y.totalLength;return se.createElement(so,{begin:h,duration:d,isActive:u,easing:m,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(j){var S=j.t;if(_){var C=_.length/l.length,P=l.map(function(M,$){var B=Math.floor($*C);if(_[B]){var U=_[B],G=yr(U.x,M.x),Z=yr(U.y,M.y);return ca(ca({},M),{},{x:G(S),y:Z(S)})}if(w){var X=yr(v*2,M.x),V=yr(b/2,M.y);return ca(ca({},M),{},{x:X(S),y:V(S)})}return ca(ca({},M),{},{x:M.x,y:M.y})});return a.renderCurveStatically(P,r,s)}var A=yr(0,N),F=A(S),I;if(c){var R="".concat(c).split(/[,\s]+/gim).map(function(M){return parseFloat(M)});I=a.getStrokeDasharray(F,N,R)}else I=a.generateSimpleStrokeDasharray(N,F);return a.renderCurveStatically(l,r,s,{strokeDasharray:I})})}},{key:"renderCurve",value:function(r,s){var a=this.props,o=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,h=c.totalLength;return l&&o&&o.length&&(!u&&h>0||!Bd(u,o))?this.renderCurveWithAnimation(r,s):this.renderCurveStatically(o,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.xAxis,h=s.yAxis,d=s.top,m=s.left,g=s.width,w=s.height,v=s.isAnimationActive,b=s.id;if(a||!l||!l.length)return null;var y=this.state.isAnimationFinished,_=l.length===1,N=Tt("recharts-line",c),j=u&&u.allowDataOverflow,S=h&&h.allowDataOverflow,C=j||S,P=zt(b)?this.id:b,A=(r=wt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},F=A.r,I=F===void 0?3:F,R=A.strokeWidth,M=R===void 0?2:R,$=jH(o)?o:{},B=$.clipDot,U=B===void 0?!0:B,G=I*2+M;return se.createElement(dn,{className:N},j||S?se.createElement("defs",null,se.createElement("clipPath",{id:"clipPath-".concat(P)},se.createElement("rect",{x:j?m:m-g/2,y:S?d:d-w/2,width:j?g:g*2,height:S?w:w*2})),!U&&se.createElement("clipPath",{id:"clipPath-dots-".concat(P)},se.createElement("rect",{x:m-G/2,y:d-G/2,width:g+G,height:w+G}))):null,!_&&this.renderCurve(C,P),this.renderErrorBar(C,P),(_||o)&&this.renderDots(C,U,P),(!v||y)&&Uo.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:s.curPoints}:r.points!==s.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,s){for(var a=r.length%2!==0?[].concat(Lp(r),[0]):r,o=[],l=0;l<s;++l)o=[].concat(Lp(o),Lp(a));return o}},{key:"renderDotItem",value:function(r,s){var a;if(se.isValidElement(r))a=se.cloneElement(r,s);else if(At(r))a=r(s);else{var o=s.key,l=c8(s,P4e),c=Tt("recharts-line-dot",typeof r!="boolean"?r.className:"");a=se.createElement(yv,L0({key:o},l,{className:c}))}return a}}])})(O.PureComponent);$o(_v,"displayName","Line");$o(_v,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!mu.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});$o(_v,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,s=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,h=t.layout,d=c.map(function(m,g){var w=wr(m,o);return h==="horizontal"?{x:Gj({axis:n,ticks:s,bandSize:l,entry:m,index:g}),y:zt(w)?null:r.scale(w),value:w,payload:m}:{x:zt(w)?null:n.scale(w),y:Gj({axis:r,ticks:a,bandSize:l,entry:m,index:g}),value:w,payload:m}});return ca({points:d,layout:h},u)});var z4e=["layout","type","stroke","connectNulls","isRange","ref"],B4e=["key"],vQ;function Kg(e){"@babel/helpers - typeof";return Kg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kg(e)}function xQ(e,t){if(e==null)return{};var n=U4e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function U4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function mh(){return mh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mh.apply(this,arguments)}function f8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ld(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f8(Object(n),!0).forEach(function(r){Ll(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h8(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bQ(r.key),r)}}function W4e(e,t,n){return t&&h8(e.prototype,t),n&&h8(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function H4e(e,t,n){return t=b_(t),K4e(e,yQ()?Reflect.construct(t,n||[],b_(e).constructor):t.apply(e,n))}function K4e(e,t){if(t&&(Kg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G4e(e)}function G4e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yQ=function(){return!!e})()}function b_(e){return b_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},b_(e)}function Q4e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NT(e,t)}function NT(e,t){return NT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},NT(e,t)}function Ll(e,t,n){return t=bQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bQ(e){var t=Y4e(e,"string");return Kg(t)=="symbol"?t:t+""}function Y4e(e,t){if(Kg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Yd=(function(e){function t(){var n;V4e(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=H4e(this,t,[].concat(s)),Ll(n,"state",{isAnimationFinished:!0}),Ll(n,"id",tm("recharts-area-")),Ll(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),At(o)&&o()}),Ll(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),At(o)&&o()}),n}return Q4e(t,e),W4e(t,[{key:"renderDots",value:function(r,s,a){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,h=c.points,d=c.dataKey,m=wt(this.props,!1),g=wt(u,!0),w=h.map(function(b,y){var _=ld(ld(ld({key:"dot-".concat(y),r:3},m),g),{},{index:y,cx:b.x,cy:b.y,dataKey:d,value:b.value,payload:b.payload,points:h});return t.renderDotItem(u,_)}),v={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(a,")"):null};return se.createElement(dn,mh({className:"recharts-area-dots"},v),w)}},{key:"renderHorizontalRect",value:function(r){var s=this.props,a=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].x,u=o[o.length-1].x,h=r*Math.abs(c-u),d=_d(o.map(function(m){return m.y||0}));return et(a)&&typeof a=="number"?d=Math.max(a,d):a&&Array.isArray(a)&&a.length&&(d=Math.max(_d(a.map(function(m){return m.y||0})),d)),et(d)?se.createElement("rect",{x:c<u?c:c-h,y:0,width:h,height:Math.floor(d+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var s=this.props,a=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].y,u=o[o.length-1].y,h=r*Math.abs(c-u),d=_d(o.map(function(m){return m.x||0}));return et(a)&&typeof a=="number"?d=Math.max(a,d):a&&Array.isArray(a)&&a.length&&(d=Math.max(_d(a.map(function(m){return m.x||0})),d)),et(d)?se.createElement("rect",{x:0,y:c<u?c:c-h,width:d+(l?parseInt("".concat(l),10):1),height:Math.floor(h)}):null}},{key:"renderClipRect",value:function(r){var s=this.props.layout;return s==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,s,a,o){var l=this.props,c=l.layout,u=l.type,h=l.stroke,d=l.connectNulls,m=l.isRange;l.ref;var g=xQ(l,z4e);return se.createElement(dn,{clipPath:a?"url(#clipPath-".concat(o,")"):null},se.createElement(Ph,mh({},wt(g,!0),{points:r,connectNulls:d,type:u,baseLine:s,layout:c,stroke:"none",className:"recharts-area-area"})),h!=="none"&&se.createElement(Ph,mh({},wt(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:d,fill:"none",points:r})),h!=="none"&&m&&se.createElement(Ph,mh({},wt(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:d,fill:"none",points:s})))}},{key:"renderAreaWithAnimation",value:function(r,s){var a=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,h=o.animationBegin,d=o.animationDuration,m=o.animationEasing,g=o.animationId,w=this.state,v=w.prevPoints,b=w.prevBaseLine;return se.createElement(so,{begin:h,duration:d,isActive:u,easing:m,from:{t:0},to:{t:1},key:"area-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var _=y.t;if(v){var N=v.length/l.length,j=l.map(function(A,F){var I=Math.floor(F*N);if(v[I]){var R=v[I],M=yr(R.x,A.x),$=yr(R.y,A.y);return ld(ld({},A),{},{x:M(_),y:$(_)})}return A}),S;if(et(c)&&typeof c=="number"){var C=yr(b,c);S=C(_)}else if(zt(c)||mv(c)){var P=yr(b,0);S=P(_)}else S=c.map(function(A,F){var I=Math.floor(F*N);if(b[I]){var R=b[I],M=yr(R.x,A.x),$=yr(R.y,A.y);return ld(ld({},A),{},{x:M(_),y:$(_)})}return A});return a.renderAreaStatically(j,S,r,s)}return se.createElement(dn,null,se.createElement("defs",null,se.createElement("clipPath",{id:"animationClipPath-".concat(s)},a.renderClipRect(_))),se.createElement(dn,{clipPath:"url(#animationClipPath-".concat(s,")")},a.renderAreaStatically(l,c,r,s)))})}},{key:"renderArea",value:function(r,s){var a=this.props,o=a.points,l=a.baseLine,c=a.isAnimationActive,u=this.state,h=u.prevPoints,d=u.prevBaseLine,m=u.totalLength;return c&&o&&o.length&&(!h&&m>0||!Bd(h,o)||!Bd(d,l))?this.renderAreaWithAnimation(r,s):this.renderAreaStatically(o,l,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.top,h=s.left,d=s.xAxis,m=s.yAxis,g=s.width,w=s.height,v=s.isAnimationActive,b=s.id;if(a||!l||!l.length)return null;var y=this.state.isAnimationFinished,_=l.length===1,N=Tt("recharts-area",c),j=d&&d.allowDataOverflow,S=m&&m.allowDataOverflow,C=j||S,P=zt(b)?this.id:b,A=(r=wt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},F=A.r,I=F===void 0?3:F,R=A.strokeWidth,M=R===void 0?2:R,$=jH(o)?o:{},B=$.clipDot,U=B===void 0?!0:B,G=I*2+M;return se.createElement(dn,{className:N},j||S?se.createElement("defs",null,se.createElement("clipPath",{id:"clipPath-".concat(P)},se.createElement("rect",{x:j?h:h-g/2,y:S?u:u-w/2,width:j?g:g*2,height:S?w:w*2})),!U&&se.createElement("clipPath",{id:"clipPath-dots-".concat(P)},se.createElement("rect",{x:h-G/2,y:u-G/2,width:g+G,height:w+G}))):null,_?null:this.renderArea(C,P),(o||_)&&this.renderDots(C,U,P),(!v||y)&&Uo.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:s.curPoints,prevBaseLine:s.curBaseLine}:r.points!==s.curPoints||r.baseLine!==s.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])})(O.PureComponent);vQ=Yd;Ll(Yd,"displayName","Area");Ll(Yd,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!mu.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Ll(Yd,"getBaseValue",function(e,t,n,r){var s=e.layout,a=e.baseValue,o=t.props.baseValue,l=o??a;if(et(l)&&typeof l=="number")return l;var c=s==="horizontal"?r:n,u=c.scale.domain();if(c.type==="number"){var h=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return l==="dataMin"?d:l==="dataMax"||h<0?h:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Ll(Yd,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,s=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,h=e.dataStartIndex,d=e.displayedData,m=e.offset,g=t.layout,w=u&&u.length,v=vQ.getBaseValue(t,n,r,s),b=g==="horizontal",y=!1,_=d.map(function(j,S){var C;w?C=u[h+S]:(C=wr(j,c),Array.isArray(C)?y=!0:C=[v,C]);var P=C[1]==null||w&&wr(j,c)==null;return b?{x:Gj({axis:r,ticks:a,bandSize:l,entry:j,index:S}),y:P?null:s.scale(C[1]),value:C,payload:j}:{x:P?null:r.scale(C[1]),y:Gj({axis:s,ticks:o,bandSize:l,entry:j,index:S}),value:C,payload:j}}),N;return w||y?N=_.map(function(j){var S=Array.isArray(j.value)?j.value[0]:null;return b?{x:j.x,y:S!=null&&j.y!=null?s.scale(S):null}:{x:S!=null?r.scale(S):null,y:j.y}}):N=b?s.scale(v):r.scale(v),ld({points:_,baseLine:N,layout:g,isRange:y},m)});Ll(Yd,"renderDotItem",function(e,t){var n;if(se.isValidElement(e))n=se.cloneElement(e,t);else if(At(e))n=e(t);else{var r=Tt("recharts-area-dot",typeof e!="boolean"?e.className:""),s=t.key,a=xQ(t,B4e);n=se.createElement(yv,mh({},a,{key:s,className:r}))}return n});function Gg(e){"@babel/helpers - typeof";return Gg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gg(e)}function X4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z4e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_Q(r.key),r)}}function J4e(e,t,n){return t&&Z4e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function eRe(e,t,n){return t=w_(t),tRe(e,wQ()?Reflect.construct(t,n||[],w_(e).constructor):t.apply(e,n))}function tRe(e,t){if(t&&(Gg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nRe(e)}function nRe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wQ=function(){return!!e})()}function w_(e){return w_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},w_(e)}function rRe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ST(e,t)}function ST(e,t){return ST=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},ST(e,t)}function jQ(e,t,n){return t=_Q(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Q(e){var t=iRe(e,"string");return Gg(t)=="symbol"?t:t+""}function iRe(e,t){if(Gg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function kT(){return kT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kT.apply(this,arguments)}function sRe(e){var t=e.xAxisId,n=l5(),r=c5(),s=rQ(t);return s==null?null:O.createElement(jv,kT({},s,{className:Tt("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Hc(o,!0)}}))}var eo=(function(e){function t(){return X4e(this,t),eRe(this,t,arguments)}return rRe(t,e),J4e(t,[{key:"render",value:function(){return O.createElement(sRe,this.props)}}])})(O.Component);jQ(eo,"displayName","XAxis");jQ(eo,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Qg(e){"@babel/helpers - typeof";return Qg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qg(e)}function aRe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oRe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kQ(r.key),r)}}function lRe(e,t,n){return t&&oRe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function cRe(e,t,n){return t=j_(t),uRe(e,NQ()?Reflect.construct(t,n||[],j_(e).constructor):t.apply(e,n))}function uRe(e,t){if(t&&(Qg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dRe(e)}function dRe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NQ=function(){return!!e})()}function j_(e){return j_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},j_(e)}function fRe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ET(e,t)}function ET(e,t){return ET=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},ET(e,t)}function SQ(e,t,n){return t=kQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kQ(e){var t=hRe(e,"string");return Qg(t)=="symbol"?t:t+""}function hRe(e,t){if(Qg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function PT(){return PT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PT.apply(this,arguments)}var mRe=function(t){var n=t.yAxisId,r=l5(),s=c5(),a=iQ(n);return a==null?null:O.createElement(jv,PT({},a,{className:Tt("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:s},ticksGenerator:function(l){return Hc(l,!0)}}))},to=(function(e){function t(){return aRe(this,t),cRe(this,t,arguments)}return fRe(t,e),lRe(t,[{key:"render",value:function(){return O.createElement(mRe,this.props)}}])})(O.Component);SQ(to,"displayName","YAxis");SQ(to,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function m8(e){return xRe(e)||vRe(e)||gRe(e)||pRe()}function pRe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
835In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gRe(e,t){if(e){if(typeof e=="string")return CT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CT(e,t)}}function vRe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xRe(e){if(Array.isArray(e))return CT(e)}function CT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var AT=function(t,n,r,s,a){var o=xa(t,d5),l=xa(t,BN),c=[].concat(m8(o),m8(l)),u=xa(t,VN),h="".concat(s,"Id"),d=s[0],m=n;if(c.length&&(m=c.reduce(function(v,b){if(b.props[h]===r&&Ul(b.props,"extendDomain")&&et(b.props[d])){var y=b.props[d];return[Math.min(v[0],y),Math.max(v[1],y)]}return v},m)),u.length){var g="".concat(d,"1"),w="".concat(d,"2");m=u.reduce(function(v,b){if(b.props[h]===r&&Ul(b.props,"extendDomain")&&et(b.props[g])&&et(b.props[w])){var y=b.props[g],_=b.props[w];return[Math.min(v[0],y,_),Math.max(v[1],y,_)]}return v},m)}return a&&a.length&&(m=a.reduce(function(v,b){return et(b)?[Math.min(v[0],b),Math.max(v[1],b)]:v},m)),m},YC={exports:{}},p8;function yRe(){return p8||(p8=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(c,u,h){this.fn=c,this.context=u,this.once=h||!1}function a(c,u,h,d,m){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new s(h,d||c,m),w=n?n+u:u;return c._events[w]?c._events[w].fn?c._events[w]=[c._events[w],g]:c._events[w].push(g):(c._events[w]=g,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],h,d;if(this._eventsCount===0)return u;for(d in h=this._events)t.call(h,d)&&u.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},l.prototype.listeners=function(u){var h=n?n+u:u,d=this._events[h];if(!d)return[];if(d.fn)return[d.fn];for(var m=0,g=d.length,w=new Array(g);m<g;m++)w[m]=d[m].fn;return w},l.prototype.listenerCount=function(u){var h=n?n+u:u,d=this._events[h];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,h,d,m,g,w){var v=n?n+u:u;if(!this._events[v])return!1;var b=this._events[v],y=arguments.length,_,N;if(b.fn){switch(b.once&&this.removeListener(u,b.fn,void 0,!0),y){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,h),!0;case 3:return b.fn.call(b.context,h,d),!0;case 4:return b.fn.call(b.context,h,d,m),!0;case 5:return b.fn.call(b.context,h,d,m,g),!0;case 6:return b.fn.call(b.context,h,d,m,g,w),!0}for(N=1,_=new Array(y-1);N<y;N++)_[N-1]=arguments[N];b.fn.apply(b.context,_)}else{var j=b.length,S;for(N=0;N<j;N++)switch(b[N].once&&this.removeListener(u,b[N].fn,void 0,!0),y){case 1:b[N].fn.call(b[N].context);break;case 2:b[N].fn.call(b[N].context,h);break;case 3:b[N].fn.call(b[N].context,h,d);break;case 4:b[N].fn.call(b[N].context,h,d,m);break;default:if(!_)for(S=1,_=new Array(y-1);S<y;S++)_[S-1]=arguments[S];b[N].fn.apply(b[N].context,_)}}return!0},l.prototype.on=function(u,h,d){return a(this,u,h,d,!1)},l.prototype.once=function(u,h,d){return a(this,u,h,d,!0)},l.prototype.removeListener=function(u,h,d,m){var g=n?n+u:u;if(!this._events[g])return this;if(!h)return o(this,g),this;var w=this._events[g];if(w.fn)w.fn===h&&(!m||w.once)&&(!d||w.context===d)&&o(this,g);else{for(var v=0,b=[],y=w.length;v<y;v++)(w[v].fn!==h||m&&!w[v].once||d&&w[v].context!==d)&&b.push(w[v]);b.length?this._events[g]=b.length===1?b[0]:b:o(this,g)}return this},l.prototype.removeAllListeners=function(u){var h;return u?(h=n?n+u:u,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(YC)),YC.exports}var bRe=yRe();const wRe=En(bRe);var XC=new wRe,ZC="recharts.syncMouseEvents";function Dy(e){"@babel/helpers - typeof";return Dy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dy(e)}function jRe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _Re(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,EQ(r.key),r)}}function NRe(e,t,n){return t&&_Re(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function JC(e,t,n){return t=EQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EQ(e){var t=SRe(e,"string");return Dy(t)=="symbol"?t:t+""}function SRe(e,t){if(Dy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var kRe=(function(){function e(){jRe(this,e),JC(this,"activeIndex",0),JC(this,"coordinateList",[]),JC(this,"layout","horizontal")}return NRe(e,[{key:"setDetails",value:function(n){var r,s=n.coordinateList,a=s===void 0?null:s,o=n.container,l=o===void 0?null:o,c=n.layout,u=c===void 0?null:c,h=n.offset,d=h===void 0?null:h,m=n.mouseHandlerCallback,g=m===void 0?null:m;this.coordinateList=(r=a??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=d??this.offset,this.mouseHandlerCallback=g??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var s=this.container.getBoundingClientRect(),a=s.x,o=s.y,l=s.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,h=((r=window)===null||r===void 0?void 0:r.scrollY)||0,d=a+c+u,m=o+this.offset.top+l/2+h;this.mouseHandlerCallback({pageX:d,pageY:m})}}}])})();function ERe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],s=e==null?void 0:e[1];if(r&&s&&et(r)&&et(s))return!0}return!1}function PRe(e,t,n,r){var s=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-s,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function PQ(e){var t=e.cx,n=e.cy,r=e.radius,s=e.startAngle,a=e.endAngle,o=Tn(t,n,r,s),l=Tn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:s,endAngle:a}}function CRe(e,t,n){var r,s,a,o;if(e==="horizontal")r=t.x,a=r,s=n.top,o=n.top+n.height;else if(e==="vertical")s=t.y,o=s,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,h=t.outerRadius,d=t.angle,m=Tn(l,c,u,d),g=Tn(l,c,h,d);r=m.x,s=m.y,a=g.x,o=g.y}else return PQ(t);return[{x:r,y:s},{x:a,y:o}]}function Ly(e){"@babel/helpers - typeof";return Ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ly(e)}function g8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function P1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g8(Object(n),!0).forEach(function(r){ARe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ARe(e,t,n){return t=ORe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ORe(e){var t=TRe(e,"string");return Ly(t)=="symbol"?t:t+""}function TRe(e,t){if(Ly(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ly(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RRe(e){var t,n,r=e.element,s=e.tooltipEventType,a=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,h=e.tooltipAxisBandSize,d=e.layout,m=e.chartName,g=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!g||!a||!o||m!=="ScatterChart"&&s!=="axis")return null;var w,v=Ph;if(m==="ScatterChart")w=o,v=bCe;else if(m==="BarChart")w=PRe(d,o,c,h),v=r5;else if(d==="radial"){var b=PQ(o),y=b.cx,_=b.cy,N=b.radius,j=b.startAngle,S=b.endAngle;w={cx:y,cy:_,startAngle:j,endAngle:S,innerRadius:N,outerRadius:N},v=jG}else w={points:CRe(d,o,c)},v=Ph;var C=P1(P1(P1(P1({stroke:"#ccc",pointerEvents:"none"},c),w),wt(g,!1)),{},{payload:l,payloadIndex:u,className:Tt("recharts-tooltip-cursor",g.className)});return O.isValidElement(g)?O.cloneElement(g,C):O.createElement(v,C)}var MRe=["item"],IRe=["children","className","width","height","style","compact","title","desc"];function Yg(e){"@babel/helpers - typeof";return Yg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yg(e)}function Xp(){return Xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xp.apply(this,arguments)}function v8(e,t){return FRe(e)||LRe(e,t)||AQ(e,t)||DRe()}function DRe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
836In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LRe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(h){u=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function FRe(e){if(Array.isArray(e))return e}function x8(e,t){if(e==null)return{};var n=$Re(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $Re(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function qRe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zRe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,OQ(r.key),r)}}function BRe(e,t,n){return t&&zRe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function URe(e,t,n){return t=__(t),VRe(e,CQ()?Reflect.construct(t,n||[],__(e).constructor):t.apply(e,n))}function VRe(e,t){if(t&&(Yg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WRe(e)}function WRe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CQ=function(){return!!e})()}function __(e){return __=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},__(e)}function HRe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&OT(e,t)}function OT(e,t){return OT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},OT(e,t)}function Xg(e){return QRe(e)||GRe(e)||AQ(e)||KRe()}function KRe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
837In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AQ(e,t){if(e){if(typeof e=="string")return TT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TT(e,t)}}function GRe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function QRe(e){if(Array.isArray(e))return TT(e)}function TT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function $e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y8(Object(n),!0).forEach(function(r){Dt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dt(e,t,n){return t=OQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OQ(e){var t=YRe(e,"string");return Yg(t)=="symbol"?t:t+""}function YRe(e,t){if(Yg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var XRe={xAxis:["bottom","top"],yAxis:["left","right"]},ZRe={width:"100%",height:"100%"},TQ={x:0,y:0};function C1(e){return e}var JRe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},e5e=function(t,n,r,s){var a=n.find(function(h){return h&&h.index===r});if(a){if(t==="horizontal")return{x:a.coordinate,y:s.y};if(t==="vertical")return{x:s.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,l=s.radius;return $e($e($e({},s),Tn(s.cx,s.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=s.angle;return $e($e($e({},s),Tn(s.cx,s.cy,c,u)),{},{angle:u,radius:c})}return TQ},WN=function(t,n){var r=n.graphicalItems,s=n.dataStartIndex,a=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Xg(l),Xg(u)):l},[]);return o.length>0?o:t&&t.length&&et(s)&&et(a)?t.slice(s,a+1):[]};function RQ(e){return e==="number"?[0,"auto"]:void 0}var RT=function(t,n,r,s){var a=t.graphicalItems,o=t.tooltipAxis,l=WN(n,t);return r<0||!a||!a.length||r>=l.length?null:a.reduce(function(c,u){var h,d=(h=u.props.data)!==null&&h!==void 0?h:n;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(o.dataKey&&!o.allowDuplicatedCategory){var g=d===void 0?l:d;m=_j(g,o.dataKey,s)}else m=d&&d[r]||l[r];return m?[].concat(Xg(c),[mG(u,m)]):c},[])},b8=function(t,n,r,s){var a=s||{x:t.chartX,y:t.chartY},o=JRe(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,h=GSe(o,l,u,c);if(h>=0&&u){var d=u[h]&&u[h].value,m=RT(t,n,h,d),g=e5e(r,l,h,a);return{activeTooltipIndex:h,activeLabel:d,activePayload:m,activeCoordinate:g}}return null},t5e=function(t,n){var r=n.axes,s=n.graphicalItems,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,h=t.layout,d=t.children,m=t.stackOffset,g=lG(h,a);return r.reduce(function(w,v){var b,y=v.type.defaultProps!==void 0?$e($e({},v.type.defaultProps),v.props):v.props,_=y.type,N=y.dataKey,j=y.allowDataOverflow,S=y.allowDuplicatedCategory,C=y.scale,P=y.ticks,A=y.includeHidden,F=y[o];if(w[F])return w;var I=WN(t.data,{graphicalItems:s.filter(function(W){var Q,J=o in W.props?W.props[o]:(Q=W.type.defaultProps)===null||Q===void 0?void 0:Q[o];return J===F}),dataStartIndex:c,dataEndIndex:u}),R=I.length,M,$,B;ERe(y.domain,j,_)&&(M=WO(y.domain,null,j),g&&(_==="number"||C!=="auto")&&(B=R0(I,N,"category")));var U=RQ(_);if(!M||M.length===0){var G,Z=(G=y.domain)!==null&&G!==void 0?G:U;if(N){if(M=R0(I,N,_),_==="category"&&g){var X=ybe(M);S&&X?($=M,M=c_(0,R)):S||(M=fq(Z,M,v).reduce(function(W,Q){return W.indexOf(Q)>=0?W:[].concat(Xg(W),[Q])},[]))}else if(_==="category")S?M=M.filter(function(W){return W!==""&&!zt(W)}):M=fq(Z,M,v).reduce(function(W,Q){return W.indexOf(Q)>=0||Q===""||zt(Q)?W:[].concat(Xg(W),[Q])},[]);else if(_==="number"){var V=JSe(I,s.filter(function(W){var Q,J,ne=o in W.props?W.props[o]:(Q=W.type.defaultProps)===null||Q===void 0?void 0:Q[o],Y="hide"in W.props?W.props.hide:(J=W.type.defaultProps)===null||J===void 0?void 0:J.hide;return ne===F&&(A||!Y)}),N,a,h);V&&(M=V)}g&&(_==="number"||C!=="auto")&&(B=R0(I,N,"category"))}else g?M=c_(0,R):l&&l[F]&&l[F].hasStack&&_==="number"?M=m==="expand"?[0,1]:hG(l[F].stackGroups,c,u):M=oG(I,s.filter(function(W){var Q=o in W.props?W.props[o]:W.type.defaultProps[o],J="hide"in W.props?W.props.hide:W.type.defaultProps.hide;return Q===F&&(A||!J)}),_,h,!0);if(_==="number")M=AT(d,M,F,a,P),Z&&(M=WO(Z,M,j));else if(_==="category"&&Z){var z=Z,L=M.every(function(W){return z.indexOf(W)>=0});L&&(M=z)}}return $e($e({},w),{},Dt({},F,$e($e({},y),{},{axisType:a,domain:M,categoricalDomain:B,duplicateDomain:$,originalDomain:(b=y.domain)!==null&&b!==void 0?b:U,isCategorical:g,layout:h})))},{})},n5e=function(t,n){var r=n.graphicalItems,s=n.Axis,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,h=t.layout,d=t.children,m=WN(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),g=m.length,w=lG(h,a),v=-1;return r.reduce(function(b,y){var _=y.type.defaultProps!==void 0?$e($e({},y.type.defaultProps),y.props):y.props,N=_[o],j=RQ("number");if(!b[N]){v++;var S;return w?S=c_(0,g):l&&l[N]&&l[N].hasStack?(S=hG(l[N].stackGroups,c,u),S=AT(d,S,N,a)):(S=WO(j,oG(m,r.filter(function(C){var P,A,F=o in C.props?C.props[o]:(P=C.type.defaultProps)===null||P===void 0?void 0:P[o],I="hide"in C.props?C.props.hide:(A=C.type.defaultProps)===null||A===void 0?void 0:A.hide;return F===N&&!I}),"number",h),s.defaultProps.allowDataOverflow),S=AT(d,S,N,a)),$e($e({},b),{},Dt({},N,$e($e({axisType:a},s.defaultProps),{},{hide:!0,orientation:va(XRe,"".concat(a,".").concat(v%2),null),domain:S,originalDomain:j,isCategorical:w,layout:h})))}return b},{})},r5e=function(t,n){var r=n.axisType,s=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,h=t.children,d="".concat(s,"Id"),m=xa(h,a),g={};return m&&m.length?g=t5e(t,{axes:m,graphicalItems:o,axisType:s,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(g=n5e(t,{Axis:a,graphicalItems:o,axisType:s,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),g},i5e=function(t){var n=ud(t),r=Hc(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:AR(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Qj(n,r)}},w8=function(t){var n=t.children,r=t.defaultShowTooltip,s=da(n,qg),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(a=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},s5e=function(t){return!t||!t.length?!1:t.some(function(n){var r=Xc(n&&n.type);return r&&r.indexOf("Bar")>=0})},j8=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},a5e=function(t,n){var r=t.props,s=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,h=r.height,d=r.children,m=r.margin||{},g=da(d,qg),w=da(d,Od),v=Object.keys(c).reduce(function(S,C){var P=c[C],A=P.orientation;return!P.mirror&&!P.hide?$e($e({},S),{},Dt({},A,S[A]+P.width)):S},{left:m.left||0,right:m.right||0}),b=Object.keys(o).reduce(function(S,C){var P=o[C],A=P.orientation;return!P.mirror&&!P.hide?$e($e({},S),{},Dt({},A,va(S,"".concat(A))+P.height)):S},{top:m.top||0,bottom:m.bottom||0}),y=$e($e({},b),v),_=y.bottom;g&&(y.bottom+=g.props.height||qg.defaultProps.height),w&&n&&(y=XSe(y,s,r,n));var N=u-y.left-y.right,j=h-y.top-y.bottom;return $e($e({brushBottom:_},y),{},{width:Math.max(N,0),height:Math.max(j,0)})},o5e=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},gb=function(t){var n=t.chartName,r=t.GraphicalChild,s=t.defaultTooltipEventType,a=s===void 0?"axis":s,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,h=t.formatAxisMap,d=t.defaultProps,m=function(y,_){var N=_.graphicalItems,j=_.stackGroups,S=_.offset,C=_.updateId,P=_.dataStartIndex,A=_.dataEndIndex,F=y.barSize,I=y.layout,R=y.barGap,M=y.barCategoryGap,$=y.maxBarSize,B=j8(I),U=B.numericAxisName,G=B.cateAxisName,Z=s5e(N),X=[];return N.forEach(function(V,z){var L=WN(y.data,{graphicalItems:[V],dataStartIndex:P,dataEndIndex:A}),W=V.type.defaultProps!==void 0?$e($e({},V.type.defaultProps),V.props):V.props,Q=W.dataKey,J=W.maxBarSize,ne=W["".concat(U,"Id")],Y=W["".concat(G,"Id")],ee={},le=c.reduce(function(de,Pe){var Ze=_["".concat(Pe.axisType,"Map")],ct=W["".concat(Pe.axisType,"Id")];Ze&&Ze[ct]||Pe.axisType==="zAxis"||Hh();var pt=Ze[ct];return $e($e({},de),{},Dt(Dt({},Pe.axisType,pt),"".concat(Pe.axisType,"Ticks"),Hc(pt)))},ee),re=le[G],fe=le["".concat(G,"Ticks")],ge=j&&j[ne]&&j[ne].hasStack&&lke(V,j[ne].stackGroups),he=Xc(V.type).indexOf("Bar")>=0,De=Qj(re,fe),_e=[],We=Z&&QSe({barSize:F,stackGroups:j,totalSize:o5e(le,G)});if(he){var ze,Xe,ke=zt(J)?$:J,Ae=(ze=(Xe=Qj(re,fe,!0))!==null&&Xe!==void 0?Xe:ke)!==null&&ze!==void 0?ze:0;_e=YSe({barGap:R,barCategoryGap:M,bandSize:Ae!==De?Ae:De,sizeList:We[Y],maxBarSize:ke}),Ae!==De&&(_e=_e.map(function(de){return $e($e({},de),{},{position:$e($e({},de.position),{},{offset:de.position.offset-Ae/2})})}))}var Be=V&&V.type&&V.type.getComposedData;Be&&X.push({props:$e($e({},Be($e($e({},le),{},{displayedData:L,props:y,dataKey:Q,item:V,bandSize:De,barPosition:_e,offset:S,stackedData:ge,layout:I,dataStartIndex:P,dataEndIndex:A}))),{},Dt(Dt(Dt({key:V.key||"item-".concat(z)},U,le[U]),G,le[G]),"animationId",C)),childIndex:Obe(V,y.children),item:V})}),X},g=function(y,_){var N=y.props,j=y.dataStartIndex,S=y.dataEndIndex,C=y.updateId;if(!j6({props:N}))return null;var P=N.children,A=N.layout,F=N.stackOffset,I=N.data,R=N.reverseStackOrder,M=j8(A),$=M.numericAxisName,B=M.cateAxisName,U=xa(P,r),G=ake(I,U,"".concat($,"Id"),"".concat(B,"Id"),F,R),Z=c.reduce(function(W,Q){var J="".concat(Q.axisType,"Map");return $e($e({},W),{},Dt({},J,r5e(N,$e($e({},Q),{},{graphicalItems:U,stackGroups:Q.axisType===$&&G,dataStartIndex:j,dataEndIndex:S}))))},{}),X=a5e($e($e({},Z),{},{props:N,graphicalItems:U}),_==null?void 0:_.legendBBox);Object.keys(Z).forEach(function(W){Z[W]=h(N,Z[W],X,W.replace("Map",""),n)});var V=Z["".concat(B,"Map")],z=i5e(V),L=m(N,$e($e({},Z),{},{dataStartIndex:j,dataEndIndex:S,updateId:C,graphicalItems:U,stackGroups:G,offset:X}));return $e($e({formattedGraphicalItems:L,graphicalItems:U,offset:X,stackGroups:G},z),Z)},w=(function(b){function y(_){var N,j,S;return qRe(this,y),S=URe(this,y,[_]),Dt(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Dt(S,"accessibilityManager",new kRe),Dt(S,"handleLegendBBoxUpdate",function(C){if(C){var P=S.state,A=P.dataStartIndex,F=P.dataEndIndex,I=P.updateId;S.setState($e({legendBBox:C},g({props:S.props,dataStartIndex:A,dataEndIndex:F,updateId:I},$e($e({},S.state),{},{legendBBox:C}))))}}),Dt(S,"handleReceiveSyncEvent",function(C,P,A){if(S.props.syncId===C){if(A===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(P)}}),Dt(S,"handleBrushChange",function(C){var P=C.startIndex,A=C.endIndex;if(P!==S.state.dataStartIndex||A!==S.state.dataEndIndex){var F=S.state.updateId;S.setState(function(){return $e({dataStartIndex:P,dataEndIndex:A},g({props:S.props,dataStartIndex:P,dataEndIndex:A,updateId:F},S.state))}),S.triggerSyncEvent({dataStartIndex:P,dataEndIndex:A})}}),Dt(S,"handleMouseEnter",function(C){var P=S.getMouseInfo(C);if(P){var A=$e($e({},P),{},{isTooltipActive:!0});S.setState(A),S.triggerSyncEvent(A);var F=S.props.onMouseEnter;At(F)&&F(A,C)}}),Dt(S,"triggeredAfterMouseMove",function(C){var P=S.getMouseInfo(C),A=P?$e($e({},P),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(A),S.triggerSyncEvent(A);var F=S.props.onMouseMove;At(F)&&F(A,C)}),Dt(S,"handleItemMouseEnter",function(C){S.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),Dt(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Dt(S,"handleMouseMove",function(C){C.persist(),S.throttleTriggeredAfterMouseMove(C)}),Dt(S,"handleMouseLeave",function(C){S.throttleTriggeredAfterMouseMove.cancel();var P={isTooltipActive:!1};S.setState(P),S.triggerSyncEvent(P);var A=S.props.onMouseLeave;At(A)&&A(P,C)}),Dt(S,"handleOuterEvent",function(C){var P=Abe(C),A=va(S.props,"".concat(P));if(P&&At(A)){var F,I;/.*touch.*/i.test(P)?I=S.getMouseInfo(C.changedTouches[0]):I=S.getMouseInfo(C),A((F=I)!==null&&F!==void 0?F:{},C)}}),Dt(S,"handleClick",function(C){var P=S.getMouseInfo(C);if(P){var A=$e($e({},P),{},{isTooltipActive:!0});S.setState(A),S.triggerSyncEvent(A);var F=S.props.onClick;At(F)&&F(A,C)}}),Dt(S,"handleMouseDown",function(C){var P=S.props.onMouseDown;if(At(P)){var A=S.getMouseInfo(C);P(A,C)}}),Dt(S,"handleMouseUp",function(C){var P=S.props.onMouseUp;if(At(P)){var A=S.getMouseInfo(C);P(A,C)}}),Dt(S,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),Dt(S,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&S.handleMouseDown(C.changedTouches[0])}),Dt(S,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&S.handleMouseUp(C.changedTouches[0])}),Dt(S,"handleDoubleClick",function(C){var P=S.props.onDoubleClick;if(At(P)){var A=S.getMouseInfo(C);P(A,C)}}),Dt(S,"handleContextMenu",function(C){var P=S.props.onContextMenu;if(At(P)){var A=S.getMouseInfo(C);P(A,C)}}),Dt(S,"triggerSyncEvent",function(C){S.props.syncId!==void 0&&XC.emit(ZC,S.props.syncId,C,S.eventEmitterSymbol)}),Dt(S,"applySyncEvent",function(C){var P=S.props,A=P.layout,F=P.syncMethod,I=S.state.updateId,R=C.dataStartIndex,M=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)S.setState($e({dataStartIndex:R,dataEndIndex:M},g({props:S.props,dataStartIndex:R,dataEndIndex:M,updateId:I},S.state)));else if(C.activeTooltipIndex!==void 0){var $=C.chartX,B=C.chartY,U=C.activeTooltipIndex,G=S.state,Z=G.offset,X=G.tooltipTicks;if(!Z)return;if(typeof F=="function")U=F(X,C);else if(F==="value"){U=-1;for(var V=0;V<X.length;V++)if(X[V].value===C.activeLabel){U=V;break}}var z=$e($e({},Z),{},{x:Z.left,y:Z.top}),L=Math.min($,z.x+z.width),W=Math.min(B,z.y+z.height),Q=X[U]&&X[U].value,J=RT(S.state,S.props.data,U),ne=X[U]?{x:A==="horizontal"?X[U].coordinate:L,y:A==="horizontal"?W:X[U].coordinate}:TQ;S.setState($e($e({},C),{},{activeLabel:Q,activeCoordinate:ne,activePayload:J,activeTooltipIndex:U}))}else S.setState(C)}),Dt(S,"renderCursor",function(C){var P,A=S.state,F=A.isTooltipActive,I=A.activeCoordinate,R=A.activePayload,M=A.offset,$=A.activeTooltipIndex,B=A.tooltipAxisBandSize,U=S.getTooltipEventType(),G=(P=C.props.active)!==null&&P!==void 0?P:F,Z=S.props.layout,X=C.key||"_recharts-cursor";return se.createElement(RRe,{key:X,activeCoordinate:I,activePayload:R,activeTooltipIndex:$,chartName:n,element:C,isActive:G,layout:Z,offset:M,tooltipAxisBandSize:B,tooltipEventType:U})}),Dt(S,"renderPolarAxis",function(C,P,A){var F=va(C,"type.axisType"),I=va(S.state,"".concat(F,"Map")),R=C.type.defaultProps,M=R!==void 0?$e($e({},R),C.props):C.props,$=I&&I[M["".concat(F,"Id")]];return O.cloneElement(C,$e($e({},$),{},{className:Tt(F,$.className),key:C.key||"".concat(P,"-").concat(A),ticks:Hc($,!0)}))}),Dt(S,"renderPolarGrid",function(C){var P=C.props,A=P.radialLines,F=P.polarAngles,I=P.polarRadius,R=S.state,M=R.radiusAxisMap,$=R.angleAxisMap,B=ud(M),U=ud($),G=U.cx,Z=U.cy,X=U.innerRadius,V=U.outerRadius;return O.cloneElement(C,{polarAngles:Array.isArray(F)?F:Hc(U,!0).map(function(z){return z.coordinate}),polarRadius:Array.isArray(I)?I:Hc(B,!0).map(function(z){return z.coordinate}),cx:G,cy:Z,innerRadius:X,outerRadius:V,key:C.key||"polar-grid",radialLines:A})}),Dt(S,"renderLegend",function(){var C=S.state.formattedGraphicalItems,P=S.props,A=P.children,F=P.width,I=P.height,R=S.props.margin||{},M=F-(R.left||0)-(R.right||0),$=sG({children:A,formattedGraphicalItems:C,legendWidth:M,legendContent:u});if(!$)return null;var B=$.item,U=x8($,MRe);return O.cloneElement(B,$e($e({},U),{},{chartWidth:F,chartHeight:I,margin:R,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),Dt(S,"renderTooltip",function(){var C,P=S.props,A=P.children,F=P.accessibilityLayer,I=da(A,_i);if(!I)return null;var R=S.state,M=R.isTooltipActive,$=R.activeCoordinate,B=R.activePayload,U=R.activeLabel,G=R.offset,Z=(C=I.props.active)!==null&&C!==void 0?C:M;return O.cloneElement(I,{viewBox:$e($e({},G),{},{x:G.left,y:G.top}),active:Z,label:U,payload:Z?B:[],coordinate:$,accessibilityLayer:F})}),Dt(S,"renderBrush",function(C){var P=S.props,A=P.margin,F=P.data,I=S.state,R=I.offset,M=I.dataStartIndex,$=I.dataEndIndex,B=I.updateId;return O.cloneElement(C,{key:C.key||"_recharts-brush",onChange:N1(S.handleBrushChange,C.props.onChange),data:F,x:et(C.props.x)?C.props.x:R.left,y:et(C.props.y)?C.props.y:R.top+R.height+R.brushBottom-(A.bottom||0),width:et(C.props.width)?C.props.width:R.width,startIndex:M,endIndex:$,updateId:"brush-".concat(B)})}),Dt(S,"renderReferenceElement",function(C,P,A){if(!C)return null;var F=S,I=F.clipPathId,R=S.state,M=R.xAxisMap,$=R.yAxisMap,B=R.offset,U=C.type.defaultProps||{},G=C.props,Z=G.xAxisId,X=Z===void 0?U.xAxisId:Z,V=G.yAxisId,z=V===void 0?U.yAxisId:V;return O.cloneElement(C,{key:C.key||"".concat(P,"-").concat(A),xAxis:M[X],yAxis:$[z],viewBox:{x:B.left,y:B.top,width:B.width,height:B.height},clipPathId:I})}),Dt(S,"renderActivePoints",function(C){var P=C.item,A=C.activePoint,F=C.basePoint,I=C.childIndex,R=C.isRange,M=[],$=P.props.key,B=P.item.type.defaultProps!==void 0?$e($e({},P.item.type.defaultProps),P.item.props):P.item.props,U=B.activeDot,G=B.dataKey,Z=$e($e({index:I,dataKey:G,cx:A.x,cy:A.y,r:4,fill:n5(P.item),strokeWidth:2,stroke:"#fff",payload:A.payload,value:A.value},wt(U,!1)),Nj(U));return M.push(y.renderActiveDot(U,Z,"".concat($,"-activePoint-").concat(I))),F?M.push(y.renderActiveDot(U,$e($e({},Z),{},{cx:F.x,cy:F.y}),"".concat($,"-basePoint-").concat(I))):R&&M.push(null),M}),Dt(S,"renderGraphicChild",function(C,P,A){var F=S.filterFormatItem(C,P,A);if(!F)return null;var I=S.getTooltipEventType(),R=S.state,M=R.isTooltipActive,$=R.tooltipAxis,B=R.activeTooltipIndex,U=R.activeLabel,G=S.props.children,Z=da(G,_i),X=F.props,V=X.points,z=X.isRange,L=X.baseLine,W=F.item.type.defaultProps!==void 0?$e($e({},F.item.type.defaultProps),F.item.props):F.item.props,Q=W.activeDot,J=W.hide,ne=W.activeBar,Y=W.activeShape,ee=!!(!J&&M&&Z&&(Q||ne||Y)),le={};I!=="axis"&&Z&&Z.props.trigger==="click"?le={onClick:N1(S.handleItemMouseEnter,C.props.onClick)}:I!=="axis"&&(le={onMouseLeave:N1(S.handleItemMouseLeave,C.props.onMouseLeave),onMouseEnter:N1(S.handleItemMouseEnter,C.props.onMouseEnter)});var re=O.cloneElement(C,$e($e({},F.props),le));function fe(Pe){return typeof $.dataKey=="function"?$.dataKey(Pe.payload):null}if(ee)if(B>=0){var ge,he;if($.dataKey&&!$.allowDuplicatedCategory){var De=typeof $.dataKey=="function"?fe:"payload.".concat($.dataKey.toString());ge=_j(V,De,U),he=z&&L&&_j(L,De,U)}else ge=V==null?void 0:V[B],he=z&&L&&L[B];if(Y||ne){var _e=C.props.activeIndex!==void 0?C.props.activeIndex:B;return[O.cloneElement(C,$e($e($e({},F.props),le),{},{activeIndex:_e})),null,null]}if(!zt(ge))return[re].concat(Xg(S.renderActivePoints({item:F,activePoint:ge,basePoint:he,childIndex:B,isRange:z})))}else{var We,ze=(We=S.getItemByXY(S.state.activeCoordinate))!==null&&We!==void 0?We:{graphicalItem:re},Xe=ze.graphicalItem,ke=Xe.item,Ae=ke===void 0?C:ke,Be=Xe.childIndex,de=$e($e($e({},F.props),le),{},{activeIndex:Be});return[O.cloneElement(Ae,de),null,null]}return z?[re,null,null]:[re,null]}),Dt(S,"renderCustomized",function(C,P,A){return O.cloneElement(C,$e($e({key:"recharts-customized-".concat(A)},S.props),S.state))}),Dt(S,"renderMap",{CartesianGrid:{handler:C1,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:C1},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:C1},YAxis:{handler:C1},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((N=_.id)!==null&&N!==void 0?N:tm("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=iK(S.triggeredAfterMouseMove,(j=_.throttleDelay)!==null&&j!==void 0?j:1e3/60),S.state={},S}return HRe(y,b),BRe(y,[{key:"componentDidMount",value:function(){var N,j;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(N=this.props.margin.left)!==null&&N!==void 0?N:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var N=this.props,j=N.children,S=N.data,C=N.height,P=N.layout,A=da(j,_i);if(A){var F=A.props.defaultIndex;if(!(typeof F!="number"||F<0||F>this.state.tooltipTicks.length-1)){var I=this.state.tooltipTicks[F]&&this.state.tooltipTicks[F].value,R=RT(this.state,S,F,I),M=this.state.tooltipTicks[F].coordinate,$=(this.state.offset.top+C)/2,B=P==="horizontal",U=B?{x:M,y:$}:{y:M,x:$},G=this.state.formattedGraphicalItems.find(function(X){var V=X.item;return V.type.name==="Scatter"});G&&(U=$e($e({},U),G.props.points[F].tooltipPosition),R=G.props.points[F].tooltipPayload);var Z={activeTooltipIndex:F,isTooltipActive:!0,activeLabel:I,activePayload:R,activeCoordinate:U};this.setState(Z),this.renderCursor(A),this.accessibilityManager.setIndex(F)}}}},{key:"getSnapshotBeforeUpdate",value:function(N,j){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==j.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==N.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==N.margin){var S,C;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(N){hO([da(N.children,_i)],[da(this.props.children,_i)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var N=da(this.props.children,_i);if(N&&typeof N.props.shared=="boolean"){var j=N.props.shared?"axis":"item";return l.indexOf(j)>=0?j:a}return a}},{key:"getMouseInfo",value:function(N){if(!this.container)return null;var j=this.container,S=j.getBoundingClientRect(),C=zje(S),P={chartX:Math.round(N.pageX-C.left),chartY:Math.round(N.pageY-C.top)},A=S.width/j.offsetWidth||1,F=this.inRange(P.chartX,P.chartY,A);if(!F)return null;var I=this.state,R=I.xAxisMap,M=I.yAxisMap,$=this.getTooltipEventType(),B=b8(this.state,this.props.data,this.props.layout,F);if($!=="axis"&&R&&M){var U=ud(R).scale,G=ud(M).scale,Z=U&&U.invert?U.invert(P.chartX):null,X=G&&G.invert?G.invert(P.chartY):null;return $e($e({},P),{},{xValue:Z,yValue:X},B)}return B?$e($e({},P),B):null}},{key:"inRange",value:function(N,j){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,P=N/S,A=j/S;if(C==="horizontal"||C==="vertical"){var F=this.state.offset,I=P>=F.left&&P<=F.left+F.width&&A>=F.top&&A<=F.top+F.height;return I?{x:P,y:A}:null}var R=this.state,M=R.angleAxisMap,$=R.radiusAxisMap;if(M&&$){var B=ud(M);return pq({x:P,y:A},B)}return null}},{key:"parseEventsOfWrapper",value:function(){var N=this.props.children,j=this.getTooltipEventType(),S=da(N,_i),C={};S&&j==="axis"&&(S.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var P=Nj(this.props,this.handleOuterEvent);return $e($e({},P),C)}},{key:"addListener",value:function(){XC.on(ZC,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){XC.removeListener(ZC,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(N,j,S){for(var C=this.state.formattedGraphicalItems,P=0,A=C.length;P<A;P++){var F=C[P];if(F.item===N||F.props.key===N.key||j===Xc(F.item.type)&&S===F.childIndex)return F}return null}},{key:"renderClipPath",value:function(){var N=this.clipPathId,j=this.state.offset,S=j.left,C=j.top,P=j.height,A=j.width;return se.createElement("defs",null,se.createElement("clipPath",{id:N},se.createElement("rect",{x:S,y:C,height:P,width:A})))}},{key:"getXScales",value:function(){var N=this.state.xAxisMap;return N?Object.entries(N).reduce(function(j,S){var C=v8(S,2),P=C[0],A=C[1];return $e($e({},j),{},Dt({},P,A.scale))},{}):null}},{key:"getYScales",value:function(){var N=this.state.yAxisMap;return N?Object.entries(N).reduce(function(j,S){var C=v8(S,2),P=C[0],A=C[1];return $e($e({},j),{},Dt({},P,A.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(N){var j;return(j=this.state.xAxisMap)===null||j===void 0||(j=j[N])===null||j===void 0?void 0:j.scale}},{key:"getYScaleByAxisId",value:function(N){var j;return(j=this.state.yAxisMap)===null||j===void 0||(j=j[N])===null||j===void 0?void 0:j.scale}},{key:"getItemByXY",value:function(N){var j=this.state,S=j.formattedGraphicalItems,C=j.activeItem;if(S&&S.length)for(var P=0,A=S.length;P<A;P++){var F=S[P],I=F.props,R=F.item,M=R.type.defaultProps!==void 0?$e($e({},R.type.defaultProps),R.props):R.props,$=Xc(R.type);if($==="Bar"){var B=(I.data||[]).find(function(X){return tCe(N,X)});if(B)return{graphicalItem:F,payload:B}}else if($==="RadialBar"){var U=(I.data||[]).find(function(X){return pq(N,X)});if(U)return{graphicalItem:F,payload:U}}else if(FN(F,C)||$N(F,C)||Oy(F,C)){var G=MAe({graphicalItem:F,activeTooltipItem:C,itemData:M.data}),Z=M.activeIndex===void 0?G:M.activeIndex;return{graphicalItem:$e($e({},F),{},{childIndex:Z}),payload:Oy(F,C)?M.data[G]:F.props.data[G]}}}return null}},{key:"render",value:function(){var N=this;if(!j6(this))return null;
837var j=this.props,S=j.children,C=j.className,P=j.width,A=j.height,F=j.style,I=j.compact,R=j.title,M=j.desc,$=x8(j,IRe),B=wt($,!1);if(I)return se.createElement(Yz,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},se.createElement(pO,Xp({},B,{width:P,height:A,title:R,desc:M}),this.renderClipPath(),N6(S,this.renderMap)));if(this.props.accessibilityLayer){var U,G;B.tabIndex=(U=this.props.tabIndex)!==null&&U!==void 0?U:0,B.role=(G=this.props.role)!==null&&G!==void 0?G:"application",B.onKeyDown=function(X){N.accessibilityManager.keyboardEvent(X)},B.onFocus=function(){N.accessibilityManager.focus()}}var Z=this.parseEventsOfWrapper();return se.createElement(Yz,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},se.createElement("div",Xp({className:Tt("recharts-wrapper",C),style:$e({position:"relative",cursor:"default",width:P,height:A},F)},Z,{ref:function(V){N.container=V}}),se.createElement(pO,Xp({},B,{width:P,height:A,title:R,desc:M,style:ZRe}),this.renderClipPath(),N6(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(O.Component);Dt(w,"displayName",n),Dt(w,"defaultProps",$e({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),Dt(w,"getDerivedStateFromProps",function(b,y){var _=b.dataKey,N=b.data,j=b.children,S=b.width,C=b.height,P=b.layout,A=b.stackOffset,F=b.margin,I=y.dataStartIndex,R=y.dataEndIndex;if(y.updateId===void 0){var M=w8(b);return $e($e($e({},M),{},{updateId:0},g($e($e({props:b},M),{},{updateId:0}),y)),{},{prevDataKey:_,prevData:N,prevWidth:S,prevHeight:C,prevLayout:P,prevStackOffset:A,prevMargin:F,prevChildren:j})}if(_!==y.prevDataKey||N!==y.prevData||S!==y.prevWidth||C!==y.prevHeight||P!==y.prevLayout||A!==y.prevStackOffset||!eg(F,y.prevMargin)){var $=w8(b),B={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},U=$e($e({},b8(y,N,P)),{},{updateId:y.updateId+1}),G=$e($e($e({},$),B),U);return $e($e($e({},G),g($e({props:b},G),y)),{},{prevDataKey:_,prevData:N,prevWidth:S,prevHeight:C,prevLayout:P,prevStackOffset:A,prevMargin:F,prevChildren:j})}if(!hO(j,y.prevChildren)){var Z,X,V,z,L=da(j,qg),W=L&&(Z=(X=L.props)===null||X===void 0?void 0:X.startIndex)!==null&&Z!==void 0?Z:I,Q=L&&(V=(z=L.props)===null||z===void 0?void 0:z.endIndex)!==null&&V!==void 0?V:R,J=W!==I||Q!==R,ne=!zt(N),Y=ne&&!J?y.updateId:y.updateId+1;return $e($e({updateId:Y},g($e($e({props:b},y),{},{updateId:Y,dataStartIndex:W,dataEndIndex:Q}),y)),{},{prevChildren:j,dataStartIndex:W,dataEndIndex:Q})}return null}),Dt(w,"renderActiveDot",function(b,y,_){var N;return O.isValidElement(b)?N=O.cloneElement(b,y):At(b)?N=b(y):N=se.createElement(yv,y),se.createElement(dn,{className:"recharts-active-dot",key:_},N)});var v=O.forwardRef(function(y,_){return se.createElement(w,Xp({},y,{ref:_}))});return v.displayName=w.displayName,v},MQ=gb({chartName:"LineChart",GraphicalChild:_v,axisComponents:[{axisType:"xAxis",AxisComp:eo},{axisType:"yAxis",AxisComp:to}],formatAxisMap:i5}),N_=gb({chartName:"BarChart",GraphicalChild:Ql,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:eo},{axisType:"yAxis",AxisComp:to}],formatAxisMap:i5}),l5e=gb({chartName:"PieChart",GraphicalChild:gu,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:wv},{axisType:"radiusAxis",AxisComp:bv}],formatAxisMap:vG,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),c5e=gb({chartName:"RadarChart",GraphicalChild:pb,axisComponents:[{axisType:"angleAxis",AxisComp:wv},{axisType:"radiusAxis",AxisComp:bv}],formatAxisMap:vG,defaultProps:{layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),u5e=gb({chartName:"AreaChart",GraphicalChild:Yd,axisComponents:[{axisType:"xAxis",AxisComp:eo},{axisType:"yAxis",AxisComp:to}],formatAxisMap:i5});function d5e(){const{data:e=[],isLoading:t}=qe({queryKey:["visitLogs"],queryFn:()=>ae.entities.VisitLog.list(),refetchInterval:3e4}),n=new Date,r=new Date(n-300*1e3),s=Ad(n),a=b0(s,7),o=b0(s,30),l=new Set(e.filter(y=>new Date(y.timestamp)>=r).map(y=>y.session_id)).size,c=new Set(e.filter(y=>new Date(y.timestamp)>=s).map(y=>y.session_id)).size,u=new Set(e.filter(y=>new Date(y.timestamp)>=a).map(y=>y.session_id)).size,h=new Set(e.filter(y=>new Date(y.timestamp)>=o).map(y=>y.session_id)).size,d=()=>{const y=[];for(let _=6;_>=0;_--){const N=b0(s,_),j=Ad(N),S=fD(N),C=new Set(e.filter(P=>{const A=new Date(P.timestamp);return A>=j&&A<=S}).map(P=>P.session_id)).size;y.push({date:Ut(N,"MMM d"),visitors:C})}return y},m=()=>{const y=[];for(let _=29;_>=0;_--){const N=b0(s,_),j=Ad(N),S=fD(N),C=new Set(e.filter(P=>{const A=new Date(P.timestamp);return A>=j&&A<=S}).map(P=>P.session_id)).size;y.push({date:Ut(N,"MMM d"),visitors:C})}return y},g=()=>
837{const y={Public:"Leaderboard",CentralHub:"Hub",UpcomingEvents:"Upcoming Events",TeamPhoto:"Upload Photo",Newsletter:"Newsletter",CommunityEvents:"Community Events",TeamsStats:"Team Stats"},_={};return e.forEach(N=>{const j=y[N.page_name]||N.page_name;_[j]=(_[j]||0)+1}),Object.entries(_).map(([N,j])=>({name:N,count:j})).sort((N,j)=>j.count-N.count)},w=d(),v=m(),b=g();return t?i.jsx(Me,{children:i.jsx(Fe,{className:"p-12 text-center",children:i.jsx("p",{className:"text-slate-600",children:"Loading analytics..."})})}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[i.jsxs(Me,{children:[i.jsxs(st,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(at,{className:"text-sm font-medium",children:"Live Visitors"}),i.jsx(GJ,{className:"h-4 w-4 text-green-600"})]}),i.jsxs(Fe,{children:[i.jsx("div",{className:"text-2xl font-bold text-green-600",children:l}),i.jsx("p",{className:"text-xs text-slate-600",children:"Active in last 5 minutes"})]})]}),i.jsxs(Me,{children:[i.jsxs(st,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(at,{className:"text-sm font-medium",children:"Today"}),i.jsx(du,{className:"h-4 w-4 text-blue-600"})]}),i.jsxs(Fe,{children:[i.jsx("div",{className:"text-2xl font-bold",children:c}),i.jsx("p",{className:"text-xs text-slate-600",children:"Unique visitors today"})]})]}),i.jsxs(Me,{children:[i.jsxs(st,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(at,{className:"text-sm font-medium",children:"Last 7 Days"}),i.jsx(ro,{className:"h-4 w-4 text-indigo-600"})]}),i.jsxs(Fe,{children:[i.jsx("div",{className:"text-2xl font-bold",children:u}),i.jsx("p",{className:"text-xs text-slate-600",children:"Unique visitors"})]})]}),i.jsxs(Me,{children:[i.jsxs(st,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(at,{className:"text-sm font-medium",children:"Last 30 Days"}),i.jsx(Fn,{className:"h-4 w-4 text-purple-600"})]}),i.jsxs(Fe,{children:[i.jsx("div",{className:"text-2xl font-bold",children:h}),i.jsx("p",{className:"text-xs text-slate-600",children:"Unique visitors"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsx(at,{children:"Last 7 Days"})}),i.jsx(Fe,{children:i.jsx(Uc,{width:"100%",height:300,children:i.jsxs(MQ,{data:w,children:[i.jsx(Rd,{strokeDasharray:"3 3"}),i.jsx(eo,{dataKey:"date"}),i.jsx(to,{}),i.jsx(_i,{}),i.jsx(_v,{type:"monotone",dataKey:"visitors",stroke:"#4f46e5",strokeWidth:2})]})})})]}),i.jsxs(Me,{children:[i.jsx(st,{children:i.jsx(at,{children:"Last 30 Days"})}),i.jsx(Fe,{children:i.jsx(Uc,{width:"100%",height:300,children:i.jsxs(N_,{data:v,children:[i.jsx(Rd,{strokeDasharray:"3 3"}),i.jsx(eo,{dataKey:"date",angle:-45,textAnchor:"end",height:80}),i.jsx(to,{}),i.jsx(_i,{}),i.jsx(Ql,{dataKey:"visitors",fill:"#8b5cf6"})]})})})]})]}),i.jsxs(Me,{children:[i.jsx(st,{children:i.jsx(at,{children:"Page Popularity"})}),i.jsx(Fe,{children:i.jsx("div",{className:"space-y-4",children:b.map((y,_)=>{var S;const N=((S=b[0])==null?void 0:S.count)||1,j=y.count/N*100;return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("span",{className:"text-sm font-medium",children:y.name}),i.jsxs("span",{className:"text-sm text-slate-600",children:[y.count," visits"]})]}),i.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:i.jsx("div",{className:"bg-indigo-600 h-2 rounded-full transition-all",style:{width:`${j}%`}})})]},_)})})})]})]})}const f5e=e=>{const t=e.split(`
838`),n=t[0].split(",").map(s=>s.trim().replace(/^"|"$/g,"")),r=[];for(let s=1;s<t.length;s++){if(!t[s].trim())continue;const a=t[s].split(",").map(l=>l.trim().replace(/^"|"$/g,"")),o={};n.forEach((l,c)=>{o[l]=a[c]||""}),r.push(o)}return r},h5e=(e,t)=>{const n=Object.keys(e[0]||{}),r=[n.join(","),...e.map(l=>n.map(c=>`"${l[c]||""}"`).join(","))].join(`
839`),s=new Blob([r],{type:"text/csv"}),a=window.URL.createObjectURL(s),o=document.createElement("a");o.href=a,o.download=t,o.click(),window.URL.revokeObjectURL(a)};function m5e(){const[e,t]=O.useState(!1),[n,r]=O.useState("all"),[s,a]=O.useState(!1),[o,l]=O.useState(null),c=mn(),{data:u=[]}=qe({queryKey:["contacts"],queryFn:()=>ae.entities.Contact.list()}),h=async(P,A)=>new Promise((F,I)=>{const R=new FileReader;R.onload=async M=>{try{const $=M.target.result,B=f5e($);await A(B),F()}catch($){I($)}},R.onerror=I,R.readAsText(P)}),d=async P=>{const A=P.target.files[0];if(A){t(!0);try{await h(A,async F=>{var R;const I=new Date().toISOString();for(const M of F){const $=(R=M["Email Address"])==null?void 0:R.toLowerCase().trim(),B=M["First Name"]||M["Full Name"]||"";if(!$)continue;const U=u.find(G=>G.email===$);if(U){if(U.status==="unsubscribed")continue;await ae.entities.Contact.update(U.id,{name:B||U.name,status:"subscribed",last_seen_at:I,last_consent_source:"Mailchimp",last_consent_value:"yes",last_consent_at:I})}else await ae.entities.Contact.create({email:$,name:B,status:"subscribed",invali
839d:!1,first_seen_at:I,last_seen_at:I,last_consent_source:"Mailchimp",last_consent_value:"yes",last_consent_at:I})}c.invalidateQueries(["contacts"]),alert(`Processed ${F.length} subscribed contacts`)})}catch(F){console.error("Failed to process Mailchimp subscribed:",F),alert("Failed to process file")}t(!1),P.target.value=""}},m=async P=>{const A=P.target.files[0];if(A){t(!0);try{await h(A,async F=>{var R;const I=new Date().toISOString();for(const M of F){const $=(R=M["Email Address"])==null?void 0:R.toLowerCase().trim(),B=M["First Name"]||M["Full Name"]||"";if(!$)continue;const U=u.find(G=>G.email===$);U?await ae.entities.Contact.update(U.id,{name:B||U.name,status:"unsubscribed",last_seen_at:I,last_consent_source:"Mailchimp",last_consent_value:"no",last_consent_at:I}):await ae.entities.Contact.create({email:$,name:B,status:"unsubscribed",invalid:!1,first_seen_at:I,last_seen_at:I,last_consent_source:"Mailchimp",last_consent_value:"no",last_consent_at:I})}c.invalidateQueries(["contacts"]),alert(`Processed ${F.length} unsubscribed contacts`)})}catch(F){console.error("Failed to process Mailchimp unsubscribed:",F),alert("Failed to process file")}t(!1),P.target.value=""}},g=async P=>{const A=P.target.files[0];if(A){t(!0);try{await h(A,async F=>{var R;const I=new Date().toISOString();for(const M of F){const $=(R=M["Email Address"])==null?void 0:R.toLowerCase().trim(),B=M["First Name"]||M["Full Name"]||"";if(!$)continue;const U=u.find(G=>G.email===$);U?await ae.entities.Contact.update(U.id,{name:B||U.name,status:"unsubscribed",invalid:!0,last_seen_at:I,last_consent_source:"Mailchimp",last_consent_value:"no",last_consent_at:I}):await ae.entities.Contact.create({email:$,name:B,status:"unsubscribed",invalid:!0,first_seen_at:I,last_seen_at:I,last_consent_source:"Mailchimp",last_consent_value:"no",last_consent_at:I})}c.invalidateQueries(["contacts"]),alert(`Processed ${F.length} cleaned contacts`)})}catch(F){console.error("Failed to process Mailchimp cleaned:",F),alert("Failed to process file")}t(!1),P.target.value=""}},w=async P=>{const A=P.target.files[0];if(A){t(!0);try{await h(A,async F=>{var $;const I=new Date().toISOString();let R=0,M=0;for(const B of F){const U=($=B.Email)==null?void 0:$.toLowerCase().trim(),G=B.Name||B["Team Name"]||"",Z=B["Team Name"]||"",X=B["Would you like to be added to our newsletter?"]||"";if(!U)continue;const V=u.find(z=>z.email===U);X==="Yes, that's fine"?(R++,V?await ae.entities.Contact.update(V.id,{name:G||V.name,team_name:Z||V.team_name,status:"subscribed",last_seen_at:I,last_consent_source:"Crowdpurr",last_consent_value:"yes",last_consent_at:I}):await ae.entities.Contact.create({email:U,name:G,team_name:Z,status:"subscribed",invalid:!1,first_seen_at:I,last_seen_at:I,last_consent_source:"Crowdpurr",last_consent_value:"yes",last_consent_at:I})):X==="No Thanks"?(M++,V?await ae.entities.Contact.update(V.id,{name:G||V.name,team_name:Z||V.team_name,status:"unsubscribed",last_seen_at:I,last_consent_source:"Crowdpurr",last_consent_value:"no",last_consent_at:I}):await ae.entities.Contact.create({email:U,name:G,team_name:Z,status:"unsubscribed",invalid:!1,first_seen_at:I,last_seen_at:I,last_consent_source:"Crowdpurr",last_consent_value:"no",last_consent_at:I})):V?await ae.entities.Contact.update(V.id,{name:G||V.name,team_name:Z||V.team_name,last_seen_at:I}):await ae.entities.Contact.create({email:U,name:G,team_name:Z,status:"unknown",invalid:!1,first_seen_at:I,last_seen_at:I})}c.invalidateQueries(["contacts"]),alert(`Processed ${F.length} Crowdpurr contacts
840✅ ${R} new opt-ins
841❌ ${M} new opt-outs`)})}catch(F){console.error("Failed to process Crowdpurr data:",F),alert("Failed to process file")}t(!1),P.target.value=""}},v=()=>{const P=u.filter(A=>A.status==="subscribed"&&!A.invalid);h5e(P.map(A=>({Email:A.email,Name:A.name,"Team Name":A.team_name||"","First Seen":A.first_seen_at,"Last Seen":A.last_seen_at})),`subscribed-contacts-${Ut(new Date,"yyyy-MM-dd")}.csv`)},b=async()=>{if(o)try{const P=new Date().toISOString();await ae.entities.Contact.update(o.id,{status:"subscribed",last_consent_source:"Manual Override",last_consent_value:"yes",last_consent_at:P}),c.invalidateQueries(["contacts"]),a(!1),l(null)}catch(P){console.error("Failed to override contact:",P),alert("Failed to update contact")}},y=u.filter(P=>n==="all"?!0:n==="subscribed"?P.status==="subscribed"&&!P.invali
841d:n==="unsubscribed"?P.status==="unsubscribed":n==="invalid"?P.invalid:!0).sort((P,A)=>new Date(A.last_seen_at)-new Date(P.last_seen_at)),_=P=>P.invalid?i.jsx(nt,{className:"bg-red-600",children:"Invalid"}):P.status==="subscribed"?i.jsx(nt,{className:"bg-green-600",children:"Subscribed"}):P.status==="unsubscribed"?i.jsx(nt,{className:"bg-orange-600",children:"Unsubscribed"}):i.jsx(nt,{className:"bg-slate-400",children:"Unknown"}),N={subscribed:u.filter(P=>P.status==="subscribed"&&!P.invalid).length,unsubscribed:u.filter(P=>P.status==="unsubscribed").length,invalid:u.filter(P=>P.invalid).length,unknown:u.filter(P=>P.status==="unknown"&&!P.invalid).length},j=new Date(Date.now()-10080*60*1e3),S=u.filter(P=>P.status==="subscribed"&&P.last_consent_at&&new Date(P.last_consent_at)>=j).length,C=u.filter(P=>P.status==="unsubscribed"&&P.last_consent_at&&new Date(P.last_consent_at)>=j).length;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-6",children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(Dr,{className:"w-5 h-5"}),"Contact Management"]})}),i.jsxs(Fe,{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[i.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:[i.jsx("div",{className:"text-2xl font-bold text-green-900",children:N.subscribed}),i.jsx("div",{className:"text-sm text-green-700",children:"Subscribed"}),S>0&&i.jsxs("div",{className:"text-xs text-green-600 mt-1",children:["+",S," this week"]})]}),i.jsxs("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-4",children:[i.jsx("div",{className:"text-2xl font-bold text-orange-900",children:N.unsubscribed}),i.jsx("div",{className:"text-sm text-orange-700",children:"Unsubscribed"}),C>0&&i.jsxs("div",{className:"text-xs text-orange-600 mt-1",children:[C," this week"]})]}),i.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-lg p-4",children:[i.jsx("div",{className:"text-2xl font-bold text-slate-900",children:N.unknown}),i.jsx("div",{className:"text-sm text-slate-700",children:"Unknown"})]}),i.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:[i.jsx("div",{className:"text-2xl font-bold text-red-900",children:N.invalid}),i.jsx("div",{className:"text-sm text-red-700",children:"Invalid"})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Mailchimp Subscribed List"}),i.jsx(Ee,{type:"file",accept:".csv",onChange:d,disabled:e}),i.jsx("p",{className:"text-xs text-slate-600",children:"CSV with Email Address, First Name columns"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Mailchimp Unsubscribed List"}),i.jsx(Ee,{type:"file",accept:".csv",onChange:m,disabled:e}),i.jsx("p",{className:"text-xs text-slate-600",children:"CSV with Email Address, First Name columns"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Mailchimp Cleaned List"}),i.jsx(Ee,{type:"file",accept:".csv",onChange:g,disabled:e}),i.jsx("p",{className:"text-xs text-slate-600",children:"CSV with Email Address, First Name columns"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Crowdpurr Data Capture"}),i.jsx(Ee,{type:"file",accept:".csv",onChange:w,disabled:e}),i.jsx("p",{className:"text-xs text-slate-600",children:"CSV with Email, Name, Team Name, mailing list answer"})]})]}),e&&i.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 text-center",children:i.jsx("p",{className:"text-blue-900 font-semibold",children:"Processing contacts..."})})]})]}),i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs(at,{children:["Contacts (",y.length,")"]}),i.jsx("div",{className:"flex gap-2",children:i.jsxs(ue,{onClick:v,variant:"outline",size:"sm",children:[i.jsx(Wy,{className:"w-4 h-4 mr-2"}),"Export Subscribed"]})})]})}),i.jsxs(Fe,{children:[i.jsxs("div",{className:"flex gap-2 mb-4",children:[i.jsxs(ue,{size:"sm",variant:n==="all"?"default":"outline",onClick:()=>r("all"),children:["All (",u.length,")"]}),i.jsxs(ue,{size:"sm",variant:n==="subscribed"?"default":"outline",onClick:()=>r("subscribed"),children:[i.jsx(Ch,{className:"w-4 h-4 mr-1"}),"Subscribed (",N.subscribed,")"]}),i.jsxs(ue,{size:"sm",variant:n==="unsubscribed"?"default":"outline",onClick:()=>r("unsubscribed"),children:[i.jsx(ya,{className:"w-4 h-4 mr-1"}),"Unsubscribed (",N.unsubscribed,")"]}),i.jsxs(ue,{size:"sm",variant:n==="invalid"?"default":"outline",onClick:()=>r("invalid"),children:[i.jsx(Sn,{className:"w-4 h-4 mr-1"}),"Invalid (",N.invalid,")"]})]}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs(Qo,{children:[i.jsx(Yo,{children:i.jsxs(tr,{children:[i.jsx(ht,{children:"Email"}),i.jsx(ht,{children:"Name"}),i.jsx(ht,{children:"Team"}),i.jsx(ht,{children:"Status"}),i.jsx(ht,{children:"Last Consent"}),i.jsx(ht,{children:"Last Seen"}),i.jsx(ht,{children:"Actions"})]})}),i.jsx(Xo,{children:y.map(P=>i.jsxs(tr,{children:[i.jsx(it,{className:"font-mono text-sm",children:P.email}),i.jsx(it,{children:P.name||"-"}),i.jsx(it,{children:P.team_name||"-"}),i.jsx(it,{children:_(P)}),i.jsx(it,{children:P.last_consent_source?i.jsxs("div",{className:"text-xs",children:[i.jsx("div",{children:P.last_consent_source}),i.jsx("div",{className:"text-slate-600",children:P.last_consent_value})]}):"-"}),i.jsx(it,{className:"text-sm text-slate-600",children:P.last_seen_at?Ut(new Date(P.last_seen_at),"MMM d, yyyy"):"-"}),i.jsx(it,{children:P.status==="unsubscribed"&&i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>{l(P),a(!0)},children:"Override"})})]},P.id))})]})})]})]})]}),i.jsx(rn,{open:s,onOpenChange:a,children:i.jsxs(en,{children:[i.jsx(vn,{children:i.jsx(sn,{children:"Override to Subscribed"})}),o&&i.jsx("div",{className:"space-y-4 py-4",children:i.jsxs("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-4",children:[i.jsxs("p",{className:"text-sm text-orange-900",children:[i.jsx("strong",{children:"Warning:"})," You are about to override the unsubscribed status for:"]}),i.jsx("p",{className:"mt-2 font-mono text-sm",children:o.email}),i.jsx("p",{className:"mt-2 text-xs text-orange-800",children:"Only do this if you have received explicit verbal consent from this contact."})]})}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),i.jsxs(ue,{onClick:b,className:"bg-green-600 hover:bg-green-700",children:[i.jsx(Ch,{className:"w-4 h-4 mr-2"}),"Confirm Override"]})]})]})})]})}function gr({className:e,...t}){return i.jsx("div",{className:Nt("animate-pulse rounded-md bg-slate-200",e),...t})}function p5e(){var g;const e=mn(),[t,n]=O.useState("quizzes"),{data:r=[]}=qe({queryKey:["adminCommunityQuizzes"],queryFn:()=>ae.entities.CommunityQuiz.list("-created_date"),refetchInterval:5e3}),{data:s=[]}=qe({queryKey:["adminFlaggedReviews"],queryFn:async()=>(await ae.entities.CommunityQuizReview.list("-created_date")).filter(v=>v.ai_flagged===!0)}),{data:a,isLoading:o,refetch:l}=qe({queryKey:["communityInsights"],queryFn:async()=>(await ae.functions.invoke("communityQuiz",{action:"getCommunityInsights"})).data,enabled:t==="insights"}),c=qt({mutationFn:w=>ae.functions.invoke("communityQuiz",{action:"deleteQuiz",quizId:w}),onSuccess:()=>e.invalidateQueries(["adminCommunityQuizzes"])}),u=qt({mutationFn:w=>ae.entities.CommunityQuiz.update(w,{status:"archived"}),onSuccess:()=>e.invalidateQueries(["adminCommunityQuizzes"])}),h=qt({mutationFn:w=>ae.entities.CommunityQuiz.update(w,{status:"active",ai_flagged:!1}),onSuccess:()=>e.invalidateQueries(["adminCommunityQuizzes"])}),d=qt({mutationFn:w=>ae.entities.CommunityQuizReview.delete(w),onSuccess:()=>e.invalidateQueries(["adminFlaggedReviews"])}),m=qt({mutationFn:w=>ae.entities.CommunityQuizReview.update(w,{ai_flagged:!1}),onSuccess:()=>e.invalidateQueries(["adminFlaggedReviews"])});return i.jsx("div",{className:"space-y-6",children:i.jsxs(tu,{value:t,onValueChange:n,className:"w-full",children:[i.jsxs(Wl,{className:"grid w-full grid-cols-3",children:[i.jsx(Wt,{value:"quizzes",children:"Qu
841izzes & Moderation"}),i.jsxs(Wt,{value:"reviews",className:"relative",children:["Flagged Reviews",s.length>0&&i.jsxs("span",{className:"absolute top-0 right-0 -mt-1 -mr-1 flex h-3 w-3",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-red-500"})]})]}),i.jsx(Wt,{value:"insights",children:"AI Insights"})]}),i.jsx(Yt,{value:"quizzes",className:"space-y-4",children:i.jsxs(Me,{children:[i.jsxs(st,{children:[i.jsx(at,{children:"Community Quizzes"}),i.jsx(Ja,{children:"Manage and moderate user-created challenges."})]}),i.jsx(Fe,{children:i.jsx("div",{className:"rounded-md border",children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{className:"bg-slate-50 border-b",children:i.jsxs("tr",{children:[i.jsx("th",{className:"p-3 text-left font-medium text-slate-500",children:"Title"}),i.jsx("th",{className:"p-3 text-left font-medium text-slate-500",children:"Creator"}),i.jsx("th",{className:"p-3 text-left font-medium text-slate-500",children:"Stats"}),i.jsx("th",{className:"p-3 text-left font-medium text-slate-500",children:"Status"}),i.jsx("th",{className:"p-3 text-right font-medium text-slate-500",children:"Actions"})]})}),i.jsx("tbody",{className:"divide-y",children:r.map(w=>i.jsxs("tr",{className:w.status==="flagged"?"bg-red-50/50":"",children:[i.jsxs("td",{className:"p-3",children:[i.jsx("div",{className:"font-medium",children:w.title}),i.jsx("div",{className:"text-xs text-slate-500 line-clamp-1",children:w.description})]}),i.jsx("td",{className:"p-3 text-slate-600",children:w.created_by_name}),i.jsxs("td",{className:"p-3 text-slate-600",children:[w.total_plays," plays • ",w.questions_count," Qs"]}),i.jsxs("td",{className:"p-3",children:[i.jsx(nt,{variant:w.status==="active"?"default":w.status==="flagged"?"destructive":"secondary",children:w.status==="flagged"?"AI Flagged":w.status}),w.ai_reason&&w.status==="flagged"&&i.jsxs("div",{className:"text-xs text-red-600 mt-1 max-w-[150px] leading-tight",children:[i.jsx(ba,{className:"w-3 h-3 inline mr-1"}),w.ai_reason]})]}),i.jsxs("td",{className:"p-3 text-right space-x-2",children:[w.status==="flagged"&&i.jsx(ue,{size:"sm",className:"bg-green-600 hover:bg-green-700",onClick:()=>h.mutate(w.id),children:i.jsx(Cn,{className:"w-4 h-4"})}),w.status==="active"&&i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>u.mutate(w.id),children:"Archive"}),i.jsx(ue,{size:"sm",variant:"destructive",onClick:()=>{confirm("Delete this quiz permanently?")&&c.mutate(w.id)},children:i.jsx(ci,{className:"w-4 h-4"})})]})]},w.id))})]})})})]})}),i.jsx(Yt,{value:"reviews",className:"space-y-4",children:i.jsxs(Me,{children:[i.jsxs(st,{children:[i.jsx(at,{children:"Flagged Reviews"}),i.jsx(Ja,{children:"Review comments flagged by AI for inappropriate content."})]}),i.jsx(Fe,{children:s.length>0?i.jsx("div",{className:"space-y-4",children:s.map(w=>i.jsxs("div",{className:"p-4 border rounded-lg bg-red-50 border-red-100 flex flex-col md:flex-row justify-between items-start gap-4",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"font-bold text-slate-800",children:w.user_name}),i.jsxs("span",{className:"text-slate-500 text-xs",children:["• ",new Date(w.created_date).toLocaleDateString()]})]}),i.jsxs("p",{className:"text-slate-800 font-medium italic mb-2",children:['"',w.comment,'"']}),i.jsxs("div",{className:"flex items-center gap-2 text-xs text-red-600 font-bold bg-red-100 px-2 py-1 rounded inline-block",children:[i.jsx(ba,{className:"w-3 h-3"}),"AI Flag: ",w.ai_reason]})]}),i.jsxs("div",{className:"flex gap-2 shrink-0",children:[i.jsxs(ue,{size:"sm",variant:"outline",className:"bg-white hover:bg-slate-50 text-green-600 border-green-200 hover:border-green-300",onClick:()=>m.mutate(w.id),children:[i.jsx(Cn,{className:"w-4 h-4 mr-2"})," Ignore"]}),i.jsxs(ue,{size:"sm",variant:"destructive",onClick:()=>d.mutate(w.id),children:[i.jsx(ci,{className:"w-4 h-4 mr-2"})," Delete"]})]})]},w.id))}):i.jsxs("div",{className:"text-center py-12 text-slate-500 bg-slate-50 rounded-lg border border-dashed",children:[i.jsx(Cn,{className:"w-12 h-12 mx-auto mb-3 text-green-500 opacity-50"}),i.jsx("p",{children:"No flagged reviews. The community is safe!"})]})})]})}),i.jsxs(Yt,{value:"insights",className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsxs("h2",{className:"text-xl font-bold text-slate-800 flex items-center gap-2",children:[i.jsx(es,{className:"w-5 h-5 text-indigo-500"}),"AI Community Analysis"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(),disabled:o,children:[i.jsx(Ah,{className:`w-4 h-4 mr-2 ${o?"animate-spin":""}`}),"Refresh"]})]}),o?i.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[i.jsx(gr,{className:"h-40 rounded-xl"}),i.jsx(gr,{className:"h-40 rounded-xl"}),i.jsx(gr,{className:"h-40 rounded-xl"}),i.jsx(gr,{className:"h-40 rounded-xl"})]}):a?i.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[i.jsxs(Me,{className:"bg-indigo-50 border-indigo-100",children:[i.jsx(st,{children:i.jsxs(at,{className:"text-indigo-900 flex items-center gap-2",children:[i.jsx(pg,{className:"w-5 h-5"})," Content Trends"]})}),i.jsxs(Fe,{children:[i.jsx("p",{className:"text-slate-700 text-sm leading-relaxed",children:a.top_creators_analysis}),i.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:(g=a.popular_categories)==null?void 0:g.map((w,v)=>i.jsx(nt,{variant:"secondary",className:"bg-white text-indigo-700 shadow-sm",children:w},v))})]})]}),i.jsxs(Me,{className:"bg-emerald-50 border-emerald-100",children:[i.jsx(st,{children:i.jsxs(at,{className:"text-emerald-900 flex items-center gap-2",children:[i.jsx(Dr,{className:"w-5 h-5"})," Engagement Health"]})}),i.jsx(Fe,{children:i.jsx("p",{className:"text-slate-700 text-sm leading-relaxed",children:a.engagement_summary})})]}),i.jsxs(Me,{className:"bg-amber-50 border-amber-100 md:col-span-2",children:[i.jsx(st,{children:i.jsxs(at,{className:"text-amber-900 flex items-center gap-2",children:[i.jsx(ro,{className:"w-5 h-5"})," Areas for Improvement"]})}),i.jsx(Fe,{children:i.jsx("p",{className:"text-slate-700 text-sm leading-relaxed",children:a.improvement_areas})})]})]}):i.jsx("div",{className:"text-center py-10 text-slate-400",children:"Failed to load insights."})]})]})})}function g5e(){const[e,t]=O.useState(!1),[n,r]=O.useState("Medium"),[s,a]=O.useState([]),o=mn(),l=async u=>{var h,d;if(!e){t(!0),tt.loading("Generating quiz... This may take 30-60 seconds",{id:"quiz-gen"});try{const m=await ae.functions.invoke("weeklyAIQuiz",{action:"generateWeeklyQuiz",region:u,difficulty:n});if((h=m.data)!=null&&h.success)tt.success(`✅ ${u==="irish-uk"?"Irish/UK":"Worldwide"} quiz created: ${m.data.title}`,{id:"quiz-gen",duration:5e3}),a(g=>[...g,{region:u,title:m.data.title,timestamp:new Date().toLocaleStr
841ing()}]),o.invalidateQueries(["communityQuizzes"]);else throw new Error(((d=m.data)==null?void 0:d.error)||"Failed to generate quiz")}catch(m){tt.error(`❌ ${m.message}`,{id:"quiz-gen"})}finally{t(!1)}}},c=async()=>{var u,h;if(!e){t(!0),tt.loading("Generating both quizzes... This may take 60-90 seconds",{id:"both-quiz-gen"});try{const d=await ae.functions.invoke("weeklyAIQuiz",{action:"generateBothWeeklyQuizzes",difficulty:n});if((u=d.data)!=null&&u.success)tt.success("✅ Both weekly quizzes created successfully!",{id:"both-quiz-gen",duration:5e3}),a(d.data.quizzes.map(m=>({region:m.region,title:m.data.title,timestamp:new Date().toLocaleString()}))),o.invalidateQueries(["communityQuizzes"]);else throw new Error(((h=d.data)==null?void 0:h.error)||"Failed to generate quizzes")}catch(d){tt.error(`❌ ${d.message}`,{id:"both-quiz-gen"})}finally{t(!1)}}};return i.jsx("div",{className:"space-y-6",children:i.jsxs(Me,{className:"border-indigo-200 bg-gradient-to-br from-indigo-50 to-purple-50",children:[i.jsx(st,{children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{children:[i.jsxs(at,{className:"text-2xl flex items-center gap-2",children:[i.jsx(es,{className:"w-6 h-6 text-indigo-600"}),"Weekly AI Quiz Generator"]}),i.jsx(Ja,{className:"mt-2",children:"Automatically generate quizzes based on recent news and events from the past week"})]}),i.jsx(nt,{className:"bg-indigo-600",children:"AI Powered"})]})}),i.jsxs(Fe,{className:"space-y-6",children:[i.jsxs("div",{className:"bg-white p-4 rounded-lg border",children:[i.jsx("h3",{className:"font-semibold mb-3",children:"Quiz Settings"}),i.jsx("div",{className:"flex items-center gap-4",children:i.jsxs("div",{className:"flex-1",children:[i.jsx("label",{className:"text-sm font-medium text-slate-600 mb-1 block",children:"Difficulty Level"}),i.jsxs(Xt,{value:n,onValueChange:r,children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"Easy",children:"Easy"}),i.jsx(Ie,{value:"Medium",children:"Medium"}),i.jsx(Ie,{value:"Hard",children:"Hard"})]})]})]})})]}),i.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[i.jsxs(Me,{className:"border-2 hover:border-green-300 transition-colors",children:[i.jsxs(st,{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(js,{className:"w-5 h-5 text-green-600"}),i.jsx(at,{className:"text-lg",children:"Irish & UK Quiz"})]}),i.jsx(Ja,{children:"Generate a quiz focused on events from Ireland and the United Kingdom"})]}),i.jsx(Fe,{children:i.jsxs(ue,{onClick:()=>l("irish-uk"),disabled:e,className:"w-full bg-green-600 hover:bg-green-700",children:[e?i.jsx(dr,{className:"w-4 h-4 animate-spin mr-2"}):i.jsx(es,{className:"w-4 h-4 mr-2"}),"Generate Irish/UK Quiz"]})})]}),i.jsxs(Me,{className:"border-2 hover:border-blue-300 transition-colors",children:[i.jsxs(st,{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(q0,{className:"w-5 h-5 text-blue-600"}),i.jsx(at,{className:"text-lg",children:"Worldwide Quiz"})]}),i.jsx(Ja,{children:"Generate a quiz focused on major worldwide events and news"})]}),i.jsx(Fe,{children:i.jsxs(ue,{onClick:()=>l("worldwide"),disabled:e,className:"w-full bg-blue-600 hover:bg-blue-700",children:[e?i.jsx(dr,{className:"w-4 h-4 animate-spin mr-2"}):i.jsx(es,{className:"w-4 h-4 mr-2"}),"Generate Worldwide Quiz"]})})]})]}),i.jsx("div",{className:"bg-gradient-to-r from-indigo-50 to-purple-50 p-4 rounded-lg border-2 border-indigo-200",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold text-indigo-900",children:"Generate Both Quizzes"}),i.jsx("p",{className:"text-sm text-indigo-700 mt-1",children:"Create both Irish/UK and Worldwide quizzes in one go"})]}),i.jsxs(ue,{onClick:c,disabled:e,size:"lg",className:"bg-indigo-600 hover:bg-indigo-700",children:[e?i.jsx(dr,{className:"w-4 h-4 animate-spin mr-2"}):i.jsx(es,{className:"w-4 h-4 mr-2"}),"Generate Both"]})]})}),s.length>0&&i.jsxs("div",{className:"bg-white p-4 rounded-lg border",children:[i.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[i.jsx(Cn,{className:"w-5 h-5 text-green-600"}),"Recently Generated"]}),i.jsx("div",{className:"space-y-2",children:s.map((u,h)=>i.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 rounded border border-green-200",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[u.region==="irish-uk"?i.jsx(js,{className:"w-4 h-4 text-green-600"}):i.jsx(q0,{className:"w-4 h-4 text-blue-600"}),i.jsx("span",{className:"font-medium text-sm",children:u.title})]}),i.jsx("span",{className:"text-xs text-slate-500",children:u.timestamp})]},h))})]}),i.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(Sn,{className:"w-5 h-5 text-blue-600 flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"text-sm text-blue-900",children:[i.jsx("p",{className:"font-semibold mb-1",children:"How it works:"}),i.jsxs("ul",{className:"list-disc list-inside space-y-1 text-blue-800",children:[i.jsx("li",{children:"AI fetches recent news and events from the past week"}),i.jsx("li",{children:"Generates 20 engaging questions (mix of multiple-choice and numerical)"}
841),i.jsx("li",{children:"Quiz is automatically published to Community Challenges"}),i.jsx("li",{children:"Quizzes expire after 6 months"})]})]})]})})]})]})})}const A1={short:{name:"Short & Snappy",content:`🏆 WEEKLY QUIZ RESULTS 🏆
842
843This week's Top 3:
844🥇 [TOP1]
845🥈 [TOP2]
846🥉 [TOP3]
847
848League Leader: [LEADER]
849[NEWCOMER]
850Next Quiz: [NEXT_EVENT]
851
852View full standings: [LEADERBOARD_URL]
853
854You can unsubscribe or update your email preferences anytime inside the app. Open the Hub and tap Newsletter & Notifications.`},sms:{name:"SMS Version",content:`Quiz Results! Top 3: [TOP1], [TOP2], [TOP3]. League Leader: [LEADER]. [NEWCOMER]Next quiz: [NEXT_EVENT]. View standings: [LEADERBOARD_URL]
855You can unsubscribe or update your email preferences anytime inside the app. Open the Hub and tap Newsletter & Notifications.`},whatsapp:{name:"WhatsApp Version",content:`🎯 *QUIZ LEAGUE UPDATE* 🎯
856
857*This Week's Winners:*
858🥇 [TOP1]
859🥈 [TOP2]
860🥉 [TOP3]
861
862*Current League Leader:* [LEADER]
863[NEWCOMER]
864*Next Event:* [NEXT_EVENT]
865
866📊 Full Leaderboard: [LEADERBOARD_URL]
867📸 Upload Team Photo: [PHOTO_URL]
868🏠 App Hub: [HUB_URL]
869
870You can unsubscribe or update your email preferences anytime inside the app. Open the Hub and tap Newsletter & Notifications.`},newsletter:{name:"Full Newsletter Version",content:`🏆 WEEKLY QUIZ LEAGUE ROUNDUP 🏆
871
872Hello Quiz Fans!
873
874Another fantastic week at the Quiz League! Here's everything you need to know:
875
876THIS WEEK'S TOP PERFORMERS
877----------------------------
878🥇 First Place: [TOP1]
879🥈 Second Place: [TOP2]
880🥉 Third Place: [TOP3]
881
882Congratulations to our winners! 
883
884LEAGUE STANDINGS
885----------------------------
886Current League Leader: [LEADER]
887[NEWCOMER]
888WHAT'S NEXT
889----------------------------
890Next Event: [NEXT_EVENT]
891
892QUICK LINKS
893----------------------------
894📊 View Full Leaderboard: [LEADERBOARD_URL]
895📸 Upload Your Team Photo: [PHOTO_URL]
896🏠 Quiz League Hub: [HUB_URL]
897📅 Upcoming Events: [EVENTS_URL]
898
899See you at the next quiz!
900
901Quiz League Team
902
903----------------------------
904You can unsubscribe or update your email preferences anytime inside the app. Open the Hub and tap Newsletter & Notifications.`},hype:{name:"Hype Version",content:`🔥🔥🔥 QUIZ LEAGUE ALERT 🔥🔥🔥
905
906THE CHAMPIONS OF THE WEEK ARE...
907
908🥇 [TOP1] - ABSOLUTE LEGENDS!!!
909🥈 [TOP2] - SO CLOSE TO GLORY!
910🥉 [TOP3] - BRONZE BUT NEVER BORING!
911
912👑 REIGNING SUPREME: [LEADER] 👑
913[NEWCOMER]
914⚡ NEXT BATTLE: [NEXT_EVENT] ⚡
915
916Don't just read about it - BE PART OF IT!
917🔗 [LEADERBOARD_URL]
918
919Can YOUR team make it to the top? There's only one way to find out... 💪
920
921#QuizLeague #TriviaLife #BrainPower
922
923You can unsubscribe or update your email preferences anytime inside the app. Open the Hub and tap Newsletter & Notifications.`}};function v5e(){const[e,t]=O.useState("short"),[n,r]=O.useState(A1.short.content),[s,a]=O.useState(!1),{data:o=[]}=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list("-updated_date",200),refetchInterval:3e4}),{data:l=[]}=qe({queryKey:["importBatches"],queryFn:()=>ae.entities.ImportBatch.list("-import_timestamp",50),refetchInterval:3e4}),{data:c=[]}=qe({queryKey:["events"],queryFn:()=>ae.entities.Event.list()}),{data:u}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{}}),h=g=>{t(g),r(A1[g].content)},d=()=>{var U,G,Z,X;const w=[...l].sort((V,z)=>new Date(z.import_timestamp)-new Date(V.import_timestamp))[0];let v=[];if(w!=null&&w.quiz_date){const V=w.quiz_date,z=w.import_timestamp.split("T")[0];v=o.filter(W=>{const Q=W.last_attendance_date===V,J=W.updated_date&&W.updated_date.startsWith(z);return Q||J}).sort((W,Q)=>Q.finishes_1st!==W.finishes_1st?Q.finishes_1st-W.finishes_1st:Q.finishes_2nd!==W.finishes_2nd?Q.finishes_2nd-W.finishes_2nd:Q.total_points-W.total_points).slice(0,3)}v.length===0&&(v=[...o].sort((V,z)=>z.total_points-V.total_points).slice(0,3));const b=((U=v[0])==null?void 0:U.team_name)||"TBD",y=((G=v[1])==null?void 0:G.team_name)||"TBD",_=((Z=v[2])==null?void 0:Z.team_name)||"TBD",N=((X=[...o].sort((V,z)=>z.total_points-V.total_points)[0])==null?void 0:X.team_name)||"TBD",j=o.filter(V=>V.appearances===1&&(V.finishes_1st>0||V.finishes_2nd>0||V.finishes_3rd>0)),S=j.length>0?`
924🌟 Best Newcomer: ${j[0].team_name}
925`:"",C=new Date,A=c.filter(V=>V.is_active!==!1).map(V=>{const z=new Date(V.start_datetime);if(z>C)return{...V,nextOccurrence:z};if(V.repeat_type==="weekly"&&V.repeat_end_date){const L=new Date(V.repeat_end_date);let W=new Date(z);for(;W<C&&W<L;)W.setDate(W.getDate()+7);if(W<L)return{...V,nextOccurrence:W}}return null}
925).filter(Boolean).sort((V,z)=>V.nextOccurrence-z.nextOccurrence)[0],F=A?`${A.title} - ${Ut(A.nextOccurrence,"EEEE, MMM d")}`:"Check app for details";let B=A1[e].content.replace(/\[TOP1\]/g,b).replace(/\[TOP2\]/g,y).replace(/\[TOP3\]/g,_).replace(/\[LEADER\]/g,N).replace(/\[NEWCOMER\]/g,S).replace(/\[NEXT_EVENT\]/g,F).replace(/\[LEADERBOARD_URL\]/g,"https://quizleague.base44.app").replace(/\[PHOTO_URL\]/g,"https://quizleague.base44.app/teamphoto").replace(/\[HUB_URL\]/g,"https://quizleague.base44.app").replace(/\[EVENTS_URL\]/g,"https://quizleague.base44.app/upcomingevents");r(B)},m=()=>{navigator.clipboard.writeText(n),a(!0),setTimeout(()=>a(!1),2e3)};return i.jsx("div",{className:"space-y-6",children:i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(Wo,{className:"w-5 h-5"}),"Weekly Message Generator"]})}),i.jsxs(Fe,{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Select Template"}),i.jsxs(Xt,{value:e,onValueChange:h,children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsx(Kt,{children:Object.entries(A1).map(([g,w])=>i.jsx(Ie,{value:g,children:w.name},g))})]})]}),i.jsxs(ue,{onClick:d,className:"w-full",children:[i.jsx(fB,{className:"w-4 h-4 mr-2"}),"Auto-Fill From Latest Data"]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Preview & Edit"}),i.jsx(nr,{value:n,onChange:g=>r(g.target.value),rows:20,className:"font-mono text-sm"})]}),i.jsx("div",{className:"flex gap-2",children:i.jsx(ue,{onClick:m,variant:"outline",className:"flex-1",children:s?i.jsxs(i.Fragment,{children:[i.jsx(Id,{className:"w-4 h-4 mr-2"}),"Copied!"]}):i.jsxs(i.Fragment,{children:[i.jsx($0,{className:"w-4 h-4 mr-2"}),"Copy to Clipboard"]})})}),i.jsxs("div",{className:"bg-slate-50 rounded-lg p-4 text-sm text-slate-600",children:[i.jsx("p",{className:"font-semibold mb-2",children:"Available Placeholders:"}),i.jsxs("ul",{className:"space-y-1",children:[i.jsx("li",{children:"• [TOP1], [TOP2], [TOP3] - This week's top 3 teams"}),i.jsx("li",{children:"• [LEADER] - Current league leader"}),i.jsx("li",{children:"• [NEWCOMER] - Best newcomer (auto-hidden if none)"}),i.jsx("li",{children:"• [NEXT_EVENT] - Next upcoming event"}),i.jsx("li",{children:"• [LEADERBOARD_URL] - Link to leaderboard"}),i.jsx("li",{children:"• [PHOTO_URL] - Link to photo upload"}),i.jsx("li",{children:"• [HUB_URL] - Link to app hub"}),i.jsx("li",{children:"• [EVENTS_URL] - Link to events page"})]})]})]})]})})}const _8={new:"bg-blue-100 text-blue-800 border-blue-200",seen:"bg-yellow-100 text-yellow-800 border-yellow-200",accepted:"bg-green-100 text-green-800 border-green-200",declined:"bg-red-100 text-red-800 border-red-200"},N8={new:"New",seen:"Seen",accepted:"Accepted",declined:"Declined"};function x5e(){const[e,t]=O.useState("all"),[n,r]=O.useState(null),[s,a]=O.useState(!1),o=mn(),{data:l=[]}=qe({queryKey:["bookingRequests"],queryFn:()=>ae.entities.BookingRequest.list("-created_date")}),c=qt({mutationFn:({id:w,status:v,admin_notes:b})=>ae.entities.BookingRequest.update(w,{status:v,admin_notes:b}),onSuccess:()=>{o.invalidateQueries(["bookingRequests"]),a(!1)}}),u=e==="all"?l:l.filter(w=>w.status===e),h=l.filter(w=>w.status==="new").length,d=w=>{r(w),a(!0)},m=w=>{n&&c.mutate({id:n.id,status:w,admin_notes:n.admin_notes||""})},g=()=>{n&&c.mutate({id:n.id,status:n.status,admin_notes:n.admin_notes||""})};return i.jsxs(i.Fragment,{children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(Bc,{className:"w-5 h-5"}),"Booking Enquiries",h>0&&i.jsxs(nt,{className:"bg-blue-500 text-white ml-2",children:[h," New"]})]}),i.jsx("div",{className:"w-48",children:i.jsxs(Xt,{value:e,onValueChange:t,children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"all",children:"All Bookings"}),i.jsx(Ie,{value:"new",children:"New"}),i.jsx(Ie,{value:"seen",children:"Seen"}),i.jsx(Ie,{value:"accepted",children:"Accepted"}),i.jsx(Ie,{value:"declined",children:"Declined"})]})]})})]})}),i.jsx(Fe,{children:u.length===0?i.jsxs("div",{className:"text-center py-12 text-slate-500",children:[i.jsx(Bc,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),i.jsx("p",{children:"No booking enquiries yet"})]}):i.jsx("div",{className:"space-y-4",children:u.map(w=>i.jsx(Me,{className:"border-2",children:i.jsx(Fe,{className:"p-4",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("h3",{className:"font-semibold text-lg",children:w.name_or_company}),i.jsx(nt,{className:_8[w.status],children:N8[w.status]})]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[i.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[i.jsx(Vo,{className:"w-4 h-4"}),i.jsx("span",{children:w.email})]}),w.phone&&i.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[i.jsx(uM,{className:"w-4 h-4"}),i.jsx("span",{children:w.phone})]}),i.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[i.jsx(Fn,{className:"w-4 h-4"}),i.jsx("span",{children:Ut(new Date(w.event_date),"MMM d, yyyy")})]}),i.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[i.jsx(rs,{className:"w-4 h-4"}),i.jsx("span",{children:w.start_time})]}),i.jsx("div",{className:"flex items-center gap-2 text-slate-600",children:w.quiz_format==="in-venue"?i.jsxs(i.Fragment,{children:[i.jsx(js,{className:"w-4 h-4"}),i.jsx("span",{children:"In-Venue"})]}):i.jsxs(i.Fragment,{children:[i.jsx(q0,{className:"w-4 h-4"}),i.jsx("span",{children:"Online"})]})}),i.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[i.jsx(Bc,{className:"w-4 h-4"}),i.jsx("span",{className:"capitalize",children:w.quiz_type.replace("-"," ")})]}),i.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[i.jsx(Dr,{className:"w-4 h-4"}),i.jsx("span",{children:w.estimated_participants})]}),i.jsxs("div",{className:"text-xs text-slate-500",children:["Submitted: ",Ut(new Date(w.created_date),"MMM d, h:mm a")]})]})]}),i.jsx(ue,{onClick:()=>d(w),variant:"outline",className:"ml-4",children:"View Details"})]})})},w.id))})})]}),i.jsx(rn,{open:s,onOpenChange:a,children:i.jsxs(en,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[i.jsx(vn,{children:i.jsxs(sn,{className:"flex items-center gap-2",children:[i.jsx(Bc,{className:"w-5 h-5"}),"Booking Details"]}
925)}),n&&i.jsxs("div",{className:"space-y-6 py-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(nt,{className:`${_8[n.status]} text-base px-4 py-1`,children:N8[n.status]}),i.jsxs("span",{className:"text-sm text-slate-500",children:["Submitted: ",Ut(new Date(n.created_date),"MMM d, yyyy h:mm a")]})]}),i.jsxs("div",{className:"space-y-3 border-b pb-4",children:[i.jsx("h4",{className:"font-semibold text-slate-900",children:"Contact Information"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm font-medium text-slate-600 w-32",children:"Name/Company:"}),i.jsx("span",{className:"text-sm",children:n.name_or_company})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Vo,{className:"w-4 h-4 text-slate-400"}),i.jsx("a",{href:`mailto:${n.email}`,className:"text-sm text-indigo-600 hover:underline",children:n.email})]}),n.phone&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(uM,{className:"w-4 h-4 text-slate-400"}),i.jsx("a",{href:`tel:${n.phone}`,className:"text-sm text-indigo-600 hover:underline",children:n.phone})]})]})]}),i.jsxs("div",{className:"space-y-3 border-b pb-4",children:[i.jsx("h4",{className:"font-semibold text-slate-900",children:"Quiz Information"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm font-medium text-slate-600 w-32",children:"Format:"}),i.jsx("span",{className:"text-sm flex items-center gap-1",children:n.quiz_format==="in-venue"?i.jsxs(i.Fragment,{children:[i.jsx(js,{className:"w-4 h-4"})," In-Venue Quiz"]}):i.jsxs(i.Fragment,{children:[i.jsx(q0,{className:"w-4 h-4"})," Online Quiz"]})})]}),n.quiz_format==="in-venue"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-sm font-medium text-slate-600 w-32",children:"Venue:"}),i.jsx("span",{className:"text-sm",children:n.venue_name})]}),i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-sm font-medium text-slate-600 w-32",children:"Address:"}),i.jsx("span",{className:"text-sm",children:n.venue_address})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm font-medium text-slate-600 w-32",children:"Quiz Type:"}),i.jsx("span",{className:"text-sm capitalize",children:n.quiz_type.replace("-"," ")})]}),n.theme&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm font-medium text-slate-600 w-32",children:"Theme:"}),i.jsx("span",{className:"text-sm",children:n.theme})]}),n.custom_details&&i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-sm font-medium text-slate-600 w-32",children:"Custom Details:"}),i.jsx("span",{className:"text-sm",children:n.custom_details})]})]})]}),i.jsxs("div",{className:"space-y-3 border-b pb-4",children:[i.jsx("h4",{className:"font-semibold text-slate-900",children:"Event Details"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Fn,{className:"w-4 h-4 text-slate-400"}),i.jsx("span",{className:"text-sm",children:Ut(new Date(n.event_date),"EEEE, MMMM d, yyyy")})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(rs,{className:"w-4 h-4 text-slate-400"}),i.jsxs("span",{className:"text-sm",children:["Start Time: ",n.start_time]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Dr,{className:"w-4 h-4 text-slate-400"}),i.jsx("span",{className:"text-sm",children:n.estimated_participants})]})]})]}),n.extra_notes&&i.jsxs("div",{className:"space-y-3 border-b pb-4",children:[i.jsx("h4",{className:"font-semibold text-slate-900",children:"Additional Notes"}),i.jsx("p",{className:"text-sm text-slate-700 whitespace-pre-wrap",children:n.extra_notes})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(me,{htmlFor:"admin-notes",className:"font-semibold text-slate-900",children:"Internal Admin Notes"}),i.jsx(nr,{id:"admin-notes",value:n.admin_notes||"",onChange:w=>r({...n,admin_notes:w.target.value}),placeholder:"Add internal notes about this booking...",rows:4}),i.jsxs(ue,{onClick:g,variant:"outline",size:"sm",children:[i.jsx(Dd,{className:"w-4 h-4 mr-2"}),"Save Notes"]})]}),i.jsxs("div",{className:"space-y-3 pt-4 border-t",children:[i.jsx("h4",{className:"font-semibold text-slate-900",children:"Update Status"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{onClick:()=>m("seen"),variant:"outline",disabled:n.status==="seen",className:"flex-1",children:"Mark as Seen"}),i.jsx(ue,{onClick:()=>
925m("accepted"),className:"flex-1 bg-green-600 hover:bg-green-700",disabled:n.status==="accepted",children:"Accept Booking"}),i.jsx(ue,{onClick:()=>m("declined"),variant:"destructive",disabled:n.status==="declined",className:"flex-1",children:"Decline"})]})]})]}),i.jsx(Fr,{children:i.jsx(ue,{onClick:()=>a(!1),variant:"outline",children:"Close"})})]})})]})}function IQ({onComplete:e,duration:t=4,raffle:n}){const[r,s]=O.useState(n!=null&&n.short_code?`${n.short_code}-XXXXXX`:"XXXXXX");return O.useEffect(()=>{const a=setTimeout(()=>{e()},t*1e3),o=setInterval(()=>{const l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",c=()=>l.charAt(Math.floor(Math.random()*l.length));if(n!=null&&n.short_code){let u="";for(let h=0;h<6;h++)u+=c();s(`${n.short_code}-${u}`)}else{let u="";for(let h=0;h<8;h++)u+=c();s(u)}},50);return()=>{clearTimeout(a),clearInterval(o)}},[e,t]),i.jsxs("div",{className:"fixed inset-0 z-[100] bg-slate-900 flex flex-col items-center justify-center overflow-hidden",children:[i.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_center,_var(--tw-gradient-stops))] from-amber-900/20 via-slate-900 to-slate-900"}),i.jsx("div",{className:"absolute inset-0 overflow-hidden opacity-30",children:[...Array(30)].map((a,o)=>i.jsx(rt.div,{initial:{y:"100vh",x:Math.random()*100+"vw",opacity:0},animate:{y:"-10vh",opacity:[0,1,0]},transition:{duration:1+Math.random()*2,repeat:1/0,ease:"linear",delay:Math.random()*2},className:"absolute w-3 h-3 bg-amber-400/50 rounded-full blur-[1px]"},o))}),i.jsx(rt.div,{initial:{scale:.5,opacity:0},animate:{scale:[.5,1.1,1],opacity:1},transition:{duration:.5},className:"relative z-10",children:i.jsxs("div",{className:"w-64 h-64 rounded-full border-8 border-amber-500/20 flex flex-col items-center justify-center relative bg-slate-900/50 backdrop-blur-sm",children:[i.jsx(rt.div,{animate:{rotate:360},transition:{duration:1.5,repeat:1/0,ease:"linear"},className:"absolute inset-0 rounded-full border-t-8 border-amber-500"}),i.jsx(Jt,{className:"w-20 h-20 text-amber-400 mb-4 animate-pulse"}),i.jsx("div",{className:"font-mono text-4xl font-black text-white tracking-widest shadow-lg",children:r})]})}),i.jsxs(rt.h2,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"text-4xl md:text-6xl font-black text-white mt-12 tracking-wider uppercase text-center px-4 z-10 drop-shadow-2xl",children:["Finding Winner",i.jsx(rt.span,{animate:{opacity:[0,1,0]},transition:{repeat:1/0,duration:1.5},children:"..."})]}),i.jsx(rt.p,{initial:{opacity:0}
925,animate:{opacity:1},transition:{delay:.8},className:"text-amber-400 mt-6 text-2xl font-bold uppercase tracking-[0.5em] z-10",children:"Good Luck!"})]})}function DQ({winner:e,raffle:t,onClose:n,onDrawNext:r,onRedraw:s}){var g;const[a,o]=O.useState("winner");if(!e)return null;const l=t.collection_type==="venue_only"&&t.total_prizes===1&&e.prize_rank===1,c=()=>{window.print()},u=()=>{const w=`WINNER ANNOUNCEMENT
926-------------------
927Raffle: ${t.title}
928Ticket: ${e.ticket_code}
929Prize Rank: #${e.prize_rank}
930Winner: ${e.user_email||"Anonymous"}
931Winner ID: ${e.user_id}
932Date: ${new Date().toLocaleString()}`,v=new Blob([w],{type:"text/plain"}),b=URL.createObjectURL(v),y=document.createElement("a");y.href=b,y.download=`winner_${e.ticket_code}.txt`,document.body.appendChild(y),y.click(),document.body.removeChild(y)},h=`🏆 WINNER ANNOUNCEMENT 🏆
933
934Raffle: ${t.title}
935Winning Ticket: ${e.ticket_code}
936Prize: #${e.prize_rank}
937
938Congratulations!`,d=()=>{window.open(`mailto:?subject=Winner Announcement: ${t.title}&body=${encodeURIComponent(h)}`)},m=()=>{navigator.clipboard.writeText(h),tt.success("Announcement copied to clipboard")};return i.jsxs("div",{className:"fixed inset-0 z-[100] bg-slate-950 flex items-center justify-center p-4",children:[i.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_center,_var(--tw-gradient-stops))] from-indigo-900/40 via-slate-950 to-slate-950"}),i.jsxs(Me,{className:"w-full max-w-4xl bg-slate-900/80 backdrop-blur-xl border-slate-700 text-white shadow-2xl relative overflow-hidden min-h-[600px] flex items-center justify-center",children:[a==="winner"&&i.jsx("div",{className:"absolute inset-0 pointer-events-none overflow-hidden",children:[...Array(50)].map((w,v)=>i.jsx(rt.div,{initial:{y:"-10%",x:Math.random()*100+"%",rotate:0},animate:{y:"110%",rotate:360*(Math.random()>.5?1:-1)},transition:{duration:3+Math.random()*2,repeat:1/0,ease:"linear",delay:Math.random()*2},className:`absolute w-3 h-3 ${["bg-red-500","bg-blue-500","bg-green-500","bg-yellow-500","bg-purple-500"][Math.floor(Math.random()*5)]}`,style:{borderRadius:Math.random()>.5?"50%":"0%"}},v))}),i.jsxs("div",{className:"p-8 md:p-12 flex flex-col items-center text-center relative z-10 w-full",children:[i.jsx(Gs,{mode:"wait",children:a==="winner"?i.jsxs(rt.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"flex flex-col items-center w-full",children:[i.jsx(rt.div,{initial:{scale:0,rotate:-180},animate:{scale:[0,1.2,1],rotate:0},transition:{type:"spring",bounce:.6,duration:.8},className:"w-32 h-32 bg-gradient-to-br from-amber-400 to-amber-600 rounded-full flex items-center justify-center mb-8 shadow-2xl shadow-amber-500/40 ring-4 ring-white/10",children:i.jsx(Jt,{className:"w-16 h-16 text-slate-900 drop-shadow-md"})}),i.jsx(rt.h3,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"text-amber-400 font-bold tracking-widest uppercase mb-2",children:"Congratulations!"}),i.jsx(rt.h1,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.3},className:"text-3xl md:text-5xl font-black text-white mb-8",children:t.title}),i.jsxs(rt.div,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{delay:.4},className:"bg-white text-slate-900 p-8 rounded-2xl w-full max-w-2xl transform rotate-1 shadow-xl border-4 border-amber-400 mb-8",children:[i.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-8",children:[i.jsxs("div",{className:"text-center md:text-left",children:[i.jsx("div",{className:"text-sm font-bold text-slate-400 uppercase tracking-wider mb-1",children:"Winning Ticket"}),i.jsx("div",{className:"text-4xl md:text-6xl font-black text-slate-900 tracking-tight font-mono",children:e.ticket_code})]}),i.jsx("div",{className:"h-px w-full md:w-px md:h-20 bg-slate-200"}),i.jsxs("div",{className:"text-center md:text-right",children:[i.jsx("div",{className:"text-sm font-bold text-slate-400 uppercase tracking-wider mb-1",children:"Prize Rank"}),i.jsxs("div",{className:"text-3xl md:text-4xl font-bold text-indigo-600 flex items-center justify-center md:justify-end gap-2",children:[i.jsx(qee,{className:"w-8 h-8"})," #",e.prize_rank]})]})]}),i.jsxs("div",{className:"mt-8 pt-6 border-t border-slate-100 flex flex-col md:flex-row justify-between items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-slate-100 flex items-center justify-center text-slate-500 font-bold",children:(e.user_email||"A").charAt(0).toUpperCase()}),i.jsxs("div",{className:"text-left",children:[i.jsx("div",{className:"font-bold text-slate-900",children:e.user_email||"Anonymous User"}),i.jsxs("div",{className:"text-xs text-slate-500",children:["Winner ID: ",(g=e.user_id)==null?void 0:g.slice(0,8)]})]})]}),i.jsx("div",{className:"text-slate-400 text-sm font-mono",children:Ut(new Date,"PP pp")})]})]}),i.jsxs(rt.div,{initial:{opacity:0}
938,animate:{opacity:1},transition:{delay:.6},className:"flex gap-2 mb-8",children:[i.jsxs(ue,{variant:"outline",size:"sm",onClick:c,className:"bg-slate-800 border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white print:hidden",children:[i.jsx(jte,{className:"w-4 h-4 mr-2"})," Print"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:u,className:"bg-slate-800 border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white print:hidden",children:[i.jsx(Wy,{className:"w-4 h-4 mr-2"})," Save"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:d,className:"bg-slate-800 border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white print:hidden",children:[i.jsx(Vo,{className:"w-4 h-4 mr-2"})," Email"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:m,className:"bg-slate-800 border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white print:hidden",children:[i.jsx($0,{className:"w-4 h-4 mr-2"})," Copy"]})]})]},"winner-view"):i.jsxs(rt.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"flex flex-col items-center w-full max-w-2xl",children:[i.jsx(rt.div,{initial:{scale:0,rotate:180},animate:{scale:[0,1.2,1],rotate:0},transition:{type:"spring",bounce:.6,duration:.8},className:"w-32 h-32 bg-slate-800 rounded-full flex items-center justify-center mb-8 shadow-2xl ring-4 ring-slate-700",children:i.jsx(zT,{className:"w-16 h-16 text-slate-400"})}),i.jsx(rt.h1,{className:"text-4xl md:text-6xl font-black text-slate-200 mb-4 uppercase tracking-tighter",children:"Hard Luck!"}),i.jsxs(rt.p,{className:"text-xl text-slate-400 mb-12 max-w-lg",children:["Better luck next time to everyone else.",i.jsx("br",{}),"Thank you for playing!"]}),i.jsxs("div",{className:"bg-slate-800/50 p-6 rounded-xl border border-slate-700 w-full mb-8",children:[i.jsx("div",{className:"text-sm text-slate-500 uppercase tracking-widest font-bold mb-2",children:"Winning Ticket Was"}),i.jsx("div",{className:"text-3xl font-mono font-bold text-amber-500",children:e.ticket_code})]})]},"hardluck-view")}),i.jsxs("div",{className:"flex flex-wrap justify-center gap-4 w-full print:hidden mt-auto",children:[i.jsx(ue,{onClick:()=>o(a==="winner"?"hardluck":"winner"),variant:"outline",className:"border-slate-600 text-slate-300 hover:bg-slate-800 min-w-[150px]",children:a==="winner"?i.jsxs(i.Fragment,{children:[i.jsx(Hte,{className:"w-4 h-4 mr-2"})," Show Hard Luck"]}):i.jsxs(i.Fragment,{children:[i.jsx(Jt,{className:"w-4 h-4 mr-2"})," Show Winner"]})}),i.jsx(ue,{onClick:n,className:"bg-slate-700 text-white hover:bg-slate-600 min-w-[120px]",children:"Close"}),l&&i.jsxs(ue,{onClick:()=>{confirm("Are you sure you want to REDRAW? The current winner will be voided and a new winner selected.")&&s(t)},className:"bg-red-600 hover:bg-red-700 text-white font-bold min-w-[150px] border-2 border-red-400 shadow-[0_0_15px_rgba(220,38,38,0.5)] animate-pulse",children:[i.jsx(Ah,{className:"w-4 h-4 mr-2"})," Redraw Winner"]}),r&&i.jsxs(ue,{onClick:r,className:"bg-amber-500 hover:bg-amber-600 text-slate-900 font-bold px-8 min-w-[200px]",children:[i.jsx(Jt,{className:"w-4 h-4 mr-2"})," Draw Next Winner"]})]})]})]})]})}function LQ({settings:e,onClose:t,onAction:n,onPurchaseRequest:r}){const[s,a]=O.useState(null),[o,l]=O.useState(null),c=qi();O.useEffect(()=>{e!=null&&e.promo_event_id?ae.entities.Event.filter({id:e.promo_event_id}).then(d=>{d.length>0&&(a(d[0]),l("event"))}):e!=null&&e.promo_raffle_id&&ae.entities.Raffle.filter({id:e.promo_raffle_id}).then(d=>{d.length>0&&(a(d[0]),l("raffle"))})},[e==null?void 0:e.promo_raffle_id,e==null?void 0:e.promo_event_id]);const u=()=>{s&&(n&&n(),t(),o==="event"?r?setTimeout(()=>r(s),100):c(Ft("UpcomingEvents")+`?buy_event=${s.id}`):c(Ft("RaffleTickets")+`?buy=${s.id}`))};if(!s)return null;const h=o==="event"?s.price>0?`€${s.price}`:"FREE":s.ticket_price===0?"FREE":`€${s.ticket_price}`;return i.jsx(rn,{open:!0,onOpenChange:d=>!d&&t(),children:i.jsxs(en,{className:"max-w-md p-0 border-none bg-transparent shadow-none sm:max-w-md [&>button]:hidden z-[10005]",onInteractOutside:d=>d.preventDefault(),children:[i.jsx(sn,{className:"sr-only",children:s.title}),i.jsxs(Kl,{className:"sr-only",children:["Promotional offer for ",s.title]}),i.jsxs(Me,{className:"overflow-hidden bg-slate-900 border-amber-500/50 border-2 shadow-2xl relative mx-4 sm:mx-0",children:[i.jsx("button",{onClick:t,className:"absolute top-2 right-2 z-20 bg-black/60 hover:bg-black/80 text-white rounded-full p-2 transition-colors active:scale-95","aria-label":"Close promo",children:i.jsx(Si,{className:"w-6 h-6"})}),i.jsxs("div",{className:"relative h-48 bg-slate-800",children:[s.image_url?i.jsx("img",{src:s.image_url,alt:s.title,className:"w-full h-full object-cover"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:i.jsx(Vr,{className:"w-20 h-20 text-amber-500/20"})}),i.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900 via-trans
938parent to-transparent"}),i.jsxs("div",{className:"absolute bottom-4 left-4 right-4",children:[i.jsx("div",{className:"inline-block bg-amber-500 text-slate-900 text-xs font-bold px-2 py-1 rounded mb-2",children:"LIMITED TIME OFFER"}),i.jsx("h2",{className:"text-2xl font-bold text-white leading-tight shadow-sm",children:s.title})]})]}),i.jsxs("div",{className:"p-6 pt-4 space-y-6",children:[i.jsx("p",{className:"text-slate-300 text-sm leading-relaxed",children:s.description||(o==="event"?"Join us for this special event!":"Don't miss your chance to win amazing prizes! Tickets are available now.")}),i.jsxs("div",{className:"flex items-center justify-between bg-slate-800/50 p-3 rounded-lg border border-slate-700",children:[i.jsx("div",{className:"text-slate-400 text-xs uppercase font-semibold",children:o==="event"?"Access Price":"Ticket Price"}),i.jsx("div",{className:"text-2xl font-bold text-amber-400",children:h})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs(ue,{onClick:u,className:"w-full bg-amber-500 hover:bg-amber-600 text-slate-900 font-bold h-12 text-lg shadow-lg shadow-amber-900/20",children:[i.jsx(ej,{className:"w-5 h-5 mr-2"}),o==="event"?"Buy Access Now":"Buy Tickets Now"]}),i.jsx(ue,{variant:"ghost",onClick:t,className:"w-full text-slate-500 hover:text-white hover:bg-slate-800",children:"No thanks, maybe later"})]})]})]})]})})}function y5e({raffle:e,isOpen:t,onClose:n}){const r=mn(),[s,a]=O.useState(""),[o,l]=O.useState(!1),[c,u]=O.useState(null),[h,d]=O.useState(!1),[m,g]=O.useState({ticket_code:"",user_id:"",is_winner:!1,prize_rank:0}),{data:w=[],isLoading:v}=qe({queryKey:["raffleTickets",e==null?void 0:e.id],queryFn:async()=>e!=null&&e.id?(await ae.entities.RaffleTicket.filter({raffle_id:e.id})).sort((R,M)=>R.ticket_code.localeCompare(M.ticket_code)):[],enabled:!!(e!=null&&e.id)&&t}),{data:b=[]}=qe({queryKey:["users"],queryFn:()=>ae.entities.User.list(),enabled:t&&(h||o)}),y=qt({mutationFn:async I=>{const R=b.find(M=>M.id===I.user_id);return ae.entities.RaffleTicket.create({raffle_id:e.id,ticket_code:I.ticket_code,unique_key:`${e.id}_${I.ticket_code}`,user_id:I.user_id,user_email:(R==null?void 0:R.email)||"[email protected]",purchase_date:new Date().toISOString(),is_winner:I.is_winner,prize_rank:I.is_winner?parseInt(I.prize_rank):null})},onSuccess:()=>{r.invalidateQueries(["raffleTickets"]),d(!1),j()},onError:I=>alert("Failed to create ticket: "+I.message)}),_=qt({mutationFn:I=>ae.entities.RaffleTicket.update(c.id,{is_winner:I.is_winner,prize_rank:I.is_winner?parseInt(I.prize_rank):null}),onSuccess:()=>{r.invalidateQueries(["raffleTickets"]),l(!1),u(null),j()},onError:I=>alert("Failed to update ticket: "+I.message)}),N=qt({mutationFn:I=>ae.entities.RaffleTicket.delete(I),onSuccess:()=>r.invalidateQueries(["raffleTickets"])}),j=()=>{g({ticket_code:"",user_id:"",is_winner:!1,prize_rank:0})},S=()=>{const I=Math.random().toString(36).substring(2,8).toUpperCase(),R=e.short_code||"TKT";g({ticket_code:`${R}-${I}`,user_id:"",is_winner:!1,prize_rank:0}),d(!0)},C=I=>{u(I),g({ticket_code:I.ticket_code,user_id:I.user_id,is_winner:I.is_winner,prize_rank:I.prize_rank||0}),l(!0)},P=I=>{confirm("Are you sure you want to delete this ticket?")&&N.mutate(I)},A=I=>{I.preventDefault(),h?y.mutate(m):o&&_.mutate(m)},F=w.filter(I=>I.ticket_code.toLowerCase().includes(s.toLowerCase())||I.user_email&&I.user_email.toLowerCase().includes(s.toLowerCase()));return i.jsx(rn,{open:t,onOpenChange:n,children:i.jsxs(en,{className:"max-w-4xl max-h-[90vh] flex flex-col",children:[i.jsx(vn,{children:i.jsxs(sn,{className:"flex items-center gap-2",children:[i.jsx(Vr,{className:"w-5 h-5 text-indigo-600"}),"Manage Tickets: ",e==null?void 0:e.title]})}),h||o?i.jsxs("div",{className:"p-4 border rounded-lg bg-slate-50 space-y-4",children:[i.jsx("h3",{className:"font-bold text-lg",children:h?"Add New Ticket":"Edit Ticket"}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Ticket Code"}),i.jsx(Ee,{value:m.ticket_code,onChange:I=>g({...m,ticket_code:I.target.value}),disabled:o})]}),i.jsxs("div",{children:[i.jsx(me,{children:"User"}),i.jsxs(Xt,{value:m.user_id,onValueChange:I=>g({...m,user_id:I}),disabled:o,children:[i.jsx(Ht,{children:i.jsx(Zt,{placeholder:"Select User"})}),i.jsx(Kt,{children:b.map(I=>
938i.jsxs(Ie,{value:I.id,children:[I.full_name," (",I.email,")"]},I.id))})]})]}),i.jsxs("div",{className:"flex items-center gap-2 border p-3 rounded bg-white",children:[i.jsx("input",{type:"checkbox",id:"is_winner",checked:m.is_winner,onChange:I=>g({...m,is_winner:I.target.checked}),className:"w-4 h-4"}),i.jsx(me,{htmlFor:"is_winner",className:"cursor-pointer",children:"Mark as Winner"})]}),m.is_winner&&i.jsxs("div",{children:[i.jsx(me,{children:"Prize Rank"}),i.jsx(Ee,{type:"number",value:m.prize_rank,onChange:I=>g({...m,prize_rank:I.target.value})})]})]}),i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(ue,{variant:"outline",onClick:()=>{d(!1),l(!1)},children:"Cancel"}),i.jsxs(ue,{onClick:A,children:[i.jsx(Hy,{className:"w-4 h-4 mr-2"})," Save Ticket"]})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex justify-between items-center gap-4 py-2",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(Ld,{className:"absolute left-2 top-2.5 h-4 w-4 text-slate-400"}),i.jsx(Ee,{placeholder:"Search tickets...",className:"pl-8",value:s,onChange:I=>a(I.target.value)})]}),i.jsxs(ue,{onClick:S,className:"bg-indigo-600 hover:bg-indigo-700",children:[i.jsx(li,{className:"w-4 h-4 mr-2"})," Add Ticket"]})]}),i.jsx("div",{className:"flex-1 overflow-auto border rounded-md",children:i.jsxs(Qo,{children:[i.jsx(Yo,{children:i.jsxs(tr,{children:[i.jsx(ht,{children:"Code"}),i.jsx(ht,{children:"User"}),i.jsx(ht,{children:"Status"}),i.jsx(ht,{children:"Purchased"}),i.jsx(ht,{className:"text-right",children:"Actions"})]})}),i.jsx(Xo,{children:v?i.jsx(tr,{children:i.jsx(it,{colSpan:5,className:"text-center py-8",children:i.jsx(dr,{className:"w-8 h-8 animate-spin mx-auto text-slate-400"})})}):F.length===0?i.jsx(tr,{children:i.jsx(it,{colSpan:5,className:"text-center py-8 text-slate-500",children:"No tickets found."})}):F.map(I=>{var R;return i.jsxs(tr,{children:[i.jsx(it,{className:"font-mono font-bold",children:I.ticket_code}),i.jsx(it,{children:i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"font-medium text-sm",children:I.user_email}),i.jsxs("span",{className:"text-xs text-slate-400",children:[(R=I.user_id)==null?void 0:R.substring(0,8),"..."]})]})}),i.jsx(it,{children:I.is_winner?i.jsxs(nt,{className:"bg-amber-500 hover:bg-amber-600",children:[i.jsx(Jt,{className:"w-3 h-3 mr-1"})," Rank #",I.prize_rank]}):i.jsx(nt,{variant:"outline",children:"Active"})}),i.jsx(it,{className:"text-xs text-slate-500",children:Ut(new Date(I.purchase_date),"MMM d, HH:mm")}),i.jsx(it,{className:"text-right",children:i.jsxs("div",{className:"flex justify-end gap-1",children:[i.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>C(I),children:i.jsx(UT,{className:"w-4 h-4 text-slate-500"})}),i.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>P(I.id),children:i.jsx(ci,{className:"w-4 h-4 text-red-400"})})]})})]},I.id)})})]})})]}),i.jsxs(Fr,{className:"mt-4",children:[i.jsxs("div",{className:"flex-1 text-sm text-slate-500 flex items-center",children:["Total: ",F.length," tickets"]}),i.jsx(ue,{variant:"outline",onClick:n,children:"Close"})]})]})})}var HN="Popover",[FQ]=ja(HN,[K_]),vb=K_(),[b5e,Xd]=FQ(HN),$Q=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!1}=e,l=vb(t),c=O.useRef(null),[u,h]=O.useState(!1),[d,m]=eu({prop:r,defaultProp:s??!1,onChange:a,caller:HN});return i.jsx(BU,{...l,children:i.jsx(b5e,{scope:t,contentId:Gc(),triggerRef:c,open:d,onOpenChange:m,onOpenToggle:O.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:u,onCustomAnchorAdd:O.useCallback(()=>h(!0),[]),onCustomAnchorRemove:O.useCallback(()=>h(!1),[]),modal:o,children:n})})};$Q.displayName=HN;var qQ="PopoverAnchor",w5e=O.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Xd(qQ,n),a=vb(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=s;return O.useEffect(()=>(o(),()=>l()),[o,l]),i.jsx(_4,{...a,...r,ref:t})});w5e.displayName=qQ;var zQ="PopoverTrigger",BQ=O.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Xd(zQ,n),a=vb(n),o=fn(t,s.triggerRef),l=i.jsx(Pt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":KQ(s.open),...r,ref:o,onClick:Et(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:i.jsx(_4,{asChild:!0,...a,children:l})});BQ.displayName=zQ;var m5="PopoverPortal",[j5e,_5e]=FQ(m5,{forceMount:void 0}),UQ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=Xd(m5,t);return i.jsx(j5e,{scope:t,forceMount:n,children:i.jsx(co,{present:n||a.open,children:i.jsx(G_,{asChild:!0,container:s,children:r})})})};UQ.displayName=m5;var Zg="PopoverContent",VQ=O.forwardRef((e,t)=>
vendor: 12,522 bytes, lines 938-945
938{const n=_5e(Zg,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=Xd(Zg,e.__scopePopover);return i.jsx(co,{present:r||a.open,children:a.modal?i.jsx(S5e,{...s,ref:t}):i.jsx(k5e,{...s,ref:t})})});VQ.displayName=Zg;var N5e=Dh("PopoverContent.RemoveScroll"),S5e=O.forwardRef((e,t)=>{const n=Xd(Zg,e.__scopePopover),r=O.useRef(null),s=fn(t,r),a=O.useRef(!1);return O.useEffect(()=>{const o=r.current;if(o)return N4(o)},[]),i.jsx(X_,{as:N5e,allowPinchZoom:!0,children:i.jsx(WQ,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Et(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Et(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Et(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),k5e=O.forwardRef((e,t)=>{const n=Xd(Zg,e.__scopePopover),r=O.useRef(!1),s=O.useRef(!1);return i.jsx(WQ,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),WQ=O.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:h,...d}=e,m=Xd(Zg,n),g=vb(n);return m4(),i.jsx(z_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(q_,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:i.jsx(UU,{"data-state":KQ(m.open),role:"dialog",id:m.contentId,...g,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),HQ="PopoverClose",E5e=O.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Xd(HQ,n);return i.jsx(Pt.button,{type:"button",...r,ref:t,onClick:Et(e.onClick,()=>s.onOpenChange(!1))})});E5e.displayName=HQ;var P5e="PopoverArrow",C5e=O.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=vb(n);return i.jsx(VU,{...s,...r,ref:t})});C5e.displayName=P5e;function KQ(e){return e?"open":"closed"}var A5e=$Q,O5e=BQ,T5e=UQ,GQ=VQ;const R5e=A5e,M5e=O5e,QQ=O.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>i.jsx(T5e,{children:i.jsx(GQ,{ref:s,align:t,sideOffset:n,className:Nt("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));QQ.displayName=GQ.displayName;function S8({onGenerate:e,initialTitle:t}){const[n,r]=O.useState(!1),[s,a]=O.useState(!1),[o,l]=O.useState(""),c=async()=>{a(!0);try{const u=`
939            Write an engaging and appealing description for a raffle.
940            
941            Raffle Title: ${t||"A new exciting raffle"}
942            Additional Details (Prize, Theme, Audience): ${o}
943            
944            The description should be exciting, encourage people to buy tickets, and clearly highlight the value. Keep it concise (1-2 sentences).
945            `,h=await ae.integrations.Core.InvokeLLM({prompt:u,response_json_schema:{type:"object",properties:{description:{type:"string"}}}});h&&h.description&&(e(h.description),r(!1))}catch(u){console.error("AI Generation failed:",u),alert("Failed to generate description. Please try again.")}finally{a(!1)}};return i.jsxs(R5e,{open:n,onOpenChange:r,children:[i.jsx(M5e,{asChild:!0,children:i.jsxs(ue,{variant:"outline",size:"sm",type:"button",className:"gap-2 text-indigo-600 border-indigo-200 hover:bg-indigo-50 h-6 px-2 text-xs",children:[i.jsx(es,{className:"w-3 h-3"})," AI Generate"]})}),i.jsxs(QQ,{className:"w-80 p-4 space-y-4",align:"end",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("h4",{className:"font-semibold flex items-center gap-2 text-sm",children:[i.jsx(es,{className:"w-4 h-4 text-indigo-500"})," Generate Description"]}),i.jsx("p",{className:"text-xs text-slate-500",children:"Enter key details like prizes, theme, or audience to generate a catchy description."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{className:"text-xs",children:"Key Details"}),i.jsx(nr,{placeholder:"e.g. Win a luxury hamper, Christmas theme, for families...",value:o,onChange:u=>l(u.target.value),className:"h-24 text-sm resize-none"})]}),i.jsx(ue,{onClick:c,disabled:s,className:"w-full bg-indigo-600 hover:bg-indigo-700",size:"sm",children:s?i.jsx(dr,{className:"w-4 h-4 animate-spin mr-2"}):"Generate Magic"})]})]})}function I5e(e,t){return O.useReducer((n,r)=>t[n][r]??n,e)}var p5="ScrollArea",[YQ]=ja(p5),[D5e,fo]=YQ(p5),XQ=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:a=600,...o}=e,[l,c]=O.useState(null),[u,h]=O.useState(null),[d,m]=O.useState(null),[g,w]=O.useState(null),[v,b]=O.useState(null),[y,_]=O.useState(0),[N,j]=O.useState(0),[S,C]=O.useState(!1),[P,A]=O.useState(!1),F=fn(t,R=>c(R)),I=Jy(s);return i.jsx(D5e,{scope:n,type:r,dir:I,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:h,content:d,onContentChange:m,scrollbarX:g,onScrollbarXChange:w,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:v,onScrollbarYChange:b,scrollbarYEnabled:P,onScrollbarYEnabledChange:A,onCornerWidthChange:_,onCornerHeightChange:j,children:i.jsx(Pt.div,{dir:I,...o,ref:F,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});XQ.displayName=p5;var ZQ="ScrollAreaViewport",JQ=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...a}=e,o=fo(ZQ,n),l=O.useRef(null),c=fn(t,l,o.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),i.jsx(Pt.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});JQ.displayName=ZQ;var Jl="ScrollAreaScrollbar",g5=O.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=fo(Jl,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=s,l=e.orientation==="horizontal";return O.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),s.type==="hover"?i.jsx(L5e,{...r,ref:t,forceMount:n}):s.type==="scroll"?i.jsx(F5e,{...r,ref:t,forceMount:n}):s.type==="auto"?i.jsx(eY,{...r,ref:t,forceMount:n}):s.type==="always"?i.jsx(v5,{...r,ref:t}):null});g5.displayName=Jl;var L5e=O.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=fo(Jl,e.__scopeScrollArea),[a,o]=O.useState(!1);return O.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},h=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",h)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx(co,{present:n||a,children:i.jsx(eY,{"data-state":a?"visible":"hidden",...r,ref:t})})}),F5e=O.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=fo(Jl,e.__scopeScrollArea),a=e.orientation==="horizontal",o=GN(()=>c("SCROLL_END"),100),[l,c]=I5e("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return O.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,s.scrollHideDelay,c]),O.useEffect(()=>{const u=s.viewport,h=a?"scrollLeft":"scrollTop";if(u){let d=u[h];const m=()=>{const g=u[h];d!==g&&(c("SCROLL"),o()),d=g};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[s.viewport,a,c,o]),i.jsx(co,{present:n||l!=="hidden",children:i.jsx(v5,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Et(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Et(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),eY=O.forwardRef((e,t)=>{const n=fo(Jl,e.__scopeScrollArea),{forceMount:r,...s}=e,[a,o]=O.useState(!1),l=e.orientation==="horizontal",c=GN(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?u:h)}},10);return Jg(n.viewport,c),Jg(n.content,c),i.jsx(co,{present:r||a,children:i.jsx(v5,{"data-state":a?"visible":"hidden",...s,ref:t})})}),v5=O.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=fo(Jl,e.__scopeScrollArea),a=O.useRef(null),o=O.useRef(0),[l,c]=O.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=sY(l.viewport,l.content),h={...r,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:m=>a.current=m,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:m=>o.current=m};function d(m,g){return V5e(m,o.current,l,g)}return n==="horizontal"?i.jsx($5e,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const m=s.viewport.scrollLeft,g=k8(m,l,s.dir);a.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollLeft=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollLeft=d(m,s.dir))}}):n==="vertical"?i.jsx(q5e,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const m=s.viewport.scrollTop,g=k8(m,l);a.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollTop=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollTop=d(m))}}):null}),$5e=O.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,a=fo(Jl,e.__scopeScrollArea),[o,l]=O.useState(),c=O.useRef(null),u=fn(t,c,a.onScrollbarXChange);return O.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(nY,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":KN(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,d)=>{if(a.viewport){const m=a.viewport.scrollLeft+h.deltaX;e.onWheelScroll(m),oY(m,d)&&h.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:k_(o.paddingLeft),paddingEnd:k_(o.paddingRight)}})}})}),q5e=O.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,a=fo(Jl,e.__scopeScrollArea),[o,l]=O.useState(),c=O.useRef(null),u=fn(t,c,a.onScrollbarYChange);return O.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(nY,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":KN(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,d)=>{if(a.viewport){const m=a.viewport.scrollTop+h.deltaY;e.onWheelScroll(m),oY(m,d)&&h.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:
vendor: 6,179 bytes, lines 945-950
945a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:k_(o.paddingTop),paddingEnd:k_(o.paddingBottom)}})}})}),[z5e,tY]=YQ(Jl),nY=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:h,onResize:d,...m}=e,g=fo(Jl,n),[w,v]=O.useState(null),b=fn(t,F=>v(F)),y=O.useRef(null),_=O.useRef(""),N=g.viewport,j=r.content-r.viewport,S=Ji(h),C=Ji(c),P=GN(d,10);function A(F){if(y.current){const I=F.clientX-y.current.left,R=F.clientY-y.current.top;u({x:I,y:R})}}return O.useEffect(()=>{const F=I=>{const R=I.target;(w==null?void 0:w.contains(R))&&S(I,j)};return document.addEventListener("wheel",F,{passive:!1}),()=>document.removeEventListener("wheel",F,{passive:!1})},[N,w,j,S]),O.useEffect(C,[r,C]),Jg(w,P),Jg(g.content,P),i.jsx(z5e,{scope:n,scrollbar:w,hasThumb:s,onThumbChange:Ji(a),onThumbPointerUp:Ji(o),onThumbPositionChange:C,onThumbPointerDown:Ji(l),children:i.jsx(Pt.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:Et(e.onPointerDown,F=>{F.button===0&&(F.target.setPointerCapture(F.pointerId),y.current=w.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),A(F))}),onPointerMove:Et(e.onPointerMove,A),onPointerUp:Et(e.onPointerUp,F=>{const I=F.target;I.hasPointerCapture(F.pointerId)&&I.releasePointerCapture(F.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),y.current=null})})})}),S_="ScrollAreaThumb",rY=O.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=tY(S_,e.__scopeScrollArea);return i.jsx(co,{present:n||s.hasThumb,children:i.jsx(B5e,{ref:t,...r})})}),B5e=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,a=fo(S_,n),o=tY(S_,n),{onThumbPositionChange:l}=o,c=fn(t,d=>o.onThumbChange(d)),u=O.useRef(void 0),h=GN(()=>{u.current&&(u.current(),u.current=void 0)},100);return O.useEffect(()=>{const d=a.viewport;if(d){const m=()=>{if(h(),!u.current){const g=W5e(d,l);u.current=g,l()}};return l(),d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[a.viewport,h,l]),i.jsx(Pt.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Et(e.onPointerDownCapture,d=>{const g=d.target.getBoundingClientRect(),w=d.clientX-g.left,v=d.clientY-g.top;o.onThumbPointerDown({x:w,y:v})}),onPointerUp:Et(e.onPointerUp,o.onThumbPointerUp)})});rY.displayName=S_;var x5="ScrollAreaCorner",iY=O.forwardRef((e,t)=>{const n=fo(x5,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(U5e,{...e,ref:t}):null});iY.displayName=x5;var U5e=O.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=fo(x5,n),[a,o]=O.useState(0),[l,c]=O.useState(0),u=!!(a&&l);return Jg(s.scrollbarX,()=>{var d;const h=((d=s.scrollbarX)==null?void 0:d.offsetHeight)||0;s.onCornerHeightChange(h),c(h)}),Jg(s.scrollbarY,()=>{var d;const h=((d=s.scrollbarY)==null?void 0:d.offsetWidth)||0;s.onCornerWidthChange(h),o(h)}),u?i.jsx(Pt.div,{...r,ref:t,style:{width:a,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function k_(e){return e?parseInt(e,10):0}function sY(e,t){const n=e/t;return isNaN(n)?0:n}function KN(e){const t=sY(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function V5e(e,t,n,r="ltr"){const s=KN(n),a=s/2,o=t||a,l=s-o,c=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,d=r==="ltr"?[0,h]:[h*-1,0];return aY([c,u],d)(e)}function k8(e,t,n="ltr"){const r=KN(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-s,o=t.content-t.viewport,l=a-r,c=n==="ltr"?[0,o]:[o*-1,0],u=K0(e,c);return aY([0,o],[0,l])(u)}function aY(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function oY(e,t){return e>0&&e<t}var W5e=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function s(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,l=n.top!==a.top;(o||l)&&t(),n=a,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function GN(e,t){const n=Ji(e),r=O.useRef(0);return O.useEffect(()=>()=>window.clearTimeout(r.current),[]),O.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Jg(e,t){const n=Ji(t);Gr(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var lY=XQ,H5e=JQ,K5e=iY;const cY=O.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(lY,{ref:r,className:Nt("relative overflow-hidden",e),...n,children:[i.jsx(H5e,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(uY,{}),i.jsx(K5e,{})]}));cY.displayName=lY.displayName;const uY=O.forwardRef(({className:e,orientation:t="vertical",...n},r)=>i.jsx(g5,{ref:r,orientation:t,className:Nt("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:i.jsx(rY,{className:"relative flex-1 rounded-full bg-border"})}));uY.displayName=g5.displayName;function G5e({raffles:e,tickets:t}){var u;const[n,r]=O.useState(!1),[s,a]=O.useState(!1),[o,l]=O.useState(null),c=async()=>{a(!0);try{const h=e.map(g=>{const w=t.filter(_=>_.raffle_id===g.id),v=w.length,b=new Set(w.map(_=>_.user_id)).size,y=v*g.ticket_price;return{title:g.title,status:g.status,price:g.ticket_price,prizes:g.total_prizes,sold:v,revenue:y,uniqueUsers:b,created:g.created_date}}),d=`
946            Analyze this raffle data and provide advanced insights in JSON format.
947            Data: ${JSON.stringify(h)}
948
949            Provide:
950            1. "sales_predictions": Prediction text for active raffles (max 2 sentences).
951            2. "pricing_suggestions": Suggestions for optimal pricing based on revenue/volume (max 2 sentences).
952            3. "engagement_patterns": Analysis of user participation (max 2 sentences).
953            4. "key_trends": 3 bullet points of interesting trends found.
954            `,m=await ae.integrations.Core.InvokeLLM({prompt:d,response_json_schema:{type:"object",properties:{sales_predictions:{type:"string"},pricing_suggestions:{type:"string"},engagement_patterns:{type:"string"},key_trends:{type:"array",items:{type:"string"}}}}});l(m)}catch(h){console.error("AI Analysis failed:",h),alert("Failed to generate insights. Please try again.")}finally{a(!1)}};return i.jsxs(rn,{open:n,onOpenChange:r,children:[i.jsx(bg,{asChild:!0,children:i.jsxs(ue,{variant:"outline",className:"gap-2 border-indigo-200 text-indigo-700 bg-indigo-50 hover:bg-indigo-100",children:[i.jsx(es,{className:"w-4 h-4"})," AI Insights"]})}),i.jsxs(en,{className:"max-w-4xl max-h-[80vh] flex flex-col bg-slate-50",children:[i.jsx(vn,{children:i.jsxs(sn,{className:"flex items-center gap-2 text-indigo-700 text-xl",children:[i.jsx(es,{className:"w-6 h-6"})," AI Raffle Intelligence"]})}),i.jsx(cY,{className:"flex-1 pr-4",children:o?i.jsxs("div",{className:"space-y-8 py-4",children:[i.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[i.jsxs(Me,{className:"bg-white border-indigo-100 shadow-sm hover:shadow-md transition-shadow",children:[i.jsx(st,{className:"p-5 pb-2",children:i.jsxs(at,{className:"text-base font-bold text-indigo-700 flex items-center gap-2",children:[i.jsx(ro,{className:"w-4 h-4"})," Sales Predictions"]})}),i.jsx(Fe,{className:"p-5 pt-2 text-sm text-slate-600 leading-relaxed",children:o.sales_predictions})]}),i.jsxs(Me,{className:"bg-white border-emerald-100 shadow-sm hover:shadow-md transition-shadow",children:[i.jsx(st,{className:"p-5 pb-2",children:i.jsxs(at,{className:"text-base font-bold text-emerald-700 flex items-center gap-2",children:[i.jsx(O_,{className:"w-4 h-4"})," Pricing Strategy"]})}),i.jsx(Fe,{className:"p-5 pt-2 text-sm text-slate-600 leading-relaxed",children:o.pricing_suggestions})]}),i.jsxs(Me,{className:"bg-white border-purple-100 shadow-sm hover:shadow-md transition-shadow",children:[i.jsx(st,{className:"p-5 pb-2",children:i.jsxs(at,{className:"text-base font-bold text-purple-700 flex items-center gap-2",children:[i.jsx(Dr,{className:"w-4 h-4"})," Engagement"]})}),i.jsx(Fe,{className:"p-5 pt-2 text-sm text-slate-600 leading-relaxed",children:o.engagement_patterns})]})]}),i.jsxs("div",{className:"bg-white rounded-xl p-6 border border-slate-200 shadow-sm",children:[i.jsxs("h4",{className:"font-bold text-lg text-slate-900 mb-4 flex items-center gap-2",children:[i.jsx(es,{className:"w-4 h-4 text-amber-500"})," Key Trends Identified"]}),i.jsx("ul",{className:"grid gap-3 md:grid-cols-1",children:(u=o.key_trends)==null?void 0:u.map((h,d)=>i.jsxs("li",{className:"flex items-start gap-3 text-slate-700 p-3 rounded-lg bg-slate-50 border border-slate-100",children:[i.jsx("span",{className:"mt-1.5 block w-2 h-2 rounded-full bg-indigo-500 shrink-0"}),i.jsx("span",{className:"text-sm font-medium",children:h})]},d))})]}),i.jsx("div",{className:"flex justify-end pt-2",children:i.jsxs(ue,{variant:"ghost",onClick:c,disabled:s,className:"text-slate-500 hover:text-slate-900",children:[i.jsx(Ah,{className:`w-4 h-4 mr-2 ${s?"animate-spin":""}`})," Refresh Analysis"]})})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center space-y-6",children:[i.jsx("div",{className:"p-6 bg-white rounded-full shadow-sm border border-indigo-100",children:i.jsx(ro,{className:"w-10 h-10 text-indigo-500"})}),i.jsxs("div",{className:"space-y-2 max-w-md",children:[i.jsx("h3",{className:"font-semibold text-xl text-slate-900",children:"Generate Advanced Analytics"}),i.jsx("p",{className:"text-slate-500",children:"Unlock predictive insights, optimize your pricing strategy, and understand your audience better with AI-powered analysis of your raffle data."})]}),i.jsxs(ue,{onClick:c,disabled:s,className:"bg-indigo-600 hover:bg-indigo-700 px-8 h-12 text-base shadow-lg shadow-indigo-200",children:[s?i.jsx(dr,{className:"w-5 h-5 animate-spin mr-2"}):i.jsx(es,{className:"w-5 h-5 mr-2"}),s?"Analyzing Data...":"Generate Insights"]})]})})]})]})}function Q5e({raffle:e,stats:t}){const[n,r]=O.useState("social"),[s,a]=O.useState(!1),[o,l]=O.useState({social:"",email:"",strategy:""}),[c,u]=O.useState(!1),h=async()=>{var m;a(!0);try{const g=n;let w=`Context: I am running a raffle titled "${e.title}".
955Details:
956- Prize Description: ${e.description}
957- Ticket Price: ${e.ticket_price===0?"FREE":"€"+e.ticket_price}
958- Draw Date: ${e.draw_date?new Date(e.draw_date).toLocaleString():"Coming Soon"}
959- Current Performance: ${(t==null?void 0:t.count)||0} tickets sold so far, generating €${((m=t==null?void 0:t.revenue)==null?void 0:m.toFixed(2))||0}.
960
961Task: `;g==="social"?w+="Write 3 distinct, engaging social media posts (1 for Twitter/X with hashtags, 1 for Facebook with more detail, 1 for Instagram focusing on visual/excitement). Use emojis to make it pop. Focus on the prize and urgency.":g==="email"?w+=`Write a high-converting email marketing campaign. Include:
9621. A catchy, high-open-rate Subject Line.
9632. A persuasive Email Body that highlights the value of the prize, creates a sense of urgency, and includes a clear Call to Action (CTA) to buy tickets.`:g==="strategy"&&(w+="Analyze the current situation and suggest 3 specific, actionable marketing strategies to boost ticket sales right now. Suggest optimal times to post and specific angles to target based on the prize type and price point.");const v=await ae.integrations.Core.InvokeLLM({prompt:w});l(b=>({...b,[g]:v}))}catch(g){console.error(g)}finally{a(!1)}},d=m=>{navigator.clipboard.writeText(m),u(!0),setTimeout(()=>u(!1),2e3)};return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-slate-50 p-3 rounded-lg border text-sm text-slate-600 mb-4",children:[i.jsx("h4",{className:"font-semibold text-slate-900 mb-1",children:e.title}),i.jsxs("p",{children:["Generating content for this ",e.status," raffle."]})]}),i.jsxs(tu,{value:n,onValueChange:r,className:"w-full",children:[i.jsxs(Wl,{className:"grid w-full grid-cols-3",children:[i.jsxs(Wt,{value:"social",children:[i.jsx(Ho,{className:"w-4 h-4 mr-2"})," Social Media"]}),i.jsxs(Wt,{value:"email",children:[i.jsx(Vo,{className:"w-4 h-4 mr-2"})," Email Copy"]}),i.jsxs(Wt,{value:"strategy",children:[i.jsx(ro,{className:"w-4 h-4 mr-2"})," Strategy"]})]}),i.jsx("div",{className:"mt-4 min-h-[350px]",children:s?i.jsxs("div",{className:"flex flex-col items-center justify-center h-80 space-y-4 border rounded-lg bg-slate-50/50",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 bg-indigo-100 rounded-full animate-ping opacity-25"}),i.jsx(dr,{className:"relative w-10 h-10 animate-spin text-indigo-600"})]}),i.jsx("p",{className:"text-sm font-medium text-slate-600 animate-pulse",children:"AI is crafting your content..."})]}):i.jsx(i.Fragment,{children:o[n]?i.jsxs("div",{className:"space-y-4 animate-in fade-in slide-in-from-bottom-2 duration-500",children:[i.jsxs("div",{className:"relative group",children:[i.jsx(nr,{value:o[n],onChange:m=>l(g=>({...g,[n]:m.target.value})),className:"min-h-[320px] p-4 font-mono text-sm bg-white border-slate-200 focus:ring-indigo-500 resize-none leading-relaxed"}),i.jsx("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity bg-white/80 backdrop-blur rounded-md p-1",children:i.jsx(ue,{size:"sm",variant:"ghost",onClick:()=>d(o[n]),title:"Copy to clipboard",className:"h-8 w-8 p-0",children:c?i.jsx(Id,{className:"w-4 h-4 text-green-600"}):i.jsx($0,{className:"w-4 h-4 text-slate-600"})})})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsxs(ue,{onClick:h,variant:"outline",className:"flex-1 border-slate-200 hover:bg-slate-50 hover:text-indigo-600",children:[i.jsx(Ah,{className:"w-4 h-4 mr-2"})," Regenerate"]}),i.jsxs(ue,{onClick:()=>d(o[n]),className:"flex-1 bg-indigo-600 hover:bg-indigo-700",children:[c?i.jsx(Id,{className:"w-4 h-4 mr-2"}):i.jsx($0,{className:"w-4 h-4 mr-2"}),c?"Copied!":"Copy Text"]})]})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center h-80 text-center space-y-5 bg-white rounded-lg border-2 border-dashed border-slate-200 hover:border-indigo-200 transition-colors p-6",children:[i.jsx("div",{className:"w-16 h-16 bg-indigo-50 rounded-full flex items-center justify-center",children:i.jsx(es,{className:"w-8 h-8 text-indigo-500"})}),i.jsxs("div",{className:"space-y-2 max-w-sm",children:[i.jsx("h3",{className:"font-semibold text-lg text-slate-900",children:"Generate AI Promotions"}),i.jsxs("p",{className:"text-sm text-slate-500",children:["Instantly create tailored ",n==="social"?"social posts":n==="email"?"email campaigns":"marketing strategies"," for this raffle."]})]}),i.jsxs(ue,{onClick:h,size:"lg",className:"bg-indigo-600 hover:bg-indigo-700 shadow-lg shadow-indigo-200",children:[i.jsx(es,{className:"w-4 h-4 mr-2"})," Generate Content"]})]})})})]})]})}function Y5e(){var F;mn();const[e,t]=O.useState(null),[n,r]=O.useState(0),[s,a]=O.useState(!1),[o,l]=O.useState(null),[c,u]=O.useState(!1),[h,d]=O.useState(!1),[m,g]=O.useState(!1),[w,v]=O.useState("0"),{data:b=[]}=qe({queryKey:["raffles"],queryFn:()=>ae.entities.Raffle.list()}),y=b.filter(I=>I.status==="active"&&I.type==="take_your_pick"),_=async()=>{a(!0);try{const I=await ae.functions.invoke("takeYourPick",{action:"get_state"});I.data&&(t(I.data.state),r(I.data.currentRaffleSales||0))}catch(I){console.error(I)}finally{a(!1)}};O.useEffect(()=>{_()},[]);const N=qt({mutationFn:I=>ae.functions.invoke("takeYourPick",{action:"update_jackpot",amount:I}),onSuccess:()=>_()}),j=qt({mutationFn:I=>ae.functions.invoke("takeYourPick",{action:"set_active_raffle",raffleId:I}),onSuccess:()=>_()}),S=qt({mutationFn:I=>ae.functions.invoke("takeYourPick",{action:"envelope_picked",...I}),onSuccess:()=>{u(!1),_()}}),C=qt({mutationFn:I=>ae.functions.invoke("takeYourPick",{action:"reset_game",...I}),onSuccess:()=>{g(!1),_()}}),P=qt({mutationFn:I=>ae.functions.invoke("takeYourPick",{action:"toggle_enabled",enabled:I}),onSuccess:()=>_()}),A=()=>{if(!e)return;const I=(e.current_jackpot||0)+n;confirm(`Update Jackpot to €${I.toFixed(2)} (Base €${e.current_jackpot} + Sales €${n})?`)&&N.mutate(I)};return e?i.jsxs("div",{className:"space-y-6",children:[i.jsxs(Me,{className:"border-purple-200 bg-purple-50",children:[i.jsx(st,{children:i.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx(at,{className:"text-2xl text-purple-900",children:"Take Your Pick - Jackpot Control"}),i.jsx("p",{className:"text-purple-600",children:"Manage the weekly jackpot game"})]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs(ue,{variant:e.enabled?"default":"outline",size:"sm",onClick:()=>P.mutate(!e.enabled),className:e.enabled?"bg-green-600 hover:bg-green-700 text-white":"border-slate-300 text-slate-600 hover:bg-slate-100",children:[i.jsx(aB,{className:"w-4 h-4 mr-2"}),e.enabled?"Enabled":"Disabled"]}),i.jsxs("div",{className:"text-right",children:[i.jsxs("div",{className:"text-3xl font-black text-purple-800",children:["€",(F=e.current_jackpot)==null?void 0:F.toFixed(2)]}),i.jsx("div",{className:"text-xs text-purple-600 uppercase font-bold tracking-wider",children:"Current Jackpot"})]})]})]})}),i.jsxs(Fe,{className:"space-y-6",children:[i.jsxs("div",{className:"bg-white p-4 rounded-lg border shadow-sm",children:[i.jsx(me,{className:"mb-2 block",children:"Linked Weekly Raffle"}),i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsxs(Xt,{value:e.active_raffle_id||"",onValueChange:I=>j.mutate(I),children:[i.jsx(Ht,{className:"w-[300px]",children:i.jsx(Zt,{placeholder:"Select Active Raffle..."})}),i.jsxs(Kt,{children:[y.map(I=>i.jsxs(Ie,{value:I.id,children:[I.title," (€",I.ticket_price,")"]},I.id)),y.length===0&&i.jsx(Ie,{value:"none",disabled:!0,children:"No active 'Take Your Pick' raffles"})]})]}),i.jsx(ue,{variant:"outline",onClick:_,title:"Refresh",children:i.jsx(Ah,{className:"w-4 h-4"})})]}),e.active_raffle_id&&i.jsxs("div",{className:"mt-2 flex items-center gap-4 text-sm",children:[i.jsxs("div",{className:"bg-green-50 text-green-700 px-3 py-1 rounded-md border border-green-100",children:[i.jsx("strong",{children:"Current Week Sales:"})," €",n.toFixed(2)]}),i.jsxs(ue,{size:"sm",variant:"secondary",onClick:A,className:"h-8",children:[i.jsx(O_,{className:"w-3 h-3 mr-1"})," Add Sales to Jackpot"]})]})]}),i.jsxs("div",{children:[i.jsxs(me,{className:"mb-3 block text-lg font-semibold",children:["Envelopes (",e.envelopes.filter(I=>I.status==="available").length," Remaining)"]}
963),i.jsx("div",{className:"grid grid-cols-5 gap-4",children:e.envelopes.sort((I,R)=>I.id-R.id).map(I=>i.jsxs("button",{disabled:I.status!=="available"||e.status==="won",onClick:()=>{l(I),d(!1),u(!0)},className:`
964                                        relative aspect-[3/4] rounded-lg border-2 flex flex-col items-center justify-center p-2 transition-all
965                                        ${I.status==="available"?"bg-white border-slate-200 hover:border-purple-500 hover:shadow-md cursor-pointer hover:scale-105":I.result==="jackpot"?"bg-yellow-100 border-yellow-400":"bg-slate-100 border-slate-200 opacity-60 cursor-not-allowed"}
966                                    `,children:[i.jsx("div",{className:`text-3xl font-black mb-2 ${I.status==="available"?"text-purple-900":"text-slate-400"}`,children:I.id}),I.status==="available"?i.jsx(sB,{className:"w-8 h-8 text-purple-200"}):I.result==="jackpot"?i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-2xl",children:"🏆"}),i.jsx("div",{className:"text-xs font-bold text-yellow-700 mt-1",children:"JACKPOT"})]}):i.jsxs("div",{className:"text-center",children:[i.jsx(ya,{className:"w-8 h-8 text-slate-400"}),i.jsx("div",{className:"text-xs font-bold text-slate-500 mt-1",children:"GONE"})]})]},I.id))})]}),i.jsxs("div",{className:"pt-4 border-t flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-sm font-medium text-slate-500",children:"Game Status"}),i.jsx(nt,{variant:e.status==="active"?"default":"success",className:e.status==="active"?"bg-green-600":"bg-yellow-500",children:e.status.toUpperCase()})]}),i.jsxs(ue,{variant:"destructive",onClick:()=>g(!0),className:"w-full sm:w-auto",children:[i.jsx(Ah,{className:"w-4 h-4 mr-2"})," Reset Game"]})]})]})]}),i.jsx(rn,{open:c,onOpenChange:u,children:i.jsxs(en,{children:[i.jsx(vn,{children:i.jsxs(sn,{children:["Open Envelope #",o==null?void 0:o.id]})}),i.jsxs("div",{className:"py-4",children:[i.jsxs("p",{className:"mb-4 text-slate-600",children:["Confirm the result of opening Envelope #",o==null?void 0:o.id,". If this is the Jackpot, the game will end!"]}),i.jsxs("div",{className:"flex gap-4 justify-center",children:[i.jsxs("button",{onClick:()=>d(!1),className:`p-4 rounded-xl border-2 w-32 text-center transition-all ${h?"border-slate-200 hover:bg-slate-50":"border-slate-500 bg-slate-100 ring-2 ring-slate-300"}`,children:[i.jsx(ya,{className:"w-8 h-8 mx-auto mb-2 text-slate-500"}),i.jsx("div",{className:"font-bold text-slate-700",children:"Empty / Booby"})]}),i.jsxs("button",{onClick:()=>d(!0),className:`p-4 rounded-xl border-2 w-32 text-center transition-all ${h?"border-yellow-500 bg-yellow-50 ring-2 ring-yellow-300":"border-slate-200 hover:bg-yellow-50"}`,children:[i.jsx(X5e,{className:"w-8 h-8 mx-auto mb-2 text-yellow-500"}),i.jsx("div",{className:"font-bold text-yellow-700",children:"JACKPOT!"})]})]})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),i.jsx(ue,{onClick:()=>S.mutate({envelopeId:o.id,isJackpot:h}),className:h?"bg-yellow-600 hover:bg-yellow-700 text-white":"",children:"Confirm Result"})]})]})}),i.jsx(rn,{open:m,onOpenChange:g,children:i.jsxs(en,{children:[i.jsx(vn,{children:i.jsx(sn,{children:'Reset "Take Your Pick"'})}),i.jsxs("div",{className:"py-4 space-y-4",children:[i.jsx("p",{className:"text-red-600 font-semibold",children:"Warning: This will reset the game state, clear all opened envelopes, and set the jackpot to the start amount."}),i.jsxs("div",{children:[i.jsx(me,{children:"Starting Jackpot (€)"}),i.jsx(Ee,{type:"number",value:w,onChange:I=>v(I.target.value)})]})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),i.jsx(ue,{variant:"destructive",onClick:()=>C.mutate({startJackpot:parseFloat(w)}),children:"Reset Game"})]})]})})]}):i.jsxs("div",{className:"p-4",children:[i.jsx(dr,{className:"animate-spin"})," Loading Game State..."]})}function X5e(e){return i.jsxs("svg",{...e,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",children:[i.jsx("path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6"}),i.jsx("path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18"}),i.jsx("path",{d:"M4 22h16"}),i.jsx("path",{d:"M10 14.66V17"}),i.jsx("path",{d:"M14 14.66V17"}),i.jsx("path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z"})]})}function Z5e({raffle:e,onClose:t}){const[n,r]=O.useState(e.pricing_tiers||[]),[s,a]=O.useState(e.bonus_rules||[]),[o,l]=O.useState(e.schedule_config||{}),[c,u]=O.useState(e.winning_config||{method:"random",options:["","","",""]}),h=mn(),d=qt({mutationFn:N=>ae.entities.Raffle.update(e.id,N),onSuccess:()=>{h.invalidateQueries({queryKey:["raffles"]}),t&&t()}}),m=()=>{d.mutate({pricing_tiers:n,bonus_rules:s,schedule_config:o,winning_config:c}
966)},g=()=>{r([...n,{name:"",min_tickets:2,price_per_ticket:e.ticket_price*.9,valid_from:"",valid_until:""}])},w=N=>{r(n.filter((j,S)=>S!==N))},v=(N,j,S)=>{const C=[...n];C[N]={...C[N],[j]:S},r(C)},b=()=>{a([...s,{trigger:"share_whatsapp",tickets_rewarded:1}])},y=N=>{a(s.filter((j,S)=>S!==N))},_=(N,j,S)=>{const C=[...s];C[N]={...C[N],[j]:S},a(C)};return i.jsxs("div",{className:"max-h-[80vh] overflow-y-auto p-1",children:[i.jsxs(tu,{defaultValue:"pricing",className:"w-full",children:[i.jsxs(Wl,{className:"w-full grid grid-cols-4",children:[i.jsx(Wt,{value:"pricing",children:"Pricing"}),i.jsx(Wt,{value:"bonus",children:"Bonus"}),i.jsx(Wt,{value:"schedule",children:"Schedule"}),i.jsx(Wt,{value:"winning",children:"Winning"})]}),i.jsxs(Yt,{value:"pricing",className:"space-y-4 mt-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold",children:"Tiered Pricing & Discounts"}),i.jsx("p",{className:"text-sm text-slate-500",children:"Set discounts for bulk purchases or time-limited offers."})]}),i.jsxs(ue,{onClick:g,size:"sm",variant:"outline",children:[i.jsx(li,{className:"w-4 h-4 mr-2"})," Add Tier"]})]}),n.length===0&&i.jsxs("div",{className:"text-center p-8 border border-dashed rounded-lg text-slate-400",children:["No pricing rules configured. Standard price (€",e.ticket_price,") applies."]}),n.map((N,j)=>i.jsx(Me,{children:i.jsxs(Fe,{className:"p-4 space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-start",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-3 w-full mr-4",children:[i.jsxs("div",{children:[i.jsx(me,{className:"text-xs",children:"Tier Name"}),i.jsx(Ee,{value:N.name,onChange:S=>v(j,"name",S.target.value),placeholder:"e.g. Bulk Deal"})]}),i.jsxs("div",{children:[i.jsx(me,{className:"text-xs",children:"Min. Tickets"}),i.jsx(Ee,{type:"number",min:"2",value:N.min_tickets,onChange:S=>v(j,"min_tickets",parseInt(S.target.value))})]}),i.jsxs("div",{children:[i.jsx(me,{className:"text-xs",children:"Price Per Ticket (€)"}),i.jsx(Ee,{type:"number",step:"0.01",value:N.price_per_ticket,onChange:S=>v(j,"price_per_ticket",parseFloat(S.target.value))})]}),i.jsx("div",{className:"flex flex-col justify-end pb-2",children:i.jsxs("p",{className:"text-xs text-green-600 font-medium",children:["Bundle: €",(N.price_per_ticket*N.min_tickets).toFixed(2),i.jsxs("span",{className:"text-slate-400 ml-2 line-through",children:["€",(e.ticket_price*N.min_tickets).toFixed(2)]})]})})]}),i.jsx(ue,{size:"icon",variant:"ghost",className:"text-red-500 h-8 w-8 shrink-0",onClick:()=>w(j),children:i.jsx(ci,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 pt-2 border-t",children:[i.jsxs("div",{children:[i.jsx(me,{className:"text-xs text-slate-500",children:"Valid From (Optional)"}),i.jsx(Ee,{type:"datetime-local",value:N.valid_from?new Date(N.valid_from).toISOString().slice(0,16):"",onChange:S=>v(j,"valid_from",S.target.value?new Date(S.target.value).toISOString():""),className:"h-8 text-xs"})]}),i.jsxs("div",{children:[i.jsx(me,{className:"text-xs text-slate-500",children:"Valid Until (Optional)"}),i.jsx(Ee,{type:"datetime-local",value:N.valid_until?new Date(N.valid_until).toISOString().slice(0,16):"",onChange:S=>v(j,"valid_until",S.target.value?new Date(S.target.value).toISOString():""),className:"h-8 text-xs"})]})]})]})},j))]}),i.jsxs(Yt,{value:"bonus",className:"space-y-4 mt-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold",children:"Bonus Tickets"}),i.jsx("p",{className:"text-sm text-slate-500",children:"Reward users for specific actions."})]}),i.jsxs(ue,{onClick:b,size:"sm",variant:"outline",children:[i.jsx(li,{className:"w-4 h-4 mr-2"})," Add Rule"]})]}),s.length===0&&i.jsx("div",{className:"text-center p-8 border border-dashed rounded-lg text-slate-400",children:"No bonus rules active."}),s.map((N,j)=>i.jsxs(Me,{className:"p-4 flex justify-between items-center gap-4",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx(me,{className:"text-xs",children:"Action Trigger"}),i.jsxs(Xt,{value:N.trigger,onValueChange:S=>_(j,"trigger",S),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"share_whatsapp",children:"Share on WhatsApp"}),i.jsx(Ie,{value:"share_facebook",children:"Share on Facebook"}),i.jsx(Ie,{value:"share_twitter",children:"Share on Twitter"})]})]})]}),i.jsxs("div",{className:"w-32",children:[i.jsx(me,{className:"text-xs",children:"Free Tickets"}),i.jsx(Ee,{type:"number",min:"1",value:N.tickets_rewarded,onChange:S=>_(j,"tickets_rewarded",parseInt(S.target.value))})]}),i.jsx(ue,{size:"icon",variant:"ghost",className:"text-red-500 mt-5",onClick:()=>y(j),children:i.jsx(ci,{className:"w-4 h-4"})})]},j))]}
966),i.jsx(Yt,{value:"schedule",className:"space-y-4 mt-4",children:i.jsxs(Me,{children:[i.jsxs(st,{children:[i.jsxs(at,{className:"text-base flex items-center gap-2",children:[i.jsx(rs,{className:"w-4 h-4"})," Scheduled Pause"]}),i.jsx(Ja,{children:"Automatically pause and restart ticket sales."})]}),i.jsxs(Fe,{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Pause Sales At"}),i.jsx(Ee,{type:"datetime-local",value:o.pause_start?new Date(o.pause_start).toISOString().slice(0,16):"",onChange:N=>l({...o,pause_start:N.target.value?new Date(N.target.value).toISOString():""})})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Resume Sales At"}),i.jsx(Ee,{type:"datetime-local",value:o.pause_end?new Date(o.pause_end).toISOString().slice(0,16):"",onChange:N=>l({...o,pause_end:N.target.value?new Date(N.target.value).toISOString():""})})]})]}),i.jsxs("div",{className:"flex items-center space-x-2 pt-2",children:[i.jsx(ai,{id:"auto-restart",checked:o.auto_restart||!1,onCheckedChange:N=>l({...o,auto_restart:N})}),i.jsx(me,{htmlFor:"auto-restart",children:"Auto-restart raffle after pause ends"})]})]})]})}),i.jsx(Yt,{value:"winning",className:"space-y-4 mt-4",children:i.jsxs(Me,{children:[i.jsxs(st,{children:[i.jsxs(at,{className:"text-base flex items-center gap-2",children:[i.jsx(tB,{className:"w-4 h-4"})," Winning Criteria"]}),i.jsx(Ja,{children:"Define how the winner is determined."})]}),i.jsxs(Fe,{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Method"}),i.jsxs(Xt,{value:c.method||"random",onValueChange:N=>u({...c,method:N}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"random",children:"Random Draw (Standard)"}),i.jsx(Ie,{value:"skill_question",children:"Skill-Based Question"})]})]})]}),c.method==="skill_question"&&i.jsxs("div",{className:"space-y-4 border-l-2 border-indigo-200 pl-4 mt-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Question Text"}),i.jsx(Ee,{value:c.question_text||"",onChange:N=>u({...c,question_text:N.target.value}),placeholder:"e.g. What is the capital of France?"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Correct Answer"}),i.jsx(Ee,{value:c.correct_answer||"",onChange:N=>u({...c,correct_answer:N.target.value}),placeholder:"e.g. Paris"})]}),i.jsxs("div",{children:[i.jsx(me,{className:"mb-2 block",children:"Options (Optional for multiple choice)"}),i.jsx("div",{className:"grid grid-cols-2 gap-2",children:(c.options||["","","",""]).map((N,j)=>i.jsx(Ee,{value:N,onChange:S=>{const C=[...c.options||["","","",""]];C[j]=S.target.value,u({...c,options:C})},placeholder:`Option ${j+1}`},j))})]}),i.jsxs("div",{className:"flex items-start gap-2 text-amber-600 bg-amber-50 p-3 rounded-md text-sm",children:[i.jsx(Sn,{className:"w-4 h-4 mt-0.5 shrink-0"}),i.jsx("p",{children:"Note: For skill-based raffles, users must answer correctly BEFORE purchasing a ticket. Incorrect answers may prevent purchase or disqualify the entry."})]})]})]})]})})]}),i.jsx("div",{className:"flex justify-end pt-6",children:i.jsx(ue,{onClick:m,disabled:d.isPending,children:d.isPending?"Saving...":"Save Configuration"})})]})}function J5e({raffles:e,tickets:t}){const n=t.length,r=O.useMemo(()=>t.reduce((u,h)=>{const d=e.find(m=>m.id===h.raffle_id);return u+(d?d.ticket_price:0)},0),[t,e]),s=e.filter(u=>u.status==="active").length,a=O.useMemo(()=>{const u=Array.from({length:30},(h,d)=>
966{const m=b0(new Date,29-d);return{date:m,dateStr:Ut(m,"yyyy-MM-dd"),label:Ut(m,"MMM dd"),sales:0,revenue:0}});return t.forEach(h=>{if(!h.purchase_date)return;const d=zp(h.purchase_date),m=u.find(g=>kxe(g.date,d));if(m){m.sales+=1;const g=e.find(w=>w.id===h.raffle_id);m.revenue+=g?g.ticket_price:0}}),u},[t,e]),o=O.useMemo(()=>{const u={};return t.forEach(h=>{const d=e.find(g=>g.id===h.raffle_id),m=d?d.title:"Unknown";u[m]||(u[m]=0),u[m]+=1}),Object.entries(u).map(([h,d])=>({name:h,value:d})).sort((h,d)=>d.value-h.value).slice(0,5)},[t,e]),l=O.useMemo(()=>{const u={};return t.forEach(h=>{const d=h.purchase_source||"Direct",m=d.charAt(0).toUpperCase()+d.slice(1);u[m]||(u[m]=0),u[m]+=1}),Object.entries(u).map(([h,d])=>({name:h,value:d})).sort((h,d)=>d.value-h.value)},[t]),c=["#6366f1","#8b5cf6","#ec4899","#f43f5e","#f59e0b","#10b981"];return i.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.jsx(Me,{className:"bg-white border-l-4 border-l-indigo-500 shadow-sm",children:i.jsxs(Fe,{className:"p-6 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-slate-500",children:"Total Revenue"}),i.jsxs("h3",{className:"text-2xl font-bold text-slate-900",children:["€",r.toFixed(2)]})]}),i.jsx("div",{className:"h-12 w-12 bg-indigo-50 rounded-full flex items-center justify-center",children:i.jsx(O_,{className:"h-6 w-6 text-indigo-600"})})]})}),i.jsx(Me,{className:"bg-white border-l-4 border-l-purple-500 shadow-sm",children:i.jsxs(Fe,{className:"p-6 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-slate-500",children:"Total Tickets Sold"}),i.jsx("h3",{className:"text-2xl font-bold text-slate-900",children:n})]}),i.jsx("div",{className:"h-12 w-12 bg-purple-50 rounded-full flex items-center justify-center",children:i.jsx(Vr,{className:"h-6 w-6 text-purple-600"})})]})}),i.jsx(Me,{className:"bg-white border-l-4 border-l-pink-500 shadow-sm",children:i.jsxs(Fe,{className:"p-6 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-slate-500",children:"Active Raffles"}),i.jsx("h3",{className:"text-2xl font-bold text-slate-900",children:s})]}),i.jsx("div",{className:"h-12 w-12 bg-pink-50 rounded-full flex items-center justify-center",children:i.jsx(ro,{className:"h-6 w-6 text-pink-600"})})]})})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[i.jsxs(Me,{className:"col-span-1 lg:col-span-2 shadow-sm",children:[i.jsx(st,{children:i.jsx(at,{className:"text-lg font-bold text-slate-800",children:"Ticket Sales Trends (Last 30 Days)"})}),i.jsx(Fe,{className:"h-[300px]",children:i.jsx(Uc,{width:"100%",height:"100%",children:i.jsxs(u5e,{data:a,margin:{top:10,right:30,left:0,bottom:0},children:[i.jsx("defs",{children:i.jsxs("linearGradient",{id:"colorSales",x1:"0",y1:"0",x2:"0",y2:"1",children:[i.jsx("stop",{offset:"5%",stopColor:"#6366f1",stopOpacity:.8}),i.jsx("stop",{offset:"95%",stopColor:"#6366f1",stopOpacity:0})]})}),i.jsx(Rd,{strokeDasharray:"3 3",vertical:!1,stroke:"#e2e8f0"}),i.jsx(eo,{dataKey:"label",stroke:"#64748b",fontSize:12,tickLine:!1,axisLine:!1}),i.jsx(to,{stroke:"#64748b",fontSize:12,tickLine:!1,axisLine:!1}),i.jsx(_i,{contentStyle:{backgroundColor:"#fff",borderRadius:"8px",border:"1px solid #e2e8f0",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"},cursor:{stroke:"#6366f1",strokeWidth:1}}),i.jsx(Yd,{type:"monotone",dataKey:"sales",stroke:"#6366f1",strokeWidth:3,fillOpacity:1,fill:"url(#colorSales)"})]})})})]}),i.jsxs(Me,{className:"shadow-sm",children:[i.jsx(st,{children:i.jsx(at,{className:"text-lg font-bold text-slate-800",children:"Top 5 Raffles by Sales"})}),i.jsx(Fe,{className:"h-[300px]",children:i.jsx(Uc,{width:"100%",height:"100%",children:i.jsxs(N_,{data:o,layout:"vertical",margin:{top:5,right:30,left:20,bottom:5},children:[i.jsx(Rd,{strokeDasharray:"3 3",horizontal:!0,vertical:!1,stroke:"#e2e8f0"}),i.jsx(eo,{type:"number",hide:!0}),i.jsx(to,{dataKey:"name",type:"category",width:100,stroke:"#64748b",fontSize:11,tickLine:!1,axisLine
966:!1}),i.jsx(_i,{contentStyle:{backgroundColor:"#fff",borderRadius:"8px",border:"1px solid #e2e8f0",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"},cursor:{fill:"#f1f5f9"}}),i.jsx(Ql,{dataKey:"value",fill:"#8b5cf6",radius:[0,4,4,0],barSize:32})]})})})]}),i.jsxs(Me,{className:"shadow-sm",children:[i.jsx(st,{children:i.jsx(at,{className:"text-lg font-bold text-slate-800",children:"Sales by Marketing Channel"})}),i.jsx(Fe,{className:"h-[300px] flex items-center justify-center",children:l.length>0?i.jsx(Uc,{width:"100%",height:"100%",children:i.jsxs(l5e,{children:[i.jsx(gu,{data:l,cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",children:l.map((u,h)=>i.jsx(SN,{fill:c[h%c.length]},`cell-${h}`))}),i.jsx(_i,{}),i.jsx(Od,{verticalAlign:"bottom",height:36})]})}):i.jsxs("div",{className:"text-slate-400 flex flex-col items-center",children:[i.jsx(hee,{className:"w-12 h-12 mb-2 opacity-20"}),i.jsx("p",{children:"No channel data available yet"})]})})]})]})]})}function eMe({raffle:e}){const[t,n]=O.useState(!1),[r,s]=O.useState({name:"",type:"email",platform:"email",subject:"",content:"",scheduled_at:"",target_audience:"all_users",status:"scheduled"}),a=mn(),{data:o=[],isLoading:l}=qe({queryKey:["marketingCampaigns",e.id],queryFn:()=>ae.entities.MarketingCampaign.filter({raffle_id:e.id})}),c=qt({mutationFn:g=>ae.entities.MarketingCampaign.create({...g,raffle_id:e.id}),onSuccess:()=>{a.invalidateQueries(["marketingCampaigns"]),n(!1),s({name:"",type:"email",platform:"email",subject:"",content:"",scheduled_at:"",target_audience:"all_users",status:"scheduled"})}}),u=qt({mutationFn:g=>ae.entities.MarketingCampaign.delete(g),onSuccess:()=>a.invalidateQueries(["marketingCampaigns"])}),h=qt({mutationFn:()=>ae.functions.invoke("marketingAutomation",{action:"check_campaigns"}),onSuccess:g=>{var w;alert(`Automation run complete. Processed ${((w=g.data)==null?void 0:w.processed)||0} campaigns.`),a.invalidateQueries(["marketingCampaigns"])}}),d=()=>{c.mutate(r)},m=g=>{switch(g){case"sent":return"bg-green-100 text-green-800";case"failed":return"bg-red-100 text-red-800";case"scheduled":return"bg-blue-100 text-blue-800";default:return"bg-slate-100 text-slate-800"}};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-bold text-slate-900",children:"Marketing Campaigns"}),i.jsxs("p",{className:"text-sm text-slate-500",children:["Schedule automated emails and social posts for ",e.title]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>h.mutate(),disabled:h.isPending,children:[i.jsx(rs,{className:"w-4 h-4 mr-2"})," Run Scheduler Now"]}),i.jsxs(ue,{onClick:()=>n(!t),size:"sm",className:"bg-indigo-600 hover:bg-indigo-700",children:[i.jsx(li,{className:"w-4 h-4 mr-2"})," New Campaign"]})]})]}),t&&i.jsx(Me,{className:"border-indigo-200 bg-indigo-50/50",children:i.jsxs(Fe,{className:"p-4 space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Campaign Name"}),i.jsx(Ee,{value:r.name,onChange:g=>s({...r,name:g.target.value}),placeholder:"e.g. Launch Announcement"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Type"}),i.jsxs(Xt,{value:r.type,onValueChange:g=>s({...r,type:g,platform:g==="email"?"email":"facebook"}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"email",children:"Email Blast"}),i.jsx(Ie,{value:"social_post",children:"Social Media Post"})]})]})]})]}),r.type==="email"&&i.jsxs("div",{children:[i.jsx(me,{children:"Subject Line"}),i.jsx(Ee,{value:r.subject,onChange:g=>s({...r,subject:g.target.value}),placeholder:"Don't miss out!"})]}),r.type==="social_post"&&i.jsxs("div",{children:[i.jsx(me,{children:"Platform"}),i.jsxs(Xt,{value:r.platform,onValueChange:g=>s({...r,platform:g}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"facebook",children:"Facebook"}),i.jsx(Ie,{value:"twitter",children:"Twitter / X"}),i.jsx(Ie,{value:"instagram",children:"Instagram"})]})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Content"}),i.jsx(nr,{value:r.content,onChange:g=>s({...r,content:g.target.value}),className:"h-32",placeholder:r.type==="email"?"Email body content...":"Post caption..."})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Schedule For"}),i.jsx(Ee,{type:"datetime-local",value:r.scheduled_at,onChange:g=>s({...r,scheduled_at:g.target.value})})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Target Audience"}),i.jsxs(Xt,{value:r.target_audience,onValueChange:g=>s({...r,target_audience:g}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"all_users",children:"All Users"}),i.jsx(Ie,{value:"past_buyers",children:"Past Buyers"}),i.jsx(Ie,{value:"non_buyers",children:"Non-Buyers"})]})]})]})]}),i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(ue,{variant:"ghost",onClick:()=>n(!1),children:"Cancel"}),i.jsx(ue,{onClick:d,disabled:c.isPending,children:c.isPending?"Scheduling...":"Schedule Campaign"})]})]})}),i.jsx("div",{className:"grid gap-4",children:o.length===0?i.jsx("div",{className:"text-center py-8 text-slate-500 bg-slate-50 rounded-lg border border-dashed",children:"No campaigns scheduled. Create one to get started!"}):o.sort((g,w)=>new Date(w.scheduled_at)-new Date(g.scheduled_at)).map(g=>i.jsx(Me,{className:"hover:shadow-md transition-shadow",children:i.jsxs(Fe,{className:"p-4 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:`p-2 rounded-full ${g.type==="email"?"bg-blue-100 text-blue-600":"bg-pink-100 text-pink-600"}`,children:g.type==="email"?i.jsx(Vo,{className:"w-5 h-5"}):i.jsx(Ho,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h4",{className:"font-bold text-slate-900",children:g.name}),i.jsx(nt,{className:m(g.status),children:g.status}),g.platform!=="email"&&i.jsx(nt,{variant:"outline",children:g.platform})]}),i.jsx("p",{className:"text-sm text-slate-600 mt-1 line-clamp-1",children:g.subject||g.content}),i.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-slate-500",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Fn,{className:"w-3 h-3"}),g.scheduled_at?Ut(new Date(g.scheduled_at),"MMM d, yyyy HH:mm"):"Not scheduled"]}),g.sent_at&&i.jsxs("span",{className:"flex items-center gap-1 text-green-600",children:[i.jsx(Ch,{className:"w-3 h-3"})," Sent: ",Ut(new Date(g.sent_at),"HH:mm")]}),g.error_log&&i.jsxs("span",{className:"flex items-center gap-1 text-red-600",children:[i.jsx(Sn,{className:"w-3 h-3"})," Error"]})]})]})]}),i.jsx("div",{className:"flex items-center gap-2",children:g.status!=="sent"&&i.jsx(ue,{size:"icon",variant:"ghost",className:"text-red-400 hover:text-red-600",onClick:()=>u.mutate(g.id),children:i.jsx(ci,{className:"w-4 h-4"})})})]})},g.id))})]})}function tMe(){const[e,t]=O.useState(!1),[n,r]=O.useState("idle"),[s,a]=O.useState(null),[o,l]=O.useState(null),[c,u]=O.useState(!1),[h,d]=O.useState(null),[m,g]=O.useState(!1),[w,v]=O.useState(null),[b,y]=O.useState(!1),[_,N]=O.useState(null),[j,S]=O.useState(!1),[C,P]=O.useState(null),[A,F]=O.useState(!1),I={title:"",short_code:"",description:"",ticket_price:5,total_prizes:20,unique_winner_per_draw:!0,daily_code_seed:Math.random().toString(36).substring(2,8).toUpperCase(),image_url:"",draw_date:"",splash_duration_seconds:4,reveal_duration_seconds:10,max_tickets_per_person:0,type:"standard",collection_type:"anywhere"},[R,M]=O.useState(I),$=mn(),{data:B=[]}=qe({queryKey:["raffles"],queryFn:()=>ae.entities.Raffle.list()}),{data:U}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{}}),{data:G}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me()}),{data:Z=[]}=qe({queryKey:["allTickets"],queryFn:()=>ae.entities.RaffleTicket.list()}),X=qt({mutationFn:de=>ae.entities.Raffle.create({...de,created_date:new Date().toISOString(),status:"active",prizes_drawn:0,winning_tickets:[]}),onSuccess:()=>{$.invalidateQueries({queryKey:["raffles"]}),t(!1),M(I)}}),V=qt({mutationFn:({id:de,data:Pe})=>ae.entities.Raffle.update(de,Pe),onSuccess:()=>
966$.invalidateQueries({queryKey:["raffles"]})});qt({mutationFn:({id:de,data:Pe})=>ae.entities.RaffleTicket.update(de,Pe),onSuccess:()=>$.invalidateQueries({queryKey:["allTickets"]})});const z=qt({mutationFn:de=>ae.entities.Raffle.delete(de),onSuccess:()=>$.invalidateQueries({queryKey:["raffles"]})}),L=de=>{window.confirm("Are you sure you want to delete this raffle? This action cannot be undone.")&&z.mutate(de)},W=de=>{de.preventDefault(),X.mutate(R)},Q=async de=>{const Pe=de.target.files[0];if(Pe){F(!0);try{const{file_url:Ze}=await ae.integrations.Core.UploadFile({file:Pe});M(ct=>({...ct,image_url:Ze}))}catch(Ze){alert("Failed to upload image: "+Ze.message)}finally{F(!1)}}},J=async de=>{if(de.prizes_drawn>=de.total_prizes)return;if(Z.filter(ct=>ct.raffle_id===de.id).filter(ct=>{var pt;return!(ct.is_winner||de.unique_winner_per_draw&&((pt=de.winning_tickets)==null?void 0:pt.some(wn=>wn.user_id===ct.user_id)))}).length===0){alert("No eligible tickets left to draw!");return}l(de),r("splashing");try{await ae.functions.invoke("raffleControl",{action:"start_draw",raffleId:de.id}),$.invalidateQueries({queryKey:["raffles"]})}catch(ct){console.error("Failed to start draw:",ct)}},ne=async()=>{var Pe,Ze,ct,pt;if(!o)return;const de=o;try{const $t=await ae.functions.invoke("raffleControl",{action:"reveal_winner",raffleId:de.id});if((Pe=$t.data)!=null&&Pe.success&&((ct=(Ze=$t.data)==null?void 0:Ze.data)!=null&&ct.current_winner_display)){const wn=$t.data.data.current_winner_display;a(wn),r("revealing"),$.invalidateQueries({queryKey:["raffles"]}),$.invalidateQueries({queryKey:["allTickets"]})}else throw new Error(((pt=$t.data)==null?void 0:pt.error)||"Failed to draw winner")}catch($t){console.error("Error during draw:",$t),alert("Error drawing winner: "+$t.message),r("idle"),l(null)}},Y=()=>{r("idle"),setTimeout(()=>{const de=B.find(Pe=>Pe.id===o.id);de&&de.prizes_drawn<de.total_prizes?J(de):(o&&ae.functions.invoke("raffleControl",{action:"end_draw",raffleId:o.id}),l(null))},100)},ee=()=>{r("idle"),o&&ae.functions.invoke("raffleControl",{action:"end_draw",raffleId:o.id}),l(null),a(null)},le=async de=>{var Pe,Ze,ct,pt;try{const $t=await ae.functions.invoke("raffleControl",{action:"redraw_winner",raffleId:de.id});if((Pe=$t.data)!=null&&Pe.success&&((ct=(Ze=$t.data)==null?void 0:Ze.data)!=null&&ct.current_winner_display)){const wn=$t.data.data.current_winner_display;a(wn),$.invalidateQueries({queryKey:["raffles"]}),$.invalidateQueries({queryKey:["allTickets"]})}else throw new Error(((pt=$t.data)==null?void 0:pt.error)||"Failed to redraw winner")}catch($t){console.error("Error during redraw:",$t),alert("Error redrawing winner: "+$t.message)}},re=de=>{if(!de.winning_tickets||de.winning_tickets.length===0)return;const Pe=`Prize Rank,Ticket Code,User Email,Drawn At
967`,Ze=de.winning_tickets.map(wn=>`${wn.prize_rank},${wn.ticket_code},${wn.user_email},${wn.drawn_at}`).join(`
968`),ct=new Blob([Pe+Ze],{type:"text/csv"}),pt=window.URL.createObjectURL(ct),$t=document.createElement("a");$t.href=pt,$t.download=`${de.title.replace(/\s+/g,"_")}_winners.csv`,document.body.appendChild($t),$t.click(),document.body.removeChild($t)},fe=de=>{d(de),M({title:de.title,short_code:de.short_code||"",description:de.description||"",ticket_price:de.ticket_price,total_prizes:de.total_prizes,unique_winner_per_draw:de.unique_winner_per_draw,daily_code_seed:de.daily_code_seed,image_url:de.image_url||"",draw_date:de.draw_date||"",splash_duration_seconds:de.splash_duration_seconds||4,reveal_duration_seconds:de.reveal_duration_seconds||10,max_tickets_per_person:de.max_tickets_per_person||0,type:de.type||"standard",collection_type:de.collection_type||"anywhere"}),u(!0)},ge=de=>{de.preventDefault(),h&&V.mutate({id:h.id,data:R},{onSuccess:()=>{u(!1),d(null),M(I)}})},he=(de,Pe)=>{de.status!=="completed"&&V.mutate({id:de.id,data:{status:Pe?"active":"paused"}})},De=de=>{confirm("Are you sure you want to CLOSE this raffle? It will be marked as completed and no more tickets can be sold.")&&V.mutate({id:de.id,data:{status:"completed"}})},_e=de=>{v(de),g(!0)},We=de=>{N(de),y(!0)},ze=de=>{P(de),S(!0)},[Xe,ke]=O.useState(null),Ae=async de=>{const Pe=U==null?void 0:U.id;if(!Pe){const Ze=await ae.entities.Settings.list();if(Ze.length>0){await ae.entities.Settings.update(Ze[0].id,{promo_active:!0,promo_raffle_id:de.id,promo_event_id:null,promo_trigger_timestamp:new Date().toISOString()}),alert("Promo pushed! It should appear on user screens shortly.");return}alert("Settings not found. Please create settings first.");return}confirm(`Are you sure you want to PUSH this raffle (${de.title}) to all active users? It will appear as a splash screen.`)&&(await ae.entities.Settings.update(Pe,{promo_active:!0,promo_raffle_id:de.id,promo_event_id:null,promo_trigger_timestamp:new Date().toISOString()}),alert("Promo pushed! It should appear on user screens shortly."))},Be=de=>{const Pe=Z.filter(pt=>pt.raffle_id===de),Ze=B.find(pt=>
968pt.id===de),ct=Pe.length*(Ze?Ze.ticket_price:0);return{count:Pe.length,revenue:ct}};return i.jsx("div",{className:"space-y-6",children:i.jsxs(tu,{defaultValue:"raffles",className:"w-full",children:[i.jsxs(Wl,{children:[i.jsx(Wt,{value:"raffles",children:"Raffles"}),i.jsx(Wt,{value:"analytics",children:"Analytics"}),i.jsx(Wt,{value:"take_your_pick",children:"Take Your Pick Game"})]}),i.jsx(Yt,{value:"analytics",children:i.jsx(J5e,{raffles:B,tickets:Z})}),_&&i.jsx(rn,{open:b,onOpenChange:y,children:i.jsxs(en,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[i.jsx(vn,{children:i.jsxs(sn,{children:["Promote Raffle: ",_.title]})}),i.jsxs(tu,{defaultValue:"ai_content",className:"w-full mt-4",children:[i.jsxs(Wl,{className:"grid w-full grid-cols-2",children:[i.jsx(Wt,{value:"ai_content",children:"AI Content Generator"}),i.jsx(Wt,{value:"campaigns",children:"Automated Campaigns"})]}),i.jsx(Yt,{value:"ai_content",className:"mt-4",children:i.jsx(Q5e,{raffle:_,stats:Be(_.id)})}),i.jsx(Yt,{value:"campaigns",className:"mt-4",children:i.jsx(eMe,{raffle:_})})]})]})}),i.jsx(Yt,{value:"take_your_pick",children:i.jsx(Y5e,{})}),i.jsxs(Yt,{value:"raffles",children:[n==="splashing"&&o&&i.jsx(IQ,{onComplete:ne,duration:o.splash_duration_seconds||4,raffle:o}),n==="revealing"&&s&&o&&i.jsx(DQ,{winner:s,raffle:o,onClose:ee,onDrawNext:o.prizes_drawn<o.total_prizes?Y:null,onRedraw:le}),Xe&&i.jsx(LQ,{settings:{promo_raffle_id:Xe.id},onClose:()=>ke(null)}),w&&i.jsx(y5e,{raffle:w,isOpen:m,onClose:()=>{g(!1),v(null)}}),C&&i.jsx(rn,{open:j,onOpenChange:S,children:i.jsxs(en,{className:"max-w-3xl max-h-[90vh] flex flex-col",children:[i.jsx(vn,{children:i.jsxs(sn,{children:["Advanced Rules: ",C.title]})}),i.jsx(Z5e,{raffle:C,onClose:()=>S(!1)})]})}),i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h2",{className:"text-2xl font-bold text-slate-900",children:"Raffle Management"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(G5e,{raffles:B,tickets:Z}),i.jsxs(rn,{open:e,onOpenChange:t,children:[i.jsx(bg,{asChild:!0,children:i.jsxs(ue,{className:"bg-indigo-600 hover:bg-indigo-700",children:[i.jsx(li,{className:"w-4 h-4 mr-2"})," Create Raffle"]})}),i.jsxs(en,{children:[i.jsx(vn,{children:i.jsx(sn,{children:"Create New Raffle"})}),i.jsxs("form",{onSubmit:W,className:"space-y-4 mt-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Title"}),i.jsx(Ee,{value:R.title,onChange:de=>M({...R,title:de.target.value}),required:!0})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Raffle Type"}),i.jsxs(Xt,{value:R.type,onValueChange:de=>M({...R,type:de}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"standard",children:"Standard Raffle"}),i.jsx(Ie,{value:"take_your_pick",children:"Take Your Pick"})]})]})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Short Code (Prefix)"}),i.jsx(Ee,{value:R.short_code||"",onChange:de=>M({...R,short_code:de.target.value.toUpperCase()}),placeholder:"e.g. XMAS",maxLength:6})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between items-center mb-1",children:[i.jsx(me,{children:"Description"}),i.jsx(S8,{initialTitle:R.title,onGenerate:de=>M({...R,description:de})})]}),i.jsx(Ee,{value:R.description,onChange:de=>M({...R,description:de.target.value})})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Image"}),i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsx(Ee,{value:R.image_url||"",onChange:de=>M({...R,image_url:de.target.value}),placeholder:"https://..."}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:"file",accept:"image/*",className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",onChange:Q,disabled:A}),i.jsx(ue,{type:"button",variant:"outline",size:"icon",disabled:A,title:"Upload Image",children:A?i.jsx(dr,{className:"w-4 h-4 animate-spin"}):i.jsx(ma,{className:"w-4 h-4"})})]})]}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Recommended aspect ratio: 16:9 (Landscape)"}),R.image_url&&i.jsx("div",{className:"mt-2 w-20 h-20 rounded-lg overflow-hidden border border-slate-200 relative bg-slate-50",children:i.jsx("img",{src:R.image_url,alt:"Preview",className:"w-full h-full object-cover"})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex items-center space-x-2 bg-slate-50 p-3 rounded-lg border border-slate-100 h-full",children:[i.jsx(ai,{id:"create-free",checked:R.ticket_price===0,onCheckedChange:de=>M({...R,ticket_price:de?0:5})}),i.jsx(me,{htmlFor:"create-free",className:"cursor-pointer font-medium",children:"Free Raffle"})]}),i.jsxs("div",{className:"flex items-center space-x-2 bg-slate-50 p-3 rounded-lg border border-slate-100 h-full",children:[i.jsx(ai,{id:"create-venue-only",checked:R.collection_type==="venue_only",onCheckedChange:de=>M({...R,collection_type:de?"venue_only":"anywhere"})}),i.jsxs(me,{htmlFor:"create-venue-only",className:"cursor-pointer font-medium flex items-center gap-2",children:[i.jsx(js,{className:"w-4 h-4 text-slate-500"}),R.collection_type==="venue_only"?"In Venue Only":"Online / Anywhere"]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Draw Date & Time"}),i.jsx(Ee,{type:"datetime-local",value:R.draw_date?new Date(R.draw_date).toISOString().slice(0,16):"",onCh
968ange:de=>M({...R,draw_date:de.target.value?new Date(de.target.value).toISOString():""})})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Ticket Price (€)"}),i.jsx(Ee,{type:"number",step:"0.01",min:"0",value:R.ticket_price,onChange:de=>M({...R,ticket_price:parseFloat(de.target.value)}),required:!0,disabled:R.ticket_price===0})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Total Prizes"}),i.jsx(Ee,{type:"number",value:R.total_prizes,onChange:de=>M({...R,total_prizes:parseInt(de.target.value)}),required:!0})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Max Tickets Per Person (0 for unlimited)"}),i.jsx(Ee,{type:"number",min:"0",value:R.max_tickets_per_person,onChange:de=>M({...R,max_tickets_per_person:parseInt(de.target.value)})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Splash Duration (sec)"}),i.jsx(Ee,{type:"number",min:"1",value:R.splash_duration_seconds,onChange:de=>M({...R,splash_duration_seconds:parseInt(de.target.value)})})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Reveal Duration (sec)"}),i.jsx(Ee,{type:"number",min:"1",value:R.reveal_duration_seconds,onChange:de=>M({...R,reveal_duration_seconds:parseInt(de.target.value)})})]})]}),i.jsx(ue,{type:"submit",className:"w-full",children:"Create Raffle"})]})]})]})]}),i.jsx(rn,{open:c,onOpenChange:u,children:i.jsxs(en,{children:[i.jsx(vn,{children:i.jsx(sn,{children:"Edit Raffle"})}),i.jsxs("form",{onSubmit:ge,className:"space-y-4 mt-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Title"}),i.jsx(Ee,{value:R.title,onChange:de=>M({...R,title:de.target.value}),required:!0})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Raffle Type"}),i.jsxs(Xt,{value:R.type,onValueChange:de=>M({...R,type:de}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"standard",children:"Standard Raffle"}),i.jsx(Ie,{value:"take_your_pick",children:"Take Your Pick"})]})]})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Short Code (Prefix)"}),i.jsx(Ee,{value:R.short_code||"",onChange:de=>M({...R,short_code:de.target.value.toUpperCase()}),placeholder:"e.g. XMAS",maxLength:6})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between items-center mb-1",children:[i.jsx(me,{children:"Description"}),i.jsx(S8,{initialTitle:R.title,onGenerate:de=>M({...R,description:de})})]}),i.jsx(Ee,{value:R.description,onChange:de=>M({...R,description:de.target.value})})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Image"}),i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsx(Ee,{value:R.image_url||"",onChange:de=>M({...R,image_url:de.target.value}),placeholder:"https://..."}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:"file",accept:"image/*",className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",onChange:Q,disabled:A}),i.jsx(ue,{type:"button",variant:"outline",size:"icon",disabled:A,title:"Upload Image",children:A?i.jsx(dr,{className:"w-4 h-4 animate-spin"}):i.jsx(ma,{className:"w-4 h-4"})})]})]}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Recommended aspect ratio: 16:9 (Landscape)"}),R.image_url&&i.jsx("div",{className:"mt-2 w-20 h-20 rounded-lg overflow-hidden border border-slate-200 relative bg-slate-50",children:i.jsx("img",{src:R.image_url,alt:"Preview",className:"w-full h-full object-cover"})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex items-center space-x-2 bg-slate-50 p-3 rounded-lg border border-slate-100 h-full",children:[i.jsx(ai,{id:"edit-free",checked:R.ticket_price===0,onCheckedChange:de=>M({...R,ticket_price:de?0:5})}),i.jsx(me,{htmlFor:"edit-free",className:"cursor-pointer font-medium",children:"Free Raffle"})]}),i.jsxs("div",{className:"flex items-center space-x-2 bg-slate-50 p-3 rounded-lg border border-slate-100 h-full",children:[i.jsx(ai,{id:"edit-venue-only",checked:R.collection_type==="venue_only",onCheckedChange:de=>M({...R,collection_type:de?"venue_only":"anywhere"})}),i.jsxs(me,{htmlFor:"edit-venue-only",className:"cursor-pointer font-medium flex items-center gap-2",children:[i.jsx(js,{className:"w-4 h-4 text-slate-500"}),R.collection_type==="venue_only"?"In Venue Only":"Online / Anywhere"]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Draw Date & Time"}),i.jsx(Ee,{type:"datetime-local",value:R.draw_date?new Date(R.draw_date).toISOString().slice(0,16):"",onCh
968ange:de=>M({...R,draw_date:de.target.value?new Date(de.target.value).toISOString():""})})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Ticket Price (€)"}),i.jsx(Ee,{type:"number",step:"0.01",min:"0",value:R.ticket_price,onChange:de=>M({...R,ticket_price:parseFloat(de.target.value)}),required:!0,disabled:R.ticket_price===0})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Total Prizes"}),i.jsx(Ee,{type:"number",value:R.total_prizes,onChange:de=>M({...R,total_prizes:parseInt(de.target.value)}),required:!0})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Max Tickets Per Person (0 for unlimited)"}),i.jsx(Ee,{type:"number",min:"0",value:R.max_tickets_per_person,onChange:de=>M({...R,max_tickets_per_person:parseInt(de.target.value)})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Splash Duration (sec)"}),i.jsx(Ee,{type:"number",min:"1",value:R.splash_duration_seconds,onChange:de=>M({...R,splash_duration_seconds:parseInt(de.target.value)})})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Reveal Duration (sec)"}),i.jsx(Ee,{type:"number",min:"1",value:R.reveal_duration_seconds,onChange:de=>M({...R,reveal_duration_seconds:parseInt(de.target.value)})})]})]}),i.jsx(ue,{type:"submit",className:"w-full",children:"Update Raffle"})]})]})})]}),i.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:B.map(de=>{var Pe;return i.jsxs(Me,{className:"overflow-hidden",children:[i.jsx(st,{className:"bg-slate-50 border-b",children:i.jsxs("div",{className:"flex justify-between items-start",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(at,{className:"text-lg font-bold",children:de.title}),de.type==="take_your_pick"&&i.jsx(nt,{className:"bg-purple-100 text-purple-800 border-purple-200",children:"Take Your Pick"})]}),i.jsx("div",{className:"flex gap-2 mt-2",children:i.jsx(nt,{variant:de.status==="active"?"default":"secondary",children:de.status})})]}),i.jsxs("div",{className:"flex flex-col items-end gap-2",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx(ai,{checked:de.status==="active",onCheckedChange:Ze=>he(de,Ze),disabled:de.status==="completed"})}),i.jsxs("div",{className:"flex gap-1",children:[i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>ke(de),title:"Preview Promo Splash",className:"border-indigo-200 text-indigo-600 hover:bg-indigo-50",children:[i.jsx(du,{className:"w-4 h-4 mr-1"})," Preview"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>Ae(de),title:"Push Splash Screen Promo",className:"border-amber-200 text-amber-600 hover:bg-amber-50",children:[i.jsx(Kc,{className:"w-4 h-4 mr-1"})," Push Promo"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:async()=>{if(confirm("Retract all ads from users?"))try{const Ze=await ae.entities.Settings.list();Ze[0]&&(await ae.entities.Settings.update(Ze[0].id,{force_close_trigger:new Date().toISOString()}),alert("Retract signal sent"))}catch(Ze){console.error(Ze)}},title:"Retract/Close Ads",className:"border-red-200 text-red-600 hover:bg-red-50",children:[i.jsx(F0,{className:"w-4 h-4 mr-1"})," Retract"]}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>_e(de),title:"Manage Tickets",children:i.jsx(Vr,{className:"w-4 h-4 text-indigo-600"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>ze(de),title:"Advanced Rules",children:i.jsx(VT,{className:"w-4 h-4 text-slate-600"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>We(de),title:"Promote with AI",children:i.jsx(gg,{className:"w-4 h-4 text-purple-600"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>fe(de),title:"Edit Settings",children:i.jsx(UT,{className:"w-4 h-4"})}),de.status!=="completed"&&i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>De(de),title:"Close Raffle",className:"text-orange-500 hover:text-orange-600 hover:bg-orange-50",children:i.jsx(YJ,{className:"w-4 h-4"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>L(de.id),title:"Delete",className:"text-red-500 hover:text-red-600 hover:bg-red-50",children:i.jsx(ci,{className:"w-4 h-4"})})]})]})]})}),i.jsxs(Fe,{className:"p-6 space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-3 gap-4 bg-slate-50 p-4 rounded-lg",children:[i.jsxs("div",{children:[i.jsxs("span",{className:"text-xs text-slate-500 flex items-center gap-1",children:[i.jsx(Dr,{className:"w-3 h-3"})," Sold"]}),i.jsx("span",{className:"text-xl font-bold",children:Be(de.id).count})]}),i.jsxs("div",{children:[i.jsxs("span",{className:"text-xs text-slate-500 flex items-center gap-1",children:[i.jsx(Ute,{className:"w-3 h-3"})," Price"]}),i.jsx("span",{className:"text-xl font-bold",children:de.ticket_price===0?"FREE":`€${de.ticket_price}`})]}),i.jsxs("div",{children:[i.jsxs("span",{className:"text-xs text-slate-500 flex items-center gap-1",children:[i.jsx(O_,{className:"w-3 h-3"})," Revenue"]}),i.jsx("span",{className:"text-xl font-bold text-green-600",children:Be(de.id).revenue===0?"FREE":`€${Be(de.id).revenue.toFixed(2)}`})]})]}),i.jsxs("div",{className:"flex justify-between items-center border-t pt-4",children:[i.jsxs("span",{className:"font-bold",children:[de.prizes_drawn," / ",de.total_prizes," prizes"]}),i.jsxs(ue,{onClick:()=>J(de),disabled:de.prizes_drawn>=de.total_prizes,className:"bg-amber-500 hover:bg-amber-600 text-slate-900",children:[i.jsx(Jt,{className:"w-4 h-4 mr-2"})," Draw Next Winner"]})]}),((Pe=de.winning_tickets)==null?void 0:Pe.length)>0&&i.jsxs("div",{className:"mt-4 border-t pt-4",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsxs("h4",{className:"text-sm font-bold flex items-center gap-2",children:[i.jsx(rB,{className:"w-3 h-3"})," Draw History"]}),i.jsxs(ue,{variant:"ghost",size:"sm",onClick:()=>re(de),className:"h-6 text-xs",children:[i.jsx(Wy,{className:"w-3 h-3 mr-1"})," CSV"]})]}),i.jsx("div",{className:"border rounded-lg overflow-hidden",children:i.jsxs("table",{className:"w-full text-sm text-left",children:[i.jsx("thead",{className:"bg-slate-100 text-slate-600",children:i.jsxs("tr",{children:[i.jsx("th",{className:"p-2 font-medium",children:"#"}),i.jsx("th",{className:"p-2 font-medium",children:"Ticket"}),i.jsx("th",{className:"p-2 font-medium",children:"Winner"}),i.jsx("th",{className:"p-2 font-medium",children:"Time"})]})}),i.jsx("tbody",{className:"divide-y divide-slate-100",children:[...de.winning_tickets].sort((Ze,ct)=>ct.prize_rank-Ze.prize_rank).map((Ze,ct)=>i.jsxs("tr",{className:"bg-white hover:bg-slate-50",children:[i.jsxs("td",{className:"p-2 text-indigo-600 font-bold",children:["#",Ze.prize_rank]}),i.jsx("td",{className:"p-2 font-mono font-bold",children:Ze.ticket_code}),i.jsx("td",{className:"p-2 text-slate-600 truncate max-w-[120px]",children:Ze.user_email||"Anonymous"}),i.jsx("td",{className:"p-2 text-slate-400 text-xs",children:Ut(new Date(Ze.drawn_at),"dd/MM HH:mm")}
968)]},ct))})]})})]})]})]},de.id)})})]})]})})}function nMe(){const[e,t]=O.useState(!1),[n,r]=O.useState(null),s=mn(),{data:a=[],isLoading:o}=qe({queryKey:["instantGames"],queryFn:()=>ae.entities.InstantGame.list("-created_date")}),l=qt({mutationFn:d=>ae.entities.InstantGame.create(d),onSuccess:()=>{s.invalidateQueries(["instantGames"]),t(!1),tt.success("Game created successfully")},onError:()=>tt.error("Failed to create game")}),c=qt({mutationFn:({id:d,data:m})=>ae.entities.InstantGame.update(d,m),onSuccess:()=>{s.invalidateQueries(["instantGames"]),r(null),tt.success("Game updated successfully")},onError:()=>tt.error("Failed to update game")}),u=qt({mutationFn:d=>ae.entities.InstantGame.delete(d),onSuccess:()=>{s.invalidateQueries(["instantGames"]),tt.success("Game deleted")}}),h=({initialData:d,onSubmit:m,isSubmitting:g})=>{const[w,v]=O.useState(d||{title:"",description:"",image_url:"",price:1,game_url:"",active:!0,category:"General Knowledge",is_featured:!1});return i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Game Title"}),i.jsx(Ee,{value:w.title,onChange:b=>v({...w,title:b.target.value}),placeholder:"e.g. General Knowledge Blitz"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Description"}),i.jsx(nr,{value:w.description,onChange:b=>v({...w,description:b.target.value}),placeholder:"Brief description of the game..."})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Price (€)"}),i.jsx(Ee,{type:"number",step:"0.01",value:w.price,onChange:b=>v({...w,price:parseFloat(b.target.value)})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Status"}),i.jsxs("div",{className:"flex items-center space-x-2 h-10",children:[i.jsx(ai,{checked:w.active,onCheckedChange:b=>v({...w,active:b})}),i.jsx("span",{className:"text-sm text-slate-600",children:w.active?"Active":"Inactive"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Category"}),i.jsxs(Xt,{value:w.category,onValueChange:b=>v({...w,category:b}),children:[i.jsx(Ht,{children:i.jsx(Zt,{placeholder:"Select Category"})}),i.jsx(Kt,{children:["General Knowledge","Music","Movies & TV","Sports","History & Geo","Science & Tech","Other"].map(b=>i.jsx(Ie,{value:b,children:b},b))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Featured"}),i.jsxs("div",{className:"flex items-center space-x-2 h-10",children:[i.jsx(ai,{checked:w.is_featured,onCheckedChange:b=>v({...w,is_featured:b})}),i.jsx("span",{className:"text-sm text-slate-600",children:w.is_featured?"Featured":"Standard"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Game URL (Destination)"}),i.jsx(Ee,{value:w.game_url,onChange:b=>v({...w,game_url:b.target.value}),placeholder:"https://..."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Image URL"}),i.jsx(Ee,{value:w.image_url,onChange:b=>v({...w,image_url:b.target.value}),placeholder:"https://..."})]}),i.jsxs(ue,{className:"w-full mt-4",onClick:()=>m(w),disabled:g||!w.title||!w.game_url,children:[g&&i.jsx(dr,{className:"w-4 h-4 mr-2 animate-spin"}),d?"Update Game":"Create Game"]})]})};return o?i.jsx("div",{className:"p-8 text-center",children:i.jsx(dr,{className:"w-8 h-8 animate-spin mx-auto"})}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold text-slate-900",children:"Instant Games"}),i.jsx("p",{className:"text-slate-500",children:"Manage instant-play quiz games available for purchase"})]}),i.jsxs(rn,{open:e,onOpenChange:t,children:[i.jsx(bg,{asChild:!0,children:i.jsxs(ue,{className:"bg-indigo-600 hover:bg-indigo-700",children:[i.jsx(li,{className:"w-4 h-4 mr-2"}),"Add New Game"]})}),i.jsxs(en,{children:[i.jsx(vn,{children:i.jsx(sn,{children:"Add New Instant Game"})}),i.jsx(h,{onSubmit:l.mutate,isSubmitting:l.isPending})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[a.map(d=>{var m;return i.jsxs(Me,{className:"overflow-hidden",children:[i.jsx("div",{className:"p-4 pb-0 flex justify-center",children:i.jsx("div",{className:"w-40 h-40 bg-slate-100 relative rounded-full overflow-hidden shadow-md border border-slate-200",children:d.image_url?i.jsx("img",{src:d.image_url,alt:d.title,className:"w-full h-full object-cover"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center text-slate-300",children:i.jsx(vs,{className:"w-12 h-12"})})})}),i.jsx("div",{className:"flex justify-end px-4 -mt-4 relative z-10",children:i.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-bold ${d.active?"bg-green-500 text-white":"bg-slate-500 text-white"}`,children:d.active?"ACTIVE":"INACTIVE"})}),i.jsxs(Fe,{className:"p-4 pt-2",children:[i.jsxs("div",{className:"flex justify-between items-start mb-2",children:[i.jsx("h3",{className:"font-bold text-lg truncate pr-2",children:d.title}),i.jsxs("span",{className:"font-bold text-indigo-600",children:["€",(m=d.price)==null?void 0:m.toFixed(2)]})]}),i.jsx("p",{className:"text-slate-500 text-sm line-clamp-2 mb-4 min-h-[2.5rem]",children:d.description||"No description provided"}),i.jsxs("div",{className:"flex items-center justify-between gap-2 text-sm text-slate-500 mb-4",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(vs,{className:"w-4 h-4"}),d.play_count||0," plays"]}),d.game_url&&i.jsxs("a",{href:d.game_url,target:"_blank",rel:"noreferrer",className:"flex items-center gap-1 text-blue-500 hover:underline",children:["Test Link ",i.jsx(ws,{className:"w-3 h-3"})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(rn,{open:(n==null?void 0:n.id)===d.id,onOpenChange:g=>!g&&r(null),children:[i.jsx(bg,{asChild:!0,children:i.jsxs(ue,{variant:"outline",className:"flex-1",onClick:()=>r(d),children:[i.jsx(UT,{className:"w-4 h-4 mr-2"}),"Edit"]})}),i.jsxs(en,{children:[i.jsx(vn,{children:i.jsx(sn,{children:"Edit Game"})}),i.jsx(h,{initialData:d,onSubmit:g=>c.mutate({id:d.id,data:g}),isSubmitting:c.isPending})]})]}),i.jsx(ue,{variant:"destructive",size:"icon",onClick:()=>{confirm("Are you sure you want to delete this game?")&&u.mutate(d.id)},children:i.jsx(ci,{className:"w-4 h-4"})})]})]})]},d.id)}),a.length===0&&i.jsxs("div",{className:"col-span-full py-12 text-center bg-slate-50 rounded-xl border-2 border-dashed border-slate-200",children:[i.jsx(vs,{className:"w-12 h-12 text-slate-300 mx-auto mb-3"}),i.jsx("p",{className:"text-slate-500",children:"No instant games created yet."}),i.jsx(ue,{variant:"link",onClick:()=>t(!0),children:"Create your first game"})]})]})]})}var y5="Progress",b5=100,[rMe]=ja(y5),[iMe,sMe]=rMe(y5),dY=O.forwardRef((e,t)=>
968{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:a=aMe,...o}=e;(s||s===0)&&!E8(s)&&console.error(oMe(`${s}`,"Progress"));const l=E8(s)?s:b5;r!==null&&!P8(r,l)&&console.error(lMe(`${r}`,"Progress"));const c=P8(r,l)?r:null,u=E_(c)?a(c,l):void 0;return i.jsx(iMe,{scope:n,value:c,max:l,children:i.jsx(Pt.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":E_(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":mY(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});dY.displayName=y5;var fY="ProgressIndicator",hY=O.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=sMe(fY,n);return i.jsx(Pt.div,{"data-state":mY(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});hY.displayName=fY;function aMe(e,t){return`${Math.round(e/t*100)}%`}function mY(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function E_(e){return typeof e=="number"}function E8(e){return E_(e)&&!isNaN(e)&&e>0}function P8(e,t){return E_(e)&&!isNaN(e)&&e<=t&&e>=0}function oMe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${b5}\`.`}function lMe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
969  - a positive number
970  - less than the value passed to \`max\` (or ${b5} if no \`max\` prop is set)
971  - \`null\` or \`undefined\` if the progress is indeterminate.
972
973Defaulting to \`null\`.`}var pY=dY,cMe=hY;const w5=O.forwardRef(({className:e,value:t,indicatorClassName:n,...r},s)=>i.jsx(pY,{ref:s,className:Nt("relative h-4 w-full overflow-hidden rounded-full bg-slate-100",e),...r,children:i.jsx(cMe,{className:Nt("h-full w-full flex-1 bg-slate-900 transition-all",n),style:{transform:`translateX(-${100-(t||0)}%)`}})}));w5.displayName=pY.displayName;function uMe(){const[e,t]=O.useState(!1),[n,r]=O.useState(null),[s,a]=O.useState({name:"",description:"",start_date:"",end_date:"",budget:100,status:"draft",schedule_days:[],schedule_start_time:"",schedule_end_time:""}),o=mn(),{data:l}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me()}),{data:c=[],isLoading:u}=qe({queryKey:["adCampaigns"],queryFn:()=>ae.entities.AdCampaign.list("-created_date"),enabled:!!l}),{data:h=[]}=qe({queryKey:["allAdsForCampaigns"],queryFn:()=>ae.entities.Advertisement.list(),enabled:!!l}),d=qt({mutationFn:S=>ae.entities.AdCampaign.create(S),onSuccess:()=>{o.invalidateQueries(["adCampaigns"]),t(!1),v(),tt.success("Campaign created successfully")}}),m=qt({mutationFn:({id:S,data:C})=>ae.entities.AdCampaign.update(S,C),onSuccess:()=>{o.invalidateQueries(["adCampaigns"]),tt.success("Campaign updated")}}),g=qt({mutationFn:S=>ae.entities.AdCampaign.delete(S),onSuccess:()=>{o.invalidateQueries(["adCampaigns"]),tt.success("Campaign deleted")}}),w=S=>{S.preventDefault(),l&&d.mutate({...s,creator_id:l.id,creator_email:l.email,spent:0,total_impressions_purchased:0,total_impressions_delivered:0,total_clicks:0})},v=()=>{a({name:"",description:"",start_date:"",end_date:"",budget:100,status:"draft",schedule_days:[],schedule_start_time:"",schedule_end_time:""})},b=S=>{const C=S.status==="active"?"paused":"active";m.mutate({id:S.id,data:{status:C}})},y=S=>h.filter(C=>C.campaign_id===S),_=S=>{const C=y(S.id),P=C.reduce((R,M)=>R+(M.total_clicks||0),0),A=S.total_impressions_delivered||0,F=A>0?(P/A*100).toFixed(2):0,I=S.spent/S.budget*100;return{totalClicks:P,totalImpressions:A,ctr:F,budgetUsed:I,adsCount:C.length}},N=S=>{const C={draft:"bg-gray-100 text-gray-800",active:"bg-green-100 text-green-800",paused:"bg-yellow-100 text-yellow-800",completed:"bg-blue-100 text-blue-800",cancelled:"bg-red-100 text-red-800"};return C[S]||C.draft},j=S=>S.end_date?new Date(S.end_date)<new Date:!1;return u?i.jsx(Me,{children:i.jsx(Fe,{className:"p-8 text-center",children:"Loading campaigns..."})}):i.jsxs(i.Fragment,{children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(vg,{className:"w-5 h-5"}),"Ad Campaigns"]}),i.jsxs(ue,{onClick:()=>t(!e),children:[i.jsx(li,{className:"w-4 h-4 mr-2"}),"New Campaign"]})]})}),i.jsxs(Fe,{className:"space-y-4",children:[e&&i.jsxs("form",{onSubmit:w,className:"bg-slate-50 rounded-lg p-6 space-y-4 border-2 border-indigo-200",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"col-span-2 space-y-2",children:[i.jsx(me,{children:"Campaign Name *"}),i.jsx(Ee,{value:s.name,onChange:S=>a({...s,name:S.target.value}),placeholder:"e.g. Spring Promotion 2026",required:!0})]}),i.jsxs("div",{className:"col-span-2 space-y-2",children:[i.jsx(me,{children:"Description"}),i.jsx(nr,{value:s.description,onChange:S=>a({...s,description:S.target.value}),placeholder:"Campaign objective and target audience...",rows:3})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Start Date"}),i.jsx(Ee,{type:"date",value:s.start_date,onChange:S=>a({...s,start_date:S.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"End Date"}),i.jsx(Ee,{type:"date",value:s.end_date,onChange:S=>a({...s,end_date:S.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Budget (EUR)"}),i.jsx(Ee,{type:"number",min:"0",step:"0.01",value:s.budget,onChange:S=>a({...s,budget:parseFloat(S.target.value)||0}),required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Initial Status"}),i.jsxs("select",{className:"w-full h-10 px-3 rounded-md border border-slate-300",value:s.status,onChange:S=>a({...s,status:S.target.value}),children:[i.jsx("option",{value:"draft",children:"Draft"}),i.jsx("option",{value:"active",children:"Active"})]})]})]}),i.jsxs("div",{className:"col-span-2 pt-4 border-t",children:[i.jsxs("h4",{className:"font-semibold mb-3 flex items-center gap-2",children:[i.jsx(Fn,{className:"w-4 h-4"}),"Ad Schedule (Optional)"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Days of Week"}),i.jsx("div",{className:"flex gap-2 mt-2 flex-wrap",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map((S,C)=>i.jsx("button",{type:"button",onClick:()=>{const P=s.schedule_days||[];P.includes(C)?a({...s,schedule_days:P.filter(A=>A!==C)}):a({...s,schedule_days:[...P,C]})},className:`px-3 py-1.5 rounded-md text-sm font-medium transition-colors ${(s.schedule_days||[]).includes(C)?"bg-indigo-600 text-white":"bg-slate-100 text-slate-700 hover:bg-slate-200"}`,children:S},C))}),i.jsx("p",{className:"text-xs text-slate-600 mt-1",children:"Leave empty to run all days"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Start Time (24h)"}),i.jsx(Ee,{type:"time",value:s.schedule_start_time||"",onChange:S=>a({...s,schedule_start_time:S.target.value})})]}),i.jsxs("div",{children:[i.jsx(me,{children:"End Time (24h)"}),i.jsx(Ee,{type:"time",value:s.schedule_end_time||"",onChange:S=>a({...s,schedule_end_time:S.target.value})})]})]}),i.jsx("p",{className:"text-xs text-slate-600",children:"Leave empty to run 24/7"})]})]}),i.jsxs("div",{className:"flex gap-3 pt-2",children:[i.jsx(ue,{type:"submit",className:"flex-1",disabled:d.isPending,children:d.isPending?"Creating...":"Create Campaign"}),i.jsx(ue,{type:"button",variant:"outline",onClick:()=>{t(!1),v()},children:"Cancel"})]})]}),c.length===0?i.jsxs("div",{className:"text-center py-12 text-slate-600",children:[i.jsx(vg,{className:"w-12 h-12 mx-auto mb-4 text-slate-400"}),i.jsx("p",{className:"text-lg font-medium",children:"No campaigns yet"}),i.jsx("p",{className:"text-sm",children:"Create your first campaign to organize your ads"})]}):i.jsx("div",{className:"grid gap-4",children:c.map(S=>{const C=_(S),P=j(S);return i.jsxs("div",{className:"border rounded-lg p-5 hover:shadow-md transition-shadow bg-white",children:[i.jsxs("div",{className:"flex items-start justify-between mb-4",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[i.jsx("h3",{className:"text-lg font-bold text-slate-900",children:S.name}),i.jsx(nt,{className:N(S.status),children:S.status}),P&&i.jsx(nt,{className:"bg-red-100 text-red-800",children:"Expired"})]}),S.description&&i.jsx("p",{className:"text-sm text-slate-600 mb-3",children:S.description}),i.jsxs("div",{className:"flex items-center gap-6 text-sm text-slate-600",children:[S.start_date&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Fn,{className:"w-4 h-4"}),new Date(S.start_date).toLocaleDateString()]}),S.end_date&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Fn,{className:"w-4 h-4"}),new Date(S.end_date).toLocaleDateString()]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(pg,{className:"w-4 h-4"}),C.adsCount," ads"]})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>r(S),children:i.jsx(du,{className:"w-4 h-4"})}
973),S.status!=="completed"&&S.status!=="cancelled"&&i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>b(S),children:S.status==="active"?i.jsx(J1,{className:"w-4 h-4"}):i.jsx(_s,{className:"w-4 h-4"})}),i.jsx(ue,{size:"sm",variant:"destructive",onClick:()=>{confirm("Delete this campaign? Ads will remain but lose their campaign link.")&&g.mutate(S.id)},children:i.jsx(ya,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{className:"grid grid-cols-4 gap-4 pt-4 border-t",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-slate-600 mb-1",children:"Budget"}),i.jsxs("div",{className:"font-bold text-slate-900",children:["€",S.budget.toFixed(2)]}),i.jsx(w5,{value:C.budgetUsed,className:"h-1 mt-2"}),i.jsxs("div",{className:"text-xs text-slate-600 mt-1",children:["€",S.spent.toFixed(2)," spent (",C.budgetUsed.toFixed(0),"%)"]})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-slate-600 mb-1",children:"Impressions"}),i.jsx("div",{className:"font-bold text-slate-900",children:C.totalImpressions.toLocaleString()}),i.jsxs("div",{className:"text-xs text-slate-600 mt-1",children:["of ",S.total_impressions_purchased.toLocaleString()," purchased"]})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-slate-600 mb-1",children:"Clicks"}),i.jsx("div",{className:"font-bold text-slate-900",children:C.totalClicks.toLocaleString()}),i.jsxs("div",{className:"text-xs text-slate-600 mt-1",children:["CTR: ",C.ctr,"%"]})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-slate-600 mb-1",children:"CPM"}),i.jsxs("div",{className:"font-bold text-slate-900",children:["€",C.totalImpressions>0?(S.spent/C.totalImpressions*1e3).toFixed(2):"0.00"]}),i.jsx("div",{className:"text-xs text-slate-600 mt-1",children:"Cost per 1K"})]})]})]},S.id)})})]})]}),i.jsx(rn,{open:!!n,onOpenChange:S=>!S&&r(null),children:i.jsxs(en,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[i.jsx(vn,{children:i.jsxs(sn,{className:"flex items-center gap-2",children:[i.jsx(ro,{className:"w-5 h-5"}),"Campaign Performance: ",n==null?void 0:n.name]})}),n&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Campaign Name"}),i.jsx(Ee,{value:n.name,onChange:S=>{const C={...n,name:S.target.value};r(C)}})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Status"}),i.jsxs("select",{className:"w-full h-10 px-3 rounded-md border border-slate-300",value:n.status,onChange:S=>{const C={...n,status:S.target.value};r(C)},children:[i.jsx("option",{value:"draft",children:"Draft"}),i.jsx("option",{value:"active",children:"Active"}),i.jsx("option",{value:"paused",children:"Paused"}),i.jsx("option",{value:"completed",children:"Completed"}),i.jsx("option",{value:"cancelled",children:"Cancelled"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Start Date"}),i.jsx(Ee,{type:"date",value:n.start_date||"",onChange:S=>{const C={...n,start_date:S.target.value};r(C)}})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"End Date"}),i.jsx(Ee,{type:"date",value:n.end_date||"",onChange:S=>{const C={...n,end_date:S.target.value};r(C)}})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Budget (EUR)"}),i.jsx(Ee,{type:"number",step:"0.01",value:n.budget,onChange:S=>{const C={...n,budget:parseFloat(S.target.value)||0};r(C)}})]})]}),i.jsxs("div",{className:"border-t pt-4",children:[i.jsx("h4",{className:"font-semibold mb-3",children:"Ad Schedule"}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Days of Week"}),i.jsx("div",{className:"flex gap-2 mt-2 flex-wrap",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map((S,C)=>i.jsx("button",{type:"button",onClick:()=>{const P=n.schedule_days||[];P.includes(C)?r({...n,schedule_days:P.filter(A=>A!==C)}):r({...n,schedule_days:[...P,C]})},className:`px-3 py-1.5 rounded-md text-sm font-medium transition-colors ${(n.schedule_days||[]).includes(C)?"bg-indigo-600 text-white":"bg-slate-100 text-slate-700 hover:bg-slate-200"}`,children:S},C))})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Start Time (24h)"}),i.jsx(Ee,{type:"time",value:n.schedule_start_time||"",onChange:S=>r({...n,schedule_start_time:S.target.value})})]}),i.jsxs("div",{children:[i.jsx(me,{children:"End Time (24h)"}),i.jsx(Ee,{type:"time",value:n.schedule_end_time||"",onChange:S=>r({...n,schedule_end_time:S.target.value})})]})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Description"}),i.jsx(nr,{value:n.description||"",onChange:S=>{const C={...n,description:S.target.value};r(C)},rows:3})]}),i.jsxs("div",{className:"border-t pt-4",children:[i.jsx("h4",{className:"font-semibold mb-3",children:"Campaign Ads"}),i.jsxs("div",{className:"space-y-2",children:[y(n.id).map(S=>i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded",children:[i.jsx("img",{src:S.image_url,alt:S.title,className:"w-16 h-16 object-cover rounded"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"font-medium",children:S.title}),i.jsxs("div",{className:"text-xs text-slate-600",children:[S.impressions_delivered||0," impressions • ",S.status]})]}),i.jsx(nt,{className:S.status==="active"?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800",children:S.status})]},S.id)),y(n.id).length===0&&i.jsx("p",{className:"text-sm text-slate-600 text-center py-4",children:"No ads in this campaign yet"})]})]}),i.jsxs("div",{className:"flex gap-3 pt-4 border-t",children:[i.jsx(ue,{className:"flex-1",onClick:()=>{m.mutate({id:n.id,data:{name:n.name,description:n.description,start_date:n.start_date,end_date:n.end_date,budget:n.budget,status:n.status,schedule_days:n.schedule_days,schedule_start_time:n.schedule_start_time,schedule_end_time:n.schedule_end_time}}),r(null)},children:"Save Changes"}),i.jsx(ue,{variant:"outline",onClick:()=>r(null),children:"Cancel"})]})]})]})})]})}
973function dMe({schedule:e,onChange:t}){const n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],r=s=>{const a=e.schedule_days||[];a.includes(s)?t({...e,schedule_days:a.filter(o=>o!==s)}):t({...e,schedule_days:[...a,s]})};return i.jsxs("div",{className:"space-y-4 p-4 bg-slate-50 rounded-lg border",children:[i.jsxs("div",{className:"flex items-center gap-2 font-semibold text-slate-900",children:[i.jsx(Fn,{className:"w-4 h-4"}),"Ad Schedule"]}),i.jsxs("div",{children:[i.jsx(me,{className:"mb-2 block",children:"Days of Week"}),i.jsx("div",{className:"flex gap-2 flex-wrap",children:n.map((s,a)=>i.jsx("button",{type:"button",onClick:()=>r(a),className:`px-3 py-1.5 rounded-md text-sm font-medium transition-all ${(e.schedule_days||[]).includes(a)?"bg-indigo-600 text-white shadow-md":"bg-white text-slate-700 hover:bg-slate-100 border"}`,children:s},a))}),i.jsx("p",{className:"text-xs text-slate-600 mt-2",children:(e.schedule_days||[]).length===0?"No days selected - will run every day":"Ad will only run on selected days"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsxs(me,{className:"flex items-center gap-1 mb-2",children:[i.jsx(rs,{className:"w-3 h-3"}),"Start Time (24h)"]}),i.jsx(Ee,{type:"time",value:e.schedule_start_time||"",onChange:s=>t({...e,schedule_start_time:s.target.value}),placeholder:"09:00"})]}),i.jsxs("div",{children:[i.jsxs(me,{className:"flex items-center gap-1 mb-2",children:[i.jsx(rs,{className:"w-3 h-3"}),"End Time (24h)"]}),i.jsx(Ee,{type:"time",value:e.schedule_end_time||"",onChange:s=>t({...e,schedule_end_time:s.target.value}),placeholder:"17:00"})]})]}),i.jsx("p",{className:"text-xs text-slate-600",children:!e.schedule_start_time&&!e.schedule_end_time?"No time restrictions - will run 24/7":`Ad will run from ${e.schedule_start_time||"00:00"} to ${e.schedule_end_time||"23:59"}`}),e.campaign_id&&i.jsx("p",{className:"text-xs text-amber-700 bg-amber-50 p-2 rounded border border-amber-200",children:"💡 This ad is part of a campaign. If no schedule is set here, it will use the campaign's schedule."})]})}function fMe(){const e=mn(),[t,n]=O.useState(!1),[r,s]=O.useState(!1),[a,o]=O.useState({title:"",description:"",image_url:"",link_url:"",placement:"leaderboard_footer",start_date:"",end_date:"",schedule_days:[],schedule_start_time:"",schedule_end_time:""}),{data:l}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{}}),c=qt({mutationFn:async N=>{if(!(l!=null&&l.id))throw new Error("Settings not found");return ae.entities.Settings.update(l.id,{ad_display_interval_minutes:N})},onSuccess:()=>{e.invalidateQueries(["settings"]),tt.success("Ad display interval updated")},onError:N=>{tt.error("Failed to update interval: "+N.message)}}),{data:u}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me()}),{data:h=[]}=qe({queryKey:["adminAds"],queryFn:()=>ae.entities.Advertisement.filter({is_admin_ad:!0})}),d=qt({mutationFn:async N=>ae.entities.Advertisement.create({...N,is_admin_ad:!0,creator_id:u.id,creator_email:u.email,status:"paused",ai_moderation_status:"bypassed",impressions_purchased:999999,impressions_remaining:999999}),onSuccess:()=>{e.invalidateQueries(["adminAds"]),n(!1),_(),tt.success('✅ Ad created! Click "Push Live" to activate it.')}}),m=qt({mutationFn:({id:N,status:j})=>ae.entities.Advertisement.update(N,{status:j}),onSuccess:()=>{e.invalidateQueries(["adminAds"]),tt.success("Ad status updated")}}),g=qt({mutationFn:N=>ae.entities.Advertisement.delete(N),onSuccess:()=>{e.invalidateQueries(["adminAds"]),tt.success("Ad deleted")}}),w=qt({mutationFn:async N=>(await ae.functions.invoke("adPushControl",{action:"push",adId:N})).data,onSuccess:()=>{e.invalidateQueries(["adminAds"]),tt.success("🚀 Ad pushed live to all devices!")},onError:N=>{console.error("❌ Push failed:",N),tt.error("Failed: "+N.message)}}),v=qt({mutationFn:async()=>(await ae.functions.invoke("adPushControl",{action:"retract"})).data,onSuccess:()=>{e.invalidateQueries(["adminAds"]),tt.success("🛑 All ads retracted from all devices!")},onError:N=>{console.error("❌ Retract failed:",N),tt.error("Failed: "+N.message)}}),b=async N=>{const j=N.target.files[0];if(j){s(!0);try{const{file_url:S}=await ae.integrations.Core.UploadFile({file:j});o({...a,image_url:S}),tt.success("Image uploaded")}catch{tt.error("Failed to upload image")}s(!1)}},y=()=>
973{if(!a.title||!a.image_url){tt.error("Title and image are required");return}d.mutate(a)},_=()=>{o({title:"",description:"",image_url:"",link_url:"",placement:"leaderboard_footer",start_date:"",end_date:"",schedule_days:[],schedule_start_time:"",schedule_end_time:""})};return i.jsxs(i.Fragment,{children:[i.jsx(uMe,{}),i.jsxs(Me,{className:"mt-6",children:[i.jsx(st,{children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(at,{children:"Admin Ads (Free)"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{onClick:()=>v.mutate(),disabled:v.isPending,variant:"destructive",className:"font-bold",children:[i.jsx(J1,{className:"w-4 h-4 mr-2"}),"🛑 Retract All Ads"]}),i.jsxs(ue,{onClick:()=>n(!t),children:[i.jsx(li,{className:"w-4 h-4 mr-2"}),"Create Admin Ad"]})]})]})}),i.jsxs(Fe,{children:[(l==null?void 0:l.id)&&i.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6",children:[i.jsx(me,{className:"font-bold text-sm mb-2 block",children:"Ad Display Frequency Control"}),i.jsx("p",{className:"text-xs text-slate-600 mb-3",children:"Set minimum time between ad displays per user to avoid annoying users"}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Ee,{type:"number",min:"1",max:"120",value:(l==null?void 0:l.ad_display_interval_minutes)||10,onChange:N=>{const j=parseInt(N.target.value);j>=1&&j<=120&&(l!=null&&l.id)&&c.mutate(j)},className:"w-24",disabled:c.isPending}),i.jsx("span",{className:"text-sm font-medium",children:"minutes between ads"})]}),i.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:["Current: Ads can appear once every ",i.jsxs("strong",{children:[(l==null?void 0:l.ad_display_interval_minutes)||10," minutes"]})," per user"]})]}),t&&i.jsx("div",{className:"bg-slate-50 p-6 rounded-lg mb-6",children:i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"order-2 lg:order-1",children:[i.jsx("h4",{className:"font-bold text-slate-800 mb-3",children:"Live Preview"}),i.jsxs("div",{className:"border-2 border-indigo-300 rounded-lg overflow-hidden bg-white shadow-lg",children:[a.image_url?i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:a.image_url,alt:"Preview",className:"w-full h-auto object-cover"}),i.jsx("div",{className:"absolute top-2 right-2 text-[8px] bg-white/80 px-1.5 py-0.5 rounded text-slate-500",children:"Sponsored"})]}):i.jsxs("div",{className:"w-full h-48 bg-gradient-to-br from-slate-100 to-slate-200 flex flex-col items-center justify-center",children:[i.jsx(ma,{className:"w-12 h-12 text-slate-400 mb-2"}),i.jsx("span",{className:"text-slate-500 text-sm",children:"Upload image to preview"})]}),i.jsxs("div",{className:"p-4",children:[i.jsx("h4",{className:"font-bold text-sm",children:a.title||"Ad title will appear here..."}),a.description&&i.jsx("p",{className:"text-xs text-slate-600 mt-1",children:a.description}),a.link_url&&i.jsxs("div",{className:"flex items-center gap-1 text-xs text-indigo-600 mt-2",children:[i.jsx(ws,{className:"w-3 h-3"}),i.jsx("span",{children:"Learn more"})]})]})]}),i.jsxs("div",{className:"mt-3 bg-indigo-50 border border-indigo-200 rounded-lg p-3",children:[i.jsxs("p",{className:"text-xs text-indigo-800",children:[i.jsx("strong",{children:"Placement:"})," ",a.placement==="leaderboard_footer"?"Leaderboard Footer":"Hub Tile"]}),i.jsx("p",{className:"text-xs text-indigo-600 mt-1",children:"⚡ Admin ad • Free • Unlimited impressions"})]})]}),i.jsxs("div",{className:"order-1 lg:order-2 space-y-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Title *"}),i.jsx(Ee,{value:a.title,onChange:N=>o({...a,title:N.target.value}),placeholder:"Ad title"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Description (Optional)"}),i.jsx(Ee,{value:a.description,onChange:N=>o({...a,description:N.target.value}),placeholder:"Short description"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Image *"}),i.jsx(Ee,{type:"file",accept:"image/*",onChange:b,disabled:r}),a.image_url&&i.jsx("img",{src:a.image_url,alt:"Preview",className:"mt-2 h-32 object-contain"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Link URL (Optional)"}),i.jsx(Ee,{value:a.link_url,onChange:N=>o({...a,link_url:N.target.value}),placeholder:"https://..."})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Placement"}),i.jsxs(Xt,{value:a.placement,onValueChange:N=>o({...a,placement:N}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"leaderboard_footer",children:"Leaderboard Footer"}),i.jsx(Ie,{value:"hub_tile",children:"Hub Tile"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Start Date (Optional)"}),i.jsx(Ee,{type:"date",value:a.start_date,onChange:N=>o({...a,start_date:N.target.value})})]}),i.jsxs("div",{children:[i.jsx(me,{children:"End Date (Optional)"}),i.jsx(Ee,{type:"date",value:a.end_date,onChange:N=>o({...a,end_date:N.target.value})})]})]}),i.jsx("div",{className:"col-span-2",children:i.jsx(dMe,{schedule:a,onChange:N=>o(N)})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{onClick:y,disabled:d.isPending,children:"Create Ad"}),i.jsx(ue,{variant:"outline",onClick:()=>n(!1),children:"Cancel"})]})]})]})}),i.jsx("div",{className:"space-y-4",children:h.map(N=>i.jsxs("div",{className:"border rounded-lg p-4 flex items-center gap-4",children:[i.jsx("img",{src:N.image_url,alt:N.title,className:"w-24 h-24 object-cover rounded"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-bold",children:N.title}),N.description&&i.jsx("p",{className:"text-sm text-slate-600",children:N.description}),i.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[i.jsx(nt,{variant:N.status==="active"?"default":"secondary",children:N.status}),i.jsx("span",{className:"text-xs text-slate-500",children:N.placement.replace("_"," ")})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{onClick:()=>w.mutate(N.id),disabled:w.isPending,className:"bg-gradient-to-r from-green-600 to-emerald-600 hover:from-green-700 hover:to-emerald-700 text-white font-bold shadow-lg hover:shadow-xl transition-all hover:scale-105",children:[i.jsx(_s,{className:"w-4 h-4 mr-2"}),"🚀 Push Live to All Users"]}),N.link_url&&i.jsx(ue,{size:"sm",variant:"outline",asChild:!0,children:i.jsx("a",{href:N.link_url,target:"_blank",rel:"noopener noreferrer",children:i.jsx(ws,{className:"w-4 h-4"})})}),i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>m.mutate({id:N.id,status:N.status==="active"?"paused":"active"}),children:N.status==="active"?i.jsx(J1,{className:"w-4 h-4"}):i.jsx(_s,{className:"w-4 h-4"})}),i.jsx(ue,{size:"sm",variant:"destructive",onClick:()=>{confirm("Delete this ad?")&&g.mutate(N.id)},children:i.jsx(ci,{className:"w-4 h-4"})})]})]},N.id))})]})]})]})}function hMe(){const e=mn(),{data:t=[]}=qe({queryKey:["userAds"],queryFn:()=>ae.entities.Advertisement.filter({is_admin_ad:!1})}),n=qt({mutationFn:h=>ae.entities.Advertisement.update(h,{status:"active",ai_moderation_status:"approved",admin_override:!0,start_date:new Date().toISOString().split("T")[0]}),onSuccess:()=>
973{e.invalidateQueries(["userAds"]),tt.success("🚀 Ad approved and pushed live!")}}),r=qt({mutationFn:async h=>{await ae.entities.Advertisement.update(h,{status:"active",start_date:new Date().toISOString().split("T")[0]})},onSuccess:()=>{e.invalidateQueries(["userAds"]),tt.success("🚀 Ad pushed live!")}}),s=qt({mutationFn:({id:h,reason:d})=>ae.entities.Advertisement.update(h,{status:"rejected",ai_moderation_status:"rejected",ai_rejection_reason:d,admin_override:!0}),onSuccess:()=>{e.invalidateQueries(["userAds"]),tt.success("Ad rejected")}}),a=qt({mutationFn:({id:h,status:d})=>ae.entities.Advertisement.update(h,{status:d}),onSuccess:()=>{e.invalidateQueries(["userAds"]),tt.success("Ad status updated")}}),o=qt({mutationFn:h=>ae.entities.Advertisement.delete(h),onSuccess:()=>{e.invalidateQueries(["userAds"]),tt.success("Ad deleted")}}),l=t.filter(h=>h.status==="pending_review"),c=t.filter(h=>h.status==="active"),u=t.filter(h=>!["pending_review","active"].includes(h.status));return i.jsxs(Me,{children:[i.jsx(st,{children:i.jsx(at,{children:"User Ads & Moderation"})}),i.jsxs(Fe,{className:"space-y-6",children:[l.length>0&&i.jsxs("div",{children:[i.jsxs("h3",{className:"font-bold text-lg mb-3 flex items-center gap-2",children:[i.jsx(ba,{className:"w-5 h-5 text-orange-500"}),"Pending Review (",l.length,")"]}),i.jsx("div",{className:"space-y-4",children:l.map(h=>i.jsx("div",{className:"border-2 border-orange-200 rounded-lg p-4 bg-orange-50",children:i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("img",{src:h.image_url,alt:h.title,className:"w-32 h-32 object-cover rounded"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h4",{className:"font-bold text-lg",children:h.title}),h.description&&i.jsx("p",{className:"text-sm text-slate-700 mt-1",children:h.description}),i.jsxs("div",{className:"mt-2 space-y-1 text-sm",children:[i.jsxs("div",{children:[i.jsx("strong",{children:"Creator:"})," ",h.creator_email]}),i.jsxs("div",{children:[i.jsx("strong",{children:"Placement:"})," ",h.placement.replace("_"," ")]}),i.jsxs("div",{children:[i.jsx("strong",{children:"Impressions:"})," ",h.impressions_purchased.toLocaleString()]}),i.jsxs("div",{children:[i.jsx("strong",{children:"Paid:"})," €",h.total_paid.toFixed(2)]})]}),h.link_url&&i.jsxs("a",{href:h.link_url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 text-sm flex items-center gap-1 mt-2",children:[i.jsx(ws,{className:"w-3 h-3"})," ",h.link_url]})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs(ue,{size:"sm",className:"bg-gradient-to-r from-green-600 to-emerald-600 hover:from-green-700 hover:to-emerald-700 font-bold",onClick:()=>n.mutate(h.id),children:[i.jsx(Ch,{className:"w-4 h-4 mr-1"}),"Approve & Push Live"]}),i.jsxs(ue,{size:"sm",variant:"destructive",onClick:()=>{const d=prompt("Rejection reason:");d&&s.mutate({id:h.id,reason:d})},children:[i.jsx(ya,{className:"w-4 h-4 mr-1"}),"Reject"]})]})]})},h.id))})]}),i.jsxs("div",{children:[i.jsxs("h3",{className:"font-bold text-lg mb-3",children:["Active User Ads (",c.length,")"]}),i.jsx("div",{className:"space-y-4",children:c.map(h=>i.jsxs("div",{className:"border rounded-lg p-4 flex items-center gap-4",children:[i.jsx("img",{src:h.image_url,alt:h.title,className:"w-24 h-24 object-cover rounded"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h4",{className:"font-bold",children:h.title}),i.jsx("p",{className:"text-sm text-slate-600",children:h.creator_email}),i.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[i.jsx(nt,{children:h.placement.replace("_"," ")}),i.jsxs("span",{className:"text-xs text-slate-600",children:[h.impressions_remaining.toLocaleString()," / ",h.impressions_purchased.toLocaleString()," left"]})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>a.mutate({id:h.id,status:"paused"}),children:i.jsx(J1,{className:"w-4 h-4"})}),i.jsx(ue,{size:"sm",variant:"destructive",onClick:()=>{confirm("Delete this ad?")&&o.mutate(h.id)},children:i.jsx(ci,{className:"w-4 h-4"})})]})]},h.id))})]}),u.length>0&&i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-lg mb-3",children:"Other Ads"}),i.jsx("div",{className:"space-y-4",children:u.map(h=>i.jsxs("div",{className:"border rounded-lg p-4 flex items-center gap-4",children:[i.jsx("img",{src:h.image_url,alt:h.title,className:"w-24 h-24 object-cover rounded"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h4",{className:"font-bold",children:h.title}),i.jsx("p",{className:"text-sm text-slate-600",children:h.creator_email}),i.jsx(nt,{variant:h.status==="rejected"?"destructive":"secondary",children:h.status}),h.ai_rejection_reason&&i.jsx("p",{className:"text-xs text-red-600 mt-1",children:h.ai_rejection_reason})]}),i.jsxs("div",{className:"flex gap-2",children:[h.status==="paused"&&i.jsxs(ue,{size:"sm",onClick:()=>r.mutate(h.id),className:"bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700",children:[i.jsx(_s,{className:"w-4 h-4 mr-1"}),"Push Live"]}),i.jsx(ue,{size:"sm",variant:"destructive",onClick:()=>{confirm("Delete this ad?")&&o.mutate(h.id)},children:i.jsx(ci,{className:"w-4 h-4"})})]})]}
973,h.id))})]})]})]})}function mMe(){const[e,t]=O.useState(null),[n,r]=O.useState(""),s=mn(),{data:a=[],isLoading:o}=qe({queryKey:["quizIssues"],queryFn:()=>ae.entities.QuizIssue.list("-created_date"),refetchInterval:3e4}),{data:l}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me()}),c=qt({mutationFn:({id:y,data:_})=>ae.entities.QuizIssue.update(y,_),onSuccess:()=>{s.invalidateQueries(["quizIssues"]),tt.success("Issue updated successfully"),t(null)}}),u=qt({mutationFn:y=>ae.entities.QuizIssue.delete(y),onSuccess:()=>{s.invalidateQueries(["quizIssues"]),tt.success("Issue deleted")}}),h=qt({mutationFn:async()=>{const y=await ae.entities.QuizIssue.list();await Promise.all(y.map(_=>ae.entities.QuizIssue.delete(_.id)))},onSuccess:()=>{s.invalidateQueries(["quizIssues"]),tt.success("All issues deleted")}}),d=(y,_)=>{c.mutate({id:y.id,data:{status:_,resolved_by:l==null?void 0:l.email,resolved_at:_==="fixed"||_==="dismissed"?new Date().toISOString():null}})},m=()=>{e&&c.mutate({id:e.id,data:{admin_notes:n}})},g=y=>{const _={new:"bg-red-100 text-red-800",reviewing:"bg-yellow-100 text-yellow-800",fixed:"bg-green-100 text-green-800",dismissed:"bg-gray-100 text-gray-800"};return _[y]||_.new},w=a.filter(y=>y.status==="new"),v=a.filter(y=>y.status==="reviewing"),b=a.filter(y=>y.status==="fixed"||y.status==="dismissed");return o?i.jsx(Me,{children:i.jsx(Fe,{className:"p-8 text-center",children:"Loading issues..."})}):i.jsxs(i.Fragment,{children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(ba,{className:"w-5 h-5"}),"Quiz Issues",w.length>0&&i.jsxs(nt,{className:"bg-red-500 text-white ml-2",children:[w.length," New"]})]}),a.length>0&&i.jsx(ue,{variant:"destructive",size:"sm",onClick:()=>{confirm(`Delete all ${a.length} issues? This cannot be undone.`)&&h.mutate()},children:"Delete All"})]})}),i.jsxs(Fe,{className:"space-y-6",children:[w.length>0&&i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold text-lg mb-3 text-red-600",children:"New Issues"}),i.jsx("div",{className:"space-y-3",children:w.map(y=>i.jsx("div",{className:"border-2 border-red-200 rounded-lg p-4 bg-red-50",children:i.jsxs("div",{className:"flex items-start justify-between mb-3",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsxs(nt,{className:"bg-indigo-600 text-white",children:["Q",y.question_number]}),i.jsx(nt,{className:g(y.status),children:y.status}),i.jsx("span",{className:"text-sm text-slate-600",children:new Date(y.created_date).toLocaleDateString()})]}),i.jsx("p",{className:"text-sm text-slate-700 mb-2",children:y.issue_description}),i.jsxs("div",{className:"text-xs text-slate-600",children:["Reported by: ",y.reporter_name," (",y.reporter_email,")"]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>{t(y),r(y.admin_notes||"")},children:i.jsx(du,{className:"w-4 h-4"})}),i.jsx(ue,{size:"sm",onClick:()=>d(y,"reviewing"),children:"Review"})]})]})},y.id))})]}),v.length>0&&i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold text-lg mb-3 text-yellow-600",children:"Under Review"}),i.jsx("div",{className:"space-y-3",children:v.map(y=>i.jsx("div",{className:"border rounded-lg p-4 bg-yellow-50",children:i.jsxs("div",{className:"flex items-start justify-between mb-3",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsxs(nt,{className:"bg-indigo-600 text-white",children:["Q",y.question_number]}),i.jsx(nt,{className:g(y.status),children:y.status})]}),i.jsx("p",{className:"text-sm text-slate-700 mb-2",children:y.issue_description}),i.jsxs("div",{className:"text-xs text-slate-600",children:["By: ",y.reporter_name," • ",new Date(y.created_date).toLocaleDateString()]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>{t(y),r(y.admin_notes||"")},children:i.jsx(Wo,{className:"w-4 h-4"})}),i.jsxs(ue,{size:"sm",className:"bg-green-600 hover:bg-green-700",onClick:()=>d(y,"fixed"),children:[i.jsx(Cn,{className:"w-4 h-4 mr-1"}),"Fixed"]}),i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>d(y,"dismissed"),children:i.jsx(ya,{className:"w-4 h-4"})})]})]})},y.id))})]}),b.length>0&&i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold text-lg mb-3 text-slate-600",children:"Resolved"}),i.jsx("div",{className:"space-y-2",children:b.slice(0,5).map(y=>i.jsx("div",{className:"border rounded p-3 bg-slate-50",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsxs(nt,{className:"bg-slate-600 text-white text-xs",children:["Q",y.question_number]}),i.jsx(nt,{className:g(y.status),children:y.status})]}),i.jsx("p",{className:"text-sm text-slate-600 truncate",children:y.issue_description})]}),i.jsx(ue,{size:"sm",variant:"ghost",onClick:()=>{confirm("Delete this issue?")&&u.mutate(y.id)},children:i.jsx(ya,{className:"w-4 h-4"})})]})},y.id))})]}),a.length===0&&i.jsxs("div",{className:"text-center py-12 text-slate-600",children:[i.jsx(ba,{className:"w-12 h-12 mx-auto mb-4 text-slate-400"}),i.jsx("p",{className:"text-lg font-medium",children:"No issues reported yet"}
973),i.jsx("p",{className:"text-sm",children:"Quiz issue reports will appear here"})]})]})]}),i.jsx(rn,{open:!!e,onOpenChange:y=>!y&&t(null),children:i.jsxs(en,{className:"max-w-2xl",children:[i.jsx(vn,{children:i.jsxs(sn,{children:["Issue Details - Question ",e==null?void 0:e.question_number]})}),e&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Status"}),i.jsx("div",{className:"flex gap-2 mt-2",children:["new","reviewing","fixed","dismissed"].map(y=>i.jsx(ue,{size:"sm",variant:e.status===y?"default":"outline",onClick:()=>d(e,y),children:y},y))})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Issue Description"}),i.jsx("div",{className:"mt-2 p-3 bg-slate-50 rounded border",children:e.issue_description})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Reporter"}),i.jsx("div",{className:"mt-1",children:e.reporter_name})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Email"}),i.jsx("div",{className:"mt-1",children:e.reporter_email})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Quiz Date"}),i.jsx("div",{className:"mt-1",children:e.quiz_date?new Date(e.quiz_date).toLocaleDateString():"N/A"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Reported On"}),i.jsx("div",{className:"mt-1",children:new Date(e.created_date).toLocaleDateString()})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Admin Notes"}),i.jsx(nr,{value:n,onChange:y=>r(y.target.value),placeholder:"Add internal notes about this issue...",rows:4,className:"mt-2"}),i.jsx(ue,{size:"sm",className:"mt-2",onClick:m,disabled:n===(e.admin_notes||""),children:"Save Notes"})]}),e.resolved_by&&i.jsxs("div",{className:"border-t pt-4 text-sm text-slate-600",children:["Resolved by ",e.resolved_by," on ",new Date(e.resolved_at).toLocaleDateString()]})]})]})})]})}const id=e=>e?e.toLowerCase().trim().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g," ").trim():"",pMe=e=>{const t=e||0;return t<=3?-1*t:-3-2*(t-3)},C8=(e,t,n,r)=>{const s=t||0,a=n||0,o=r||0,c=(e||0)+4*s+3*a+2*o,u=pMe(s);return{basePoints:c,handicap:u,totalPoints:c}},gMe=e=>{if(!e)return null;const t=e.split("/");if(t.length===3){const[n,r,s]=t;return`${s}-${r.padStart(2,"0")}-${n.padStart(2,"0")}`}return e};function vMe(){const[e,t]=O.useState(null),[n,r]=O.useState([]),[s,a]=O.useState([]),[o,l]=O.useState(null),[c,u]=O.useState(!1),[h,d]=O.useState(!1),m=mn(),{data:g=[]}=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list()}),w=y=>{const _=y.target.files[0];if(!_)return;l(null),t(null),r([]),a([]);const N=new FileReader;N.onload=j=>{const C=j.target.result.split(`
974`).filter(V=>V.trim());if(C.length<2){l({type:"error",message:"CSV appears empty or has no data rows."});return}const P=V=>{const z=[];let L="",W=!1;for(let Q=0;Q<V.length;Q++)V[Q]==='"'?W=!W:V[Q]===","&&!W?(z.push(L.trim()),L=""):L+=V[Q];return z.push(L.trim()),z},A=P(C[0]).map(V=>V.replace(/^\uFEFF/,"").trim()),F=C.slice(1).map(V=>{const z=P(V),L={};return A.forEach((W,Q)=>{L[W]=z[Q]||""}),L}).filter(V=>Object.values(V).some(z=>z.trim()));t({headers:A,rows:F});const I=A.find(V=>/team.?name/i.test(V))||A[0],R=A.find(V=>/appear|att/i.test(V)),M=A.find(V=>/3rd|third/i.test(V)),$=A.find(V=>/2nd|second/i.test(V)),B=A.find(V=>/1st|first/i.test(V)),U=A.find(V=>/date/i.test(V)),G=F.map(V=>{var re;const z=((re=V[I])==null?void 0:re.trim())||"",L=parseInt(V[R])||0,W=parseInt(V[M])||0,Q=parseInt(V[$])||0,J=parseInt(V[B])||0,ne=gMe(V[U]),{basePoints:Y,handicap:ee,totalPoints:le}=C8(L,J,Q,W);return{teamName:z,appearances:L,finishes_1st:J,finishes_2nd:Q,finishes_3rd:W,last_attendance_date:ne,basePoints:Y,handicap:ee,totalPoints:le}}).filter(V=>V.teamName);r(G);const Z=[],X=new Set;for(const V of g){const z=id(V.team_name);if(X.has(z))continue;const L=g.filter(W=>W.id!==V.id&&!X.has(id(W.team_name))&&id(W.team_name)!==z);for(const W of L){const Q=id(W.team_name),J=id(V.team_name).replace(/\s/g,""),ne=id(W.team_name).replace(/\s/g,"");(J===ne||J.startsWith(ne)||ne.startsWith(J))&&(Z.push({keep:V,merge:W}),X.add(Q))}X.add(z)}a(Z)},N.readAsText(_)},v=async()=>{if(s.length!==0){d(!0);try{for(const{keep:y,merge:_}of s){const N=(y.appearances||0)+(_.appearances||0),j=(y.finishes_1st||0)+(_.finishes_1st||0),S=(y.finishes_2nd||0)+(_.finishes_2nd||0),C=(y.finishes_3rd||0)+(_.finishes_3rd||0),{basePoints:P,handicap:A,totalPoints:F}=C8(N,j,S,C);await ae.entities.Team.update(y.id,{appearances:N,finishes_1st:j,finishes_2nd:S,finishes_3rd:C,base_points:P,handicap:A,total_points:F}),await ae.entities.Team.delete(_.id);const I=await ae.entities.NameMapping.filter({mapped_team_id:_.id});for(const R of I)await ae.entities.NameMapping.update(R.id,{mapped_team_id:y.id,mapped_team_name:y.team_name})}
974a([]),m.invalidateQueries(["teams"]),l({type:"success",message:`Merged ${s.length} duplicate(s) successfully.`})}catch(y){l({type:"error",message:`Merge failed: ${y.message}`})}d(!1)}},b=async()=>{if(n.length){u(!0),l(null);try{const y=await ae.entities.Team.list();let _=0,N=0;for(const j of n){const S=id(j.teamName),C=y.find(A=>id(A.team_name)===S),P={appearances:j.appearances,finishes_1st:j.finishes_1st,finishes_2nd:j.finishes_2nd,finishes_3rd:j.finishes_3rd,base_points:j.basePoints,handicap:j.handicap,total_points:j.totalPoints,last_attendance_date:j.last_attendance_date,active:!0};C?(await ae.entities.Team.update(C.id,P),_++):(await ae.entities.Team.create({team_name:j.teamName,...P}),N++)}m.invalidateQueries(["teams"]),l({type:"success",message:`Done! Updated ${_} existing teams, created ${N} new teams. All points recalculated from master spreadsheet.`})}catch(y){l({type:"error",message:`Import failed: ${y.message}`})}u(!1)}};return i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(ma,{className:"w-5 h-5"}),"Master Spreadsheet Import"]})}),i.jsxs(Fe,{className:"space-y-5",children:[i.jsxs(vr,{className:"bg-blue-50 border-blue-200",children:[i.jsx(Sn,{className:"h-4 w-4 text-blue-600"}),i.jsxs(xr,{className:"text-blue-900",children:["Use this to sync your league table from your master Google Sheets export. It will ",i.jsx("strong",{children:"update existing teams"})," with the correct cumulative stats and create any missing ones. Points are recalculated automatically.",i.jsx("br",{}),"Expected columns: ",i.jsx("strong",{children:"Team Name, Appearances, Finishing 1st, Finishing 2nd, Finishing 3rd, Last Attendance Date"})]})]}),g.length>0&&i.jsxs("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-4 space-y-3",children:[i.jsxs("div",{className:"font-semibold text-orange-900 flex items-center gap-2",children:[i.jsx(B0,{className:"w-4 h-4"}),"Duplicate Team Detector"]}),s.length===0?i.jsx("p",{className:"text-sm text-orange-800",children:"No obvious duplicates found in current database."}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-sm text-orange-800",children:["Found ",i.jsx("strong",{children:s.length})," likely duplicate(s):"]}),i.jsx("ul",{className:"space-y-1",children:s.map((y,_)=>i.jsxs("li",{className:"text-sm bg-white border border-orange-200 rounded px-3 py-2 flex items-center justify-between",children:[i.jsxs("span",{children:[i.jsxs("strong",{children:['"',y.keep.team_name,'"']}),i.jsx("span",{className:"text-orange-600 mx-2",children:"←merge←"}),i.jsxs("strong",{children:['"',y.merge.team_name,'"']})]}),i.jsx("span",{className:"text-xs text-orange-600",children:"Will combine stats & delete duplicate"})]},_))}),i.jsxs(ue,{onClick:v,disabled:h,className:"bg-orange-600 hover:bg-orange-700",size:"sm",children:[i.jsx(B0,{className:"w-4 h-4 mr-2"}),h?"Merging...":`Merge ${s.length} Duplicate(s)`]})]})]}),i.jsxs("div",{children:[i.jsx(me,{htmlFor:"master-csv",children:"Upload Master CSV"}),i.jsx(Ee,{id:"master-csv",type:"file",accept:".csv",onChange:w,className:"mt-2"})]}),n.length>0&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3",children:i.jsxs("p",{className:"text-sm text-green-900 font-semibold",children:["✓ Parsed ",n.length," teams from CSV"]})}),i.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[i.jsx("div",{className:"bg-slate-50 px-3 py-2 border-b text-sm font-semibold",children:"Preview (first 10 rows)"}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-xs",children:[i.jsx("thead",{className:"bg-slate-100",children:i.jsxs("tr",{children:[i.jsx("th",{className:"text-left p-2",children:"Team Name"}),i.jsx("th",{className:"text-center p-2",children:"ATT"}),i.jsx("th",{className:"text-center p-2",children:"1st"}),i.jsx("th",{className:"text-center p-2",children:"2nd"}),i.jsx("th",{className:"text-center p-2",children:"3rd"}),i.jsx("th",{className:"text-center p-2",children:"Base Pts"}),i.jsx("th",{className:"text-center p-2",children:"Handicap"}),i.jsx("th",{className:"text-center p-2 font-bold",children:"Total"})]})}),i.jsx("tbody",{children:n.slice(0,10).map((y,_)=>i.jsxs("tr",{className:"border-t",children:[i.jsx("td",{className:"p-2",children:y.teamName}),i.jsx("td",{className:"p-2 text-center",children:y.appearances}),i.jsx("td",{className:"p-2 text-center",children:y.finishes_1st}),i.jsx("td",{className:"p-2 text-center",children:y.finishes_2nd}),i.jsx("td",{className:"p-2 text-center",children:y.finishes_3rd}),i.jsx("td",{className:"p-2 text-center",children:y.basePoints}),i.jsx("td",{className:"p-2 text-center text-red-600",children:y.handicap}),i.jsx("td",{className:"p-2 text-center font-bold",children:y.totalPoints})]},_))})]})})]}
974),i.jsxs(ue,{onClick:b,disabled:c,className:"w-full bg-indigo-600 hover:bg-indigo-700",children:[i.jsx(ma,{className:"w-4 h-4 mr-2"}),c?"Importing...":`Import & Sync ${n.length} Teams from Master Spreadsheet`]})]}),o&&i.jsxs(vr,{className:o.type==="error"?"bg-red-50 border-red-300":"bg-green-50 border-green-300",children:[o.type==="error"?i.jsx(Sn,{className:"h-4 w-4 text-red-600"}):i.jsx(Cn,{className:"h-4 w-4 text-green-600"}),i.jsx(xr,{className:o.type==="error"?"text-red-900":"text-green-900",children:o.message})]})]})]})}const xMe=e=>{const t=e||0;return t<=3?-1*t:-3-2*(t-3)},A8=(e,t,n,r)=>{const s=t||0,a=n||0,o=r||0,c=(e||0)+4*s+3*a+2*o,u=xMe(s);return{basePoints:c,handicap:u,totalPoints:c}},yMe=e=>{if(!e)return null;const t=String(e).split("/");if(t.length===3){const[n,r,s]=t;return`${s}-${r.padStart(2,"0")}-${n.padStart(2,"0")}`}return String(e).slice(0,10)},O8=e=>{const t=[];let n="",r=!1;for(let s=0;s<e.length;s++)e[s]==='"'?r=!r:e[s]===","&&!r?(t.push(n.trim()),n=""):n+=e[s];return t.push(n.trim()),t};function bMe(){const e=mn(),[t,n]=O.useState(""),[r,s]=O.useState(""),[a,o]=O.useState(""),[l,c]=O.useState(!1),[u,h]=O.useState(null),[d,m]=O.useState(null),[g,w]=O.useState([]),[v,b]=O.useState(!1),[y,_]=O.useState(!1),[N,j]=O.useState(null),{data:S}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{}}),{data:C=[]}=qe({queryKey:["weeklyResults"],queryFn:()=>
974ae.entities.WeeklyResult.list("-quiz_date",500)}),{data:P=[]}=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list()});se.useEffect(()=>{S!=null&&S.maintenance_message&&t===""&&n(S.maintenance_message)},[S==null?void 0:S.maintenance_message]);const A=(S==null?void 0:S.voided_weeks)||[],F=!!(S!=null&&S.league_table_offline),I=O.useMemo(()=>{const V=new Set;for(const z of C)z.quiz_date&&V.add(z.quiz_date);return Array.from(V).sort().reverse()},[C]),R=async V=>{const L=(await ae.entities.Settings.list())[0];L&&(await ae.entities.Settings.update(L.id,V),e.invalidateQueries(["settings"]))},M=async()=>{try{await R({league_table_offline:!F}),m({type:"success",message:`League table is now ${F?"ONLINE":"OFFLINE"}.`}),setTimeout(()=>m(null),3e3)}catch(V){m({type:"error",message:`Failed: ${V.message}`})}},$=async()=>{try{await R({maintenance_message:t}),m({type:"success",message:"Maintenance message saved."}),setTimeout(()=>m(null),3e3)}catch(V){m({type:"error",message:`Failed: ${V.message}`})}},B=async()=>{if(!a){h({type:"error",message:"Select a quiz date to void."});return}if(A.some(L=>L.quiz_date===a)){h({type:"error",message:"That week is already voided."});return}const z=C.filter(L=>L.quiz_date===a);if(z.length===0){h({type:"error",message:"No weekly results found for that date. Upload results first."});return}if(confirm(`Void the quiz on ${a}? This will subtract ${z.length} teams' results from the standings.`)){c(!0),h(null);try{for(const W of z){const Q=P.find(ge=>ge.id===W.team_id);if(!Q)continue;const J=Math.max(0,(Q.appearances||0)-1),ne=Math.max(0,(Q.finishes_1st||0)-(W.placement===1?1:0)),Y=Math.max(0,(Q.finishes_2nd||0)-(W.placement===2?1:0)),ee=Math.max(0,(Q.finishes_3rd||0)-(W.placement===3?1:0)),{basePoints:le,handicap:re,totalPoints:fe}=A8(J,ne,Y,ee);await ae.entities.Team.update(Q.id,{appearances:J,finishes_1st:ne,finishes_2nd:Y,finishes_3rd:ee,base_points:le,handicap:re,total_points:fe}
974),await ae.entities.WeeklyResult.update(W.id,{is_voided:!0})}const L=z[0];await R({voided_weeks:[...A,{quiz_date:a,week_number:L.week_number||null,reason:r||"Voided by admin",voided_at:new Date().toISOString()}]}),e.invalidateQueries(["teams"]),e.invalidateQueries(["weeklyResults"]),h({type:"success",message:`Week of ${a} voided. Standings updated.`}),o(""),s("")}catch(L){h({type:"error",message:`Void failed: ${L.message}`})}c(!1)}},U=async V=>{if(confirm(`Restore the quiz on ${V.quiz_date}? Its results will be added back to the standings.`)){c(!0),h(null);try{const z=C.filter(L=>L.quiz_date===V.quiz_date);for(const L of z){const W=P.find(fe=>fe.id===L.team_id);if(!W)continue;const Q=(W.appearances||0)+1,J=(W.finishes_1st||0)+(L.placement===1?1:0),ne=(W.finishes_2nd||0)+(L.placement===2?1:0),Y=(W.finishes_3rd||0)+(L.placement===3?1:0),{basePoints:ee,handicap:le,totalPoints:re}=A8(Q,J,ne,Y);await ae.entities.Team.update(W.id,{appearances:Q,finishes_1st:J,finishes_2nd:ne,finishes_3rd:Y,base_points:ee,handicap:le,total_points:re}
974),await ae.entities.WeeklyResult.update(L.id,{is_voided:!1})}await R({voided_weeks:A.filter(L=>L.quiz_date!==V.quiz_date)}),e.invalidateQueries(["teams"]),e.invalidateQueries(["weeklyResults"]),h({type:"success",message:`Week of ${V.quiz_date} restored.`})}catch(z){h({type:"error",message:`Restore failed: ${z.message}`})}c(!1)}},G=V=>{const z=V.target.files[0];if(!z)return;m(null),w([]),j(null);const L=new FileReader;L.onload=W=>{const J=W.target.result.split(`
975`).filter(_e=>_e.trim());if(J.length<2){m({type:"error",message:"CSV appears empty."});return}const ne=O8(J[0]).map(_e=>_e.replace(/^\uFEFF/,"").trim()),Y=J.slice(1).map(_e=>{const We=O8(_e),ze={};return ne.forEach((Xe,ke)=>{ze[Xe]=We[ke]||""}),ze}).filter(_e=>Object.values(_e).some(We=>We.trim())),ee=ne.find(_e=>/date|quiz/i.test(_e))||ne[0],le=ne.find(_e=>/week/i.test(_e)),re=ne.find(_e=>/team.?name|name/i.test(_e))||ne[1],fe=ne.find(_e=>/email|e-?mail/i.test(_e)),ge=ne.find(_e=>/place|pos|rank|finish/i.test(_e)),he=ne.find(_e=>/point|score/i.test(_e)),De=Y.map(_e=>{const We=yMe(_e[ee]),ze=le&&parseInt(_e[le])||null,Xe=(_e[re]||"").trim(),ke=fe?(_e[fe]||"").trim():"",Ae=ge&&parseInt(_e[ge])||0,Be=he&&parseFloat(_e[he])||0;return{quiz_date:We,week_number:ze,team_name:Xe,team_email:ke,placement:Ae,points_earned:Be,raw_data:_e}}).filter(_e=>_e.quiz_date&&_e.team_name);w(De),m({type:"info",message:`Parsed ${De.length} result rows across ${new Set(De.map(_e=>_e.quiz_date)).size} week(s).`})},L.readAsText(z)},Z=async()=>{if(g.length){b(!0),m(null);try{const V=await ae.entities.Team.list(),z=[];for(const L of g){const W=L.team_name.toLowerCase().trim();let Q=V.find(J=>(J.team_name||"").toLowerCase().trim()===W);Q||(Q=await ae.entities.Team.create({team_name:L.team_name,appearances:0,finishes_1st:0,finishes_2nd:0,finishes_3rd:0,base_points:0,handicap:0,total_points:0,active:!0}
975),V.push(Q)),z.push(ae.entities.WeeklyResult.create({quiz_date:L.quiz_date,week_number:L.week_number,team_id:Q.id,team_name:L.team_name,team_email:L.team_email,placement:L.placement,points_earned:L.points_earned,is_voided:!1,raw_data:L.raw_data}))}await Promise.all(z),e.invalidateQueries(["weeklyResults"]),e.invalidateQueries(["teams"]),m({type:"success",message:`Imported ${z.length} weekly result records.`}),w([])}catch(V){m({type:"error",message:`Import failed: ${V.message}`})}b(!1)}},X=async()=>{var V;if(C.length===0){m({type:"error",message:"No weekly results to audit."});return}_(!0),j(null);try{const z=P.map(J=>({team:J.team_name,appearances:J.appearances,f1:J.finishes_1st,f2:J.finishes_2nd,f3:J.finishes_3rd,base_points:J.base_points,handicap:J.handicap,total_points:J.total_points})),L=C.slice(0,200).map(J=>({date:J.quiz_date,team:J.team_name,placement:J.placement,pts:J.points_earned,voided:J.is_voided})),W=`You are auditing a quiz league's data for errors. Here is the scoring formula:
976- Base Points = appearances + (4 × 1st place finishes) + (3 × 2nd place finishes) + (2 × 3rd place finishes)
977- Handicap = -1 per 1st place win for wins 1-3, then -2 per win from the 4th win onwards
978- Total Points = Base Points only (handicap is tracked separately, never subtracted)
979
980TEAM CUMULATIVE STATS (JSON):
981${JSON.stringify(z)}
982
983WEEKLY RESULTS SAMPLE (JSON):
984${JSON.stringify(L)}
985
986Scrutinise this data and flag any of:
9871. Scoring errors (base_points or total_points don't match the formula)
9882. Handicap miscalculations
9893. Duplicate appearances (same team appearing twice in one week)
9904. Phantom teams (in weekly results but not in team list, or vice versa)
9915. Placement inconsistencies (e.g. two teams both marked 1st in the same week with no indication of a tie)
9926. Voided weeks still contributing to cumulative stats
993
994Return a JSON object with an "issues" array, each item having: team, issue_type, description, severity (low/medium/high). If no issues, return {"issues": []}.`,Q=await ae.integrations.Core.InvokeLLM({prompt:W,response_json_schema:{type:"object",properties:{issues:{type:"array",items:{type:"object",properties:{team:{type:"string"},issue_type:{type:"string"},description:{type:"string"},severity:{type:"string",enum:["low","medium","high"]}}}}}}});j((Q==null?void 0:Q.issues)||[]),m({type:"success",message:`Audit complete — ${((V=Q==null?void 0:Q.issues)==null?void 0:V.length)||0} issue(s) found.`})}catch(z){m({type:"error",message:`Audit failed: ${z.message}`})}_(!1)};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(WT,{className:"w-5 h-5"}),"League Table Maintenance Mode"]})}),i.jsxs(Fe,{className:"space-y-4",children:[i.jsxs(vr,{className:"bg-blue-50 border-blue-200",children:[i.jsx(Sn,{className:"h-4 w-4 text-blue-600"}),i.jsx(xr,{className:"text-blue-900",children:'Take the public league table offline temporarily. Visitors will see a friendly "check back later" message instead of the standings.'})]}),i.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg border-2 ${F?"bg-red-50 border-red-300":"bg-green-50 border-green-300"}`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(aB,{className:`w-5 h-5 ${F?"text-red-600":"text-green-600"}`}),i.jsxs("div",{children:[i.jsxs("p",{className:"font-semibold text-slate-900",children:["League table is currently ",i.jsx("span",{className:F?"text-red-600":"text-green-600",children:F?"OFFLINE":"ONLINE"})]}),i.jsx("p",{className:"text-sm text-slate-600",children:F?"Visitors see the maintenance message.":"Visitors see the full leaderboard."})]})]}),i.jsx(ai,{checked:F,onCheckedChange:M})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"maintenance-msg",children:"Maintenance Message"}),i.jsx(nr,{id:"maintenance-msg",value:t,onChange:V=>n(V.target.value),rows:2,placeholder:"We're currently updating the league table. Please check back later!"}),i.jsxs(ue,{onClick:$,variant:"outline",size:"sm",children:[i.jsx(Cn,{className:"w-4 h-4 mr-2"}),"Save Message"]})]})]})]}),i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(F0,{className:"w-5 h-5"}),"Void a Quiz Week"]})}),i.jsxs(Fe,{className:"space-y-4",children:[i.jsxs(vr,{className:"bg-amber-50 border-amber-200",children:[i.jsx(Sn,{className:"h-4 w-4 text-amber-600"}),i.jsx(xr,{className:"text-amber-900",children:"Voiding a week removes its results from the standings (appearances, podium finishes, and points are subtracted). The week stays visible in the public browser but marked as VOID. You can restore it later."})]}),A.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-semibold text-slate-700",children:"Currently voided weeks:"}),A.map((V,z)=>i.jsxs("div",{className:"flex items-center justify-between bg-red-50 border border-red-200 rounded-lg px-3 py-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(nt,{className:"bg-red-500 text-white",children:"VOID"}),i.jsx("span",{className:"font-medium text-slate-800",children:V.quiz_date}),V.week_number&&i.jsxs("span",{className:"text-xs text-slate-500",children:["Week ",V.week_number]}),V.reason&&i.jsxs("span",{className:"text-xs text-slate-500 italic",children:["— ",V.reason]})]}),i.jsxs(ue,{onClick:()=>U(V),variant:"outline",size:"sm",disabled:l,children:[i.jsx(nne,{className:"w-3 h-3 mr-1"}),"Restore"]})]},z))]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"void-date",children:"Qu
994iz Date to Void"}),i.jsxs("select",{id:"void-date",value:a,onChange:V=>o(V.target.value),className:"w-full h-9 rounded-md border border-input bg-transparent px-3 text-sm",children:[i.jsx("option",{value:"",children:"Select a date…"}),I.map(V=>i.jsxs("option",{value:V,disabled:A.some(z=>z.quiz_date===V),children:[V,A.some(z=>z.quiz_date===V)?" (already voided)":""]},V))]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"void-reason",children:"Reason (optional)"}),i.jsx(Ee,{id:"void-reason",value:r,onChange:V=>s(V.target.value),placeholder:"e.g. Quiz cancelled, scoring error"})]})]}),i.jsxs(ue,{onClick:B,disabled:l,className:"bg-red-600 hover:bg-red-700",children:[i.jsx(F0,{className:"w-4 h-4 mr-2"}),l?"Voiding…":"Void This Week"]}),u&&i.jsxs(vr,{className:u.type==="error"?"bg-red-50 border-red-300":"bg-green-50 border-green-300",children:[u.type==="error"?i.jsx(Sn,{className:"h-4 w-4 text-red-600"}):i.jsx(Cn,{className:"h-4 w-4 text-green-600"}),i.jsx(xr,{className:u.type==="error"?"text-red-900":"text-green-900",children:u.message})]})]})]}),i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(ma,{className:"w-5 h-5"}),"Bulk Historical Results Upload"]})}),i.jsxs(Fe,{className:"space-y-4",children:[i.jsxs(vr,{className:"bg-blue-50 border-blue-200",children:[i.jsx(Sn,{className:"h-4 w-4 text-blue-600"}),i.jsxs(xr,{className:"text-blue-900",children:["Upload a CSV of all historical weekly results to populate the public Weekly Results browser. Expected columns (auto-detected): ",i.jsx("strong",{children:"Date, Week, Team Name, Email, Placement, Points"}),". Missing teams are created automatically."]})]}),i.jsxs("div",{children:[i.jsx(me,{htmlFor:"bulk-csv",children:"Upload Historical Results CSV"}),i.jsx(Ee,{id:"bulk-csv",type:"file",accept:".csv",onChange:G,className:"mt-2"})]}),g.length>0&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3",children:i.jsxs("p",{className:"text-sm text-green-900 font-semibold",children:["✓ Parsed ",g.length," rows across ",new Set(g.map(V=>V.quiz_date)).size," week(s)"]})}),i.jsxs("div",{className:"border rounded-lg overflow-hidden overflow-x-auto",children:[i.jsx("div",{className:"bg-slate-50 px-3 py-2 border-b text-sm font-semibold",children:"Preview (first 10 rows)"}),i.jsxs("table",{className:"w-full text-xs",children:[i.jsx("thead",{className:"bg-slate-100",children:i.jsxs("tr",{children:[i.jsx("th",{className:"text-left p-2",children:"Date"}),i.jsx("th",{className:"text-left p-2",children:"Team"}),i.jsx("th",{className:"text-left p-2",children:"Email"}),i.jsx("th",{className:"text-center p-2",children:"Place"}),i.jsx("th",{className:"text-center p-2",children:"Pts"})]})}),i.jsx("tbody",{children:g.slice(0,10).map((V,z)=>i.jsxs("tr",{className:"border-t",children:[i.jsx("td",{className:"p-2",children:V.quiz_date}),i.jsx("td",{className:"p-2",children:V.team_name}),i.jsx("td",{className:"p-2 text-slate-500",children:V.team_email||"—"}),i.jsx("td",{className:"p-2 text-center",children:V.placement||"—"}),i.jsx("td",{className:"p-2 text-center",children:V.points_earned})]},z))})]})]}),i.jsxs(ue,{onClick:Z,disabled:v,className:"w-full bg-indigo-600 hover:bg-indigo-700",children:[i.jsx(ma,{className:"w-4 h-4 mr-2"}),v?"Importing…":`Import ${g.length} Results`]})]}),d&&i.jsxs(vr,{className:d.type==="error"?"bg-red-50 border-red-300":d.type==="success"?"bg-green-50 border-green-300":"bg-blue-50 border-blue-200",children:[d.type==="error"?i.jsx(Sn,{className:"h-4 w-4 text-red-600"}):d.type==="success"?i.jsx(Cn,{className:"h-4 w-4 text-green-600"}):i.jsx(Sn,{className:"h-4 w-4 text-blue-600"}),i.jsx(xr,{className:d.type==="error"?"text-red-900":d.type==="success"?"text-green-900":"text-blue-900",children:d.message})]}),i.jsxs("div",{className:"pt-4 border-t",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("div",{children:[i.jsxs("p",{className:"font-semibold text-slate-800 flex items-center gap-2",children:[i.jsx(dM,{className:"w-4 h-4"}),"AI Data Audit"]}),i.jsx("p",{className:"text-sm text-slate-500",children:"Cross-examine all stored results against the scoring formula for errors."})]}),i.jsxs(ue,{onClick:X,disabled:y||C.length===0,variant:"outline",children:[y?i.jsx(dr,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(dM,{className:"w-4 h-4 mr-2"}),y?"Auditing…":"Run Audit"]})]}),N!==null&&i.jsx("div",{className:"space-y-2",children:N.length===0?i.jsxs(vr,{className:"bg-green-50 border-green-300",children:[i.jsx(Cn,{className:"h-4 w-4 text-green-600"}),i.jsx(xr,{className:"text-green-900",children:"No issues found — the data looks clean!"})]}):N.map((V,z)=>i.jsxs("div",{className:`rounded-lg border p-3 ${V.severity==="high"?"bg-red-50 border-red-300":V.severity==="medium"?"bg-amber-50 border-amber-300":"bg-blue-50 border-blue-200"}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(nt,{className:V.severity==="high"?"bg-red-500 text-white":V.severity==="medium"?"bg-amber-500 text-white":"bg-blue-500 text-white",children:V.severity}),i.jsx("span",{className:"font-semibold text-slate-800 text-sm",children:V.issue_type}),V.team&&i.jsxs("span",{className:"text-xs text-slate-500",children:["— ",V.team]})]}),i.jsx("p",{className:"text-sm text-slate-700",children:V.description})]},z))})]})]})]})]})}function wMe(){const[e,t]=O.useState("import"),[n,r]=O.useState(null),[s,a]=O.useState([]),[o,l]=O.useState(!1),[c,u]=O.useState(!0),[h,d]=O.useState(""),[m,g]=O.useState(""),w=qi(),{data:v,isLoading:b}=qe({queryKey:["settings"],queryFn:async()=>{const U=await ae.entities.Settings.list();return U.length===0?await ae.entities.Settings.create({season_name:"Quiz League Season",total_weeks:10,current_week:0,show_handicap_coloring:!0,carousel_visible_rows:5,carousel_scroll_interval:3e3,carousel_pause_duration:2e3,admin_pin:"3190"}):U[0]}}),{data:y=[]}=qe({queryKey:["teamIssues"],queryFn:()=>ae.entities.TeamIssue.list(),enabled:o}),{data:_=[]}=qe({queryKey:["bookingRequests"],queryFn:()=>ae.entities.BookingRequest.list(),enabled:o}),{data:N=[]}=qe({queryKey:["quizIssues"],queryFn:()=>ae.entities.QuizIssue.list(),enabled:o}),j=y.filter(U=>U.status==="open").length,S=_.filter(U=>U.status==="new").length,C=N.filter(U=>U.status==="new").length,P=1800*1e3,A=se.useRef(null),F=se.useCallback(()=>{A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{localStorage.removeItem("admin_authenticated"),l(!1),u(!0)},P)},[]);O.useEffect(()=>{localStorage.getItem("admin_authenticated")==="true"&&(l(!0),u(!1))},[]),O.useEffect(()=>{if(!o)return;const U=["mousemove","mousedown","keydown","touchstart","scroll","click"];
994return U.forEach(G=>window.addEventListener(G,F)),F(),()=>{U.forEach(G=>window.removeEventListener(G,F)),A.current&&clearTimeout(A.current)}},[o,F]);const I=()=>{const U=(v==null?void 0:v.admin_pin)||"3190";h===U?(l(!0),u(!1),g(""),localStorage.setItem("admin_authenticated","true")):(g("Incorrect PIN. Please try again."),d(""))},R=()=>{localStorage.removeItem("admin_authenticated"),w(Ft("Public"))},M=()=>{w(Ft("Public"))},$=U=>{r(U),a(U.unmatchedTeams||[]),t("matching")},B=()=>{r(null),a([]),t("teams")};if(!o){const U=()=>{const G=window.location.href,Z=`${window.location.origin}/login?from_url=${encodeURIComponent(G)}`,X=`${window.location.origin}/api/apps/auth/logout?from_url=${encodeURIComponent(Z)}`;window.top.location.href=X};return i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-indigo-950 to-slate-900 flex items-center justify-center p-4",children:i.jsxs("div",{className:"w-full max-w-sm",children:[i.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl overflow-hidden",children:[i.jsxs("div",{className:"bg-gradient-to-r from-indigo-600 to-purple-600 px-6 py-5 text-center",children:[i.jsx("div",{className:"w-14 h-14 mx-auto bg-white/20 rounded-full flex items-center justify-center mb-2",children:i.jsx(no,{className:"w-7 h-7 text-white"})}),i.jsx("h2",{className:"text-xl font-bold text-white",children:"Admin Access"}),i.jsx("p",{className:"text-indigo-100 text-sm mt-0.5",children:"Enter your PIN to continue"})]}),i.jsxs("div",{className:"p-6 space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"admin-pin",className:"text-sm font-medium text-slate-700",children:"Admin PIN"}),i.jsx(Ee,{id:"admin-pin",type:"password",inputMode:"numeric",value:h,onChange:G=>{d(G.target.value),g("")},onKeyDown:G=>{G.key==="Enter"&&I()},placeholder:"••••",className:`text-center text-2xl tracking-[0.5em] h-14 ${m?"border-red-500 focus:border-red-500":""}`,autoFocus:!0,disabled:b,maxLength:10}),m&&i.jsx("p",{className:"text-sm text-red-600 text-center font-medium",children:m})]}),i.jsxs(ue,{onClick:I,className:"w-full h-12 text-base font-semibold",disabled:b||h.length===0,children:[i.jsx(no,{className:"w-4 h-4 mr-2"}),b?"Loading...":"Unlock Dashboard"]}),i.jsxs("div",{className:"pt-3 border-t border-slate-100 space-y-2",children:[i.jsxs(ue,{variant:"outline",onClick:U,className:"w-full h-11",children:[i.jsx(iA,{className:"w-4 h-4 mr-2"}),"Switch / Log In Account"]}),i.jsxs(ue,{variant:"ghost",onClick:M,className:"w-full h-11 text-slate-600",children:[i.jsx(BT,{className:"w-4 h-4 mr-2"}),"Back to Home"]})]})]})]}),i.jsx("p",{className:"text-center text-slate-400 text-xs mt-4",children:"Quiz league administrators only"})]})})}return i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 p-3 sm:p-6",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsxs("div",{className:"mb-6 sm:mb-8",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-4xl font-bold text-slate-900 mb-1 sm:mb-2",children:"Admin Dashboard"}),i.jsx("p",{className:"text-slate-600 text-sm sm:text-base",children:"Complete control center for your quiz league"})]}),i.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 flex-wrap",children:[C>0&&i.jsxs(ue,{onClick:()=>t("quiz-issues"),variant:"outline",className:"flex items-center gap-2 border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 text-xs sm:text-sm px-2 sm:px-4",children:[i.jsx(nA,{className:"w-4 h-4 sm:w-5 sm:h-5"}),i.jsxs("span",{className:"font-semibold",children:[C," Quiz Issue",C!==1?"s":""]})]}),S>0&&i.jsxs(ue,{onClick:()=>t("bookings"),variant:"outline",className:"flex items-center gap-2 border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 text-xs sm:text-sm px-2 sm:px-4",children:[i.jsx(Bc,{className:"w-4 h-4 sm:w-5 sm:h-5"}),i.jsxs("span",{className:"font-semibold",children:[S," New Booking",S!==1?"s":""]})]}),j>0&&i.jsxs(ue,{onClick:()=>t("issues"),variant:"outline",className:"flex items-center gap-2 border-red-200 bg-red-50 text-red-700 hover:bg-red-100 text-xs sm:text-sm px-2 sm:px-4",children:[i.jsx(Sn,{className:"w-4 h-4 sm:w-5 sm:h-5"}),i.jsxs("span",{className:"font-semibold",children:[j," Open Issue",j!==1?"s":""]})]}),i.jsxs(ue,{onClick:R,variant:"outline",className:"flex items-center gap-2",children:[i.jsx(iA,{className:"w-4 h-4"}),i.jsx("span",{children:"Logout"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 sm:gap-3 mt-4 sm:mt-6",children:[i.jsxs("button",{onClick:()=>t("teams"),className:"bg-white rounded-lg p-4 shadow-sm border-2 border-slate-200 hover:border-indigo-400 transition-all hover:shadow-md text-left",children:[i.jsx(Dr,{className:"w-6 h-6 text-indigo-600 mb-2"}),i.jsx("h3",{className:"font-bold text-slate-900",children:"Teams"}),i.jsx("p",{className:"text-xs text-slate-600",children:"Manage all teams"})]}),i.jsxs("button",{onClick:()=>t("import"),className:"bg-white rounded-lg p-4 shadow-sm border-2 border-slate-200 hover:border-blue-400 transition-all hover:shadow-md text-left",children:[i.jsx(ma,{className:"w-6 h-6 text-blue-600 mb-2"}),i.jsx("h3",{className:"font-bold text-slate-900",children:"Import"}),i.jsx("p",{className:"text-xs text-slate-600",children:"Upload results"})]}),i.jsxs("button",{onClick:()=>t("raffles"),className:"bg-white rounded-lg p-4 shadow-sm border-2 border-slate-200 hover:border-amber-400 transition-all hover:shadow-md text-left",children:[i.jsx(Vr,{className:"w-6 h-6 text-amber-600 mb-2"}),i.jsx("h3",{className:"font-bold text-slate-900",children:"Raffles"}),i.jsx("p",{className:"text-xs text-slate-600",children:"Manage draws"})]}),i.jsxs("button",{onClick:()=>t("ads"),className:"bg-white rounded-lg p-4 shadow-sm border-2 border-slate-200 hover:border-purple-400 transition-all hover:shadow-md text-left",children:[i.jsx(Dr,{className:"w-6 h-6 text-purple-600 mb-2"}),i.jsx("h3",{className:"font-bold text-slate-900",children:"Ads"}),i.jsx("p",{className:"text-xs text-slate-600",children:"Push ads live"})]})]})]}),i.jsxs(tu,{value:e,onValueChange:t,className:"space-y-6",children:[i.jsxs(Wl,{className:"flex flex-wrap sm:flex-nowrap sm:overflow-x-auto justify-start sm:justify-center w-full h-auto gap-2 p-2 bg-slate-100 border border-slate-200 rounded-xl",children:[i.jsxs(Wt,{value:"import",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(ma,{className:"w-4 h-4"}),i.jsx("span",{children:"Import"})]}),i.jsxs(Wt,{value:"matching",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",disabled:!n,children:[i.jsx(rA,{className:"w-4 h-4"}),i.jsx("span",{children:"Match"}),s.length>0&&i.jsx(nt,{className:"ml-1 bg-red-500 text-white",children:s.length})]}),i.jsxs(Wt,{value:"teams",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(Dr,{className:"w-4 h-4"}),i.jsx("span",{children:"Teams"})]}),i.jsxs(Wt,{value:"issues",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(Sn,{className:"w-4 h-4"}),i.jsx("span",{children:"Issues"}),j>0&&i.jsx(nt,{className:"ml-1 bg-red-500 text-white",children:j})]}),i.jsxs(Wt,{value:"quiz-issues",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(nA,{className:"w-4 h-4"}
994),i.jsx("span",{children:"Quiz Q's"}),C>0&&i.jsx(nt,{className:"ml-1 bg-amber-500 text-white",children:C})]}),i.jsxs(Wt,{value:"bookings",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(Bc,{className:"w-4 h-4"}),i.jsx("span",{children:"Bookings"}),S>0&&i.jsx(nt,{className:"ml-1 bg-orange-500 text-white",children:S})]}),i.jsxs(Wt,{value:"raffles",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(Vr,{className:"w-4 h-4"}),i.jsx("span",{children:"Raffles"})]}),i.jsxs(Wt,{value:"games",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(vs,{className:"w-4 h-4"}),i.jsx("span",{children:"Quiz Games"})]}),i.jsxs(Wt,{value:"ads",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(Dr,{className:"w-4 h-4"}),i.jsx("span",{children:"Ads"})]}),i.jsxs(Wt,{value:"events",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(Fn,{className:"w-4 h-4"}),i.jsx("span",{children:"Events"})]}),i.jsxs(Wt,{value:"community",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(Dr,{className:"w-4 h-4"}),i.jsx("span",{children:"Comm."})]}),i.jsxs(Wt,{value:"newsletter",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(Dd,{className:"w-4 h-4"}),i.jsx("span",{children:"News"})]}),i.jsxs(Wt,{value:"contacts",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(Vo,{className:"w-4 h-4"}),i.jsx("span",{children:"Contacts"})]}),i.jsxs(Wt,{value:"messages",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(Wo,{className:"w-4 h-4"}),i.jsx("span",{children:"Messages"})]}),i.jsxs(Wt,{value:"analytics",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(dee,{className:"w-4 h-4"}),i.jsx("span",{children:"Stats"})]}),i.jsxs(Wt,{value:"settings",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-indigo-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(VT,{className:"w-4 h-4"}),i.jsx("span",{children:"Settings"})]}),i.jsxs(Wt,{value:"master-import",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-green-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(ma,{className:"w-4 h-4"}),i.jsx("span",{children:"Master CSV"})]}),i.jsxs(Wt,{value:"maintenance",className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all hover:bg-white/50 data-[state=active]:bg-amber-600 data-[state=active]:text-white data-[state=active]:shadow-sm",children:[i.jsx(WT,{className:"w-4 h-4"}),i.jsx("span",{children:"Maintenance"})]})]}),i.jsx(Yt,{value:"import",className:"mt-6",children:i.jsx(Che,{onImportComplete:$})}),i.jsx(Yt,{value:"matching",className:"mt-6",children:i.jsx(Ahe,{importData:n,pendingMatches:s,setPendingMatches:a,onComplete:B})}),i.jsx(Yt,{value:"teams",className:"mt-6",children:i.jsx(pxe,{})}),i.jsx(Yt,{value:"issues",className:"mt-6",children:i.jsx(H0e,{})}),i.jsx(Yt,{value:"quiz-issues",className:"mt-6",children:i.jsx(mMe,{})}),i.jsx(Yt,{value:"bookings",className:"mt-6",children:i.jsx(x5e,{})}),i.jsx(Yt,{value:"raffles",className:"mt-6",children:i.jsx(tMe,{})}),i.jsx(Yt,{value:"games",className:"mt-6",children:i.jsx(nMe,{})}),i.jsxs(Yt,{value:"ads",className:"mt-6",children:[i.jsx(fMe,{}),i.jsx("div",{className:"mt-6",children:i.jsx(hMe,{})})]}),i.jsx(Yt,{value:"events",className:"mt-6",children:i.jsx(K0e,{})}),i.jsxs(Yt,{value:"community",className:"mt-6",children:[i.jsx(Jye,{}),i.jsxs("div",{className:"mt-8 pt-8 border-t",children:[i.jsx("h2",{className:"text-xl font-bold mb-4",children:"Weekly AI Quiz Generator"}),i.jsx(g5e,{})]}),i.jsxs("div",{className:"mt-8 pt-8 border-t",children:[i.jsx("h2",{className:"text-xl font-bold mb-4",children:"Community Quizzes"}),i.jsx(p5e,{})]})]}),i.jsx(Yt,{value:"newsletter",className:"mt-6",children:i.jsx(Zye,{})}),i.jsx(Yt,{value:"contacts",className:"mt-6",children:i.jsx(m5e,{})}),i.jsx(Yt,{value:"messages",className:"mt-6",children:i.jsx(v5e,{})}),i.jsx(Yt,{value:"analytics",className:"mt-6",children:i.jsx(d5e,{})}),i.jsx(Yt,{value:"settings",className:"mt-6",children:i.jsx(jxe,{})}),i.jsx(Yt,{value:"master-import",className:"mt-6",children:i.jsx(vMe,{})}),i.jsx(Yt,{value:"maintenance",className:"mt-6",children:i.jsx(bMe,{})})]})]})})}function jMe(){const[e,t]=O.useState("All");se.useEffect(()=>{document.title="Quiz Night Blog | Tips, Trivia & Pub Quiz Advice | Live Quizzing";const o=document.querySelector('meta[name="description"]');o&&o.setAttribute("content","Expert pub quiz tips, trivia strategies, and quiz night guides from Live Quizzing Ireland. Learn how to win your next quiz night.")},[]);const{data:n=[],isLoading:r}=qe({queryKey:["blogPosts"],queryFn:async()=>(await ae.entities.Newsletter.list()).filter(l=>l.is_published).sort((l,c)=>new Date(c.publish_date)-new Date(l.publish_date))}),s=["All","Quiz Tips","Trivia","News","Guides"],a=[{title:"How to Win Your Pub Quiz: 10 Proven Strategies",date:"February 2026",category:"Qu
994iz Tips",body:["Winning a pub quiz isn't just about knowing facts — it's about strategy, teamwork, and knowing when to trust your gut. After hosting hundreds of quiz nights across Ireland, we've compiled the most effective tips from our top-performing teams.","1. Build a balanced team. The best quiz teams have specialists across different categories — one person strong in sport, another in history, someone who knows their pop culture. Avoid teams where everyone has the same knowledge base.","2. Don't second-guess yourself. Studies consistently show that your first instinct is correct more often than not. The biggest mistake in quiz nights is changing a correct answer to a wrong one.","3. Manage your joker wisely. Most quizzes allow you to double your points on one round. Play your joker on a category your team is strongest in — not on a topic you 'hope' to do well at.","4. Listen carefully to the question. Quizmasters often hide the key detail early in a long question. Jot down what you hear as you go rather than waiting until the end.","5. Stay calm under pressure. Quiz nights are meant to be fun. Teams that stay relaxed and enjoy the process tend to perform better than those who get frustrated."]},{title:"Understanding Handicap Scoring in the Live Quizzing League",date:"January 2026",category:"Guides",body:["The Live Quizzing League uses a handicap scoring system designed to keep things competitive for teams of all experience levels. Here's exactly how it works and how it affects your standing.","Base points are awarded based on your finishing position each week. First place earns the most points, with descending awards down the leaderboard. These points accumulate throughout the season.","The handicap system adjusts for dominant teams. The more first-place finishes a team accumulates, the larger the handicap applied to their total score. This gives newer or less-dominant teams a real chance to compete at the top of the table.","Total points = base points + handicap adjustment. This means that a team with many wins may actually have a lower total than a consistently placing team — making every week's result meaningful right to the end of the season.","Season standings reset annually. Each new season gives every team a fresh start, which means even the longest-running champions have to earn their place at the top again."]},{title:"The History of the Pub Quiz in Ireland",date:"December 2025",category:"Trivia",body:["The pub quiz is as much a part of Irish culture as Guinness and GAA. But where did it come from, and how did it evolve into the sophisticated, tech-driven experience we know today?","The pub quiz is generally believed to have originated in the UK during the 1970s, introduced as a way to drive mid-week footfall into pubs. Sharon Burns and Tom Porter are often credited 
994with formalising the format in the late 1970s in Britain.","In Ireland, the pub quiz grew rapidly through the 1980s and 1990s as a staple of community life. Parish halls, sports clubs, and local pubs all hosted regular quiz nights that drew large crowds and fostered fierce — but friendly — rivalries.","Today, the format has evolved significantly. Digital platforms allow for live scoring, team registration, real-time leaderboards, and even remote participation. Live Quizzing is at the forefront of this evolution in Ireland, combining the warmth of the traditional quiz night with modern technology.","The core appeal remains unchanged: gathering people together, testing knowledge, and sharing the joy of a well-answered question. That's something no amount of technology changes."]},{title:"Top 5 Quiz Categories That Win or Lose Nights",date:"November 2025",category:"Quiz Tips",body:["In years of hosting quiz nights across Ireland, certain categories consistently separate the winning teams from the rest. Here are the five most decisive rounds — and how to prepare for them.","Music. Music rounds are often the great leveller. From 1970s rock to modern pop, the range is vast. Teams that practice identifying artists from short clips have a significant advantage. Tip: make sure your team has at least one person under 30 for contemporary hits.","Sport. Sport questions disproportionately favour Irish and UK audiences when they cover local content, but can trip up the same teams when questions venture into American sports or Olympic history. Tip: brush up on Olympic sports and international athletics.","Current Affairs. Recent news questions reward teams that actually read the news rather than just scroll social media headlines. Tip: agree before the night that one team member will do a 10-minute news catch-up on the day of the quiz.","Science & Nature. Often underestimated, science rounds catch many teams off guard. Basic biology, chemistry, and space questions appear regularly. Tip: a quick refresh on the periodic table's most common elements and the planets can earn easy points.","Picture Rounds. Logo identification, celebrity faces, and landmark recognition are common. Teams who take time to study the sheet carefully rather than rushing answers tend to score higher."]},{title:"How to Host a Great Quiz Night: A Beginner's Guide",date:"October 2025",category:"Guides",body:["Hosting a quiz night can seem daunting, but with the right preparation it's one of the most rewarding events you can run — whether for a charity, a corporate team-building event, or just a local social gathering.","Structure your quiz properly. A typical quiz has 6–8 rounds of 10 questions each. Include a mix of categories — general knowledge, music, sport, current affairs, and a picture round. Variety keeps all participants engaged.","Write clear questions. Ambiguous questions are the enemy of a good quiz. Every question should have one unambiguous correct answer. Test your questions on someone else before the night.","Manage the energy of the room. A good quizmaster reads the crowd. If energy drops, throw in a fun bonus question or light-hearted comment. Keep the pace moving — long gaps between rounds lose momentum.","Use technology wisely. Digital scoring platforms like Live Quizzing eliminate scoring disputes and give participants real-time feedback. This keeps teams engaged and builds anticipation.","If you'd like to have Live Quizzing host your next event — in-venue or online — visit our booking page to make an enquiry. We handle everything from question writing to full event management."]}];return i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx("div",{className:"bg-gradient-to-br from-indigo-900 via-slate-900 to-slate-900 py-16 px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 bg-indigo-500/20 border border-indigo-500/30 rounded-full px-4 py-1.5 mb-4",children:[i.jsx(sM,{className:"w-4 h-4 text-indigo-300"}),i.jsx("span",{className:"text-indigo-300 text-sm font-medium",children:"Live Quizzing Blog"})]}),i.jsx("h1",{className:"text-4xl md:text-5xl font-black text-white mb-4",children:"Qu
994iz Night Tips & Trivia"}),i.jsx("p",{className:"text-slate-300 text-lg max-w-2xl mx-auto",children:"Expert advice on pub quizzes, trivia strategies, and everything you need to dominate your local quiz night in Ireland."})]})}),i.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-10",children:[i.jsx("div",{className:"flex flex-wrap gap-2 mb-8",children:s.map(o=>i.jsx("button",{onClick:()=>t(o),className:`px-4 py-1.5 rounded-full text-sm font-medium transition-all ${e===o?"bg-indigo-600 text-white":"bg-white border border-slate-200 text-slate-600 hover:border-indigo-300"}`,children:o},o))}),r?i.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:[1,2,3,4].map(o=>i.jsx("div",{className:"bg-white rounded-2xl h-64 animate-pulse"},o))}):n.length===0?i.jsx("div",{className:"space-y-6",children:a.map((o,l)=>i.jsx(Me,{className:"overflow-hidden border-slate-200",children:i.jsxs(Fe,{className:"p-6 md:p-8",children:[i.jsxs("div",{className:"flex items-center gap-2 text-slate-400 text-xs mb-3",children:[i.jsx(Fn,{className:"w-3 h-3"}),i.jsx("span",{children:o.date}),i.jsx("span",{className:"ml-auto bg-indigo-100 text-indigo-700 px-2 py-0.5 rounded-full text-xs font-medium",children:o.category})]}),i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:o.title}),i.jsx("div",{className:"text-slate-600 text-sm leading-relaxed space-y-3",children:o.body.map((c,u)=>i.jsx("p",{children:c},u))})]})},l))}):i.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:n.map(o=>i.jsxs(Me,{className:"overflow-hidden hover:shadow-lg transition-shadow group cursor-pointer border-slate-200",children:[o.image_url&&i.jsx("img",{src:o.image_url,alt:o.title,className:"w-full h-48 object-cover group-hover:scale-105 transition-transform duration-300",loading:"lazy"}),!o.image_url&&i.jsx("div",{className:"w-full h-48 bg-gradient-to-br from-indigo-100 to-purple-100 flex items-center justify-center",children:i.jsx(sM,{className:"w-12 h-12 text-indigo-300"})}),i.jsxs(Fe,{className:"p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 text-slate-400 text-xs mb-2",children:[i.jsx(Fn,{className:"w-3 h-3"}),i.jsx("span",{children:Ut(new Date(o.publish_date),"MMMM d, yyyy")}),i.jsx("span",{className:"ml-auto bg-indigo-100 text-indigo-700 px-2 py-0.5 rounded-full text-xs font-medium",children:"Quiz Tips"})]}),i.jsx("h2",{className:"text-lg font-bold text-slate-900 mb-2 group-hover:text-indigo-600 transition-colors line-clamp-2",children:o.title}),i.jsx("div",{className:"text-slate-500 text-sm line-clamp-3 prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:o.content}}),i.jsxs("div",{className:"mt-4 flex items-center text-indigo-600 text-sm font-medium",children:["Read more ",i.jsx(X1,{className:"w-4 h-4 ml-1"})]})]})]},o.id))}),i.jsxs("div",{className:"mt-16 bg-white rounded-2xl p-8 border border-slate-200",children:[i.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-3",children:"About Live Quizzing"}),i.jsx("p",{className:"text-slate-600 leading-relaxed mb-4",children:"Live Quizzing is Ireland's premier pub quiz platform, hosting weekly quiz nights across Dublin and beyond. Our blog covers everything from quiz night strategies and trivia tips to local event news and team spotlight stories."}),i.jsxs("p",{className:"text-slate-600 leading-relaxed",children:["Whether you're a seasoned quiz champion or just getting started, our guides will help you sharpen your general knowledge, understand handicap scoring, and build the ultimate quiz team.",i.jsx(lr,{to:Ft("BookingPortal"),className:"text-indigo-600 hover:underline ml-1",children:"Book us for your next event →"})]})]})]})]})}function _Me(){const e=qi();return i.jsx("div",{className:"fixed inset-0 bg-gradient-to-br from-slate-900 via-indigo-900 to-slate-900 flex items-center justify-center z-50 p-4",children:i.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl max-w-md w-full p-8 text-center space-y-6",children:[i.jsx("div",{className:"flex justify-center",children:i.jsx("div",{className:"bg-green-100 rounded-full p-4",children:i.jsx(Cn,{className:"w-16 h-16 text-green-600"})})}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("h2",{className:"text-3xl font-bold text-slate-900",children:"Thank You!"}),i.jsx("p",{className:"text-lg text-slate-700",children:"Your quiz booking request has been received."}),i.jsx("p",{className:"text-slate-600",children:"We'll follow up with you as soon as possible to confirm details."})]}),i.jsxs(ue,{onClick:()=>e(Ft("Public")),className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-6 text-lg",children:[i.jsx(BT,{className:"w-5 h-5 mr-2"}),"Return to Hub"]})]})})}const NMe=()=>{let e=sessionStorage.getItem("visitor_session_id");return e||(e=`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,sessionStorage.setItem("visitor_session_id",e)),e},SMe=()=>{const e=navigator.userAgent;
994return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(e)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(e)?"mobile":"desktop"};function ao({pageName:e}){return O.useEffect(()=>{(async()=>{try{const n=NMe(),r=SMe(),s=navigator.userAgent;await ae.entities.VisitLog.create({timestamp:new Date().toISOString(),page_name:e,device_type:r,user_agent:s,session_id:n})}catch(n){console.error("Failed to track visit:",n)}})()},[e]),null}const kMe=["Music","Movies & TV","Sports","History","Geography","Science & Nature","Pop Culture","Decades (60s, 70s, 80s, etc.)","Holiday Special","Other"];function EMe(){const[e,t]=O.useState(!1),[n,r]=O.useState(!1),[s,a]=O.useState({name_or_company:"",email:"",phone:"",quiz_format:"in-venue",venue_name:"",venue_address:"",quiz_type:"general",theme:"",custom_details:"",event_date:"",start_time:"",estimated_participants:"",extra_notes:""}),o=async l=>{l.preventDefault(),t(!0);try{await ae.entities.BookingRequest.create({...s,status:"new"}),r(!0)}catch(c){console.error("Failed to submit booking:",c),alert("Failed to submit booking. Please try again.")}t(!1)};return n?i.jsx(_Me,{}):i.jsxs(i.Fragment,{children:[i.jsx(ao,{pageName:"BookingPortal"}),i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-indigo-900 to-slate-900 py-8 px-4",children:i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[i.jsx(Bc,{className:"w-10 h-10 text-amber-400"}),i.jsx("h1",{className:"text-4xl font-bold text-white",children:"Book a Quizmaster"})]}),i.jsx("p",{className:"text-slate-300 text-lg",children:"Private quizzes • Online or in-venue • Custom themes"})]}),i.jsxs(Me,{className:"bg-white/95 backdrop-blur-md",children:[i.jsx(st,{children:i.jsx(at,{children:"Quiz Booking Request"})}),i.jsx(Fe,{children:i.jsxs("form",{onSubmit:o,className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-slate-900 flex items-center gap-2",children:"Contact Details"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"name",children:"Name or Company/Organisation *"}),i.jsx(Ee,{id:"name",required:!0,value:s.name_or_company,onChange:l=>a({...s,name_or_company:l.target.value}),placeholder:"Your name or organisation"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"email",children:"Email *"}),i.jsx(Ee,{id:"email",type:"email",required:!0,value:s.email,onChange:l=>a({...s,email:l.target.value}),placeholder:"[email protected]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"phone",children:"Phone (optional)"}),i.jsx(Ee,{id:"phone",type:"tel",value:s.phone,onChange:l=>a({...s,phone:l.target.value}),placeholder:"Your phone number"})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Quiz Format"}),i.jsxs("div",{className:"flex items-center gap-4 p-4 bg-slate-50 rounded-lg",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"flex items-center gap-2 font-medium text-slate-900",children:s.quiz_format==="in-venue"?i.jsxs(i.Fragment,{children:[i.jsx(js,{className:"w-4 h-4"}),"In-Venue Quiz"]}):i.jsxs(i.Fragment,{children:[i.jsx(q0,{className:"w-4 h-4"}),"Online Quiz"]})}),i.jsx("p",{className:"text-sm text-slate-600 mt-1",children:s.quiz_format==="in-venue"?"Quiz hosted at your venue":"Virtual quiz via online platform"})]}),i.jsx(ai,{checked:s.quiz_format==="online",onCheckedChange:l=>a({...s,quiz_format:l?"online":"in-venue"})})]}),s.quiz_format==="in-venue"&&i.jsxs("div",{className:"space-y-4 pl-4 border-l-2 border-indigo-200",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"venue-name",children:"Venue Name *"}),i.jsx(Ee,{id:"venue-name",required:s.quiz_format==="in-venue",value:s.venue_name,onChange:l=>a({...s,venue_name:l.target.value}),placeholder:"Name of venue"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"venue-address",children:"Full Address *"}),i.jsx(nr,{id:"venue-address",required:s.quiz_format==="in-venue",value:s.venue_address,onChange:l=>a({...s,venue_address:l.target.value}),placeholder:"Street address, city, postcode",rows:3})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Qu
994iz Type"}),i.jsx("div",{className:"space-y-2",children:i.jsxs(Xt,{value:s.quiz_type,onValueChange:l=>a({...s,quiz_type:l}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"general",children:"General Knowledge"}),i.jsx(Ie,{value:"theme-based",children:"Theme-Based Quiz"}),i.jsx(Ie,{value:"custom",children:"Custom Quiz (Family/Company)"})]})]})}),s.quiz_type==="theme-based"&&i.jsxs("div",{className:"space-y-2 pl-4 border-l-2 border-indigo-200",children:[i.jsx(me,{htmlFor:"theme",children:"Select Theme *"}),i.jsxs(Xt,{value:s.theme,onValueChange:l=>a({...s,theme:l}),children:[i.jsx(Ht,{children:i.jsx(Zt,{placeholder:"Choose a theme"})}),i.jsx(Kt,{children:kMe.map(l=>i.jsx(Ie,{value:l,children:l},l))})]}),s.theme==="Other"&&i.jsx(Ee,{placeholder:"Specify your theme",value:s.custom_details,onChange:l=>a({...s,custom_details:l.target.value}),className:"mt-2"})]}),s.quiz_type==="custom"&&i.jsxs("div",{className:"space-y-2 pl-4 border-l-2 border-indigo-200",children:[i.jsx(me,{htmlFor:"custom-details",children:"Custom Quiz Details"}),i.jsx(nr,{id:"custom-details",value:s.custom_details,onChange:l=>a({...s,custom_details:l.target.value}),placeholder:"Tell us about your custom quiz (family trivia, company history, etc.)",rows:4})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("h3",{className:"text-lg font-semibold text-slate-900 flex items-center gap-2",children:[i.jsx(Fn,{className:"w-5 h-5"}),"Event Details"]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"event-date",children:"Event Date *"}),i.jsx(Ee,{id:"event-date",type:"date",required:!0,value:s.event_date,onChange:l=>a({...s,event_date:l.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"start-time",children:"Start Time *"}),i.jsx(Ee,{id:"start-time",type:"time",required:!0,value:s.start_time,onChange:l=>a({...s,start_time:l.target.value})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"participants",children:"Estimated Number of Players/Teams *"}),i.jsx(Ee,{id:"participants",required:!0,value:s.estimated_participants,onChange:l=>a({...s,estimated_participants:l.target.value}),placeholder:"e.g. 50 players or 10 teams"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Additional Information"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"notes",children:"Extra Notes (optional)"}),i.jsx(nr,{id:"notes",value:s.extra_notes,onChange:l=>a({...s,extra_notes:l.target.value}),placeholder:"Any other details you'd like us to know...",rows:4})]})]}),i.jsx("div",{className:"pt-4",children:i.jsx(ue,{type:"submit",disabled:e,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-6 text-lg",children:e?"Submitting...":"Submit Booking Request"})})]})})]})]})})]})}function gY({placement:e}){mn();const[t]=O.useState(()=>{let h=sessionStorage.getItem("ad_session_id");return h||(h=`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,sessionStorage.setItem("ad_session_id",h)),h}),[n,r]=O.useState(null);O.useEffect(()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(h=>{fetch(`https://geocode.xyz/${h.coords.latitude},${h.coords.longitude}?json=1`).then(d=>d.json()).then(d=>{r({country:d.country||"Unknown",region:d.region||"",city:d.city||""})}).catch(()=>{})},()=>{})},[]);const{data:s}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{},refetchInterval:3e4}),a=((s==null?void 0:s.ads_rotation_interval)||300)*1e3,{data:o}=qe({queryKey:["smartAd",e,t],queryFn:async()=>(await ae.functions.invoke("adDelivery",{action:"getAd",placement:e,sessionId:t,userLocation:n})).data,refetchInterval:a,staleTime:1e3,gcTime:6e4,enabled:!0}),l=qt({mutationFn:async({impressionId:h,adId:d})=>{await ae.functions.invoke("adDelivery",{action:"trackClick",impressionId:h,adId:d})},retry:2});if(!(o!=null&&o.ad))return null;const c=o.ad,u=()=>{c.link_url&&(l.mutate({impressionId:o==null?void 0:o.impressionId,adI
994d:c.id}),window.open(c.link_url,"_blank","noopener,noreferrer"))};return i.jsx(Gs,{children:i.jsxs(rt.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.4,ease:[.4,0,.2,1]},className:"relative group",children:[i.jsxs("div",{onClick:u,className:`border border-slate-200 rounded-xl overflow-hidden shadow-lg hover:shadow-2xl hover:border-indigo-300 transition-all duration-300 ${c.link_url?"cursor-pointer":""}`,children:[i.jsxs("div",{className:"relative overflow-hidden",children:[i.jsx("img",{src:c.image_url,alt:c.title,className:"w-full h-auto object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy"}),i.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"})]}),i.jsxs("div",{className:"p-3 bg-white",children:[i.jsx("h4",{className:"font-bold text-sm text-slate-900 group-hover:text-indigo-600 transition-colors duration-200",children:c.title}),c.description&&i.jsx("p",{className:"text-xs text-slate-600 mt-1 line-clamp-2",children:c.description}),c.link_url&&i.jsxs("div",{className:"flex items-center gap-1 text-xs text-indigo-600 mt-2 group-hover:text-indigo-700 transition-colors font-medium",children:[i.jsx(ws,{className:"w-3 h-3"}),i.jsx("span",{children:"Learn more"}),i.jsx("span",{className:"group-hover:translate-x-1 transition-transform duration-200",children:"→"})]})]})]}),i.jsx("div",{className:"absolute top-2 right-2 text-[8px] bg-white/90 backdrop-blur-sm px-2 py-1 rounded-full text-slate-500 font-medium shadow-sm",children:"Sponsored"})]})})}function PMe({open:e,onOpenChange:t}){const[n,r]=O.useState({question_number:"",issue_description:"",reporter_name:"",reporter_email:"",quiz_date:new Date().toISOString().split("T")[0]});mn();const s=qt({mutationFn:l=>ae.entities.QuizIssue.create(l),onSuccess:()=>{tt.success("Issue reported successfully! We'll review it soon."),a(),t(!1)},onError:()=>{tt.error("Failed to submit report. Please try again.")}}),a=()=>{r({question_number:"",issue_description:"",reporter_name:"",reporter_email:"",quiz_date:new Date().toISOString().split("T")[0]})},o=l=>{l.preventDefault(),s.mutate({...n,question_number:parseInt(n.question_number),status:"new"})};return i.jsx(rn,{open:e,onOpenChange:t,children:i.jsxs(en,{className:"max-w-md",children:[i.jsxs(vn,{children:[i.jsxs(sn,{className:"flex items-center gap-2",children:[i.jsx(ba,{className:"w-5 h-5 text-amber-500"}),"Report Quiz Issue"]}),i.jsx(Kl,{children:"Found an error in a question or answer? Let us know!"})]}),i.jsxs("form",{onSubmit:o,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Question Number *"}),i.jsx(Ee,{type:"number",min:"1",value:n.question_number,onChange:l=>r({...n,question_number:l.target.value}),placeholder:"e.g. 5",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"What's the issue? *"}),i.jsx(nr,{value:n.issue_description,onChange:l=>r({...n,issue_description:l.target.value}),placeholder:"e.g. The answer given was incorrect, the correct answer is...",rows:4,required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Your Name *"}),i.jsx(Ee,{value:n.reporter_name,onChange:l=>r({...n,reporter_name:l.target.value}),placeholder:"Your name",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Your Email *"}),i.jsx(Ee,{type:"email",value:n.reporter_email,onChange:l=>r({...n,reporter_email:l.target.value}),placeholder:"[email protected]",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{children:"Quiz Date"}),i.jsx(Ee,{type:"date",value:n.quiz_date,onChange:l=>r({...n,quiz_date:l.target.value})})]}),i.jsxs("div",{className:"flex gap-3 pt-2",children:[i.jsx(ue,{type:"submit",className:"flex-1",disabled:s.isPending,children:s.isPending?"Submitting...":"Submit Report"}),i.jsx(ue,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"})]})]})]})})}function vY({onClose:e,onOpenLiveQuiz:t}){const n=qi(),r=oo(),s=localStorage.getItem("admin_authenticated")==="true",[a,o]=se.useState(null),[l,c]=se.useState(""),[u,h]=se.useState(!1),m=new URLSearchParams(r.
994search).get("highlight"),{data:g}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{show_live_visitor_count:!1}}),{data:w=[]}=qe({queryKey:["newsletters"],queryFn:()=>ae.entities.Newsletter.list("-created_date",20)}),{data:v=[]}=qe({queryKey:["events"],queryFn:()=>ae.entities.Event.list("-created_date",50),refetchInterval:6e4}),{data:b=[]}=qe({queryKey:["communityEvents"],queryFn:()=>ae.entities.CommunityEvent.list("-created_date",20)}),{data:y=[]}=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list("-updated_date",1),staleTime:6e4}),{data:_=[]}=qe({queryKey:["visitLogs"],queryFn:()=>ae.entities.VisitLog.list("-timestamp",200),refetchInterval:6e4,enabled:(g==null?void 0:g.show_live_visitor_count)===!0}),N=se.useMemo(()=>{const M=new Date(Date.now()-3e5);return new Set(_.filter($=>new Date($.timestamp)>=M).map($=>$.session_id)).size},[_]),j=se.useMemo(()=>{const M=new Date;return v.some($=>{var Z;if($.is_active===!1)return!1;const B=new Date($.start_datetime),U=$.end_datetime?new Date($.end_datetime):new Date(B.getTime()+7200*1e3),G=U.getTime()-B.getTime();if($.repeat_type==="weekly"){const X={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if((((Z=$.repeat_days_of_week)==null?void 0:Z.length)>0?$.repeat_days_of_week:$.repeat_day_of_week?[$.repeat_day_of_week]:[]).some(z=>M.getDay()===X[z])){const z=new Date(M);z.setHours(B.getHours(),B.getMinutes(),0,0);const L=new Date(z.getTime()+G);return M>=z&&M<=L}return!1}return M>=B&&M<=U})},[v]),S=M=>{e&&e(),n(Ft(M))},C=()=>{const M=localStorage.getItem("newsletter_last_seen");return M?w.filter($=>$.is_published&&new Date($.created_date)>new Date(M)).length:w.filter($=>$.is_published).length},P=()=>{const M=localStorage.getItem("events_last_seen");return M?v.filter($=>$.is_active!==!1&&new Date($.created_date)>new Date(M)).length:v.filter($=>$.is_active!==!1).length},A=()=>{const M=localStorage.getItem("league_table_last_seen");return M?y.some(B=>new Date(B.updated_date)>new Date(M))?1:0:y.length>0?1:0},I=(()=>{if(!(g!=null&&g.live_quiz_start_time)||!(g!=null&&g.live_quiz_end_time))return!1;const M=new Date,$=new Date(g.live_quiz_start_time),B=new Date(g.live_quiz_end_time);return M>=$&&M<=B})(),R=[...g!=null&&g.show_live_quiz_tile?[{title:"Live Quiz or Bingo",subtitle:I?"Happening Now!":"Join the action",icon:lB,color:I?"from-red-500 to-red-600 animate-pulse shadow-[0_0_15px_rgba(220,38,38,0.7)]":"from-slate-600 to-slate-700",action:()=>{e&&e(),t&&t()},pulse:I,isLive:I}]:[],{title:"League Table",icon:Jt,color:"from-amber-500 to-amber-600",page:"Public",badge:A()},{title:"Team Stats",icon:pg,color:"from-indigo-500 to-indigo-600",page:"TeamsStats"},{title:"Team Profiles",icon:Dr,color:"from-purple-500 to-purple-600",page:"TeamProfiles"},{title:"Upload Photo",icon:Md,color:"from-purple-500 to-purple-600",page:"TeamPhoto"},{title:"Raffle Tickets",subtitle:"Win big! Buy tickets now",icon:Vr,color:"from-amber-500 to-orange-600",page:"RaffleTickets"},{title:"Quiz Games",subtitle:"Play instant quizzes for €1",icon:vs,color:"from-emerald-500 to-emerald-600",page:"QuizGames"},{title:"Community Challenges",subtitle:"Play user-created quizzes",icon:Sd,color:"from-orange-500 to-orange-600",page:"CommunityChallenges"},{title:"Community",subtitle:"Forum, Reviews & Leaderboard",icon:Dr,color:"from-pink-500 to-rose-600",page:"Community"},{title:"Upcoming Events",icon:Fn,color:"from-blue-500 to-blue-600",page:"UpcomingEvents",badge:P(),isLive:j},{title:"Newsletter",icon:Dd,color:"from-green-500 to-green-600",page:"Newsletter",badge:C()},{title:"Newsletter & Notifications",subtitle:"Get updates – or unsubscribe",icon:qT,color:"from-cyan-500 to-cyan-600",page:"NewsletterSubscription"},{title:"Book a Quizmaster",subtitle:"Private quizzes • Online or in-venue",icon:Bc,color:"from-orange-500 to-orange-600",page:"BookingPortal"},{title:"My Profile",subtitle:"Games, Tickets & Settings",icon:zo,color:"from-slate-500 to-slate-600",page:"UserProfile"},{title:"Create Ad",subtitle:"Promote your business",icon:gg,color:"from-indigo-500 to-indigo-600",page:"CreateAd"},{title:"Report Quiz Issue",subtitle:"Flag a question or answer",icon:Sn,color:"from-
994amber-500 to-amber-600",action:()=>h(!0)},...s?[{title:"Admin Dashboard",icon:no,color:"from-slate-600 to-slate-700",page:"Admin"},{title:"Team Issues",icon:Sn,color:"from-red-500 to-red-600",page:"Admin",action:()=>{e&&e(),n(Ft("Admin")),setTimeout(()=>{const M=document.querySelector('[value="issues"]');M&&M.click()},100)}}]:[]];return i.jsxs(i.Fragment,{children:[i.jsx(ao,{pageName:"CentralHub"}),i.jsx(PMe,{open:u,onOpenChange:h}),i.jsx(rn,{open:!!a,onOpenChange:M=>{M||o(null)},children:i.jsxs(en,{className:"max-w-5xl w-full h-[85vh] p-0 overflow-hidden flex flex-col","aria-describedby":void 0,children:[i.jsx(sn,{className:"sr-only",children:l}),i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-slate-900 border-b border-slate-700",children:[i.jsx("span",{className:"text-white font-bold text-sm",children:l}),i.jsx("button",{onClick:()=>o(null),className:"text-slate-400 hover:text-white transition-colors",children:i.jsx(Si,{className:"w-5 h-5"})})]}),a&&i.jsx("iframe",{src:a,className:"flex-1 w-full border-0",allow:"camera; microphone; fullscreen",title:l})]})}),i.jsxs("div",{className:`${e?"fixed inset-0 z-50":"min-h-screen"} bg-gradient-to-br from-slate-900 via-indigo-900 to-slate-900 overflow-auto`,children:[i.jsxs("div",{className:"absolute inset-0 pointer-events-none opacity-40",children:[i.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-indigo-500/40 rounded-full blur-3xl",style:{animation:"float 20s ease-in-out infinite"}}),i.jsx("div",{className:"absolute top-3/4 right-1/4 w-96 h-96 bg-pink-500/35 rounded-full blur-3xl",style:{animation:"float 25s ease-in-out infinite reverse"}}),i.jsx("div",{className:"absolute top-1/2 left-1/2 w-96 h-96 bg-amber-500/30 rounded-full blur-3xl",style:{animation:"float 30s ease-in-out infinite"}}),i.jsx("div",{className:"absolute top-1/3 right-1/3 w-72 h-72 bg-emerald-500/25 rounded-full blur-3xl",style:{animation:"float 22s ease-in-out infinite reverse"}}),i.jsx("div",{className:"absolute bottom-1/4 left-1/3 w-80 h-80 bg-rose-500/25 rounded-full blur-3xl",style:{animation:"float 28s ease-in-out infinite"}}),i.jsx("div",{className:"absolute top-2/3 right-1/2 w-72 h-72 bg-cyan-500/20 rounded-full blur-3xl",style:{animation:"float 26s ease-in-out infinite reverse"}}),i.jsx("div",{className:"absolute top-1/5 right-1/4 w-64 h-64 bg-fuchsia-500/25 rounded-full blur-3xl",style:{animation:"float 24s ease-in-out infinite"}}),i.jsx("style",{children:`
995            @keyframes float {
996              0%, 100% { transform: translate(0, 0); }
997              25% { transform: translate(50px, -50px); }
998              50% { transform: translate(0, -100px); }
999              75% { transform: translate(-50px, -50px); }
1000            }
1001          `})]}),e&&i.jsx(ue,{variant:"ghost",size:"icon",onClick:e,className:"fixed top-4 right-4 z-10 h-12 w-12 bg-white/10 hover:bg-white/20 text-white border border-white/20",children:i.jsx(Si,{className:"w-6 h-6"})}),i.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",children:i.jsxs("div",{className:"max-w-6xl w-full",children:[i.jsxs("div",{className:"text-center mb-12",children:[i.jsxs("div",{className:"flex items-center justify-center gap-4 mb-6",children:[i.jsx("img",{src:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/69159eb1f2b08a81df520821/e08a7a193_LiveQuizzing.png",alt:"Live Quizzing",className:"h-16 sm:h-20 md:h-24 w-auto bg-white rounded-xl p-2 shadow-lg"}),i.jsxs("h1",{className:"text-4xl sm:text-5xl md:text-6xl font-black text-transparent bg-clip-text",style:{backgroundImage:"linear-gradient(90deg, #f472b6, #fbbf24, #fde047, #34d399, #22d3ee, #a78bfa, #f472b6)",backgroundSize:"200% auto",animation:"rainbowShift 4s linear infinite"},children:[i.jsx("style",{children:"@keyframes rainbowShift { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }"}),"Hub"]})]}),i.jsx("p",{className:"text-xl text-slate-300",children:"Navigate to any section of the app"}),(g==null?void 0:g.show_live_visitor_count)&&N>0&&i.jsxs("div",{className:"mt-4 inline-flex items-center gap-2 bg-white/10 backdrop-blur-sm px-4 py-2 rounded-full border border-white/20",children:[i.jsx(du,{className:"w-4 h-4 text-green-400"}),i.jsxs("span",{className:"text-white text-sm font-semibold",children:["👀 ",N," ",N===1?"person":"people"," viewing right now"]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 sm:gap-6",children:[i.jsx(gY,{placement:"hub_tile"}),R.map((M,$)=>{const B=M.icon,U=M.title.toLowerCase().replace(/\s+/g,"-"),G=m===U;return i.jsxs("button",{onClick:()=>M.action?M.action():S(M.page),onContextMenu:Z=>{Z.preventDefault();const X=M.page?`${window.location.origin}${Ft(M.page)}`:`${window.location.origin}/?hub=${U}`;navigator.clipboard.writeText(X),tt.success(`Link copied! Share this ${M.title} directly.`)},className:`group relative bg-white/10 backdrop-blur-sm rounded-2xl p-6 sm:p-8 border-2 transition-all duration-300 hover:scale-105 hover:shadow-2xl hover:shadow-white/20 ${G?"border-yellow-400 ring-4 ring-yellow-400/50 animate-pulse":"border-white/20 hover:border-white/50"}`,children:[i.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${M.color} opacity-0 group-hover:opacity-20 rounded-2xl transition-opacity duration-300`}),M.badge>0&&i.jsx("div",{className:"absolute -top-2 -right-2 bg-red-500 text-white text-xs rounded-full w-7 h-7 flex items-center justify-center font-bold shadow-lg z-10 border-2 border-white",children:M.badge>9?"9+":M.badge}),M.isLive&&i.jsxs("div",{className:"absolute -top-2 -left-2 bg-red-600 text-white text-xs font-bold px-2 py-1 rounded-md animate-pulse shadow-lg z-20 flex items-center gap-1 border-2 border-white",children:[i.jsxs("span",{className:"relative flex h-2 w-2",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-white opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-white"})]}),"LIVE"]}),i.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:i.jsx(Ho,{className:"w-4 h-4 text-white/70"})}),i.jsxs("div",{className:"relative flex flex-col items-center gap-4",children:[i.jsx("div",{className:`w-16 h-16 sm:w-20 sm:h-20 rounded-xl bg-gradient-to-br ${M.color} flex items-center justify-center shadow-lg group-hover:scale-110 group-hover:shadow-xl transition-all duration-300`,children:i.jsx(B,{className:"w-8 h-8 sm:w-10 sm:h-10 text-white drop-shadow-lg"})}),i.jsxs("div",{className:"text-center",children:[i.jsx("span",{className:"text-white font-bold text-base sm:text-lg block",children:M.title}),M.subtitle&&i.jsx("span",{className:"text-slate-300 text-xs sm:text-sm block mt-1",children:M.subtitle})]})]})]},$)})]}),!s&&i.jsx("div",{className:"mt-12 flex justify-center",children:i.jsxs("button",{onClick:()=>S("Admin"),className:"text-slate-500 hover:text-slate-300 text-sm flex items-center gap-2 px-4 py-2 rounded-full hover:bg-white/5 transition-colors",children:[i.jsx(no,{className:"w-4 h-4"}),i.jsx("span",{children:"Admin Login"})]})})]})})]})]})}var eA={exports:{}},tA={};
1001/**
1002 * @license React
1003 * use-sync-external-store-shim.production.js
1004 *
1005 * Copyright (c) Meta Platforms, Inc. and affiliates.
1006 *
1007 * This source code is licensed under the MIT license found in the
1008 * LICENSE file in the root directory of this source tree.
1009 */var T8;function CMe(){if(T8)return tA;T8=1;var e=Uy();function t(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(d,m){var g=m(),w=r({inst:{value:g,getSnapshot:m}}),v=w[0].inst,b=w[1];return a(function(){v.value=g,v.getSnapshot=m,c(v)&&b({inst:v})},[d,g,m]),s(function(){return c(v)&&b({inst:v}),d(function(){c(v)&&b({inst:v})})},[d]),o(g),g}function c(d){var m=d.getSnapshot;d=d.value;try{var g=m();return!n(d,g)}catch{return!0}}function u(d,m){return m()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return tA.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,tA}var R8;function AMe(){return R8||(R8=1,eA.exports=CMe()),eA.exports}var OMe=AMe();function TMe(){return OMe.useSyncExternalStore(RMe,()=>!0,()=>!1)}function RMe(){return()=>{}}var j5="Avatar",[MMe]=ja(j5),[IMe,xY]=MMe(j5),yY=O.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[s,a]=O.useState("idle");return i.jsx(IMe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:a,children:i.jsx(Pt.span,{...r,ref:t})})});yY.displayName=j5;var bY="AvatarImage",wY=O.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...a}=e,o=xY(bY,n),l=DMe(r,a),c=Ji(u=>{s(u),o.onImageLoadingStatusChange(u)});return Gr(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?i.jsx(Pt.img,{...a,ref:t,src:r}):null});wY.displayName=bY;var jY="AvatarFallback",_Y=O.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,a=xY(jY,n),[o,l]=O.useState(r===void 0);return O.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&a.imageLoadingStatus!=="loaded"?i.jsx(Pt.span,{...s,ref:t}):null});_Y.displayName=jY;function M8(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function DMe(e,{referrerPolicy:t,crossOrigin:n}){const r=TMe(),s=O.useRef(null),a=r?(s.current||(s.current=new window.Image),s.current):null,[o,l]=O.useState(()=>M8(a,e));return Gr(()=>{l(M8(a,e))},[a,e]),Gr(()=>{const c=d=>()=>{l(d)};if(!a)return;const u=c("loaded"),h=c("error");return a.addEventListener("load",u),a.addEventListener("error",h),t&&(a.referrerPolicy=t),typeof n=="string"&&(a.crossOrigin=n),()=>{a.removeEventListener("load",u),a.removeEventListener("error",h)}},[a,n,t]),o}var NY=yY,SY=wY,kY=_Y;const Gh=O.forwardRef(({className:e,...t},n)=>i.jsx(NY,{ref:n,className:Nt("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Gh.displayName=NY.displayName;const ev=O.forwardRef(({className:e,...t},n)=>i.jsx(SY,{ref:n,className:Nt("aspect-square h-full w-full",e),...t}));ev.displayName=SY.displayName;const Qh=O.forwardRef(({className:e,...t},n)=>i.jsx(kY,{ref:n,className:Nt("flex h-full w-full items-center justify-center rounded-full bg-slate-100",e),...t}));Qh.displayName=kY.displayName;function LMe(){const[e,t]=O.useState(null),[n,r]=O.useState(!1),s=mn(),{data:a=[],isLoading:o}=qe({queryKey:["forumThreads"],queryFn:()=>ae.entities.ForumThread.list("-last_reply_at")}),{data:l}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me().catch(()=>null)}),c=qt({mutationFn:async u=>{var d;const h=await ae.functions.invoke("gamification",{action:"createThread",...u});if((d=h.data)!=null&&d.error)throw new Error(h.data.error);return h.data},onSuccess:()=>{s.invalidateQueries(["forumThreads"]),r(!1),tt.success("Discussion started! +10 XP")},onError:()=>tt.error("Failed to create thread")});return e?i.jsx(FMe,{thread:e,onBack:()=>t(null),currentUser:l}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold text-white",children:"Community Forum"}),i.jsx("p",{className:"text-slate-400",children:"Join the discussion"})]}),i.jsxs(rn,{open:n,onOpenChange:r,children:[i.jsx(bg,{asChild:!0,children:i.jsxs(ue,{className:"bg-indigo-600 hover:bg-indigo-700",disabled:!l,children:[i.jsx(li,{className:"w-4 h-4 mr-2"})," New Topic"]})}),i.jsxs(en,{className:"bg-slate-900 border-slate-800 text-white",children:[i.jsx(vn,{children:i.jsx(sn,{children:"Start a New Discu
1009ssion"})}),i.jsx($Me,{onSubmit:c.mutate,isSubmitting:c.isPending})]})]})]}),i.jsx("div",{className:"grid gap-4",children:a.map(u=>{var h;return i.jsx(Me,{className:"bg-slate-800/50 border-slate-700 hover:border-indigo-500/50 transition-colors cursor-pointer",onClick:()=>t(u),children:i.jsx(Fe,{className:"p-4",children:i.jsxs("div",{className:"flex gap-4",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(nt,{variant:"secondary",className:"bg-slate-700 text-slate-300 hover:bg-slate-600",children:u.category}),i.jsxs("span",{className:"text-xs text-slate-500",children:["Last active ",Ut(new Date(u.last_reply_at||u.created_date),"MMM d, HH:mm")]})]}),i.jsx("h3",{className:"font-bold text-lg text-white mb-1",children:u.title}),i.jsx("p",{className:"text-slate-400 text-sm line-clamp-2",children:u.content})]}),i.jsxs("div",{className:"flex flex-col items-end justify-center gap-2 text-slate-400 text-sm min-w-[80px]",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Wo,{className:"w-4 h-4"}),u.reply_count||0]}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsxs(Gh,{className:"w-6 h-6",children:[i.jsx(ev,{src:u.author_avatar}),i.jsx(Qh,{children:(h=u.author_name)==null?void 0:h[0]})]})})]})]})})},u.id)})})]})}function FMe({thread:e,onBack:t,currentUser:n}){var c;const r=mn(),[s,a]=O.useState(""),{data:o=[]}=qe({queryKey:["forumPosts",e.id],queryFn:()=>ae.entities.ForumPost.filter({thread_id:e.id},"created_date")}),l=qt({mutationFn:async u=>{var d;const h=await ae.functions.invoke("gamification",{action:"createPost",thread_id:e.id,content:u});if((d=h.data)!=null&&d.error)throw new Error(h.data.error);return h.data},onSuccess:()=>{r.invalidateQueries(["forumPosts",e.id]),r.invalidateQueries(["forumThreads"]),a(""),tt.success("Reply posted! +5 XP")},onError:()=>tt.error("Failed to post reply")});return i.jsxs("div",{className:"space-y-6",children:[i.jsx(ue,{variant:"ghost",onClick:t,className:"text-slate-400 hover:text-white pl-0",children:"← Back to Discussions"}),i.jsxs(Me,{className:"bg-slate-800 border-slate-700",children:[i.jsxs(st,{className:"pb-2",children:[i.jsxs("div",{className:"flex justify-between items-start",children:[i.jsx("h2",{className:"text-2xl font-bold text-white",children:e.title}),i.jsx(nt,{children:e.category})]}),i.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[i.jsxs(Gh,{className:"w-6 h-6",children:[i.jsx(ev,{src:e.author_avatar}),i.jsx(Qh,{children:(c=e.author_name)==null?void 0:c[0]})]}),i.jsx("span",{children:e.author_name}),i.jsx("span",{children:"•"}),i.jsx("span",{children:Ut(new Date(e.created_date),"PPP p")})]})]}),i.jsx(Fe,{className:"text-slate-200 whitespace-pre-wrap",children:e.content})]}),i.jsx("div",{className:"space-y-4",children:o.map(u=>{var h;return i.jsx(Me,{className:"bg-slate-800/50 border-slate-700/50 ml-4 md:ml-8",children:i.jsxs(Fe,{className:"p-4",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-400 mb-2",children:[i.jsxs(Gh,{className:"w-5 h-5",children:[i.jsx(ev,{src:u.author_avatar}),i.jsx(Qh,{children:(h=u.author_name)==null?void 0:h[0]})]}),i.jsx("span",{className:"font-medium text-slate-300",children:u.author_name}),i.jsx("span",{children:Ut(new Date(u.created_date),"MMM d, HH:mm")})]}),i.jsx("p",{className:"text-slate-300 text-sm whitespace-pre-wrap",children:u.content})]})},u.id)})}),n?i.jsxs("div",{className:"pt-4",children:[i.jsx(nr,{value:s,onChange:u=>a(u.target.value),placeholder:"Write a reply...",className:"bg-slate-900 border-slate-700 text-white mb-2"}),i.jsx(ue,{onClick:()=>l.mutate(s),disabled:!s.trim()||l.isPending,className:"bg-indigo-600 hover:bg-indigo-700",children:"Post Reply"})]}):i.jsx("div",{className:"text-center p-4 bg-slate-800/30 rounded-lg text-slate-400",children:"Please log in to reply"})]})}function $Me({onSubmit:e,isSubmitting:t}){const[n,r]=O.useState({title:"",content:"",category:"General"});return i.jsxs("div",{className:"space-y-4 py-2",children:[i.jsx("div",{children:i.jsx(Ee,{placeholder:"Title",value:n.title,onChange:s=>r({...n,title:s.target.value}),className:"bg-slate-800 border-slate-700 text-white"})}),i.jsxs("select",{className:"w-full bg-slate-800 border border-slate-700 text-white rounded-md p-2 text-sm",value:n.category,onChange:s=>r({...n,category:s.target.value}),children:[i.jsx("option",{value:"General",children:"General"}),i.jsx("option",{value:"Game Strategy",children:"Game Strategy"}),i.jsx("option",{value:"Events",children:"Events"}),i.jsx("option",{value:"Off-Topic",children:"Off-Topic"})]}),i.jsx(nr,{placeholder:"What's on your mind?",value:n.content,onChange:s=>r({...n,content:s.target.value}),className:"bg-slate-800 border-slate-700 text-white h-32"}),i.jsx(ue,{className:"w-full bg-indigo-600 hover:bg-indigo-700",onClick:()=>e(n),disabled:!n.title||!n.content||t,children:t?"Posting...":"Create Thread"})]})}function qMe(){const{data:e=[]}=qe({queryKey:["allGamePurchases"],queryFn:()=>ae.entities.GamePurchase.list("-purchased_at",500)}),{data:t=[]}=qe({queryKey:["allEventPurchases"],queryFn:()=>ae.entities.EventPurchase.list("-purchase_date",500)}),n=se.useMemo(()=>{const r={};return e.forEach(s=>{r[s.user_id]||(r[s.user_id]={id:s.user_id,email:s.user_email,score:0,games:0,events:0}
1009),r[s.user_id].score+=20,r[s.user_id].games+=1}),t.forEach(s=>{r[s.user_id]||(r[s.user_id]={id:s.user_id,email:s.user_email,score:0,games:0,events:0}),r[s.user_id].score+=50,r[s.user_id].events+=1}),Object.values(r).sort((s,a)=>a.score-s.score).slice(0,10)},[e,t]);return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold text-white",children:"Top Community Members"}),i.jsx("p",{className:"text-slate-400",children:"Based on game plays and event attendance"})]}),i.jsxs("div",{className:"space-y-3",children:[n.map((r,s)=>{var a,o;return i.jsx(Me,{className:"bg-slate-800/50 border-slate-700",children:i.jsxs(Fe,{className:"p-4 flex items-center gap-4",children:[i.jsxs("div",{className:"font-black text-2xl w-8 text-center text-slate-500",children:[s===0&&i.jsx(Jt,{className:"w-6 h-6 text-yellow-400 mx-auto"}),s===1&&i.jsx(z0,{className:"w-6 h-6 text-slate-300 mx-auto"}),s===2&&i.jsx(z0,{className:"w-6 h-6 text-amber-600 mx-auto"}),s>2&&`#${s+1}`]}),i.jsx(Gh,{className:"w-10 h-10 border-2 border-slate-600",children:i.jsx(Qh,{className:"bg-indigo-900 text-white",children:((o=(a=r.email)==null?void 0:a[0])==null?void 0:o.toUpperCase())||"U"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-bold text-white",children:r.email?r.email.split("@")[0]:`Quizzer ${r.id.slice(0,6)}`}),i.jsxs("div",{className:"text-xs text-slate-400 flex gap-3",children:[i.jsxs("span",{children:[r.games," Games"]}),i.jsxs("span",{children:[r.events," Events"]})]})]}),i.jsxs("div",{className:"text-right",children:[i.jsx("div",{className:"font-black text-xl text-indigo-400",children:r.score}),i.jsx("div",{className:"text-xs text-slate-500 uppercase tracking-wider",children:"Points"})]})]})},r.id)}),n.length===0&&i.jsx("div",{className:"text-center py-8 text-slate-500",children:"No activity recorded yet. Be the first to play!"})]})]})}function zMe(){const e=qi(),{data:t}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me().catch(()=>null)});se.useEffect(()=>{localStorage.setItem("community_events_last_seen",new Date().toISOString())},[]);const[n,r]=O.useState(!1),[s,a]=O.useState(!1),[o,l]=O.useState(!1),c=mn(),[u,h]=O.useState({title:"",description:"",date_time:"",location:"",image_url:"",external_link:"",submitted_by_name:"",submitted_by_email:""}),{data:d=[],isLoading:m}=qe({queryKey:["communityEvents"],queryFn:async()=>(await ae.entities.CommunityEvent.list()).filter(b=>b.status==="approved").filter(b=>new Date(b.date_time)>=new Date).sort((b,y)=>new Date(b.date_time)-new Date(y.date_time))}),g=async v=>{const b=v.target.files[0];if(b){a(!0);try{const{file_url:y}=await ae.integrations.Core.UploadFile({file:b});h({...u,image_url:y})}catch(y){console.error("Failed to upload image:",y),alert("Failed to upload image. Please try again.")}a(!1)}},w=async()=>{var v;if(!u.title.trim()||!u.date_time||!u.submitted_by_name.trim()||!u.submitted_by_email.trim()){alert("Please fill in all required fields");return}l(!0);try{const y=(await ae.functions.invoke("adModeration",{title:u.title,description:u.description||"",image_url:u.image_url,type:"event",location:u.location,date_time:u.date_time})).data||{},_=y.safe!==!1,N=y.score||100,j=y.severity||"low",S=!_||N<90,P=((v=(await ae.entities.Settings.list())[0])==null?void 0:v.moderation_enabled)??!0;let A="pending";!P||!S?A="approved":j==="critical"?A="rejected":j==="low"&&N>=90&&(A="approved");const F=await ae.entities.CommunityEvent.create({...u,status:A,ai_flagged:S,ai_score:N,ai_reason:y.reason,ai_violations:y.violations||[],ai_severity:j,ai_recommended_action:y.recommended_action}),I=A==="approved"?"approved and is now live":A==="rejected"?"rejected":"submitted for review";if(await ae.integrations.Core.SendEmail({to:u.submitted_by_email,subject:`Event "${u.title}" ${A==="approved"?"Approved":A==="rejected"?"Not Approved":"Received"}`,body:`
1010          <h2>Event Submission ${A==="approved"?"Approved!":A==="rejected"?"Update":"Received"}</h2>
1011          <p>Your community event has been ${I}.</p>
1012          <p><strong>Event:</strong> ${u.title}</p>
1013          ${A==="rejected"?`<p><strong>Reason:</strong> ${y.reason}</p>`:""}
1014          ${A==="pending"?"<p>Our team will review it shortly and notify you of the decision.</p>":""}
1015          <p>Thank you for your submission!</p>
1016        `}).catch(console.error),A==="pending"){const R=await ae.entities.User.filter({role:"admin"});for(const M of R)M.email&&await ae.integrations.Core.SendEmail({to:M.email,subject:`⚠️ Event Requires Review: ${u.title}`,body:`
1017                <h2>Community Event Pending Review</h2>
1018                <p><strong>Title:</strong> ${u.title}</p>
1019                <p><strong>Submitter:</strong> ${u.submitted_by_name} (${u.submitted_by_email})</p>
1020                <p><strong>AI Score:</strong> ${N}/100</p>
1021                <p><strong>Severity:</strong> ${j==null?void 0:j.toUpperCase()}</p>
1022                <p><strong>Reason:</strong> ${y.reason}</p>
1023                <p>Please review in the admin dashboard.</p>
1024              `}).catch(console.error)}r(!1),h({title:"",description:"",date_time:"",location:"",image_url:"",external_link:"",submitted_by_name:"",submitted_by_email:""}),alert(A==="approved"?"Your event has been approved and is now live!":A==="rejected"?"Your event could not be approved due to content policy violations.":"Your event has been submitted for review. You'll receive an email notification."),c.invalidateQueries(["communityEvents"])}catch(b){console.error("Failed to submit event:",b),alert("Failed to submit event. Please try again.")}l(!1)};return m?i.jsx("div",{className:"p-6 flex items-center justify-center",children:i.jsx("p",{className:"text-slate-400",children:"Loading events..."})}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold text-white",children:"Upcoming Events"}),i.jsx("p",{className:"text-slate-400",children:"Discover local events submitted by the community"})]}),i.jsxs(ue,{onClick:()=>r(!0),className:"bg-purple-600 hover:bg-purple-700",children:[i.jsx(li,{className:"w-4 h-4 mr-2"}),"Submit Event"]})]}),d.length===0?i.jsx(Me,{className:"bg-slate-900 border-slate-800",children:i.jsxs(Fe,{className:"p-12 text-center",children:[i.jsx(Dr,{className:"w-16 h-16 text-slate-700 mx-auto mb-4"}),i.jsx("p",{className:"text-slate-400 mb-4",children:"No upcoming community events yet."}),i.jsxs(ue,{onClick:()=>r(!0),variant:"outline",className:"border-slate-700 text-slate-300 hover:bg-slate-800",children:[i.jsx(li,{className:"w-4 h-4 mr-2"}),"Submit the First Event"]})]})}):i.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:d.map(v=>i.jsxs(Me,{className:"overflow-hidden hover:shadow-lg transition-shadow bg-slate-900 border-slate-800",children:[v.image_url&&i.jsx("img",{src:v.image_url,alt:v.title,className:"w-full h-48 object-cover"}),i.jsxs(st,{children:[i.jsx(at,{className:"text-xl text-white",children:v.title}),i.jsxs("div",{className:"flex flex-col gap-2 text-sm text-slate-400",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Fn,{className:"w-4 h-4"}),i.jsx("span",{children:Ut(new Date(v.date_time),"MMM d, yyyy • h:mm a")})]}),v.location&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(js,{className:"w-4 h-4"}),i.jsx("span",{children:v.location})]})]})]}),i.jsxs(Fe,{children:[i.jsx("p",{className:"text-slate-300 mb-4",children:v.description}),v.external_link&&i.jsxs("a",{href:v.external_link,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-purple-400 hover:text-purple-300 font-semibold",children:[i.jsx(ws,{className:"w-4 h-4"}),"Learn More"]}),t&&(t.email===v.submitted_by_email||t.role==="admin")&&i.jsxs(ue,{size:"sm",className:"w-full mt-4 bg-amber-500 hover:bg-amber-600 text-slate-900 font-bold",onClick:()=>{const b=new URLSearchParams;b.set("upgrade_title",v.title),b.set("upgrade_desc",v.description),v.image_url&&b.set("upgrade_img",v.image_url),v.external_link&&b.set("upgrade_link",v.external_link),e(`${Ft("AdManager")}?${b.toString()}`)},children:[i.jsx(Kc,{className:"w-4 h-4 mr-2"}),"Upgrade to Pop-up Ad"]})]})]},v.id))}),i.jsx(rn,{open:n,onOpenChange:r,children:i.jsxs(en,{className:"max-w-2xl max-h-[90vh] overflow-y-auto bg-white text-slate-900",children:[i.jsx(vn,{children:i.jsx(sn,{children:"Submit Community Event"})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"title",children:"Event Title *"}),i.jsx(Ee,{id:"title",value:u.title,onChange:v=>h({...u,title:v.target.value}),placeholder:"Community Trivia Night"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"date-time",children:"Date & Time *"}),i.jsx(Ee,{id:"date-time",type:"datetime-local",value:u.date_time?u.date_time.slice(0,16):"",onCh
1024ange:v=>h({...u,date_time:v.target.value?new Date(v.target.value).toISOString():""})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"location",children:"Location"}),i.jsx(Ee,{id:"location",value:u.location,onChange:v=>h({...u,location:v.target.value}),placeholder:"The Local Pub"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"description",children:"Description"}),i.jsx(nr,{id:"description",value:u.description,onChange:v=>h({...u,description:v.target.value}),placeholder:"Tell us about your event...",rows:4})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"image",children:"Event Image (Optional)"}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Ee,{id:"image",type:"file",accept:"image/*",onChange:g,disabled:s}),u.image_url&&i.jsx("img",{src:u.image_url,alt:"Preview",className:"h-20 object-contain rounded"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"link",children:"External Link (Optional)"}),i.jsx(Ee,{id:"link",type:"url",value:u.external_link,onChange:v=>h({...u,external_link:v.target.value}),placeholder:"https://..."})]}),i.jsxs("div",{className:"border-t pt-4 mt-4",children:[i.jsx("h3",{className:"font-semibold mb-3",children:"Your Information"}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"name",children:"Your Name *"}),i.jsx(Ee,{id:"name",value:u.submitted_by_name,onChange:v=>h({...u,submitted_by_name:v.target.value}),placeholder:"John Doe"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"email",children:"Your Email *"}),i.jsx(Ee,{id:"email",type:"email",value:u.submitted_by_email,onChange:v=>h({...u,submitted_by_email:v.target.value}),placeholder:"[email protected]"})]})]})]})]}),i.jsxs(Fr,{children:[i.jsx(ue,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),i.jsx(ue,{onClick:w,disabled:o,children:o?"Submitting...":"Submit Event"})]})]})})]})}function BMe(){const e=qi(),[t,n]=O.useState("forum");return se.useEffect(()=>{const s=new URLSearchParams(window.location.search).get("tab");s&&n(s)},[]),i.jsxs("div",{className:"min-h-screen bg-slate-950 pb-20 font-sans",children:[i.jsx("div",{className:"bg-gradient-to-b from-indigo-900 to-slate-950 pt-8 pb-12 px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("button",{onClick:()=>e(Ft("CentralHub")),className:"text-slate-400 hover:text-white flex items-center gap-2 mb-6 transition-colors",children:[i.jsx(uu,{className:"w-4 h-4"})," Back to Hub"]}),i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"bg-indigo-500/20 p-3 rounded-2xl backdrop-blur-sm border border-indigo-500/30",children:i.jsx(Dr,{className:"w-8 h-8 text-indigo-400"})}),i.jsx("h1",{className:"text-3xl md:text-4xl font-black text-white tracking-tight",children:"Community"})]}),i.jsx("p",{className:"text-slate-400 text-lg max-w-2xl",children:"Discuss strategies, check rankings, and connect with other players."})]})}),i.jsx("div",{className:"max-w-4xl mx-auto px-4 -mt-8",children:i.jsxs(tu,{value:t,onValueChange:n,className:"space-y-6",children:[i.jsxs(Wl,{className:"grid w-full grid-cols-3 bg-slate-900 border border-slate-800",children:[i.jsxs(Wt,{value:"forum",className:"data-[state=active]:bg-indigo-600 data-[state=active]:text-white",children:[i.jsx(Wo,{className:"w-4 h-4 mr-2"})," Forum"]}),i.jsxs(Wt,{value:"leaderboard",className:"data-[state=active]:bg-indigo-600 data-[state=active]:text-white",children:[i.jsx(Jt,{className:"w-4 h-4 mr-2"})," Leaderboard"]}),i.jsxs(Wt,{value:"events",className:"data-[state=active]:bg-indigo-600 data-[state=active]:text-white",children:[i.jsx(Dr,{className:"w-4 h-4 mr-2"})," Events"]})]}),i.jsx(Yt,{value:"forum",children:i.jsx(LMe,{})}),i.jsx(Yt,{value:"leaderboard",children:i.jsx(qMe,{})}),i.jsx(Yt,{value:"events",children:i.jsx(zMe,{})})]})})]})}function UMe({quizId:e,onClose:t}){const{data:n=[],isLoading:r}=qe({queryKey:["quizReviews",e],queryFn:async()=>{var a;return e?((a=(await ae.functions.invoke("communityQuiz",{action:"getReviews",quizId:e})).data)==null?void 0:a.reviews)||[]:[]},enabled:!!e});return i.jsx(Gs,{children:e&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/80 backdrop-blur-sm",children:i.jsxs(rt.div,{initial:{opacity:0,scale:.95}
1024,animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-slate-900 border border-slate-800 w-full max-w-lg max-h-[80vh] rounded-xl shadow-2xl flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"p-4 border-b border-slate-800 flex justify-between items-center bg-slate-900/50",children:[i.jsxs("h3",{className:"text-lg font-bold text-white flex items-center gap-2",children:[i.jsx(Wo,{className:"w-5 h-5 text-indigo-400"}),"Community Reviews"]}),i.jsx("button",{onClick:t,className:"text-slate-400 hover:text-white transition-colors",children:i.jsx(Si,{className:"w-6 h-6"})})]}),i.jsx("div",{className:"p-4 overflow-y-auto custom-scrollbar flex-1",children:r?i.jsx("div",{className:"flex justify-center py-8",children:i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-500"})}):n.length>0?i.jsx("div",{className:"space-y-4",children:n.map(s=>{var a;return i.jsxs("div",{className:"bg-slate-800/50 border border-slate-700/50 rounded-lg p-4",children:[i.jsxs("div",{className:"flex justify-between items-start mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 rounded-full bg-indigo-900/50 flex items-center justify-center text-xs font-bold text-indigo-200 border border-indigo-500/20",children:(a=s.user_name)==null?void 0:a.charAt(0).toUpperCase()}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm font-semibold text-slate-200",children:s.user_name}),i.jsx("div",{className:"text-xs text-slate-500",children:new Date(s.created_date).toLocaleDateString()})]})]}),i.jsx("div",{className:"flex",children:[...Array(5)].map((o,l)=>i.jsx(Za,{className:`w-3.5 h-3.5 ${l<s.rating?"text-amber-500 fill-amber-500":"text-slate-700"}`},l))})]}),s.comment&&i.jsx("p",{className:"text-sm text-slate-300 leading-relaxed pl-10",children:s.comment})]},s.id)})}):i.jsxs("div",{className:"text-center py-12 text-slate-500",children:[i.jsx(Wo,{className:"w-12 h-12 mx-auto mb-3 opacity-20"}),i.jsx("p",{children:"No reviews yet for this quiz."})]})})]})})})}function VMe(){const e=qi(),{data:t=[],isLoading:n}=qe({queryKey:["creatorLeaderboard"],queryFn:async()=>{var s;return((s=(await ae.functions.invoke("communityQuiz",{action:"getCreatorLeaderboard"})).data)==null?void 0:s.leaderboard)||[]}});return n?i.jsx("div",{className:"h-64 flex items-center justify-center",children:i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-500"})}):i.jsxs("div",{className:"bg-white rounded-xl border border-slate-200 shadow-sm overflow-hidden w-full",children:[i.jsxs("div",{className:"bg-slate-50 p-4 border-b border-slate-200 flex items-center justify-between",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("h3",{className:"font-bold text-slate-900 flex items-center gap-2",children:[i.jsx(nB,{className:"w-5 h-5 text-amber-500 flex-shrink-0"}),"Top Creators"]}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Recognizing our best quiz writers"})]}),i.jsx(Jt,{className:"w-8 h-8 text-slate-200 flex-shrink-0"})]}),i.jsx("div",{className:"divide-y divide-slate-100 overflow-hidden",children:t.length===0?i.jsx("div",{className:"p-8 text-center text-slate-400 text-sm",children:"No creators yet. Be the first!"}):t.map((r,s)=>{var a;return i.jsx(rt.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:s*.1},className:"p-4 hover:bg-slate-50 transition-colors cursor-pointer group overflow-hidden",onClick:()=>e(Ft(`PublicProfile?userId=${r.userId}`)),children:i.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[i.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 overflow-hidden",children:[i.jsxs("div",{className:"relative flex-shrink-0",style:{width:"40px",height:"40px"},children:[s<3&&i.jsx("div",{className:"absolute -top-1 -right-1 z-20",children:i.jsx(z0,{className:`w-4 h-4 ${s===0?"text-yellow-500 fill-yellow-500":s===1?"text-slate-400 fill-slate-400":"text-amber-700 fill-amber-700"} drop-shadow-lg`})}),i.jsxs(Gh,{className:`w-10 h-10 border-2 ${s===0?"border-yellow-500":s===1?"border-slate-400":s===2?"border-amber-700":"border-transparent"}`,children:[i.jsx(ev,{src:r.avatar_url}),i.jsx(Qh,{className:"bg-indigo-100 text-indigo-700 font-bold",children:(a=r.name)==null?void 0:a.charAt(0).toUpperCase()})]}),i.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-bold border-2 border-white ${s<3?"bg-slate-900 text-white":"bg-slate-200 text-slate-600"} z-10`,children:s+1})]}),i.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden",children:[i.jsx("div",{className:"font-semibold text-slate-900 text-sm group-hover:text-indigo-600 transition-colors truncate",children:r.name}),i.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-500",children:[i.jsx(C_,{className:"w-3 h-3 flex-shrink-0"}),i.jsxs("span",{className:"truncate",children:[r.quizCount," Quizzes"]})]})]})]}),i.jsxs("div",{className:"text-right flex-shrink-0 pl-2",children:[i.jsx("div",{className:"font-bold text-slate-900 text-sm whitespace-nowrap",children:r.score}),i.jsx("div",{className:"text-[10px] text-slate-400 uppercase tracking-wider font-semibold whitespace-nowrap",children:"Pts"})]})]})},r.userId)})}),i.jsx("div",{className:"bg-slate-50 p-3 text-center border-t border-slate-200",children:i.jsx("p",{className:"text-[10px] text-slate-500",children:"Points based on plays, quizzes, and ratings."})})]})}function WMe(){const e=qi(),[t,n]=O.useState(""),[r,s]=O.useState("trending"),[a,o]=O.useState("all"),[l,c]=O.useState("all"),[u,h]=O.useState(null),{data:d,isLoading:m}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me().catch(()=>null)}),{data:g=[]}=qe({queryKey:["quizRecommendations",d==null?void 0:d.id],queryFn:async()=>{var S;return d?((S=(await ae.functions.invoke("communityQuiz",{action:"getRecommendations"})).data)==null?void 0:S.recommendations)||[]:[]},enabled:!!d}),{data:w=[],isLoading:v,refetch:b}=qe({queryKey:["communityQuizzes",r],queryFn:async()=>{const j=await ae.entities.CommunityQuiz.list(),S=new Date;return j.filter(C=>C.status==="active"&&new Date(C.expires_at)>S)}}),y=async(j,S)=>{if(S.stopPropagation(),!!confirm("Delete this quiz permanently? This cannot be undone."))try{await ae.functions.invoke("communityQuiz",{action:"deleteQuiz",quizId:j}
1024),tt.success("Quiz deleted successfully"),b()}catch(C){tt.error(C.message||"Failed to delete quiz")}},_=w.filter(j=>{var A;const S=j.title.toLowerCase().includes(t.toLowerCase())||((A=j.description)==null?void 0:A.toLowerCase().includes(t.toLowerCase())),C=a==="all"||j.category===a,P=l==="all"||j.difficulty===l;return S&&C&&P}).sort((j,S)=>r==="trending"?(S.total_plays||0)-(j.total_plays||0):r==="newest"?new Date(S.created_date)-new Date(j.created_date):r==="top_rated"?(S.average_rating||0)-(j.average_rating||0):0);if(m)return i.jsx("div",{className:"min-h-screen flex items-center justify-center",children:i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600"})});if(!d)return i.jsx("div",{className:"min-h-screen bg-slate-50 flex flex-col items-center justify-center p-4",children:i.jsxs(Me,{className:"max-w-md w-full text-center p-8 shadow-xl border-indigo-100",children:[i.jsx("div",{className:"w-20 h-20 bg-indigo-100 rounded-full flex items-center justify-center mx-auto mb-6",children:i.jsx(Sd,{className:"w-10 h-10 text-indigo-600"})}),i.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-3",children:"Community Challenges"}),i.jsx("p",{className:"text-slate-600 mb-8",children:"Join the community to create, play, and rate quizzes from other players."}),i.jsx(ue,{onClick:()=>ae.auth.redirectToLogin(),className:"w-full bg-indigo-600 hover:bg-indigo-700 h-12 text-lg",children:"Log In to Play"})]})});if(!d.display_name&&!d.full_name)return i.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center p-4",children:i.jsxs(Me,{className:"max-w-md w-full text-center p-8 shadow-xl border-indigo-100",children:[i.jsx("div",{className:"w-20 h-20 bg-amber-100 rounded-full flex items-center justify-center mx-auto mb-6",children:i.jsx(zo,{className:"w-10 h-10 text-amber-600"})}),i.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-3",children:"Setup Your Profile"}),i.jsx("p",{className:"text-slate-600 mb-8",children:"Please set a display name to start playing and interacting with the community."}),i.jsx(ue,{onClick:()=>e(Ft("UserProfile")),className:"w-full bg-indigo-600 hover:bg-indigo-700 h-12 text-lg",children:"Complete Profile"})]})});const N=({quiz:j})=>{var P;const S=Math.ceil((new Date(j.expires_at)-new Date)/864e5),C=async A=>{A.stopPropagation();const F=`${window.location.origin}${Ft(`PlayCommunityQuiz?id=${j.id}`)}`;if(navigator.share)try{await navigator.share({title:j.title,text:`Check out this quiz: ${j.title}`,url:F})}catch{}else navigator.clipboard.writeText(F),tt.success("Link copied to clipboard!")};return i.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},whileHover:{y:-5},transition:{duration:.2},children:i.jsxs(Me,{className:"h-full flex flex-col border-slate-200 hover:border-indigo-500 transition-colors hover:shadow-md",children:[i.jsxs(st,{className:"pb-3",children:[i.jsxs("div",{className:"flex justify-between items-start gap-2",children:[i.jsxs(nt,{variant:"outline",className:S<5?"text-red-500 border-red-200 bg-red-50":"text-slate-500",children:[S," days left"]}),i.jsx("div",{className:"flex gap-1",children:j.average_rating>4.5&&i.jsxs(nt,{className:"bg-amber-500 text-white border-none",children:[i.jsx(Za,{className:"w-3 h-3 mr-1 fill-current"})," Top Rated"]})})]}),i.jsx(at,{className:"line-clamp-2 leading-tight",children:j.title}),i.jsx(Ja,{className:"line-clamp-2 h-10",children:j.description||"No description provided."}),i.jsxs("div",{className:"flex gap-2 mt-2 flex-wrap",children:[j.category&&i.jsx(nt,{variant:"secondary",className:"text-xs",children:j.category}),j.difficulty&&i.jsx(nt,{variant:"outline",className:`text-xs ${j.difficulty==="Easy"?"border-green-500 text-green-700 bg-green-50":j.difficulty==="Hard"?"border-red-500 text-red-700 bg-red-50":"border-amber-500 text-amber-700 bg-amber-50"}`,children:j.difficulty})]})]}),i.jsxs(Fe,{className:"py-2 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-4 text-sm text-slate-500 mb-4",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Jt,{className:"w-4 h-4 text-indigo-500"}),i.jsxs("span",{children:[j.questions_count," Qs"]})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(_s,{className:"w-4 h-4 text-green-500"}),i.jsxs("span",{children:[j.total_plays," plays"]})]}),i.jsxs("button",{onClick:A=>{A.stopPropagation(),h(j.id)},className:"flex items-center gap-1 hover:text-indigo-600 transition-colors",title:"View Reviews",children:[i.jsx(Za,{className:"w-4 h-4 text-amber-500"}),i.jsx("span",{className:"underline decoration-dotted underline-offset-2",children:((P=j.average_rating)==null?void 0:P.toFixed(1))||"N/A"})]})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-400",children:[i.jsx(zo,{className:"w-3 h-3"}),i.jsxs("button",{onClick:A=>{A.stopPropagation(),e(Ft(`PublicProfile?userId=${j.created_by_user_id}`))},className:"hover:text-indigo-600 hover:underline cursor-pointer transition-colors",children:["By ",j.created_by_name]})]})]}),i.jsxs(h4,{className:"pt-2 gap-2",children:[i.jsxs(ue,{className:"flex-1 bg-indigo-600 hover:bg-indigo-700 gap-2",onClick:()=>e(Ft(`PlayCommunityQuiz?id=${j.id}`)),children:[i.jsx(_s,{className:"w-4 h-4"})," Play"]}),i.jsx(ue,{variant:"outline",size:"icon",onClick:A=>{A.stopPropagation(),h(j.id)},className:"text-slate-600 border-slate-200 hover:bg-slate-50",title:"View Reviews",children:i.jsx(Wo,{className:"w-4 h-4"})}),i.jsx(ue,{variant:"outline",size:"icon",onClick:C,className:"text-indigo-600 border-indigo-200 hover:bg-indigo-50",title:"Share Quiz",children:i.jsx(Ho,{className:"w-4 h-4"})}),(d==null?void 0:d.id)===j.created_by_user_id&&i.jsx(ue,{variant:"outline",size:"icon",onClick:A=>
1024y(j.id,A),className:"text-red-600 border-red-200 hover:bg-red-50",title:"Delete Quiz",children:i.jsx(ci,{className:"w-4 h-4"})})]})]})})};return i.jsxs("div",{className:"min-h-screen bg-slate-50 pb-20",children:[i.jsx("div",{className:"bg-white border-b border-slate-200 sticky top-0 z-10",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-4",children:[i.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsxs("h1",{className:"text-2xl font-bold text-slate-900 flex items-center gap-2",children:[i.jsx(Sd,{className:"w-6 h-6 text-orange-500"}),"Community Challenges"]}),i.jsx("p",{className:"text-slate-500 text-sm",children:"Create & play quizzes made by the community."})]}),i.jsx("div",{className:"flex items-center gap-3",children:d?i.jsxs(ue,{onClick:()=>e(Ft("CreateCommunityQuiz")),className:"bg-slate-900 text-white hover:bg-slate-800",children:[i.jsx(li,{className:"w-4 h-4 mr-2"})," Create Quiz"]}):i.jsx(ue,{onClick:()=>ae.auth.redirectToLogin(),variant:"outline",children:"Log in to Create"})})]}),i.jsxs("div",{className:"mt-6 space-y-3",children:[i.jsxs("div",{className:"relative",children:[i.jsx(Ld,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}),i.jsx(Ee,{placeholder:"Search quizzes...",value:t,onChange:j=>n(j.target.value),className:"pl-10 bg-slate-100 border-slate-200"})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[i.jsxs(Xt,{value:a,onValueChange:o,children:[i.jsx(Ht,{children:i.jsx(Zt,{placeholder:"Category"})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"all",children:"All Categories"}),i.jsx(Ie,{value:"General Knowledge",children:"General Knowledge"}),i.jsx(Ie,{value:"Irish & UK News",children:"Irish & UK News"}),i.jsx(Ie,{value:"World News",children:"World News"}),i.jsx(Ie,{value:"History",children:"History"}),i.jsx(Ie,{value:"Science & Technology",children:"Science & Tech"}),i.jsx(Ie,{value:"Pop Culture",children:"Pop Culture"}),i.jsx(Ie,{value:"Movies & TV",children:"Movies & TV"}),i.jsx(Ie,{value:"Music",children:"Music"}),i.jsx(Ie,{value:"Sports",children:"Sports"}),i.jsx(Ie,{value:"Geography",children:"Geography"}),i.jsx(Ie,{value:"Literature",children:"Literature"}),i.jsx(Ie,{value:"Food & Drink",children:"Food & Drink"}),i.jsx(Ie,{value:"Other",children:"Other"})]})]}),i.jsxs(Xt,{value:l,onValueChange:c,children:[i.jsx(Ht,{children:i.jsx(Zt,{placeholder:"Difficulty"})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"all",children:"All Levels"}),i.jsx(Ie,{value:"Easy",children:"Easy"}),i.jsx(Ie,{value:"Medium",children:"Medium"}),i.jsx(Ie,{value:"Hard",children:"Hard"})]})]}),i.jsxs(Xt,{value:r,onValueChange:s,children:[i.jsx(Ht,{children:i.jsx(Zt,{placeholder:"Sort By"})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"trending",children:"🔥 Trending"}),i.jsx(Ie,{value:"newest",children:"✨ Newest"}),i.jsx(Ie,{value:"top_rated",children:"⭐ Top Rated"})]})]})]})]})]})}),i.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-8",children:[i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8 mb-12",children:[i.jsx("div",{className:"lg:col-span-8",children:g.length>0&&i.jsxs("div",{className:"mb-10",children:[i.jsxs("h2",{className:"text-xl font-bold text-slate-800 mb-4 flex items-center gap-2",children:[i.jsx(es,{className:"w-5 h-5 text-indigo-500"}),"Recommended For You"]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:g.map(j=>i.jsx(N,{quiz:j},j.id))})]})}),i.jsx("div",{className:"lg:col-span-4",children:i.jsx(VMe,{})})]}),i.jsxs("h2",{className:"text-xl font-bold text-slate-800 mb-4 flex items-center gap-2",children:[i.jsx(Sd,{className:"w-5 h-5 text-orange-500"}),"All Challenges"]}),v?i.jsx("div",{className:"text-center py-20 text-slate-400",children:"Loading challenges..."}):_.length>0?i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:_.map(j=>i.jsx(N,{quiz:j},j.id))}):i.jsxs("div",{className:"text-center py-20 bg-white rounded-xl border border-dashed border-slate-300",children:[i.jsx("div",{className:"w-16 h-16 bg-slate-100 rounded-full flex items-center justify-center mx-auto mb-4",children:i.jsx(Ld,{className:"w-8 h-8 text-slate-400"})}),i.jsx("h3",{className:"text-lg font-bold text-slate-900",children:"No quizzes found"}),i.jsx("p",{className:"text-slate-500 max-w-sm mx-auto mt-2",children:"Be the first to create a community challenge!"}),d&&i.jsx(ue,{onClick:()=>e(Ft("CreateCommunityQuiz")),variant:"link",className:"mt-2 text-indigo-600",children:"Create One Now"})]})]}),i.jsx(UMe,{quizId:u,onClose:()=>h(null)})]})}var EY=["PageUp","PageDown"],PY=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],CY={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Nv="Slider",[MT,HMe,KMe]=d4(Nv),[AY]=ja(Nv,[KMe]),[GMe,QN]=AY(Nv),OY=O.forwardRef((e,t)=>
1024{const{name:n,min:r=0,max:s=100,step:a=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:h,onValueChange:d=()=>{},onValueCommit:m=()=>{},inverted:g=!1,form:w,...v}=e,b=O.useRef(new Set),y=O.useRef(0),N=o==="horizontal"?QMe:YMe,[j=[],S]=eu({prop:h,defaultProp:u,onChange:R=>{var $;($=[...b.current][y.current])==null||$.focus(),d(R)}}),C=O.useRef(j);function P(R){const M=t3e(j,R);I(R,M)}function A(R){I(R,y.current)}function F(){const R=C.current[y.current];j[y.current]!==R&&m(j)}function I(R,M,{commit:$}={commit:!1}){const B=s3e(a),U=a3e(Math.round((R-r)/a)*a+r,B),G=K0(U,[r,s]);S((Z=[])=>{const X=JMe(Z,G,M);if(i3e(X,c*a)){y.current=X.indexOf(G);const V=String(X)!==String(Z);return V&&$&&m(X),V?X:Z}else return Z})}return i.jsx(GMe,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:s,valueIndexToChangeRef:y,thumbs:b.current,values:j,orientation:o,form:w,children:i.jsx(MT.Provider,{scope:e.__scopeSlider,children:i.jsx(MT.Slot,{scope:e.__scopeSlider,children:i.jsx(N,{"aria-disabled":l,"data-disabled":l?"":void 0,...v,ref:t,onPointerDown:Et(v.onPointerDown,()=>{l||(C.current=j)}),min:r,max:s,inverted:g,onSlideStart:l?void 0:P,onSlideMove:l?void 0:A,onSlideEnd:l?void 0:F,onHomeKeyDown:()=>!l&&I(r,0,{commit:!0}),onEndKeyDown:()=>!l&&I(s,j.length-1,{commit:!0}),onStepKeyDown:({event:R,direction:M})=>{if(!l){const U=EY.includes(R.key)||R.shiftKey&&PY.includes(R.key)?10:1,G=y.current,Z=j[G],X=a*U*M;I(Z+X,G,{commit:!0})}}})})})})});OY.displayName=Nv;var[TY,RY]=AY(Nv,{startEdge:"left",endEdge:"right",size:"width",direction:1}),QMe=O.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:a,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...h}=e,[d,m]=O.useState(null),g=fn(t,N=>m(N)),w=O.useRef(void 0),v=Jy(s),b=v==="ltr",y=b&&!a||!b&&a;function _(N){const j=w.current||d.getBoundingClientRect(),S=[0,j.width],P=_5(S,y?[n,r]:[r,n]);return w.current=j,P(N-j.left)}return i.jsx(TY,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:i.jsx(MY,{dir:v,"data-orientation":"horizontal",...h,ref:g,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const j=_(N.clientX);o==null||o(j)},onSlideMove:N=>{const j=_(N.clientX);l==null||l(j)},onSlideEnd:()=>{w.current=void 0,c==null||c()},onStepKeyDown:N=>{const S=CY[y?"from-left":"from-right"].includes(N.key);u==null||u({event:N,direction:S?-1:1})}})})}),YMe=O.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:a,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...u}=e,h=O.useRef(null),d=fn(t,h),m=O.useRef(void 0),g=!s;function w(v){const b=m.current||h.current.getBoundingClientRect(),y=[0,b.height],N=_5(y,g?[r,n]:[n,r]);return m.current=b,N(v-b.top)}return i.jsx(TY,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:i.jsx(MY,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const b=w(v.clientY);a==null||a(b)},onSlideMove:v=>{const b=w(v.clientY);o==null||o(b)},onSlideEnd:()=>{m.current=void 0,l==null||l()},onStepKeyDown:v=>{const y=CY[g?"from-bottom":"from-top"].includes(v.key);c==null||c({event:v,direction:y?-1:1})}})})}),MY=O.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:c,...u}=e,h=QN(Nv,n);return i.jsx(Pt.span,{...u,ref:t,onKeyDown:Et(e.onKeyDown,d=>{d.key==="Home"?(o(d),d.preventDefault()):d.key==="End"?(l(d),d.preventDefault()):EY.concat(PY).includes(d.key)&&(c(d),d.preventDefault())}),onPointerDown:Et(e.onPointerDown,d=>{const m=d.target;m.setPointerCapture(d.pointerId),d.preventDefault(),h.thumbs.has(m)?m.focus():r(d)}),onPointerMove:Et(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&s(d)}),onPointerUp:Et(e.onPointerUp,d=>{const m=d.target;m.hasPointerCapture(d.pointerId)&&(m.releasePointerCapture(d.pointerId),a(d))})})}),IY="SliderTrack",DY=O.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=QN(IY,n);return i.jsx(Pt.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});
1024DY.displayName=IY;var IT="SliderRange",LY=O.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=QN(IT,n),a=RY(IT,n),o=O.useRef(null),l=fn(t,o),c=s.values.length,u=s.values.map(m=>qY(m,s.min,s.max)),h=c>1?Math.min(...u):0,d=100-Math.max(...u);return i.jsx(Pt.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:l,style:{...e.style,[a.startEdge]:h+"%",[a.endEdge]:d+"%"}})});LY.displayName=IT;var DT="SliderThumb",FY=O.forwardRef((e,t)=>{const n=HMe(e.__scopeSlider),[r,s]=O.useState(null),a=fn(t,l=>s(l)),o=O.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return i.jsx(XMe,{...e,ref:a,index:o})}),XMe=O.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...a}=e,o=QN(DT,n),l=RY(DT,n),[c,u]=O.useState(null),h=fn(t,_=>u(_)),d=c?o.form||!!c.closest("form"):!0,m=H_(c),g=o.values[r],w=g===void 0?0:qY(g,o.min,o.max),v=e3e(r,o.values.length),b=m==null?void 0:m[l.size],y=b?n3e(b,w,l.direction):0;return O.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),i.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${w}% + ${y}px)`},children:[i.jsx(MT.ItemSlot,{scope:e.__scopeSlider,children:i.jsx(Pt.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":o.min,"aria-valuenow":g,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...a,ref:h,style:g===void 0?{display:"none"}:e.style,onFocus:Et(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),d&&i.jsx($Y,{name:s??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});FY.displayName=DT;var ZMe="RadioBubbleInput",$Y=O.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=O.useRef(null),a=fn(s,r),o=Q_(t);return O.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&h){const d=new Event("input",{bubbles:!0});h.call(l,t),l.dispatchEvent(d)}},[o,t]),i.jsx(Pt.input,{style:{display:"none"},...n,ref:a,defaultValue:t})});$Y.displayName=ZMe;function JMe(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,a)=>s-a)}function qY(e,t,n){const a=100/(n-t)*(e-t);return K0(a,[0,100])}function e3e(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function t3e(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function n3e(e,t,n){const r=e/2,a=_5([0,50],[0,r]);return(r-a(t)*n)*n}function r3e(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function i3e(e,t){if(t>0){const n=r3e(e);return Math.min(...n)>=t}return!0}function _5(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function s3e(e){return(String(e).split(".")[1]||"").length}function a3e(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var zY=OY,o3e=DY,l3e=LY,c3e=FY;const BY=O.forwardRef(({className:e,...t},n)=>i.jsxs(zY,{ref:n,className:Nt("relative flex w-full touch-none select-none items-center",e),...t,children:[i.jsx(o3e,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:i.jsx(l3e,{className:"absolute h-full bg-primary"})}),i.jsx(c3e,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));BY.displayName=zY.displayName;function u3e(){const[e,t]=O.useState({title:"",description:"",image_url:"",link_url:"",placement:"leaderboard_footer",impressions:1e3,campaign_id:""}),[n,r]=O.useState(!1),[s,a]=O.useState(!1),{data:o}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me()}),{data:l=[]}=qe({queryKey:["myCampaigns"],queryFn:async()=>o?ae.entities.AdCampaign.filter({creator_id:o.id}):[],enabled:!!o}),u=e.impressions/1e3*5,h=async m=>{const g=m.target.files[0];if(g){r(!0);try{const{file_url:w}=await ae.integrations.Core.UploadFile({file:g});t({...e,image_url:w}),tt.success("Image uploaded")}catch{tt.error("Failed to upload image")}r(!1)}},d=async()=>{var m;if(!o){ae.auth.redirectToLogin();return}if(!e.title||!e.image_url){tt.error("Title and image are required");return}a(!0);try{const g=`${window.location.origin}/user-profile?ad_payment_success=true&session_id={CHECKOUT_SESSION_ID}`,w=`${window.location.origin}/create-ad?canceled=true`,v=await ae.functions.invoke("adPayment",{action:"createAdSession",adData:{...e,creator_id:o.id,creator_email:o.email,is_admin_ad:!1,impressions_purchased:e.impressions,impressions_remaining:e.impressions,total_paid:u,status:"pending_payment"},cost:u,successUrl:g,cancelUrl:w});(m=v.data)!=null&&m.url&&(window.location.href=v.data.url)}catch{tt.error("Failed to process payment"),a(!1)}};return o?i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 p-6",children:i.jsxs("div",{className:"max-w-6xl mx-auto grid grid-cols-1 lg:grid-cols-2 gap-6",children:[i.jsx("div",{className:"lg:order-2",children:i.jsxs("div",{className:"sticky top-6",children:[i.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-4",children:"Live Preview"}),i.jsx(Me,{className:"overflow-hidden",children:i.jsxs(Fe,{className:"p-0",children:[e.image_url?i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:e.image_url,alt:"Preview",className:"w-full h-auto object-cover"}),i.jsx("div",{className:"absolute top-2 right-2 text-[8px] bg-white/80 px-1.5 py-0.5 rounded text-slate-500",children:"Sponsored"})]}):i.jsx("div",{className:"w-full h-64 bg-slate-100 flex items-center justify-center",children:i.jsx(ma,{className:"w-12 h-12 text-slate-300"})}),i.jsxs("div",{className:"p-4 bg-white",children:[i.jsx("h4",{className:"font-bold text-sm",children:e.title||"Your ad title will appear here"}),e.description&&i.jsx("p",{className:"text-xs text-slate-600 mt-1",children:e.description}),e.link_url&&i.jsx("div",{className:"flex items-center gap-1 text-xs text-indigo-600 mt-2",children:i.jsx("span",{children:"Learn more"})})]})]})}),i.jsxs("div",{className:"mt-4 bg-blue-50 border border-blue-200 rounded-lg p-4",children:[i.jsxs("p",{className:"text-sm text-blue-800",children:[i.jsx("strong",{children:"Placement:"})," ",e.placement==="leaderboard_footer"?"Leaderboard Footer":"Hub Tile"]}),i.jsx("p",{className:"text-xs text-blue-600 mt-2",children:"Your ad will appear to users as 
1024shown above"})]})]})}),i.jsxs(Me,{className:"lg:order-1",children:[i.jsxs(st,{children:[i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(gg,{className:"w-6 h-6 text-indigo-600"}),"Create Your Ad"]}),i.jsx(Ja,{children:"Advertise on the leaderboard or hub. €5 per 1,000 impressions."})]}),i.jsxs(Fe,{className:"space-y-6",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Ad Title *"}),i.jsx(Ee,{value:e.title,onChange:m=>t({...e,title:m.target.value}),placeholder:"Your business or message"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Description (Optional)"}),i.jsx(Ee,{value:e.description,onChange:m=>t({...e,description:m.target.value}),placeholder:"Short tagline"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Ad Image *"}),i.jsx(Ee,{type:"file",accept:"image/*",onChange:h,disabled:n}),e.image_url&&i.jsx("img",{src:e.image_url,alt:"Preview",className:"mt-3 h-40 object-contain border rounded"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Link URL (Optional)"}),i.jsx(Ee,{value:e.link_url,onChange:m=>t({...e,link_url:m.target.value}),placeholder:"https://yourwebsite.com"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Campaign (Optional)"}),i.jsxs(Xt,{value:e.campaign_id,onValueChange:m=>t({...e,campaign_id:m}),children:[i.jsx(Ht,{children:i.jsx(Zt,{placeholder:"No campaign (standalone ad)"})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:null,children:"No campaign (standalone ad)"}),l.filter(m=>m.status==="active"||m.status==="draft").map(m=>i.jsxs(Ie,{value:m.id,children:[m.name," (",m.status,")"]},m.id))]})]}),i.jsx("p",{className:"text-xs text-slate-600 mt-1",children:"Organize ads into campaigns for better tracking"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Placement"}),i.jsxs(Xt,{value:e.placement,onValueChange:m=>t({...e,placement:m}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"leaderboard_footer",children:"Leaderboard Footer"}),i.jsx(Ie,{value:"hub_tile",children:"Hub Tile"})]})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Number of Impressions"}),i.jsx(BY,{value:[e.impressions],onValueChange:m=>t({...e,impressions:m[0]}),min:1e3,max:1e4,step:1e3,className:"my-4"}),i.jsxs("div",{className:"flex justify-between text-sm text-slate-600",children:[i.jsx("span",{children:"1,000"}),i.jsxs("span",{className:"font-bold text-lg text-indigo-600",children:[e.impressions.toLocaleString()," impressions"]}),i.jsx("span",{children:"10,000"})]})]}),i.jsxs("div",{className:"bg-indigo-50 border-2 border-indigo-200 rounded-lg p-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"font-semibold",children:"Total Cost:"}),i.jsxs("span",{className:"text-3xl font-bold text-indigo-600",children:["€",u.toFixed(2)]})]}),i.jsx("p",{className:"text-xs text-slate-600 mt-2",children:"€5 per 1,000 impressions"})]}),i.jsx(ue,{className:"w-full",size:"lg",onClick:d,disabled:!e.title||!e.image_url||s,children:s?"Processing...":`Pay €${u.toFixed(2)} & Submit for Review`}),i.jsx("p",{className:"text-xs text-slate-600 text-center",children:"Your ad will be reviewed for content policy compliance before going live."})]})]})]})}):i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 p-6 flex items-center justify-center",children:i.jsx(Me,{className:"max-w-md",children:i.jsxs(Fe,{className:"p-6 text-center",children:[i.jsx("p",{children:"Please log in to create an ad."}),i.jsx(ue,{onClick:()=>ae.auth.redirectToLogin(),className:"mt-4",children:"Log In"})]})})})}function d3e(){const e=qi(),[t,n]=O.useState(!1),[r,s]=O.useState({title:"",description:"",category:"General Knowledge",difficulty:"Medium"}),[a,o]=O.useState(!1),[l,c]=O.useState({}),[u,h]=O.useState([{id:1,question_text:"",question_type:"multiple_choice",correct_answer:"",option_a:"",option_b:"",option_c:"",option_d:""}]),d=()=>{if(u.length>=25){tt.error("Maximum 25 questions allowed");return}h([...u,{id:Date.now(),question_text:"",question_type:"multiple_choice",correct_answer:"",option_a:"",option_b:"",option_c:"",option_d:""}])},m=P=>{u.length!==1&&h(u.filter(A=>A.id!==P))},g=(P,A,F)=>
1024{if(h(u.map(I=>I.id===P?{...I,[A]:F}:I)),A==="question_text"&&l[P]){const I={...l};delete I[P],c(I)}},[w,v]=O.useState(!1),[b,y]=O.useState([]),_=async()=>{var P;o(!0);try{const A=await ae.functions.invoke("communityQuiz",{action:"suggestTopics"});(P=A.data)!=null&&P.topics&&(y(A.data.topics),v(!0))}catch(A){console.error(A),tt.error("Failed to get suggestions")}finally{o(!1)}},N=async(P,A,F)=>{var I;if(!A||!F){tt.error("Enter question and correct answer first");return}o(!0);try{const R=await ae.functions.invoke("communityQuiz",{action:"generateOptions",questionText:A,correctAnswer:F});if((I=R.data)!=null&&I.options&&R.data.options.length>=3){g(P,"option_a",F);const M=[F,...R.data.options];for(let $=M.length-1;$>0;$--){const B=Math.floor(Math.random()*($+1));[M[$],M[B]]=[M[B],M[$]]}h($=>$.map(B=>B.id!==P?B:{...B,option_a:M[0],option_b:M[1],option_c:M[2],option_d:M[3]})),tt.success("Options generated!")}}catch(R){console.error(R),tt.error("Failed to generate options")}finally{o(!1)}},j=async(P,A,F)=>{if(!A){tt.error("Enter question text first");return}o(!0);try{const I=await ae.functions.invoke("communityQuiz",{action:"analyzeClarity",questionText:A,correctAnswer:F});I.data&&(I.data.safe?(tt.success("Question looks clear!"),c(R=>({...R,[P]:"Looks good!"}))):(tt.warning("Feedback: "+I.data.feedback),c(R=>({...R,[P]:I.data.feedback}))))}catch(I){console.error(I)}finally{o(!1)}},S=()=>{var P,A,F,I,R,M;if(!((P=r.title)!=null&&P.trim()))return"Quiz title is required";if(!u||u.length===0)return"Add at least one question";for(let $=0;$<u.length;$++){const B=u[$];if(!((A=B.question_text)!=null&&A.trim()))return`Question ${$+1} is missing text`;if(B.question_type==="numerical"&&!((F=B.correct_answer)!=null&&F.trim()))return`Question ${$+1} is missing a correct answer`;if(B.question_type==="multiple_choice"){if(!((I=B.option_a)!=null&&I.trim())||!((R=B.option_b)!=null&&R.trim()))return`Question ${$+1} must have at least options A and B`;if(!B.correct_option_id)return`Question ${$+1}: Please select which option is the correct answer`;if(!((M=B[B.correct_option_id])!=null&&M.trim()))return`Question ${$+1}: The selected correct option is empty`}}return null},C=async()=>{var F,I;const P=S();if(P){tt.error(P);return}const A=u.map(R=>R.question_type==="multiple_choice"&&R.correct_option_id?{...R,correct_answer:R[R.correct_option_id]}:R);n(!0);try{const R=await ae.functions.invoke("communityQuiz",{action:"createQuiz",title:r.title,description:r.description,category:r.category,difficulty:r.difficulty,questions:A});if((F=R.data)!=null&&F.success)tt.success("Quiz published successfully!"),e(Ft("CommunityChallenges"));else throw new Error(((I=R.data)==null?void 0:I.error)||"Failed to create quiz")}catch(R){console.error(R),tt.error(R.message)}finally{n(!1)}};return i.jsxs("div",{className:"min-h-screen bg-slate-50 pb-20",children:[i.jsx("div",{className:"bg-white border-b border-slate-200 sticky top-0 z-10",children:i.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-4 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>e(-1),children:i.jsx(uu,{className:"w-5 h-5"})}),i.jsx("h1",{className:"text-xl font-bold",children:"Create Challenge"})]}),i.jsx(ue,{onClick:C,disabled:t,className:"bg-green-600 hover:bg-green-700",children:t?"Publishing...":"Publish Quiz"})]})}),i.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-8 space-y-8",children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsx(at,{children:"Quiz Details"})}),i.jsxs(Fe,{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between items-center mb-1",children:[i.jsx(me,{children:"Quiz Title"}),i.jsxs(ue,{variant:"ghost",size:"sm",onClick:_,disabled:a,className:"text-indigo-600 hover:text-indigo-700 h-auto p-0 px-2",children:[i.jsx(es,{className:"w-3 h-3 mr-1"}),"Suggest Trending Topic"]})]}),w&&b.length>0&&i.jsxs("div",{className:"mb-3 p-3 bg-indigo-50 border border-indigo-100 rounded-lg",children:[i.jsx("p",{className:"text-xs text-indigo-800 font-medium mb-2",children:"Trending Suggestions:"}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[b.map((P,A)=>i.jsx("button",{onClick:()=>{s({...r,title:P}),v(!1)},className:"text-xs bg-white text-slate-700 border border-slate-200 px-2 py-1 rounded hover:bg-indigo-100 hover:text-indigo-800 transition-colors",children:P},A)),i.jsx("button",{onClick:()=>v(!1),className:"text-xs text-slate-400 hover:text-slate-600 px-1",children:"Close"})]})]}),i.jsx(Ee,{value:r.title,onChange:P=>s({...r,title:P.target.value}),placeholder:"e.g., The Ultimate 90s Music Quiz"})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Description"}),i.jsx(nr,{value:r.description,onChange:P=>s({...r,description:P.target.value}),placeholder:"What's this quiz about?"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{children:"Category"}),i.jsxs(Xt,{value:r.category,onValueChange:P=>s({...r,category:P}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"General Knowledge",children:"General Knowledge"}),i.jsx(Ie,{value:"History",children:"History"}),i.jsx(Ie,{value:"Science & Technology",children:"Science & Technology"}),i.jsx(Ie,{value:"Pop Culture",children:"Pop Culture"}),i.jsx(Ie,{value:"Movies & TV",children:"Movies & TV"}),i.jsx(Ie,{value:"Music",children:"Music"}),i.jsx(Ie,{value:"Sports",children:"Sports"}),i.jsx(Ie,{value:"Geography",children:"Geography"}),i.jsx(Ie,{value:"Literature",children:"Literature"}),i.jsx(Ie,{value:"Food & Drink",children:"Food & Drink"}),i.jsx(Ie,{value:"Other",children:"Other"})]})]})]}),i.jsxs("div",{children:[i.jsx(me,{children:"Difficulty"}),i.jsxs(Xt,{value:r.difficulty,onValueChange:P=>s({...r,difficulty:P}),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"Easy",children:"Easy"}),i.jsx(Ie,{value:"Medium",children:"Medium"}),i.jsx(Ie,{value:"Hard",children:"Hard"})]})]})]})]})]})]}),i.jsx("div",{className:"space-y-6",children:u.map((P,A)=>i.jsxs(Me,{className:"relative overflow-hidden",children:[i.jsx("div",{className:"absolute top-0 left-0 w-1 h-full bg-indigo-500"}),i.jsxs(Fe,{className:"pt-6 space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-start",children:[i.jsxs("h3",{className:"font-bold text-slate-700",children:["Question ",A+1]}),u.length>1&&i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>
1024m(P.id),className:"text-red-500 hover:text-red-600",children:i.jsx(ci,{className:"w-4 h-4"})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("span",{className:"text-xs font-medium text-slate-500",children:"Question Text"}),i.jsxs(ue,{variant:"ghost",size:"sm",onClick:()=>j(P.id,P.question_text,P.correct_answer),disabled:a||!P.question_text,className:"h-auto p-0 px-2 text-slate-500 hover:text-slate-700",children:[i.jsx(iee,{className:"w-3 h-3 mr-1"}),"Check Clarity"]})]}),i.jsx(Ee,{value:P.question_text,onChange:F=>g(P.id,"question_text",F.target.value),placeholder:"Type your question here...",className:"font-medium text-lg"}),l[P.id]&&i.jsxs("div",{className:`text-xs mt-1 px-2 py-1 rounded ${l[P.id]==="Looks good!"?"bg-green-100 text-green-700":"bg-amber-100 text-amber-700"}`,children:["AI Feedback: ",l[P.id]]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(me,{className:"text-xs mb-1 block",children:"Type"}),i.jsxs(Xt,{value:P.question_type,onValueChange:F=>g(P.id,"question_type",F),children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"multiple_choice",children:"Multiple Choice"}),i.jsx(Ie,{value:"numerical",children:"Numerical Answer"})]})]})]}),P.question_type==="numerical"&&i.jsxs("div",{children:[i.jsx(me,{className:"text-xs mb-1 block text-green-700 font-bold",children:"Correct Answer"}),i.jsx(Ee,{value:P.correct_answer,onChange:F=>g(P.id,"correct_answer",F.target.value),placeholder:"e.g. 42",className:"border-green-200 bg-green-50 focus-visible:ring-green-500"})]})]}),P.question_type==="multiple_choice"&&i.jsxs("div",{className:"relative pt-6 bg-slate-50 p-3 rounded-lg mt-2",children:[i.jsxs("div",{className:"absolute -top-3 left-3 flex gap-2",children:[i.jsxs(ue,{variant:"secondary",size:"sm",onClick:()=>N(P.id,P.question_text,P.option_a||P.correct_answer),disabled:a||!P.question_text,className:"shadow-sm bg-indigo-100 hover:bg-indigo-200 text-indigo-700 h-7 text-xs",children:[i.jsx(fB,{className:"w-3 h-3 mr-1"}),"Auto-Generate Options"]}),i.jsxs("div",{className:"text-xs text-slate-500 flex items-center bg-white px-2 py-0.5 rounded-full border",children:[i.jsx(Cn,{className:"w-3 h-3 mr-1 text-green-600"}),"Select the correct answer"]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-2",children:["option_a","option_b","option_c","option_d"].map((F,I)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:()=>g(P.id,"correct_option_id",F),className:`w-6 h-6 rounded-full border-2 flex items-center justify-center flex-shrink-0 transition-colors ${P.correct_option_id===F?"border-green-500 bg-green-500 text-white":"border-slate-300 hover:border-slate-400"}`,children:P.correct_option_id===F&&i.jsx(Cn,{className:"w-4 h-4"})}),i.jsx(Ee,{value:P[F],onChange:R=>g(P.id,F,R.target.value),placeholder:`Option ${String.fromCharCode(65+I)}${I>1?" (Optional)":""}`,className:P.correct_option_id===F?"border-green-500 ring-1 ring-green-500":""})]},F))})]})]})]},P.id))}),i.jsxs(ue,{onClick:d,variant:"outline",className:"w-full py-8 border-dashed",children:[i.jsx(li,{className:"w-5 h-5 mr-2"})," Add Another Question"]})]})]})}function f3e(){const e=qi(),t=oo(),n=localStorage.getItem("admin_authenticated")==="true",s=new URLSearchParams(t.search).get("highlight"),{data:a}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{show_live_visitor_count:!1}}),{data:o=[]}=qe({queryKey:["newsletters"],queryFn:()=>ae.entities.Newsletter.list("-created_date",20)}),{data:l=[]}=qe({queryKey:["events"],queryFn:()=>ae.entities.Event.list("-created_date",50),refetchInterval:6e4}),{data:c=[]}=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list("-updated_date",1),staleTime:6e4}),{data:u=[]}=qe({queryKey:["visitLogs"],queryFn:()=>ae.entities.VisitLog.list("-timestamp",200),refetchInterval:6e4,enabled:(a==null?void 0:a.show_live_visitor_count)===!0}),h=se.useMemo(()=>{const N=new Date(Date.now()-3e5);return new Set(u.filter(j=>new Date(j.timestamp)>=N).map(j=>j.session_id)).size},[u]),d=se.useMemo(()=>{const N=new Date;return l.some(j=>{if(j.is_active===!1)return!1;const S=new Date(j.start_datetime),C=j.end_datetime?new Date(j.end_datetime):new Date(S.getTime()+7200*1e3),P=C.getTime()-S.getTime();if(j.repeat_type==="weekly"){const A={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(N.getDay()===A[j.repeat_day_of_week]){const F=new Date(N);F.setHours(S.getHours(),S.getMinutes(),0,0);const I=new Date(F.getTime()+P);return N>=F&&N<=I}return!1}return N>=S&&N<=C})},[l]),m=N=>{e(Ft(N))},g=()=>{const N=localStorage.getItem("newsletter_last_seen");return N?o.filter(j=>j.is_published&&new Date(j.created_date)>new Date(N)).length:o.filter(j=>j.is_published).length},w=()=>{const N=localStorage.getItem("events_last_seen");return N?l.filter(j=>j.is_active!==!1&&new Date(j.created_date)>new Date(N)).length:l.filter(j=>j.is_active!==!1).length},v=()=>{const N=localStorage.getItem("league_table_last_seen");return N?c.some(S=>new Date(S.updated_date)>new Date(N))?1:0:c.length>0?1:0},y=(()=>
1024{if(!(a!=null&&a.live_quiz_start_time)||!(a!=null&&a.live_quiz_end_time))return!1;const N=new Date,j=new Date(a.live_quiz_start_time),S=new Date(a.live_quiz_end_time);return N>=j&&N<=S})(),_=[...a!=null&&a.show_live_quiz_tile?[{title:"Live Quiz",subtitle:y?"Happening Now!":"Join the action",icon:lB,color:y?"from-red-500 to-red-600 animate-pulse shadow-[0_0_15px_rgba(220,38,38,0.7)]":"from-slate-600 to-slate-700",action:()=>e(Ft("CentralHub")+"?hub=live-quiz"),pulse:y}]:[],{title:"League Table",icon:Jt,color:"from-amber-500 to-amber-600",page:"Public",badge:v()},{title:"Team Stats",icon:pg,color:"from-indigo-500 to-indigo-600",page:"TeamsStats"},{title:"Team Profiles",icon:Jt,color:"from-purple-500 to-purple-600",page:"TeamProfiles"},{title:"Upload Photo",icon:Md,color:"from-purple-500 to-purple-600",page:"TeamPhoto"},{title:"Raffle Tickets",subtitle:"Win big! Buy tickets now",icon:Vr,color:"from-amber-500 to-orange-600",page:"RaffleTickets"},{title:"Quiz Games",subtitle:"Play instant quizzes for €1",icon:vs,color:"from-emerald-500 to-emerald-600",page:"QuizGames"},{title:"Community Challenges",subtitle:"Play user-created quizzes",icon:Sd,color:"from-orange-500 to-orange-600",page:"CommunityChallenges"},{title:"Community",subtitle:"Forum, Reviews & Leaderboard",icon:Dr,color:"from-pink-500 to-rose-600",page:"Community"},{title:"Upcoming Events",icon:Fn,color:"from-blue-500 to-blue-600",page:"UpcomingEvents",badge:w(),isLive:d},{title:"Newsletter",icon:Dd,color:"from-green-500 to-green-600",page:"Newsletter",badge:g()},{title:"Newsletter & Notifications",subtitle:"Get updates – or unsubscribe",icon:qT,color:"from-cyan-500 to-cyan-600",page:"NewsletterSubscription"},{title:"Book a Quizmaster",subtitle:"Private quizzes • Online or in-venue",icon:Bc,color:"from-orange-500 to-orange-600",page:"BookingPortal"},{title:"My Profile",subtitle:"Games, Tickets & Settings",icon:zo,color:"from-slate-500 to-slate-600",page:"UserProfile"},{title:"Create Advertisement",subtitle:"Promote your business here",icon:gg,color:"from-indigo-500 to-indigo-600",page:"AdManager"},...n?[{title:"Admin Dashboard",icon:no,color:"from-slate-600 to-slate-700",page:"Admin"},{title:"Team Issues",icon:Sn,color:"from-red-500 to-red-600",page:"Admin",action:()=>{e(Ft("Admin")),setTimeout(()=>{const N=document.querySelector('[value="issues"]');N&&N.click()},100)}},{title:"Ad Manager",subtitle:"Manage Ads",icon:gg,color:"from-indigo-600 to-indigo-700",page:"AdManager"}]:[]];return i.jsxs(i.Fragment,{children:[i.jsx(ao,{pageName:"Home"}),i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-indigo-900 to-slate-900 overflow-auto",children:i.jsx("div",{className:"min-h-screen flex items-center justify-center p-4 sm:p-6 py-16 sm:py-20",children:i.jsxs("div",{className:"max-w-6xl w-full",children:[i.jsxs("div",{className:"text-center mb-8 sm:mb-12",children:[i.jsxs("div",{className:"flex items-center justify-center gap-3 sm:gap-4 mb-4 sm:mb-6",children:[i.jsx("img",{src:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/69159eb1f2b08a81df520821/e08a7a193_LiveQuizzing.png",alt:"Live Quizzing",className:"h-12 sm:h-20 md:h-24 w-auto bg-white rounded-xl p-1.5 sm:p-2 shadow-lg"}),i.jsx("h1",{className:"text-3xl sm:text-5xl md:text-6xl font-black text-white",children:"Hub"})]}),i.jsx("p",{className:"text-base sm:text-xl text-slate-300",children:"Navigate to any section of the app"}),(a==null?void 0:a.show_live_visitor_count)&&h>0&&i.jsxs("div",{className:"mt-4 inline-flex items-center gap-2 bg-white/10 backdrop-blur-sm px-4 py-2 rounded-full border border-white/20",children:[i.jsx(du,{className:"w-4 h-4 text-green-400"}),i.jsxs("span",{className:"text-white text-sm font-semibold",children:["👀 ",h," ",h===1?"person":"people"," viewing right now"]})]})]}),i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3 sm:gap-6",children:_.map((N,j)=>{const S=N.icon,C=N.title.toLowerCase().replace(/\s+/g,"-"),P=s===C;return i.jsxs("button",{onClick:()=>N.action?N.action():m(N.page),onContextMenu:A=>{A.preventDefault();const F=N.page?`${window.location.origin}${Ft(N.page)}`:`${window.location.origin}/?hub=${C}`;navigator.clipboard.writeText(F),tt.success(`Link copied! Share this ${N.title} directly.`)},className:`group relative bg-white/10 backdrop-blur-sm rounded-2xl p-4 sm:p-8 border-2 transition-all duration-300 hover:scale-105 hover:shadow-2xl ${P?"border-yellow-400 ring-4 ring-yellow-400/50 animate-pulse":"border-white/20 hover:border-white/40"}`,children:[i.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${N.color} opacity-0 group-hover:opacity-20 rounded-2xl transition-opacity duration-300`}),N.badge>0&&i.jsx("div",{className:"absolute -top-2 -right-2 bg-red-500 text-white text-xs rounded-full w-7 h-7 flex items-center justify-center font-bold shadow-lg z-10 border-2 border-white",children:N.badge>9?"9+":N.badge}),N.isLive&&i.jsxs("div",{className:"absolute -top-2 -left-2 bg-red-600 text-white text-xs font-bold px-2 py-1 rounded-md animate-pulse shadow-lg z-20 flex items-center gap-1 border-2 border-white",children:[i.jsxs("span",{className:"relative flex h-2 w-2",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-white opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-white"})]}),"LIVE"]}),i.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:i.jsx(Ho,{className:"w-4 h-4 text-white/70"})}),i.jsxs("div",{className:"relative flex flex-col items-center gap-3 sm:gap-4",children:[i.jsx("div",{className:`w-14 h-14 sm:w-20 sm:h-20 rounded-xl bg-gradient-to-br ${N.color} flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform duration-300`,children:i.jsx(S,{className:"w-7 h-7 sm:w-10 sm:h-10 text-white"})}),i.jsxs("div",{className:"text-center",children:[i.jsx("span",{className:"text-white font-bold text-sm sm:text-lg block leading-tight",children:N.title}),N.subtitle&&i.jsx("span",{className:"text-slate-300 text-[11px] sm:text-sm block mt-1 leading-tight",children:N.subtitle})]})]})]},j)})}),!n&&i.jsx("div",{className:"mt-12 flex justify-center",children:i.jsxs("button",{onClick:()=>m("Admin"),className:"text-slate-500 hover:text-slate-300 text-sm flex items-center gap-2 px-4 py-2 rounded-full hover:bg-white/5 transition-colors",children:[i.jsx(no,{className:"w-4 h-4"}),i.jsx("span",{children:"Admin Login"})]})})]})})})]})}function h3e(){const{data:e=[],isLoading:t}=qe({queryKey:["newsletters"],queryFn:async()=>(await ae.entities.Newsletter.list()).filter(r=>r.is_published).sort((r,s)=>new Date(s.publish_date)-new Date(r.publish_date))});return se.useEffect(()=>{localStorage.setItem("newsletter_last_seen",new Date().toISOString())},[]),t?i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 p-6 flex items-center justify-center",children:i.jsx("p",{className:"text-slate-600",children:"Loading newsletters..."})}):i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 p-6",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"mb-8 text-center",children:[i.jsxs("div",{className:"flex items-center justify-center gap-3 mb-3",children:[i.jsx(Dd,{className:"w-10 h-10 text-indigo-600"}),i.jsx("h1",{className:"text-4xl md:text-5xl font-black text-slate-900",children:"Weekly Newsletter"})]}),i.jsx("p",{className:"text-lg text-slate-600",children:"Stay updated with the latest quiz league news"})]}),e.length===0?i.jsx(Me,{children:i.jsxs(Fe,{className:"p-12 text-center",children:[i.jsx(Dd,{className:"w-16 h-16 text-slate-300 mx-auto mb-4"}),i.jsx("p",{className:"text-slate-600",children:"No newsletters published yet."})]})}):i.jsx("div",{className:"space-y-6",children:e.map(n=>i.jsxs(Me,{className:"overflow-hidden",children:[n.image_url&&i.jsx("img",{src:n.image_url,alt:n.title,className:"w-full h-48 sm:h-64 object-cover"}),i.jsxs(st,{children:[i.jsx(at,{className:"text-2xl sm:text-3xl",children:n.title}),i.jsxs("div",{className:"flex items-center gap-2 text-slate-600 text-sm",children:[i.jsx(Fn,{className:"w-4 h-4"}),i.jsx("span",{children:Ut(new Date(n.publish_date),"MMMM d, yyyy")})]})]}),i.jsx(Fe,{children:i.jsx("div",{className:"prose prose-slate max-w-none",dangerouslySetInnerHTML:{__html:n.content}})})]},n.id))})]})})}function m3e(){const[e,t]=O.useState(""),[n,r]=O.useState(""),[s,a]=O.useState(!1),[o,l]=O.useState(null),[c,u]=O.useState(!1),[h,d]=O.useState(""),[m,g]=O.useState(null),[w,v]=O.useState(!1),{data:b=[]}=qe({queryKey:["contacts"],queryFn:()=>ae.entities.Contact.list()}),y=async N=>{if(N.preventDefault(),!n||!s){alert("Please provide your email and consent to receive updates.");return}u(!0),l(null);try{const j=new Date().toISOString(),S=n.toLowerCase().trim(),C=b.find(P=>P.email===S);C?await ae.entities.Contact.update(C.id,{name:e||C.name,status:"subscribed",last_seen_at:j,last_consent_source:"App Form",last_consent_value:"yes",last_consent_at:j}):await ae.entities.Contact.create({email:S,name:e,status:"subscribed",invali
1024d:!1,first_seen_at:j,last_seen_at:j,last_consent_source:"App Form",last_consent_value:"yes",last_consent_at:j}),l("success"),t(""),r(""),a(!1)}catch(j){console.error("Failed to subscribe:",j),l("error")}u(!1)},_=async N=>{if(N.preventDefault(),!h){alert("Please provide your email address.");return}v(!0),g(null);try{const j=new Date().toISOString(),S=h.toLowerCase().trim(),C=b.find(P=>P.email===S);C&&await ae.entities.Contact.update(C.id,{status:"unsubscribed",last_seen_at:j,last_consent_source:"App Form",last_consent_value:"no",last_consent_at:j}),g("success"),d("")}catch(j){console.error("Failed to unsubscribe:",j),g("error")}v(!1)};return i.jsxs(i.Fragment,{children:[i.jsx(ao,{pageName:"NewsletterSubscription"}),i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 p-6",children:i.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-cyan-100 mb-4",children:i.jsx(qT,{className:"w-8 h-8 text-cyan-600"})}),i.jsx("h1",{className:"text-4xl font-bold text-slate-900 mb-2",children:"Newsletter & Notifications"}),i.jsx("p",{className:"text-slate-600",children:"Stay updated with quiz results, events, and league news"})]}),i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(Vo,{className:"w-5 h-5"}),"Subscribe to Updates"]})}),i.jsx(Fe,{children:i.jsxs("form",{onSubmit:y,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"subscribe-name",children:"Name (optional)"}),i.jsx(Ee,{id:"subscribe-name",type:"text",value:e,onChange:N=>t(N.target.value),placeholder:"Your name"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"subscribe-email",children:"Email *"}),i.jsx(Ee,{id:"subscribe-email",type:"email",value:n,onChange:N=>r(N.target.value),placeholder:"[email protected]",required:!0})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(qh,{id:"consent",checked:s,onCheckedChange:a}),i.jsx("label",{htmlFor:"consent",className:"text-sm text-slate-700 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"I'd like to receive email updates about quizzes, results and events."})]}),i.jsx(ue,{type:"submit",className:"w-full",disabled:c||!n||!s,children:c?"Subscribing...":"Subscribe"}),o==="success"&&i.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4 flex items-start gap-3",children:[i.jsx(Ch,{className:"w-5 h-5 text-green-600 mt-0.5 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold text-green-900",children:"You're subscribed!"}),i.jsx("p",{className:"text-sm text-green-800",children:"We'll email you about future quizzes, results and events."})]})]}),o==="error"&&i.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:i.jsx("p",{className:"text-red-900",children:"Failed to subscribe. Please try again."})})]})})]}),i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(Vo,{className:"w-5 h-5"}),"Unsubscribe"]})}),i.jsx(Fe,{children:i.jsxs("form",{onSubmit:_,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"unsubscribe-email",children:"Email *"}),i.jsx(Ee,{id:"unsubscribe-email",type:"email",value:h,onChange:N=>d(N.target.value),placeholder:"[email protected]",required:!0})]}),i.jsx(ue,{type:"submit",variant:"outline",className:"w-full",disabled:w||!h,children:w?"Unsubscribing...":"Unsubscribe"}),m==="success"&&i.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4 flex items-start gap-3",children:[i.jsx(Ch,{className:"w-5 h-5 text-green-600 mt-0.5 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold text-green-900",children:"You've been unsubscribed."}),i.jsx("p",{className:"text-sm text-green-800",children:"You won't receive any more quiz updates by email."})]})]}),m==="error"&&i.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:i.jsx("p",{className:"text-red-900",children:"Failed to unsubscribe. Please try again."})})]})})]}),i.jsx("div",{className:"bg-slate-100 rounded-lg p-4 text-center text-sm text-slate-600",children:i.jsx("p",{children:"Questions? Contact us at your quiz league organizer's email."})})]})})]})}function p3e(){return i.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center p-4",children:i.jsxs(Me,{className:"max-w-md w-full bg-white p-8 text-center shadow-xl rounded-2xl border-slate-200",children:[i.jsx("div",{className:"w-20 h-20 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-6",children:i.jsx(ya,{className:"w-10 h-10 text-red-600"})}),i.jsx("h1",{className:"text-3xl font-black text-slate-900 mb-2",children:"Payment Cancelled"}),i.jsx("p",{className:"text-slate-600 mb-8",children:"Your payment was cancelled and you haven't been charged."}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(lr,{to:"/shop",children:i.jsx(ue,{className:"w-full bg-slate-900 hover:bg-slate-800",children:"Return to Shop"})}),i.jsx(lr,{to:"/",children:i.jsx(ue,{variant:"outline",className:"w-full",children:"Back to Home"})})]})]})})}function g3e(){const[e]=e9();return e.get("session_id"),i.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center p-4",children:i.jsx(rt.div,{initial:{scale:.8,opacity:0}
1024,animate:{scale:1,opacity:1},transition:{duration:.5,type:"spring"},className:"w-full max-w-md",children:i.jsxs(Me,{className:"w-full bg-white p-8 text-center shadow-xl rounded-2xl border-slate-200",children:[i.jsx("div",{className:"w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6",children:i.jsx(Cn,{className:"w-10 h-10 text-green-600"})}),i.jsx("h1",{className:"text-3xl font-black text-slate-900 mb-2",children:"Payment Successful!"}),i.jsx("p",{className:"text-slate-600 mb-8",children:"Thank you for your purchase. Your order has been processed successfully."}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(lr,{to:"/shop",children:i.jsx(ue,{className:"w-full bg-slate-900 hover:bg-slate-800",children:"Continue Shopping"})}),i.jsx(lr,{to:"/",children:i.jsx(ue,{variant:"outline",className:"w-full",children:"Back to Home"})})]})]})})})}var xb={};(function e(t,n,r,s){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=(function(){if(!t.OffscreenCanvas)return!1;try{var z=new OffscreenCanvas(1,1),L=z.getContext("2d");L.fillRect(0,0,1,1);var W=z.transferToImageBitmap();L.createPattern(W,"no-repeat")}catch{return!1}return!0})();function c(){}function u(z){var L=n.exports.Promise,W=L!==void 0?L:t.Promise;return typeof W=="function"?new W(z):(z(c,c),null)}var h=(function(z,L){return{transform:function(W){if(z)return W;if(L.has(W))return L.get(W);var Q=new OffscreenCanvas(W.width,W.height),J=Q.getContext("2d");return J.drawImage(W,0,0),L.set(W,Q),Q},clear:function(){L.clear()}}})(l,new Map),d=(function(){var z=Math.floor(16.666666666666668),L,W,Q={},J=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(L=function(ne){var Y=Math.random();return Q[Y]=requestAnimationFrame(function ee(le){J===le||J+z-1<le?(J=le,delete Q[Y],ne()):Q[Y]=requestAnimationFrame(ee)}),Y}
vendor: 6,944 bytes, lines 1024-1025
1024,W=function(ne){Q[ne]&&cancelAnimationFrame(Q[ne])}):(L=function(ne){return setTimeout(ne,z)},W=function(ne){return clearTimeout(ne)}),{frame:L,cancel:W}})(),m=(function(){var z,L,W={};function Q(J){function ne(Y,ee){J.postMessage({options:Y||{},callback:ee})}J.init=function(ee){var le=ee.transferControlToOffscreen();J.postMessage({canvas:le},[le])},J.fire=function(ee,le,re){if(L)return ne(ee,null),L;var fe=Math.random().toString(36).slice(2);return L=u(function(ge){function he(De){De.data.callback===fe&&(delete W[fe],J.removeEventListener("message",he),L=null,h.clear(),re(),ge())}J.addEventListener("message",he),ne(ee,fe),W[fe]=he.bind(null,{data:{callback:fe}})}),L},J.reset=function(){J.postMessage({reset:!0});for(var ee in W)W[ee](),delete W[ee]}}return function(){if(z)return z;if(!r&&a){var J=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {","  if (msg.data.options) {","    CONFETTI(msg.data.options).then(function () {","      if (msg.data.callback) {","        postMessage({ callback: msg.data.callback });","      }","    });","  } else if (msg.data.reset) {","    CONFETTI && CONFETTI.reset();","  } else if (msg.data.resize) {","    SIZE.width = msg.data.resize.width;","    SIZE.height = msg.data.resize.height;","  } else if (msg.data.canvas) {","    SIZE.width = msg.data.canvas.width;","    SIZE.height = msg.data.canvas.height;","    CONFETTI = module.exports.create(msg.data.canvas);","  }","}"].join(`
1025`);try{z=new Worker(URL.createObjectURL(new Blob([J])))}catch(ne){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",ne),null}Q(z)}return z}})(),g={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function w(z,L){return L?L(z):z}function v(z){return z!=null}function b(z,L,W){return w(z&&v(z[L])?z[L]:g[L],W)}function y(z){return z<0?0:Math.floor(z)}function _(z,L){return Math.floor(Math.random()*(L-z))+z}function N(z){return parseInt(z,16)}function j(z){return z.map(S)}function S(z){var L=String(z).replace(/[^0-9a-f]/gi,"");return L.length<6&&(L=L[0]+L[0]+L[1]+L[1]+L[2]+L[2]),{r:N(L.substring(0,2)),g:N(L.substring(2,4)),b:N(L.substring(4,6))}}function C(z){var L=b(z,"origin",Object);return L.x=b(L,"x",Number),L.y=b(L,"y",Number),L}function P(z){z.width=document.documentElement.clientWidth,z.height=document.documentElement.clientHeight}function A(z){var L=z.getBoundingClientRect();z.width=L.width,z.height=L.height}function F(z){var L=document.createElement("canvas");return L.style.position="fixed",L.style.top="0px",L.style.left="0px",L.style.pointerEvents="none",L.style.zIndex=z,L}function I(z,L,W,Q,J,ne,Y,ee,le){z.save(),z.translate(L,W),z.rotate(ne),z.scale(Q,J),z.arc(0,0,1,Y,ee,le),z.restore()}function R(z){var L=z.angle*(Math.PI/180),W=z.spread*(Math.PI/180);return{x:z.x,y:z.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:z.startVelocity*.5+Math.random()*z.startVelocity,angle2D:-L+(.5*W-Math.random()*W),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:z.color,shape:z.shape,tick:0,totalTicks:z.ticks,decay:z.decay,drift:z.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:z.gravity*3,ovalScalar:.6,scalar:z.scalar,flat:z.flat}}function M(z,L){L.x+=Math.cos(L.angle2D)*L.velocity+L.drift,L.y+=Math.sin(L.angle2D)*L.velocity+L.gravity,L.velocity*=L.decay,L.flat?(L.wobble=0,L.wobbleX=L.x+10*L.scalar,L.wobbleY=L.y+10*L.scalar,L.tiltSin=0,L.tiltCos=0,L.random=1):(L.wobble+=L.wobbleSpeed,L.wobbleX=L.x+10*L.scalar*Math.cos(L.wobble),L.wobbleY=L.y+10*L.scalar*Math.sin(L.wobble),L.tiltAngle+=.1,L.tiltSin=Math.sin(L.tiltAngle),L.tiltCos=Math.cos(L.tiltAngle),L.random=Math.random()+2);var W=L.tick++/L.totalTicks,Q=L.x+L.random*L.tiltCos,J=L.y+L.random*L.tiltSin,ne=L.wobbleX+L.random*L.tiltCos,Y=L.wobbleY+L.random*L.tiltSin;if(z.fillStyle="rgba("+L.color.r+", "+L.color.g+", "+L.color.b+", "+(1-W)+")",z.beginPath(),o&&L.shape.type==="path"&&typeof L.shape.path=="string"&&Array.isArray(L.shape.matrix))z.fill(Z(L.shape.path,L.shape.matrix,L.x,L.y,Math.abs(ne-Q)*.1,Math.abs(Y-J)*.1,Math.PI/10*L.wobble));else if(L.shape.type==="bitmap"){var ee=Math.PI/10*L.wobble,le=Math.abs(ne-Q)*.1,re=Math.abs(Y-J)*.1,fe=L.shape.bitmap.width*L.scalar,ge=L.shape.bitmap.height*L.scalar,he=new DOMMatrix([Math.cos(ee)*le,Math.sin(ee)*le,-Math.sin(ee)*re,Math.cos(ee)*re,L.x,L.y]);he.multiplySelf(new DOMMatrix(L.shape.matrix));var De=z.createPattern(h.transform(L.shape.bitmap),"no-repeat");De.setTransform(he),z.globalAlpha=1-W,z.fillStyle=De,z.fillRect(L.x-fe/2,L.y-ge/2,fe,ge),z.globalAlpha=1}else if(L.shape==="circle")z.ellipse?z.ellipse(L.x,L.y,Math.abs(ne-Q)*L.ovalScalar,Math.abs(Y-J)*L.ovalScalar,Math.PI/10*L.wobble,0,2*Math.PI):I(z,L.x,L.y,Math.abs(ne-Q)*L.ovalScalar,Math.abs(Y-J)*L.ovalScalar,Math.PI/10*L.wobble,0,2*Math.PI);else if(L.shape==="star")for(var _e=Math.PI/2*3,We=4*L.scalar,ze=8*L.scalar,Xe=L.x,ke=L.y,Ae=5,Be=Math.PI/Ae;Ae--;)Xe=L.x+Math.cos(_e)*ze,ke=L.y+Math.sin(_e)*ze,z.lineTo(Xe,ke),_e+=Be,Xe=L.x+Math.cos(_e)*We,ke=L.y+Math.sin(_e)*We,z.lineTo(Xe,ke),_e+=Be;else z.moveTo(Math.floor(L.x),Math.floor(L.y)),z.lineTo(Math.floor(L.wobbleX),Math.floor(J)),z.lineTo(Math.floor(ne),Math.floor(Y)),z.lineTo(Math.floor(Q),Math.floor(L.wobbleY));return z.closePath(),z.fill(),L.tick<L.totalTicks}function $(z,L,W,Q,J){var ne=L.slice(),Y=z.getContext("2d"),ee,le,re=u(function(fe){function ge(){ee=le=null,Y.clearRect(0,0,Q.width,Q.height),h.clear(),J(),fe()}function he(){r&&!(Q.width===s.width&&Q.height===s.height)&&(Q.width=z.width=s.width,Q.height=z.height=s.height),!Q.width&&!Q.height&&(W(z),Q.width=z.width,Q.height=z.height),Y.clearRect(0,0,Q.width,Q.height),ne=ne.filter(function(De){return M(Y,De)}),ne.length?ee=d.frame(he):ge()}ee=d.frame(he),le=ge});return{addFettis:function(fe){return ne=ne.concat(fe),re},canvas:z,promise:re,reset:function(){ee&&d.cancel(ee),le&&le()}}}function B(z,L){var W=!z,Q=!!b(L||{},"resize"),J=!1,ne=b(L,"disableForReducedMotion",Boolean),Y=a&&!!b(L||{},"useWorker"),ee=Y?m():null,le=W?P:A,re=z&&ee?!!z.__confetti_initialized:!1,fe=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,ge;function he(_e,We,ze){for(var Xe=b(_e,"particleCount",y),ke=b(_e,"angle",Number),Ae=b(_e,"spread",Number),Be=b(_e,"startVelocity",Number),de=b(_e,"decay",Number),Pe=b(_e,"gravity",Number),Ze=b(_e,"drift",Number),ct=b(_e,"colors",j),pt=b(_e,"ticks",Number),$t=b(_e,"shapes"),wn=b(_e,"scalar"),an=!!b(_e,"flat"),is=C(_e),on=Xe,ir=[],Ns=z.width*is.x,el=z.height*is.y;on--;)ir.push(R({x:Ns,y:el,angle:ke,spread:Ae,startVelocity:Be,color:ct[on%ct.length],shape:$t[_(0,$t.length)],ticks:pt,decay:de,gravity:Pe,drift:Ze,scalar:wn,flat:an}));
1025return ge?ge.addFettis(ir):(ge=$(z,ir,le,We,ze),ge.promise)}function De(_e){var We=ne||b(_e,"disableForReducedMotion",Boolean),ze=b(_e,"zIndex",Number);if(We&&fe)return u(function(Be){Be()});W&&ge?z=ge.canvas:W&&!z&&(z=F(ze),document.body.appendChild(z)),Q&&!re&&le(z);var Xe={width:z.width,height:z.height};ee&&!re&&ee.init(z),re=!0,ee&&(z.__confetti_initialized=!0);function ke(){if(ee){var Be={getBoundingClientRect:function(){if(!W)return z.getBoundingClientRect()}};le(Be),ee.postMessage({resize:{width:Be.width,height:Be.height}});return}Xe.width=Xe.height=null}function Ae(){ge=null,Q&&(J=!1,t.removeEventListener("resize",ke)),W&&z&&(document.body.contains(z)&&document.body.removeChild(z),z=null,re=!1)}return Q&&!J&&(J=!0,t.addEventListener("resize",ke,!1)),ee?ee.fire(_e,Xe,Ae):he(_e,Xe,Ae)}return De.reset=function(){ee&&ee.reset(),ge&&ge.reset()},De}var U;function G(){return U||(U=B(null,{useWorker:!0,resize:!0})),U}function Z(z,L,W,Q,J,ne,Y){var ee=new Path2D(z),le=new Path2D;le.addPath(ee,new DOMMatrix(L));var re=new Path2D;return re.addPath(le,new DOMMatrix([Math.cos(Y)*J,Math.sin(Y)*J,-Math.sin(Y)*ne,Math.cos(Y)*ne,W,Q])),re}function X(z){if(!o)throw new Error("path confetti are not supported in this browser");var L,W;typeof z=="string"?L=z:(L=z.path,W=z.matrix);var Q=new Path2D(L),J=document.createElement("canvas"),ne=J.getContext("2d");if(!W){for(var Y=1e3,ee=Y,le=Y,re=0,fe=0,ge,he,De=0;De<Y;De+=2)for(var _e=0;_e<Y;_e+=2)ne.isPointInPath(Q,De,_e,"nonzero")&&(ee=Math.min(ee,De),le=Math.min(le,_e),re=Math.max(re,De),fe=Math.max(fe,_e));ge=re-ee,he=fe-le;var We=10,ze=Math.min(We/ge,We/he);W=[ze,0,0,ze,-Math.round(ge/2+ee)*ze,-Math.round(he/2+le)*ze]}return{type:"path",path:L,matrix:W}}function V(z){var L,W=1,Q="#000000",J='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof z=="string"?L=z:(L=z.text,W="scalar"in z?z.scalar:W,J="fontFamily"in z?z.fontFamily:J,Q="color"in z?z.color:Q);var ne=10*W,Y=""+ne+"px "+J,ee=new OffscreenCanvas(ne,ne),le=ee.getContext("2d");le.font=Y;var re=le.measureText(L),fe=Math.ceil(re.actualBoundingBoxRight+re.actualBoundingBoxLeft),ge=Math.ceil(re.actualBoundingBoxAscent+re.actualBoundingBoxDescent),he=2,De=re.actualBoundingBoxLeft+he,_e=re.actualBoundingBoxAscent+he;fe+=he+he,ge+=he+he,ee=new OffscreenCanvas(fe,ge),le=ee.getContext("2d"),le.font=Y,le.fillStyle=Q,le.fillText(L,De,_e);var We=1/W;return{type:"bitmap",bitmap:ee.transferToImageBitmap(),matrix:[We,0,0,We,-fe*We/2,-ge*We/2]}}n.exports=function(){return G().apply(this,arguments)},n.exports.reset=function(){G().reset()},n.exports.create=B,n.exports.shapeFromPath=X,n.exports.shapeFromText=V})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),xb,!1);const P_=xb.exports;xb.exports.create;function v3e({quiz:e,score:t,correctAnswers:n,totalQuestions:r,timeTaken:s}){const[a,o]=O.useState(!1),l=`🎯 I just scored ${Math.round(t)}% on "${e.title}"!
1026
1027✅ ${n}/${r} correct in ${s}s
1028
1029Think you can beat my score? Try it now!`,c=`${window.location.origin}${window.location.pathname}?id=${e.id}`,u=async()=>{if(navigator.share)try{await navigator.share({title:`My Quiz Results - ${e.title}`,text:l,url:c}),P_({particleCount:50,spread:60,origin:{y:.6}})}catch(m){m.name!=="AbortError"&&console.error("Share failed:",m)}else h()},h=async()=>{try{await navigator.clipboard.writeText(`${l}
1030
1031${c}`),o(!0),tt.success("Results copied to clipboard!"),setTimeout(()=>o(!1),2e3)}catch{tt.error("Failed to copy")}},d=m=>{const g=encodeURIComponent(l),w=encodeURIComponent(c),v={twitter:`https://twitter.com/intent/tweet?text=${g}&url=${w}`,facebook:`https://www.facebook.com/sharer/sharer.php?u=${w}&quote=${g}`,whatsapp:`https://wa.me/?text=${g}%20${w}`,linkedin:`https://www.linkedin.com/sharing/share-offsite/?url=${w}`};v[m]&&(window.open(v[m],"_blank","width=600,height=400"),P_({particleCount:50,spread:60,origin:{y:.6}}))};return i.jsxs("div",{className:"max-w-md mx-auto bg-slate-900/50 rounded-xl p-6 border border-slate-800",children:[i.jsxs("h3",{className:"text-lg font-bold text-white mb-4 text-center flex items-center justify-center gap-2",children:[i.jsx(Ho,{className:"w-5 h-5 text-indigo-400"}),"Share Your Results"]}),i.jsx("div",{className:"bg-slate-800/50 rounded-lg p-4 mb-4 border border-slate-700",children:i.jsx("p",{className:"text-sm text-slate-300 leading-relaxed whitespace-pre-line",children:l})}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(ue,{onClick:u,className:"w-full bg-indigo-600 hover:bg-indigo-700 font-semibold",children:[i.jsx(Ho,{className:"w-4 h-4 mr-2"}),"Share Results"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs(ue,{variant:"outline",onClick:()=>d("twitter"),className:"border-slate-600 text-slate-300 hover:bg-slate-800 hover:text-white",children:[i.jsx("svg",{className:"w-4 h-4 mr-2",fill:"
1031currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"Twitter"]}),i.jsxs(ue,{variant:"outline",onClick:()=>d("whatsapp"),className:"border-slate-600 text-slate-300 hover:bg-slate-800 hover:text-white",children:[i.jsx("svg",{className:"w-4 h-4 mr-2",fill:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"})}),"WhatsApp"]}),i.jsxs(ue,{variant:"outline",onClick:()=>d("facebook"),className:"border-slate-600 text-slate-300 hover:bg-slate-800 hover:text-white",children:[i.jsx("svg",{className:"w-4 h-4 mr-2",fill:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),"Facebook"]}),i.jsx(ue,{variant:"outline",onClick:h,className:"border-slate-600 text-slate-300 hover:bg-slate-800 hover:text-white",children:a?i.jsxs(i.Fragment,{children:[i.jsx(Id,{className:"w-4 h-4 mr-2 text-green-500"}),"Copied!"]}):i.jsxs(i.Fragment,{children:[i.jsx($0,{className:"w-4 h-4 mr-2"}),"Copy"]})})]})]})]})}function x3e(){const e=qi(),t=mn(),[n,r]=O.useState(null),[s,a]=O.useState("intro"),[o,l]=O.useState(0),[c,u]=O.useState({}),[h,d]=O.useState(0),[m,g]=O.useState(null),[w,v]=O.useState(null),[b,y]=O.useState(null),[_,N]=O.useState(""),[j,S]=O.useState(!1),[C,P]=O.useState(0),[A,F]=O.useState(0),[I,R]=O.useState(""),[M,$]=O.useState(!1),B=O.useRef(null);O.useEffect(()=>{const re=new URLSearchParams(window.location.search);r(re.get("id"))},[]);const{data:U}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me().catch(()=>null)}),{data:G,isLoading:Z}=qe({queryKey:["communityQuiz",n],queryFn:async()=>n?(await ae.entities.CommunityQuiz.filter({id:n}))[0]:null,enabled:!!n}),{data:X=[],isLoading:V}=qe({queryKey:["communityQuizQuestions",n],queryFn:async()=>n?(await ae.entities.CommunityQuizQuestion.filter({quiz_id:n})).sort((fe,ge)=>fe.order_index-ge.order_index):[],enabled:!!n}),{data:z=[]}=qe({queryKey:["quizLeaderboard",n],queryFn:async()=>n?(await ae.entities.CommunityQuizAttempt.filter({quiz_id:n,is_official_entry:!0},"-score_percent",50)).sort((fe,ge)=>ge.score_percent!==fe.score_percent?ge.score_percent-fe.score_percent:fe.time_taken_seconds-ge.time_taken_seconds).slice(0,10):[],enabled:!!n&&s==="finished"}),{data:L=[],refetch:W}=qe({queryKey:["quizReviews",n],queryFn:async()=>{var fe;return n?((fe=(await ae.functions.invoke("communityQuiz",{action:"getReviews",quizId:n})).data)==null?void 0:fe.reviews)||[]:[]},enabled:!!n&&s==="finished"});O.useEffect(()=>(s==="playing"?B.current=setInterval(()=>{P(re=>re+1)},1e3):clearInterval(B.current),()=>clearInterval(B.current)),[s]);const Q=()=>{a("playing"),g(Date.now()),P(0)},J=re=>{if(j)return;const fe=re?re.toString():"";y(fe),S(!0),N("");const ge=X[o],he=ge.correct_answer?ge.correct_answer.toString():"",De=fe.toLowerCase().trim()===he.toLowerCase().trim();De&&P_({particleCount:100,spread:70,origin:{y:.6},colors:["#22c55e","#ffffff","#f59e0b"]}),u(_e=>({..._e,[ge.id]:De})),setTimeout(()=>{S(!1),y(null),o<X.length-1?l(_e=>_e+1):ne()},2e3)},ne=async()=>{v(Date.now()),a("finished")};O.useEffect(()=>
1031{if(s==="finished"&&w&&U){const re=Object.values(c).filter(Boolean).length,fe=X.length,ge=fe>0?re/fe*100:0,he=Math.floor((w-m)/1e3);ae.functions.invoke("communityQuiz",{action:"submitAttempt",quizId:n,score:ge,timeTaken:he,correctCount:re,totalQuestions:fe}).then(()=>{t.invalidateQueries({queryKey:["quizRecommendations"]}),t.invalidateQueries({queryKey:["communityQuizzes"]}),t.invalidateQueries({queryKey:["userAttempts"]}),t.invalidateQueries({queryKey:["myAttempts"]})}),d(ge)}},[s,w,U,X.length,c,n,m,t]);const Y=async()=>{confirm("Report this quiz for inappropriate content?")&&(await ae.functions.invoke("communityQuiz",{action:"report",targetId:n,targetType:"quiz",reason:"User reported via play screen"}),tt.success("Report submitted."))};if(Z||V)return i.jsx("div",{className:"flex items-center justify-center min-h-screen",children:i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600"})});if(!G||X.length===0)return i.jsx("div",{className:"p-8 text-center",children:"Quiz not found or empty."});const ee=X[o],le=o/X.length*100;return i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-indigo-950 to-slate-950 text-white flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-3 bg-slate-950 border-b border-slate-800 gap-2",children:[i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>e(Ft("CommunityChallenges")),className:"text-slate-400 hover:text-white shrink-0 px-2",children:"Close"}),i.jsxs("div",{className:"flex-1 min-w-0 text-center",children:[i.jsx("h1",{className:"text-base md:text-lg font-bold text-white truncate px-2",children:G.title}),s==="playing"&&i.jsxs("div",{className:"font-mono text-xs md:text-sm text-indigo-400 flex items-center justify-center gap-1 mt-1",children:[i.jsx(Qte,{className:"w-3 h-3 md:w-4 md:h-4"}),Math.floor(C/60),":",(C%60).toString().padStart(2,"0")]})]}),i.jsx(ue,{variant:"ghost",size:"icon",onClick:Y,className:"text-slate-600 hover:text-red-500 shrink-0 w-8 h-8 md:w-10 md:h-10",children:i.jsx(nA,{className:"w-3 h-3 md:w-4 md:h-4"})})]}),i.jsxs("div",{className:"flex-1 container max-w-2xl mx-auto p-6 my-4 flex flex-col justify-center bg-slate-950/40 rounded-3xl border border-white/10 shadow-2xl backdrop-blur-xl",children:[s==="intro"&&i.jsxs("div",{className:"text-center space-y-8",children:[i.jsx("div",{className:"w-24 h-24 bg-indigo-600 rounded-full flex items-center justify-center mx-auto shadow-2xl shadow-indigo-500/30",children:i.jsx(Jt,{className:"w-10 h-10 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-3xl font-bold mb-2",children:G.title}),i.jsx("p",{className:"text-slate-400 max-w-md mx-auto",children:G.description})]}),i.jsxs("div",{className:"flex justify-center gap-8 text-sm text-slate-400",children:[i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-white font-bold text-lg",children:X.length}),i.jsx("span",{children:"Questions"})]}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-white font-bold text-lg",children:G.total_plays}),i.jsx("span",{children:"Plays"})]})]}),i.jsxs(ue,{onClick:Q,size:"lg",className:"w-full md:w-auto min-w-[200px] bg-indigo-600 hover:bg-indigo-500 text-lg h-14",children:["Start Challenge ",i.jsx(_s,{className:"w-5 h-5 ml-2"})]})]}),s==="playing"&&i.jsxs("div",{className:"space-y-8",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm text-slate-400",children:[i.jsxs("span",{children:["Question ",o+1," of ",X.length]}),i.jsxs("span",{children:[Math.round(le),"%"]})]}),i.jsx(w5,{value:le,className:"h-2 bg-slate-800",indicatorClassName:"bg-indigo-500"})]}),i.jsx(Me,{className:"bg-white/5 border-white/10 overflow-hidden",children:i.jsxs(Fe,{className:"p-8 text-center relative",children:[i.jsx("div",{className:"absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500"}),i.jsx("h2",{className:"text-2xl md:text-3xl font-black leading-relaxed tracking-tight drop-shadow-sm text-white",children:ee.question_text})]})}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:ee.question_type==="multiple_choice"?[ee.option_a,ee.option_b,ee.option_c,ee.option_d].filter(
1031Boolean).map((re,fe)=>{const ge=b===re,he=re===ee.correct_answer;let _e=`relative ${["bg-blue-600 border-blue-500 hover:bg-blue-700","bg-green-600 border-green-500 hover:bg-green-700","bg-red-600 border-red-500 hover:bg-red-700","bg-amber-600 border-amber-500 hover:bg-amber-700"][fe]} border-2 text-white h-auto py-5 text-lg justify-start px-6 transition-all duration-200 font-bold`,We={},ze="bg-white/20 text-white";return j&&(he?(_e="relative bg-gradient-to-br from-green-600 to-green-700 border-4 border-green-300 text-white h-auto py-5 text-lg justify-start px-6 shadow-[0_0_40px_rgba(34,197,94,0.7)] font-black",ze="bg-white text-green-600 ring-2 ring-green-400",We={scale:[1,1.1,1.05],transition:{duration:.5}}):ge&&!he?(_e="relative bg-gradient-to-br from-red-600 to-red-700 border-4 border-red-300 text-white h-auto py-5 text-lg justify-start px-6 font-black",ze="bg-white text-red-600 ring-2 ring-red-400",We={x:[0,-10,10,-8,8,-5,5,0],transition:{duration:.6}}):!ge&&!he&&re===ee.correct_answer?(_e="relative bg-gradient-to-br from-green-500 to-green-600 border-4 border-green-400 border-dashed text-white h-auto py-5 text-lg justify-start px-6 font-black shadow-[0_0_20px_rgba(34,197,94,0.5)]",ze="bg-white text-green-600 ring-2 ring-white",We={scale:[.95,1.02],opacity:[.7,1],transition:{duration:.4,delay:.2}}):(_e="relative bg-slate-800/40 border-2 border-slate-700 text-slate-400 h-auto py-5 text-lg justify-start px-6",ze="bg-slate-700 text-slate-500",We={opacity:[1,.5],transition:{duration:.3}})),i.jsx(rt.div,{animate:We,className:"w-full",children:i.jsxs(ue,{variant:"ghost",onClick:()=>J(re),disabled:j,className:`${_e} w-full`,children:[i.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center mr-4 text-base font-bold ${ze}`,children:String.fromCharCode(65+fe)}),i.jsx("span",{className:"flex-1 text-white font-bold",children:re}),j&&he&&i.jsx(Cn,{className:"ml-auto w-7 h-7 text-white"}),j&&ge&&!he&&i.jsx(ya,{className:"ml-auto w-7 h-7 text-white"})]})},`${o}-${fe}`)}):i.jsxs("div",{className:"md:col-span-2 space-y-4",children:[(()=>{let re="bg-slate-800 border-slate-700 text-white text-center text-2xl h-16 transition-all duration-300",fe=null;if(j){const ge=ee.correct_answer?ee.correct_answer.toString():"";(b?b.toString():"").toLowerCase().trim()===ge.toLowerCase().trim()?(re="bg-gradient-to-r from-green-600 to-emerald-600 border-green-400 text-white text-center text-2xl h-16 shadow-[0_0_30px_rgba(34,197,94,0.6)] scale-[1.03] ring-2 ring-green-400/50 font-bold",fe=i.jsx(Cn,{className:"absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 text-white drop-shadow-lg animate-in zoom-in spin-in duration-500"})):(re="bg-gradient-to-r from-red-600 to-rose-600 border-red-400 text-white text-center text-2xl h-16 ring-2 ring-red-400/50 font-bold animate-shake",fe=i.jsx(ya,{className:"absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 text-white drop-shadow-lg animate-in zoom-in duration-300"}))}return i.jsxs("div",{className:"relative",children:[i.jsx(Ee,{type:ee.question_type==="number"?"number":"text",placeholder:j?b||"No answer":"Enter your answer...",value:j?b||"":_,onChange:ge=>!j&&N(ge.target.value),className:re,disabled:j,onKeyDown:ge=>{ge.key==="Enter"&&!j&&J(_)}}),fe,j&&!b&&i.jsxs("div",{className:"mt-3 text-center bg-green-600 text-white px-4 py-3 rounded-lg font-black text-base border-2 border-green-400 shadow-lg",children:["✓ Correct answer: ",i.jsx("span",{className:"text-green-100",children:ee.correct_answer})]}),j&&b&&(()=>{const ge=ee.correct_answer?ee.correct_answer.toString():"";return b.toString().toLowerCase().trim()===ge.toLowerCase().trim()?null:i.jsxs("div",{className:"mt-3 text-center bg-green-600 text-white px-4 py-3 rounded-lg font-black text-base border-2 border-green-400 shadow-lg animate-in fade-in slide-in-from-top-2",children:["✓ Correct answer: ",i.jsx("span",{className:"text-green-100",children:ee.correct_answer})]})})()]})})(),i.jsx(ue,{className:"w-full bg-indigo-600 hover:bg-indigo-700 hover:shadow-[0_0_20px_rgba(99,102,241,0.5)] active:scale-[0.98] transition-all duration-200 font-bold text-lg h-14",onClick:()=>J(_),disabled:j,children:"Submit Answer"})]})})]}),s==="finished"&&i.jsxs("div",{className:"text-center space-y-8 animate-in fade-in zoom-in duration-300",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("h2",{className:"text-4xl font-black text-white",children:"Challenge Complete!"}),i.jsxs("p",{className:"text-slate-400",children:["You finished in ",Math.floor((w-m)/1e3)," seconds"]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4 max-w-md mx-auto",children:[i.jsx(Me,{className:"bg-slate-800 border-slate-700",children:i.jsxs(Fe,{className:"p-6",children:[i.jsxs("div",{className:"text-4xl font-bold text-indigo-400 mb-1",children:[Object.values(c).filter(
1031Boolean).length,"/",X.length]}),i.jsx("div",{className:"text-xs text-slate-500 uppercase font-bold tracking-wider",children:"Correct"})]})}),i.jsx(Me,{className:"bg-slate-800 border-slate-700",children:i.jsxs(Fe,{className:"p-6",children:[i.jsxs("div",{className:"text-4xl font-bold text-green-400 mb-1",children:[Math.round(h),"%"]}),i.jsx("div",{className:"text-xs text-slate-500 uppercase font-bold tracking-wider",children:"Score"})]})})]}),i.jsxs("div",{className:"max-w-md mx-auto bg-slate-800 rounded-xl p-4",children:[i.jsx("h3",{className:"text-left text-sm font-bold text-slate-400 mb-4 uppercase tracking-wider border-b border-slate-700 pb-2",children:"Leaderboard"}),i.jsxs("div",{className:"space-y-2",children:[z.map((re,fe)=>i.jsxs(lr,{to:Ft(`PublicProfile?userId=${re.user_id}`),className:"flex items-center justify-between bg-slate-900/50 p-3 rounded-lg hover:bg-slate-800 transition-colors group",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold ${fe<3?"bg-yellow-500 text-black":"bg-slate-700 text-slate-400"}`,children:fe+1}),i.jsx("span",{className:"font-medium text-slate-200 group-hover:text-indigo-300 transition-colors",children:re.user_name})]}),i.jsxs("div",{className:"text-right",children:[i.jsxs("div",{className:"font-bold text-indigo-400",children:[re.score_percent,"%"]}),i.jsxs("div",{className:"text-xs text-slate-500",children:[re.time_taken_seconds,"s"]})]})]},fe)),z.length===0&&i.jsx("div",{className:"text-slate-500 text-sm py-2",children:"Be the first to set a record!"})]})]}),M?i.jsxs("div",{className:"max-w-md mx-auto bg-slate-900/50 rounded-xl p-6 border border-slate-800 text-center animate-in fade-in",children:[i.jsx("div",{className:"w-12 h-12 bg-green-500/20 rounded-full flex items-center justify-center mx-auto mb-3",children:i.jsx(Cn,{className:"w-6 h-6 text-green-500"})}),i.jsx("h3",{className:"text-lg font-bold text-white",children:"Thanks for your feedback!"}),i.jsx("p",{className:"text-slate-400 text-sm mt-1",children:"Your review helps others find great quizzes."})]}):i.jsxs("div",{className:"max-w-md mx-auto bg-slate-900/50 rounded-xl p-6 border border-slate-800",children:[i.jsxs("h3",{className:"text-lg font-bold text-white mb-4 flex items-center justify-center gap-2",children:[i.jsx(Za,{className:"w-5 h-5 text-amber-500 fill-amber-500"}),"Rate this Challenge"]}),i.jsx("div",{className:"flex justify-center gap-2 mb-6",children:[1,2,3,4,5].map(re=>i.jsx("button",{type:"button",onClick:fe=>{fe.preventDefault(),F(re)},className:"focus:outline-none transition-transform hover:scale-110",children:i.jsx(Za,{className:`w-8 h-8 ${re<=A?"text-amber-500 fill-amber-500":"text-slate-600"}`})},re))}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"relative",children:[i.jsx(Wo,{className:"absolute top-3 left-3 w-4 h-4 text-slate-500"}),i.jsx("textarea",{value:I,onChange:re=>R(re.target.value),placeholder:"Leave a comment (optional)...",className:"w-full bg-slate-800 border-slate-700 rounded-lg pl-10 pr-4 py-3 text-sm text-white placeholder:text-slate-500 focus:ring-2 focus:ring-indigo-500 focus:border-transparent min-h-[80px]"})]}),i.jsxs(ue,{onClick:async()=>{if(A===0){tt.error("Please select a rating");return}try{await ae.functions.invoke("communityQuiz",{action:"submitReview",quizId:n,rating:A,comment:I}),$(!0),tt.success("Review submitted!"),W(),P_({particleCount:50,spread:60,origin:{y:.7},colors:["#fbbf24","#ffffff"]})}catch{tt.error("Failed to submit review")}},className:"w-full bg-indigo-600 hover:bg-indigo-700",disabled:A===0,children:[i.jsx(cB,{className:"w-4 h-4 mr-2"})," Submit Review"]})]})]}),i.jsx(v3e,{quiz:G,score:h,correctAnswers:Object.values(c).filter(Boolean).length,totalQuestions:X.length,timeTaken:Math.floor((w-m)/1e3)}),L.length>0&&i.jsxs("div",{className:"max-w-md mx-auto mt-8",children:[i.jsxs("h3",{className:"text-lg font-bold text-white mb-4 flex items-center gap-2",children:[i.jsx(Wo,{className:"w-5 h-5 text-indigo-400"}),"Community Reviews (",L.length,")"]}),i.jsx("div",{className:"space-y-3 max-h-60 overflow-y-auto pr-2 custom-scrollbar",children:L.map(re=>{var fe;return i.jsxs("div",{className:"bg-slate-900/40 border border-slate-800 rounded-lg p-4 text-left",children:[i.jsxs("div",{className:"flex justify-between items-start mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-6 h-6 rounded-full bg-indigo-900/50 flex items-center justify-center text-xs font-bold text-indigo-200",children:(fe=re.user_name)==null?void 0:fe.charAt(0).toUpperCase()}),i.jsx("span",{className:"text-sm font-semibold text-slate-200",children:re.user_name})]}),i.jsx("div",{className:"flex",children:[...Array(5)].map((ge,he)=>i.jsx(Za,{className:`w-3 h-3 ${he<re.rating?"text-amber-500 fill-amber-500":"text-slate-700"}`},he))})]}),re.comment&&i.jsx("p",{className:"text-sm text-slate-400 leading-relaxed",children:re.comment}),i.jsx("div",{className:"mt-2 text-xs text-slate-600",children:new Date(re.created_date).toLocaleDateString()})]},re.id)})})]}),i.jsxs("div",{className:"flex gap-4 justify-center mt-6",children:[i.jsx(ue,{variant:"outline",onClick:()=>e(Ft("CommunityChallenges")),className:"border-slate-600 text-slate-300 hover:bg-slate-800",children:"Back to Menu"}),i.jsx(ue,{onClick:()=>e(0),className:"bg-indigo-600 hover:bg-indigo-700",children:"Try Again"})]})]})]})]})}function y3e(){return i.jsx("div",{className:"min-h-screen bg-slate-50",children:i.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-12",children:[i.jsxs(lr,{to:Ft("Public"),className:"inline-flex items-center gap-2 text-indigo-600 hover:text-indigo-800 mb
1031-8 font-medium",children:[i.jsx(uu,{className:"w-4 h-4"}),"Back to Home"]}),i.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-200 p-8 md:p-12",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[i.jsx(uB,{className:"w-8 h-8 text-indigo-600"}),i.jsx("h1",{className:"text-3xl font-bold text-slate-900",children:"Privacy Policy"})]}),i.jsx("p",{className:"text-slate-500 mb-8 text-sm",children:"Last updated: May 2026"}),i.jsxs("div",{className:"prose prose-slate max-w-none space-y-8 text-slate-700",children:[i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"1. Who We Are"}),i.jsxs("p",{children:["Live Quizzing (",i.jsx("strong",{children:"livequizzing.com"}),") is a quiz league platform operated in Ireland. We host live quiz nights, manage league standings, run raffles, and provide community features for quiz enthusiasts."]}),i.jsxs("p",{className:"mt-2",children:["If you have any questions about this policy, contact us at: ",i.jsx("a",{href:"mailto:[email protected]",className:"text-indigo-600 hover:underline",children:"[email protected]"})]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"2. Information We Collect"}),i.jsx("p",{children:"We may collect the following types of information:"}),i.jsxs("ul",{className:"list-disc pl-6 mt-3 space-y-2",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Account information:"})," Name and email address when you register or log in."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Transaction data:"})," Payment details processed securely through Stripe when purchasing raffle tickets or event access. We do not store your card details."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Usage data:"})," Pages visited, features used, and general interaction data to improve the platform."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Device data:"})," Browser type, device type, and session identifiers for analytics and security purposes."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"User-submitted content:"})," Quiz submissions, community posts, forum threads, and booking enquiries."]})]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"3. How We Use Your Information"}),i.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[i.jsx("li",{children:"To manage your account and provide our services."}),i.jsx("li",{children:"To process payments and deliver purchased content."}),i.jsx("li",{children:"To send newsletters and updates (only with your consent)."}),i.jsx("li",{children:"To improve the platform and user experience."}),i.jsx("li",{children:"To operate raffle draws and notify winners."}),i.jsx("li",{children:"To respond to enquiries and booking requests."}),i.jsx("li",{children:"To comply with legal obligations."})]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"4. Cookies & Advertising"}),i.jsx("p",{children:"We use cookies and similar tracking technologies to operate the site and improve your experience. This includes:"}),i.jsxs("ul",{className:"list-disc pl-6 mt-3 space-y-2",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Essential cookies:"})," Required for login sessions and security."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Analytics cookies:"})," To understand how visitors use our site."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Advertising cookies:"})," We use ",i.jsx("strong",{children:"Google AdSense"})," to display advertisements. Google may use cookies to serve ads based on your prior visits to this website or other websites. You can opt out of personalised advertising by visiting ",i.jsx("a",{href:"https://www.google.com/settings/ads",target:"_blank",rel:"noopener noreferrer",className:"text-indigo-600 hover:underline",children:"Google's Ads Settings"}),"."]})]}),i.jsxs("p",{className:"mt-3",children:["For more information on how Google uses data, visit: ",i.jsx("a",{href:"https://policies.google.com/technologies/partner-sites",target:"_blank",rel:"noopener noreferrer",className:"text-indigo-600 hover:underline",children:"Google's Privacy & Terms"}),"."]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"5. Third-Party Services"}),i.jsx("p",{children:"We use the following third-party services which may collect data according to their own privacy policies:"}),i.jsxs("ul",{className:"list-disc pl-6 mt-3 space-y-2",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Stripe"})," — Payment processing (",i.jsx("a",{href:"https://stripe.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"text-indigo-600 hover:underline",children:"Stripe Privacy Policy"}),")"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Google AdSense"})," — Advertising (",i.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"text-indigo-600 hover:underline",children:"Google Privacy Policy"}),")"]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Google Analytics"})," — Website analytics"]})]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"6. Data Sharing"}),i.jsx("p",{children:"We do not sell, trade, or rent your personal information to third parties. We only share data where necessary to deliver our services (e.g. payment processors) or where required by law."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"7. Data Retention"}),i.jsx("p",{children:"We retain your personal data for as long as your account is active or as needed to provide services. You may request deleti
1031on of your account and associated data at any time by contacting us."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"8. Your Rights (GDPR)"}),i.jsx("p",{children:"As a user based in the EU/EEA, you have the right to:"}),i.jsxs("ul",{className:"list-disc pl-6 mt-3 space-y-2",children:[i.jsx("li",{children:"Access the personal data we hold about you."}),i.jsx("li",{children:"Request correction of inaccurate data."}),i.jsx("li",{children:'Request deletion of your data ("right to be forgotten").'}),i.jsx("li",{children:"Object to or restrict how we process your data."}),i.jsx("li",{children:"Lodge a complaint with the Data Protection Commission (Ireland)."})]}),i.jsxs("p",{className:"mt-3",children:["To exercise any of these rights, email us at ",i.jsx("a",{href:"mailto:[email protected]",className:"text-indigo-600 hover:underline",children:"[email protected]"}),"."]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"9. Children's Privacy"}),i.jsx("p",{children:"Our service is not directed at children under the age of 13. We do not knowingly collect personal information from children. If you believe a child has provided us with personal information, please contact us immediately."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"10. Changes to This Policy"}),i.jsx("p",{children:"We may update this Privacy Policy from time to time. We will notify users of significant changes by posting the new policy on this page with an updated date."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"11. Contact Us"}),i.jsx("p",{children:"For any privacy-related questions or requests:"}),i.jsxs("div",{className:"mt-3 bg-slate-50 rounded-lg p-4 border border-slate-200",children:[i.jsx("p",{children:i.jsx("strong",{children:"Live Quizzing"})}),i.jsx("p",{children:"Ireland"}),i.jsxs("p",{children:["Email: ",i.jsx("a",{href:"mailto:[email protected]",className:"text-indigo-600 hover:underline",children:"[email protected]"})]}),i.jsxs("p",{children:["Website: ",i.jsx("a",{href:"https://livequizzing.com",className:"text-indigo-600 hover:underline",children:"livequizzing.com"})]})]})]})]})]})]})})}const b3e=e=>e.split(" ").map(t=>t[0]).filter(Boolean).slice(0,2).join("").toUpperCase(),w3e=e=>e===1?"from-pink-400 via-amber-300 to-yellow-400":e===2?"from-cyan-300 via-slate-200 to-slate-400":"from-orange-300 via-rose-400 to-amber-500",j3e=e=>e===1?"border-amber-400 shadow-[0_0_40px_rgba(251,191,36,0.5)]":e===2?"border-slate-300 shadow-[0_0_25px_rgba(203,213,225,0.3)]":"border-orange-400 shadow-[0_0_25px_rgba(251,146,60,0.35)]",_3e=e=>e===1?"from-pink-500/25 via-amber-500/20 to-purple-500/15":e===2?"from-cyan-400/20 via-slate-300/15 to-blue-400/10":"from-orange-500/20 via-rose-500/15 to-amber-500/10",f0=({label:e,value:t,type:n})=>{const r=()=>{switch(n){case"1st":return"text-amber-300";case"2nd":return"text-slate-300";case"3rd":return"text-orange-300";case"att":return"text-indigo-300";case"handicap":return t===0?"text-slate-400":t>=-2?"text-orange-300":"text-red-400";default:return"text-slate-300"}};return i.jsxs("div",{className:`${r()} flex items-center gap-1.5`,children:[i.jsx("span",{className:"text-xs sm:text-sm md:text-base font-semibold uppercase tracking-wide opacity-80",children:e}),i.jsx("span",{className:"text-sm sm:text-base md:text-xl font-black",children:t})]})},N3e=e=>{if(!e[0])return"rgba(99, 102, 241, 0.15)";const[t,n,r]=e,s=(t==null?void 0:t.total_points)||0,a=(n==null?void 0:n.total_points)||0;return s-a<=5?"rgba(251, 191, 36, 0.3)":s-a<=15?"rgba(250, 204, 21, 0.2)":"rgba(99, 102, 241, 0.15)"};function S3e({teams:e,showHandicapColoring:t}){const[n,r,s]=e,[a,o]=O.useState({x:0,y:0}),l=[{team:n,position:1},{team:r,position:2},{team:s,position:3}];O.useEffect(()=>{const u=h=>{const d=(h.clientX/window.innerWidth-.5)*20,m=(h.clientY/window.innerHeight-.5)*20;o({x:d,y:m})};return window.addEventListener("mousemove",u),()=>window.removeEventListener("mousemove",u)},[]);const c=N3e(e);return i.jsxs("div",{className:"relative space-y-3 mb-6",children:[i.jsx("div",{className:"absolute inset-0 -m-8 rounded-3xl blur-3xl transition-all duration-1000 pointer-events-none opacity-60",style:{background:`radial-gradient(ellipse at center, ${c}, transparent 70%)`,animation:"pulse 4s ease-in-out infinite"}}),i.jsx("style",{children:`
1032        @keyframes pulse {
1033          0%, 100% { opacity: 0.6; transform: scale(1); }
1034          50% { opacity: 0.8; transform: scale(1.05); }
1035        }
1036      `}),l.map(({team:u,position:h})=>{if(!u)return null;const d=u.total_points||0,m=d===1?"Point":"Points",g=a.x*(.3/h),w=a.y*(.3/h);return i.jsx("div",{className:`relative bg-gradient-to-r ${_3e(h)} backdrop-blur-sm rounded-xl md:rounded-2xl p-3 md:p-6 border-2 ${j3e(h)} transition-all duration-300 ease-out hover:scale-[1.02] hover:border-white/60`,style:{transform:`translate(${g}px, ${w}px)`,transition:"transform 0.2s ease-out"},children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-6",children:[i.jsxs("div",{className:"flex items-center gap-3 sm:gap-6 w-full",children:[i.jsx("div",{className:`w-14 h-14 sm:w-16 sm:h-16 md:w-20 md:h-20 flex-shrink-0 rounded-full bg-gradient-to-br ${w3e(h)} flex items-center justify-center shadow-xl ${h===1?"ring-4 ring-pink-300/50 ring-offset-2 ring-offset-transparent animate-pulse":""}`,children:i.jsx("span",{className:"text-white font-black text-xl sm:text-2xl md:text-3xl drop-shadow-lg",children:h===1?"👑":h})}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx("h3",{className:"text-xl sm:text-2xl md:text-4xl font-black text-white leading-tight truncate",children:u.team_name})}),i.jsxs("div",{className:"text-right flex-shrink-0 sm:hidden",children:[i.jsx("div",{className:"text-3xl font-black text-white leading-none",children:d}),i.jsx("div",{className:"text-xs text-slate-300 mt-1 font-bold uppercase tracking-wide",children:m})]})]}),i.jsxs("div",{className:"flex items-center justify-between gap-3 w-full sm:w-auto",children:[i.jsx("div",{className:"flex-1 sm:flex-initial",children:i.jsxs("div",{className:"flex gap-2 sm:gap-3 md:gap-4 flex-wrap items-center",children:[i.jsx(f0,{label:"1st",value:u.finishes_1st||0,type:"1st"}),i.jsx("span",{className:"text-white/30 font-bold hidden sm:inline",children:"•"}),i.jsx(f0,{label:"2nd",value:u.finishes_2nd||0,type:"2nd"}),i.jsx("span",{className:"text-white/30 font-bold hidden sm:inline",children:"•"}),i.jsx(f0,{label:"3rd",value:u.finishes_3rd||0,type:"3rd"}),i.jsx("span",{className:"text-white/30 font-bold hidden sm:inline",children:"•"}),i.jsx(f0,{label:"ATT",value:u.appearances||0,type:"att"}),t&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-white/30 font-bold hidden sm:inline",children:"•"}),i.jsx(f0,{label:"H",value:u.handicap||0,type:"handicap"})]})]})}),u.team_photo_url?i.jsx("img",{src:u.team_photo_url,alt:u.team_name,className:"w-20 h-16 sm:w-24 sm:h-20 md:w-32 md:h-28 object-cover border-2 md:border-4 border-white shadow-xl flex-shrink-0 rounded-lg"}):i.jsx("div",{className:"w-20 h-16 sm:w-24 sm:h-20 md:w-32 md:h-28 bg-white/30 flex items-center justify-center text-white text-base sm:text-xl md:text-2xl font-bold border-2 md:border-4 border-white shadow-xl flex-shrink-0 rounded-lg",children:b3e(u.team_name)}),i.jsxs("div",{className:"hidden sm:block text-right flex-shrink-0",children:[i.jsx("div",{className:"text-4xl md:text-6xl font-black text-white leading-none",children:d}),i.jsx("div",{className:"text-xs md:text-base text-slate-300 mt-1 md:mt-2 font-bold uppercase tracking-wide",children:m})]})]})]})},h)})]})}const k3e=e=>e.split(" ").map(t=>
1036t[0]).filter(Boolean).slice(0,2).join("").toUpperCase(),I8=["from-pink-400 via-rose-500 to-purple-500","from-violet-400 via-purple-500 to-indigo-500","from-cyan-400 via-blue-500 to-indigo-500","from-emerald-400 via-teal-500 to-cyan-500","from-lime-400 via-green-500 to-emerald-500","from-amber-400 via-yellow-500 to-orange-500","from-orange-400 via-red-500 to-rose-500","from-fuchsia-400 via-pink-500 to-rose-500"],E3e=e=>I8[(e-4)%I8.length]||"from-slate-500 to-slate-700",qc=({label:e,value:t,type:n})=>{const r=()=>{switch(n){case"1st":return"text-amber-300";case"2nd":return"text-slate-300";case"3rd":return"text-orange-300";case"att":return"text-indigo-300";case"handicap":return t===0?"text-slate-400":t>=-2?"text-orange-300":"text-red-400";default:return"text-slate-300"}};return i.jsxs("div",{className:`${r()} flex items-center gap-1 sm:gap-1.5`,children:[i.jsx("span",{className:"text-xs sm:text-sm font-semibold uppercase tracking-wide opacity-80",children:e}),i.jsx("span",{className:"text-sm sm:text-base font-black",children:t})]})},P3e=({team:e,position:t,onClose:n})=>{if(!e)return null;const r=e.appearances||0,s=e.finishes_1st||0,a=r>0?Math.round(s/r*100):0,o=r>0?(e.total_points/r).toFixed(1):0;return i.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm animate-in fade-in duration-500",onClick:n,children:i.jsxs("div",{className:"bg-gradient-to-br from-amber-500 via-orange-500 to-red-600 p-1 rounded-3xl shadow-2xl max-w-2xl w-full mx-4",style:{animation:"spotlightPulse 2s ease-in-out infinite"},children:[i.jsx("style",{children:`
1037          @keyframes spotlightPulse {
1038            0%, 100% { box-shadow: 0 0 40px rgba(251, 191, 36, 0.6); }
1039            50% { box-shadow: 0 0 80px rgba(251, 191, 36, 0.9); }
1040          }
1041        `}),i.jsx("div",{className:"bg-slate-900/95 backdrop-blur-md rounded-3xl p-6 md:p-8",children:i.jsxs("div",{className:"text-center space-y-4",children:[i.jsx("div",{className:"flex justify-center",children:i.jsx("div",{className:"bg-gradient-to-r from-amber-400 to-yellow-500 text-slate-900 px-4 py-2 rounded-full font-black text-sm uppercase tracking-wider",children:"🔥 Team of the Moment"})}),i.jsx("h2",{className:"text-3xl md:text-5xl font-black text-white",children:e.team_name}),i.jsxs("div",{className:"text-amber-400 text-lg font-bold",children:["Currently #",t," on the leaderboard"]}),i.jsxs("div",{className:"grid grid-cols-3 gap-4 pt-4",children:[i.jsxs("div",{className:"bg-white/10 rounded-xl p-4 border border-amber-400/30",children:[i.jsx("div",{className:"flex items-center justify-center gap-2 mb-2",children:i.jsx(ro,{className:"w-5 h-5 text-amber-400"})}),i.jsx("div",{className:"text-3xl font-black text-white",children:e.total_points}),i.jsx("div",{className:"text-xs text-slate-300 uppercase font-semibold",children:"Total Points"})]}),i.jsxs("div",{className:"bg-white/10 rounded-xl p-4 border border-green-400/30",children:[i.jsx("div",{className:"flex items-center justify-center gap-2 mb-2",children:i.jsx(vg,{className:"w-5 h-5 text-green-400"})}),i.jsxs("div",{className:"text-3xl font-black text-white",children:[a,"%"]}),i.jsx("div",{className:"text-xs text-slate-300 uppercase font-semibold",children:"Win Rate"})]}),i.jsxs("div",{className:"bg-white/10 rounded-xl p-4 border border-blue-400/30",children:[i.jsx("div",{className:"flex items-center justify-center gap-2 mb-2",children:i.jsx(C_,{className:"w-5 h-5 text-blue-400"})}),i.jsx("div",{className:"text-3xl font-black text-white",children:o}),i.jsx("div",{className:"text-xs text-slate-300 uppercase font-semibold",children:"Pts/Game"})]})]}),i.jsxs("div",{className:"flex justify-center gap-3 pt-2 flex-wrap",children:[i.jsx(qc,{label:"1st",value:e.finishes_1st||0,type:"1st"}),i.jsx(qc,{label:"2nd",value:e.finishes_2nd||0,type:"2nd"}),i.jsx(qc,{label:"3rd",value:e.finishes_3rd||0,type:"3rd"}),i.jsx(qc,{label:"ATT",value:e.appearances||0,type:"att"})]})]})})]})})};function C3e({teams:e,visibleRows:t,scrollInterval:n,pauseDuration:r,showHandicapColoring:s}){const[a,o]=O.useState(0),[l,c]=O.useState(!1),[u,h]=O.useState(null),[d,m]=O.useState(null),g=O.useRef(null),w=t||6,v=140,b=108,y=12,_=35e3,N=3e3,j=O.useMemo(()=>[...e,...e],[e]);O.useEffect(()=>{if(e.length<=w)return;const C=setInterval(()=>{c(!0),setTimeout(()=>{o(P=>{const A=P+1;return A>=e.length?0:A}),c(!1)},800)},n+800);return()=>clearInterval(C)},[e.length,n]),O.useEffect(()=>{if(e.length===0)return;const C=setInterval(()=>{const P=Math.floor(Math.random()*e.length),A=e[P],F=P+4;h(A),m(F),setTimeout(()=>{h(null),m(null)},N)},_);return()=>clearInterval(C)},[e.length]);const S=()=>l?"translateY(calc(-1 * (var(--row-height) + var(--gap-height))))":"translateY(0)";return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-1 bg-gradient-to-r from-transparent via-amber-400 to-transparent my-4 roun
1041ded-full"}),i.jsxs(Me,{className:"relative bg-white/10 backdrop-blur-md border-white/20 p-3 sm:p-4 md:p-6",children:[i.jsx("h2",{className:"text-xl sm:text-2xl md:text-3xl font-black text-white mb-3 sm:mb-5 text-center tracking-tight",children:"League Standings"}),i.jsxs("div",{ref:g,className:"relative overflow-hidden",style:{"--row-height":`${v}px`,"--gap-height":`${y}px`},children:[i.jsx("style",{children:`
1042            @media (min-width: 640px) {
1043              .carousel-container {
1044                --row-height: ${b}px !important;
1045              }
1046            }
1047          `}),i.jsx("div",{className:"carousel-container",style:{transform:S(),transition:l?"transform 0.8s ease-in-out":"none"},children:j.slice(a,a+w+1).map((C,P)=>{const A=(a+P)%e.length,F=A+4,I=C.total_points||0,R=I===1?"Point":"Points",M=A===e.length-1&&a+P===e.length-1;return i.jsxs("div",{children:[i.jsx("div",{className:"mb-3 bg-white/20 backdrop-blur-sm rounded-xl md:rounded-2xl p-3 md:p-4 border-2 border-white/30",children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5",children:[i.jsxs("div",{className:"flex items-center gap-3 sm:gap-5 w-full",children:[i.jsx("div",{className:`w-12 h-12 sm:w-14 sm:h-14 md:w-16 md:h-16 flex-shrink-0 rounded-full bg-gradient-to-br ${E3e(F)} flex items-center justify-center shadow-lg`,children:i.jsx("span",{className:"text-white font-black text-lg sm:text-xl md:text-2xl drop-shadow",children:F})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h3",{className:"text-lg sm:text-xl md:text-3xl font-black text-white leading-tight truncate",children:C.team_name}),C.is_champion&&i.jsx("span",{className:"inline-flex items-center gap-1 bg-amber-500 text-white text-xs font-black px-2 py-0.5 rounded-full uppercase tracking-wider mt-1",children:"🏆 Champions"})]}),i.jsxs("div",{className:"text-right flex-shrink-0 sm:hidden",children:[i.jsx("div",{className:"text-2xl font-black text-white leading-none",children:I}),i.jsx("div",{className:"text-xs text-slate-300 mt-0.5 font-bold uppercase",children:R})]})]}),i.jsxs("div",{className:"flex items-center justify-between gap-3 w-full sm:w-auto",children:[i.jsx("div",{className:"flex-1 sm:flex-initial",children:i.jsxs("div",{className:"flex gap-2 sm:gap-2.5 md:gap-3 flex-wrap items-center",children:[i.jsx(qc,{label:"1st",value:C.finishes_1st||0,type:"1st"}),i.jsx("span",{className:"text-white/30 font-bold hidden sm:inline",children:"•"}),i.jsx(qc,{label:"2nd",value:C.finishes_2nd||0,type:"2nd"}),i.jsx("span",{className:"text-white/30 font-bold hidden sm:inline",children:"•"}),i.jsx(qc,{label:"3rd",value:C.finishes_3rd||0,type:"3rd"}),i.jsx("span",{className:"text-white/30 font-bold hidden sm:inline",children:"•"}),i.jsx(qc,{label:"ATT",value:C.appearances||0,type:"att"}),s&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-white/30 font-bold hidden sm:inline",children:"•"}),i.jsx(qc,{label:"H",value:C.handicap||0,type:"handicap"})]})]})}),C.team_photo_url?i.jsx("img",{src:C.team_photo_url,alt:C.team_name,className:"w-20 h-16 sm:w-24 sm:h-20 md:w-28 md:h-24 object-cover border-2 md:border-3 border-white shadow-xl flex-shrink-0 rounded-lg"}):i.jsx("div",{className:"w-20 h-16 sm:w-24 sm:h-20 md:w-28 md:h-24 bg-white/30 flex items-center justify-center text-white text-base sm:text-lg md:text-xl font-bold border-2 md:border-3 border-white shadow-xl flex-shrink-0 rounded-lg",children:k3e(C.team_name)}),i.jsxs("div",{className:"hidden sm:block text-right flex-shrink-0",children:[i.jsx("div",{className:"text-3xl md:text-5xl font-black text-white leading-none",children:I}),i.jsx("div",{className:"text-xs md:text-sm text-slate-300 mt-1 font-bold uppercase tracking-wide",children:R})]})]})]})}),M&&i.jsx("div",{className:"py-4 mb-3",children:i.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-slate-400/40 to-transparent rounded-full"})})]},`${C.id}-${a}-${P}`)})})]}),u&&i.jsx(P3e,{team:u,position:d,onClose:()=>{h(null),m(null)}})]})]})}function N5(){const[e,t]=O.useState(!1),[n,r]=O.useState(!1);O.useEffect(()=>{const a=window.innerWidth<=768,o=localStorage.getItem("a2hs_dismissed");a&&!o&&t(!0)},[]);const s=()=>{t(!1),localStorage.setItem("a2hs_dismissed","true")};return e?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 p-3 bg-gradient-to-r from-indigo-600 to-indigo-700 border-t-2 border-indigo-400 shadow-2xl",children:i.jsxs("div",{className:"max-w-7xl mx-auto flex items-center gap-3",children:[i.jsx(sA,{className:"w-5 h-5 text-white flex-shrink-0"}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx("p",{className:"text-white text-sm font-semibold leading-tight",children:"📱 Tip: Add this Quiz League to your home screen for a full-screen app experience."})}),i.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>r(!0),className:"bg-white text-indigo-700 hover:bg-indigo-50 border-white h-8 px-3 text-xs font-bold",children:"How?"}),i.jsx("button",{onClick:s,className:"text-white hover:bg-indigo-600 h-8 w-8 rounded flex items-center justify-center",children:i.jsx(Si,{className:"w-4 h-4"})})]})]})}),i.jsx(rn,{open:n,onOpenChange:r,children:i.jsxs(en,{className:"max-w-lg",children:[i.jsx(vn,{children:i.jsxs(sn,{className:"flex items-center gap-2",children:[i.jsx(sA,{className:"w-5 h-5"}),"Add to Home Screen"]})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsx("p",{className:"text-slate-700",children:"Get quick access to the Quiz League by adding it to your device's home screen:"}),i.jsxs("div",{className:"bg-slate-50 rounded-lg p-4 border border-slate-200",children:[i.jsx("h3",{className:"font-bold text-slate-900 mb-2 flex items-center gap-2",children:"📱 iPhone / iPad (Safari)"}),i.jsxs("ol",{className:"list-decimal list-inside space-y-1.5 text-sm text-slate-700",children:[i.jsxs("li",{children:["Tap the ",i.jsx("strong",{children:"Share"})," button (box with arrow) at the bottom"]}),i.jsxs("li",{children:["Scroll down and tap ",i.jsx("strong",{children:'"Add to Home Screen"'})]}),i.jsxs("li",{children:["Tap ",i.jsx("strong",{children:'"Add"'})," in the top right"]}),i.jsx("li",{children:"The app icon will appear on your home screen!"})]})]}),i.jsxs("div",{className:"bg-slate-50 rounded-lg p-4 border border-slate-200",children:[i.jsx("h3",{className:"font-bold text-slate-900 mb-2 flex items-center gap-2",children:"📱 Android (Chrome)"}),i.jsxs("ol",{className:"list-decimal list-inside space-y-1.5 text-sm text-slate-700",children:[i.jsxs("li",{children:["Tap the ",i.jsx("strong",{children:"⋮"})," (three dots) menu in the top right"]}),i.jsxs("li",{children:["Select ",i.jsx("strong",{children:'"Add to Home screen"'})," or ",i.jsx("strong",{children:'"Install app"'})]}),i.jsxs("li",{children:["Tap ",i.jsx("strong",{children:'"Add"'})," or ",i.jsx("strong",{children:'"Install"'})]}),i.jsx("li",{children:"The app icon will appear on your home screen!"})]})]}),i.jsx("div",{className:"bg-indigo-50 rounded-lg p-3 border border-indigo-200",children:i.jsxs("p",{className:"text-sm text-indigo-900",children:[i.jsx("strong",{children:"Tip:"})," Once added, open the app from your home screen for a full-screen experience without browser bars!"]})})]}),i.jsx("div",{className:"flex justify-end",children:i.jsx(ue,{onClick:()=>r(!1),children:"Got it!"})})]})})]}):null}function A3e(){const[e,t]=O.useState([]),[n,r]=O.useState(0),[s,a]=O.useState(!1);if(O.useEffect(()=>{const u=sessionStorage.getItem("quiz_highlights");if(u)try{const h=JSON.parse(u);t(h),a(!0),setTimeout(()=>{a(!1),sessionStorage.removeItem("quiz_highlights")},h.length*5e3)}catch(h){console.error("Failed to parse highlights",h)}},[]),O.useEffect(()=>{if(e.length===0)return;const u=setInterval(()=>{r(h=>{const d=h+1;return d>=e.length?0:d})},5e3);return()=>clearInterval(u)},[e.length]),!s||e.length===0)return null;const o=e[n];if(!o)return null;const l=u=>{switch(u){case"jump":return i.jsx(ro,{className:"w-6 h-6"});case"drop":return i.jsx(dB,{className:"w-6 h-6"});case"win":return i.jsx(Jt,{className:"w-6 h-6"});case"new":return i.jsx(Dr,{className:"w-6 h-6"});case"milestone":return i.jsx(Kc,{className:"w-6 h-6"});default:return i.jsx(Jt,{className:"w-6 h-6"})}},c=u=>{switch(u){case"jump":return"from-green-500 to-emerald-600";case"drop":return"from-red-500 to-rose-600";case"win":return"from-amber-400 to-yellow-500";case"new":return"from-indigo-500 to-purple-600";case"milestone":return"from-cyan-500 to-blue-600";default:return"from-indigo-500 to-purple-600"}};return i.jsxs("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 max-w-2xl w-full px-4",style:{animation:"slideDown 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55)"},children:[i.jsx("style",{children:`
1048        @keyframes slideDown {
1049          from {
1050            transform: translate(-50%, -100%);
1051            opacity: 0;
1052          }
1053          to {
1054            transform: translate(-50%, 0);
1055            opacity: 1;
1056          }
1057        }
1058        @keyframes shimmer {
1059          0% { background-position: -200% center; }
1060          100% { background-position: 200% center; }
1061        }
1062      `}),i.jsx("div",{className:`bg-gradient-to-r ${c(o.type)} p-1 rounded-2xl shadow-2xl`,style:{animation:"shimmer 3s linear infinite",backgroundSize:"200% auto"},children:i.jsx("div",{className:"bg-slate-900/95 backdrop-blur-md rounded-xl p-4 md:p-6",children:i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:`flex-shrink-0 w-12 h-12 md:w-16 md:h-16 rounded-full bg-gradient-to-br ${c(o.type)} flex items-center justify-center text-white shadow-lg`,children:l(o.type)}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"text-xs md:text-sm font-bold uppercase tracking-wider text-amber-400 mb-1",children:"Breaking News"}),i.jsx("div",{className:"text-sm md:text-lg font-black text-white leading-tight",children:o.message})]}),i.jsx("div",{className:"flex-shrink-0 flex gap-1.5",children:e.map((u,h)=>i.jsx("div",{className:`w-2 h-2 rounded-full transition-all ${h===n?"bg-amber-400 w-6":"bg-white/30"}`},h))})]})})})]})}function O3e(){return i.jsx("div",{className:"space-y-2",children:[...Array(10)].map((e,t)=>i.jsxs("div",{className:"bg-white rounded-lg p-4 flex items-center gap-4",children:[i.jsx(gr,{className:"w-8 h-8"}),i.jsx(gr,{className:"w-12 h-12 rounded-full"}),i.jsxs("div",{className:"flex-1 space-y-2",children:[i.jsx(gr,{className:"h-5 w-32"}),i.jsx(gr,{className:"h-4 w-20"})]}),i.jsx(gr,{className:"h-8 w-16"})]},t))})}function UY({isActive:e}){const[t,n]=O.useState(!1);O.useEffect(()=>{if(!e){n(!1);return}const s=localStorage.getItem("game_pass_promo_dismissed");if(s){const a=new Date(s).getTime();if(Date.now()-a<36e5)return}n(!0)},[e]);const r=()=>{localStorage.setItem("game_pass_promo_dismissed",new Date().toISOString()),n(!1)};return t?i.jsx(Gs,{children:i.jsx(rt.div,{initial:{opacity:0,scale:.8,y:50}
1062,animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:50},className:"fixed bottom-6 right-6 z-[100] max-w-sm",children:i.jsxs("div",{className:"bg-gradient-to-br from-indigo-600 via-purple-600 to-pink-600 text-white rounded-2xl shadow-2xl p-6 border-2 border-white/30 relative overflow-hidden",children:[i.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_50%_120%,rgba(255,255,255,0.1),transparent_50%)]"}),i.jsx("button",{onClick:r,className:"absolute top-3 right-3 text-white/80 hover:text-white transition-colors z-10",children:i.jsx(Si,{className:"w-5 h-5"})}),i.jsxs("div",{className:"space-y-4 relative z-10",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-3xl animate-pulse",children:"🎮"}),i.jsx("div",{className:"text-2xl font-black",children:"Beat The Points"})]}),i.jsx("p",{className:"text-white/95 text-base font-medium",children:"Continue playing Beat The Points - Click here to play Round 1 & 2"}),i.jsxs("button",{onClick:()=>{window.open("https://buy.stripe.com/5kA2aNdJE8AXb5K6ov","_blank"),r()},className:"w-full bg-white text-indigo-600 hover:bg-indigo-50 px-6 py-4 rounded-xl font-bold shadow-lg hover:scale-105 transition-all flex items-center justify-center gap-2 text-lg",children:["Click Here to Play ",i.jsx(ws,{className:"w-5 h-5"})]})]})]})})}):null}function S5({message:e}){const t=e||"We're currently updating the league table. Please check back later!";return i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-indigo-900 to-slate-900 relative overflow-hidden flex items-center justify-center px-4",children:[i.jsxs("div",{className:"absolute inset-0 pointer-events-none opacity-40",children:[i.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-indigo-500/40 rounded-full blur-3xl",style:{animation:"float 20s ease-in-out infinite"}}),i.jsx("div",{className:"absolute top-3/4 right-1/4 w-96 h-96 bg-pink-500/35 rounded-full blur-3xl",style:{animation:"float 25s ease-in-out infinite reverse"}}),i.jsx("div",{className:"absolute top-1/2 left-1/2 w-96 h-96 bg-amber-500/30 rounded-full blur-3xl",style:{animation:"float 30s ease-in-out infinite"}}),i.jsx("style",{children:`
1063          @keyframes float {
1064            0%, 100% { transform: translate(0, 0); }
1065            25% { transform: translate(50px, -50px); }
1066            50% { transform: translate(0, -100px); }
1067            75% { transform: translate(-50px, -50px); }
1068          }
1069        `})]}),i.jsxs(rt.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.6,ease:"easeOut"},className:"relative z-10 max-w-2xl w-full text-center",children:[i.jsx(rt.div,{animate:{rotate:[0,-10,10,-10,0]},transition:{duration:2,repeat:1/0,repeatDelay:1},className:"inline-flex items-center justify-center w-28 h-28 rounded-full bg-gradient-to-br from-amber-400 via-pink-500 to-indigo-500 shadow-2xl shadow-indigo-500/40 mb-8",children:i.jsx(WT,{className:"w-14 h-14 text-white"})}),i.jsxs("h1",{className:"text-4xl md:text-6xl font-black mb-6 text-transparent bg-clip-text tracking-widest uppercase",style:{backgroundImage:"linear-gradient(90deg, #f472b6, #fbbf24, #fde047, #34d399, #22d3ee, #a78bfa, #f472b6)",backgroundSize:"200% auto",animation:"rainbowShift 4s linear infinite"},children:[i.jsx("style",{children:"@keyframes rainbowShift { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }"}),"Back Soon"]}),i.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-8 border border-white/20 shadow-xl",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2 text-amber-300 mb-4",children:[i.jsx(rs,{className:"w-5 h-5"}),i.jsx("span",{className:"text-sm font-semibold uppercase tracking-wide",children:"Maintenance in Progress"})]}),i.jsx("p",{className:"text-white text-xl md:text-2xl font-medium leading-relaxed",children:t})]})]})]})}function T3e(){const[e,t]=O.useState(""),[n,r]=O.useState(!0),[s,a]=O.useState(20),[o,l]=O.useState(!1),[c,u]=O.useState({days:0,hours:0,minutes:0,seconds:0,isPast:!1});qi(),O.useEffect(()=>{localStorage.setItem("league_table_last_seen",new Date().toISOString());let C=document.querySelector('meta[name="description"]');C||(C=document.createElement("meta"),C.name="description",document.head.appendChild(C)),C.content="Live Quizzing league standings, weekly results, raffles and community quizzes. Ireland's home for live quiz nights.",document.title="Live Quizzing | League Table & Quiz Community"},[]);const{data:h=[],isLoading:d}
1069=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list(),refetchInterval:3e4,staleTime:15e3}),{data:m}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{season_name:"Live Quizzing Season",total_weeks:10,current_week:0,show_handicap_coloring:!0,carousel_visible_rows:5,carousel_scroll_interval:3e3,carousel_pause_duration:2e3},refetchInterval:1e4}),g=m||{};O.useEffect(()=>{if(!g.next_quiz_start_time)return;const C=()=>{const A=new Date,I=new Date(g.next_quiz_start_time)-A;if(I<=0){u({days:0,hours:0,minutes:0,seconds:0,isPast:!0});return}const R=Math.floor(I/(1e3*60*60*24)),M=Math.floor(I%(1e3*60*60*24)/(1e3*60*60)),$=Math.floor(I%(1e3*60*60)/(1e3*60)),B=Math.floor(I%(1e3*60)/1e3);u({days:R,hours:M,minutes:$,seconds:B,isPast:!1})};C();const P=setInterval(C,1e3);return()=>clearInterval(P)},[g.next_quiz_start_time]);const w=[...h].filter(C=>{var P;return(n?C.active!==!1:!0)&&(e?(P=C.team_name)==null?void 0:P.toLowerCase().includes(e.toLowerCase()):!0)}).sort((C,P)=>P.total_points!==C.total_points?P.total_points-C.total_points:P.finishes_1st!==C.finishes_1st?P.finishes_1st-C.finishes_1st:(C.team_name||"").localeCompare(P.team_name||"")).slice(0,s),v=w.slice(0,3),b=w.slice(3),y=()=>{document.fullscreenElement?(document.exitFullscreen(),l(!1)):(document.documentElement.requestFullscreen(),l(!0))};O.useEffect(()=>{const C=()=>{l(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",C),()=>document.removeEventListener("fullscreenchange",C)},[]);const _=C=>{if(!C)return null;const P=180;return`https://api.qrserver.com/v1/create-qr-code/?size=${P}x${P}&data=${encodeURIComponent(C)}`},N=!!g.current_quiz_url,j=g.permanent_app_url||"https://livequizzing.base44.app",S=g.quiz_title||(g.next_quiz_start_time?new Date(g.next_quiz_start_time).toLocaleDateString("en-US",{weekday:"long"})+"'s Quiz":"Tonight's Quiz");return g.league_table_offline?i.jsxs(i.Fragment,{children:[i.jsx(ao,{pageName:"Public"}),i.jsx(S5,{message:g.maintenance_message})]}):i.jsxs(i.Fragment,{children:[i.jsx(ao,{pageName:"Public"}),i.jsx(UY,{isActive:g.show_game_pass_promo}),i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-indigo-900 to-slate-900 relative overflow-hidden",children:[i.jsxs("div",{className:"absolute inset-0 pointer-events-none opacity-40",children:[i.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-indigo-500/40 rounded-full blur-3xl",style:{animation:"float 20s ease-in-out infinite"}}),i.jsx("div",{className:"absolute top-3/4 right-1/4 w-96 h-96 bg-pink-500/35 rounded-full blur-3xl",style:{animation:"float 25s ease-in-out infinite reverse"}}),i.jsx("div",{className:"absolute top-1/2 left-1/2 w-96 h-96 bg-amber-500/30 rounded-full blur-3xl",style:{animation:"float 30s ease-in-out infinite"}}),i.jsx("div",{className:"absolute top-1/3 right-1/3 w-72 h-72 bg-emerald-500/25 rounded-full blur-3xl",style:{animation:"float 22s ease-in-out infinite reverse"}}),i.jsx("div",{className:"absolute bottom-1/4 left-1/3 w-80 h-80 bg-rose-500/25 rounded-full blur-3xl",style:{animation:"float 28s ease-in-out infinite"}}),i.jsx("div",{className:"absolute top-2/3 right-1/2 w-72 h-72 bg-cyan-500/20 rounded-full blur-3xl",style:{animation:"float 26s ease-in-out infinite reverse"}}),i.jsx("div",{className:"absolute top-1/5 right-1/4 w-64 h-64 bg-fuchsia-500/25 rounded-full blur-3xl",style:{animation:"float 24s ease-in-out infinite"}}),i.jsx("style",{children:`
1070            @keyframes float {
1071              0%, 100% { transform: translate(0, 0); }
1072              25% { transform: translate(50px, -50px); }
1073              50% { transform: translate(0, -100px); }
1074              75% { transform: translate(-50px, -50px); }
1075            }
1076          `})]}),i.jsx(A3e,{}),N&&i.jsx("div",{className:"hidden xl:block fixed left-4 bottom-4 z-50 bg-gradient-to-br from-black/90 to-black/70 backdrop-blur-md rounded-2xl p-5 border-2 border-amber-400/50 shadow-2xl max-w-[220px]",children:i.jsxs("div",{className:"text-center space-y-3",children:[i.jsx("div",{className:"text-amber-400 font-bold text-sm uppercase tracking-wide",children:S}),i.jsx("div",{className:"bg-white p-2 rounded-lg",children:i.jsx("img",{src:_(g.current_quiz_url),alt:"Quiz QR",className:"w-full h-auto"})}),g.next_quiz_start_time&&!c.isPast&&i.jsxs("div",{className:"pt-2 pb-1",children:[i.jsxs("div",{className:"text-white text-xs font-semibold mb-2 flex items-center justify-center gap-1 uppercase tracking-wide",children:[i.jsx(rs,{className:"w-3 h-3"})," Starts in:"]}),i.jsx("div",{className:"bg-slate-900/80 rounded-lg py-2 px-2 border border-amber-400/30",children:i.jsxs("div",{className:"flex justify-center items-center gap-2",children:[c.days>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-amber-400 font-black text-2xl leading-none",children:String(c.days).padStart(2,"0")}),i.jsx("span",{className:"text-amber-300 text-[10px] font-bold mt-0.5",children:"D"})]}),i.jsx("span",{className:"text-amber-400 font-black text-xl mb-3",children:":"})]}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-amber-400 font-black text-2xl leading-none",children:String(c.hours).padStart(2,"0")}),i.jsx("span",{className:"text-amber-300 text-[10px] font-bold mt-0.5",children:"H"})]}),i.jsx("span",{className:"text-amber-400 font-black text-xl mb-3",children:":"}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-amber-400 font-black text-2xl leading-none",children:String(c.minutes).padStart(2,"0")}),i.jsx("span",{className:"text-amber-300 text-[10px] font-bold mt-0.5",children:"M"})]}),i.jsx("span",{className:"text-amber-400 font-black text-xl mb-3",children:":"}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-amber-400 font-black text-2xl leading-none",children:String(c.seconds).padStart(2,"0")}),i.jsx("span",{className:"text-amber-300 text-[10px] font-bold mt-0.5",children:"S"})]})]})})]}),g.next_quiz_start_time&&c.isPast&&i.jsx("div",{className:"pt-2 bg-green-500/20 border border-green-400 rounded-lg py-3 px-2",children:i.jsx("div",{className:"text-green-400 font-black text-2xl animate-pulse",children:"LIVE NOW!"})}),i.jsx("div",{className:"text-slate-300 text-xs pt-1",children:"Scan to Join"})]})}),i.jsx("div",{className:"hidden xl:block fixed right-4 bottom-4 z-50 bg-gradient-to-br from-black/80 to-black/60 backdrop-blur-md rounded-2xl p-4 border-2 border-indigo-400/50 shadow-2xl max-w-[180px]",children:i.jsxs("div",{className:"text-center space-y-2",children:[i.jsx("div",{className:"text-indigo-400 font-bold text-sm uppercase tracking-wide",children:"League Info"}),i.jsx("div",{className:"bg-white p-2 rounded-lg",children:i.jsx("img",{src:_(j),alt:"League App QR",className:"w-full h-auto"})}),i.jsx("div",{className:"text-slate-300 text-xs",children:"Scan for Leaderboard"})]})}),i.jsxs("div",{className:"relative z-10 mx-auto px-3 sm:px-4 xl:px-52 py-3 sm:py-4 pb-24 xl:pb-80 max-w-[1800px]",children:[i.jsx("div",{className:"text-center mb-8",children:i.jsxs("h1",{className:"text-4xl md:text-6xl font-black text-transparent bg-clip-text bg-gradient-to-r from-pink-400 via-amber-300 to-cyan-300 drop-shadow-[0_2px_2px_rgba(0,0,0,0.8)] tracking-widest uppercase",style:{backgroundImage:"linear-gradient(90deg, #f472b6, #fbbf24, #fde047, #34d399, #22d3ee, #a78bfa, #f472b6)",backgroundSize:"200% auto",animation:"rainbowShift 4s linear infinite"},children:[i.jsx("style",{children:"@keyframes rainbowShift { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }"}),"League Table"]})}),!o&&i.jsx("div",{className:"bg-white/10 backdrop-blur-md rounded-lg sm:rounded-xl p-2 sm:p-3 mb-3 sm:mb-4 border border-white/20",children:i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 sm:gap-3",children:[i.jsx("div",{className:"w-full sm:flex-1 sm:max-w-xs",children:i.jsxs("div",{className:"relative",children:[i.jsx(Ld,{className:"absolute left-2 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}
1076),i.jsx(Ee,{placeholder:"Search teams...",value:e,onChange:C=>t(C.target.value),className:"pl-8 h-9 text-sm bg-white/20 border-white/30 text-white placeholder:text-slate-400"})]})}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(me,{htmlFor:"hide-inactive",className:"text-white text-xs sm:text-sm whitespace-nowrap",children:"Hide Inactive"}),i.jsx(ai,{id:"hide-inactive",checked:n,onCheckedChange:r})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(me,{htmlFor:"top-count",className:"text-white text-xs sm:text-sm whitespace-nowrap",children:"Show Top"}),i.jsx(Ee,{id:"top-count",type:"number",value:s,onChange:C=>a(parseInt(C.target.value)||20),className:"w-14 sm:w-16 h-9 text-sm bg-white/20 border-white/30 text-white"})]}),i.jsx(ue,{variant:"outline",size:"icon",onClick:y,className:"h-9 w-9 bg-white/20 border-white/30 text-white hover:bg-white/30 ml-auto sm:ml-0",children:o?i.jsx(ute,{className:"w-4 h-4"}):i.jsx(rte,{className:"w-4 h-4"})})]})]})}),d?i.jsx(O3e,{}):i.jsxs(i.Fragment,{children:[i.jsx(S3e,{teams:v,showHandicapColoring:g.show_handicap_coloring}),b.length>0&&i.jsx(C3e,{teams:b,visibleRows:g.carousel_visible_rows||5,scrollInterval:g.carousel_scroll_interval||3e3,pauseDuration:g.carousel_pause_duration||2e3,showHandicapColoring:g.show_handicap_coloring}),i.jsx("div",{className:"mt-6",children:i.jsx(gY,{placement:"leaderboard_footer"})})]})]}),i.jsx(N5,{})]})]})}function VY({attempts:e=[],badges:t=[]}){const n={totalPlayed:e.length,averageScore:e.length?(e.reduce((r,s)=>r+(s.score_percent||0),0)/e.length).toFixed(1):0,totalCorrect:e.reduce((r,s)=>r+(s.correct_answers||0),0),perfectScores:e.filter(r=>r.score_percent===100).length,bestTime:e.length?Math.min(...e.map(r=>r.time_taken_seconds)):0};return i.jsxs("div",{className:"space-y-8",children:[i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[i.jsx(Me,{className:"bg-gradient-to-br from-indigo-50 to-white border-indigo-100",children:i.jsxs(Fe,{className:"p-6 flex flex-col items-center text-center",children:[i.jsx("div",{className:"p-3 bg-indigo-100 rounded-full mb-3",children:i.jsx(Z1,{className:"w-6 h-6 text-indigo-600"})}),i.jsx("div",{className:"text-2xl font-bold text-slate-800",children:n.totalPlayed}),i.jsx("div",{className:"text-xs text-slate-500 font-medium uppercase tracking-wider",children:"Quizzes Played"})]})}),i.jsx(Me,{className:"bg-gradient-to-br from-emerald-50 to-white border-emerald-100",children:i.jsxs(Fe,{className:"p-6 flex flex-col items-center text-center",children:[i.jsx("div",{className:"p-3 bg-emerald-100 rounded-full mb-3",children:i.jsx(vg,{className:"w-6 h-6 text-emerald-600"})}),i.jsxs("div",{className:"text-2xl font-bold text-slate-800",children:[n.averageScore,"%"]}),i.jsx("div",{className:"text-xs text-slate-500 font-medium uppercase tracking-wider",children:"Avg Score"})]})}),i.jsx(Me,{className:"bg-gradient-to-br from-amber-50 to-white border-amber-100",children:i.jsxs(Fe,{className:"p-6 flex flex-col items-center text-center",children:[i.jsx("div",{className:"p-3 bg-amber-100 rounded-full mb-3",children:i.jsx(Jt,{className:"w-6 h-6 text-amber-600"})}),i.jsx("div",{className:"text-2xl font-bold text-slate-800",children:n.perfectScores}),i.jsx("div",{className:"text-xs text-slate-500 font-medium uppercase tracking-wider",children:"Perfect Games"})]})}),i.jsx(Me,{className:"bg-gradient-to-br from-purple-50 to-white border-purple-100",children:i.jsxs(Fe,{className:"p-6 flex flex-col items-center text-center",children:[i.jsx("div",{className:"p-3 bg-purple-100 rounded-full mb-3",children:i.jsx(Cn,{className:"w-6 h-6 text-purple-600"})}),i.jsx("div",{className:"text-2xl font-bold text-slate-800",children:n.totalCorrect}),i.jsx("div",{className:"text-xs text-slate-500 font-medium uppercase tracking-wider",children:"Correct Answers"})]})})]}),t.length>0&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("h3",{className:"font-bold text-lg text-slate-800 flex items-center gap-2",children:[i.jsx(Jt,{className:"w-5 h-5 text-amber-500"}),"Earned Badges"]}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4",children:t.map((r,s)=>i.jsxs(rt.div,{initial:{opacity:0,scale:.9}
1076,animate:{opacity:1,scale:1},className:"bg-white p-4 rounded-xl border border-slate-200 shadow-sm flex flex-col items-center text-center",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-amber-400 to-orange-500 flex items-center justify-center mb-3 shadow-md text-white",children:i.jsx(Jt,{className:"w-6 h-6"})}),i.jsx("span",{className:"font-bold text-sm text-slate-800 leading-tight",children:r})]},s))})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("h3",{className:"font-bold text-lg text-slate-800 flex items-center gap-2",children:[i.jsx(rs,{className:"w-5 h-5 text-slate-500"}),"Quiz History"]}),i.jsx(Me,{children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs(Qo,{children:[i.jsx(Yo,{children:i.jsxs(tr,{children:[i.jsx(ht,{children:"Date"}),i.jsx(ht,{children:"Quiz"}),i.jsx(ht,{children:"Score"}),i.jsx(ht,{children:"Time"}),i.jsx(ht,{children:"Status"})]})}),i.jsx(Xo,{children:e.length>0?e.map(r=>i.jsxs(tr,{children:[i.jsx(it,{className:"font-medium text-slate-600",children:Ut(new Date(r.completed_at),"MMM d, yyyy")}),i.jsx(it,{children:i.jsx("span",{className:"font-semibold text-slate-800 block min-w-[150px]",children:r.quiz_title||"Unknown Quiz"})}),i.jsx(it,{children:i.jsxs(nt,{variant:r.score_percent>=80?"default":"secondary",className:r.score_percent>=80?"bg-green-600":"",children:[r.score_percent,"%"]})}),i.jsxs(it,{className:"text-slate-500",children:[r.time_taken_seconds,"s"]}),i.jsx(it,{children:r.score_percent===100?i.jsxs("div",{className:"flex items-center text-amber-500 font-bold text-xs",children:[i.jsx(Jt,{className:"w-3 h-3 mr-1"})," Perfect"]}):i.jsx("span",{className:"text-xs text-slate-400",children:"Completed"})})]},r.id)):i.jsx(tr,{children:i.jsx(it,{colSpan:5,className:"text-center py-8 text-slate-500",children:"No quizzes played yet."})})})]})})})]})]})}function WY({userId:e}){const{data:t}=qe({queryKey:["creatorStats",e],queryFn:async()=>{if(!e)return null;const n=await ae.entities.CommunityQuiz.filter({created_by_user_id:e});return{totalCreated:n.length,totalPlays:n.reduce((r,s)=>r+(s.total_plays||0),0),avgRating:n.length?(n.reduce((r,s)=>r+(s.average_rating||0),0)/n.length).toFixed(1):0}},enabled:!!e});return t?i.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[i.jsxs("div",{className:"bg-white/50 backdrop-blur-sm p-3 rounded-lg border border-slate-100/50 text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-current",children:t.totalCreated}),i.jsx("div",{className:"text-xs opacity-70 uppercase tracking-wider mt-1",children:"Quizzes Created"})]}),i.jsxs("div",{className:"bg-white/50 backdrop-blur-sm p-3 rounded-lg border border-slate-100/50 text-center",children:[i.jsxs("div",{className:"text-2xl font-bold text-current flex items-center justify-center gap-1",children:[i.jsx(_s,{className:"w-4 h-4"})," ",t.totalPlays]}),i.jsx("div",{className:"text-xs opacity-70 uppercase tracking-wider mt-1",children:"Total Plays"})]}),i.jsxs("div",{className:"bg-white/50 backdrop-blur-sm p-3 rounded-lg border border-slate-100/50 text-center",children:[i.jsxs("div",{className:"text-2xl font-bold text-current flex items-center justify-center gap-1",children:[i.jsx(Za,{className:"w-4 h-4 fill-current"})," ",t.avgRating]}),i.jsx("div",{className:"text-xs opacity-70 uppercase tracking-wider mt-1",children:"Avg Rating"})]})]}):i.jsx("div",{className:"text-sm text-slate-500",children:"Loading stats..."})}function R3e(){var h;const e=qi(),[t]=e9(),n=t.get("userId"),{data:r,isLoading:s}=qe({queryKey:["publicProfile",n],queryFn:async()=>{var m;return n?(m=(await ae.functions.invoke("publicProfile",{action:"getPublicProfile",userId:n})).data)==null?void 0:m.profile:null},enabled:!!n}),{data:a=[]}=qe({queryKey:["userAttempts",n],queryFn:async()=>n?(await ae.entities.CommunityQuizAttempt.filter({user_id:n})).sort((m,g)=>new Date(g.completed_at)-new Date(m.completed_at)):[],enabled:!!n}),{data:o=[]}=qe({queryKey:["creatorLeaderboard"],queryFn:async()=>{var m;return((m=(await ae.functions.invoke("communityQuiz",{action:"getCreatorLeaderboard"})).data)==null?void 0:m.leaderboard)||[]}}),l=o.findIndex(d=>d.userId===n),c=l!==-1&&l<3,u=l===0?"gold":l===1?"silver":l===2?"bronze":null;return n?s?i.jsx("div",{className:"flex justify-center p-10",children:i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-600"})}):r?i.jsxs("div",{className:"min-h-screen bg-slate-50 pb-20",children:[i.jsx(ao,{pageName:`PublicProfile-${n}`}),i.jsx("div",{className:"bg-white border-b border-slate-200 sticky top-0 z-10",children:i.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-4",children:[i.jsxs(ue,{variant:"ghost",onClick:()=>e(-1),className:"mb-2 -ml-2 text-slate-500 hover:text-slate-900",children:[i.jsx(uu,{className:"w-4 h-4 mr-2"})," Back"]}),i.jsxs("div",{className:"flex items-center gap-6",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:`w-20 h-20 rounded-full bg-indigo-600 flex items-center justify-center text-3xl font-bold text-white shadow-lg overflow-hidden border-4 ${u==="gold"?"border-yellow-400":u==="silver"?"border-slate-300":u==="bronze"?"border-amber-700":"border-white"}`,children:r.avatar_url?i.jsx("img",{src:r.avatar_url,alt:"Avatar",className:"w-full h-full object-cover"}):r.display_name?r.display_name.charAt(0).toUpperCase():i.jsx(zo,{})}),c&&i.jsx("div",{className:"absolute -top-2 -right-2 bg-white rounded-full p-1 shadow-md z-10",title:`Top Creator Rank #${l+1}`,children:i.jsx(z0,{className:`w-6 h-6 ${u==="gold"?"text-yellow-500 fill-yellow-500":u==="silver"?"text-slate-400 fill-slate-400":"text-amber-700 fill-amber-700"}`})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:r.display_name||r.full_name||"Anonymous User"}),c&&i.jsxs("span",{className:"bg-gradient-to-r from-amber-200 to-yellow-400 text-amber-900 text-[10px] font-black px-1.5 py-0.5 rounded uppercase tracking-wider flex items-center gap-1 border border-amber-500/20",children:[i.jsx(nB,{className:"w-3 h-3"}),"Top Creator"]}),((h=r.badges)==null?void 0:h.includes("Quiz Master"))&&i.jsx(nt,{className:"bg-amber-500 hover:bg-amber-600",children:"Qu
1076iz Master"})]}),i.jsx("p",{className:"text-slate-500 mb-2",children:r.bio||"No bio yet."}),i.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[i.jsxs("div",{className:"bg-indigo-50 text-indigo-700 px-2 py-0.5 rounded-md font-bold border border-indigo-100",children:["Lvl ",r.level||1]}),i.jsxs("div",{className:"bg-emerald-50 text-emerald-700 px-2 py-0.5 rounded-md font-bold border border-emerald-100",children:[r.xp||0," XP"]})]})]})]})]})}),i.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8 space-y-6",children:[i.jsxs(Me,{className:"border-none shadow-sm bg-gradient-to-r from-slate-900 to-indigo-900 text-white overflow-hidden relative",children:[i.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-white/5 rounded-full -mr-16 -mt-16 blur-3xl"}),i.jsxs(Fe,{className:"p-6 relative z-10",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 opacity-90",children:[i.jsx(Sd,{className:"w-5 h-5 text-orange-400"}),i.jsx("span",{className:"font-bold uppercase tracking-wider text-sm",children:"Creator Profile"})]}),i.jsx("div",{className:"bg-white/10 rounded-xl p-1",children:i.jsx(WY,{userId:n})})]})]}),i.jsxs(tu,{defaultValue:"stats",className:"w-full",children:[i.jsxs(Wl,{className:"bg-white border mb-6",children:[i.jsx(Wt,{value:"stats",children:"Player Stats"}),i.jsx(Wt,{value:"history",children:"Recent Activity"})]}),i.jsx(Yt,{value:"stats",children:i.jsx(VY,{attempts:a,badges:r.badges})}),i.jsx(Yt,{value:"history",children:i.jsx(Me,{children:i.jsx(Fe,{className:"p-0",children:a.length>0?i.jsx("div",{className:"divide-y divide-slate-100",children:a.map(d=>i.jsxs("div",{className:"p-4 hover:bg-slate-50 transition-colors flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-slate-800",children:d.quiz_title||"Unknown Quiz"}),i.jsx("p",{className:"text-xs text-slate-500",children:new Date(d.completed_at).toLocaleDateString()})]}),i.jsxs("div",{className:"text-right",children:[i.jsxs("div",{className:`font-bold ${d.score_percent>=80?"text-green-600":"text-slate-600"}`,children:[d.score_percent,"%"]}),i.jsxs("div",{className:"text-xs text-slate-400",children:[d.time_taken_seconds,"s"]})]})]},d.id))}):i.jsx("div",{className:"p-8 text-center text-slate-500",children:"No activity yet."})})})})]})]})]}):i.jsx("div",{className:"p-8 text-center",children:"User not found"}):i.jsx("div",{className:"p-8 text-center",children:"User ID required"})}const M3e=()=>{const e=new Date,t=e.getDay(),n=e.getHours();return t===1?n>=23||n<13:t===0?!1:t>=2&&t<=6};function I3e({open:e,onOpenChange:t}){const[n,r]=O.useState(1),s=()=>{r(2)},a=()=>{r(1)},o=()=>{window.open("https://buy.stripe.com/5kQaEXgNV7ghfJl59q2Ji0r","_blank")},l=()=>{r(1),t(!1)},c=M3e();return i.jsx(rn,{open:e,onOpenChange:u=>{u||r(1),t(u)},children:i.jsxs(en,{className:"sm:max-w-lg",children:[n===1&&i.jsxs(i.Fragment,{children:[i.jsxs(vn,{children:[i.jsxs(sn,{className:"flex items-center gap-2 text-2xl",children:[i.jsx(_s,{className:"w-6 h-6 text-green-600"}),"Replay Last Monday's Quiz – €2"]}),i.jsx(Kl,{className:"text-base pt-2",children:"Replay last Monday's quiz at any time for just €2."})]}),i.jsxs(Fr,{className:"flex-col sm:flex-row gap-2 mt-4",children:[i.jsx(ue,{variant:"outline",onClick:l,className:"w-full sm:w-auto order-2 sm:order-1",children:"Cancel"}),i.jsxs(ue,{onClick:s,className:"w-full sm:w-auto order-1 sm:order-2 bg-green-600 hover:bg-green-700",children:["Continue",i.jsx(X1,{className:"w-4 h-4 ml-2"})]})]})]}),n===2&&i.jsxs(i.Fragment,{children:[i.jsx(vn,{children:i.jsxs(sn,{className:"flex items-center gap-2 text-2xl",children:[i.jsx(_s,{className:"w-6 h-6 text-green-600"}),"Quiz Replay"]})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsx("p",{className:"text-slate-700 leading-relaxed",children:"Missed Monday's quiz? Replay the full game at home with the same questions, timers, and scoring as the live event."}),i.jsx("p",{className:"text-slate-700 leading-relaxed",children:"Play alone or with family and friends. Once your payment is completed, you'll be taken straight into the game with instant access."}),i.jsx("p",{className:"text-slate-700 leading-relaxed",children:"Replay is available weekly from Monday 11pm to Monday 1pm. Enjoy the challenge and see how you score!"}),!c&&i.jsxs("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-4 flex items-start gap-3",children:[i.jsx(Sn,{className:"w-5 h-5 text-orange-600 flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"text-sm text-orange-900",children:[i.jsx("strong",{children:"Currently Unavailable"}),i.jsx("p",{className:"mt-1",children:"Replay will reopen Monday at 11pm with the latest quiz."})]})]})]}),i.jsxs(Fr,{className:"flex-col sm:flex-row gap-2",children:[i.jsxs(ue,{variant:"outline",onClick:a,className:"w-full sm:w-auto order-2 sm:order-1",children:[i.jsx(uu,{className:"w-4 h-4 mr-2"}),"Back"]}
1076),c?i.jsxs(ue,{onClick:o,className:"w-full sm:w-auto order-1 sm:order-2 bg-green-600 hover:bg-green-700",children:["Proceed to Checkout (€2)",i.jsx(X1,{className:"w-4 h-4 ml-2"})]}):i.jsx(ue,{disabled:!0,className:"w-full sm:w-auto order-1 sm:order-2 opacity-60 cursor-not-allowed",children:"Replay will reopen Monday at 11pm"})]})]})]})})}function D3e({targetId:e,targetType:t,currentUser:n}){const r=mn(),[s,a]=O.useState(5),[o,l]=O.useState(""),{data:c=[]}=qe({queryKey:["reviews",e],queryFn:()=>ae.entities.Review.filter({target_id:e})}),u=se.useMemo(()=>c.length===0?0:(c.reduce((m,g)=>m+g.rating,0)/c.length).toFixed(1),[c]),h=qt({mutationFn:async()=>{var m;const d=await ae.functions.invoke("gamification",{action:"submitReview",target_id:e,target_type:t,rating:s,comment:o});if((m=d.data)!=null&&m.error)throw new Error(d.data.error);return d.data},onSuccess:()=>{r.invalidateQueries(["reviews",e]),l(""),a(5),tt.success("Review submitted! +15 XP")},onError:()=>tt.error("Failed to submit review")});return i.jsxs("div",{className:"mt-8 border-t border-slate-800 pt-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsx("h3",{className:"text-xl font-bold text-white",children:"Reviews"}),c.length>0&&i.jsxs("div",{className:"flex items-center gap-2 bg-slate-800 px-3 py-1 rounded-full",children:[i.jsx(Za,{className:"w-4 h-4 text-yellow-400 fill-yellow-400"}),i.jsx("span",{className:"font-bold text-white",children:u}),i.jsxs("span",{className:"text-slate-400 text-sm",children:["(",c.length,")"]})]})]}),i.jsxs("div",{className:"space-y-4 mb-8",children:[c.map(d=>{var m;return i.jsxs("div",{className:"bg-slate-800/30 p-4 rounded-lg",children:[i.jsxs("div",{className:"flex justify-between items-start mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(Gh,{className:"w-6 h-6",children:[i.jsx(ev,{src:d.user_avatar}),i.jsx(Qh,{children:(m=d.user_name)==null?void 0:m[0]})]}),i.jsx("span",{className:"font-bold text-sm text-slate-300",children:d.user_name})]}),i.jsx("div",{className:"flex text-yellow-400",children:[...Array(5)].map((g,w)=>i.jsx(Za,{className:`w-3 h-3 ${w<d.rating?"fill-current":"text-slate-600"}`},w))})]}),i.jsx("p",{className:"text-slate-300 text-sm",children:d.comment}),i.jsx("div",{className:"text-xs text-slate-500 mt-2",children:Ut(new Date(d.created_date),"MMM d, yyyy")})]},d.id)}),c.length===0&&i.jsx("p",{className:"text-slate-500 text-center py-4",children:"No reviews yet. Be the first!"})]}),n?i.jsxs("div",{className:"bg-slate-800/50 p-4 rounded-lg border border-slate-700",children:[i.jsx("h4",{className:"font-bold text-white mb-3",children:"Write a Review"}),i.jsx("div",{className:"flex gap-1 mb-3",children:[1,2,3,4,5].map(d=>i.jsx("button",{onClick:()=>a(d),className:"focus:outline-none",children:i.jsx(Za,{className:`w-6 h-6 ${d<=s?"text-yellow-400 fill-yellow-400":"text-slate-600"}`})},d))}),i.jsx(nr,{value:o,onChange:d=>l(d.target.value),placeholder:"Share your thoughts...",className:"bg-slate-900 border-slate-600 text-white mb-3"}),i.jsx(ue,{onClick:()=>h.mutate(),disabled:!o.trim()||h.isPending,className:"w-full bg-indigo-600 hover:bg-indigo-700",children:"Submit Review"})]}):i.jsx("div",{className:"text-center p-4 bg-slate-800/30 rounded-lg text-slate-400 text-sm",children:"Please log in to write a review."})]})}const L3e=["All","General Knowledge","Music","Movies & TV","Sports","History & Geo","Science & Tech","Other"];function F3e(){const e=qi(),[t,n]=O.useState(null),[r,s]=O.useState(null),[a,o]=O.useState(!1),[l,c]=O.useState(!1),[u,h]=O.useState(""),[d,m]=O.useState("All"),[g,w]=O.useState("all"),[v,b]=O.useState("popular");O.useEffect(()=>{new URLSearchParams(window.location.search).get("canceled")==="true"&&(tt.error("Payment cancelled"),window.history.replaceState({},"",window.location.pathname))},[]);const{data:y}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me().catch(()=>null)}),{data:_=[],isLoading:N}=qe({queryKey:["publicInstantGames"],queryFn:async()=>(await ae.entities.InstantGame.list("-play_count")).filter(M=>M.active)}),{data:j=[],isLoading:S}=qe({queryKey:["publicEvents"],queryFn:async()=>{const R=await ae.entities.Event.list("-start_datetime"),M=new Date;return R.filter($=>$.is_active!==!1&&(new Date($.start_datetime)>M||$.game_url))}}),C=O.useMemo(()=>{const R=_.filter(M=>M.is_featured);if(R.length<3){const M=_.filter($=>!$.is_featured).sort(($,B)=>(B.play_count||0)-($.play_count||0)).slice(0,3-R.length);return[...R,...M]}return R.slice(0,3)},[_]),P=O.useMemo(()=>{const R=_.map(B=>({...B,type:"game"})),M=j.map(B=>({...B,type:"event"}));let $=[...R,...M];if(u){const B=u.toLowerCase();$=$.filter(U=>U.title.toLowerCase().includes(B)||U.description&&U.description.toLowerCase().includes(B))}return d!=="All"&&($=$.filter(B=>B.type==="event"||B.category===d)),g!=="all"&&(g==="free"&&($=$.filter(B=>B.price===0)),g==="under_5"&&($=$.filter(B=>B.price<5))),$.sort((B,U)=>{if(v==="newest"){const G=new Date(B.created_date||B.start_datetime).getTime();return new Date(U.created_date||U.start_datetime).getTime()-G}if(v==="price_asc")return B.price-U.price;if(v==="price_desc")return U.price-B.price;if(v==="popular"){const G=B.play_count||0;return(U.play_count||0)-G}return 0}),$},[_,j,u,d,g,v]),A=R=>{R.type==="game"?n(R):s(R)},F=async()=>{var R;if(!y){ae.auth.redirectToLogin();return}o(!0);try{const M=`${window.location.origin}${window.location.pathname}?buy_game_success=true&game_id=${t.id}&session_id={CHECKOUT_SESSION_ID}`,$=`${window.location.origin}${window.location.pathname}?canceled=true`,B=await ae.functions.invoke("payment",{action:"createGameSession",gameId:t.id,userId:y.id,userEmail:y.email,successUrl:M,cancelUrl:$});if((R=B.data)!=null&&R.url)window.location.href=B.data.url;else throw new Error("Failed to create checkout session")}catch(M){console.error("Purchase failed:",M),tt.error("Something went wrong. Please try again."),o(!1)}},I=async R=>{var U,G;if(!y){ae.auth.redirectToLogin();return}const M=`${window.location.origin}${window.location.pathname}?buy_event_success=true&event_id=${R.id}&session_id={CHECKOUT_SESSION_ID}`,$=`${window.location.origin}${window.location.pathname}?canceled=true`;if(R.price===0){if((U=(await ae.functions.invoke("payment",{action:"claimFreeEvent",eventId:R.id,userId:y.id,userEmail:y.email})).data)!=null&&U.game_url){const X=`${window.location.origin}${window.location.pathname}?buy_event_success=true&event_id=${R.id}&session_id=free_${R.id}`;window.location.href=X}s(null),tt.success("Event claimed!");return}const B=await ae.functions.invoke("payment",{action:"createSession",eventId:R.id,quantity:1,userId:y.id,userEmail:y.email,successUrl:M,cancelUrl:$});(G=B.data)!=null&&G.url?window.location.href=B.data.url:tt.error("Failed to initiate purchase")};return i.jsxs("div",{className:"min-h-screen bg-slate-950 pb-20 font-sans",children:[i.jsx("div",{className:"bg-gradient-to-b from-indigo-900 to-slate-950 pt-8 pb-12 px-4",children:i.jsxs("div",{className:"max-w-6xl mx-auto",children:[i.jsxs("button",{onClick:()=>e(Ft("CentralHub")),className:"text-slate-400 hover:text-white flex items-center gap-2 mb-6 transition-colors",children:[i.jsx(uu,{className:"w-4 h-4"})," Back to Hub"]}),i.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6 mb-8",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[i.jsx("div",{className:"bg-indigo-500/20 p-2 rounded-lg border border-indigo-500/30",children:i.jsx(vs,{className:"w-6 h-6 text-indigo-400"})}),i.jsx("h1",{className:"text-3xl md:text-4xl font-black text-white tracking-tight",children:"Qu
1076iz Store"})]}),i.jsx("p",{className:"text-slate-400 max-w-lg",children:"Browse our collection of instant quizzes and upcoming live events."})]}),i.jsx("div",{className:"flex-1 max-w-md",children:i.jsxs("div",{className:"relative",children:[i.jsx(Ld,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}),i.jsx(Ee,{placeholder:"Search games...",className:"pl-10 bg-slate-900/50 border-slate-700 text-white focus:border-indigo-500",value:u,onChange:R=>h(R.target.value)})]})})]}),!u&&d==="All"&&i.jsxs("div",{className:"mb-12",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 text-amber-400",children:[i.jsx(es,{className:"w-5 h-5"}),i.jsx("h2",{className:"font-bold text-lg uppercase tracking-wider",children:"Featured & Popular"})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:C.map((R,M)=>i.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:(M+1)*.1},children:i.jsxs(Me,{className:"bg-slate-900/50 border-slate-700 overflow-hidden hover:border-indigo-500/50 transition-all cursor-pointer group h-full flex flex-col",onClick:()=>A({...R,type:"game"}),children:[i.jsxs("div",{className:"aspect-video relative overflow-hidden",children:[R.image_url?i.jsx("img",{src:R.image_url,alt:R.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center bg-slate-800",children:i.jsx(vs,{className:"w-12 h-12 text-slate-600"})}),i.jsx("div",{className:"absolute bottom-2 right-2",children:i.jsx(nt,{className:"bg-indigo-600 hover:bg-indigo-700",children:"POPULAR"})})]}),i.jsxs(Fe,{className:"p-4 flex-1 flex flex-col",children:[i.jsx("h3",{className:"text-white font-bold text-lg mb-1 line-clamp-1",children:R.title}),i.jsx("p",{className:"text-slate-400 text-sm mb-3 line-clamp-2 flex-1",children:R.description}),i.jsxs("div",{className:"flex items-center justify-between mt-auto",children:[i.jsxs("span",{className:"text-white font-bold text-lg",children:["€",R.price.toFixed(2)]}),i.jsxs("div",{className:"text-xs text-slate-500 flex items-center gap-1",children:[i.jsx(Sd,{className:"w-3 h-3"})," ",R.play_count||0," plays"]})]})]})]})},R.id))})]})]})}),i.jsxs("div",{className:"max-w-6xl mx-auto px-4 -mt-6",children:[i.jsxs("div",{className:"flex flex-wrap gap-3 mb-6 sticky top-4 z-20 py-2 bg-slate-950/90 backdrop-blur-md rounded-xl px-4 border border-slate-800/50 shadow-xl",children:[i.jsxs(Xt,{value:d,onValueChange:m,children:[i.jsx(Ht,{className:"w-[140px] bg-slate-900 border-slate-700 text-white",children:i.jsx(Zt,{placeholder:"Category"})}),i.jsx(Kt,{children:L3e.map(R=>i.jsx(Ie,{value:R,children:R},R))})]}),i.jsxs(Xt,{value:g,onValueChange:w,children:[i.jsx(Ht,{className:"w-[130px] bg-slate-900 border-slate-700 text-white",children:i.jsx(Zt,{placeholder:"Price"})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"all",children:"Any Price"}),i.jsx(Ie,{value:"free",children:"Free"}),i.jsx(Ie,{value:"under_5",children:"Under €5"})]})]}),i.jsx("div",{className:"ml-auto",children:i.jsxs(Xt,{value:v,onValueChange:b,children:[i.jsx(Ht,{className:"w-[150px] bg-slate-900 border-slate-700 text-white",children:i.jsx(Zt,{placeholder:"Sort By"})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"popular",children:"Most Popular"}),i.jsx(Ie,{value:"newest",children:"Newest"}),i.jsx(Ie,{value:"price_asc",children:"Price: Low to High"}),i.jsx(Ie,{value:"price_desc",children:"Price: High to Low"})]})]})})]}),N||S?i.jsx("div",{className:"flex justify-center py-20",children:i.jsx(dr,{className:"w-8 h-8 text-indigo-500 animate-spin"})}):i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6",children:P.map((R,M)=>i.jsx(rt.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:M*.05},children:i.jsxs(Me,{className:"bg-slate-900/40 border-slate-800 overflow-hidden hover:border-indigo-500/50 transition-all cursor-pointer group h-full flex flex-col hover:shadow-2xl hover:shadow-indigo-900/20 hover:-translate-y-1",onClick:()=>A(R),children:[i.jsxs("div",{className:"pt-6 pb-2 flex justify-center relative bg-slate-900/30",children:[i.jsx("div",{className:"w-48 h-48 bg-slate-800 relative rounded-full overflow-hidden shadow-xl border-4 border-slate-700 group-hover:border-indigo-500 transition-all duration-300",children:R.image_url?i.jsx("img",{src:R.image_url,alt:
1076R.title,className:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-500",loading:"lazy"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:R.type==="game"?i.jsx(vs,{className:"w-20 h-20 text-slate-600"}):i.jsx(Fn,{className:"w-20 h-20 text-slate-600"})})}),R.type==="event"&&i.jsx("div",{className:"absolute top-4 right-4",children:i.jsx(nt,{className:"bg-blue-600 hover:bg-blue-700",children:"EVENT"})}),R.type==="game"&&R.category&&R.category!=="General Knowledge"&&i.jsx("div",{className:"absolute top-4 right-4",children:i.jsx(nt,{variant:"outline",className:"bg-black/50 text-white border-white/20 backdrop-blur-sm",children:R.category})}),i.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-1/4 z-10",children:i.jsx("span",{className:"bg-slate-800 text-white font-bold text-lg px-4 py-1 rounded-full border border-slate-600 shadow-lg",children:R.price===0?"Free":`€${R.price.toFixed(2)}`})})]}),i.jsxs(Fe,{className:"p-4 pt-8 flex-1 flex flex-col text-center",children:[i.jsx("h3",{className:"text-white font-bold text-lg mb-1 line-clamp-2 group-hover:text-indigo-400 transition-colors",children:R.title}),i.jsx("p",{className:"text-slate-400 text-xs line-clamp-2 mb-3 flex-1",children:R.description}),i.jsx(ue,{className:`w-full h-9 text-xs ${R.type==="event"?"bg-blue-600 hover:bg-blue-700":"bg-white/10 hover:bg-indigo-600 text-white border border-white/10"}`,children:R.type==="event"?"View Event":"Play Now"})]})]})},`${R.type}-${R.id}`))}),!N&&!S&&P.length===0&&i.jsxs("div",{className:"text-center py-20 bg-slate-900/30 rounded-2xl border border-slate-800",children:[i.jsx(Ld,{className:"w-12 h-12 text-slate-600 mx-auto mb-4"}),i.jsx("h3",{className:"text-white font-bold text-xl mb-2",children:"No Matches Found"}),i.jsx("p",{className:"text-slate-400",children:"Try adjusting your filters or search query."}),i.jsx(ue,{variant:"link",className:"text-indigo-400 mt-2",onClick:()=>{h(""),m("All"),w("all")},children:"Clear all filters"})]})]}),i.jsx(rn,{open:!!t,onOpenChange:R=>{R||(n(null),o(!1))},children:i.jsxs(en,{className:"bg-slate-900 border-slate-700 text-white sm:max-w-md",children:[i.jsx("div",{className:"absolute right-4 top-4",children:i.jsx("button",{onClick:()=>{n(null),o(!1)},className:"p-1 rounded-full hover:bg-white/10 text-slate-400 hover:text-white transition-colors",children:i.jsx(Si,{className:"w-5 h-5"})})}),i.jsxs(vn,{children:[i.jsxs(sn,{className:"flex items-center gap-2 text-xl",children:[i.jsx(vs,{className:"w-5 h-5 text-indigo-400"}),"Unlock Game"]}),i.jsxs(Kl,{className:"text-slate-400",children:["Get instant access to play ",t==null?void 0:t.title]})]}),i.jsxs("div",{className:"py-6",children:[i.jsxs("div",{className:"bg-slate-950 rounded-xl p-4 border border-slate-800 mb-6 flex gap-4 items-center",children:[i.jsx("div",{className:"w-16 h-16 bg-slate-800 rounded-lg overflow-hidden flex-shrink-0",children:t!=null&&t.image_url?i.jsx("img",{src:t.image_url,alt:"",className:"w-full h-full object-cover",loading:"lazy"}):i.jsx(vs,{className:"w-8 h-8 text-slate-600 m-auto"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-white line-clamp-1",children:t==null?void 0:t.title}),i.jsxs("div",{className:"text-indigo-400 font-bold mt-1",children:["€",t==null?void 0:t.price.toFixed(2)]})]})]}),y?i.jsx(ue,{onClick:F,disabled:a,className:"w-full bg-green-600 hover:bg-green-700 text-white h-12 text-lg font-bold shadow-lg shadow-green-900/20",children:a?i.jsxs(i.Fragment,{children:[i.jsx(dr,{className:"w-5 h-5 mr-2 animate-spin"})," Processing..."]}):i.jsxs(i.Fragment,{children:["Pay & Play Now ",i.jsx(no,{className:"w-4 h-4 ml-2 opacity-70"})]})}):i.jsxs("div",{className:"text-center space-y-3",children:[i.jsx("p",{className:"text-slate-300 text-sm",children:"Please log in to purchase and play."}),i.jsx(ue,{onClick:()=>ae.auth.redirectToLogin(),className:"w-full bg-indigo-600 hover:bg-indigo-700",children:"Log In to Continue"})]}),i.jsx("p",{className:"text-center text-xs text-slate-500 mt-4",children:"Secure payment via Stripe. Game opens immediately after payment."})]}),t&&i.jsx("div",{className:"px-6 pb-8 max-h-[40vh] overflow-y-auto",children:i.jsx(D3e,{targetId:t.id,targetType:"game",currentUser:y})})]})}),r&&i.jsx(fN,{event:r,isOpen:!!r,onClose:()=>s(null),currentUser:y,onPurchase:I}),i.jsx(I3e,{open:l,onOpenChange:c})]})}function $3e(){return i.jsxs(Me,{className:"overflow-hidden",children:[i.jsx(gr,{className:"h-48 w-full"}),i.jsxs("div",{className:"p-6 space-y-4",children:[i.jsx(gr,{className:"h-8 w-3/4"}),i.jsx(gr,{className:"h-4 w-full"}),i.jsx(gr,{className:"h-4 w-5/6"}),i.jsxs("div",{className:"flex gap-2 mt-4",children:[i.jsx(gr,{className:"h-6 w-20"}),i.jsx(gr,{className:"h-6 w-24"})]}),i.jsx(gr,{className:"h-10 w-full mt-4"})]})]})}function HY(){const[e,t]=O.useState(!1);O.useEffect(()=>{localStorage.getItem("quick_actions_hint_seen")||setTimeout(()=>t(!0),2e3)},[]);const n=()=>{localStorage.setItem("quick_actions_hint_seen","true"),t(!1)};return i.jsx(Gs,{children:e&&i.jsxs(rt.div,{initial:{y:100,opacity:0}
1076,animate:{y:0,opacity:1},exit:{y:100,opacity:0},className:"fixed bottom-20 left-4 right-4 md:left-auto md:right-4 md:w-96 z-40 bg-gradient-to-br from-indigo-600 to-purple-600 rounded-2xl shadow-2xl p-5 text-white",children:[i.jsx("button",{onClick:n,className:"absolute top-3 right-3 text-white/70 hover:text-white",children:i.jsx(Si,{className:"w-5 h-5"})}),i.jsxs("div",{className:"mb-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(oM,{className:"w-5 h-5 animate-bounce"}),i.jsx("h3",{className:"font-bold text-lg",children:"Quick Actions"})]}),i.jsx("p",{className:"text-white/90 text-sm leading-relaxed",children:"On mobile, try these gestures on cards:"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-3 bg-white/10 rounded-lg p-3",children:[i.jsx(X1,{className:"w-5 h-5 flex-shrink-0"}),i.jsx("span",{className:"text-sm",children:"Swipe right to share"})]}),i.jsxs("div",{className:"flex items-center gap-3 bg-white/10 rounded-lg p-3",children:[i.jsx(uu,{className:"w-5 h-5 flex-shrink-0"}),i.jsx("span",{className:"text-sm",children:"Swipe left for quick buy"})]}),i.jsxs("div",{className:"flex items-center gap-3 bg-white/10 rounded-lg p-3",children:[i.jsx(oM,{className:"w-5 h-5 flex-shrink-0"}),i.jsx("span",{className:"text-sm",children:"Long press for more options"})]})]}),i.jsx("button",{onClick:n,className:"w-full mt-4 bg-white text-indigo-600 font-bold py-2 rounded-lg hover:bg-white/90 transition-colors",children:"Got it!"})]})})}const q3e=({raffle:e,isOpen:t,onClose:n,currentUser:r,onPurchase:s,existingTicketCount:a})=>{const[o,l]=O.useState(1),[c,u]=O.useState(!1),[h,d]=O.useState(null);se.useEffect(()=>{t&&(l(1),u(!1),d(null))},[t]);const m=e.max_tickets_per_person&&e.max_tickets_per_person>0?Math.max(0,e.max_tickets_per_person-a):50,g=y=>{let _=e.ticket_price,N=!1;if(e.pricing_tiers&&e.pricing_tiers.length>0){const j=e.pricing_tiers.filter(S=>y>=S.min_tickets).filter(S=>!S.valid_from||new Date(S.valid_from)<=new Date).filter(S=>!S.valid_until||new Date(S.valid_until)>=new Date).sort((S,C)=>C.min_tickets-S.min_tickets);j.length>0&&(_=j[0].price_per_ticket,N=!0)}return{total:_*y,unitPrice:_,discountApplied:N}},{total:w,unitPrice:v,discountApplied:b}=g(o);return i.jsx(rn,{open:t,onOpenChange:n,children:i.jsxs(en,{className:"sm:max-w-md bg-slate-900 text-white border-slate-700 [&>button]:hidden",onPointerDownOutside:y=>y.preventDefault(),children:[i.jsx("div",{className:"absolute right-0 top-0 pr-2 pt-2 z-50",children:i.jsx("button",{onClick:n,className:"p-3 rounded-full hover:bg-white/10 text-slate-400 hover:text-white transition-colors focus:outline-none","aria-label":"Close",children:i.jsx(Si,{className:"w-6 h-6"})})}),i.jsxs(vn,{children:[i.jsxs(sn,{className:"text-xl font-bold flex items-center gap-2",children:[i.jsx(Vr,{className:"w-5 h-5 text-amber-500"}),"Purchase Tickets"]}),i.jsx(Kl,{className:"text-slate-400",children:e.title})]}),e.collection_type==="venue_only"&&i.jsxs("div",{className:"bg-red-900/20 border border-red-900/50 p-3 rounded-lg flex items-start gap-3 mb-2",children:[i.jsx(js,{className:"w-5 h-5 text-red-400 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-red-400 font-bold text-sm",children:"In Venue Only Prize"}),i.jsx("p",{className:"text-red-200/70 text-xs mt-1",children:"This prize must be collected at the venue. Please ensure you can be present to claim it if you win."})]})]}),r?m===0?i.jsxs("div",{className:"py-6 text-center space-y-4",children:[i.jsxs("div",{className:"bg-amber-900/20 border border-amber-500/30 p-4 rounded-lg",children:[i.jsx("p",{className:"text-amber-400 font-bold",children:"Ticket Limit Reached"}),i.jsxs("p",{className:"text-slate-300 text-sm mt-1",children:["You have already purchased ",a," tickets, which is the maximum allowed per person for this raffle."]})]}),i.jsx(ue,{onClick:n,className:"w-full bg-slate-700 hover:bg-slate-600",children:"Close"})]}):i.jsxs("div",{className:"py-4 space-y-6",children:[i.jsxs("div",{className:"flex flex-col items-center justify-center space-y-2",children:[i.jsxs("div",{className:"text-3xl font-bold text-amber-400 flex items-center gap-2",children:[e.ticket_price===0?"FREE":`€${w.toFixed(2)}`,b&&i.jsxs("span",{className:"text-sm font-medium text-green-500 bg-green-500/10 px-2 py-1 rounded-full animate-pulse",children:["Save €",(e.ticket_price*o-w).toFixed(2)]})]}),i.jsxs("div",{className:"text-xs text-slate-400",children:[o," ticket",o>1?"s":""," @ €",v.toFixed(2),"/ea"]}),e.max_tickets_per_person>0&&i.jsxs("div",{className:"text-xs text-amber-500 font-medium",children:["Limit: ",e.max_tickets_per_person," per person (",a," owned)"]}),e.pricing_tiers&&e.pricing_tiers.length>0&&!b&&i.jsxs("div",{className:"text-xs text-slate-500 mt-2 bg-slate-800 p-2 rounded w-full text-center",children:["Buy ",e.pricing_tiers.sort((y,_)=>
1076y.min_tickets-_.min_tickets)[0].min_tickets,"+ to get a discount!"]})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4 bg-slate-800/50 p-4 rounded-xl",children:[i.jsx(ue,{size:"icon",onClick:()=>l(Math.max(1,o-1)),className:"bg-slate-700 hover:bg-slate-600 text-white border border-slate-600 h-10 w-10",disabled:o<=1,children:i.jsx(fte,{className:"w-5 h-5"})}),i.jsx("span",{className:"text-xl font-bold w-12 text-center text-white",children:o}),i.jsx(ue,{size:"icon",onClick:()=>l(Math.min(m,o+1)),className:"bg-slate-700 hover:bg-slate-600 text-white border border-slate-600 h-10 w-10",disabled:o>=m,children:i.jsx(li,{className:"w-5 h-5"})})]}),h&&i.jsxs("div",{className:"bg-red-900/20 border border-red-900/50 p-3 rounded-lg text-red-400 text-sm flex items-center gap-2",children:[i.jsx(Sn,{className:"w-4 h-4"}),h]}),i.jsxs(ue,{onClick:()=>window.open("https://buy.stripe.com/5kA2aNdJE8AXb5K6ov","_blank"),disabled:c,className:"w-full h-12 text-lg font-semibold transition-all duration-200 transform hover:scale-[1.02] active:scale-95 text-white shadow-lg bg-[#635BFF] hover:bg-[#5851DB] hover:shadow-indigo-600/50",children:["Buy Tickets on Stripe ",i.jsx(no,{className:"w-4 h-4 ml-2 opacity-70"})]}),e.ticket_price>0&&i.jsx("p",{className:"text-center text-xs text-slate-500",children:"Secure payment processing powered by Stripe"})]}):i.jsxs("div",{className:"space-y-6 py-6",children:[i.jsxs("div",{className:"text-center space-y-2",children:[i.jsx("p",{className:"text-slate-200 text-lg font-medium",children:"Sign in to purchase tickets"}),i.jsx("p",{className:"text-slate-400 text-sm",children:"Safe, secure, and instant"})]}),i.jsxs("div",{className:"bg-slate-800/50 rounded-lg p-4 space-y-2 border border-slate-700/50",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-300",children:[i.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Google-secured login"]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-300",children:[i.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"We never share your information"]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-300",children:[i.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Secure payment processing"]})]}),i.jsx(ue,{onClick:()=>ae.auth.redirectToLogin(),className:"w-full bg-indigo-600 hover:bg-indigo-700 h-12 text-base font-semibold",children:"Continue with Google"})]})]})})},z3e=({targetDate:e})=>{const[t,n]=O.useState("");return O.useEffect(()=>{if(!e)return;const r=()=>{const a=new Date(e)-new Date;if(a<=0){n("Draw Starting Soon");return}const o=Math.floor(a/(1e3*60*60*24)),l=Math.floor(a/(1e3*60*60)%24),c=Math.floor(a/1e3/60%60),u=Math.floor(a/1e3%60);o>0?n(`${o}d ${l}h ${c}m ${u}s`):l>0?n(`${l}h ${c}m ${u}s`):n(`${c}m ${u}s`)};r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[e]),e?i.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold bg-amber-100 text-amber-800 px-2 py-1 rounded-md",children:[i.jsx(rs,{className:"w-3 h-3"}),t]}):null},Al={LIGHT:10,MEDIUM:20,HEAVY:50,SUCCESS:[10,50,10],ERROR:[50,100,50],WARNING:[30,50,30],SELECTION:5,IMPACT:15,NOTIFICATION:[10,20,10,20,10]};function yb(){const e=O.useCallback((t=Al.LIGHT)=>{if(navigator.vibrate)try{navigator.vibrate(t)}
1076catch{}},[]);return{light:()=>e(Al.LIGHT),medium:()=>e(Al.MEDIUM),heavy:()=>e(Al.HEAVY),success:()=>e(Al.SUCCESS),error:()=>e(Al.ERROR),warning:()=>e(Al.WARNING),selection:()=>e(Al.SELECTION),impact:()=>e(Al.IMPACT),notification:()=>e(Al.NOTIFICATION),trigger:e}}function KY({children:e,onSwipeLeft:t,onSwipeRight:n,leftAction:r,rightAction:s,swipeThreshold:a=100}){const[o,l]=O.useState(!1),c=$W(0),u=GS(c,[-200,0,200],[.5,1,.5]),h=GS(c,[0,100],[0,1]),d=GS(c,[-100,0],[1,0]),m=yb(),g=()=>{l(!0)},w=(v,b)=>{l(!1),Math.abs(b.offset.x)>a&&(m.impact(),b.offset.x<0&&t?t():b.offset.x>0&&n&&n())};return i.jsxs("div",{className:"relative overflow-hidden",children:[s&&i.jsx(rt.div,{className:"absolute left-0 top-0 bottom-0 w-24 bg-gradient-to-r from-green-500 to-transparent flex items-center justify-start pl-4 z-0",style:{opacity:h},children:i.jsx("div",{className:"text-white",children:s.icon})}),r&&i.jsx(rt.div,{className:"absolute right-0 top-0 bottom-0 w-24 bg-gradient-to-l from-blue-500 to-transparent flex items-center justify-end pr-4 z-0",style:{opacity:d},children:i.jsx("div",{className:"text-white",children:r.icon})}),i.jsx(rt.div,{drag:"x",dragConstraints:{left:0,right:0},dragElastic:.2,onDragStart:g,onDragEnd:w,style:{x:c,opacity:u},className:"relative z-10",children:e})]})}function GY({children:e,actions:t,disabled:n=!1}){const[r,s]=O.useState(!1),[a,o]=O.useState({x:0,y:0}),l=O.useRef(null),c=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),u=yb(),h=w=>{if(n||!c)return;const v=w.touches[0];o({x:v.clientX,y:v.clientY}),l.current=setTimeout(()=>{u.medium(),s(!0)},500)},d=()=>{l.current&&clearTimeout(l.current)},m=()=>{l.current&&clearTimeout(l.current)},g=w=>{u.light(),s(!1),w.handler()};return i.jsxs(i.Fragment,{children:[i.jsx("div",{onTouchStart:h,onTouchEnd:d,onTouchMove:m,className:"relative",children:e}),i.jsx(Gs,{children:r&&i.jsxs(i.Fragment,{children:[i.jsx(rt.div,{initial:{opacity:0}
1076,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 z-50",onClick:()=>s(!1)}),i.jsx(rt.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},style:{position:"fixed",left:Math.min(a.x,window.innerWidth-200),top:Math.min(a.y,window.innerHeight-t.length*50)},className:"z-50",children:i.jsx(Me,{className:"p-2 min-w-[180px] shadow-2xl border-slate-200 bg-white",children:t.map((w,v)=>i.jsxs("button",{onClick:()=>g(w),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-slate-100 rounded-lg transition-colors text-left",children:[i.jsx("div",{className:w.color||"text-slate-700",children:w.icon}),i.jsx("span",{className:"text-sm font-medium text-slate-900",children:w.label})]},v))})})]})})]})}const B3e=({raffle:e,onPurchase:t,onQuickBuy:n,takeYourPickState:r})=>{const[s,a]=O.useState(!1),[o,l]=O.useState(!1),[c,u]=O.useState(!1),[h,d]=O.useState(!1),m=yb(),g=e.draw_date&&new Date>=new Date(e.draw_date),w=async()=>{m.light(),a(!0);try{await n(e,1),m.success()}catch(_){m.error(),console.error(_)}finally{a(!1)}},v=`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(`${window.location.origin}${window.location.pathname}?buy=${e.id}`)}`,b=()=>{m.light();const _=`${window.location.origin}${window.location.pathname}?buy=${e.id}`;navigator.share?navigator.share({title:e.title,text:`Check out this raffle: ${e.title}`,url:_}):(navigator.clipboard.writeText(_),tt.success("Raffle link copied to clipboard!"))},y=[{icon:i.jsx(ej,{className:"w-4 h-4"}),label:"Buy Tickets",handler:()=>t(e),color:"text-blue-600"},...e.ticket_price>0?[{icon:i.jsx(Kc,{className:"w-4 h-4"}),label:"Quick Buy (1x)",handler:w,color:"text-amber-600"}]:[],{icon:i.jsx(du,{className:"w-4 h-4"}),label:c?"Close Image":"View Image",handler:()=>u(!c),color:"text-purple-600"},{icon:i.jsx(Ho,{className:"w-4 h-4"}),label:"Share Raffle",handler:b,color:"text-green-600"}];return i.jsx(GY,{actions:y,disabled:e.status!=="active"||g,children:i.jsx(KY,{onSwipeLeft:()=>e.status==="active"&&!g&&w(),onSwipeRight:()=>b(),leftAction:{icon:i.jsx(Kc,{className:"w-6 h-6"})},rightAction:{icon:i.jsx(Ho,{className:"w-6 h-6"})},children:i.jsxs(Me,{className:"bg-white border-slate-200 overflow-hidden hover:shadow-2xl hover:border-indigo-300 transition-all duration-300 flex flex-col h-full relative",children:[i.jsxs("div",{className:"h-48 bg-slate-100 relative overflow-hidden group",children:[o?i.jsx("div",{className:"w-full h-full flex items-center justify-center bg-white p-4",children:i.jsx("img",{src:v,alt:"Scan to Buy",className:"h-full object-contain cursor-zoom-in",onDoubleClick:()=>d(!0),loading:"lazy"})}):e.image_url?i.jsx("img",{src:e.image_url,alt:e.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500 cursor-zoom-in",onDoubleClick:()=>u(!0),loading:"lazy"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center bg-slate-200",children:i.jsx(Jt,{className:"w-16 h-16 text-slate-400"})}),i.jsxs("div",{className:"absolute top-3 right-3 flex flex-col gap-2 items-end pointer-events-none",children:[i.jsxs("div",{className:"flex flex-col items-end gap-2",children:[e.collection_type==="venue_only"&&i.jsxs(nt,{className:"bg-red-500 hover:bg-red-600 text-white shadow-md flex items-center gap-1",children:[i.jsx(js,{className:"w-3 h-3"})," In Venue Only"]}),i.jsx(nt,{className:`${e.ticket_price===0?"bg-green-500 hover:bg-green-600":"bg-amber-500 hover:bg-amber-600"} text-white text-md px-3 py-1 shadow-md`,children:e.ticket_price===0?"FREE":`€${e.ticket_price}`})]}),!o&&e.status==="active"&&e.draw_date&&i.jsx(z3e,{targetDate:e.draw_date})]}),i.jsx("div",{className:"absolute top-3 left-3",children:i.jsx(ue,{size:"icon",variant:"secondary",className:"bg-white/80 hover:bg-white backdrop-blur-sm shadow-sm h-8 w-8",onClick:_=>{_.stopPropagation(),l(!o)},title:o?"Show Image":"Show QR Code",children:o?i.jsx(Jt,{className:"w-4 h-4 text-slate-700"}):i.jsx(oB,{className:"w-4 h-4 text-slate-700"})})})]}),i.jsx(st,{children:i.jsx(at,{className:"text-xl text-slate-900",children:e.title})}),i.jsxs(Fe,{className:"flex-1",children:[e.type==="take_your_pick"&&(r==null?void 0:r.state)&&i.jsxs("div",{className:"mb-3 space-y-2",children:[i.jsxs("div",{className:"p-3 bg-purple-100 border border-purple-200 rounded-xl text-center animate-pulse cursor-pointer hover:bg-purple-200 transition-colors",children:[i.jsx("div",{className:"text-xs font-bold text-purple-600 uppercase tracking-widest",children:"Current Jackpot"}),i.jsxs("div",{className:"text-3xl font-black text-purple-900",children:["€",((r.state.current_jackpot||0)+(r.state.active_raffle_id===e.id&&r.currentRaffleSales||0)).toFixed(2)]})]}),i.jsx("div",{className:"text-center",children:i.jsxs("span",{className:"text-xs text-purple-600 font-semibold bg-purple-50 px-2 py-1 rounded-md",children:[r.state.envelopes.filter(_=>_.status==="available").length," Envelopes Remaining"]})})]}),i.jsx("p",{className:"text-slate-600 text-sm line-clamp-3",children:e.description}),e.draw_date&&i.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs text-slate-500 font-medium",children:[i.jsx(Fn,{className:"w-3 h-3"}),i.jsxs("span",{children:["Draws on: ",Ut(new Date(e.draw_date),"MMM d, yyyy 'at' h:mm a")]})]}),e.winning_tickets&&e.winning_tickets.length>0&&i.jsxs("div",{className:"mt-4 p-3 bg-green-50 border border-green-100 rounded-lg",children:[i.jsxs("p",{className:"text-xs font-bold text-green-700 uppercase mb-1 flex items-center gap-1",children:[i.jsx(Jt,{className:"w-3 h-3"})," Latest Winner"]}),i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"font-mono font-bold text-green-800",children:e.winning_tickets[e.winning_tickets.length-1].ticket_code}),i.jsxs("span",{className:"text-green-600",children:["Prize #",e.winning_tickets[e.winning_tickets.length-1].prize_rank]})]})]})]}),i.jsx(h4,{className:"pt-0 gap-2",children:e.status==="active"&&!g?i.jsxs(i.Fragment,{children:[i.jsx(ue,{onClick:()=>t(e),className:`flex-1 text-white font-semibold transition-all duration-200 hover:scale-[1.02] active:scale-95 ${e.t
1076icket_price===0?"bg-green-600 hover:bg-green-700 shadow-lg hover:shadow-green-600/40":"bg-slate-900 hover:bg-slate-800 shadow-lg hover:shadow-slate-900/40"}`,children:e.ticket_price===0?"Claim":"Buy Tickets"}),e.ticket_price>0&&i.jsx(ue,{onClick:w,disabled:s,variant:"outline",className:"border-slate-200 hover:bg-amber-50 hover:border-amber-300 text-amber-700 hover:shadow-md transition-all duration-200",title:"Quick Buy 1 Ticket",children:s?i.jsx(dr,{className:"w-4 h-4 animate-spin"}):i.jsx(Kc,{className:"w-4 h-4"})})]}):i.jsx(ue,{disabled:!0,className:"w-full bg-slate-100 text-slate-400",children:g?"Sales Closed (Draw pending)":"Raffle Closed"})}),e.image_url&&i.jsx(rn,{open:c,onOpenChange:u,children:i.jsxs(en,{className:"max-w-5xl p-0 bg-transparent border-none shadow-none overflow-hidden flex items-center justify-center z-[10020]",onInteractOutside:_=>_.preventDefault(),children:[i.jsxs(sn,{className:"sr-only",children:[e.title," Full Image"]}),i.jsxs(Kl,{className:"sr-only",children:["Full size image of ",e.title]}),i.jsx("div",{className:"relative w-full h-full flex items-center justify-center",onClick:()=>u(!1),children:i.jsx("img",{src:e.image_url,alt:e.title,className:"max-w-[90vw] max-h-[90vh] object-contain rounded-lg shadow-2xl cursor-zoom-out",loading:"lazy"})})]})}),i.jsx(rn,{open:h,onOpenChange:d,children:i.jsxs(en,{className:"max-w-lg p-0 bg-transparent border-none shadow-none overflow-hidden flex items-center justify-center z-[10020]",onInteractOutside:_=>_.preventDefault(),children:[i.jsxs(sn,{className:"sr-only",children:[e.title," QR Code"]}),i.jsxs(Kl,{className:"sr-only",children:["Large QR code for ",e.title]}),i.jsx("div",{className:"relative w-full h-full flex items-center justify-center",onClick:()=>d(!1),children:i.jsx("div",{className:"bg-white p-4 rounded-xl",children:i.jsx("img",{src:v,alt:"Scan to Buy",className:"w-[80vw] max-w-[400px] h-auto object-contain cursor-zoom-out",loading:"lazy"})})})]})})]})})})},U3e=({tickets:e,raffles:t})=>{const n=e.filter(r=>t.some(s=>s.id===r.raffle_id));return n.length===0?null:i.jsxs("div",{className:"mt-12 bg-white rounded-2xl p-6 border border-slate-200 shadow-sm",children:[i.jsxs("h3",{className:"text-lg font-bold text-slate-900 mb-4 flex items-center gap-2",children:[i.jsx(Vr,{className:"w-5 h-5 text-indigo-600"})," My Tickets"]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:n.map(r=>{const s=t.find(c=>c.id===r.raffle_id),a=r.is_winner,o=(s==null?void 0:s.status)==="active",l=(s==null?void 0:s.type)==="take_your_pick";return i.jsxs("div",{className:`
1077                          relative p-4 rounded-xl border 
1078                          ${a?"bg-amber-50 border-amber-200":l?"bg-purple-50 border-purple-100":o?"bg-green-50 border-green-100":"bg-slate-50 border-slate-100"}
1079                      `,children:[i.jsx("div",{className:"absolute -top-2 -right-2",children:a?i.jsx(nt,{className:"bg-amber-500 text-white animate-pulse shadow-md border-2 border-white",children:"WINNER"}):o?i.jsx(nt,{className:`${l?"bg-purple-500":"bg-green-500"} text-white shadow-md border-2 border-white`,children:l?"IN PLAY":"ACTIVE"}):i.jsx(nt,{variant:"secondary",className:"bg-slate-200 text-slate-500 border-2 border-white",children:"CLOSED"})}),i.jsx("div",{className:"text-xs font-medium text-slate-500 mb-1 truncate pr-4",children:(s==null?void 0:s.title)||"Unknown Raffle"}),i.jsx("div",{className:"text-xl font-mono font-bold text-slate-800 tracking-wider",children:r.ticket_code}),i.jsx("div",{className:"text-xs text-slate-400 mt-2 flex justify-between items-center",children:i.jsx("span",{children:Ut(new Date(r.purchase_date),"MMM d, HH:mm")})})]},r.id)})})]})};function D8({state:e,isLoading:t,onPurchase:n}){const r=(e==null?void 0:e.state)||e,s=(e==null?void 0:e.currentRaffleSales)||0,a=((r==null?void 0:r.current_jackpot)||0)+s,{data:o}=qe({queryKey:["raffle",r==null?void 0:r.active_raffle_id],queryFn:async()=>r!=null&&r.active_raffle_id?(await ae.entities.Raffle.filter({id:r.active_raffle_id}))[0]:null,enabled:!!(r!=null&&r.active_raffle_id),staleTime:6e4});return t?i.jsx("div",{className:"flex justify-center p-8",children:i.jsx(dr,{className:"animate-spin w-8 h-8 text-purple-500"})}):e?i.jsx("div",{className:"w-full max-w-4xl mx-auto",children:i.jsxs(Me,{className:"border-purple-200 bg-gradient-to-b from-purple-50 to-white overflow-hidden shadow-xl",children:[i.jsxs(st,{className:"text-center bg-purple-900 text-white py-8 relative overflow-hidden",children:[i.jsx("div",{className:"absolute top-0 left-0 w-full h-full opacity-10 bg-[url('https://www.transparenttextures.com/patterns/cubes.png')]"}),i.jsx(at,{className:"text-3xl md:text-5xl font-black uppercase tracking-widest relative z-10 text-transparent bg-clip-text bg-gradient-to-r from-amber-200 via-white to-amber-200 drop-shadow-sm",children:"Take Your Pick"}),i.jsx("div",{className:"mt-4 relative z-10",children:i.jsxs("div",{className:"inline-block bg-black/30 backdrop-blur-md rounded-2xl p-4 border border-white/10",children:[i.jsx("div",{className:"text-xs md:text-sm font-bold text-purple-200 uppercase tracking-[0.2em] mb-1",children:"Current Jackpot"}),i.jsxs("div",{className:"text-4xl md:text-6xl font-black text-white drop-shadow-[0_4px_4px_rgba(0,0,0,0.5)]",children:["€",a.toFixed(2)]})]})})]}),i.jsxs(Fe,{className:"p-6 md:p-8",children:[i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 md:gap-6",children:r.envelopes.sort((l,c)=>l.id-c.id).map(l=>i.jsx("div",{className:`
1080                                    aspect-[3/4] rounded-xl border-2 flex flex-col items-center justify-center p-2 transition-all duration-500 relative
1081                                    ${l.status==="available"?"bg-white border-purple-200 shadow-lg transform hover:scale-105 z-10":"bg-slate-100 border-slate-200 grayscale opacity-60 z-0"}
1082                                `,children:l.status==="available"?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"absolute top-2 left-2 text-purple-200",children:i.jsx(sB,{className:"w-6 h-6"})}),i.jsx("div",{className:"text-4xl md:text-5xl font-black text-purple-900 font-mono",children:l.id}),i.jsx("div",{className:"mt-2 px-3 py-1 bg-purple-100 text-purple-800 text-xs font-bold rounded-full",children:"OPEN"})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-20",children:l.result==="jackpot"?i.jsx(Jt,{className:"w-24 h-24 text-yellow-500"}):i.jsx(ya,{className:"w-24 h-24 text-slate-500"})}),i.jsxs("div",{className:"relative z-10 text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-slate-400 line-through decoration-2 decoration-red-500",children:l.id}),i.jsx(nt,{variant:"outline",className:"mt-2 bg-slate-200 border-slate-300 text-slate-500",children:l.result==="jackpot"?"WON":"GONE"})]})]})},l.id))}),i.jsxs("div",{className:"mt-8 flex flex-col items-center gap-4",children:[o&&o.status==="active"?i.jsxs("div",{className:"bg-purple-100 p-4 rounded-xl border border-purple-200 w-full max-w-md",children:[i.jsxs("div",{className:"flex items-center justify-between gap-4 mb-3",children:[i.jsxs("div",{className:"text-left",children:[i.jsx("div",{className:"font-bold text-purple-900",children:"Play for the Jackpot!"}),i.jsxs("div",{className:"text-xs text-purple-700",children:["Entry via ",i.jsx("strong",{children:o.title})]})]}),i.jsxs("div",{className:"text-xl font-black text-purple-900",children:["€",o.ticket_price]})]}),i.jsxs(ue,{onClick:()=>n&&n(o),className:"w-full bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-700 hover:to-indigo-700 text-white font-bold shadow-lg transform hover:scale-[1.02] transition-all",size:"lg",children:[i.jsx(Vr,{className:"w-5 h-5 mr-2"}),"Buy Ticket & Increase Jackpot"]}),i.jsxs("div",{className:"flex items-center justify-center gap-2 mt-2 text-[10px] text-purple-500 uppercase font-bold tracking-wider",children:[i.jsx(Kc,{className:"w-3 h-3 animate-pulse"}),"Jackpot updates in real-time"]})]}):i.jsxs("div",{className:"text-center p-4 bg-slate-100 rounded-xl",children:[i.jsx("p",{className:"text-slate-500 font-medium",children:"Ticket sales are currently closed for this week."}),i.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Check back later for the next draw!"})]}),i.jsx("p",{className:"text-slate-500 text-xs text-center max-w-md",children:"One envelope is removed each week until the Jackpot is won! Buy a ticket for the weekly raffle to be the one who picks."})]})]})]})}):null}function V3e(){const e=mn(),[t,n]=O.useState(null),[r,s]=O.useState(!1),[a,o]=O.useState(null),[l,c]=O.useState(!1),{data:u}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me().catch(()=>null)}),{data:h=[],isLoading:d}=qe({queryKey:["raffles"],queryFn:async()=>(await ae.entities.Raffle.list()).sort((N,j)=>N.status==="active"&&j.status!=="active"?-1:N.status!=="active"&&j.status==="active"?1:new Date(j.created_date)-new Date(N.created_date)),refetchInterval:1e4,staleTime:5e3}),{data:m,isLoading:g}=qe({queryKey:["takeYourPickState"],queryFn:async()=>{try{return(await ae.functions.invoke("takeYourPick",{action:"get_state"})).data}catch{return null}},refetchInterval:5e3}),{data:w=[]}=qe({queryKey:["myTickets",u==null?void 0:u.id],queryFn:()=>ae.entities.RaffleTicket.filter({user_id:u==null?void 0:u.id}),enabled:!!u,select:_=>_.sort((N,j)=>new Date(j.purchase_date)-new Date(N.purchase_date)),staleTime:5e3,gcTime:6e4});O.useEffect(()=>{const _=new URLSearchParams(window.location.search),N=_.get("session_id"),j=_.get("success"),S=_.get("
1082canceled"),C=_.get("buy");if(N&&j==="true"&&!a&&(v(N),window.history.replaceState({},"",window.location.pathname)),S==="true"&&window.history.replaceState({},"",window.location.pathname),C&&h.length>0&&!t){const P=h.find(A=>A.id===C);P&&(y(P),window.history.replaceState({},"",window.location.pathname))}},[a,h]);const v=async _=>{var N,j;o("verifying");try{let S=0;const C=5;for(;S<C;){try{const P=await ae.functions.invoke("payment",{action:"verifySession",sessionId:_});if((N=P.data)!=null&&N.success||((j=P.data)==null?void 0:j.message)==="Tickets already generated"){o("success"),e.invalidateQueries(["myTickets"]),tt.success("Payment verified! Your tickets are ready.");return}}catch(P){console.warn("Verification attempt failed, retrying...",P)}await new Promise(P=>setTimeout(P,2e3)),S++}throw new Error("Verification timed out")}catch(S){console.error("Verification failed",S),o("error"),tt.error("Payment verification delayed. Your tickets will appear shortly.")}},b=async(_,N)=>{var j,S,C;if(!u){ae.auth.redirectToLogin();return}try{if(_.ticket_price===0){const I=await ae.functions.invoke("payment",{action:"claimFreeTickets",raffleId:_.id,quantity:N,userId:u.id,userEmail:u.email});if((j=I.data)!=null&&j.error)throw new Error(I.data.error);await Promise.all([e.invalidateQueries(["myTickets"]),e.invalidateQueries(["raffles"])]),s(!1),o("success"),tt.success("Free tickets claimed successfully!");return}const P=`${window.location.origin}${window.location.pathname}?success=true&session_id={CHECKOUT_SESSION_ID}`,A=`${window.location.origin}${window.location.pathname}?canceled=true`,F=await ae.functions.invoke("payment",{action:"createSession",raffleId:_.id,quantity:N,userId:u.id,userEmail:u.email,successUrl:P,cancelUrl:A});if((S=F.data)!=null&&S.url)window.location.href=F.data.url;else throw new Error(((C=F.data)==null?void 0:C.error)||"Failed to create checkout session")}catch(P){throw console.error("Purchase error:",P),tt.error(P.message||"Failed to process purchase. Please try again."),P}},y=_=>{n(_),s(!0)};return i.jsxs(i.Fragment,{children:[i.jsx(ao,{pageName:"RaffleTickets"}),i.jsx(HY,{}),i.jsxs(Gs,{children:[a==="verifying"&&i.jsx(rt.div,{initial:{opacity:0}
1082,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-50 bg-slate-900/95 backdrop-blur-md flex items-center justify-center",children:i.jsxs(rt.div,{initial:{scale:.95,y:20},animate:{scale:1,y:0},transition:{duration:.3,ease:[.4,0,.2,1]},className:"text-center text-white",children:[i.jsx(dr,{className:"w-16 h-16 animate-spin mx-auto mb-6 text-amber-400"}),i.jsx("h2",{className:"text-3xl font-bold mb-2",children:"Verifying Payment..."}),i.jsx("p",{className:"text-slate-300 text-lg",children:"Generating your lucky tickets"})]})}),a==="success"&&i.jsx(rt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-50 bg-slate-900/95 backdrop-blur-md flex items-center justify-center p-4",onClick:()=>o(null),children:i.jsxs(rt.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},transition:{duration:.3,ease:[.4,0,.2,1]},onClick:_=>_.stopPropagation(),className:"bg-white text-slate-900 p-8 rounded-2xl max-w-md w-full text-center shadow-2xl",children:[i.jsx(rt.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,type:"spring",stiffness:200},className:"w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:i.jsx(Cn,{className:"w-10 h-10 text-green-600"})}),i.jsx("h2",{className:"text-3xl font-bold mb-3",children:"Purchase Successful!"}),i.jsx("p",{className:"text-slate-600 mb-6 text-lg",children:"Your tickets have been added to your account."}),i.jsx(ue,{onClick:()=>o(null),className:"w-full bg-slate-900 hover:bg-slate-800 text-white h-12 text-base",children:"View My Tickets"})]})}),a==="error"&&i.jsx(rt.div,{initial:{opacity:0}
1082,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-slate-900/90 backdrop-blur flex items-center justify-center",onClick:()=>o(null),children:i.jsxs("div",{className:"bg-white text-slate-900 p-8 rounded-2xl max-w-md text-center shadow-2xl",children:[i.jsx("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4",children:i.jsx(Sn,{className:"w-8 h-8 text-red-600"})}),i.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Verification Issue"}),i.jsx("p",{className:"text-slate-600 mb-6",children:"We couldn't verify the payment automatically right now. Please check your tickets in a moment or contact support."}),i.jsx(ue,{onClick:()=>o(null),className:"w-full bg-slate-900 text-white",children:"Close"})]})})]}),i.jsxs("div",{className:"min-h-screen bg-slate-50 pb-12",children:[i.jsx("div",{className:"bg-slate-900 text-white py-16 px-6 text-center",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx(nt,{variant:"outline",className:"mb-4 border-amber-500 text-amber-400",children:"Official League Raffles"}),i.jsx("h1",{className:"text-4xl md:text-5xl font-black tracking-tight mb-4",children:"Win Big with LiveQuizzing's E-Raffle Tickets"}),i.jsx("p",{className:"text-lg text-slate-400 max-w-2xl mx-auto mb-6",children:"Purchase Raffle tickets securely for a chance to win amazing prizes."}),i.jsxs("div",{className:"relative inline-block",children:[i.jsxs("button",{className:"flex items-center gap-2 mx-auto text-amber-400 hover:text-amber-300 transition-colors font-medium text-sm bg-white/10 px-4 py-2 rounded-full border border-amber-500/30 hover:bg-white/20",onClick:()=>c(!0),children:[i.jsx(iB,{className:"w-4 h-4"}),i.jsx("span",{children:"How do E-Tickets work?"})]}),i.jsx(Gs,{children:l&&i.jsxs(i.Fragment,{children:[i.jsx(rt.div,{initial:{opacity:0}
1082,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 z-[60]",onClick:()=>c(!1)}),i.jsxs(rt.div,{initial:{opacity:0,scale:.9,y:"-40%",x:"-50%"},animate:{opacity:1,scale:1,y:"-50%",x:"-50%"},exit:{opacity:0,scale:.9,y:"-40%",x:"-50%"},className:"fixed left-1/2 top-1/2 w-80 sm:w-96 bg-white text-slate-900 p-6 rounded-xl shadow-2xl z-[61] text-left border border-slate-200",children:[i.jsxs("h4",{className:"font-bold text-indigo-900 mb-3 flex items-center gap-2 text-lg",children:[i.jsx(Cn,{className:"w-5 h-5 text-green-500"}),"100% Secure & Automated"]}),i.jsx("p",{className:"text-slate-600 leading-relaxed",children:"Every ticket is generated with a unique code and instantly linked to your account. We store them safely for you, so there's no risk of losing them. Winners are tracked and verified automatically!"}),i.jsx(ue,{onClick:()=>c(!1),className:"w-full mt-6 bg-slate-900 text-white",children:"Got it"})]})]})})]})]})}),i.jsx("div",{className:"max-w-7xl mx-auto px-6 -mt-8",children:d?i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[...Array(3)].map((_,N)=>i.jsx($3e,{},N))}):i.jsxs(i.Fragment,{children:[h.length>0?i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:h.map(_=>i.jsx(B3e,{raffle:_,onPurchase:y,onQuickBuy:b,takeYourPickState:_.type==="take_your_pick"?m:null},_.id))}):i.jsxs("div",{className:"bg-white p-8 rounded-2xl text-center shadow-sm border border-slate-100",children:[i.jsx(Jt,{className:"w-12 h-12 text-slate-300 mx-auto mb-4"}),i.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"No Raffles Active"}),i.jsx("p",{className:"text-slate-500",children:"Check back later for new prize draws."})]}),m&&i.jsxs("div",{className:"mt-12",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsx("h2",{className:"text-2xl font-bold text-slate-900",children:"Take Your Pick Status"}),i.jsxs(rn,{children:[i.jsx(bg,{asChild:!0,children:i.jsx(ue,{variant:"outline",className:"text-purple-600 border-purple-200 hover:bg-purple-50",children:"View Full Board"})}),i.jsx(en,{className:"max-w-5xl p-0 bg-transparent border-none shadow-none",children:i.jsx(D8,{state:m,onPurchase:_=>{y(_)}})})]})]}),i.jsx("div",{className:"opacity-100 transition-opacity",children:i.jsx(D8,{state:m,onPurchase:y})})]}),u&&i.jsx(U3e,{tickets:w,raffles:h})]})})]}),t&&i.jsx(q3e,{raffle:t,isOpen:r,onClose:()=>s(!1),currentUser:u,onPurchase:b,existingTicketCount:w.filter(_=>_.raffle_id===t.id).length})]})}function W3e(){const[e,t]=O.useState(""),[n,r]=O.useState("all"),{data:s=[]}=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list()}),{data:a=[]}=qe({queryKey:["questionResults"],queryFn:()=>ae.entities.QuestionResult.list()}),o=[...s].sort((y,_)=>(y.team_name||"").localeCompare(_.team_name||"")),l=O.useMemo(()=>{if(!e)return[];let y=a.filter(_=>_.team_id===e);if(n!=="all"){const _=new Date;n==="month"&&_.setMonth(_.getMonth()-1),n==="3months"&&_.setMonth(_.getMonth()-3),n==="6months"&&_.setMonth(_.getMonth()-6),y=y.filter(N=>new Date(N.quiz_date)>=_)}return y.filter(_=>_.category&&_.category!=="Unassigned")},[e,a,n]),c=O.useMemo(()=>{const y={};return l.forEach(_=>{const N=_.category||"Unassigned";y[N]||(y[N]={correct:0,total:0,totalTime:0,timeCount:0}),y[N].total++,_.correct&&y[N].correct++,_.time_taken_seconds&&(y[N].totalTime+=_.time_taken_seconds,y[N].timeCount++)}),Object.entries(y).map(([_,N])=>({category:_,accuracy:N.total>0?(N.correct/N.total*100).toFixed(1):0,correct:N.correct,total:N.total,avgTime:N.timeCount>0?(N.totalTime/N.timeCount).toFixed(1):null})).sort((_,N)=>N.accuracy-_.accuracy)},[l]),u=O.useMemo(()=>{const y={Easy:{correct:0,total:0},Medium:{correct:0,total:0},Hard:{correct:0,total:0}};return l.forEach(_=>{const N=_.difficulty||"Medium";y[N]&&(y[N].total++,_.correct&&y[N].correct++)}),Object.entries(y).map(([_,N])=>({level:_,accuracy:N.total>0?(N.correct/N.total*100).toFixed(1):0,total:N.total})).filter(_=>_.total>0)},[l]),h=O.useMemo(()=>{const y={};return l.forEach(_=>{const N=_.quiz_date;y[N]||(y[N]={correct:0,total:0}),y[N].total++,_.correct&&y[N].correct++}),Object.entries(y).map(([_,N])=>({date:_,accuracy:N.total>0?(N.correct/N.total*100).toFixed(1):0}
1082)).sort((_,N)=>new Date(_.date)-new Date(N.date))},[l]),d=O.useMemo(()=>{const y=l.filter(S=>S.time_taken_seconds!=null);if(y.length===0)return null;const _=y.reduce((S,C)=>S+C.time_taken_seconds,0)/y.length,N=Math.min(...y.map(S=>S.time_taken_seconds)),j=Math.max(...y.map(S=>S.time_taken_seconds));return{average:_.toFixed(1),fastest:N.toFixed(1),slowest:j.toFixed(1),count:y.length}},[l]),m=s.find(y=>y.id===e),g=l.length>0?(l.filter(y=>y.correct).length/l.length*100).toFixed(1):0,w=c.slice(0,3),v=c.slice(-3).reverse(),b=c.slice(0,8).map(y=>({category:y.category.length>15?y.category.substring(0,15)+"...":y.category,accuracy:parseFloat(y.accuracy)}));return i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 p-6",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsxs("div",{className:"mb-8",children:[i.jsxs("h1",{className:"text-4xl font-bold text-slate-900 mb-2 flex items-center gap-3",children:[i.jsx(Z1,{className:"w-10 h-10 text-purple-600"}),"Team Intelligence Profiles"]}),i.jsx("p",{className:"text-slate-600",children:"Analyze team strengths, weaknesses, and performance trends based on per-question data"})]}),i.jsx(Me,{className:"mb-6",children:i.jsx(Fe,{className:"p-6",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-semibold text-slate-700",children:"Select Team"}),i.jsxs(Xt,{value:e,onValueChange:t,children:[i.jsx(Ht,{children:i.jsx(Zt,{placeholder:"Choose a team..."})}),i.jsx(Kt,{children:o.map(y=>i.jsx(Ie,{value:y.id,children:y.team_name},y.id))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-semibold text-slate-700",children:"Time Period"}),i.jsxs(Xt,{value:n,onValueChange:r,children:[i.jsx(Ht,{children:i.jsx(Zt,{})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"all",children:"All Time"}),i.jsx(Ie,{value:"month",children:"Last Month"}),i.jsx(Ie,{value:"3months",children:"Last 3 Months"}),i.jsx(Ie,{value:"6months",children:"Last 6 Months"})]})]})]})]})})}),!e&&i.jsx(Me,{children:i.jsxs(Fe,{className:"p-12 text-center",children:[i.jsx(Z1,{className:"w-16 h-16 text-slate-300 mx-auto mb-4"}),i.jsx("p",{className:"text-slate-600 text-lg",children:"Select a team to view their intelligence profile"}),i.jsx("p",{className:"text-slate-500 text-sm mt-2",children:"Per-question analytics, category strengths, and performance trends"})]})}),e&&l.length===0&&i.jsx(Me,{children:i.jsxs(Fe,{className:"p-12 text-center",children:[i.jsx(pg,{className:"w-16 h-16 text-slate-300 mx-auto mb-4"}),i.jsxs("p",{className:"text-slate-600 text-lg",children:["No categorized question data available for ",m==null?void 0:m.team_name]}),i.jsx("p",{className:"text-slate-500 text-sm mt-2",children:"Import Crowdpurr results from Admin → Intelligence, then assign categories in Admin → Mapping"})]})}),e&&l.length>0&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[i.jsxs(Me,{children:[i.jsx(st,{className:"pb-2",children:i.jsx(at,{className:"text-sm font-semibold text-slate-600",children:"Overall Accuracy"})}),i.jsxs(Fe,{children:[i.jsxs("div",{className:"text-3xl font-bold text-indigo-600",children:[g,"%"]}),i.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:[l.length," questions"]})]})]}),i.jsxs(Me,{children:[i.jsx(st,{className:"pb-2",children:i.jsx(at,{className:"text-sm font-semibold text-slate-600",children:"Categories Analyzed"})}),i.jsxs(Fe,{children:[i.jsx("div",{className:"text-3xl font-bold text-purple-600",children:c.length}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Unique categories"})]})]}),i.jsxs(Me,{children:[i.jsx(st,{className:"pb-2",children:i.jsx(at,{className:"text-sm font-semibold text-slate-600",children:"Quiz Sessions"})}),i.jsxs(Fe,{children:[i.jsx("div",{className:"text-3xl font-bold text-slate-700",children:h.length}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Total quiz dates"})]})]}),i.jsxs(Me,{children:[i.jsx(st,{className:"pb-2",children:i.jsx(at,{className:"text-sm font-semibold text-slate-600",children:"Avg Response Time"})}),i.jsx(Fe,{children:d?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"text-3xl font-bold text-green-600",children:[d.average,"s"]}
1082),i.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:[d.count," timed answers"]})]}):i.jsx("div",{className:"text-sm text-slate-500",children:"No timing data"})})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2 text-green-700",children:[i.jsx(ro,{className:"w-5 h-5"}),"Top 3 Strongest Categories"]})}),i.jsx(Fe,{children:i.jsx("div",{className:"space-y-3",children:w.map((y,_)=>i.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 rounded-lg border border-green-200",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"font-semibold text-green-900",children:y.category}),i.jsxs("div",{className:"text-xs text-green-700",children:[y.correct," / ",y.total," correct"]}),y.avgTime&&i.jsxs("div",{className:"text-xs text-green-600 mt-1",children:["⏱ Avg ",y.avgTime,"s"]})]}),i.jsxs("div",{className:"text-2xl font-bold text-green-600",children:[y.accuracy,"%"]})]},_))})})]}),i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2 text-red-700",children:[i.jsx(dB,{className:"w-5 h-5"}),"Bottom 3 Weakest Categories"]})}),i.jsx(Fe,{children:i.jsx("div",{className:"space-y-3",children:v.map((y,_)=>i.jsxs("div",{className:"flex items-center justify-between p-3 bg-red-50 rounded-lg border border-red-200",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"font-semibold text-red-900",children:y.category}),i.jsxs("div",{className:"text-xs text-red-700",children:[y.correct," / ",y.total," correct"]}),y.avgTime&&i.jsxs("div",{className:"text-xs text-red-600 mt-1",children:["⏱ Avg ",y.avgTime,"s"]})]}),i.jsxs("div",{className:"text-2xl font-bold text-red-600",children:[y.accuracy,"%"]})]},_))})})]})]}),i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(vg,{className:"w-5 h-5 text-purple-600"}),"Category Performance Breakdown"]})}),i.jsx(Fe,{children:i.jsxs(Qo,{children:[i.jsx(Yo,{children:i.jsxs(tr,{children:[i.jsx(ht,{children:"Rank"}),i.jsx(ht,{children:"Category"}),i.jsx(ht,{children:"Accuracy"}),i.jsx(ht,{children:"Correct"}),i.jsx(ht,{children:"Total"}),i.jsx(ht,{children:"Avg Time"})]})}),i.jsx(Xo,{children:c.map((y,_)=>i.jsxs(tr,{children:[i.jsx(it,{className:"font-semibold",children:_+1}),i.jsx(it,{className:"font-medium",children:y.category}),i.jsx(it,{children:i.jsxs(nt,{className:parseFloat(y.accuracy)>=70?"bg-green-100 text-green-800":parseFloat(y.accuracy)>=50?"bg-yellow-100 text-yellow-800":"bg-red-100 text-red-800",children:[y.accuracy,"%"]})}),i.jsx(it,{children:y.correct}),i.jsx(it,{children:y.total}),i.jsx(it,{children:y.avgTime?`${y.avgTime}s`:"-"})]},_))})]})})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(pg,{className:"w-5 h-5 text-indigo-600"}),"Category Accuracy"]})}),i.jsx(Fe,{children:i.jsx(Uc,{width:"100%",height:300,children:i.jsxs(N_,{data:c.slice(0,10),children:[i.jsx(Rd,{strokeDasharray:"3 3"}),i.jsx(eo,{dataKey:"category",angle:-45,textAnchor:"end",height:100,fontSize:10}),i.jsx(to,{domain:[0,100]}),i.jsx(_i,{}),i.jsx(Ql,{dataKey:"accuracy",fill:"#6366f1"})]})})})]}),b.length>3&&i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(vg,{className:"w-5 h-5 text-purple-600"}),"Strength Radar"]})}),i.jsx(Fe,{children:i.jsx(Uc,{width:"100%",height:300,children:i.jsxs(c5e,{data:b,children:[i.jsx(OG,{}),i.jsx(wv,{dataKey:"category",fontSize:10}),i.jsx(bv,{domain:[0,100]}),i.jsx(pb,{name:"Accuracy",dataKey:"accuracy",stroke:"#8b5cf6",fill:"#8b5cf6",fillOpacity:.6}),i.jsx(_i,{})]})})})]})]}),h.length>1&&i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(ro,{className:"w-5 h-5 text-green-600"}),"Accuracy Trend Over Time"]})}),i.jsx(Fe,{children:i.jsx(Uc,{width:"100%",height:300,children:i.jsxs(MQ,{data:h,children:[i.jsx(Rd,{strokeDasharray:"3 3"}),i.jsx(eo,{dataKey:"date",fontSize:12}),i.jsx(to,{domain:[0,100]}),i.jsx(_i,{}),i.jsx(Od,{}),i.jsx(_v,{type:"monotone",dataKey:"accuracy",stroke:"#10b981",strokeWidth:2,name:"Accuracy %"})]})})})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[u.length>0&&i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(C_,{className:"w-5 h-5 text-amber-600"}),"Performance by Difficulty"]})}),i.jsx(Fe,{children:i.jsx(Uc,{width:"100%",height:250,children:i.jsxs(N_,{data:u,children:[i.jsx(Rd,{strokeDasharray:"3 3"}),i.jsx(eo,{dataKey:"level"}),i.jsx(to,{domain:[0,100]}),i.jsx(_i,{}),i.jsx(Ql,{dataKey:"accuracy",fill:"#f59e0b",name:"Accuracy %"})]})})})]}),d&&i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-2",children:[i.jsx(rs,{className:"w-5 h-5 text-blue-600"}),"Response Speed Analysis"]})}),i.jsx(Fe,{children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 bg-blue-50 rounded-lg",children:[i.jsx("span",{className:"text-sm font-semibold text-blue-900",children:"Average"}),i.jsxs("span",{className:"text-2xl font-bold text-blue-600",children:[d.average,"s"]}
1082)]}),i.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 rounded-lg",children:[i.jsx("span",{className:"text-sm font-semibold text-green-900",children:"Fastest"}),i.jsxs("span",{className:"text-2xl font-bold text-green-600",children:[d.fastest,"s"]})]}),i.jsxs("div",{className:"flex items-center justify-between p-3 bg-orange-50 rounded-lg",children:[i.jsx("span",{className:"text-sm font-semibold text-orange-900",children:"Slowest"}),i.jsxs("span",{className:"text-2xl font-bold text-orange-600",children:[d.slowest,"s"]})]})]})})]})]})]})]})})}function H3e(){const[e,t]=O.useState(""),[n,r]=O.useState(""),[s,a]=O.useState(null),[o,l]=O.useState(!1),[c,u]=O.useState(!1),[h,d]=O.useState(""),m=w=>{const v=w.target.files[0];if(v){if(!v.type.startsWith("image/")){d("Please select a valid image file (JPG, PNG, etc.)");return}if(v.size>5*1024*1024){d("File size must be less than 5MB");return}a(v),d("")}},g=async w=>{var v;if(w.preventDefault(),d(""),u(!1),!e.trim()){d("Please enter your team name");return}if(!n.trim()){d("Please enter your email address");return}if(!s){d("Please select a photo to upload");return}l(!0);try{const y=(await ae.entities.Team.list()).find(P=>P.team_name.toLowerCase()===e.trim().toLowerCase());if(!y){d("We couldn't find that team name. Please check your spelling or ask your quiz host for help."),l(!1);return}const _=n.trim().toLowerCase(),N=(v=y.team_email)==null?void 0:v.toLowerCase();if(N&&N!==_){d("The email address doesn't match the one registered for this team. Please use the correct email or contact your quiz host."),l(!1);return}const{file_url:j}=await ae.integrations.Core.UploadFile({file:s}),S={team_photo_url:j};N||(S.team_email=_),await ae.entities.Team.update(y.id,S),u(!0),t(""),r(""),a(null);const C=document.getElementById("photo-upload");C&&(C.value="")}catch(b){console.error("Upload failed:",b),d("Something went wrong. Please try again or contact your quiz host.")}l(!1)};return i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-indigo-900 to-slate-900 p-6 pb-24",children:[i.jsx("div",{className:"max-w-2xl mx-auto",children:i.jsxs(Me,{className:"bg-white/10 backdrop-blur-md border-white/20",children:[i.jsx(st,{children:i.jsxs(at,{className:"flex items-center gap-3 text-white text-3xl",children:[i.jsx(Md,{className:"w-8 h-8"}),"Upload Your Team Photo"]})}),i.jsxs(Fe,{className:"space-y-6",children:[i.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:i.jsxs("p",{className:"text-blue-900 text-sm leading-relaxed",children:["Upload your team photo to appear beside your name on the league table. Please enter the same ",i.jsx("strong",{children:"Team Name"})," and ",i.jsx("strong",{children:"Email"})," used when playing."]})}),c&&i.jsxs(vr,{className:"bg-green-50 border-green-200",children:[i.jsx(Cn,{className:"h-4 w-4 text-green-600"}),i.jsxs(xr,{className:"text-green-900",children:[i.jsx("strong",{children:"Thanks!"})," Your team photo has been updated. It will appear on the league table shortly."]})]}),h&&i.jsxs(vr,{variant:"destructive",children:[i.jsx(Sn,{className:"h-4 w-4"}),i.jsx(xr,{children:h})]}),i.jsxs("form",{onSubmit:g,className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"team-name",className:"text-white text-lg",children:"Team Name *"}),i.jsx(Ee,{id:"team-name",type:"text",value:e,onChange:w=>t(w.target.value),placeholder:"Enter your team name",className:"h-12 text-lg bg-white/20 border-white/30 text-white placeholder:text-slate-300",disabled:o})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"email",className:"text-white text-lg",children:"Email Address *"}),i.jsx(Ee,{id:"email",type:"email",value:n,onChange:w=>r(w.target.value),placeholder:"[email protected]",className:"h-12 text-lg bg-white/20 border-white/30 text-white placeholder:text-slate-300",disabled:o})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"photo-upload",className:"text-white text-lg",children:"Upload Photo *"}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Ee,{id:"photo-upload",type:"file",accept:"image/*",onChange:m,className:"flex-1 h-12 bg-white/20 border-white/30 text-white file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:bg-indigo-600 file:text-white file:font-semibold hover:file:bg-indigo-700",disabled:o}),s&&i.jsx(Cn,{className:"w-6 h-6 text-green-400 flex-shrink-0"})]}),i.jsx("p",{className:"text-slate-300 text-sm",children:"Accepted formats: JPG, PNG. Maximum size: 5MB"})]}),i.jsx(ue,{type:"submit",disabled:o,className:"w-full h-14 text-lg bg-indigo-600 hover:bg-indigo-700",children:o?i.jsxs(i.Fragment,{children:[i.jsx(ma,{className:"w-5 h-5 mr-2 animate-pulse"}),"Uploading..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Md,{className:"w-5 h-5 mr-2"}),"Upload Team Photo"]})})]})]})]})}),i.jsx(N5,{})]})}function K3e(){const[e,t]=O.useState(""),[n,r]=O.useState(null),[s,a]=O.useState({}),{data:o=[]}
1082=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list()}),{data:l}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{current_week:0}}),{data:c=[]}=qe({queryKey:["importBatches"],queryFn:()=>ae.entities.ImportBatch.list()}),u=o.filter(j=>j.active!==!1).filter(j=>{var S;return e?(S=j.team_name)==null?void 0:S.toLowerCase().includes(e.toLowerCase()):!0}).sort((j,S)=>S.total_points-j.total_points),h=j=>j.finishes_1st>0?"1st":j.finishes_2nd>0?"2nd":j.finishes_3rd>0?"3rd":"N/A",d=j=>j.appearances===0?"N/A":((j.finishes_1st*1+j.finishes_2nd*2+j.finishes_3rd*3+(j.appearances-j.finishes_1st-j.finishes_2nd-j.finishes_3rd)*4)/j.appearances).toFixed(1),m=j=>{if(j.appearances===0)return"0%";const S=j.finishes_1st+j.finishes_2nd+j.finishes_3rd;return`${Math.round(S/j.appearances*100)}%`},g=j=>c.filter(S=>{var A,F;const C=((A=S.changes)==null?void 0:A.team_updates)||[],P=((F=S.changes)==null?void 0:F.created_team_ids)||[];return C.some(I=>I.team_id===j)||P.includes(j)}).sort((S,C)=>new Date(C.quiz_date)-new Date(S.quiz_date)).slice(0,25),w=(j,S)=>{const C=[];return c.filter(A=>{var R,M;const F=((R=A.changes)==null?void 0:R.team_updates)||[],I=((M=A.changes)==null?void 0:M.created_team_ids)||[];return F.some($=>$.team_id===j)||I.includes(j)}).sort((A,F)=>new Date(F.quiz_date)-new Date(A.quiz_date)).slice(0,25).forEach((A,F)=>{var B,U,G,Z;const I=(U=(B=A.changes)==null?void 0:B.team_updates)==null?void 0:U.find(X=>X.team_id===j),R=I==null?void 0:I.previous_state;let M="–",$=1;if(R){const X=R.finishes_1st||0,V=R.finishes_2nd||0,z=R.finishes_3rd||0,L=(S.finishes_1st||0)-X,W=(S.finishes_2nd||0)-V,Q=(S.finishes_3rd||0)-z;L>0&&F===0?(M="1st",$=5):W>0&&F===0?(M="2nd",$=4):Q>0&&F===0&&(M="3rd",$=3);const J=R.base_points||0,Y=(S.base_points||0)-J;Y>0&&($=Y)}else(Z=(G=A.changes)==null?void 0:G.created_team_ids)!=null&&Z.includes(j)&&((S.finishes_1st||0)>0&&S.appearances===1?(M="1st",$=5):(S.finishes_2nd||0)>0&&S.appearances===1?(M="2nd",$=4):(S.finishes_3rd||0)>0&&S.appearances===1&&(M="3rd",$=3));C.push({weekNumber:A.week_number,date:A.quiz_date,position:M,pointsEarned:$})}),C},v=j=>{a(S=>({...S,[j]:!S[j]}))},b=j=>j==="1st"?"text-amber-400 font-bold":j==="2nd"?"text-slate-300 font-bold":j==="3rd"?"text-orange-400 font-bold":"text-slate-500",y=j=>{const S=c.filter(P=>{var I,R;const A=((I=P.changes)==null?void 0:I.team_updates)||[],F=((R=P.changes)==null?void 0:R.created_team_ids)||[];return A.some(M=>M.team_id===j)||F.includes(j)}).sort((P,A)=>new Date(A.quiz_date)-new Date(P.quiz_date));let C=0;for(let P=0;P<S.length&&(P===0||S[P].week_number===S[P-1].week_number-1);P++)C++;return C},_=j=>{if(!j)return"Never";const S=new Date(j),P=Math.floor((new Date-S)/(1e3*60*60*24));return P===0?"Today":P===1?"Yesterday":P<7?`${P} days ago`:P<30?`${Math.floor(P/7)} weeks ago`:S.toLocaleDateString()},N=j=>{const S=[],C=(l==null?void 0:l.current_week)||0,P=j.finishes_1st+j.finishes_2nd+j.finishes_3rd,A=j.appearances>0?P/j.appearances:0;return j.finishes_1st>=3&&S.push({icon:"🏆",label:"Champion",color:"bg-amber-500"}),j.appearances>0&&j.finishes_1st===j.appearances&&j.appearances>=2&&S.push({icon:"👑",label:"Undefeated",color:"bg-purple-600"}),C>0&&j.appearances>=C&&S.push({icon:"⭐",label:"Perfect Attendance",color:"bg-blue-600"}),j.appearances>=5&&A>=.5&&S.push({icon:"🥇",label:"Podium Regular",color:"bg-orange-500"}),j.appearances===1&&S.push({icon:"🌟",label:"First Timer",color:"bg-green-500"}),j.appearances>=10&&S.push({icon:"🎖️",label:"Veteran",color:"bg-slate-600"}),j.finishes_1st>0&&o.filter(F=>F.active!==!1).sort((F,I)=>I.total_points-F.total_points).slice(0,3).find(F=>F.id===j.id)&&S.push({icon:"🔥",label:"Top 3",color:"bg-red-500"}),S};return l!=null&&l.league_table_offline?i.jsxs(i.Fragment,{children:[i.jsx(ao,{pageName:"TeamProfiles"}),i.jsx(S5,{message:l.maintenance_message})]}):i.jsxs(i.Fragment,{children:[i.jsx(ao,{pageName:"TeamProfiles"}),i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-indigo-900 to-slate-900 p-6",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsxs("div",{className:"mb-8",children:[i.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"Team Career Profiles"}),i.jsx("p",{className:"text-slate-300",children:"View detailed statistics and history for each team"})]}),i.jsxs("div",{className:"mb-6 relative",children:[i.jsx(Ld,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400"}
1082),i.jsx(Ee,{placeholder:"Search teams...",value:e,onChange:j=>t(j.target.value),className:"pl-10 bg-white/10 border-white/20 text-white placeholder:text-slate-400"})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:u.map(j=>{const S=N(j),C=y(j.id);g(j.id);const P=w(j.id,j),A=s[j.id];return i.jsx("div",{className:"cursor-pointer",style:{perspective:"1000px",minHeight:"600px"},onClick:()=>v(j.id),children:i.jsxs("div",{className:"relative w-full h-full transition-transform duration-700",style:{transformStyle:"preserve-3d",transform:A?"rotateY(180deg)":"rotateY(0deg)",minHeight:"600px"},children:[i.jsxs(Me,{className:"relative w-full h-full bg-white/10 backdrop-blur-md border-white/20 hover:bg-white/15 transition-all",style:{backfaceVisibility:"hidden"},children:[i.jsxs(st,{children:[i.jsxs("div",{className:"flex items-start gap-4",children:[j.team_photo_url?i.jsx("img",{src:j.team_photo_url,alt:j.team_name,onClick:F=>{F.stopPropagation(),r({url:j.team_photo_url,name:j.team_name})},className:"w-20 h-20 rounded-full object-cover border-2 border-white/30 curs
1082or-pointer hover:scale-110 transition-transform"}):i.jsx("div",{className:"w-20 h-20 rounded-full bg-slate-700 flex items-center justify-center border-2 border-white/30",children:i.jsx(Dr,{className:"w-10 h-10 text-slate-400"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx(at,{className:"text-white text-lg mb-2",children:j.team_name}),i.jsxs("div",{className:"flex gap-2 flex-wrap mb-2",children:[i.jsxs(nt,{className:"bg-amber-500 text-white",children:[j.total_points," pts"]}),j.finishes_1st>0&&i.jsxs(nt,{className:"bg-yellow-500 text-slate-900",children:[j.finishes_1st,"× 🥇"]})]}),i.jsxs("div",{className:"text-xs text-slate-400",children:["Last seen: ",i.jsx("span",{className:"text-slate-300",children:_(j.last_attendance_date)})]})]})]}),S.length>0&&i.jsx("div",{className:"mt-3 flex gap-1.5 flex-wrap",children:S.map((F,I)=>i.jsxs("div",{className:`${F.color} text-white text-xs px-2 py-1 rounded-full flex items-center gap-1 shadow-lg`,title:F.label,children:[i.jsx("span",{children:F.icon}),i.jsx("span",{className:"hidden sm:inline",children:F.label})]},I))})]}),i.jsxs(Fe,{className:"space-y-3",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"bg-slate-800/50 rounded-lg p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-slate-400 text-xs mb-1",children:[i.jsx(Fn,{className:"w-3 h-3"}),"Total Quizzes"]}),i.jsx("div",{className:"text-2xl font-bold text-white",children:j.appearances})]}),i.jsxs("div",{className:"bg-slate-800/50 rounded-lg p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-slate-400 text-xs mb-1",children:[i.jsx(Jt,{className:"w-3 h-3"}),"Career Points"]}),i.jsx("div",{className:"text-2xl font-bold text-amber-400",children:j.total_points})]}),i.jsxs("div",{className:"bg-slate-800/50 rounded-lg p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-slate-400 text-xs mb-1",children:[i.jsx(C_,{className:"w-3 h-3"}),"Best Finish"]}),i.jsx("div",{className:"text-2xl font-bold text-white",children:h(j)})]}),i.jsxs("div",{className:"bg-slate-800/50 rounded-lg p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-slate-400 text-xs mb-1",children:[i.jsx(ro,{className:"w-3 h-3"}),"Avg Position"]}),i.jsx("div",{className:"text-2xl font-bold text-white",children:d(j)})]})]}),C>0&&i.jsx("div",{className:"bg-green-900/30 rounded-lg p-3 border border-green-500/30",children:i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-slate-300 text-sm",children:"🔥 Attendance Streak"}),i.jsxs("span",{className:"text-green-300 font-bold",children:[C," week",C!==1?"s":""]})]})}),i.jsxs("div",{className:"bg-slate-800/30 rounded-lg p-3 border border-slate-600/30",children:[i.jsx("div",{className:"text-slate-300 text-xs font-semibold mb-2",children:"Podium Breakdown"}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xl font-bold text-amber-400",children:j.finishes_1st}),i.jsx("div",{className:"text-xs text-slate-400",children:"🥇 1st"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xl font-bold text-slate-300",children:j.finishes_2nd}),i.jsx("div",{className:"text-xs text-slate-400",children:"🥈 2nd"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xl font-bold text-orange-400",children:j.finishes_3rd}),i.jsx("div",{className:"text-xs text-slate-400",children:"🥉 3rd"})]})]}),i.jsxs("div",{className:"mt-2 pt-2 border-t border-slate-600/30 text-center",children:[i.jsx("span",{className:"text-indigo-300 font-semibold text-sm",children:m(j)}),i.jsx("span",{className:"text-slate-400 text-xs ml-1",children:"podium rate"})]})]})]})]}),i.jsxs(Me,{className:"absolute inset-0 bg-white/10 backdrop-blur-md border-white/20",style:{backfaceVisibility:"hidden",transform:"rotateY(180deg)"},children:[i.jsx(st,{className:"pb-3",children:i.jsxs(at,{className:"text-white text-lg flex items-center justify-between",children:[i.jsx("span",{children:j.team_name}),i.jsx("span",{className:"text-sm text-slate-400",children:"Results History"})]})}),i.jsx(Fe,{children:P.length>0?i.jsx("div",{className:"space-y-1.5",children:P.map((F,I)=>i.jsxs("div",{className:"flex items-center justify-between text-xs py-1.5 px-2 bg-slate-800/30 rounded border border-slate-700/30",children:[i.jsxs("span",{className:"text-slate-400 font-medium",children:["Week ",F.weekNumber]}
1082),i.jsx("span",{className:"text-slate-400",children:new Date(F.date).toLocaleDateString("en-GB",{day:"numeric",month:"short"})}),i.jsx("span",{className:b(F.position),children:F.position}),i.jsxs("span",{className:"text-amber-400 font-semibold",children:[F.pointsEarned," pts"]})]},I))}):i.jsx("div",{className:"text-center py-8 text-slate-400",children:i.jsx("p",{children:"No results history available"})})})]})]})},j.id)})}),u.length===0&&i.jsx(Me,{className:"bg-white/10 backdrop-blur-md border-white/20",children:i.jsxs(Fe,{className:"p-12 text-center",children:[i.jsx(Dr,{className:"w-16 h-16 text-slate-400 mx-auto mb-4"}),i.jsx("p",{className:"text-slate-300",children:"No teams found matching your search."})]})})]})}),i.jsx(rn,{open:!!n,onOpenChange:()=>r(null),children:i.jsx(en,{className:"max-w-4xl p-0 bg-transparent border-none",children:i.jsxs("div",{className:"relative",children:[i.jsx("button",{onClick:()=>r(null),className:"absolute -top-12 right-0 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white backdrop-blur-sm",children:i.jsx(Si,{className:"w-6 h-6"})}),n&&i.jsxs("div",{className:"rounded-2xl overflow-hidden",children:[i.jsx("img",{src:n.url,alt:n.name,className:"w-full h-auto max-h-[80vh] object-contain"}),i.jsx("div",{className:"bg-slate-900/90 backdrop-blur-sm p-4 text-center",children:i.jsx("p",{className:"text-white font-semibold text-xl",children:n.name})})]})]})})})]})}function G3e({team:e,open:t,onClose:n}){const[r,s]=O.useState(""),[a,o]=O.useState(""),[l,c]=O.useState(""),[u,h]=O.useState(""),[d,m]=O.useState(!1),[g,w]=O.useState(""),[v,b]=O.useState(!1),y=()=>{s(""),o(""),c(""),h(""),w(""),b(!1),n()},_=async N=>{var j;if(N.preventDefault(),w(""),b(!1),!r.trim()){w("Please enter your email address");return}if(!a){w("Please select a category");return}if(!u.trim()){w("Please describe the issue");return}m(!0);try{const S=r.trim().toLowerCase(),C=(j=e.team_email)==null?void 0:j.toLowerCase();if(C&&C!==S){w("This email does not match the registered email for this team. Please use the same email you used before or contact the host."),m(!1);return}await ae.entities.TeamIssue.create({team_id:e.id,team_name_snapshot:e.team_name,email:S,category:a,message:u.trim(),quiz_date:l||null,status:"open"}),C||await ae.entities.Team.update(e.id,{team_email:S}),b(!0),setTimeout(()=>{y()},2e3)}catch(S){console.error("Failed to submit issue:",S),w("Something went wrong. Please try again or contact the host directly.")}m(!1)};return e?i.jsx(rn,{open:t,onOpenChange:y,children:i.jsxs(en,{className:"max-w-2xl",children:[i.jsx(vn,{children:i.jsxs(sn,{className:"flex items-center gap-2",children:[i.jsx(Sn,{className:"w-5 h-5"}),"Report an Issue - ",e.team_name]})}),v?i.jsxs(vr,{className:"bg-green-50 border-green-200",children:[i.jsx(Cn,{className:"h-4 w-4 text-green-600"}),i.jsxs(xr,{className:"text-green-900",children:[i.jsx("strong",{children:"Thanks!"})," Your query has been sent to the host. They'll review it and update your stats if needed."]})]}):i.jsxs("form",{onSubmit:_,className:"space-y-4 py-4",children:[g&&i.jsxs(vr,{variant:"destructive",children:[i.jsx(Sn,{className:"h-4 w-4"}),i.jsx(xr,{children:g})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"team-name",children:"Team Name"}),i.jsx(Ee,{id:"team-name",value:e.team_name,disabled:!0,className:"bg-slate-100"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"email",children:"Email Address *"}),i.jsx(Ee,{id:"email",type:"email",value:r,onChange:N=>{s(N.target.value),w("")},placeholder:"[email protected]",disabled:d}),i.jsx("p",{className:"text-sm text-slate-600",children:"Use the same email you used for team photo uploads"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"category",children:"Category *"}),i.jsxs(Xt,{value:a,onValueChange:o,disabled:d,children:[i.jsx(Ht,{children:i.jsx(Zt,{placeholder:"Select issue type..."})}),i.jsxs(Kt,{children:[i.jsx(Ie,{value:"Missing attendance",children:"Missing attendance"}),i.jsx(Ie,{value:"Points incorrect",children:"Points incorrect"}),i.jsx(Ie,{value:"Team name issue",children:"Team name issue"}),i.jsx(Ie,{value:"Other",children:"Other"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"quiz-date",children:"Qu
1082iz Date (Optional)"}),i.jsx(Ee,{id:"quiz-date",type:"date",value:l,onChange:N=>c(N.target.value),disabled:d})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"message",children:"Describe the Issue *"}),i.jsx(nr,{id:"message",value:u,onChange:N=>{h(N.target.value),w("")},placeholder:"Please provide details about the issue...",rows:4,disabled:d})]}),i.jsxs(Fr,{children:[i.jsx(ue,{type:"button",variant:"outline",onClick:y,disabled:d,children:"Cancel"}),i.jsxs(ue,{type:"submit",disabled:d,children:[i.jsx(cB,{className:"w-4 h-4 mr-2"}),d?"Sending...":"Send Report"]})]})]})]})}):null}function Q3e(){const[e,t]=O.useState(null);O.useEffect(()=>{"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual"),window.scrollTo(0,0);const o=setTimeout(()=>window.scrollTo(0,0),100);return()=>clearTimeout(o)},[]);const{data:n=[]}=qe({queryKey:["teams"],queryFn:()=>ae.entities.Team.list(),refetchInterval:1e4}),{data:r}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{},refetchInterval:15e3}),s=[...n].sort((o,l)=>l.total_points!==o.total_points?l.total_points-o.total_points:l.finishes_1st!==o.finishes_1st?l.finishes_1st-o.finishes_1st:(o.team_name||"").localeCompare(l.team_name||"")),a=o=>o.split(" ").map(l=>l[0]).filter(Boolean).slice(0,2).join("").toUpperCase();return r!=null&&r.league_table_offline?i.jsx(S5,{message:r.maintenance_message}):i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-indigo-900 to-slate-900 p-3 sm:p-6 pb-24",children:[i.jsx("div",{className:"max-w-7xl mx-auto",children:i.jsxs(Me,{className:"bg-white/10 backdrop-blur-md border-white/20",children:[i.jsxs(st,{children:[i.jsx(at,{className:"text-2xl sm:text-3xl font-bold text-white",children:"League Teams & Statistics"}),i.jsx("p",{className:"text-slate-300 mt-2 text-sm sm:text-base",children:"View all teams and their performance. Report any issues with the data below."}),i.jsx("button",{onClick:()=>{var o;return(o=document.getElementById("weekly-results-section"))==null?void 0:o.scrollIntoView({behavior:"smooth",block:"start"})},className:"group relative mt-5 w-full overflow-hidden rounded-2xl p-[1.5px] bg-gradient-to-r from-amber-500 via-orange-500 to-yellow-400 animate-[shimmer_3s_ease-in-out_infinite] bg-[length:200%_100%] shadow-lg shadow-amber-500/20 hover:shadow-amber-500/40 transition-shadow duration-300",children:i.jsxs("div",{className:"relative flex items-center gap-3 sm:gap-4 rounded-2xl bg-slate-900/90 px-3 sm:px-5 py-3 sm:py-4 backdrop-blur-sm",children:[i.jsx("div",{className:"flex h-10 w-10 sm:h-12 sm:w-12 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 shadow-inner shadow-amber-300/30",children:i.jsx(eB,{className:"h-5 w-5 sm:h-6 sm:w-6 text-white"})}),i.jsxs("div",{className:"flex-1 text-left min-w-0",children:[i.jsx("div",{className:"text-sm sm:text-base font-bold text-white",children:"Weekly Results Browser"}),i.jsx("div",{className:"text-xs sm:text-sm text-slate-300 truncate",children:"Browse every week's standings, scores & podium finishes"})]}),i.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 rounded-full bg-gradient-to-r from-amber-500 to-orange-500 px-3 sm:px-4 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold text-white shadow-md group-hover:gap-3 transition-all duration-200 shrink-0",children:["Jump down",i.jsx(Yh,{className:"h-4 w-4 animate-bounce"})]})]})})]}),i.jsx(Fe,{children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs(Qo,{children:[i.jsx(Yo,{children:i.jsxs(tr,{className:"border-white/20",children:[i.jsx(ht,{className:"text-slate-200 font-semibold text-xs sm:text-sm",children:"Rank"}),i.jsx(ht,{className:"text-slate-200 font-semibold text-xs sm:text-sm",children:"Team"}),i.jsx(ht,{className:"text-slate-200 font-semibold text-xs sm:text-sm",children:"Total Points"}),i.jsx(ht,{className:"text-slate-200 font-semibold text-xs sm:text-sm",children:"Handicap"}),i.jsx(ht,{className:"text-slate-200 font-semibold text-xs sm:text-sm",children:"1st"}),i.jsx(ht,{className:"text-slate-200 font-semibold text-xs sm:text-sm",children:"2nd"}),i.jsx(ht,{className:"text-slate-200 font-semibold text-xs sm:text-sm",children:"3rd"}),i.jsx(ht,{className:"text-slate-200 font-semibold text-xs sm:text-sm",children:"ATT"}),i.jsx(ht,{className:"text-slate-200 font-semibold text-xs sm:text-sm",children:"Last Date"}),i.jsx(ht,{className:"text-slate-200 font-semibold text-xs sm:text-sm",children:"Actions"})]})}),i.jsx(Xo,{children:s.map((o,l)=>i.jsxs(tr,{className:"border-white/10 hover:bg-white/5",children:[i.jsx(it,{className:"text-white font-bold text-base sm:text-lg",children:l+1}),i.jsx(it,{children:i.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[o.team_photo_url?i.jsx("img",{src:o.team_photo_url,alt:o.team_name,className:"w-9 h-9 sm:w-12 sm:h-12 rounded-lg object-cover border-2 border-white/30"}):i.jsx("div",{className:"w-9 h-9 sm:w-12 sm:h-12 rounded-lg bg-white/20 flex items-center justify-center text-white text-xs sm:text-sm font-bold border-2 border-white/30",children:a(o.team_name)}),i.jsx("span",{className:"text-white font-semibold text-sm sm:text-lg",children:o.team_name})]})}),i.jsx(it,{className:"text-white font-bold text-base sm:text-xl",children:o.total_points||0}),i.jsx(it,{className:`font-semibold text-sm sm:text-base ${o.handicap<0?"text-red-400":"text-slate-300"}`,children:o.handicap||0}),i.jsx(it,{className:"text-slate-200 text-sm sm:text-base",children:o.finishes_1st||0}),i.jsx(it,{className:"text-slate-200 text-sm sm:text-base",children:o.finishes_2nd||0}),i.jsx(it,{className:"text-slate-200 text-sm sm:text-base",children:o.finishes_3rd||0}),i.jsx(it,{className:"text-slate-200 text-sm sm:text-base",children:o.appearances||0}),i.jsx(it,{className:"text-slate-300 text-xs sm:text-sm",children:o.last_attendance_date||"-"}),i.jsx(it,{children:i.jsxs(ue,{size:"sm",variant:"outline",onClick:()=>t(o),className:"bg-white/10 border-white/30 text-white hover:bg-white/20",children:[i.jsx(Sn,{className:"w-3 h-3 sm:w-4 sm:h-4"}),i.jsx("span",{className:"hidden sm:inline ml-2",children:"Report Issue"})]})})]},o.id))})]})})})]})}),i.jsx("div",{id:"weekly-results-section",className:"scroll-mt-4",children:i.jsx(zW,{voidedWeeks:(r==null?void 0:r.voided_weeks)||[]})}),i.jsx(G3e,{team:e,open:!!e,onClose:()=>t(null)}),i.jsx(N5,{})]})}var N0={exports:{}};/**
1083 * @license
1084 * Lodash <https://lodash.com/>
1085 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
1086 * Released under MIT license <https://lodash.com/license>
1087 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1088 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1089 */var Y3e=N0.exports,L8;function X3e(){return L8||(L8=1,(function(e,t){(function(){var n,r="4.17.21",s=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",l="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,h="__lodash_placeholder__",d=1,m=2,g=4,w=1,v=2,b=1,y=2,_=4,N=8,j=16,S=32,C=64,P=128,A=256,F=512,I=30,R="...",M=800,$=16,B=1,U=2,G=3,Z=1/0,X=9007199254740991,V=17976931348623157e292,z=NaN,L=4294967295,W=L-1,Q=L>>>1,J=[["ary",P],["bind",b],["bindKey",y],["curry",N],["curryRight",j],["flip",F],["partial",S],["partialRight",C],["rearg",A]],ne="[object Arguments]",Y="[object Array]",ee="[object AsyncFunction]",le="[object Boolean]",re="[object Date]",fe="[object DOMException]",ge="[object Error]",he="[object Function]",De="[object GeneratorFunction]",_e="[object Map]",We="[object Number]",ze="[object Null]",Xe="[object Object]",ke="[object Promise]",Ae="[object Proxy]",Be="[object RegExp]",de="[object Set]",Pe="[object String]",Ze="[object Symbol]",ct="[object Undefined]",pt="[object WeakMap]",$t="[object WeakSet]",wn="[object ArrayBuffer]",an="[object DataView]",is="[object Float32Array]",on="[object Float64Array]",ir="[object Int8Array]",Ns="[object Int16Array]",el="[object Int32Array]",vu="[object Uint8Array]",xu="[object Uint8ClampedArray]",tl="[object Uint16Array]",ec="[object Uint32Array]",tc=/\b__p \+= '';/g,Ss=/\b(__p \+=) '' \+/g,Zd=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ho=/&(?:amp|lt|gt|quot|#39);/g,_a=/[&<>"']/g,Jd=RegExp(ho.source),Vt=RegExp(_a.source),fr=/<%-([\s\S]+?)%>/g,Ar=/<%([\s\S]+?)%>/g,Qr=/<%=([\s\S]+?)%>/g,nl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jr=/^\w*$/,$r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Na=/[\\^$.*+?()[\]{}|]/g,Yr=RegExp(Na.source),Ei=/^\s+/,rl=/\s/,ks=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ef=/\{\n\/\* \[wrapped with (.+)\] \*/,Sv=/,? & /,XN=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ZN=/[()=,{}\[\]\/\s]/,JN=/\\(\\)?/g,nc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,kv=/\w*$/,bb=/^[-+]0x[0-9a-f]+$/i,e2=/^0b[01]+$/i,wb=/^\[object .+?Constructor\]$/,jb=/^0o[0-7]+$/i,_b=/^(?:0|[1-9]\d*)$/,Nb=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 15,715 bytes, line 1089
10897f]/g,sm=/($^)/,t2=/['\n\r\u2028\u2029\\]/g,Gn="\\ud800-\\udfff",n2="\\u0300-\\u036f",Ev="\\ufe20-\\ufe2f",Sb="\\u20d0-\\u20ff",tf=n2+Ev+Sb,kb="\\u2700-\\u27bf",Pv="a-z\\xdf-\\xf6\\xf8-\\xff",am="\\xac\\xb1\\xd7\\xf7",Sa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",r2="\\u2000-\\u206f",Ys=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Eb="A-Z\\xc0-\\xd6\\xd8-\\xde",Pb="\\ufe0e\\ufe0f",Cb=am+Sa+r2+Ys,yu="['’]",om="["+Gn+"]",bu="["+Cb+"]",rc="["+tf+"]",Ab="\\d+",i2="["+kb+"]",lm="["+Pv+"]",Cv="[^"+Gn+Cb+Ab+kb+Pv+Eb+"]",nf="\\ud83c[\\udffb-\\udfff]",rf="(?:"+rc+"|"+nf+")",Ob="[^"+Gn+"]",sf="(?:\\ud83c[\\udde6-\\uddff]){2}",kn="[\\ud800-\\udbff][\\udc00-\\udfff]",ic="["+Eb+"]",Av="\\u200d",cm="(?:"+lm+"|"+Cv+")",Tb="(?:"+ic+"|"+Cv+")",Ov="(?:"+yu+"(?:d|ll|m|re|s|t|ve))?",Tv="(?:"+yu+"(?:D|LL|M|RE|S|T|VE))?",um=rf+"?",af="["+Pb+"]?",il="(?:"+Av+"(?:"+[Ob,sf,kn].join("|")+")"+af+um+")*",sl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",al="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wu=af+um+il,of="(?:"+[i2,sf,kn].join("|")+")"+wu,ol="(?:"+[Ob+rc+"?",rc,sf,kn,om].join("|")+")",s2=RegExp(yu,"g"),Rb=RegExp(rc,"g"),sc=RegExp(nf+"(?="+nf+")|"+ol+wu,"g"),a2=RegExp([ic+"?"+lm+"+"+Ov+"(?="+[bu,ic,"$"].join("|")+")",Tb+"+"+Tv+"(?="+[bu,ic+cm,"$"].join("|")+")",ic+"?"+cm+"+"+Ov,ic+"+"+Tv,al,sl,Ab,of].join("|"),"g"),Mb=RegExp("["+Av+Gn+tf+Pb+"]"),dm=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ib=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],o2=-1,On={};On[is]=On[on]=On[ir]=On[Ns]=On[el]=On[vu]=On[xu]=On[tl]=On[ec]=!0,On[ne]=On[Y]=On[wn]=On[le]=On[an]=On[re]=On[ge]=On[he]=On[_e]=On[We]=On[Xe]=On[Be]=On[de]=On[Pe]=On[pt]=!1;var Pn={};Pn[ne]=Pn[Y]=Pn[wn]=Pn[an]=Pn[le]=Pn[re]=Pn[is]=Pn[on]=Pn[ir]=Pn[Ns]=Pn[el]=Pn[_e]=Pn[We]=Pn[Xe]=Pn[Be]=Pn[de]=Pn[Pe]=Pn[Ze]=Pn[vu]=Pn[xu]=Pn[tl]=Pn[ec]=!0,Pn[ge]=Pn[he]=Pn[pt]=!1;var ju={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},fm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l2={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},c2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Rv=parseFloat,hm=parseInt,mm=typeof bd=="object"&&bd&&bd.Object===Object&&bd,Db=typeof self=="object"&&self&&self.Object===Object&&self,Qn=mm||Db||Function("return this")(),lf=t&&!t.nodeType&&t,ka=lf&&!0&&e&&!e.nodeType&&e,Mv=ka&&ka.exports===lf,_u=Mv&&mm.process,Pi=(function(){try{var Ne=ka&&ka.require&&ka.require("util").types;return Ne||_u&&_u.binding&&_u.binding("util")}catch{}})(),Iv=Pi&&Pi.isArrayBuffer,zi=Pi&&Pi.isDate,ac=Pi&&Pi.isMap,pm=Pi&&Pi.isRegExp,Nu=Pi&&Pi.isSet,Lb=Pi&&Pi.isTypedArray;function Ci(Ne,Le,Te){switch(Te.length){case 0:return Ne.call(Le);case 1:return Ne.call(Le,Te[0]);case 2:return Ne.call(Le,Te[0],Te[1]);case 3:return Ne.call(Le,Te[0],Te[1],Te[2])}return Ne.apply(Le,Te)}function Dv(Ne,Le,Te,ut){for(var Bt=-1,jn=Ne==null?0:Ne.length;++Bt<jn;){var _r=Ne[Bt];Le(ut,_r,Te(_r),Ne)}return ut}function fi(Ne,Le){for(var Te=-1,ut=Ne==null?0:Ne.length;++Te<ut&&Le(Ne[Te],Te,Ne)!==!1;);return Ne}function gm(Ne,Le){for(var Te=Ne==null?0:Ne.length;Te--&&Le(Ne[Te],Te,Ne)!==!1;);return Ne}function Lv(Ne,Le){for(var Te=-1,ut=Ne==null?0:Ne.length;++Te<ut;)if(!Le(Ne[Te],Te,Ne))return!1;return!0}function ll(Ne,Le){for(var Te=-1,ut=Ne==null?0:Ne.length,Bt=0,jn=[];++Te<ut;){var _r=Ne[Te];Le(_r,Te,Ne)&&(jn[Bt++]=_r)}return jn}function vm(Ne,Le){var Te=Ne==null?0:Ne.length;return!!Te&&Su(Ne,Le,0)>-1}function Fv(Ne,Le,Te){for(var ut=-1,Bt=Ne==null?0:Ne.length;++ut<Bt;)if(Te(Le,Ne[ut]))return!0;return!1}function zn(Ne,Le){for(var Te=-1,ut=Ne==null?0:Ne.length,Bt=Array(ut);++Te<ut;)Bt[Te]=Le(Ne[Te],Te,Ne);return Bt}function cl(Ne,Le){for(var Te=-1,ut=Le.length,Bt=Ne.length;++Te<ut;)Ne[Bt+Te]=Le[Te];return Ne}function $v(Ne,Le,Te,ut){var Bt=-1,jn=Ne==null?0:Ne.length;for(ut&&jn&&(Te=Ne[++Bt]);++Bt<jn;)Te=Le(Te,Ne[Bt],Bt,Ne);return Te}function u2(Ne,Le,Te,ut){var Bt=Ne==null?0:Ne.length;for(ut&&Bt&&(Te=Ne[--Bt]);Bt--;)Te=Le(Te,Ne[Bt],Bt,Ne);return Te}function qv(Ne,Le){for(var Te=-1,ut=Ne==null?0:Ne.length;++Te<ut;)if(Le(Ne[Te],Te,Ne))return!0;return!1}var d2=Bv("length");function Fb(Ne){return Ne.split("")}function f2(Ne){return Ne.match(XN)||[]}function $b(Ne,Le,Te){var ut;return Te(Ne,function(Bt,jn,_r){if(Le(Bt,jn,_r))return ut=jn,!1}),ut}function xm(Ne,Le,Te,ut){for(var Bt=Ne.length,jn=Te+(ut?1:-1);ut?jn--:++jn<Bt;)if(Le(Ne[jn],jn,Ne))return jn;return-1}function Su(Ne,Le,Te){return Le===Le?wm(Ne,Le,Te):xm(Ne,qb,Te)}function zv(Ne,Le,Te,ut){for(var Bt=Te-1,jn=Ne.length;++Bt<jn;)if(ut(Ne[Bt],Le))return Bt;return-1}function qb(Ne){return Ne!==Ne}function zb(Ne,Le){var Te=Ne==null?0:Ne.length;return Te?Uv(Ne,Le)/Te:z}function Bv(Ne){return function(Le){return Le==null?n:Le[Ne]}}function ym(Ne){return function(Le){return Ne==null?n:Ne[Le]}}function Bb(Ne,Le,Te,ut,Bt){return Bt(Ne,function(jn,_r,Rn){Te=ut?(ut=!1,jn):Le(Te,jn,_r,Rn)}),Te}function h2(Ne,Le){var Te=Ne.length;for(Ne.sort(Le);Te--;)Ne[Te]=Ne[Te].value;return Ne}function Uv(Ne,Le){for(var Te,ut=-1,Bt=Ne.length;++ut<Bt;){var jn=Le(Ne[ut]);jn!==n&&(Te=Te===n?jn:Te+jn)}return Te}function Vv(Ne,Le){for(var Te=-1,ut=Array(Ne);++Te<Ne;)ut[Te]=Le(Te);return ut}function m2(Ne,Le){return zn(Le,function(Te){return[Te,Ne[Te]]})}function Ub(Ne){return Ne&&Ne.slice(0,jm(Ne)+1).replace(Ei,"")}function ss(Ne){return function(Le){return Ne(Le)}}function cf(Ne,Le){return zn(Le,function(Te){return Ne[Te]})}function mo(Ne,Le){return Ne.has(Le)}function Vb(Ne,Le){for(var Te=-1,ut=Ne.length;++Te<ut&&Su(Le,Ne[Te],0)>-1;);return Te}function Wv(Ne,Le){for(var Te=Ne.length;Te--&&Su(Le,Ne[Te],0)>-1;);return Te}function Wb(Ne,Le){for(var Te=Ne.length,ut=0;Te--;)Ne[Te]===Le&&++ut;return ut}var Hb=ym(ju),Kb=ym(fm);function Gb(Ne){return"\\"+c2[Ne]}function ku(Ne,Le){return Ne==null?n:Ne[Le]}function Eu(Ne){return Mb.test(Ne)}function p2(Ne){return dm.test(Ne)}function g2(Ne){for(var Le,Te=[];!(Le=Ne.next()).done;)Te.push(Le.value);return Te}function bm(Ne){var Le=-1,Te=Array(Ne.size);return Ne.forEach(function(ut,Bt){Te[++Le]=[Bt,ut]}),Te}function Hv(Ne,Le){return function(Te){return Ne(Le(Te))}}function Es(Ne,Le){for(var Te=-1,ut=Ne.length,Bt=0,jn=[];++Te<ut;){var _r=Ne[Te];(_r===Le||_r===h)&&(Ne[Te]=h,jn[Bt++]=Te)}return jn}function ul(Ne){var Le=-1,Te=Array(Ne.size);return Ne.forEach(function(ut){Te[++Le]=ut}),Te}function v2(Ne){var Le=-1,Te=Array(Ne.size);return Ne.forEach(function(ut){Te[++Le]=[ut,ut]}),Te}function wm(Ne,Le,Te){for(var ut=Te-1,Bt=Ne.length;++ut<Bt;)if(Ne[ut]===Le)return ut;return-1}function x2(Ne,Le,Te){for(var ut=Te+1;ut--;)if(Ne[ut]===Le)return ut;return ut}function oc(Ne){return Eu(Ne)?Yb(Ne):d2(Ne)}function as(Ne){return Eu(Ne)?Xb(Ne):Fb(Ne)}function jm(Ne){for(var Le=Ne.length;Le--&&rl.test(Ne.charAt(Le)););return Le}var Qb=ym(l2);function Yb(Ne){for(var Le=sc.lastIndex=0;sc.test(Ne);)++Le;return Le}function Xb(Ne){return Ne.match(sc)||[]}function y2(Ne){return Ne.match(a2)||[]}var b2=(function Ne(Le){Le=Le==null?Qn:Pu.defaults(Qn.Object(),Le,Pu.pick(Qn,Ib));var Te=Le.Array,ut=Le.Date,Bt=Le.Error,jn=Le.Function,_r=Le.Math,Rn=Le.Object,uf=Le.RegExp,w2=Le.String,Ps=Le.TypeError,po=Te.prototype,Kv=jn.prototype,Ea=Rn.prototype,Cu=Le["__core-js_shared__"],df=Kv.toString,_n=Ea.hasOwnProperty,Au=0,_m=(function(){var x=/[^.]+$/.exec(Cu&&Cu.keys&&Cu.keys.IE_PROTO||"");return x?"Symbol(src)_1."+x:""})(),ff=Ea.toString,Nm=df.call(Rn),Zb=Qn._,Jb=uf("^"+df.call(_n).replace(Na,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hf=Mv?Le.Buffer:n,go=Le.Symbol,mf=Le.Uint8Array,Gv=hf?hf.allocUnsafe:n,Xs=Hv(Rn.getPrototypeOf,Rn),Sm=Rn.create,km=Ea.propertyIsEnumerable,Em=po.splice,ew=go?go.isConcatSpreadable:n,vo=go?go.iterator:n,lc=go?go.toStringTag:n,pf=(function(){try{var x=wl(Rn,"defineProperty");return x({},"",{}),x}catch{}})(),tw=Le.clearTimeout!==Qn.clearTimeout&&Le.clearTimeout,Vn=ut&&ut.now!==Qn.Date.now&&ut.now,Qv=Le.setTimeout!==Qn.setTimeout&&Le.setTimeout,cc=_r.ceil,dl=_r.floor,Pm=Rn.getOwnPropertySymbols,Yv=hf?hf.isBuffer:n,Ou=Le.isFinite,Cm=po.join,Tu=Hv(Rn.keys,Rn),Nr=_r.max,hi=_r.min,j2=ut.now,nw=Le.parseInt,gf=_r.random,Am=po.reverse,vf=wl(Le,"DataView"),uc=wl(Le,"Map"),xf=wl(Le,"Promise"),fl=wl(Le,"Set"),yf=wl(Le,"WeakMap"),Ru=wl(Rn,"create"),Om=yf&&new yf,Mu={},Xv=jl(vf),hl=jl(uc),rw=jl(xf),Iu=jl(fl),Pa=jl(yf),ml=go?go.prototype:n,os=ml?ml.valueOf:n,Tm=ml?ml.toString:n;function oe(x){if(kr(x)&&!Qt(x)&&!(x instanceof Gt)){if(x instanceof mi)return x;if(_n.call(x,"__wrapped__"))return Ow(x)}return new mi(x)}var Du=(function(){function x(){}return function(k){if(!pr(k))return{};if(Sm)return Sm(k);x.prototype=k;var D=new x;return x.prototype=n,D}})();function Ca(){}function mi(x,k){this.__wrapped__=x,this.__actions__=[],this.__chain__=!!k,this.__index__=0,this.__values__=n}oe.templateSettings={escape:fr,evaluate:Ar,interpolate:Qr,variable:"",imports:{_:oe}},oe.prototype=Ca.prototype,oe.prototype.constructor=oe,mi.prototype=Du(Ca.prototype),mi.prototype.constructor=mi;function Gt(x){this.__wrapped__=x,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=L,this.__views__=[]}function Rm(){var x=new Gt(this.__wrapped__);return x.__actions__=Oi(this.__actions__),x.__dir__=this.__dir__,x.__filtered__=this.__filtered__,x.__iteratees__=Oi(this.__iteratees__),x.__takeCount__=this.__takeCount__,x.__views__=Oi(this.__views__),x}function Zv(){if(this.__filtered__){var x=new Gt(this);x.__dir__=-1,x.__filtered__=!0}else x=this.clone(),x.__dir__*=-1;return x}function Lu(){var x=this.__wrapped__.value(),k=this.__dir__,D=Qt(x),K=k<0,te=D?x.length:0,ce=kx(0,te,this.__views__),ve=ce.start,be=ce.end,Se=be-ve,Ue=K?be:ve-1,Ve=this.__iteratees__,Qe=Ve.length,ot=0,_t=hi(Se,this.__takeCount__);if(!D||!K&&te==Se&&_t==Se)return Wu(x,this.__actions__);var Mt=[];e:for(;Se--&&ot<_t;){Ue+=k;for(var ln=-1,It=x[Ue];++ln<Qe;){var gn=Ve[ln],yn=gn.iteratee,oa=gn.type,fs=yn(It);if(oa==U)It=fs;else if(!fs){if(oa==B)continue e;break e}}Mt[ot++]=It}return Mt}Gt.prototype=Du(Ca.prototype),Gt.prototype.constructor=Gt;function Bi(x){var k=-1,D=x==null?0:x.length;for(this.clear();++k<D;){var K=x[k];this.set(K[0],K[1])}}function Wn(){this.__data__=Ru?Ru(null):{},this.size=0}function Bn(x){var k=this.has(x)&&delete this.__data__[x];return this.size-=k?1:0,k}function pl(x){var k=this.__data__;if(Ru){var D=k[x];return D===c?n:D}return _n.call(k,x)?k[x]:n}function pi(x){var k=this.__data__;return Ru?k[x]!==n:_n.call(k,x)}function Ui(x,k){var D=this.__data__;return this.size+=this.has(x)?0:1,D[x]=Ru&&k===n?c:k,this}Bi.prototype.clear=Wn,Bi.prototype.delete=Bn,Bi.prototype.get=pl,Bi.prototype.has=pi,Bi.prototype.set=Ui;function Ai(x){var k=-1,D=x==null?0:x.length;for(this.clear();++k<D;){var K=x[k];this.set(K[0],K[1])}}function Fu(){this.__data__=[],this.size=0}function Vi(x){var k=this.__data__,D=vi(k,x);if(D<0)return!1;var K=k.length-1;return D==K?k.pop():Em.call(k,D,1),--this.size,!0}function Mm(x){var k=this.__data__,D=vi(k,x);return D<0?n:k[D][1]}function iw(x){return vi(this.__data__,x)>-1}function sw(x,k){var D=this.__data__,K=vi(D,x);return K<0?(++this.size,D.push([x,k])):D[K][1]=k,this}Ai.prototype.clear=Fu,Ai.prototype.delete=Vi,Ai.prototype.get=Mm,Ai.prototype.has=iw,Ai.prototype.set=sw;function Cs(x){var k=-1,D=x==null?0:x.length;for(this.clear();++k<D;){var K=x[k];this.set(K[0],K[1])}}function aw(){this.size=0,this.__data__={hash:new Bi,map:new(uc||Ai),string:new Bi}}function xo(x){var k=If(this,x).delete(x);return this.size-=k?1:0,k}function Im(x){return If(this,x).get(x)}function Jv(x){return If(this,x).has(x)}function ow(x,k){var D=If(this,x),K=D.size;return D.set(x,k),this.size+=D.size==K?0:1,this}Cs.prototype.clear=aw,Cs.prototype.delete=xo,Cs.prototype.get=Im,Cs.prototype.has=Jv,Cs.prototype.set=ow;function dc(x){var k=-1,D=x==null?0:x.length;for(this.__data__=new Cs;++k<D;)this.add(x[k])}function gl(x){return this.__data__.set(x,c),this}function $u(x){return this.__data__.has(x)}dc.prototype.add=dc.prototype.push=gl,dc.prototype.has=$u;function gi(x){var k=this.__data__=new Ai(x);this.size=k.size}function Dm(){this.__data__=new Ai,this.size=0}function Lm(x){var k=this.__data__,D=k.delete(x);return this.size=k.size,D}function As(x){return this.__data__.get(x)}function Os(x){return this.__data__.has(x)}function fc(x,k){var D=this.__data__;if(D instanceof Ai){var K=D.__data__;if(!uc||K.length<s-1)return K.push([x,k]),this.size=++D.size,this;D=this.__data__=new Cs(K)}return D.set(x,k),this.size=D.size,this}gi.prototype.clear=Dm,gi.prototype.delete=Lm,gi.prototype.get=As,gi.prototype.has=Os,gi.prototype.set=fc;function Aa(x,k){var D=Qt(x),K=!D&&Kf(x),te=!D&&!K&&td(x),ce=!D&&!K&&!te&&kp(x),ve=D||K||te||ce,be=ve?Vv(x.length,w2):[],Se=be.length;for(var Ue in x)(k||_n.call(x,Ue))&&!(ve&&(Ue=="length"||te&&(Ue=="offset"||Ue=="parent")||ce&&(Ue=="buffer"||Ue=="byteLength"||Ue=="byteOffset")||Xn(Ue,Se)))&&be.push(Ue);return be}function Oa(x){var k=x.length;return k?x[Uu(0,k-1)]:n}function hc(x,k){return cp(Oi(x),yo(k,0,x.length))}function lw(x){return cp(Oi(x))}function bf(x,k,D){(D!==n&&!Co(x[k],D)||D===n&&!(k in x))&&Ta(x,k,D)}function mc(x,k,D){var K=x[k];(!(_n.call(x,k)&&Co(K,D))||D===n&&!(k in x))&&Ta(x,k,D)}function vi(x,k){for(var D=x.length;D--;)if(Co(x[D][0],k))return D;return-1}function ls(x,k,D,K){return Ma(x,function(te,ce,ve){k(K,te,D(te),ve)}),K}function Hn(x,k){return x&&Js(k,bi(k),x)}function Zs(x,k){return x&&Js(k,qs(k),x)}function Ta(x,k,D){k=="__proto__"&&pf?pf(x,k,{configurable:!0,enumerable:!0,value:D,writable:!0}):x[k]=D}function Fm(x,k){for(var D=-1,K=k.length,te=Te(K),ce=x==null;++D<K;)te[D]=ce?n:H2(x,k[D]);return te}function yo(x,k,D){return x===x&&(D!==n&&(x=x<=D?x:D),k!==n&&(x=x>=k?x:k)),x}function Wi(x,k,D,K,te,ce){var ve,be=k&d,Se=k&m,Ue=k&g;if(D&&(ve=te?D(x,K,te,ce):D(x)),ve!==n)return ve;if(!pr(x))return x;var Ve=Qt(x);if(Ve){if(ve=Lf(x),!be)return Oi(x,ve)}else{var Qe=Jr(x),ot=Qe==he||Qe==De;if(td(x))return mx(x,be);if(Qe==Xe||Qe==ne||ot&&!te){if(ve=Se||ot?{}
vendor: 8,419 bytes, line 1089
1089:ei(x),!be)return Se?N2(x,Zs(ve,x)):Xm(x,Hn(ve,x))}else{if(!Pn[Qe])return te?x:{};ve=S2(x,Qe,be)}}ce||(ce=new gi);var _t=ce.get(x);if(_t)return _t;ce.set(x,ve),O5(x)?x.forEach(function(It){ve.add(Wi(It,k,D,It,x,ce))}):C5(x)&&x.forEach(function(It,gn){ve.set(gn,Wi(It,k,D,gn,x,ce))});var Mt=Ue?Se?Mf:Rf:Se?qs:bi,ln=Ve?n:Mt(x);return fi(ln||x,function(It,gn){ln&&(gn=It,It=x[gn]),mc(ve,gn,Wi(It,k,D,gn,x,ce))}),ve}function cw(x){var k=bi(x);return function(D){return wf(D,x,k)}}function wf(x,k,D){var K=D.length;if(x==null)return!K;for(x=Rn(x);K--;){var te=D[K],ce=k[te],ve=x[te];if(ve===n&&!(te in x)||!ce(ve))return!1}return!0}function ex(x,k,D){if(typeof x!="function")throw new Ps(o);return Zu(function(){x.apply(n,D)},k)}function Ra(x,k,D,K){var te=-1,ce=vm,ve=!0,be=x.length,Se=[],Ue=k.length;if(!be)return Se;D&&(k=zn(k,ss(D))),K?(ce=Fv,ve=!1):k.length>=s&&(ce=mo,ve=!1,k=new dc(k));e:for(;++te<be;){var Ve=x[te],Qe=D==null?Ve:D(Ve);if(Ve=K||Ve!==0?Ve:0,ve&&Qe===Qe){for(var ot=Ue;ot--;)if(k[ot]===Qe)continue e;Se.push(Ve)}else ce(k,Qe,K)||Se.push(Ve)}return Se}var Ma=Ds(cs),uw=Ds(vl,!0);function jf(x,k){var D=!0;return Ma(x,function(K,te,ce){return D=!!k(K,te,ce),D}),D}function pc(x,k,D){for(var K=-1,te=x.length;++K<te;){var ce=x[K],ve=k(ce);if(ve!=null&&(be===n?ve===ve&&!aa(ve):D(ve,be)))var be=ve,Se=ce}return Se}function dw(x,k,D,K){var te=x.length;for(D=nn(D),D<0&&(D=-D>te?0:te+D),K=K===n||K>te?te:nn(K),K<0&&(K+=te),K=D>K?0:R5(K);D<K;)x[D++]=k;return x}function tx(x,k){var D=[];return Ma(x,function(K,te,ce){k(K,te,ce)&&D.push(K)}),D}function cr(x,k,D,K,te){var ce=-1,ve=x.length;for(D||(D=ap),te||(te=[]);++ce<ve;){var be=x[ce];k>0&&D(be)?k>1?cr(be,k-1,D,K,te):cl(te,be):K||(te[te.length]=be)}return te}var $m=Jm(),_f=Jm(!0);function cs(x,k){return x&&$m(x,k,bi)}function vl(x,k){return x&&_f(x,k,bi)}function qu(x,k){return ll(k,function(D){return Pc(x[D])})}function bo(x,k){k=La(k,x);for(var D=0,K=k.length;x!=null&&D<K;)x=x[ra(k[D++])];return D&&D==K?x:n}function qm(x,k,D){var K=k(x);return Qt(x)?K:cl(K,D(x))}function Xr(x){return x==null?x===n?ct:ze:lc&&lc in Rn(x)?sp(x):Px(x)}function xl(x,k){return x>k}function Ts(x,k){return x!=null&&_n.call(x,k)}function gc(x,k){return x!=null&&k in Rn(x)}function nx(x,k,D){return x>=hi(k,D)&&x<Nr(k,D)}function zm(x,k,D){for(var K=D?Fv:vm,te=x[0].length,ce=x.length,ve=ce,be=Te(ce),Se=1/0,Ue=[];ve--;){var Ve=x[ve];ve&&k&&(Ve=zn(Ve,ss(k))),Se=hi(Ve.length,Se),be[ve]=!D&&(k||te>=120&&Ve.length>=120)?new dc(ve&&Ve):n}Ve=x[0];var Qe=-1,ot=be[0];e:for(;++Qe<te&&Ue.length<Se;){var _t=Ve[Qe],Mt=k?k(_t):_t;if(_t=D||_t!==0?_t:0,!(ot?mo(ot,Mt):K(Ue,Mt,D))){for(ve=ce;--ve;){var ln=be[ve];if(!(ln?mo(ln,Mt):K(x[ve],Mt,D)))continue e}ot&&ot.push(Mt),Ue.push(_t)}}return Ue}function wo(x,k,D,K){return cs(x,function(te,ce,ve){k(K,D(te),ce,ve)}),K}function Rs(x,k,D){k=La(k,x),x=qr(x,k);var K=x==null?x:x[ra(Mi(k))];return K==null?n:Ci(K,x,D)}function Bm(x){return kr(x)&&Xr(x)==ne}function fw(x){return kr(x)&&Xr(x)==wn}function jo(x){return kr(x)&&Xr(x)==re}function Ms(x,k,D,K,te){return x===k?!0:x==null||k==null||!kr(x)&&!kr(k)?x!==x&&k!==k:Um(x,k,D,K,Ms,te)}function Um(x,k,D,K,te,ce){var ve=Qt(x),be=Qt(k),Se=ve?Y:Jr(x),Ue=be?Y:Jr(k);Se=Se==ne?Xe:Se,Ue=Ue==ne?Xe:Ue;var Ve=Se==Xe,Qe=Ue==Xe,ot=Se==Ue;if(ot&&td(x)){if(!td(k))return!1;ve=!0,Ve=!1}if(ot&&!Ve)return ce||(ce=new gi),ve||kp(x)?Nx(x,k,D,K,te,ce):Sx(x,k,Se,D,K,te,ce);if(!(D&w)){var _t=Ve&&_n.call(x,"__wrapped__"),Mt=Qe&&_n.call(k,"__wrapped__");if(_t||Mt){var ln=_t?x.value():x,It=Mt?k.value():k;return ce||(ce=new gi),te(ln,It,D,K,ce)}}return ot?(ce||(ce=new gi),_w(x,k,D,K,te,ce)):!1}function hw(x){return kr(x)&&Jr(x)==_e}function zu(x,k,D,K){var te=D.length,ce=te,ve=!K;if(x==null)return!ce;for(x=Rn(x);te--;){var be=D[te];if(ve&&be[2]?be[1]!==x[be[0]]:!(be[0]in x))return!1}for(;++te<ce;){be=D[te];var Se=be[0],Ue=x[Se],Ve=be[1];if(ve&&be[2]){if(Ue===n&&!(Se in x))return!1}else{var Qe=new gi;if(K)var ot=K(Ue,Ve,Se,x,k,Qe);if(!(ot===n?Ms(Ve,Ue,w|v,K,Qe):ot))return!1}}return!0}function rx(x){if(!pr(x)||kw(x))return!1;var k=Pc(x)?Jb:wb;return k.test(jl(x))}function Nf(x){return kr(x)&&Xr(x)==Be}function Ia(x){return kr(x)&&Jr(x)==de}function Sf(x){return kr(x)&&Ww(x.length)&&!!On[Xr(x)]}function Bu(x){return typeof x=="function"?x:x==null?zs:typeof x=="object"?Qt(x)?Yn(x[0],x[1]):Vm(x):V5(x)}function _o(x){if(!Eo(x))return Tu(x);var k=[];for(var D in Rn(x))_n.call(x,D)&&D!="constructor"&&k.push(D);return k}function ix(x){if(!pr(x))return Cw(x);var k=Eo(x),D=[];for(var K in x)K=="constructor"&&(k||!_n.call(x,K))||D.push(K);return D}function yl(x,k){return x<k}function sx(x,k){var D=-1,K=$s(x)?Te(x.length):[];return Ma(x,function(te,ce,ve){K[++D]=k(te,ce,ve)}),K}function Vm(x){var k=Df(x);return k.length==1&&k[0][2]?op(k[0][0],k[0][1]):function(D){return D===x||zu(D,x,k)}}function Yn(x,k){return mt(x)&&$f(k)?op(ra(x),k):function(D){var K=H2(D,x);return K===n&&K===k?K2(D,x):Ms(k,K,w|v)}}function vc(x,k,D,K,te){x!==k&&$m(k,function(ce,ve){if(te||(te=new gi),pr(ce))ax(x,k,ve,D,vc,K,te);else{var be=K?K(qa(x,ve),ce,ve+"",x,k,te):n;be===n&&(be=ce),bf(x,ve,be)}},qs)}function ax(x,k,D,K,te,ce,ve){var be=qa(x,D),Se=qa(k,D),Ue=ve.get(Se);if(Ue){bf(x,D,Ue);return}var Ve=ce?ce(be,Se,D+"",x,k,ve):n,Qe=Ve===n;if(Qe){var ot=Qt(Se),_t=!ot&&td(Se),Mt=!ot&&!_t&&kp(Se);Ve=Se,ot||_t||Mt?Qt(be)?Ve=be:Rr(be)?Ve=Oi(be):_t?(Qe=!1,Ve=mx(Se,!0)):Mt?(Qe=!1,Ve=xw(Se,!0)):Ve=[]:Hx(Se)||Kf(Se)?(Ve=be,Kf(be)?Ve=M5(be):(!pr(be)||Pc(be))&&(Ve=ei(Se))):Qe=!1}Qe&&(ve.set(Se,Ve),te(Ve,Se,K,ce,ve),ve.delete(Se)),bf(x,D,Ve)}function Wm(x,k){var D=x.length;if(D)return k+=k<0?D:0,Xn(k,D)?x[k]:n}function kf(x,k,D){k.length?k=zn(k,function(ce){return Qt(ce)?function(ve){return bo(ve,ce.length===1?ce[0]:ce)}:ce}):k=[zs];var K=-1;k=zn(k,ss(Ot()));var te=sx(x,function(ce,ve,be){var Se=zn(k,function(Ue){return Ue(ce)});return{criteria:Se,index:++K,value:ce}});return h2(te,function(ce,ve){return _2(ce,ve,D)})}function ox(x,k){return bl(x,k,function(D,K){return K2(x,K)})}function bl(x,k,D){for(var K=-1,te=k.length,ce={};++K<te;){var ve=k[K],be=bo(x,ve);D(be,ve)&&yc(ce,La(ve,x),be)}return ce}function sr(x){return function(k){return bo(k,x)}}function hr(x,k,D,K){var te=K?zv:Su,ce=-1,ve=k.length,be=x;for(x===k&&(k=Oi(k)),D&&(be=zn(x,ss(D)));++ce<ve;)for(var Se=0,Ue=k[ce],Ve=D?D(Ue):Ue;(Se=te(be,Ve,Se,K))>-1;)be!==x&&Em.call(be,Se,1),Em.call(x,Se,1);return x}function Or(x,k){for(var D=x?k.length:0,K=D-1;D--;){var te=k[D];if(D==K||te!==ce){var ce=te;Xn(te)?Em.call(x,te,1):Gm(x,te)}}return x}function Uu(x,k){return x+dl(gf()*(k-x+1))}function Ef(x,k,D,K){for(var te=-1,ce=Nr(cc((k-x)/(D||1)),0),ve=Te(ce);ce--;)ve[K?ce:++te]=x,x+=D;return ve}function xc(x,k){var D="";if(!x||k<1||k>X)return D;do k%2&&(D+=x),k=dl(k/2),k&&(x+=x);while(k);return D}function tn(x,k){return us(lp(x,k,zs),x+"")}function xi(x){return Oa(Ep(x))}function lx(x,k){var D=Ep(x);return cp(D,yo(k,0,D.length))}function yc(x,k,D,K){if(!pr(x))return x;k=La(k,x);for(var te=-1,ce=k.length,ve=ce-1,be=x;be!=null&&++te<ce;){var Se=ra(k[te]),Ue=D;if(Se==="__proto__"||Se==="constructor"||Se==="prototype")return x;if(te!=ve){var Ve=be[Se];Ue=K?K(Ve,Se,be):n,Ue===n&&(Ue=pr(Ve)?Ve:Xn(k[te+1])?[]:{})}mc(be,Se,Ue),be=be[Se]}return x}var Hm=Om?function(x,k){return Om.set(x,k),x}:zs,Da=pf?function(x,k){return pf(x,"toString",{configurable:!0,enumerable:!1,value:Q2(k),writable:!0})}:zs;function Is(x){return cp(Ep(x))}function yi(x,k,D){var K=-1,te=x.length;k<0&&(k=-k>te?0:te+k),D=D>te?te:D,D<0&&(D+=te),te=k>D?0:D-k>>>0,k>>>=0;for(var ce=Te(te);++K<te;)ce[K]=x[K+k];return ce}function cx(x,k){var D;return Ma(x,function(K,te,ce){return D=k(K,te,ce),!D}),!!D}function Vu(x,k,D){var K=0,te=x==null?K:x.length;if(typeof k=="number"&&k===k&&te<=Q){for(;K<te;){var ce=K+te>>>1,ve=x[ce];ve!==null&&!aa(ve)&&(D?ve<=k:ve<k)?K=ce+1:te=ce}return te}return Km(x,k,zs,D)}function Km(x,k,D,K){var te=0,ce=x==null?0:x.length;if(ce===0)return 0;k=D(k);for(var ve=k!==k,be=k===null,Se=aa(k),Ue=k===n;te<ce;){var Ve=dl((te+ce)/2),Qe=D(x[Ve]),ot=Qe!==n,_t=Qe===null,Mt=Qe===Qe,ln=aa(Qe);if(ve)var It=K||Mt;else Ue?It=Mt&&(K||ot):be?It=Mt&&ot&&(K||!_t):Se?It=Mt&&ot&&!_t&&(K||!ln):_t||ln?It=!1:It=K?Qe<=k:Qe<k;It?te=Ve+1:ce=Ve}return hi(ce,W)}function ux(x,k){for(var D=-1,K=x.length,te=0,ce=[];++D<K;){var ve=x[D],be=k?k(ve):ve;if(!D||!Co(be,Se)){var Se=be;ce[te++]=ve===0?0:ve}}return ce}function dx(x){return typeof x=="number"?x:aa(x)?z:+x}
vendor: 6,524 bytes, line 1089
1089function Hi(x){if(typeof x=="string")return x;if(Qt(x))return zn(x,Hi)+"";if(aa(x))return Tm?Tm.call(x):"";var k=x+"";return k=="0"&&1/x==-Z?"-0":k}function No(x,k,D){var K=-1,te=vm,ce=x.length,ve=!0,be=[],Se=be;if(D)ve=!1,te=Fv;else if(ce>=s){var Ue=k?null:jw(x);if(Ue)return ul(Ue);ve=!1,te=mo,Se=new dc}else Se=k?[]:be;e:for(;++K<ce;){var Ve=x[K],Qe=k?k(Ve):Ve;if(Ve=D||Ve!==0?Ve:0,ve&&Qe===Qe){for(var ot=Se.length;ot--;)if(Se[ot]===Qe)continue e;k&&Se.push(Qe),be.push(Ve)}else te(Se,Qe,D)||(Se!==be&&Se.push(Qe),be.push(Ve))}return be}function Gm(x,k){return k=La(k,x),x=qr(x,k),x==null||delete x[ra(Mi(k))]}function fx(x,k,D,K){return yc(x,k,D(bo(x,k)),K)}function Pf(x,k,D,K){for(var te=x.length,ce=K?te:-1;(K?ce--:++ce<te)&&k(x[ce],ce,x););return D?yi(x,K?0:ce,K?ce+1:te):yi(x,K?ce+1:0,K?te:ce)}function Wu(x,k){var D=x;return D instanceof Gt&&(D=D.value()),$v(k,function(K,te){return te.func.apply(te.thisArg,cl([K],te.args))},D)}function Qm(x,k,D){var K=x.length;if(K<2)return K?No(x[0]):[];for(var te=-1,ce=Te(K);++te<K;)for(var ve=x[te],be=-1;++be<K;)be!=te&&(ce[te]=Ra(ce[te]||ve,x[be],k,D));return No(cr(ce,1),k,D)}function Cf(x,k,D){for(var K=-1,te=x.length,ce=k.length,ve={};++K<te;){var be=K<ce?k[K]:n;D(ve,x[K],be)}return ve}function Hu(x){return Rr(x)?x:[]}function Ym(x){return typeof x=="function"?x:zs}function La(x,k){return Qt(x)?x:mt(x,k)?[x]:Ox(Mn(x))}var mw=tn;function So(x,k,D){var K=x.length;return D=D===n?K:D,!k&&D>=K?x:yi(x,k,D)}var hx=tw||function(x){return Qn.clearTimeout(x)};function mx(x,k){if(k)return x.slice();var D=x.length,K=Gv?Gv(D):new x.constructor(D);return x.copy(K),K}function Af(x){var k=new x.constructor(x.byteLength);return new mf(k).set(new mf(x)),k}function pw(x,k){var D=k?Af(x.buffer):x.buffer;return new x.constructor(D,x.byteOffset,x.byteLength)}function gw(x){var k=new x.constructor(x.source,kv.exec(x));return k.lastIndex=x.lastIndex,k}function vw(x){return os?Rn(os.call(x)):{}}function xw(x,k){var D=k?Af(x.buffer):x.buffer;return new x.constructor(D,x.byteOffset,x.length)}function px(x,k){if(x!==k){var D=x!==n,K=x===null,te=x===x,ce=aa(x),ve=k!==n,be=k===null,Se=k===k,Ue=aa(k);if(!be&&!Ue&&!ce&&x>k||ce&&ve&&Se&&!be&&!Ue||K&&ve&&Se||!D&&Se||!te)return 1;if(!K&&!ce&&!Ue&&x<k||Ue&&D&&te&&!K&&!ce||be&&D&&te||!ve&&te||!Se)return-1}return 0}function _2(x,k,D){for(var K=-1,te=x.criteria,ce=k.criteria,ve=te.length,be=D.length;++K<ve;){var Se=px(te[K],ce[K]);if(Se){if(K>=be)return Se;var Ue=D[K];return Se*(Ue=="desc"?-1:1)}}return x.index-k.index}function yw(x,k,D,K){for(var te=-1,ce=x.length,ve=D.length,be=-1,Se=k.length,Ue=Nr(ce-ve,0),Ve=Te(Se+Ue),Qe=!K;++be<Se;)Ve[be]=k[be];for(;++te<ve;)(Qe||te<ce)&&(Ve[D[te]]=x[te]);for(;Ue--;)Ve[be++]=x[te++];return Ve}function gx(x,k,D,K){for(var te=-1,ce=x.length,ve=-1,be=D.length,Se=-1,Ue=k.length,Ve=Nr(ce-be,0),Qe=Te(Ve+Ue),ot=!K;++te<Ve;)Qe[te]=x[te];for(var _t=te;++Se<Ue;)Qe[_t+Se]=k[Se];for(;++ve<be;)(ot||te<ce)&&(Qe[_t+D[ve]]=x[te++]);return Qe}function Oi(x,k){var D=-1,K=x.length;for(k||(k=Te(K));++D<K;)k[D]=x[D];return k}function Js(x,k,D,K){var te=!D;D||(D={});for(var ce=-1,ve=k.length;++ce<ve;){var be=k[ce],Se=K?K(D[be],x[be],be,D,x):n;Se===n&&(Se=x[be]),te?Ta(D,be,Se):mc(D,be,Se)}return D}function Xm(x,k){return Js(x,ea(x),k)}function N2(x,k){return Js(x,Nw(x),k)}function Zm(x,k){return function(D,K){var te=Qt(D)?Dv:ls,ce=k?k():{};return te(D,x,Ot(K,2),ce)}}function Ku(x){return tn(function(k,D){var K=-1,te=D.length,ce=te>1?D[te-1]:n,ve=te>2?D[2]:n;for(ce=x.length>3&&typeof ce=="function"?(te--,ce):n,ve&&Ri(D[0],D[1],ve)&&(ce=te<3?n:ce,te=1),k=Rn(k);++K<te;){var be=D[K];be&&x(k,be,K,ce)}return k})}function Ds(x,k){return function(D,K){if(D==null)return D;if(!$s(D))return x(D,K);for(var te=D.length,ce=k?te:-1,ve=Rn(D);(k?ce--:++ce<te)&&K(ve[ce],ce,ve)!==!1;);return D}}function Jm(x){return function(k,D,K){for(var te=-1,ce=Rn(k),ve=K(k),be=ve.length;be--;){var Se=ve[x?be:++te];if(D(ce[Se],Se,ce)===!1)break}return k}}function ep(x,k,D){var K=k&b,te=Gu(x);function ce(){var ve=this&&this!==Qn&&this instanceof ce?te:x;return ve.apply(K?D:this,arguments)}return ce}function vx(x){return function(k){k=Mn(k);var D=Eu(k)?as(k):n,K=D?D[0]:k.charAt(0),te=D?So(D,1).join(""):k.slice(1);return K[x]()+te}}function bc(x){return function(k){return $v(B5(z5(k).replace(s2,"")),x,"")}}function Gu(x){return function(){var k=arguments;switch(k.length){case 0:return new x;case 1:return new x(k[0]);case 2:return new x(k[0],k[1]);case 3:return new x(k[0],k[1],k[2]);case 4:return new x(k[0],k[1],k[2],k[3]);case 5:return new x(k[0],k[1],k[2],k[3],k[4]);case 6:return new x(k[0],k[1],k[2],k[3],k[4],k[5]);case 7:return new x(k[0],k[1],k[2],k[3],k[4],k[5],k[6])}var D=Du(x.prototype),K=x.apply(D,k);return pr(K)?K:D}}function xx(x,k,D){var K=Gu(x);function te(){for(var ce=arguments.length,ve=Te(ce),be=ce,Se=ko(te);be--;)ve[be]=arguments[be];var Ue=ce<3&&ve[0]!==Se&&ve[ce-1]!==Se?[]:Es(ve,Se);if(ce-=Ue.length,ce<D)return Ti(x,k,Qu,te.placeholder,n,ve,Ue,n,n,D-ce);var Ve=this&&this!==Qn&&this instanceof te?K:x;return Ci(Ve,this,ve)}return te}function wc(x){return function(k,D,K){var te=Rn(k);if(!$s(k)){var ce=Ot(D,3);k=bi(k),D=function(be){return ce(te[be],be,te)}}var ve=x(k,D,K);return ve>-1?te[ce?k[ve]:ve]:n}}function tp(x){return $a(function(k){var D=k.length,K=D,te=mi.prototype.thru;for(x&&k.reverse();K--;){var ce=k[K];if(typeof ce!="function")throw new Ps(o);if(te&&!ve&&Yu(ce)=="wrapper")var ve=new mi([],!0)}for(K=ve?K:D;++K<D;){ce=k[K];var be=Yu(ce),Se=be=="wrapper"?ip(ce):n;Se&&Ff(Se[0])&&Se[1]==(P|N|S|A)&&!Se[4].length&&Se[9]==1?ve=ve[Yu(Se[0])].apply(ve,Se[3]):ve=ce.length==1&&Ff(ce)?ve[be]():ve.thru(ce)}return function(){var Ue=arguments,Ve=Ue[0];if(ve&&Ue.length==1&&Qt(Ve))return ve.plant(Ve).value();for(var Qe=0,ot=D?k[Qe].apply(this,Ue):Ve;++Qe<D;)ot=k[Qe].call(this,ot);return ot}})}function Qu(x,k,D,K,te,ce,ve,be,Se,Ue){var Ve=k&P,Qe=k&b,ot=k&y,_t=k&(N|j),Mt=k&F,ln=ot?n:Gu(x);function It(){for(var gn=arguments.length,yn=Te(gn),oa=gn;oa--;)yn[oa]=arguments[oa];if(_t)var fs=ko(It),la=Wb(yn,fs);if(K&&(yn=yw(yn,K,te,_t)),ce&&(yn=gx(yn,ce,ve,_t)),gn-=la,_t&&gn<Ue){var Mr=Es(yn,fs);return Ti(x,k,Qu,It.placeholder,D,yn,Mr,be,Se,Ue-gn)}var Ao=Qe?D:this,Ac=ot?Ao[x]:x;return gn=yn.length,be?yn=ta(yn,be):Mt&&gn>1&&yn.reverse(),Ve&&Se<gn&&(yn.length=Se),this&&this!==Qn&&this instanceof It&&(Ac=ln||Gu(Ac)),Ac.apply(Ao,yn)}return It}function bw(x,k){return function(D,K){return wo(D,x,k(K),{})}}function Of(x,k){return function(D,K){var te;if(D===n&&K===n)return k;
vendor: 4,369 bytes, line 1089
1089if(D!==n&&(te=D),K!==n){if(te===n)return K;typeof D=="string"||typeof K=="string"?(D=Hi(D),K=Hi(K)):(D=dx(D),K=dx(K)),te=x(D,K)}return te}}function np(x){return $a(function(k){return k=zn(k,ss(Ot())),tn(function(D){var K=this;return x(k,function(te){return Ci(te,K,D)})})})}function Tf(x,k){k=k===n?" ":Hi(k);var D=k.length;if(D<2)return D?xc(k,x):k;var K=xc(k,cc(x/oc(k)));return Eu(k)?So(as(K),0,x).join(""):K.slice(0,x)}function ww(x,k,D,K){var te=k&b,ce=Gu(x);function ve(){for(var be=-1,Se=arguments.length,Ue=-1,Ve=K.length,Qe=Te(Ve+Se),ot=this&&this!==Qn&&this instanceof ve?ce:x;++Ue<Ve;)Qe[Ue]=K[Ue];for(;Se--;)Qe[Ue++]=arguments[++be];return Ci(ot,te?D:this,Qe)}return ve}function yx(x){return function(k,D,K){return K&&typeof K!="number"&&Ri(k,D,K)&&(D=K=n),k=Cc(k),D===n?(D=k,k=0):D=Cc(D),K=K===n?k<D?1:-1:Cc(K),Ef(k,D,K,x)}}function rp(x){return function(k,D){return typeof k=="string"&&typeof D=="string"||(k=za(k),D=za(D)),x(k,D)}}function Ti(x,k,D,K,te,ce,ve,be,Se,Ue){var Ve=k&N,Qe=Ve?ve:n,ot=Ve?n:ve,_t=Ve?ce:n,Mt=Ve?n:ce;k|=Ve?S:C,k&=~(Ve?C:S),k&_||(k&=-4);var ln=[x,k,te,_t,Qe,Mt,ot,be,Se,Ue],It=D.apply(n,ln);return Ff(x)&&Cx(It,ln),It.placeholder=K,Ax(It,x,k)}function Zr(x){var k=_r[x];return function(D,K){if(D=za(D),K=K==null?0:hi(nn(K),292),K&&Ou(D)){var te=(Mn(D)+"e").split("e"),ce=k(te[0]+"e"+(+te[1]+K));return te=(Mn(ce)+"e").split("e"),+(te[0]+"e"+(+te[1]-K))}return k(D)}}var jw=fl&&1/ul(new fl([,-0]))[1]==Z?function(x){return new fl(x)}:Z2;function bx(x){return function(k){var D=Jr(k);return D==_e?bm(k):D==de?v2(k):m2(k,x(k))}}function Fa(x,k,D,K,te,ce,ve,be){var Se=k&y;if(!Se&&typeof x!="function")throw new Ps(o);var Ue=K?K.length:0;if(Ue||(k&=-97,K=te=n),ve=ve===n?ve:Nr(nn(ve),0),be=be===n?be:nn(be),Ue-=te?te.length:0,k&C){var Ve=K,Qe=te;K=te=n}var ot=Se?n:ip(x),_t=[x,k,D,K,te,Ve,Qe,ce,ve,be];if(ot&&Pw(_t,ot),x=_t[0],k=_t[1],D=_t[2],K=_t[3],te=_t[4],be=_t[9]=_t[9]===n?Se?0:x.length:Nr(_t[9]-Ue,0),!be&&k&(N|j)&&(k&=-25),!k||k==b)var Mt=ep(x,k,D);else k==N||k==j?Mt=xx(x,k,be):(k==S||k==(b|S))&&!te.length?Mt=ww(x,k,D,K):Mt=Qu.apply(n,_t);var ln=ot?Hm:Cx;return Ax(ln(Mt,_t),x,k)}function wx(x,k,D,K){return x===n||Co(x,Ea[D])&&!_n.call(K,D)?k:x}function jx(x,k,D,K,te,ce){return pr(x)&&pr(k)&&(ce.set(k,x),vc(x,k,n,jx,ce),ce.delete(k)),x}function _x(x){return Hx(x)?n:x}function Nx(x,k,D,K,te,ce){var ve=D&w,be=x.length,Se=k.length;if(be!=Se&&!(ve&&Se>be))return!1;var Ue=ce.get(x),Ve=ce.get(k);if(Ue&&Ve)return Ue==k&&Ve==x;var Qe=-1,ot=!0,_t=D&v?new dc:n;for(ce.set(x,k),ce.set(k,x);++Qe<be;){var Mt=x[Qe],ln=k[Qe];if(K)var It=ve?K(ln,Mt,Qe,k,x,ce):K(Mt,ln,Qe,x,k,ce);if(It!==n){if(It)continue;ot=!1;break}if(_t){if(!qv(k,function(gn,yn){if(!mo(_t,yn)&&(Mt===gn||te(Mt,gn,D,K,ce)))return _t.push(yn)})){ot=!1;break}}else if(!(Mt===ln||te(Mt,ln,D,K,ce))){ot=!1;break}}return ce.delete(x),ce.delete(k),ot}function Sx(x,k,D,K,te,ce,ve){switch(D){case an:if(x.byteLength!=k.byteLength||x.byteOffset!=k.byteOffset)return!1;x=x.buffer,k=k.buffer;case wn:return!(x.byteLength!=k.byteLength||!ce(new mf(x),new mf(k)));case le:case re:case We:return Co(+x,+k);case ge:return x.name==k.name&&x.message==k.message;case Be:case Pe:return x==k+"";case _e:var be=bm;case de:var Se=K&w;if(be||(be=ul),x.size!=k.size&&!Se)return!1;var Ue=ve.get(x);if(Ue)return Ue==k;K|=v,ve.set(x,k);var Ve=Nx(be(x),be(k),K,te,ce,ve);return ve.delete(x),Ve;case Ze:if(os)return os.call(x)==os.call(k)}return!1}function _w(x,k,D,K,te,ce){var ve=D&w,be=Rf(x),Se=be.length,Ue=Rf(k),Ve=Ue.length;if(Se!=Ve&&!ve)return!1;for(var Qe=Se;Qe--;){var ot=be[Qe];if(!(ve?ot in k:_n.call(k,ot)))return!1}var _t=ce.get(x),Mt=ce.get(k);if(_t&&Mt)return _t==k&&Mt==x;var ln=!0;ce.set(x,k),ce.set(k,x);for(var It=ve;++Qe<Se;){ot=be[Qe];var gn=x[ot],yn=k[ot];if(K)var oa=ve?K(yn,gn,ot,k,x,ce):K(gn,yn,ot,x,k,ce);if(!(oa===n?gn===yn||te(gn,yn,D,K,ce):oa)){ln=!1;break}It||(It=ot=="constructor")}if(ln&&!It){var fs=x.constructor,la=k.constructor;fs!=la&&"constructor"in x&&"constructor"in k&&!(typeof fs=="function"&&fs instanceof fs&&typeof la=="function"&&la instanceof la)&&(ln=!1)}return ce.delete(x),ce.delete(k),ln}function $a(x){return us(lp(x,n,dp),x+"")}function Rf(x){return qm(x,bi,ea)}function Mf(x){return qm(x,qs,Nw)}var ip=Om?function(x){return Om.get(x)}:Z2;function Yu(x){for(var k=x.name+"",D=Mu[k],K=_n.call(Mu,k)?D.length:0;K--;){var te=D[K],ce=te.func;
vendor: 6,569 bytes, lines 1089-1091
1089if(ce==null||ce==x)return te.name}return k}function ko(x){var k=_n.call(oe,"placeholder")?oe:x;return k.placeholder}function Ot(){var x=oe.iteratee||Y2;return x=x===Y2?Bu:x,arguments.length?x(arguments[0],arguments[1]):x}function If(x,k){var D=x.__data__;return Xu(k)?D[typeof k=="string"?"string":"hash"]:D.map}function Df(x){for(var k=bi(x),D=k.length;D--;){var K=k[D],te=x[K];k[D]=[K,te,$f(te)]}return k}function wl(x,k){var D=ku(x,k);return rx(D)?D:n}function sp(x){var k=_n.call(x,lc),D=x[lc];try{x[lc]=n;var K=!0}catch{}var te=ff.call(x);return K&&(k?x[lc]=D:delete x[lc]),te}var ea=Pm?function(x){return x==null?[]:(x=Rn(x),ll(Pm(x),function(k){return km.call(x,k)}))}:J2,Nw=Pm?function(x){for(var k=[];x;)cl(k,ea(x)),x=Xs(x);return k}:J2,Jr=Xr;(vf&&Jr(new vf(new ArrayBuffer(1)))!=an||uc&&Jr(new uc)!=_e||xf&&Jr(xf.resolve())!=ke||fl&&Jr(new fl)!=de||yf&&Jr(new yf)!=pt)&&(Jr=function(x){var k=Xr(x),D=k==Xe?x.constructor:n,K=D?jl(D):"";if(K)switch(K){case Xv:return an;case hl:return _e;case rw:return ke;case Iu:return de;case Pa:return pt}return k});function kx(x,k,D){for(var K=-1,te=D.length;++K<te;){var ce=D[K],ve=ce.size;switch(ce.type){case"drop":x+=ve;break;case"dropRight":k-=ve;break;case"take":k=hi(k,x+ve);break;case"takeRight":x=Nr(x,k-ve);break}}return{start:x,end:k}}function Sw(x){var k=x.match(ef);return k?k[1].split(Sv):[]}function Ex(x,k,D){k=La(k,x);for(var K=-1,te=k.length,ce=!1;++K<te;){var ve=ra(k[K]);if(!(ce=x!=null&&D(x,ve)))break;x=x[ve]}return ce||++K!=te?ce:(te=x==null?0:x.length,!!te&&Ww(te)&&Xn(ve,te)&&(Qt(x)||Kf(x)))}function Lf(x){var k=x.length,D=new x.constructor(k);return k&&typeof x[0]=="string"&&_n.call(x,"index")&&(D.index=x.index,D.input=x.input),D}function ei(x){return typeof x.constructor=="function"&&!Eo(x)?Du(Xs(x)):{}}function S2(x,k,D){var K=x.constructor;switch(k){case wn:return Af(x);case le:case re:return new K(+x);case an:return pw(x,D);case is:case on:case ir:case Ns:case el:case vu:case xu:case tl:case ec:return xw(x,D);case _e:return new K;case We:case Pe:return new K(x);case Be:return gw(x);case de:return new K;case Ze:return vw(x)}}function k2(x,k){var D=k.length;if(!D)return x;var K=D-1;return k[K]=(D>1?"& ":"")+k[K],k=k.join(D>2?", ":" "),x.replace(ks,`{
1090/* [wrapped with `+k+`] */
1091`)}function ap(x){return Qt(x)||Kf(x)||!!(ew&&x&&x[ew])}function Xn(x,k){var D=typeof x;return k=k??X,!!k&&(D=="number"||D!="symbol"&&_b.test(x))&&x>-1&&x%1==0&&x<k}function Ri(x,k,D){if(!pr(D))return!1;var K=typeof k;return(K=="number"?$s(D)&&Xn(k,D.length):K=="string"&&k in D)?Co(D[k],x):!1}function mt(x,k){if(Qt(x))return!1;var D=typeof x;return D=="number"||D=="symbol"||D=="boolean"||x==null||aa(x)?!0:jr.test(x)||!nl.test(x)||k!=null&&x in Rn(k)}function Xu(x){var k=typeof x;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?x!=="__proto__":x===null}function Ff(x){var k=Yu(x),D=oe[k];if(typeof D!="function"||!(k in Gt.prototype))return!1;if(x===D)return!0;var K=ip(D);return!!K&&x===K[0]}function kw(x){return!!_m&&_m in x}var E2=Cu?Pc:eS;function Eo(x){var k=x&&x.constructor,D=typeof k=="function"&&k.prototype||Ea;return x===D}function $f(x){return x===x&&!pr(x)}function op(x,k){return function(D){return D==null?!1:D[x]===k&&(k!==n||x in Rn(D))}}function Ew(x){var k=Oe(x,function(K){return D.size===u&&D.clear(),K}),D=k.cache;return k}function Pw(x,k){var D=x[1],K=k[1],te=D|K,ce=te<(b|y|P),ve=K==P&&D==N||K==P&&D==A&&x[7].length<=k[8]||K==(P|A)&&k[7].length<=k[8]&&D==N;if(!(ce||ve))return x;K&b&&(x[2]=k[2],te|=D&b?0:_);var be=k[3];if(be){var Se=x[3];x[3]=Se?yw(Se,be,k[4]):be,x[4]=Se?Es(x[3],h):k[4]}return be=k[5],be&&(Se=x[5],x[5]=Se?gx(Se,be,k[6]):be,x[6]=Se?Es(x[5],h):k[6]),be=k[7],be&&(x[7]=be),K&P&&(x[8]=x[8]==null?k[8]:hi(x[8],k[8])),x[9]==null&&(x[9]=k[9]),x[0]=k[0],x[1]=te,x}function Cw(x){var k=[];if(x!=null)for(var D in Rn(x))k.push(D);return k}function Px(x){return ff.call(x)}function lp(x,k,D){return k=Nr(k===n?x.length-1:k,0),function(){for(var K=arguments,te=-1,ce=Nr(K.length-k,0),ve=Te(ce);++te<ce;)ve[te]=K[k+te];te=-1;for(var be=Te(k+1);++te<k;)be[te]=K[te];return be[k]=D(ve),Ci(x,this,be)}}function qr(x,k){return k.length<2?x:bo(x,yi(k,0,-1))}function ta(x,k){for(var D=x.length,K=hi(k.length,D),te=Oi(x);K--;){var ce=k[K];x[K]=Xn(ce,D)?te[ce]:n}return x}function qa(x,k){if(!(k==="constructor"&&typeof x[k]=="function")&&k!="__proto__")return x[k]}var Cx=na(Hm),Zu=Qv||function(x,k){return Qn.setTimeout(x,k)},us=na(Da);function Ax(x,k,D){var K=k+"";return us(x,k2(K,Aw(Sw(K),D)))}function na(x){var k=0,D=0;return function(){var K=j2(),te=$-(K-D);if(D=K,te>0){if(++k>=M)return arguments[0]}else k=0;return x.apply(n,arguments)}}function cp(x,k){var D=-1,K=x.length,te=K-1;for(k=k===n?K:k;++D<k;){var ce=Uu(D,te),ve=x[ce];x[ce]=x[D],x[D]=ve}return x.length=k,x}var Ox=Ew(function(x){var k=[];return x.charCodeAt(0)===46&&k.push(""),x.replace($r,function(D,K,te,ce){k.push(te?ce.replace(JN,"$1"):K||D)}),k});function ra(x){if(typeof x=="string"||aa(x))return x;var k=x+"";return k=="0"&&1/x==-Z?"-0":k}function jl(x){if(x!=null){try{return df.call(x)}catch{}try{return x+""}catch{}}return""}function Aw(x,k){return fi(J,function(D){var K="_."+D[0];k&D[1]&&!vm(x,K)&&x.push(K)}),x.sort()}function Ow(x){if(x instanceof Gt)return x.clone();var k=new mi(x.__wrapped__,x.__chain__);return k.__actions__=Oi(x.__actions__),k.__index__=x.__index__,k.__values__=x.__values__,k}function up(x,k,D){(D?Ri(x,k,D):k===n)?k=1:k=Nr(nn(k),0);var K=x==null?0:x.length;if(!K||k<1)return[];for(var te=0,ce=0,ve=Te(cc(K/k));te<K;)ve[ce++]=yi(x,te,te+=k);return ve}function Tx(x){for(var k=-1,D=x==null?0:x.length,K=0,te=[];++k<D;){var ce=x[k];ce&&(te[K++]=ce)}return te}function Ls(){var x=arguments.length;if(!x)return[];for(var k=Te(x-1),D=arguments[0],K=x;K--;)k[K-1]=arguments[K];return cl(Qt(D)?Oi(D):[D],cr(k,1))}var xn=tn(function(x,k){return Rr(x)?Ra(x,cr(k,1,Rr,!0)):[]}),zr=tn(function(x,k){var D=Mi(k);return Rr(D)&&(D=n),Rr(x)?Ra(x,cr(k,1,Rr,!0),Ot(D,2)):[]}),Sr=tn(function(x,k){var D=Mi(k);return Rr(D)&&(D=n),Rr(x)?Ra(x,cr(k,1,Rr,!0),n,D):[]});function ti(x,k,D){var K=x==null?0:x.length;return K?(k=D||k===n?1:nn(k),yi(x,k<0?0:k,K)):[]}function ds(x,k,D){var K=x==null?0:x.length;return K?(k=D||k===n?1:nn(k),k=K-k,yi(x,0,k<0?0:k)):[]}function Ju(x,k){return x&&x.length?Pf(x,Ot(k,3),!0,!0):[]}function Tr(x,k){return x&&x.length?Pf(x,Ot(k,3),!0):[]}function qf(x,k,D,K){var te=x==null?0:x.length;return te?(D&&typeof D!="number"&&Ri(x,k,D)&&(D=0,K=te),dw(x,k,D,K)):[]}function _l(x,k,D){var K=x==null?0:x.length;if(!K)return-1;var te=D==null?0:nn(D);
vendor: 4,663 bytes, line 1091
1091return te<0&&(te=Nr(K+te,0)),xm(x,Ot(k,3),te)}function zf(x,k,D){var K=x==null?0:x.length;if(!K)return-1;var te=K-1;return D!==n&&(te=nn(D),te=D<0?Nr(K+te,0):hi(te,K-1)),xm(x,Ot(k,3),te,!0)}function dp(x){var k=x==null?0:x.length;return k?cr(x,1):[]}function Bf(x){var k=x==null?0:x.length;return k?cr(x,Z):[]}function Ki(x,k){var D=x==null?0:x.length;return D?(k=k===n?1:nn(k),cr(x,k)):[]}function Rx(x){for(var k=-1,D=x==null?0:x.length,K={};++k<D;){var te=x[k];K[te[0]]=te[1]}return K}function jc(x){return x&&x.length?x[0]:n}function Po(x,k,D){var K=x==null?0:x.length;if(!K)return-1;var te=D==null?0:nn(D);return te<0&&(te=Nr(K+te,0)),Su(x,k,te)}function fp(x){var k=x==null?0:x.length;return k?yi(x,0,-1):[]}var Mx=tn(function(x){var k=zn(x,Hu);return k.length&&k[0]===x[0]?zm(k):[]}),Nl=tn(function(x){var k=Mi(x),D=zn(x,Hu);return k===Mi(D)?k=n:D.pop(),D.length&&D[0]===x[0]?zm(D,Ot(k,2)):[]}),hp=tn(function(x){var k=Mi(x),D=zn(x,Hu);return k=typeof k=="function"?k:n,k&&D.pop(),D.length&&D[0]===x[0]?zm(D,n,k):[]});function Sl(x,k){return x==null?"":Cm.call(x,k)}function Mi(x){var k=x==null?0:x.length;return k?x[k-1]:n}function Uf(x,k,D){var K=x==null?0:x.length;if(!K)return-1;var te=K;return D!==n&&(te=nn(D),te=te<0?Nr(K+te,0):hi(te,K-1)),k===k?x2(x,k,te):xm(x,qb,te,!0)}function Ix(x,k){return x&&x.length?Wm(x,nn(k)):n}var mp=tn(Vf);function Vf(x,k){return x&&x.length&&k&&k.length?hr(x,k):x}function Ii(x,k,D){return x&&x.length&&k&&k.length?hr(x,k,Ot(D,2)):x}function kl(x,k,D){return x&&x.length&&k&&k.length?hr(x,k,n,D):x}var ia=$a(function(x,k){var D=x==null?0:x.length,K=Fm(x,k);return Or(x,zn(k,function(te){return Xn(te,D)?+te:te}).sort(px)),K});function Gi(x,k){var D=[];if(!(x&&x.length))return D;var K=-1,te=[],ce=x.length;for(k=Ot(k,3);++K<ce;){var ve=x[K];k(ve,K,x)&&(D.push(ve),te.push(K))}return Or(x,te),D}function pp(x){return x==null?x:Am.call(x)}function Dx(x,k,D){var K=x==null?0:x.length;return K?(D&&typeof D!="number"&&Ri(x,k,D)?(k=0,D=K):(k=k==null?0:nn(k),D=D===n?K:nn(D)),yi(x,k,D)):[]}function Lx(x,k){return Vu(x,k)}function P2(x,k,D){return Km(x,k,Ot(D,2))}function El(x,k){var D=x==null?0:x.length;if(D){var K=Vu(x,k);if(K<D&&Co(x[K],k))return K}return-1}function Tw(x,k){return Vu(x,k,!0)}function Fx(x,k,D){return Km(x,k,Ot(D,2),!0)}function _c(x,k){var D=x==null?0:x.length;if(D){var K=Vu(x,k,!0)-1;if(Co(x[K],k))return K}return-1}function $x(x){return x&&x.length?ux(x):[]}function Nc(x,k){return x&&x.length?ux(x,Ot(k,2)):[]}function Rw(x){var k=x==null?0:x.length;return k?yi(x,1,k):[]}function Mw(x,k,D){return x&&x.length?(k=D||k===n?1:nn(k),yi(x,0,k<0?0:k)):[]}function qx(x,k,D){var K=x==null?0:x.length;return K?(k=D||k===n?1:nn(k),k=K-k,yi(x,k<0?0:k,K)):[]}function gp(x,k){return x&&x.length?Pf(x,Ot(k,3),!1,!0):[]}function C2(x,k){return x&&x.length?Pf(x,Ot(k,3)):[]}var A2=tn(function(x){return No(cr(x,1,Rr,!0))}),Iw=tn(function(x){var k=Mi(x);return Rr(k)&&(k=n),No(cr(x,1,Rr,!0),Ot(k,2))}),Dw=tn(function(x){var k=Mi(x);return k=typeof k=="function"?k:n,No(cr(x,1,Rr,!0),n,k)});function Sc(x){return x&&x.length?No(x):[]}function O2(x,k){return x&&x.length?No(x,Ot(k,2)):[]}function ed(x,k){return k=typeof k=="function"?k:n,x&&x.length?No(x,n,k):[]}function vp(x){if(!(x&&x.length))return[];var k=0;return x=ll(x,function(D){if(Rr(D))return k=Nr(D.length,k),!0}),Vv(k,function(D){return zn(x,Bv(D))})}function ar(x,k){if(!(x&&x.length))return[];var D=vp(x);return k==null?D:zn(D,function(K){return Ci(k,n,K)})}var T2=tn(function(x,k){return Rr(x)?Ra(x,k):[]}),Lw=tn(function(x){return Qm(ll(x,Rr))}),R2=tn(function(x){var k=Mi(x);return Rr(k)&&(k=n),Qm(ll(x,Rr),Ot(k,2))}),M2=tn(function(x){var k=Mi(x);return k=typeof k=="function"?k:n,Qm(ll(x,Rr),n,k)}),Fw=tn(vp);function $w(x,k){return Cf(x||[],k||[],mc)}function I2(x,k){return Cf(x||[],k||[],yc)}var Fs=tn(function(x){var k=x.length,D=k>1?x[k-1]:n;return D=typeof D=="function"?(x.pop(),D):n,ar(x,D)});function xp(x){var k=oe(x);return k.__chain__=!0,k}function D2(x,k){return k(x),x}function sa(x,k){return k(x)}var yp=$a(function(x){var k=x.length,D=k?x[0]:0,K=this.__wrapped__,te=function(ce){return Fm(ce,x)};return k>1||this.__actions__.length||!(K instanceof Gt)||!Xn(D)?this.thru(te):(K=K.slice(D,+D+(k?1:0)),K.__actions__.push({func:sa,args:[te],thisArg:n}),new mi(K,this.__chain__).thru(function(ce){return k&&!ce.length&&ce.push(n),ce}))});function kc(){return xp(this)}function bp(){return new mi(this.value(),this.__chain__)}function zx(){this.__values__===n&&(this.__values__=T5(this.value()));var x=this.__index__>=this.__values__.length,k=x?n:this.__values__[this.__index__++];return{done:x,value:k}}function Bx(){return this}
vendor: 6,331 bytes, line 1091
1091function L2(x){for(var k,D=this;D instanceof Ca;){var K=Ow(D);K.__index__=0,K.__values__=n,k?te.__wrapped__=K:k=K;var te=K;D=D.__wrapped__}return te.__wrapped__=x,k}function Ux(){var x=this.__wrapped__;if(x instanceof Gt){var k=x;return this.__actions__.length&&(k=new Gt(this)),k=k.reverse(),k.__actions__.push({func:sa,args:[pp],thisArg:n}),new mi(k,this.__chain__)}return this.thru(pp)}function F2(){return Wu(this.__wrapped__,this.__actions__)}var qw=Zm(function(x,k,D){_n.call(x,D)?++x[D]:Ta(x,D,1)});function zw(x,k,D){var K=Qt(x)?Lv:jf;return D&&Ri(x,k,D)&&(k=n),K(x,Ot(k,3))}function wp(x,k){var D=Qt(x)?ll:tx;return D(x,Ot(k,3))}var jp=wc(_l),Bw=wc(zf);function Vx(x,k){return cr(Ec(x,k),1)}function $2(x,k){return cr(Ec(x,k),Z)}function Uw(x,k,D){return D=D===n?1:nn(D),cr(Ec(x,k),D)}function _p(x,k){var D=Qt(x)?fi:Ma;return D(x,Ot(k,3))}function Wf(x,k){var D=Qt(x)?gm:uw;return D(x,Ot(k,3))}var Wx=Zm(function(x,k,D){_n.call(x,D)?x[D].push(k):Ta(x,D,[k])});function Np(x,k,D,K){x=$s(x)?x:Ep(x),D=D&&!K?nn(D):0;var te=x.length;return D<0&&(D=Nr(te+D,0)),Hw(x)?D<=te&&x.indexOf(k,D)>-1:!!te&&Su(x,k,D)>-1}var Vw=tn(function(x,k,D){var K=-1,te=typeof k=="function",ce=$s(x)?Te(x.length):[];return Ma(x,function(ve){ce[++K]=te?Ci(k,ve,D):Rs(ve,k,D)}),ce}),q2=Zm(function(x,k,D){Ta(x,D,k)});function Ec(x,k){var D=Qt(x)?zn:sx;return D(x,Ot(k,3))}function z2(x,k,D,K){return x==null?[]:(Qt(k)||(k=k==null?[]:[k]),D=K?n:D,Qt(D)||(D=D==null?[]:[D]),kf(x,k,D))}var Hf=Zm(function(x,k,D){x[D?0:1].push(k)},function(){return[[],[]]});function B2(x,k,D){var K=Qt(x)?$v:Bb,te=arguments.length<3;return K(x,Ot(k,4),D,te,Ma)}function Sp(x,k,D){var K=Qt(x)?u2:Bb,te=arguments.length<3;return K(x,Ot(k,4),D,te,uw)}function f(x,k){var D=Qt(x)?ll:tx;return D(x,Je(Ot(k,3)))}function p(x){var k=Qt(x)?Oa:xi;return k(x)}function E(x,k,D){(D?Ri(x,k,D):k===n)?k=1:k=nn(k);var K=Qt(x)?hc:lx;return K(x,k)}function T(x){var k=Qt(x)?lw:Is;return k(x)}function q(x){if(x==null)return 0;if($s(x))return Hw(x)?oc(x):x.length;var k=Jr(x);return k==_e||k==de?x.size:_o(x).length}function H(x,k,D){var K=Qt(x)?qv:cx;return D&&Ri(x,k,D)&&(k=n),K(x,Ot(k,3))}var ie=tn(function(x,k){if(x==null)return[];var D=k.length;return D>1&&Ri(x,k[0],k[1])?k=[]:D>2&&Ri(k[0],k[1],k[2])&&(k=[k[0]]),kf(x,cr(k,1),[])}),pe=Vn||function(){return Qn.Date.now()};function ye(x,k){if(typeof k!="function")throw new Ps(o);return x=nn(x),function(){if(--x<1)return k.apply(this,arguments)}}function Re(x,k,D){return k=D?n:k,k=x&&k==null?x.length:k,Fa(x,P,n,n,n,n,k)}function Ge(x,k){var D;if(typeof k!="function")throw new Ps(o);return x=nn(x),function(){return--x>0&&(D=k.apply(this,arguments)),x<=1&&(k=n),D}}var Ye=tn(function(x,k,D){var K=b;if(D.length){var te=Es(D,ko(Ye));K|=S}return Fa(x,K,k,D,te)}),Ke=tn(function(x,k,D){var K=b|y;if(D.length){var te=Es(D,ko(Ke));K|=S}return Fa(k,K,x,D,te)});function dt(x,k,D){k=D?n:k;var K=Fa(x,N,n,n,n,n,n,k);return K.placeholder=dt.placeholder,K}function gt(x,k,D){k=D?n:k;var K=Fa(x,j,n,n,n,n,n,k);return K.placeholder=gt.placeholder,K}function xt(x,k,D){var K,te,ce,ve,be,Se,Ue=0,Ve=!1,Qe=!1,ot=!0;if(typeof x!="function")throw new Ps(o);k=za(k)||0,pr(D)&&(Ve=!!D.leading,Qe="maxWait"in D,ce=Qe?Nr(za(D.maxWait)||0,k):ce,ot="trailing"in D?!!D.trailing:ot);function _t(Mr){var Ao=K,Ac=te;return K=te=n,Ue=Mr,ve=x.apply(Ac,Ao),ve}function Mt(Mr){return Ue=Mr,be=Zu(gn,k),Ve?_t(Mr):ve}function ln(Mr){var Ao=Mr-Se,Ac=Mr-Ue,W5=k-Ao;return Qe?hi(W5,ce-Ac):W5}function It(Mr){var Ao=Mr-Se,Ac=Mr-Ue;return Se===n||Ao>=k||Ao<0||Qe&&Ac>=ce}function gn(){var Mr=pe();if(It(Mr))return yn(Mr);be=Zu(gn,ln(Mr))}function yn(Mr){return be=n,ot&&K?_t(Mr):(K=te=n,ve)}function oa(){be!==n&&hx(be),Ue=0,K=Se=te=be=n}function fs(){return be===n?ve:yn(pe())}function la(){var Mr=pe(),Ao=It(Mr);if(K=arguments,te=this,Se=Mr,Ao){if(be===n)return Mt(Se);if(Qe)return hx(be),be=Zu(gn,k),_t(Se)}return be===n&&(be=Zu(gn,k)),ve}return la.cancel=oa,la.flush=fs,la}var mr=tn(function(x,k){return ex(x,1,k)}),Ce=tn(function(x,k,D){return ex(x,za(k)||0,D)});function we(x){return Fa(x,F)}function Oe(x,k){if(typeof x!="function"||k!=null&&typeof k!="function")throw new Ps(o);var D=function(){var K=arguments,te=k?k.apply(this,K):K[0],ce=D.cache;if(ce.has(te))return ce.get(te);var ve=x.apply(this,K);return D.cache=ce.set(te,ve)||ce,ve};return D.cache=new(Oe.Cache||Cs),D}Oe.Cache=Cs;function Je(x){if(typeof x!="function")throw new Ps(o);return function(){var k=arguments;switch(k.length){case 0:return!x.call(this);case 1:return!x.call(this,k[0]);case 2:return!x.call(this,k[0],k[1]);case 3:return!x.call(this,k[0],k[1],k[2])}return!x.apply(this,k)}}function jt(x){return Ge(2,x)}var Ct=mw(function(x,k){k=k.length==1&&Qt(k[0])?zn(k[0],ss(Ot())):zn(cr(k,1),ss(Ot()));var D=k.length;return tn(function(K){for(var te=-1,ce=hi(K.length,D);++te<ce;)K[te]=k[te].call(this,K[te]);return Ci(x,this,K)})}),St=tn(function(x,k){var D=Es(k,ko(St));return Fa(x,S,n,k,D)}),Rt=tn(function(x,k){var D=Es(k,ko(Rt));return Fa(x,C,n,k,D)}),Br=$a(function(x,k){return Fa(x,A,n,n,n,k)});function Nn(x,k){if(typeof x!="function")throw new Ps(o);return k=k===n?k:nn(k),tn(x,k)}function Pl(x,k){if(typeof x!="function")throw new Ps(o);return k=k==null?0:Nr(nn(k),0),tn(function(D){var K=D[k],te=So(D,0,k);return K&&cl(te,K),Ci(x,this,te)})}function U2(x,k,D){var K=!0,te=!0;if(typeof x!="function")throw new Ps(o);return pr(D)&&(K="leading"in D?!!D.leading:K,te="trailing"in D?!!D.trailing:te),xt(x,k,{leading:K,maxWait:k,trailing:te})}function nX(x){return Re(x,1)}function rX(x,k){return St(Ym(k),x)}function iX(){if(!arguments.length)return[];var x=arguments[0];return Qt(x)?x:[x]}function sX(x){return Wi(x,g)}function aX(x,k){return k=typeof k=="function"?k:n,Wi(x,g,k)}function oX(x){return Wi(x,d|g)}function lX(x,k){return k=typeof k=="function"?k:n,Wi(x,d|g,k)}function cX(x,k){return k==null||wf(x,k,bi(k))}function Co(x,k){return x===k||x!==x&&k!==k}var uX=rp(xl),dX=rp(function(x,k){return x>=k}),Kf=Bm((function(){return arguments})())?Bm:function(x){return kr(x)&&_n.call(x,"callee")&&!km.call(x,"callee")},Qt=Te.isArray,fX=Iv?ss(Iv):fw;function $s(x){return x!=null&&Ww(x.length)&&!Pc(x)}function Rr(x){return kr(x)&&$s(x)}function hX(x){return x===!0||x===!1||kr(x)&&Xr(x)==le}var td=Yv||eS,mX=zi?ss(zi):jo;function pX(x){return kr(x)&&x.nodeType===1&&!Hx(x)}
vendor: 5,051 bytes, line 1091
1091function gX(x){if(x==null)return!0;if($s(x)&&(Qt(x)||typeof x=="string"||typeof x.splice=="function"||td(x)||kp(x)||Kf(x)))return!x.length;var k=Jr(x);if(k==_e||k==de)return!x.size;if(Eo(x))return!_o(x).length;for(var D in x)if(_n.call(x,D))return!1;return!0}function vX(x,k){return Ms(x,k)}function xX(x,k,D){D=typeof D=="function"?D:n;var K=D?D(x,k):n;return K===n?Ms(x,k,n,D):!!K}function V2(x){if(!kr(x))return!1;var k=Xr(x);return k==ge||k==fe||typeof x.message=="string"&&typeof x.name=="string"&&!Hx(x)}function yX(x){return typeof x=="number"&&Ou(x)}function Pc(x){if(!pr(x))return!1;var k=Xr(x);return k==he||k==De||k==ee||k==Ae}function P5(x){return typeof x=="number"&&x==nn(x)}function Ww(x){return typeof x=="number"&&x>-1&&x%1==0&&x<=X}function pr(x){var k=typeof x;return x!=null&&(k=="object"||k=="function")}function kr(x){return x!=null&&typeof x=="object"}var C5=ac?ss(ac):hw;function bX(x,k){return x===k||zu(x,k,Df(k))}function wX(x,k,D){return D=typeof D=="function"?D:n,zu(x,k,Df(k),D)}function jX(x){return A5(x)&&x!=+x}function _X(x){if(E2(x))throw new Bt(a);return rx(x)}function NX(x){return x===null}function SX(x){return x==null}function A5(x){return typeof x=="number"||kr(x)&&Xr(x)==We}function Hx(x){if(!kr(x)||Xr(x)!=Xe)return!1;var k=Xs(x);if(k===null)return!0;var D=_n.call(k,"constructor")&&k.constructor;return typeof D=="function"&&D instanceof D&&df.call(D)==Nm}var W2=pm?ss(pm):Nf;function kX(x){return P5(x)&&x>=-X&&x<=X}var O5=Nu?ss(Nu):Ia;function Hw(x){return typeof x=="string"||!Qt(x)&&kr(x)&&Xr(x)==Pe}function aa(x){return typeof x=="symbol"||kr(x)&&Xr(x)==Ze}var kp=Lb?ss(Lb):Sf;function EX(x){return x===n}function PX(x){return kr(x)&&Jr(x)==pt}function CX(x){return kr(x)&&Xr(x)==$t}var AX=rp(yl),OX=rp(function(x,k){return x<=k});function T5(x){if(!x)return[];if($s(x))return Hw(x)?as(x):Oi(x);if(vo&&x[vo])return g2(x[vo]());var k=Jr(x),D=k==_e?bm:k==de?ul:Ep;return D(x)}function Cc(x){if(!x)return x===0?x:0;if(x=za(x),x===Z||x===-Z){var k=x<0?-1:1;return k*V}return x===x?x:0}function nn(x){var k=Cc(x),D=k%1;return k===k?D?k-D:k:0}function R5(x){return x?yo(nn(x),0,L):0}function za(x){if(typeof x=="number")return x;if(aa(x))return z;if(pr(x)){var k=typeof x.valueOf=="function"?x.valueOf():x;x=pr(k)?k+"":k}if(typeof x!="string")return x===0?x:+x;x=Ub(x);var D=e2.test(x);return D||jb.test(x)?hm(x.slice(2),D?2:8):bb.test(x)?z:+x}function M5(x){return Js(x,qs(x))}function TX(x){return x?yo(nn(x),-X,X):x===0?x:0}function Mn(x){return x==null?"":Hi(x)}var RX=Ku(function(x,k){if(Eo(k)||$s(k)){Js(k,bi(k),x);return}for(var D in k)_n.call(k,D)&&mc(x,D,k[D])}),I5=Ku(function(x,k){Js(k,qs(k),x)}),Kw=Ku(function(x,k,D,K){Js(k,qs(k),x,K)}),MX=Ku(function(x,k,D,K){Js(k,bi(k),x,K)}),IX=$a(Fm);function DX(x,k){var D=Du(x);return k==null?D:Hn(D,k)}var LX=tn(function(x,k){x=Rn(x);var D=-1,K=k.length,te=K>2?k[2]:n;for(te&&Ri(k[0],k[1],te)&&(K=1);++D<K;)for(var ce=k[D],ve=qs(ce),be=-1,Se=ve.length;++be<Se;){var Ue=ve[be],Ve=x[Ue];(Ve===n||Co(Ve,Ea[Ue])&&!_n.call(x,Ue))&&(x[Ue]=ce[Ue])}return x}),FX=tn(function(x){return x.push(n,jx),Ci(D5,n,x)});function $X(x,k){return $b(x,Ot(k,3),cs)}function qX(x,k){return $b(x,Ot(k,3),vl)}function zX(x,k){return x==null?x:$m(x,Ot(k,3),qs)}function BX(x,k){return x==null?x:_f(x,Ot(k,3),qs)}function UX(x,k){return x&&cs(x,Ot(k,3))}function VX(x,k){return x&&vl(x,Ot(k,3))}function WX(x){return x==null?[]:qu(x,bi(x))}function HX(x){return x==null?[]:qu(x,qs(x))}function H2(x,k,D){var K=x==null?n:bo(x,k);return K===n?D:K}function KX(x,k){return x!=null&&Ex(x,k,Ts)}function K2(x,k){return x!=null&&Ex(x,k,gc)}var GX=bw(function(x,k,D){k!=null&&typeof k.toString!="function"&&(k=ff.call(k)),x[k]=D},Q2(zs)),QX=bw(function(x,k,D){k!=null&&typeof k.toString!="function"&&(k=ff.call(k)),_n.call(x,k)?x[k].push(D):x[k]=[D]},Ot),YX=tn(Rs);function bi(x){return $s(x)?Aa(x):_o(x)}function qs(x){return $s(x)?Aa(x,!0):ix(x)}function XX(x,k){var D={};return k=Ot(k,3),cs(x,function(K,te,ce){Ta(D,k(K,te,ce),K)}),D}function ZX(x,k){var D={};return k=Ot(k,3),cs(x,function(K,te,ce){Ta(D,te,k(K,te,ce))}),D}var JX=Ku(function(x,k,D){vc(x,k,D)}),D5=Ku(function(x,k,D,K){vc(x,k,D,K)}),eZ=$a(function(x,k){var D={};if(x==null)return D;var K=!1;k=zn(k,function(ce){return ce=La(ce,x),K||(K=ce.length>1),ce}),Js(x,Mf(x),D),K&&(D=Wi(D,d|m|g,_x));for(var te=k.length;te--;)Gm(D,k[te]);return D});function tZ(x,k){return L5(x,Je(Ot(k)))}var nZ=$a(function(x,k){return x==null?{}:ox(x,k)});function L5(x,k){if(x==null)return{};var D=zn(Mf(x),function(K){return[K]});return k=Ot(k),bl(x,D,function(K,te){return k(K,te[0])})}function rZ(x,k,D){k=La(k,x);var K=-1,te=k.length;for(te||(te=1,x=n);++K<te;){var ce=x==null?n:x[ra(k[K])];ce===n&&(K=te,ce=D),x=Pc(ce)?ce.call(x):ce}return x}function iZ(x,k,D){return x==null?x:yc(x,k,D)}function sZ(x,k,D,K){return K=typeof K=="function"?K:n,x==null?x:yc(x,k,D,K)}var F5=bx(bi),$5=bx(qs);function aZ(x,k,D){var K=Qt(x),te=K||td(x)||kp(x);if(k=Ot(k,4),D==null){var ce=x&&x.constructor;te?D=K?new ce:[]:pr(x)?D=Pc(ce)?Du(Xs(x)):{}:D={}}
vendor: 10,702 bytes, lines 1091-1108
1091return(te?fi:cs)(x,function(ve,be,Se){return k(D,ve,be,Se)}),D}function oZ(x,k){return x==null?!0:Gm(x,k)}function lZ(x,k,D){return x==null?x:fx(x,k,Ym(D))}function cZ(x,k,D,K){return K=typeof K=="function"?K:n,x==null?x:fx(x,k,Ym(D),K)}function Ep(x){return x==null?[]:cf(x,bi(x))}function uZ(x){return x==null?[]:cf(x,qs(x))}function dZ(x,k,D){return D===n&&(D=k,k=n),D!==n&&(D=za(D),D=D===D?D:0),k!==n&&(k=za(k),k=k===k?k:0),yo(za(x),k,D)}function fZ(x,k,D){return k=Cc(k),D===n?(D=k,k=0):D=Cc(D),x=za(x),nx(x,k,D)}function hZ(x,k,D){if(D&&typeof D!="boolean"&&Ri(x,k,D)&&(k=D=n),D===n&&(typeof k=="boolean"?(D=k,k=n):typeof x=="boolean"&&(D=x,x=n)),x===n&&k===n?(x=0,k=1):(x=Cc(x),k===n?(k=x,x=0):k=Cc(k)),x>k){var K=x;x=k,k=K}if(D||x%1||k%1){var te=gf();return hi(x+te*(k-x+Rv("1e-"+((te+"").length-1))),k)}return Uu(x,k)}var mZ=bc(function(x,k,D){return k=k.toLowerCase(),x+(D?q5(k):k)});function q5(x){return G2(Mn(x).toLowerCase())}function z5(x){return x=Mn(x),x&&x.replace(Nb,Hb).replace(Rb,"")}function pZ(x,k,D){x=Mn(x),k=Hi(k);var K=x.length;D=D===n?K:yo(nn(D),0,K);var te=D;return D-=k.length,D>=0&&x.slice(D,te)==k}function gZ(x){return x=Mn(x),x&&Vt.test(x)?x.replace(_a,Kb):x}function vZ(x){return x=Mn(x),x&&Yr.test(x)?x.replace(Na,"\\$&"):x}var xZ=bc(function(x,k,D){return x+(D?"-":"")+k.toLowerCase()}),yZ=bc(function(x,k,D){return x+(D?" ":"")+k.toLowerCase()}),bZ=vx("toLowerCase");function wZ(x,k,D){x=Mn(x),k=nn(k);var K=k?oc(x):0;if(!k||K>=k)return x;var te=(k-K)/2;return Tf(dl(te),D)+x+Tf(cc(te),D)}function jZ(x,k,D){x=Mn(x),k=nn(k);var K=k?oc(x):0;return k&&K<k?x+Tf(k-K,D):x}function _Z(x,k,D){x=Mn(x),k=nn(k);var K=k?oc(x):0;return k&&K<k?Tf(k-K,D)+x:x}function NZ(x,k,D){return D||k==null?k=0:k&&(k=+k),nw(Mn(x).replace(Ei,""),k||0)}function SZ(x,k,D){return(D?Ri(x,k,D):k===n)?k=1:k=nn(k),xc(Mn(x),k)}function kZ(){var x=arguments,k=Mn(x[0]);return x.length<3?k:k.replace(x[1],x[2])}var EZ=bc(function(x,k,D){return x+(D?"_":"")+k.toLowerCase()});function PZ(x,k,D){return D&&typeof D!="number"&&Ri(x,k,D)&&(k=D=n),D=D===n?L:D>>>0,D?(x=Mn(x),x&&(typeof k=="string"||k!=null&&!W2(k))&&(k=Hi(k),!k&&Eu(x))?So(as(x),0,D):x.split(k,D)):[]}var CZ=bc(function(x,k,D){return x+(D?" ":"")+G2(k)});function AZ(x,k,D){return x=Mn(x),D=D==null?0:yo(nn(D),0,x.length),k=Hi(k),x.slice(D,D+k.length)==k}function OZ(x,k,D){var K=oe.templateSettings;D&&Ri(x,k,D)&&(k=n),x=Mn(x),k=Kw({},k,K,wx);var te=Kw({},k.imports,K.imports,wx),ce=bi(te),ve=cf(te,ce),be,Se,Ue=0,Ve=k.interpolate||sm,Qe="__p += '",ot=uf((k.escape||sm).source+"|"+Ve.source+"|"+(Ve===Qr?nc:sm).source+"|"+(k.evaluate||sm).source+"|$","g"),_t="//# sourceURL="+(_n.call(k,"sourceURL")?(k.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++o2+"]")+`
1092`;x.replace(ot,function(It,gn,yn,oa,fs,la){return yn||(yn=oa),Qe+=x.slice(Ue,la).replace(t2,Gb),gn&&(be=!0,Qe+=`' +
1093__e(`+gn+`) +
1094'`),fs&&(Se=!0,Qe+=`';
1095`+fs+`;
1096__p += '`),yn&&(Qe+=`' +
1097((__t = (`+yn+`)) == null ? '' : __t) +
1098'`),Ue=la+It.length,It}),Qe+=`';
1099`;var Mt=_n.call(k,"variable")&&k.variable;if(!Mt)Qe=`with (obj) {
1100`+Qe+`
1101}
1102`;else if(ZN.test(Mt))throw new Bt(l);Qe=(Se?Qe.replace(tc,""):Qe).replace(Ss,"$1").replace(Zd,"$1;"),Qe="function("+(Mt||"obj")+`) {
1103`+(Mt?"":`obj || (obj = {});
1104`)+"var __t, __p = ''"+(be?", __e = _.escape":"")+(Se?`, __j = Array.prototype.join;
1105function print() { __p += __j.call(arguments, '') }
1106`:`;
1107`)+Qe+`return __p
1108}`;var ln=U5(function(){return jn(ce,_t+"return "+Qe).apply(n,ve)});if(ln.source=Qe,V2(ln))throw ln;return ln}function TZ(x){return Mn(x).toLowerCase()}function RZ(x){return Mn(x).toUpperCase()}function MZ(x,k,D){if(x=Mn(x),x&&(D||k===n))return Ub(x);if(!x||!(k=Hi(k)))return x;var K=as(x),te=as(k),ce=Vb(K,te),ve=Wv(K,te)+1;return So(K,ce,ve).join("")}function IZ(x,k,D){if(x=Mn(x),x&&(D||k===n))return x.slice(0,jm(x)+1);if(!x||!(k=Hi(k)))return x;var K=as(x),te=Wv(K,as(k))+1;return So(K,0,te).join("")}function DZ(x,k,D){if(x=Mn(x),x&&(D||k===n))return x.replace(Ei,"");if(!x||!(k=Hi(k)))return x;var K=as(x),te=Vb(K,as(k));return So(K,te).join("")}function LZ(x,k){var D=I,K=R;if(pr(k)){var te="separator"in k?k.separator:te;D="length"in k?nn(k.length):D,K="omission"in k?Hi(k.omission):K}x=Mn(x);var ce=x.length;if(Eu(x)){var ve=as(x);ce=ve.length}if(D>=ce)return x;var be=D-oc(K);if(be<1)return K;var Se=ve?So(ve,0,be).join(""):x.slice(0,be);if(te===n)return Se+K;if(ve&&(be+=Se.length-be),W2(te)){if(x.slice(be).search(te)){var Ue,Ve=Se;for(te.global||(te=uf(te.source,Mn(kv.exec(te))+"g")),te.lastIndex=0;Ue=te.exec(Ve);)var Qe=Ue.index;Se=Se.slice(0,Qe===n?be:Qe)}}else if(x.indexOf(Hi(te),be)!=be){var ot=Se.lastIndexOf(te);ot>-1&&(Se=Se.slice(0,ot))}return Se+K}function FZ(x){return x=Mn(x),x&&Jd.test(x)?x.replace(ho,Qb):x}var $Z=bc(function(x,k,D){return x+(D?" ":"")+k.toUpperCase()}),G2=vx("toUpperCase");function B5(x,k,D){return x=Mn(x),k=D?n:k,k===n?p2(x)?y2(x):f2(x):x.match(k)||[]}var U5=tn(function(x,k){try{return Ci(x,n,k)}catch(D){return V2(D)?D:new Bt(D)}}),qZ=$a(function(x,k){return fi(k,function(D){D=ra(D),Ta(x,D,Ye(x[D],x))}),x});function zZ(x){var k=x==null?0:x.length,D=Ot();return x=k?zn(x,function(K){if(typeof K[1]!="function")throw new Ps(o);return[D(K[0]),K[1]]}):[],tn(function(K){for(var te=-1;++te<k;){var ce=x[te];if(Ci(ce[0],this,K))return Ci(ce[1],this,K)}})}function BZ(x){return cw(Wi(x,d))}function Q2(x){return function(){return x}}function UZ(x,k){return x==null||x!==x?k:x}var VZ=tp(),WZ=tp(!0);function zs(x){return x}function Y2(x){return Bu(typeof x=="function"?x:Wi(x,d))}function HZ(x){return Vm(Wi(x,d))}function KZ(x,k){return Yn(x,Wi(k,d))}var GZ=tn(function(x,k){return function(D){return Rs(D,x,k)}}),QZ=tn(function(x,k){return function(D){return Rs(x,D,k)}});function X2(x,k,D){var K=bi(k),te=qu(k,K);D==null&&!(pr(k)&&(te.length||!K.length))&&(D=k,k=x,x=this,te=qu(k,bi(k)));var ce=!(pr(D)&&"chain"in D)||!!D.chain,ve=Pc(x);return fi(te,function(be){var Se=k[be];x[be]=Se,ve&&(x.prototype[be]=function(){var Ue=this.__chain__;if(ce||Ue){var Ve=x(this.__wrapped__),Qe=Ve.__actions__=Oi(this.__actions__);return Qe.push({func:Se,args:arguments,thisArg:x}),Ve.__chain__=Ue,Ve}return Se.apply(x,cl([this.value()],arguments))})}),x}function YZ(){return Qn._===this&&(Qn._=Zb),this}function Z2(){}function XZ(x){return x=nn(x),tn(function(k){return Wm(k,x)})}var ZZ=np(zn),JZ=np(Lv),eJ=np(qv);function V5(x){return mt(x)?Bv(ra(x)):sr(x)}function tJ(x){return function(k){return x==null?n:bo(x,k)}}var nJ=yx(),rJ=yx(!0);function J2(){return[]}function eS(){return!1}function iJ(){return{}}function sJ(){return""}function aJ(){return!0}function oJ(x,k){if(x=nn(x),x<1||x>X)return[];var D=L,K=hi(x,L);k=Ot(k),x-=L;for(var te=Vv(K,k);++D<x;)k(D);return te}function lJ(x){return Qt(x)?zn(x,ra):aa(x)?[x]:Oi(Ox(Mn(x)))}function cJ(x){var k=++Au;return Mn(x)+k}var uJ=Of(function(x,k){return x+k},0),dJ=Zr("ceil"),fJ=Of(function(x,k){return x/k},1),hJ=Zr("floor");function mJ(x){return x&&x.length?pc(x,zs,xl):n}function pJ(x,k){return x&&x.length?pc(x,Ot(k,2),xl):n}function gJ(x){return zb(x,zs)}function vJ(x,k){return zb(x,Ot(k,2))}function xJ(x){return x&&x.length?pc(x,zs,yl):n}function yJ(x,k){return x&&x.length?pc(x,Ot(k,2),yl):n}var bJ=Of(function(x,k){return x*k},1),wJ=Zr("round"),jJ=Of(function(x,k){return x-k},0);function _J(x){return x&&x.length?Uv(x,zs):0}function NJ(x,k){return x&&x.length?Uv(x,Ot(k,2)):0}return oe.after=ye,oe.ary=Re,oe.assign=RX,oe.assignIn=I5,oe.assignInWith=Kw,oe.assignWith=MX,oe.at=IX,oe.before=Ge,oe.bind=Ye,oe.bindAll=qZ,oe.bindKey=Ke,oe.castArray=iX,oe.chain=xp,oe.chunk=up,oe.compact=Tx,oe.concat=Ls,oe.cond=zZ,oe.conforms=BZ,oe.constant=Q2,oe.countBy=qw,oe.create=DX,oe.curry=dt,oe.curryRight=gt,oe.debounce=xt,oe.defaults=LX,oe.defaultsDeep=FX,oe.defer=mr,oe.delay=Ce,oe.difference=xn,oe.differenceBy=zr,oe.differenceWith=Sr,oe.drop=ti,oe.dropRight=ds,oe.dropRightWhile=Ju,oe.dropWhile=Tr,oe.fill=qf,oe.filter=wp,oe.flatMap=Vx,oe.flatMapDeep=$2,oe.flatMapDepth=Uw,oe.flatten=dp,oe.flattenDeep=Bf,oe.flattenDepth=Ki,oe.flip=we,oe.flow=VZ,oe.flowRight=WZ,oe.fromPairs=Rx,oe.functions=WX,oe.functionsIn=HX,oe.groupBy=Wx,oe.initial=fp,oe.intersection=Mx,oe.intersectionBy=Nl,oe.intersectionWith=hp,oe.invert=GX,oe.invertBy=QX,oe.invokeMap=Vw,oe.iteratee=Y2,oe.keyBy=q2,oe.keys=bi,oe.keysIn=qs,oe.map=Ec,oe.mapKeys=XX,oe.mapValues=ZX,oe.matches=HZ,oe.matchesProperty=KZ,oe.memoize=Oe,oe.merge=JX,oe.mergeWith=D5,oe.method=GZ,oe.methodOf=QZ,oe.mixin=X2,oe.negate=Je,oe.nthArg=XZ,oe.omit=eZ,oe.omitBy=tZ,oe.once=jt,oe.orderBy=z2,oe.over=ZZ,oe.overArgs=Ct,oe.overEvery=JZ,oe.overSome=eJ,oe.partial=St,oe.partialRight=Rt,oe.partition=Hf,oe.pick=nZ,oe.pickBy=L5,oe.property=V5,oe.propertyOf=tJ,oe.pull=mp,oe.pullAll=Vf,oe.pullAllBy=Ii,oe.pullAllWith=kl,oe.pullAt=ia,oe.range=nJ,oe.rangeRight=rJ,oe.rearg=Br,oe.reject=f,oe.remove=Gi,oe.rest=Nn,oe.reverse=pp,oe.sampleSize=E,oe.set=iZ,oe.setWith=sZ,oe.shuffle=T,oe.slice=Dx,oe.sortBy=ie,oe.sortedUniq=$x,oe.sortedUniqBy=Nc,oe.split=PZ,oe.spread=Pl,oe.tail=Rw,oe.take=Mw,oe.takeRight=qx,oe.takeRightWhile=gp,oe.takeWhile=C2,oe.tap=D2,oe.throttle=U2,oe.thru=sa,oe.toArray=T5,oe.toPairs=F5,oe.toPairsIn=$5,oe.toPath=lJ,oe.toPlainObject=M5,oe.transform=aZ,oe.unary=nX,oe.union=A2,oe.unionBy=Iw,oe.unionWith=Dw,oe.uniq=Sc,oe.uniqBy=O2,oe.uniqWith=ed,oe.unset=oZ,oe.unzip=vp,oe.unzipWith=ar,oe.update=lZ,oe.updateWith=cZ,oe.values=Ep,oe.valuesIn=uZ,oe.without=T2,oe.words=B5,oe.wrap=rX,oe.xor=Lw,oe.xorBy=R2,oe.xorWith=M2,oe.zip=Fw,oe.zipObject=$w,oe.zipObjectDeep=I2,oe.zipWith=Fs,oe.entries=F5,oe.entriesIn=$5,oe.extend=I5,oe.extendWith=Kw,X2(oe,oe),oe.add=uJ,oe.attempt=U5,oe.camelCase=mZ,oe.capitalize=q5,oe.ceil=dJ,oe.clamp=dZ,oe.clone=sX,oe.cloneDeep=oX,oe.cloneDeepWith=lX,oe.cloneWith=aX,oe.conformsTo=cX,oe.deburr=z5,oe.defaultTo=UZ,oe.divide=fJ,oe.endsWith=pZ,oe.eq=Co,oe.escape=gZ,oe.escapeRegExp=vZ,oe.every=zw,oe.find=jp,oe.findIndex=_l,oe.findKey=$X,oe.findLast=Bw,oe.findLastIndex=zf,oe.findLastKey=qX,oe.floor=hJ,oe.forEach=_p,oe.forEachRight=Wf,oe.forIn=zX,oe.forInRight=BX,oe.forOwn=UX,oe.forOwnRight=VX,oe.get=H2,oe.gt=uX,oe.gte=dX,oe.has=KX,oe.hasIn=K2,oe.head=jc,oe.identity=zs,oe.includes=Np,oe.indexOf=Po,oe.inRange=fZ,oe.invoke=YX,oe.isArguments=Kf,oe.isArray=Qt,oe.isArrayBuffer=fX,oe.isArrayLike=$s,oe.isArrayLikeObject=Rr,oe.isBoolean=hX,oe.isBuffer=td,oe.isDate=mX,oe.isElement=pX,oe.isEmpty=gX,oe.isEqual=vX,oe.isEqualWith=xX,oe.isError=V2,oe.isFinite=yX,oe.isFunction=Pc,oe.isInteger=P5,oe.isLength=Ww,oe.isMap=C5,oe.isMatch=bX,oe.isMatchWith=wX,oe.isNaN=jX,oe.isNative=_X,oe.isNil=SX,oe.isNull=NX,oe.isNumber=A5,oe.isObject=pr,oe.isObjectLike=kr,oe.isPlainObject=Hx,oe.isRegExp=W2,oe.isSafeInteger=kX,oe.isSet=O5,oe.isString=Hw,oe.isSymbol
vendor: 4,455 bytes, line 1108
1108=aa,oe.isTypedArray=kp,oe.isUndefined=EX,oe.isWeakMap=PX,oe.isWeakSet=CX,oe.join=Sl,oe.kebabCase=xZ,oe.last=Mi,oe.lastIndexOf=Uf,oe.lowerCase=yZ,oe.lowerFirst=bZ,oe.lt=AX,oe.lte=OX,oe.max=mJ,oe.maxBy=pJ,oe.mean=gJ,oe.meanBy=vJ,oe.min=xJ,oe.minBy=yJ,oe.stubArray=J2,oe.stubFalse=eS,oe.stubObject=iJ,oe.stubString=sJ,oe.stubTrue=aJ,oe.multiply=bJ,oe.nth=Ix,oe.noConflict=YZ,oe.noop=Z2,oe.now=pe,oe.pad=wZ,oe.padEnd=jZ,oe.padStart=_Z,oe.parseInt=NZ,oe.random=hZ,oe.reduce=B2,oe.reduceRight=Sp,oe.repeat=SZ,oe.replace=kZ,oe.result=rZ,oe.round=wJ,oe.runInContext=Ne,oe.sample=p,oe.size=q,oe.snakeCase=EZ,oe.some=H,oe.sortedIndex=Lx,oe.sortedIndexBy=P2,oe.sortedIndexOf=El,oe.sortedLastIndex=Tw,oe.sortedLastIndexBy=Fx,oe.sortedLastIndexOf=_c,oe.startCase=CZ,oe.startsWith=AZ,oe.subtract=jJ,oe.sum=_J,oe.sumBy=NJ,oe.template=OZ,oe.times=oJ,oe.toFinite=Cc,oe.toInteger=nn,oe.toLength=R5,oe.toLower=TZ,oe.toNumber=za,oe.toSafeInteger=TX,oe.toString=Mn,oe.toUpper=RZ,oe.trim=MZ,oe.trimEnd=IZ,oe.trimStart=DZ,oe.truncate=LZ,oe.unescape=FZ,oe.uniqueId=cJ,oe.upperCase=$Z,oe.upperFirst=G2,oe.each=_p,oe.eachRight=Wf,oe.first=jc,X2(oe,(function(){var x={};return cs(oe,function(k,D){_n.call(oe.prototype,D)||(x[D]=k)}),x})(),{chain:!1}),oe.VERSION=r,fi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(x){oe[x].placeholder=oe}),fi(["drop","take"],function(x,k){Gt.prototype[x]=function(D){D=D===n?1:Nr(nn(D),0);var K=this.__filtered__&&!k?new Gt(this):this.clone();return K.__filtered__?K.__takeCount__=hi(D,K.__takeCount__):K.__views__.push({size:hi(D,L),type:x+(K.__dir__<0?"Right":"")}),K},Gt.prototype[x+"Right"]=function(D){return this.reverse()[x](D).reverse()}}),fi(["filter","map","takeWhile"],function(x,k){var D=k+1,K=D==B||D==G;Gt.prototype[x]=function(te){var ce=this.clone();return ce.__iteratees__.push({iteratee:Ot(te,3),type:D}),ce.__filtered__=ce.__filtered__||K,ce}}),fi(["head","last"],function(x,k){var D="take"+(k?"Right":"");Gt.prototype[x]=function(){return this[D](1).value()[0]}}),fi(["initial","tail"],function(x,k){var D="drop"+(k?"":"Right");Gt.prototype[x]=function(){return this.__filtered__?new Gt(this):this[D](1)}}),Gt.prototype.compact=function(){return this.filter(zs)},Gt.prototype.find=function(x){return this.filter(x).head()},Gt.prototype.findLast=function(x){return this.reverse().find(x)},Gt.prototype.invokeMap=tn(function(x,k){return typeof x=="function"?new Gt(this):this.map(function(D){return Rs(D,x,k)})}),Gt.prototype.reject=function(x){return this.filter(Je(Ot(x)))},Gt.prototype.slice=function(x,k){x=nn(x);var D=this;return D.__filtered__&&(x>0||k<0)?new Gt(D):(x<0?D=D.takeRight(-x):x&&(D=D.drop(x)),k!==n&&(k=nn(k),D=k<0?D.dropRight(-k):D.take(k-x)),D)},Gt.prototype.takeRightWhile=function(x){return this.reverse().takeWhile(x).reverse()},Gt.prototype.toArray=function(){return this.take(L)},cs(Gt.prototype,function(x,k){var D=/^(?:filter|find|map|reject)|While$/.test(k),K=/^(?:head|last)$/.test(k),te=oe[K?"take"+(k=="last"?"Right":""):k],ce=K||/^find/.test(k);te&&(oe.prototype[k]=function(){var ve=this.__wrapped__,be=K?[1]:arguments,Se=ve instanceof Gt,Ue=be[0],Ve=Se||Qt(ve),Qe=function(gn){var yn=te.apply(oe,cl([gn],be));return K&&ot?yn[0]:yn};Ve&&D&&typeof Ue=="function"&&Ue.length!=1&&(Se=Ve=!1);var ot=this.__chain__,_t=!!this.__actions__.length,Mt=ce&&!ot,ln=Se&&!_t;if(!ce&&Ve){ve=ln?ve:new Gt(this);var It=x.apply(ve,be);return It.__actions__.push({func:sa,args:[Qe],thisArg:n}),new mi(It,ot)}return Mt&&ln?x.apply(this,be):(It=this.thru(Qe),Mt?K?It.value()[0]:It.value():It)})}),fi(["pop","push","shift","sort","splice","unshift"],function(x){var k=po[x],D=/^(?:push|sort|unshift)$/.test(x)?"tap":"thru",K=/^(?:pop|shift)$/.test(x);oe.prototype[x]=function(){var te=arguments;if(K&&!this.__chain__){var ce=this.value();return k.apply(Qt(ce)?ce:[],te)}return this[D](function(ve){return k.apply(Qt(ve)?ve:[],te)})}}),cs(Gt.prototype,function(x,k){var D=oe[k];if(D){var K=D.name+"";_n.call(Mu,K)||(Mu[K]=[]),Mu[K].push({name:k,func:D})}}),Mu[Qu(n,y).name]=[{name:"wrapper",func:n}],Gt.prototype.clone=Rm,Gt.prototype.reverse=Zv,Gt.prototype.value=Lu,oe.prototype.at=yp,oe.prototype.chain=kc,oe.prototype.commit=bp,oe.prototype.next=zx,oe.prototype.plant=L2,oe.prototype.reverse=Ux,oe.prototype.toJSON=oe.prototype.valueOf=oe.prototype.value=F2,oe.prototype.first=oe.prototype.head,vo&&(oe.prototype[vo]=Bx),oe}),Pu=b2();ka?((ka.exports=Pu)._=Pu,lf._=Pu):Qn._=Pu}).call(Y3e)}
1108)(N0,N0.exports)),N0.exports}var Z3e=X3e();const J3e=({ticket:e,raffle:t})=>{const n=e.is_winner,r=t.status==="active",s=!r&&!n;return i.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"w-full",children:i.jsxs(Me,{className:`border-2 overflow-hidden ${n?"border-amber-400 bg-amber-50/50":r?"border-blue-200 bg-blue-50/50":"border-slate-200 bg-slate-50/50"}`,children:[i.jsx("div",{className:`h-2 w-full ${n?"bg-amber-500":r?"bg-blue-500":"bg-slate-400"}`}),i.jsx(Fe,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col md:flex-row gap-6 items-center",children:[i.jsxs("div",{className:"flex-1 text-center md:text-left",children:[i.jsx("h3",{className:"text-lg font-bold text-slate-900 mb-1",children:t.title}),i.jsxs("div",{className:"text-sm text-slate-500 flex items-center justify-center md:justify-start gap-2",children:[i.jsx(Vr,{className:"w-4 h-4"}),i.jsx("span",{className:"font-mono font-bold",children:e.ticket_code})]})]}),i.jsxs("div",{className:"text-center",children:[n&&i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("div",{className:"w-16 h-16 rounded-full bg-amber-100 flex items-center justify-center mb-2 shadow-sm",children:i.jsx(Jt,{className:"w-8 h-8 text-amber-600"})}),i.jsx("h4",{className:"text-xl font-black text-amber-600 uppercase tracking-wide",children:"Winner!"}),i.jsxs(nt,{className:"bg-amber-500 mt-1",children:["Prize #",e.prize_rank]}),i.jsx("p",{className:"text-sm text-amber-700 mt-2 font-medium",children:"Congratulations!"})]}),r&&i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("div",{className:"w-16 h-16 rounded-full bg-blue-100 flex items-center justify-center mb-2 shadow-sm",children:i.jsx(rs,{className:"w-8 h-8 text-blue-600"})}),i.jsx("h4",{className:"text-xl font-black text-blue-600 uppercase tracking-wide",children:"Active"}),i.jsxs("p",{className:"text-sm text-blue-700 mt-2",children:["Draw Date: ",t.draw_date?Ut(new Date(t.draw_date),"MMM d, yyyy"):"Coming Soon"]})]}),s&&i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("div",{className:"w-16 h-16 rounded-full bg-slate-200 flex items-center justify-center mb-2 shadow-sm",children:i.jsx(zT,{className:"w-8 h-8 text-slate-500"})}),i.jsx("h4",{className:"text-xl font-black text-slate-500 uppercase tracking-wide",children:"Hard Luck"}),i.jsx("p",{className:"text-sm text-slate-600 mt-2",children:"Better luck next time!"})]})]})]})})]})})},eIe=({raffle:e,tickets:t})=>{const[n,r]=O.useState(!1),s=t.filter(h=>h.is_winner),a=s.length>0,o=e.status==="active",l=[...t].sort((h,d)=>h.is_winner&&!d.is_winner?-1:!h.is_winner&&d.is_winner?1:new Date(d.purchase_date)-new Date(h.purchase_date)),c=n?l:l.slice(0,3),u=t.length>3;return i.jsx(rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"w-full",children:i.jsxs(Me,{className:`border-2 overflow-hidden ${a?"border-amber-400 bg-amber-50/50":o?"border-blue-200 bg-blue-50/50":"border-slate-200 bg-slate-50/50"}`,children:[i.jsx("div",{className:`h-2 w-full ${a?"bg-amber-500":o?"bg-blue-500":"bg-slate-400"}`}),i.jsx(Fe,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col md:flex-row gap-8 items-start",children:[i.jsx("div",{className:"w-full md:w-auto flex flex-col items-center justify-center text-center min-w-[160px]",children:a?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-20 h-20 rounded-full bg-amber-100 flex items-center justify-center mb-3 shadow-sm",children:i.jsx(Jt,{className:"w-10 h-10 text-amber-600"})}),i.jsx("h4",{className:"text-2xl font-black text-amber-600 uppercase tracking-wide",children:"Winner!"}),i.jsxs("p",{className:"text-sm text-amber-700 font-bold",children:[s.length," Prize",s.length>1?"s":""," Won"]})]}):o?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-20 h-20 rounded-full bg-blue-100 flex items-center justify-center mb-3 shadow-sm",children:i.jsx(rs,{className:"w-10 h-10 text-blue-600"})}),i.jsx("h4",{className:"text-2xl font-black text-blue-600 uppercase tracking-wide",children:"Active"}),i.jsxs("p",{className:"text-xs text-blue-700 font-medium mt-1",children:["Draw: ",e.draw_date?Ut(new Date(e.draw_date),"MMM d"):"TBA"]})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-20 h-20 rounded-full bg-slate-200 flex items-center justify-center mb-3 shadow-sm",children:i.jsx(zT,{className:"w-10 h-10 text-slate-500"})}),i.jsx("h4",{className:"text-2xl font-black text-slate-500 uppercase tracking-wide",children:"Hard Luck"}
1108),i.jsx("p",{className:"text-xs text-slate-600 font-medium mt-1",children:"Better luck next time"})]})}),i.jsxs("div",{className:"flex-1 w-full",children:[i.jsxs("div",{className:"flex justify-between items-start mb-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl font-bold text-slate-900",children:e.title}),i.jsxs("p",{className:"text-slate-500 text-sm",children:["You have ",t.length," ticket",t.length!==1?"s":""," in this raffle"]})]}),!o&&i.jsx(nt,{variant:a?"default":"secondary",className:a?"bg-amber-500":"",children:a?"COMPLETED - WON":"COMPLETED"})]}),i.jsxs("div",{className:"bg-white/60 rounded-xl border border-slate-200 overflow-hidden",children:[c.map(h=>i.jsxs("div",{className:`p-3 flex items-center justify-between border-b border-slate-100 last:border-0 ${h.is_winner?"bg-amber-50":""}`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Vr,{className:`w-4 h-4 ${h.is_winner?"text-amber-500":"text-slate-400"}`}),i.jsx("span",{className:`font-mono font-medium ${h.is_winner?"text-slate-900 font-bold":"text-slate-600"}`,children:h.ticket_code})]}),h.is_winner?i.jsxs(nt,{className:"bg-amber-500 hover:bg-amber-600",children:[i.jsx(Jt,{className:"w-3 h-3 mr-1"})," Prize #",h.prize_rank]}):i.jsx("span",{className:"text-xs text-slate-400",children:o?"In Draw":"Did not win"})]},h.id)),u&&i.jsx("button",{onClick:()=>r(!n),className:"w-full p-2 text-xs text-center text-slate-500 hover:bg-slate-50 transition-colors flex items-center justify-center gap-1",children:n?i.jsxs(i.Fragment,{children:[i.jsx(A_,{className:"w-3 h-3"})," Show Less"]}):i.jsxs(i.Fragment,{children:[i.jsx(Yh,{className:"w-3 h-3"})," Show ",t.length-3," More Tickets"]})})]})]})]})})]})})};function tIe(){const[e,t]=O.useState(""),[n,r]=O.useState(null),[s,a]=O.useState(!1),[o,l]=O.useState(null),{data:c}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me().catch(()=>null)}),{data:u=[]}=qe({queryKey:["myTicketsFull",c==null?void 0:c.id],queryFn:()=>ae.entities.RaffleTicket.filter({user_id:c==null?void 0:c.id}),enabled:!!c}),{data:h=[]}=qe({queryKey:["raffles"],queryFn:()=>ae.entities.Raffle.list()}),d=async m=>{var g;if(m.preventDefault(),!!e.trim()){a(!0),l(null),r(null);try{const w=await ae.functions.invoke("checkTicket",{ticketCode:e.trim()});(g=w.data)!=null&&g.found?r(w.data):l("Ticket not found. Please check the code and try again.")}catch(w){l("An error occurred while checking the ticket."),console.error(w)}finally{a(!1)}}};return i.jsxs("div",{className:"min-h-screen bg-slate-50 pb-20",children:[i.jsx(ao,{pageName:"TicketChecker"}),i.jsx("div",{className:"bg-slate-900 text-white py-12 px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[i.jsx("h1",{className:"text-3xl md:text-5xl font-black mb-4",children:"Ticket Checker"}),i.jsx("p",{className:"text-slate-400 text-lg max-w-2xl mx-auto",children:"Verify your raffle tickets and check if you're a winner."})]})}),i.jsxs("div",{className:"max-w-3xl mx-auto px-4 -mt-8",children:[i.jsx(Me,{className:"shadow-xl border-0 mb-12",children:i.jsxs(Fe,{className:"p-6",children:[i.jsxs("form",{onSubmit:d,className:"flex flex-col md:flex-row gap-4",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(Ld,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-slate-400 w-5 h-5"}),i.jsx(Ee,{placeholder:"Enter Ticket Code (e.g. XMAS-123456)",value:e,onChange:m=>t(m.target.value),className:"pl-10 h-12 text-lg font-mono uppercase"})]}),i.jsx(ue,{type:"submit",disabled:s||!e,className:"h-12 px-8 bg-indigo-600 hover:bg-indigo-700 text-lg font-semibold",children:s?i.jsx(dr,{className:"w-5 h-5 animate-spin"}):"Check Ticket"})]}),i.jsxs(Gs,{children:[o&&i.jsxs(rt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mt-4 p-4 bg-red-50 text-red-600 rounded-lg flex items-center gap-2",children:[i.jsx(Sn,{className:"w-5 h-5"}),o]}),n&&i.jsx("div",{className:"mt-8",children:i.jsx(J3e,{ticket:n.ticket,raffle:n.raffle})})]})]})}),c&&u.length>0&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsx(Vr,{className:"w-6 h-6 text-indigo-600"}),i.jsx("h2",{className:"text-2xl font-bold text-slate-900",children:"My Tickets"})]}),i.jsx("div",{className:"grid gap-6",children:Object.entries(Z3e.groupBy(u,"raffle_id")).sort(([,m],[,g])=>{const w=Math.max(...m.map(b=>new Date(b.purchase_date).getTime()));return Math.max(...g.map(b=>new Date(b.purchase_date).getTime()))-w}).map(([m,g])=>{const w=h.find(v=>v.id===m);return w?i.jsx(eIe,{raffle:w,tickets:g},m):null})})]}),c&&u.length===0&&i.jsxs("div",{className:"text-center py-12 bg-white rounded-2xl border border-slate-200",children:[i.jsx(Vr,{className:"w-12 h-12 text-slate-300 mx-auto mb-4"}),i.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"No Tickets Found"}),i.jsx("p",{className:"text-slate-500",children:"You haven't purchased any raffle tickets yet."})]})]})]})}function nIe(){return i.jsx(Me,{className:"overflow-hidden",children:i.jsxs("div",{className:"flex flex-col md:flex-row",children:[i.jsx(gr,{className:"h-48 md:h-auto md:w-48"}),i.jsxs("div",{className:"p-6 flex-1 space-y-3",children:[i.jsx(gr,{className:"h-6 w-32"}),i.jsx(gr,{className:"h-8 w-3/4"}),i.jsx(gr,{className:"h-4 w-full"}),i.jsx(gr,{className:"h-4 w-2/3"}),i.jsxs("div",{className:"flex gap-2 mt-4",children:[i.jsx(gr,{className:"h-9 w-32"}),i.jsx(gr,{className:"h-9 w-24"})]})]})]})})}function rIe({event:e,hasAccess:t,onPurchase:n,onViewLink:r,isHighlighted:s=!1}){const a=yb(),o=()=>{a.light();const d=`${window.location.origin}${window.location.pathname}?buy_event=${e.id}`;navigator.share?navigator.share({title:e.title,text:`Check out this event: ${e.title}`,url:d}):(navigator.clipboard.writeText(d),tt.success("Event link copied to clipboard!"))},l=()=>{a.light(),n(e)},c=()=>{a.light(),e.external_link&&r(e.external_link)},u=()=>{a.light(),e.game_url&&r(e.game_url)},h=[...e.price>0&&!t?[{icon:i.jsx(ej,{className:"w-4 h-4"}),label:`Get Access (€${e.price})`,handler:l,color:"text-amber-600"}]:[],...t&&e.game_url?[{icon:i.jsx(_s,{className:"w-4 h-4"}),label:"Play Now",handler:u,color:"text-green-600"}]:[],...e.external_link?[{icon:i.jsx(iB,{className:"w-4 h-4"}),label:"More Info",handler:c,color:"text-blue-600"}]:[],{icon:i.jsx(Ho,{className:"w-4 h-4"}),label:"Share Event",handler:o,color:"text-green-600"}];return i.jsx(GY,{actions:h,children:i.jsx(KY,{onSwipeLeft:()=>e.price>0&&!t&&l(),onSwipeRight:()=>
1108o(),leftAction:{icon:i.jsx(ej,{className:"w-6 h-6"})},rightAction:{icon:i.jsx(Ho,{className:"w-6 h-6"})},children:i.jsx(Me,{className:"bg-white/20 backdrop-blur-md border-white/30 hover:bg-white/25 transition-all",children:i.jsx(Fe,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[e.image_url&&i.jsx("div",{className:"flex-shrink-0",children:i.jsx("img",{src:e.image_url,alt:e.title,className:`w-full ${s?"md:w-56 h-56":"md:w-48 h-48"} object-cover rounded-lg border-2 ${s?"border-amber-400/50":"border-white/30"}`,loading:"lazy"})}),i.jsxs("div",{className:"flex-1 space-y-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("h4",{className:`${s?"text-3xl":"text-2xl"} font-bold text-white`,children:e.title}),e.category&&e.category!=="Other"&&i.jsx(nt,{className:`${s?"bg-white/20":"bg-white/10"} text-white border-white/30`,children:e.category})]}),e.description&&i.jsx("p",{className:`${s?"text-white/90":"text-slate-200"} leading-relaxed`,children:e.description})]}),i.jsxs("div",{className:`flex flex-wrap gap-4 ${s?"text-white":"text-slate-200"}`,children:[i.jsxs("div",{className:`flex items-center gap-2 ${s?"bg-white/10 px-3 py-2 rounded-lg":""}`,children:[i.jsx(rs,{className:`w-4 h-4 ${s?"text-amber-400":"text-indigo-400"}`}),i.jsx("span",{className:"font-semibold",children:Ut(e.nextOccurrence,"h:mm a")})]}),e.venue_name&&i.jsxs("div",{className:`flex items-center gap-2 ${s?"bg-white/10 px-3 py-2 rounded-lg":""}`,children:[i.jsx(js,{className:`w-4 h-4 ${s?"text-amber-400":"text-indigo-400"}`}),i.jsxs("span",{className:"font-semibold",children:[e.venue_name,e.location&&`, ${e.location}`]})]}),e.repeat_type==="weekly"&&i.jsx("div",{className:`px-3 py-${s?"2":"1"} ${s?"bg-amber-400/20 rounded-lg border border-amber-400/40":"bg-indigo-500/20 rounded-full border border-indigo-400/30"}`,children:i.jsxs("span",{className:`${s?"text-amber-200":"text-indigo-300"} text-sm font-semibold`,children:["Weekly ",(()=>{var m;const d=((m=e.repeat_days_of_week)==null?void 0:m.length)>0?e.repeat_days_of_week:e.repeat_day_of_week?[e.repeat_day_of_week]:[];return d.length>0?`on ${d.join("/")}s`:""})()]})})]}),i.jsxs("div",{className:"pt-2 flex gap-2 md:gap-3 flex-wrap",children:[e.external_link&&i.jsxs(ue,{size:s?"lg":"sm",onClick:c,className:`${s?"bg-white/10 hover:bg-white/20":"bg-white/10 border-white/20 hover:bg-white/20"} text-white font-bold flex items-center gap-2`,children:["More Info",i.jsx(ws,{className:`w-${s?"5":"4"} h-${s?"5":"4"}`})]}),e.price>0&&(t?i.jsxs(ue,{size:s?"lg":"sm",onClick:u,className:`${s?"bg-green-500 hover:bg-green-600":"bg-green-500/20 hover:bg-green-500/30 border border-green-500/50"} ${s?"text-white":"text-green-300"} font-bold flex items-center gap-2`,children:["Play Now",i.jsx(_s,{className:`w-${s?"5":"4"} h-${s?"5":"4"}`})]}):i.jsxs(ue,{size:s?"lg":"sm",onClick:l,className:`bg-amber-500 hover:bg-amber-600 text-slate-900 font-bold flex items-center gap-2 ${s?"shadow-lg shadow-amber-900/20":""}`,children:[s?"Unlock Access":"Get Access"," (€",e.price,")",i.jsx(no,{className:`w-${s?"4":"3"} h-${s?"4":"3"} opacity-70`})]}))]})]})]})})})})})}function iIe(){se.useEffect(()=>{localStorage.setItem("events_last_seen",new Date().toISOString())},[]);const[e,t]=O.useState({days:0,hours:0,minutes:0,seconds:0}),[n,r]=O.useState(null),[s,a]=O.useState(null),[o,l]=O.useState(!1),[c,u]=O.useState(null),[h,d]=O.useState(!1);oo();const m=mn(),{data:g}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me().catch(()=>null)}),{data:w=[],isLoading:v}=qe({queryKey:["events"],queryFn:()=>ae.entities.Event.list("-created_date",100),refetchInterval:3e4}),b=w.filter($=>$.status!=="completed"&&$.status!=="cancelled"),{data:y=[]}=qe({queryKey:["myEventPurchases",g==null?void 0:g.id],queryFn:()=>ae.entities.EventPurchase.filter({user_id:g==null?void 0:g.id}),enabled:!!g});O.useEffect(()=>{const $=new URLSearchParams(window.location.search),B=$.get("session_id"),U=$.get("success"),G=$.get("canceled"),Z=$.get("buy_event");if(B&&U==="true"&&!c&&(_(B),window.history.replaceState({},"",window.location.pathname)),G==="true"&&window.history.replaceState({},"",window.location.pathname),Z&&b.length>0&&!s&&!o){const X=b.find(V=>V.id===Z);X&&(j(X),window.history.replaceState({},"",window.location.pathname))}},[c,b,s,o]);const _=async $=>{var B,U;u("verifying");try{let G=0;const Z=5;for(;G<Z;){try{const X=await ae.functions.invoke("payment",{action:"verifySession",sessionId:$});if((B=X.data)!=null&&B.success||((U=X.data)==null?void 0:U.message)==="Access already granted"){u("success"),m.invali
1108dateQueries(["myEventPurchases"]);return}}catch(X){console.warn("Verification attempt failed, retrying...",X)}await new Promise(X=>setTimeout(X,2e3)),G++}throw new Error("Verification timed out")}catch(G){console.error("Verification failed",G),u("error")}},N=async $=>{var Z,X;if(!g){ae.auth.redirectToLogin();return}const B=`${window.location.origin}${window.location.pathname}?success=true&session_id={CHECKOUT_SESSION_ID}`,U=`${window.location.origin}${window.location.pathname}?canceled=true`,G=await ae.functions.invoke("payment",{action:"createSession",eventId:$.id,quantity:1,userId:g.id,userEmail:g.email,successUrl:B,cancelUrl:U});if((Z=G.data)!=null&&Z.url)window.location.href=G.data.url;else throw new Error(((X=G.data)==null?void 0:X.error)||"Failed to create checkout session")},j=$=>{a($),l(!0)},S=$=>y.some(B=>B.event_id===$),C=$=>{var G;const B=new Date,U=zp($.start_datetime);if($.repeat_type==="weekly"){const Z={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},X=((G=$.repeat_days_of_week)==null?void 0:G.length)>0?$.repeat_days_of_week:$.repeat_day_of_week?[$.repeat_day_of_week]:[];if(X.length===0)return null;const V=B.getDay();let z=1/0;for(const W of X){const Q=Z[W];if(Q===void 0)continue;let J=Q-V;(J<0||J===0&&B.getTime()>U.getTime())&&(J+=7),J<z&&(z=J)}if(z===1/0)return null;const L=GW(Ad(B),z);if(L.setHours(U.getHours(),U.getMinutes(),0,0),$.repeat_end_date){const W=zp($.repeat_end_date);if(C0e(L,W))return null}return L}else return A0e(U,B)?null:U},P=b.filter($=>$.is_active).map($=>({...$,nextOccurrence:C($)})).filter($=>$.nextOccurrence!==null).sort(($,B)=>$.nextOccurrence-B.nextOccurrence),A=P.length>0?P[0]:null,F=P.slice(1);O.useEffect(()=>{if(!A)return;const $=()=>{const U=new Date,G=A.nextOccurrence-U;if(G<=0){t({days:0,hours:0,minutes:0,seconds:0});return}const Z=Math.floor(G/(1e3*60*60*24)),X=Math.floor(G%(1e3*60*60*24)/(1e3*60*60)),V=Math.floor(G%(1e3*60*60)/(1e3*60)),z=Math.floor(G%(1e3*60)/1e3);t({days:Z,hours:X,minutes:V,seconds:z})};$();const B=setInterval($,1e3);return()=>clearInterval(B)},[A]);const I=F.reduce(($,B)=>{const U=Ut(B.nextOccurrence,"yyyy-MM-dd");return $[U]||($[U]=[]),$[U].push(B),$},{}),R=Object.entries(I).sort(([$],[B])=>$.localeCompare(B)),M=$=>{const U=Cxe($,new Date);return U===0?"Today":U===1?"Tomorrow":U<7?`In ${U} days`:U<14?"Next week":U<30?`In ${Math.floor(U/7)} weeks`:`In ${Math.floor(U/30)} months`};return i.jsxs(i.Fragment,{children:[i.jsx(HY,{}),i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-indigo-900 to-slate-900 p-6",children:[i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsxs("div",{className:"mb-8 text-center",children:[i.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-white mb-3",children:"Upcoming Events"}),i.jsx("p",{className:"text-slate-300 text-lg",children:"Don't miss out on our quiz nights and special events!"})]}),v?i.jsx("div",{className:"space-y-4",children:[...Array(3)].map(($,B)=>i.jsx(nIe,{},B))}):P.length===0?i.jsx(Me,{className:"bg-white/10 backdrop-blur-md border-white/20",children:i.jsxs(Fe,{className:"p-12 text-center",children:[i.jsx(Fn,{className:"w-16 h-16 text-slate-400 mx-auto mb-4"}),i.jsx("p",{className:"text-slate-300 text-lg",children:"No upcoming events scheduled at the moment."}),i.jsx("p",{className:"text-slate-400 mt-2",children:"Check back soon!"})]})}):i.jsxs("div",{className:"space-y-8",children:[A&&i.jsx(Me,{className:"bg-gradient-to-br from-amber-500/30 to-orange-600/30 backdrop-blur-md border-amber-400/50 border-2 shadow-2xl",children:i.jsxs(Fe,{className:"p-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx(Kc,{className:"w-8 h-8 text-amber-400 animate-pulse"}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-black text-white",children:"NEXT EVENT"}),i.jsx("p",{className:"text-amber-200 text-sm font-semibold",children:"Coming up soon!"})]})]}),i.jsx("div",{className:"bg-black/30 backdrop-blur-sm rounded-xl p-4 mb-6",children:i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-amber-300 text-sm font-semibold mb-2 uppercase tracking-wide",children:"Starts in:"}),i.jsxs("div",{className:"flex justify-center items-center gap-3 text-white",children:[i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-4xl md:text-5xl font-black",children:String(e.days).padStart(2,"0")}),i.jsx("span",{className:"text-xs text-amber-200 uppercase tracking-wide",children:"Days"})]}),i.jsx("span",{className:"text-3xl font-bold text-amber-400",children:":"}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-4xl md:text-5xl font-black",children:String(e.hours).padStart(2,"0")}),i.jsx("span",{className:"text-xs text-amber-200 uppercase tracking-wide",children:"Hours"})]}),i.jsx("span",{className:"text-3xl font-bold text-amber-400",children:":"}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-4xl md:text-5xl font-black",children:String(e.minutes).padStart(2,"0")}),i.jsx("span",{className:"text-xs text-amber-200 uppercase tracking-wide",children:"Minutes"})]}),i.jsx("span",{className:"text-3xl font-bold text-amber-400",children:":"}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("span",{className:"text-4xl md:text-5xl font-black",children:String(e.seconds).padStart(2,"0")}),i.jsx("span",{className:"text-xs text-amber-200 uppercase tracking-wide",children:"Seconds"})]})]})]})}),i.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[A.image_url&&i.jsx("div",{className:"flex-shrink-0",children:i.jsx("img",{src:A.image_url,alt:A.title,className:"w-full md:w-56 h-56 object-cover rounded-lg border-2 border-amber-400/50",loading:"lazy"})}),i.jsxs("div",{className:"flex-1 space-y-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("h3",{className:"text-3xl font-bold text-white",children:A.title}),A.category&&A.category!=="Other"&&i.jsx(nt,{className:"bg-white/20 text-white border-white/30",children:A.category})]}),A.description&&i.jsx("p",{className:"text-white/90 leading-relaxed",children:A.description})]}),i.jsxs("div",{className:"flex flex-wrap gap-4 text-white",children:[i.jsxs("div",{className:"flex items-center gap-2 bg-white/10 px-3 py-2 rounded-lg",children:[i.jsx(Fn,{className:"w-4 h-4 text-amber-400"}),i.jsx("span",{className:"font-semibold",children:Ut(A.nextOccurrence,"EEEE, MMMM d, yyyy")})]}),i.jsxs("div",{className:"flex items-center gap-2 bg-white/10 px-3 py-2 rounded-lg",children:[i.jsx(rs,{className:"w-4 h-4 text-amber-400"}),i.jsx("span",{className:"font-semibold",children:Ut(A.nextOccurrence,"h:mm a")})]}),A.venue_name&&i.jsxs("div",{className:"flex items-center gap-2 bg-white/10 px-3 py-2 rounded-lg",children:[i.jsx(js,{className:"w-4 h-4 text-amber-400"}),i.jsxs("span",{className:"font-semibold",children:[A.venue_name,A.location&&`, ${A.location}`]})]}),A.repeat_type==="weekly"&&i.jsx("div",{className:"px-3 py-2 bg-amber-400/20 rounded-lg border border-amber-400/40",children:i.jsxs("span",{className:"text-amber-200 text-sm font-semibold",children:["Weekly ",(()=>{var B;const $=((B=A.repeat_days_of_week)==null?void 0:B.length)>0?A.repeat_days_of_week:A.repeat_day_of_week?[A.repeat_day_of_week]:[];return $.length>0?`on ${$.join("/")}s`:""})()]})})]}),i.jsxs("div",{className:"pt-2 flex gap-3 flex-wrap",children:[A.external_link&&i.jsxs(ue,{size:"lg",onClick:()=>r(A.external_link),className:"bg-white/10 hover:bg-white/20 text-white font-bold flex items-center gap-2",children:["More Info",i.jsx(ws,{className:"w-5 h-5"})]}),A.price>0&&(S(A.id)?i.jsxs(ue,{size:"lg",onClick:()=>A.game_url?r(A.game_url):alert("Access granted! Check your email for details."),className:"bg-green-500 hover:bg-green-600 text-white font-bold flex items-center gap-2",children:["Play Now",i.jsx(_s,{className:"w-5 h-5"})]}):i.jsxs(ue,{size:"lg",onClick:()=>j(A),className:"bg-amber-500 hover:bg-amber-600 text-slate-900 font-bold flex items-center gap-2 shadow-lg shadow-amber-900/20",children:["Unlock Access (€",A.price,")",i.jsx(no,{className:"w-4 h-4 opacity-70"})]}))]})]})]})]})}),R.length>0&&i.jsxs("div",{className:"space-y-8",children:[i.jsx("div",{className:"border-t border-white/20 pt-4",children:i.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"More Upcoming Events"})}),R.map(([$,B])=>i.jsxs("div",{children:[i.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[i.jsxs("h3",{className:"text-xl font-bold text-white flex items-center gap-2",children:[i.jsx(Fn,{className:"w-5 h-5 text-indigo-400"}),Ut(zp($),"EEEE, MMMM d, yyyy")]}),i.jsx("span",{className:"text-sm text-slate-400 font-semibold",children:M(zp($))})]}),i.jsx("div",{className:"space-y-4",children:B.map(U=>i.jsx(rIe,{event:U,hasAccess:S(U.id),onPurchase:j,onViewLink:r},U.id))})]},$))]})]}),w.filter($=>$.status==="completed"||$.status==="cancelled").length>0&&i.jsxs("div",{className:"mt-12",children:[i.jsxs(ue,{onClick:()=>d(!h),variant:"outline",className:"w-full bg-white/10 hover:bg-white/20 text-white border-white/20 mb-6",children:[h?i.jsx(A_,{className:"w-5 h-5 mr-2"}):i.jsx(Yh,{className:"w-5 h-5 mr-2"}),"Past Events (",w.filter($=>$.status==="completed"||$.status==="cancelled").length,")"]}),h&&i.jsx("div",{className:"space-y-4 opacity-70",children:w.filter($=>$.status==="completed"||$.status==="cancelled").sort(($,B)=>new Date(B.start_datetime)-new Date($.start_datetime)).map($=>i.jsx(Me,{className:"bg-white/10 backdrop-blur-md border-white/20",children:i.jsx(Fe,{className:"p-6",children:i.jsx("div",{className:"flex items-start justify-between",children:i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("h3",{className:"text-xl font-bold text-white",children:$.title}),$.category&&$.category!=="Other"&&i.jsx(nt,{variant:"outline",className:"bg-white/10 text-white border-white/20",children:$.category}),i.jsx(nt,{className:$.status==="completed"?"bg-green-600/80":"bg-red-600/80",children:$.status})]}),i.jsxs("div",{className:"flex items-center gap-4 text-sm text-slate-300",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Fn,{className:"w-4 h-4"}),Ut(zp($.start_datetime),"EEEE, MMMM d, yyyy")]}),$.venue_name&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(js,{className:"w-4 h-4"}),$.venue_name]})]})]})})})},$.id))})]})]}),s&&i.jsx(fN,{event:s,isOpen:o,onClose:()=>l(!1),currentUser:g,onPurchase:N}),n&&i.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-slate-900 animate-in slide-in-from-bottom duration-300",children:[i.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-900 border-b border-slate-700 shadow-md",children:[i.jsxs("div",{className:"text-white font-medium truncate flex-1 mr-4 flex items-center gap-2",children:[i.jsx(ws,{className:"w-4 h-4 text-indigo-400"}),i.jsx("span",{className:"opacity-90 text-sm",children:n})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>window.open(n,"_blank"),title:"Open in browser",className:"text-slate-400 hover:text-white hover:bg-slate-800",children:i.jsx(ws,{className:"w-5 h-5"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>r(null),className:"text-slate-400 hover:text-white hover:bg-slate-800",children:i.jsx(Si,{className:"w-6 h-6"})})]})]}),i.jsx("div",{className:"flex-1 relative bg-white",children:i.jsx("iframe",{src:n,className:"w-full h-full border-0",title:"External Content",sandbox:"allow-same-origin allow-scripts allow-forms allow-popups allow-modals",loading:"lazy"})})]})]})]})}function YN(...e){return T_(Tt(e))}const k5=O.createContext({}),E5=O.createContext({}),QY=O.forwardRef(({className:e,type:t,collapsible:n,...r},s)=>{const[a,o]=O.useState(r.defaultValue||""),l=c=>{o(u=>u===c&&n?"":c)};return i.jsx(k5.Provider,{value:{value:a,onValueChange:l},children:i.jsx("div",{ref:s,className:YN("space-y-2",e),...r})})});QY.displayName="Accordion";const YY=O.forwardRef(({className:e,value:t,...n},r)=>i.jsx(E5.Provider,{value:{value:t},children:i.jsx("div",{ref:r,className:YN("border-b",e),...n})}));YY.displayName="AccordionItem";const XY=O.forwardRef(({className:e,children:t,...n},r)=>{const{value:s,onValueChange:a}=O.useContext(k5),{value:o}=O.useContext(E5),l=s===o;return i.jsx("div",{className:"flex",children:i.jsxs("button",{ref:r,onClick:()=>a(o),className:YN("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),"data-state":l?"open":"closed",...n,children:[t,i.jsx(Yh,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})})});XY.displayName="AccordionTrigger";const ZY=O.forwardRef(({className:e,children:t,...n},r)=>{const{value:s}=O.useContext(k5),{value:a}=O.useContext(E5),o=s===a;return i.jsx(Gs,{initial:!1,children:o&&i.jsx(rt.div,{initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.2},className:"overflow-hidden text-sm",children:i.jsx("div",{ref:r,className:YN("pb-4 pt-0",e),...n,children:t})})})});ZY.displayName="AccordionContent";function sIe({userId:e}){const t=qi(),{data:n=[]}=qe({queryKey:["myAds",e],queryFn:()=>ae.entities.Advertisement.filter({creator_id:e}),enabled:!!e,refetchInterval:1e4,staleTime:5e3}),r=async a=>{var u;const o=parseInt(prompt("How many impressions to add? (1000, 2000, 5000, etc.)","1000"));if(!o||o<1e3){tt.error("Invalid impressions count");return}const c=o/1e3*5;
1108if(confirm(`Add ${o.toLocaleString()} impressions for €${c.toFixed(2)}?`))try{const h=`${window.location.origin}/user-profile?ad_topup_success=true&session_id={CHECKOUT_SESSION_ID}`,d=`${window.location.origin}/user-profile?canceled=true`,m=await ae.functions.invoke("adPayment",{action:"buyMoreImpressions",adId:a.id,impressions:o,cost:c,successUrl:h,cancelUrl:d});(u=m.data)!=null&&u.url&&(window.location.href=m.data.url)}catch{tt.error("Failed to process payment")}},s={pending_payment:"bg-orange-100 text-orange-800",pending_review:"bg-yellow-100 text-yellow-800",active:"bg-green-100 text-green-800",paused:"bg-slate-100 text-slate-800",completed:"bg-blue-100 text-blue-800",rejected:"bg-red-100 text-red-800"};return i.jsxs(Me,{children:[i.jsx(st,{children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(at,{children:"My Ads"}),i.jsxs(ue,{onClick:()=>t(Ft("CreateAd")),children:[i.jsx(li,{className:"w-4 h-4 mr-2"}),"Create New Ad"]})]})}),i.jsx(Fe,{children:n.length===0?i.jsxs("div",{className:"text-center py-8 text-slate-500",children:[i.jsx("p",{children:"You haven't created any ads yet."}),i.jsx(ue,{onClick:()=>
1108t(Ft("CreateAd")),className:"mt-4",children:"Create Your First Ad"})]}):i.jsx("div",{className:"space-y-4",children:n.map(a=>i.jsx("div",{className:"border rounded-lg p-4",children:i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("img",{src:a.image_url,alt:a.title,className:"w-24 h-24 object-cover rounded"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h4",{className:"font-bold",children:a.title}),a.description&&i.jsx("p",{className:"text-sm text-slate-600",children:a.description}),i.jsxs("div",{className:"flex items-center gap-2 mt-2 flex-wrap",children:[i.jsx(nt,{className:s[a.status],children:a.status.replace("_"," ")}),i.jsx("span",{className:"text-xs text-slate-600",children:a.placement.replace("_"," ")})]}),i.jsxs("div",{className:"mt-2 text-sm",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("span",{children:[i.jsx("strong",{children:"Impressions:"})," ",a.impressions_delivered.toLocaleString()," / ",a.impressions_purchased.toLocaleString()]}),i.jsxs("span",{className:"text-slate-600",children:[a.impressions_remaining.toLocaleString()," left"]})]}),i.jsxs("div",{className:"mt-1",children:[i.jsx("strong",{children:"Total Paid:"})," €",a.total_paid.toFixed(2)]})]}),a.ai_rejection_reason&&i.jsx("p",{className:"text-xs text-red-600 mt-2 bg-red-50 p-2 rounded",children:a.ai_rejection_reason}),a.link_url&&i.jsxs("a",{href:a.link_url,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-600 text-xs flex items-center gap-1 mt-2",children:[i.jsx(ws,{className:"w-3 h-3"})," ",a.link_url]})]}),i.jsx("div",{children:a.status==="active"&&i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>r(a),children:"Buy More"})})]})},a.id))})})]})}function aIe(){const e=mn(),[t,n]=O.useState("tickets"),[r,s]=O.useState({full_name:"",display_name:"",avatar_url:"",bio:""}),{data:a,isLoading:o}=qe({queryKey:["currentUser"],queryFn:async()=>{const v=await ae.auth.me();return s({full_name:v.full_name||"",display_name:v.display_name||"",avatar_url:v.avatar_url||"",bio:v.bio||""}),v}}),{data:l=[]}=qe({queryKey:["myGames",a==null?void 0:a.id],queryFn:async()=>{if(!a)return[];const v=await ae.entities.GamePurchase.filter({user_id:a.id});if(v.length===0)return[];const b=await ae.entities.InstantGame.list();return v.map(y=>{const _=b.find(N=>N.id===y.game_id);return{...y,game_title:(_==null?void 0:_.title)||"Unknown Game",game_image:_==null?void 0:_.image_url,game_url:_==null?void 0:_.game_url,game_description:_==null?void 0:_.description}}).filter(y=>y.game_url)},enabled:!!a}),{data:c=[]}=qe({queryKey:["myTickets",a==null?void 0:a.id],queryFn:async()=>{if(!a)return[];const v=await ae.entities.RaffleTicket.list(),b=new Date;return b.setMonth(b.getMonth()-2),v.filter(y=>y.user_id===a.id).filter(y=>new Date(y.purchase_date)>b).sort((y,_)=>new Date(_.purchase_date)-new Date(y.purchase_date))},enabled:!!a}),{data:u=[]}=qe({queryKey:["myAttempts",a==null?void 0:a.id],queryFn:async()=>a?(await ae.entities.CommunityQuizAttempt.filter({user_id:a.id})).sort((b,y)=>new Date(y.completed_at)-new Date(b.completed_at)):[],enabled:!!a}),{data:h=[]}=qe({queryKey:["raffles"],queryFn:()=>ae.entities.Raffle.list()}),d=qt({mutationFn:v=>ae.auth.updateMe(v),onSuccess:()=>{e.invalidateQueries({queryKey:["currentUser"]}),alert("Profile updated successfully!")},onError:v=>{console.error(v),alert("Failed to update profile.")}}),m=v=>{v.preventDefault(),d.mutate(r)};if(o)return i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-900 text-white",children:i.jsx(dr,{className:"animate-spin w-8 h-8"})});const g=c.filter(v=>v.is_winner),w=c.filter(v=>{const b=h.find(y=>y.id===v.raffle_id);return b&&b.status==="active"});return a?i.jsxs(i.Fragment,{children:[i.jsx(ao,{pageName:"UserProfile"}),i.jsx("div",{className:"min-h-screen bg-slate-50 p-6",children:i.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[i.jsx("div",{className:"w-20 h-20 rounded-full bg-indigo-600 flex items-center justify-center text-3xl font-bold text-white shadow-lg overflow-hidden border-4 border-white",children:a.avatar_url?i.jsx("img",{src:a.avatar_url,alt:"Avatar",className:"w-full h-full object-cover"}):a.display_name?a.display_name.charAt(0).toUpperCase():a.full_name?a.full_name.charAt(0).toUpperCase():i.jsx(zo,{})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h1",{className:"text-3xl font-bold text-slate-900",children:a.display_name||a.full_name||"User Profile"}),i.jsx("p",{className:"text-slate-500 truncate",children:a.bio||a.email}),i.jsxs("div",{className:"flex items-center gap-4 mt-2",children:[i.jsxs("div",{className:"bg-indigo-100 text-indigo-800 px-3 py-1 rounded-full text-sm font-bold flex items-center gap-1",children:[i.jsx(Jt,{className:"w-4 h-4"})," Lvl ",a.level||1]}),i.jsxs("div",{className:"bg-emerald-100 text-emerald-800 px-3 py-1 rounded-full text-sm font-bold flex items-center gap-1",children:[i.jsx(Za,{className:"w-4 h-4"})," ",a.xp||0," XP"]})]})]}),i.jsxs(ue,{onClick:()=>ae.auth.logout(window.location.origin),variant:"outline",className:"flex items-center gap-2 border-red-200 text-red-600 hover:bg-red-50 hover:text-red-700 shrink-0",children:[i.jsx(iA,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Log Out"})]})]}),i.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-4 border border-slate-100 mb-6",children:[i.jsxs("h3",{className:"font-bold text-slate-800 mb-3 flex items-center gap-2",children:[i.jsx(Sd,{className:"w-4 h-4 text-orange-500"}),"Community Creator Stats"]}),i.jsx(WY,{userId:a.id})]}),i.jsxs(tu,{value:t,onValueChange:n,className:"space-y-6",children:[i.jsxs(Wl,{className:"bg-white border p-1 w-full sm:w-auto grid grid-cols-3 h-auto",children:[i.jsxs(Wt,{value:"tickets",className:"py-3 data-[state=active]:bg-indigo-50 data-[state=active]:text-indigo-700",children:[i.jsx(Vr,{className:"w-4 h-4 mr-2"})," Tickets"]}),i.jsxs(Wt,{value:"stats",className:"py-3 data-[state=active]:bg-blue-50 data-[state=active]:text-blue-700",children:[i.jsx(Z1,{className:"w-4 h-4 mr-2"})," Stats"]}),i.jsxs(Wt,{value:"games",className:"py-3 data-[state=active]:bg-emerald-50 data-[state=active]:text-emerald-700",children:[i.jsx(vs,{className:"w-4 h-4 mr-2"})," Games"]}),i.jsxs(Wt,{value:"ads",className:"py-3 data-[state=active]:bg-purple-50 data-[state=active]:text-purple-700",children:[i.jsx(Md,{className:"w-4 h-4 mr-2"})," My Ads"]}),i.jsxs(Wt,{value:"winnings",className:"py-3 data-[state=active]:bg-amber-50 data-[state=active]:text-amber-700",children:[i.jsx(Jt,{className:"w-4 h-4 mr-2"})," Wins"]}),i.jsxs(Wt,{value:"profile",className:"py-3 data-[state=active]:bg-slate-100",children:[i.jsx(zo,{className:"w-4 h-4 mr-2"})," Profile"]})]}),i.jsx(Yt,{value:"stats",className:"space-y-6",children:i.jsx(VY,{attempts:u,badges:a.badges||[]})}),i.jsx(Yt,{value:"ads",className:"space-y-6",children:i.jsx(sIe,{userId:a==null?void 0:a.id})}),i.jsxs(Yt,{value:"games",className:"space-y-6",children:[i.jsx("h3",{className:"font-semibold text-lg text-slate-800 mb-4",children:"Purchased Games"}),l.length>0?i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:l.map((v,b)=>i.jsxs(Me,{className:"overflow-hidden hover:shadow-md transition-shadow",children:[i.jsx("div",{className:"h-32 bg-slate-200 relative",children:v.game_image?i.jsx("img",{src:v.game_image,alt:v.game_title,className:"w-full h-full object-cover"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:i.jsx(vs,{className:"w-12 h-12 text-slate-400"})})}),i.jsxs(Fe,{className:"p-4",children:[i.jsx("h4",{className:"font-bold text-lg mb-1",children:v.game_title}),i.jsx("p",{className:"text-sm text-slate-500 mb-4 line-clamp-2",children:v.game_description}),i.jsx(ue,{className:"w-full bg-emerald-600 hover:bg-emerald-700",onClick:()=>window.open(v.game_url,"_blank"),children:"Play Now"}),i.jsxs("p",{className:"text-xs text-slate-400 mt-2 text-center",children:["Purchased on ",Ut(new Date(v.purchased_at),"MMM d, yyyy")]})]})]},b))}):i.jsxs("div",{className:"text-center py-12 bg-white rounded-xl border border-dashed border-slate-300",children:[i.jsx(vs,{className:"w-12 h-12 text-slate-300 mx-auto mb-3"}),i.jsx("p",{className:"text-slate-500",children:"You haven't purchased any games yet."}),i.jsx(ue,{variant:"link",onClick:()=>window.location.href="/QuizGames",children:"Browse Games Store"})]})]}),i.jsx(Yt,{value:"achievements",className:"space-y-6",children:i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[i.jsxs(Me,{className:`text-center p-4 ${c.length>0?"bg-white":"bg-slate-50 opacity-60"}`,children:[i.jsx("div",{className:"w-12 h-12 bg-indigo-100 rounded-full flex items-center justify-center mx-auto mb-2",children:i.jsx(Vr,{className:"w-6 h-6 text-indigo-600"})}),i.jsx("h4",{className:"font-bold text-sm",children:"Raffle Rookie"}),i.jsx("p",{className:"text-xs text-slate-500",children:"Bought first ticket"})]}),i.jsxs(Me,{className:`text-center p-4 ${g.length>0?"bg-white":"bg-slate-50 opacity-60"}`,children:[i.jsx("div",{className:"w-12 h-12 bg-amber-100 rounded-full flex items-center justify-center mx-auto mb-2",children:i.jsx(Jt,{className:"w-6 h-6 text-amber-600"})}),i.jsx("h4",{className:"font-bold text-sm",children:"Lucky Winner"}),i.jsx("p",{className:"text-xs text-slate-500",children:"Won a raffle prize"})]}),i.jsxs(Me,{className:`text-center p-4 ${l.length>0?"bg-white":"bg-slate-50 opacity-60"}`,children:[i.jsx("div",{className:"w-12 h-12 bg-emerald-100 rounded-full flex items-center justify-center mx-auto mb-2",children:i.jsx(vs,{className:"w-6 h-6 text-emerald-600"})}),i.jsx("h4",{className:"font-bold text-sm",children:"Gamer"}),i.jsx("p",{className:"text-xs text-slate-500",children:"Purchased a game"})]}),i.jsxs(Me,{className:`text-center p-4 ${a.display_name?"bg-white":"bg-slate-50 opacity-60"}`,children:[i.jsx("div",{className:"w-12 h-12 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-2",children:i.jsx(zo,{className:"w-6 h-6 text-purple-600"})}),i.jsx("h4",{className:"font-bold text-sm",children:"Identity"}),i.jsx("p",{className:"text-xs text-slate-500",children:"Set display name"})]}),a.badges&&a.badges.map((v,b)=>i.jsxs(Me,{className:"text-center p-4 bg-white border-2 border-indigo-100",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-full flex items-center justify-center mx-auto mb-2 text-white shadow-lg",children:i.jsx(z0,{className:"w-6 h-6"})}),i.jsx("h4",{className:"font-bold text-sm",children:v}),i.jsx("p",{className:"text-xs text-slate-500",children:"Unlocked"})]},`badge-${b}`))]})}),i.jsxs(Yt,{value:"tickets",className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[i.jsx(Me,{children:i.jsxs(Fe,{className:"p-4 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm text-slate-500",children:"Total Tickets"}),i.jsx("p",{className:"text-2xl font-bold",children:c.length})]}),i.jsx(Vr,{className:"w-8 h-8 text-indigo-100"})]})}),i.jsx(Me,{children:i.jsxs(Fe,{className:"p-4 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm text-slate-500",children:"Active Draws"}),i.jsx("p",{className:"text-2xl font-bold text-green-600",children:w.length})]}),i.jsx(rB,{className:"w-8 h-8 text-green-100"})]})}),i.jsx(Me,{children:i.jsxs(Fe,{className:"p-4 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm text-slate-500",children:"Wins"}),i.jsx("p",{className:"text-2xl font-bold text-amber-500",children:g.length})]}),i.jsx(Jt,{className:"w-8 h-8 text-amber-100"})]})})]}),i.jsx("h3",{className:"font-semibold text-lg text-slate-800 mb-4",children:"Recent Tickets (Last 2 Months)"}),c.length>0?i.jsx(QY,{type:"single",collapsible:!0,className:"w-full space-y-2",children:Object.entries(c.reduce((v,b)=>{const y=Ut(new Date(b.purchase_date),"MMMM yyyy");return v[y]||(v[y]=[]),v[y].push(b),v},{})).map(([v,b])=>i.jsxs(YY,{value:v,className:"bg-white border border-slate-200 rounded-xl px-4",children:[i.jsx(XY,{className:"text-slate-800 font-semibold hover:no-underline",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Fn,{className:"w-4 h-4 text-indigo-500"}),v,i.jsxs(nt,{variant:"secondary",className:"ml-2 bg-indigo-50 text-indigo-700 border-indigo-100",children:[b.length," ",b.length===1?"Ticket":"Tickets"]})]})}),i.jsx(ZY,{className:"pt-4 pb-4",children:i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:b.map(y=>{const _=h.find(N=>N.id===y.raffle_id);return i.jsxs(rt.div,{initial:{opacity:0,y:10}
1108,animate:{opacity:1,y:0},className:"bg-slate-50 p-4 rounded-lg border border-slate-200",children:[i.jsxs("div",{className:"flex justify-between items-start mb-2",children:[i.jsx(nt,{variant:y.is_winner?"default":"outline",className:y.is_winner?"bg-amber-500 hover:bg-amber-600":"bg-white",children:y.is_winner?"WINNER!":(_==null?void 0:_.status)==="active"?"In Play":"Completed"}),i.jsx("span",{className:"text-xs text-slate-400",children:Ut(new Date(y.purchase_date),"MMM d")})]}),i.jsx("div",{className:"font-mono text-xl font-bold text-slate-800 tracking-widest mb-1",children:y.ticket_code}),i.jsx("p",{className:"text-sm text-slate-500 truncate",children:(_==null?void 0:_.title)||"Unknown Raffle"})]},y.id)})})})]},v))}):i.jsxs("div",{className:"text-center py-12 bg-white rounded-xl border border-dashed border-slate-300",children:[i.jsx(Vr,{className:"w-12 h-12 text-slate-300 mx-auto mb-3"}),i.jsx("p",{className:"text-slate-500",children:"No recent tickets found (older than 2 months are hidden)."})]})]}),i.jsx(Yt,{value:"winnings",children:i.jsxs(Me,{children:[i.jsxs(st,{children:[i.jsx(at,{children:"Your Prize History"}),i.jsx(Ja,{children:"Track all your raffle victories here."})]}),i.jsx(Fe,{children:g.length>0?i.jsx("div",{className:"space-y-4",children:g.map(v=>{const b=h.find(y=>y.id===v.raffle_id);return i.jsxs(rt.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},className:"flex items-center p-4 bg-amber-50 border border-amber-200 rounded-lg",children:[i.jsx("div",{className:"p-3 bg-amber-100 rounded-full mr-4",children:i.jsx(Jt,{className:"w-6 h-6 text-amber-600"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h4",{className:"font-bold text-slate-800",children:b==null?void 0:b.title}),i.jsxs("p",{className:"text-sm text-slate-600",children:["Won Prize #",v.prize_rank," with ticket ",i.jsx("span",{className:"font-mono font-bold",children:v.ticket_code})]})]}),i.jsx("div",{className:"text-right text-sm text-slate-500",children:Ut(new Date(v.purchase_date),"MMM d, yyyy")})]},v.id)})}):i.jsxs("div",{className:"text-center py-12",children:[i.jsx(Jt,{className:"w-12 h-12 text-slate-200 mx-auto mb-3"}),i.jsx("p",{className:"text-slate-500",children:"No winnings yet. Good luck on your next draw!"})]})})]})}),i.jsx(Yt,{value:"profile",children:i.jsxs(Me,{children:[i.jsxs(st,{children:[i.jsx(at,{children:"Profile Customization"}),i.jsx(Ja,{children:"Customize how you appear to others."})]}),i.jsx(Fe,{children:i.jsxs("form",{onSubmit:m,className:"space-y-6",children:[i.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[i.jsxs("div",{className:"flex-shrink-0",children:[i.jsx(me,{className:"block mb-2",children:"Avatar"}),i.jsxs("div",{className:"w-24 h-24 rounded-full bg-slate-100 border-2 border-dashed border-slate-300 flex items-center justify-center overflow-hidden relative group",children:[r.avatar_url?i.jsx("img",{src:r.avatar_url,alt:"Avatar",className:"w-full h-full object-cover"}):i.jsx(zo,{className:"w-10 h-10 text-slate-400"}),i.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:i.jsx(Md,{className:"w-6 h-6 text-white"})})]}),i.jsxs("div",{className:"mt-2",children:[i.jsx(me,{htmlFor:"avatar",className:"text-xs",children:"Avatar URL"}),i.jsx(Ee,{id:"avatar",value:r.avatar_url,onChange:v=>s({...r,avatar_url:v.target.value}),placeholder:"https://...",className:"mt-1 text-xs"})]})]}),i.jsxs("div",{className:"flex-1 space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"display_name",children:"Display Name"}),i.jsx(Ee,{id:"display_name",value:r.display_name,onChange:v=>s({...r,display_name:v.target.value}),placeholder:"How should we call you?"}),i.jsx("p",{className:"text-xs text-slate-500",children:"This name will be shown on leaderboards and public profiles."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"bio",children:"Bio"}),i.jsx(Ee,{id:"bio",value:r.bio,onChange:v=>s({...r,bio:v.target.value}),placeholder:"Short bio about yourself"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"name",children:"Full Name (Private)"}),i.jsx(Ee,{id:"name",value:r.full_name,onChange:v=>s({...r,full_name:v.target.value}),placeholder:"Enter your full name"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(me,{htmlFor:"email",children:"Email Address"}),i.jsx(Ee,{id:"email",value:a.email,disabled:!0,className:"bg-slate-50 text-slate-500"})]})]})]}),i.jsx("div",{className:"pt-4 border-t border-slate-100 flex justify-end",children:i.jsxs(ue,{type:"submit",disabled:d.isPending,className:"bg-indigo-600 hover:bg-indigo-700",children:[d.isPending?i.jsx(dr,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(Hy,{className:"w-4 h-4 mr-2"}),"Save Profile"]})})]})})]})})]})]})})]}):i.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-slate-900 text-white p-6 text-center",children:[i.jsx("h1",{className:"text-3xl font-bold mb-4",children:"Access Denied"}),i.jsx("p",{className:"text-slate-400 mb-8",children:"Please log in to view your profile."}),i.jsx(ue,{onClick:()=>ae.auth.redirectToLogin(),className:"bg-indigo-600 hover:bg-indigo-700",children:"Log In"})]})}function oIe({open:e,onOpenChange:t,url:n,showExternalLink:r}){return n?i.jsx(rn,{open:e,onOpenChange:t,children:i.jsxs(en,{className:"max-w-5xl w-full h-[90vh] p-0 bg-slate-900 border-slate-700 [&>button]:hidden flex flex-col",children:[i.jsx(HU,{children:i.jsx(sn,{children:"Live Quiz"})}),i.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-slate-800 rounded-t-lg border-b border-slate-700 shrink-0",children:[i.jsx("span",{className:"text-white font-semibold text-sm",children:"Live Quiz"}),i.jsxs("div",{className:"flex items-center gap-2",children:[r&&i.jsxs(ue,{variant:"ghost",size:"sm",className:"text-slate-300 hover:text-white",onClick:()=>window.open(n,"_blank"),children:[i.jsx(ws,{className:"w-4 h-4 mr-1"}),"Open in new tab"]}),i.jsx("button",{onClick:()=>t(!1),className:"p-1.5 rounded-full hover:bg-white/10 text-slate-400 hover:text-white transition-colors",children:i.jsx(Si,{className:"w-5 h-5"})})]})]}),i.jsx("iframe",{src:n,className:"w-full flex-1 rounded-b-lg",title:"Live Quiz",allow:"camera; microphone; fullscreen",allowFullScreen:!0})]})}):null}function lIe(){return i.jsx("footer",{className:"w-full bg-slate-900 border-t border-slate-800 mt-4",children:i.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-8",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-6",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-white font-bold mb-2",children:"Live Quizzing"}),i.jsx("p",{className:"text-slate-400 text-sm",children:"Ireland's home for live quiz nights — tracking standings, celebrating teams, and bringing communities together."})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-slate-300 font-semibold mb-2 text-sm uppercase tracking-wide",children:"Qu
1108ick Links"}),i.jsxs("ul",{className:"space-y-1",children:[i.jsx("li",{children:i.jsx(lr,{to:Ft("Public"),className:"text-slate-400 hover:text-white text-sm transition-colors",children:"Home"})}),i.jsx("li",{children:i.jsx(lr,{to:Ft("Blog"),className:"text-slate-400 hover:text-white text-sm transition-colors",children:"Blog"})}),i.jsx("li",{children:i.jsx(lr,{to:Ft("BookingPortal"),className:"text-slate-400 hover:text-white text-sm transition-colors",children:"Book a Quiz"})}),i.jsx("li",{children:i.jsx(lr,{to:Ft("UpcomingEvents"),className:"text-slate-400 hover:text-white text-sm transition-colors",children:"Events"})})]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-slate-300 font-semibold mb-2 text-sm uppercase tracking-wide",children:"Legal & Contact"}),i.jsxs("ul",{className:"space-y-1",children:[i.jsx("li",{children:i.jsx(lr,{to:Ft("About"),className:"text-slate-400 hover:text-white text-sm transition-colors",children:"About & Contact"})}),i.jsx("li",{children:i.jsx(lr,{to:Ft("PrivacyPolicy"),className:"text-slate-400 hover:text-white text-sm transition-colors",children:"Privacy Policy"})}),i.jsx("li",{children:i.jsx(lr,{to:"/TermsOfService",className:"text-slate-400 hover:text-white text-sm transition-colors",children:"Terms of Service"})}),i.jsx("li",{children:i.jsx("a",{href:"mailto:[email protected]",className:"text-slate-400 hover:text-white text-sm transition-colors",children:"[email protected]"})})]})]})]}),i.jsxs("div",{className:"border-t border-slate-800 pt-4 flex flex-col md:flex-row items-center justify-between gap-2 text-xs text-slate-500",children:[i.jsxs("span",{children:["© ",new Date().getFullYear()," Live Quizzing. All rights reserved."]}),i.jsx("span",{children:"Based in Ireland 🇮🇪"})]})]})})}function cIe(){const[e,t]=O.useState(null),[n,r]=O.useState(!1);O.useEffect(()=>{const o=l=>{l.preventDefault(),t(l);const c=localStorage.getItem("pwa_install_dismissed");(c?(Date.now()-parseInt(c))/(1e3*60*60*24):999)>7&&r(!0)};return window.addEventListener("beforeinstallprompt",o),()=>window.removeEventListener("beforeinstallprompt",o)},[]);const s=async()=>{if(!e)return;e.prompt();const{outcome:o}=await e.userChoice;o==="accepted"&&r(!1),t(null)},a=()=>{localStorage.setItem("pwa_install_dismissed",Date.now().toString()),r(!1)};return n?i.jsx(Gs,{children:i.jsx(rt.div,{initial:{y:100,opacity:0},animate:{y:0,opacity:1},exit:{y:100,opacity:0},className:"fixed bottom-4 left-4 right-4 md:left-auto md:right-4 md:w-96 z-50",children:i.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl border border-slate-200 p-5",children:[i.jsx("button",{onClick:a,className:"absolute top-3 right-3 text-slate-400 hover:text-slate-600",children:i.jsx(Si,{className:"w-5 h-5"})}),i.jsxs("div",{className:"flex gap-4",children:[i.jsx("div",{className:"w-12 h-12 bg-indigo-100 rounded-xl flex items-center justify-center flex-shrink-0",children:i.jsx(sA,{className:"w-6 h-6 text-indigo-600"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-bold text-slate-900 mb-1",children:"Install Live Quizzing"}),i.jsx("p",{className:"text-sm text-slate-600 mb-4",children:"Add to your home screen for quick access and offline features"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{onClick:s,className:"bg-indigo-600 hover:bg-indigo-700 gap-2",children:[i.jsx(Wy,{className:"w-4 h-4"}),"Install"]}),i.jsx(ue,{onClick:a,variant:"ghost",children:"Maybe Later"})]})]})]})]})})}):null}function uIe(){const[e,t]=O.useState(!0),[n,r]=O.useState(!1);return O.useEffect(()=>{const s=()=>{t(!0),r(!0),setTimeout(()=>r(!1),3e3)},a=()=>{t(!1),r(!1)};return t(navigator.onLine),window.addEventListener("online",s),window.addEventListener("offline",a),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",a)}},[]),i.jsxs(Gs,{children:[!e&&i.jsxs(rt.div,{initial:{y:-100},animate:{y:0},exit:{y:-100},className:"fixed top-0 left-0 right-0 z-50 bg-red-600 text-white py-2 px-4 text-center text-sm font-medium shadow-lg",children:[i.jsx(lne,{className:"w-4 h-4 inline mr-2"}),"You're offline - Some features may not work"]}),n&&i.jsxs(rt.div,{initial:{y:-100},animate:{y:0},exit:{y:-100},className:"fixed top-0 left-0 right-0 z-50 bg-green-600 text-white py-2 px-4 text-center text-sm font-medium shadow-lg",children:[i.jsx(une,{className:"w-4 h-4 inline mr-2"}),"Back online!"]})]})}function dIe({currentUser:e}){const t=oo(),n=s=>s==="/"?t.pathname==="/":t.pathname.includes(s),r=[{icon:BT,label:"Home",path:"/"},{icon:Jt,label:"Teams",path:Ft("TeamsStats")},{icon:Vr,label:"Raffles",path:Ft("RaffleTickets")},{icon:Fn,label:"Events",path:Ft("UpcomingEvents")},{icon:zo,label:"Profile",path:Ft("UserProfile")}];return i.jsx("nav",{className:"md:hidden fixed bottom-0 left-0 right-0 bg-white border-t border-slate-200 z-40 safe-area-inset-bottom",children:i.jsx("div",{className:"grid grid-cols-5 h-16",children:r.map(s=>{const a=s.icon,o=n(s.path);return i.jsxs(lr,{to:s.path,className:`flex flex-col items-center justify-center gap-1 transition-colors ${o?"text-indigo-600":"text-slate-400 active:text-slate-600"}`,children:[i.jsx(a,{className:`w-5 h-5 ${o?"stroke-[2.5]":""}`}),i.jsx("span",{className:"text-[10px] font-medium",children:s.label})]},s.path)})})})}function fIe({children:e,currentPageName:t}){var B;const[n,r]=O.useState(!1),[s,a]=O.useState(!1),[o,l]=O.useState(null),[c,u]=O.useState(null),[h,d]=O.useState(!1),[m,g]=O.useState(!1),w=oo(),v=mn(),b=yb();se.useEffect(()=>{r(!1)},[w]);const[y,_]=O.useState(null),[N,j]=O.useState(!1),{data:S}=qe({queryKey:["currentUser"],queryFn:()=>ae.auth.me().catch(()=>null)});se.useEffect(()=>{!S&&localStorage.getItem("admin_authenticated")&&localStorage.removeItem("admin_authenticated")},[S]),se.useEffect(()=>{S&&(async()=>{var G,Z;try{const X=await ae.functions.invoke("gamification",{action:"dailyLogin"});(G=X.data)!=null&&G.success&&((Z=X.data)!=null&&Z.xpAwarded)}catch{}})()},[S]),se.useEffect(()=>{const U=new URLSearchParams(window.location.search),G=U.get("buy_event_success"),Z=U.get("buy_game_success"),X=U.get("event_id"),V=U.get("game_id"),z=U.get("session_id");if(z&&!/^cs_[a-zA-Z0-9_]+$/.test(z)){console.error("Invalid session ID format");return}if(Z==="true"&&V&&z){let W=0;const Q=5,J=async()=>{var ne,Y;try{const ee=await ae.functions.invoke("payment",{action:"verifySession",sessionId:z});if((ne=ee.data)!=null&&ne.success||((Y=ee.data)==null?void 0:Y.message)==="Game access already granted"){const re=(await ae.entities.InstantGame.filter({id:V}
1108))[0];re&&re.game_url&&(l(re.game_url),d(re.price>0),a(!0),window.history.replaceState({},"",window.location.pathname));return}throw new Error("Verification incomplete")}catch{W<Q&&(W++,setTimeout(J,2e3))}};J()}if(U.get("ad_payment_success")==="true"&&z&&(async()=>{try{await ae.functions.invoke("payment",{action:"verifySession",sessionId:z}),window.history.replaceState({},"",window.location.pathname),v.invalidateQueries(["myAds"])}catch(Q){console.error("Ad verification failed",Q)}})(),G==="true"&&X&&z){g(!0);let W=0;const Q=5,J=async()=>{var ne,Y;try{const ee=await ae.functions.invoke("payment",{action:"verifySession",sessionId:z});if((ne=ee.data)!=null&&ne.success&&((Y=ee.data)!=null&&Y.game_url)){v.invalidateQueries(["myEventPurchases"]),l(ee.data.game_url),d(!0),a(!0),g(!1),window.history.replaceState({},"",window.location.pathname);return}throw new Error("Verification incomplete")}catch(ee){W<Q?(W++,setTimeout(J,2e3)):(g(!1),console.error("Failed to verify event purchase after retries",ee))}};J()}},[]),se.useEffect(()=>{const G=new URLSearchParams(w.search).get("hub");G==="live-quiz"?a(!0):G&&!n&&r(!0)},[w.search]),se.useEffect(()=>{const U=document.createElement("link");if(U.rel="manifest",U.href="data:application/json;charset=utf-8,"+encodeURIComponent(JSON.stringify({name:"Live Quizzing",short_name:"Live Quizzing",description:"Live Quizzing standings and team statistics",start_url:window.location.origin,display:"standalone",background_color:"#0f172a",theme_color:"#312e81",orientation:"any",icons:[{src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Crect width='512' height='512' fill='%23312e81'/%3E%3Cpath d='M256 80l80 160h-160z' fill='%23fbbf24'/%3E%3Ccircle cx='256' cy='320' r='60' fill='%23fbbf24'/%3E%3Crect x='196' y='360' width='120' height='80' rx='10' fill='%23fbbf24'/%3E%3C/svg%3E",sizes:"512x512",type:"image/svg+xml",purpose:"any maskable"}]})),document.head.appendChild(U),!document.querySelector('meta[name="theme-color"]')){const X=document.createElement("meta");X.name="theme-color",X.content="#312e81",document.head.appendChild(X)}const Z=document.createElement("link");return Z.rel="apple-touch-icon",Z.href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Crect width='512' height='512' fill='%23312e81'/%3E%3Cpath d='M256 80l80 160h-160z' fill='%23fbbf24'/%3E%3Ccircle cx='256' cy='320' r='60' fill='%23fbbf24'/%3E%3Crect x='196' y='360' width='120' height='80' rx='10' fill='%23fbbf24'/%3E%3C/svg%3E",document.head.appendChild(Z),()=>{document.head.removeChild(U),document.head.removeChild(Z)}},[]);const{data:C=[]}=qe({queryKey:["newsletters"],queryFn:()=>ae.entities.Newsletter.list("-created_date",20),refetchInterval:6e4,staleTime:3e4}),{data:P=[]}=qe({queryKey:["raffles"],queryFn:()=>ae.entities.Raffle.list(),refetchInterval:1e4,staleTime:5e3}),{data:A}=qe({queryKey:["settings"],queryFn:async()=>(await ae.entities.Settings.list())[0]||{},refetchInterval:1e4,staleTime:5e3});se.useEffect(()=>{if(A!=null&&A.force_close_trigger){const U=new Date(A.force_close_trigger).getTime(),G=parseInt(localStorage.getItem("last_force_close_handled_promo")||"0");U>G&&(j(!1),localStorage.setItem("last_force_close_handled_promo",U.toString()))}},[A==null?void 0:A.force_close_trigger]),se.useEffect(()=>{if(A!=null&&A.promo_active&&(A!=null&&A.promo_raffle_id||A!=null&&A.promo_event_id)&&(A!=null&&A.promo_trigger_timestamp)){const U=localStorage.getItem("last_promo_seen"),G=new Date(A.promo_trigger_timestamp).getTime(),X=Date.now()-G<3e4;new Date(A.promo_trigger_timestamp)>new Date(U||0)&&X&&j(!0)}else j(!1)},[A==null?void 0:A.promo_active,A==null?void 0:A.promo_trigger_timestamp]);const F=()=>{A!=null&&A.promo_trigger_timestamp&&localStorage.setItem("last_promo_seen",A.promo_trigger_timestamp),j(!1)};se.useEffect(()=>{let U=!0,G=null,Z=0;const X=3,V=async()=>{var z;if(U)try{const L=await ae.functions.invoke("waitForUpdates");Z=0,U&&((z=L.data)!=null&&z.update)&&v.invalidateQueries({queryKey:["raffles"]}),U&&(G=setTimeout(V,2e3))}catch{if(U){Z++;const W=Z>=X?3e4:1e4;G=setTimeout(V,W)}}};return V(),()=>{U=!1,G&&clearTimeout(G)}},[v]);const I=P.find(U=>U.active_draw_state&&U.active_draw_state!=="idle");se.useEffect(()=>{var U;(U=I==null?void 0:I.current_winner_display)!=null&&U.ticket_code&&_(G=>G===I.current_winner_display.ticket_code?G:null)},[(B=I==null?void 0:I.current_winner_display)==null?void 0:B.ticket_code]);const M=(()=>{const U=localStorage.getItem("newsletter_last_seen");return U?C.filter(G=>G.is_published&&new Date(G.created_date)>new Date(U)).length:C.filter(G=>G.is_published).length})(),$=async U=>{var G,Z,X,V;if(!S){ae.auth.redirectToLogin();return}try{const z=`${window.location.origin}${window.location.pathname}?buy_event_success=true&event_id=${U.id}&session_id={CHECKOUT_SESSION_ID}`,L=`${window.location.origin}${window.location.pathname}?canceled=true`;if(U.price===0){const Q=await ae.functions.invoke("payment",{action:"claimFreeEvent",eventId:U.id,userId:S.id,userEmail:S.email});((G=Q.data)!=null&&G.success||((Z=Q.data)==null?void 0:Z.message)==="Access already granted")&&(U.game_url&&(l(U.game_url),d(!1),a(!0)),u(null));return}const W=await ae.functions.invoke("payment",{action:"createSession",eventId:U.id,quantity:1,userId:S.id,userEmail:S.email,successUrl:z,cancelUrl:L});if((X=W.data)!=null&&X.url)window.location.href=W.data.url;else throw new Error(((V=W.data)==null?void 0:V.error)||"Failed to create checkout session")}catch(z){console.error("Event purchase error:",z),tt.error(z.message||"Failed to process purchase. Please try again.")}};return i.jsxs(i.Fragment,{children:[i.jsx(Sce,{}),i.jsx(uIe,{}),i.jsx(cIe,{}),m&&i.jsxs(rt.div,{initial:{opacity:0}
1108,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-gradient-to-br from-slate-900 via-indigo-950 to-slate-900 z-[10100] flex items-center justify-center overflow-hidden",children:[i.jsxs("div",{className:"absolute inset-0",children:[i.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(99,102,241,0.15),transparent_60%)] animate-pulse"}),[...Array(20)].map((U,G)=>i.jsx(rt.div,{className:"absolute w-1 h-1 bg-amber-500/30 rounded-full",style:{left:`${Math.random()*100}%`,top:`${Math.random()*100}%`},animate:{y:[0,-30,0],opacity:[.3,1,.3],scale:[1,1.5,1]},transition:{duration:3+Math.random()*2,repeat:1/0,delay:Math.random()*2}},G))]}),i.jsxs(rt.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.5,ease:"easeOut"},className:"text-center space-y-10 max-w-md px-8 relative z-10",children:[i.jsxs("div",{className:"relative mx-auto w-40 h-40",children:[i.jsx(rt.div,{className:"absolute inset-0 rounded-full bg-gradient-to-r from-amber-500/20 to-indigo-500/20 blur-xl",animate:{scale:[1,1.2,1]},transition:{duration:2,repeat:1/0}}),i.jsx(rt.div,{className:"absolute inset-0 border-4 border-transparent border-t-amber-500 border-r-amber-400 rounded-full",animate:{rotate:360},transition:{duration:1.5,repeat:1/0,ease:"linear"}}),i.jsx(rt.div,{className:"absolute inset-4 border-4 border-transparent border-t-indigo-500 border-l-indigo-400 rounded-full",animate:{rotate:-360},transition:{duration:2,repeat:1/0,ease:"linear"}}),i.jsx(rt.div,{className:"absolute inset-8 border-3 border-transparent border-t-purple-400 border-r-pink-400 rounded-full",animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"}}),i.jsx(rt.div,{className:"absolute inset-0 flex items-center justify-center",animate:{scale:[1,1.1,1]},transition:{duration:1.5,repeat:1/0},children:i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-amber-500 via-amber-600 to-orange-600 rounded-full flex items-center justify-center shadow-2xl shadow-amber-500/50",children:i.jsx(rt.svg,{className:"w-8 h-8 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",initial:{pathLength:0},animate:{pathLength:1},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},children:i.jsx(rt.path,{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})})})]}),i.jsxs(rt.div,{className:"space-y-5",initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3,duration:.5},children:[i.jsxs("div",{className:"space-y-3",children:[i.jsx(rt.h2,{className:"text-4xl font-bold text-white",animate:{backgroundPosition:["0% 50%","100% 50%","0% 50%"]},transition:{duration:3,repeat:1/0},style:{backgroundImage:"linear-gradient(90deg, #ffffff 0%, #fbbf24 25%, #f59e0b 50%, #fbbf24 75%, #ffffff 100%)",backgroundSize:"200% 100%",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:"Verifying Your Purchase"}),i.jsx(rt.div,{className:"h-1 w-24 mx-auto bg-gradient-to-r from-transparent via-amber-500 to-transparent rounded-full",animate:{scaleX:[.5,1,.5]},transition:{duration:2,repeat:1/0}})]}),i.jsxs(rt.div,{className:"space-y-3 bg-slate-800/30 backdrop-blur-sm rounded-2xl p-6 border border-slate-700/50",initial:{scale:.95},animate:{scale:1},transition:{delay:.5,duration:.3},children:[i.jsx("p",{className:"text-slate-200 text-lg font-medium",children:"Please bear with us as we prepare your game access"}),i.jsx("p",{className:"text-slate-400 text-sm",children:"This will only take a moment..."})]}),i.jsx("div",{className:"flex justify-center items-center gap-3 pt-4",children:[0,150,300].map((U,G)=>i.jsx(rt.div,{className:"w-3 h-3 bg-gradient-to-br from-amber-500 to-orange-500 rounded-full shadow-lg shadow-amber-500/50",animate:{y:[0,-15,0],scale:[1,1.2,1]},transition:{duration:.8,repeat:1/0,delay:U/1e3,ease:"easeInOut"}},G))})]}),i.jsx(rt.div,{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-amber-500/50 to-transparent",animate:{x:["-100%","100%"]},transition:{duration:2,repeat:1/0,ease:"linear"}})]})]}),i.jsx(oIe,{open:s,onOpenChange:U=>{a(U),U||(l(null),d(!1))}
1108,url:o||(A==null?void 0:A.current_quiz_url)}),c&&i.jsx(fN,{event:c,isOpen:!!c,onClose:()=>u(null),currentUser:S,onPurchase:$}),n&&i.jsx(vY,{onClose:()=>r(!1),onOpenLiveQuiz:()=>a(!0)}),i.jsxs(Gs,{children:[N&&A&&t!=="Admin"&&i.jsx(LQ,{settings:A,onClose:F,onAction:()=>{a(!1)},onPurchaseRequest:U=>u(U)}),I&&I.active_draw_state==="drawing"&&i.jsx(rt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999]",children:i.jsx(IQ,{onComplete:()=>{},duration:I.splash_duration_seconds||4,raffle:I})}),I&&I.active_draw_state==="revealing"&&I.current_winner_display&&y!==I.current_winner_display.ticket_code&&i.jsx(rt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999]",children:i.jsx(DQ,{winner:I.current_winner_display,raffle:I,onClose:()=>_(I.current_winner_display.ticket_code),onDrawNext:null})})]}),i.jsxs("div",{className:"min-h-screen",children:[i.jsx("nav",{className:"bg-slate-900 border-b border-slate-800",children:i.jsx("div",{className:"max-w-7xl mx-auto px-4",children:i.jsxs("div",{className:"flex items-center justify-between h-16 relative",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{src:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/69159eb1f2b08a81df520821/e08a7a193_LiveQuizzing.png",alt:"Live Quizzing",className:"h-10 w-auto bg-white rounded-md p-1.5",loading:"lazy"}),i.jsx("span",{className:"text-white font-bold text-lg hidden md:inline",children:"Hub"})]}),i.jsxs("div",{className:"flex items-center gap-4",children:[S&&i.jsx(lr,{to:Ft("UserProfile"),className:"text-slate-300 hover:text-white flex items-center gap-2 font-medium transition-colors text-sm md:text-base",children:S.avatar_url?i.jsx("img",{src:S.avatar_url,alt:"Avatar",className:"w-8 h-8 rounded-full object-cover border border-slate-600",loading:"lazy"}):i.jsx("div",{className:"w-8 h-8 rounded-full bg-indigo-600 flex items-center justify-center text-white text-xs font-bold border border-slate-600",children:S.display_name?S.display_name.charAt(0).toUpperCase():S.full_name?S.full_name.charAt(0).toUpperCase():i.jsx(zo,{className:"w-4 h-4"})})}),i.jsxs(lr,{to:Ft("TicketChecker"),className:"text-slate-300 hover:text-white flex items-center gap-2 font-medium transition-colors text-sm md:text-base",children:[i.jsx(Cn,{className:"w-5 h-5"}),i.jsx("span",{className:"hidden md:inline",children:"Check Tickets"})]}),i.jsxs("button",{onClick:()=>{b.light(),r(!0)},className:"bg-indigo-600 hover:bg-indigo-700 active:bg-indigo-800 text-white px-5 py-2.5 md:px-6 md:py-3 rounded-xl flex items-center gap-2.5 font-bold transition-all duration-150 hover:scale-105 active:scale-95 active:shadow-inner relative shadow-xl shadow-indigo-900/20",children:[i.jsx(Uee,{className:"w-5 h-5 md:w-6 md:h-6"}),i.jsx("span",{className:"text-sm md:text-base",children:"Hub Apps"}),M>0&&i.jsx("span",{className:"absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full w-5 h-5 flex items-center justify-center font-bold border-2 border-slate-900",children:M>9?"9+":M})]})]})]})})}),i.jsx("main",{className:"pb-20 md:pb-0",children:e}),i.jsx(UY,{isActive:(A==null?void 0:A.show_game_pass_promo)??!1}),i.jsx(dIe,{currentUser:S}),i.jsx(lIe,{})]})]})}const hIe={About:Lce,Admin:wMe,Blog:jMe,BookingPortal:EMe,CentralHub:vY,Community:BMe,CommunityChallenges:WMe,CreateAd:u3e,CreateCommunityQuiz:d3e,Home:f3e,Newsletter:h3e,NewsletterSubscription:m3e,PaymentCancel:p3e,PaymentSuccess:g3e,PlayCommunityQuiz:x3e,PrivacyPolicy:y3e,Public:T3e,PublicProfile:R3e,QuizGames:F3e,RaffleTickets:V3e,TeamIntelligence:W3e,TeamPhoto:H3e,TeamProfiles:K3e,TeamsStats:Q3e,TicketChecker:tIe,UpcomingEvents:iIe,UserProfile:aIe},JY={mainPage:"Public",Pages:hIe,Layout:fIe};function mIe(){const e=oo(),{isAuthenticated:t}=Q9(),{Pages:n,mainPage:r}=JY,s=r;return O.useEffect(()=>{var a;(a=window.parent)==null||a.postMessage({type:"app_changed_url",url:window.location.href},"*")},[e]),O.useEffect(()=>{const a=e.pathname;let o;if(a==="/"||a==="")o=s;else{const l=a.replace(/^\//,"").split("/")[0];o=Object.keys(n).find(h=>h.toLowerCase()===l.toLowerCase())||null}t&&o&&ae.appLogs.logUserInApp(o).catch(()=>{})},[e,t,n,s]),null}function pIe({}){var s;const t=oo().pathname.substring(1),{data:n,isFetched:r}=qe({queryKey:["user"],queryFn:async()=>{try{return{user:await ae.auth.me(),isAuthenticated:!0}}catch{return{user:null,isAuthenticated:!1}}}});return i.jsx("div",{className:"min-h-screen flex items-center justify-center p-6 bg-slate-50",children:i.jsx("div",{className:"max-w-md w-full",children:i.jsxs("div",{className:"text-center space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("h1",{className:"text-7xl font-light text-slate-300",children:"404"}),i.jsx("div",{className:"h-0.5 w-16 bg-slate-200 mx-auto"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("h2",{className:"text-2xl font-medium text-slate-800",children:"Page Not Found"}),i.jsxs("p",{className:"text-slate-600 leading-relaxed",children:["The page ",i.jsxs("span",{className:"font-medium text-slate-700",children:['"',t,'"']})," could not be found in this application."]})]}),r&&n.isAuthenticated&&((s=n.user)==null?void 0:s.role)==="admin"&&i.jsx("div",{className:"mt-8 p-4 bg-slate-100 rounded-lg border border-slate-200",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"flex-shrink-0 w-5 h-5 rounded-full bg-orange-100 flex items-center justify-center mt-0.5",children:i.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-400"})}),i.jsxs("div",{className:"text-left space-y-1",children:[i.jsx("p",{className:"text-sm font-medium text-slate-700",children:"Admin Note"}),i.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:"This could mean that the AI hasn't implemented this page yet. Ask it to implement it in the chat."})]})]})}),i.jsx("div",{className:"pt-6",children:i.jsxs("button",{onClick:()=>window.location.href="/",className:"inline-flex items-center px-4 py-2 text-sm font-medium text-slate-700 bg-white border border-slate-200 rounded-lg hover:bg-slate-50 hover:border-slate-300 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-slate-500",children:[i.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),"Go Home"]})})]})})})}function gIe(){return i.jsx("div",{className:"min-h-screen bg-slate-50",children:i.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-12",children:[i.jsxs(lr,{to:Ft("Public"),className:"inline-flex items-center gap-2 text-indigo-600 hover:text-indigo-800 mb
1108-8 font-medium",children:[i.jsx(uu,{className:"w-4 h-4"}),"Back to Home"]}),i.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-200 p-8 md:p-12",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[i.jsx(Dd,{className:"w-8 h-8 text-indigo-600"}),i.jsx("h1",{className:"text-3xl font-bold text-slate-900",children:"Terms of Service"})]}),i.jsx("p",{className:"text-slate-500 mb-8 text-sm",children:"Last updated: May 2026"}),i.jsxs("div",{className:"prose prose-slate max-w-none space-y-8 text-slate-700",children:[i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"1. Acceptance of Terms"}),i.jsxs("p",{children:["By accessing or using the Live Quizzing website at ",i.jsx("strong",{children:"livequizzing.com"}),", you agree to be bound by these Terms of Service. If you do not agree with any part of these terms, you may not use our service."]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"2. Description of Service"}),i.jsx("p",{children:"Live Quizzing provides a platform for quiz league management, live quiz participation, raffle ticket purchases, event booking, and community features. The service is operated from Ireland and is primarily intended for users in Ireland and the United Kingdom."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"3. User Accounts"}),i.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[i.jsx("li",{children:"You must provide accurate and complete information when creating an account."}),i.jsx("li",{children:"You are responsible for maintaining the confidentiality of your login credentials."}),i.jsx("li",{children:"You are responsible for all activity that occurs under your account."}),i.jsx("li",{children:"You must notify us immediately of any unauthorised use of your account."}),i.jsx("li",{children:"We reserve the right to suspend or terminate accounts that violate these terms."})]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"4. Payments & Purchases"}),i.jsxs("p",{children:["Certain features — including raffle tickets, event access, and game passes — require payment. All payments are processed securely through ",i.jsx("strong",{children:"Stripe"}),". By making a purchase, you agree to the following:"]}),i.jsxs("ul",{className:"list-disc pl-6 mt-3 space-y-2",children:[i.jsx("li",{children:"All prices are displayed in Euros (€) and are inclusive of applicable taxes."}
1108),i.jsx("li",{children:"Purchases are final and non-refundable unless otherwise stated."}),i.jsx("li",{children:"Raffle tickets are sold in accordance with Irish gambling laws. Participants must be 18 or older."}),i.jsx("li",{children:"We reserve the right to cancel a raffle or event and issue a full refund in exceptional circumstances."})]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"5. Raffles & Prize Draws"}),i.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[i.jsx("li",{children:"All raffles are conducted fairly using randomised draw systems."}),i.jsx("li",{children:"Winners are notified by email. Unclaimed prizes after 30 days may be forfeited."}),i.jsx("li",{children:"Employees and administrators of Live Quizzing are not eligible to enter raffles."}),i.jsx("li",{children:"Participation in raffles constitutes acceptance of the specific draw's terms."})]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"6. Community & User Content"}),i.jsx("p",{children:"Users may submit content including forum posts, community quiz questions, and event submissions. By 
1108submitting content, you:"}),i.jsxs("ul",{className:"list-disc pl-6 mt-3 space-y-2",children:[i.jsx("li",{children:"Confirm the content is your own original work or that you have the right to share it."}),i.jsx("li",{children:"Grant Live Quizzing a non-exclusive licence to display the content on our platform."}),i.jsx("li",{children:"Agree not to post content that is offensive, defamatory, illegal, or violates others' rights."})]}),i.jsx("p",{className:"mt-3",children:"We reserve the right to remove any content that violates these terms without notice."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"7. Advertising"}),i.jsx("p",{children:"Live Quizzing displays advertisements through Google AdSense and may also feature paid advertisements from local businesses. Advertisements are clearly distinguished from editorial content. We do not endorse the products or services advertised by third parties."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"8. Intellectual Property"}),i.jsx("p",{children:"All content on Live Quizzing — including text, graphics, logos, and software — is the property of Live Quizzing or its licensors and is protected by applicable intellectual property laws. You may not reproduce, distribute, or create derivative works without our written permission."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"9. Limitation of Liability"}),i.jsx("p",{children:"To the maximum extent permitted by law, Live Quizzing shall not be liable for any indirect, incidental, or consequential damages arising from your use of the service. Our total liability for any claim shall not exceed the amount you paid us in the 12 months preceding the claim."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"10. Changes to These Terms"}),i.jsx("p",{children:"We may update these Terms of Service from time to time. We will notify users of material changes by posting the updated terms on this page. Continued use of the service after changes are posted constitutes acceptance of the revised terms."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"11. Governing Law"}),i.jsx("p",{children:"These terms are governed by the laws of Ireland. Any disputes shall be subject to the exclusive jurisdiction of the Irish courts."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-3",children:"12. Contact"}),i.jsx("p",{children:"For questions about these terms, contact us:"}),i.jsxs("div",{className:"mt-3 bg-slate-50 rounded-lg p-4 border border-slate-200",children:[i.jsx("p",{children:i.jsx("strong",{children:"Live Quizzing"})}),i.jsx("p",{children:"Ireland"}),i.jsxs("p",{children:["Email: ",i.jsx("a",{href:"mailto:[email protected]",className:"text-indigo-600 hover:underline",children:"[email protected]"})]}),i.jsxs("p",{children:["Website: ",i.jsx("a",{href:"https://livequizzing.com",className:"text-indigo-600 hover:underline",children:"livequizzing.com"})]})]})]})]})]}),i.jsxs("div",{className:"text-center mt-8 text-sm text-slate-500 space-x-4",children:[i.jsx(lr,{to:Ft("PrivacyPolicy"),className:"hover:text-indigo-600",children:"Privacy Policy"}),i.jsx("span",{children:"·"}),i.jsx(lr,{to:Ft("About"),className:"hover:text-indigo-600",children:"About & Contact"}),i.jsx("span",{children:"·"}),i.jsxs("span",{children:["© ",new Date().getFullYear()," Live Quizzing"]})]})]})})}const F8="https://buy.stripe.com/14AaEX9lt301bt5bxO2Ji0p",vIe=[{icon:"1️⃣",title:"After the Main Quiz",desc:"Who Wants to Be a Survivor kicks off at the end of Monday night's main quiz at Cove Bar, hosted by John O'Connor."},{icon:"2️⃣",title:"Purchase Your Entry",desc:"Click the button below to purchase your entry via Stripe. Once payment is confirmed, you'll be automatically redirected into the game — this may take a few seconds, please be patient."},{icon:"3️⃣",title:"Play 15 Questions",desc:"There are 15 questions inspired by Who Wants to Be a Millionaire. Answer each one correctly to stay in the game."},{icon:"4️⃣",title:"Get Eliminated or Survive",desc:"Get a question wrong and you're out. Play individually — no team help allowed. The goal is to be the last person standing."},{icon:"5️⃣",title:"Win the Jackpot",desc:"The jackpot is typically the total entry fees collected, up to a maximum of €50. If all players are eliminated, the house wins."}],xIe=[{q:"Can I play from outside the venue?",a:"Yes! Remote players are more than welcome to participate from anywhere."},{q:"What happens if it comes down to the last question?",a:"The final question is a 'fastest finger' style — you must put the correct answer in the correct sequence. Whoever submits the correct answer the fastest wins."},{q:"How do I receive my prize?",a:"After the game, we'll contact you via the email address you used to purchase and/or sign in to the game. Please make sure they match so we can identify you as the winner. Payment is typically sent later that evening or the following morning via Revolut, bank transfer, or PayPal."},{q:"What payment methods are accepted for the prize?",a:"Most winners choose Revolut, but bank transfer and PayPal are also available. We'll contact you to confirm your preference."},{q:"Is my email address important?",a:"Yes — please use the same email address to sign into the game as you used when purchasing. This is how we identify and verify the winner."}];function yIe({q:e,a:t}){const[n,r]=O.useState(!1);return i.jsxs("div",{className:"border border-white/20 rounded-xl overflow-hidden",children:[i.jsxs("button",{className:"w-full flex items-center justify-between px-5 py-4 text-left text-white font-semibold hover:bg-white/10 transition-colors",onClick:()=>r(!n),children:[i.jsx("span",{children:e}),n?i.jsx(A_,{className:"w-5 h-5 flex-shrink-0 text-amber-400"}):i.jsx(Yh,{className:"w-5 h-5 flex-shrink-0 text-slate-400"})]}),n&&i.jsx("div",{className:"px-5 pb-4 text-slate-300 text-sm leading-relaxed border-t border-white/10 pt-3",children:t})]})}function bIe(){return i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-indigo-950 to-slate-900 text-white",children:[i.jsxs("div",{className:"relative overflow-hidden",children:[i.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_50%_0%,rgba(251,191,36,0.15),transparent_60%)]"}),i.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-16 sm:py-24 text-center relative z-10",children:[i.jsx(rt.div,{initial:{scale:.8,opacity:0}
1108,animate:{scale:1,opacity:1},transition:{duration:.5},className:"flex justify-center mb-6",children:i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"w-24 h-24 rounded-full bg-gradient-to-br from-amber-400 via-yellow-500 to-orange-500 flex items-center justify-center shadow-2xl shadow-amber-500/40",children:i.jsx(Jt,{className:"w-12 h-12 text-white"})}),i.jsx("div",{className:"absolute -top-1 -right-1 w-8 h-8 rounded-full bg-red-500 flex items-center justify-center text-xs font-black border-2 border-slate-900",children:"💀"})]})}),i.jsxs(rt.h1,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.1},className:"text-4xl sm:text-6xl font-black mb-2 leading-tight",style:{backgroundImage:"linear-gradient(135deg, #fbbf24, #f59e0b, #ffffff, #fbbf24)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:["Who Wants to Be",i.jsx("br",{}),"a Survivor?"]}),i.jsxs(rt.p,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.2},className:"text-slate-300 text-lg sm:text-xl mt-4 max-w-2xl mx-auto",children:["Inspired by ",i.jsx("span",{className:"text-amber-400 font-semibold",children:"Who Wants to Be a Millionaire"})," — 15 questions, one survivor, one jackpot."]}),i.jsxs(rt.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3},className:"mt-4 flex flex-wrap justify-center gap-3 text-sm",children:[i.jsx("span",{className:"bg-indigo-600/40 border border-indigo-500/50 text-indigo-200 px-3 py-1.5 rounded-full font-semibold",children:"📍 Cove Bar"}),i.jsx("span",{className:"bg-indigo-600/40 border border-indigo-500/50 text-indigo-200 px-3 py-1.5 rounded-full font-semibold",children:"📅 Monday Nights"}),i.jsx("span",{className:"bg-indigo-600/40 border border-indigo-500/50 text-indigo-200 px-3 py-1.5 rounded-full font-semibold",children:"🎤 Hosted by John O'Connor"})]}),i.jsxs(rt.a,{href:F8,target:"_blank",rel:"noopener noreferrer",initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.4},className:"inline-flex items-center gap-3 mt-10 bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-400 hover:to-orange-400 text-white font-black text-lg sm:text-xl px-8 py-4 rounded-2xl shadow-2xl shadow-amber-500/30 transition-all hover:scale-105 active:scale-95",children:[i.jsx(aM,{className:"w-6 h-6"}),"Enter the Game — Buy Now"]}),i.jsx("p",{className:"text-slate-500 text-xs mt-3",children:"Secure payment via Stripe. You'll be redirected into the game automatically after purchase."})]})]}),i.jsx("div",{className:"max-w-4xl mx-auto px-4 mb-10",children:i.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/40 rounded-2xl p-4 flex items-start gap-3",children:[i.jsx(ba,{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"}),i.jsxs("p",{className:"text-amber-200 text-sm leading-relaxed",children:[i.jsx("strong",{children:"Important:"})," After completing payment, you'll be automatically redirected into the game. This can take a few seconds — please be patient and don't close or refresh the page during this process."]})]})}),i.jsx("div",{className:"max-w-4xl mx-auto px-4 mb-6 flex justify-end",children:i.jsxs("a",{href:"https://www.playvgn.com/RESULTS",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 bg-white/10 hover:bg-white/20 border border-white/20 text-white font-semibold text-sm px-4 py-2 rounded-xl transition-all hover:scale-105 active:scale-95",children:[i.jsx(lM,{className:"w-4 h-4"}),"Return to Results Screen"]})}),i.jsxs("div",{className:"max-w-4xl mx-auto px-4 mb-14",children:[i.jsxs("h2",{className:"text-2xl sm:text-3xl font-black text-center mb-8",children:[i.jsx(Kc,{className:"inline w-7 h-7 text-amber-400 mr-2 mb-1"}),"How It Works"]}),i.jsx("div",{className:"space-y-4",children:vIe.map((e,t)=>i.jsxs(rt.div,{initial:{x:-20,opacity:0},whileInView:{x:0,opacity:1},viewport:{once:!0},transition:{delay:t*.08},className:"bg-white/5 border border-white/10 rounded-2xl p-5 flex items-start gap-4 hover:bg-white/10 transition-colors",children:[i.jsx("span",{className:"text-3xl flex-shrink-0",children:e.icon}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-black text-white text-base sm:text-lg mb-1",children:e.title}),i.jsx("p",{className:"text-slate-300 text-sm leading-relaxed",children:e.desc})]})]},t))})]}),i.jsxs("div",{className:"max-w-4xl mx-auto px-4 mb-14",children:[i.jsxs("h2",{className:"text-2xl sm:text-3xl font-black text-center mb-8",children:[i.jsx(Za,{className:"inline w-7 h-7 text-amber-400 mr-2 mb-1"}),"The Rules"]}),i.jsx("div",{className:"grid sm:grid-cols-2 gap-4",children:[{icon:"🧠",title:"Play Solo",de
1108sc:"This is an individual game. No team consultations — you're on your own!"},{icon:"❌",title:"One Strike & You're Out",desc:"Answer a question wrong and you're immediately eliminated from the game."},{icon:"🏆",title:"Last One Standing Wins",desc:"The last player remaining wins the jackpot (up to €50)."},{icon:"🏠",title:"House Wins if All Eliminated",desc:"If every player is eliminated before the final question, the house takes the pot."},{icon:"⚡",title:"Final Question: Fastest Finger",desc:"If players reach Q15, the winner is whoever correctly sequences the answer the fastest."},{icon:"🌍",title:"Remote Players Welcome",desc:"You don't have to be at Cove Bar — anyone can enter and play online."}].map((e,t)=>i.jsxs(rt.div,{initial:{y:10,opacity:0},whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{delay:t*.07},className:"bg-white/5 border border-white/10 rounded-xl p-4 flex items-start gap-3",children:[i.jsx("span",{className:"text-2xl flex-shrink-0",children:e.icon}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-white text-sm mb-0.5",children:e.title}),i.jsx("p",{className:"text-slate-400 text-xs leading-relaxed",children:e.desc})]})]},t))})]}),i.jsx("div",{className:"max-w-4xl mx-auto px-4 mb-14",children:i.jsxs("div",{className:"bg-gradient-to-br from-green-900/30 to-emerald-900/20 border border-green-500/30 rounded-2xl p-6 sm:p-8",children:[i.jsxs("h2",{className:"text-2xl font-black text-white mb-6 flex items-center gap-2",children:[i.jsx(Vo,{className:"w-6 h-6 text-green-400"}),"Prize & Payment"]}),i.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"bg-white/5 rounded-xl p-4",children:[i.jsx("p",{className:"text-green-400 font-bold text-xs uppercase tracking-wider mb-1",children:"💰 Jackpot"}),i.jsxs("p",{className:"text-white text-sm leading-relaxed",children:["Typically the total entry fees collected, up to a maximum of ",i.jsx("strong",{children:"€50"}),"."]})]}),i.jsxs("div",{className:"bg-white/5 rounded-xl p-4",children:[i.jsx("p",{className:"text-green-400 font-bold text-xs uppercase tracking-wider mb-1",children:"⏱ When You'll Be Paid"}),i.jsxs("p",{className:"text-white text-sm leading-relaxed",children:["Payment is sent ",i.jsx("strong",{children:"later that evening or the following morning"})," — not instantly after the game."]})]}),i.jsxs("div",{className:"bg-white/5 rounded-xl p-4",children:[i.jsx("p",{className:"text-green-400 font-bold text-xs uppercase tracking-wider mb-1",children:"📧 How We Contact You"}),i.jsxs("p",{className:"text-white text-sm leading-relaxed",children:["We use the email you provided at checkout. ",i.jsx("strong",{children:"Use the same email to sign into the game"})," so we can verify your win."]})]}),i.jsxs("div",{className:"bg-white/5 rounded-xl p-4",children:[i.jsx("p",{className:"text-green-400 font-bold text-xs uppercase tracking-wider mb-1",children:"💳 Payout Methods"}),i.jsxs("p",{className:"text-white text-sm leading-relaxed",children:[i.jsx("strong",{children:"Revolut"})," is most common, but bank transfer and PayPal are also available. We'll confirm your preference when we reach out."]})]})]})]})}),i.jsxs("div",{className:"max-w-4xl mx-auto px-4 mb-14",children:[i.jsxs("h2",{className:"text-2xl sm:text-3xl font-black text-center mb-8",children:[i.jsx(tB,{className:"inline w-7 h-7 text-amber-400 mr-2 mb-1"}),"FAQs"]}),i.jsx("div",{className:"space-y-3",children:xIe.map((e,t)=>i.jsx(yIe,{q:e.q,a:e.a},t))})]}),i.jsx("div",{className:"max-w-4xl mx-auto px-4 pb-16 text-center",children:i.jsxs("div",{className:"bg-gradient-to-br from-amber-500/10 to-orange-500/10 border border-amber-500/30 rounded-3xl p-8",children:[i.jsx(Jt,{className:"w-12 h-12 text-amber-400 mx-auto mb-4"}),i.jsx("h3",{className:"text-2xl font-black text-white mb-2",children:"Ready to Survive?"}),i.jsx("p",{className:"text-slate-400 text-sm mb-6 max-w-md mx-auto",children:"15 questions. One jackpot. No lifelines. Buy your entry now and test your nerve."}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[i.jsxs("a",{href:F8,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-3 bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-400 hover:to-orange-400 text-white font-black text-lg px-8 py-4 rounded-2xl shadow-2xl shadow-amber-500/30 transition-all hover:scale-105 active:scale-95",children:[i.jsx(aM,{className:"w-5 h-5"}),"Buy Your Entry via Stripe"]}),i.jsxs("a",{href:"https://www.playvgn.com/RESULTS",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-3 bg-white/10 hover:bg-white/20 border border-white/20 text-white font-bold text-lg px-8 py-4 rounded-2xl transition-all hover:scale-105 active:scale-95",children:[i.jsx(lM,{className:"w-5 h-5"}),"Return to Results Screen"]})]})]})})]})}
1108const wIe=()=>i.jsx("div",{className:"flex flex-col items-center justify-center min-h-screen bg-gradient-to-b from-white to-slate-50",children:i.jsx("div",{className:"max-w-md w-full p-8 bg-white rounded-lg shadow-lg border border-slate-100",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 mb-6 rounded-full bg-orange-100",children:i.jsx("svg",{className:"w-8 h-8 text-orange-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),i.jsx("h1",{className:"text-3xl font-bold text-slate-900 mb-4",children:"Access Restricted"}),i.jsx("p",{className:"text-slate-600 mb-8",children:"You are not registered to use this application. Please contact the app administrator to request access."}),i.jsxs("div",{className:"p-4 bg-slate-50 rounded-md text-sm text-slate-600",children:[i.jsx("p",{children:"If you believe this is an error, you can:"}),i.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[i.jsx("li",{children:"Verify you are logged in with the correct account"}),i.jsx("li",{children:"Contact the app administrator for access"}),i.jsx("li",{children:"Try logging out and back in again"})]})]})]})})}),{Pages:eX,Layout:$8,mainPage:jIe}=JY,tX=jIe,_Ie=eX[tX],O1=({children:e,currentPageName:t})=>$8?i.jsx($8,{currentPageName:t,children:e}):i.jsx(i.Fragment,{children:e}),NIe=()=>{const{isLoadingAuth:e,isLoadingPublicSettings:t,authError:n,isAuthenticated:r,navigateToLogin:s}=Q9();if(t||e)return i.jsx("div",{className:"fixed inset-0 flex items-center justify-center",children:i.jsx("div",{className:"w-8 h-8 border-4 border-slate-200 border-t-slate-800 rounded-full animate-spin"})});if(n){if(n.type==="user_not_registered")return i.jsx(wIe,{});if(n.type==="auth_required")return s(),null}return i.jsxs(_ie,{children:[i.jsx(Fp,{path:"/",element:i.jsx(O1,{currentPageName:tX,children:i.jsx(_Ie,{})})}),Object.entries(eX).map(([a,o])=>i.jsx(Fp,{path:`/${a}`,element:i.jsx(O1,{currentPageName:a,children:i.jsx(o,{})})},a)),i.jsx(Fp,{path:"/TermsOfService",element:i.jsx(O1,{currentPageName:"TermsOfService",children:i.jsx(gIe,{})})}),i.jsx(Fp,{path:"/wwtbas",element:i.jsx(O1,{currentPageName:"WWTBAS",children:i.jsx(bIe,{})})}),i.jsx(Fp,{path:"*",element:i.jsx(pIe,{})})]})};function SIe(){return i.jsx(Zle,{children:i.jsxs(yre,{client:Ore,children:[i.jsxs(Oie,{children:[i.jsx(mIe,{}),i.jsx(NIe,{})]}),i.jsx(Qne,{}),i.jsx(Tre,{})]})})}LJ.createRoot(document.getElementById("root")).render(i.jsx(SIe,{}))});export default kIe();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.