function eA(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)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(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var bI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Y2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var K0={exports:{}},eh={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Yb;function tA(){if(Yb)return eh;Yb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:t,type:r,key:o,ref:i!==void 0?i:null,props:a}}return eh.Fragment=e,eh.jsx=n,eh.jsxs=n,eh}var Vb;function nA(){return Vb||(Vb=1,K0.exports=tA()),K0.exports}var S=nA(),Q0={exports:{}},Vt={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Gb;function rA(){if(Gb)return Vt;Gb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function b(W){return W===null||typeof W!="object"?null:(W=g&&W[g]||W["@@iterator"],typeof W=="function"?W:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,w={};function k(W,xe,R){this.props=W,this.context=xe,this.refs=w,this.updater=R||y}k.prototype.isReactComponent={},k.prototype.setState=function(W,xe){if(typeof W!="object"&&typeof W!="function"&&W!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,xe,"setState")},k.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function C(){}C.prototype=k.prototype;function L(W,xe,R){this.props=W,this.context=xe,this.refs=w,this.updater=R||y}var j=L.prototype=new C;j.constructor=L,N(j,k.prototype),j.isPureReactComponent=!0;var z=Array.isArray,O={H:null,A:null,T:null,S:null,V:null},K=Object.prototype.hasOwnProperty;function q(W,xe,R,V,Q,ae){return R=ae.ref,{$$typeof:t,type:W,key:xe,ref:R!==void 0?R:null,props:ae}}function H(W,xe){return q(W.type,xe,void 0,void 0,void 0,W.props)}function se(W){return typeof W=="object"&&W!==null&&W.$$typeof===t}function le(W){var xe={"=":"=0",":":"=2"};return"$"+W.replace(/[=:]/g,function(R){return xe[R]})}var P=/\/+/g;function I(W,xe){return typeof W=="object"&&W!==null&&W.key!=null?le(""+W.key):xe.toString(36)}function ne(){}function te(W){switch(W.status){case"fulfilled":return W.value;case"rejected":throw W.reason;default:switch(typeof W.status=="string"?W.then(ne,ne):(W.status="pending",W.then(function(xe){W.status==="pending"&&(W.status="fulfilled",W.value=xe)},function(xe){W.status==="pending"&&(W.status="rejected",W.reason=xe)})),W.status){case"fulfilled":return W.value;case"rejected":throw W.reason}}throw W}function de(W,xe,R,V,Q){var ae=typeof W;(ae==="undefined"||ae==="boolean")&&(W=null);var ce=!1;if(W===null)ce=!0;else switch(ae){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(W.$$typeof){case t:case e:ce=!0;break;case p:return ce=W._init,de(ce(W._payload),xe,R,V,Q)}}if(ce)return Q=Q(W),ce=V===""?"."+I(W,0):V,z(Q)?(R="",ce!=null&&(R=ce.replace(P,"$&/")+"/"),de(Q,xe,R,"",function(Se){return Se})):Q!=null&&(se(Q)&&(Q=H(Q,R+(Q.key==null||W&&W.key===Q.key?"":(""+Q.key).replace(P,"$&/")+"/")+ce)),xe.push(Q)),1;ce=0;var he=V===""?".":V+":";if(z(W))for(var we=0;we<W.length;we++)V=W[we],ae=he+I(V,we),ce+=de(V,xe,R,ae,Q);else if(we=b(W),typeof we=="function")for(W=we.call(W),we=0;!(V=W.next()).done;)V=V.value,ae=he+I(V,we++),ce+=de(V,xe,R,ae,Q);else if(ae==="object"){if(typeof W.then=="function")return de(te(W),xe,R,V,Q);throw xe=String(W),Error("Objects are not valid as a React child (found: "+(xe==="[object Object]"?"object with keys {"+Object.keys(W).join(", ")+"}":xe)+"). If you meant to render a collection of children, use an array instead.")}return ce}function X(W,xe,R){if(W==null)return W;var V=[],Q=0;return de(W,V,"","",function(ae){return xe.call(R,ae,Q++)}),V}function J(W){if(W._status===-1){var xe=W._result;xe=xe(),xe.then(function(R){(W._status===0||W._status===-1)&&(W._status=1,W._result=R)},function(R){(W._status===0||W._status===-1)&&(W._status=2,W._result=R)}),W._status===-1&&(W._status=0,W._result=xe)}if(W._status===1)return W._result.default;throw W._result}var G=typeof reportError=="function"?reportError:function(W){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var xe=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof W=="object"&&W!==null&&typeof W.message=="string"?String(W.message):String(W),error:W});if(!window.dispatchEvent(xe))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",W);return}console.error(W)};function me(){}return Vt.Children={map:X,forEach:function(W,xe,R){X(W,function(){xe.apply(this,arguments)},R)},count:function(W){var xe=0;return X(W,function(){xe++}),xe},toArray:function(W){return X(W,function(xe){return xe})||[]},only:function(W){if(!se(W))throw Error("React.Children.only expected to receive a single React element child.");return W}},Vt.Component=k,Vt.Fragment=n,Vt.Profiler=i,Vt.PureComponent=L,Vt.StrictMode=r,Vt.Suspense=f,Vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Vt.__COMPILER_RUNTIME={__proto__:null,c:function(W){return O.H.useMemoCache(W)}},Vt.cache=function(W){return function(){return W.apply(null,arguments)}},Vt.cloneElement=function(W,xe,R){if(W==null)throw Error("The argument must be a React element, but you passed "+W+".");var V=N({},W.props),Q=W.key,ae=void 0;if(xe!=null)for(ce in xe.ref!==void 0&&(ae=void 0),xe.key!==void 0&&(Q=""+xe.key),xe)!K.call(xe,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&xe.ref===void 0||(V[ce]=xe[ce]);var ce=arguments.length-2;if(ce===1)V.children=R;else if(1<ce){for(var he=Array(ce),we=0;we<ce;we++)he[we]=arguments[we+2];V.children=he}return q(W.type,Q,void 0,void 0,ae,V)},Vt.createContext=function(W){return W={$$typeof:o,_currentValue:W,_currentValue2:W,_threadCount:0,Provider:null,Consumer:null},W.Provider=W,W.Consumer={$$typeof:a,_context:W},W},Vt.createElement=function(W,xe,R){var V,Q={},ae=null;if(xe!=null)for(V in xe.key!==void 0&&(ae=""+xe.key),xe)K.call(xe,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(Q[V]=xe[V]);var ce=arguments.length-2;if(ce===1)Q.children=R;else if(1<ce){for(var he=Array(ce),we=0;we<ce;we++)he[we]=arguments[we+2];Q.children=he}if(W&&W.defaultProps)for(V in ce=W.defaultProps,ce)Q[V]===void 0&&(Q[V]=ce[V]);return q(W,ae,void 0,void 0,null,Q)},Vt.createRef=function(){return{current:null}},Vt.forwardRef=function(W){return{$$typeof:c,render:W}},Vt.isValidElement=se,Vt.lazy=function(W){return{$$typeof:p,_payload:{_status:-1,_result:W},_init:J}},Vt.memo=function(W,xe){return{$$typeof:d,type:W,compare:xe===void 0?null:xe}},Vt.startTransition=function(W){var xe=O.T,R={};O.T=R;try{var V=W(),Q=O.S;Q!==null&&Q(R,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(me,G)}catch(ae){G(ae)}finally{O.T=xe}},Vt.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Vt.use=function(W){return O.H.use(W)},Vt.useActionState=function(W,xe,R){return O.H.useActionState(W,xe,R)},Vt.useCallback=function(W,xe){return O.H.useCallback(W,xe)},Vt.useContext=function(W){return O.H.useContext(W)},Vt.useDebugValue=function(){},Vt.useDeferredValue=function(W,xe){return O.H.useDeferredValue(W,xe)},Vt.useEffect=function(W,xe,R){var V=O.H;if(typeof R=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return V.useEffect(W,xe)},Vt.useId=function(){return O.H.useId()},Vt.useImperativeHandle=function(W,xe,R){return O.H.useImperativeHandle(W,xe,R)},Vt.useInsertionEffect=function(W,xe){return O.H.useInsertionEffect(W,xe)},Vt.useLayoutEffect=function(W,xe){return O.H.useLayoutEffect(W,xe)},Vt.useMemo=function(W,xe){return O.H.useMemo(W,xe)},Vt.useOptimistic=function(W,xe){return O.H.useOptimistic(W,xe)},Vt.useReducer=function(W,xe,R){return O.H.useReducer(W,xe,R)},Vt.useRef=function(W){return O.H.useRef(W)},Vt.useState=function(W){return O.H.useState(W)},Vt.useSyncExternalStore=function(W,xe,R){return O.H.useSyncExternalStore(W,xe,R)},Vt.useTransition=function(){return O.H.useTransition()},Vt.version="19.1.0",Vt}var $b;function V2(){return $b||($b=1,Q0.exports=rA()),Q0.exports}var E=V2();const st=Y2(E),Vw=eA({__proto__:null,default:st},[E]);var J0={exports:{}},th={},e1={exports:{}},t1={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Xb;function iA(){return Xb||(Xb=1,function(t){function e(X,J){var G=X.length;X.push(J);e:for(;0<G;){var me=G-1>>>1,W=X[me];if(0<i(W,J))X[me]=J,X[G]=W,G=me;else break e}}function n(X){return X.length===0?null:X[0]}function r(X){if(X.length===0)return null;var J=X[0],G=X.pop();if(G!==J){X[0]=G;e:for(var me=0,W=X.length,xe=W>>>1;me<xe;){var R=2*(me+1)-1,V=X[R],Q=R+1,ae=X[Q];if(0>i(V,G))Q<W&&0>i(ae,V)?(X[me]=ae,X[Q]=G,me=Q):(X[me]=V,X[R]=G,me=R);else if(Q<W&&0>i(ae,G))X[me]=ae,X[Q]=G,me=Q;else break e}}return J}function i(X,J){var G=X.sortIndex-J.sortIndex;return G!==0?G:X.id-J.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,c=o.now();t.unstable_now=function(){return o.now()-c}}var f=[],d=[],p=1,g=null,b=3,y=!1,N=!1,w=!1,k=!1,C=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function z(X){for(var J=n(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=X)r(d),J.sortIndex=J.expirationTime,e(f,J);else break;J=n(d)}}function O(X){if(w=!1,z(X),!N)if(n(f)!==null)N=!0,K||(K=!0,I());else{var J=n(d);J!==null&&de(O,J.startTime-X)}}var K=!1,q=-1,H=5,se=-1;function le(){return k?!0:!(t.unstable_now()-se<H)}function P(){if(k=!1,K){var X=t.unstable_now();se=X;var J=!0;try{e:{N=!1,w&&(w=!1,L(q),q=-1),y=!0;var G=b;try{t:{for(z(X),g=n(f);g!==null&&!(g.expirationTime>X&&le());){var me=g.callback;if(typeof me=="function"){g.callback=null,b=g.priorityLevel;var W=me(g.expirationTime<=X);if(X=t.unstable_now(),typeof W=="function"){g.callback=W,z(X),J=!0;break t}g===n(f)&&r(f),z(X)}else r(f);g=n(f)}if(g!==null)J=!0;else{var xe=n(d);xe!==null&&de(O,xe.startTime-X),J=!1}}break e}finally{g=null,b=G,y=!1}J=void 0}}finally{J?I():K=!1}}}var I;if(typeof j=="function")I=function(){j(P)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,te=ne.port2;ne.port1.onmessage=P,I=function(){te.postMessage(null)}}else I=function(){C(P,0)};function de(X,J){q=C(function(){X(t.unstable_now())},J)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(X){X.callback=null},t.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"):H=0<X?Math.floor(1e3/X):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(X){switch(b){case 1:case 2:case 3:var J=3;break;default:J=b}var G=b;b=J;try{return X()}finally{b=G}},t.unstable_requestPaint=function(){k=!0},t.unstable_runWithPriority=function(X,J){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var G=b;b=X;try{return J()}finally{b=G}},t.unstable_scheduleCallback=function(X,J,G){var me=t.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?me+G:me):G=me,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=G+W,X={id:p++,callback:J,priorityLevel:X,startTime:G,expirationTime:W,sortIndex:-1},G>me?(X.sortIndex=G,e(d,X),n(f)===null&&X===n(d)&&(w?(L(q),q=-1):w=!0,de(O,G-me))):(X.sortIndex=W,e(f,X),N||y||(N=!0,K||(K=!0,I()))),X},t.unstable_shouldYield=le,t.unstable_wrapCallback=function(X){var J=b;return function(){var G=b;b=J;try{return X.apply(this,arguments)}finally{b=G}}}}(t1)),t1}var Zb;function aA(){return Zb||(Zb=1,e1.exports=iA()),e1.exports}var n1={exports:{}},pi={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Kb;function sA(){if(Kb)return pi;Kb=1;var t=V2();function e(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(f,d,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:f,containerInfo:d,implementation:p}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return pi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,pi.createPortal=function(f,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return a(f,d,null,p)},pi.flushSync=function(f){var d=o.T,p=r.p;try{if(o.T=null,r.p=2,f)return f()}finally{o.T=d,r.p=p,r.d.f()}},pi.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},pi.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},pi.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var p=d.as,g=c(p,d.crossOrigin),b=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:y}):p==="script"&&r.d.X(f,{crossOrigin:g,integrity:b,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},pi.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=c(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},pi.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,g=c(p,d.crossOrigin);r.d.L(f,p,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},pi.preloadModule=function(f,d){if(typeof f=="string")if(d){var p=c(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},pi.requestFormReset=function(f){r.d.r(f)},pi.unstable_batchedUpdates=function(f,d){return f(d)},pi.useFormState=function(f,d,p){return o.H.useFormState(f,d,p)},pi.useFormStatus=function(){return o.H.useHostTransitionStatus()},pi.version="19.1.0",pi}var Qb;function Gw(){if(Qb)return n1.exports;Qb=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),n1.exports=sA(),n1.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Jb;function oA(){if(Jb)return th;Jb=1;var t=aA(),e=V2(),n=Gw();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var l=s,u=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(u=l.return),s=l.return;while(s)}return l.tag===3?u:null}function o(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(a(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=a(s),l===null)throw Error(r(188));return l!==s?null:s}for(var u=s,h=l;;){var v=u.return;if(v===null)break;var _=v.alternate;if(_===null){if(h=v.return,h!==null){u=h;continue}break}if(v.child===_.child){for(_=v.child;_;){if(_===u)return c(v),s;if(_===h)return c(v),l;_=_.sibling}throw Error(r(188))}if(u.return!==h.return)u=v,h=_;else{for(var T=!1,Z=v.child;Z;){if(Z===u){T=!0,u=v,h=_;break}if(Z===h){T=!0,h=v,u=_;break}Z=Z.sibling}if(!T){for(Z=_.child;Z;){if(Z===u){T=!0,u=_,h=v;break}if(Z===h){T=!0,h=_,u=v;break}Z=Z.sibling}if(!T)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?s:l}function d(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=d(s),l!==null)return l;s=s.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),L=Symbol.for("react.consumer"),j=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),le=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function I(s){return s===null||typeof s!="object"?null:(s=P&&s[P]||s["@@iterator"],typeof s=="function"?s:null)}var ne=Symbol.for("react.client.reference");function te(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===ne?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case N:return"Fragment";case k:return"Profiler";case w:return"StrictMode";case O:return"Suspense";case K:return"SuspenseList";case se:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case y:return"Portal";case j:return(s.displayName||"Context")+".Provider";case L:return(s._context.displayName||"Context")+".Consumer";case z:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case q:return l=s.displayName||null,l!==null?l:te(s.type)||"Memo";case H:l=s._payload,s=s._init;try{return te(s(l))}catch{}}return null}var de=Array.isArray,X=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},me=[],W=-1;function xe(s){return{current:s}}function R(s){0>W||(s.current=me[W],me[W]=null,W--)}function V(s,l){W++,me[W]=s.current,s.current=l}var Q=xe(null),ae=xe(null),ce=xe(null),he=xe(null);function we(s,l){switch(V(ce,l),V(ae,s),V(Q,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?bb(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=bb(l),s=xb(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}R(Q),V(Q,s)}function Se(){R(Q),R(ae),R(ce)}function Ve(s){s.memoizedState!==null&&V(he,s);var l=Q.current,u=xb(l,s.type);l!==u&&(V(ae,s),V(Q,u))}function He(s){ae.current===s&&(R(Q),R(ae)),he.current===s&&(R(he),Xd._currentValue=G)}var Je=Object.prototype.hasOwnProperty,it=t.unstable_scheduleCallback,dt=t.unstable_cancelCallback,ze=t.unstable_shouldYield,ue=t.unstable_requestPaint,pt=t.unstable_now,ht=t.unstable_getCurrentPriorityLevel,fe=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,Ge=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,ie=t.log,ye=t.unstable_setDisableYieldValue,Be=null,Le=null;function Re(s){if(typeof ie=="function"&&ye(s),Le&&typeof Le.setStrictMode=="function")try{Le.setStrictMode(Be,s)}catch{}}var qe=Math.clz32?Math.clz32:jt,ft=Math.log,$e=Math.LN2;function jt(s){return s>>>=0,s===0?32:31-(ft(s)/$e|0)|0}var Mt=256,mn=4194304;function Ct(s){var l=s&42;if(l!==0)return l;switch(s&-s){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:return 64;case 128:return 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 s&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Gt(s,l,u){var h=s.pendingLanes;if(h===0)return 0;var v=0,_=s.suspendedLanes,T=s.pingedLanes;s=s.warmLanes;var Z=h&134217727;return Z!==0?(h=Z&~_,h!==0?v=Ct(h):(T&=Z,T!==0?v=Ct(T):u||(u=Z&~s,u!==0&&(v=Ct(u))))):(Z=h&~_,Z!==0?v=Ct(Z):T!==0?v=Ct(T):u||(u=h&~s,u!==0&&(v=Ct(u)))),v===0?0:l!==0&&l!==v&&(l&_)===0&&(_=v&-v,u=l&-l,_>=u||_===32&&(u&4194048)!==0)?l:v}function ur(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function ut(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32: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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nn(){var s=Mt;return Mt<<=1,(Mt&4194048)===0&&(Mt=256),s}function Lt(){var s=mn;return mn<<=1,(mn&62914560)===0&&(mn=4194304),s}function Yn(s){for(var l=[],u=0;31>u;u++)l.push(s);return l}function jn(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function wn(s,l,u,h,v,_){var T=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var Z=s.entanglements,pe=s.expirationTimes,Te=s.hiddenUpdates;for(u=T&~u;0<u;){var Ze=31-qe(u),nt=1<<Ze;Z[Ze]=0,pe[Ze]=-1;var Pe=Te[Ze];if(Pe!==null)for(Te[Ze]=null,Ze=0;Ze<Pe.length;Ze++){var Fe=Pe[Ze];Fe!==null&&(Fe.lane&=-536870913)}u&=~nt}h!==0&&mt(s,h,0),_!==0&&v===0&&s.tag!==0&&(s.suspendedLanes|=_&~(T&~l))}function mt(s,l,u){s.pendingLanes|=l,s.suspendedLanes&=~l;var h=31-qe(l);s.entangledLanes|=l,s.entanglements[h]=s.entanglements[h]|1073741824|u&4194090}function Ht(s,l){var u=s.entangledLanes|=l;for(s=s.entanglements;u;){var h=31-qe(u),v=1<<h;v&l|s[h]&l&&(s[h]|=l),u&=~v}}function Wt(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Jn(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function _i(){var s=J.p;return s!==0?s:(s=window.event,s===void 0?32:Ib(s.type))}function Pi(s,l){var u=J.p;try{return J.p=s,l()}finally{J.p=u}}var xt=Math.random().toString(36).slice(2),un="__reactFiber$"+xt,zn="__reactProps$"+xt,vr="__reactContainer$"+xt,er="__reactEvents$"+xt,fr="__reactListeners$"+xt,Ni="__reactHandles$"+xt,Ao="__reactResources$"+xt,Ai="__reactMarker$"+xt;function Ci(s){delete s[un],delete s[zn],delete s[er],delete s[fr],delete s[Ni]}function Wr(s){var l=s[un];if(l)return l;for(var u=s.parentNode;u;){if(l=u[vr]||u[un]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(s=Nb(s);s!==null;){if(u=s[un])return u;s=Nb(s)}return l}s=u,u=s.parentNode}return null}function Yr(s){if(s=s[un]||s[vr]){var l=s.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return s}return null}function si(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(r(33))}function Fr(s){var l=s[Ao];return l||(l=s[Ao]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Sn(s){s[Ai]=!0}var _s=new Set,Co={};function Bi(s,l){Ji(s,l),Ji(s+"Capture",l)}function Ji(s,l){for(Co[s]=l,s=0;s<l.length;s++)_s.add(l[s])}var bl=RegExp("^[: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]*$"),Lc={},Iu={};function ud(s){return Je.call(Iu,s)?!0:Je.call(Lc,s)?!1:bl.test(s)?Iu[s]=!0:(Lc[s]=!0,!1)}function Ia(s,l,u){if(ud(l))if(u===null)s.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+u)}}function ko(s,l,u){if(u===null)s.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+u)}}function ea(s,l,u,h){if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(l,u,""+h)}}var Mo,zu;function za(s){if(Mo===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);Mo=l&&l[1]||"",zu=-1<u.stack.indexOf(`
    at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Mo+s+zu}var Ec=!1;function Ns(s,l){if(!s||Ec)return"";Ec=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var nt=function(){throw Error()};if(Object.defineProperty(nt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(nt,[])}catch(Fe){var Pe=Fe}Reflect.construct(s,[],nt)}else{try{nt.call()}catch(Fe){Pe=Fe}s.call(nt.prototype)}}else{try{throw Error()}catch(Fe){Pe=Fe}(nt=s())&&typeof nt.catch=="function"&&nt.catch(function(){})}}catch(Fe){if(Fe&&Pe&&typeof Fe.stack=="string")return[Fe.stack,Pe.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=h.DetermineComponentFrameRoot(),T=_[0],Z=_[1];if(T&&Z){var pe=T.split(`
`),Te=Z.split(`
`);for(v=h=0;h<pe.length&&!pe[h].includes("DetermineComponentFrameRoot");)h++;for(;v<Te.length&&!Te[v].includes("DetermineComponentFrameRoot");)v++;if(h===pe.length||v===Te.length)for(h=pe.length-1,v=Te.length-1;1<=h&&0<=v&&pe[h]!==Te[v];)v--;for(;1<=h&&0<=v;h--,v--)if(pe[h]!==Te[v]){if(h!==1||v!==1)do if(h--,v--,0>v||pe[h]!==Te[v]){var Ze=`
`+pe[h].replace(" at new "," at ");return s.displayName&&Ze.includes("<anonymous>")&&(Ze=Ze.replace("<anonymous>",s.displayName)),Ze}while(1<=h&&0<=v);break}}}finally{Ec=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?za(u):""}function fd(s){switch(s.tag){case 26:case 27:case 5:return za(s.type);case 16:return za("Lazy");case 13:return za("Suspense");case 19:return za("SuspenseList");case 0:case 15:return Ns(s.type,!1);case 11:return Ns(s.type.render,!1);case 1:return Ns(s.type,!0);case 31:return za("Activity");default:return""}}function Vn(s){try{var l="";do l+=fd(s),s=s.return;while(s);return l}catch(u){return`
Error generating stack: `+u.message+`
`+u.stack}}function Jr(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Dc(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Hu(s){var l=Dc(s)?"checked":"value",u=Object.getOwnPropertyDescriptor(s.constructor.prototype,l),h=""+s[l];if(!s.hasOwnProperty(l)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var v=u.get,_=u.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return v.call(this)},set:function(T){h=""+T,_.call(this,T)}}),Object.defineProperty(s,l,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(T){h=""+T},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function As(s){s._valueTracker||(s._valueTracker=Hu(s))}function Uu(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var u=l.getValue(),h="";return s&&(h=Dc(s)?s.checked?"true":"false":s.value),s=h,s!==u?(l.setValue(s),!0):!1}function oi(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var xl=/[\n"\\]/g;function On(s){return s.replace(xl,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Lo(s,l,u,h,v,_,T,Z){s.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?s.type=T:s.removeAttribute("type"),l!=null?T==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+Jr(l)):s.value!==""+Jr(l)&&(s.value=""+Jr(l)):T!=="submit"&&T!=="reset"||s.removeAttribute("value"),l!=null?Oc(s,T,Jr(l)):u!=null?Oc(s,T,Jr(u)):h!=null&&s.removeAttribute("value"),v==null&&_!=null&&(s.defaultChecked=!!_),v!=null&&(s.checked=v&&typeof v!="function"&&typeof v!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?s.name=""+Jr(Z):s.removeAttribute("name")}function jc(s,l,u,h,v,_,T,Z){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),l!=null||u!=null){if(!(_!=="submit"&&_!=="reset"||l!=null))return;u=u!=null?""+Jr(u):"",l=l!=null?""+Jr(l):u,Z||l===s.value||(s.value=l),s.defaultValue=l}h=h??v,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=Z?s.checked:!!h,s.defaultChecked=!!h,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.name=T)}function Oc(s,l,u){l==="number"&&oi(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function Ha(s,l,u,h){if(s=s.options,l){l={};for(var v=0;v<u.length;v++)l["$"+u[v]]=!0;for(u=0;u<s.length;u++)v=l.hasOwnProperty("$"+s[u].value),s[u].selected!==v&&(s[u].selected=v),v&&h&&(s[u].defaultSelected=!0)}else{for(u=""+Jr(u),l=null,v=0;v<s.length;v++){if(s[v].value===u){s[v].selected=!0,h&&(s[v].defaultSelected=!0);return}l!==null||s[v].disabled||(l=s[v])}l!==null&&(l.selected=!0)}}function qu(s,l,u){if(l!=null&&(l=""+Jr(l),l!==s.value&&(s.value=l),u==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=u!=null?""+Jr(u):""}function Tc(s,l,u,h){if(l==null){if(h!=null){if(u!=null)throw Error(r(92));if(de(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),l=u}u=Jr(l),s.defaultValue=u,h=s.textContent,h===u&&h!==""&&h!==null&&(s.value=h)}function Cs(s,l){if(l){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=l;return}}s.textContent=l}var Rc=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Wu(s,l,u){var h=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":h?s.setProperty(l,u):typeof u!="number"||u===0||Rc.has(l)?l==="float"?s.cssFloat=u:s[l]=(""+u).trim():s[l]=u+"px"}function Yu(s,l,u){if(l!=null&&typeof l!="object")throw Error(r(62));if(s=s.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?s.setProperty(h,""):h==="float"?s.cssFloat="":s[h]="");for(var v in l)h=l[v],l.hasOwnProperty(v)&&u[v]!==h&&Wu(s,v,h)}else for(var _ in l)l.hasOwnProperty(_)&&Wu(s,_,l[_])}function Pc(s){if(s.indexOf("-")===-1)return!1;switch(s){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 Ua=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),wl=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qa(s){return wl.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}var Sl=null;function Er(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var ks=null,Wa=null;function Pt(s){var l=Yr(s);if(l&&(s=l.stateNode)){var u=s[zn]||null;e:switch(s=l.stateNode,l.type){case"input":if(Lo(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+On(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var h=u[l];if(h!==s&&h.form===s.form){var v=h[zn]||null;if(!v)throw Error(r(90));Lo(h,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(l=0;l<u.length;l++)h=u[l],h.form===s.form&&Uu(h)}break e;case"textarea":qu(s,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&Ha(s,!!u.multiple,l,!1)}}}var Bc=!1;function Vu(s,l,u){if(Bc)return s(l,u);Bc=!0;try{var h=s(l);return h}finally{if(Bc=!1,(ks!==null||Wa!==null)&&(Lp(),ks&&(l=ks,s=Wa,Wa=ks=null,Pt(l),s)))for(l=0;l<s.length;l++)Pt(s[l])}}function li(s,l){var u=s.stateNode;if(u===null)return null;var h=u[zn]||null;if(h===null)return null;u=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(r(231,l,typeof u));return u}var Fi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_l=!1;if(Fi)try{var wa={};Object.defineProperty(wa,"passive",{get:function(){_l=!0}}),window.addEventListener("test",wa,wa),window.removeEventListener("test",wa,wa)}catch{_l=!1}var Ii=null,Fc=null,Nl=null;function Gu(){if(Nl)return Nl;var s,l=Fc,u=l.length,h,v="value"in Ii?Ii.value:Ii.textContent,_=v.length;for(s=0;s<u&&l[s]===v[s];s++);var T=u-s;for(h=1;h<=T&&l[u-h]===v[_-h];h++);return Nl=v.slice(s,1<h?1-h:void 0)}function Ms(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function Sa(){return!0}function Ya(){return!1}function Vr(s){function l(u,h,v,_,T){this._reactName=u,this._targetInst=v,this.type=h,this.nativeEvent=_,this.target=T,this.currentTarget=null;for(var Z in s)s.hasOwnProperty(Z)&&(u=s[Z],this[Z]=u?u(_):_[Z]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Sa:Ya,this.isPropagationStopped=Ya,this}return p(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Sa)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Sa)},persist:function(){},isPersistent:Sa}),l}var ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ls=Vr(ki),_a=p({},ki,{view:0,detail:0}),$u=Vr(_a),Al,Cl,Es,Mi=p({},_a,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:El,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Es&&(Es&&s.type==="mousemove"?(Al=s.screenX-Es.screenX,Cl=s.screenY-Es.screenY):Cl=Al=0,Es=s),Al)},movementY:function(s){return"movementY"in s?s.movementY:Cl}}),Na=Vr(Mi),dd=p({},Mi,{dataTransfer:0}),Ds=Vr(dd),ta=p({},_a,{relatedTarget:0}),Eo=Vr(ta),Do=p({},ki,{animationName:0,elapsedTime:0,pseudoElement:0}),hd=Vr(Do),kl=p({},ki,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),pd=Vr(kl),Ic=p({},ki,{data:0}),Ml=Vr(Ic),Xu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ll={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"},zc={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hc(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=zc[s])?!!l[s]:!1}function El(){return Hc}var md=p({},_a,{key:function(s){if(s.key){var l=Xu[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=Ms(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?Ll[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:El,charCode:function(s){return s.type==="keypress"?Ms(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Ms(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),Dl=Vr(md),jo=p({},Mi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jl=Vr(jo),js=p({},_a,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:El}),Uc=Vr(js),A=p({},ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),F=Vr(A),oe=p({},Mi,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),ge=Vr(oe),Me=p({},ki,{newState:0,oldState:0}),Ye=Vr(Me),rt=[9,13,27,32],lt=Fi&&"CompositionEvent"in window,St=null;Fi&&"documentMode"in document&&(St=document.documentMode);var zt=Fi&&"TextEvent"in window&&!St,Ft=Fi&&(!lt||St&&8<St&&11>=St),Jt=" ",Bn=!1;function Hn(s,l){switch(s){case"keyup":return rt.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tr(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var nr=!1;function Dr(s,l){switch(s){case"compositionend":return tr(l);case"keypress":return l.which!==32?null:(Bn=!0,Jt);case"textInput":return s=l.data,s===Jt&&Bn?null:s;default:return null}}function na(s,l){if(nr)return s==="compositionend"||!lt&&Hn(s,l)?(s=Gu(),Nl=Fc=Ii=null,nr=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Ft&&l.locale!=="ko"?null:l.data;default:return null}}var Li={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 ra(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!Li[s.type]:l==="textarea"}function qc(s,l,u,h){ks?Wa?Wa.push(h):Wa=[h]:ks=h,l=Rp(l,"onChange"),0<l.length&&(u=new Ls("onChange","change",null,u,h),s.push({event:u,listeners:l}))}var Va=null,Ga=null;function Ol(s){pb(s,0)}function Os(s){var l=si(s);if(Uu(l))return s}function Tl(s,l){if(s==="change")return l}var Oo=!1;if(Fi){var br;if(Fi){var Ts="oninput"in document;if(!Ts){var To=document.createElement("div");To.setAttribute("oninput","return;"),Ts=typeof To.oninput=="function"}br=Ts}else br=!1;Oo=br&&(!document.documentMode||9<document.documentMode)}function Ro(){Va&&(Va.detachEvent("onpropertychange",Rl),Ga=Va=null)}function Rl(s){if(s.propertyName==="value"&&Os(Ga)){var l=[];qc(l,Ga,s,Er(s)),Vu(Ol,l)}}function ci(s,l,u){s==="focusin"?(Ro(),Va=l,Ga=u,Va.attachEvent("onpropertychange",Rl)):s==="focusout"&&Ro()}function gd(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Os(Ga)}function Wc(s,l){if(s==="click")return Os(l)}function Zu(s,l){if(s==="input"||s==="change")return Os(l)}function zi(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var jr=typeof Object.is=="function"?Object.is:zi;function Rs(s,l){if(jr(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var u=Object.keys(s),h=Object.keys(l);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var v=u[h];if(!Je.call(l,v)||!jr(s[v],l[v]))return!1}return!0}function Yc(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function $a(s,l){var u=Yc(s);s=0;for(var h;u;){if(u.nodeType===3){if(h=s+u.textContent.length,s<=l&&h>=l)return{node:u,offset:l-s};s=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Yc(u)}}function Ps(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?Ps(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function ei(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=oi(s.document);l instanceof s.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)s=l.contentWindow;else break;l=oi(s.document)}return l}function Ir(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var Bs=Fi&&"documentMode"in document&&11>=document.documentMode,ui=null,ia=null,Aa=null,aa=!1;function Gn(s,l,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;aa||ui==null||ui!==oi(h)||(h=ui,"selectionStart"in h&&Ir(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Aa&&Rs(Aa,h)||(Aa=h,h=Rp(ia,"onSelect"),0<h.length&&(l=new Ls("onSelect","select",null,l,u),s.push({event:l,listeners:h}),l.target=ui)))}function sa(s,l){var u={};return u[s.toLowerCase()]=l.toLowerCase(),u["Webkit"+s]="webkit"+l,u["Moz"+s]="moz"+l,u}var dr={animationend:sa("Animation","AnimationEnd"),animationiteration:sa("Animation","AnimationIteration"),animationstart:sa("Animation","AnimationStart"),transitionrun:sa("Transition","TransitionRun"),transitionstart:sa("Transition","TransitionStart"),transitioncancel:sa("Transition","TransitionCancel"),transitionend:sa("Transition","TransitionEnd")},fi={},Po={};Fi&&(Po=document.createElement("div").style,"AnimationEvent"in window||(delete dr.animationend.animation,delete dr.animationiteration.animation,delete dr.animationstart.animation),"TransitionEvent"in window||delete dr.transitionend.transition);function Ca(s){if(fi[s])return fi[s];if(!dr[s])return s;var l=dr[s],u;for(u in l)if(l.hasOwnProperty(u)&&u in Po)return fi[s]=l[u];return s}var Pl=Ca("animationend"),Fs=Ca("animationiteration"),Is=Ca("animationstart"),zs=Ca("transitionrun"),Bo=Ca("transitionstart"),Bl=Ca("transitioncancel"),Hs=Ca("transitionend"),Xa=new Map,Fo="abort auxClick beforeToggle 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(" ");Fo.push("scrollEnd");function $n(s,l){Xa.set(s,l),Bi(l,[s])}var Ei=new WeakMap;function Xt(s,l){if(typeof s=="object"&&s!==null){var u=Ei.get(s);return u!==void 0?u:(l={value:s,source:l,stack:Vn(l)},Ei.set(s,l),l)}return{value:s,source:l,stack:Vn(l)}}var Zt=[],Mn=0,rr=0;function Hi(){for(var s=Mn,l=rr=Mn=0;l<s;){var u=Zt[l];Zt[l++]=null;var h=Zt[l];Zt[l++]=null;var v=Zt[l];Zt[l++]=null;var _=Zt[l];if(Zt[l++]=null,h!==null&&v!==null){var T=h.pending;T===null?v.next=v:(v.next=T.next,T.next=v),h.pending=v}_!==0&&Ku(u,v,_)}}function Us(s,l,u,h){Zt[Mn++]=s,Zt[Mn++]=l,Zt[Mn++]=u,Zt[Mn++]=h,rr|=h,s.lanes|=h,s=s.alternate,s!==null&&(s.lanes|=h)}function qs(s,l,u,h){return Us(s,l,u,h),Io(s)}function Za(s,l){return Us(s,null,null,l),Io(s)}function Ku(s,l,u){s.lanes|=u;var h=s.alternate;h!==null&&(h.lanes|=u);for(var v=!1,_=s.return;_!==null;)_.childLanes|=u,h=_.alternate,h!==null&&(h.childLanes|=u),_.tag===22&&(s=_.stateNode,s===null||s._visibility&1||(v=!0)),s=_,_=_.return;return s.tag===3?(_=s.stateNode,v&&l!==null&&(v=31-qe(u),s=_.hiddenUpdates,h=s[v],h===null?s[v]=[l]:h.push(l),l.lane=u|536870912),_):null}function Io(s){if(50<Hd)throw Hd=0,w0=null,Error(r(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var Or={};function Ui(s,l,u,h){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(s,l,u,h){return new Ui(s,l,u,h)}function Fl(s){return s=s.prototype,!(!s||!s.isReactComponent)}function ka(s,l){var u=s.alternate;return u===null?(u=Gr(s.tag,l,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=l,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,l=s.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function Vc(s,l){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,l=u.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function zo(s,l,u,h,v,_){var T=0;if(h=s,typeof s=="function")Fl(s)&&(T=1);else if(typeof s=="string")T=H6(s,u,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case se:return s=Gr(31,u,l,v),s.elementType=se,s.lanes=_,s;case N:return Ka(u.children,v,_,l);case w:T=8,v|=24;break;case k:return s=Gr(12,u,l,v|2),s.elementType=k,s.lanes=_,s;case O:return s=Gr(13,u,l,v),s.elementType=O,s.lanes=_,s;case K:return s=Gr(19,u,l,v),s.elementType=K,s.lanes=_,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:case j:T=10;break e;case L:T=9;break e;case z:T=11;break e;case q:T=14;break e;case H:T=16,h=null;break e}T=29,u=Error(r(130,s===null?"null":typeof s,"")),h=null}return l=Gr(T,u,l,v),l.elementType=s,l.type=h,l.lanes=_,l}function Ka(s,l,u,h){return s=Gr(7,s,h,l),s.lanes=u,s}function Qu(s,l,u){return s=Gr(6,s,null,l),s.lanes=u,s}function Gc(s,l,u){return l=Gr(4,s.children!==null?s.children:[],s.key,l),l.lanes=u,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var Ws=[],Qa=0,Il=null,Ju=0,qi=[],Di=0,Ho=null,Ja=1,es="";function Uo(s,l){Ws[Qa++]=Ju,Ws[Qa++]=Il,Il=s,Ju=l}function Jh(s,l,u){qi[Di++]=Ja,qi[Di++]=es,qi[Di++]=Ho,Ho=s;var h=Ja;s=es;var v=32-qe(h)-1;h&=~(1<<v),u+=1;var _=32-qe(l)+v;if(30<_){var T=v-v%5;_=(h&(1<<T)-1).toString(32),h>>=T,v-=T,Ja=1<<32-qe(l)+v|u<<v|h,es=_+s}else Ja=1<<_|u<<v|h,es=s}function $c(s){s.return!==null&&(Uo(s,1),Jh(s,1,0))}function Xc(s){for(;s===Il;)Il=Ws[--Qa],Ws[Qa]=null,Ju=Ws[--Qa],Ws[Qa]=null;for(;s===Ho;)Ho=qi[--Di],qi[Di]=null,es=qi[--Di],qi[Di]=null,Ja=qi[--Di],qi[Di]=null}var xr=null,Xn=null,cn=!1,Ys=null,Ma=!1,yd=Error(r(519));function qo(s){var l=Error(r(418,""));throw zl(Xt(l,s)),yd}function ep(s){var l=s.stateNode,u=s.type,h=s.memoizedProps;switch(l[un]=s,l[zn]=h,u){case"dialog":tn("cancel",l),tn("close",l);break;case"iframe":case"object":case"embed":tn("load",l);break;case"video":case"audio":for(u=0;u<qd.length;u++)tn(qd[u],l);break;case"source":tn("error",l);break;case"img":case"image":case"link":tn("error",l),tn("load",l);break;case"details":tn("toggle",l);break;case"input":tn("invalid",l),jc(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),As(l);break;case"select":tn("invalid",l);break;case"textarea":tn("invalid",l),Tc(l,h.value,h.defaultValue,h.children),As(l)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||h.suppressHydrationWarning===!0||vb(l.textContent,u)?(h.popover!=null&&(tn("beforetoggle",l),tn("toggle",l)),h.onScroll!=null&&tn("scroll",l),h.onScrollEnd!=null&&tn("scrollend",l),h.onClick!=null&&(l.onclick=Pp),l=!0):l=!1,l||qo(s)}function ts(s){for(xr=s.return;xr;)switch(xr.tag){case 5:case 13:Ma=!1;return;case 27:case 3:Ma=!0;return;default:xr=xr.return}}function ti(s){if(s!==xr)return!1;if(!cn)return ts(s),cn=!0,!1;var l=s.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||B0(s.type,s.memoizedProps)),u=!u),u&&Xn&&qo(s),ts(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));e:{for(s=s.nextSibling,l=0;s;){if(s.nodeType===8)if(u=s.data,u==="/$"){if(l===0){Xn=cs(s.nextSibling);break e}l--}else u!=="$"&&u!=="$!"&&u!=="$?"||l++;s=s.nextSibling}Xn=null}}else l===27?(l=Xn,rc(s.type)?(s=H0,H0=null,Xn=s):Xn=l):Xn=xr?cs(s.stateNode.nextSibling):null;return!0}function ji(){Xn=xr=null,cn=!1}function tp(){var s=Ys;return s!==null&&(Vi===null?Vi=s:Vi.push.apply(Vi,s),Ys=null),s}function zl(s){Ys===null?Ys=[s]:Ys.push(s)}var La=xe(null),Tr=null,ns=null;function Vs(s,l,u){V(La,l._currentValue),l._currentValue=u}function Ea(s){s._currentValue=La.current,R(La)}function ef(s,l,u){for(;s!==null;){var h=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),s===u)break;s=s.return}}function tf(s,l,u,h){var v=s.child;for(v!==null&&(v.return=s);v!==null;){var _=v.dependencies;if(_!==null){var T=v.child;_=_.firstContext;e:for(;_!==null;){var Z=_;_=v;for(var pe=0;pe<l.length;pe++)if(Z.context===l[pe]){_.lanes|=u,Z=_.alternate,Z!==null&&(Z.lanes|=u),ef(_.return,u,s),h||(T=null);break e}_=Z.next}}else if(v.tag===18){if(T=v.return,T===null)throw Error(r(341));T.lanes|=u,_=T.alternate,_!==null&&(_.lanes|=u),ef(T,u,s),T=null}else T=v.child;if(T!==null)T.return=v;else for(T=v;T!==null;){if(T===s){T=null;break}if(v=T.sibling,v!==null){v.return=T.return,T=v;break}T=T.return}v=T}}function Hl(s,l,u,h){s=null;for(var v=l,_=!1;v!==null;){if(!_){if((v.flags&524288)!==0)_=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var T=v.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var Z=v.type;jr(v.pendingProps.value,T.value)||(s!==null?s.push(Z):s=[Z])}}else if(v===he.current){if(T=v.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(s!==null?s.push(Xd):s=[Xd])}v=v.return}s!==null&&tf(l,s,u,h),l.flags|=262144}function nf(s){for(s=s.firstContext;s!==null;){if(!jr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Da(s){Tr=s,ns=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function wr(s){return rf(Tr,s)}function Gs(s,l){return Tr===null&&Da(s),rf(s,l)}function rf(s,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},ns===null){if(s===null)throw Error(r(308));ns=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else ns=ns.next=l;return u}var Vg=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(u,h){s.push(h)}};this.abort=function(){l.aborted=!0,s.forEach(function(u){return u()})}},np=t.unstable_scheduleCallback,Gg=t.unstable_NormalPriority,Sr={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vd(){return{controller:new Vg,data:new Map,refCount:0}}function Zc(s){s.refCount--,s.refCount===0&&np(Gg,function(){s.controller.abort()})}var Kc=null,bd=0,Wo=0,rs=null;function $g(s,l){if(Kc===null){var u=Kc=[];bd=0,Wo=M0(),rs={status:"pending",value:void 0,then:function(h){u.push(h)}}}return bd++,l.then(rp,rp),l}function rp(){if(--bd===0&&Kc!==null){rs!==null&&(rs.status="fulfilled");var s=Kc;Kc=null,Wo=0,rs=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function ip(s,l){var u=[],h={status:"pending",value:null,reason:null,then:function(v){u.push(v)}};return s.then(function(){h.status="fulfilled",h.value=l;for(var v=0;v<u.length;v++)(0,u[v])(l)},function(v){for(h.status="rejected",h.reason=v,v=0;v<u.length;v++)(0,u[v])(void 0)}),h}var m=X.S;X.S=function(s,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&$g(s,l),m!==null&&m(s,l)};var x=xe(null);function M(){var s=x.current;return s!==null?s:In.pooledCache}function D(s,l){l===null?V(x,x.current):V(x,l.pool)}function B(){var s=M();return s===null?null:{parent:Sr._currentValue,pool:s}}var U=Error(r(460)),Y=Error(r(474)),$=Error(r(542)),ee={then:function(){}};function re(s){return s=s.status,s==="fulfilled"||s==="rejected"}function ve(){}function je(s,l,u){switch(u=s[u],u===void 0?s.push(l):u!==l&&(l.then(ve,ve),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,et(s),s;default:if(typeof l.status=="string")l.then(ve,ve);else{if(s=In,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=l,s.status="pending",s.then(function(h){if(l.status==="pending"){var v=l;v.status="fulfilled",v.value=h}},function(h){if(l.status==="pending"){var v=l;v.status="rejected",v.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,et(s),s}throw Ee=l,U}}var Ee=null;function Ae(){if(Ee===null)throw Error(r(459));var s=Ee;return Ee=null,s}function et(s){if(s===U||s===$)throw Error(r(483))}var Ie=!1;function be(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ne(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Xe(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function tt(s,l,u){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(Nn&2)!==0){var v=h.pending;return v===null?l.next=l:(l.next=v.next,v.next=l),h.pending=l,l=Io(s),Ku(s,null,u),l}return Us(s,h,l,u),Io(s)}function Ke(s,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var h=l.lanes;h&=s.pendingLanes,u|=h,l.lanes=u,Ht(s,u)}}function ct(s,l){var u=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var v=null,_=null;if(u=u.firstBaseUpdate,u!==null){do{var T={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};_===null?v=_=T:_=_.next=T,u=u.next}while(u!==null);_===null?v=_=l:_=_.next=l}else v=_=l;u={baseState:h.baseState,firstBaseUpdate:v,lastBaseUpdate:_,shared:h.shared,callbacks:h.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=l}var at=!1;function _t(){if(at){var s=rs;if(s!==null)throw s}}function ot(s,l,u,h){at=!1;var v=s.updateQueue;Ie=!1;var _=v.firstBaseUpdate,T=v.lastBaseUpdate,Z=v.shared.pending;if(Z!==null){v.shared.pending=null;var pe=Z,Te=pe.next;pe.next=null,T===null?_=Te:T.next=Te,T=pe;var Ze=s.alternate;Ze!==null&&(Ze=Ze.updateQueue,Z=Ze.lastBaseUpdate,Z!==T&&(Z===null?Ze.firstBaseUpdate=Te:Z.next=Te,Ze.lastBaseUpdate=pe))}if(_!==null){var nt=v.baseState;T=0,Ze=Te=pe=null,Z=_;do{var Pe=Z.lane&-536870913,Fe=Pe!==Z.lane;if(Fe?(on&Pe)===Pe:(h&Pe)===Pe){Pe!==0&&Pe===Wo&&(at=!0),Ze!==null&&(Ze=Ze.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var Bt=s,Et=Z;Pe=l;var En=u;switch(Et.tag){case 1:if(Bt=Et.payload,typeof Bt=="function"){nt=Bt.call(En,nt,Pe);break e}nt=Bt;break e;case 3:Bt.flags=Bt.flags&-65537|128;case 0:if(Bt=Et.payload,Pe=typeof Bt=="function"?Bt.call(En,nt,Pe):Bt,Pe==null)break e;nt=p({},nt,Pe);break e;case 2:Ie=!0}}Pe=Z.callback,Pe!==null&&(s.flags|=64,Fe&&(s.flags|=8192),Fe=v.callbacks,Fe===null?v.callbacks=[Pe]:Fe.push(Pe))}else Fe={lane:Pe,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Ze===null?(Te=Ze=Fe,pe=nt):Ze=Ze.next=Fe,T|=Pe;if(Z=Z.next,Z===null){if(Z=v.shared.pending,Z===null)break;Fe=Z,Z=Fe.next,Fe.next=null,v.lastBaseUpdate=Fe,v.shared.pending=null}}while(!0);Ze===null&&(pe=nt),v.baseState=pe,v.firstBaseUpdate=Te,v.lastBaseUpdate=Ze,_===null&&(v.shared.lanes=0),Jl|=T,s.lanes=T,s.memoizedState=nt}}function an(s,l){if(typeof s!="function")throw Error(r(191,s));s.call(l)}function fn(s,l){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)an(u[s],l)}var $t=xe(null),Yt=xe(0);function gn(s,l){s=el,V(Yt,s),V($t,l),el=s|l.baseLanes}function dn(){V(Yt,el),V($t,$t.current)}function It(){el=Yt.current,R($t),R(Yt)}var _n=0,kt=null,Ot=null,rn=null,sn=!1,Rr=!1,_r=!1,ir=0,ar=0,hr=null,Wi=0;function hn(){throw Error(r(321))}function pr(s,l){if(l===null)return!1;for(var u=0;u<l.length&&u<s.length;u++)if(!jr(s[u],l[u]))return!1;return!0}function oa(s,l,u,h,v,_){return _n=_,kt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,X.H=s===null||s.memoizedState===null?Qy:Jy,_r=!1,_=u(h,v),_r=!1,Rr&&(_=Yo(l,u,h,v)),$s(s),_}function $s(s){X.H=gp;var l=Ot!==null&&Ot.next!==null;if(_n=0,rn=Ot=kt=null,sn=!1,ar=0,hr=null,l)throw Error(r(300));s===null||$r||(s=s.dependencies,s!==null&&nf(s)&&($r=!0))}function Yo(s,l,u,h){kt=s;var v=0;do{if(Rr&&(hr=null),ar=0,Rr=!1,25<=v)throw Error(r(301));if(v+=1,rn=Ot=null,s.updateQueue!=null){var _=s.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}X.H=QN,_=l(u,h)}while(Rr);return _}function Xs(){var s=X.H,l=s.useState()[0];return l=typeof l.then=="function"?Zs(l):l,s=s.useState()[0],(Ot!==null?Ot.memoizedState:null)!==s&&(kt.flags|=1024),l}function Fn(){var s=ir!==0;return ir=0,s}function Qc(s,l,u){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~u}function af(s){if(sn){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}sn=!1}_n=0,rn=Ot=kt=null,Rr=!1,ar=ir=0,hr=null}function ni(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?kt.memoizedState=rn=s:rn=rn.next=s,rn}function Un(){if(Ot===null){var s=kt.alternate;s=s!==null?s.memoizedState:null}else s=Ot.next;var l=rn===null?kt.memoizedState:rn.next;if(l!==null)rn=l,Ot=s;else{if(s===null)throw kt.alternate===null?Error(r(467)):Error(r(310));Ot=s,s={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},rn===null?kt.memoizedState=rn=s:rn=rn.next=s}return rn}function Vo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zs(s){var l=ar;return ar+=1,hr===null&&(hr=[]),s=je(hr,s,l),l=kt,(rn===null?l.memoizedState:rn.next)===null&&(l=l.alternate,X.H=l===null||l.memoizedState===null?Qy:Jy),s}function di(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Zs(s);if(s.$$typeof===j)return wr(s)}throw Error(r(438,String(s)))}function Ks(s){var l=null,u=kt.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var h=kt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(v){return v.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=Vo(),kt.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(s),h=0;h<s;h++)u[h]=le;return l.index++,u}function hi(s,l){return typeof l=="function"?l(s):l}function Jc(s){var l=Un();return Ul(l,Ot,s)}function Ul(s,l,u){var h=s.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var v=s.baseQueue,_=h.pending;if(_!==null){if(v!==null){var T=v.next;v.next=_.next,_.next=T}l.baseQueue=v=_,h.pending=null}if(_=s.baseState,v===null)s.memoizedState=_;else{l=v.next;var Z=T=null,pe=null,Te=l,Ze=!1;do{var nt=Te.lane&-536870913;if(nt!==Te.lane?(on&nt)===nt:(_n&nt)===nt){var Pe=Te.revertLane;if(Pe===0)pe!==null&&(pe=pe.next={lane:0,revertLane:0,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null}),nt===Wo&&(Ze=!0);else if((_n&Pe)===Pe){Te=Te.next,Pe===Wo&&(Ze=!0);continue}else nt={lane:0,revertLane:Te.revertLane,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null},pe===null?(Z=pe=nt,T=_):pe=pe.next=nt,kt.lanes|=Pe,Jl|=Pe;nt=Te.action,_r&&u(_,nt),_=Te.hasEagerState?Te.eagerState:u(_,nt)}else Pe={lane:nt,revertLane:Te.revertLane,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null},pe===null?(Z=pe=Pe,T=_):pe=pe.next=Pe,kt.lanes|=nt,Jl|=nt;Te=Te.next}while(Te!==null&&Te!==l);if(pe===null?T=_:pe.next=Z,!jr(_,s.memoizedState)&&($r=!0,Ze&&(u=rs,u!==null)))throw u;s.memoizedState=_,s.baseState=T,s.baseQueue=pe,h.lastRenderedState=_}return v===null&&(h.lanes=0),[s.memoizedState,h.dispatch]}function sf(s){var l=Un(),u=l.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=s;var h=u.dispatch,v=u.pending,_=l.memoizedState;if(v!==null){u.pending=null;var T=v=v.next;do _=s(_,T.action),T=T.next;while(T!==v);jr(_,l.memoizedState)||($r=!0),l.memoizedState=_,l.baseQueue===null&&(l.baseState=_),u.lastRenderedState=_}return[_,h]}function eu(s,l,u){var h=kt,v=Un(),_=cn;if(_){if(u===void 0)throw Error(r(407));u=u()}else u=l();var T=!jr((Ot||v).memoizedState,u);T&&(v.memoizedState=u,$r=!0),v=v.queue;var Z=ql.bind(null,h,v,s);if(Vl(2048,8,Z,[s]),v.getSnapshot!==l||T||rn!==null&&rn.memoizedState.tag&1){if(h.flags|=2048,as(9,iu(),tu.bind(null,h,v,u,l),null),In===null)throw Error(r(349));_||(_n&124)!==0||of(h,l,u)}return u}function of(s,l,u){s.flags|=16384,s={getSnapshot:l,value:u},l=kt.updateQueue,l===null?(l=Vo(),kt.updateQueue=l,l.stores=[s]):(u=l.stores,u===null?l.stores=[s]:u.push(s))}function tu(s,l,u,h){l.value=u,l.getSnapshot=h,ap(l)&&sp(s)}function ql(s,l,u){return u(function(){ap(l)&&sp(s)})}function ap(s){var l=s.getSnapshot;s=s.value;try{var u=l();return!jr(s,u)}catch{return!0}}function sp(s){var l=Za(s,2);l!==null&&ha(l,s,2)}function nu(s){var l=ni();if(typeof s=="function"){var u=s;if(s=u(),_r){Re(!0);try{u()}finally{Re(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hi,lastRenderedState:s},l}function is(s,l,u,h){return s.baseState=u,Ul(s,Ot,typeof h=="function"?h:hi)}function Xg(s,l,u,h,v){if(mp(s))throw Error(r(485));if(s=l.action,s!==null){var _={payload:v,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){_.listeners.push(T)}};X.T!==null?u(!0):_.isTransition=!1,h(_),u=l.pending,u===null?(_.next=l.pending=_,op(l,_)):(_.next=u.next,l.pending=u.next=_)}}function op(s,l){var u=l.action,h=l.payload,v=s.state;if(l.isTransition){var _=X.T,T={};X.T=T;try{var Z=u(v,h),pe=X.S;pe!==null&&pe(T,Z),lp(s,l,Z)}catch(Te){Wl(s,l,Te)}finally{X.T=_}}else try{_=u(v,h),lp(s,l,_)}catch(Te){Wl(s,l,Te)}}function lp(s,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){xd(s,l,h)},function(h){return Wl(s,l,h)}):xd(s,l,u)}function xd(s,l,u){l.status="fulfilled",l.value=u,wd(l),s.state=u,l=s.pending,l!==null&&(u=l.next,u===l?s.pending=null:(u=u.next,l.next=u,op(s,u)))}function Wl(s,l,u){var h=s.pending;if(s.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=u,wd(l),l=l.next;while(l!==h)}s.action=null}function wd(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function Sd(s,l){return l}function ru(s,l){if(cn){var u=In.formState;if(u!==null){e:{var h=kt;if(cn){if(Xn){t:{for(var v=Xn,_=Ma;v.nodeType!==8;){if(!_){v=null;break t}if(v=cs(v.nextSibling),v===null){v=null;break t}}_=v.data,v=_==="F!"||_==="F"?v:null}if(v){Xn=cs(v.nextSibling),h=v.data==="F!";break e}}qo(h)}h=!1}h&&(l=u[0])}}return u=ni(),u.memoizedState=u.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sd,lastRenderedState:l},u.queue=h,u=Xy.bind(null,kt,h),h.dispatch=u,h=nu(!1),_=Zg.bind(null,kt,!1,h.queue),h=ni(),v={state:l,dispatch:null,action:s,pending:null},h.queue=v,u=Xg.bind(null,kt,v,_,u),v.dispatch=u,h.memoizedState=s,[l,u,!1]}function lf(s){var l=Un();return Yl(l,Ot,s)}function Yl(s,l,u){if(l=Ul(s,l,Sd)[0],s=Jc(hi)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=Zs(l)}catch(T){throw T===U?$:T}else h=l;l=Un();var v=l.queue,_=v.dispatch;return u!==l.memoizedState&&(kt.flags|=2048,as(9,iu(),cp.bind(null,v,u),null)),[h,_,s]}function cp(s,l){s.action=l}function up(s){var l=Un(),u=Ot;if(u!==null)return Yl(l,u,s);Un(),l=l.memoizedState,u=Un();var h=u.queue.dispatch;return u.memoizedState=s,[l,h,!1]}function as(s,l,u,h){return s={tag:s,create:u,deps:h,inst:l,next:null},l=kt.updateQueue,l===null&&(l=Vo(),kt.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=s.next=s:(h=u.next,u.next=s,s.next=h,l.lastEffect=s),s}function iu(){return{destroy:void 0,resource:void 0}}function cf(){return Un().memoizedState}function la(s,l,u,h){var v=ni();h=h===void 0?null:h,kt.flags|=s,v.memoizedState=as(1|l,iu(),u,h)}function Vl(s,l,u,h){var v=Un();h=h===void 0?null:h;var _=v.memoizedState.inst;Ot!==null&&h!==null&&pr(h,Ot.memoizedState.deps)?v.memoizedState=as(l,_,u,h):(kt.flags|=s,v.memoizedState=as(1|l,_,u,h))}function _d(s,l){la(8390656,8,s,l)}function fp(s,l){Vl(2048,8,s,l)}function Nd(s,l){return Vl(4,2,s,l)}function Go(s,l){return Vl(4,4,s,l)}function dp(s,l){if(typeof l=="function"){s=s();var u=l(s);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function Ad(s,l,u){u=u!=null?u.concat([s]):null,Vl(4,4,dp.bind(null,l,s),u)}function Cd(){}function kd(s,l){var u=Un();l=l===void 0?null:l;var h=u.memoizedState;return l!==null&&pr(l,h[1])?h[0]:(u.memoizedState=[s,l],s)}function hp(s,l){var u=Un();l=l===void 0?null:l;var h=u.memoizedState;if(l!==null&&pr(l,h[1]))return h[0];if(h=s(),_r){Re(!0);try{s()}finally{Re(!1)}}return u.memoizedState=[h,l],h}function $o(s,l,u){return u===void 0||(_n&1073741824)!==0?s.memoizedState=l:(s.memoizedState=u,s=Yv(),kt.lanes|=s,Jl|=s,u)}function uf(s,l,u,h){return jr(u,l)?u:$t.current!==null?(s=$o(s,u,h),jr(s,l)||($r=!0),s):(_n&42)===0?($r=!0,s.memoizedState=u):(s=Yv(),kt.lanes|=s,Jl|=s,l)}function au(s,l,u,h,v){var _=J.p;J.p=_!==0&&8>_?_:8;var T=X.T,Z={};X.T=Z,Zg(s,!1,l,u);try{var pe=v(),Te=X.S;if(Te!==null&&Te(Z,pe),pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Ze=ip(pe,h);Dd(s,l,Ze,da(s))}else Dd(s,l,h,da(s))}catch(nt){Dd(s,l,{then:function(){},status:"rejected",reason:nt},da())}finally{J.p=_,X.T=T}}function ss(){}function ja(s,l,u,h){if(s.tag!==5)throw Error(r(476));var v=os(s).queue;au(s,v,l,G,u===null?ss:function(){return su(s),u(h)})}function os(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hi,lastRenderedState:G},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hi,lastRenderedState:u},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function su(s){var l=os(s).next.queue;Dd(s,l,{},da())}function ou(){return wr(Xd)}function Md(){return Un().memoizedState}function pp(){return Un().memoizedState}function Ld(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var u=da();s=Xe(u);var h=tt(l,s,u);h!==null&&(ha(h,l,u),Ke(h,l,u)),l={cache:vd()},s.payload=l;return}l=l.return}}function Ed(s,l,u){var h=da();u={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},mp(s)?Zy(l,u):(u=qs(s,l,u,h),u!==null&&(ha(u,s,h),Ky(u,l,h)))}function Xy(s,l,u){var h=da();Dd(s,l,u,h)}function Dd(s,l,u,h){var v={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(mp(s))Zy(l,v);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=l.lastRenderedReducer,_!==null))try{var T=l.lastRenderedState,Z=_(T,u);if(v.hasEagerState=!0,v.eagerState=Z,jr(Z,T))return Us(s,l,v,0),In===null&&Hi(),!1}catch{}finally{}if(u=qs(s,l,v,h),u!==null)return ha(u,s,h),Ky(u,l,h),!0}return!1}function Zg(s,l,u,h){if(h={lane:2,revertLane:M0(),action:h,hasEagerState:!1,eagerState:null,next:null},mp(s)){if(l)throw Error(r(479))}else l=qs(s,u,h,2),l!==null&&ha(l,s,2)}function mp(s){var l=s.alternate;return s===kt||l!==null&&l===kt}function Zy(s,l){Rr=sn=!0;var u=s.pending;u===null?l.next=l:(l.next=u.next,u.next=l),s.pending=l}function Ky(s,l,u){if((u&4194048)!==0){var h=l.lanes;h&=s.pendingLanes,u|=h,l.lanes=u,Ht(s,u)}}var gp={readContext:wr,use:di,useCallback:hn,useContext:hn,useEffect:hn,useImperativeHandle:hn,useLayoutEffect:hn,useInsertionEffect:hn,useMemo:hn,useReducer:hn,useRef:hn,useState:hn,useDebugValue:hn,useDeferredValue:hn,useTransition:hn,useSyncExternalStore:hn,useId:hn,useHostTransitionStatus:hn,useFormState:hn,useActionState:hn,useOptimistic:hn,useMemoCache:hn,useCacheRefresh:hn},Qy={readContext:wr,use:di,useCallback:function(s,l){return ni().memoizedState=[s,l===void 0?null:l],s},useContext:wr,useEffect:_d,useImperativeHandle:function(s,l,u){u=u!=null?u.concat([s]):null,la(4194308,4,dp.bind(null,l,s),u)},useLayoutEffect:function(s,l){return la(4194308,4,s,l)},useInsertionEffect:function(s,l){la(4,2,s,l)},useMemo:function(s,l){var u=ni();l=l===void 0?null:l;var h=s();if(_r){Re(!0);try{s()}finally{Re(!1)}}return u.memoizedState=[h,l],h},useReducer:function(s,l,u){var h=ni();if(u!==void 0){var v=u(l);if(_r){Re(!0);try{u(l)}finally{Re(!1)}}}else v=l;return h.memoizedState=h.baseState=v,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:v},h.queue=s,s=s.dispatch=Ed.bind(null,kt,s),[h.memoizedState,s]},useRef:function(s){var l=ni();return s={current:s},l.memoizedState=s},useState:function(s){s=nu(s);var l=s.queue,u=Xy.bind(null,kt,l);return l.dispatch=u,[s.memoizedState,u]},useDebugValue:Cd,useDeferredValue:function(s,l){var u=ni();return $o(u,s,l)},useTransition:function(){var s=nu(!1);return s=au.bind(null,kt,s.queue,!0,!1),ni().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,u){var h=kt,v=ni();if(cn){if(u===void 0)throw Error(r(407));u=u()}else{if(u=l(),In===null)throw Error(r(349));(on&124)!==0||of(h,l,u)}v.memoizedState=u;var _={value:u,getSnapshot:l};return v.queue=_,_d(ql.bind(null,h,_,s),[s]),h.flags|=2048,as(9,iu(),tu.bind(null,h,_,u,l),null),u},useId:function(){var s=ni(),l=In.identifierPrefix;if(cn){var u=es,h=Ja;u=(h&~(1<<32-qe(h)-1)).toString(32)+u,l="«"+l+"R"+u,u=ir++,0<u&&(l+="H"+u.toString(32)),l+="»"}else u=Wi++,l="«"+l+"r"+u.toString(32)+"»";return s.memoizedState=l},useHostTransitionStatus:ou,useFormState:ru,useActionState:ru,useOptimistic:function(s){var l=ni();l.memoizedState=l.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=Zg.bind(null,kt,!0,u),u.dispatch=l,[s,l]},useMemoCache:Ks,useCacheRefresh:function(){return ni().memoizedState=Ld.bind(null,kt)}},Jy={readContext:wr,use:di,useCallback:kd,useContext:wr,useEffect:fp,useImperativeHandle:Ad,useInsertionEffect:Nd,useLayoutEffect:Go,useMemo:hp,useReducer:Jc,useRef:cf,useState:function(){return Jc(hi)},useDebugValue:Cd,useDeferredValue:function(s,l){var u=Un();return uf(u,Ot.memoizedState,s,l)},useTransition:function(){var s=Jc(hi)[0],l=Un().memoizedState;return[typeof s=="boolean"?s:Zs(s),l]},useSyncExternalStore:eu,useId:Md,useHostTransitionStatus:ou,useFormState:lf,useActionState:lf,useOptimistic:function(s,l){var u=Un();return is(u,Ot,s,l)},useMemoCache:Ks,useCacheRefresh:pp},QN={readContext:wr,use:di,useCallback:kd,useContext:wr,useEffect:fp,useImperativeHandle:Ad,useInsertionEffect:Nd,useLayoutEffect:Go,useMemo:hp,useReducer:sf,useRef:cf,useState:function(){return sf(hi)},useDebugValue:Cd,useDeferredValue:function(s,l){var u=Un();return Ot===null?$o(u,s,l):uf(u,Ot.memoizedState,s,l)},useTransition:function(){var s=sf(hi)[0],l=Un().memoizedState;return[typeof s=="boolean"?s:Zs(s),l]},useSyncExternalStore:eu,useId:Md,useHostTransitionStatus:ou,useFormState:up,useActionState:up,useOptimistic:function(s,l){var u=Un();return Ot!==null?is(u,Ot,s,l):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:Ks,useCacheRefresh:pp},ff=null,jd=0;function yp(s){var l=jd;return jd+=1,ff===null&&(ff=[]),je(ff,s,l)}function Od(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function vp(s,l){throw l.$$typeof===g?Error(r(525)):(s=Object.prototype.toString.call(l),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function ev(s){var l=s._init;return l(s._payload)}function tv(s){function l(ke,_e){if(s){var De=ke.deletions;De===null?(ke.deletions=[_e],ke.flags|=16):De.push(_e)}}function u(ke,_e){if(!s)return null;for(;_e!==null;)l(ke,_e),_e=_e.sibling;return null}function h(ke){for(var _e=new Map;ke!==null;)ke.key!==null?_e.set(ke.key,ke):_e.set(ke.index,ke),ke=ke.sibling;return _e}function v(ke,_e){return ke=ka(ke,_e),ke.index=0,ke.sibling=null,ke}function _(ke,_e,De){return ke.index=De,s?(De=ke.alternate,De!==null?(De=De.index,De<_e?(ke.flags|=67108866,_e):De):(ke.flags|=67108866,_e)):(ke.flags|=1048576,_e)}function T(ke){return s&&ke.alternate===null&&(ke.flags|=67108866),ke}function Z(ke,_e,De,Qe){return _e===null||_e.tag!==6?(_e=Qu(De,ke.mode,Qe),_e.return=ke,_e):(_e=v(_e,De),_e.return=ke,_e)}function pe(ke,_e,De,Qe){var gt=De.type;return gt===N?Ze(ke,_e,De.props.children,Qe,De.key):_e!==null&&(_e.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===H&&ev(gt)===_e.type)?(_e=v(_e,De.props),Od(_e,De),_e.return=ke,_e):(_e=zo(De.type,De.key,De.props,null,ke.mode,Qe),Od(_e,De),_e.return=ke,_e)}function Te(ke,_e,De,Qe){return _e===null||_e.tag!==4||_e.stateNode.containerInfo!==De.containerInfo||_e.stateNode.implementation!==De.implementation?(_e=Gc(De,ke.mode,Qe),_e.return=ke,_e):(_e=v(_e,De.children||[]),_e.return=ke,_e)}function Ze(ke,_e,De,Qe,gt){return _e===null||_e.tag!==7?(_e=Ka(De,ke.mode,Qe,gt),_e.return=ke,_e):(_e=v(_e,De),_e.return=ke,_e)}function nt(ke,_e,De){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return _e=Qu(""+_e,ke.mode,De),_e.return=ke,_e;if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case b:return De=zo(_e.type,_e.key,_e.props,null,ke.mode,De),Od(De,_e),De.return=ke,De;case y:return _e=Gc(_e,ke.mode,De),_e.return=ke,_e;case H:var Qe=_e._init;return _e=Qe(_e._payload),nt(ke,_e,De)}if(de(_e)||I(_e))return _e=Ka(_e,ke.mode,De,null),_e.return=ke,_e;if(typeof _e.then=="function")return nt(ke,yp(_e),De);if(_e.$$typeof===j)return nt(ke,Gs(ke,_e),De);vp(ke,_e)}return null}function Pe(ke,_e,De,Qe){var gt=_e!==null?_e.key:null;if(typeof De=="string"&&De!==""||typeof De=="number"||typeof De=="bigint")return gt!==null?null:Z(ke,_e,""+De,Qe);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case b:return De.key===gt?pe(ke,_e,De,Qe):null;case y:return De.key===gt?Te(ke,_e,De,Qe):null;case H:return gt=De._init,De=gt(De._payload),Pe(ke,_e,De,Qe)}if(de(De)||I(De))return gt!==null?null:Ze(ke,_e,De,Qe,null);if(typeof De.then=="function")return Pe(ke,_e,yp(De),Qe);if(De.$$typeof===j)return Pe(ke,_e,Gs(ke,De),Qe);vp(ke,De)}return null}function Fe(ke,_e,De,Qe,gt){if(typeof Qe=="string"&&Qe!==""||typeof Qe=="number"||typeof Qe=="bigint")return ke=ke.get(De)||null,Z(_e,ke,""+Qe,gt);if(typeof Qe=="object"&&Qe!==null){switch(Qe.$$typeof){case b:return ke=ke.get(Qe.key===null?De:Qe.key)||null,pe(_e,ke,Qe,gt);case y:return ke=ke.get(Qe.key===null?De:Qe.key)||null,Te(_e,ke,Qe,gt);case H:var Qt=Qe._init;return Qe=Qt(Qe._payload),Fe(ke,_e,De,Qe,gt)}if(de(Qe)||I(Qe))return ke=ke.get(De)||null,Ze(_e,ke,Qe,gt,null);if(typeof Qe.then=="function")return Fe(ke,_e,De,yp(Qe),gt);if(Qe.$$typeof===j)return Fe(ke,_e,De,Gs(_e,Qe),gt);vp(_e,Qe)}return null}function Bt(ke,_e,De,Qe){for(var gt=null,Qt=null,Nt=_e,Dt=_e=0,Zr=null;Nt!==null&&Dt<De.length;Dt++){Nt.index>Dt?(Zr=Nt,Nt=null):Zr=Nt.sibling;var pn=Pe(ke,Nt,De[Dt],Qe);if(pn===null){Nt===null&&(Nt=Zr);break}s&&Nt&&pn.alternate===null&&l(ke,Nt),_e=_(pn,_e,Dt),Qt===null?gt=pn:Qt.sibling=pn,Qt=pn,Nt=Zr}if(Dt===De.length)return u(ke,Nt),cn&&Uo(ke,Dt),gt;if(Nt===null){for(;Dt<De.length;Dt++)Nt=nt(ke,De[Dt],Qe),Nt!==null&&(_e=_(Nt,_e,Dt),Qt===null?gt=Nt:Qt.sibling=Nt,Qt=Nt);return cn&&Uo(ke,Dt),gt}for(Nt=h(Nt);Dt<De.length;Dt++)Zr=Fe(Nt,ke,Dt,De[Dt],Qe),Zr!==null&&(s&&Zr.alternate!==null&&Nt.delete(Zr.key===null?Dt:Zr.key),_e=_(Zr,_e,Dt),Qt===null?gt=Zr:Qt.sibling=Zr,Qt=Zr);return s&&Nt.forEach(function(lc){return l(ke,lc)}),cn&&Uo(ke,Dt),gt}function Et(ke,_e,De,Qe){if(De==null)throw Error(r(151));for(var gt=null,Qt=null,Nt=_e,Dt=_e=0,Zr=null,pn=De.next();Nt!==null&&!pn.done;Dt++,pn=De.next()){Nt.index>Dt?(Zr=Nt,Nt=null):Zr=Nt.sibling;var lc=Pe(ke,Nt,pn.value,Qe);if(lc===null){Nt===null&&(Nt=Zr);break}s&&Nt&&lc.alternate===null&&l(ke,Nt),_e=_(lc,_e,Dt),Qt===null?gt=lc:Qt.sibling=lc,Qt=lc,Nt=Zr}if(pn.done)return u(ke,Nt),cn&&Uo(ke,Dt),gt;if(Nt===null){for(;!pn.done;Dt++,pn=De.next())pn=nt(ke,pn.value,Qe),pn!==null&&(_e=_(pn,_e,Dt),Qt===null?gt=pn:Qt.sibling=pn,Qt=pn);return cn&&Uo(ke,Dt),gt}for(Nt=h(Nt);!pn.done;Dt++,pn=De.next())pn=Fe(Nt,ke,Dt,pn.value,Qe),pn!==null&&(s&&pn.alternate!==null&&Nt.delete(pn.key===null?Dt:pn.key),_e=_(pn,_e,Dt),Qt===null?gt=pn:Qt.sibling=pn,Qt=pn);return s&&Nt.forEach(function(J6){return l(ke,J6)}),cn&&Uo(ke,Dt),gt}function En(ke,_e,De,Qe){if(typeof De=="object"&&De!==null&&De.type===N&&De.key===null&&(De=De.props.children),typeof De=="object"&&De!==null){switch(De.$$typeof){case b:e:{for(var gt=De.key;_e!==null;){if(_e.key===gt){if(gt=De.type,gt===N){if(_e.tag===7){u(ke,_e.sibling),Qe=v(_e,De.props.children),Qe.return=ke,ke=Qe;break e}}else if(_e.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===H&&ev(gt)===_e.type){u(ke,_e.sibling),Qe=v(_e,De.props),Od(Qe,De),Qe.return=ke,ke=Qe;break e}u(ke,_e);break}else l(ke,_e);_e=_e.sibling}De.type===N?(Qe=Ka(De.props.children,ke.mode,Qe,De.key),Qe.return=ke,ke=Qe):(Qe=zo(De.type,De.key,De.props,null,ke.mode,Qe),Od(Qe,De),Qe.return=ke,ke=Qe)}return T(ke);case y:e:{for(gt=De.key;_e!==null;){if(_e.key===gt)if(_e.tag===4&&_e.stateNode.containerInfo===De.containerInfo&&_e.stateNode.implementation===De.implementation){u(ke,_e.sibling),Qe=v(_e,De.children||[]),Qe.return=ke,ke=Qe;break e}else{u(ke,_e);break}else l(ke,_e);_e=_e.sibling}Qe=Gc(De,ke.mode,Qe),Qe.return=ke,ke=Qe}return T(ke);case H:return gt=De._init,De=gt(De._payload),En(ke,_e,De,Qe)}if(de(De))return Bt(ke,_e,De,Qe);if(I(De)){if(gt=I(De),typeof gt!="function")throw Error(r(150));return De=gt.call(De),Et(ke,_e,De,Qe)}if(typeof De.then=="function")return En(ke,_e,yp(De),Qe);if(De.$$typeof===j)return En(ke,_e,Gs(ke,De),Qe);vp(ke,De)}return typeof De=="string"&&De!==""||typeof De=="number"||typeof De=="bigint"?(De=""+De,_e!==null&&_e.tag===6?(u(ke,_e.sibling),Qe=v(_e,De),Qe.return=ke,ke=Qe):(u(ke,_e),Qe=Qu(De,ke.mode,Qe),Qe.return=ke,ke=Qe),T(ke)):u(ke,_e)}return function(ke,_e,De,Qe){try{jd=0;var gt=En(ke,_e,De,Qe);return ff=null,gt}catch(Nt){if(Nt===U||Nt===$)throw Nt;var Qt=Gr(29,Nt,null,ke.mode);return Qt.lanes=Qe,Qt.return=ke,Qt}finally{}}}var df=tv(!0),nv=tv(!1),Oa=xe(null),Qs=null;function Gl(s){var l=s.alternate;V(zr,zr.current&1),V(Oa,s),Qs===null&&(l===null||$t.current!==null||l.memoizedState!==null)&&(Qs=s)}function rv(s){if(s.tag===22){if(V(zr,zr.current),V(Oa,s),Qs===null){var l=s.alternate;l!==null&&l.memoizedState!==null&&(Qs=s)}}else $l()}function $l(){V(zr,zr.current),V(Oa,Oa.current)}function Xo(s){R(Oa),Qs===s&&(Qs=null),R(zr)}var zr=xe(0);function bp(s){for(var l=s;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||z0(u)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function Kg(s,l,u,h){l=s.memoizedState,u=u(h,l),u=u==null?l:p({},l,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var Qg={enqueueSetState:function(s,l,u){s=s._reactInternals;var h=da(),v=Xe(h);v.payload=l,u!=null&&(v.callback=u),l=tt(s,v,h),l!==null&&(ha(l,s,h),Ke(l,s,h))},enqueueReplaceState:function(s,l,u){s=s._reactInternals;var h=da(),v=Xe(h);v.tag=1,v.payload=l,u!=null&&(v.callback=u),l=tt(s,v,h),l!==null&&(ha(l,s,h),Ke(l,s,h))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var u=da(),h=Xe(u);h.tag=2,l!=null&&(h.callback=l),l=tt(s,h,u),l!==null&&(ha(l,s,u),Ke(l,s,u))}};function iv(s,l,u,h,v,_,T){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,_,T):l.prototype&&l.prototype.isPureReactComponent?!Rs(u,h)||!Rs(v,_):!0}function av(s,l,u,h){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,h),l.state!==s&&Qg.enqueueReplaceState(l,l.state,null)}function lu(s,l){var u=l;if("ref"in l){u={};for(var h in l)h!=="ref"&&(u[h]=l[h])}if(s=s.defaultProps){u===l&&(u=p({},u));for(var v in s)u[v]===void 0&&(u[v]=s[v])}return u}var xp=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)};function sv(s){xp(s)}function ov(s){console.error(s)}function lv(s){xp(s)}function wp(s,l){try{var u=s.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function cv(s,l,u){try{var h=s.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Jg(s,l,u){return u=Xe(u),u.tag=3,u.payload={element:null},u.callback=function(){wp(s,l)},u}function uv(s){return s=Xe(s),s.tag=3,s}function fv(s,l,u,h){var v=u.type.getDerivedStateFromError;if(typeof v=="function"){var _=h.value;s.payload=function(){return v(_)},s.callback=function(){cv(l,u,h)}}var T=u.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(s.callback=function(){cv(l,u,h),typeof v!="function"&&(ec===null?ec=new Set([this]):ec.add(this));var Z=h.stack;this.componentDidCatch(h.value,{componentStack:Z!==null?Z:""})})}function JN(s,l,u,h,v){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=u.alternate,l!==null&&Hl(l,u,v,!0),u=Oa.current,u!==null){switch(u.tag){case 13:return Qs===null?_0():u.alternate===null&&mr===0&&(mr=3),u.flags&=-257,u.flags|=65536,u.lanes=v,h===ee?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([h]):l.add(h),A0(s,h,v)),!1;case 22:return u.flags|=65536,h===ee?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([h]):u.add(h)),A0(s,h,v)),!1}throw Error(r(435,u.tag))}return A0(s,h,v),_0(),!1}if(cn)return l=Oa.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=v,h!==yd&&(s=Error(r(422),{cause:h}),zl(Xt(s,u)))):(h!==yd&&(l=Error(r(423),{cause:h}),zl(Xt(l,u))),s=s.current.alternate,s.flags|=65536,v&=-v,s.lanes|=v,h=Xt(h,u),v=Jg(s.stateNode,h,v),ct(s,v),mr!==4&&(mr=2)),!1;var _=Error(r(520),{cause:h});if(_=Xt(_,u),zd===null?zd=[_]:zd.push(_),mr!==4&&(mr=2),l===null)return!0;h=Xt(h,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,s=v&-v,u.lanes|=s,s=Jg(u.stateNode,h,s),ct(u,s),!1;case 1:if(l=u.type,_=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(ec===null||!ec.has(_))))return u.flags|=65536,v&=-v,u.lanes|=v,v=uv(v),fv(v,s,u,h),ct(u,v),!1}u=u.return}while(u!==null);return!1}var dv=Error(r(461)),$r=!1;function ri(s,l,u,h){l.child=s===null?nv(l,null,u,h):df(l,s.child,u,h)}function hv(s,l,u,h,v){u=u.render;var _=l.ref;if("ref"in h){var T={};for(var Z in h)Z!=="ref"&&(T[Z]=h[Z])}else T=h;return Da(l),h=oa(s,l,u,T,_,v),Z=Fn(),s!==null&&!$r?(Qc(s,l,v),Zo(s,l,v)):(cn&&Z&&$c(l),l.flags|=1,ri(s,l,h,v),l.child)}function pv(s,l,u,h,v){if(s===null){var _=u.type;return typeof _=="function"&&!Fl(_)&&_.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=_,mv(s,l,_,h,v)):(s=zo(u.type,null,h,l,l.mode,v),s.ref=l.ref,s.return=l,l.child=s)}if(_=s.child,!o0(s,v)){var T=_.memoizedProps;if(u=u.compare,u=u!==null?u:Rs,u(T,h)&&s.ref===l.ref)return Zo(s,l,v)}return l.flags|=1,s=ka(_,h),s.ref=l.ref,s.return=l,l.child=s}function mv(s,l,u,h,v){if(s!==null){var _=s.memoizedProps;if(Rs(_,h)&&s.ref===l.ref)if($r=!1,l.pendingProps=h=_,o0(s,v))(s.flags&131072)!==0&&($r=!0);else return l.lanes=s.lanes,Zo(s,l,v)}return e0(s,l,u,h,v)}function gv(s,l,u){var h=l.pendingProps,v=h.children,_=s!==null?s.memoizedState:null;if(h.mode==="hidden"){if((l.flags&128)!==0){if(h=_!==null?_.baseLanes|u:u,s!==null){for(v=l.child=s.child,_=0;v!==null;)_=_|v.lanes|v.childLanes,v=v.sibling;l.childLanes=_&~h}else l.childLanes=0,l.child=null;return yv(s,l,h,u)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&D(l,_!==null?_.cachePool:null),_!==null?gn(l,_):dn(),rv(l);else return l.lanes=l.childLanes=536870912,yv(s,l,_!==null?_.baseLanes|u:u,u)}else _!==null?(D(l,_.cachePool),gn(l,_),$l(),l.memoizedState=null):(s!==null&&D(l,null),dn(),$l());return ri(s,l,v,u),l.child}function yv(s,l,u,h){var v=M();return v=v===null?null:{parent:Sr._currentValue,pool:v},l.memoizedState={baseLanes:u,cachePool:v},s!==null&&D(l,null),dn(),rv(l),s!==null&&Hl(s,l,h,!0),null}function Sp(s,l){var u=l.ref;if(u===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(s===null||s.ref!==u)&&(l.flags|=4194816)}}function e0(s,l,u,h,v){return Da(l),u=oa(s,l,u,h,void 0,v),h=Fn(),s!==null&&!$r?(Qc(s,l,v),Zo(s,l,v)):(cn&&h&&$c(l),l.flags|=1,ri(s,l,u,v),l.child)}function vv(s,l,u,h,v,_){return Da(l),l.updateQueue=null,u=Yo(l,h,u,v),$s(s),h=Fn(),s!==null&&!$r?(Qc(s,l,_),Zo(s,l,_)):(cn&&h&&$c(l),l.flags|=1,ri(s,l,u,_),l.child)}function bv(s,l,u,h,v){if(Da(l),l.stateNode===null){var _=Or,T=u.contextType;typeof T=="object"&&T!==null&&(_=wr(T)),_=new u(h,_),l.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Qg,l.stateNode=_,_._reactInternals=l,_=l.stateNode,_.props=h,_.state=l.memoizedState,_.refs={},be(l),T=u.contextType,_.context=typeof T=="object"&&T!==null?wr(T):Or,_.state=l.memoizedState,T=u.getDerivedStateFromProps,typeof T=="function"&&(Kg(l,u,T,h),_.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(T=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),T!==_.state&&Qg.enqueueReplaceState(_,_.state,null),ot(l,h,_,v),_t(),_.state=l.memoizedState),typeof _.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(s===null){_=l.stateNode;var Z=l.memoizedProps,pe=lu(u,Z);_.props=pe;var Te=_.context,Ze=u.contextType;T=Or,typeof Ze=="object"&&Ze!==null&&(T=wr(Ze));var nt=u.getDerivedStateFromProps;Ze=typeof nt=="function"||typeof _.getSnapshotBeforeUpdate=="function",Z=l.pendingProps!==Z,Ze||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(Z||Te!==T)&&av(l,_,h,T),Ie=!1;var Pe=l.memoizedState;_.state=Pe,ot(l,h,_,v),_t(),Te=l.memoizedState,Z||Pe!==Te||Ie?(typeof nt=="function"&&(Kg(l,u,nt,h),Te=l.memoizedState),(pe=Ie||iv(l,u,pe,h,Pe,Te,T))?(Ze||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(l.flags|=4194308)):(typeof _.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=Te),_.props=h,_.state=Te,_.context=T,h=pe):(typeof _.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{_=l.stateNode,Ne(s,l),T=l.memoizedProps,Ze=lu(u,T),_.props=Ze,nt=l.pendingProps,Pe=_.context,Te=u.contextType,pe=Or,typeof Te=="object"&&Te!==null&&(pe=wr(Te)),Z=u.getDerivedStateFromProps,(Te=typeof Z=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(T!==nt||Pe!==pe)&&av(l,_,h,pe),Ie=!1,Pe=l.memoizedState,_.state=Pe,ot(l,h,_,v),_t();var Fe=l.memoizedState;T!==nt||Pe!==Fe||Ie||s!==null&&s.dependencies!==null&&nf(s.dependencies)?(typeof Z=="function"&&(Kg(l,u,Z,h),Fe=l.memoizedState),(Ze=Ie||iv(l,u,Ze,h,Pe,Fe,pe)||s!==null&&s.dependencies!==null&&nf(s.dependencies))?(Te||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(h,Fe,pe),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(h,Fe,pe)),typeof _.componentDidUpdate=="function"&&(l.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof _.componentDidUpdate!="function"||T===s.memoizedProps&&Pe===s.memoizedState||(l.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&Pe===s.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=Fe),_.props=h,_.state=Fe,_.context=pe,h=Ze):(typeof _.componentDidUpdate!="function"||T===s.memoizedProps&&Pe===s.memoizedState||(l.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&Pe===s.memoizedState||(l.flags|=1024),h=!1)}return _=h,Sp(s,l),h=(l.flags&128)!==0,_||h?(_=l.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:_.render(),l.flags|=1,s!==null&&h?(l.child=df(l,s.child,null,v),l.child=df(l,null,u,v)):ri(s,l,u,v),l.memoizedState=_.state,s=l.child):s=Zo(s,l,v),s}function xv(s,l,u,h){return ji(),l.flags|=256,ri(s,l,u,h),l.child}var t0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function n0(s){return{baseLanes:s,cachePool:B()}}function r0(s,l,u){return s=s!==null?s.childLanes&~u:0,l&&(s|=Ta),s}function wv(s,l,u){var h=l.pendingProps,v=!1,_=(l.flags&128)!==0,T;if((T=_)||(T=s!==null&&s.memoizedState===null?!1:(zr.current&2)!==0),T&&(v=!0,l.flags&=-129),T=(l.flags&32)!==0,l.flags&=-33,s===null){if(cn){if(v?Gl(l):$l(),cn){var Z=Xn,pe;if(pe=Z){e:{for(pe=Z,Z=Ma;pe.nodeType!==8;){if(!Z){Z=null;break e}if(pe=cs(pe.nextSibling),pe===null){Z=null;break e}}Z=pe}Z!==null?(l.memoizedState={dehydrated:Z,treeContext:Ho!==null?{id:Ja,overflow:es}:null,retryLane:536870912,hydrationErrors:null},pe=Gr(18,null,null,0),pe.stateNode=Z,pe.return=l,l.child=pe,xr=l,Xn=null,pe=!0):pe=!1}pe||qo(l)}if(Z=l.memoizedState,Z!==null&&(Z=Z.dehydrated,Z!==null))return z0(Z)?l.lanes=32:l.lanes=536870912,null;Xo(l)}return Z=h.children,h=h.fallback,v?($l(),v=l.mode,Z=_p({mode:"hidden",children:Z},v),h=Ka(h,v,u,null),Z.return=l,h.return=l,Z.sibling=h,l.child=Z,v=l.child,v.memoizedState=n0(u),v.childLanes=r0(s,T,u),l.memoizedState=t0,h):(Gl(l),i0(l,Z))}if(pe=s.memoizedState,pe!==null&&(Z=pe.dehydrated,Z!==null)){if(_)l.flags&256?(Gl(l),l.flags&=-257,l=a0(s,l,u)):l.memoizedState!==null?($l(),l.child=s.child,l.flags|=128,l=null):($l(),v=h.fallback,Z=l.mode,h=_p({mode:"visible",children:h.children},Z),v=Ka(v,Z,u,null),v.flags|=2,h.return=l,v.return=l,h.sibling=v,l.child=h,df(l,s.child,null,u),h=l.child,h.memoizedState=n0(u),h.childLanes=r0(s,T,u),l.memoizedState=t0,l=v);else if(Gl(l),z0(Z)){if(T=Z.nextSibling&&Z.nextSibling.dataset,T)var Te=T.dgst;T=Te,h=Error(r(419)),h.stack="",h.digest=T,zl({value:h,source:null,stack:null}),l=a0(s,l,u)}else if($r||Hl(s,l,u,!1),T=(u&s.childLanes)!==0,$r||T){if(T=In,T!==null&&(h=u&-u,h=(h&42)!==0?1:Wt(h),h=(h&(T.suspendedLanes|u))!==0?0:h,h!==0&&h!==pe.retryLane))throw pe.retryLane=h,Za(s,h),ha(T,s,h),dv;Z.data==="$?"||_0(),l=a0(s,l,u)}else Z.data==="$?"?(l.flags|=192,l.child=s.child,l=null):(s=pe.treeContext,Xn=cs(Z.nextSibling),xr=l,cn=!0,Ys=null,Ma=!1,s!==null&&(qi[Di++]=Ja,qi[Di++]=es,qi[Di++]=Ho,Ja=s.id,es=s.overflow,Ho=l),l=i0(l,h.children),l.flags|=4096);return l}return v?($l(),v=h.fallback,Z=l.mode,pe=s.child,Te=pe.sibling,h=ka(pe,{mode:"hidden",children:h.children}),h.subtreeFlags=pe.subtreeFlags&65011712,Te!==null?v=ka(Te,v):(v=Ka(v,Z,u,null),v.flags|=2),v.return=l,h.return=l,h.sibling=v,l.child=h,h=v,v=l.child,Z=s.child.memoizedState,Z===null?Z=n0(u):(pe=Z.cachePool,pe!==null?(Te=Sr._currentValue,pe=pe.parent!==Te?{parent:Te,pool:Te}:pe):pe=B(),Z={baseLanes:Z.baseLanes|u,cachePool:pe}),v.memoizedState=Z,v.childLanes=r0(s,T,u),l.memoizedState=t0,h):(Gl(l),u=s.child,s=u.sibling,u=ka(u,{mode:"visible",children:h.children}),u.return=l,u.sibling=null,s!==null&&(T=l.deletions,T===null?(l.deletions=[s],l.flags|=16):T.push(s)),l.child=u,l.memoizedState=null,u)}function i0(s,l){return l=_p({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function _p(s,l){return s=Gr(22,s,null,l),s.lanes=0,s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},s}function a0(s,l,u){return df(l,s.child,null,u),s=i0(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function Sv(s,l,u){s.lanes|=l;var h=s.alternate;h!==null&&(h.lanes|=l),ef(s.return,l,u)}function s0(s,l,u,h,v){var _=s.memoizedState;_===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:v}:(_.isBackwards=l,_.rendering=null,_.renderingStartTime=0,_.last=h,_.tail=u,_.tailMode=v)}function _v(s,l,u){var h=l.pendingProps,v=h.revealOrder,_=h.tail;if(ri(s,l,h.children,u),h=zr.current,(h&2)!==0)h=h&1|2,l.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Sv(s,u,l);else if(s.tag===19)Sv(s,u,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}h&=1}switch(V(zr,h),v){case"forwards":for(u=l.child,v=null;u!==null;)s=u.alternate,s!==null&&bp(s)===null&&(v=u),u=u.sibling;u=v,u===null?(v=l.child,l.child=null):(v=u.sibling,u.sibling=null),s0(l,!1,v,u,_);break;case"backwards":for(u=null,v=l.child,l.child=null;v!==null;){if(s=v.alternate,s!==null&&bp(s)===null){l.child=v;break}s=v.sibling,v.sibling=u,u=v,v=s}s0(l,!0,u,null,_);break;case"together":s0(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Zo(s,l,u){if(s!==null&&(l.dependencies=s.dependencies),Jl|=l.lanes,(u&l.childLanes)===0)if(s!==null){if(Hl(s,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(r(153));if(l.child!==null){for(s=l.child,u=ka(s,s.pendingProps),l.child=u,u.return=l;s.sibling!==null;)s=s.sibling,u=u.sibling=ka(s,s.pendingProps),u.return=l;u.sibling=null}return l.child}function o0(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&nf(s)))}function e6(s,l,u){switch(l.tag){case 3:we(l,l.stateNode.containerInfo),Vs(l,Sr,s.memoizedState.cache),ji();break;case 27:case 5:Ve(l);break;case 4:we(l,l.stateNode.containerInfo);break;case 10:Vs(l,l.type,l.memoizedProps.value);break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(Gl(l),l.flags|=128,null):(u&l.child.childLanes)!==0?wv(s,l,u):(Gl(l),s=Zo(s,l,u),s!==null?s.sibling:null);Gl(l);break;case 19:var v=(s.flags&128)!==0;if(h=(u&l.childLanes)!==0,h||(Hl(s,l,u,!1),h=(u&l.childLanes)!==0),v){if(h)return _v(s,l,u);l.flags|=128}if(v=l.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),V(zr,zr.current),h)break;return null;case 22:case 23:return l.lanes=0,gv(s,l,u);case 24:Vs(l,Sr,s.memoizedState.cache)}return Zo(s,l,u)}function Nv(s,l,u){if(s!==null)if(s.memoizedProps!==l.pendingProps)$r=!0;else{if(!o0(s,u)&&(l.flags&128)===0)return $r=!1,e6(s,l,u);$r=(s.flags&131072)!==0}else $r=!1,cn&&(l.flags&1048576)!==0&&Jh(l,Ju,l.index);switch(l.lanes=0,l.tag){case 16:e:{s=l.pendingProps;var h=l.elementType,v=h._init;if(h=v(h._payload),l.type=h,typeof h=="function")Fl(h)?(s=lu(h,s),l.tag=1,l=bv(null,l,h,s,u)):(l.tag=0,l=e0(null,l,h,s,u));else{if(h!=null){if(v=h.$$typeof,v===z){l.tag=11,l=hv(null,l,h,s,u);break e}else if(v===q){l.tag=14,l=pv(null,l,h,s,u);break e}}throw l=te(h)||h,Error(r(306,l,""))}}return l;case 0:return e0(s,l,l.type,l.pendingProps,u);case 1:return h=l.type,v=lu(h,l.pendingProps),bv(s,l,h,v,u);case 3:e:{if(we(l,l.stateNode.containerInfo),s===null)throw Error(r(387));h=l.pendingProps;var _=l.memoizedState;v=_.element,Ne(s,l),ot(l,h,null,u);var T=l.memoizedState;if(h=T.cache,Vs(l,Sr,h),h!==_.cache&&tf(l,[Sr],u,!0),_t(),h=T.element,_.isDehydrated)if(_={element:h,isDehydrated:!1,cache:T.cache},l.updateQueue.baseState=_,l.memoizedState=_,l.flags&256){l=xv(s,l,h,u);break e}else if(h!==v){v=Xt(Error(r(424)),l),zl(v),l=xv(s,l,h,u);break e}else{switch(s=l.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Xn=cs(s.firstChild),xr=l,cn=!0,Ys=null,Ma=!0,u=nv(l,null,h,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(ji(),h===v){l=Zo(s,l,u);break e}ri(s,l,h,u)}l=l.child}return l;case 26:return Sp(s,l),s===null?(u=Mb(l.type,null,l.pendingProps,null))?l.memoizedState=u:cn||(u=l.type,s=l.pendingProps,h=Bp(ce.current).createElement(u),h[un]=l,h[zn]=s,ai(h,u,s),Sn(h),l.stateNode=h):l.memoizedState=Mb(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return Ve(l),s===null&&cn&&(h=l.stateNode=Ab(l.type,l.pendingProps,ce.current),xr=l,Ma=!0,v=Xn,rc(l.type)?(H0=v,Xn=cs(h.firstChild)):Xn=v),ri(s,l,l.pendingProps.children,u),Sp(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&cn&&((v=h=Xn)&&(h=M6(h,l.type,l.pendingProps,Ma),h!==null?(l.stateNode=h,xr=l,Xn=cs(h.firstChild),Ma=!1,v=!0):v=!1),v||qo(l)),Ve(l),v=l.type,_=l.pendingProps,T=s!==null?s.memoizedProps:null,h=_.children,B0(v,_)?h=null:T!==null&&B0(v,T)&&(l.flags|=32),l.memoizedState!==null&&(v=oa(s,l,Xs,null,null,u),Xd._currentValue=v),Sp(s,l),ri(s,l,h,u),l.child;case 6:return s===null&&cn&&((s=u=Xn)&&(u=L6(u,l.pendingProps,Ma),u!==null?(l.stateNode=u,xr=l,Xn=null,s=!0):s=!1),s||qo(l)),null;case 13:return wv(s,l,u);case 4:return we(l,l.stateNode.containerInfo),h=l.pendingProps,s===null?l.child=df(l,null,h,u):ri(s,l,h,u),l.child;case 11:return hv(s,l,l.type,l.pendingProps,u);case 7:return ri(s,l,l.pendingProps,u),l.child;case 8:return ri(s,l,l.pendingProps.children,u),l.child;case 12:return ri(s,l,l.pendingProps.children,u),l.child;case 10:return h=l.pendingProps,Vs(l,l.type,h.value),ri(s,l,h.children,u),l.child;case 9:return v=l.type._context,h=l.pendingProps.children,Da(l),v=wr(v),h=h(v),l.flags|=1,ri(s,l,h,u),l.child;case 14:return pv(s,l,l.type,l.pendingProps,u);case 15:return mv(s,l,l.type,l.pendingProps,u);case 19:return _v(s,l,u);case 31:return h=l.pendingProps,u=l.mode,h={mode:h.mode,children:h.children},s===null?(u=_p(h,u),u.ref=l.ref,l.child=u,u.return=l,l=u):(u=ka(s.child,h),u.ref=l.ref,l.child=u,u.return=l,l=u),l;case 22:return gv(s,l,u);case 24:return Da(l),h=wr(Sr),s===null?(v=M(),v===null&&(v=In,_=vd(),v.pooledCache=_,_.refCount++,_!==null&&(v.pooledCacheLanes|=u),v=_),l.memoizedState={parent:h,cache:v},be(l),Vs(l,Sr,v)):((s.lanes&u)!==0&&(Ne(s,l),ot(l,null,null,u),_t()),v=s.memoizedState,_=l.memoizedState,v.parent!==h?(v={parent:h,cache:h},l.memoizedState=v,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=v),Vs(l,Sr,h)):(h=_.cache,Vs(l,Sr,h),h!==v.cache&&tf(l,[Sr],u,!0))),ri(s,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Ko(s){s.flags|=4}function Av(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!Ob(l)){if(l=Oa.current,l!==null&&((on&4194048)===on?Qs!==null:(on&62914560)!==on&&(on&536870912)===0||l!==Qs))throw Ee=ee,Y;s.flags|=8192}}function Np(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?Lt():536870912,s.lanes|=l,gf|=l)}function Td(s,l){if(!cn)switch(s.tailMode){case"hidden":l=s.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function sr(s){var l=s.alternate!==null&&s.alternate.child===s.child,u=0,h=0;if(l)for(var v=s.child;v!==null;)u|=v.lanes|v.childLanes,h|=v.subtreeFlags&65011712,h|=v.flags&65011712,v.return=s,v=v.sibling;else for(v=s.child;v!==null;)u|=v.lanes|v.childLanes,h|=v.subtreeFlags,h|=v.flags,v.return=s,v=v.sibling;return s.subtreeFlags|=h,s.childLanes=u,l}function t6(s,l,u){var h=l.pendingProps;switch(Xc(l),l.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sr(l),null;case 1:return sr(l),null;case 3:return u=l.stateNode,h=null,s!==null&&(h=s.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Ea(Sr),Se(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(ti(l)?Ko(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,tp())),sr(l),null;case 26:return u=l.memoizedState,s===null?(Ko(l),u!==null?(sr(l),Av(l,u)):(sr(l),l.flags&=-16777217)):u?u!==s.memoizedState?(Ko(l),sr(l),Av(l,u)):(sr(l),l.flags&=-16777217):(s.memoizedProps!==h&&Ko(l),sr(l),l.flags&=-16777217),null;case 27:He(l),u=ce.current;var v=l.type;if(s!==null&&l.stateNode!=null)s.memoizedProps!==h&&Ko(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return sr(l),null}s=Q.current,ti(l)?ep(l):(s=Ab(v,h,u),l.stateNode=s,Ko(l))}return sr(l),null;case 5:if(He(l),u=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==h&&Ko(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return sr(l),null}if(s=Q.current,ti(l))ep(l);else{switch(v=Bp(ce.current),s){case 1:s=v.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:s=v.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":s=v.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":s=v.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":s=v.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof h.is=="string"?v.createElement("select",{is:h.is}):v.createElement("select"),h.multiple?s.multiple=!0:h.size&&(s.size=h.size);break;default:s=typeof h.is=="string"?v.createElement(u,{is:h.is}):v.createElement(u)}}s[un]=l,s[zn]=h;e:for(v=l.child;v!==null;){if(v.tag===5||v.tag===6)s.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===l)break e;for(;v.sibling===null;){if(v.return===null||v.return===l)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}l.stateNode=s;e:switch(ai(s,u,h),u){case"button":case"input":case"select":case"textarea":s=!!h.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Ko(l)}}return sr(l),l.flags&=-16777217,null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==h&&Ko(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(s=ce.current,ti(l)){if(s=l.stateNode,u=l.memoizedProps,h=null,v=xr,v!==null)switch(v.tag){case 27:case 5:h=v.memoizedProps}s[un]=l,s=!!(s.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||vb(s.nodeValue,u)),s||qo(l)}else s=Bp(s).createTextNode(h),s[un]=l,l.stateNode=s}return sr(l),null;case 13:if(h=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(v=ti(l),h!==null&&h.dehydrated!==null){if(s===null){if(!v)throw Error(r(318));if(v=l.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[un]=l}else ji(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;sr(l),v=!1}else v=tp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=v),v=!0;if(!v)return l.flags&256?(Xo(l),l):(Xo(l),null)}if(Xo(l),(l.flags&128)!==0)return l.lanes=u,l;if(u=h!==null,s=s!==null&&s.memoizedState!==null,u){h=l.child,v=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(v=h.alternate.memoizedState.cachePool.pool);var _=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(_=h.memoizedState.cachePool.pool),_!==v&&(h.flags|=2048)}return u!==s&&u&&(l.child.flags|=8192),Np(l,l.updateQueue),sr(l),null;case 4:return Se(),s===null&&j0(l.stateNode.containerInfo),sr(l),null;case 10:return Ea(l.type),sr(l),null;case 19:if(R(zr),v=l.memoizedState,v===null)return sr(l),null;if(h=(l.flags&128)!==0,_=v.rendering,_===null)if(h)Td(v,!1);else{if(mr!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(_=bp(s),_!==null){for(l.flags|=128,Td(v,!1),s=_.updateQueue,l.updateQueue=s,Np(l,s),l.subtreeFlags=0,s=u,u=l.child;u!==null;)Vc(u,s),u=u.sibling;return V(zr,zr.current&1|2),l.child}s=s.sibling}v.tail!==null&&pt()>kp&&(l.flags|=128,h=!0,Td(v,!1),l.lanes=4194304)}else{if(!h)if(s=bp(_),s!==null){if(l.flags|=128,h=!0,s=s.updateQueue,l.updateQueue=s,Np(l,s),Td(v,!0),v.tail===null&&v.tailMode==="hidden"&&!_.alternate&&!cn)return sr(l),null}else 2*pt()-v.renderingStartTime>kp&&u!==536870912&&(l.flags|=128,h=!0,Td(v,!1),l.lanes=4194304);v.isBackwards?(_.sibling=l.child,l.child=_):(s=v.last,s!==null?s.sibling=_:l.child=_,v.last=_)}return v.tail!==null?(l=v.tail,v.rendering=l,v.tail=l.sibling,v.renderingStartTime=pt(),l.sibling=null,s=zr.current,V(zr,h?s&1|2:s&1),l):(sr(l),null);case 22:case 23:return Xo(l),It(),h=l.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(u&536870912)!==0&&(l.flags&128)===0&&(sr(l),l.subtreeFlags&6&&(l.flags|=8192)):sr(l),u=l.updateQueue,u!==null&&Np(l,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==u&&(l.flags|=2048),s!==null&&R(x),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),Ea(Sr),sr(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function n6(s,l){switch(Xc(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return Ea(Sr),Se(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return He(l),null;case 13:if(Xo(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(r(340));ji()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return R(zr),null;case 4:return Se(),null;case 10:return Ea(l.type),null;case 22:case 23:return Xo(l),It(),s!==null&&R(x),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return Ea(Sr),null;case 25:return null;default:return null}}function Cv(s,l){switch(Xc(l),l.tag){case 3:Ea(Sr),Se();break;case 26:case 27:case 5:He(l);break;case 4:Se();break;case 13:Xo(l);break;case 19:R(zr);break;case 10:Ea(l.type);break;case 22:case 23:Xo(l),It(),s!==null&&R(x);break;case 24:Ea(Sr)}}function Rd(s,l){try{var u=l.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var v=h.next;u=v;do{if((u.tag&s)===s){h=void 0;var _=u.create,T=u.inst;h=_(),T.destroy=h}u=u.next}while(u!==v)}}catch(Z){Tn(l,l.return,Z)}}function Xl(s,l,u){try{var h=l.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var _=v.next;h=_;do{if((h.tag&s)===s){var T=h.inst,Z=T.destroy;if(Z!==void 0){T.destroy=void 0,v=l;var pe=u,Te=Z;try{Te()}catch(Ze){Tn(v,pe,Ze)}}}h=h.next}while(h!==_)}}catch(Ze){Tn(l,l.return,Ze)}}function kv(s){var l=s.updateQueue;if(l!==null){var u=s.stateNode;try{fn(l,u)}catch(h){Tn(s,s.return,h)}}}function Mv(s,l,u){u.props=lu(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(h){Tn(s,l,h)}}function Pd(s,l){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof u=="function"?s.refCleanup=u(h):u.current=h}}catch(v){Tn(s,l,v)}}function Js(s,l){var u=s.ref,h=s.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(v){Tn(s,l,v)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(v){Tn(s,l,v)}else u.current=null}function Lv(s){var l=s.type,u=s.memoizedProps,h=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(v){Tn(s,s.return,v)}}function l0(s,l,u){try{var h=s.stateNode;_6(h,s.type,u,l),h[zn]=l}catch(v){Tn(s,s.return,v)}}function Ev(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&rc(s.type)||s.tag===4}function c0(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Ev(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&rc(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function u0(s,l,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(s),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=Pp));else if(h!==4&&(h===27&&rc(s.type)&&(u=s.stateNode,l=null),s=s.child,s!==null))for(u0(s,l,u),s=s.sibling;s!==null;)u0(s,l,u),s=s.sibling}function Ap(s,l,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?u.insertBefore(s,l):u.appendChild(s);else if(h!==4&&(h===27&&rc(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(Ap(s,l,u),s=s.sibling;s!==null;)Ap(s,l,u),s=s.sibling}function Dv(s){var l=s.stateNode,u=s.memoizedProps;try{for(var h=s.type,v=l.attributes;v.length;)l.removeAttributeNode(v[0]);ai(l,h,u),l[un]=s,l[zn]=u}catch(_){Tn(s,s.return,_)}}var Qo=!1,Nr=!1,f0=!1,jv=typeof WeakSet=="function"?WeakSet:Set,Xr=null;function r6(s,l){if(s=s.containerInfo,R0=qp,s=ei(s),Ir(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var v=h.anchorOffset,_=h.focusNode;h=h.focusOffset;try{u.nodeType,_.nodeType}catch{u=null;break e}var T=0,Z=-1,pe=-1,Te=0,Ze=0,nt=s,Pe=null;t:for(;;){for(var Fe;nt!==u||v!==0&&nt.nodeType!==3||(Z=T+v),nt!==_||h!==0&&nt.nodeType!==3||(pe=T+h),nt.nodeType===3&&(T+=nt.nodeValue.length),(Fe=nt.firstChild)!==null;)Pe=nt,nt=Fe;for(;;){if(nt===s)break t;if(Pe===u&&++Te===v&&(Z=T),Pe===_&&++Ze===h&&(pe=T),(Fe=nt.nextSibling)!==null)break;nt=Pe,Pe=nt.parentNode}nt=Fe}u=Z===-1||pe===-1?null:{start:Z,end:pe}}else u=null}u=u||{start:0,end:0}}else u=null;for(P0={focusedElem:s,selectionRange:u},qp=!1,Xr=l;Xr!==null;)if(l=Xr,s=l.child,(l.subtreeFlags&1024)!==0&&s!==null)s.return=l,Xr=s;else for(;Xr!==null;){switch(l=Xr,_=l.alternate,s=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((s&1024)!==0&&_!==null){s=void 0,u=l,v=_.memoizedProps,_=_.memoizedState,h=u.stateNode;try{var Bt=lu(u.type,v,u.elementType===u.type);s=h.getSnapshotBeforeUpdate(Bt,_),h.__reactInternalSnapshotBeforeUpdate=s}catch(Et){Tn(u,u.return,Et)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,u=s.nodeType,u===9)I0(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":I0(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=l.sibling,s!==null){s.return=l.return,Xr=s;break}Xr=l.return}}function Ov(s,l,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Zl(s,u),h&4&&Rd(5,u);break;case 1:if(Zl(s,u),h&4)if(s=u.stateNode,l===null)try{s.componentDidMount()}catch(T){Tn(u,u.return,T)}else{var v=lu(u.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(v,l,s.__reactInternalSnapshotBeforeUpdate)}catch(T){Tn(u,u.return,T)}}h&64&&kv(u),h&512&&Pd(u,u.return);break;case 3:if(Zl(s,u),h&64&&(s=u.updateQueue,s!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{fn(s,l)}catch(T){Tn(u,u.return,T)}}break;case 27:l===null&&h&4&&Dv(u);case 26:case 5:Zl(s,u),l===null&&h&4&&Lv(u),h&512&&Pd(u,u.return);break;case 12:Zl(s,u);break;case 13:Zl(s,u),h&4&&Pv(s,u),h&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=d6.bind(null,u),E6(s,u))));break;case 22:if(h=u.memoizedState!==null||Qo,!h){l=l!==null&&l.memoizedState!==null||Nr,v=Qo;var _=Nr;Qo=h,(Nr=l)&&!_?Kl(s,u,(u.subtreeFlags&8772)!==0):Zl(s,u),Qo=v,Nr=_}break;case 30:break;default:Zl(s,u)}}function Tv(s){var l=s.alternate;l!==null&&(s.alternate=null,Tv(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&Ci(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Zn=null,Yi=!1;function Jo(s,l,u){for(u=u.child;u!==null;)Rv(s,l,u),u=u.sibling}function Rv(s,l,u){if(Le&&typeof Le.onCommitFiberUnmount=="function")try{Le.onCommitFiberUnmount(Be,u)}catch{}switch(u.tag){case 26:Nr||Js(u,l),Jo(s,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Nr||Js(u,l);var h=Zn,v=Yi;rc(u.type)&&(Zn=u.stateNode,Yi=!1),Jo(s,l,u),Yd(u.stateNode),Zn=h,Yi=v;break;case 5:Nr||Js(u,l);case 6:if(h=Zn,v=Yi,Zn=null,Jo(s,l,u),Zn=h,Yi=v,Zn!==null)if(Yi)try{(Zn.nodeType===9?Zn.body:Zn.nodeName==="HTML"?Zn.ownerDocument.body:Zn).removeChild(u.stateNode)}catch(_){Tn(u,l,_)}else try{Zn.removeChild(u.stateNode)}catch(_){Tn(u,l,_)}break;case 18:Zn!==null&&(Yi?(s=Zn,_b(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),Jd(s)):_b(Zn,u.stateNode));break;case 4:h=Zn,v=Yi,Zn=u.stateNode.containerInfo,Yi=!0,Jo(s,l,u),Zn=h,Yi=v;break;case 0:case 11:case 14:case 15:Nr||Xl(2,u,l),Nr||Xl(4,u,l),Jo(s,l,u);break;case 1:Nr||(Js(u,l),h=u.stateNode,typeof h.componentWillUnmount=="function"&&Mv(u,l,h)),Jo(s,l,u);break;case 21:Jo(s,l,u);break;case 22:Nr=(h=Nr)||u.memoizedState!==null,Jo(s,l,u),Nr=h;break;default:Jo(s,l,u)}}function Pv(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Jd(s)}catch(u){Tn(l,l.return,u)}}function i6(s){switch(s.tag){case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new jv),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new jv),l;default:throw Error(r(435,s.tag))}}function d0(s,l){var u=i6(s);l.forEach(function(h){var v=h6.bind(null,s,h);u.has(h)||(u.add(h),h.then(v,v))})}function ca(s,l){var u=l.deletions;if(u!==null)for(var h=0;h<u.length;h++){var v=u[h],_=s,T=l,Z=T;e:for(;Z!==null;){switch(Z.tag){case 27:if(rc(Z.type)){Zn=Z.stateNode,Yi=!1;break e}break;case 5:Zn=Z.stateNode,Yi=!1;break e;case 3:case 4:Zn=Z.stateNode.containerInfo,Yi=!0;break e}Z=Z.return}if(Zn===null)throw Error(r(160));Rv(_,T,v),Zn=null,Yi=!1,_=v.alternate,_!==null&&(_.return=null),v.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)Bv(l,s),l=l.sibling}var ls=null;function Bv(s,l){var u=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:ca(l,s),ua(s),h&4&&(Xl(3,s,s.return),Rd(3,s),Xl(5,s,s.return));break;case 1:ca(l,s),ua(s),h&512&&(Nr||u===null||Js(u,u.return)),h&64&&Qo&&(s=s.updateQueue,s!==null&&(h=s.callbacks,h!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var v=ls;if(ca(l,s),ua(s),h&512&&(Nr||u===null||Js(u,u.return)),h&4){var _=u!==null?u.memoizedState:null;if(h=s.memoizedState,u===null)if(h===null)if(s.stateNode===null){e:{h=s.type,u=s.memoizedProps,v=v.ownerDocument||v;t:switch(h){case"title":_=v.getElementsByTagName("title")[0],(!_||_[Ai]||_[un]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=v.createElement(h),v.head.insertBefore(_,v.querySelector("head > title"))),ai(_,h,u),_[un]=s,Sn(_),h=_;break e;case"link":var T=Db("link","href",v).get(h+(u.href||""));if(T){for(var Z=0;Z<T.length;Z++)if(_=T[Z],_.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&_.getAttribute("rel")===(u.rel==null?null:u.rel)&&_.getAttribute("title")===(u.title==null?null:u.title)&&_.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){T.splice(Z,1);break t}}_=v.createElement(h),ai(_,h,u),v.head.appendChild(_);break;case"meta":if(T=Db("meta","content",v).get(h+(u.content||""))){for(Z=0;Z<T.length;Z++)if(_=T[Z],_.getAttribute("content")===(u.content==null?null:""+u.content)&&_.getAttribute("name")===(u.name==null?null:u.name)&&_.getAttribute("property")===(u.property==null?null:u.property)&&_.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&_.getAttribute("charset")===(u.charSet==null?null:u.charSet)){T.splice(Z,1);break t}}_=v.createElement(h),ai(_,h,u),v.head.appendChild(_);break;default:throw Error(r(468,h))}_[un]=s,Sn(_),h=_}s.stateNode=h}else jb(v,s.type,s.stateNode);else s.stateNode=Eb(v,h,s.memoizedProps);else _!==h?(_===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):_.count--,h===null?jb(v,s.type,s.stateNode):Eb(v,h,s.memoizedProps)):h===null&&s.stateNode!==null&&l0(s,s.memoizedProps,u.memoizedProps)}break;case 27:ca(l,s),ua(s),h&512&&(Nr||u===null||Js(u,u.return)),u!==null&&h&4&&l0(s,s.memoizedProps,u.memoizedProps);break;case 5:if(ca(l,s),ua(s),h&512&&(Nr||u===null||Js(u,u.return)),s.flags&32){v=s.stateNode;try{Cs(v,"")}catch(Fe){Tn(s,s.return,Fe)}}h&4&&s.stateNode!=null&&(v=s.memoizedProps,l0(s,v,u!==null?u.memoizedProps:v)),h&1024&&(f0=!0);break;case 6:if(ca(l,s),ua(s),h&4){if(s.stateNode===null)throw Error(r(162));h=s.memoizedProps,u=s.stateNode;try{u.nodeValue=h}catch(Fe){Tn(s,s.return,Fe)}}break;case 3:if(zp=null,v=ls,ls=Fp(l.containerInfo),ca(l,s),ls=v,ua(s),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Jd(l.containerInfo)}catch(Fe){Tn(s,s.return,Fe)}f0&&(f0=!1,Fv(s));break;case 4:h=ls,ls=Fp(s.stateNode.containerInfo),ca(l,s),ua(s),ls=h;break;case 12:ca(l,s),ua(s);break;case 13:ca(l,s),ua(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(v0=pt()),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,d0(s,h)));break;case 22:v=s.memoizedState!==null;var pe=u!==null&&u.memoizedState!==null,Te=Qo,Ze=Nr;if(Qo=Te||v,Nr=Ze||pe,ca(l,s),Nr=Ze,Qo=Te,ua(s),h&8192)e:for(l=s.stateNode,l._visibility=v?l._visibility&-2:l._visibility|1,v&&(u===null||pe||Qo||Nr||cu(s)),u=null,l=s;;){if(l.tag===5||l.tag===26){if(u===null){pe=u=l;try{if(_=pe.stateNode,v)T=_.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{Z=pe.stateNode;var nt=pe.memoizedProps.style,Pe=nt!=null&&nt.hasOwnProperty("display")?nt.display:null;Z.style.display=Pe==null||typeof Pe=="boolean"?"":(""+Pe).trim()}}catch(Fe){Tn(pe,pe.return,Fe)}}}else if(l.tag===6){if(u===null){pe=l;try{pe.stateNode.nodeValue=v?"":pe.memoizedProps}catch(Fe){Tn(pe,pe.return,Fe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=s.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,d0(s,u))));break;case 19:ca(l,s),ua(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,d0(s,h)));break;case 30:break;case 21:break;default:ca(l,s),ua(s)}}function ua(s){var l=s.flags;if(l&2){try{for(var u,h=s.return;h!==null;){if(Ev(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var v=u.stateNode,_=c0(s);Ap(s,_,v);break;case 5:var T=u.stateNode;u.flags&32&&(Cs(T,""),u.flags&=-33);var Z=c0(s);Ap(s,Z,T);break;case 3:case 4:var pe=u.stateNode.containerInfo,Te=c0(s);u0(s,Te,pe);break;default:throw Error(r(161))}}catch(Ze){Tn(s,s.return,Ze)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function Fv(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;Fv(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function Zl(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Ov(s,l.alternate,l),l=l.sibling}function cu(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:Xl(4,l,l.return),cu(l);break;case 1:Js(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&Mv(l,l.return,u),cu(l);break;case 27:Yd(l.stateNode);case 26:case 5:Js(l,l.return),cu(l);break;case 22:l.memoizedState===null&&cu(l);break;case 30:cu(l);break;default:cu(l)}s=s.sibling}}function Kl(s,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,v=s,_=l,T=_.flags;switch(_.tag){case 0:case 11:case 15:Kl(v,_,u),Rd(4,_);break;case 1:if(Kl(v,_,u),h=_,v=h.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(Te){Tn(h,h.return,Te)}if(h=_,v=h.updateQueue,v!==null){var Z=h.stateNode;try{var pe=v.shared.hiddenCallbacks;if(pe!==null)for(v.shared.hiddenCallbacks=null,v=0;v<pe.length;v++)an(pe[v],Z)}catch(Te){Tn(h,h.return,Te)}}u&&T&64&&kv(_),Pd(_,_.return);break;case 27:Dv(_);case 26:case 5:Kl(v,_,u),u&&h===null&&T&4&&Lv(_),Pd(_,_.return);break;case 12:Kl(v,_,u);break;case 13:Kl(v,_,u),u&&T&4&&Pv(v,_);break;case 22:_.memoizedState===null&&Kl(v,_,u),Pd(_,_.return);break;case 30:break;default:Kl(v,_,u)}l=l.sibling}}function h0(s,l){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&Zc(u))}function p0(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Zc(s))}function eo(s,l,u,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Iv(s,l,u,h),l=l.sibling}function Iv(s,l,u,h){var v=l.flags;switch(l.tag){case 0:case 11:case 15:eo(s,l,u,h),v&2048&&Rd(9,l);break;case 1:eo(s,l,u,h);break;case 3:eo(s,l,u,h),v&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Zc(s)));break;case 12:if(v&2048){eo(s,l,u,h),s=l.stateNode;try{var _=l.memoizedProps,T=_.id,Z=_.onPostCommit;typeof Z=="function"&&Z(T,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(pe){Tn(l,l.return,pe)}}else eo(s,l,u,h);break;case 13:eo(s,l,u,h);break;case 23:break;case 22:_=l.stateNode,T=l.alternate,l.memoizedState!==null?_._visibility&2?eo(s,l,u,h):Bd(s,l):_._visibility&2?eo(s,l,u,h):(_._visibility|=2,hf(s,l,u,h,(l.subtreeFlags&10256)!==0)),v&2048&&h0(T,l);break;case 24:eo(s,l,u,h),v&2048&&p0(l.alternate,l);break;default:eo(s,l,u,h)}}function hf(s,l,u,h,v){for(v=v&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var _=s,T=l,Z=u,pe=h,Te=T.flags;switch(T.tag){case 0:case 11:case 15:hf(_,T,Z,pe,v),Rd(8,T);break;case 23:break;case 22:var Ze=T.stateNode;T.memoizedState!==null?Ze._visibility&2?hf(_,T,Z,pe,v):Bd(_,T):(Ze._visibility|=2,hf(_,T,Z,pe,v)),v&&Te&2048&&h0(T.alternate,T);break;case 24:hf(_,T,Z,pe,v),v&&Te&2048&&p0(T.alternate,T);break;default:hf(_,T,Z,pe,v)}l=l.sibling}}function Bd(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=s,h=l,v=h.flags;switch(h.tag){case 22:Bd(u,h),v&2048&&h0(h.alternate,h);break;case 24:Bd(u,h),v&2048&&p0(h.alternate,h);break;default:Bd(u,h)}l=l.sibling}}var Fd=8192;function pf(s){if(s.subtreeFlags&Fd)for(s=s.child;s!==null;)zv(s),s=s.sibling}function zv(s){switch(s.tag){case 26:pf(s),s.flags&Fd&&s.memoizedState!==null&&q6(ls,s.memoizedState,s.memoizedProps);break;case 5:pf(s);break;case 3:case 4:var l=ls;ls=Fp(s.stateNode.containerInfo),pf(s),ls=l;break;case 22:s.memoizedState===null&&(l=s.alternate,l!==null&&l.memoizedState!==null?(l=Fd,Fd=16777216,pf(s),Fd=l):pf(s));break;default:pf(s)}}function Hv(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function Id(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Xr=h,qv(h,s)}Hv(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Uv(s),s=s.sibling}function Uv(s){switch(s.tag){case 0:case 11:case 15:Id(s),s.flags&2048&&Xl(9,s,s.return);break;case 3:Id(s);break;case 12:Id(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,Cp(s)):Id(s);break;default:Id(s)}}function Cp(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Xr=h,qv(h,s)}Hv(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:Xl(8,l,l.return),Cp(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,Cp(l));break;default:Cp(l)}s=s.sibling}}function qv(s,l){for(;Xr!==null;){var u=Xr;switch(u.tag){case 0:case 11:case 15:Xl(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Zc(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,Xr=h;else e:for(u=s;Xr!==null;){h=Xr;var v=h.sibling,_=h.return;if(Tv(h),h===u){Xr=null;break e}if(v!==null){v.return=_,Xr=v;break e}Xr=_}}}var a6={getCacheForType:function(s){var l=wr(Sr),u=l.data.get(s);return u===void 0&&(u=s(),l.data.set(s,u)),u}},s6=typeof WeakMap=="function"?WeakMap:Map,Nn=0,In=null,en=null,on=0,An=0,fa=null,Ql=!1,mf=!1,m0=!1,el=0,mr=0,Jl=0,uu=0,g0=0,Ta=0,gf=0,zd=null,Vi=null,y0=!1,v0=0,kp=1/0,Mp=null,ec=null,ii=0,tc=null,yf=null,vf=0,b0=0,x0=null,Wv=null,Hd=0,w0=null;function da(){if((Nn&2)!==0&&on!==0)return on&-on;if(X.T!==null){var s=Wo;return s!==0?s:M0()}return _i()}function Yv(){Ta===0&&(Ta=(on&536870912)===0||cn?nn():536870912);var s=Oa.current;return s!==null&&(s.flags|=32),Ta}function ha(s,l,u){(s===In&&(An===2||An===9)||s.cancelPendingCommit!==null)&&(bf(s,0),nc(s,on,Ta,!1)),jn(s,u),((Nn&2)===0||s!==In)&&(s===In&&((Nn&2)===0&&(uu|=u),mr===4&&nc(s,on,Ta,!1)),to(s))}function Vv(s,l,u){if((Nn&6)!==0)throw Error(r(327));var h=!u&&(l&124)===0&&(l&s.expiredLanes)===0||ur(s,l),v=h?c6(s,l):N0(s,l,!0),_=h;do{if(v===0){mf&&!h&&nc(s,l,0,!1);break}else{if(u=s.current.alternate,_&&!o6(u)){v=N0(s,l,!1),_=!1;continue}if(v===2){if(_=l,s.errorRecoveryDisabledLanes&_)var T=0;else T=s.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){l=T;e:{var Z=s;v=zd;var pe=Z.current.memoizedState.isDehydrated;if(pe&&(bf(Z,T).flags|=256),T=N0(Z,T,!1),T!==2){if(m0&&!pe){Z.errorRecoveryDisabledLanes|=_,uu|=_,v=4;break e}_=Vi,Vi=v,_!==null&&(Vi===null?Vi=_:Vi.push.apply(Vi,_))}v=T}if(_=!1,v!==2)continue}}if(v===1){bf(s,0),nc(s,l,0,!0);break}e:{switch(h=s,_=v,_){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:nc(h,l,Ta,!Ql);break e;case 2:Vi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(v=v0+300-pt(),10<v)){if(nc(h,l,Ta,!Ql),Gt(h,0,!0)!==0)break e;h.timeoutHandle=wb(Gv.bind(null,h,u,Vi,Mp,y0,l,Ta,uu,gf,Ql,_,2,-0,0),v);break e}Gv(h,u,Vi,Mp,y0,l,Ta,uu,gf,Ql,_,0,-0,0)}}break}while(!0);to(s)}function Gv(s,l,u,h,v,_,T,Z,pe,Te,Ze,nt,Pe,Fe){if(s.timeoutHandle=-1,nt=l.subtreeFlags,(nt&8192||(nt&16785408)===16785408)&&($d={stylesheets:null,count:0,unsuspend:U6},zv(l),nt=W6(),nt!==null)){s.cancelPendingCommit=nt(eb.bind(null,s,l,_,u,h,v,T,Z,pe,Ze,1,Pe,Fe)),nc(s,_,T,!Te);return}eb(s,l,_,u,h,v,T,Z,pe)}function o6(s){for(var l=s;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var v=u[h],_=v.getSnapshot;v=v.value;try{if(!jr(_(),v))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function nc(s,l,u,h){l&=~g0,l&=~uu,s.suspendedLanes|=l,s.pingedLanes&=~l,h&&(s.warmLanes|=l),h=s.expirationTimes;for(var v=l;0<v;){var _=31-qe(v),T=1<<_;h[_]=-1,v&=~T}u!==0&&mt(s,u,l)}function Lp(){return(Nn&6)===0?(Ud(0),!1):!0}function S0(){if(en!==null){if(An===0)var s=en.return;else s=en,ns=Tr=null,af(s),ff=null,jd=0,s=en;for(;s!==null;)Cv(s.alternate,s),s=s.return;en=null}}function bf(s,l){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,A6(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),S0(),In=s,en=u=ka(s.current,null),on=l,An=0,fa=null,Ql=!1,mf=ur(s,l),m0=!1,gf=Ta=g0=uu=Jl=mr=0,Vi=zd=null,y0=!1,(l&8)!==0&&(l|=l&32);var h=s.entangledLanes;if(h!==0)for(s=s.entanglements,h&=l;0<h;){var v=31-qe(h),_=1<<v;l|=s[v],h&=~_}return el=l,Hi(),u}function $v(s,l){kt=null,X.H=gp,l===U||l===$?(l=Ae(),An=3):l===Y?(l=Ae(),An=4):An=l===dv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,fa=l,en===null&&(mr=1,wp(s,Xt(l,s.current)))}function Xv(){var s=X.H;return X.H=gp,s===null?gp:s}function Zv(){var s=X.A;return X.A=a6,s}function _0(){mr=4,Ql||(on&4194048)!==on&&Oa.current!==null||(mf=!0),(Jl&134217727)===0&&(uu&134217727)===0||In===null||nc(In,on,Ta,!1)}function N0(s,l,u){var h=Nn;Nn|=2;var v=Xv(),_=Zv();(In!==s||on!==l)&&(Mp=null,bf(s,l)),l=!1;var T=mr;e:do try{if(An!==0&&en!==null){var Z=en,pe=fa;switch(An){case 8:S0(),T=6;break e;case 3:case 2:case 9:case 6:Oa.current===null&&(l=!0);var Te=An;if(An=0,fa=null,xf(s,Z,pe,Te),u&&mf){T=0;break e}break;default:Te=An,An=0,fa=null,xf(s,Z,pe,Te)}}l6(),T=mr;break}catch(Ze){$v(s,Ze)}while(!0);return l&&s.shellSuspendCounter++,ns=Tr=null,Nn=h,X.H=v,X.A=_,en===null&&(In=null,on=0,Hi()),T}function l6(){for(;en!==null;)Kv(en)}function c6(s,l){var u=Nn;Nn|=2;var h=Xv(),v=Zv();In!==s||on!==l?(Mp=null,kp=pt()+500,bf(s,l)):mf=ur(s,l);e:do try{if(An!==0&&en!==null){l=en;var _=fa;t:switch(An){case 1:An=0,fa=null,xf(s,l,_,1);break;case 2:case 9:if(re(_)){An=0,fa=null,Qv(l);break}l=function(){An!==2&&An!==9||In!==s||(An=7),to(s)},_.then(l,l);break e;case 3:An=7;break e;case 4:An=5;break e;case 7:re(_)?(An=0,fa=null,Qv(l)):(An=0,fa=null,xf(s,l,_,7));break;case 5:var T=null;switch(en.tag){case 26:T=en.memoizedState;case 5:case 27:var Z=en;if(!T||Ob(T)){An=0,fa=null;var pe=Z.sibling;if(pe!==null)en=pe;else{var Te=Z.return;Te!==null?(en=Te,Ep(Te)):en=null}break t}}An=0,fa=null,xf(s,l,_,5);break;case 6:An=0,fa=null,xf(s,l,_,6);break;case 8:S0(),mr=6;break e;default:throw Error(r(462))}}u6();break}catch(Ze){$v(s,Ze)}while(!0);return ns=Tr=null,X.H=h,X.A=v,Nn=u,en!==null?0:(In=null,on=0,Hi(),mr)}function u6(){for(;en!==null&&!ze();)Kv(en)}function Kv(s){var l=Nv(s.alternate,s,el);s.memoizedProps=s.pendingProps,l===null?Ep(s):en=l}function Qv(s){var l=s,u=l.alternate;switch(l.tag){case 15:case 0:l=vv(u,l,l.pendingProps,l.type,void 0,on);break;case 11:l=vv(u,l,l.pendingProps,l.type.render,l.ref,on);break;case 5:af(l);default:Cv(u,l),l=en=Vc(l,el),l=Nv(u,l,el)}s.memoizedProps=s.pendingProps,l===null?Ep(s):en=l}function xf(s,l,u,h){ns=Tr=null,af(l),ff=null,jd=0;var v=l.return;try{if(JN(s,v,l,u,on)){mr=1,wp(s,Xt(u,s.current)),en=null;return}}catch(_){if(v!==null)throw en=v,_;mr=1,wp(s,Xt(u,s.current)),en=null;return}l.flags&32768?(cn||h===1?s=!0:mf||(on&536870912)!==0?s=!1:(Ql=s=!0,(h===2||h===9||h===3||h===6)&&(h=Oa.current,h!==null&&h.tag===13&&(h.flags|=16384))),Jv(l,s)):Ep(l)}function Ep(s){var l=s;do{if((l.flags&32768)!==0){Jv(l,Ql);return}s=l.return;var u=t6(l.alternate,l,el);if(u!==null){en=u;return}if(l=l.sibling,l!==null){en=l;return}en=l=s}while(l!==null);mr===0&&(mr=5)}function Jv(s,l){do{var u=n6(s.alternate,s);if(u!==null){u.flags&=32767,en=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(s=s.sibling,s!==null)){en=s;return}en=s=u}while(s!==null);mr=6,en=null}function eb(s,l,u,h,v,_,T,Z,pe){s.cancelPendingCommit=null;do Dp();while(ii!==0);if((Nn&6)!==0)throw Error(r(327));if(l!==null){if(l===s.current)throw Error(r(177));if(_=l.lanes|l.childLanes,_|=rr,wn(s,u,_,T,Z,pe),s===In&&(en=In=null,on=0),yf=l,tc=s,vf=u,b0=_,x0=v,Wv=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,p6(Oe,function(){return ab(),null})):(s.callbackNode=null,s.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=X.T,X.T=null,v=J.p,J.p=2,T=Nn,Nn|=4;try{r6(s,l,u)}finally{Nn=T,J.p=v,X.T=h}}ii=1,tb(),nb(),rb()}}function tb(){if(ii===1){ii=0;var s=tc,l=yf,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=X.T,X.T=null;var h=J.p;J.p=2;var v=Nn;Nn|=4;try{Bv(l,s);var _=P0,T=ei(s.containerInfo),Z=_.focusedElem,pe=_.selectionRange;if(T!==Z&&Z&&Z.ownerDocument&&Ps(Z.ownerDocument.documentElement,Z)){if(pe!==null&&Ir(Z)){var Te=pe.start,Ze=pe.end;if(Ze===void 0&&(Ze=Te),"selectionStart"in Z)Z.selectionStart=Te,Z.selectionEnd=Math.min(Ze,Z.value.length);else{var nt=Z.ownerDocument||document,Pe=nt&&nt.defaultView||window;if(Pe.getSelection){var Fe=Pe.getSelection(),Bt=Z.textContent.length,Et=Math.min(pe.start,Bt),En=pe.end===void 0?Et:Math.min(pe.end,Bt);!Fe.extend&&Et>En&&(T=En,En=Et,Et=T);var ke=$a(Z,Et),_e=$a(Z,En);if(ke&&_e&&(Fe.rangeCount!==1||Fe.anchorNode!==ke.node||Fe.anchorOffset!==ke.offset||Fe.focusNode!==_e.node||Fe.focusOffset!==_e.offset)){var De=nt.createRange();De.setStart(ke.node,ke.offset),Fe.removeAllRanges(),Et>En?(Fe.addRange(De),Fe.extend(_e.node,_e.offset)):(De.setEnd(_e.node,_e.offset),Fe.addRange(De))}}}}for(nt=[],Fe=Z;Fe=Fe.parentNode;)Fe.nodeType===1&&nt.push({element:Fe,left:Fe.scrollLeft,top:Fe.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<nt.length;Z++){var Qe=nt[Z];Qe.element.scrollLeft=Qe.left,Qe.element.scrollTop=Qe.top}}qp=!!R0,P0=R0=null}finally{Nn=v,J.p=h,X.T=u}}s.current=l,ii=2}}function nb(){if(ii===2){ii=0;var s=tc,l=yf,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=X.T,X.T=null;var h=J.p;J.p=2;var v=Nn;Nn|=4;try{Ov(s,l.alternate,l)}finally{Nn=v,J.p=h,X.T=u}}ii=3}}function rb(){if(ii===4||ii===3){ii=0,ue();var s=tc,l=yf,u=vf,h=Wv;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?ii=5:(ii=0,yf=tc=null,ib(s,s.pendingLanes));var v=s.pendingLanes;if(v===0&&(ec=null),Jn(u),l=l.stateNode,Le&&typeof Le.onCommitFiberRoot=="function")try{Le.onCommitFiberRoot(Be,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=X.T,v=J.p,J.p=2,X.T=null;try{for(var _=s.onRecoverableError,T=0;T<h.length;T++){var Z=h[T];_(Z.value,{componentStack:Z.stack})}}finally{X.T=l,J.p=v}}(vf&3)!==0&&Dp(),to(s),v=s.pendingLanes,(u&4194090)!==0&&(v&42)!==0?s===w0?Hd++:(Hd=0,w0=s):Hd=0,Ud(0)}}function ib(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,Zc(l)))}function Dp(s){return tb(),nb(),rb(),ab()}function ab(){if(ii!==5)return!1;var s=tc,l=b0;b0=0;var u=Jn(vf),h=X.T,v=J.p;try{J.p=32>u?32:u,X.T=null,u=x0,x0=null;var _=tc,T=vf;if(ii=0,yf=tc=null,vf=0,(Nn&6)!==0)throw Error(r(331));var Z=Nn;if(Nn|=4,Uv(_.current),Iv(_,_.current,T,u),Nn=Z,Ud(0,!1),Le&&typeof Le.onPostCommitFiberRoot=="function")try{Le.onPostCommitFiberRoot(Be,_)}catch{}return!0}finally{J.p=v,X.T=h,ib(s,l)}}function sb(s,l,u){l=Xt(u,l),l=Jg(s.stateNode,l,2),s=tt(s,l,2),s!==null&&(jn(s,2),to(s))}function Tn(s,l,u){if(s.tag===3)sb(s,s,u);else for(;l!==null;){if(l.tag===3){sb(l,s,u);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ec===null||!ec.has(h))){s=Xt(u,s),u=uv(2),h=tt(l,u,2),h!==null&&(fv(u,h,l,s),jn(h,2),to(h));break}}l=l.return}}function A0(s,l,u){var h=s.pingCache;if(h===null){h=s.pingCache=new s6;var v=new Set;h.set(l,v)}else v=h.get(l),v===void 0&&(v=new Set,h.set(l,v));v.has(u)||(m0=!0,v.add(u),s=f6.bind(null,s,l,u),l.then(s,s))}function f6(s,l,u){var h=s.pingCache;h!==null&&h.delete(l),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,In===s&&(on&u)===u&&(mr===4||mr===3&&(on&62914560)===on&&300>pt()-v0?(Nn&2)===0&&bf(s,0):g0|=u,gf===on&&(gf=0)),to(s)}function ob(s,l){l===0&&(l=Lt()),s=Za(s,l),s!==null&&(jn(s,l),to(s))}function d6(s){var l=s.memoizedState,u=0;l!==null&&(u=l.retryLane),ob(s,u)}function h6(s,l){var u=0;switch(s.tag){case 13:var h=s.stateNode,v=s.memoizedState;v!==null&&(u=v.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),ob(s,u)}function p6(s,l){return it(s,l)}var jp=null,wf=null,C0=!1,Op=!1,k0=!1,fu=0;function to(s){s!==wf&&s.next===null&&(wf===null?jp=wf=s:wf=wf.next=s),Op=!0,C0||(C0=!0,g6())}function Ud(s,l){if(!k0&&Op){k0=!0;do for(var u=!1,h=jp;h!==null;){if(s!==0){var v=h.pendingLanes;if(v===0)var _=0;else{var T=h.suspendedLanes,Z=h.pingedLanes;_=(1<<31-qe(42|s)+1)-1,_&=v&~(T&~Z),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(u=!0,fb(h,_))}else _=on,_=Gt(h,h===In?_:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(_&3)===0||ur(h,_)||(u=!0,fb(h,_));h=h.next}while(u);k0=!1}}function m6(){lb()}function lb(){Op=C0=!1;var s=0;fu!==0&&(N6()&&(s=fu),fu=0);for(var l=pt(),u=null,h=jp;h!==null;){var v=h.next,_=cb(h,l);_===0?(h.next=null,u===null?jp=v:u.next=v,v===null&&(wf=u)):(u=h,(s!==0||(_&3)!==0)&&(Op=!0)),h=v}Ud(s)}function cb(s,l){for(var u=s.suspendedLanes,h=s.pingedLanes,v=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var T=31-qe(_),Z=1<<T,pe=v[T];pe===-1?((Z&u)===0||(Z&h)!==0)&&(v[T]=ut(Z,l)):pe<=l&&(s.expiredLanes|=Z),_&=~Z}if(l=In,u=on,u=Gt(s,s===l?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h=s.callbackNode,u===0||s===l&&(An===2||An===9)||s.cancelPendingCommit!==null)return h!==null&&h!==null&&dt(h),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||ur(s,u)){if(l=u&-u,l===s.callbackPriority)return l;switch(h!==null&&dt(h),Jn(u)){case 2:case 8:u=Ce;break;case 32:u=Oe;break;case 268435456:u=Ue;break;default:u=Oe}return h=ub.bind(null,s),u=it(u,h),s.callbackPriority=l,s.callbackNode=u,l}return h!==null&&h!==null&&dt(h),s.callbackPriority=2,s.callbackNode=null,2}function ub(s,l){if(ii!==0&&ii!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(Dp()&&s.callbackNode!==u)return null;var h=on;return h=Gt(s,s===In?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h===0?null:(Vv(s,h,l),cb(s,pt()),s.callbackNode!=null&&s.callbackNode===u?ub.bind(null,s):null)}function fb(s,l){if(Dp())return null;Vv(s,l,!0)}function g6(){C6(function(){(Nn&6)!==0?it(fe,m6):lb()})}function M0(){return fu===0&&(fu=nn()),fu}function db(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:qa(""+s)}function hb(s,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,s.id&&u.setAttribute("form",s.id),l.parentNode.insertBefore(u,l),s=new FormData(s),u.parentNode.removeChild(u),s}function y6(s,l,u,h,v){if(l==="submit"&&u&&u.stateNode===v){var _=db((v[zn]||null).action),T=h.submitter;T&&(l=(l=T[zn]||null)?db(l.formAction):T.getAttribute("formAction"),l!==null&&(_=l,T=null));var Z=new Ls("action","action",null,h,v);s.push({event:Z,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(fu!==0){var pe=T?hb(v,T):new FormData(v);ja(u,{pending:!0,data:pe,method:v.method,action:_},null,pe)}}else typeof _=="function"&&(Z.preventDefault(),pe=T?hb(v,T):new FormData(v),ja(u,{pending:!0,data:pe,method:v.method,action:_},_,pe))},currentTarget:v}]})}}for(var L0=0;L0<Fo.length;L0++){var E0=Fo[L0],v6=E0.toLowerCase(),b6=E0[0].toUpperCase()+E0.slice(1);$n(v6,"on"+b6)}$n(Pl,"onAnimationEnd"),$n(Fs,"onAnimationIteration"),$n(Is,"onAnimationStart"),$n("dblclick","onDoubleClick"),$n("focusin","onFocus"),$n("focusout","onBlur"),$n(zs,"onTransitionRun"),$n(Bo,"onTransitionStart"),$n(Bl,"onTransitionCancel"),$n(Hs,"onTransitionEnd"),Ji("onMouseEnter",["mouseout","mouseover"]),Ji("onMouseLeave",["mouseout","mouseover"]),Ji("onPointerEnter",["pointerout","pointerover"]),Ji("onPointerLeave",["pointerout","pointerover"]),Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qd="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(" "),x6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qd));function pb(s,l){l=(l&4)!==0;for(var u=0;u<s.length;u++){var h=s[u],v=h.event;h=h.listeners;e:{var _=void 0;if(l)for(var T=h.length-1;0<=T;T--){var Z=h[T],pe=Z.instance,Te=Z.currentTarget;if(Z=Z.listener,pe!==_&&v.isPropagationStopped())break e;_=Z,v.currentTarget=Te;try{_(v)}catch(Ze){xp(Ze)}v.currentTarget=null,_=pe}else for(T=0;T<h.length;T++){if(Z=h[T],pe=Z.instance,Te=Z.currentTarget,Z=Z.listener,pe!==_&&v.isPropagationStopped())break e;_=Z,v.currentTarget=Te;try{_(v)}catch(Ze){xp(Ze)}v.currentTarget=null,_=pe}}}}function tn(s,l){var u=l[er];u===void 0&&(u=l[er]=new Set);var h=s+"__bubble";u.has(h)||(mb(l,s,2,!1),u.add(h))}function D0(s,l,u){var h=0;l&&(h|=4),mb(u,s,h,l)}var Tp="_reactListening"+Math.random().toString(36).slice(2);function j0(s){if(!s[Tp]){s[Tp]=!0,_s.forEach(function(u){u!=="selectionchange"&&(x6.has(u)||D0(u,!1,s),D0(u,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[Tp]||(l[Tp]=!0,D0("selectionchange",!1,l))}}function mb(s,l,u,h){switch(Ib(l)){case 2:var v=G6;break;case 8:v=$6;break;default:v=V0}u=v.bind(null,l,u,s),v=void 0,!_l||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(v=!0),h?v!==void 0?s.addEventListener(l,u,{capture:!0,passive:v}):s.addEventListener(l,u,!0):v!==void 0?s.addEventListener(l,u,{passive:v}):s.addEventListener(l,u,!1)}function O0(s,l,u,h,v){var _=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var T=h.tag;if(T===3||T===4){var Z=h.stateNode.containerInfo;if(Z===v)break;if(T===4)for(T=h.return;T!==null;){var pe=T.tag;if((pe===3||pe===4)&&T.stateNode.containerInfo===v)return;T=T.return}for(;Z!==null;){if(T=Wr(Z),T===null)return;if(pe=T.tag,pe===5||pe===6||pe===26||pe===27){h=_=T;continue e}Z=Z.parentNode}}h=h.return}Vu(function(){var Te=_,Ze=Er(u),nt=[];e:{var Pe=Xa.get(s);if(Pe!==void 0){var Fe=Ls,Bt=s;switch(s){case"keypress":if(Ms(u)===0)break e;case"keydown":case"keyup":Fe=Dl;break;case"focusin":Bt="focus",Fe=Eo;break;case"focusout":Bt="blur",Fe=Eo;break;case"beforeblur":case"afterblur":Fe=Eo;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Fe=Na;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=Ds;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=Uc;break;case Pl:case Fs:case Is:Fe=hd;break;case Hs:Fe=F;break;case"scroll":case"scrollend":Fe=$u;break;case"wheel":Fe=ge;break;case"copy":case"cut":case"paste":Fe=pd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=jl;break;case"toggle":case"beforetoggle":Fe=Ye}var Et=(l&4)!==0,En=!Et&&(s==="scroll"||s==="scrollend"),ke=Et?Pe!==null?Pe+"Capture":null:Pe;Et=[];for(var _e=Te,De;_e!==null;){var Qe=_e;if(De=Qe.stateNode,Qe=Qe.tag,Qe!==5&&Qe!==26&&Qe!==27||De===null||ke===null||(Qe=li(_e,ke),Qe!=null&&Et.push(Wd(_e,Qe,De))),En)break;_e=_e.return}0<Et.length&&(Pe=new Fe(Pe,Bt,null,u,Ze),nt.push({event:Pe,listeners:Et}))}}if((l&7)===0){e:{if(Pe=s==="mouseover"||s==="pointerover",Fe=s==="mouseout"||s==="pointerout",Pe&&u!==Sl&&(Bt=u.relatedTarget||u.fromElement)&&(Wr(Bt)||Bt[vr]))break e;if((Fe||Pe)&&(Pe=Ze.window===Ze?Ze:(Pe=Ze.ownerDocument)?Pe.defaultView||Pe.parentWindow:window,Fe?(Bt=u.relatedTarget||u.toElement,Fe=Te,Bt=Bt?Wr(Bt):null,Bt!==null&&(En=a(Bt),Et=Bt.tag,Bt!==En||Et!==5&&Et!==27&&Et!==6)&&(Bt=null)):(Fe=null,Bt=Te),Fe!==Bt)){if(Et=Na,Qe="onMouseLeave",ke="onMouseEnter",_e="mouse",(s==="pointerout"||s==="pointerover")&&(Et=jl,Qe="onPointerLeave",ke="onPointerEnter",_e="pointer"),En=Fe==null?Pe:si(Fe),De=Bt==null?Pe:si(Bt),Pe=new Et(Qe,_e+"leave",Fe,u,Ze),Pe.target=En,Pe.relatedTarget=De,Qe=null,Wr(Ze)===Te&&(Et=new Et(ke,_e+"enter",Bt,u,Ze),Et.target=De,Et.relatedTarget=En,Qe=Et),En=Qe,Fe&&Bt)t:{for(Et=Fe,ke=Bt,_e=0,De=Et;De;De=Sf(De))_e++;for(De=0,Qe=ke;Qe;Qe=Sf(Qe))De++;for(;0<_e-De;)Et=Sf(Et),_e--;for(;0<De-_e;)ke=Sf(ke),De--;for(;_e--;){if(Et===ke||ke!==null&&Et===ke.alternate)break t;Et=Sf(Et),ke=Sf(ke)}Et=null}else Et=null;Fe!==null&&gb(nt,Pe,Fe,Et,!1),Bt!==null&&En!==null&&gb(nt,En,Bt,Et,!0)}}e:{if(Pe=Te?si(Te):window,Fe=Pe.nodeName&&Pe.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&Pe.type==="file")var gt=Tl;else if(ra(Pe))if(Oo)gt=Zu;else{gt=gd;var Qt=ci}else Fe=Pe.nodeName,!Fe||Fe.toLowerCase()!=="input"||Pe.type!=="checkbox"&&Pe.type!=="radio"?Te&&Pc(Te.elementType)&&(gt=Tl):gt=Wc;if(gt&&(gt=gt(s,Te))){qc(nt,gt,u,Ze);break e}Qt&&Qt(s,Pe,Te),s==="focusout"&&Te&&Pe.type==="number"&&Te.memoizedProps.value!=null&&Oc(Pe,"number",Pe.value)}switch(Qt=Te?si(Te):window,s){case"focusin":(ra(Qt)||Qt.contentEditable==="true")&&(ui=Qt,ia=Te,Aa=null);break;case"focusout":Aa=ia=ui=null;break;case"mousedown":aa=!0;break;case"contextmenu":case"mouseup":case"dragend":aa=!1,Gn(nt,u,Ze);break;case"selectionchange":if(Bs)break;case"keydown":case"keyup":Gn(nt,u,Ze)}var Nt;if(lt)e:{switch(s){case"compositionstart":var Dt="onCompositionStart";break e;case"compositionend":Dt="onCompositionEnd";break e;case"compositionupdate":Dt="onCompositionUpdate";break e}Dt=void 0}else nr?Hn(s,u)&&(Dt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(Dt="onCompositionStart");Dt&&(Ft&&u.locale!=="ko"&&(nr||Dt!=="onCompositionStart"?Dt==="onCompositionEnd"&&nr&&(Nt=Gu()):(Ii=Ze,Fc="value"in Ii?Ii.value:Ii.textContent,nr=!0)),Qt=Rp(Te,Dt),0<Qt.length&&(Dt=new Ml(Dt,s,null,u,Ze),nt.push({event:Dt,listeners:Qt}),Nt?Dt.data=Nt:(Nt=tr(u),Nt!==null&&(Dt.data=Nt)))),(Nt=zt?Dr(s,u):na(s,u))&&(Dt=Rp(Te,"onBeforeInput"),0<Dt.length&&(Qt=new Ml("onBeforeInput","beforeinput",null,u,Ze),nt.push({event:Qt,listeners:Dt}),Qt.data=Nt)),y6(nt,s,Te,u,Ze)}pb(nt,l)})}function Wd(s,l,u){return{instance:s,listener:l,currentTarget:u}}function Rp(s,l){for(var u=l+"Capture",h=[];s!==null;){var v=s,_=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||_===null||(v=li(s,u),v!=null&&h.unshift(Wd(s,v,_)),v=li(s,l),v!=null&&h.push(Wd(s,v,_))),s.tag===3)return h;s=s.return}return[]}function Sf(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function gb(s,l,u,h,v){for(var _=l._reactName,T=[];u!==null&&u!==h;){var Z=u,pe=Z.alternate,Te=Z.stateNode;if(Z=Z.tag,pe!==null&&pe===h)break;Z!==5&&Z!==26&&Z!==27||Te===null||(pe=Te,v?(Te=li(u,_),Te!=null&&T.unshift(Wd(u,Te,pe))):v||(Te=li(u,_),Te!=null&&T.push(Wd(u,Te,pe)))),u=u.return}T.length!==0&&s.push({event:l,listeners:T})}var w6=/\r\n?/g,S6=/\u0000|\uFFFD/g;function yb(s){return(typeof s=="string"?s:""+s).replace(w6,`
`).replace(S6,"")}function vb(s,l){return l=yb(l),yb(s)===l}function Pp(){}function Ln(s,l,u,h,v,_){switch(u){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||Cs(s,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&Cs(s,""+h);break;case"className":ko(s,"class",h);break;case"tabIndex":ko(s,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":ko(s,u,h);break;case"style":Yu(s,h,_);break;case"data":if(l!=="object"){ko(s,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||u!=="href")){s.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=qa(""+h),s.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){s.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(u==="formAction"?(l!=="input"&&Ln(s,l,"name",v.name,v,null),Ln(s,l,"formEncType",v.formEncType,v,null),Ln(s,l,"formMethod",v.formMethod,v,null),Ln(s,l,"formTarget",v.formTarget,v,null)):(Ln(s,l,"encType",v.encType,v,null),Ln(s,l,"method",v.method,v,null),Ln(s,l,"target",v.target,v,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=qa(""+h),s.setAttribute(u,h);break;case"onClick":h!=null&&(s.onclick=Pp);break;case"onScroll":h!=null&&tn("scroll",s);break;case"onScrollEnd":h!=null&&tn("scrollend",s);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(v.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"multiple":s.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":s.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){s.removeAttribute("xlink:href");break}u=qa(""+h),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""+h):s.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":h===!0?s.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,h):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?s.setAttribute(u,h):s.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?s.removeAttribute(u):s.setAttribute(u,h);break;case"popover":tn("beforetoggle",s),tn("toggle",s),Ia(s,"popover",h);break;case"xlinkActuate":ea(s,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":ea(s,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":ea(s,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":ea(s,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":ea(s,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":ea(s,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":ea(s,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":ea(s,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":ea(s,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Ia(s,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Ua.get(u)||u,Ia(s,u,h))}}function T0(s,l,u,h,v,_){switch(u){case"style":Yu(s,h,_);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(v.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"children":typeof h=="string"?Cs(s,h):(typeof h=="number"||typeof h=="bigint")&&Cs(s,""+h);break;case"onScroll":h!=null&&tn("scroll",s);break;case"onScrollEnd":h!=null&&tn("scrollend",s);break;case"onClick":h!=null&&(s.onclick=Pp);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Co.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(v=u.endsWith("Capture"),l=u.slice(2,v?u.length-7:void 0),_=s[zn]||null,_=_!=null?_[u]:null,typeof _=="function"&&s.removeEventListener(l,_,v),typeof h=="function")){typeof _!="function"&&_!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(l,h,v);break e}u in s?s[u]=h:h===!0?s.setAttribute(u,""):Ia(s,u,h)}}}function ai(s,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tn("error",s),tn("load",s);var h=!1,v=!1,_;for(_ in u)if(u.hasOwnProperty(_)){var T=u[_];if(T!=null)switch(_){case"src":h=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Ln(s,l,_,T,u,null)}}v&&Ln(s,l,"srcSet",u.srcSet,u,null),h&&Ln(s,l,"src",u.src,u,null);return;case"input":tn("invalid",s);var Z=_=T=v=null,pe=null,Te=null;for(h in u)if(u.hasOwnProperty(h)){var Ze=u[h];if(Ze!=null)switch(h){case"name":v=Ze;break;case"type":T=Ze;break;case"checked":pe=Ze;break;case"defaultChecked":Te=Ze;break;case"value":_=Ze;break;case"defaultValue":Z=Ze;break;case"children":case"dangerouslySetInnerHTML":if(Ze!=null)throw Error(r(137,l));break;default:Ln(s,l,h,Ze,u,null)}}jc(s,_,Z,pe,Te,T,v,!1),As(s);return;case"select":tn("invalid",s),h=T=_=null;for(v in u)if(u.hasOwnProperty(v)&&(Z=u[v],Z!=null))switch(v){case"value":_=Z;break;case"defaultValue":T=Z;break;case"multiple":h=Z;default:Ln(s,l,v,Z,u,null)}l=_,u=T,s.multiple=!!h,l!=null?Ha(s,!!h,l,!1):u!=null&&Ha(s,!!h,u,!0);return;case"textarea":tn("invalid",s),_=v=h=null;for(T in u)if(u.hasOwnProperty(T)&&(Z=u[T],Z!=null))switch(T){case"value":h=Z;break;case"defaultValue":v=Z;break;case"children":_=Z;break;case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(91));break;default:Ln(s,l,T,Z,u,null)}Tc(s,h,v,_),As(s);return;case"option":for(pe in u)if(u.hasOwnProperty(pe)&&(h=u[pe],h!=null))switch(pe){case"selected":s.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Ln(s,l,pe,h,u,null)}return;case"dialog":tn("beforetoggle",s),tn("toggle",s),tn("cancel",s),tn("close",s);break;case"iframe":case"object":tn("load",s);break;case"video":case"audio":for(h=0;h<qd.length;h++)tn(qd[h],s);break;case"image":tn("error",s),tn("load",s);break;case"details":tn("toggle",s);break;case"embed":case"source":case"link":tn("error",s),tn("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Te in u)if(u.hasOwnProperty(Te)&&(h=u[Te],h!=null))switch(Te){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Ln(s,l,Te,h,u,null)}return;default:if(Pc(l)){for(Ze in u)u.hasOwnProperty(Ze)&&(h=u[Ze],h!==void 0&&T0(s,l,Ze,h,u,void 0));return}}for(Z in u)u.hasOwnProperty(Z)&&(h=u[Z],h!=null&&Ln(s,l,Z,h,u,null))}function _6(s,l,u,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,_=null,T=null,Z=null,pe=null,Te=null,Ze=null;for(Fe in u){var nt=u[Fe];if(u.hasOwnProperty(Fe)&&nt!=null)switch(Fe){case"checked":break;case"value":break;case"defaultValue":pe=nt;default:h.hasOwnProperty(Fe)||Ln(s,l,Fe,null,h,nt)}}for(var Pe in h){var Fe=h[Pe];if(nt=u[Pe],h.hasOwnProperty(Pe)&&(Fe!=null||nt!=null))switch(Pe){case"type":_=Fe;break;case"name":v=Fe;break;case"checked":Te=Fe;break;case"defaultChecked":Ze=Fe;break;case"value":T=Fe;break;case"defaultValue":Z=Fe;break;case"children":case"dangerouslySetInnerHTML":if(Fe!=null)throw Error(r(137,l));break;default:Fe!==nt&&Ln(s,l,Pe,Fe,h,nt)}}Lo(s,T,Z,pe,Te,Ze,_,v);return;case"select":Fe=T=Z=Pe=null;for(_ in u)if(pe=u[_],u.hasOwnProperty(_)&&pe!=null)switch(_){case"value":break;case"multiple":Fe=pe;default:h.hasOwnProperty(_)||Ln(s,l,_,null,h,pe)}for(v in h)if(_=h[v],pe=u[v],h.hasOwnProperty(v)&&(_!=null||pe!=null))switch(v){case"value":Pe=_;break;case"defaultValue":Z=_;break;case"multiple":T=_;default:_!==pe&&Ln(s,l,v,_,h,pe)}l=Z,u=T,h=Fe,Pe!=null?Ha(s,!!u,Pe,!1):!!h!=!!u&&(l!=null?Ha(s,!!u,l,!0):Ha(s,!!u,u?[]:"",!1));return;case"textarea":Fe=Pe=null;for(Z in u)if(v=u[Z],u.hasOwnProperty(Z)&&v!=null&&!h.hasOwnProperty(Z))switch(Z){case"value":break;case"children":break;default:Ln(s,l,Z,null,h,v)}for(T in h)if(v=h[T],_=u[T],h.hasOwnProperty(T)&&(v!=null||_!=null))switch(T){case"value":Pe=v;break;case"defaultValue":Fe=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==_&&Ln(s,l,T,v,h,_)}qu(s,Pe,Fe);return;case"option":for(var Bt in u)if(Pe=u[Bt],u.hasOwnProperty(Bt)&&Pe!=null&&!h.hasOwnProperty(Bt))switch(Bt){case"selected":s.selected=!1;break;default:Ln(s,l,Bt,null,h,Pe)}for(pe in h)if(Pe=h[pe],Fe=u[pe],h.hasOwnProperty(pe)&&Pe!==Fe&&(Pe!=null||Fe!=null))switch(pe){case"selected":s.selected=Pe&&typeof Pe!="function"&&typeof Pe!="symbol";break;default:Ln(s,l,pe,Pe,h,Fe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Et in u)Pe=u[Et],u.hasOwnProperty(Et)&&Pe!=null&&!h.hasOwnProperty(Et)&&Ln(s,l,Et,null,h,Pe);for(Te in h)if(Pe=h[Te],Fe=u[Te],h.hasOwnProperty(Te)&&Pe!==Fe&&(Pe!=null||Fe!=null))switch(Te){case"children":case"dangerouslySetInnerHTML":if(Pe!=null)throw Error(r(137,l));break;default:Ln(s,l,Te,Pe,h,Fe)}return;default:if(Pc(l)){for(var En in u)Pe=u[En],u.hasOwnProperty(En)&&Pe!==void 0&&!h.hasOwnProperty(En)&&T0(s,l,En,void 0,h,Pe);for(Ze in h)Pe=h[Ze],Fe=u[Ze],!h.hasOwnProperty(Ze)||Pe===Fe||Pe===void 0&&Fe===void 0||T0(s,l,Ze,Pe,h,Fe);return}}for(var ke in u)Pe=u[ke],u.hasOwnProperty(ke)&&Pe!=null&&!h.hasOwnProperty(ke)&&Ln(s,l,ke,null,h,Pe);for(nt in h)Pe=h[nt],Fe=u[nt],!h.hasOwnProperty(nt)||Pe===Fe||Pe==null&&Fe==null||Ln(s,l,nt,Pe,h,Fe)}var R0=null,P0=null;function Bp(s){return s.nodeType===9?s:s.ownerDocument}function bb(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xb(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function B0(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var F0=null;function N6(){var s=window.event;return s&&s.type==="popstate"?s===F0?!1:(F0=s,!0):(F0=null,!1)}var wb=typeof setTimeout=="function"?setTimeout:void 0,A6=typeof clearTimeout=="function"?clearTimeout:void 0,Sb=typeof Promise=="function"?Promise:void 0,C6=typeof queueMicrotask=="function"?queueMicrotask:typeof Sb<"u"?function(s){return Sb.resolve(null).then(s).catch(k6)}:wb;function k6(s){setTimeout(function(){throw s})}function rc(s){return s==="head"}function _b(s,l){var u=l,h=0,v=0;do{var _=u.nextSibling;if(s.removeChild(u),_&&_.nodeType===8)if(u=_.data,u==="/$"){if(0<h&&8>h){u=h;var T=s.ownerDocument;if(u&1&&Yd(T.documentElement),u&2&&Yd(T.body),u&4)for(u=T.head,Yd(u),T=u.firstChild;T;){var Z=T.nextSibling,pe=T.nodeName;T[Ai]||pe==="SCRIPT"||pe==="STYLE"||pe==="LINK"&&T.rel.toLowerCase()==="stylesheet"||u.removeChild(T),T=Z}}if(v===0){s.removeChild(_),Jd(l);return}v--}else u==="$"||u==="$?"||u==="$!"?v++:h=u.charCodeAt(0)-48;else h=0;u=_}while(u);Jd(l)}function I0(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":I0(u),Ci(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function M6(s,l,u,h){for(;s.nodeType===1;){var v=u;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(h){if(!s[Ai])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(_=s.getAttribute("rel"),_==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(_!==v.rel||s.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||s.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||s.getAttribute("title")!==(v.title==null?null:v.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(_=s.getAttribute("src"),(_!==(v.src==null?null:v.src)||s.getAttribute("type")!==(v.type==null?null:v.type)||s.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&_&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var _=v.name==null?null:""+v.name;if(v.type==="hidden"&&s.getAttribute("name")===_)return s}else return s;if(s=cs(s.nextSibling),s===null)break}return null}function L6(s,l,u){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=cs(s.nextSibling),s===null))return null;return s}function z0(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState==="complete"}function E6(s,l){var u=s.ownerDocument;if(s.data!=="$?"||u.readyState==="complete")l();else{var h=function(){l(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),s._reactRetry=h}}function cs(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="F!"||l==="F")break;if(l==="/$")return null}}return s}var H0=null;function Nb(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"){if(l===0)return s;l--}else u==="/$"&&l++}s=s.previousSibling}return null}function Ab(s,l,u){switch(l=Bp(u),s){case"html":if(s=l.documentElement,!s)throw Error(r(452));return s;case"head":if(s=l.head,!s)throw Error(r(453));return s;case"body":if(s=l.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Yd(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);Ci(s)}var Ra=new Map,Cb=new Set;function Fp(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var tl=J.d;J.d={f:D6,r:j6,D:O6,C:T6,L:R6,m:P6,X:F6,S:B6,M:I6};function D6(){var s=tl.f(),l=Lp();return s||l}function j6(s){var l=Yr(s);l!==null&&l.tag===5&&l.type==="form"?su(l):tl.r(s)}var _f=typeof document>"u"?null:document;function kb(s,l,u){var h=_f;if(h&&typeof l=="string"&&l){var v=On(l);v='link[rel="'+s+'"][href="'+v+'"]',typeof u=="string"&&(v+='[crossorigin="'+u+'"]'),Cb.has(v)||(Cb.add(v),s={rel:s,crossOrigin:u,href:l},h.querySelector(v)===null&&(l=h.createElement("link"),ai(l,"link",s),Sn(l),h.head.appendChild(l)))}}function O6(s){tl.D(s),kb("dns-prefetch",s,null)}function T6(s,l){tl.C(s,l),kb("preconnect",s,l)}function R6(s,l,u){tl.L(s,l,u);var h=_f;if(h&&s&&l){var v='link[rel="preload"][as="'+On(l)+'"]';l==="image"&&u&&u.imageSrcSet?(v+='[imagesrcset="'+On(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(v+='[imagesizes="'+On(u.imageSizes)+'"]')):v+='[href="'+On(s)+'"]';var _=v;switch(l){case"style":_=Nf(s);break;case"script":_=Af(s)}Ra.has(_)||(s=p({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:s,as:l},u),Ra.set(_,s),h.querySelector(v)!==null||l==="style"&&h.querySelector(Vd(_))||l==="script"&&h.querySelector(Gd(_))||(l=h.createElement("link"),ai(l,"link",s),Sn(l),h.head.appendChild(l)))}}function P6(s,l){tl.m(s,l);var u=_f;if(u&&s){var h=l&&typeof l.as=="string"?l.as:"script",v='link[rel="modulepreload"][as="'+On(h)+'"][href="'+On(s)+'"]',_=v;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Af(s)}if(!Ra.has(_)&&(s=p({rel:"modulepreload",href:s},l),Ra.set(_,s),u.querySelector(v)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Gd(_)))return}h=u.createElement("link"),ai(h,"link",s),Sn(h),u.head.appendChild(h)}}}function B6(s,l,u){tl.S(s,l,u);var h=_f;if(h&&s){var v=Fr(h).hoistableStyles,_=Nf(s);l=l||"default";var T=v.get(_);if(!T){var Z={loading:0,preload:null};if(T=h.querySelector(Vd(_)))Z.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":l},u),(u=Ra.get(_))&&U0(s,u);var pe=T=h.createElement("link");Sn(pe),ai(pe,"link",s),pe._p=new Promise(function(Te,Ze){pe.onload=Te,pe.onerror=Ze}),pe.addEventListener("load",function(){Z.loading|=1}),pe.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,Ip(T,l,h)}T={type:"stylesheet",instance:T,count:1,state:Z},v.set(_,T)}}}function F6(s,l){tl.X(s,l);var u=_f;if(u&&s){var h=Fr(u).hoistableScripts,v=Af(s),_=h.get(v);_||(_=u.querySelector(Gd(v)),_||(s=p({src:s,async:!0},l),(l=Ra.get(v))&&q0(s,l),_=u.createElement("script"),Sn(_),ai(_,"link",s),u.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(v,_))}}function I6(s,l){tl.M(s,l);var u=_f;if(u&&s){var h=Fr(u).hoistableScripts,v=Af(s),_=h.get(v);_||(_=u.querySelector(Gd(v)),_||(s=p({src:s,async:!0,type:"module"},l),(l=Ra.get(v))&&q0(s,l),_=u.createElement("script"),Sn(_),ai(_,"link",s),u.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(v,_))}}function Mb(s,l,u,h){var v=(v=ce.current)?Fp(v):null;if(!v)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=Nf(u.href),u=Fr(v).hoistableStyles,h=u.get(l),h||(h={type:"style",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=Nf(u.href);var _=Fr(v).hoistableStyles,T=_.get(s);if(T||(v=v.ownerDocument||v,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,T),(_=v.querySelector(Vd(s)))&&!_._p&&(T.instance=_,T.state.loading=5),Ra.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ra.set(s,u),_||z6(v,s,u,T.state))),l&&h===null)throw Error(r(528,""));return T}if(l&&h!==null)throw Error(r(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Af(u),u=Fr(v).hoistableScripts,h=u.get(l),h||(h={type:"script",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Nf(s){return'href="'+On(s)+'"'}function Vd(s){return'link[rel="stylesheet"]['+s+"]"}function Lb(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function z6(s,l,u,h){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=s.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),ai(l,"link",u),Sn(l),s.head.appendChild(l))}function Af(s){return'[src="'+On(s)+'"]'}function Gd(s){return"script[async]"+s}function Eb(s,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var h=s.querySelector('style[data-href~="'+On(u.href)+'"]');if(h)return l.instance=h,Sn(h),h;var v=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),Sn(h),ai(h,"style",v),Ip(h,u.precedence,s),l.instance=h;case"stylesheet":v=Nf(u.href);var _=s.querySelector(Vd(v));if(_)return l.state.loading|=4,l.instance=_,Sn(_),_;h=Lb(u),(v=Ra.get(v))&&U0(h,v),_=(s.ownerDocument||s).createElement("link"),Sn(_);var T=_;return T._p=new Promise(function(Z,pe){T.onload=Z,T.onerror=pe}),ai(_,"link",h),l.state.loading|=4,Ip(_,u.precedence,s),l.instance=_;case"script":return _=Af(u.src),(v=s.querySelector(Gd(_)))?(l.instance=v,Sn(v),v):(h=u,(v=Ra.get(_))&&(h=p({},u),q0(h,v)),s=s.ownerDocument||s,v=s.createElement("script"),Sn(v),ai(v,"link",h),s.head.appendChild(v),l.instance=v);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,Ip(h,u.precedence,s));return l.instance}function Ip(s,l,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=h.length?h[h.length-1]:null,_=v,T=0;T<h.length;T++){var Z=h[T];if(Z.dataset.precedence===l)_=Z;else if(_!==v)break}_?_.parentNode.insertBefore(s,_.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(s,l.firstChild))}function U0(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function q0(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var zp=null;function Db(s,l,u){if(zp===null){var h=new Map,v=zp=new Map;v.set(u,h)}else v=zp,h=v.get(u),h||(h=new Map,v.set(u,h));if(h.has(s))return h;for(h.set(s,null),u=u.getElementsByTagName(s),v=0;v<u.length;v++){var _=u[v];if(!(_[Ai]||_[un]||s==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var T=_.getAttribute(l)||"";T=s+T;var Z=h.get(T);Z?Z.push(_):h.set(T,[_])}}return h}function jb(s,l,u){s=s.ownerDocument||s,s.head.insertBefore(u,l==="title"?s.querySelector("head > title"):null)}function H6(s,l,u){if(u===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return s=l.disabled,typeof l.precedence=="string"&&s==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Ob(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}var $d=null;function U6(){}function q6(s,l,u){if($d===null)throw Error(r(475));var h=$d;if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var v=Nf(u.href),_=s.querySelector(Vd(v));if(_){s=_._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(h.count++,h=Hp.bind(h),s.then(h,h)),l.state.loading|=4,l.instance=_,Sn(_);return}_=s.ownerDocument||s,u=Lb(u),(v=Ra.get(v))&&U0(u,v),_=_.createElement("link"),Sn(_);var T=_;T._p=new Promise(function(Z,pe){T.onload=Z,T.onerror=pe}),ai(_,"link",u),l.instance=_}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(l,s),(s=l.state.preload)&&(l.state.loading&3)===0&&(h.count++,l=Hp.bind(h),s.addEventListener("load",l),s.addEventListener("error",l))}}function W6(){if($d===null)throw Error(r(475));var s=$d;return s.stylesheets&&s.count===0&&W0(s,s.stylesheets),0<s.count?function(l){var u=setTimeout(function(){if(s.stylesheets&&W0(s,s.stylesheets),s.unsuspend){var h=s.unsuspend;s.unsuspend=null,h()}},6e4);return s.unsuspend=l,function(){s.unsuspend=null,clearTimeout(u)}}:null}function Hp(){if(this.count--,this.count===0){if(this.stylesheets)W0(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Up=null;function W0(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Up=new Map,l.forEach(Y6,s),Up=null,Hp.call(s))}function Y6(s,l){if(!(l.state.loading&4)){var u=Up.get(s);if(u)var h=u.get(null);else{u=new Map,Up.set(s,u);for(var v=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<v.length;_++){var T=v[_];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(u.set(T.dataset.precedence,T),h=T)}h&&u.set(null,h)}v=l.instance,T=v.getAttribute("data-precedence"),_=u.get(T)||h,_===h&&u.set(null,v),u.set(T,v),this.count++,h=Hp.bind(this),v.addEventListener("load",h),v.addEventListener("error",h),_?_.parentNode.insertBefore(v,_.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(v,s.firstChild)),l.state.loading|=4}}var Xd={$$typeof:j,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function V6(s,l,u,h,v,_,T,Z){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Yn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yn(0),this.hiddenUpdates=Yn(null),this.identifierPrefix=h,this.onUncaughtError=v,this.onCaughtError=_,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function Tb(s,l,u,h,v,_,T,Z,pe,Te,Ze,nt){return s=new V6(s,l,u,T,Z,pe,Te,nt),l=1,_===!0&&(l|=24),_=Gr(3,null,null,l),s.current=_,_.stateNode=s,l=vd(),l.refCount++,s.pooledCache=l,l.refCount++,_.memoizedState={element:h,isDehydrated:u,cache:l},be(_),s}function Rb(s){return s?(s=Or,s):Or}function Pb(s,l,u,h,v,_){v=Rb(v),h.context===null?h.context=v:h.pendingContext=v,h=Xe(l),h.payload={element:u},_=_===void 0?null:_,_!==null&&(h.callback=_),u=tt(s,h,l),u!==null&&(ha(u,s,l),Ke(u,s,l))}function Bb(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<l?u:l}}function Y0(s,l){Bb(s,l),(s=s.alternate)&&Bb(s,l)}function Fb(s){if(s.tag===13){var l=Za(s,67108864);l!==null&&ha(l,s,67108864),Y0(s,67108864)}}var qp=!0;function G6(s,l,u,h){var v=X.T;X.T=null;var _=J.p;try{J.p=2,V0(s,l,u,h)}finally{J.p=_,X.T=v}}function $6(s,l,u,h){var v=X.T;X.T=null;var _=J.p;try{J.p=8,V0(s,l,u,h)}finally{J.p=_,X.T=v}}function V0(s,l,u,h){if(qp){var v=G0(h);if(v===null)O0(s,l,h,Wp,u),zb(s,h);else if(Z6(v,s,l,u,h))h.stopPropagation();else if(zb(s,h),l&4&&-1<X6.indexOf(s)){for(;v!==null;){var _=Yr(v);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var T=Ct(_.pendingLanes);if(T!==0){var Z=_;for(Z.pendingLanes|=2,Z.entangledLanes|=2;T;){var pe=1<<31-qe(T);Z.entanglements[1]|=pe,T&=~pe}to(_),(Nn&6)===0&&(kp=pt()+500,Ud(0))}}break;case 13:Z=Za(_,2),Z!==null&&ha(Z,_,2),Lp(),Y0(_,2)}if(_=G0(h),_===null&&O0(s,l,h,Wp,u),_===v)break;v=_}v!==null&&h.stopPropagation()}else O0(s,l,h,null,u)}}function G0(s){return s=Er(s),$0(s)}var Wp=null;function $0(s){if(Wp=null,s=Wr(s),s!==null){var l=a(s);if(l===null)s=null;else{var u=l.tag;if(u===13){if(s=o(l),s!==null)return s;s=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return Wp=s,null}function Ib(s){switch(s){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ht()){case fe:return 2;case Ce:return 8;case Oe:case Ge:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var X0=!1,ic=null,ac=null,sc=null,Zd=new Map,Kd=new Map,oc=[],X6="mousedown 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".split(" ");function zb(s,l){switch(s){case"focusin":case"focusout":ic=null;break;case"dragenter":case"dragleave":ac=null;break;case"mouseover":case"mouseout":sc=null;break;case"pointerover":case"pointerout":Zd.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kd.delete(l.pointerId)}}function Qd(s,l,u,h,v,_){return s===null||s.nativeEvent!==_?(s={blockedOn:l,domEventName:u,eventSystemFlags:h,nativeEvent:_,targetContainers:[v]},l!==null&&(l=Yr(l),l!==null&&Fb(l)),s):(s.eventSystemFlags|=h,l=s.targetContainers,v!==null&&l.indexOf(v)===-1&&l.push(v),s)}function Z6(s,l,u,h,v){switch(l){case"focusin":return ic=Qd(ic,s,l,u,h,v),!0;case"dragenter":return ac=Qd(ac,s,l,u,h,v),!0;case"mouseover":return sc=Qd(sc,s,l,u,h,v),!0;case"pointerover":var _=v.pointerId;return Zd.set(_,Qd(Zd.get(_)||null,s,l,u,h,v)),!0;case"gotpointercapture":return _=v.pointerId,Kd.set(_,Qd(Kd.get(_)||null,s,l,u,h,v)),!0}return!1}function Hb(s){var l=Wr(s.target);if(l!==null){var u=a(l);if(u!==null){if(l=u.tag,l===13){if(l=o(u),l!==null){s.blockedOn=l,Pi(s.priority,function(){if(u.tag===13){var h=da();h=Wt(h);var v=Za(u,h);v!==null&&ha(v,u,h),Y0(u,h)}});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Yp(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var u=G0(s.nativeEvent);if(u===null){u=s.nativeEvent;var h=new u.constructor(u.type,u);Sl=h,u.target.dispatchEvent(h),Sl=null}else return l=Yr(u),l!==null&&Fb(l),s.blockedOn=u,!1;l.shift()}return!0}function Ub(s,l,u){Yp(s)&&u.delete(l)}function K6(){X0=!1,ic!==null&&Yp(ic)&&(ic=null),ac!==null&&Yp(ac)&&(ac=null),sc!==null&&Yp(sc)&&(sc=null),Zd.forEach(Ub),Kd.forEach(Ub)}function Vp(s,l){s.blockedOn===l&&(s.blockedOn=null,X0||(X0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,K6)))}var Gp=null;function qb(s){Gp!==s&&(Gp=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gp===s&&(Gp=null);for(var l=0;l<s.length;l+=3){var u=s[l],h=s[l+1],v=s[l+2];if(typeof h!="function"){if($0(h||u)===null)continue;break}var _=Yr(u);_!==null&&(s.splice(l,3),l-=3,ja(_,{pending:!0,data:v,method:u.method,action:h},h,v))}}))}function Jd(s){function l(pe){return Vp(pe,s)}ic!==null&&Vp(ic,s),ac!==null&&Vp(ac,s),sc!==null&&Vp(sc,s),Zd.forEach(l),Kd.forEach(l);for(var u=0;u<oc.length;u++){var h=oc[u];h.blockedOn===s&&(h.blockedOn=null)}for(;0<oc.length&&(u=oc[0],u.blockedOn===null);)Hb(u),u.blockedOn===null&&oc.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var v=u[h],_=u[h+1],T=v[zn]||null;if(typeof _=="function")T||qb(u);else if(T){var Z=null;if(_&&_.hasAttribute("formAction")){if(v=_,T=_[zn]||null)Z=T.formAction;else if($0(v)!==null)continue}else Z=T.action;typeof Z=="function"?u[h+1]=Z:(u.splice(h,3),h-=3),qb(u)}}}function Z0(s){this._internalRoot=s}$p.prototype.render=Z0.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(r(409));var u=l.current,h=da();Pb(u,h,s,l,null,null)},$p.prototype.unmount=Z0.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;Pb(s.current,2,null,s,null,null),Lp(),l[vr]=null}};function $p(s){this._internalRoot=s}$p.prototype.unstable_scheduleHydration=function(s){if(s){var l=_i();s={blockedOn:null,target:s,priority:l};for(var u=0;u<oc.length&&l!==0&&l<oc[u].priority;u++);oc.splice(u,0,s),u===0&&Hb(s)}};var Wb=e.version;if(Wb!=="19.1.0")throw Error(r(527,Wb,"19.1.0"));J.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(l),s=s!==null?d(s):null,s=s===null?null:s.stateNode,s};var Q6={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xp.isDisabled&&Xp.supportsFiber)try{Be=Xp.inject(Q6),Le=Xp}catch{}}return th.createRoot=function(s,l){if(!i(s))throw Error(r(299));var u=!1,h="",v=sv,_=ov,T=lv,Z=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(_=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(Z=l.unstable_transitionCallbacks)),l=Tb(s,1,!1,null,null,u,h,v,_,T,Z,null),s[vr]=l.current,j0(s),new Z0(l)},th.hydrateRoot=function(s,l,u){if(!i(s))throw Error(r(299));var h=!1,v="",_=sv,T=ov,Z=lv,pe=null,Te=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(v=u.identifierPrefix),u.onUncaughtError!==void 0&&(_=u.onUncaughtError),u.onCaughtError!==void 0&&(T=u.onCaughtError),u.onRecoverableError!==void 0&&(Z=u.onRecoverableError),u.unstable_transitionCallbacks!==void 0&&(pe=u.unstable_transitionCallbacks),u.formState!==void 0&&(Te=u.formState)),l=Tb(s,1,!0,l,u??null,h,v,_,T,Z,pe,Te),l.context=Rb(null),u=l.current,h=da(),h=Wt(h),v=Xe(h),v.callback=null,tt(u,v,h),u=h,l.current.lanes=u,jn(l,u),to(l),s[vr]=l.current,j0(s),new $p(l)},th.version="19.1.0",th}var e5;function lA(){if(e5)return J0.exports;e5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),J0.exports=oA(),J0.exports}var cA=lA();const uA=Y2(cA);var nh={},t5;function fA(){if(t5)return nh;t5=1,Object.defineProperty(nh,"__esModule",{value:!0}),nh.parse=o,nh.serialize=d;const t=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,e=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,a=(()=>{const b=function(){};return b.prototype=Object.create(null),b})();function o(b,y){const N=new a,w=b.length;if(w<2)return N;const k=y?.decode||p;let C=0;do{const L=b.indexOf("=",C);if(L===-1)break;const j=b.indexOf(";",C),z=j===-1?w:j;if(L>z){C=b.lastIndexOf(";",L-1)+1;continue}const O=c(b,C,L),K=f(b,L,O),q=b.slice(O,K);if(N[q]===void 0){let H=c(b,L+1,z),se=f(b,z,H);const le=k(b.slice(H,se));N[q]=le}C=z+1}while(C<w);return N}function c(b,y,N){do{const w=b.charCodeAt(y);if(w!==32&&w!==9)return y}while(++y<N);return N}function f(b,y,N){for(;y>N;){const w=b.charCodeAt(--y);if(w!==32&&w!==9)return y+1}return N}function d(b,y,N){const w=N?.encode||encodeURIComponent;if(!t.test(b))throw new TypeError(`argument name is invalid: ${b}`);const k=w(y);if(!e.test(k))throw new TypeError(`argument val is invalid: ${y}`);let C=b+"="+k;if(!N)return C;if(N.maxAge!==void 0){if(!Number.isInteger(N.maxAge))throw new TypeError(`option maxAge is invalid: ${N.maxAge}`);C+="; Max-Age="+N.maxAge}if(N.domain){if(!n.test(N.domain))throw new TypeError(`option domain is invalid: ${N.domain}`);C+="; Domain="+N.domain}if(N.path){if(!r.test(N.path))throw new TypeError(`option path is invalid: ${N.path}`);C+="; Path="+N.path}if(N.expires){if(!g(N.expires)||!Number.isFinite(N.expires.valueOf()))throw new TypeError(`option expires is invalid: ${N.expires}`);C+="; Expires="+N.expires.toUTCString()}if(N.httpOnly&&(C+="; HttpOnly"),N.secure&&(C+="; Secure"),N.partitioned&&(C+="; Partitioned"),N.priority)switch(typeof N.priority=="string"?N.priority.toLowerCase():void 0){case"low":C+="; Priority=Low";break;case"medium":C+="; Priority=Medium";break;case"high":C+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${N.priority}`)}if(N.sameSite)switch(typeof N.sameSite=="string"?N.sameSite.toLowerCase():N.sameSite){case!0:case"strict":C+="; SameSite=Strict";break;case"lax":C+="; SameSite=Lax";break;case"none":C+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${N.sameSite}`)}return C}function p(b){if(b.indexOf("%")===-1)return b;try{return decodeURIComponent(b)}catch{return b}}function g(b){return i.call(b)==="[object Date]"}return nh}fA();var n5="popstate";function dA(t={}){function e(r,i){let{pathname:a,search:o,hash:c}=r.location;return Um("",{pathname:a,search:o,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Gf(i)}return $w(e,n,null,t)}function hA(t={}){function e(i,a){let{pathname:o="/",search:c="",hash:f=""}=Ru(i.location.hash.substring(1));return!o.startsWith("/")&&!o.startsWith(".")&&(o="/"+o),Um("",{pathname:o,search:c,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(i,a){let o=i.document.querySelector("base"),c="";if(o&&o.getAttribute("href")){let f=i.location.href,d=f.indexOf("#");c=d===-1?f:f.slice(0,d)}return c+"#"+(typeof a=="string"?a:Gf(a))}function r(i,a){Ba(i.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(a)})`)}return $w(e,n,r,t)}function Qn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Ba(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function pA(){return Math.random().toString(36).substring(2,10)}function r5(t,e){return{usr:t.state,key:t.key,idx:e}}function Um(t,e,n=null,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Ru(e):e,state:n,key:e&&e.key||r||pA()}}function Gf({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ru(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function $w(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,c="POP",f=null,d=p();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function p(){return(o.state||{idx:null}).idx}function g(){c="POP";let k=p(),C=k==null?null:k-d;d=k,f&&f({action:c,location:w.location,delta:C})}function b(k,C){c="PUSH";let L=Um(w.location,k,C);n&&n(L,k),d=p()+1;let j=r5(L,d),z=w.createHref(L);try{o.pushState(j,"",z)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(z)}a&&f&&f({action:c,location:w.location,delta:1})}function y(k,C){c="REPLACE";let L=Um(w.location,k,C);n&&n(L,k),d=p();let j=r5(L,d),z=w.createHref(L);o.replaceState(j,"",z),a&&f&&f({action:c,location:w.location,delta:0})}function N(k){return mA(k)}let w={get action(){return c},get location(){return t(i,o)},listen(k){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(n5,g),f=k,()=>{i.removeEventListener(n5,g),f=null}},createHref(k){return e(i,k)},createURL:N,encodeLocation(k){let C=N(k);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:y,go(k){return o.go(k)}};return w}function mA(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Qn(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:Gf(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Xw(t,e,n="/"){return gA(t,e,n,!1)}function gA(t,e,n,r){let i=typeof e=="string"?Ru(e):e,a=hl(i.pathname||"/",n);if(a==null)return null;let o=Zw(t);yA(o);let c=null;for(let f=0;c==null&&f<o.length;++f){let d=MA(a);c=CA(o[f],d,r)}return c}function Zw(t,e=[],n=[],r=""){let i=(a,o,c)=>{let f={relativePath:c===void 0?a.path||"":c,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};f.relativePath.startsWith("/")&&(Qn(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length));let d=dl([r,f.relativePath]),p=n.concat(f);a.children&&a.children.length>0&&(Qn(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Zw(a.children,e,p,d)),!(a.path==null&&!a.index)&&e.push({path:d,score:NA(d,a.index),routesMeta:p})};return t.forEach((a,o)=>{if(a.path===""||!a.path?.includes("?"))i(a,o);else for(let c of Kw(a.path))i(a,o,c)}),e}function Kw(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=Kw(r.join("/")),c=[];return c.push(...o.map(f=>f===""?a:[a,f].join("/"))),i&&c.push(...o),c.map(f=>t.startsWith("/")&&f===""?"/":f)}function yA(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:AA(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var vA=/^:[\w-]+$/,bA=3,xA=2,wA=1,SA=10,_A=-2,i5=t=>t==="*";function NA(t,e){let n=t.split("/"),r=n.length;return n.some(i5)&&(r+=_A),e&&(r+=xA),n.filter(i=>!i5(i)).reduce((i,a)=>i+(vA.test(a)?bA:a===""?wA:SA),r)}function AA(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function CA(t,e,n=!1){let{routesMeta:r}=t,i={},a="/",o=[];for(let c=0;c<r.length;++c){let f=r[c],d=c===r.length-1,p=a==="/"?e:e.slice(a.length)||"/",g=qm({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},p),b=f.route;if(!g&&d&&n&&!r[r.length-1].route.index&&(g=qm({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},p)),!g)return null;Object.assign(i,g.params),o.push({params:i,pathname:dl([a,g.pathname]),pathnameBase:jA(dl([a,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(a=dl([a,g.pathnameBase]))}return o}function qm(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=kA(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:r.reduce((d,{paramName:p,isOptional:g},b)=>{if(p==="*"){let N=c[b]||"";o=a.slice(0,a.length-N.length).replace(/(.)\/+$/,"$1")}const y=c[b];return g&&!y?d[p]=void 0:d[p]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:t}}function kA(t,e=!1,n=!0){Ba(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,f)=>(r.push({paramName:c,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function MA(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Ba(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function hl(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function LA(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Ru(t):t;return{pathname:n?n.startsWith("/")?n:EA(n,e):e,search:OA(r),hash:TA(i)}}function EA(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function r1(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` 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 DA(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function G2(t){let e=DA(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function $2(t,e,n,r=!1){let i;typeof t=="string"?i=Ru(t):(i={...t},Qn(!i.pathname||!i.pathname.includes("?"),r1("?","pathname","search",i)),Qn(!i.pathname||!i.pathname.includes("#"),r1("#","pathname","hash",i)),Qn(!i.search||!i.search.includes("#"),r1("#","search","hash",i)));let a=t===""||i.pathname==="",o=a?"/":i.pathname,c;if(o==null)c=n;else{let g=e.length-1;if(!r&&o.startsWith("..")){let b=o.split("/");for(;b[0]==="..";)b.shift(),g-=1;i.pathname=b.join("/")}c=g>=0?e[g]:"/"}let f=LA(i,c),d=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(d||p)&&(f.pathname+="/"),f}var dl=t=>t.join("/").replace(/\/\/+/g,"/"),jA=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),OA=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,TA=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function RA(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}var Qw=["POST","PUT","PATCH","DELETE"];new Set(Qw);var PA=["GET",...Qw];new Set(PA);var Qf=E.createContext(null);Qf.displayName="DataRouter";var hg=E.createContext(null);hg.displayName="DataRouterState";var Jw=E.createContext({isTransitioning:!1});Jw.displayName="ViewTransition";var BA=E.createContext(new Map);BA.displayName="Fetchers";var FA=E.createContext(null);FA.displayName="Await";var ys=E.createContext(null);ys.displayName="Navigation";var Hh=E.createContext(null);Hh.displayName="Location";var vs=E.createContext({outlet:null,matches:[],isDataRoute:!1});vs.displayName="Route";var X2=E.createContext(null);X2.displayName="RouteError";function IA(t,{relative:e}={}){Qn(Jf(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=E.useContext(ys),{hash:i,pathname:a,search:o}=Uh(t,{relative:e}),c=a;return n!=="/"&&(c=a==="/"?n:dl([n,a])),r.createHref({pathname:c,search:o,hash:i})}function Jf(){return E.useContext(Hh)!=null}function xo(){return Qn(Jf(),"useLocation() may be used only in the context of a <Router> component."),E.useContext(Hh).location}var eS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function tS(t){E.useContext(ys).static||E.useLayoutEffect(t)}function Pu(){let{isDataRoute:t}=E.useContext(vs);return t?JA():zA()}function zA(){Qn(Jf(),"useNavigate() may be used only in the context of a <Router> component.");let t=E.useContext(Qf),{basename:e,navigator:n}=E.useContext(ys),{matches:r}=E.useContext(vs),{pathname:i}=xo(),a=JSON.stringify(G2(r)),o=E.useRef(!1);return tS(()=>{o.current=!0}),E.useCallback((f,d={})=>{if(Ba(o.current,eS),!o.current)return;if(typeof f=="number"){n.go(f);return}let p=$2(f,JSON.parse(a),i,d.relative==="path");t==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:dl([e,p.pathname])),(d.replace?n.replace:n.push)(p,d.state,d)},[e,n,a,i,t])}E.createContext(null);function HA(){let{matches:t}=E.useContext(vs),e=t[t.length-1];return e?e.params:{}}function Uh(t,{relative:e}={}){let{matches:n}=E.useContext(vs),{pathname:r}=xo(),i=JSON.stringify(G2(n));return E.useMemo(()=>$2(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function UA(t,e){return nS(t,e)}function nS(t,e,n,r){Qn(Jf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=E.useContext(ys),{matches:a}=E.useContext(vs),o=a[a.length-1],c=o?o.params:{},f=o?o.pathname:"/",d=o?o.pathnameBase:"/",p=o&&o.route;{let C=p&&p.path||"";rS(f,!p||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let g=xo(),b;if(e){let C=typeof e=="string"?Ru(e):e;Qn(d==="/"||C.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${C.pathname}" was given in the \`location\` prop.`),b=C}else b=g;let y=b.pathname||"/",N=y;if(d!=="/"){let C=d.replace(/^\//,"").split("/");N="/"+y.replace(/^\//,"").split("/").slice(C.length).join("/")}let w=Xw(t,{pathname:N});Ba(p||w!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Ba(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let k=GA(w&&w.map(C=>Object.assign({},C,{params:Object.assign({},c,C.params),pathname:dl([d,i.encodeLocation?i.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?d:dl([d,i.encodeLocation?i.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),a,n,r);return e&&k?E.createElement(Hh.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},k):k}function qA(){let t=QA(),e=RA(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=E.createElement(E.Fragment,null,E.createElement("p",null,"💿 Hey developer 👋"),E.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",E.createElement("code",{style:a},"ErrorBoundary")," or"," ",E.createElement("code",{style:a},"errorElement")," prop on your route.")),E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},e),n?E.createElement("pre",{style:i},n):null,o)}var WA=E.createElement(qA,null),YA=class extends E.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,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){console.error("React Router caught the following error during render",t,e)}render(){return this.state.error!==void 0?E.createElement(vs.Provider,{value:this.props.routeContext},E.createElement(X2.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function VA({routeContext:t,match:e,children:n}){let r=E.useContext(Qf);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),E.createElement(vs.Provider,{value:t},n)}function GA(t,e=[],n=null,r=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let i=t,a=n?.errors;if(a!=null){let f=i.findIndex(d=>d.route.id&&a?.[d.route.id]!==void 0);Qn(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,f+1))}let o=!1,c=-1;if(n)for(let f=0;f<i.length;f++){let d=i[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=f),d.route.id){let{loaderData:p,errors:g}=n,b=d.route.loader&&!p.hasOwnProperty(d.route.id)&&(!g||g[d.route.id]===void 0);if(d.route.lazy||b){o=!0,c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((f,d,p)=>{let g,b=!1,y=null,N=null;n&&(g=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||WA,o&&(c<0&&p===0?(rS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,N=null):c===p&&(b=!0,N=d.route.hydrateFallbackElement||null)));let w=e.concat(i.slice(0,p+1)),k=()=>{let C;return g?C=y:b?C=N:d.route.Component?C=E.createElement(d.route.Component,null):d.route.element?C=d.route.element:C=f,E.createElement(VA,{match:d,routeContext:{outlet:f,matches:w,isDataRoute:n!=null},children:C})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?E.createElement(YA,{location:n.location,revalidation:n.revalidation,component:y,error:g,children:k(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):k()},null)}function Z2(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function $A(t){let e=E.useContext(Qf);return Qn(e,Z2(t)),e}function XA(t){let e=E.useContext(hg);return Qn(e,Z2(t)),e}function ZA(t){let e=E.useContext(vs);return Qn(e,Z2(t)),e}function K2(t){let e=ZA(t),n=e.matches[e.matches.length-1];return Qn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function KA(){return K2("useRouteId")}function QA(){let t=E.useContext(X2),e=XA("useRouteError"),n=K2("useRouteError");return t!==void 0?t:e.errors?.[n]}function JA(){let{router:t}=$A("useNavigate"),e=K2("useNavigate"),n=E.useRef(!1);return tS(()=>{n.current=!0}),E.useCallback(async(i,a={})=>{Ba(n.current,eS),n.current&&(typeof i=="number"?t.navigate(i):await t.navigate(i,{fromRouteId:e,...a}))},[t,e])}var a5={};function rS(t,e,n){!e&&!a5[t]&&(a5[t]=!0,Ba(!1,n))}E.memo(eC);function eC({routes:t,future:e,state:n}){return nS(t,void 0,n,e)}function Z1({to:t,replace:e,state:n,relative:r}){Qn(Jf(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=E.useContext(ys);Ba(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=E.useContext(vs),{pathname:o}=xo(),c=Pu(),f=$2(t,G2(a),o,r==="path"),d=JSON.stringify(f);return E.useEffect(()=>{c(JSON.parse(d),{replace:e,state:n,relative:r})},[c,d,r,e,n]),null}function hc(t){Qn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function iS({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:a=!1}){Qn(!Jf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=t.replace(/^\/*/,"/"),c=E.useMemo(()=>({basename:o,navigator:i,static:a,future:{}}),[o,i,a]);typeof n=="string"&&(n=Ru(n));let{pathname:f="/",search:d="",hash:p="",state:g=null,key:b="default"}=n,y=E.useMemo(()=>{let N=hl(f,o);return N==null?null:{location:{pathname:N,search:d,hash:p,state:g,key:b},navigationType:r}},[o,f,d,p,g,b,r]);return Ba(y!=null,`<Router basename="${o}"> is not able to match the URL "${f}${d}${p}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:E.createElement(ys.Provider,{value:c},E.createElement(Hh.Provider,{children:e,value:y}))}function tC({children:t,location:e}){return UA(K1(t),e)}function K1(t,e=[]){let n=[];return E.Children.forEach(t,(r,i)=>{if(!E.isValidElement(r))return;let a=[...e,i];if(r.type===E.Fragment){n.push.apply(n,K1(r.props.children,a));return}Qn(r.type===hc,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Qn(!r.props.index||!r.props.children,"An index route cannot have child routes.");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,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||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=K1(r.props.children,a)),n.push(o)}),n}var km="get",Mm="application/x-www-form-urlencoded";function pg(t){return t!=null&&typeof t.tagName=="string"}function nC(t){return pg(t)&&t.tagName.toLowerCase()==="button"}function rC(t){return pg(t)&&t.tagName.toLowerCase()==="form"}function iC(t){return pg(t)&&t.tagName.toLowerCase()==="input"}function aC(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function sC(t,e){return t.button===0&&(!e||e==="_self")&&!aC(t)}var Zp=null;function oC(){if(Zp===null)try{new FormData(document.createElement("form"),0),Zp=!1}catch{Zp=!0}return Zp}var lC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function i1(t){return t!=null&&!lC.has(t)?(Ba(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Mm}"`),null):t}function cC(t,e){let n,r,i,a,o;if(rC(t)){let c=t.getAttribute("action");r=c?hl(c,e):null,n=t.getAttribute("method")||km,i=i1(t.getAttribute("enctype"))||Mm,a=new FormData(t)}else if(nC(t)||iC(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=t.getAttribute("formaction")||c.getAttribute("action");if(r=f?hl(f,e):null,n=t.getAttribute("formmethod")||c.getAttribute("method")||km,i=i1(t.getAttribute("formenctype"))||i1(c.getAttribute("enctype"))||Mm,a=new FormData(c,t),!oC()){let{name:d,type:p,value:g}=t;if(p==="image"){let b=d?`${d}.`:"";a.append(`${b}x`,"0"),a.append(`${b}y`,"0")}else d&&a.append(d,g)}}else{if(pg(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=km,r=null,i=Mm,o=t}return a&&i==="text/plain"&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function Q2(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}async function uC(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function fC(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function dC(t,e,n){let r=await Promise.all(t.map(async i=>{let a=e.routes[i.route.id];if(a){let o=await uC(a,n);return o.links?o.links():[]}return[]}));return gC(r.flat(1).filter(fC).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function s5(t,e,n,r,i,a){let o=(f,d)=>n[d]?f.route.id!==n[d].route.id:!0,c=(f,d)=>n[d].pathname!==f.pathname||n[d].route.path?.endsWith("*")&&n[d].params["*"]!==f.params["*"];return a==="assets"?e.filter((f,d)=>o(f,d)||c(f,d)):a==="data"?e.filter((f,d)=>{let p=r.routes[f.route.id];if(!p||!p.hasLoader)return!1;if(o(f,d)||c(f,d))return!0;if(f.route.shouldRevalidate){let g=f.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function hC(t,e,{includeHydrateFallback:n}={}){return pC(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function pC(t){return[...new Set(t)]}function mC(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function gC(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let a=JSON.stringify(mC(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var yC=new Set([100,101,204,205]);function vC(t,e){let n=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n.pathname==="/"?n.pathname="_root.data":e&&hl(n.pathname,e)==="/"?n.pathname=`${e.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function aS(){let t=E.useContext(Qf);return Q2(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function bC(){let t=E.useContext(hg);return Q2(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var J2=E.createContext(void 0);J2.displayName="FrameworkContext";function sS(){let t=E.useContext(J2);return Q2(t,"You must render this element inside a <HydratedRouter> element"),t}function xC(t,e){let n=E.useContext(J2),[r,i]=E.useState(!1),[a,o]=E.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:d,onMouseLeave:p,onTouchStart:g}=e,b=E.useRef(null);E.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let w=C=>{C.forEach(L=>{o(L.isIntersecting)})},k=new IntersectionObserver(w,{threshold:.5});return b.current&&k.observe(b.current),()=>{k.disconnect()}}},[t]),E.useEffect(()=>{if(r){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[r]);let y=()=>{i(!0)},N=()=>{i(!1),o(!1)};return n?t!=="intent"?[a,b,{}]:[a,b,{onFocus:rh(c,y),onBlur:rh(f,N),onMouseEnter:rh(d,y),onMouseLeave:rh(p,N),onTouchStart:rh(g,y)}]:[!1,b,{}]}function rh(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function wC({page:t,...e}){let{router:n}=aS(),r=E.useMemo(()=>Xw(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?E.createElement(_C,{page:t,matches:r,...e}):null}function SC(t){let{manifest:e,routeModules:n}=sS(),[r,i]=E.useState([]);return E.useEffect(()=>{let a=!1;return dC(t,e,n).then(o=>{a||i(o)}),()=>{a=!0}},[t,e,n]),r}function _C({page:t,matches:e,...n}){let r=xo(),{manifest:i,routeModules:a}=sS(),{basename:o}=aS(),{loaderData:c,matches:f}=bC(),d=E.useMemo(()=>s5(t,e,f,i,r,"data"),[t,e,f,i,r]),p=E.useMemo(()=>s5(t,e,f,i,r,"assets"),[t,e,f,i,r]),g=E.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let N=new Set,w=!1;if(e.forEach(C=>{let L=i.routes[C.route.id];!L||!L.hasLoader||(!d.some(j=>j.route.id===C.route.id)&&C.route.id in c&&a[C.route.id]?.shouldRevalidate||L.hasClientLoader?w=!0:N.add(C.route.id))}),N.size===0)return[];let k=vC(t,o);return w&&N.size>0&&k.searchParams.set("_routes",e.filter(C=>N.has(C.route.id)).map(C=>C.route.id).join(",")),[k.pathname+k.search]},[o,c,r,i,d,e,t,a]),b=E.useMemo(()=>hC(p,i),[p,i]),y=SC(p);return E.createElement(E.Fragment,null,g.map(N=>E.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...n})),b.map(N=>E.createElement("link",{key:N,rel:"modulepreload",href:N,...n})),y.map(({key:N,link:w})=>E.createElement("link",{key:N,...w})))}function NC(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var oS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{oS&&(window.__reactRouterVersion="7.6.2")}catch{}function AC({basename:t,children:e,window:n}){let r=E.useRef();r.current==null&&(r.current=dA({window:n,v5Compat:!0}));let i=r.current,[a,o]=E.useState({action:i.action,location:i.location}),c=E.useCallback(f=>{E.startTransition(()=>o(f))},[o]);return E.useLayoutEffect(()=>i.listen(c),[i,c]),E.createElement(iS,{basename:t,children:e,location:a.location,navigationType:a.action,navigator:i})}function CC({basename:t,children:e,window:n}){let r=E.useRef();r.current==null&&(r.current=hA({window:n,v5Compat:!0}));let i=r.current,[a,o]=E.useState({action:i.action,location:i.location}),c=E.useCallback(f=>{E.startTransition(()=>o(f))},[o]);return E.useLayoutEffect(()=>i.listen(c),[i,c]),E.createElement(iS,{basename:t,children:e,location:a.location,navigationType:a.action,navigator:i})}var lS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cS=E.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:a,replace:o,state:c,target:f,to:d,preventScrollReset:p,viewTransition:g,...b},y){let{basename:N}=E.useContext(ys),w=typeof d=="string"&&lS.test(d),k,C=!1;if(typeof d=="string"&&w&&(k=d,oS))try{let se=new URL(window.location.href),le=d.startsWith("//")?new URL(se.protocol+d):new URL(d),P=hl(le.pathname,N);le.origin===se.origin&&P!=null?d=P+le.search+le.hash:C=!0}catch{Ba(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let L=IA(d,{relative:i}),[j,z,O]=xC(r,b),K=EC(d,{replace:o,state:c,target:f,preventScrollReset:p,relative:i,viewTransition:g});function q(se){e&&e(se),se.defaultPrevented||K(se)}let H=E.createElement("a",{...b,...O,href:k||L,onClick:C||a?e:q,ref:NC(y,z),target:f,"data-discover":!w&&n==="render"?"true":void 0});return j&&!w?E.createElement(E.Fragment,null,H,E.createElement(wC,{page:L})):H});cS.displayName="Link";var kC=E.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:a,to:o,viewTransition:c,children:f,...d},p){let g=Uh(o,{relative:d.relative}),b=xo(),y=E.useContext(hg),{navigator:N,basename:w}=E.useContext(ys),k=y!=null&&RC(g)&&c===!0,C=N.encodeLocation?N.encodeLocation(g).pathname:g.pathname,L=b.pathname,j=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(L=L.toLowerCase(),j=j?j.toLowerCase():null,C=C.toLowerCase()),j&&w&&(j=hl(j,w)||j);const z=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let O=L===C||!i&&L.startsWith(C)&&L.charAt(z)==="/",K=j!=null&&(j===C||!i&&j.startsWith(C)&&j.charAt(C.length)==="/"),q={isActive:O,isPending:K,isTransitioning:k},H=O?e:void 0,se;typeof r=="function"?se=r(q):se=[r,O?"active":null,K?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let le=typeof a=="function"?a(q):a;return E.createElement(cS,{...d,"aria-current":H,className:se,ref:p,style:le,to:o,viewTransition:c},typeof f=="function"?f(q):f)});kC.displayName="NavLink";var MC=E.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:a,method:o=km,action:c,onSubmit:f,relative:d,preventScrollReset:p,viewTransition:g,...b},y)=>{let N=OC(),w=TC(c,{relative:d}),k=o.toLowerCase()==="get"?"get":"post",C=typeof c=="string"&&lS.test(c),L=j=>{if(f&&f(j),j.defaultPrevented)return;j.preventDefault();let z=j.nativeEvent.submitter,O=z?.getAttribute("formmethod")||o;N(z||j.currentTarget,{fetcherKey:e,method:O,navigate:n,replace:i,state:a,relative:d,preventScrollReset:p,viewTransition:g})};return E.createElement("form",{ref:y,method:k,action:w,onSubmit:r?f:L,...b,"data-discover":!C&&t==="render"?"true":void 0})});MC.displayName="Form";function LC(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function uS(t){let e=E.useContext(Qf);return Qn(e,LC(t)),e}function EC(t,{target:e,replace:n,state:r,preventScrollReset:i,relative:a,viewTransition:o}={}){let c=Pu(),f=xo(),d=Uh(t,{relative:a});return E.useCallback(p=>{if(sC(p,e)){p.preventDefault();let g=n!==void 0?n:Gf(f)===Gf(d);c(t,{replace:g,state:r,preventScrollReset:i,relative:a,viewTransition:o})}},[f,c,d,n,r,e,t,i,a,o])}var DC=0,jC=()=>`__${String(++DC)}__`;function OC(){let{router:t}=uS("useSubmit"),{basename:e}=E.useContext(ys),n=KA();return E.useCallback(async(r,i={})=>{let{action:a,method:o,encType:c,formData:f,body:d}=cC(r,e);if(i.navigate===!1){let p=i.fetcherKey||jC();await t.fetch(p,n,i.action||a,{preventScrollReset:i.preventScrollReset,formData:f,body:d,formMethod:i.method||o,formEncType:i.encType||c,flushSync:i.flushSync})}else await t.navigate(i.action||a,{preventScrollReset:i.preventScrollReset,formData:f,body:d,formMethod:i.method||o,formEncType:i.encType||c,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[t,e,n])}function TC(t,{relative:e}={}){let{basename:n}=E.useContext(ys),r=E.useContext(vs);Qn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...Uh(t||".",{relative:e})},o=xo();if(t==null){a.search=o.search;let c=new URLSearchParams(a.search),f=c.getAll("index");if(f.some(p=>p==="")){c.delete("index"),f.filter(g=>g).forEach(g=>c.append("index",g));let p=c.toString();a.search=p?`?${p}`:""}}return(!t||t===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:dl([n,a.pathname])),Gf(a)}function RC(t,e={}){let n=E.useContext(Jw);Qn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=uS("useViewTransitionState"),i=Uh(t,{relative:e.relative});if(!n.isTransitioning)return!1;let a=hl(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=hl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return qm(i.pathname,o)!=null||qm(i.pathname,a)!=null}[...yC];var qh=Gw();const PC=Y2(qh);function fS(t,e){return function(){return t.apply(e,arguments)}}const{toString:BC}=Object.prototype,{getPrototypeOf:ey}=Object,{iterator:mg,toStringTag:dS}=Symbol,gg=(t=>e=>{const n=BC.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),bs=t=>(t=t.toLowerCase(),e=>gg(e)===t),yg=t=>e=>typeof e===t,{isArray:ed}=Array,Lh=yg("undefined");function FC(t){return t!==null&&!Lh(t)&&t.constructor!==null&&!Lh(t.constructor)&&Zi(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const hS=bs("ArrayBuffer");function IC(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&hS(t.buffer),e}const zC=yg("string"),Zi=yg("function"),pS=yg("number"),vg=t=>t!==null&&typeof t=="object",HC=t=>t===!0||t===!1,Lm=t=>{if(gg(t)!=="object")return!1;const e=ey(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(dS in t)&&!(mg in t)},UC=bs("Date"),qC=bs("File"),WC=bs("Blob"),YC=bs("FileList"),VC=t=>vg(t)&&Zi(t.pipe),GC=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Zi(t.append)&&((e=gg(t))==="formdata"||e==="object"&&Zi(t.toString)&&t.toString()==="[object FormData]"))},$C=bs("URLSearchParams"),[XC,ZC,KC,QC]=["ReadableStream","Request","Response","Headers"].map(bs),JC=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Wh(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),ed(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const a=n?Object.getOwnPropertyNames(t):Object.keys(t),o=a.length;let c;for(r=0;r<o;r++)c=a[r],e.call(null,t[c],c,t)}}function mS(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const wu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,gS=t=>!Lh(t)&&t!==wu;function Q1(){const{caseless:t}=gS(this)&&this||{},e={},n=(r,i)=>{const a=t&&mS(e,i)||i;Lm(e[a])&&Lm(r)?e[a]=Q1(e[a],r):Lm(r)?e[a]=Q1({},r):ed(r)?e[a]=r.slice():e[a]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Wh(arguments[r],n);return e}const e8=(t,e,n,{allOwnKeys:r}={})=>(Wh(e,(i,a)=>{n&&Zi(i)?t[a]=fS(i,n):t[a]=i},{allOwnKeys:r}),t),t8=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),n8=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},r8=(t,e,n,r)=>{let i,a,o;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),a=i.length;a-- >0;)o=i[a],(!r||r(o,t,e))&&!c[o]&&(e[o]=t[o],c[o]=!0);t=n!==!1&&ey(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},i8=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},a8=t=>{if(!t)return null;if(ed(t))return t;let e=t.length;if(!pS(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},s8=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ey(Uint8Array)),o8=(t,e)=>{const r=(t&&t[mg]).call(t);let i;for(;(i=r.next())&&!i.done;){const a=i.value;e.call(t,a[0],a[1])}},l8=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},c8=bs("HTMLFormElement"),u8=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),o5=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),f8=bs("RegExp"),yS=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Wh(n,(i,a)=>{let o;(o=e(i,a,t))!==!1&&(r[a]=o||i)}),Object.defineProperties(t,r)},d8=t=>{yS(t,(e,n)=>{if(Zi(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Zi(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},h8=(t,e)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return ed(t)?r(t):r(String(t).split(e)),n},p8=()=>{},m8=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function g8(t){return!!(t&&Zi(t.append)&&t[dS]==="FormData"&&t[mg])}const y8=t=>{const e=new Array(10),n=(r,i)=>{if(vg(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const a=ed(r)?[]:{};return Wh(r,(o,c)=>{const f=n(o,i+1);!Lh(f)&&(a[c]=f)}),e[i]=void 0,a}}return r};return n(t,0)},v8=bs("AsyncFunction"),b8=t=>t&&(vg(t)||Zi(t))&&Zi(t.then)&&Zi(t.catch),vS=((t,e)=>t?setImmediate:e?((n,r)=>(wu.addEventListener("message",({source:i,data:a})=>{i===wu&&a===n&&r.length&&r.shift()()},!1),i=>{r.push(i),wu.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Zi(wu.postMessage)),x8=typeof queueMicrotask<"u"?queueMicrotask.bind(wu):typeof process<"u"&&process.nextTick||vS,w8=t=>t!=null&&Zi(t[mg]),We={isArray:ed,isArrayBuffer:hS,isBuffer:FC,isFormData:GC,isArrayBufferView:IC,isString:zC,isNumber:pS,isBoolean:HC,isObject:vg,isPlainObject:Lm,isReadableStream:XC,isRequest:ZC,isResponse:KC,isHeaders:QC,isUndefined:Lh,isDate:UC,isFile:qC,isBlob:WC,isRegExp:f8,isFunction:Zi,isStream:VC,isURLSearchParams:$C,isTypedArray:s8,isFileList:YC,forEach:Wh,merge:Q1,extend:e8,trim:JC,stripBOM:t8,inherits:n8,toFlatObject:r8,kindOf:gg,kindOfTest:bs,endsWith:i8,toArray:a8,forEachEntry:o8,matchAll:l8,isHTMLForm:c8,hasOwnProperty:o5,hasOwnProp:o5,reduceDescriptors:yS,freezeMethods:d8,toObjectSet:h8,toCamelCase:u8,noop:p8,toFiniteNumber:m8,findKey:mS,global:wu,isContextDefined:gS,isSpecCompliantForm:g8,toJSONObject:y8,isAsyncFn:v8,isThenable:b8,setImmediate:vS,asap:x8,isIterable:w8};function qt(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}We.inherits(qt,Error,{toJSON:function(){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:We.toJSONObject(this.config),code:this.code,status:this.status}}});const bS=qt.prototype,xS={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{xS[t]={value:t}});Object.defineProperties(qt,xS);Object.defineProperty(bS,"isAxiosError",{value:!0});qt.from=(t,e,n,r,i,a)=>{const o=Object.create(bS);return We.toFlatObject(t,o,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),qt.call(o,t.message,e,n,r,i),o.cause=t,o.name=t.name,a&&Object.assign(o,a),o};const S8=null;function J1(t){return We.isPlainObject(t)||We.isArray(t)}function wS(t){return We.endsWith(t,"[]")?t.slice(0,-2):t}function l5(t,e,n){return t?t.concat(e).map(function(i,a){return i=wS(i),!n&&a?"["+i+"]":i}).join(n?".":""):e}function _8(t){return We.isArray(t)&&!t.some(J1)}const N8=We.toFlatObject(We,{},null,function(e){return/^is[A-Z]/.test(e)});function bg(t,e,n){if(!We.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=We.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,k){return!We.isUndefined(k[w])});const r=n.metaTokens,i=n.visitor||p,a=n.dots,o=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&We.isSpecCompliantForm(e);if(!We.isFunction(i))throw new TypeError("visitor must be a function");function d(N){if(N===null)return"";if(We.isDate(N))return N.toISOString();if(We.isBoolean(N))return N.toString();if(!f&&We.isBlob(N))throw new qt("Blob is not supported. Use a Buffer instead.");return We.isArrayBuffer(N)||We.isTypedArray(N)?f&&typeof Blob=="function"?new Blob([N]):Buffer.from(N):N}function p(N,w,k){let C=N;if(N&&!k&&typeof N=="object"){if(We.endsWith(w,"{}"))w=r?w:w.slice(0,-2),N=JSON.stringify(N);else if(We.isArray(N)&&_8(N)||(We.isFileList(N)||We.endsWith(w,"[]"))&&(C=We.toArray(N)))return w=wS(w),C.forEach(function(j,z){!(We.isUndefined(j)||j===null)&&e.append(o===!0?l5([w],z,a):o===null?w:w+"[]",d(j))}),!1}return J1(N)?!0:(e.append(l5(k,w,a),d(N)),!1)}const g=[],b=Object.assign(N8,{defaultVisitor:p,convertValue:d,isVisitable:J1});function y(N,w){if(!We.isUndefined(N)){if(g.indexOf(N)!==-1)throw Error("Circular reference detected in "+w.join("."));g.push(N),We.forEach(N,function(C,L){(!(We.isUndefined(C)||C===null)&&i.call(e,C,We.isString(L)?L.trim():L,w,b))===!0&&y(C,w?w.concat(L):[L])}),g.pop()}}if(!We.isObject(t))throw new TypeError("data must be an object");return y(t),e}function c5(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function ty(t,e){this._pairs=[],t&&bg(t,this,e)}const SS=ty.prototype;SS.append=function(e,n){this._pairs.push([e,n])};SS.toString=function(e){const n=e?function(r){return e.call(this,r,c5)}:c5;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function A8(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _S(t,e,n){if(!e)return t;const r=n&&n.encode||A8;We.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let a;if(i?a=i(e,n):a=We.isURLSearchParams(e)?e.toString():new ty(e,n).toString(r),a){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class u5{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){We.forEach(this.handlers,function(r){r!==null&&e(r)})}}const NS={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},C8=typeof URLSearchParams<"u"?URLSearchParams:ty,k8=typeof FormData<"u"?FormData:null,M8=typeof Blob<"u"?Blob:null,L8={isBrowser:!0,classes:{URLSearchParams:C8,FormData:k8,Blob:M8},protocols:["http","https","file","blob","url","data"]},ny=typeof window<"u"&&typeof document<"u",e2=typeof navigator=="object"&&navigator||void 0,E8=ny&&(!e2||["ReactNative","NativeScript","NS"].indexOf(e2.product)<0),D8=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",j8=ny&&window.location.href||"http://localhost",O8=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ny,hasStandardBrowserEnv:E8,hasStandardBrowserWebWorkerEnv:D8,navigator:e2,origin:j8},Symbol.toStringTag,{value:"Module"})),xi={...O8,...L8};function T8(t,e){return bg(t,new xi.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,a){return xi.isNode&&We.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function R8(t){return We.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function P8(t){const e={},n=Object.keys(t);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],e[a]=t[a];return e}function AS(t){function e(n,r,i,a){let o=n[a++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),f=a>=n.length;return o=!o&&We.isArray(i)?i.length:o,f?(We.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!c):((!i[o]||!We.isObject(i[o]))&&(i[o]=[]),e(n,r,i[o],a)&&We.isArray(i[o])&&(i[o]=P8(i[o])),!c)}if(We.isFormData(t)&&We.isFunction(t.entries)){const n={};return We.forEachEntry(t,(r,i)=>{e(R8(r),i,n,0)}),n}return null}function B8(t,e,n){if(We.isString(t))try{return(e||JSON.parse)(t),We.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Yh={transitional:NS,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,a=We.isObject(e);if(a&&We.isHTMLForm(e)&&(e=new FormData(e)),We.isFormData(e))return i?JSON.stringify(AS(e)):e;if(We.isArrayBuffer(e)||We.isBuffer(e)||We.isStream(e)||We.isFile(e)||We.isBlob(e)||We.isReadableStream(e))return e;if(We.isArrayBufferView(e))return e.buffer;if(We.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return T8(e,this.formSerializer).toString();if((c=We.isFileList(e))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return bg(c?{"files[]":e}:e,f&&new f,this.formSerializer)}}return a||i?(n.setContentType("application/json",!1),B8(e)):e}],transformResponse:[function(e){const n=this.transitional||Yh.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(We.isResponse(e)||We.isReadableStream(e))return e;if(e&&We.isString(e)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(o)throw c.name==="SyntaxError"?qt.from(c,qt.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xi.classes.FormData,Blob:xi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};We.forEach(["delete","get","head","post","put","patch"],t=>{Yh.headers[t]={}});const F8=We.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"]),I8=t=>{const e={};let n,r,i;return t&&t.split(`
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||e[n]&&F8[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},f5=Symbol("internals");function ih(t){return t&&String(t).trim().toLowerCase()}function Em(t){return t===!1||t==null?t:We.isArray(t)?t.map(Em):String(t)}function z8(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const H8=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function a1(t,e,n,r,i){if(We.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!We.isString(e)){if(We.isString(r))return e.indexOf(r)!==-1;if(We.isRegExp(r))return r.test(e)}}function U8(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function q8(t,e){const n=We.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,a,o){return this[r].call(this,e,i,a,o)},configurable:!0})})}let Ki=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function a(c,f,d){const p=ih(f);if(!p)throw new Error("header name must be a non-empty string");const g=We.findKey(i,p);(!g||i[g]===void 0||d===!0||d===void 0&&i[g]!==!1)&&(i[g||f]=Em(c))}const o=(c,f)=>We.forEach(c,(d,p)=>a(d,p,f));if(We.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(We.isString(e)&&(e=e.trim())&&!H8(e))o(I8(e),n);else if(We.isObject(e)&&We.isIterable(e)){let c={},f,d;for(const p of e){if(!We.isArray(p))throw TypeError("Object iterator must return a key-value pair");c[d=p[0]]=(f=c[d])?We.isArray(f)?[...f,p[1]]:[f,p[1]]:p[1]}o(c,n)}else e!=null&&a(n,e,r);return this}get(e,n){if(e=ih(e),e){const r=We.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return z8(i);if(We.isFunction(n))return n.call(this,i,r);if(We.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=ih(e),e){const r=We.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||a1(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function a(o){if(o=ih(o),o){const c=We.findKey(r,o);c&&(!n||a1(r,r[c],c,n))&&(delete r[c],i=!0)}}return We.isArray(e)?e.forEach(a):a(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const a=n[r];(!e||a1(this,this[a],a,e,!0))&&(delete this[a],i=!0)}return i}normalize(e){const n=this,r={};return We.forEach(this,(i,a)=>{const o=We.findKey(r,a);if(o){n[o]=Em(i),delete n[a];return}const c=e?U8(a):String(a).trim();c!==a&&delete n[a],n[c]=Em(i),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return We.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&We.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[f5]=this[f5]={accessors:{}}).accessors,i=this.prototype;function a(o){const c=ih(o);r[c]||(q8(i,o),r[c]=!0)}return We.isArray(e)?e.forEach(a):a(e),this}};Ki.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);We.reduceDescriptors(Ki.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});We.freezeMethods(Ki);function s1(t,e){const n=this||Yh,r=e||n,i=Ki.from(r.headers);let a=r.data;return We.forEach(t,function(c){a=c.call(n,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function CS(t){return!!(t&&t.__CANCEL__)}function td(t,e,n){qt.call(this,t??"canceled",qt.ERR_CANCELED,e,n),this.name="CanceledError"}We.inherits(td,qt,{__CANCEL__:!0});function kS(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new qt("Request failed with status code "+n.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function W8(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Y8(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,a=0,o;return e=e!==void 0?e:1e3,function(f){const d=Date.now(),p=r[a];o||(o=d),n[i]=f,r[i]=d;let g=a,b=0;for(;g!==i;)b+=n[g++],g=g%t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),d-o<e)return;const y=p&&d-p;return y?Math.round(b*1e3/y):void 0}}function V8(t,e){let n=0,r=1e3/e,i,a;const o=(d,p=Date.now())=>{n=p,i=null,a&&(clearTimeout(a),a=null),t.apply(null,d)};return[(...d)=>{const p=Date.now(),g=p-n;g>=r?o(d,p):(i=d,a||(a=setTimeout(()=>{a=null,o(i)},r-g)))},()=>i&&o(i)]}const Wm=(t,e,n=3)=>{let r=0;const i=Y8(50,250);return V8(a=>{const o=a.loaded,c=a.lengthComputable?a.total:void 0,f=o-r,d=i(f),p=o<=c;r=o;const g={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:d||void 0,estimated:d&&c&&p?(c-o)/d:void 0,event:a,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(g)},n)},d5=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},h5=t=>(...e)=>We.asap(()=>t(...e)),G8=xi.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,xi.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(xi.origin),xi.navigator&&/(msie|trident)/i.test(xi.navigator.userAgent)):()=>!0,$8=xi.hasStandardBrowserEnv?{write(t,e,n,r,i,a){const o=[t+"="+encodeURIComponent(e)];We.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),We.isString(r)&&o.push("path="+r),We.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function X8(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Z8(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function MS(t,e,n){let r=!X8(e);return t&&(r||n==!1)?Z8(t,e):e}const p5=t=>t instanceof Ki?{...t}:t;function ku(t,e){e=e||{};const n={};function r(d,p,g,b){return We.isPlainObject(d)&&We.isPlainObject(p)?We.merge.call({caseless:b},d,p):We.isPlainObject(p)?We.merge({},p):We.isArray(p)?p.slice():p}function i(d,p,g,b){if(We.isUndefined(p)){if(!We.isUndefined(d))return r(void 0,d,g,b)}else return r(d,p,g,b)}function a(d,p){if(!We.isUndefined(p))return r(void 0,p)}function o(d,p){if(We.isUndefined(p)){if(!We.isUndefined(d))return r(void 0,d)}else return r(void 0,p)}function c(d,p,g){if(g in e)return r(d,p);if(g in t)return r(void 0,d)}const f={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,responseEncoding:o,validateStatus:c,headers:(d,p,g)=>i(p5(d),p5(p),g,!0)};return We.forEach(Object.keys(Object.assign({},t,e)),function(p){const g=f[p]||i,b=g(t[p],e[p],p);We.isUndefined(b)&&g!==c||(n[p]=b)}),n}const LS=t=>{const e=ku({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:c}=e;e.headers=o=Ki.from(o),e.url=_S(MS(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(We.isFormData(n)){if(xi.hasStandardBrowserEnv||xi.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((f=o.getContentType())!==!1){const[d,...p]=f?f.split(";").map(g=>g.trim()).filter(Boolean):[];o.setContentType([d||"multipart/form-data",...p].join("; "))}}if(xi.hasStandardBrowserEnv&&(r&&We.isFunction(r)&&(r=r(e)),r||r!==!1&&G8(e.url))){const d=i&&a&&$8.read(a);d&&o.set(i,d)}return e},K8=typeof XMLHttpRequest<"u",Q8=K8&&function(t){return new Promise(function(n,r){const i=LS(t);let a=i.data;const o=Ki.from(i.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:d}=i,p,g,b,y,N;function w(){y&&y(),N&&N(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let k=new XMLHttpRequest;k.open(i.method.toUpperCase(),i.url,!0),k.timeout=i.timeout;function C(){if(!k)return;const j=Ki.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),O={data:!c||c==="text"||c==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:j,config:t,request:k};kS(function(q){n(q),w()},function(q){r(q),w()},O),k=null}"onloadend"in k?k.onloadend=C:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(C)},k.onabort=function(){k&&(r(new qt("Request aborted",qt.ECONNABORTED,t,k)),k=null)},k.onerror=function(){r(new qt("Network Error",qt.ERR_NETWORK,t,k)),k=null},k.ontimeout=function(){let z=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const O=i.transitional||NS;i.timeoutErrorMessage&&(z=i.timeoutErrorMessage),r(new qt(z,O.clarifyTimeoutError?qt.ETIMEDOUT:qt.ECONNABORTED,t,k)),k=null},a===void 0&&o.setContentType(null),"setRequestHeader"in k&&We.forEach(o.toJSON(),function(z,O){k.setRequestHeader(O,z)}),We.isUndefined(i.withCredentials)||(k.withCredentials=!!i.withCredentials),c&&c!=="json"&&(k.responseType=i.responseType),d&&([b,N]=Wm(d,!0),k.addEventListener("progress",b)),f&&k.upload&&([g,y]=Wm(f),k.upload.addEventListener("progress",g),k.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(p=j=>{k&&(r(!j||j.type?new td(null,t,k):j),k.abort(),k=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const L=W8(i.url);if(L&&xi.protocols.indexOf(L)===-1){r(new qt("Unsupported protocol "+L+":",qt.ERR_BAD_REQUEST,t));return}k.send(a||null)})},J8=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const a=function(d){if(!i){i=!0,c();const p=d instanceof Error?d:this.reason;r.abort(p instanceof qt?p:new td(p instanceof Error?p.message:p))}};let o=e&&setTimeout(()=>{o=null,a(new qt(`timeout ${e} of ms exceeded`,qt.ETIMEDOUT))},e);const c=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(a):d.removeEventListener("abort",a)}),t=null)};t.forEach(d=>d.addEventListener("abort",a));const{signal:f}=r;return f.unsubscribe=()=>We.asap(c),f}},ek=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},tk=async function*(t,e){for await(const n of nk(t))yield*ek(n,e)},nk=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},m5=(t,e,n,r)=>{const i=tk(t,e);let a=0,o,c=f=>{o||(o=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:d,value:p}=await i.next();if(d){c(),f.close();return}let g=p.byteLength;if(n){let b=a+=g;n(b)}f.enqueue(new Uint8Array(p))}catch(d){throw c(d),d}},cancel(f){return c(f),i.return()}},{highWaterMark:2})},xg=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ES=xg&&typeof ReadableStream=="function",rk=xg&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),DS=(t,...e)=>{try{return!!t(...e)}catch{return!1}},ik=ES&&DS(()=>{let t=!1;const e=new Request(xi.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),g5=64*1024,t2=ES&&DS(()=>We.isReadableStream(new Response("").body)),Ym={stream:t2&&(t=>t.body)};xg&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ym[e]&&(Ym[e]=We.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new qt(`Response type '${e}' is not supported`,qt.ERR_NOT_SUPPORT,r)})})})(new Response);const ak=async t=>{if(t==null)return 0;if(We.isBlob(t))return t.size;if(We.isSpecCompliantForm(t))return(await new Request(xi.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(We.isArrayBufferView(t)||We.isArrayBuffer(t))return t.byteLength;if(We.isURLSearchParams(t)&&(t=t+""),We.isString(t))return(await rk(t)).byteLength},sk=async(t,e)=>{const n=We.toFiniteNumber(t.getContentLength());return n??ak(e)},ok=xg&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:a,timeout:o,onDownloadProgress:c,onUploadProgress:f,responseType:d,headers:p,withCredentials:g="same-origin",fetchOptions:b}=LS(t);d=d?(d+"").toLowerCase():"text";let y=J8([i,a&&a.toAbortSignal()],o),N;const w=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let k;try{if(f&&ik&&n!=="get"&&n!=="head"&&(k=await sk(p,r))!==0){let O=new Request(e,{method:"POST",body:r,duplex:"half"}),K;if(We.isFormData(r)&&(K=O.headers.get("content-type"))&&p.setContentType(K),O.body){const[q,H]=d5(k,Wm(h5(f)));r=m5(O.body,g5,q,H)}}We.isString(g)||(g=g?"include":"omit");const C="credentials"in Request.prototype;N=new Request(e,{...b,signal:y,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:C?g:void 0});let L=await fetch(N,b);const j=t2&&(d==="stream"||d==="response");if(t2&&(c||j&&w)){const O={};["status","statusText","headers"].forEach(se=>{O[se]=L[se]});const K=We.toFiniteNumber(L.headers.get("content-length")),[q,H]=c&&d5(K,Wm(h5(c),!0))||[];L=new Response(m5(L.body,g5,q,()=>{H&&H(),w&&w()}),O)}d=d||"text";let z=await Ym[We.findKey(Ym,d)||"text"](L,t);return!j&&w&&w(),await new Promise((O,K)=>{kS(O,K,{data:z,headers:Ki.from(L.headers),status:L.status,statusText:L.statusText,config:t,request:N})})}catch(C){throw w&&w(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new qt("Network Error",qt.ERR_NETWORK,t,N),{cause:C.cause||C}):qt.from(C,C&&C.code,t,N)}}),n2={http:S8,xhr:Q8,fetch:ok};We.forEach(n2,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const y5=t=>`- ${t}`,lk=t=>We.isFunction(t)||t===null||t===!1,jS={getAdapter:t=>{t=We.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let a=0;a<e;a++){n=t[a];let o;if(r=n,!lk(n)&&(r=n2[(o=String(n)).toLowerCase()],r===void 0))throw new qt(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+a]=r}if(!r){const a=Object.entries(i).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let o=e?a.length>1?`since :
`+a.map(y5).join(`
`):" "+y5(a[0]):"as no adapter specified";throw new qt("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:n2};function o1(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new td(null,t)}function v5(t){return o1(t),t.headers=Ki.from(t.headers),t.data=s1.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),jS.getAdapter(t.adapter||Yh.adapter)(t).then(function(r){return o1(t),r.data=s1.call(t,t.transformResponse,r),r.headers=Ki.from(r.headers),r},function(r){return CS(r)||(o1(t),r&&r.response&&(r.response.data=s1.call(t,t.transformResponse,r.response),r.response.headers=Ki.from(r.response.headers))),Promise.reject(r)})}const OS="1.10.0",wg={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{wg[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const b5={};wg.transitional=function(e,n,r){function i(a,o){return"[Axios v"+OS+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,c)=>{if(e===!1)throw new qt(i(o," has been removed"+(n?" in "+n:"")),qt.ERR_DEPRECATED);return n&&!b5[o]&&(b5[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(a,o,c):!0}};wg.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function ck(t,e,n){if(typeof t!="object")throw new qt("options must be an object",qt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const a=r[i],o=e[a];if(o){const c=t[a],f=c===void 0||o(c,a,t);if(f!==!0)throw new qt("option "+a+" must be "+f,qt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new qt("Unknown option "+a,qt.ERR_BAD_OPTION)}}const Dm={assertOptions:ck,validators:wg},no=Dm.validators;let Nu=class{constructor(e){this.defaults=e||{},this.interceptors={request:new u5,response:new u5}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+a):r.stack=a}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ku(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:a}=n;r!==void 0&&Dm.assertOptions(r,{silentJSONParsing:no.transitional(no.boolean),forcedJSONParsing:no.transitional(no.boolean),clarifyTimeoutError:no.transitional(no.boolean)},!1),i!=null&&(We.isFunction(i)?n.paramsSerializer={serialize:i}:Dm.assertOptions(i,{encode:no.function,serialize:no.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Dm.assertOptions(n,{baseUrl:no.spelling("baseURL"),withXsrfToken:no.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&We.merge(a.common,a[n.method]);a&&We.forEach(["delete","get","head","post","put","patch","common"],N=>{delete a[N]}),n.headers=Ki.concat(o,a);const c=[];let f=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(f=f&&w.synchronous,c.unshift(w.fulfilled,w.rejected))});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let p,g=0,b;if(!f){const N=[v5.bind(this),void 0];for(N.unshift.apply(N,c),N.push.apply(N,d),b=N.length,p=Promise.resolve(n);g<b;)p=p.then(N[g++],N[g++]);return p}b=c.length;let y=n;for(g=0;g<b;){const N=c[g++],w=c[g++];try{y=N(y)}catch(k){w.call(this,k);break}}try{p=v5.call(this,y)}catch(N){return Promise.reject(N)}for(g=0,b=d.length;g<b;)p=p.then(d[g++],d[g++]);return p}getUri(e){e=ku(this.defaults,e);const n=MS(e.baseURL,e.url,e.allowAbsoluteUrls);return _S(n,e.params,e.paramsSerializer)}};We.forEach(["delete","get","head","options"],function(e){Nu.prototype[e]=function(n,r){return this.request(ku(r||{},{method:e,url:n,data:(r||{}).data}))}});We.forEach(["post","put","patch"],function(e){function n(r){return function(a,o,c){return this.request(ku(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}Nu.prototype[e]=n(),Nu.prototype[e+"Form"]=n(!0)});let uk=class TS{constructor(e){if(typeof e!="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(i=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](i);r._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(c=>{r.subscribe(c),a=c}).then(i);return o.cancel=function(){r.unsubscribe(a)},o},e(function(a,o,c){r.reason||(r.reason=new td(a,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new TS(function(i){e=i}),cancel:e}}};function fk(t){return function(n){return t.apply(null,n)}}function dk(t){return We.isObject(t)&&t.isAxiosError===!0}const r2={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent: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};Object.entries(r2).forEach(([t,e])=>{r2[e]=t});function RS(t){const e=new Nu(t),n=fS(Nu.prototype.request,e);return We.extend(n,Nu.prototype,e,{allOwnKeys:!0}),We.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return RS(ku(t,i))},n}const Lr=RS(Yh);Lr.Axios=Nu;Lr.CanceledError=td;Lr.CancelToken=uk;Lr.isCancel=CS;Lr.VERSION=OS;Lr.toFormData=bg;Lr.AxiosError=qt;Lr.Cancel=Lr.CanceledError;Lr.all=function(e){return Promise.all(e)};Lr.spread=fk;Lr.isAxiosError=dk;Lr.mergeConfig=ku;Lr.AxiosHeaders=Ki;Lr.formToJSON=t=>AS(We.isHTMLForm(t)?new FormData(t):t);Lr.getAdapter=jS.getAdapter;Lr.HttpStatusCode=r2;Lr.default=Lr;const{Axios:SI,AxiosError:_I,CanceledError:NI,isCancel:AI,CancelToken:CI,VERSION:kI,all:MI,Cancel:LI,isAxiosError:EI,spread:DI,toFormData:jI,AxiosHeaders:OI,HttpStatusCode:TI,formToJSON:RI,getAdapter:PI,mergeConfig:BI}=Lr,or=Lr.create({baseURL:"https://cyberhawk.pushpak.cloud/api"});or.interceptors.request.use(t=>{const e=localStorage.getItem("accessToken"),n=localStorage.getItem("tokenTimestamp");if(e&&n){const i=Date.now()-parseInt(n),a=8*60*60*1e3;if(i>a)return console.log("Token expired (8 hours), logging out user"),localStorage.removeItem("accessToken"),localStorage.removeItem("tokenTimestamp"),window.location.href="/login",Promise.reject(new Error("Token expired"))}return e?(t.headers.Authorization=`Bearer ${e}`,console.log("Adding auth token to request:",t.url)):console.log("No auth token found for request:",t.url),t},t=>Promise.reject(t));or.interceptors.response.use(t=>(console.log("API Response received:",t.status,t.config.url),t),t=>{if(t.response&&t.response.status===401){if(t.config.headers&&t.config.headers["X-Skip-Auth-Redirect"])return console.log("Skipping auth redirect due to X-Skip-Auth-Redirect header"),Promise.reject(t);console.error("Authentication Error: Token is invalid or expired. Logging out."),localStorage.removeItem("accessToken"),window.location.href="/login"}return Promise.reject(t)});const x5=()=>{localStorage.setItem("tokenTimestamp",Date.now().toString()),console.log("Token timestamp set for 8-hour expiration")},hk=()=>{const t=localStorage.getItem("accessToken"),e=localStorage.getItem("tokenTimestamp");if(!t||!e)return!0;const r=Date.now()-parseInt(e),i=8*60*60*1e3;return r>i},pk=()=>{const t=localStorage.getItem("tokenTimestamp");if(!t)return 0;const n=Date.now()-parseInt(t),r=8*60*60*1e3;return Math.max(0,r-n)},w5=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("tokenTimestamp"),window.location.href="/login"};function PS(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=PS(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function BS(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=PS(t))&&(r&&(r+=" "),r+=e);return r}const ry="-",mk=t=>{const e=yk(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const c=o.split(ry);return c[0]===""&&c.length!==1&&c.shift(),FS(c,e)||gk(o)},getConflictingClassGroupIds:(o,c)=>{const f=n[o]||[];return c&&r[o]?[...f,...r[o]]:f}}},FS=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?FS(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const a=t.join(ry);return e.validators.find(({validator:o})=>o(a))?.classGroupId},S5=/^\[(.+)\]$/,gk=t=>{if(S5.test(t)){const e=S5.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},yk=t=>{const{theme:e,classGroups:n}=t,r={nextPart:new Map,validators:[]};for(const i in n)i2(n[i],r,i,e);return r},i2=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const a=i===""?e:_5(e,i);a.classGroupId=n;return}if(typeof i=="function"){if(vk(i)){i2(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,o])=>{i2(o,_5(e,a),n,r)})})},_5=(t,e)=>{let n=t;return e.split(ry).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},vk=t=>t.isThemeGetter,bk=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(a,o)=>{n.set(a,o),e++,e>t&&(e=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 i(a,o),o},set(a,o){n.has(a)?n.set(a,o):i(a,o)}}},a2="!",s2=":",xk=s2.length,wk=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const a=[];let o=0,c=0,f=0,d;for(let N=0;N<i.length;N++){let w=i[N];if(o===0&&c===0){if(w===s2){a.push(i.slice(f,N)),f=N+xk;continue}if(w==="/"){d=N;continue}}w==="["?o++:w==="]"?o--:w==="("?c++:w===")"&&c--}const p=a.length===0?i:i.substring(f),g=Sk(p),b=g!==p,y=d&&d>f?d-f:void 0;return{modifiers:a,hasImportantModifier:b,baseClassName:g,maybePostfixModifierPosition:y}};if(e){const i=e+s2,a=r;r=o=>o.startsWith(i)?a(o.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Sk=t=>t.endsWith(a2)?t.substring(0,t.length-1):t.startsWith(a2)?t.substring(1):t,_k=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let a=[];return r.forEach(o=>{o[0]==="["||e[o]?(i.push(...a.sort(),o),a=[]):a.push(o)}),i.push(...a.sort()),i}},Nk=t=>({cache:bk(t.cacheSize),parseClassName:wk(t),sortModifiers:_k(t),...mk(t)}),Ak=/\s+/,Ck=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=e,o=[],c=t.trim().split(Ak);let f="";for(let d=c.length-1;d>=0;d-=1){const p=c[d],{isExternal:g,modifiers:b,hasImportantModifier:y,baseClassName:N,maybePostfixModifierPosition:w}=n(p);if(g){f=p+(f.length>0?" "+f:f);continue}let k=!!w,C=r(k?N.substring(0,w):N);if(!C){if(!k){f=p+(f.length>0?" "+f:f);continue}if(C=r(N),!C){f=p+(f.length>0?" "+f:f);continue}k=!1}const L=a(b).join(":"),j=y?L+a2:L,z=j+C;if(o.includes(z))continue;o.push(z);const O=i(C,k);for(let K=0;K<O.length;++K){const q=O[K];o.push(j+q)}f=p+(f.length>0?" "+f:f)}return f};function kk(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=IS(e))&&(r&&(r+=" "),r+=n);return r}const IS=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=IS(t[r]))&&(n&&(n+=" "),n+=e);return n};function Mk(t,...e){let n,r,i,a=o;function o(f){const d=e.reduce((p,g)=>g(p),t());return n=Nk(d),r=n.cache.get,i=n.cache.set,a=c,c(f)}function c(f){const d=r(f);if(d)return d;const p=Ck(f,n);return i(f,p),p}return function(){return a(kk.apply(null,arguments))}}const Hr=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},zS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,HS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Lk=/^\d+\/\d+$/,Ek=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dk=/\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$/,jk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ok=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cf=t=>Lk.test(t),Kt=t=>!!t&&!Number.isNaN(Number(t)),cc=t=>!!t&&Number.isInteger(Number(t)),l1=t=>t.endsWith("%")&&Kt(t.slice(0,-1)),nl=t=>Ek.test(t),Rk=()=>!0,Pk=t=>Dk.test(t)&&!jk.test(t),US=()=>!1,Bk=t=>Ok.test(t),Fk=t=>Tk.test(t),Ik=t=>!yt(t)&&!vt(t),zk=t=>nd(t,YS,US),yt=t=>zS.test(t),du=t=>nd(t,VS,Pk),c1=t=>nd(t,Yk,Kt),N5=t=>nd(t,qS,US),Hk=t=>nd(t,WS,Fk),Kp=t=>nd(t,GS,Bk),vt=t=>HS.test(t),ah=t=>rd(t,VS),Uk=t=>rd(t,Vk),A5=t=>rd(t,qS),qk=t=>rd(t,YS),Wk=t=>rd(t,WS),Qp=t=>rd(t,GS,!0),nd=(t,e,n)=>{const r=zS.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},rd=(t,e,n=!1)=>{const r=HS.exec(t);return r?r[1]?e(r[1]):n:!1},qS=t=>t==="position"||t==="percentage",WS=t=>t==="image"||t==="url",YS=t=>t==="length"||t==="size"||t==="bg-size",VS=t=>t==="length",Yk=t=>t==="number",Vk=t=>t==="family-name",GS=t=>t==="shadow",Gk=()=>{const t=Hr("color"),e=Hr("font"),n=Hr("text"),r=Hr("font-weight"),i=Hr("tracking"),a=Hr("leading"),o=Hr("breakpoint"),c=Hr("container"),f=Hr("spacing"),d=Hr("radius"),p=Hr("shadow"),g=Hr("inset-shadow"),b=Hr("text-shadow"),y=Hr("drop-shadow"),N=Hr("blur"),w=Hr("perspective"),k=Hr("aspect"),C=Hr("ease"),L=Hr("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...z(),vt,yt],K=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto","contain","none"],H=()=>[vt,yt,f],se=()=>[Cf,"full","auto",...H()],le=()=>[cc,"none","subgrid",vt,yt],P=()=>["auto",{span:["full",cc,vt,yt]},cc,vt,yt],I=()=>[cc,"auto",vt,yt],ne=()=>["auto","min","max","fr",vt,yt],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],de=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...H()],J=()=>[Cf,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],G=()=>[t,vt,yt],me=()=>[...z(),A5,N5,{position:[vt,yt]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",qk,zk,{size:[vt,yt]}],R=()=>[l1,ah,du],V=()=>["","none","full",d,vt,yt],Q=()=>["",Kt,ah,du],ae=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[Kt,l1,A5,N5],we=()=>["","none",N,vt,yt],Se=()=>["none",Kt,vt,yt],Ve=()=>["none",Kt,vt,yt],He=()=>[Kt,vt,yt],Je=()=>[Cf,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[nl],breakpoint:[nl],color:[Rk],container:[nl],"drop-shadow":[nl],ease:["in","out","in-out"],font:[Ik],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[nl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[nl],shadow:[nl],spacing:["px",Kt],text:[nl],"text-shadow":[nl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Cf,yt,vt,k]}],container:["container"],columns:[{columns:[Kt,yt,vt,c]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"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:O()}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:se()}],"inset-x":[{"inset-x":se()}],"inset-y":[{"inset-y":se()}],start:[{start:se()}],end:[{end:se()}],top:[{top:se()}],right:[{right:se()}],bottom:[{bottom:se()}],left:[{left:se()}],visibility:["visible","invisible","collapse"],z:[{z:[cc,"auto",vt,yt]}],basis:[{basis:[Cf,"full","auto",c,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Kt,Cf,"auto","initial","none",yt]}],grow:[{grow:["",Kt,vt,yt]}],shrink:[{shrink:["",Kt,vt,yt]}],order:[{order:[cc,"first","last","none",vt,yt]}],"grid-cols":[{"grid-cols":le()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":le()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...de(),"normal"]}],"justify-self":[{"justify-self":["auto",...de()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...de(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...de(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...de(),"baseline"]}],"place-self":[{"place-self":["auto",...de()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[c,"screen",...J()]}],"min-w":[{"min-w":[c,"screen","none",...J()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,ah,du]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,vt,c1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",l1,yt]}],"font-family":[{font:[Uk,yt,e]}],"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:[i,vt,yt]}],"line-clamp":[{"line-clamp":[Kt,"none",vt,c1]}],leading:[{leading:[a,...H()]}],"list-image":[{"list-image":["none",vt,yt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",vt,yt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:G()}],"text-color":[{text:G()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[Kt,"from-font","auto",vt,du]}],"text-decoration-color":[{decoration:G()}],"underline-offset":[{"underline-offset":[Kt,"auto",vt,yt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",vt,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",vt,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:me()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cc,vt,yt],radial:["",vt,yt],conic:[cc,vt,yt]},Wk,Hk]}],"bg-color":[{bg:G()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:G()}],"gradient-via":[{via:G()}],"gradient-to":[{to:G()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:G()}],"border-color-x":[{"border-x":G()}],"border-color-y":[{"border-y":G()}],"border-color-s":[{"border-s":G()}],"border-color-e":[{"border-e":G()}],"border-color-t":[{"border-t":G()}],"border-color-r":[{"border-r":G()}],"border-color-b":[{"border-b":G()}],"border-color-l":[{"border-l":G()}],"divide-color":[{divide:G()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Kt,vt,yt]}],"outline-w":[{outline:["",Kt,ah,du]}],"outline-color":[{outline:G()}],shadow:[{shadow:["","none",p,Qp,Kp]}],"shadow-color":[{shadow:G()}],"inset-shadow":[{"inset-shadow":["none",g,Qp,Kp]}],"inset-shadow-color":[{"inset-shadow":G()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:G()}],"ring-offset-w":[{"ring-offset":[Kt,du]}],"ring-offset-color":[{"ring-offset":G()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":G()}],"text-shadow":[{"text-shadow":["none",b,Qp,Kp]}],"text-shadow-color":[{"text-shadow":G()}],opacity:[{opacity:[Kt,vt,yt]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"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":[Kt]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":G()}],"mask-image-linear-to-color":[{"mask-linear-to":G()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":G()}],"mask-image-t-to-color":[{"mask-t-to":G()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":G()}],"mask-image-r-to-color":[{"mask-r-to":G()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":G()}],"mask-image-b-to-color":[{"mask-b-to":G()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":G()}],"mask-image-l-to-color":[{"mask-l-to":G()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":G()}],"mask-image-x-to-color":[{"mask-x-to":G()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":G()}],"mask-image-y-to-color":[{"mask-y-to":G()}],"mask-image-radial":[{"mask-radial":[vt,yt]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":G()}],"mask-image-radial-to-color":[{"mask-radial-to":G()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[Kt]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":G()}],"mask-image-conic-to-color":[{"mask-conic-to":G()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:me()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",vt,yt]}],filter:[{filter:["","none",vt,yt]}],blur:[{blur:we()}],brightness:[{brightness:[Kt,vt,yt]}],contrast:[{contrast:[Kt,vt,yt]}],"drop-shadow":[{"drop-shadow":["","none",y,Qp,Kp]}],"drop-shadow-color":[{"drop-shadow":G()}],grayscale:[{grayscale:["",Kt,vt,yt]}],"hue-rotate":[{"hue-rotate":[Kt,vt,yt]}],invert:[{invert:["",Kt,vt,yt]}],saturate:[{saturate:[Kt,vt,yt]}],sepia:[{sepia:["",Kt,vt,yt]}],"backdrop-filter":[{"backdrop-filter":["","none",vt,yt]}],"backdrop-blur":[{"backdrop-blur":we()}],"backdrop-brightness":[{"backdrop-brightness":[Kt,vt,yt]}],"backdrop-contrast":[{"backdrop-contrast":[Kt,vt,yt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Kt,vt,yt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Kt,vt,yt]}],"backdrop-invert":[{"backdrop-invert":["",Kt,vt,yt]}],"backdrop-opacity":[{"backdrop-opacity":[Kt,vt,yt]}],"backdrop-saturate":[{"backdrop-saturate":[Kt,vt,yt]}],"backdrop-sepia":[{"backdrop-sepia":["",Kt,vt,yt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",vt,yt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Kt,"initial",vt,yt]}],ease:[{ease:["linear","initial",C,vt,yt]}],delay:[{delay:[Kt,vt,yt]}],animate:[{animate:["none",L,vt,yt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,vt,yt]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Ve()}],"scale-x":[{"scale-x":Ve()}],"scale-y":[{"scale-y":Ve()}],"scale-z":[{"scale-z":Ve()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[vt,yt,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Je()}],"translate-x":[{"translate-x":Je()}],"translate-y":[{"translate-y":Je()}],"translate-z":[{"translate-z":Je()}],"translate-none":["translate-none"],accent:[{accent:G()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:G()}],"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",vt,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":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",vt,yt]}],fill:[{fill:["none",...G()]}],"stroke-w":[{stroke:[Kt,ah,du,c1]}],stroke:[{stroke:["none",...G()]}],"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"]}},$k=Mk(Gk);function wt(...t){return $k(BS(t))}function Pr(t){return t?`/image/${t.replace(/^\/+/,"").replace(/\/+$/,"")}`:(console.warn("getImagePath called with empty imageName"),"")}function C5(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function $S(...t){return e=>{let n=!1;const r=t.map(i=>{const a=C5(i,e);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():C5(t[i],null)}}}}function cr(...t){return E.useCallback($S(...t),t)}function Mu(t){const e=Zk(t),n=E.forwardRef((r,i)=>{const{children:a,...o}=r,c=E.Children.toArray(a),f=c.find(Qk);if(f){const d=f.props.children,p=c.map(g=>g===f?E.Children.count(d)>1?E.Children.only(null):E.isValidElement(d)?d.props.children:null:g);return S.jsx(e,{...o,ref:i,children:E.isValidElement(d)?E.cloneElement(d,void 0,p):null})}return S.jsx(e,{...o,ref:i,children:a})});return n.displayName=`${t}.Slot`,n}var Xk=Mu("Slot");function Zk(t){const e=E.forwardRef((n,r)=>{const{children:i,...a}=n;if(E.isValidElement(i)){const o=eM(i),c=Jk(a,i.props);return i.type!==E.Fragment&&(c.ref=r?$S(r,o):o),E.cloneElement(i,c)}return E.Children.count(i)>1?E.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Kk=Symbol("radix.slottable");function Qk(t){return E.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Kk}function Jk(t,e){const n={...e};for(const r in e){const i=t[r],a=e[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...c)=>{const f=a(...c);return i(...c),f}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...t,...n}}function eM(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}const k5=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,M5=BS,iy=(t,e)=>n=>{var r;if(e?.variants==null)return M5(t,n?.class,n?.className);const{variants:i,defaultVariants:a}=e,o=Object.keys(i).map(d=>{const p=n?.[d],g=a?.[d];if(p===null)return null;const b=k5(p)||k5(g);return i[d][b]}),c=n&&Object.entries(n).reduce((d,p)=>{let[g,b]=p;return b===void 0||(d[g]=b),d},{}),f=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:g,className:b,...y}=p;return Object.entries(y).every(N=>{let[w,k]=N;return Array.isArray(k)?k.includes({...a,...c}[w]):{...a,...c}[w]===k})?[...d,g,b]:d},[]);return M5(t,o,f,n?.class,n?.className)},o2=iy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary 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"}}),Ti=E.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},a)=>{const o=r?Xk:"button";return S.jsx(o,{className:wt(o2({variant:e,size:n,className:t})),ref:a,...i})});Ti.displayName="Button";const Eh=E.forwardRef(({className:t,...e},n)=>S.jsx("div",{ref:n,className:wt("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Eh.displayName="Card";const ay=E.forwardRef(({className:t,...e},n)=>S.jsx("div",{ref:n,className:wt("flex flex-col space-y-1.5 p-6",t),...e}));ay.displayName="CardHeader";const Dh=E.forwardRef(({className:t,...e},n)=>S.jsx("div",{ref:n,className:wt("text-2xl font-semibold leading-none tracking-tight",t),...e}));Dh.displayName="CardTitle";const sy=E.forwardRef(({className:t,...e},n)=>S.jsx("div",{ref:n,className:wt("text-sm text-muted-foreground",t),...e}));sy.displayName="CardDescription";const jh=E.forwardRef(({className:t,...e},n)=>S.jsx("div",{ref:n,className:wt("p-6 pt-0",t),...e}));jh.displayName="CardContent";const tM=E.forwardRef(({className:t,...e},n)=>S.jsx("div",{ref:n,className:wt("flex items-center p-6 pt-0",t),...e}));tM.displayName="CardFooter";const yo=E.forwardRef(({className:t,type:e,...n},r)=>S.jsx("input",{type:e,className:wt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));yo.displayName="Input";var nM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xn=nM.reduce((t,e)=>{const n=Mu(`Primitive.${e}`),r=E.forwardRef((i,a)=>{const{asChild:o,...c}=i,f=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(f,{...c,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function rM(t,e){t&&qh.flushSync(()=>t.dispatchEvent(e))}var iM="Label",XS=E.forwardRef((t,e)=>S.jsx(xn.label,{...t,ref:e,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));XS.displayName=iM;var ZS=XS;const aM=iy("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),l2=E.forwardRef(({className:t,...e},n)=>S.jsx(ZS,{ref:n,className:wt(aM(),t),...e}));l2.displayName=ZS.displayName;function KS({loginData:t,onBackToLogin:e}){const[n,r]=E.useState(["","","","","",""]),[i,a]=E.useState(""),[o,c]=E.useState(!1),[f,d]=E.useState(120),[p,g]=E.useState(!1),b=Pu(),y=E.useRef([]);E.useEffect(()=>{let j;return f>0&&(j=setTimeout(()=>d(f-1),1e3)),()=>clearTimeout(j)},[f]);const N=async()=>{g(!0),a("");try{(await or.post("/login",{id:t.username,password:t.password})).data.responseCode==="0"?(d(120),r(["","","","","",""])):a("Failed to send OTP. Please try again.")}catch(j){a(j.response?.data?.responseDesc||"Failed to send OTP. Please try again.")}finally{g(!1)}},w=async j=>{j.preventDefault();const z=n.join("");if(z.length!==6){a("Please enter the complete 6-digit OTP.");return}c(!0),a("");try{const O=await or.post("/verify-otp",{id:t.username,otp:z,user_type:"operator"},{headers:{"X-Skip-Auth-Redirect":"true"}});O.data.responseCode==="0"?(O.data.access_token?(localStorage.setItem("accessToken",O.data.access_token),x5()):t.access_token&&(localStorage.setItem("accessToken",t.access_token),x5()),b("/dashboard")):(a(O.data.responseDesc||"Invalid OTP. Please try again."),r(["","","","","",""]),y.current[0]&&y.current[0].focus())}catch(O){console.error("OTP verification error:",O),console.error("Error response:",O.response?.data),a(O.response?.data?.responseDesc||"Verification failed. Please try again."),r(["","","","","",""]),y.current[0]&&y.current[0].focus()}finally{c(!1)}},k=async()=>{f>0||await N()},C=(j,z)=>{if(/^\d$/.test(z)||z===""){const O=[...n];O[j]=z,r(O),z&&j<5&&y.current[j+1]?.focus()}},L=(j,z)=>{z.key==="Backspace"&&!n[j]&&j>0&&y.current[j-1]?.focus()};return S.jsxs("div",{className:"relative flex justify-center items-center min-h-screen bg-gradient-to-br from-gray-50 to-blue-100 overflow-hidden",children:[S.jsx("svg",{className:"absolute left-[-100px] top-[-100px] w-[400px] h-[400px] opacity-30 blur-2xl z-0",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:S.jsx("circle",{cx:"200",cy:"200",r:"200",fill:"#60A5FA"})}),S.jsx("svg",{className:"absolute right-[-120px] bottom-[-120px] w-[350px] h-[350px] opacity-20 blur-2xl z-0",viewBox:"0 0 350 350",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:S.jsx("circle",{cx:"175",cy:"175",r:"175",fill:"#818CF8"})}),S.jsx("svg",{className:"absolute left-1/2 top-0 -translate-x-1/2 w-[200px] h-[200px] opacity-10 blur-3xl z-0",viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:S.jsx("rect",{width:"200",height:"200",rx:"100",fill:"#F472B6"})}),S.jsx("div",{className:"flex w-full items-center justify-center p-2 z-10",children:S.jsx(Eh,{className:"w-full max-w-sm md:max-w-2xl min-h-[420px] rounded-2xl shadow-2xl border border-gray-200 bg-white py-3 px-3 md:py-4 md:px-6 flex flex-col md:flex-row justify-center items-center",children:S.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-center gap-2 md:gap-4 w-full",children:[S.jsx("div",{className:"flex flex-col items-center justify-center w-full md:w-auto mb-1 md:mb-4",children:S.jsx("img",{src:Pr("telangana-police-logo.svg"),alt:"Telangana Police Logo",className:"w-20 h-20 sm:w-28 sm:h-28 md:w-36 md:h-36 object-contain"})}),S.jsx("div",{className:"hidden md:block h-[180px] md:h-[200px] w-px bg-gray-200 mx-2 md:mx-3"}),S.jsx("div",{className:"grid flex-1 min-w-0 w-full",children:S.jsxs("div",{className:"col-start-1 row-start-1",children:[S.jsxs(ay,{className:"text-center pb-2",children:[S.jsx(Dh,{className:"text-lg md:text-xl font-bold font-sans",children:"OTP verification"}),S.jsx(sy,{className:"mb-2 md:mb-4 text-gray-500 text-xs md:text-sm",children:"OTP sent to your registered mobile number"})]}),S.jsx("form",{onSubmit:w,children:S.jsxs(jh,{className:"space-y-3 md:space-y-4",children:[S.jsx("div",{className:"flex justify-center",children:S.jsx("div",{className:"flex gap-2 md:gap-3",children:n.map((j,z)=>S.jsx(yo,{ref:O=>y.current[z]=O,type:"text",maxLength:1,required:!0,value:j,onChange:O=>C(z,O.target.value),onKeyDown:O=>L(z,O),placeholder:"0",className:"w-10 h-10 md:w-12 md:h-12 text-center text-lg md:text-xl font-mono border-gray-300 focus:border-blue-500 focus:ring-2 focus:ring-blue-100",autoComplete:"one-time-code",inputMode:"numeric",pattern:"[0-9]*"},z))})}),S.jsx(Ti,{type:"submit",className:"w-full h-9 md:h-10 text-sm md:text-base font-semibold bg-blue-600 hover:bg-blue-700 transition-colors",disabled:o||n.join("").length<6,children:o?"Verifying...":"Verify"}),S.jsx("div",{className:"text-center",children:S.jsx(Ti,{type:"button",variant:"link",onClick:k,disabled:f>0||p,className:"text-xs md:text-sm text-gray-600 hover:text-gray-800",children:f>0?`Resend code in ${f}s`:p?"Sending...":"Resend code"})}),i&&S.jsx("div",{className:"text-red-600 text-xs md:text-sm text-center mt-1",role:"alert",children:i})]})})]})})]})})}),S.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-4 text-center text-sm text-gray-500",children:S.jsx("p",{children:"© 2025 PushpakAI. All rights reserved."})})]})}function sM(){const[t,e]=E.useState(""),[n,r]=E.useState(""),[i,a]=E.useState(""),[o,c]=E.useState(!1),[f,d]=E.useState(!1),[p,g]=E.useState(!1),[b,y]=E.useState(null),N=Pu();E.useEffect(()=>{typeof window<"u"&&localStorage.getItem("accessToken")&&N("/dashboard")},[N]);const w=z=>{const O=z.target.value;/^\d{0,8}$/.test(O)?(e(O),i&&/^\d+$/.test(O)&&a("")):a("Login ID must contain only numbers (0-9).")},k=z=>{z.preventDefault();const K=z.clipboardData.getData("text").replace(/\D/g,"").slice(0,8);K?(e(K),i&&a("")):a("Login ID must contain only numbers (0-9).")},C=async z=>{if(z.preventDefault(),c(!0),a(""),!/^\d+$/.test(t)){a("Login ID must contain only numbers (0-9)."),c(!1);return}if(!t.trim()){a("Login ID is required."),c(!1);return}if(!n.trim()){a("Password is required."),c(!1);return}try{const O=await or.post("/login",{id:t,password:n});O.data.responseCode==="0"?(y({username:t,password:n,access_token:O.data.access_token,responseDesc:O.data.responseDesc}),g(!0)):a(O.data.responseDesc||"Login failed. Please try again.")}catch(O){a(O.response?.data?.responseDesc||O.response?.data?.detail||"An unexpected error occurred.")}finally{c(!1)}},L=()=>{g(!1),y(null),a("")},j=()=>{d(!f)};return p&&b?S.jsx(KS,{loginData:b,onBackToLogin:L}):S.jsxs("div",{className:"relative flex justify-center items-center min-h-screen bg-gradient-to-br from-gray-50 to-blue-100 overflow-hidden",children:[S.jsx("svg",{className:"absolute left-[-100px] top-[-100px] w-[400px] h-[400px] opacity-30 blur-2xl z-0",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:S.jsx("circle",{cx:"200",cy:"200",r:"200",fill:"#60A5FA"})}),S.jsx("svg",{className:"absolute right-[-120px] bottom-[-120px] w-[350px] h-[350px] opacity-20 blur-2xl z-0",viewBox:"0 0 350 350",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:S.jsx("circle",{cx:"175",cy:"175",r:"175",fill:"#818CF8"})}),S.jsx("svg",{className:"absolute left-1/2 top-0 -translate-x-1/2 w-[200px] h-[200px] opacity-10 blur-3xl z-0",viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:S.jsx("rect",{width:"200",height:"200",rx:"100",fill:"#F472B6"})}),S.jsx("div",{className:"flex w-full items-center justify-center p-2 z-10",children:S.jsx(Eh,{className:"w-full max-w-sm md:max-w-2xl min-h-[420px] rounded-2xl shadow-2xl border border-gray-200 bg-white py-3 px-3 md:py-4 md:px-6 flex flex-col md:flex-row justify-center items-center",children:S.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-center gap-2 md:gap-4 w-full",children:[S.jsx("div",{className:"flex flex-col items-center justify-center w-full md:w-auto mb-1 md:mb-4",children:S.jsx("img",{src:Pr("telangana-police-logo.svg"),alt:"Telangana Police Logo",className:"w-20 h-20 sm:w-28 sm:h-28 md:w-36 md:h-36 object-contain"})}),S.jsx("div",{className:"hidden md:block h-[180px] md:h-[200px] w-px bg-gray-200 mx-2 md:mx-3"}),S.jsx("div",{className:"grid flex-1 min-w-0 w-full",children:S.jsxs("div",{className:"col-start-1 row-start-1",children:[S.jsxs(ay,{className:"text-center pb-2",children:[S.jsx(Dh,{className:"text-lg md:text-xl font-bold font-sans",children:"Sign in to your account"}),S.jsx(sy,{className:"mb-2 md:mb-4 text-gray-500 text-xs md:text-sm",children:"Welcome back! Please enter your credentials."})]}),S.jsx("form",{onSubmit:C,children:S.jsxs(jh,{className:"space-y-3 md:space-y-4",children:[S.jsxs("div",{children:[S.jsx(l2,{htmlFor:"username",className:"block mb-1 text-xs md:text-sm font-medium font-sans",children:"Login ID"}),S.jsx(yo,{id:"username",className:"h-9 md:h-10 px-3 md:px-4 border-gray-300 focus:border-blue-500 focus:ring-2 focus:ring-blue-100 text-sm md:text-base font-mono",type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:8,placeholder:"Enter your Login ID",value:t,onChange:w,onPaste:k,required:!0,"aria-invalid":!!i,"aria-describedby":i?"login-error":void 0})]}),S.jsxs("div",{children:[S.jsx(l2,{htmlFor:"password",className:"block mb-1 text-xs md:text-sm font-medium font-sans",children:"Password"}),S.jsxs("div",{className:"relative",children:[S.jsx(yo,{id:"password",className:"h-9 md:h-10 px-3 md:px-4 pr-10 border-gray-300 focus:border-blue-500 focus:ring-2 focus:ring-blue-100 text-sm md:text-base",type:f?"text":"password",placeholder:"Enter your password",value:n,onChange:z=>r(z.target.value),required:!0}),S.jsx(Ti,{type:"button",variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 p-0 hover:bg-gray-100 rounded-md",onClick:j,"aria-label":f?"Hide password":"Show password",children:f?S.jsx("svg",{className:"h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.878L21 21"})}):S.jsxs("svg",{className:"h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})]})]}),i&&S.jsx("div",{id:"login-error",className:"text-red-600 text-xs md:text-sm text-center mt-1",role:"alert",children:i}),S.jsx(Ti,{type:"submit",className:"w-full h-9 md:h-10 text-sm md:text-base font-semibold bg-blue-600 hover:bg-blue-700 transition-colors",disabled:o,children:o?"Signing In...":"Sign In"})]})})]})})]})})}),S.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-4 text-center text-sm text-gray-500",children:S.jsx("p",{children:"© 2025 PushpakAI. All rights reserved."})})]})}const QS=6048e5,oM=864e5,L5=Symbol.for("constructDateFrom");function qr(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&L5 in t?t[L5](e):t instanceof Date?new t.constructor(e):new Date(e)}function Dn(t,e){return qr(e||t,t)}function JS(t,e,n){const r=Dn(t,n?.in);return isNaN(e)?qr(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function e3(t,e,n){const r=Dn(t,n?.in);if(isNaN(e))return qr(t,NaN);if(!e)return r;const i=r.getDate(),a=qr(t,r.getTime());a.setMonth(r.getMonth()+e+1,0);const o=a.getDate();return i>=o?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}let lM={};function Vh(){return lM}function $f(t,e){const n=Vh(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Dn(t,e?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Oh(t,e){return $f(t,{...e,weekStartsOn:1})}function t3(t,e){const n=Dn(t,e?.in),r=n.getFullYear(),i=qr(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const a=Oh(i),o=qr(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const c=Oh(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function E5(t){const e=Dn(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function id(t,...e){const n=qr.bind(null,e.find(r=>typeof r=="object"));return e.map(n)}function Th(t,e){const n=Dn(t,e?.in);return n.setHours(0,0,0,0),n}function n3(t,e,n){const[r,i]=id(n?.in,t,e),a=Th(r),o=Th(i),c=+a-E5(a),f=+o-E5(o);return Math.round((c-f)/oM)}function cM(t,e){const n=t3(t,e),r=qr(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Oh(r)}function uM(t,e,n){return JS(t,e*7,n)}function fM(t,e,n){return e3(t,e*12,n)}function dM(t,e){let n,r=e?.in;return t.forEach(i=>{!r&&typeof i=="object"&&(r=qr.bind(null,i));const a=Dn(i,r);(!n||n<a||isNaN(+a))&&(n=a)}),qr(r,n||NaN)}function hM(t,e){let n,r=e?.in;return t.forEach(i=>{!r&&typeof i=="object"&&(r=qr.bind(null,i));const a=Dn(i,r);(!n||n>a||isNaN(+a))&&(n=a)}),qr(r,n||NaN)}function pM(t,e,n){const[r,i]=id(n?.in,t,e);return+Th(r)==+Th(i)}function r3(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function mM(t){return!(!r3(t)&&typeof t!="number"||isNaN(+Dn(t)))}function gM(t,e,n){const[r,i]=id(n?.in,t,e),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function yM(t,e){const n=Dn(t,e?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function vM(t,e){const[n,r]=id(t,e.start,e.end);return{start:n,end:r}}function bM(t,e){const{start:n,end:r}=vM(e?.in,t);let i=+n>+r;const a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setDate(1);let c=1;const f=[];for(;+o<=a;)f.push(qr(n,o)),o.setMonth(o.getMonth()+c);return i?f.reverse():f}function xM(t,e){const n=Dn(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function wM(t,e){const n=Dn(t,e?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function i3(t,e){const n=Dn(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function a3(t,e){const n=Vh(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Dn(t,e?.in),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function SM(t,e){return a3(t,{...e,weekStartsOn:1})}const _M={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"}},NM=(t,e,n)=>{let r;const i=_M[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function u1(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const AM={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},CM={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kM={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},MM={date:u1({formats:AM,defaultWidth:"full"}),time:u1({formats:CM,defaultWidth:"full"}),dateTime:u1({formats:kM,defaultWidth:"full"})},LM={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},EM=(t,e,n,r)=>LM[t];function sh(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,c=n?.width?String(n.width):o;i=t.formattingValues[c]||t.formattingValues[o]}else{const o=t.defaultWidth,c=n?.width?String(n.width):t.defaultWidth;i=t.values[c]||t.values[o]}const a=t.argumentCallback?t.argumentCallback(e):e;return i[a]}}const DM={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},jM={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},OM={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"]},TM={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"]},RM={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"}},PM={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"}},BM=(t,e)=>{const n=Number(t),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"},FM={ordinalNumber:BM,era:sh({values:DM,defaultWidth:"wide"}),quarter:sh({values:jM,defaultWidth:"wide",argumentCallback:t=>t-1}),month:sh({values:OM,defaultWidth:"wide"}),day:sh({values:TM,defaultWidth:"wide"}),dayPeriod:sh({values:RM,defaultWidth:"wide",formattingValues:PM,defaultFormattingWidth:"wide"})};function oh(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],a=e.match(i);if(!a)return null;const o=a[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],f=Array.isArray(c)?zM(c,g=>g.test(o)):IM(c,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(f):f,d=n.valueCallback?n.valueCallback(d):d;const p=e.slice(o.length);return{value:d,rest:p}}}function IM(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function zM(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function HM(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],a=e.match(t.parsePattern);if(!a)return null;let o=t.valueCallback?t.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const c=e.slice(i.length);return{value:o,rest:c}}}const UM=/^(\d+)(th|st|nd|rd)?/i,qM=/\d+/i,WM={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},YM={any:[/^b/i,/^(a|c)/i]},VM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},GM={any:[/1/i,/2/i,/3/i,/4/i]},$M={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},XM={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]},ZM={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},KM={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]},QM={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},JM={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}},eL={ordinalNumber:HM({matchPattern:UM,parsePattern:qM,valueCallback:t=>parseInt(t,10)}),era:oh({matchPatterns:WM,defaultMatchWidth:"wide",parsePatterns:YM,defaultParseWidth:"any"}),quarter:oh({matchPatterns:VM,defaultMatchWidth:"wide",parsePatterns:GM,defaultParseWidth:"any",valueCallback:t=>t+1}),month:oh({matchPatterns:$M,defaultMatchWidth:"wide",parsePatterns:XM,defaultParseWidth:"any"}),day:oh({matchPatterns:ZM,defaultMatchWidth:"wide",parsePatterns:KM,defaultParseWidth:"any"}),dayPeriod:oh({matchPatterns:QM,defaultMatchWidth:"any",parsePatterns:JM,defaultParseWidth:"any"})},oy={code:"en-US",formatDistance:NM,formatLong:MM,formatRelative:EM,localize:FM,match:eL,options:{weekStartsOn:0,firstWeekContainsDate:1}};function tL(t,e){const n=Dn(t,e?.in);return n3(n,i3(n))+1}function s3(t,e){const n=Dn(t,e?.in),r=+Oh(n)-+cM(n);return Math.round(r/QS)+1}function o3(t,e){const n=Dn(t,e?.in),r=n.getFullYear(),i=Vh(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=qr(e?.in||t,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);const c=$f(o,e),f=qr(e?.in||t,0);f.setFullYear(r,0,a),f.setHours(0,0,0,0);const d=$f(f,e);return+n>=+c?r+1:+n>=+d?r:r-1}function nL(t,e){const n=Vh(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=o3(t,e),a=qr(e?.in||t,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),$f(a,e)}function l3(t,e){const n=Dn(t,e?.in),r=+$f(n,e)-+nL(n,e);return Math.round(r/QS)+1}function Cn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const uc={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Cn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Cn(n+1,2)},d(t,e){return Cn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){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(t,e){return Cn(t.getHours()%12||12,e.length)},H(t,e){return Cn(t.getHours(),e.length)},m(t,e){return Cn(t.getMinutes(),e.length)},s(t,e){return Cn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Cn(i,e.length)}},kf={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},D5={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){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(t,e,n){if(e==="yo"){const r=t.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return uc.y(t,e)},Y:function(t,e,n,r){const i=o3(t,r),a=i>0?i:1-i;if(e==="YY"){const o=a%100;return Cn(o,2)}return e==="Yo"?n.ordinalNumber(a,{unit:"year"}):Cn(a,e.length)},R:function(t,e){const n=t3(t);return Cn(n,e.length)},u:function(t,e){const n=t.getFullYear();return Cn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Cn(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(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Cn(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(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return uc.M(t,e);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(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Cn(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(t,e,n,r){const i=l3(t,r);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):Cn(i,e.length)},I:function(t,e,n){const r=s3(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Cn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):uc.d(t,e)},D:function(t,e,n){const r=tL(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Cn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){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(t,e,n,r){const i=t.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return Cn(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const i=t.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return Cn(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return Cn(i,e.length);case"io":return n.ordinalNumber(i,{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(t,e,n){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let i;switch(r===12?i=kf.noon:r===0?i=kf.midnight:i=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let i;switch(r>=17?i=kf.evening:r>=12?i=kf.afternoon:r>=4?i=kf.morning:i=kf.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return uc.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):uc.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Cn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Cn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):uc.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):uc.s(t,e)},S:function(t,e){return uc.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return O5(r);case"XXXX":case"XX":return gu(r);case"XXXXX":case"XXX":default:return gu(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return O5(r);case"xxxx":case"xx":return gu(r);case"xxxxx":case"xxx":default:return gu(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+j5(r,":");case"OOOO":default:return"GMT"+gu(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+j5(r,":");case"zzzz":default:return"GMT"+gu(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return Cn(r,e.length)},T:function(t,e,n){return Cn(+t,e.length)}};function j5(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+e+Cn(a,2)}function O5(t,e){return t%60===0?(t>0?"-":"+")+Cn(Math.abs(t)/60,2):gu(t,e)}function gu(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Cn(Math.trunc(r/60),2),a=Cn(r%60,2);return n+i+e+a}const T5=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},c3=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},rL=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return T5(t,e);let a;switch(r){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;case"PPPP":default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",T5(r,e)).replace("{{time}}",c3(i,e))},iL={p:c3,P:rL},aL=/^D+$/,sL=/^Y+$/,oL=["D","DD","YY","YYYY"];function lL(t){return aL.test(t)}function cL(t){return sL.test(t)}function uL(t,e,n){const r=fL(t,e,n);if(console.warn(r),oL.includes(t))throw new RangeError(r)}function fL(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const dL=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,hL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pL=/^'([^]*?)'?$/,mL=/''/g,gL=/[a-zA-Z]/;function Oi(t,e,n){const r=Vh(),i=n?.locale??r.locale??oy,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,c=Dn(t,n?.in);if(!mM(c))throw new RangeError("Invalid time value");let f=e.match(hL).map(p=>{const g=p[0];if(g==="p"||g==="P"){const b=iL[g];return b(p,i.formatLong)}return p}).join("").match(dL).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:yL(p)};if(D5[g])return{isToken:!0,value:p};if(g.match(gL))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});i.localize.preprocessor&&(f=i.localize.preprocessor(c,f));const d={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return f.map(p=>{if(!p.isToken)return p.value;const g=p.value;(!n?.useAdditionalWeekYearTokens&&cL(g)||!n?.useAdditionalDayOfYearTokens&&lL(g))&&uL(g,e,String(t));const b=D5[g[0]];return b(c,g,i.localize,d)}).join("")}function yL(t){const e=t.match(pL);return e?e[1].replace(mL,"'"):t}function vL(t,e){const n=Dn(t,e?.in),r=n.getFullYear(),i=n.getMonth(),a=qr(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function bL(t,e){return Dn(t,e?.in).getMonth()}function xL(t,e){return Dn(t,e?.in).getFullYear()}function jm(t,e){return+Dn(t)>+Dn(e)}function wL(t,e){return+Dn(t)<+Dn(e)}function SL(t,e,n){const[r,i]=id(n?.in,t,e);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function _L(t,e,n){const[r,i]=id(n?.in,t,e);return r.getFullYear()===i.getFullYear()}function NL(t,e,n){const r=Dn(t,n?.in),i=r.getFullYear(),a=r.getDate(),o=qr(t,0);o.setFullYear(i,e,15),o.setHours(0,0,0,0);const c=vL(o);return r.setMonth(e,Math.min(a,c)),r}function AL(t,e,n){const r=Dn(t,n?.in);return isNaN(+r)?qr(t,NaN):(r.setFullYear(e),r)}const CL=iy("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-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function yu({className:t,variant:e,...n}){return S.jsx("div",{className:wt(CL({variant:e}),t),...n})}const ly=E.forwardRef(({className:t,...e},n)=>S.jsx("div",{className:"relative w-full overflow-x-auto",children:S.jsx("table",{ref:n,className:wt("w-full min-w-full caption-bottom text-sm",t),...e})}));ly.displayName="Table";const cy=E.forwardRef(({className:t,...e},n)=>S.jsx("thead",{ref:n,className:wt("[&_tr]:border-b",t),...e}));cy.displayName="TableHeader";const uy=E.forwardRef(({className:t,...e},n)=>S.jsx("tbody",{ref:n,className:wt("[&_tr:last-child]:border-0",t),...e}));uy.displayName="TableBody";const kL=E.forwardRef(({className:t,...e},n)=>S.jsx("tfoot",{ref:n,className:wt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));kL.displayName="TableFooter";const mc=E.forwardRef(({className:t,...e},n)=>S.jsx("tr",{ref:n,className:wt("border-b transition-colors data-[state=selected]:bg-muted",t),...e}));mc.displayName="TableRow";const so=E.forwardRef(({className:t,...e},n)=>S.jsx("th",{ref:n,className:wt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));so.displayName="TableHead";const ma=E.forwardRef(({className:t,...e},n)=>S.jsx("td",{ref:n,className:wt("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));ma.displayName="TableCell";const ML=E.forwardRef(({className:t,...e},n)=>S.jsx("caption",{ref:n,className:wt("mt-4 text-sm text-muted-foreground",t),...e}));ML.displayName="TableCaption";/*!
 * @kurkle/color v0.3.4
 * https://github.com/kurkle/color#readme
 * (c) 2024 Jukka Kurkela
 * Released under the MIT License
 */function Gh(t){return t+.5|0}const gc=(t,e,n)=>Math.max(Math.min(t,n),e);function gh(t){return gc(Gh(t*2.55),0,255)}function xc(t){return gc(Gh(t*255),0,255)}function ol(t){return gc(Gh(t/2.55)/100,0,1)}function R5(t){return gc(Gh(t*100),0,100)}const Pa={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},c2=[..."0123456789ABCDEF"],LL=t=>c2[t&15],EL=t=>c2[(t&240)>>4]+c2[t&15],Jp=t=>(t&240)>>4===(t&15),DL=t=>Jp(t.r)&&Jp(t.g)&&Jp(t.b)&&Jp(t.a);function jL(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&Pa[t[1]]*17,g:255&Pa[t[2]]*17,b:255&Pa[t[3]]*17,a:e===5?Pa[t[4]]*17:255}:(e===7||e===9)&&(n={r:Pa[t[1]]<<4|Pa[t[2]],g:Pa[t[3]]<<4|Pa[t[4]],b:Pa[t[5]]<<4|Pa[t[6]],a:e===9?Pa[t[7]]<<4|Pa[t[8]]:255})),n}const OL=(t,e)=>t<255?e(t):"";function TL(t){var e=DL(t)?LL:EL;return t?"#"+e(t.r)+e(t.g)+e(t.b)+OL(t.a,e):void 0}const RL=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function u3(t,e,n){const r=e*Math.min(n,1-n),i=(a,o=(a+t/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function PL(t,e,n){const r=(i,a=(i+t/60)%6)=>n-n*e*Math.max(Math.min(a,4-a,1),0);return[r(5),r(3),r(1)]}function BL(t,e,n){const r=u3(t,1,.5);let i;for(e+n>1&&(i=1/(e+n),e*=i,n*=i),i=0;i<3;i++)r[i]*=1-e-n,r[i]+=e;return r}function FL(t,e,n,r,i){return t===i?(e-n)/r+(e<n?6:0):e===i?(n-t)/r+2:(t-e)/r+4}function fy(t){const n=t.r/255,r=t.g/255,i=t.b/255,a=Math.max(n,r,i),o=Math.min(n,r,i),c=(a+o)/2;let f,d,p;return a!==o&&(p=a-o,d=c>.5?p/(2-a-o):p/(a+o),f=FL(n,r,i,p,a),f=f*60+.5),[f|0,d||0,c]}function dy(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(xc)}function hy(t,e,n){return dy(u3,t,e,n)}function IL(t,e,n){return dy(BL,t,e,n)}function zL(t,e,n){return dy(PL,t,e,n)}function f3(t){return(t%360+360)%360}function HL(t){const e=RL.exec(t);let n=255,r;if(!e)return;e[5]!==r&&(n=e[6]?gh(+e[5]):xc(+e[5]));const i=f3(+e[2]),a=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?r=IL(i,a,o):e[1]==="hsv"?r=zL(i,a,o):r=hy(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function UL(t,e){var n=fy(t);n[0]=f3(n[0]+e),n=hy(n),t.r=n[0],t.g=n[1],t.b=n[2]}function qL(t){if(!t)return;const e=fy(t),n=e[0],r=R5(e[1]),i=R5(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${i}%, ${ol(t.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const P5={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},B5={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function WL(){const t={},e=Object.keys(B5),n=Object.keys(P5);let r,i,a,o,c;for(r=0;r<e.length;r++){for(o=c=e[r],i=0;i<n.length;i++)a=n[i],c=c.replace(a,P5[a]);a=parseInt(B5[o],16),t[c]=[a>>16&255,a>>8&255,a&255]}return t}let em;function YL(t){em||(em=WL(),em.transparent=[0,0,0,0]);const e=em[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const VL=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function GL(t){const e=VL.exec(t);let n=255,r,i,a;if(e){if(e[7]!==r){const o=+e[7];n=e[8]?gh(o):gc(o*255,0,255)}return r=+e[1],i=+e[3],a=+e[5],r=255&(e[2]?gh(r):gc(r,0,255)),i=255&(e[4]?gh(i):gc(i,0,255)),a=255&(e[6]?gh(a):gc(a,0,255)),{r,g:i,b:a,a:n}}}function $L(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${ol(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const f1=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Mf=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function XL(t,e,n){const r=Mf(ol(t.r)),i=Mf(ol(t.g)),a=Mf(ol(t.b));return{r:xc(f1(r+n*(Mf(ol(e.r))-r))),g:xc(f1(i+n*(Mf(ol(e.g))-i))),b:xc(f1(a+n*(Mf(ol(e.b))-a))),a:t.a+n*(e.a-t.a)}}function tm(t,e,n){if(t){let r=fy(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,e===0?360:1)),r=hy(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function d3(t,e){return t&&Object.assign(e||{},t)}function F5(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=xc(t[3]))):(e=d3(t,{r:0,g:0,b:0,a:1}),e.a=xc(e.a)),e}function ZL(t){return t.charAt(0)==="r"?GL(t):HL(t)}class Rh{constructor(e){if(e instanceof Rh)return e;const n=typeof e;let r;n==="object"?r=F5(e):n==="string"&&(r=jL(e)||YL(e)||ZL(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=d3(this._rgb);return e&&(e.a=ol(e.a)),e}set rgb(e){this._rgb=F5(e)}rgbString(){return this._valid?$L(this._rgb):void 0}hexString(){return this._valid?TL(this._rgb):void 0}hslString(){return this._valid?qL(this._rgb):void 0}mix(e,n){if(e){const r=this.rgb,i=e.rgb;let a;const o=n===a?.5:n,c=2*o-1,f=r.a-i.a,d=((c*f===-1?c:(c+f)/(1+c*f))+1)/2;a=1-d,r.r=255&d*r.r+a*i.r+.5,r.g=255&d*r.g+a*i.g+.5,r.b=255&d*r.b+a*i.b+.5,r.a=o*r.a+(1-o)*i.a,this.rgb=r}return this}interpolate(e,n){return e&&(this._rgb=XL(this._rgb,e._rgb,n)),this}clone(){return new Rh(this.rgb)}alpha(e){return this._rgb.a=xc(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=Gh(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return tm(this._rgb,2,e),this}darken(e){return tm(this._rgb,2,-e),this}saturate(e){return tm(this._rgb,1,e),this}desaturate(e){return tm(this._rgb,1,-e),this}rotate(e){return UL(this._rgb,e),this}}/*!
 * Chart.js v4.5.0
 * https://www.chartjs.org
 * (c) 2025 Chart.js Contributors
 * Released under the MIT License
 */function rl(){}const KL=(()=>{let t=0;return()=>t++})();function Mr(t){return t==null}function Qr(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function ln(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function pl(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function ro(t,e){return pl(t)?t:e}function bn(t,e){return typeof t>"u"?e:t}const QL=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,h3=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Pn(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function yn(t,e,n,r){let i,a,o;if(Qr(t))for(a=t.length,i=0;i<a;i++)e.call(n,t[i],i);else if(ln(t))for(o=Object.keys(t),a=o.length,i=0;i<a;i++)e.call(n,t[o[i]],o[i])}function Vm(t,e){let n,r,i,a;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(i=t[n],a=e[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function Gm(t){if(Qr(t))return t.map(Gm);if(ln(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let i=0;for(;i<r;++i)e[n[i]]=Gm(t[n[i]]);return e}return t}function p3(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function JL(t,e,n,r){if(!p3(t))return;const i=e[t],a=n[t];ln(i)&&ln(a)?vo(i,a,r):e[t]=Gm(a)}function vo(t,e,n){const r=Qr(e)?e:[e],i=r.length;if(!ln(t))return t;n=n||{};const a=n.merger||JL;let o;for(let c=0;c<i;++c){if(o=r[c],!ln(o))continue;const f=Object.keys(o);for(let d=0,p=f.length;d<p;++d)a(f[d],t,o,n)}return t}function wh(t,e){return vo(t,e,{merger:eE})}function eE(t,e,n){if(!p3(t))return;const r=e[t],i=n[t];ln(r)&&ln(i)?wh(r,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Gm(i))}const I5={"":t=>t,x:t=>t.x,y:t=>t.y};function tE(t){const e=t.split("."),n=[];let r="";for(const i of e)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function nE(t){const e=tE(t);return n=>{for(const r of e){if(r==="")break;n=n&&n[r]}return n}}function Ph(t,e){return(I5[e]||(I5[e]=nE(e)))(t)}function py(t){return t.charAt(0).toUpperCase()+t.slice(1)}const $m=t=>typeof t<"u",wc=t=>typeof t=="function",z5=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function rE(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const qn=Math.PI,Br=2*qn,Xm=Number.POSITIVE_INFINITY,iE=qn/180,Ur=qn/2,hu=qn/4,H5=qn*2/3,U5=Math.sign;function aE(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r===0&&(e.push(r),e.push(t/r));return n===(n|0)&&e.push(n),e.sort((i,a)=>i-a).pop(),e}function sE(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Zm(t){return!sE(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function Su(t){return t*(qn/180)}function oE(t){return t*(180/qn)}function m3(t,e){const n=e.x-t.x,r=e.y-t.y,i=Math.sqrt(n*n+r*r);let a=Math.atan2(r,n);return a<-.5*qn&&(a+=Br),{angle:a,distance:i}}function lE(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function co(t){return(t%Br+Br)%Br}function Km(t,e,n,r){const i=co(t),a=co(e),o=co(n),c=co(a-i),f=co(o-i),d=co(i-a),p=co(i-o);return i===a||i===o||r&&a===o||c>f&&d<p}function va(t,e,n){return Math.max(e,Math.min(n,t))}function cE(t){return va(t,-32768,32767)}function _u(t,e,n,r=1e-6){return t>=Math.min(e,n)-r&&t<=Math.max(e,n)+r}function my(t,e,n){n=n||(o=>t[o]<e);let r=t.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}const u2=(t,e,n,r)=>my(t,n,r?i=>{const a=t[i][e];return a<n||a===n&&t[i+1][e]===n}:i=>t[i][e]<n),uE=(t,e,n)=>my(t,n,r=>t[r][e]>=n);function fE(t,e,n){let r=0,i=t.length;for(;r<i&&t[r]<e;)r++;for(;i>r&&t[i-1]>n;)i--;return r>0||i<t.length?t.slice(r,i):t}const g3=["push","pop","shift","splice","unshift"];function dE(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),g3.forEach(n=>{const r="_onData"+py(n),i=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...a){const o=i.apply(this,a);return t._chartjs.listeners.forEach(c=>{typeof c[r]=="function"&&c[r](...a)}),o}})})}function q5(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(e);i!==-1&&r.splice(i,1),!(r.length>0)&&(g3.forEach(a=>{delete t[a]}),delete t._chartjs)}function hE(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const y3=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function v3(t,e){let n=[],r=!1;return function(...i){n=i,r||(r=!0,y3.call(window,()=>{r=!1,t.apply(e,n)}))}}function pE(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}const b3=t=>t==="start"?"left":t==="end"?"right":"center",pa=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,mE=(t,e,n,r)=>t===(r?"left":"right")?n:t==="center"?(e+n)/2:e,nm=t=>t===0||t===1,W5=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Br/n)),Y5=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*Br/n)+1,Sh={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*Ur)+1,easeOutSine:t=>Math.sin(t*Ur),easeInOutSine:t=>-.5*(Math.cos(qn*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>nm(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>nm(t)?t:W5(t,.075,.3),easeOutElastic:t=>nm(t)?t:Y5(t,.075,.3),easeInOutElastic(t){return nm(t)?t:t<.5?.5*W5(t*2,.1125,.45):.5+.5*Y5(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Sh.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Sh.easeInBounce(t*2)*.5:Sh.easeOutBounce(t*2-1)*.5+.5};function x3(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function V5(t){return x3(t)?t:new Rh(t)}function d1(t){return x3(t)?t:new Rh(t).saturate(.5).darken(.1).hexString()}const gE=["x","y","borderWidth","radius","tension"],yE=["color","borderColor","backgroundColor"];function vE(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:yE},numbers:{type:"number",properties:gE}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function bE(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const G5=new Map;function xE(t,e){e=e||{};const n=t+JSON.stringify(e);let r=G5.get(n);return r||(r=new Intl.NumberFormat(t,e),G5.set(n,r)),r}function wE(t,e,n){return xE(e,n).format(t)}const SE={values(t){return Qr(t)?t:""+t}};var _E={formatters:SE};function NE(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:_E.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Lu=Object.create(null),f2=Object.create(null);function _h(t,e){if(!e)return t;const n=e.split(".");for(let r=0,i=n.length;r<i;++r){const a=n[r];t=t[a]||(t[a]=Object.create(null))}return t}function h1(t,e,n){return typeof e=="string"?vo(_h(t,e),n):vo(_h(t,""),e)}class AE{constructor(e,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>d1(i.backgroundColor),this.hoverBorderColor=(r,i)=>d1(i.borderColor),this.hoverColor=(r,i)=>d1(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return h1(this,e,n)}get(e){return _h(this,e)}describe(e,n){return h1(f2,e,n)}override(e,n){return h1(Lu,e,n)}route(e,n,r,i){const a=_h(this,e),o=_h(this,r),c="_"+n;Object.defineProperties(a,{[c]:{value:a[n],writable:!0},[n]:{enumerable:!0,get(){const f=this[c],d=o[i];return ln(f)?Object.assign({},d,f):bn(f,d)},set(f){this[c]=f}}})}apply(e){e.forEach(n=>n(this))}}var yr=new AE({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[vE,bE,NE]);function CE(t){return!t||Mr(t.size)||Mr(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function $5(t,e,n,r,i){let a=e[i];return a||(a=e[i]=t.measureText(i).width,n.push(i)),a>r&&(r=a),r}function pu(t,e,n){const r=t.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((e-i)*r)/r+i}function X5(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function d2(t,e,n,r){w3(t,e,n,r,null)}function w3(t,e,n,r,i){let a,o,c,f,d,p,g,b;const y=e.pointStyle,N=e.rotation,w=e.radius;let k=(N||0)*iE;if(y&&typeof y=="object"&&(a=y.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){t.save(),t.translate(n,r),t.rotate(k),t.drawImage(y,-y.width/2,-y.height/2,y.width,y.height),t.restore();return}if(!(isNaN(w)||w<=0)){switch(t.beginPath(),y){default:i?t.ellipse(n,r,i/2,w,0,0,Br):t.arc(n,r,w,0,Br),t.closePath();break;case"triangle":p=i?i/2:w,t.moveTo(n+Math.sin(k)*p,r-Math.cos(k)*w),k+=H5,t.lineTo(n+Math.sin(k)*p,r-Math.cos(k)*w),k+=H5,t.lineTo(n+Math.sin(k)*p,r-Math.cos(k)*w),t.closePath();break;case"rectRounded":d=w*.516,f=w-d,o=Math.cos(k+hu)*f,g=Math.cos(k+hu)*(i?i/2-d:f),c=Math.sin(k+hu)*f,b=Math.sin(k+hu)*(i?i/2-d:f),t.arc(n-g,r-c,d,k-qn,k-Ur),t.arc(n+b,r-o,d,k-Ur,k),t.arc(n+g,r+c,d,k,k+Ur),t.arc(n-b,r+o,d,k+Ur,k+qn),t.closePath();break;case"rect":if(!N){f=Math.SQRT1_2*w,p=i?i/2:f,t.rect(n-p,r-f,2*p,2*f);break}k+=hu;case"rectRot":g=Math.cos(k)*(i?i/2:w),o=Math.cos(k)*w,c=Math.sin(k)*w,b=Math.sin(k)*(i?i/2:w),t.moveTo(n-g,r-c),t.lineTo(n+b,r-o),t.lineTo(n+g,r+c),t.lineTo(n-b,r+o),t.closePath();break;case"crossRot":k+=hu;case"cross":g=Math.cos(k)*(i?i/2:w),o=Math.cos(k)*w,c=Math.sin(k)*w,b=Math.sin(k)*(i?i/2:w),t.moveTo(n-g,r-c),t.lineTo(n+g,r+c),t.moveTo(n+b,r-o),t.lineTo(n-b,r+o);break;case"star":g=Math.cos(k)*(i?i/2:w),o=Math.cos(k)*w,c=Math.sin(k)*w,b=Math.sin(k)*(i?i/2:w),t.moveTo(n-g,r-c),t.lineTo(n+g,r+c),t.moveTo(n+b,r-o),t.lineTo(n-b,r+o),k+=hu,g=Math.cos(k)*(i?i/2:w),o=Math.cos(k)*w,c=Math.sin(k)*w,b=Math.sin(k)*(i?i/2:w),t.moveTo(n-g,r-c),t.lineTo(n+g,r+c),t.moveTo(n+b,r-o),t.lineTo(n-b,r+o);break;case"line":o=i?i/2:Math.cos(k)*w,c=Math.sin(k)*w,t.moveTo(n-o,r-c),t.lineTo(n+o,r+c);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(k)*(i?i/2:w),r+Math.sin(k)*w);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function gy(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function yy(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function vy(t){t.restore()}function kE(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Mr(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function ME(t,e,n,r,i){if(i.strikethrough||i.underline){const a=t.measureText(r),o=e-a.actualBoundingBoxLeft,c=e+a.actualBoundingBoxRight,f=n-a.actualBoundingBoxAscent,d=n+a.actualBoundingBoxDescent,p=i.strikethrough?(f+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=i.decorationWidth||2,t.moveTo(o,p),t.lineTo(c,p),t.stroke()}}function LE(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function Qm(t,e,n,r,i,a={}){const o=Qr(e)?e:[e],c=a.strokeWidth>0&&a.strokeColor!=="";let f,d;for(t.save(),t.font=i.string,kE(t,a),f=0;f<o.length;++f)d=o[f],a.backdrop&&LE(t,a.backdrop),c&&(a.strokeColor&&(t.strokeStyle=a.strokeColor),Mr(a.strokeWidth)||(t.lineWidth=a.strokeWidth),t.strokeText(d,n,r,a.maxWidth)),t.fillText(d,n,r,a.maxWidth),ME(t,n,r,d,a),r+=Number(i.lineHeight);t.restore()}function Jm(t,e){const{x:n,y:r,w:i,h:a,radius:o}=e;t.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*qn,qn,!0),t.lineTo(n,r+a-o.bottomLeft),t.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,qn,Ur,!0),t.lineTo(n+i-o.bottomRight,r+a),t.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,Ur,0,!0),t.lineTo(n+i,r+o.topRight),t.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-Ur,!0),t.lineTo(n+o.topLeft,r)}const EE=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,DE=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function jE(t,e){const n=(""+t).match(EE);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const OE=t=>+t||0;function by(t,e){const n={},r=ln(e),i=r?Object.keys(e):e,a=ln(t)?r?o=>bn(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of i)n[o]=OE(a(o));return n}function S3(t){return by(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ff(t){return by(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Fa(t){const e=S3(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ri(t,e){t=t||{},e=e||yr.font;let n=bn(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let r=bn(t.style,e.style);r&&!(""+r).match(DE)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:bn(t.family,e.family),lineHeight:jE(bn(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:bn(t.weight,e.weight),string:""};return i.string=CE(i),i}function Kn(t,e,n,r){let i,a,o;for(i=0,a=t.length;i<a;++i)if(o=t[i],o!==void 0&&(e!==void 0&&typeof o=="function"&&(o=o(e)),n!==void 0&&Qr(o)&&(o=o[n%o.length]),o!==void 0))return o}function TE(t,e,n){const{min:r,max:i}=t,a=h3(e,(i-r)/2),o=(c,f)=>n&&c===0?0:c+f;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function ad(t,e){return Object.assign(Object.create(t),e)}function xy(t,e=[""],n,r,i=()=>t[0]){const a=n||t;typeof r>"u"&&(r=C3("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:a,_fallback:r,_getTarget:i,override:c=>xy([c,...t],e,a,r)};return new Proxy(o,{deleteProperty(c,f){return delete c[f],delete c._keys,delete t[0][f],!0},get(c,f){return N3(c,f,()=>UE(f,e,t,c))},getOwnPropertyDescriptor(c,f){return Reflect.getOwnPropertyDescriptor(c._scopes[0],f)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(c,f){return K5(c).includes(f)},ownKeys(c){return K5(c)},set(c,f,d){const p=c._storage||(c._storage=i());return c[f]=p[f]=d,delete c._keys,!0}})}function Xf(t,e,n,r){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:_3(t,r),setContext:a=>Xf(t,a,n,r),override:a=>Xf(t.override(a),e,n,r)};return new Proxy(i,{deleteProperty(a,o){return delete a[o],delete t[o],!0},get(a,o,c){return N3(a,o,()=>PE(a,o,c))},getOwnPropertyDescriptor(a,o){return a._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(a,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(a,o,c){return t[o]=c,delete a[o],!0}})}function _3(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:i=e.allKeys}=t;return{allKeys:i,scriptable:n,indexable:r,isScriptable:wc(n)?n:()=>n,isIndexable:wc(r)?r:()=>r}}const RE=(t,e)=>t?t+py(e):e,wy=(t,e)=>ln(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function N3(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const r=n();return t[e]=r,r}function PE(t,e,n){const{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=t;let c=r[e];return wc(c)&&o.isScriptable(e)&&(c=BE(e,c,t,n)),Qr(c)&&c.length&&(c=FE(e,c,t,o.isIndexable)),wy(e,c)&&(c=Xf(c,i,a&&a[e],o)),c}function BE(t,e,n,r){const{_proxy:i,_context:a,_subProxy:o,_stack:c}=n;if(c.has(t))throw new Error("Recursion detected: "+Array.from(c).join("->")+"->"+t);c.add(t);let f=e(a,o||r);return c.delete(t),wy(t,f)&&(f=Sy(i._scopes,i,t,f)),f}function FE(t,e,n,r){const{_proxy:i,_context:a,_subProxy:o,_descriptors:c}=n;if(typeof a.index<"u"&&r(t))return e[a.index%e.length];if(ln(e[0])){const f=e,d=i._scopes.filter(p=>p!==f);e=[];for(const p of f){const g=Sy(d,i,t,p);e.push(Xf(g,a,o&&o[t],c))}}return e}function A3(t,e,n){return wc(t)?t(e,n):t}const IE=(t,e)=>t===!0?e:typeof t=="string"?Ph(e,t):void 0;function zE(t,e,n,r,i){for(const a of e){const o=IE(n,a);if(o){t.add(o);const c=A3(o._fallback,n,i);if(typeof c<"u"&&c!==n&&c!==r)return c}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function Sy(t,e,n,r){const i=e._rootScopes,a=A3(e._fallback,n,r),o=[...t,...i],c=new Set;c.add(r);let f=Z5(c,o,n,a||n,r);return f===null||typeof a<"u"&&a!==n&&(f=Z5(c,o,a,f,r),f===null)?!1:xy(Array.from(c),[""],i,a,()=>HE(e,n,r))}function Z5(t,e,n,r,i){for(;n;)n=zE(t,e,n,r,i);return n}function HE(t,e,n){const r=t._getTarget();e in r||(r[e]={});const i=r[e];return Qr(i)&&ln(n)?n:i||{}}function UE(t,e,n,r){let i;for(const a of e)if(i=C3(RE(a,t),n),typeof i<"u")return wy(t,i)?Sy(n,r,t,i):i}function C3(t,e){for(const n of e){if(!n)continue;const r=n[t];if(typeof r<"u")return r}}function K5(t){let e=t._keys;return e||(e=t._keys=qE(t._scopes)),e}function qE(t){const e=new Set;for(const n of t)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))e.add(r);return Array.from(e)}function _y(){return typeof window<"u"&&typeof document<"u"}function Ny(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function eg(t,e,n){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*e.parentNode[n])):r=t,r}const Sg=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function WE(t,e){return Sg(t).getPropertyValue(e)}const YE=["top","right","bottom","left"];function Au(t,e,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const a=YE[i];r[a]=parseFloat(t[e+"-"+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const VE=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function GE(t,e){const n=t.touches,r=n&&n.length?n[0]:t,{offsetX:i,offsetY:a}=r;let o=!1,c,f;if(VE(i,a,t.target))c=i,f=a;else{const d=e.getBoundingClientRect();c=r.clientX-d.left,f=r.clientY-d.top,o=!0}return{x:c,y:f,box:o}}function vu(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:r}=e,i=Sg(n),a=i.boxSizing==="border-box",o=Au(i,"padding"),c=Au(i,"border","width"),{x:f,y:d,box:p}=GE(t,n),g=o.left+(p&&c.left),b=o.top+(p&&c.top);let{width:y,height:N}=e;return a&&(y-=o.width+c.width,N-=o.height+c.height),{x:Math.round((f-g)/y*n.width/r),y:Math.round((d-b)/N*n.height/r)}}function $E(t,e,n){let r,i;if(e===void 0||n===void 0){const a=t&&Ny(t);if(!a)e=t.clientWidth,n=t.clientHeight;else{const o=a.getBoundingClientRect(),c=Sg(a),f=Au(c,"border","width"),d=Au(c,"padding");e=o.width-d.width-f.width,n=o.height-d.height-f.height,r=eg(c.maxWidth,a,"clientWidth"),i=eg(c.maxHeight,a,"clientHeight")}}return{width:e,height:n,maxWidth:r||Xm,maxHeight:i||Xm}}const rm=t=>Math.round(t*10)/10;function XE(t,e,n,r){const i=Sg(t),a=Au(i,"margin"),o=eg(i.maxWidth,t,"clientWidth")||Xm,c=eg(i.maxHeight,t,"clientHeight")||Xm,f=$E(t,e,n);let{width:d,height:p}=f;if(i.boxSizing==="content-box"){const b=Au(i,"border","width"),y=Au(i,"padding");d-=y.width+b.width,p-=y.height+b.height}return d=Math.max(0,d-a.width),p=Math.max(0,r?d/r:p-a.height),d=rm(Math.min(d,o,f.maxWidth)),p=rm(Math.min(p,c,f.maxHeight)),d&&!p&&(p=rm(d/2)),(e!==void 0||n!==void 0)&&r&&f.height&&p>f.height&&(p=f.height,d=rm(Math.floor(p*r))),{width:d,height:p}}function Q5(t,e,n){const r=e||1,i=Math.floor(t.height*r),a=Math.floor(t.width*r);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(t.currentDevicePixelRatio=r,o.height=i,o.width=a,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const ZE=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};_y()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function J5(t,e){const n=WE(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}const KE=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},QE=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function If(t,e,n){return t?KE(e,n):QE()}function k3(t,e){let n,r;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function M3(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function im(t,e,n){return t.options.clip?t[n]:e[n]}function JE(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:im(n,e,"left"),right:im(n,e,"right"),top:im(r,e,"top"),bottom:im(r,e,"bottom")}:e}function eD(t,e){const n=e._clip;if(n.disabled)return!1;const r=JE(e,t.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
 * Chart.js v4.5.0
 * https://www.chartjs.org
 * (c) 2025 Chart.js Contributors
 * Released under the MIT License
 */class tD{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,i){const a=n.listeners[i],o=n.duration;a.forEach(c=>c({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=y3.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const a=r.items;let o=a.length-1,c=!1,f;for(;o>=0;--o)f=a[o],f._active?(f._total>r.duration&&(r.duration=f._total),f.tick(e),c=!0):(a[o]=a[a.length-1],a.pop());c&&(i.draw(),this._notify(i,r,e,"progress")),a.length||(r.running=!1,this._notify(i,r,e,"complete"),r.initial=!1),n+=a.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var al=new tD;const ex="transparent",nD={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const r=V5(t||ex),i=r.valid&&V5(e||ex);return i&&i.valid?i.mix(r,n).hexString():e},number(t,e,n){return t+(e-t)*n}};let rD=class{constructor(e,n,r,i){const a=n[r];i=Kn([e.to,i,a,e.from]);const o=Kn([e.from,a,i]);this._active=!0,this._fn=e.fn||nD[e.type||typeof o],this._easing=Sh[e.easing]||Sh.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],a=r-this._start,o=this._duration-a;this._start=r,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=a,this._loop=!!e.loop,this._to=Kn([e.to,n,i,e.from]),this._from=Kn([e.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,i=this._prop,a=this._from,o=this._loop,c=this._to;let f;if(this._active=a!==c&&(o||n<r),!this._active){this._target[i]=c,this._notify(!0);return}if(n<0){this._target[i]=a;return}f=n/r%2,f=o&&f>1?2-f:f,f=this._easing(Math.min(1,Math.max(0,f))),this._target[i]=this._fn(a,c,f)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}};class L3{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!ln(e))return;const n=Object.keys(yr.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const a=e[i];if(!ln(a))return;const o={};for(const c of n)o[c]=a[c];(Qr(a.properties)&&a.properties||[i]).forEach(c=>{(c===i||!r.has(c))&&r.set(c,o)})})}_animateOptions(e,n){const r=n.options,i=aD(e,r);if(!i)return[];const a=this._createAnimations(i,r);return r.$shared&&iD(e.options.$animations,r).then(()=>{e.options=r},()=>{}),a}_createAnimations(e,n){const r=this._properties,i=[],a=e.$animations||(e.$animations={}),o=Object.keys(n),c=Date.now();let f;for(f=o.length-1;f>=0;--f){const d=o[f];if(d.charAt(0)==="$")continue;if(d==="options"){i.push(...this._animateOptions(e,n));continue}const p=n[d];let g=a[d];const b=r.get(d);if(g)if(b&&g.active()){g.update(b,p,c);continue}else g.cancel();if(!b||!b.duration){e[d]=p;continue}a[d]=g=new rD(b,e,d,p),i.push(g)}return i}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return al.add(this._chart,r),!0}}function iD(t,e){const n=[],r=Object.keys(e);for(let i=0;i<r.length;i++){const a=t[r[i]];a&&a.active()&&n.push(a.wait())}return Promise.all(n)}function aD(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function tx(t,e){const n=t&&t.options||{},r=n.reverse,i=n.min===void 0?e:0,a=n.max===void 0?e:0;return{start:r?a:i,end:r?i:a}}function sD(t,e,n){if(n===!1)return!1;const r=tx(t,n),i=tx(e,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function oD(t){let e,n,r,i;return ln(t)?(e=t.top,n=t.right,r=t.bottom,i=t.left):e=n=r=i=t,{top:e,right:n,bottom:r,left:i,disabled:t===!1}}function E3(t,e){const n=[],r=t._getSortedDatasetMetas(e);let i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function nx(t,e,n,r={}){const i=t.keys,a=r.mode==="single";let o,c,f,d;if(e===null)return;let p=!1;for(o=0,c=i.length;o<c;++o){if(f=+i[o],f===n){if(p=!0,r.all)continue;break}d=t.values[f],pl(d)&&(a||e===0||U5(e)===U5(d))&&(e+=d)}return!p&&!r.all?0:e}function lD(t,e){const{iScale:n,vScale:r}=e,i=n.axis==="x"?"x":"y",a=r.axis==="x"?"x":"y",o=Object.keys(t),c=new Array(o.length);let f,d,p;for(f=0,d=o.length;f<d;++f)p=o[f],c[f]={[i]:p,[a]:t[p]};return c}function p1(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function cD(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function uD(t){const{min:e,max:n,minDefined:r,maxDefined:i}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function fD(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function rx(t,e,n,r){for(const i of e.getMatchingVisibleMetas(r).reverse()){const a=t[i.index];if(n&&a>0||!n&&a<0)return i.index}return null}function ix(t,e){const{chart:n,_cachedMeta:r}=t,i=n._stacks||(n._stacks={}),{iScale:a,vScale:o,index:c}=r,f=a.axis,d=o.axis,p=cD(a,o,r),g=e.length;let b;for(let y=0;y<g;++y){const N=e[y],{[f]:w,[d]:k}=N,C=N._stacks||(N._stacks={});b=C[d]=fD(i,p,w),b[c]=k,b._top=rx(b,o,!0,r.type),b._bottom=rx(b,o,!1,r.type);const L=b._visualValues||(b._visualValues={});L[c]=k}}function m1(t,e){const n=t.scales;return Object.keys(n).filter(r=>n[r].axis===e).shift()}function dD(t,e){return ad(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function hD(t,e,n){return ad(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function lh(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const i of e){const a=i._stacks;if(!a||a[r]===void 0||a[r][n]===void 0)return;delete a[r][n],a[r]._visualValues!==void 0&&a[r]._visualValues[n]!==void 0&&delete a[r]._visualValues[n]}}}const g1=t=>t==="reset"||t==="none",ax=(t,e)=>e?t:Object.assign({},t),pD=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:E3(n,!0),values:null};class D3{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=p1(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&lh(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(g,b,y,N)=>g==="x"?b:g==="r"?N:y,a=n.xAxisID=bn(r.xAxisID,m1(e,"x")),o=n.yAxisID=bn(r.yAxisID,m1(e,"y")),c=n.rAxisID=bn(r.rAxisID,m1(e,"r")),f=n.indexAxis,d=n.iAxisID=i(f,a,o,c),p=n.vAxisID=i(f,o,a,c);n.xScale=this.getScaleForId(a),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(c),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(p)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&q5(this._data,this),e._stacked&&lh(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),r=this._data;if(ln(n)){const i=this._cachedMeta;this._data=lD(n,i)}else if(r!==n){if(r){q5(r,this);const i=this._cachedMeta;lh(i),i._parsed=[]}n&&Object.isExtensible(n)&&dE(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const a=n._stacked;n._stacked=p1(n.vScale,n),n.stack!==r.stack&&(i=!0,lh(n),n.stack=r.stack),this._resyncElements(e),(i||a!==n._stacked)&&(ix(this,n._parsed),n._stacked=p1(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:r,_data:i}=this,{iScale:a,_stacked:o}=r,c=a.axis;let f=e===0&&n===i.length?!0:r._sorted,d=e>0&&r._parsed[e-1],p,g,b;if(this._parsing===!1)r._parsed=i,r._sorted=!0,b=i;else{Qr(i[e])?b=this.parseArrayData(r,i,e,n):ln(i[e])?b=this.parseObjectData(r,i,e,n):b=this.parsePrimitiveData(r,i,e,n);const y=()=>g[c]===null||d&&g[c]<d[c];for(p=0;p<n;++p)r._parsed[p+e]=g=b[p],f&&(y()&&(f=!1),d=g);r._sorted=f}o&&ix(this,b)}parsePrimitiveData(e,n,r,i){const{iScale:a,vScale:o}=e,c=a.axis,f=o.axis,d=a.getLabels(),p=a===o,g=new Array(i);let b,y,N;for(b=0,y=i;b<y;++b)N=b+r,g[b]={[c]:p||a.parse(d[N],N),[f]:o.parse(n[N],N)};return g}parseArrayData(e,n,r,i){const{xScale:a,yScale:o}=e,c=new Array(i);let f,d,p,g;for(f=0,d=i;f<d;++f)p=f+r,g=n[p],c[f]={x:a.parse(g[0],p),y:o.parse(g[1],p)};return c}parseObjectData(e,n,r,i){const{xScale:a,yScale:o}=e,{xAxisKey:c="x",yAxisKey:f="y"}=this._parsing,d=new Array(i);let p,g,b,y;for(p=0,g=i;p<g;++p)b=p+r,y=n[b],d[p]={x:a.parse(Ph(y,c),b),y:o.parse(Ph(y,f),b)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,r){const i=this.chart,a=this._cachedMeta,o=n[e.axis],c={keys:E3(i,!0),values:n._stacks[e.axis]._visualValues};return nx(c,o,a.index,{mode:r})}updateRangeFromParsed(e,n,r,i){const a=r[n.axis];let o=a===null?NaN:a;const c=i&&r._stacks[n.axis];i&&c&&(i.values=c,o=nx(i,a,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,n){const r=this._cachedMeta,i=r._parsed,a=r._sorted&&e===r.iScale,o=i.length,c=this._getOtherScale(e),f=pD(n,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:p,max:g}=uD(c);let b,y;function N(){y=i[b];const w=y[c.axis];return!pl(y[e.axis])||p>w||g<w}for(b=0;b<o&&!(!N()&&(this.updateRangeFromParsed(d,e,y,f),a));++b);if(a){for(b=o-1;b>=0;--b)if(!N()){this.updateRangeFromParsed(d,e,y,f);break}}return d}getAllParsedValues(e){const n=this._cachedMeta._parsed,r=[];let i,a,o;for(i=0,a=n.length;i<a;++i)o=n[i][e.axis],pl(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,r=n.iScale,i=n.vScale,a=this.getParsed(e);return{label:r?""+r.getLabelForValue(a[r.axis]):"",value:i?""+i.getLabelForValue(a[i.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=oD(bn(this.options.clip,sD(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],a=n.chartArea,o=[],c=this._drawStart||0,f=this._drawCount||i.length-c,d=this.options.drawActiveElementsOnTop;let p;for(r.dataset&&r.dataset.draw(e,a,c,f),p=c;p<c+f;++p){const g=i[p];g.hidden||(g.active&&d?o.push(g):g.draw(e,a))}for(p=0;p<o.length;++p)o[p].draw(e,a)}getStyle(e,n){const r=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,n,r){const i=this.getDataset();let a;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];a=o.$context||(o.$context=hD(this.getContext(),e,o)),a.parsed=this.getParsed(e),a.raw=i.data[e],a.index=a.dataIndex=e}else a=this.$context||(this.$context=dD(this.chart.getContext(),this.index)),a.dataset=i,a.index=a.datasetIndex=this.index;return a.active=!!n,a.mode=r,a}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",r){const i=n==="active",a=this._cachedDataOpts,o=e+"-"+n,c=a[o],f=this.enableOptionSharing&&$m(r);if(c)return ax(c,f);const d=this.chart.config,p=d.datasetElementScopeKeys(this._type,e),g=i?[`${e}Hover`,"hover",e,""]:[e,""],b=d.getOptionScopes(this.getDataset(),p),y=Object.keys(yr.elements[e]),N=()=>this.getContext(r,i,n),w=d.resolveNamedOptions(b,y,N,g);return w.$shared&&(w.$shared=f,a[o]=Object.freeze(ax(w,f))),w}_resolveAnimations(e,n,r){const i=this.chart,a=this._cachedDataOpts,o=`animation-${n}`,c=a[o];if(c)return c;let f;if(i.options.animation!==!1){const p=this.chart.config,g=p.datasetAnimationScopeKeys(this._type,n),b=p.getOptionScopes(this.getDataset(),g);f=p.createResolver(b,this.getContext(e,r,n))}const d=new L3(i,f&&f.animations);return f&&f._cacheable&&(a[o]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||g1(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const r=this.resolveDataElementOptions(e,n),i=this._sharedOptions,a=this.getSharedOptions(r),o=this.includeOptions(n,a)||a!==i;return this.updateSharedOptions(a,n,r),{sharedOptions:a,includeOptions:o}}updateElement(e,n,r,i){g1(i)?Object.assign(e,r):this._resolveAnimations(n,i).update(e,r)}updateSharedOptions(e,n,r){e&&!g1(n)&&this._resolveAnimations(void 0,n).update(e,r)}_setStyle(e,n,r,i){e.active=i;const a=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(e,{options:!i&&this.getSharedOptions(a)||a})}removeHoverStyle(e,n,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,n,r){this._setStyle(e,r,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,r=this._cachedMeta.data;for(const[c,f,d]of this._syncList)this[c](f,d);this._syncList=[];const i=r.length,a=n.length,o=Math.min(a,i);o&&this.parse(0,o),a>i?this._insertElements(i,a-i,e):a<i&&this._removeElements(a,i-a)}_insertElements(e,n,r=!0){const i=this._cachedMeta,a=i.data,o=e+n;let c;const f=d=>{for(d.length+=n,c=d.length-1;c>=o;c--)d[c]=d[c-n]};for(f(a),c=e;c<o;++c)a[c]=new this.dataElementType;this._parsing&&f(i._parsed),this.parse(e,n),r&&this.updateElements(a,e,n,"reset")}updateElements(e,n,r,i){}_removeElements(e,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(e,n);r._stacked&&lh(r,i)}r.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,r,i]=e;this[n](r,i)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function mD(t,e,n){let r=1,i=1,a=0,o=0;if(e<Br){const c=t,f=c+e,d=Math.cos(c),p=Math.sin(c),g=Math.cos(f),b=Math.sin(f),y=(j,z,O)=>Km(j,c,f,!0)?1:Math.max(z,z*n,O,O*n),N=(j,z,O)=>Km(j,c,f,!0)?-1:Math.min(z,z*n,O,O*n),w=y(0,d,g),k=y(Ur,p,b),C=N(qn,d,g),L=N(qn+Ur,p,b);r=(w-C)/2,i=(k-L)/2,a=-(w+C)/2,o=-(k+L)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}class gD extends D3{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=e.legend.options;return n.labels.map((a,o)=>{const f=e.getDatasetMeta(0).controller.getStyle(o);return{text:a,fillStyle:f.backgroundColor,strokeStyle:f.borderColor,fontColor:i,lineWidth:f.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(o),index:o}})}return[]}},onClick(e,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}};constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let a=f=>+r[f];if(ln(r[e])){const{key:f="value"}=this._parsing;a=d=>+Ph(r[d],f)}let o,c;for(o=e,c=e+n;o<c;++o)i._parsed[o]=a(o)}}_getRotation(){return Su(this.options.rotation-90)}_getCircumference(){return Su(this.options.circumference)}_getRotationExtents(){let e=Br,n=-Br;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,a=i._getRotation(),o=i._getCircumference();e=Math.min(e,a),n=Math.max(n,a+o)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,a=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,c=Math.max((Math.min(r.width,r.height)-o)/2,0),f=Math.min(QL(this.options.cutout,c),1),d=this._getRingWeight(this.index),{circumference:p,rotation:g}=this._getRotationExtents(),{ratioX:b,ratioY:y,offsetX:N,offsetY:w}=mD(g,p,f),k=(r.width-o)/b,C=(r.height-o)/y,L=Math.max(Math.min(k,C)/2,0),j=h3(this.options.radius,L),z=Math.max(j*f,0),O=(j-z)/this._getVisibleDatasetWeightTotal();this.offsetX=N*j,this.offsetY=w*j,i.total=this.calculateTotal(),this.outerRadius=j-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*d,0),this.updateElements(a,0,a.length,e)}_circumference(e,n){const r=this.options,i=this._cachedMeta,a=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(e)||i._parsed[e]===null||i.data[e].hidden?0:this.calculateCircumference(i._parsed[e]*a/Br)}updateElements(e,n,r,i){const a=i==="reset",o=this.chart,c=o.chartArea,d=o.options.animation,p=(c.left+c.right)/2,g=(c.top+c.bottom)/2,b=a&&d.animateScale,y=b?0:this.innerRadius,N=b?0:this.outerRadius,{sharedOptions:w,includeOptions:k}=this._getSharedOptions(n,i);let C=this._getRotation(),L;for(L=0;L<n;++L)C+=this._circumference(L,a);for(L=n;L<n+r;++L){const j=this._circumference(L,a),z=e[L],O={x:p+this.offsetX,y:g+this.offsetY,startAngle:C,endAngle:C+j,circumference:j,outerRadius:N,innerRadius:y};k&&(O.options=w||this.resolveDataElementOptions(L,z.active?"active":i)),C+=j,this.updateElement(z,L,O,i)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let r=0,i;for(i=0;i<n.length;i++){const a=e._parsed[i];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(a))}return r}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?Br*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=wE(n._parsed[e],r.options.locale);return{label:i[e]||"",value:a}}getMaxBorderWidth(e){let n=0;const r=this.chart;let i,a,o,c,f;if(!e){for(i=0,a=r.data.datasets.length;i<a;++i)if(r.isDatasetVisible(i)){o=r.getDatasetMeta(i),e=o.data,c=o.controller;break}}if(!e)return 0;for(i=0,a=e.length;i<a;++i)f=c.resolveDataElementOptions(i),f.borderAlign!=="inner"&&(n=Math.max(n,f.borderWidth||0,f.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let r=0,i=e.length;r<i;++r){const a=this.resolveDataElementOptions(r);n=Math.max(n,a.offset||0,a.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let r=0;r<e;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(e){return Math.max(bn(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}function mu(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ay{static override(e){Object.assign(Ay.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return mu()}parse(){return mu()}format(){return mu()}add(){return mu()}diff(){return mu()}startOf(){return mu()}endOf(){return mu()}}var yD={_date:Ay};function vD(t,e,n,r){const{controller:i,data:a,_sorted:o}=t,c=i._cachedMeta.iScale,f=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(c&&e===c.axis&&e!=="r"&&o&&a.length){const d=c._reversePixels?uE:u2;if(r){if(i._sharedOptions){const p=a[0],g=typeof p.getRange=="function"&&p.getRange(e);if(g){const b=d(a,e,n-g),y=d(a,e,n+g);return{lo:b.lo,hi:y.hi}}}}else{const p=d(a,e,n);if(f){const{vScale:g}=i._cachedMeta,{_parsed:b}=t,y=b.slice(0,p.lo+1).reverse().findIndex(w=>!Mr(w[g.axis]));p.lo-=Math.max(0,y);const N=b.slice(p.hi).findIndex(w=>!Mr(w[g.axis]));p.hi+=Math.max(0,N)}return p}}return{lo:0,hi:a.length-1}}function _g(t,e,n,r,i){const a=t.getSortedVisibleDatasetMetas(),o=n[e];for(let c=0,f=a.length;c<f;++c){const{index:d,data:p}=a[c],{lo:g,hi:b}=vD(a[c],e,o,i);for(let y=g;y<=b;++y){const N=p[y];N.skip||r(N,d,y)}}}function bD(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(r,i){const a=e?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}function y1(t,e,n,r,i){const a=[];return!i&&!t.isPointInArea(e)||_g(t,n,e,function(c,f,d){!i&&!gy(c,t.chartArea,0)||c.inRange(e.x,e.y,r)&&a.push({element:c,datasetIndex:f,index:d})},!0),a}function xD(t,e,n,r){let i=[];function a(o,c,f){const{startAngle:d,endAngle:p}=o.getProps(["startAngle","endAngle"],r),{angle:g}=m3(o,{x:e.x,y:e.y});Km(g,d,p)&&i.push({element:o,datasetIndex:c,index:f})}return _g(t,n,e,a),i}function wD(t,e,n,r,i,a){let o=[];const c=bD(n);let f=Number.POSITIVE_INFINITY;function d(p,g,b){const y=p.inRange(e.x,e.y,i);if(r&&!y)return;const N=p.getCenterPoint(i);if(!(!!a||t.isPointInArea(N))&&!y)return;const k=c(e,N);k<f?(o=[{element:p,datasetIndex:g,index:b}],f=k):k===f&&o.push({element:p,datasetIndex:g,index:b})}return _g(t,n,e,d),o}function v1(t,e,n,r,i,a){return!a&&!t.isPointInArea(e)?[]:n==="r"&&!r?xD(t,e,n,i):wD(t,e,n,r,i,a)}function sx(t,e,n,r,i){const a=[],o=n==="x"?"inXRange":"inYRange";let c=!1;return _g(t,n,e,(f,d,p)=>{f[o]&&f[o](e[n],i)&&(a.push({element:f,datasetIndex:d,index:p}),c=c||f.inRange(e.x,e.y,i))}),r&&!c?[]:a}var SD={modes:{index(t,e,n,r){const i=vu(e,t),a=n.axis||"x",o=n.includeInvisible||!1,c=n.intersect?y1(t,i,a,r,o):v1(t,i,a,!1,r,o),f=[];return c.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const p=c[0].index,g=d.data[p];g&&!g.skip&&f.push({element:g,datasetIndex:d.index,index:p})}),f):[]},dataset(t,e,n,r){const i=vu(e,t),a=n.axis||"xy",o=n.includeInvisible||!1;let c=n.intersect?y1(t,i,a,r,o):v1(t,i,a,!1,r,o);if(c.length>0){const f=c[0].datasetIndex,d=t.getDatasetMeta(f).data;c=[];for(let p=0;p<d.length;++p)c.push({element:d[p],datasetIndex:f,index:p})}return c},point(t,e,n,r){const i=vu(e,t),a=n.axis||"xy",o=n.includeInvisible||!1;return y1(t,i,a,r,o)},nearest(t,e,n,r){const i=vu(e,t),a=n.axis||"xy",o=n.includeInvisible||!1;return v1(t,i,a,n.intersect,r,o)},x(t,e,n,r){const i=vu(e,t);return sx(t,i,"x",n.intersect,r)},y(t,e,n,r){const i=vu(e,t);return sx(t,i,"y",n.intersect,r)}}};const j3=["left","top","right","bottom"];function ch(t,e){return t.filter(n=>n.pos===e)}function ox(t,e){return t.filter(n=>j3.indexOf(n.pos)===-1&&n.box.axis===e)}function uh(t,e){return t.sort((n,r)=>{const i=e?r:n,a=e?n:r;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function _D(t){const e=[];let n,r,i,a,o,c;for(n=0,r=(t||[]).length;n<r;++n)i=t[n],{position:a,options:{stack:o,stackWeight:c=1}}=i,e.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:c});return e}function ND(t){const e={};for(const n of t){const{stack:r,pos:i,stackWeight:a}=n;if(!r||!j3.includes(i))continue;const o=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=a}return e}function AD(t,e){const n=ND(t),{vBoxMaxWidth:r,hBoxMaxHeight:i}=e;let a,o,c;for(a=0,o=t.length;a<o;++a){c=t[a];const{fullSize:f}=c.box,d=n[c.stack],p=d&&c.stackWeight/d.weight;c.horizontal?(c.width=p?p*r:f&&e.availableWidth,c.height=i):(c.width=r,c.height=p?p*i:f&&e.availableHeight)}return n}function CD(t){const e=_D(t),n=uh(e.filter(d=>d.box.fullSize),!0),r=uh(ch(e,"left"),!0),i=uh(ch(e,"right")),a=uh(ch(e,"top"),!0),o=uh(ch(e,"bottom")),c=ox(e,"x"),f=ox(e,"y");return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(f).concat(o).concat(c),chartArea:ch(e,"chartArea"),vertical:r.concat(i).concat(f),horizontal:a.concat(o).concat(c)}}function lx(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function O3(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function kD(t,e,n,r){const{pos:i,box:a}=n,o=t.maxPadding;if(!ln(i)){n.size&&(t[i]-=n.size);const g=r[n.stack]||{size:0,count:1};g.size=Math.max(g.size,n.horizontal?a.height:a.width),n.size=g.size/g.count,t[i]+=n.size}a.getPadding&&O3(o,a.getPadding());const c=Math.max(0,e.outerWidth-lx(o,t,"left","right")),f=Math.max(0,e.outerHeight-lx(o,t,"top","bottom")),d=c!==t.w,p=f!==t.h;return t.w=c,t.h=f,n.horizontal?{same:d,other:p}:{same:p,other:d}}function MD(t){const e=t.maxPadding;function n(r){const i=Math.max(e[r]-t[r],0);return t[r]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function LD(t,e){const n=e.maxPadding;function r(i){const a={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{a[o]=Math.max(e[o],n[o])}),a}return r(t?["left","right"]:["top","bottom"])}function yh(t,e,n,r){const i=[];let a,o,c,f,d,p;for(a=0,o=t.length,d=0;a<o;++a){c=t[a],f=c.box,f.update(c.width||e.w,c.height||e.h,LD(c.horizontal,e));const{same:g,other:b}=kD(e,n,c,r);d|=g&&i.length,p=p||b,f.fullSize||i.push(c)}return d&&yh(i,e,n,r)||p}function am(t,e,n,r,i){t.top=n,t.left=e,t.right=e+r,t.bottom=n+i,t.width=r,t.height=i}function cx(t,e,n,r){const i=n.padding;let{x:a,y:o}=e;for(const c of t){const f=c.box,d=r[c.stack]||{placed:0,weight:1},p=c.stackWeight/d.weight||1;if(c.horizontal){const g=e.w*p,b=d.size||f.height;$m(d.start)&&(o=d.start),f.fullSize?am(f,i.left,o,n.outerWidth-i.right-i.left,b):am(f,e.left+d.placed,o,g,b),d.start=o,d.placed+=g,o=f.bottom}else{const g=e.h*p,b=d.size||f.width;$m(d.start)&&(a=d.start),f.fullSize?am(f,a,i.top,b,n.outerHeight-i.bottom-i.top):am(f,a,e.top+d.placed,b,g),d.start=a,d.placed+=g,a=f.right}}e.x=a,e.y=o}var yc={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,r){if(!t)return;const i=Fa(t.options.layout.padding),a=Math.max(e-i.width,0),o=Math.max(n-i.height,0),c=CD(t.boxes),f=c.vertical,d=c.horizontal;yn(t.boxes,w=>{typeof w.beforeLayout=="function"&&w.beforeLayout()});const p=f.reduce((w,k)=>k.box.options&&k.box.options.display===!1?w:w+1,0)||1,g=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/p,hBoxMaxHeight:o/2}),b=Object.assign({},i);O3(b,Fa(r));const y=Object.assign({maxPadding:b,w:a,h:o,x:i.left,y:i.top},i),N=AD(f.concat(d),g);yh(c.fullSize,y,g,N),yh(f,y,g,N),yh(d,y,g,N)&&yh(f,y,g,N),MD(y),cx(c.leftAndTop,y,g,N),y.x+=y.w,y.y+=y.h,cx(c.rightAndBottom,y,g,N),t.chartArea={left:y.left,top:y.top,right:y.left+y.w,bottom:y.top+y.h,height:y.h,width:y.w},yn(c.chartArea,w=>{const k=w.box;Object.assign(k,t.chartArea),k.update(y.w,y.h,{left:0,top:0,right:0,bottom:0})})}};class T3{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,r){}removeEventListener(e,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,r,i){return n=Math.max(0,n||e.width),r=r||e.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(e){return!0}updateConfig(e){}}class ED extends T3{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Om="$chartjs",DD={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ux=t=>t===null||t==="";function jD(t,e){const n=t.style,r=t.getAttribute("height"),i=t.getAttribute("width");if(t[Om]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",ux(i)){const a=J5(t,"width");a!==void 0&&(t.width=a)}if(ux(r))if(t.style.height==="")t.height=t.width/(e||2);else{const a=J5(t,"height");a!==void 0&&(t.height=a)}return t}const R3=ZE?{passive:!0}:!1;function OD(t,e,n){t&&t.addEventListener(e,n,R3)}function TD(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,R3)}function RD(t,e){const n=DD[t.type]||t.type,{x:r,y:i}=vu(t,e);return{type:n,chart:e,native:t,x:r!==void 0?r:null,y:i!==void 0?i:null}}function tg(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function PD(t,e,n){const r=t.canvas,i=new MutationObserver(a=>{let o=!1;for(const c of a)o=o||tg(c.addedNodes,r),o=o&&!tg(c.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function BD(t,e,n){const r=t.canvas,i=new MutationObserver(a=>{let o=!1;for(const c of a)o=o||tg(c.removedNodes,r),o=o&&!tg(c.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Bh=new Map;let fx=0;function P3(){const t=window.devicePixelRatio;t!==fx&&(fx=t,Bh.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function FD(t,e){Bh.size||window.addEventListener("resize",P3),Bh.set(t,e)}function ID(t){Bh.delete(t),Bh.size||window.removeEventListener("resize",P3)}function zD(t,e,n){const r=t.canvas,i=r&&Ny(r);if(!i)return;const a=v3((c,f)=>{const d=i.clientWidth;n(c,f),d<i.clientWidth&&n()},window),o=new ResizeObserver(c=>{const f=c[0],d=f.contentRect.width,p=f.contentRect.height;d===0&&p===0||a(d,p)});return o.observe(i),FD(t,a),o}function b1(t,e,n){n&&n.disconnect(),e==="resize"&&ID(t)}function HD(t,e,n){const r=t.canvas,i=v3(a=>{t.ctx!==null&&n(RD(a,t))},t);return OD(r,e,i),i}class UD extends T3{acquireContext(e,n){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(jD(e,n),r):null}releaseContext(e){const n=e.canvas;if(!n[Om])return!1;const r=n[Om].initial;["height","width"].forEach(a=>{const o=r[a];Mr(o)?n.removeAttribute(a):n.setAttribute(a,o)});const i=r.style||{};return Object.keys(i).forEach(a=>{n.style[a]=i[a]}),n.width=n.width,delete n[Om],!0}addEventListener(e,n,r){this.removeEventListener(e,n);const i=e.$proxies||(e.$proxies={}),o={attach:PD,detach:BD,resize:zD}[n]||HD;i[n]=o(e,n,r)}removeEventListener(e,n){const r=e.$proxies||(e.$proxies={}),i=r[n];if(!i)return;({attach:b1,detach:b1,resize:b1}[n]||TD)(e,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,r,i){return XE(e,n,r,i)}isAttached(e){const n=e&&Ny(e);return!!(n&&n.isConnected)}}function qD(t){return!_y()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?ED:UD}let Bu=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}hasValue(){return Zm(this.x)&&Zm(this.y)}getProps(e,n){const r=this.$animations;if(!n||!r)return this;const i={};return e.forEach(a=>{i[a]=r[a]&&r[a].active()?r[a]._to:this[a]}),i}};function WD(t,e){const n=t.options.ticks,r=YD(t),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?GD(e):[],o=a.length,c=a[0],f=a[o-1],d=[];if(o>i)return $D(e,d,a,o/i),d;const p=VD(a,e,i);if(o>0){let g,b;const y=o>1?Math.round((f-c)/(o-1)):null;for(sm(e,d,p,Mr(y)?0:c-y,c),g=0,b=o-1;g<b;g++)sm(e,d,p,a[g],a[g+1]);return sm(e,d,p,f,Mr(y)?e.length:f+y),d}return sm(e,d,p),d}function YD(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),i=t._maxLength/n;return Math.floor(Math.min(r,i))}function VD(t,e,n){const r=XD(t),i=e.length/n;if(!r)return Math.max(i,1);const a=aE(r);for(let o=0,c=a.length-1;o<c;o++){const f=a[o];if(f>i)return f}return Math.max(i,1)}function GD(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}function $D(t,e,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<t.length;o++)o===a&&(e.push(t[o]),i++,a=n[i*r])}function sm(t,e,n,r,i){const a=bn(r,0),o=Math.min(bn(i,t.length),t.length);let c=0,f,d,p;for(n=Math.ceil(n),i&&(f=i-r,n=f/Math.floor(f/n)),p=a;p<0;)c++,p=Math.round(a+c*n);for(d=Math.max(a,0);d<o;d++)d===p&&(e.push(t[d]),c++,p=Math.round(a+c*n))}function XD(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}const ZD=t=>t==="left"?"right":t==="right"?"left":t,dx=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,hx=(t,e)=>Math.min(e||t,t);function px(t,e){const n=[],r=t.length/e,i=t.length;let a=0;for(;a<i;a+=r)n.push(t[Math.floor(a)]);return n}function KD(t,e,n){const r=t.ticks.length,i=Math.min(e,r-1),a=t._startPixel,o=t._endPixel,c=1e-6;let f=t.getPixelForTick(i),d;if(!(n&&(r===1?d=Math.max(f-a,o-f):e===0?d=(t.getPixelForTick(1)-f)/2:d=(f-t.getPixelForTick(i-1))/2,f+=i<e?d:-d,f<a-c||f>o+c)))return f}function QD(t,e){yn(t,n=>{const r=n.gc,i=r.length/2;let a;if(i>e){for(a=0;a<i;++a)delete n.data[r[a]];r.splice(0,i)}})}function fh(t){return t.drawTicks?t.tickLength:0}function mx(t,e){if(!t.display)return 0;const n=Ri(t.font,e),r=Fa(t.padding);return(Qr(t.text)?t.text.length:1)*n.lineHeight+r.height}function JD(t,e){return ad(t,{scale:e,type:"scale"})}function e7(t,e,n){return ad(t,{tick:n,index:e,type:"tick"})}function t7(t,e,n){let r=b3(t);return(n&&e!=="right"||!n&&e==="right")&&(r=ZD(r)),r}function n7(t,e,n,r){const{top:i,left:a,bottom:o,right:c,chart:f}=t,{chartArea:d,scales:p}=f;let g=0,b,y,N;const w=o-i,k=c-a;if(t.isHorizontal()){if(y=pa(r,a,c),ln(n)){const C=Object.keys(n)[0],L=n[C];N=p[C].getPixelForValue(L)+w-e}else n==="center"?N=(d.bottom+d.top)/2+w-e:N=dx(t,n,e);b=c-a}else{if(ln(n)){const C=Object.keys(n)[0],L=n[C];y=p[C].getPixelForValue(L)-k+e}else n==="center"?y=(d.left+d.right)/2-k+e:y=dx(t,n,e);N=pa(r,o,i),g=n==="left"?-Ur:Ur}return{titleX:y,titleY:N,maxWidth:b,rotation:g}}class Ng extends Bu{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return e=ro(e,Number.POSITIVE_INFINITY),n=ro(n,Number.NEGATIVE_INFINITY),r=ro(r,Number.POSITIVE_INFINITY),i=ro(i,Number.NEGATIVE_INFINITY),{min:ro(e,r),max:ro(n,i),minDefined:pl(e),maxDefined:pl(n)}}getMinMax(e){let{min:n,max:r,minDefined:i,maxDefined:a}=this.getUserBounds(),o;if(i&&a)return{min:n,max:r};const c=this.getMatchingVisibleMetas();for(let f=0,d=c.length;f<d;++f)o=c[f].controller.getMinMax(this,e),i||(n=Math.min(n,o.min)),a||(r=Math.max(r,o.max));return n=a&&n>r?r:n,r=i&&n>r?n:r,{min:ro(n,ro(r,n)),max:ro(r,ro(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Pn(this.options.beforeUpdate,[this])}update(e,n,r){const{beginAtZero:i,grace:a,ticks:o}=this.options,c=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=TE(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const f=c<this.ticks.length;this._convertTicksToLabels(f?px(this.ticks,c):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=WD(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),f&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,e=!e),this._startPixel=n,this._endPixel=r,this._reversePixels=e,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Pn(this.options.afterUpdate,[this])}beforeSetDimensions(){Pn(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Pn(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Pn(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Pn(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r],a.label=Pn(n.callback,[a.value,r,e],this)}afterTickToLabelConversion(){Pn(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Pn(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,r=hx(this.ticks.length,e.ticks.maxTicksLimit),i=n.minRotation||0,a=n.maxRotation;let o=i,c,f,d;if(!this._isVisible()||!n.display||i>=a||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const p=this._getLabelSizes(),g=p.widest.width,b=p.highest.height,y=va(this.chart.width-g,0,this.maxWidth);c=e.offset?this.maxWidth/r:y/(r-1),g+6>c&&(c=y/(r-(e.offset?.5:1)),f=this.maxHeight-fh(e.grid)-n.padding-mx(e.title,this.chart.options.font),d=Math.sqrt(g*g+b*b),o=oE(Math.min(Math.asin(va((p.highest.height+6)/c,-1,1)),Math.asin(va(f/d,-1,1))-Math.asin(va(b/d,-1,1)))),o=Math.max(i,Math.min(a,o))),this.labelRotation=o}afterCalculateLabelRotation(){Pn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Pn(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:a}}=this,o=this._isVisible(),c=this.isHorizontal();if(o){const f=mx(i,n.options.font);if(c?(e.width=this.maxWidth,e.height=fh(a)+f):(e.height=this.maxHeight,e.width=fh(a)+f),r.display&&this.ticks.length){const{first:d,last:p,widest:g,highest:b}=this._getLabelSizes(),y=r.padding*2,N=Su(this.labelRotation),w=Math.cos(N),k=Math.sin(N);if(c){const C=r.mirror?0:k*g.width+w*b.height;e.height=Math.min(this.maxHeight,e.height+C+y)}else{const C=r.mirror?0:w*g.width+k*b.height;e.width=Math.min(this.maxWidth,e.width+C+y)}this._calculatePadding(d,p,k,w)}}this._handleMargins(),c?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,r,i){const{ticks:{align:a,padding:o},position:c}=this.options,f=this.labelRotation!==0,d=c!=="top"&&this.axis==="x";if(this.isHorizontal()){const p=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let b=0,y=0;f?d?(b=i*e.width,y=r*n.height):(b=r*e.height,y=i*n.width):a==="start"?y=n.width:a==="end"?b=e.width:a!=="inner"&&(b=e.width/2,y=n.width/2),this.paddingLeft=Math.max((b-p+o)*this.width/(this.width-p),0),this.paddingRight=Math.max((y-g+o)*this.width/(this.width-g),0)}else{let p=n.height/2,g=e.height/2;a==="start"?(p=0,g=e.height):a==="end"&&(p=n.height,g=0),this.paddingTop=p+o,this.paddingBottom=g+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Pn(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,r;for(n=0,r=e.length;n<r;n++)Mr(e[n].label)&&(e.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=px(r,n)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,r){const{ctx:i,_longestTextCache:a}=this,o=[],c=[],f=Math.floor(n/hx(n,r));let d=0,p=0,g,b,y,N,w,k,C,L,j,z,O;for(g=0;g<n;g+=f){if(N=e[g].label,w=this._resolveTickFontOptions(g),i.font=k=w.string,C=a[k]=a[k]||{data:{},gc:[]},L=w.lineHeight,j=z=0,!Mr(N)&&!Qr(N))j=$5(i,C.data,C.gc,j,N),z=L;else if(Qr(N))for(b=0,y=N.length;b<y;++b)O=N[b],!Mr(O)&&!Qr(O)&&(j=$5(i,C.data,C.gc,j,O),z+=L);o.push(j),c.push(z),d=Math.max(j,d),p=Math.max(z,p)}QD(a,n);const K=o.indexOf(d),q=c.indexOf(p),H=se=>({width:o[se]||0,height:c[se]||0});return{first:H(0),last:H(n-1),widest:H(K),highest:H(q),widths:o,heights:c}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return cE(this._alignToPixels?pu(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const r=n[e];return r.$context||(r.$context=e7(this.getContext(),e,r))}return this.$context||(this.$context=JD(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=Su(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),a=this._getLabelSizes(),o=e.autoSkipPadding||0,c=a?a.widest.width+o:0,f=a?a.highest.height+o:0;return this.isHorizontal()?f*r>c*i?c/r:f/i:f*i<c*r?f/r:c/i}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,r=this.chart,i=this.options,{grid:a,position:o,border:c}=i,f=a.offset,d=this.isHorizontal(),g=this.ticks.length+(f?1:0),b=fh(a),y=[],N=c.setContext(this.getContext()),w=N.display?N.width:0,k=w/2,C=function(X){return pu(r,X,w)};let L,j,z,O,K,q,H,se,le,P,I,ne;if(o==="top")L=C(this.bottom),q=this.bottom-b,se=L-k,P=C(e.top)+k,ne=e.bottom;else if(o==="bottom")L=C(this.top),P=e.top,ne=C(e.bottom)-k,q=L+k,se=this.top+b;else if(o==="left")L=C(this.right),K=this.right-b,H=L-k,le=C(e.left)+k,I=e.right;else if(o==="right")L=C(this.left),le=e.left,I=C(e.right)-k,K=L+k,H=this.left+b;else if(n==="x"){if(o==="center")L=C((e.top+e.bottom)/2+.5);else if(ln(o)){const X=Object.keys(o)[0],J=o[X];L=C(this.chart.scales[X].getPixelForValue(J))}P=e.top,ne=e.bottom,q=L+k,se=q+b}else if(n==="y"){if(o==="center")L=C((e.left+e.right)/2);else if(ln(o)){const X=Object.keys(o)[0],J=o[X];L=C(this.chart.scales[X].getPixelForValue(J))}K=L-k,H=K-b,le=e.left,I=e.right}const te=bn(i.ticks.maxTicksLimit,g),de=Math.max(1,Math.ceil(g/te));for(j=0;j<g;j+=de){const X=this.getContext(j),J=a.setContext(X),G=c.setContext(X),me=J.lineWidth,W=J.color,xe=G.dash||[],R=G.dashOffset,V=J.tickWidth,Q=J.tickColor,ae=J.tickBorderDash||[],ce=J.tickBorderDashOffset;z=KD(this,j,f),z!==void 0&&(O=pu(r,z,me),d?K=H=le=I=O:q=se=P=ne=O,y.push({tx1:K,ty1:q,tx2:H,ty2:se,x1:le,y1:P,x2:I,y2:ne,width:me,color:W,borderDash:xe,borderDashOffset:R,tickWidth:V,tickColor:Q,tickBorderDash:ae,tickBorderDashOffset:ce}))}return this._ticksLength=g,this._borderValue=L,y}_computeLabelItems(e){const n=this.axis,r=this.options,{position:i,ticks:a}=r,o=this.isHorizontal(),c=this.ticks,{align:f,crossAlign:d,padding:p,mirror:g}=a,b=fh(r.grid),y=b+p,N=g?-p:y,w=-Su(this.labelRotation),k=[];let C,L,j,z,O,K,q,H,se,le,P,I,ne="middle";if(i==="top")K=this.bottom-N,q=this._getXAxisLabelAlignment();else if(i==="bottom")K=this.top+N,q=this._getXAxisLabelAlignment();else if(i==="left"){const de=this._getYAxisLabelAlignment(b);q=de.textAlign,O=de.x}else if(i==="right"){const de=this._getYAxisLabelAlignment(b);q=de.textAlign,O=de.x}else if(n==="x"){if(i==="center")K=(e.top+e.bottom)/2+y;else if(ln(i)){const de=Object.keys(i)[0],X=i[de];K=this.chart.scales[de].getPixelForValue(X)+y}q=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")O=(e.left+e.right)/2-y;else if(ln(i)){const de=Object.keys(i)[0],X=i[de];O=this.chart.scales[de].getPixelForValue(X)}q=this._getYAxisLabelAlignment(b).textAlign}n==="y"&&(f==="start"?ne="top":f==="end"&&(ne="bottom"));const te=this._getLabelSizes();for(C=0,L=c.length;C<L;++C){j=c[C],z=j.label;const de=a.setContext(this.getContext(C));H=this.getPixelForTick(C)+a.labelOffset,se=this._resolveTickFontOptions(C),le=se.lineHeight,P=Qr(z)?z.length:1;const X=P/2,J=de.color,G=de.textStrokeColor,me=de.textStrokeWidth;let W=q;o?(O=H,q==="inner"&&(C===L-1?W=this.options.reverse?"left":"right":C===0?W=this.options.reverse?"right":"left":W="center"),i==="top"?d==="near"||w!==0?I=-P*le+le/2:d==="center"?I=-te.highest.height/2-X*le+le:I=-te.highest.height+le/2:d==="near"||w!==0?I=le/2:d==="center"?I=te.highest.height/2-X*le:I=te.highest.height-P*le,g&&(I*=-1),w!==0&&!de.showLabelBackdrop&&(O+=le/2*Math.sin(w))):(K=H,I=(1-P)*le/2);let xe;if(de.showLabelBackdrop){const R=Fa(de.backdropPadding),V=te.heights[C],Q=te.widths[C];let ae=I-R.top,ce=0-R.left;switch(ne){case"middle":ae-=V/2;break;case"bottom":ae-=V;break}switch(q){case"center":ce-=Q/2;break;case"right":ce-=Q;break;case"inner":C===L-1?ce-=Q:C>0&&(ce-=Q/2);break}xe={left:ce,top:ae,width:Q+R.width,height:V+R.height,color:de.backdropColor}}k.push({label:z,font:se,textOffset:I,options:{rotation:w,color:J,strokeColor:G,strokeWidth:me,textAlign:W,textBaseline:ne,translation:[O,K],backdrop:xe}})}return k}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Su(this.labelRotation))return e==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:r,mirror:i,padding:a}}=this.options,o=this._getLabelSizes(),c=e+a,f=o.widest.width;let d,p;return n==="left"?i?(p=this.right+a,r==="near"?d="left":r==="center"?(d="center",p+=f/2):(d="right",p+=f)):(p=this.right-c,r==="near"?d="right":r==="center"?(d="center",p-=f/2):(d="left",p=this.left)):n==="right"?i?(p=this.left+a,r==="near"?d="right":r==="center"?(d="center",p-=f/2):(d="left",p-=f)):(p=this.left+c,r==="near"?d="left":r==="center"?(d="center",p+=f/2):(d="right",p=this.right)):d="right",{textAlign:d,x:p}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:r,top:i,width:a,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(r,i,a,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(a=>a.value===e);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let a,o;const c=(f,d,p)=>{!p.width||!p.color||(r.save(),r.lineWidth=p.width,r.strokeStyle=p.color,r.setLineDash(p.borderDash||[]),r.lineDashOffset=p.borderDashOffset,r.beginPath(),r.moveTo(f.x,f.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(n.display)for(a=0,o=i.length;a<o;++a){const f=i[a];n.drawOnChartArea&&c({x:f.x1,y:f.y1},{x:f.x2,y:f.y2},f),n.drawTicks&&c({x:f.tx1,y:f.ty1},{x:f.tx2,y:f.ty2},{color:f.tickColor,width:f.tickWidth,borderDash:f.tickBorderDash,borderDashOffset:f.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:r,grid:i}}=this,a=r.setContext(this.getContext()),o=r.display?a.width:0;if(!o)return;const c=i.setContext(this.getContext(0)).lineWidth,f=this._borderValue;let d,p,g,b;this.isHorizontal()?(d=pu(e,this.left,o)-o/2,p=pu(e,this.right,c)+c/2,g=b=f):(g=pu(e,this.top,o)-o/2,b=pu(e,this.bottom,c)+c/2,d=p=f),n.save(),n.lineWidth=a.width,n.strokeStyle=a.color,n.beginPath(),n.moveTo(d,g),n.lineTo(p,b),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&yy(r,i);const a=this.getLabelItems(e);for(const o of a){const c=o.options,f=o.font,d=o.label,p=o.textOffset;Qm(r,d,0,p,f,c)}i&&vy(r)}drawTitle(){const{ctx:e,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const a=Ri(r.font),o=Fa(r.padding),c=r.align;let f=a.lineHeight/2;n==="bottom"||n==="center"||ln(n)?(f+=o.bottom,Qr(r.text)&&(f+=a.lineHeight*(r.text.length-1))):f+=o.top;const{titleX:d,titleY:p,maxWidth:g,rotation:b}=n7(this,f,n,c);Qm(e,r.text,0,0,a,{color:r.color,maxWidth:g,rotation:b,textAlign:t7(c,n,i),textBaseline:"middle",translation:[d,p]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,r=bn(e.grid&&e.grid.z,-1),i=bn(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Ng.prototype.draw?[{z:n,draw:a=>{this.draw(a)}}]:[{z:r,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let a,o;for(a=0,o=n.length;a<o;++a){const c=n[a];c[r]===this.id&&(!e||c.type===e)&&i.push(c)}return i}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return Ri(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class om{constructor(e,n,r){this.type=e,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let r;a7(n)&&(r=this.register(n));const i=this.items,a=e.id,o=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+e);return a in i||(i[a]=e,r7(e,o,r),this.override&&yr.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const n=this.items,r=e.id,i=this.scope;r in n&&delete n[r],i&&r in yr[i]&&(delete yr[i][r],this.override&&delete Lu[r])}}function r7(t,e,n){const r=vo(Object.create(null),[n?yr.get(n):{},yr.get(e),t.defaults]);yr.set(e,r),t.defaultRoutes&&i7(e,t.defaultRoutes),t.descriptors&&yr.describe(e,t.descriptors)}function i7(t,e){Object.keys(e).forEach(n=>{const r=n.split("."),i=r.pop(),a=[t].concat(r).join("."),o=e[n].split("."),c=o.pop(),f=o.join(".");yr.route(a,i,f,c)})}function a7(t){return"id"in t&&"defaults"in t}class s7{constructor(){this.controllers=new om(D3,"datasets",!0),this.elements=new om(Bu,"elements"),this.plugins=new om(Object,"plugins"),this.scales=new om(Ng,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,r){[...n].forEach(i=>{const a=r||this._getRegistryForType(i);r||a.isForType(i)||a===this.plugins&&i.id?this._exec(e,a,i):yn(i,o=>{const c=r||this._getRegistryForType(o);this._exec(e,c,o)})})}_exec(e,n,r){const i=py(e);Pn(r["before"+i],[],r),n[e](r),Pn(r["after"+i],[],r)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(e))return r}return this.plugins}_get(e,n,r){const i=n.get(e);if(i===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return i}}var oo=new s7;class o7{constructor(){this._init=[]}notify(e,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const a=i?this._descriptors(e).filter(i):this._descriptors(e),o=this._notify(a,e,n,r);return n==="afterDestroy"&&(this._notify(a,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,n,r,i){i=i||{};for(const a of e){const o=a.plugin,c=o[r],f=[n,i,a.options];if(Pn(c,f,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Mr(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const r=e&&e.config,i=bn(r.options&&r.options.plugins,{}),a=l7(r);return i===!1&&!n?[]:u7(e,a,i,n)}_notifyStateChanges(e){const n=this._oldCache||[],r=this._cache,i=(a,o)=>a.filter(c=>!o.some(f=>c.plugin.id===f.plugin.id));this._notify(i(n,r),e,"stop"),this._notify(i(r,n),e,"start")}}function l7(t){const e={},n=[],r=Object.keys(oo.plugins.items);for(let a=0;a<r.length;a++)n.push(oo.getPlugin(r[a]));const i=t.plugins||[];for(let a=0;a<i.length;a++){const o=i[a];n.indexOf(o)===-1&&(n.push(o),e[o.id]=!0)}return{plugins:n,localIds:e}}function c7(t,e){return!e&&t===!1?null:t===!0?{}:t}function u7(t,{plugins:e,localIds:n},r,i){const a=[],o=t.getContext();for(const c of e){const f=c.id,d=c7(r[f],i);d!==null&&a.push({plugin:c,options:f7(t.config,{plugin:c,local:n[f]},d,o)})}return a}function f7(t,{plugin:e,local:n},r,i){const a=t.pluginScopeKeys(e),o=t.getOptionScopes(r,a);return n&&e.defaults&&o.push(e.defaults),t.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function h2(t,e){const n=yr.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function d7(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function h7(t,e){return t===e?"_index_":"_value_"}function gx(t){if(t==="x"||t==="y"||t==="r")return t}function p7(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function p2(t,...e){if(gx(t))return t;for(const n of e){const r=n.axis||p7(n.position)||t.length>1&&gx(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function yx(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function m7(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(n.length)return yx(t,"x",n[0])||yx(t,"y",n[0])}return{}}function g7(t,e){const n=Lu[t.type]||{scales:{}},r=e.scales||{},i=h2(t.type,e),a=Object.create(null);return Object.keys(r).forEach(o=>{const c=r[o];if(!ln(c))return console.error(`Invalid scale configuration for scale: ${o}`);if(c._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const f=p2(o,c,m7(o,t),yr.scales[c.type]),d=h7(f,i),p=n.scales||{};a[o]=wh(Object.create(null),[{axis:f},c,p[f],p[d]])}),t.data.datasets.forEach(o=>{const c=o.type||t.type,f=o.indexAxis||h2(c,e),p=(Lu[c]||{}).scales||{};Object.keys(p).forEach(g=>{const b=d7(g,f),y=o[b+"AxisID"]||b;a[y]=a[y]||Object.create(null),wh(a[y],[{axis:b},r[y],p[g]])})}),Object.keys(a).forEach(o=>{const c=a[o];wh(c,[yr.scales[c.type],yr.scale])}),a}function B3(t){const e=t.options||(t.options={});e.plugins=bn(e.plugins,{}),e.scales=g7(t,e)}function F3(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function y7(t){return t=t||{},t.data=F3(t.data),B3(t),t}const vx=new Map,I3=new Set;function lm(t,e){let n=vx.get(t);return n||(n=e(),vx.set(t,n),I3.add(n)),n}const dh=(t,e,n)=>{const r=Ph(e,n);r!==void 0&&t.add(r)};class v7{constructor(e){this._config=y7(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=F3(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),B3(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return lm(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return lm(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return lm(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,r=this.type;return lm(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const r=this._scopeCache;let i=r.get(e);return(!i||n)&&(i=new Map,r.set(e,i)),i}getOptionScopes(e,n,r){const{options:i,type:a}=this,o=this._cachedScopes(e,r),c=o.get(n);if(c)return c;const f=new Set;n.forEach(p=>{e&&(f.add(e),p.forEach(g=>dh(f,e,g))),p.forEach(g=>dh(f,i,g)),p.forEach(g=>dh(f,Lu[a]||{},g)),p.forEach(g=>dh(f,yr,g)),p.forEach(g=>dh(f,f2,g))});const d=Array.from(f);return d.length===0&&d.push(Object.create(null)),I3.has(n)&&o.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,Lu[n]||{},yr.datasets[n]||{},{type:n},yr,f2]}resolveNamedOptions(e,n,r,i=[""]){const a={$shared:!0},{resolver:o,subPrefixes:c}=bx(this._resolverCache,e,i);let f=o;if(x7(o,n)){a.$shared=!1,r=wc(r)?r():r;const d=this.createResolver(e,r,c);f=Xf(o,r,d)}for(const d of n)a[d]=f[d];return a}createResolver(e,n,r=[""],i){const{resolver:a}=bx(this._resolverCache,e,r);return ln(n)?Xf(a,n,void 0,i):a}}function bx(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const i=n.join();let a=r.get(i);return a||(a={resolver:xy(e,n),subPrefixes:n.filter(c=>!c.toLowerCase().includes("hover"))},r.set(i,a)),a}const b7=t=>ln(t)&&Object.getOwnPropertyNames(t).some(e=>wc(t[e]));function x7(t,e){const{isScriptable:n,isIndexable:r}=_3(t);for(const i of e){const a=n(i),o=r(i),c=(o||a)&&t[i];if(a&&(wc(c)||b7(c))||o&&Qr(c))return!0}return!1}var w7="4.5.0";const S7=["top","bottom","left","right","chartArea"];function xx(t,e){return t==="top"||t==="bottom"||S7.indexOf(t)===-1&&e==="x"}function wx(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function Sx(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Pn(n&&n.onComplete,[t],e)}function _7(t){const e=t.chart,n=e.options.animation;Pn(n&&n.onProgress,[t],e)}function z3(t){return _y()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Tm={},_x=t=>{const e=z3(t);return Object.values(Tm).filter(n=>n.canvas===e).pop()};function N7(t,e,n){const r=Object.keys(t);for(const i of r){const a=+i;if(a>=e){const o=t[i];delete t[i],(n>0||a>e)&&(t[a+n]=o)}}}function A7(t,e,n,r){return!n||t.type==="mouseout"?null:r?e:t}let Ag=class{static defaults=yr;static instances=Tm;static overrides=Lu;static registry=oo;static version=w7;static getChart=_x;static register(...e){oo.add(...e),Nx()}static unregister(...e){oo.remove(...e),Nx()}constructor(e,n){const r=this.config=new v7(n),i=z3(e),a=_x(i);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||qD(i)),this.platform.updateConfig(r);const c=this.platform.acquireContext(i,o.aspectRatio),f=c&&c.canvas,d=f&&f.height,p=f&&f.width;if(this.id=KL(),this.ctx=c,this.canvas=f,this.width=p,this.height=d,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new o7,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=pE(g=>this.update(g),o.resizeDelay||0),this._dataChanges=[],Tm[this.id]=this,!c||!f){console.error("Failed to create chart: can't acquire context from the given item");return}al.listen(this,"complete",Sx),al.listen(this,"progress",_7),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:r,height:i,_aspectRatio:a}=this;return Mr(e)?n&&a?a:i?r/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return oo}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Q5(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return X5(this.canvas,this.ctx),this}stop(){return al.stop(this),this}resize(e,n){al.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const r=this.options,i=this.canvas,a=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,e,n,a),c=r.devicePixelRatio||this.platform.getDevicePixelRatio(),f=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Q5(this,c,!0)&&(this.notifyPlugins("resize",{size:o}),Pn(r.onResize,[this,o],this),this.attached&&this._doResize(f)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};yn(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const e=this.options,n=e.scales,r=this.scales,i=Object.keys(r).reduce((o,c)=>(o[c]=!1,o),{});let a=[];n&&(a=a.concat(Object.keys(n).map(o=>{const c=n[o],f=p2(o,c),d=f==="r",p=f==="x";return{options:c,dposition:d?"chartArea":p?"bottom":"left",dtype:d?"radialLinear":p?"category":"linear"}}))),yn(a,o=>{const c=o.options,f=c.id,d=p2(f,c),p=bn(c.type,o.dtype);(c.position===void 0||xx(c.position,d)!==xx(o.dposition))&&(c.position=o.dposition),i[f]=!0;let g=null;if(f in r&&r[f].type===p)g=r[f];else{const b=oo.getScale(p);g=new b({id:f,type:p,ctx:this.ctx,chart:this}),r[g.id]=g}g.init(c,e)}),yn(i,(o,c)=>{o||delete r[c]}),yn(r,o=>{yc.configure(this,o,o.options),yc.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,r=e.length;if(e.sort((i,a)=>i.index-a.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);e.splice(n,r-n)}this._sortedMetasets=e.slice(0).sort(wx("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((r,i)=>{n.filter(a=>a===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const a=n[r];let o=this.getDatasetMeta(r);const c=a.type||this.config.type;if(o.type&&o.type!==c&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=c,o.indexAxis=a.indexAxis||h2(c,this.options),o.order=a.order||0,o.index=r,o.label=""+a.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const f=oo.getController(c),{datasetElementType:d,dataElementType:p}=yr.datasets[c];Object.assign(f,{dataElementType:oo.getElement(p),datasetElementType:d&&oo.getElement(d)}),o.controller=new f(this,r),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){yn(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let d=0,p=this.data.datasets.length;d<p;d++){const{controller:g}=this.getDatasetMeta(d),b=!i&&a.indexOf(g)===-1;g.buildOrUpdateElements(b),o=Math.max(+g.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||yn(a,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(wx("z","_idx"));const{_active:c,_lastEvent:f}=this;f?this._eventHandler(f,!0):c.length&&this._updateHoverStyles(c,c,!0),this.render()}_updateScales(){yn(this.scales,e=>{yc.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!z5(n,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:a}of n){const o=r==="_removeElements"?-a:a;N7(e,i,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=a=>new Set(e.filter(o=>o[0]===a).map((o,c)=>c+","+o.splice(1).join(","))),i=r(0);for(let a=1;a<n;a++)if(!z5(i,r(a)))return;return Array.from(i).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;yc.update(this,this.width,this.height,e);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],yn(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,a)=>{i._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,wc(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const r=this.getDatasetMeta(e),i={meta:r,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(al.has(this)?this.attached&&!al.running(this)&&al.start(this):(this.draw(),Sx({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,r=[];let i,a;for(i=0,a=n.length;i<a;++i){const o=n[i];(!e||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,r={meta:e,index:e.index,cancelable:!0},i=eD(this,e);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&yy(n,i),e.controller.draw(),i&&vy(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return gy(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,r,i){const a=SD.modes[n];return typeof a=="function"?a(this,e,r,i):[]}getDatasetMeta(e){const n=this.data.datasets[e],r=this._metasets;let i=r.filter(a=>a&&a._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=ad(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(e,n){const r=this.getDatasetMeta(e);r.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,r){const i=r?"show":"hide",a=this.getDatasetMeta(e),o=a.controller._resolveAnimations(void 0,i);$m(n)?(a.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),o.update(a,{visible:r}),this.update(c=>c.datasetIndex===e?i:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),al.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),X5(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Tm[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,r=(a,o)=>{n.addEventListener(this,a,o),e[a]=o},i=(a,o,c)=>{a.offsetX=o,a.offsetY=c,this._eventHandler(a)};yn(this.options.events,a=>r(a,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,r=(f,d)=>{n.addEventListener(this,f,d),e[f]=d},i=(f,d)=>{e[f]&&(n.removeEventListener(this,f,d),delete e[f])},a=(f,d)=>{this.canvas&&this.resize(f,d)};let o;const c=()=>{i("attach",c),this.attached=!0,this.resize(),r("resize",a),r("detach",o)};o=()=>{this.attached=!1,i("resize",a),this._stop(),this._resize(0,0),r("attach",c)},n.isAttached(this.canvas)?c():o()}unbindEvents(){yn(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},yn(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,r){const i=r?"set":"remove";let a,o,c,f;for(n==="dataset"&&(a=this.getDatasetMeta(e[0].datasetIndex),a.controller["_"+i+"DatasetHoverStyle"]()),c=0,f=e.length;c<f;++c){o=e[c];const d=o&&this.getDatasetMeta(o.datasetIndex).controller;d&&d[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],r=e.map(({datasetIndex:a,index:o})=>{const c=this.getDatasetMeta(a);if(!c)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:c.data[o],index:o}});!Vm(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(e,n,r){return this._plugins.notify(this,e,n,r)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,r){const i=this.options.hover,a=(f,d)=>f.filter(p=>!d.some(g=>p.datasetIndex===g.datasetIndex&&p.index===g.index)),o=a(n,e),c=r?e:a(e,n);o.length&&this.updateHoverStyle(o,i.mode,!1),c.length&&i.mode&&this.updateHoverStyle(c,i.mode,!0)}_eventHandler(e,n){const r={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},i=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const a=this._handleEvent(e,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(a||r.changed)&&this.render(),this}_handleEvent(e,n,r){const{_active:i=[],options:a}=this,o=n,c=this._getActiveElements(e,i,r,o),f=rE(e),d=A7(e,this._lastEvent,r,f);r&&(this._lastEvent=null,Pn(a.onHover,[e,c,this],this),f&&Pn(a.onClick,[e,c,this],this));const p=!Vm(c,i);return(p||n)&&(this._active=c,this._updateHoverStyles(c,i,n)),this._lastEvent=d,p}_getActiveElements(e,n,r,i){if(e.type==="mouseout")return[];if(!r)return n;const a=this.options.hover;return this.getElementsAtEventForMode(e,a.mode,a,i)}};function Nx(){return yn(Ag.instances,t=>t._plugins.invalidate())}function C7(t,e,n){const{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:c,options:f}=e,{borderWidth:d,borderJoinStyle:p}=f,g=Math.min(d/o,co(r-n));if(t.beginPath(),t.arc(i,a,o-d/2,r+g/2,n-g/2),c>0){const b=Math.min(d/c,co(r-n));t.arc(i,a,c+d/2,n-b/2,r+b/2,!0)}else{const b=Math.min(d/2,o*co(r-n));if(p==="round")t.arc(i,a,b,n-qn/2,r+qn/2,!0);else if(p==="bevel"){const y=2*b*b,N=-y*Math.cos(n+qn/2)+i,w=-y*Math.sin(n+qn/2)+a,k=y*Math.cos(r+qn/2)+i,C=y*Math.sin(r+qn/2)+a;t.lineTo(N,w),t.lineTo(k,C)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function k7(t,e,n){const{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:c,innerRadius:f}=e;let d=i/c;t.beginPath(),t.arc(a,o,c,r-d,n+d),f>i?(d=i/f,t.arc(a,o,f,n+d,r-d,!0)):t.arc(a,o,i,n+Ur,r-Ur),t.closePath(),t.clip()}function M7(t){return by(t,["outerStart","outerEnd","innerStart","innerEnd"])}function L7(t,e,n,r){const i=M7(t.options.borderRadius),a=(n-e)/2,o=Math.min(a,r*e/2),c=f=>{const d=(n-Math.min(a,f))*r/2;return va(f,0,Math.min(a,d))};return{outerStart:c(i.outerStart),outerEnd:c(i.outerEnd),innerStart:va(i.innerStart,0,o),innerEnd:va(i.innerEnd,0,o)}}function Lf(t,e,n,r){return{x:n+t*Math.cos(e),y:r+t*Math.sin(e)}}function ng(t,e,n,r,i,a){const{x:o,y:c,startAngle:f,pixelMargin:d,innerRadius:p}=e,g=Math.max(e.outerRadius+r+n-d,0),b=p>0?p+r+n+d:0;let y=0;const N=i-f;if(r){const de=p>0?p-r:0,X=g>0?g-r:0,J=(de+X)/2,G=J!==0?N*J/(J+r):N;y=(N-G)/2}const w=Math.max(.001,N*g-n/qn)/g,k=(N-w)/2,C=f+k+y,L=i-k-y,{outerStart:j,outerEnd:z,innerStart:O,innerEnd:K}=L7(e,b,g,L-C),q=g-j,H=g-z,se=C+j/q,le=L-z/H,P=b+O,I=b+K,ne=C+O/P,te=L-K/I;if(t.beginPath(),a){const de=(se+le)/2;if(t.arc(o,c,g,se,de),t.arc(o,c,g,de,le),z>0){const me=Lf(H,le,o,c);t.arc(me.x,me.y,z,le,L+Ur)}const X=Lf(I,L,o,c);if(t.lineTo(X.x,X.y),K>0){const me=Lf(I,te,o,c);t.arc(me.x,me.y,K,L+Ur,te+Math.PI)}const J=(L-K/b+(C+O/b))/2;if(t.arc(o,c,b,L-K/b,J,!0),t.arc(o,c,b,J,C+O/b,!0),O>0){const me=Lf(P,ne,o,c);t.arc(me.x,me.y,O,ne+Math.PI,C-Ur)}const G=Lf(q,C,o,c);if(t.lineTo(G.x,G.y),j>0){const me=Lf(q,se,o,c);t.arc(me.x,me.y,j,C-Ur,se)}}else{t.moveTo(o,c);const de=Math.cos(se)*g+o,X=Math.sin(se)*g+c;t.lineTo(de,X);const J=Math.cos(le)*g+o,G=Math.sin(le)*g+c;t.lineTo(J,G)}t.closePath()}function E7(t,e,n,r,i){const{fullCircles:a,startAngle:o,circumference:c}=e;let f=e.endAngle;if(a){ng(t,e,n,r,f,i);for(let d=0;d<a;++d)t.fill();isNaN(c)||(f=o+(c%Br||Br))}return ng(t,e,n,r,f,i),t.fill(),f}function D7(t,e,n,r,i){const{fullCircles:a,startAngle:o,circumference:c,options:f}=e,{borderWidth:d,borderJoinStyle:p,borderDash:g,borderDashOffset:b,borderRadius:y}=f,N=f.borderAlign==="inner";if(!d)return;t.setLineDash(g||[]),t.lineDashOffset=b,N?(t.lineWidth=d*2,t.lineJoin=p||"round"):(t.lineWidth=d,t.lineJoin=p||"bevel");let w=e.endAngle;if(a){ng(t,e,n,r,w,i);for(let k=0;k<a;++k)t.stroke();isNaN(c)||(w=o+(c%Br||Br))}N&&k7(t,e,w),f.selfJoin&&w-o>=qn&&y===0&&p!=="miter"&&C7(t,e,w),a||(ng(t,e,n,r,w,i),t.stroke())}class H3 extends Bu{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,n,r){const i=this.getProps(["x","y"],r),{angle:a,distance:o}=m3(i,{x:e,y:n}),{startAngle:c,endAngle:f,innerRadius:d,outerRadius:p,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),b=(this.options.spacing+this.options.borderWidth)/2,y=bn(g,f-c),N=Km(a,c,f)&&c!==f,w=y>=Br||N,k=_u(o,d+b,p+b);return w&&k}getCenterPoint(e){const{x:n,y:r,startAngle:i,endAngle:a,innerRadius:o,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:f,spacing:d}=this.options,p=(i+a)/2,g=(o+c+d+f)/2;return{x:n+Math.cos(p)*g,y:r+Math.sin(p)*g}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:r}=this,i=(n.offset||0)/4,a=(n.spacing||0)/2,o=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=r>Br?Math.floor(r/Br):0,r===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const c=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(c)*i,Math.sin(c)*i);const f=1-Math.sin(Math.min(qn,r||0)),d=i*f;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,E7(e,this,d,a,o),D7(e,this,d,a,o),e.restore()}}function Ax(t,e,n,r){const i=t.options,{[n]:a}=t.getProps([n],r);return Math.abs(e-a)<i.radius+i.hitRadius}class j7 extends Bu{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,n,r){const i=this.options,{x:a,y:o}=this.getProps(["x","y"],r);return Math.pow(e-a,2)+Math.pow(n-o,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(e,n){return Ax(this,e,"x",n)}inYRange(e,n){return Ax(this,e,"y",n)}getCenterPoint(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}size(e){e=e||this.options||{};let n=e.radius||0;n=Math.max(n,n&&e.hoverRadius||0);const r=n&&e.borderWidth||0;return(n+r)*2}draw(e,n){const r=this.options;this.skip||r.radius<.1||!gy(this,n,this.size(r)/2)||(e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.fillStyle=r.backgroundColor,d2(e,r,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}function U3(t,e){const{x:n,y:r,base:i,width:a,height:o}=t.getProps(["x","y","base","width","height"],e);let c,f,d,p,g;return t.horizontal?(g=o/2,c=Math.min(n,i),f=Math.max(n,i),d=r-g,p=r+g):(g=a/2,c=n-g,f=n+g,d=Math.min(r,i),p=Math.max(r,i)),{left:c,top:d,right:f,bottom:p}}function vc(t,e,n,r){return t?0:va(e,n,r)}function O7(t,e,n){const r=t.options.borderWidth,i=t.borderSkipped,a=S3(r);return{t:vc(i.top,a.top,0,n),r:vc(i.right,a.right,0,e),b:vc(i.bottom,a.bottom,0,n),l:vc(i.left,a.left,0,e)}}function T7(t,e,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),i=t.options.borderRadius,a=Ff(i),o=Math.min(e,n),c=t.borderSkipped,f=r||ln(i);return{topLeft:vc(!f||c.top||c.left,a.topLeft,0,o),topRight:vc(!f||c.top||c.right,a.topRight,0,o),bottomLeft:vc(!f||c.bottom||c.left,a.bottomLeft,0,o),bottomRight:vc(!f||c.bottom||c.right,a.bottomRight,0,o)}}function R7(t){const e=U3(t),n=e.right-e.left,r=e.bottom-e.top,i=O7(t,n/2,r/2),a=T7(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:a},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function x1(t,e,n,r){const i=e===null,a=n===null,c=t&&!(i&&a)&&U3(t,r);return c&&(i||_u(e,c.left,c.right))&&(a||_u(n,c.top,c.bottom))}function P7(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function B7(t,e){t.rect(e.x,e.y,e.w,e.h)}function w1(t,e,n={}){const r=t.x!==n.x?-e:0,i=t.y!==n.y?-e:0,a=(t.x+t.w!==n.x+n.w?e:0)-r,o=(t.y+t.h!==n.y+n.h?e:0)-i;return{x:t.x+r,y:t.y+i,w:t.w+a,h:t.h+o,radius:t.radius}}class F7 extends Bu{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:a,outer:o}=R7(this),c=P7(o.radius)?Jm:B7;e.save(),(o.w!==a.w||o.h!==a.h)&&(e.beginPath(),c(e,w1(o,n,a)),e.clip(),c(e,w1(a,-n,o)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),c(e,w1(a,n)),e.fillStyle=i,e.fill(),e.restore()}inRange(e,n,r){return x1(this,e,n,r)}inXRange(e,n){return x1(this,e,null,n)}inYRange(e,n){return x1(this,null,e,n)}getCenterPoint(e){const{x:n,y:r,base:i,horizontal:a}=this.getProps(["x","y","base","horizontal"],e);return{x:a?(n+i)/2:n,y:a?r:(r+i)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}const Cx=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},I7=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class kx extends Bu{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,r){this.maxWidth=e,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=Pn(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(r=>e.filter(r,this.chart.data))),e.sort&&(n=n.sort((r,i)=>e.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const r=e.labels,i=Ri(r.font),a=i.size,o=this._computeTitleHeight(),{boxWidth:c,itemHeight:f}=Cx(r,a);let d,p;n.font=i.string,this.isHorizontal()?(d=this.maxWidth,p=this._fitRows(o,a,c,f)+10):(p=this.maxHeight,d=this._fitCols(o,i,c,f)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(p,e.maxHeight||this.maxHeight)}_fitRows(e,n,r,i){const{ctx:a,maxWidth:o,options:{labels:{padding:c}}}=this,f=this.legendHitBoxes=[],d=this.lineWidths=[0],p=i+c;let g=e;a.textAlign="left",a.textBaseline="middle";let b=-1,y=-p;return this.legendItems.forEach((N,w)=>{const k=r+n/2+a.measureText(N.text).width;(w===0||d[d.length-1]+k+2*c>o)&&(g+=p,d[d.length-(w>0?0:1)]=0,y+=p,b++),f[w]={left:0,top:y,row:b,width:k,height:i},d[d.length-1]+=k+c}),g}_fitCols(e,n,r,i){const{ctx:a,maxHeight:o,options:{labels:{padding:c}}}=this,f=this.legendHitBoxes=[],d=this.columnSizes=[],p=o-e;let g=c,b=0,y=0,N=0,w=0;return this.legendItems.forEach((k,C)=>{const{itemWidth:L,itemHeight:j}=z7(r,n,a,k,i);C>0&&y+j+2*c>p&&(g+=b+c,d.push({width:b,height:y}),N+=b+c,w++,b=y=0),f[C]={left:N,top:y,col:w,width:L,height:j},b=Math.max(b,L),y+=j+c}),g+=b,d.push({width:b,height:y}),g}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:a}}=this,o=If(a,this.left,this.width);if(this.isHorizontal()){let c=0,f=pa(r,this.left+i,this.right-this.lineWidths[c]);for(const d of n)c!==d.row&&(c=d.row,f=pa(r,this.left+i,this.right-this.lineWidths[c])),d.top+=this.top+e+i,d.left=o.leftForLtr(o.x(f),d.width),f+=d.width+i}else{let c=0,f=pa(r,this.top+e+i,this.bottom-this.columnSizes[c].height);for(const d of n)d.col!==c&&(c=d.col,f=pa(r,this.top+e+i,this.bottom-this.columnSizes[c].height)),d.top=f,d.left+=this.left+i,d.left=o.leftForLtr(o.x(d.left),d.width),f+=d.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;yy(e,this),this._draw(),vy(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:r,ctx:i}=this,{align:a,labels:o}=e,c=yr.color,f=If(e.rtl,this.left,this.width),d=Ri(o.font),{padding:p}=o,g=d.size,b=g/2;let y;this.drawTitle(),i.textAlign=f.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=d.string;const{boxWidth:N,boxHeight:w,itemHeight:k}=Cx(o,g),C=function(K,q,H){if(isNaN(N)||N<=0||isNaN(w)||w<0)return;i.save();const se=bn(H.lineWidth,1);if(i.fillStyle=bn(H.fillStyle,c),i.lineCap=bn(H.lineCap,"butt"),i.lineDashOffset=bn(H.lineDashOffset,0),i.lineJoin=bn(H.lineJoin,"miter"),i.lineWidth=se,i.strokeStyle=bn(H.strokeStyle,c),i.setLineDash(bn(H.lineDash,[])),o.usePointStyle){const le={radius:w*Math.SQRT2/2,pointStyle:H.pointStyle,rotation:H.rotation,borderWidth:se},P=f.xPlus(K,N/2),I=q+b;w3(i,le,P,I,o.pointStyleWidth&&N)}else{const le=q+Math.max((g-w)/2,0),P=f.leftForLtr(K,N),I=Ff(H.borderRadius);i.beginPath(),Object.values(I).some(ne=>ne!==0)?Jm(i,{x:P,y:le,w:N,h:w,radius:I}):i.rect(P,le,N,w),i.fill(),se!==0&&i.stroke()}i.restore()},L=function(K,q,H){Qm(i,H.text,K,q+k/2,d,{strikethrough:H.hidden,textAlign:f.textAlign(H.textAlign)})},j=this.isHorizontal(),z=this._computeTitleHeight();j?y={x:pa(a,this.left+p,this.right-r[0]),y:this.top+p+z,line:0}:y={x:this.left+p,y:pa(a,this.top+z+p,this.bottom-n[0].height),line:0},k3(this.ctx,e.textDirection);const O=k+p;this.legendItems.forEach((K,q)=>{i.strokeStyle=K.fontColor,i.fillStyle=K.fontColor;const H=i.measureText(K.text).width,se=f.textAlign(K.textAlign||(K.textAlign=o.textAlign)),le=N+b+H;let P=y.x,I=y.y;f.setWidth(this.width),j?q>0&&P+le+p>this.right&&(I=y.y+=O,y.line++,P=y.x=pa(a,this.left+p,this.right-r[y.line])):q>0&&I+O>this.bottom&&(P=y.x=P+n[y.line].width+p,y.line++,I=y.y=pa(a,this.top+z+p,this.bottom-n[y.line].height));const ne=f.x(P);if(C(ne,I,K),P=mE(se,P+N+b,j?P+le:this.right,e.rtl),L(f.x(P),I,K),j)y.x+=le+p;else if(typeof K.text!="string"){const te=d.lineHeight;y.y+=q3(K,te)+p}else y.y+=O}),M3(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,r=Ri(n.font),i=Fa(n.padding);if(!n.display)return;const a=If(e.rtl,this.left,this.width),o=this.ctx,c=n.position,f=r.size/2,d=i.top+f;let p,g=this.left,b=this.width;if(this.isHorizontal())b=Math.max(...this.lineWidths),p=this.top+d,g=pa(e.align,g,this.right-b);else{const N=this.columnSizes.reduce((w,k)=>Math.max(w,k.height),0);p=d+pa(e.align,this.top,this.bottom-N-e.labels.padding-this._computeTitleHeight())}const y=pa(c,g,g+b);o.textAlign=a.textAlign(b3(c)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Qm(o,n.text,y,p,r)}_computeTitleHeight(){const e=this.options.title,n=Ri(e.font),r=Fa(e.padding);return e.display?n.lineHeight+r.height:0}_getLegendItemAt(e,n){let r,i,a;if(_u(e,this.left,this.right)&&_u(n,this.top,this.bottom)){for(a=this.legendHitBoxes,r=0;r<a.length;++r)if(i=a[r],_u(e,i.left,i.left+i.width)&&_u(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(e){const n=this.options;if(!q7(e.type,n))return;const r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const i=this._hoveredItem,a=I7(i,r);i&&!a&&Pn(n.onLeave,[e,i,this],this),this._hoveredItem=r,r&&!a&&Pn(n.onHover,[e,r,this],this)}else r&&Pn(n.onClick,[e,r,this],this)}}function z7(t,e,n,r,i){const a=H7(r,t,e,n),o=U7(i,r,e.lineHeight);return{itemWidth:a,itemHeight:o}}function H7(t,e,n,r){let i=t.text;return i&&typeof i!="string"&&(i=i.reduce((a,o)=>a.length>o.length?a:o)),e+n.size/2+r.measureText(i).width}function U7(t,e,n){let r=t;return typeof e.text!="string"&&(r=q3(e,n)),r}function q3(t,e){const n=t.text?t.text.length:0;return e*n}function q7(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var W7={id:"legend",_element:kx,start(t,e,n){const r=t.legend=new kx({ctx:t.ctx,options:n,chart:t});yc.configure(t,r,n),yc.addBox(t,r)},stop(t){yc.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;yc.configure(t,r,n),r.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const r=e.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),e.hidden=!0):(i.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:c}}=t.legend.options;return t._getSortedDatasetMetas().map(f=>{const d=f.controller.getStyle(n?0:void 0),p=Fa(d.borderWidth);return{text:e[f.index].label,fillStyle:d.backgroundColor,fontColor:a,hidden:!f.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(p.width+p.height)/4,strokeStyle:d.borderColor,pointStyle:r||d.pointStyle,rotation:d.rotation,textAlign:i||d.textAlign,borderRadius:o&&(c||d.borderRadius),datasetIndex:f.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};const vh={average(t){if(!t.length)return!1;let e,n,r=new Set,i=0,a=0;for(e=0,n=t.length;e<n;++e){const c=t[e].element;if(c&&c.hasValue()){const f=c.tooltipPosition();r.add(f.x),i+=f.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((c,f)=>c+f)/r.size,y:i/a}},nearest(t,e){if(!t.length)return!1;let n=e.x,r=e.y,i=Number.POSITIVE_INFINITY,a,o,c;for(a=0,o=t.length;a<o;++a){const f=t[a].element;if(f&&f.hasValue()){const d=f.getCenterPoint(),p=lE(e,d);p<i&&(i=p,c=f)}}if(c){const f=c.tooltipPosition();n=f.x,r=f.y}return{x:n,y:r}}};function io(t,e){return e&&(Qr(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function sl(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
`)>-1?t.split(`
`):t}function Y7(t,e){const{element:n,datasetIndex:r,index:i}=e,a=t.getDatasetMeta(r).controller,{label:o,value:c}=a.getLabelAndValue(i);return{chart:t,label:o,parsed:a.getParsed(i),raw:t.data.datasets[r].data[i],formattedValue:c,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Mx(t,e){const n=t.chart.ctx,{body:r,footer:i,title:a}=t,{boxWidth:o,boxHeight:c}=e,f=Ri(e.bodyFont),d=Ri(e.titleFont),p=Ri(e.footerFont),g=a.length,b=i.length,y=r.length,N=Fa(e.padding);let w=N.height,k=0,C=r.reduce((z,O)=>z+O.before.length+O.lines.length+O.after.length,0);if(C+=t.beforeBody.length+t.afterBody.length,g&&(w+=g*d.lineHeight+(g-1)*e.titleSpacing+e.titleMarginBottom),C){const z=e.displayColors?Math.max(c,f.lineHeight):f.lineHeight;w+=y*z+(C-y)*f.lineHeight+(C-1)*e.bodySpacing}b&&(w+=e.footerMarginTop+b*p.lineHeight+(b-1)*e.footerSpacing);let L=0;const j=function(z){k=Math.max(k,n.measureText(z).width+L)};return n.save(),n.font=d.string,yn(t.title,j),n.font=f.string,yn(t.beforeBody.concat(t.afterBody),j),L=e.displayColors?o+2+e.boxPadding:0,yn(r,z=>{yn(z.before,j),yn(z.lines,j),yn(z.after,j)}),L=0,n.font=p.string,yn(t.footer,j),n.restore(),k+=N.width,{width:k,height:w}}function V7(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function G7(t,e,n,r){const{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(t==="left"&&i+a+o>e.width||t==="right"&&i-a-o<0)return!0}function $7(t,e,n,r){const{x:i,width:a}=n,{width:o,chartArea:{left:c,right:f}}=t;let d="center";return r==="center"?d=i<=(c+f)/2?"left":"right":i<=a/2?d="left":i>=o-a/2&&(d="right"),G7(d,t,e,n)&&(d="center"),d}function Lx(t,e,n){const r=n.yAlign||e.yAlign||V7(t,n);return{xAlign:n.xAlign||e.xAlign||$7(t,e,n,r),yAlign:r}}function X7(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function Z7(t,e,n){let{y:r,height:i}=t;return e==="top"?r+=n:e==="bottom"?r-=i+n:r-=i/2,r}function Ex(t,e,n,r){const{caretSize:i,caretPadding:a,cornerRadius:o}=t,{xAlign:c,yAlign:f}=n,d=i+a,{topLeft:p,topRight:g,bottomLeft:b,bottomRight:y}=Ff(o);let N=X7(e,c);const w=Z7(e,f,d);return f==="center"?c==="left"?N+=d:c==="right"&&(N-=d):c==="left"?N-=Math.max(p,b)+i:c==="right"&&(N+=Math.max(g,y)+i),{x:va(N,0,r.width-e.width),y:va(w,0,r.height-e.height)}}function cm(t,e,n){const r=Fa(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function Dx(t){return io([],sl(t))}function K7(t,e,n){return ad(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function jx(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const W3={beforeTitle:rl,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:rl,beforeBody:rl,beforeLabel:rl,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Mr(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:rl,afterBody:rl,beforeFooter:rl,footer:rl,afterFooter:rl};function Gi(t,e,n,r){const i=t[e].call(n,r);return typeof i>"u"?W3[e].call(n,r):i}class Ox extends Bu{static positioners=vh;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,a=new L3(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=K7(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,i=Gi(r,"beforeTitle",this,e),a=Gi(r,"title",this,e),o=Gi(r,"afterTitle",this,e);let c=[];return c=io(c,sl(i)),c=io(c,sl(a)),c=io(c,sl(o)),c}getBeforeBody(e,n){return Dx(Gi(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,i=[];return yn(e,a=>{const o={before:[],lines:[],after:[]},c=jx(r,a);io(o.before,sl(Gi(c,"beforeLabel",this,a))),io(o.lines,Gi(c,"label",this,a)),io(o.after,sl(Gi(c,"afterLabel",this,a))),i.push(o)}),i}getAfterBody(e,n){return Dx(Gi(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,i=Gi(r,"beforeFooter",this,e),a=Gi(r,"footer",this,e),o=Gi(r,"afterFooter",this,e);let c=[];return c=io(c,sl(i)),c=io(c,sl(a)),c=io(c,sl(o)),c}_createItems(e){const n=this._active,r=this.chart.data,i=[],a=[],o=[];let c=[],f,d;for(f=0,d=n.length;f<d;++f)c.push(Y7(this.chart,n[f]));return e.filter&&(c=c.filter((p,g,b)=>e.filter(p,g,b,r))),e.itemSort&&(c=c.sort((p,g)=>e.itemSort(p,g,r))),yn(c,p=>{const g=jx(e.callbacks,p);i.push(Gi(g,"labelColor",this,p)),a.push(Gi(g,"labelPointStyle",this,p)),o.push(Gi(g,"labelTextColor",this,p))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=o,this.dataPoints=c,c}update(e,n){const r=this.options.setContext(this.getContext()),i=this._active;let a,o=[];if(!i.length)this.opacity!==0&&(a={opacity:0});else{const c=vh[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const f=this._size=Mx(this,r),d=Object.assign({},c,f),p=Lx(this.chart,r,d),g=Ex(r,d,p,this.chart);this.xAlign=p.xAlign,this.yAlign=p.yAlign,a={opacity:1,x:g.x,y:g.y,width:f.width,height:f.height,caretX:c.x,caretY:c.y}}this._tooltipItems=o,this.$context=void 0,a&&this._resolveAnimations().update(this,a),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,i){const a=this.getCaretPosition(e,r,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)}getCaretPosition(e,n,r){const{xAlign:i,yAlign:a}=this,{caretSize:o,cornerRadius:c}=r,{topLeft:f,topRight:d,bottomLeft:p,bottomRight:g}=Ff(c),{x:b,y}=e,{width:N,height:w}=n;let k,C,L,j,z,O;return a==="center"?(z=y+w/2,i==="left"?(k=b,C=k-o,j=z+o,O=z-o):(k=b+N,C=k+o,j=z-o,O=z+o),L=k):(i==="left"?C=b+Math.max(f,p)+o:i==="right"?C=b+N-Math.max(d,g)-o:C=this.caretX,a==="top"?(j=y,z=j-o,k=C-o,L=C+o):(j=y+w,z=j+o,k=C+o,L=C-o),O=j),{x1:k,x2:C,x3:L,y1:j,y2:z,y3:O}}drawTitle(e,n,r){const i=this.title,a=i.length;let o,c,f;if(a){const d=If(r.rtl,this.x,this.width);for(e.x=cm(this,r.titleAlign,r),n.textAlign=d.textAlign(r.titleAlign),n.textBaseline="middle",o=Ri(r.titleFont),c=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,f=0;f<a;++f)n.fillText(i[f],d.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+c,f+1===a&&(e.y+=r.titleMarginBottom-c)}}_drawColorBox(e,n,r,i,a){const o=this.labelColors[r],c=this.labelPointStyles[r],{boxHeight:f,boxWidth:d}=a,p=Ri(a.bodyFont),g=cm(this,"left",a),b=i.x(g),y=f<p.lineHeight?(p.lineHeight-f)/2:0,N=n.y+y;if(a.usePointStyle){const w={radius:Math.min(d,f)/2,pointStyle:c.pointStyle,rotation:c.rotation,borderWidth:1},k=i.leftForLtr(b,d)+d/2,C=N+f/2;e.strokeStyle=a.multiKeyBackground,e.fillStyle=a.multiKeyBackground,d2(e,w,k,C),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,d2(e,w,k,C)}else{e.lineWidth=ln(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const w=i.leftForLtr(b,d),k=i.leftForLtr(i.xPlus(b,1),d-2),C=Ff(o.borderRadius);Object.values(C).some(L=>L!==0)?(e.beginPath(),e.fillStyle=a.multiKeyBackground,Jm(e,{x:w,y:N,w:d,h:f,radius:C}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Jm(e,{x:k,y:N+1,w:d-2,h:f-2,radius:C}),e.fill()):(e.fillStyle=a.multiKeyBackground,e.fillRect(w,N,d,f),e.strokeRect(w,N,d,f),e.fillStyle=o.backgroundColor,e.fillRect(k,N+1,d-2,f-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:i}=this,{bodySpacing:a,bodyAlign:o,displayColors:c,boxHeight:f,boxWidth:d,boxPadding:p}=r,g=Ri(r.bodyFont);let b=g.lineHeight,y=0;const N=If(r.rtl,this.x,this.width),w=function(H){n.fillText(H,N.x(e.x+y),e.y+b/2),e.y+=b+a},k=N.textAlign(o);let C,L,j,z,O,K,q;for(n.textAlign=o,n.textBaseline="middle",n.font=g.string,e.x=cm(this,k,r),n.fillStyle=r.bodyColor,yn(this.beforeBody,w),y=c&&k!=="right"?o==="center"?d/2+p:d+2+p:0,z=0,K=i.length;z<K;++z){for(C=i[z],L=this.labelTextColors[z],n.fillStyle=L,yn(C.before,w),j=C.lines,c&&j.length&&(this._drawColorBox(n,e,z,N,r),b=Math.max(g.lineHeight,f)),O=0,q=j.length;O<q;++O)w(j[O]),b=g.lineHeight;yn(C.after,w)}y=0,b=g.lineHeight,yn(this.afterBody,w),e.y-=a}drawFooter(e,n,r){const i=this.footer,a=i.length;let o,c;if(a){const f=If(r.rtl,this.x,this.width);for(e.x=cm(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=f.textAlign(r.footerAlign),n.textBaseline="middle",o=Ri(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,c=0;c<a;++c)n.fillText(i[c],f.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r.footerSpacing}}drawBackground(e,n,r,i){const{xAlign:a,yAlign:o}=this,{x:c,y:f}=e,{width:d,height:p}=r,{topLeft:g,topRight:b,bottomLeft:y,bottomRight:N}=Ff(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(c+g,f),o==="top"&&this.drawCaret(e,n,r,i),n.lineTo(c+d-b,f),n.quadraticCurveTo(c+d,f,c+d,f+b),o==="center"&&a==="right"&&this.drawCaret(e,n,r,i),n.lineTo(c+d,f+p-N),n.quadraticCurveTo(c+d,f+p,c+d-N,f+p),o==="bottom"&&this.drawCaret(e,n,r,i),n.lineTo(c+y,f+p),n.quadraticCurveTo(c,f+p,c,f+p-y),o==="center"&&a==="left"&&this.drawCaret(e,n,r,i),n.lineTo(c,f+g),n.quadraticCurveTo(c,f,c+g,f),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,i=r&&r.x,a=r&&r.y;if(i||a){const o=vh[e.position].call(this,this._active,this._eventPosition);if(!o)return;const c=this._size=Mx(this,e),f=Object.assign({},o,this._size),d=Lx(n,e,f),p=Ex(e,f,d,n);(i._to!==p.x||a._to!==p.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=c.width,this.height=c.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,p))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},a={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Fa(n.padding),c=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&c&&(e.save(),e.globalAlpha=r,this.drawBackground(a,e,i,n),k3(e,n.textDirection),a.y+=o.top,this.drawTitle(a,e,n),this.drawBody(a,e,n),this.drawFooter(a,e,n),M3(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,i=e.map(({datasetIndex:c,index:f})=>{const d=this.chart.getDatasetMeta(c);if(!d)throw new Error("Cannot find a dataset at index "+c);return{datasetIndex:c,element:d.data[f],index:f}}),a=!Vm(r,i),o=this._positionChanged(i,n);(a||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,a=this._active||[],o=this._getActiveElements(e,a,n,r),c=this._positionChanged(o,e),f=n||!Vm(o,a)||c;return f&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),f}_getActiveElements(e,n,r,i){const a=this.options;if(e.type==="mouseout")return[];if(!i)return n.filter(c=>this.chart.data.datasets[c.datasetIndex]&&this.chart.getDatasetMeta(c.datasetIndex).controller.getParsed(c.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,a.mode,a,r);return a.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:r,caretY:i,options:a}=this,o=vh[a.position].call(this,e,n);return o!==!1&&(r!==o.x||i!==o.y)}}var Q7={id:"tooltip",_element:Ox,positioners:vh,afterInit(t,e,n){n&&(t.tooltip=new Ox({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:W3},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Cg={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Xi=Object.keys(Cg);function Tx(t,e){return t-e}function Rx(t,e){if(Mr(e))return null;const n=t._adapter,{parser:r,round:i,isoWeekday:a}=t._parseOpts;let o=e;return typeof r=="function"&&(o=r(o)),pl(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(Zm(a)||a===!0)?n.startOf(o,"isoWeek",a):n.startOf(o,i)),+o)}function Px(t,e,n,r){const i=Xi.length;for(let a=Xi.indexOf(t);a<i-1;++a){const o=Cg[Xi[a]],c=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-e)/(c*o.size))<=r)return Xi[a]}return Xi[i-1]}function J7(t,e,n,r,i){for(let a=Xi.length-1;a>=Xi.indexOf(n);a--){const o=Xi[a];if(Cg[o].common&&t._adapter.diff(i,r,o)>=e-1)return o}return Xi[n?Xi.indexOf(n):0]}function ej(t){for(let e=Xi.indexOf(t)+1,n=Xi.length;e<n;++e)if(Cg[Xi[e]].common)return Xi[e]}function Bx(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:i}=my(n,e),a=n[r]>=e?n[r]:n[i];t[a]=!0}}function tj(t,e,n,r){const i=t._adapter,a=+i.startOf(e[0].value,r),o=e[e.length-1].value;let c,f;for(c=a;c<=o;c=+i.add(c,1,r))f=n[c],f>=0&&(e[f].major=!0);return e}function Fx(t,e,n){const r=[],i={},a=e.length;let o,c;for(o=0;o<a;++o)c=e[o],i[c]=o,r.push({value:c,major:!1});return a===0||!n?r:tj(t,r,i,n)}class Ix extends Ng{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const r=e.time||(e.time={}),i=this._adapter=new yD._date(e.adapters.date);i.init(n),wh(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Rx(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:i,max:a,minDefined:o,maxDefined:c}=this.getUserBounds();function f(d){!o&&!isNaN(d.min)&&(i=Math.min(i,d.min)),!c&&!isNaN(d.max)&&(a=Math.max(a,d.max))}(!o||!c)&&(f(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&f(this.getMinMax(!1))),i=pl(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),a=pl(a)&&!isNaN(a)?a:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,a-1),this.max=Math.max(i+1,a)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const a=this.min,o=this.max,c=fE(i,a,o);return this._unit=n.unit||(r.autoSkip?Px(n.minUnit,this.min,this.max,this._getLabelCapacity(a)):J7(this,c.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:ej(this._unit),this.initOffsets(i),e.reverse&&c.reverse(),Fx(this,c,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,i,a;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),e.length===1?n=1-i:n=(this.getDecimalForValue(e[1])-i)/2,a=this.getDecimalForValue(e[e.length-1]),e.length===1?r=a:r=(a-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=va(n,0,o),r=va(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,i=this.options,a=i.time,o=a.unit||Px(a.minUnit,n,r,this._getLabelCapacity(n)),c=bn(i.ticks.stepSize,1),f=o==="week"?a.isoWeekday:!1,d=Zm(f)||f===!0,p={};let g=n,b,y;if(d&&(g=+e.startOf(g,"isoWeek",f)),g=+e.startOf(g,d?"day":o),e.diff(r,n,o)>1e5*c)throw new Error(n+" and "+r+" are too far apart with stepSize of "+c+" "+o);const N=i.ticks.source==="data"&&this.getDataTimestamps();for(b=g,y=0;b<r;b=+e.add(b,c,o),y++)Bx(p,b,N);return(b===r||i.bounds==="ticks"||y===1)&&Bx(p,b,N),Object.keys(p).sort(Tx).map(w=>+w)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const i=this.options.time.displayFormats,a=this._unit,o=n||i[a];return this._adapter.format(e,o)}_tickFormatFunction(e,n,r,i){const a=this.options,o=a.ticks.callback;if(o)return Pn(o,[e,n,r],this);const c=a.time.displayFormats,f=this._unit,d=this._majorUnit,p=f&&c[f],g=d&&c[d],b=r[n],y=d&&g&&b&&b.major;return this._adapter.format(e,i||(y?g:p))}generateTickLabels(e){let n,r,i;for(n=0,r=e.length;n<r;++n)i=e[n],i.label=this._tickFormatFunction(i.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,i=Su(this.isHorizontal()?n.maxRotation:n.minRotation),a=Math.cos(i),o=Math.sin(i),c=this._resolveTickFontOptions(0).size;return{w:r*a+c*o,h:r*o+c*a}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,a=this._tickFormatFunction(e,0,Fx(this,[e],this._majorUnit),i),o=this._getLabelSize(a),c=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return c>0?c:1}getDataTimestamps(){let e=this._cache.data||[],n,r;if(e.length)return e;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)e=e.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)e.push(Rx(this,i[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return hE(e.sort(Tx))}}function um(t,e,n){let r=0,i=t.length-1,a,o,c,f;n?(e>=t[r].pos&&e<=t[i].pos&&({lo:r,hi:i}=u2(t,"pos",e)),{pos:a,time:c}=t[r],{pos:o,time:f}=t[i]):(e>=t[r].time&&e<=t[i].time&&({lo:r,hi:i}=u2(t,"time",e)),{time:a,pos:c}=t[r],{time:o,pos:f}=t[i]);const d=o-a;return d?c+(f-c)*(e-a)/d:c}class HI extends Ix{static id="timeseries";static defaults=Ix.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=um(n,this.min),this._tableRange=um(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,i=[],a=[];let o,c,f,d,p;for(o=0,c=e.length;o<c;++o)d=e[o],d>=n&&d<=r&&i.push(d);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,c=i.length;o<c;++o)p=i[o+1],f=i[o-1],d=i[o],Math.round((p+f)/2)!==d&&a.push({time:d,pos:o/(c-1)});return a}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,a)=>i-a)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(um(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return um(this._table,r*this._tableRange+this._minPos,!0)}}const Y3="label";function zx(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function nj(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function V3(t,e){t.labels=e}function G3(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Y3;const r=[];t.datasets=e.map(i=>{const a=t.datasets.find(o=>o[n]===i[n]);return!a||!i.data||r.includes(a)?{...i}:(r.push(a),Object.assign(a,i),a)})}function rj(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Y3;const n={labels:[],datasets:[]};return V3(n,t.labels),G3(n,t.datasets,e),n}function ij(t,e){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:a,type:o,data:c,options:f,plugins:d=[],fallbackContent:p,updateMode:g,...b}=t,y=E.useRef(null),N=E.useRef(null),w=()=>{y.current&&(N.current=new Ag(y.current,{type:o,data:rj(c,a),options:f&&{...f},plugins:d}),zx(e,N.current))},k=()=>{zx(e,null),N.current&&(N.current.destroy(),N.current=null)};return E.useEffect(()=>{!i&&N.current&&f&&nj(N.current,f)},[i,f]),E.useEffect(()=>{!i&&N.current&&V3(N.current.config.data,c.labels)},[i,c.labels]),E.useEffect(()=>{!i&&N.current&&c.datasets&&G3(N.current.config.data,c.datasets,a)},[i,c.datasets]),E.useEffect(()=>{N.current&&(i?(k(),setTimeout(w)):N.current.update(g))},[i,f,c.labels,c.datasets,g]),E.useEffect(()=>{N.current&&(k(),setTimeout(w))},[o]),E.useEffect(()=>(w(),()=>k()),[]),st.createElement("canvas",{ref:y,role:"img",height:n,width:r,...b},p)}const aj=E.forwardRef(ij);function sj(t,e){return Ag.register(e),E.forwardRef((n,r)=>st.createElement(aj,{...n,ref:r,type:t}))}const $3=sj("doughnut",gD);/*!
 * chartjs-plugin-datalabels v2.2.0
 * https://chartjs-plugin-datalabels.netlify.app
 * (c) 2017-2022 chartjs-plugin-datalabels contributors
 * Released under the MIT license
 */var Hx=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var t=window.screen;if(t)return(t.deviceXDPI||1)/(t.logicalXDPI||1)}return 1}(),Nh={toTextLines:function(t){var e=[],n;for(t=[].concat(t);t.length;)n=t.pop(),typeof n=="string"?e.unshift.apply(e,n.split(`
`)):Array.isArray(n)?t.push.apply(t,n):Mr(t)||e.unshift(""+n);return e},textSize:function(t,e,n){var r=[].concat(e),i=r.length,a=t.font,o=0,c;for(t.font=n.string,c=0;c<i;++c)o=Math.max(t.measureText(r[c]).width,o);return t.font=a,{height:i*n.lineHeight,width:o}},bound:function(t,e,n){return Math.max(t,Math.min(e,n))},arrayDiff:function(t,e){var n=t.slice(),r=[],i,a,o,c;for(i=0,o=e.length;i<o;++i)c=e[i],a=n.indexOf(c),a===-1?r.push([c,1]):n.splice(a,1);for(i=0,o=n.length;i<o;++i)r.push([n[i],-1]);return r},rasterize:function(t){return Math.round(t*Hx)/Hx}};function S1(t,e){var n=e.x,r=e.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var i=t.x-n,a=t.y-r,o=Math.sqrt(i*i+a*a);return{x:o?i/o:0,y:o?a/o:-1}}function oj(t,e,n,r,i){switch(i){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:i*=Math.PI/180,n=Math.cos(i),r=Math.sin(i);break}return{x:t,y:e,vx:n,vy:r}}var lj=0,X3=1,Z3=2,K3=4,Q3=8;function fm(t,e,n){var r=lj;return t<n.left?r|=X3:t>n.right&&(r|=Z3),e<n.top?r|=Q3:e>n.bottom&&(r|=K3),r}function cj(t,e){for(var n=t.x0,r=t.y0,i=t.x1,a=t.y1,o=fm(n,r,e),c=fm(i,a,e),f,d,p;!(!(o|c)||o&c);)f=o||c,f&Q3?(d=n+(i-n)*(e.top-r)/(a-r),p=e.top):f&K3?(d=n+(i-n)*(e.bottom-r)/(a-r),p=e.bottom):f&Z3?(p=r+(a-r)*(e.right-n)/(i-n),d=e.right):f&X3&&(p=r+(a-r)*(e.left-n)/(i-n),d=e.left),f===o?(n=d,r=p,o=fm(n,r,e)):(i=d,a=p,c=fm(i,a,e));return{x0:n,x1:i,y0:r,y1:a}}function dm(t,e){var n=e.anchor,r=t,i,a;return e.clamp&&(r=cj(r,e.area)),n==="start"?(i=r.x0,a=r.y0):n==="end"?(i=r.x1,a=r.y1):(i=(r.x0+r.x1)/2,a=(r.y0+r.y1)/2),oj(i,a,t.vx,t.vy,e.align)}var hm={arc:function(t,e){var n=(t.startAngle+t.endAngle)/2,r=Math.cos(n),i=Math.sin(n),a=t.innerRadius,o=t.outerRadius;return dm({x0:t.x+r*a,y0:t.y+i*a,x1:t.x+r*o,y1:t.y+i*o,vx:r,vy:i},e)},point:function(t,e){var n=S1(t,e.origin),r=n.x*t.options.radius,i=n.y*t.options.radius;return dm({x0:t.x-r,y0:t.y-i,x1:t.x+r,y1:t.y+i,vx:n.x,vy:n.y},e)},bar:function(t,e){var n=S1(t,e.origin),r=t.x,i=t.y,a=0,o=0;return t.horizontal?(r=Math.min(t.x,t.base),a=Math.abs(t.base-t.x)):(i=Math.min(t.y,t.base),o=Math.abs(t.base-t.y)),dm({x0:r,y0:i+o,x1:r+a,y1:i,vx:n.x,vy:n.y},e)},fallback:function(t,e){var n=S1(t,e.origin);return dm({x0:t.x,y0:t.y,x1:t.x+(t.width||0),y1:t.y+(t.height||0),vx:n.x,vy:n.y},e)}},ll=Nh.rasterize;function uj(t){var e=t.borderWidth||0,n=t.padding,r=t.size.height,i=t.size.width,a=-i/2,o=-r/2;return{frame:{x:a-n.left-e,y:o-n.top-e,w:i+n.width+e*2,h:r+n.height+e*2},text:{x:a,y:o,w:i,h:r}}}function fj(t,e){var n=e.chart.getDatasetMeta(e.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return t.horizontal?{x:r,y:null}:{x:null,y:r}}function dj(t){return t instanceof H3?hm.arc:t instanceof j7?hm.point:t instanceof F7?hm.bar:hm.fallback}function hj(t,e,n,r,i,a){var o=Math.PI/2;if(a){var c=Math.min(a,i/2,r/2),f=e+c,d=n+c,p=e+r-c,g=n+i-c;t.moveTo(e,d),f<p&&d<g?(t.arc(f,d,c,-Math.PI,-o),t.arc(p,d,c,-o,0),t.arc(p,g,c,0,o),t.arc(f,g,c,o,Math.PI)):f<p?(t.moveTo(f,n),t.arc(p,d,c,-o,o),t.arc(f,d,c,o,Math.PI+o)):d<g?(t.arc(f,d,c,-Math.PI,0),t.arc(f,g,c,0,Math.PI)):t.arc(f,d,c,-Math.PI,Math.PI),t.closePath(),t.moveTo(e,n)}else t.rect(e,n,r,i)}function pj(t,e,n){var r=n.backgroundColor,i=n.borderColor,a=n.borderWidth;!r&&(!i||!a)||(t.beginPath(),hj(t,ll(e.x)+a/2,ll(e.y)+a/2,ll(e.w)-a,ll(e.h)-a,n.borderRadius),t.closePath(),r&&(t.fillStyle=r,t.fill()),i&&a&&(t.strokeStyle=i,t.lineWidth=a,t.lineJoin="miter",t.stroke()))}function mj(t,e,n){var r=n.lineHeight,i=t.w,a=t.x,o=t.y+r/2;return e==="center"?a+=i/2:(e==="end"||e==="right")&&(a+=i),{h:r,w:i,x:a,y:o}}function gj(t,e,n){var r=t.shadowBlur,i=n.stroked,a=ll(n.x),o=ll(n.y),c=ll(n.w);i&&t.strokeText(e,a,o,c),n.filled&&(r&&i&&(t.shadowBlur=0),t.fillText(e,a,o,c),r&&i&&(t.shadowBlur=r))}function yj(t,e,n,r){var i=r.textAlign,a=r.color,o=!!a,c=r.font,f=e.length,d=r.textStrokeColor,p=r.textStrokeWidth,g=d&&p,b;if(!(!f||!o&&!g))for(n=mj(n,i,c),t.font=c.string,t.textAlign=i,t.textBaseline="middle",t.shadowBlur=r.textShadowBlur,t.shadowColor=r.textShadowColor,o&&(t.fillStyle=a),g&&(t.lineJoin="round",t.lineWidth=p,t.strokeStyle=d),b=0,f=e.length;b<f;++b)gj(t,e[b],{stroked:g,filled:o,w:n.w,x:n.x,y:n.y+n.h*b})}var J3=function(t,e,n,r){var i=this;i._config=t,i._index=r,i._model=null,i._rects=null,i._ctx=e,i._el=n};vo(J3.prototype,{_modelize:function(t,e,n,r){var i=this,a=i._index,o=Ri(Kn([n.font,{}],r,a)),c=Kn([n.color,yr.color],r,a);return{align:Kn([n.align,"center"],r,a),anchor:Kn([n.anchor,"center"],r,a),area:r.chart.chartArea,backgroundColor:Kn([n.backgroundColor,null],r,a),borderColor:Kn([n.borderColor,null],r,a),borderRadius:Kn([n.borderRadius,0],r,a),borderWidth:Kn([n.borderWidth,0],r,a),clamp:Kn([n.clamp,!1],r,a),clip:Kn([n.clip,!1],r,a),color:c,display:t,font:o,lines:e,offset:Kn([n.offset,4],r,a),opacity:Kn([n.opacity,1],r,a),origin:fj(i._el,r),padding:Fa(Kn([n.padding,4],r,a)),positioner:dj(i._el),rotation:Kn([n.rotation,0],r,a)*(Math.PI/180),size:Nh.textSize(i._ctx,e,o),textAlign:Kn([n.textAlign,"start"],r,a),textShadowBlur:Kn([n.textShadowBlur,0],r,a),textShadowColor:Kn([n.textShadowColor,c],r,a),textStrokeColor:Kn([n.textStrokeColor,c],r,a),textStrokeWidth:Kn([n.textStrokeWidth,0],r,a)}},update:function(t){var e=this,n=null,r=null,i=e._index,a=e._config,o,c,f,d=Kn([a.display,!0],t,i);d&&(o=t.dataset.data[i],c=bn(Pn(a.formatter,[o,t]),o),f=Mr(c)?[]:Nh.toTextLines(c),f.length&&(n=e._modelize(d,f,a,t),r=uj(n))),e._model=n,e._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(t,e){var n=this,r=t.ctx,i=n._model,a=n._rects,o;this.visible()&&(r.save(),i.clip&&(o=i.area,r.beginPath(),r.rect(o.left,o.top,o.right-o.left,o.bottom-o.top),r.clip()),r.globalAlpha=Nh.bound(0,i.opacity,1),r.translate(ll(e.x),ll(e.y)),r.rotate(i.rotation),pj(r,a.frame,i),yj(r,i.lines,a.text,i),r.restore())}});var vj=Number.MIN_SAFE_INTEGER||-9007199254740991,bj=Number.MAX_SAFE_INTEGER||9007199254740991;function hh(t,e,n){var r=Math.cos(n),i=Math.sin(n),a=e.x,o=e.y;return{x:a+r*(t.x-a)-i*(t.y-o),y:o+i*(t.x-a)+r*(t.y-o)}}function Ux(t,e){var n=bj,r=vj,i=e.origin,a,o,c,f,d;for(a=0;a<t.length;++a)o=t[a],c=o.x-i.x,f=o.y-i.y,d=e.vx*c+e.vy*f,n=Math.min(n,d),r=Math.max(r,d);return{min:n,max:r}}function pm(t,e){var n=e.x-t.x,r=e.y-t.y,i=Math.sqrt(n*n+r*r);return{vx:(e.x-t.x)/i,vy:(e.y-t.y)/i,origin:t,ln:i}}var e4=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};vo(e4.prototype,{center:function(){var t=this._rect;return{x:t.x+t.w/2,y:t.y+t.h/2}},update:function(t,e,n){this._rotation=n,this._rect={x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},contains:function(t){var e=this,n=1,r=e._rect;return t=hh(t,e.center(),-e._rotation),!(t.x<r.x-n||t.y<r.y-n||t.x>r.x+r.w+n*2||t.y>r.y+r.h+n*2)},intersects:function(t){var e=this._points(),n=t._points(),r=[pm(e[0],e[1]),pm(e[0],e[3])],i,a,o;for(this._rotation!==t._rotation&&r.push(pm(n[0],n[1]),pm(n[0],n[3])),i=0;i<r.length;++i)if(a=Ux(e,r[i]),o=Ux(n,r[i]),a.max<o.min||o.max<a.min)return!1;return!0},_points:function(){var t=this,e=t._rect,n=t._rotation,r=t.center();return[hh({x:e.x,y:e.y},r,n),hh({x:e.x+e.w,y:e.y},r,n),hh({x:e.x+e.w,y:e.y+e.h},r,n),hh({x:e.x,y:e.y+e.h},r,n)]}});function t4(t,e,n){var r=e.positioner(t,e),i=r.vx,a=r.vy;if(!i&&!a)return{x:r.x,y:r.y};var o=n.w,c=n.h,f=e.rotation,d=Math.abs(o/2*Math.cos(f))+Math.abs(c/2*Math.sin(f)),p=Math.abs(o/2*Math.sin(f))+Math.abs(c/2*Math.cos(f)),g=1/Math.max(Math.abs(i),Math.abs(a));return d*=i*g,p*=a*g,d+=e.offset*i,p+=e.offset*a,{x:r.x+d,y:r.y+p}}function xj(t,e){var n,r,i,a;for(n=t.length-1;n>=0;--n)for(i=t[n].$layout,r=n-1;r>=0&&i._visible;--r)a=t[r].$layout,a._visible&&i._box.intersects(a._box)&&e(i,a);return t}function wj(t){var e,n,r,i,a,o,c;for(e=0,n=t.length;e<n;++e)r=t[e],i=r.$layout,i._visible&&(c=new Proxy(r._el,{get:(f,d)=>f.getProps([d],!0)[d]}),a=r.geometry(),o=t4(c,r.model(),a),i._box.update(o,a,r.rotation()));return xj(t,function(f,d){var p=f._hidable,g=d._hidable;p&&g||g?d._visible=!1:p&&(f._visible=!1)})}var Ah={prepare:function(t){var e=[],n,r,i,a,o;for(n=0,i=t.length;n<i;++n)for(r=0,a=t[n].length;r<a;++r)o=t[n][r],e.push(o),o.$layout={_box:new e4,_hidable:!1,_visible:!0,_set:n,_idx:o._index};return e.sort(function(c,f){var d=c.$layout,p=f.$layout;return d._idx===p._idx?p._set-d._set:p._idx-d._idx}),this.update(e),e},update:function(t){var e=!1,n,r,i,a,o;for(n=0,r=t.length;n<r;++n)i=t[n],a=i.model(),o=i.$layout,o._hidable=a&&a.display==="auto",o._visible=i.visible(),e|=o._hidable;e&&wj(t)},lookup:function(t,e){var n,r;for(n=t.length-1;n>=0;--n)if(r=t[n].$layout,r&&r._visible&&r._box.contains(e))return t[n];return null},draw:function(t,e){var n,r,i,a,o,c;for(n=0,r=e.length;n<r;++n)i=e[n],a=i.$layout,a._visible&&(o=i.geometry(),c=t4(i._el,i.model(),o),a._box.update(c,o,i.rotation()),i.draw(t,c))}},Sj=function(t){if(Mr(t))return null;var e=t,n,r,i;if(ln(t))if(!Mr(t.label))e=t.label;else if(!Mr(t.r))e=t.r;else for(e="",n=Object.keys(t),i=0,r=n.length;i<r;++i)e+=(i!==0?", ":"")+n[i]+": "+t[n[i]];return""+e},_j={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:Sj,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},$i="$datalabels",n4="$default";function Nj(t,e){var n=t.datalabels,r={},i=[],a,o;return n===!1?null:(n===!0&&(n={}),e=vo({},[e,n]),a=e.labels||{},o=Object.keys(a),delete e.labels,o.length?o.forEach(function(c){a[c]&&i.push(vo({},[e,a[c],{_key:c}]))}):i.push(e),r=i.reduce(function(c,f){return yn(f.listeners||{},function(d,p){c[p]=c[p]||{},c[p][f._key||n4]=d}),delete f.listeners,c},{}),{labels:i,listeners:r})}function m2(t,e,n,r){if(e){var i=n.$context,a=n.$groups,o;e[a._set]&&(o=e[a._set][a._key],o&&Pn(o,[i,r])===!0&&(t[$i]._dirty=!0,n.update(i)))}}function Aj(t,e,n,r,i){var a,o;!n&&!r||(n?r?n!==r&&(o=a=!0):o=!0:a=!0,o&&m2(t,e.leave,n,i),a&&m2(t,e.enter,r,i))}function Cj(t,e){var n=t[$i],r=n._listeners,i,a;if(!(!r.enter&&!r.leave)){if(e.type==="mousemove")a=Ah.lookup(n._labels,e);else if(e.type!=="mouseout")return;i=n._hovered,n._hovered=a,Aj(t,r,i,a,e)}}function kj(t,e){var n=t[$i],r=n._listeners.click,i=r&&Ah.lookup(n._labels,e);i&&m2(t,r,i,e)}var Mj={id:"datalabels",defaults:_j,beforeInit:function(t){t[$i]={_actives:[]}},beforeUpdate:function(t){var e=t[$i];e._listened=!1,e._listeners={},e._datasets=[],e._labels=[]},afterDatasetUpdate:function(t,e,n){var r=e.index,i=t[$i],a=i._datasets[r]=[],o=t.isDatasetVisible(r),c=t.data.datasets[r],f=Nj(c,n),d=e.meta.data||[],p=t.ctx,g,b,y,N,w,k,C,L;for(p.save(),g=0,y=d.length;g<y;++g)if(C=d[g],C[$i]=[],o&&C&&t.getDataVisibility(g)&&!C.skip)for(b=0,N=f.labels.length;b<N;++b)w=f.labels[b],k=w._key,L=new J3(w,p,C,g),L.$groups={_set:r,_key:k||n4},L.$context={active:!1,chart:t,dataIndex:g,dataset:c,datasetIndex:r},L.update(L.$context),C[$i].push(L),a.push(L);p.restore(),vo(i._listeners,f.listeners,{merger:function(j,z,O){z[j]=z[j]||{},z[j][e.index]=O[j],i._listened=!0}})},afterUpdate:function(t){t[$i]._labels=Ah.prepare(t[$i]._datasets)},afterDatasetsDraw:function(t){Ah.draw(t,t[$i]._labels)},beforeEvent:function(t,e){if(t[$i]._listened){var n=e.event;switch(n.type){case"mousemove":case"mouseout":Cj(t,n);break;case"click":kj(t,n);break}}},afterEvent:function(t){var e=t[$i],n=e._actives,r=e._actives=t.getActiveElements(),i=Nh.arrayDiff(n,r),a,o,c,f,d,p,g;for(a=0,o=i.length;a<o;++a)if(d=i[a],d[1])for(g=d[0].element[$i]||[],c=0,f=g.length;c<f;++c)p=g[c],p.$context.active=d[1]===1,p.update(p.$context);(e._dirty||i.length)&&(Ah.update(e._labels),t.render()),delete e._dirty}};Ag.register(H3,Q7,W7,Mj);function Lj({data:t}){const e={labels:t.map(r=>r.category),datasets:[{data:t.map(r=>r.count),backgroundColor:["#3B82F6","#F59E0B","#10B981","#EF4444","#8B5CF6","#06B6D4","#F97316"],borderWidth:0,hoverBorderWidth:2,hoverBorderColor:"#ffffff"}]},n={responsive:!0,maintainAspectRatio:!1,cutout:"60%",plugins:{datalabels:{color:"#000",font:{weight:"bold",size:10},formatter:(r,i)=>{const a=i.dataset.data.reduce((c,f)=>c+f,0);return`${(r/a*100).toFixed(0)}%`}},legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:function(r){const i=r.label||"",a=r.parsed,o=r.dataset.data.reduce((f,d)=>f+d,0),c=(a/o*100).toFixed(1);return`${i}: ${a} (${c}%)`}}}}};return S.jsx("div",{className:"w-full h-full flex items-center justify-center",children:S.jsx($3,{data:e,options:n})})}function Ej({newCount:t,raisedCount:e,rejectedCount:n}){const r={labels:["New","Raised","Rejected"],datasets:[{data:[t,e,n],backgroundColor:["#10B981","#F59E0B","#EF4444"],borderWidth:0,hoverBorderWidth:2,hoverBorderColor:"#ffffff"}]},i={responsive:!0,maintainAspectRatio:!1,cutout:"60%",plugins:{datalabels:{color:"#000",font:{weight:"bold",size:10},formatter:a=>a.toString()},legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:function(a){const o=a.dataset.data.reduce((f,d)=>f+d,0),c=(a.parsed/o*100).toFixed(1);return`${a.label}: ${a.parsed} (${c}%)`}}}}};return S.jsx("div",{className:"w-full h-full flex items-center justify-center",children:S.jsx($3,{data:r,options:i})})}function qx(t,[e,n]){return Math.min(n,Math.max(e,t))}function vn(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),n===!1||!i.defaultPrevented)return e?.(i)}}function Dj(t,e){const n=E.createContext(e),r=a=>{const{children:o,...c}=a,f=E.useMemo(()=>c,Object.values(c));return S.jsx(n.Provider,{value:f,children:o})};r.displayName=t+"Provider";function i(a){const o=E.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${t}\``)}return[r,i]}function $h(t,e=[]){let n=[];function r(a,o){const c=E.createContext(o),f=n.length;n=[...n,o];const d=g=>{const{scope:b,children:y,...N}=g,w=b?.[t]?.[f]||c,k=E.useMemo(()=>N,Object.values(N));return S.jsx(w.Provider,{value:k,children:y})};d.displayName=a+"Provider";function p(g,b){const y=b?.[t]?.[f]||c,N=E.useContext(y);if(N)return N;if(o!==void 0)return o;throw new Error(`\`${g}\` must be used within \`${a}\``)}return[d,p]}const i=()=>{const a=n.map(o=>E.createContext(o));return function(c){const f=c?.[t]||a;return E.useMemo(()=>({[`__scope${t}`]:{...c,[t]:f}}),[c,f])}};return i.scopeName=t,[r,jj(i,...e)]}function jj(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((c,{useScope:f,scopeName:d})=>{const g=f(a)[`__scope${d}`];return{...c,...g}},{});return E.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Oj(t){const e=t+"CollectionProvider",[n,r]=$h(e),[i,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:k,children:C}=w,L=st.useRef(null),j=st.useRef(new Map).current;return S.jsx(i,{scope:k,itemMap:j,collectionRef:L,children:C})};o.displayName=e;const c=t+"CollectionSlot",f=Mu(c),d=st.forwardRef((w,k)=>{const{scope:C,children:L}=w,j=a(c,C),z=cr(k,j.collectionRef);return S.jsx(f,{ref:z,children:L})});d.displayName=c;const p=t+"CollectionItemSlot",g="data-radix-collection-item",b=Mu(p),y=st.forwardRef((w,k)=>{const{scope:C,children:L,...j}=w,z=st.useRef(null),O=cr(k,z),K=a(p,C);return st.useEffect(()=>(K.itemMap.set(z,{ref:z,...j}),()=>void K.itemMap.delete(z))),S.jsx(b,{[g]:"",ref:O,children:L})});y.displayName=p;function N(w){const k=a(t+"CollectionConsumer",w);return st.useCallback(()=>{const L=k.collectionRef.current;if(!L)return[];const j=Array.from(L.querySelectorAll(`[${g}]`));return Array.from(k.itemMap.values()).sort((K,q)=>j.indexOf(K.ref.current)-j.indexOf(q.ref.current))},[k.collectionRef,k.itemMap])}return[{Provider:o,Slot:d,ItemSlot:y},N,r]}var Tj=E.createContext(void 0);function Rj(t){const e=E.useContext(Tj);return t||e||"ltr"}function Eu(t){const e=E.useRef(t);return E.useEffect(()=>{e.current=t}),E.useMemo(()=>(...n)=>e.current?.(...n),[])}function Pj(t,e=globalThis?.document){const n=Eu(t);E.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Bj="DismissableLayer",g2="dismissableLayer.update",Fj="dismissableLayer.pointerDownOutside",Ij="dismissableLayer.focusOutside",Wx,r4=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kg=E.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:c,...f}=t,d=E.useContext(r4),[p,g]=E.useState(null),b=p?.ownerDocument??globalThis?.document,[,y]=E.useState({}),N=cr(e,q=>g(q)),w=Array.from(d.layers),[k]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=w.indexOf(k),L=p?w.indexOf(p):-1,j=d.layersWithOutsidePointerEventsDisabled.size>0,z=L>=C,O=Uj(q=>{const H=q.target,se=[...d.branches].some(le=>le.contains(H));!z||se||(i?.(q),o?.(q),q.defaultPrevented||c?.())},b),K=qj(q=>{const H=q.target;[...d.branches].some(le=>le.contains(H))||(a?.(q),o?.(q),q.defaultPrevented||c?.())},b);return Pj(q=>{L===d.layers.size-1&&(r?.(q),!q.defaultPrevented&&c&&(q.preventDefault(),c()))},b),E.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Wx=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Yx(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Wx)}},[p,b,n,d]),E.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Yx())},[p,d]),E.useEffect(()=>{const q=()=>y({});return document.addEventListener(g2,q),()=>document.removeEventListener(g2,q)},[]),S.jsx(xn.div,{...f,ref:N,style:{pointerEvents:j?z?"auto":"none":void 0,...t.style},onFocusCapture:vn(t.onFocusCapture,K.onFocusCapture),onBlurCapture:vn(t.onBlurCapture,K.onBlurCapture),onPointerDownCapture:vn(t.onPointerDownCapture,O.onPointerDownCapture)})});kg.displayName=Bj;var zj="DismissableLayerBranch",Hj=E.forwardRef((t,e)=>{const n=E.useContext(r4),r=E.useRef(null),i=cr(e,r);return E.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),S.jsx(xn.div,{...t,ref:i})});Hj.displayName=zj;function Uj(t,e=globalThis?.document){const n=Eu(t),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const a=c=>{if(c.target&&!r.current){let f=function(){i4(Fj,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=f,e.addEventListener("click",i.current,{once:!0})):f()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",a),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function qj(t,e=globalThis?.document){const n=Eu(t),r=E.useRef(!1);return E.useEffect(()=>{const i=a=>{a.target&&!r.current&&i4(Ij,n,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Yx(){const t=new CustomEvent(g2);document.dispatchEvent(t)}function i4(t,e,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?rM(i,a):i.dispatchEvent(a)}var _1=0;function Cy(){E.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Vx()),document.body.insertAdjacentElement("beforeend",t[1]??Vx()),_1++,()=>{_1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),_1--}},[])}function Vx(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var N1="focusScope.autoFocusOnMount",A1="focusScope.autoFocusOnUnmount",Gx={bubbles:!1,cancelable:!0},Wj="FocusScope",Mg=E.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=t,[c,f]=E.useState(null),d=Eu(i),p=Eu(a),g=E.useRef(null),b=cr(e,w=>f(w)),y=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let w=function(j){if(y.paused||!c)return;const z=j.target;c.contains(z)?g.current=z:pc(g.current,{select:!0})},k=function(j){if(y.paused||!c)return;const z=j.relatedTarget;z!==null&&(c.contains(z)||pc(g.current,{select:!0}))},C=function(j){if(document.activeElement===document.body)for(const O of j)O.removedNodes.length>0&&pc(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",k);const L=new MutationObserver(C);return c&&L.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",k),L.disconnect()}}},[r,c,y.paused]),E.useEffect(()=>{if(c){Xx.add(y);const w=document.activeElement;if(!c.contains(w)){const C=new CustomEvent(N1,Gx);c.addEventListener(N1,d),c.dispatchEvent(C),C.defaultPrevented||(Yj(Zj(a4(c)),{select:!0}),document.activeElement===w&&pc(c))}return()=>{c.removeEventListener(N1,d),setTimeout(()=>{const C=new CustomEvent(A1,Gx);c.addEventListener(A1,p),c.dispatchEvent(C),C.defaultPrevented||pc(w??document.body,{select:!0}),c.removeEventListener(A1,p),Xx.remove(y)},0)}}},[c,d,p,y]);const N=E.useCallback(w=>{if(!n&&!r||y.paused)return;const k=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,C=document.activeElement;if(k&&C){const L=w.currentTarget,[j,z]=Vj(L);j&&z?!w.shiftKey&&C===z?(w.preventDefault(),n&&pc(j,{select:!0})):w.shiftKey&&C===j&&(w.preventDefault(),n&&pc(z,{select:!0})):C===L&&w.preventDefault()}},[n,r,y.paused]);return S.jsx(xn.div,{tabIndex:-1,...o,ref:b,onKeyDown:N})});Mg.displayName=Wj;function Yj(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(pc(r,{select:e}),document.activeElement!==n)return}function Vj(t){const e=a4(t),n=$x(e,t),r=$x(e.reverse(),t);return[n,r]}function a4(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function $x(t,e){for(const n of t)if(!Gj(n,{upTo:e}))return n}function Gj(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function $j(t){return t instanceof HTMLInputElement&&"select"in t}function pc(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&$j(t)&&e&&t.select()}}var Xx=Xj();function Xj(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=Zx(t,e),t.unshift(e)},remove(e){t=Zx(t,e),t[0]?.resume()}}}function Zx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Zj(t){return t.filter(e=>e.tagName!=="A")}var Si=globalThis?.document?E.useLayoutEffect:()=>{},Kj=Vw[" useId ".trim().toString()]||(()=>{}),Qj=0;function Lg(t){const[e,n]=E.useState(Kj());return Si(()=>{n(r=>r??String(Qj++))},[t]),e?`radix-${e}`:""}const Jj=["top","right","bottom","left"],Sc=Math.min,ya=Math.max,rg=Math.round,mm=Math.floor,mo=t=>({x:t,y:t}),eO={left:"right",right:"left",bottom:"top",top:"bottom"},tO={start:"end",end:"start"};function y2(t,e,n){return ya(t,Sc(e,n))}function ml(t,e){return typeof t=="function"?t(e):t}function gl(t){return t.split("-")[0]}function sd(t){return t.split("-")[1]}function ky(t){return t==="x"?"y":"x"}function My(t){return t==="y"?"height":"width"}function fo(t){return["top","bottom"].includes(gl(t))?"y":"x"}function Ly(t){return ky(fo(t))}function nO(t,e,n){n===void 0&&(n=!1);const r=sd(t),i=Ly(t),a=My(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=ig(o)),[o,ig(o)]}function rO(t){const e=ig(t);return[v2(t),e,v2(e)]}function v2(t){return t.replace(/start|end/g,e=>tO[e])}function iO(t,e,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?a:o;default:return[]}}function aO(t,e,n,r){const i=sd(t);let a=iO(gl(t),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),e&&(a=a.concat(a.map(v2)))),a}function ig(t){return t.replace(/left|right|bottom|top/g,e=>eO[e])}function sO(t){return{top:0,right:0,bottom:0,left:0,...t}}function s4(t){return typeof t!="number"?sO(t):{top:t,right:t,bottom:t,left:t}}function ag(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Kx(t,e,n){let{reference:r,floating:i}=t;const a=fo(e),o=Ly(e),c=My(o),f=gl(e),d=a==="y",p=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,b=r[c]/2-i[c]/2;let y;switch(f){case"top":y={x:p,y:r.y-i.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:g};break;case"left":y={x:r.x-i.width,y:g};break;default:y={x:r.x,y:r.y}}switch(sd(e)){case"start":y[o]-=b*(n&&d?-1:1);break;case"end":y[o]+=b*(n&&d?-1:1);break}return y}const oO=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,c=a.filter(Boolean),f=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:g}=Kx(d,r,f),b=r,y={},N=0;for(let w=0;w<c.length;w++){const{name:k,fn:C}=c[w],{x:L,y:j,data:z,reset:O}=await C({x:p,y:g,initialPlacement:r,placement:b,strategy:i,middlewareData:y,rects:d,platform:o,elements:{reference:t,floating:e}});p=L??p,g=j??g,y={...y,[k]:{...y[k],...z}},O&&N<=50&&(N++,typeof O=="object"&&(O.placement&&(b=O.placement),O.rects&&(d=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:p,y:g}=Kx(d,b,f)),w=-1)}return{x:p,y:g,placement:b,strategy:i,middlewareData:y}};async function Fh(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:a,rects:o,elements:c,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:b=!1,padding:y=0}=ml(e,t),N=s4(y),k=c[b?g==="floating"?"reference":"floating":g],C=ag(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(k)))==null||n?k:k.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:d,rootBoundary:p,strategy:f})),L=g==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,j=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),z=await(a.isElement==null?void 0:a.isElement(j))?await(a.getScale==null?void 0:a.getScale(j))||{x:1,y:1}:{x:1,y:1},O=ag(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:L,offsetParent:j,strategy:f}):L);return{top:(C.top-O.top+N.top)/z.y,bottom:(O.bottom-C.bottom+N.bottom)/z.y,left:(C.left-O.left+N.left)/z.x,right:(O.right-C.right+N.right)/z.x}}const lO=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:a,platform:o,elements:c,middlewareData:f}=e,{element:d,padding:p=0}=ml(t,e)||{};if(d==null)return{};const g=s4(p),b={x:n,y:r},y=Ly(i),N=My(y),w=await o.getDimensions(d),k=y==="y",C=k?"top":"left",L=k?"bottom":"right",j=k?"clientHeight":"clientWidth",z=a.reference[N]+a.reference[y]-b[y]-a.floating[N],O=b[y]-a.reference[y],K=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let q=K?K[j]:0;(!q||!await(o.isElement==null?void 0:o.isElement(K)))&&(q=c.floating[j]||a.floating[N]);const H=z/2-O/2,se=q/2-w[N]/2-1,le=Sc(g[C],se),P=Sc(g[L],se),I=le,ne=q-w[N]-P,te=q/2-w[N]/2+H,de=y2(I,te,ne),X=!f.arrow&&sd(i)!=null&&te!==de&&a.reference[N]/2-(te<I?le:P)-w[N]/2<0,J=X?te<I?te-I:te-ne:0;return{[y]:b[y]+J,data:{[y]:de,centerOffset:te-de-J,...X&&{alignmentOffset:J}},reset:X}}}),cO=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:c,platform:f,elements:d}=e,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:w=!0,...k}=ml(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const C=gl(i),L=fo(c),j=gl(c)===c,z=await(f.isRTL==null?void 0:f.isRTL(d.floating)),O=b||(j||!w?[ig(c)]:rO(c)),K=N!=="none";!b&&K&&O.push(...aO(c,w,N,z));const q=[c,...O],H=await Fh(e,k),se=[];let le=((r=a.flip)==null?void 0:r.overflows)||[];if(p&&se.push(H[C]),g){const te=nO(i,o,z);se.push(H[te[0]],H[te[1]])}if(le=[...le,{placement:i,overflows:se}],!se.every(te=>te<=0)){var P,I;const te=(((P=a.flip)==null?void 0:P.index)||0)+1,de=q[te];if(de&&(!(g==="alignment"?L!==fo(de):!1)||le.every(G=>G.overflows[0]>0&&fo(G.placement)===L)))return{data:{index:te,overflows:le},reset:{placement:de}};let X=(I=le.filter(J=>J.overflows[0]<=0).sort((J,G)=>J.overflows[1]-G.overflows[1])[0])==null?void 0:I.placement;if(!X)switch(y){case"bestFit":{var ne;const J=(ne=le.filter(G=>{if(K){const me=fo(G.placement);return me===L||me==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(me=>me>0).reduce((me,W)=>me+W,0)]).sort((G,me)=>G[1]-me[1])[0])==null?void 0:ne[0];J&&(X=J);break}case"initialPlacement":X=c;break}if(i!==X)return{reset:{placement:X}}}return{}}}};function Qx(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Jx(t){return Jj.some(e=>t[e]>=0)}const uO=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=ml(t,e);switch(r){case"referenceHidden":{const a=await Fh(e,{...i,elementContext:"reference"}),o=Qx(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Jx(o)}}}case"escaped":{const a=await Fh(e,{...i,altBoundary:!0}),o=Qx(a,n.floating);return{data:{escapedOffsets:o,escaped:Jx(o)}}}default:return{}}}}};async function fO(t,e){const{placement:n,platform:r,elements:i}=t,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=gl(n),c=sd(n),f=fo(n)==="y",d=["left","top"].includes(o)?-1:1,p=a&&f?-1:1,g=ml(e,t);let{mainAxis:b,crossAxis:y,alignmentAxis:N}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return c&&typeof N=="number"&&(y=c==="end"?N*-1:N),f?{x:y*p,y:b*d}:{x:b*d,y:y*p}}const dO=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:a,placement:o,middlewareData:c}=e,f=await fO(e,t);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:a+f.y,data:{...f,placement:o}}}}},hO=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:a=!0,crossAxis:o=!1,limiter:c={fn:k=>{let{x:C,y:L}=k;return{x:C,y:L}}},...f}=ml(t,e),d={x:n,y:r},p=await Fh(e,f),g=fo(gl(i)),b=ky(g);let y=d[b],N=d[g];if(a){const k=b==="y"?"top":"left",C=b==="y"?"bottom":"right",L=y+p[k],j=y-p[C];y=y2(L,y,j)}if(o){const k=g==="y"?"top":"left",C=g==="y"?"bottom":"right",L=N+p[k],j=N-p[C];N=y2(L,N,j)}const w=c.fn({...e,[b]:y,[g]:N});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[b]:a,[g]:o}}}}}},pO=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=e,{offset:c=0,mainAxis:f=!0,crossAxis:d=!0}=ml(t,e),p={x:n,y:r},g=fo(i),b=ky(g);let y=p[b],N=p[g];const w=ml(c,e),k=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const j=b==="y"?"height":"width",z=a.reference[b]-a.floating[j]+k.mainAxis,O=a.reference[b]+a.reference[j]-k.mainAxis;y<z?y=z:y>O&&(y=O)}if(d){var C,L;const j=b==="y"?"width":"height",z=["top","left"].includes(gl(i)),O=a.reference[g]-a.floating[j]+(z&&((C=o.offset)==null?void 0:C[g])||0)+(z?0:k.crossAxis),K=a.reference[g]+a.reference[j]+(z?0:((L=o.offset)==null?void 0:L[g])||0)-(z?k.crossAxis:0);N<O?N=O:N>K&&(N=K)}return{[b]:y,[g]:N}}}},mO=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:a,platform:o,elements:c}=e,{apply:f=()=>{},...d}=ml(t,e),p=await Fh(e,d),g=gl(i),b=sd(i),y=fo(i)==="y",{width:N,height:w}=a.floating;let k,C;g==="top"||g==="bottom"?(k=g,C=b===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(C=g,k=b==="end"?"top":"bottom");const L=w-p.top-p.bottom,j=N-p.left-p.right,z=Sc(w-p[k],L),O=Sc(N-p[C],j),K=!e.middlewareData.shift;let q=z,H=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(H=j),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(q=L),K&&!b){const le=ya(p.left,0),P=ya(p.right,0),I=ya(p.top,0),ne=ya(p.bottom,0);y?H=N-2*(le!==0||P!==0?le+P:ya(p.left,p.right)):q=w-2*(I!==0||ne!==0?I+ne:ya(p.top,p.bottom))}await f({...e,availableWidth:H,availableHeight:q});const se=await o.getDimensions(c.floating);return N!==se.width||w!==se.height?{reset:{rects:!0}}:{}}}};function Eg(){return typeof window<"u"}function od(t){return o4(t)?(t.nodeName||"").toLowerCase():"#document"}function xa(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function wo(t){var e;return(e=(o4(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function o4(t){return Eg()?t instanceof Node||t instanceof xa(t).Node:!1}function ms(t){return Eg()?t instanceof Element||t instanceof xa(t).Element:!1}function bo(t){return Eg()?t instanceof HTMLElement||t instanceof xa(t).HTMLElement:!1}function ew(t){return!Eg()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof xa(t).ShadowRoot}function Xh(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=gs(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function gO(t){return["table","td","th"].includes(od(t))}function Dg(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Ey(t){const e=Dy(),n=ms(t)?gs(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function yO(t){let e=_c(t);for(;bo(e)&&!Zf(e);){if(Ey(e))return e;if(Dg(e))return null;e=_c(e)}return null}function Dy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zf(t){return["html","body","#document"].includes(od(t))}function gs(t){return xa(t).getComputedStyle(t)}function jg(t){return ms(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function _c(t){if(od(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ew(t)&&t.host||wo(t);return ew(e)?e.host:e}function l4(t){const e=_c(t);return Zf(e)?t.ownerDocument?t.ownerDocument.body:t.body:bo(e)&&Xh(e)?e:l4(e)}function Ih(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=l4(t),a=i===((r=t.ownerDocument)==null?void 0:r.body),o=xa(i);if(a){const c=b2(o);return e.concat(o,o.visualViewport||[],Xh(i)?i:[],c&&n?Ih(c):[])}return e.concat(i,Ih(i,[],n))}function b2(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function c4(t){const e=gs(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=bo(t),a=i?t.offsetWidth:n,o=i?t.offsetHeight:r,c=rg(n)!==a||rg(r)!==o;return c&&(n=a,r=o),{width:n,height:r,$:c}}function jy(t){return ms(t)?t:t.contextElement}function zf(t){const e=jy(t);if(!bo(e))return mo(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:a}=c4(e);let o=(a?rg(n.width):n.width)/r,c=(a?rg(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const vO=mo(0);function u4(t){const e=xa(t);return!Dy()||!e.visualViewport?vO:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function bO(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==xa(t)?!1:e}function Du(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),a=jy(t);let o=mo(1);e&&(r?ms(r)&&(o=zf(r)):o=zf(t));const c=bO(a,n,r)?u4(a):mo(0);let f=(i.left+c.x)/o.x,d=(i.top+c.y)/o.y,p=i.width/o.x,g=i.height/o.y;if(a){const b=xa(a),y=r&&ms(r)?xa(r):r;let N=b,w=b2(N);for(;w&&r&&y!==N;){const k=zf(w),C=w.getBoundingClientRect(),L=gs(w),j=C.left+(w.clientLeft+parseFloat(L.paddingLeft))*k.x,z=C.top+(w.clientTop+parseFloat(L.paddingTop))*k.y;f*=k.x,d*=k.y,p*=k.x,g*=k.y,f+=j,d+=z,N=xa(w),w=b2(N)}}return ag({width:p,height:g,x:f,y:d})}function Oy(t,e){const n=jg(t).scrollLeft;return e?e.left+n:Du(wo(t)).left+n}function f4(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:Oy(t,r)),a=r.top+e.scrollTop;return{x:i,y:a}}function xO(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const a=i==="fixed",o=wo(r),c=e?Dg(e.floating):!1;if(r===o||c&&a)return n;let f={scrollLeft:0,scrollTop:0},d=mo(1);const p=mo(0),g=bo(r);if((g||!g&&!a)&&((od(r)!=="body"||Xh(o))&&(f=jg(r)),bo(r))){const y=Du(r);d=zf(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const b=o&&!g&&!a?f4(o,f,!0):mo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+p.x+b.x,y:n.y*d.y-f.scrollTop*d.y+p.y+b.y}}function wO(t){return Array.from(t.getClientRects())}function SO(t){const e=wo(t),n=jg(t),r=t.ownerDocument.body,i=ya(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=ya(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Oy(t);const c=-n.scrollTop;return gs(r).direction==="rtl"&&(o+=ya(e.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:c}}function _O(t,e){const n=xa(t),r=wo(t),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,c=0,f=0;if(i){a=i.width,o=i.height;const d=Dy();(!d||d&&e==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}return{width:a,height:o,x:c,y:f}}function NO(t,e){const n=Du(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,a=bo(t)?zf(t):mo(1),o=t.clientWidth*a.x,c=t.clientHeight*a.y,f=i*a.x,d=r*a.y;return{width:o,height:c,x:f,y:d}}function tw(t,e,n){let r;if(e==="viewport")r=_O(t,n);else if(e==="document")r=SO(wo(t));else if(ms(e))r=NO(e,n);else{const i=u4(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ag(r)}function d4(t,e){const n=_c(t);return n===e||!ms(n)||Zf(n)?!1:gs(n).position==="fixed"||d4(n,e)}function AO(t,e){const n=e.get(t);if(n)return n;let r=Ih(t,[],!1).filter(c=>ms(c)&&od(c)!=="body"),i=null;const a=gs(t).position==="fixed";let o=a?_c(t):t;for(;ms(o)&&!Zf(o);){const c=gs(o),f=Ey(o);!f&&c.position==="fixed"&&(i=null),(a?!f&&!i:!f&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Xh(o)&&!f&&d4(t,o))?r=r.filter(p=>p!==o):i=c,o=_c(o)}return e.set(t,r),r}function CO(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?Dg(e)?[]:AO(e,this._c):[].concat(n),r],c=o[0],f=o.reduce((d,p)=>{const g=tw(e,p,i);return d.top=ya(g.top,d.top),d.right=Sc(g.right,d.right),d.bottom=Sc(g.bottom,d.bottom),d.left=ya(g.left,d.left),d},tw(e,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function kO(t){const{width:e,height:n}=c4(t);return{width:e,height:n}}function MO(t,e,n){const r=bo(e),i=wo(e),a=n==="fixed",o=Du(t,!0,a,e);let c={scrollLeft:0,scrollTop:0};const f=mo(0);function d(){f.x=Oy(i)}if(r||!r&&!a)if((od(e)!=="body"||Xh(i))&&(c=jg(e)),r){const y=Du(e,!0,a,e);f.x=y.x+e.clientLeft,f.y=y.y+e.clientTop}else i&&d();a&&!r&&i&&d();const p=i&&!r&&!a?f4(i,c):mo(0),g=o.left+c.scrollLeft-f.x-p.x,b=o.top+c.scrollTop-f.y-p.y;return{x:g,y:b,width:o.width,height:o.height}}function C1(t){return gs(t).position==="static"}function nw(t,e){if(!bo(t)||gs(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return wo(t)===n&&(n=n.ownerDocument.body),n}function h4(t,e){const n=xa(t);if(Dg(t))return n;if(!bo(t)){let i=_c(t);for(;i&&!Zf(i);){if(ms(i)&&!C1(i))return i;i=_c(i)}return n}let r=nw(t,e);for(;r&&gO(r)&&C1(r);)r=nw(r,e);return r&&Zf(r)&&C1(r)&&!Ey(r)?n:r||yO(t)||n}const LO=async function(t){const e=this.getOffsetParent||h4,n=this.getDimensions,r=await n(t.floating);return{reference:MO(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function EO(t){return gs(t).direction==="rtl"}const DO={convertOffsetParentRelativeRectToViewportRelativeRect:xO,getDocumentElement:wo,getClippingRect:CO,getOffsetParent:h4,getElementRects:LO,getClientRects:wO,getDimensions:kO,getScale:zf,isElement:ms,isRTL:EO};function p4(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function jO(t,e){let n=null,r;const i=wo(t);function a(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function o(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),a();const d=t.getBoundingClientRect(),{left:p,top:g,width:b,height:y}=d;if(c||e(),!b||!y)return;const N=mm(g),w=mm(i.clientWidth-(p+b)),k=mm(i.clientHeight-(g+y)),C=mm(p),j={rootMargin:-N+"px "+-w+"px "+-k+"px "+-C+"px",threshold:ya(0,Sc(1,f))||1};let z=!0;function O(K){const q=K[0].intersectionRatio;if(q!==f){if(!z)return o();q?o(!1,q):r=setTimeout(()=>{o(!1,1e-7)},1e3)}q===1&&!p4(d,t.getBoundingClientRect())&&o(),z=!1}try{n=new IntersectionObserver(O,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,j)}n.observe(t)}return o(!0),a}function OO(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=jy(t),p=i||a?[...d?Ih(d):[],...Ih(e)]:[];p.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),a&&C.addEventListener("resize",n)});const g=d&&c?jO(d,n):null;let b=-1,y=null;o&&(y=new ResizeObserver(C=>{let[L]=C;L&&L.target===d&&y&&(y.unobserve(e),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(e)})),n()}),d&&!f&&y.observe(d),y.observe(e));let N,w=f?Du(t):null;f&&k();function k(){const C=Du(t);w&&!p4(w,C)&&n(),w=C,N=requestAnimationFrame(k)}return n(),()=>{var C;p.forEach(L=>{i&&L.removeEventListener("scroll",n),a&&L.removeEventListener("resize",n)}),g?.(),(C=y)==null||C.disconnect(),y=null,f&&cancelAnimationFrame(N)}}const TO=dO,RO=hO,PO=cO,BO=mO,FO=uO,rw=lO,IO=pO,zO=(t,e,n)=>{const r=new Map,i={platform:DO,...n},a={...i.platform,_c:r};return oO(t,e,{...i,platform:a})};var HO=typeof document<"u",UO=function(){},Rm=HO?E.useLayoutEffect:UO;function sg(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!sg(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&t.$$typeof)&&!sg(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function m4(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function iw(t,e){const n=m4(t);return Math.round(e*n)/n}function k1(t){const e=E.useRef(t);return Rm(()=>{e.current=t}),e}function qO(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:c=!0,whileElementsMounted:f,open:d}=t,[p,g]=E.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[b,y]=E.useState(r);sg(b,r)||y(r);const[N,w]=E.useState(null),[k,C]=E.useState(null),L=E.useCallback(G=>{G!==K.current&&(K.current=G,w(G))},[]),j=E.useCallback(G=>{G!==q.current&&(q.current=G,C(G))},[]),z=a||N,O=o||k,K=E.useRef(null),q=E.useRef(null),H=E.useRef(p),se=f!=null,le=k1(f),P=k1(i),I=k1(d),ne=E.useCallback(()=>{if(!K.current||!q.current)return;const G={placement:e,strategy:n,middleware:b};P.current&&(G.platform=P.current),zO(K.current,q.current,G).then(me=>{const W={...me,isPositioned:I.current!==!1};te.current&&!sg(H.current,W)&&(H.current=W,qh.flushSync(()=>{g(W)}))})},[b,e,n,P,I]);Rm(()=>{d===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,g(G=>({...G,isPositioned:!1})))},[d]);const te=E.useRef(!1);Rm(()=>(te.current=!0,()=>{te.current=!1}),[]),Rm(()=>{if(z&&(K.current=z),O&&(q.current=O),z&&O){if(le.current)return le.current(z,O,ne);ne()}},[z,O,ne,le,se]);const de=E.useMemo(()=>({reference:K,floating:q,setReference:L,setFloating:j}),[L,j]),X=E.useMemo(()=>({reference:z,floating:O}),[z,O]),J=E.useMemo(()=>{const G={position:n,left:0,top:0};if(!X.floating)return G;const me=iw(X.floating,p.x),W=iw(X.floating,p.y);return c?{...G,transform:"translate("+me+"px, "+W+"px)",...m4(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:me,top:W}},[n,c,X.floating,p.x,p.y]);return E.useMemo(()=>({...p,update:ne,refs:de,elements:X,floatingStyles:J}),[p,ne,de,X,J])}const WO=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?rw({element:r.current,padding:i}).fn(n):{}:r?rw({element:r,padding:i}).fn(n):{}}}},YO=(t,e)=>({...TO(t),options:[t,e]}),VO=(t,e)=>({...RO(t),options:[t,e]}),GO=(t,e)=>({...IO(t),options:[t,e]}),$O=(t,e)=>({...PO(t),options:[t,e]}),XO=(t,e)=>({...BO(t),options:[t,e]}),ZO=(t,e)=>({...FO(t),options:[t,e]}),KO=(t,e)=>({...WO(t),options:[t,e]});var QO="Arrow",g4=E.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...a}=t;return S.jsx(xn.svg,{...a,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});g4.displayName=QO;var JO=g4;function eT(t){const[e,n]=E.useState(void 0);return Si(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,c;if("borderBoxSize"in a){const f=a.borderBoxSize,d=Array.isArray(f)?f[0]:f;o=d.inlineSize,c=d.blockSize}else o=t.offsetWidth,c=t.offsetHeight;n({width:o,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Ty="Popper",[y4,Og]=$h(Ty),[tT,v4]=y4(Ty),b4=t=>{const{__scopePopper:e,children:n}=t,[r,i]=E.useState(null);return S.jsx(tT,{scope:e,anchor:r,onAnchorChange:i,children:n})};b4.displayName=Ty;var x4="PopperAnchor",w4=E.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,a=v4(x4,n),o=E.useRef(null),c=cr(e,o);return E.useEffect(()=>{a.onAnchorChange(r?.current||o.current)}),r?null:S.jsx(xn.div,{...i,ref:c})});w4.displayName=x4;var Ry="PopperContent",[nT,rT]=y4(Ry),S4=E.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:f=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:y="optimized",onPlaced:N,...w}=t,k=v4(Ry,n),[C,L]=E.useState(null),j=cr(e,he=>L(he)),[z,O]=E.useState(null),K=eT(z),q=K?.width??0,H=K?.height??0,se=r+(a!=="center"?"-"+a:""),le=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},P=Array.isArray(d)?d:[d],I=P.length>0,ne={padding:le,boundary:P.filter(aT),altBoundary:I},{refs:te,floatingStyles:de,placement:X,isPositioned:J,middlewareData:G}=qO({strategy:"fixed",placement:se,whileElementsMounted:(...he)=>OO(...he,{animationFrame:y==="always"}),elements:{reference:k.anchor},middleware:[YO({mainAxis:i+H,alignmentAxis:o}),f&&VO({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?GO():void 0,...ne}),f&&$O({...ne}),XO({...ne,apply:({elements:he,rects:we,availableWidth:Se,availableHeight:Ve})=>{const{width:He,height:Je}=we.reference,it=he.floating.style;it.setProperty("--radix-popper-available-width",`${Se}px`),it.setProperty("--radix-popper-available-height",`${Ve}px`),it.setProperty("--radix-popper-anchor-width",`${He}px`),it.setProperty("--radix-popper-anchor-height",`${Je}px`)}}),z&&KO({element:z,padding:c}),sT({arrowWidth:q,arrowHeight:H}),b&&ZO({strategy:"referenceHidden",...ne})]}),[me,W]=A4(X),xe=Eu(N);Si(()=>{J&&xe?.()},[J,xe]);const R=G.arrow?.x,V=G.arrow?.y,Q=G.arrow?.centerOffset!==0,[ae,ce]=E.useState();return Si(()=>{C&&ce(window.getComputedStyle(C).zIndex)},[C]),S.jsx("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...de,transform:J?de.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[G.transformOrigin?.x,G.transformOrigin?.y].join(" "),...G.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:S.jsx(nT,{scope:n,placedSide:me,onArrowChange:O,arrowX:R,arrowY:V,shouldHideArrow:Q,children:S.jsx(xn.div,{"data-side":me,"data-align":W,...w,ref:j,style:{...w.style,animation:J?void 0:"none"}})})})});S4.displayName=Ry;var _4="PopperArrow",iT={top:"bottom",right:"left",bottom:"top",left:"right"},N4=E.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,a=rT(_4,r),o=iT[a.placedSide];return S.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:S.jsx(JO,{...i,ref:n,style:{...i.style,display:"block"}})})});N4.displayName=_4;function aT(t){return t!==null}var sT=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:i}=e,o=i.arrow?.centerOffset!==0,c=o?0:t.arrowWidth,f=o?0:t.arrowHeight,[d,p]=A4(n),g={start:"0%",center:"50%",end:"100%"}[p],b=(i.arrow?.x??0)+c/2,y=(i.arrow?.y??0)+f/2;let N="",w="";return d==="bottom"?(N=o?g:`${b}px`,w=`${-f}px`):d==="top"?(N=o?g:`${b}px`,w=`${r.floating.height+f}px`):d==="right"?(N=`${-f}px`,w=o?g:`${y}px`):d==="left"&&(N=`${r.floating.width+f}px`,w=o?g:`${y}px`),{data:{x:N,y:w}}}});function A4(t){const[e,n="center"]=t.split("-");return[e,n]}var C4=b4,Py=w4,k4=S4,M4=N4,oT="Portal",Tg=E.forwardRef((t,e)=>{const{container:n,...r}=t,[i,a]=E.useState(!1);Si(()=>a(!0),[]);const o=n||i&&globalThis?.document?.body;return o?PC.createPortal(S.jsx(xn.div,{...r,ref:e}),o):null});Tg.displayName=oT;var lT=Vw[" useInsertionEffect ".trim().toString()]||Si;function x2({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,a,o]=cT({defaultProp:e,onChange:n}),c=t!==void 0,f=c?t:i;{const p=E.useRef(t!==void 0);E.useEffect(()=>{const g=p.current;g!==c&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${c?"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.`),p.current=c},[c,r])}const d=E.useCallback(p=>{if(c){const g=uT(p)?p(t):p;g!==t&&o.current?.(g)}else a(p)},[c,t,a,o]);return[f,d]}function cT({defaultProp:t,onChange:e}){const[n,r]=E.useState(t),i=E.useRef(n),a=E.useRef(e);return lT(()=>{a.current=e},[e]),E.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function uT(t){return typeof t=="function"}function fT(t){const e=E.useRef({value:t,previous:t});return E.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var L4=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"}),dT="VisuallyHidden",hT=E.forwardRef((t,e)=>S.jsx(xn.span,{...t,ref:e,style:{...L4,...t.style}}));hT.displayName=dT;var pT=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ef=new WeakMap,gm=new WeakMap,ym={},M1=0,E4=function(t){return t&&(t.host||E4(t.parentNode))},mT=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=E4(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},gT=function(t,e,n,r){var i=mT(e,Array.isArray(t)?t:[t]);ym[n]||(ym[n]=new WeakMap);var a=ym[n],o=[],c=new Set,f=new Set(i),d=function(g){!g||c.has(g)||(c.add(g),d(g.parentNode))};i.forEach(d);var p=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(b){if(c.has(b))p(b);else try{var y=b.getAttribute(r),N=y!==null&&y!=="false",w=(Ef.get(b)||0)+1,k=(a.get(b)||0)+1;Ef.set(b,w),a.set(b,k),o.push(b),w===1&&N&&gm.set(b,!0),k===1&&b.setAttribute(n,"true"),N||b.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return p(e),c.clear(),M1++,function(){o.forEach(function(g){var b=Ef.get(g)-1,y=a.get(g)-1;Ef.set(g,b),a.set(g,y),b||(gm.has(g)||g.removeAttribute(r),gm.delete(g)),y||g.removeAttribute(n)}),M1--,M1||(Ef=new WeakMap,Ef=new WeakMap,gm=new WeakMap,ym={})}},By=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=pT(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),gT(r,i,n,"aria-hidden")):function(){return null}},uo=function(){return uo=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},uo.apply(this,arguments)};function D4(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function yT(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}var Pm="right-scroll-bar-position",Bm="width-before-scroll-bar",vT="with-scroll-bars-hidden",bT="--removed-body-scroll-bar-size";function L1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function xT(t,e){var n=E.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var wT=typeof window<"u"?E.useLayoutEffect:E.useEffect,aw=new WeakMap;function ST(t,e){var n=xT(null,function(r){return t.forEach(function(i){return L1(i,r)})});return wT(function(){var r=aw.get(n);if(r){var i=new Set(r),a=new Set(t),o=n.current;i.forEach(function(c){a.has(c)||L1(c,null)}),a.forEach(function(c){i.has(c)||L1(c,o)})}aw.set(n,t)},[t]),n}function _T(t){return t}function NT(t,e){e===void 0&&(e=_T);var n=[],r=!1,i={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]:t},useMedium:function(a){var o=e(a,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(a),o=n}var f=function(){var p=o;o=[],p.forEach(a)},d=function(){return Promise.resolve().then(f)};d(),n={push:function(p){o.push(p),d()},filter:function(p){return o=o.filter(p),n}}}};return i}function AT(t){t===void 0&&(t={});var e=NT(null);return e.options=uo({async:!0,ssr:!1},t),e}var j4=function(t){var e=t.sideCar,n=D4(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return E.createElement(r,uo({},n))};j4.isSideCarExport=!0;function CT(t,e){return t.useMedium(e),j4}var O4=AT(),E1=function(){},Rg=E.forwardRef(function(t,e){var n=E.useRef(null),r=E.useState({onScrollCapture:E1,onWheelCapture:E1,onTouchMoveCapture:E1}),i=r[0],a=r[1],o=t.forwardProps,c=t.children,f=t.className,d=t.removeScrollBar,p=t.enabled,g=t.shards,b=t.sideCar,y=t.noRelative,N=t.noIsolation,w=t.inert,k=t.allowPinchZoom,C=t.as,L=C===void 0?"div":C,j=t.gapMode,z=D4(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=b,K=ST([n,e]),q=uo(uo({},z),i);return E.createElement(E.Fragment,null,p&&E.createElement(O,{sideCar:O4,removeScrollBar:d,shards:g,noRelative:y,noIsolation:N,inert:w,setCallbacks:a,allowPinchZoom:!!k,lockRef:n,gapMode:j}),o?E.cloneElement(E.Children.only(c),uo(uo({},q),{ref:K})):E.createElement(L,uo({},q,{className:f,ref:K}),c))});Rg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Rg.classNames={fullWidth:Bm,zeroRight:Pm};var kT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function MT(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=kT();return e&&t.setAttribute("nonce",e),t}function LT(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function ET(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var DT=function(){var t=0,e=null;return{add:function(n){t==0&&(e=MT())&&(LT(e,n),ET(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},jT=function(){var t=DT();return function(e,n){E.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},T4=function(){var t=jT(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},OT={left:0,top:0,right:0,gap:0},D1=function(t){return parseInt(t||"",10)||0},TT=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[D1(n),D1(r),D1(i)]},RT=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return OT;var e=TT(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},PT=T4(),Hf="data-scroll-locked",BT=function(t,e,n,r){var i=t.left,a=t.top,o=t.right,c=t.gap;return n===void 0&&(n="margin"),`
  .`.concat(vT,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(c,"px ").concat(r,`;
  }
  body[`).concat(Hf,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(a,`px;
    padding-right: `).concat(o,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(c,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(Pm,` {
    right: `).concat(c,"px ").concat(r,`;
  }
  
  .`).concat(Bm,` {
    margin-right: `).concat(c,"px ").concat(r,`;
  }
  
  .`).concat(Pm," .").concat(Pm,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(Bm," .").concat(Bm,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Hf,`] {
    `).concat(bT,": ").concat(c,`px;
  }
`)},sw=function(){var t=parseInt(document.body.getAttribute(Hf)||"0",10);return isFinite(t)?t:0},FT=function(){E.useEffect(function(){return document.body.setAttribute(Hf,(sw()+1).toString()),function(){var t=sw()-1;t<=0?document.body.removeAttribute(Hf):document.body.setAttribute(Hf,t.toString())}},[])},IT=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;FT();var a=E.useMemo(function(){return RT(i)},[i]);return E.createElement(PT,{styles:BT(a,!e,i,n?"":"!important")})},w2=!1;if(typeof window<"u")try{var vm=Object.defineProperty({},"passive",{get:function(){return w2=!0,!0}});window.addEventListener("test",vm,vm),window.removeEventListener("test",vm,vm)}catch{w2=!1}var Df=w2?{passive:!1}:!1,zT=function(t){return t.tagName==="TEXTAREA"},R4=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!zT(t)&&n[e]==="visible")},HT=function(t){return R4(t,"overflowY")},UT=function(t){return R4(t,"overflowX")},ow=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=P4(t,r);if(i){var a=B4(t,r),o=a[1],c=a[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qT=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},WT=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},P4=function(t,e){return t==="v"?HT(e):UT(e)},B4=function(t,e){return t==="v"?qT(e):WT(e)},YT=function(t,e){return t==="h"&&e==="rtl"?-1:1},VT=function(t,e,n,r,i){var a=YT(t,window.getComputedStyle(e).direction),o=a*r,c=n.target,f=e.contains(c),d=!1,p=o>0,g=0,b=0;do{if(!c)break;var y=B4(t,c),N=y[0],w=y[1],k=y[2],C=w-k-a*N;(N||C)&&P4(t,c)&&(g+=C,b+=N);var L=c.parentNode;c=L&&L.nodeType===Node.DOCUMENT_FRAGMENT_NODE?L.host:L}while(!f&&c!==document.body||f&&(e.contains(c)||e===c));return(p&&Math.abs(g)<1||!p&&Math.abs(b)<1)&&(d=!0),d},bm=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},lw=function(t){return[t.deltaX,t.deltaY]},cw=function(t){return t&&"current"in t?t.current:t},GT=function(t,e){return t[0]===e[0]&&t[1]===e[1]},$T=function(t){return`
  .block-interactivity-`.concat(t,` {pointer-events: none;}
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},XT=0,jf=[];function ZT(t){var e=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(XT++)[0],a=E.useState(T4)[0],o=E.useRef(t);E.useEffect(function(){o.current=t},[t]),E.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var w=yT([t.lockRef.current],(t.shards||[]).map(cw),!0).filter(Boolean);return w.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var c=E.useCallback(function(w,k){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var C=bm(w),L=n.current,j="deltaX"in w?w.deltaX:L[0]-C[0],z="deltaY"in w?w.deltaY:L[1]-C[1],O,K=w.target,q=Math.abs(j)>Math.abs(z)?"h":"v";if("touches"in w&&q==="h"&&K.type==="range")return!1;var H=ow(q,K);if(!H)return!0;if(H?O=q:(O=q==="v"?"h":"v",H=ow(q,K)),!H)return!1;if(!r.current&&"changedTouches"in w&&(j||z)&&(r.current=O),!O)return!0;var se=r.current||O;return VT(se,k,w,se==="h"?j:z)},[]),f=E.useCallback(function(w){var k=w;if(!(!jf.length||jf[jf.length-1]!==a)){var C="deltaY"in k?lw(k):bm(k),L=e.current.filter(function(O){return O.name===k.type&&(O.target===k.target||k.target===O.shadowParent)&&GT(O.delta,C)})[0];if(L&&L.should){k.cancelable&&k.preventDefault();return}if(!L){var j=(o.current.shards||[]).map(cw).filter(Boolean).filter(function(O){return O.contains(k.target)}),z=j.length>0?c(k,j[0]):!o.current.noIsolation;z&&k.cancelable&&k.preventDefault()}}},[]),d=E.useCallback(function(w,k,C,L){var j={name:w,delta:k,target:C,should:L,shadowParent:KT(C)};e.current.push(j),setTimeout(function(){e.current=e.current.filter(function(z){return z!==j})},1)},[]),p=E.useCallback(function(w){n.current=bm(w),r.current=void 0},[]),g=E.useCallback(function(w){d(w.type,lw(w),w.target,c(w,t.lockRef.current))},[]),b=E.useCallback(function(w){d(w.type,bm(w),w.target,c(w,t.lockRef.current))},[]);E.useEffect(function(){return jf.push(a),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",f,Df),document.addEventListener("touchmove",f,Df),document.addEventListener("touchstart",p,Df),function(){jf=jf.filter(function(w){return w!==a}),document.removeEventListener("wheel",f,Df),document.removeEventListener("touchmove",f,Df),document.removeEventListener("touchstart",p,Df)}},[]);var y=t.removeScrollBar,N=t.inert;return E.createElement(E.Fragment,null,N?E.createElement(a,{styles:$T(i)}):null,y?E.createElement(IT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function KT(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const QT=CT(O4,ZT);var Pg=E.forwardRef(function(t,e){return E.createElement(Rg,uo({},t,{ref:e,sideCar:QT}))});Pg.classNames=Rg.classNames;var JT=[" ","Enter","ArrowUp","ArrowDown"],eR=[" ","Enter"],ju="Select",[Bg,Fg,tR]=Oj(ju),[ld,UI]=$h(ju,[tR,Og]),Ig=Og(),[nR,Cc]=ld(ju),[rR,iR]=ld(ju),F4=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:f,dir:d,name:p,autoComplete:g,disabled:b,required:y,form:N}=t,w=Ig(e),[k,C]=E.useState(null),[L,j]=E.useState(null),[z,O]=E.useState(!1),K=Rj(d),[q,H]=x2({prop:r,defaultProp:i??!1,onChange:a,caller:ju}),[se,le]=x2({prop:o,defaultProp:c,onChange:f,caller:ju}),P=E.useRef(null),I=k?N||!!k.closest("form"):!0,[ne,te]=E.useState(new Set),de=Array.from(ne).map(X=>X.props.value).join(";");return S.jsx(C4,{...w,children:S.jsxs(nR,{required:y,scope:e,trigger:k,onTriggerChange:C,valueNode:L,onValueNodeChange:j,valueNodeHasChildren:z,onValueNodeHasChildrenChange:O,contentId:Lg(),value:se,onValueChange:le,open:q,onOpenChange:H,dir:K,triggerPointerDownPosRef:P,disabled:b,children:[S.jsx(Bg.Provider,{scope:e,children:S.jsx(rR,{scope:t.__scopeSelect,onNativeOptionAdd:E.useCallback(X=>{te(J=>new Set(J).add(X))},[]),onNativeOptionRemove:E.useCallback(X=>{te(J=>{const G=new Set(J);return G.delete(X),G})},[]),children:n})}),I?S.jsxs(l_,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:g,value:se,onChange:X=>le(X.target.value),disabled:b,form:N,children:[se===void 0?S.jsx("option",{value:""}):null,Array.from(ne)]},de):null]})})};F4.displayName=ju;var I4="SelectTrigger",z4=E.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,a=Ig(n),o=Cc(I4,n),c=o.disabled||r,f=cr(e,o.onTriggerChange),d=Fg(n),p=E.useRef("touch"),[g,b,y]=u_(w=>{const k=d().filter(j=>!j.disabled),C=k.find(j=>j.value===o.value),L=f_(k,w,C);L!==void 0&&o.onValueChange(L.value)}),N=w=>{c||(o.onOpenChange(!0),y()),w&&(o.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return S.jsx(Py,{asChild:!0,...a,children:S.jsx(xn.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:c,"data-disabled":c?"":void 0,"data-placeholder":c_(o.value)?"":void 0,...i,ref:f,onClick:vn(i.onClick,w=>{w.currentTarget.focus(),p.current!=="mouse"&&N(w)}),onPointerDown:vn(i.onPointerDown,w=>{p.current=w.pointerType;const k=w.target;k.hasPointerCapture(w.pointerId)&&k.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(N(w),w.preventDefault())}),onKeyDown:vn(i.onKeyDown,w=>{const k=g.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&b(w.key),!(k&&w.key===" ")&&JT.includes(w.key)&&(N(),w.preventDefault())})})})});z4.displayName=I4;var H4="SelectValue",U4=E.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...c}=t,f=Cc(H4,n),{onValueNodeHasChildrenChange:d}=f,p=a!==void 0,g=cr(e,f.onValueNodeChange);return Si(()=>{d(p)},[d,p]),S.jsx(xn.span,{...c,ref:g,style:{pointerEvents:"none"},children:c_(f.value)?S.jsx(S.Fragment,{children:o}):a})});U4.displayName=H4;var aR="SelectIcon",q4=E.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return S.jsx(xn.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});q4.displayName=aR;var sR="SelectPortal",W4=t=>S.jsx(Tg,{asChild:!0,...t});W4.displayName=sR;var Ou="SelectContent",Y4=E.forwardRef((t,e)=>{const n=Cc(Ou,t.__scopeSelect),[r,i]=E.useState();if(Si(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?qh.createPortal(S.jsx(V4,{scope:t.__scopeSelect,children:S.jsx(Bg.Slot,{scope:t.__scopeSelect,children:S.jsx("div",{children:t.children})})}),a):null}return S.jsx(G4,{...t,ref:e})});Y4.displayName=Ou;var ds=10,[V4,kc]=ld(Ou),oR="SelectContentImpl",lR=Mu("SelectContent.RemoveScroll"),G4=E.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:c,sideOffset:f,align:d,alignOffset:p,arrowPadding:g,collisionBoundary:b,collisionPadding:y,sticky:N,hideWhenDetached:w,avoidCollisions:k,...C}=t,L=Cc(Ou,n),[j,z]=E.useState(null),[O,K]=E.useState(null),q=cr(e,he=>z(he)),[H,se]=E.useState(null),[le,P]=E.useState(null),I=Fg(n),[ne,te]=E.useState(!1),de=E.useRef(!1);E.useEffect(()=>{if(j)return By(j)},[j]),Cy();const X=E.useCallback(he=>{const[we,...Se]=I().map(Je=>Je.ref.current),[Ve]=Se.slice(-1),He=document.activeElement;for(const Je of he)if(Je===He||(Je?.scrollIntoView({block:"nearest"}),Je===we&&O&&(O.scrollTop=0),Je===Ve&&O&&(O.scrollTop=O.scrollHeight),Je?.focus(),document.activeElement!==He))return},[I,O]),J=E.useCallback(()=>X([H,j]),[X,H,j]);E.useEffect(()=>{ne&&J()},[ne,J]);const{onOpenChange:G,triggerPointerDownPosRef:me}=L;E.useEffect(()=>{if(j){let he={x:0,y:0};const we=Ve=>{he={x:Math.abs(Math.round(Ve.pageX)-(me.current?.x??0)),y:Math.abs(Math.round(Ve.pageY)-(me.current?.y??0))}},Se=Ve=>{he.x<=10&&he.y<=10?Ve.preventDefault():j.contains(Ve.target)||G(!1),document.removeEventListener("pointermove",we),me.current=null};return me.current!==null&&(document.addEventListener("pointermove",we),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",Se,{capture:!0})}}},[j,G,me]),E.useEffect(()=>{const he=()=>G(!1);return window.addEventListener("blur",he),window.addEventListener("resize",he),()=>{window.removeEventListener("blur",he),window.removeEventListener("resize",he)}},[G]);const[W,xe]=u_(he=>{const we=I().filter(He=>!He.disabled),Se=we.find(He=>He.ref.current===document.activeElement),Ve=f_(we,he,Se);Ve&&setTimeout(()=>Ve.ref.current.focus())}),R=E.useCallback((he,we,Se)=>{const Ve=!de.current&&!Se;(L.value!==void 0&&L.value===we||Ve)&&(se(he),Ve&&(de.current=!0))},[L.value]),V=E.useCallback(()=>j?.focus(),[j]),Q=E.useCallback((he,we,Se)=>{const Ve=!de.current&&!Se;(L.value!==void 0&&L.value===we||Ve)&&P(he)},[L.value]),ae=r==="popper"?S2:$4,ce=ae===S2?{side:c,sideOffset:f,align:d,alignOffset:p,arrowPadding:g,collisionBoundary:b,collisionPadding:y,sticky:N,hideWhenDetached:w,avoidCollisions:k}:{};return S.jsx(V4,{scope:n,content:j,viewport:O,onViewportChange:K,itemRefCallback:R,selectedItem:H,onItemLeave:V,itemTextRefCallback:Q,focusSelectedItem:J,selectedItemText:le,position:r,isPositioned:ne,searchRef:W,children:S.jsx(Pg,{as:lR,allowPinchZoom:!0,children:S.jsx(Mg,{asChild:!0,trapped:L.open,onMountAutoFocus:he=>{he.preventDefault()},onUnmountAutoFocus:vn(i,he=>{L.trigger?.focus({preventScroll:!0}),he.preventDefault()}),children:S.jsx(kg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:he=>he.preventDefault(),onDismiss:()=>L.onOpenChange(!1),children:S.jsx(ae,{role:"listbox",id:L.contentId,"data-state":L.open?"open":"closed",dir:L.dir,onContextMenu:he=>he.preventDefault(),...C,...ce,onPlaced:()=>te(!0),ref:q,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:vn(C.onKeyDown,he=>{const we=he.ctrlKey||he.altKey||he.metaKey;if(he.key==="Tab"&&he.preventDefault(),!we&&he.key.length===1&&xe(he.key),["ArrowUp","ArrowDown","Home","End"].includes(he.key)){let Ve=I().filter(He=>!He.disabled).map(He=>He.ref.current);if(["ArrowUp","End"].includes(he.key)&&(Ve=Ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(he.key)){const He=he.target,Je=Ve.indexOf(He);Ve=Ve.slice(Je+1)}setTimeout(()=>X(Ve)),he.preventDefault()}})})})})})})});G4.displayName=oR;var cR="SelectItemAlignedPosition",$4=E.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,a=Cc(Ou,n),o=kc(Ou,n),[c,f]=E.useState(null),[d,p]=E.useState(null),g=cr(e,q=>p(q)),b=Fg(n),y=E.useRef(!1),N=E.useRef(!0),{viewport:w,selectedItem:k,selectedItemText:C,focusSelectedItem:L}=o,j=E.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&d&&w&&k&&C){const q=a.trigger.getBoundingClientRect(),H=d.getBoundingClientRect(),se=a.valueNode.getBoundingClientRect(),le=C.getBoundingClientRect();if(a.dir!=="rtl"){const He=le.left-H.left,Je=se.left-He,it=q.left-Je,dt=q.width+it,ze=Math.max(dt,H.width),ue=window.innerWidth-ds,pt=qx(Je,[ds,Math.max(ds,ue-ze)]);c.style.minWidth=dt+"px",c.style.left=pt+"px"}else{const He=H.right-le.right,Je=window.innerWidth-se.right-He,it=window.innerWidth-q.right-Je,dt=q.width+it,ze=Math.max(dt,H.width),ue=window.innerWidth-ds,pt=qx(Je,[ds,Math.max(ds,ue-ze)]);c.style.minWidth=dt+"px",c.style.right=pt+"px"}const P=b(),I=window.innerHeight-ds*2,ne=w.scrollHeight,te=window.getComputedStyle(d),de=parseInt(te.borderTopWidth,10),X=parseInt(te.paddingTop,10),J=parseInt(te.borderBottomWidth,10),G=parseInt(te.paddingBottom,10),me=de+X+ne+G+J,W=Math.min(k.offsetHeight*5,me),xe=window.getComputedStyle(w),R=parseInt(xe.paddingTop,10),V=parseInt(xe.paddingBottom,10),Q=q.top+q.height/2-ds,ae=I-Q,ce=k.offsetHeight/2,he=k.offsetTop+ce,we=de+X+he,Se=me-we;if(we<=Q){const He=P.length>0&&k===P[P.length-1].ref.current;c.style.bottom="0px";const Je=d.clientHeight-w.offsetTop-w.offsetHeight,it=Math.max(ae,ce+(He?V:0)+Je+J),dt=we+it;c.style.height=dt+"px"}else{const He=P.length>0&&k===P[0].ref.current;c.style.top="0px";const it=Math.max(Q,de+w.offsetTop+(He?R:0)+ce)+Se;c.style.height=it+"px",w.scrollTop=we-Q+w.offsetTop}c.style.margin=`${ds}px 0`,c.style.minHeight=W+"px",c.style.maxHeight=I+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[b,a.trigger,a.valueNode,c,d,w,k,C,a.dir,r]);Si(()=>j(),[j]);const[z,O]=E.useState();Si(()=>{d&&O(window.getComputedStyle(d).zIndex)},[d]);const K=E.useCallback(q=>{q&&N.current===!0&&(j(),L?.(),N.current=!1)},[j,L]);return S.jsx(fR,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:K,children:S.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:z},children:S.jsx(xn.div,{...i,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});$4.displayName=cR;var uR="SelectPopperPosition",S2=E.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ds,...a}=t,o=Ig(n);return S.jsx(k4,{...o,...a,ref:e,align:r,collisionPadding:i,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)"}})});S2.displayName=uR;var[fR,Fy]=ld(Ou,{}),_2="SelectViewport",X4=E.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,a=kc(_2,n),o=Fy(_2,n),c=cr(e,a.onViewportChange),f=E.useRef(0);return S.jsxs(S.Fragment,{children:[S.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}),S.jsx(Bg.Slot,{scope:n,children:S.jsx(xn.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:vn(i.onScroll,d=>{const p=d.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=o;if(b?.current&&g){const y=Math.abs(f.current-p.scrollTop);if(y>0){const N=window.innerHeight-ds*2,w=parseFloat(g.style.minHeight),k=parseFloat(g.style.height),C=Math.max(w,k);if(C<N){const L=C+y,j=Math.min(N,L),z=L-j;g.style.height=j+"px",g.style.bottom==="0px"&&(p.scrollTop=z>0?z:0,g.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});X4.displayName=_2;var Z4="SelectGroup",[dR,hR]=ld(Z4),pR=E.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Lg();return S.jsx(dR,{scope:n,id:i,children:S.jsx(xn.div,{role:"group","aria-labelledby":i,...r,ref:e})})});pR.displayName=Z4;var K4="SelectLabel",Q4=E.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=hR(K4,n);return S.jsx(xn.div,{id:i.id,...r,ref:e})});Q4.displayName=K4;var og="SelectItem",[mR,J4]=ld(og),e_=E.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=t,c=Cc(og,n),f=kc(og,n),d=c.value===r,[p,g]=E.useState(a??""),[b,y]=E.useState(!1),N=cr(e,L=>f.itemRefCallback?.(L,r,i)),w=Lg(),k=E.useRef("touch"),C=()=>{i||(c.onValueChange(r),c.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 S.jsx(mR,{scope:n,value:r,disabled:i,textId:w,isSelected:d,onItemTextChange:E.useCallback(L=>{g(j=>j||(L?.textContent??"").trim())},[]),children:S.jsx(Bg.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:S.jsx(xn.div,{role:"option","aria-labelledby":w,"data-highlighted":b?"":void 0,"aria-selected":d&&b,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:N,onFocus:vn(o.onFocus,()=>y(!0)),onBlur:vn(o.onBlur,()=>y(!1)),onClick:vn(o.onClick,()=>{k.current!=="mouse"&&C()}),onPointerUp:vn(o.onPointerUp,()=>{k.current==="mouse"&&C()}),onPointerDown:vn(o.onPointerDown,L=>{k.current=L.pointerType}),onPointerMove:vn(o.onPointerMove,L=>{k.current=L.pointerType,i?f.onItemLeave?.():k.current==="mouse"&&L.currentTarget.focus({preventScroll:!0})}),onPointerLeave:vn(o.onPointerLeave,L=>{L.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:vn(o.onKeyDown,L=>{f.searchRef?.current!==""&&L.key===" "||(eR.includes(L.key)&&C(),L.key===" "&&L.preventDefault())})})})})});e_.displayName=og;var bh="SelectItemText",t_=E.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...a}=t,o=Cc(bh,n),c=kc(bh,n),f=J4(bh,n),d=iR(bh,n),[p,g]=E.useState(null),b=cr(e,C=>g(C),f.onItemTextChange,C=>c.itemTextRefCallback?.(C,f.value,f.disabled)),y=p?.textContent,N=E.useMemo(()=>S.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:k}=d;return Si(()=>(w(N),()=>k(N)),[w,k,N]),S.jsxs(S.Fragment,{children:[S.jsx(xn.span,{id:f.textId,...a,ref:b}),f.isSelected&&o.valueNode&&!o.valueNodeHasChildren?qh.createPortal(a.children,o.valueNode):null]})});t_.displayName=bh;var n_="SelectItemIndicator",r_=E.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return J4(n_,n).isSelected?S.jsx(xn.span,{"aria-hidden":!0,...r,ref:e}):null});r_.displayName=n_;var N2="SelectScrollUpButton",i_=E.forwardRef((t,e)=>{const n=kc(N2,t.__scopeSelect),r=Fy(N2,t.__scopeSelect),[i,a]=E.useState(!1),o=cr(e,r.onScrollButtonChange);return Si(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=f.scrollTop>0;a(d)};const f=n.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?S.jsx(s_,{...t,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=n;c&&f&&(c.scrollTop=c.scrollTop-f.offsetHeight)}}):null});i_.displayName=N2;var A2="SelectScrollDownButton",a_=E.forwardRef((t,e)=>{const n=kc(A2,t.__scopeSelect),r=Fy(A2,t.__scopeSelect),[i,a]=E.useState(!1),o=cr(e,r.onScrollButtonChange);return Si(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)<d;a(p)};const f=n.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?S.jsx(s_,{...t,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=n;c&&f&&(c.scrollTop=c.scrollTop+f.offsetHeight)}}):null});a_.displayName=A2;var s_=E.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,a=kc("SelectScrollButton",n),o=E.useRef(null),c=Fg(n),f=E.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return E.useEffect(()=>()=>f(),[f]),Si(()=>{c().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),S.jsx(xn.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:vn(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:vn(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:vn(i.onPointerLeave,()=>{f()})})}),gR="SelectSeparator",o_=E.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return S.jsx(xn.div,{"aria-hidden":!0,...r,ref:e})});o_.displayName=gR;var C2="SelectArrow",yR=E.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Ig(n),a=Cc(C2,n),o=kc(C2,n);return a.open&&o.position==="popper"?S.jsx(M4,{...i,...r,ref:e}):null});yR.displayName=C2;var vR="SelectBubbleInput",l_=E.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const i=E.useRef(null),a=cr(r,i),o=fT(e);return E.useEffect(()=>{const c=i.current;if(!c)return;const f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(o!==e&&p){const g=new Event("change",{bubbles:!0});p.call(c,e),c.dispatchEvent(g)}},[o,e]),S.jsx(xn.select,{...n,style:{...L4,...n.style},ref:a,defaultValue:e})});l_.displayName=vR;function c_(t){return t===""||t===void 0}function u_(t){const e=Eu(t),n=E.useRef(""),r=E.useRef(0),i=E.useCallback(o=>{const c=n.current+o;e(c),function f(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}(c)},[e]),a=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function f_(t,e,n){const i=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,a=n?t.indexOf(n):-1;let o=bR(t,Math.max(a,0));i.length===1&&(o=o.filter(d=>d!==n));const f=o.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function bR(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var xR=F4,d_=z4,wR=U4,SR=q4,_R=W4,h_=Y4,NR=X4,p_=Q4,m_=e_,AR=t_,CR=r_,g_=i_,y_=a_,v_=o_;/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kR=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),MR=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),uw=t=>{const e=MR(t);return e.charAt(0).toUpperCase()+e.slice(1)},b_=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),LR=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var ER={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"};/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DR=E.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...c},f)=>E.createElement("svg",{ref:f,...ER,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:b_("lucide",i),...!a&&!LR(c)&&{"aria-hidden":"true"},...c},[...o.map(([d,p])=>E.createElement(d,p)),...Array.isArray(a)?a:[a]]));/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const So=(t,e)=>{const n=E.forwardRef(({className:r,...i},a)=>E.createElement(DR,{ref:a,iconNode:e,className:b_(`lucide-${kR(uw(t))}`,`lucide-${t}`,r),...i}));return n.displayName=uw(t),n};/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jR=[["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"}]],OR=So("calendar",jR);/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],RR=So("check",TR);/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Iy=So("chevron-down",PR);/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BR=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],FR=So("chevron-left",BR);/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],zR=So("chevron-right",IR);/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],UR=So("chevron-up",HR);/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qR=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],WR=So("circle-check-big",qR);/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YR=[["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"}]],VR=So("pencil",YR);/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$R=So("search",GR);/**
 * @license lucide-react v0.523.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],k2=So("x",XR),ZR=xR,KR=wR,x_=E.forwardRef(({className:t,children:e,...n},r)=>S.jsxs(d_,{ref:r,className:wt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,S.jsx(SR,{asChild:!0,children:S.jsx(Iy,{className:"h-4 w-4 opacity-50"})})]}));x_.displayName=d_.displayName;const w_=E.forwardRef(({className:t,...e},n)=>S.jsx(g_,{ref:n,className:wt("flex cursor-default items-center justify-center py-1",t),...e,children:S.jsx(UR,{className:"h-4 w-4"})}));w_.displayName=g_.displayName;const S_=E.forwardRef(({className:t,...e},n)=>S.jsx(y_,{ref:n,className:wt("flex cursor-default items-center justify-center py-1",t),...e,children:S.jsx(Iy,{className:"h-4 w-4"})}));S_.displayName=y_.displayName;const __=E.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>S.jsx(_R,{children:S.jsxs(h_,{ref:i,className:wt("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground 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 origin-[--radix-select-content-transform-origin]",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",t),position:n,...r,children:[S.jsx(w_,{}),S.jsx(NR,{className:wt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),S.jsx(S_,{})]})}));__.displayName=h_.displayName;const QR=E.forwardRef(({className:t,...e},n)=>S.jsx(p_,{ref:n,className:wt("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));QR.displayName=p_.displayName;const N_=E.forwardRef(({className:t,children:e,...n},r)=>S.jsxs(m_,{ref:r,className:wt("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-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(CR,{children:S.jsx(RR,{className:"h-4 w-4"})})}),S.jsx(AR,{children:e})]}));N_.displayName=m_.displayName;const JR=E.forwardRef(({className:t,...e},n)=>S.jsx(v_,{ref:n,className:wt("-mx-1 my-1 h-px bg-muted",t),...e}));JR.displayName=v_.displayName;function eP(t,e){return E.useReducer((n,r)=>e[n][r]??n,t)}var cd=t=>{const{present:e,children:n}=t,r=tP(e),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),a=cr(r.ref,nP(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:a}):null};cd.displayName="Presence";function tP(t){const[e,n]=E.useState(),r=E.useRef(null),i=E.useRef(t),a=E.useRef("none"),o=t?"mounted":"unmounted",[c,f]=eP(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const d=xm(r.current);a.current=c==="mounted"?d:"none"},[c]),Si(()=>{const d=r.current,p=i.current;if(p!==t){const b=a.current,y=xm(d);t?f("MOUNT"):y==="none"||d?.display==="none"?f("UNMOUNT"):f(p&&b!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,f]),Si(()=>{if(e){let d;const p=e.ownerDocument.defaultView??window,g=y=>{const w=xm(r.current).includes(y.animationName);if(y.target===e&&w&&(f("ANIMATION_END"),!i.current)){const k=e.style.animationFillMode;e.style.animationFillMode="forwards",d=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=k)})}},b=y=>{y.target===e&&(a.current=xm(r.current))};return e.addEventListener("animationstart",b),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(d),e.removeEventListener("animationstart",b),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:E.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function xm(t){return t?.animationName||"none"}function nP(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var zg="Popover",[A_,qI]=$h(zg,[Og]),Zh=Og(),[rP,Mc]=A_(zg),C_=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=t,c=Zh(e),f=E.useRef(null),[d,p]=E.useState(!1),[g,b]=x2({prop:r,defaultProp:i??!1,onChange:a,caller:zg});return S.jsx(C4,{...c,children:S.jsx(rP,{scope:e,contentId:Lg(),triggerRef:f,open:g,onOpenChange:b,onOpenToggle:E.useCallback(()=>b(y=>!y),[b]),hasCustomAnchor:d,onCustomAnchorAdd:E.useCallback(()=>p(!0),[]),onCustomAnchorRemove:E.useCallback(()=>p(!1),[]),modal:o,children:n})})};C_.displayName=zg;var k_="PopoverAnchor",iP=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Mc(k_,n),a=Zh(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=i;return E.useEffect(()=>(o(),()=>c()),[o,c]),S.jsx(Py,{...a,...r,ref:e})});iP.displayName=k_;var M_="PopoverTrigger",L_=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Mc(M_,n),a=Zh(n),o=cr(e,i.triggerRef),c=S.jsx(xn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":T_(i.open),...r,ref:o,onClick:vn(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:S.jsx(Py,{asChild:!0,...a,children:c})});L_.displayName=M_;var zy="PopoverPortal",[aP,sP]=A_(zy,{forceMount:void 0}),E_=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,a=Mc(zy,e);return S.jsx(aP,{scope:e,forceMount:n,children:S.jsx(cd,{present:n||a.open,children:S.jsx(Tg,{asChild:!0,container:i,children:r})})})};E_.displayName=zy;var Kf="PopoverContent",D_=E.forwardRef((t,e)=>{const n=sP(Kf,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,a=Mc(Kf,t.__scopePopover);return S.jsx(cd,{present:r||a.open,children:a.modal?S.jsx(lP,{...i,ref:e}):S.jsx(cP,{...i,ref:e})})});D_.displayName=Kf;var oP=Mu("PopoverContent.RemoveScroll"),lP=E.forwardRef((t,e)=>{const n=Mc(Kf,t.__scopePopover),r=E.useRef(null),i=cr(e,r),a=E.useRef(!1);return E.useEffect(()=>{const o=r.current;if(o)return By(o)},[]),S.jsx(Pg,{as:oP,allowPinchZoom:!0,children:S.jsx(j_,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:vn(t.onCloseAutoFocus,o=>{o.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:vn(t.onPointerDownOutside,o=>{const c=o.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0,d=c.button===2||f;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:vn(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),cP=E.forwardRef((t,e)=>{const n=Mc(Kf,t.__scopePopover),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(j_,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;n.triggerRef.current?.contains(o)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),j_=E.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,...g}=t,b=Mc(Kf,n),y=Zh(n);return Cy(),S.jsx(Mg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:S.jsx(kg,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:d,onDismiss:()=>b.onOpenChange(!1),children:S.jsx(k4,{"data-state":T_(b.open),role:"dialog",id:b.contentId,...y,...g,ref:e,style:{...g.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)"}})})})}),O_="PopoverClose",uP=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Mc(O_,n);return S.jsx(xn.button,{type:"button",...r,ref:e,onClick:vn(t.onClick,()=>i.onOpenChange(!1))})});uP.displayName=O_;var fP="PopoverArrow",dP=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Zh(n);return S.jsx(M4,{...i,...r,ref:e})});dP.displayName=fP;function T_(t){return t?"open":"closed"}var hP=C_,pP=L_,mP=E_,R_=D_;const gP=hP,yP=pP,P_=E.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},i)=>S.jsx(mP,{children:S.jsx(R_,{ref:i,align:e,sideOffset:n,className:wt("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 origin-[--radix-popover-content-transform-origin]",t),...r})}));P_.displayName=R_.displayName;const vP={},xh={};function Ch(t,e){try{const r=(vP[t]||=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format)(e).split("GMT")[1]||"";return r in xh?xh[r]:fw(r,r.split(":"))}catch{if(t in xh)return xh[t];const n=t?.match(bP);return n?fw(t,n.slice(1)):NaN}}const bP=/([+-]\d\d):?(\d\d)?/;function fw(t,e){const n=+e[0],r=+(e[1]||0);return xh[t]=n>0?n*60+r:n*60-r}class ho extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ch(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),B_(this),M2(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new ho(...n,e):new ho(Date.now(),e)}withTimeZone(e){return new ho(+this,e)}getTimezoneOffset(){return-Ch(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),M2(this),+this}[Symbol.for("constructDateFrom")](e){return new ho(+new Date(e),this.timeZone)}}const dw=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!dw.test(t))return;const e=t.replace(dw,"$1UTC");ho.prototype[e]&&(t.startsWith("get")?ho.prototype[t]=function(){return this.internal[e]()}:(ho.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),xP(this),+this},ho.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),M2(this),+this}))});function M2(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function xP(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),B_(t)}function B_(t){const e=Ch(t.timeZone,t),n=new Date(+t);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+t).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),a=r-i,o=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();a&&o&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+a);const c=r-e;c&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c);const f=Ch(t.timeZone,t),p=-new Date(+t).getTimezoneOffset()-f,g=f!==e,b=p-c;if(g&&b){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+b);const y=Ch(t.timeZone,t),N=f-y;N&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+N))}}class bi extends ho{static tz(e,...n){return n.length?new bi(...n,e):new bi(Date.now(),e)}toISOString(){const[e,n,r]=this.tzComponents(),i=`${e}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,r,i]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${r} ${n} ${i}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,r,i]=this.tzComponents();return`${e} GMT${n}${r}${i} (${wP(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",r=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),i=String(Math.abs(e)%60).padStart(2,"0");return[n,r,i]}withTimeZone(e){return new bi(+this,e)}[Symbol.for("constructDateFrom")](e){return new bi(+new Date(e),this.timeZone)}}function wP(t,e){return new Intl.DateTimeFormat("en-GB",{timeZone:t,timeZoneName:"long"}).format(e).slice(12)}var At;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(At||(At={}));var lr;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(lr||(lr={}));var ps;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(ps||(ps={}));var ga;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(ga||(ga={}));const hw=5,SP=4;function _P(t,e){const n=e.startOfMonth(t),r=n.getDay()>0?n.getDay():7,i=e.addDays(t,-r+1),a=e.addDays(i,hw*7-1);return e.getMonth(t)===e.getMonth(a)?hw:SP}function F_(t,e){const n=e.startOfMonth(t),r=n.getDay();return r===1?n:r===0?e.addDays(n,-1*6):e.addDays(n,-1*(r-1))}function NP(t,e){const n=F_(t,e),r=_P(t,e);return e.addDays(n,r*7-1)}class vl{constructor(e,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?bi.tz(this.options.timeZone):new this.Date,this.newDate=(r,i,a)=>this.overrides?.newDate?this.overrides.newDate(r,i,a):this.options.timeZone?new bi(r,i,a,this.options.timeZone):new Date(r,i,a),this.addDays=(r,i)=>this.overrides?.addDays?this.overrides.addDays(r,i):JS(r,i),this.addMonths=(r,i)=>this.overrides?.addMonths?this.overrides.addMonths(r,i):e3(r,i),this.addWeeks=(r,i)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,i):uM(r,i),this.addYears=(r,i)=>this.overrides?.addYears?this.overrides.addYears(r,i):fM(r,i),this.differenceInCalendarDays=(r,i)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,i):n3(r,i),this.differenceInCalendarMonths=(r,i)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,i):gM(r,i),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):bM(r),this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):NP(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):SM(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):yM(r),this.endOfWeek=(r,i)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,i):a3(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):wM(r),this.format=(r,i,a)=>{const o=this.overrides?.format?this.overrides.format(r,i,this.options):Oi(r,i,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):s3(r),this.getMonth=(r,i)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):bL(r,this.options),this.getYear=(r,i)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):xL(r,this.options),this.getWeek=(r,i)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):l3(r,this.options),this.isAfter=(r,i)=>this.overrides?.isAfter?this.overrides.isAfter(r,i):jm(r,i),this.isBefore=(r,i)=>this.overrides?.isBefore?this.overrides.isBefore(r,i):wL(r,i),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):r3(r),this.isSameDay=(r,i)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,i):pM(r,i),this.isSameMonth=(r,i)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,i):SL(r,i),this.isSameYear=(r,i)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,i):_L(r,i),this.max=r=>this.overrides?.max?this.overrides.max(r):dM(r),this.min=r=>this.overrides?.min?this.overrides.min(r):hM(r),this.setMonth=(r,i)=>this.overrides?.setMonth?this.overrides.setMonth(r,i):NL(r,i),this.setYear=(r,i)=>this.overrides?.setYear?this.overrides.setYear(r,i):AL(r,i),this.startOfBroadcastWeek=(r,i)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):F_(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):Th(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):Oh(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):xM(r),this.startOfWeek=(r,i)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):$f(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):i3(r),this.options={locale:oy,...e},this.overrides=n}getDigitMap(){const{numerals:e="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:e}),r={};for(let i=0;i<10;i++)r[i.toString()]=n.format(i);return r}replaceDigits(e){const n=this.getDigitMap();return e.replace(/\d/g,r=>n[r]||r)}formatNumber(e){return this.replaceDigits(e.toString())}}const _o=new vl;class I_{constructor(e,n,r=_o){this.date=e,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(e,n)),this.dateLib=r}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class AP{constructor(e,n){this.date=e,this.weeks=n}}class CP{constructor(e,n){this.days=n,this.weekNumber=e}}function cl(t,e,n=!1,r=_o){let{from:i,to:a}=t;const{differenceInCalendarDays:o,isSameDay:c}=r;return i&&a?(o(a,i)<0&&([i,a]=[a,i]),o(e,i)>=(n?1:0)&&o(a,e)>=(n?1:0)):!n&&a?c(a,e):!n&&i?c(i,e):!1}function z_(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function Hy(t){return!!(t&&typeof t=="object"&&"from"in t)}function H_(t){return!!(t&&typeof t=="object"&&"after"in t)}function U_(t){return!!(t&&typeof t=="object"&&"before"in t)}function q_(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function W_(t,e){return Array.isArray(t)&&t.every(e.isDate)}function ul(t,e,n=_o){const r=Array.isArray(e)?e:[e],{isSameDay:i,differenceInCalendarDays:a,isAfter:o}=n;return r.some(c=>{if(typeof c=="boolean")return c;if(n.isDate(c))return i(t,c);if(W_(c,n))return c.includes(t);if(Hy(c))return cl(c,t,!1,n);if(q_(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(t.getDay()):c.dayOfWeek===t.getDay();if(z_(c)){const f=a(c.before,t),d=a(c.after,t),p=f>0,g=d<0;return o(c.before,c.after)?g&&p:p||g}return H_(c)?a(t,c.after)>0:U_(c)?a(c.before,t)>0:typeof c=="function"?c(t):!1})}function kP(t,e,n){const{disabled:r,hidden:i,modifiers:a,showOutsideDays:o,broadcastCalendar:c,today:f}=e,{isSameDay:d,isSameMonth:p,startOfMonth:g,isBefore:b,endOfMonth:y,isAfter:N}=n,w=e.startMonth&&g(e.startMonth),k=e.endMonth&&y(e.endMonth),C={[lr.focused]:[],[lr.outside]:[],[lr.disabled]:[],[lr.hidden]:[],[lr.today]:[]},L={};for(const j of t){const{date:z,displayMonth:O}=j,K=!!(O&&!p(z,O)),q=!!(w&&b(z,w)),H=!!(k&&N(z,k)),se=!!(r&&ul(z,r,n)),le=!!(i&&ul(z,i,n))||q||H||!c&&!o&&K||c&&o===!1&&K,P=d(z,f??n.today());K&&C.outside.push(j),se&&C.disabled.push(j),le&&C.hidden.push(j),P&&C.today.push(j),a&&Object.keys(a).forEach(I=>{const ne=a?.[I];ne&&ul(z,ne,n)&&(L[I]?L[I].push(j):L[I]=[j])})}return j=>{const z={[lr.focused]:!1,[lr.disabled]:!1,[lr.hidden]:!1,[lr.outside]:!1,[lr.today]:!1},O={};for(const K in C){const q=C[K];z[K]=q.some(H=>H===j)}for(const K in L)O[K]=L[K].some(q=>q===j);return{...z,...O}}}function MP(t,e,n={}){return Object.entries(t).filter(([,i])=>i===!0).reduce((i,[a])=>(n[a]?i.push(n[a]):e[lr[a]]?i.push(e[lr[a]]):e[ps[a]]&&i.push(e[ps[a]]),i),[e[At.Day]])}function LP(t){return st.createElement("button",{...t})}function EP(t){return st.createElement("span",{...t})}function DP(t){const{size:e=24,orientation:n="left",className:r}=t;return st.createElement("svg",{className:r,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&st.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&st.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&st.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&st.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function jP(t){const{day:e,modifiers:n,...r}=t;return st.createElement("td",{...r})}function OP(t){const{day:e,modifiers:n,...r}=t,i=st.useRef(null);return st.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),st.createElement("button",{ref:i,...r})}function TP(t){const{options:e,className:n,components:r,classNames:i,...a}=t,o=[i[At.Dropdown],n].join(" "),c=e?.find(({value:f})=>f===a.value);return st.createElement("span",{"data-disabled":a.disabled,className:i[At.DropdownRoot]},st.createElement(r.Select,{className:o,...a},e?.map(({value:f,label:d,disabled:p})=>st.createElement(r.Option,{key:f,value:f,disabled:p},d))),st.createElement("span",{className:i[At.CaptionLabel],"aria-hidden":!0},c?.label,st.createElement(r.Chevron,{orientation:"down",size:18,className:i[At.Chevron]})))}function RP(t){return st.createElement("div",{...t})}function PP(t){return st.createElement("div",{...t})}function BP(t){const{calendarMonth:e,displayIndex:n,...r}=t;return st.createElement("div",{...r},t.children)}function FP(t){const{calendarMonth:e,displayIndex:n,...r}=t;return st.createElement("div",{...r})}function IP(t){return st.createElement("table",{...t})}function zP(t){return st.createElement("div",{...t})}const Y_=E.createContext(void 0);function Kh(){const t=E.useContext(Y_);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function HP(t){const{components:e}=Kh();return st.createElement(e.Dropdown,{...t})}function UP(t){const{onPreviousClick:e,onNextClick:n,previousMonth:r,nextMonth:i,...a}=t,{components:o,classNames:c,labels:{labelPrevious:f,labelNext:d}}=Kh(),p=E.useCallback(b=>{i&&n?.(b)},[i,n]),g=E.useCallback(b=>{r&&e?.(b)},[r,e]);return st.createElement("nav",{...a},st.createElement(o.PreviousMonthButton,{type:"button",className:c[At.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":f(r),onClick:g},st.createElement(o.Chevron,{disabled:r?void 0:!0,className:c[At.Chevron],orientation:"left"})),st.createElement(o.NextMonthButton,{type:"button",className:c[At.NextMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":d(i),onClick:p},st.createElement(o.Chevron,{disabled:i?void 0:!0,orientation:"right",className:c[At.Chevron]})))}function qP(t){const{components:e}=Kh();return st.createElement(e.Button,{...t})}function WP(t){return st.createElement("option",{...t})}function YP(t){const{components:e}=Kh();return st.createElement(e.Button,{...t})}function VP(t){const{rootRef:e,...n}=t;return st.createElement("div",{...n,ref:e})}function GP(t){return st.createElement("select",{...t})}function $P(t){const{week:e,...n}=t;return st.createElement("tr",{...n})}function XP(t){return st.createElement("th",{...t})}function ZP(t){return st.createElement("thead",{"aria-hidden":!0},st.createElement("tr",{...t}))}function KP(t){const{week:e,...n}=t;return st.createElement("th",{...n})}function QP(t){return st.createElement("th",{...t})}function JP(t){return st.createElement("tbody",{...t})}function e9(t){const{components:e}=Kh();return st.createElement(e.Dropdown,{...t})}const t9=Object.freeze(Object.defineProperty({__proto__:null,Button:LP,CaptionLabel:EP,Chevron:DP,Day:jP,DayButton:OP,Dropdown:TP,DropdownNav:RP,Footer:PP,Month:BP,MonthCaption:FP,MonthGrid:IP,Months:zP,MonthsDropdown:HP,Nav:UP,NextMonthButton:qP,Option:WP,PreviousMonthButton:YP,Root:VP,Select:GP,Week:$P,WeekNumber:KP,WeekNumberHeader:QP,Weekday:XP,Weekdays:ZP,Weeks:JP,YearsDropdown:e9},Symbol.toStringTag,{value:"Module"}));function n9(t){return{...t9,...t}}function r9(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([n,r])=>{n.startsWith("data-")&&(e[n]=r)}),e}function Uy(){const t={};for(const e in At)t[At[e]]=`rdp-${At[e]}`;for(const e in lr)t[lr[e]]=`rdp-${lr[e]}`;for(const e in ps)t[ps[e]]=`rdp-${ps[e]}`;for(const e in ga)t[ga[e]]=`rdp-${ga[e]}`;return t}function V_(t,e,n){return(n??new vl(e)).format(t,"LLLL y")}const i9=V_;function a9(t,e,n){return(n??new vl(e)).format(t,"d")}function s9(t,e=_o){return e.format(t,"LLLL")}function o9(t,e=_o){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function l9(){return""}function c9(t,e,n){return(n??new vl(e)).format(t,"cccccc")}function G_(t,e=_o){return e.format(t,"yyyy")}const u9=G_,f9=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:V_,formatDay:a9,formatMonthCaption:i9,formatMonthDropdown:s9,formatWeekNumber:o9,formatWeekNumberHeader:l9,formatWeekdayName:c9,formatYearCaption:u9,formatYearDropdown:G_},Symbol.toStringTag,{value:"Module"}));function d9(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...f9,...t}}function h9(t,e,n,r,i){const{startOfMonth:a,startOfYear:o,endOfYear:c,eachMonthOfInterval:f,getMonth:d}=i;return f({start:o(t),end:c(t)}).map(b=>{const y=r.formatMonthDropdown(b,i),N=d(b),w=e&&b<a(e)||n&&b>a(n)||!1;return{value:N,label:y,disabled:w}})}function p9(t,e={},n={}){let r={...e?.[At.Day]};return Object.entries(t).filter(([,i])=>i===!0).forEach(([i])=>{r={...r,...n?.[i]}}),r}function m9(t,e,n){const r=t.today(),i=e?t.startOfISOWeek(r):t.startOfWeek(r),a=[];for(let o=0;o<7;o++){const c=t.addDays(i,o);a.push(c)}return a}function g9(t,e,n,r){if(!t||!e)return;const{startOfYear:i,endOfYear:a,addYears:o,getYear:c,isBefore:f,isSameYear:d}=r,p=i(t),g=a(e),b=[];let y=p;for(;f(y,g)||d(y,g);)b.push(y),y=o(y,1);return b.map(N=>{const w=n.formatYearDropdown(N,r);return{value:c(N),label:w,disabled:!1}})}function $_(t,e,n){return(n??new vl(e)).format(t,"LLLL y")}const y9=$_;function v9(t,e,n,r){let i=(r??new vl(n)).format(t,"PPPP");return e?.today&&(i=`Today, ${i}`),i}function X_(t,e,n,r){let i=(r??new vl(n)).format(t,"PPPP");return e.today&&(i=`Today, ${i}`),e.selected&&(i=`${i}, selected`),i}const b9=X_;function x9(){return""}function w9(t){return"Choose the Month"}function S9(t){return"Go to the Next Month"}function _9(t){return"Go to the Previous Month"}function N9(t,e,n){return(n??new vl(e)).format(t,"cccc")}function A9(t,e){return`Week ${t}`}function C9(t){return"Week Number"}function k9(t){return"Choose the Year"}const M9=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:y9,labelDay:b9,labelDayButton:X_,labelGrid:$_,labelGridcell:v9,labelMonthDropdown:w9,labelNav:x9,labelNext:S9,labelPrevious:_9,labelWeekNumber:A9,labelWeekNumberHeader:C9,labelWeekday:N9,labelYearDropdown:k9},Symbol.toStringTag,{value:"Module"})),Qh=t=>t instanceof HTMLElement?t:null,j1=t=>[...t.querySelectorAll("[data-animated-month]")??[]],L9=t=>Qh(t.querySelector("[data-animated-month]")),O1=t=>Qh(t.querySelector("[data-animated-caption]")),T1=t=>Qh(t.querySelector("[data-animated-weeks]")),E9=t=>Qh(t.querySelector("[data-animated-nav]")),D9=t=>Qh(t.querySelector("[data-animated-weekdays]"));function j9(t,e,{classNames:n,months:r,focused:i,dateLib:a}){const o=E.useRef(null),c=E.useRef(r),f=E.useRef(!1);E.useLayoutEffect(()=>{const d=c.current;if(c.current=r,!e||!t.current||!(t.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const p=a.isSameMonth(r[0].date,d[0].date),g=a.isAfter(r[0].date,d[0].date),b=g?n[ga.caption_after_enter]:n[ga.caption_before_enter],y=g?n[ga.weeks_after_enter]:n[ga.weeks_before_enter],N=o.current,w=t.current.cloneNode(!0);if(w instanceof HTMLElement?(j1(w).forEach(j=>{if(!(j instanceof HTMLElement))return;const z=L9(j);z&&j.contains(z)&&j.removeChild(z);const O=O1(j);O&&O.classList.remove(b);const K=T1(j);K&&K.classList.remove(y)}),o.current=w):o.current=null,f.current||p||i)return;const k=N instanceof HTMLElement?j1(N):[],C=j1(t.current);if(C&&C.every(L=>L instanceof HTMLElement)&&k&&k.every(L=>L instanceof HTMLElement)){f.current=!0,t.current.style.isolation="isolate";const L=E9(t.current);L&&(L.style.zIndex="1"),C.forEach((j,z)=>{const O=k[z];if(!O)return;j.style.position="relative",j.style.overflow="hidden";const K=O1(j);K&&K.classList.add(b);const q=T1(j);q&&q.classList.add(y);const H=()=>{f.current=!1,t.current&&(t.current.style.isolation=""),L&&(L.style.zIndex=""),K&&K.classList.remove(b),q&&q.classList.remove(y),j.style.position="",j.style.overflow="",j.contains(O)&&j.removeChild(O)};O.style.pointerEvents="none",O.style.position="absolute",O.style.overflow="hidden",O.setAttribute("aria-hidden","true");const se=D9(O);se&&(se.style.opacity="0");const le=O1(O);le&&(le.classList.add(g?n[ga.caption_before_exit]:n[ga.caption_after_exit]),le.addEventListener("animationend",H));const P=T1(O);P&&P.classList.add(g?n[ga.weeks_before_exit]:n[ga.weeks_after_exit]),j.insertBefore(O,j.firstChild)})}})}function O9(t,e,n,r){const i=t[0],a=t[t.length-1],{ISOWeek:o,fixedWeeks:c,broadcastCalendar:f}=n??{},{addDays:d,differenceInCalendarDays:p,differenceInCalendarMonths:g,endOfBroadcastWeek:b,endOfISOWeek:y,endOfMonth:N,endOfWeek:w,isAfter:k,startOfBroadcastWeek:C,startOfISOWeek:L,startOfWeek:j}=r,z=f?C(i,r):o?L(i):j(i),O=f?b(a):o?y(N(a)):w(N(a)),K=p(O,z),q=g(a,i)+1,H=[];for(let P=0;P<=K;P++){const I=d(z,P);if(e&&k(I,e))break;H.push(I)}const le=(f?35:42)*q;if(c&&H.length<le){const P=le-H.length;for(let I=0;I<P;I++){const ne=d(H[H.length-1],1);H.push(ne)}}return H}function T9(t){const e=[];return t.reduce((n,r)=>{const i=r.weeks.reduce((a,o)=>[...a,...o.days],e);return[...n,...i]},e)}function R9(t,e,n,r){const{numberOfMonths:i=1}=n,a=[];for(let o=0;o<i;o++){const c=r.addMonths(t,o);if(e&&c>e)break;a.push(c)}return a}function pw(t,e){const{month:n,defaultMonth:r,today:i=e.today(),numberOfMonths:a=1,endMonth:o,startMonth:c}=t;let f=n||r||i;const{differenceInCalendarMonths:d,addMonths:p,startOfMonth:g}=e;if(o&&d(o,f)<0){const b=-1*(a-1);f=p(o,b)}return c&&d(f,c)<0&&(f=c),g(f)}function P9(t,e,n,r){const{addDays:i,endOfBroadcastWeek:a,endOfISOWeek:o,endOfMonth:c,endOfWeek:f,getISOWeek:d,getWeek:p,startOfBroadcastWeek:g,startOfISOWeek:b,startOfWeek:y}=r,N=t.reduce((w,k)=>{const C=n.broadcastCalendar?g(k,r):n.ISOWeek?b(k):y(k),L=n.broadcastCalendar?a(k):n.ISOWeek?o(c(k)):f(c(k)),j=e.filter(q=>q>=C&&q<=L),z=n.broadcastCalendar?35:42;if(n.fixedWeeks&&j.length<z){const q=e.filter(H=>{const se=z-j.length;return H>L&&H<=i(L,se)});j.push(...q)}const O=j.reduce((q,H)=>{const se=n.ISOWeek?d(H):p(H),le=q.find(I=>I.weekNumber===se),P=new I_(H,k,r);return le?le.days.push(P):q.push(new CP(se,[P])),q},[]),K=new AP(k,O);return w.push(K),w},[]);return n.reverseMonths?N.reverse():N}function B9(t,e){let{startMonth:n,endMonth:r}=t;const{startOfYear:i,startOfDay:a,startOfMonth:o,endOfMonth:c,addYears:f,endOfYear:d,newDate:p,today:g}=e,{fromYear:b,toYear:y,fromMonth:N,toMonth:w}=t;!n&&N&&(n=N),!n&&b&&(n=e.newDate(b,0,1)),!r&&w&&(r=w),!r&&y&&(r=p(y,11,31));const k=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=o(n):b?n=p(b,0,1):!n&&k&&(n=i(f(t.today??g(),-100))),r?r=c(r):y?r=p(y,11,31):!r&&k&&(r=d(t.today??g())),[n&&a(n),r&&a(r)]}function F9(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:a=1}=n,{startOfMonth:o,addMonths:c,differenceInCalendarMonths:f}=r,d=i?a:1,p=o(t);if(!e)return c(p,d);if(!(f(e,t)<a))return c(p,d)}function I9(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:a}=n,{startOfMonth:o,addMonths:c,differenceInCalendarMonths:f}=r,d=i?a??1:1,p=o(t);if(!e)return c(p,-d);if(!(f(p,e)<=0))return c(p,-d)}function z9(t){const e=[];return t.reduce((n,r)=>[...n,...r.weeks],e)}function Hg(t,e){const[n,r]=E.useState(t);return[e===void 0?n:e,r]}function H9(t,e){const[n,r]=B9(t,e),{startOfMonth:i,endOfMonth:a}=e,o=pw(t,e),[c,f]=Hg(o,t.month?o:void 0);E.useEffect(()=>{const K=pw(t,e);f(K)},[t.timeZone]);const d=R9(c,r,t,e),p=O9(d,t.endMonth?a(t.endMonth):void 0,t,e),g=P9(d,p,t,e),b=z9(g),y=T9(g),N=I9(c,n,t,e),w=F9(c,r,t,e),{disableNavigation:k,onMonthChange:C}=t,L=K=>b.some(q=>q.days.some(H=>H.isEqualTo(K))),j=K=>{if(k)return;let q=i(K);n&&q<i(n)&&(q=i(n)),r&&q>i(r)&&(q=i(r)),f(q),C?.(q)};return{months:g,weeks:b,days:y,navStart:n,navEnd:r,previousMonth:N,nextMonth:w,goToMonth:j,goToDay:K=>{L(K)||j(K.date)}}}var lo;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(lo||(lo={}));function mw(t){return!t[lr.disabled]&&!t[lr.hidden]&&!t[lr.outside]}function U9(t,e,n,r){let i,a=-1;for(const o of t){const c=e(o);mw(c)&&(c[lr.focused]&&a<lo.FocusedModifier?(i=o,a=lo.FocusedModifier):r?.isEqualTo(o)&&a<lo.LastFocused?(i=o,a=lo.LastFocused):n(o.date)&&a<lo.Selected?(i=o,a=lo.Selected):c[lr.today]&&a<lo.Today&&(i=o,a=lo.Today))}return i||(i=t.find(o=>mw(e(o)))),i}function q9(t,e,n,r,i,a,o){const{ISOWeek:c,broadcastCalendar:f}=a,{addDays:d,addMonths:p,addWeeks:g,addYears:b,endOfBroadcastWeek:y,endOfISOWeek:N,endOfWeek:w,max:k,min:C,startOfBroadcastWeek:L,startOfISOWeek:j,startOfWeek:z}=o;let K={day:d,week:g,month:p,year:b,startOfWeek:q=>f?L(q,o):c?j(q):z(q),endOfWeek:q=>f?y(q):c?N(q):w(q)}[t](n,e==="after"?1:-1);return e==="before"&&r?K=k([r,K]):e==="after"&&i&&(K=C([i,K])),K}function Z_(t,e,n,r,i,a,o,c=0){if(c>365)return;const f=q9(t,e,n.date,r,i,a,o),d=!!(a.disabled&&ul(f,a.disabled,o)),p=!!(a.hidden&&ul(f,a.hidden,o)),g=f,b=new I_(f,g,o);return!d&&!p?b:Z_(t,e,b,r,i,a,o,c+1)}function W9(t,e,n,r,i){const{autoFocus:a}=t,[o,c]=E.useState(),f=U9(e.days,n,r||(()=>!1),o),[d,p]=E.useState(a?f:void 0);return{isFocusTarget:w=>!!f?.isEqualTo(w),setFocused:p,focused:d,blur:()=>{c(d),p(void 0)},moveFocus:(w,k)=>{if(!d)return;const C=Z_(w,k,d,e.navStart,e.navEnd,t,i);C&&(e.goToDay(C),p(C))}}}function Y9(t,e){const{selected:n,required:r,onSelect:i}=t,[a,o]=Hg(n,i?n:void 0),c=i?n:a,{isSameDay:f}=e,d=y=>c?.some(N=>f(N,y))??!1,{min:p,max:g}=t;return{selected:c,select:(y,N,w)=>{let k=[...c??[]];if(d(y)){if(c?.length===p||r&&c?.length===1)return;k=c?.filter(C=>!f(C,y))}else c?.length===g?k=[y]:k=[...k,y];return i||o(k),i?.(k,y,N,w),k},isSelected:d}}function V9(t,e,n=0,r=0,i=!1,a=_o){const{from:o,to:c}=e||{},{isSameDay:f,isAfter:d,isBefore:p}=a;let g;if(!o&&!c)g={from:t,to:n>0?void 0:t};else if(o&&!c)f(o,t)?i?g={from:o,to:void 0}:g=void 0:p(t,o)?g={from:t,to:o}:g={from:o,to:t};else if(o&&c)if(f(o,t)&&f(c,t))i?g={from:o,to:c}:g=void 0;else if(f(o,t))g={from:o,to:n>0?void 0:t};else if(f(c,t))g={from:t,to:n>0?void 0:t};else if(p(t,o))g={from:t,to:c};else if(d(t,o))g={from:o,to:t};else if(d(t,c))g={from:o,to:t};else throw new Error("Invalid range");if(g?.from&&g?.to){const b=a.differenceInCalendarDays(g.to,g.from);r>0&&b>r?g={from:t,to:void 0}:n>1&&b<n&&(g={from:t,to:void 0})}return g}function G9(t,e,n=_o){const r=Array.isArray(e)?e:[e];let i=t.from;const a=n.differenceInCalendarDays(t.to,t.from),o=Math.min(a,6);for(let c=0;c<=o;c++){if(r.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function gw(t,e,n=_o){return cl(t,e.from,!1,n)||cl(t,e.to,!1,n)||cl(e,t.from,!1,n)||cl(e,t.to,!1,n)}function $9(t,e,n=_o){const r=Array.isArray(e)?e:[e];if(r.filter(c=>typeof c!="function").some(c=>typeof c=="boolean"?c:n.isDate(c)?cl(t,c,!1,n):W_(c,n)?c.some(f=>cl(t,f,!1,n)):Hy(c)?c.from&&c.to?gw(t,{from:c.from,to:c.to},n):!1:q_(c)?G9(t,c.dayOfWeek,n):z_(c)?n.isAfter(c.before,c.after)?gw(t,{from:n.addDays(c.after,1),to:n.addDays(c.before,-1)},n):ul(t.from,c,n)||ul(t.to,c,n):H_(c)||U_(c)?ul(t.from,c,n)||ul(t.to,c,n):!1))return!0;const o=r.filter(c=>typeof c=="function");if(o.length){let c=t.from;const f=n.differenceInCalendarDays(t.to,t.from);for(let d=0;d<=f;d++){if(o.some(p=>p(c)))return!0;c=n.addDays(c,1)}}return!1}function X9(t,e){const{disabled:n,excludeDisabled:r,selected:i,required:a,onSelect:o}=t,[c,f]=Hg(i,o?i:void 0),d=o?i:c;return{selected:d,select:(b,y,N)=>{const{min:w,max:k}=t,C=b?V9(b,d,w,k,a,e):void 0;return r&&n&&C?.from&&C.to&&$9({from:C.from,to:C.to},n,e)&&(C.from=b,C.to=void 0),o||f(C),o?.(C,b,y,N),C},isSelected:b=>d&&cl(d,b,!1,e)}}function Z9(t,e){const{selected:n,required:r,onSelect:i}=t,[a,o]=Hg(n,i?n:void 0),c=i?n:a,{isSameDay:f}=e;return{selected:c,select:(g,b,y)=>{let N=g;return!r&&c&&c&&f(g,c)&&(N=void 0),i||o(N),i?.(N,g,b,y),N},isSelected:g=>c?f(c,g):!1}}function K9(t,e){const n=Z9(t,e),r=Y9(t,e),i=X9(t,e);switch(t.mode){case"single":return n;case"multiple":return r;case"range":return i;default:return}}function Q9(t){let e=t;e.timeZone&&(e={...t},e.today&&(e.today=new bi(e.today,e.timeZone)),e.month&&(e.month=new bi(e.month,e.timeZone)),e.defaultMonth&&(e.defaultMonth=new bi(e.defaultMonth,e.timeZone)),e.startMonth&&(e.startMonth=new bi(e.startMonth,e.timeZone)),e.endMonth&&(e.endMonth=new bi(e.endMonth,e.timeZone)),e.mode==="single"&&e.selected?e.selected=new bi(e.selected,e.timeZone):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(ut=>new bi(ut,e.timeZone)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?new bi(e.selected.from,e.timeZone):void 0,to:e.selected.to?new bi(e.selected.to,e.timeZone):void 0}));const{components:n,formatters:r,labels:i,dateLib:a,locale:o,classNames:c}=E.useMemo(()=>{const ut={...oy,...e.locale};return{dateLib:new vl({locale:ut,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:n9(e.components),formatters:d9(e.formatters),labels:{...M9,...e.labels},locale:ut,classNames:{...Uy(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.components,e.formatters,e.labels,e.classNames]),{captionLayout:f,mode:d,navLayout:p,numberOfMonths:g=1,onDayBlur:b,onDayClick:y,onDayFocus:N,onDayKeyDown:w,onDayMouseEnter:k,onDayMouseLeave:C,onNextClick:L,onPrevClick:j,showWeekNumber:z,styles:O}=e,{formatCaption:K,formatDay:q,formatMonthDropdown:H,formatWeekNumber:se,formatWeekNumberHeader:le,formatWeekdayName:P,formatYearDropdown:I}=r,ne=H9(e,a),{days:te,months:de,navStart:X,navEnd:J,previousMonth:G,nextMonth:me,goToMonth:W}=ne,xe=kP(te,e,a),{isSelected:R,select:V,selected:Q}=K9(e,a)??{},{blur:ae,focused:ce,isFocusTarget:he,moveFocus:we,setFocused:Se}=W9(e,ne,xe,R??(()=>!1),a),{labelDayButton:Ve,labelGridcell:He,labelGrid:Je,labelMonthDropdown:it,labelNav:dt,labelPrevious:ze,labelNext:ue,labelWeekday:pt,labelWeekNumber:ht,labelWeekNumberHeader:fe,labelYearDropdown:Ce}=i,Oe=E.useMemo(()=>m9(a,e.ISOWeek),[a,e.ISOWeek]),Ge=d!==void 0||y!==void 0,Ue=E.useCallback(()=>{G&&(W(G),j?.(G))},[G,W,j]),ie=E.useCallback(()=>{me&&(W(me),L?.(me))},[W,me,L]),ye=E.useCallback((ut,nn)=>Lt=>{Lt.preventDefault(),Lt.stopPropagation(),Se(ut),V?.(ut.date,nn,Lt),y?.(ut.date,nn,Lt)},[V,y,Se]),Be=E.useCallback((ut,nn)=>Lt=>{Se(ut),N?.(ut.date,nn,Lt)},[N,Se]),Le=E.useCallback((ut,nn)=>Lt=>{ae(),b?.(ut.date,nn,Lt)},[ae,b]),Re=E.useCallback((ut,nn)=>Lt=>{const Yn={ArrowLeft:["day",e.dir==="rtl"?"after":"before"],ArrowRight:["day",e.dir==="rtl"?"before":"after"],ArrowDown:["week","after"],ArrowUp:["week","before"],PageUp:[Lt.shiftKey?"year":"month","before"],PageDown:[Lt.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Yn[Lt.key]){Lt.preventDefault(),Lt.stopPropagation();const[jn,wn]=Yn[Lt.key];we(jn,wn)}w?.(ut.date,nn,Lt)},[we,w,e.dir]),qe=E.useCallback((ut,nn)=>Lt=>{k?.(ut.date,nn,Lt)},[k]),ft=E.useCallback((ut,nn)=>Lt=>{C?.(ut.date,nn,Lt)},[C]),$e=E.useCallback(ut=>nn=>{const Lt=Number(nn.target.value),Yn=a.setMonth(a.startOfMonth(ut),Lt);W(Yn)},[a,W]),jt=E.useCallback(ut=>nn=>{const Lt=Number(nn.target.value),Yn=a.setYear(a.startOfMonth(ut),Lt);W(Yn)},[a,W]),{className:Mt,style:mn}=E.useMemo(()=>({className:[c[At.Root],e.className].filter(Boolean).join(" "),style:{...O?.[At.Root],...e.style}}),[c,e.className,e.style,O]),Ct=r9(e),Gt=E.useRef(null);j9(Gt,!!e.animate,{classNames:c,months:de,focused:ce,dateLib:a});const ur={dayPickerProps:e,selected:Q,select:V,isSelected:R,months:de,nextMonth:me,previousMonth:G,goToMonth:W,getModifiers:xe,components:n,classNames:c,styles:O,labels:i,formatters:r};return st.createElement(Y_.Provider,{value:ur},st.createElement(n.Root,{rootRef:e.animate?Gt:void 0,className:Mt,style:mn,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],...Ct},st.createElement(n.Months,{className:c[At.Months],style:O?.[At.Months]},!e.hideNavigation&&!p&&st.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:c[At.Nav],style:O?.[At.Nav],"aria-label":dt(),onPreviousClick:Ue,onNextClick:ie,previousMonth:G,nextMonth:me}),de.map((ut,nn)=>{const Lt=h9(ut.date,X,J,r,a),Yn=g9(X,J,r,a);return st.createElement(n.Month,{"data-animated-month":e.animate?"true":void 0,className:c[At.Month],style:O?.[At.Month],key:nn,displayIndex:nn,calendarMonth:ut},p==="around"&&!e.hideNavigation&&nn===0&&st.createElement(n.PreviousMonthButton,{type:"button",className:c[At.PreviousMonthButton],tabIndex:G?void 0:-1,"aria-disabled":G?void 0:!0,"aria-label":ze(G),onClick:Ue,"data-animated-button":e.animate?"true":void 0},st.createElement(n.Chevron,{disabled:G?void 0:!0,className:c[At.Chevron],orientation:e.dir==="rtl"?"right":"left"})),st.createElement(n.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:c[At.MonthCaption],style:O?.[At.MonthCaption],calendarMonth:ut,displayIndex:nn},f?.startsWith("dropdown")?st.createElement(n.DropdownNav,{className:c[At.Dropdowns],style:O?.[At.Dropdowns]},f==="dropdown"||f==="dropdown-months"?st.createElement(n.MonthsDropdown,{className:c[At.MonthsDropdown],"aria-label":it(),classNames:c,components:n,disabled:!!e.disableNavigation,onChange:$e(ut.date),options:Lt,style:O?.[At.Dropdown],value:a.getMonth(ut.date)}):st.createElement("span",null,H(ut.date,a)),f==="dropdown"||f==="dropdown-years"?st.createElement(n.YearsDropdown,{className:c[At.YearsDropdown],"aria-label":Ce(a.options),classNames:c,components:n,disabled:!!e.disableNavigation,onChange:jt(ut.date),options:Yn,style:O?.[At.Dropdown],value:a.getYear(ut.date)}):st.createElement("span",null,I(ut.date,a)),st.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},K(ut.date,a.options,a))):st.createElement(n.CaptionLabel,{className:c[At.CaptionLabel],role:"status","aria-live":"polite"},K(ut.date,a.options,a))),p==="around"&&!e.hideNavigation&&nn===g-1&&st.createElement(n.NextMonthButton,{type:"button",className:c[At.NextMonthButton],tabIndex:me?void 0:-1,"aria-disabled":me?void 0:!0,"aria-label":ue(me),onClick:ie,"data-animated-button":e.animate?"true":void 0},st.createElement(n.Chevron,{disabled:me?void 0:!0,className:c[At.Chevron],orientation:e.dir==="rtl"?"left":"right"})),nn===g-1&&p==="after"&&!e.hideNavigation&&st.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:c[At.Nav],style:O?.[At.Nav],"aria-label":dt(),onPreviousClick:Ue,onNextClick:ie,previousMonth:G,nextMonth:me}),st.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":Je(ut.date,a.options,a)||void 0,className:c[At.MonthGrid],style:O?.[At.MonthGrid]},!e.hideWeekdays&&st.createElement(n.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:c[At.Weekdays],style:O?.[At.Weekdays]},z&&st.createElement(n.WeekNumberHeader,{"aria-label":fe(a.options),className:c[At.WeekNumberHeader],style:O?.[At.WeekNumberHeader],scope:"col"},le()),Oe.map((jn,wn)=>st.createElement(n.Weekday,{"aria-label":pt(jn,a.options,a),className:c[At.Weekday],key:wn,style:O?.[At.Weekday],scope:"col"},P(jn,a.options,a)))),st.createElement(n.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:c[At.Weeks],style:O?.[At.Weeks]},ut.weeks.map((jn,wn)=>st.createElement(n.Week,{className:c[At.Week],key:jn.weekNumber,style:O?.[At.Week],week:jn},z&&st.createElement(n.WeekNumber,{week:jn,style:O?.[At.WeekNumber],"aria-label":ht(jn.weekNumber,{locale:o}),className:c[At.WeekNumber],scope:"row",role:"rowheader"},se(jn.weekNumber,a)),jn.days.map(mt=>{const{date:Ht}=mt,Wt=xe(mt);if(Wt[lr.focused]=!Wt.hidden&&!!ce?.isEqualTo(mt),Wt[ps.selected]=R?.(Ht)||Wt.selected,Hy(Q)){const{from:xt,to:un}=Q;Wt[ps.range_start]=!!(xt&&un&&a.isSameDay(Ht,xt)),Wt[ps.range_end]=!!(xt&&un&&a.isSameDay(Ht,un)),Wt[ps.range_middle]=cl(Q,Ht,!0,a)}const Jn=p9(Wt,O,e.modifiersStyles),_i=MP(Wt,c,e.modifiersClassNames),Pi=!Ge&&!Wt.hidden?He(Ht,Wt,a.options,a):void 0;return st.createElement(n.Day,{key:`${a.format(Ht,"yyyy-MM-dd")}_${a.format(mt.displayMonth,"yyyy-MM")}`,day:mt,modifiers:Wt,className:_i.join(" "),style:Jn,role:"gridcell","aria-selected":Wt.selected||void 0,"aria-label":Pi,"data-day":a.format(Ht,"yyyy-MM-dd"),"data-month":mt.outside?a.format(Ht,"yyyy-MM"):void 0,"data-selected":Wt.selected||void 0,"data-disabled":Wt.disabled||void 0,"data-hidden":Wt.hidden||void 0,"data-outside":mt.outside||void 0,"data-focused":Wt.focused||void 0,"data-today":Wt.today||void 0},!Wt.hidden&&Ge?st.createElement(n.DayButton,{className:c[At.DayButton],style:O?.[At.DayButton],type:"button",day:mt,modifiers:Wt,disabled:Wt.disabled||void 0,tabIndex:he(mt)?0:-1,"aria-label":Ve(Ht,Wt,a.options,a),onClick:ye(mt,Wt),onBlur:Le(mt,Wt),onFocus:Be(mt,Wt),onKeyDown:Re(mt,Wt),onMouseEnter:qe(mt,Wt),onMouseLeave:ft(mt,Wt)},q(Ht,a.options,a)):!Wt.hidden&&q(mt.date,a.options,a))}))))))})),e.footer&&st.createElement(n.Footer,{className:c[At.Footer],style:O?.[At.Footer],role:"status","aria-live":"polite"},e.footer)))}function J9({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:i="ghost",formatters:a,components:o,...c}){const f=Uy();return S.jsx(Q9,{showOutsideDays:n,className:wt("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:r,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...a},classNames:{root:wt("w-fit",f.root),months:wt("relative flex flex-col gap-4 md:flex-row",f.months),month:wt("flex w-full flex-col gap-4",f.month),nav:wt("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",f.nav),button_previous:wt(o2({variant:i}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",f.button_previous),button_next:wt(o2({variant:i}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",f.button_next),month_caption:wt("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",f.month_caption),dropdowns:wt("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",f.dropdowns),dropdown_root:wt("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",f.dropdown_root),dropdown:wt("absolute inset-0 opacity-0",f.dropdown),caption_label:wt("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",f.caption_label),table:"w-full border-collapse",weekdays:wt("flex",f.weekdays),weekday:wt("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",f.weekday),week:wt("mt-2 flex w-full",f.week),week_number_header:wt("w-[--cell-size] select-none",f.week_number_header),week_number:wt("text-muted-foreground select-none text-[0.8rem]",f.week_number),day:wt("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",f.day),range_start:wt("bg-accent rounded-l-md",f.range_start),range_middle:wt("rounded-none",f.range_middle),range_end:wt("bg-accent rounded-r-md",f.range_end),today:wt("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",f.today),outside:wt("text-muted-foreground aria-selected:text-muted-foreground",f.outside),disabled:wt("text-muted-foreground opacity-50",f.disabled),hidden:wt("invisible",f.hidden),...e},components:{Root:({className:d,rootRef:p,...g})=>S.jsx("div",{"data-slot":"calendar",ref:p,className:wt(d),...g}),Chevron:({className:d,orientation:p,...g})=>p==="left"?S.jsx(FR,{className:wt("size-4",d),...g}):p==="right"?S.jsx(zR,{className:wt("size-4",d),...g}):S.jsx(Iy,{className:wt("size-4",d),...g}),DayButton:eB,WeekNumber:({children:d,...p})=>S.jsx("td",{...p,children:S.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:d})}),...o},...c})}function eB({className:t,day:e,modifiers:n,...r}){const i=Uy(),a=E.useRef(null);return E.useEffect(()=>{n.focused&&a.current?.focus()},[n.focused]),S.jsx(Ti,{ref:a,variant:"ghost",size:"icon","data-day":e.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:wt("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",i.day,t),...r})}const R1=[{label:"Today",value:"today",getRange:()=>{const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),t.getDate());return{from:e,to:e}}},{label:"Last 2 days",value:"2d",getRange:()=>{const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),t.getDate());return{from:new Date(t.getFullYear(),t.getMonth(),t.getDate()-1),to:e}}},{label:"Last 7 days",value:"7d",getRange:()=>{const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),t.getDate());return{from:new Date(t.getFullYear(),t.getMonth(),t.getDate()-6),to:e}}},{label:"Last 30 days",value:"30d",getRange:()=>{const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),t.getDate());return{from:new Date(t.getFullYear(),t.getMonth(),t.getDate()-29),to:e}}},{label:"Last 90 days",value:"90d",getRange:()=>{const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),t.getDate());return{from:new Date(t.getFullYear(),t.getMonth(),t.getDate()-89),to:e}}},{label:"Last 6 months",value:"6m",getRange:()=>{const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),t.getDate());return{from:new Date(t.getFullYear(),t.getMonth()-6,t.getDate()),to:e}}},{label:"Last 1 year",value:"1y",getRange:()=>{const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),t.getDate());return{from:new Date(t.getFullYear()-1,t.getMonth(),t.getDate()),to:e}}}];function L2({value:t,onValueChange:e,placeholder:n="Select date range",className:r="",forceDown:i=!1,hideCalendar:a=!1}){const[o,c]=E.useState(!1),[f,d]=E.useState(t||{from:void 0,to:void 0}),[p,g]=E.useState(null),[b,y]=E.useState({from:void 0,to:void 0});E.useEffect(()=>{if(t){d(t),y(t);const O=R1.find(K=>{const q=K.getRange();return q.from.toDateString()===t.from?.toDateString()&&q.to.toDateString()===t.to?.toDateString()});if(O)g(O.value);else if(t.from&&t.to){const K=Math.abs(t.to-t.from),q=Math.ceil(K/(1e3*60*60*24));q>=28&&q<=32?g("30d"):g(null)}else g(null)}},[t]),E.useEffect(()=>{if(!t&&!p){const O=new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()),q={from:new Date(O.getFullYear(),O.getMonth(),O.getDate()-29),to:O};d(q),y(q),g("30d")}},[]);const N=O=>{const K=new Date;let q;switch(O.value){case"today":const se=new Date(K.getFullYear(),K.getMonth(),K.getDate());q={from:se,to:se};break;case"2d":const le=new Date(K.getFullYear(),K.getMonth(),K.getDate());q={from:new Date(K.getFullYear(),K.getMonth(),K.getDate()-1),to:le};break;case"7d":const I=new Date(K.getFullYear(),K.getMonth(),K.getDate());q={from:new Date(K.getFullYear(),K.getMonth(),K.getDate()-6),to:I};break;case"30d":const te=new Date(K.getFullYear(),K.getMonth(),K.getDate());q={from:new Date(K.getFullYear(),K.getMonth(),K.getDate()-29),to:te};break;case"90d":const X=new Date(K.getFullYear(),K.getMonth(),K.getDate());q={from:new Date(K.getFullYear(),K.getMonth(),K.getDate()-89),to:X};break;case"6m":const G=new Date(K.getFullYear(),K.getMonth(),K.getDate());q={from:new Date(K.getFullYear(),K.getMonth()-6,K.getDate()),to:G};break;case"1y":const W=new Date(K.getFullYear(),K.getMonth(),K.getDate());q={from:new Date(K.getFullYear()-1,K.getMonth(),K.getDate()),to:W};break;default:q=O.getRange()}const H=K.toDateString();console.log("🔍 Enhanced Preset Selection Debug:",{presetLabel:O.label,presetValue:O.value,calculatedRange:{from:q.from.toISOString(),to:q.to.toISOString(),fromDateString:q.from.toDateString(),toDateString:q.to.toDateString(),fromLocalDate:q.from.toLocaleDateString(),toLocalDate:q.to.toLocaleDateString()},today:H,todayISO:K.toISOString(),todayLocal:K.toLocaleDateString(),includesToday:q.to.toDateString()===H,dayDifference:Math.floor((q.to-q.from)/(1e3*60*60*24))+1,expectedFrom:new Date(K.getFullYear(),K.getMonth(),K.getDate()-1).toDateString(),expectedTo:H}),d(q),y(q),g(O.value),e(q),c(!1)},w=O=>{if(!O||jm(O,new Date))return;const K=new Date(O.getFullYear(),O.getMonth(),O.getDate());if(!b.from||b.from&&b.to)y({from:K,to:void 0});else{let q=b.from,H=K;jm(q,H)&&([q,H]=[H,q]);const se={from:q,to:H};y(se),d(se),g(null),e(se),c(!1)}},k=()=>{if(p){const O=R1.find(K=>K.value===p);return O?O.label:n}if(f?.from&&f?.to){const O=Math.abs(f.to-f.from),K=Math.ceil(O/(1e3*60*60*24));return K>=28&&K<=32?"Last 30 days":`${Oi(f.from,"MMM d")} - ${Oi(f.to,"MMM d, yyyy")}`}return f?.from?`From ${Oi(f.from,"MMM d, yyyy")}`:n},C=O=>jm(O,new Date),L=O=>b.from?b.to?O>=b.from&&O<=b.to:O.getTime()===b.from.getTime():!1,j=O=>b.from&&O.getTime()===b.from.getTime(),z=O=>b.to&&O.getTime()===b.to.getTime();return S.jsxs(gP,{open:o,onOpenChange:c,children:[S.jsx(yP,{asChild:!0,children:S.jsx(Ti,{variant:"outline",className:`date-range-picker trigger-button w-full justify-start text-left font-normal ${r}`,children:S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(OR,{className:`calendar-icon ${r.includes("text-xs")||r.includes("text-[10px]")?"h-3 w-3":"h-4 w-4"}`}),S.jsx("span",{className:`${r.includes("text-xs")||r.includes("text-[10px]")?"text-[10px]":"text-sm"}`,children:k()})]})})}),S.jsx(P_,{className:`date-range-picker popover-content ${a?"w-64":"w-[440px]"} max-w-[80vw] p-0 fade-in ${i?"filters-section":""}`,align:"end",sideOffset:8,side:i?"bottom":"top",avoidCollisions:!0,children:S.jsxs("div",{className:"flex flex-col md:flex-row",children:[S.jsx("div",{className:`date-range-picker preset-panel w-full ${a?"w-full":"md:w-64 border-r-0 md:border-r border-gray-200"} p-3`,children:S.jsx("div",{className:"space-y-1",children:R1.map(O=>S.jsx("button",{onClick:()=>N(O),className:`date-range-picker preset-button w-full text-left px-2 py-1.5 text-xs md:text-sm rounded-md transition-colors ${p===O.value?"selected":"hover:bg-gray-100"}`,children:O.label},O.value))})}),!a&&S.jsx("div",{className:"date-range-picker calendar-panel w-full md:min-w-[280px] p-3",children:S.jsx("div",{className:"w-full",children:S.jsx(J9,{mode:"single",selected:void 0,onSelect:w,numberOfMonths:1,showOutsideDays:!0,disabled:C,className:"w-full",modifiers:{inRange:L,start:j,end:z},modifiersStyles:{inRange:{backgroundColor:"#e0e7ff",color:"#3730a3"},start:{backgroundColor:"#6366f1",color:"white"},end:{backgroundColor:"#6366f1",color:"white"}}})})})]})})]})}function tB(){const t=Pu(),e=xo(),[n,r]=E.useState([]),[i,a]=E.useState(null),[o,c]=E.useState(!1),[f,d]=E.useState(!0),[p,g]=E.useState({violations:[],counts:{total_count:0,new_count:0,raised_count:0,rejected_count:0},pagination:{current_page:1,page_size:20,total_items:0,total_pages:0,has_next:!1,has_prev:!1}}),[b,y]=E.useState({total_count:0,new_count:0,raised_count:0,rejected_count:0}),[N,w]=E.useState({violationTypes:[],categories:{},statusCounts:{new:0,raised:0,rejected:0}}),[k,C]=E.useState(!1),[L,j]=E.useState(!0),[z,O]=E.useState(!1),[K,q]=E.useState(!1),H=E.useRef(null),se=()=>{if(!H.current)return"left-0";const Ce=H.current.getBoundingClientRect(),Oe=window.innerWidth;return Ce.left+320>Oe-20?"right-0":"left-0"},[le,P]=E.useState([]),[I,ne]=E.useState(!1),[te,de]=E.useState(null),X=E.useRef(!1),[J,G]=E.useState({search:"",status:"all",violationTypes:[],dateRange:{from:(()=>{const fe=new Date;return new Date(fe.getFullYear(),fe.getMonth(),fe.getDate()-29)})(),to:new Date}}),[me,W]=E.useState(()=>{const fe=new Date;return{from:new Date(fe.getFullYear(),fe.getMonth(),fe.getDate()-29),to:fe}}),[xe,R]=E.useState(1);p.pagination.page_size;const V=(fe,Ce)=>{if(fe?.from&&fe?.to){const Oe=new Date(fe.from.getFullYear(),fe.from.getMonth(),fe.from.getDate()),Ge=new Date(fe.to.getFullYear(),fe.to.getMonth(),fe.to.getDate()),Ue=Ge-Oe,ie=Math.ceil(Ue/(1e3*60*60*24))+1;console.log("🔍 Date Calculation Debug:",{originalFrom:fe.from.toISOString(),originalTo:fe.to.toISOString(),fromDateStart:Oe.toISOString(),toDateStart:Ge.toISOString(),fromDateFormatted:Oi(fe.from,"yyyy-MM-dd"),toDateFormatted:Oi(fe.to,"yyyy-MM-dd"),diffTime:Ue,diffDays:ie,calculatedPeriod:Ce,isToday:fe.from.toDateString()===new Date().toDateString()&&fe.to.toDateString()===new Date().toDateString(),is6Months:ie>=180&&ie<=184,is1Year:ie>=365&&ie<=366})}},Q=E.useCallback(async(fe=null)=>{try{const Ce=fe||me,Oe=new Date,Ge=Ce?.from&&Ce?.to&&Ce.from.toDateString()===Oe.toDateString()&&Ce.to.toDateString()===Oe.toDateString();let Ue="30 days",ie=new URLSearchParams({include_categories:"true"});if(Ge)Ue="today",ie.append("period",Ue);else if(Ce?.from&&Ce?.to){const Be=Ce.from,Le=Ce.to,Re=new Date(Be.getFullYear(),Be.getMonth(),Be.getDate()),qe=new Date(Le.getFullYear(),Le.getMonth(),Le.getDate()),ft=qe-Re,$e=Math.ceil(ft/(1e3*60*60*24))+1;console.log("🔢 Raw calculation:",{fromDate:Be.toISOString(),toDate:Le.toISOString(),fromDateStart:Re.toISOString(),toDateStart:qe.toISOString(),diffTime:ft,diffDays:$e,diffTimeInDays:ft/(1e3*60*60*24)});let jt=null;$e>=180&&$e<=184?(jt="6 months",console.log("🎯 Detected 6 months period:",{diffDays:$e,detectedPeriod:jt})):Oi(Ce.from,"yyyy-MM-dd")==="2025-03-02"&&Oi(Ce.to,"yyyy-MM-dd")==="2025-09-02"?(jt="6 months",console.log("🎯 Special case: March-Sept 2025 detected as 6 months:",{diffDays:$e,detectedPeriod:jt})):$e>=365&&$e<=366&&(jt="1 year",console.log("🎯 Detected 1 year period:",{diffDays:$e,detectedPeriod:jt})),jt?(Ue=jt,console.log("✅ Using detected period:",Ue)):(console.log("⚠️ Using fallback logic for diffDays:",$e),$e===1?Ue="1 day":$e===2?Ue="2 days":$e<=7?Ue="7 days":$e<=30?Ue="30 days":$e<=90?Ue="90 days":$e<=184?Ue="6 months":Ue="1 year",console.log("📊 Fallback period assigned:",Ue)),V(Ce,Ue),ie.append("period",Ue);const Mt=Oi(Ce.from,"yyyy-MM-dd"),mn=Oi(Ce.to,"yyyy-MM-dd");ie.append("from_date",Mt),ie.append("to_date",mn)}else ie.append("period",Ue);const ye=await or.get(`/violations/statistics/?${ie.toString()}`);if(ye.data){const Be=ye.data.categories||{},Le=ye.data.summary||{},Re=[];Object.entries(Be).forEach(([qe,ft])=>{ft.count>0&&Re.push({category:qe,count:ft.count})}),w({violationTypes:Re,categories:ye.data.categories||{},statusCounts:{new:Le.new_count||0,raised:Le.raised_count||0,rejected:Le.rejected_count||0},summary:Le,period:ye.data.period,currentPeriod:ye.data.current_period,comparison:ye.data.comparison})}}catch{w({violationTypes:[],categories:{},statusCounts:{new:0,raised:0,rejected:0}})}},[]),ae=async()=>{if(!(I||X.current)){ne(!0);try{const Ce=(await or.get("/violation-types/")).data;Ce&&(Array.isArray(Ce)||typeof Ce=="object")?(P(Ce),X.current=!0):(console.warn("Invalid violation types data received:",Ce),P([])),de(null)}catch(fe){if(console.error("Error fetching violation types:",fe),console.error("Error details:",{message:fe.message,code:fe.code,status:fe.status}),de(fe.message||"Failed to fetch violation types"),fe.message==="Network Error"||fe.message.includes("Failed to fetch")){console.warn("Network error - this might be a CORS issue or server unavailable");const Ce=ce();Ce.length>0&&(P(Ce),de("Using cached violation types (API unavailable)"),X.current=!0)}le.length===0&&P([])}finally{ne(!1)}}},ce=()=>{if(!Array.isArray(n)||n.length===0)return[];const fe=new Set;return n.forEach(Ce=>{if(Ce.violation_types)try{const Oe=JSON.parse(Ce.violation_types||"[]");(Array.isArray(Oe)?Oe:[Oe]).forEach(Ue=>{Ue&&Ue.trim()!==""&&fe.add(Ue.replace(/\\"/g,'"').trim())})}catch{}}),Array.from(fe).map(Ce=>({name:Ce}))},he=E.useCallback(async(fe=null)=>{d(!0);try{const Ce=fe||J.dateRange;let Oe="/violations/";const Ge=new URLSearchParams;if(Ce?.from){const Re=Oi(Ce.from,"yyyy-MM-dd");Ge.append("start_date",Re)}if(Ce?.to){const Re=Oi(Ce.to,"yyyy-MM-dd");Ge.append("end_date",Re)}J.status!=="all"&&Ge.append("challan_status",J.status),J.violationTypes.length>0&&J.violationTypes.forEach(Re=>{Ge.append("violation_type",Re)}),J.search.trim()&&Ge.append("search",J.search.trim()),Ge.append("page",xe.toString()),Ge.toString()&&(Oe+=`?${Ge.toString()}`);const Ue=await or.get(Oe),ie=Ue.data?.violations||[],ye=Ue.data?.counts||{total_count:0,new_count:0,raised_count:0,rejected_count:0},Be=Ue.data?.pagination||{current_page:1,page_size:20,total_items:0,total_pages:0,has_next:!1,has_prev:!1};r(ie),g({violations:ie,counts:ye,pagination:Be}),J.status!=="all"||J.violationTypes.length>0||J.search.trim()||J.dateRange?.from&&J.dateRange?.to||y(ye)}catch{r([])}finally{d(!1)}},[J.status,J.violationTypes,J.search,xe]);E.useEffect(()=>{he(J.dateRange),Q(me),!X.current&&!I&&ae()},[]),E.useEffect(()=>{(async()=>{try{const Oe=(await or.get("/violations/")).data?.counts||{total_count:0,new_count:0,raised_count:0,rejected_count:0};y(Oe)}catch(Ce){console.error("Error fetching total counts:",Ce)}})()},[]),E.useEffect(()=>{const fe=Ce=>{k&&!Ce.target.closest(".user-menu-container")&&C(!1)};return document.addEventListener("mousedown",fe),()=>{document.removeEventListener("mousedown",fe)}},[k]),E.useEffect(()=>{const fe=Ce=>{K&&!Ce.target.closest(".violation-types-container")&&q(!1)};return document.addEventListener("mousedown",fe),()=>{document.removeEventListener("mousedown",fe)}},[K]),E.useEffect(()=>{(me?.from||me?.to)&&Q(me)},[me]),E.useEffect(()=>{he(J.dateRange)},[J.dateRange,J.status,J.violationTypes,J.search]),E.useEffect(()=>{new URLSearchParams(e.search).get("refresh")==="true"&&(he(J.dateRange),Q(me),t("/dashboard",{replace:!0}))},[e.search,t,J.dateRange,me]);const we=E.useMemo(()=>Array.isArray(n)?n.filter(fe=>{const Ce=J.search.toLowerCase(),Oe=J.search===""||fe.license_plate_number?.toLowerCase().includes(Ce)||fe.location_text?.toLowerCase().includes(Ce)||fe.junction_name?.toLowerCase().includes(Ce)||fe.police_station?.toLowerCase().includes(Ce),Ge=J.status==="all"||fe.challan_status===J.status;let Ue;try{const Be=JSON.parse(fe.violation_types||"[]");Ue=Array.isArray(Be)?Be:[Be],Ue=Ue.map(Le=>Le.replace(/\\"/g,'"').trim())}catch{Ue=[]}const ie=J.violationTypes.length===0||J.violationTypes.some(Be=>Ue.filter(Le=>Le&&Le.trim()!=="").includes(Be));return Oe&&Ge&&ie}):[],[n,J.search,J.status,J.violationTypes]),Se=p.pagination.total_pages||1;p.pagination.total_items||we.length;const Ve=we;E.useEffect(()=>{R(1)},[J.dateRange,J.status,J.violationTypes,J.search]);const He=E.useMemo(()=>{const fe=N.summary?.total_violations||p.counts.total_count||n.length,Ce=N.statusCounts.new||p.counts.new_count||(Array.isArray(n)?n.filter(ie=>ie.challan_status==="New").length:0),Oe=N.statusCounts.raised||p.counts.raised_count||(Array.isArray(n)?n.filter(ie=>ie.challan_status==="Raised").length:0),Ge=N.statusCounts.rejected||p.counts.rejected_count||(Array.isArray(n)?n.filter(ie=>ie.challan_status==="Rejected").length:0),Ue=N.comparison?.percentage_changes?.total_violations||0;return{total:fe,newCount:Ce,raisedCount:Oe,rejectedCount:Ge,percentageChange:Ue}},[N]),Je=E.useMemo(()=>{if(N.categories&&Object.keys(N.categories).length>0){const fe=[];return Object.entries(N.categories).forEach(([Oe,Ge])=>{Ge.count>0&&fe.push({category:Oe,count:Ge.count})}),fe.sort((Oe,Ge)=>Ge.count-Oe.count)}return[]},[N.categories]),it=()=>{localStorage.removeItem("accessToken"),t("/login")},dt=async fe=>{c(!0);try{const Oe=(await or.get(`/violations/${fe.id}`)).data,Ge=Oe.violation||Oe,Ue={...Ge,officer:Oe.officer||Ge.officer,vehicle:Oe.vehicle||Ge.vehicle,composite_image_path:Ge.composite_image_path||fe.composite_image_path,junction_name:Ge.junction_name||fe.junction_name};a(Ue)}catch(Ce){console.error("Failed to fetch violation details:",Ce),a({id:fe.id,license_plate_number:fe.license_plate_number,composite_image_path:fe.composite_image_path,junction_name:fe.junction_name,device_id:fe.device_id,location_text:fe.location_text,violation_types:fe.violation_types,timestamp:fe.timestamp})}finally{c(!1)}},ze=async fe=>{try{d(!0);let Ce="/violations/";const Oe=new URLSearchParams;if(J.dateRange?.from){const Be=Oi(J.dateRange.from,"yyyy-MM-dd");Oe.append("start_date",Be)}if(J.dateRange?.to){const Be=Oi(J.dateRange.to,"yyyy-MM-dd");Oe.append("end_date",Be)}J.status!=="all"&&Oe.append("challan_status",J.status),J.violationTypes.length>0&&J.violationTypes.forEach(Be=>{Oe.append("violation_type",Be)}),J.search.trim()&&Oe.append("search",J.search.trim()),Oe.append("page",fe.toString()),Oe.toString()&&(Ce+=`?${Oe.toString()}`);const Ge=await or.get(Ce),Ue=Ge.data?.violations||[],ie=Ge.data?.counts||p.counts,ye=Ge.data?.pagination||p.pagination;r(Ue),g({violations:Ue,counts:ie,pagination:ye}),R(fe)}catch{}finally{d(!1)}},ue=async()=>{p.pagination.has_prev&&await ze(p.pagination.current_page-1)},pt=async()=>{p.pagination.has_next&&await ze(p.pagination.current_page+1)},ht=fe=>{switch(fe?.toLowerCase()){case"raised":return S.jsx(yu,{className:"bg-green-100 text-green-800 border-green-200 hover:bg-green-100 hover:text-green-800 hover:border-green-200",children:"Raised"});case"rejected":return S.jsx(yu,{className:"bg-yellow-100 text-yellow-800 border-yellow-200 hover:bg-yellow-100 hover:text-yellow-800 hover:border-yellow-200",children:"Rejected"});default:return S.jsx(yu,{className:"bg-blue-100 text-blue-800 border-blue-200 hover:bg-blue-100 hover:text-blue-800 hover:border-blue-200",children:"New"})}};return E.useEffect(()=>{i&&t(`/violation/${i.id}`)},[i,t]),S.jsxs("div",{className:"flex h-screen bg-gray-50 overflow-hidden",children:[S.jsxs("div",{className:`${L?"w-48 lg:w-48 md:w-40 sm:w-32 xs:w-24":"w-16 lg:w-16 md:w-12 sm:w-10 xs:w-8"} bg-white border-r border-gray-200 flex flex-col fixed left-0 top-20 lg:top-20 md:top-16 sm:top-12 xs:top-10 h-full z-30 transition-all duration-300`,children:[S.jsx("div",{className:"p-2 border-b border-gray-200",children:S.jsx("button",{onClick:()=>j(!L),className:"w-8 h-8 flex items-center justify-center text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-md transition-colors",children:S.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:L?"M6 18L18 6M6 6l12 12":"M4 6h16M4 12h16M4 18h16"})})})}),S.jsxs("nav",{className:"flex-1 p-4 space-y-2",children:[S.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 cursor-pointer hover:bg-blue-100 transition-colors",children:[S.jsxs("div",{className:"flex items-center space-x-3",children:[S.jsx("div",{className:"w-5 h-5 flex items-center justify-center",children:S.jsx("svg",{className:"w-5 h-5 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}),L&&S.jsx("span",{className:"text-sm font-medium text-blue-700",children:"Violations"})]}),L&&S.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full"})]}),S.jsx("div",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>t("/constables"),children:S.jsxs("div",{className:"flex items-center space-x-3",children:[S.jsx("div",{className:"w-5 h-5 flex items-center justify-center",children:S.jsx("svg",{className:"w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),L&&S.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Constables"})]})})]})]}),S.jsxs("div",{className:`flex-1 flex flex-col transition-all duration-300 ${L?"ml-48 lg:ml-48 md:ml-40 sm:ml-32 xs:ml-24":"ml-16 lg:ml-16 md:ml-12 sm:ml-10 xs:ml-8"}`,children:[z&&S.jsx("div",{className:"md:hidden sm:block fixed inset-0 bg-black bg-opacity-50 z-20",children:S.jsxs("div",{className:"fixed left-0 top-0 h-full w-64 bg-white shadow-lg transform transition-transform duration-300 ease-in-out",children:[S.jsx("div",{className:"p-4 border-b border-gray-200",children:S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("h2",{className:"text-lg font-semibold text-gray-800",children:"Menu"}),S.jsx("button",{onClick:()=>O(!1),className:"w-8 h-8 flex items-center justify-center text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-md transition-colors",children:S.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),S.jsxs("nav",{className:"p-4 space-y-2",children:[S.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 cursor-pointer hover:bg-blue-100 transition-colors",children:[S.jsxs("div",{className:"flex items-center space-x-3",children:[S.jsx("div",{className:"w-5 h-5 flex items-center justify-center",children:S.jsx("svg",{className:"w-5 h-5 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}),S.jsx("span",{className:"text-sm font-medium text-blue-700",children:"Violations"})]}),S.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full"})]}),S.jsx("div",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>{t("/constables"),O(!1)},children:S.jsxs("div",{className:"flex items-center space-x-3",children:[S.jsx("div",{className:"w-5 h-5 flex items-center justify-center",children:S.jsx("svg",{className:"w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),S.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Constables"})]})})]})]})}),S.jsx("header",{className:"bg-white border-b border-gray-200 px-6 md:px-4 sm:px-3 py-2 md:py-2 sm:py-1 fixed top-0 left-0 right-0 z-20",children:S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-6 md:space-x-4 sm:space-x-3 xs:space-x-2",children:[S.jsx("div",{className:"flex items-center",children:S.jsx("img",{src:Pr("pushpakAI-logo.svg"),alt:"PUSHPAK.AI",className:"h-14 w-[145px] lg:h-14 lg:w-[145px] md:h-12 md:w-[120px] sm:h-10 sm:w-[100px] xs:h-8 xs:w-[80px]",onError:fe=>{console.error("Logo failed to load:",fe.target.src),fe.target.src!=="/image/pushpakAI-logo.svg"&&(fe.target.src="/image/pushpakAI-logo.svg")},onLoad:()=>{console.log("Logo loaded successfully:",Pr("pushpakAI-logo.svg"))}})}),S.jsx("div",{className:"border-l border-gray-300 h-12 lg:h-12 md:h-10 sm:h-8 xs:h-6"}),S.jsx("div",{className:"overview-section",children:S.jsx("h2",{className:"text-xl lg:text-xl md:text-lg sm:text-base xs:text-sm font-semibold text-gray-700",children:"Overview"})})]}),S.jsxs("div",{className:"flex items-center space-x-4 md:space-x-3 sm:space-x-2",children:[S.jsx("div",{className:"date-range-section md:block sm:hidden",children:S.jsx(L2,{value:me,onValueChange:fe=>W(fe),placeholder:"Select time range",className:"w-40 md:w-32 sm:w-28 h-10 md:h-9 sm:h-8 px-3 md:px-2 sm:px-2 py-2",hideCalendar:!0})}),S.jsxs("div",{className:"relative user-menu-container",children:[S.jsx("button",{onClick:()=>C(!k),className:"w-12 h-12 lg:w-11 lg:h-11 md:w-10 md:h-10 sm:w-9 sm:h-9 xs:w-8 xs:h-8 rounded-full flex items-center justify-center hover:bg-gray-100 transition-colors cursor-pointer border-2 border-gray-200 hover:border-gray-300",children:S.jsx("img",{src:Pr("user-circle-icon.svg"),alt:"User",className:"w-10 h-10 lg:w-9 lg:h-9 md:w-8 md:h-8 sm:w-7 sm:h-7 xs:w-6 xs:h-6",onError:fe=>{console.error("User icon failed to load:",fe.target.src),fe.target.src!=="/image/user-circle-icon.svg"&&(fe.target.src="/image/user-circle-icon.svg")},onLoad:()=>{console.log("User icon loaded successfully:",Pr("user-circle-icon.svg"))}})}),k&&S.jsx("div",{className:"absolute right-0 mt-2 w-48 md:w-40 sm:w-36 bg-white rounded-md shadow-lg border border-gray-200 z-20",children:S.jsx("div",{className:"py-1",children:S.jsxs("button",{onClick:it,className:"w-full text-left px-4 md:px-3 sm:px-2 py-2 md:py-1.5 sm:py-1 text-sm md:text-sm sm:text-xs text-gray-700 hover:bg-gray-100 transition-colors flex items-center gap-2",children:[S.jsx("svg",{className:"w-4 h-4 md:w-3.5 md:h-3.5 sm:w-3 sm:h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})}),"Logout"]})})})]})]})]})}),S.jsx("div",{className:"flex-1 mt-20 lg:mt-20 md:mt-16 sm:mt-12 xs:mt-10 overflow-y-auto bg-white",children:S.jsxs("div",{className:"p-4 md:p-4 sm:p-3 space-y-4 md:space-y-4 sm:space-y-3 max-w-full",children:[S.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-12 gap-4 md:gap-3 sm:gap-2",children:[S.jsx("div",{className:"sm:col-span-1 lg:col-span-3",children:S.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4 md:p-4 sm:p-3 h-full",children:[S.jsx("h4",{className:"text-xs text-gray-600 mb-2 md:mb-2 sm:mb-1",children:"Violations"}),S.jsx("div",{className:"w-full h-48 lg:h-60 md:h-56 sm:h-40 flex items-center justify-center",children:N.summary?.total_violations>0?S.jsxs("div",{className:"text-center flex flex-col justify-center items-center",children:[S.jsx("p",{className:"text-2xl md:text-xl sm:text-lg font-bold text-black mb-1",children:N.summary.total_violations}),S.jsxs("div",{className:`text-xs flex justify-center items-center gap-1 ${He.percentageChange>=0?"text-green-600":"text-red-600"}`,children:[S.jsx("img",{src:He.percentageChange>=0?Pr("arrow-up.svg"):Pr("down-arrow-icon.svg"),alt:He.percentageChange>=0?"↑":"↓",className:"w-3 h-3 md:w-3 md:h-3 sm:w-2.5 sm:h-2.5"}),S.jsxs("span",{children:[Math.abs(He.percentageChange).toFixed(1),"%"]})]})]}):S.jsx("div",{className:"text-center text-gray-500",children:S.jsx("p",{className:"text-sm font-medium",children:N.summary?"No Data Available":"Loading..."})})})]})}),S.jsx("div",{className:"sm:col-span-1 lg:col-span-4",children:S.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4 md:p-4 sm:p-3 h-full",children:[S.jsx("h4",{className:"text-xs text-gray-600 mb-1",children:"Violation breakdown"}),S.jsx("div",{className:"w-full h-48 lg:h-60 md:h-56 sm:h-40 flex items-center justify-center",children:Je&&Je.length>0?S.jsx(Lj,{data:Je}):S.jsx("div",{className:"text-center text-gray-500",children:S.jsx("p",{className:"text-sm font-medium",children:N.categories?"No Data Available":"Loading..."})})})]})}),S.jsx("div",{className:"sm:col-span-1 lg:col-span-5",children:S.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4 md:p-4 sm:p-3 h-full",children:[S.jsx("h4",{className:"text-xs text-gray-600 mb-1",children:"Status"}),S.jsx("div",{className:"w-full h-48 lg:h-60 md:h-56 sm:h-40 flex items-center justify-center",children:N.statusCounts.new>0||N.statusCounts.raised>0||N.statusCounts.rejected>0?S.jsx(Ej,{newCount:N.statusCounts.new||0,raisedCount:N.statusCounts.raised||0,rejectedCount:N.statusCounts.rejected||0}):S.jsx("div",{className:"text-center text-gray-500",children:S.jsx("p",{className:"text-sm font-medium",children:N.statusCounts?"No Data Available":"Loading..."})})})]})})]}),S.jsx("div",{className:"border-t border-gray-200 my-4"}),S.jsxs("div",{className:"w-full space-y-4",children:[S.jsxs("div",{className:"flex flex-wrap gap-2 bg-white rounded-lg p-2 overflow-x-auto",children:[S.jsxs("button",{onClick:()=>G(fe=>({...fe,status:"all"})),className:`py-2 px-4 rounded-md text-xs font-medium transition-colors whitespace-nowrap ${J.status==="all"?"bg-gray-100 text-black shadow-sm":"bg-white text-black hover:bg-gray-50"}`,children:[S.jsx("span",{className:"font-bold",children:"All"}),S.jsx("span",{className:"ml-2 bg-purple-100 text-purple-600 px-2 py-1 rounded-full text-xs",children:b.total_count>0?b.total_count:"No Data"})]}),S.jsxs("button",{onClick:()=>G(fe=>({...fe,status:"New"})),className:`py-2 px-4 rounded-md text-xs font-medium transition-colors whitespace-nowrap ${J.status==="New"?"bg-gray-100 text-black shadow-sm":"bg-white text-black hover:bg-gray-50"}`,children:[S.jsx("span",{children:"New"}),S.jsx("span",{className:"ml-2 bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs",children:b.new_count>0?b.new_count:"No Data"})]}),S.jsxs("button",{onClick:()=>G(fe=>({...fe,status:"Raised"})),className:`py-2 px-4 rounded-md text-xs font-medium transition-colors whitespace-nowrap ${J.status==="Raised"?"bg-gray-100 text-black shadow-sm":"bg-white text-black hover:bg-gray-50"}`,children:[S.jsx("span",{children:"Raised"}),S.jsx("span",{className:"ml-2 bg-green-100 text-green-600 px-2 py-1 rounded-full text-xs",children:b.raised_count>0?b.raised_count:"No Data"})]}),S.jsxs("button",{onClick:()=>G(fe=>({...fe,status:"Rejected"})),className:`py-2 px-4 rounded-md text-xs font-medium transition-colors whitespace-nowrap ${J.status==="Rejected"?"bg-gray-100 text-black shadow-sm":"bg-white text-black hover:bg-gray-50"}`,children:[S.jsx("span",{children:"Rejected"}),S.jsx("span",{className:"ml-2 bg-yellow-100 text-yellow-600 px-2 py-1 rounded-full text-xs",children:b.rejected_count>0?b.rejected_count:"No Data"})]})]}),S.jsxs("div",{className:"flex flex-wrap items-end gap-3 w-full",children:[S.jsxs("div",{className:"flex-1 min-w-[200px]",children:[S.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:"Search"}),S.jsx(yo,{placeholder:"Search by ID/license plate",value:J.search,onChange:fe=>G(Ce=>({...Ce,search:fe.target.value})),className:"text-sm w-full h-10"})]}),S.jsxs("div",{className:"flex-1 min-w-[200px]",children:[S.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:"Time Range"}),S.jsx(L2,{value:J.dateRange,onValueChange:fe=>G(Ce=>({...Ce,dateRange:fe})),placeholder:"Select time range",className:"w-full h-10 px-3 py-2 text-sm"})]}),S.jsxs("div",{className:"flex-1 min-w-[200px] violation-types-container",ref:H,children:[S.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:"Violation Types"}),S.jsxs("div",{className:"relative",children:[S.jsxs("button",{type:"button",onClick:()=>q(!K),className:"w-full flex items-center justify-between px-3 py-2 text-sm bg-white border border-gray-300 rounded-md hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent h-10",children:[S.jsx("span",{className:"truncate",children:J.violationTypes.length===0?"All Types":J.violationTypes.length===1?J.violationTypes[0]:`${J.violationTypes.length} types selected`}),S.jsx("svg",{className:`w-4 h-4 text-gray-400 transition-transform ${K?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),K&&S.jsxs("div",{className:`absolute top-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg z-50 max-h-64 overflow-y-auto w-80 max-w-[calc(100vw-2rem)] ${se()}`,children:[S.jsxs("div",{className:"sticky top-0 bg-white border-b border-gray-200 p-2 flex items-center justify-between",children:[S.jsx("span",{className:"text-xs font-medium text-gray-700",children:"Select Types"}),J.violationTypes.length>0&&S.jsx("button",{onClick:()=>G(fe=>({...fe,violationTypes:[]})),className:"text-xs text-blue-600 hover:text-blue-800 hover:underline",children:"Clear All"})]}),I?S.jsx("div",{className:"px-3 py-4 text-xs text-gray-500 text-center",children:"Loading violation types..."}):te?S.jsxs("div",{className:"px-3 py-2 text-xs text-red-600",children:[S.jsx("div",{children:"Error loading types"}),te.includes("Network Error")&&S.jsx("div",{className:"text-xs text-gray-500 mt-1",children:"CORS/Network issue detected"}),S.jsx("button",{onClick:fe=>{fe.preventDefault(),fe.stopPropagation(),de(null),ae()},className:"text-blue-600 hover:underline",children:"Retry"})]}):Array.isArray(le)&&le.length>0||typeof le=="object"&&le!==null&&Object.keys(le).length>0?Array.isArray(le)?le.map((fe,Ce)=>{const Oe=typeof fe=="object"?fe.name||fe.value:fe,Ge=typeof fe=="object"?fe.name||fe.label||fe.value:fe,Ue=J.violationTypes.includes(Oe);return S.jsx("button",{onClick:()=>{G(Ue?ie=>({...ie,violationTypes:ie.violationTypes.filter(ye=>ye!==Oe)}):ie=>({...ie,violationTypes:[...ie.violationTypes,Oe]}))},className:`w-full text-left px-3 py-2 text-xs cursor-pointer hover:bg-gray-50 transition-colors ${Ue?"bg-blue-50 text-blue-700 font-medium":"text-gray-700"}`,children:Ge},`flat-${Ce}`)}):typeof le=="object"&&le!==null?Object.entries(le).map(([fe,Ce])=>S.jsxs("div",{children:[S.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-gray-700 bg-gray-100 border-b border-gray-200",children:fe}),Array.isArray(Ce)?Ce.map((Oe,Ge)=>{const Ue=J.violationTypes.includes(Oe);return S.jsx("button",{onClick:()=>{G(Ue?ie=>({...ie,violationTypes:ie.violationTypes.filter(ye=>ye!==Oe)}):ie=>({...ie,violationTypes:[...ie.violationTypes,Oe]}))},className:`w-full text-left px-3 py-2 text-xs cursor-pointer hover:bg-gray-50 transition-colors pl-6 ${Ue?"bg-blue-50 text-blue-700 font-medium":"text-gray-700"}`,children:Oe},`${fe}-${Ge}`)}):S.jsx("button",{onClick:()=>{J.violationTypes.includes(Ce)?G(Oe=>({...Oe,violationTypes:Oe.violationTypes.filter(Ge=>Ge!==Ce)})):G(Oe=>({...Oe,violationTypes:[...Oe.violationTypes,Ce]}))},className:`w-full text-left px-3 py-2 text-xs cursor-pointer hover:bg-gray-50 transition-colors pl-6 ${J.violationTypes.includes(Ce)?"bg-blue-50 text-blue-700 font-medium":"text-gray-700"}`,children:Ce},`${fe}-single`)]},fe)):S.jsx("div",{className:"px-3 py-4 text-xs text-gray-500 text-center",children:"No Data Available"}):S.jsx("div",{className:"px-3 py-4 text-xs text-gray-500 text-center",children:"No Data Available"})]})]})]})]})]}),S.jsx("div",{className:"border-t border-gray-200 my-4"}),S.jsxs("div",{className:"w-full overflow-x-auto border border-gray-200 rounded-lg",style:{minWidth:"fit-content"},children:[o&&S.jsx("div",{className:"mb-2 p-2 bg-blue-50 border border-blue-200 rounded-md",children:S.jsxs("div",{className:"flex items-center space-x-2 text-blue-700",children:[S.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-700"}),S.jsx("span",{className:"text-xs",children:"Loading violation details..."})]})}),S.jsxs(ly,{className:"min-w-full text-xs",style:{tableLayout:"fixed"},children:[S.jsx(cy,{children:S.jsxs(mc,{children:[S.jsx(so,{className:"w-12 min-w-[3rem] text-xs px-2",children:"Sl.No"}),S.jsx(so,{className:"w-20 min-w-[5rem] text-xs px-2",children:"Image"}),S.jsx(so,{className:"w-24 min-w-[6rem] text-xs px-2",children:"ID"}),S.jsx(so,{className:"w-20 min-w-[5rem] text-xs px-2",children:"Status"}),S.jsx(so,{className:"w-28 min-w-[7rem] text-xs px-2",children:"License plate"}),S.jsx(so,{className:"w-64 min-w-[16rem] text-xs px-2",children:"Violation"}),S.jsx(so,{className:"w-20 min-w-[5rem] text-xs px-2",children:"Location"}),S.jsx(so,{className:"w-32 min-w-[8rem] text-xs px-2",children:"Time"})]})}),S.jsx(uy,{children:f?S.jsx(mc,{children:S.jsx(ma,{colSpan:"8",className:"h-12 text-center text-xs py-1 px-2",children:"Loading violations..."})}):Ve.length>0?Ve.map((fe,Ce)=>S.jsxs(mc,{onClick:()=>!o&&dt(fe),className:`cursor-pointer hover:bg-gray-50 h-9 ${o?"opacity-50":""}`,children:[S.jsx(ma,{className:"text-xs text-gray-400 py-1 px-2",children:(p.pagination.current_page-1)*p.pagination.page_size+Ce+1}),S.jsx(ma,{className:"py-1 px-2",children:S.jsx("div",{className:"w-16 h-12 bg-gray-200 rounded-lg flex items-center justify-center",children:S.jsx("img",{src:fe.composite_image_path||"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSIjRjNGNEY2Ii8+Cjx0ZXh0IHg9IjUwIiB5PSI1MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmaWxsPSIjNjc3NDhCIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+SW1hZ2U8L3RleHQ+Cjx0ZXh0IHg9IjUwIiB5PSI2NSIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmaWxsPSIjNjc3NDhCIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+Tm90IEF2YWlsYWJsZTwvdGV4dD4KPC9zdmc+",alt:"Violation",className:"w-full h-full object-cover rounded-lg",onError:Oe=>{Oe.target.src!==Pr("Capture.PNG")?Oe.target.src=Pr("Capture.PNG"):Oe.target.style.display="none"}})})}),S.jsx(ma,{className:"font-mono text-xs py-1 px-2",children:fe.id||"-"}),S.jsx(ma,{className:"text-xs py-1 px-2",children:fe.challan_status?ht(fe.challan_status):"-"}),S.jsx(ma,{className:"font-mono text-xs py-1 px-2",children:fe.license_plate_number||"-"}),S.jsx(ma,{className:"text-xs py-1 px-2",children:(()=>{if(!fe.violation_types)return"-";let Oe=[];if(typeof fe.violation_types!="string")Oe=[String(fe.violation_types||"")];else try{const Ue=JSON.parse(fe.violation_types);Array.isArray(Ue)?Oe=Ue.map(ie=>typeof ie=="string"?ie.trim():String(ie).trim()).filter(ie=>ie):Ue&&typeof Ue=="string"?Oe=Ue.split(",").map(ie=>ie.trim()).filter(ie=>ie):Oe=[Ue]}catch{let ie=fe.violation_types;typeof ie!="string"&&(ie=String(ie||"")),ie.includes(",")?Oe=ie.split(",").map(ye=>ye.trim()).filter(ye=>ye):ie.includes(";")?Oe=ie.split(";").map(ye=>ye.trim()).filter(ye=>ye):ie.includes("|")?Oe=ie.split("|").map(ye=>ye.trim()).filter(ye=>ye):Oe=[typeof ie=="string"?ie.trim():String(ie).trim()]}Oe=Oe.filter(Ue=>Ue&&typeof Ue=="string"&&Ue.trim()!=="").map(Ue=>typeof Ue=="string"?Ue.replace(/\\"/g,'"').trim():String(Ue).trim()).filter(Ue=>Ue.length>0);const Ge=Oe.length;return Ge===0?"-":Ge<=2?S.jsx("div",{className:"flex flex-wrap gap-1",children:Oe.map((Ue,ie)=>S.jsx(yu,{className:"bg-blue-100 text-blue-800 border-blue-200 text-xs hover:bg-blue-100 hover:text-blue-800 hover:border-blue-200",children:Ue},ie))}):S.jsxs("div",{className:"flex flex-wrap gap-1",children:[Oe.slice(0,2).map((Ue,ie)=>S.jsx(yu,{className:"bg-blue-100 text-blue-800 border-blue-200 text-xs hover:bg-blue-100 hover:text-blue-800 hover:border-blue-200",children:Ue},ie)),S.jsxs(yu,{className:"bg-blue-100 text-blue-800 border-blue-200 text-xs hover:bg-blue-100 hover:text-blue-800 hover:border-blue-200",children:["+",Ge-2]})]})})()}),S.jsx(ma,{className:"w-20 min-w-[5rem] text-xs py-1 px-2",children:S.jsx("div",{className:"text-xs leading-tight w-20 min-w-[5rem] max-w-20 overflow-hidden",children:fe.location_text?(()=>{const Oe=fe.location_text.split(",").map(ie=>ie.trim()).filter(ie=>ie.length>0),Ge=Oe.slice(0,2),Ue=Oe.slice(2);return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"truncate w-full",children:[Ge.join(", "),Ge.length>0&&Oe.length>2?",":""]}),Ue.length>0&&S.jsxs("div",{className:"truncate w-full",children:[Ue[0],Ue.length>1?"...":""]})]})})():"-"})}),S.jsx(ma,{className:"text-xs py-1 px-2",children:fe.timestamp?S.jsxs(S.Fragment,{children:[new Date(fe.timestamp+"Z").toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})," | ",new Date(fe.timestamp+"Z").toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]}):"-"})]},fe.id)):S.jsx(mc,{children:S.jsx(ma,{colSpan:"8",className:"h-16 text-center text-sm py-1",children:p.counts.total_count===0?"No Data Available":"No violations match the current filters."})})})]})]}),Se>1&&S.jsxs("div",{className:"flex flex-col items-center space-y-2 md:space-y-2 sm:space-y-1 py-4 md:py-4 sm:py-3",children:[S.jsxs("div",{className:"text-xs text-gray-600",children:["Page ",p.pagination.current_page," of ",Se,"(",p.pagination.total_items," total violations)"]}),S.jsxs("div",{className:"flex items-center justify-center space-x-1 md:space-x-1 sm:space-x-0.5",children:[S.jsx("button",{onClick:ue,disabled:!p.pagination.has_prev,className:`w-6 h-6 md:w-6 md:h-6 sm:w-5 sm:h-5 rounded-sm border text-xs font-medium transition-colors ${p.pagination.has_prev?"bg-white text-gray-600 hover:bg-gray-50 border-gray-200":"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200"}`,children:"‹"}),(()=>{const fe=[];for(let Ce=1;Ce<=Math.min(2,Se);Ce++)fe.push(S.jsx("button",{onClick:()=>ze(Ce),className:`w-6 h-6 rounded-sm border text-xs font-medium transition-colors ${p.pagination.current_page===Ce?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-600 hover:bg-gray-50 border-gray-200"}`,children:Ce},Ce));if(Se>4&&fe.push(S.jsx("span",{className:"w-6 h-6 flex items-center justify-center text-xs text-gray-600 border border-gray-200 rounded-sm",children:"..."},"ellipsis")),Se>2)for(let Ce=Math.max(3,Se-1);Ce<=Se;Ce++)Ce>2&&fe.push(S.jsx("button",{onClick:()=>ze(Ce),className:`w-6 h-6 rounded-sm border text-xs font-medium transition-colors ${p.pagination.current_page===Ce?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-600 hover:bg-gray-50 border-gray-200"}`,children:Ce},Ce));return fe})(),S.jsx("button",{onClick:pt,disabled:!p.pagination.has_next,className:`w-6 h-6 rounded-sm border text-xs font-medium transition-colors ${p.pagination.has_next?"bg-white text-gray-600 hover:bg-gray-50 border-gray-200":"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200"}`,children:"›"})]})]})]})}),S.jsx("div",{className:"bg-white px-4 py-2 text-left text-sm text-gray-400",children:S.jsx("p",{children:"© 2025 PushpakAI. All rights reserved."})})]})]})}function wm({children:t,title:e,currentPage:n="dashboard",showSidebar:r=!0,showHeader:i=!0,className:a=""}){const o=Pu(),[c,f]=E.useState(!1),[d,p]=E.useState(!1),[g,b]=E.useState(!0);E.useEffect(()=>{const k=()=>{if(hk())console.log("Token expired, logging out user"),w5();else{const L=pk(),j=30*60*1e3;L<j&&L>0?p(!0):p(!1)}};k();const C=setInterval(k,6e4);return()=>clearInterval(C)},[]);const y=()=>{w5()},N=()=>{o("/dashboard")},w=()=>{o("/constables")};return S.jsxs("div",{className:`flex h-screen bg-gray-50 overflow-hidden ${a}`,children:[r&&S.jsxs("div",{className:`${g?"w-48 lg:w-48 md:w-40 sm:w-32 xs:w-24":"w-16 lg:w-16 md:w-12 sm:w-10 xs:w-8"} bg-white border-r border-gray-200 flex flex-col fixed left-0 top-20 lg:top-20 md:top-16 sm:top-12 xs:top-10 h-full z-30 transition-all duration-300`,children:[S.jsx("div",{className:"p-2 border-b border-gray-200",children:S.jsx("button",{onClick:()=>b(!g),className:"w-8 h-8 flex items-center justify-center text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-md transition-colors",children:S.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:g?"M6 18L18 6M6 6l12 12":"M4 6h16M4 12h16M4 18h16"})})})}),S.jsxs("nav",{className:"flex-1 p-4 lg:p-4 md:p-3 sm:p-2 xs:p-1 space-y-2 lg:space-y-2 md:space-y-1.5 sm:space-y-1 xs:space-y-1",children:[S.jsxs("div",{className:`flex items-center justify-between p-3 md:p-3 sm:p-2 rounded-lg cursor-pointer transition-colors ${n==="dashboard"?"bg-blue-50 hover:bg-blue-100":"bg-gray-50 hover:bg-gray-100"}`,onClick:N,children:[S.jsxs("div",{className:"flex items-center space-x-3 lg:space-x-3 md:space-x-2 sm:space-x-1.5 xs:space-x-1",children:[S.jsx("div",{className:"w-5 h-5 lg:w-5 lg:h-5 md:w-4 md:h-4 sm:w-3.5 sm:h-3.5 xs:w-3 xs:h-3 flex items-center justify-center",children:S.jsx("svg",{className:`w-5 h-5 lg:w-5 lg:h-5 md:w-4 md:h-4 sm:w-3.5 sm:h-3.5 xs:w-3 xs:h-3 ${n==="dashboard"?"text-blue-600":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}),g&&S.jsx("span",{className:`font-medium text-xs lg:text-xs md:text-sm sm:text-xs xs:text-xs font-sans ${n==="dashboard"?"text-blue-700":"text-gray-600"}`,children:"Violations"})]}),n==="dashboard"&&g&&S.jsx("div",{className:"w-2 h-2 lg:w-2 lg:h-2 md:w-1.5 md:h-1.5 sm:w-1 sm:h-1 xs:w-1 xs:h-1 bg-blue-500 rounded-full"})]}),S.jsxs("div",{className:`flex items-center justify-between p-3 md:p-3 sm:p-2 rounded-lg cursor-pointer transition-colors ${n==="constables"?"bg-blue-50 hover:bg-blue-100":"bg-gray-50 hover:bg-gray-100"}`,onClick:w,children:[S.jsxs("div",{className:"flex items-center space-x-3 lg:space-x-3 md:space-x-2 sm:space-x-1.5 xs:space-x-1",children:[S.jsx("div",{className:"w-5 h-5 lg:w-5 lg:h-5 md:w-4 md:h-4 sm:w-3.5 sm:h-3.5 xs:w-3 xs:h-3 flex items-center justify-center",children:S.jsx("svg",{className:`w-5 h-5 lg:w-5 lg:h-5 md:w-4 md:h-4 sm:w-3.5 sm:h-3.5 xs:w-3 xs:h-3 ${n==="constables"?"text-blue-600":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),g&&S.jsx("span",{className:`font-medium text-xs lg:text-xs md:text-sm sm:text-xs xs:text-xs font-sans ${n==="constables"?"text-blue-700":"text-gray-600"}`,children:"Constables"})]}),n==="constables"&&g&&S.jsx("div",{className:"w-2 h-2 lg:w-2 lg:h-2 md:w-1.5 md:h-1.5 sm:w-1 sm:h-1 xs:w-1 xs:h-1 bg-blue-500 rounded-full"})]})]})]}),S.jsxs("div",{className:`flex-1 flex flex-col ${r?g?"ml-48 lg:ml-48 md:ml-40 sm:ml-32 xs:ml-24":"ml-16 lg:ml-16 md:ml-12 sm:ml-10 xs:ml-8":"ml-0"} mt-4 lg:mt-4 md:mt-3 sm:mt-2 xs:mt-1 transition-all duration-300`,children:[i&&S.jsx("header",{className:"bg-white border-b border-gray-200 px-6 lg:px-6 md:px-4 sm:px-3 xs:px-2 py-2 lg:py-2 md:py-1.5 sm:py-1 xs:py-1 fixed top-0 left-0 right-0 z-20",children:S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-6 md:space-x-4 sm:space-x-3 xs:space-x-2",children:[S.jsx("div",{className:"flex items-center",children:S.jsx("img",{src:Pr("pushpakAI-logo.svg"),alt:"PUSHPAK.AI",className:"h-14 w-[145px] lg:h-14 lg:w-[145px] md:h-12 md:w-[120px] sm:h-10 sm:w-[100px] xs:h-8 xs:w-[80px]"})}),S.jsx("div",{className:"border-l border-gray-300 h-12 lg:h-12 md:h-10 sm:h-8 xs:h-6"}),S.jsx("div",{className:"flex items-center space-x-4 lg:space-x-4 md:space-x-3 sm:space-x-2 xs:space-x-1",children:e&&S.jsx("h1",{className:"text-lg lg:text-lg md:text-base sm:text-sm xs:text-xs font-bold text-gray-900 font-sans",children:e})})]}),S.jsxs("div",{className:"relative user-menu-container",children:[S.jsx("button",{onClick:()=>f(!c),className:"w-12 h-12 lg:w-11 lg:h-11 md:w-10 md:h-10 sm:w-9 sm:h-9 xs:w-8 xs:h-8 rounded-full flex items-center justify-center hover:bg-gray-100 transition-colors cursor-pointer border-2 border-gray-200 hover:border-gray-300",children:S.jsx("img",{src:Pr("user-circle-icon.svg"),alt:"User",className:"w-10 h-10 lg:w-9 lg:h-9 md:w-8 md:h-8 sm:w-7 sm:h-7 xs:w-6 xs:h-6"})}),c&&S.jsx("div",{className:"absolute right-0 mt-2 w-48 md:w-48 sm:w-40 bg-white rounded-md shadow-lg border border-gray-200 z-20",children:S.jsx("div",{className:"py-1",children:S.jsxs("button",{onClick:y,className:"w-full text-left px-4 md:px-4 sm:px-3 py-2 md:py-2 sm:py-1.5 text-xs md:text-sm sm:text-xs text-gray-700 hover:bg-gray-100 transition-colors flex items-center gap-2 font-sans",children:[S.jsx("svg",{className:"w-4 h-4 md:w-4 md:h-4 sm:w-3.5 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 16l4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})}),"Logout"]})})})]})]})}),d&&S.jsx("div",{className:"fixed top-20 right-4 z-50 bg-yellow-100 border border-yellow-400 text-yellow-800 px-4 py-3 rounded-lg shadow-lg",children:S.jsxs("div",{className:"flex items-center space-x-2",children:[S.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.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-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),S.jsx("span",{className:"font-medium",children:"Your session will expire in less than 30 minutes. Please save your work."}),S.jsx("button",{onClick:()=>p(!1),className:"ml-2 hover:bg-yellow-200 rounded-full p-1",children:S.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),S.jsx("div",{className:`flex-1 p-6 md:p-6 sm:p-4 space-y-6 md:space-y-6 sm:space-y-4 ${i?"mt-16 md:mt-16 sm:mt-12":""} overflow-y-auto bg-white`,children:t}),S.jsx("div",{className:"bg-white px-4 md:px-4 sm:px-3 py-2 md:py-2 sm:py-1.5 text-left text-xs md:text-sm sm:text-xs text-gray-400",children:S.jsx("p",{children:"© 2025 PushpakAI. All rights reserved."})})]})]})}function nB({data:t=[],columns:e=[],searchable:n=!0,searchPlaceholder:r="Search...",searchFields:i=[],pagination:a=!0,pageSize:o=20,className:c="",emptyMessage:f="No data found.",onRowClick:d=null,rowClassName:p="",headerClassName:g="",cellClassName:b=""}){const[y,N]=E.useState(1),[w,k]=E.useState(""),C=E.useMemo(()=>!n||!w.trim()?t:t.filter(le=>i.length===0?Object.values(le).some(P=>String(P).toLowerCase().includes(w.toLowerCase())):i.some(P=>{const I=le[P];return String(I).toLowerCase().includes(w.toLowerCase())})),[t,w,n,i]),L=Math.ceil(C.length/o),j=(y-1)*o,z=j+o,O=C.slice(j,z),K=le=>{N(le)},q=()=>{y<L&&N(y+1)},H=()=>{y>1&&N(y-1)};st.useEffect(()=>{N(1)},[w]);const se=le=>{d&&d(le)};return S.jsxs("div",{className:`space-y-4 ${c}`,children:[n&&S.jsxs("div",{className:"relative max-w-md",children:[S.jsx($R,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 text-gray-400 w-3 h-3"}),S.jsx(yo,{placeholder:r,value:w,onChange:le=>k(le.target.value),className:"pl-8 font-sans"})]}),S.jsxs("div",{className:"text-xs text-gray-600 font-sans",children:["Total records: ",C.length]}),S.jsx("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:S.jsx("div",{className:"overflow-x-auto",children:S.jsxs(ly,{children:[S.jsx(cy,{children:S.jsx(mc,{className:"bg-gray-50",children:e.map((le,P)=>S.jsx(so,{className:`text-left text-xs font-bold text-gray-600 py-1 px-2 font-sans ${g}`,children:le.header},P))})}),S.jsx(uy,{children:O.length>0?O.map((le,P)=>S.jsx(mc,{className:`${p} ${d?"cursor-pointer":""}`,onClick:()=>se(le),children:e.map((I,ne)=>S.jsx(ma,{className:`text-xs text-gray-900 py-1 px-2 font-sans ${b}`,children:I.render?I.render(le[I.key],le):le[I.key]},ne))},le.id||P)):S.jsx(mc,{children:S.jsx(ma,{colSpan:e.length,className:"h-8 text-center text-xs text-gray-500 font-sans",children:f})})})]})})}),a&&L>1&&S.jsxs("div",{className:"flex flex-col items-end space-y-1 py-2",children:[S.jsxs("div",{className:"text-xs text-gray-600 font-sans",children:["Page ",y," of ",L,"(",C.length," total records)"]}),S.jsxs("div",{className:"flex items-center justify-end space-x-0.5",children:[S.jsx("button",{onClick:H,disabled:y===1,className:`w-5 h-5 rounded-sm border text-xs font-medium transition-colors font-sans ${y===1?"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200":"bg-white text-gray-600 hover:bg-gray-50 border-gray-200"}`,children:"‹"}),(()=>{const le=[];for(let P=1;P<=Math.min(2,L);P++)le.push(S.jsx("button",{onClick:()=>K(P),className:`w-5 h-5 rounded-sm border text-xs font-medium transition-colors font-sans ${y===P?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-600 hover:bg-gray-50 border-gray-200"}`,children:P},P));if(L>4&&le.push(S.jsx("span",{className:"w-5 h-5 flex items-center justify-center text-xs text-gray-600 border border-gray-200 rounded-sm font-sans",children:"..."},"ellipsis")),L>2)for(let P=Math.max(3,L-1);P<=L;P++)P>2&&le.push(S.jsx("button",{onClick:()=>K(P),className:`w-5 h-5 rounded-sm border text-xs font-medium transition-colors font-sans ${y===P?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-600 hover:bg-gray-50 border-gray-200"}`,children:P},P));return le})(),S.jsx("button",{onClick:q,disabled:y===L,className:`w-5 h-5 rounded-sm border text-xs font-medium transition-colors font-sans ${y===L?"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200":"bg-white text-gray-600 hover:bg-gray-50 border-gray-200"}`,children:"›"})]})]})]})}function rB({filters:t={},onFilterChange:e,filterConfigs:n=[],className:r="",showSearch:i=!0,searchPlaceholder:a="Search...",searchFields:o=[]}){const c=(d,p)=>{e&&e({...t,[d]:p})},f=d=>{const{key:p,type:g,label:b,options:y=[],placeholder:N,className:w}=d;switch(g){case"select":return S.jsxs("div",{className:`w-full md:w-60 sm:w-full ${w||""}`,children:[S.jsx("label",{className:"block text-xs text-gray-600 mb-1 font-sans",children:b}),S.jsxs(ZR,{value:t[p]||"all",onValueChange:k=>c(p,k),children:[S.jsx(x_,{className:"w-full font-sans text-xs md:text-sm sm:text-xs",children:S.jsx(KR,{placeholder:N||b})}),S.jsx(__,{children:y.map(k=>S.jsx(N_,{value:k.value,children:k.label},k.value))})]})]},p);case"dateRange":return S.jsx("div",{className:`w-full md:w-auto sm:w-full ${w||""}`,children:S.jsx(L2,{value:t[p],onChange:k=>c(p,k),className:"font-sans text-xs md:text-sm sm:text-xs"})},p);case"input":return S.jsx("div",{className:`w-full md:w-60 sm:w-full ${w||""}`,children:S.jsx(yo,{placeholder:N||b,value:t[p]||"",onChange:k=>c(p,k.target.value),className:"font-sans text-xs md:text-sm sm:text-xs"})},p);default:return null}};return S.jsxs("div",{className:`flex flex-col md:flex-row sm:flex-col items-start md:items-center sm:items-start gap-3 md:gap-3 sm:gap-2 ${r}`,children:[i&&S.jsxs("div",{className:"flex-1 max-w-md w-full",children:[S.jsx("label",{className:"block text-xs text-gray-600 mb-1 font-sans",children:"Search"}),S.jsxs("div",{className:"relative",children:[S.jsx("svg",{className:"absolute left-2 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4 md:w-4 md:h-4 sm:w-3.5 sm:h-3.5 pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),S.jsx(yo,{placeholder:a,value:t.search||"",onChange:d=>c("search",d.target.value),className:"pl-8 font-sans text-xs md:text-sm sm:text-xs"})]})]}),n.map(f)]})}const Sm={policeStation:{key:"policeStation",type:"select",label:"Police Station",placeholder:"Select Police Station",options:[{value:"all",label:"All"},{value:"Central Police Station",label:"Central Police Station"},{value:"North Police Station",label:"North Police Station"},{value:"South Police Station",label:"South Police Station"},{value:"East Police Station",label:"East Police Station"},{value:"West Police Station",label:"West Police Station"}]}};function iB({endpoint:t,initialFilters:e={},initialPageSize:n=10,transformData:r=null,dependencies:i=[]}){const[a,o]=E.useState([]),[c,f]=E.useState([]),[d,p]=E.useState(!0),[g,b]=E.useState(null),[y,N]=E.useState(e),[w,k]=E.useState(1),[C,L]=E.useState(n),j=E.useCallback(async()=>{p(!0),b(null);try{const ne={page:w,limit:C};y.search&&y.search.trim()&&(ne.search=y.search.trim()),y.policeStation&&y.policeStation!=="all"&&(ne.police_station=y.policeStation),console.log("API Request:",{endpoint:t,params:ne});const te=await or.get(t,{params:ne});console.log("API Response:",te.data);let de=te.data;t==="/constables/"&&(console.log("Setting full response data for constables:",de),console.log("Data structure check:",{hasConstables:!!de.constables,hasPagination:!!de.pagination,constablesLength:de.constables?.length,paginationData:de.pagination}),o(de))}catch(ne){console.error("Failed to fetch data:",ne),console.error("Error details:",{message:ne.message,status:ne.response?.status,statusText:ne.response?.statusText,data:ne.response?.data,url:ne.config?.url}),b(ne.message||"Failed to fetch data")}finally{p(!1)}},[t,r,w,C,y,...i]),z=E.useCallback((ne,te)=>(console.log("Applying filters:",{dataToFilter:ne,currentFilters:te}),!ne||!Array.isArray(ne)?(console.log("No data to filter or not an array"),[]):ne.filter(de=>{if(te.search&&te.search.trim()){const X=te.search.toLowerCase();if(!Object.values(de).filter(G=>typeof G=="string"||typeof G=="number").some(G=>String(G).toLowerCase().includes(X)))return!1}if(te.status&&te.status!=="all"&&de.status?.toLowerCase()!==te.status.toLowerCase()||te.policeStation&&te.policeStation!=="all"&&de.police_station!==te.policeStation||te.violationType&&te.violationType!=="all"&&de.violation_type!==te.violationType)return!1;if(te.dateRange?.from&&te.dateRange?.to){const X=new Date(de.timestamp||de.created_at),J=new Date(te.dateRange.from),G=new Date(te.dateRange.to);if(X<J||X>G)return!1}return!0})),[]),O=E.useCallback(ne=>{console.log("Updating filters:",{prev:y,new:ne}),N(te=>({...te,...ne})),k(1)},[y]),K=E.useCallback(ne=>{console.log("Updating page size:",ne),L(ne),k(1)},[]),q=E.useCallback(ne=>{console.log("Going to page:",ne),k(ne)},[]),H=E.useCallback(()=>{console.log("Next page called:",{endpoint:t,hasPagination:!!a.pagination}),a.pagination?(console.log("Using server-side pagination, incrementing page"),k(ne=>ne+1)):(console.log("Using client-side pagination"),k(ne=>Math.min(ne+1,Math.ceil(c.length/C))))},[t,a.pagination,c.length,C]),se=E.useCallback(()=>{console.log("Previous page called"),k(ne=>Math.max(ne-1,1))},[]),le=E.useCallback(()=>{console.log("Refreshing data"),j()},[j]);E.useEffect(()=>{console.log("Applying filters to data:",{data:a,filters:y});const ne=z(a,y);console.log("Filtered data result:",ne),f(ne)},[a,y,z]),E.useEffect(()=>{console.log("Fetching data for endpoint:",t),j()},[j]);const P=E.useMemo(()=>{if(console.log("Calculating pagination info:",{endpoint:t,data:a,filteredData:c,currentPage:w,pageSize:C}),a.pagination){console.log("Using server-side pagination for constables:",a.pagination);const G={totalItems:a.pagination.total_constables,totalPages:a.pagination.total_pages,currentPage:a.pagination.current_page,pageSize:a.pagination.limit,startIndex:(a.pagination.current_page-1)*a.pagination.limit,endIndex:Math.min((a.pagination.current_page-1)*a.pagination.limit+a.pagination.limit,a.pagination.total_constables),currentData:a.constables||[],hasNext:a.pagination.has_next,hasPrev:a.pagination.has_prev};return console.log("Calculated pagination data:",G),G}console.log("Using client-side pagination fallback");const ne=c.length,te=Math.ceil(ne/C),de=(w-1)*C,X=Math.min(de+C,ne),J=c.slice(de,X);return{totalItems:ne,totalPages:te,currentPage:w,pageSize:C,startIndex:de,endIndex:X,currentData:J,hasNext:w<te,hasPrev:w>1}},[t,a,c,w,C]),I={data:a,filteredData:c,currentData:P.currentData,isLoading:d,error:g,filters:y,updateFilters:O,paginationInfo:P,goToPage:q,nextPage:H,previousPage:se,updatePageSize:K,refreshData:le,fetchData:j};return console.log("useDataManager returning:",I),I}const aB={violations:{endpoint:"/violations",initialFilters:{search:"",status:"all",violationType:"all",dateRange:{from:new Date(Date.now()-30*24*60*60*1e3),to:new Date}},transformData:t=>t.violations?t.violations:Array.isArray(t)?t:[]},constables:{endpoint:"/constables/",initialFilters:{search:"",policeStation:"all"},transformData:t=>(console.log("Transform data input (not used for constables):",t),t)}};function sB({paginationInfo:t,onPageChange:e,onPageSizeChange:n}){return!t||t.totalPages<=1?null:S.jsxs("div",{className:"flex flex-col items-end space-y-1 md:space-y-1 sm:space-y-0.5 py-2 md:py-2 sm:py-1",children:[S.jsxs("div",{className:"text-xs md:text-xs sm:text-xs text-gray-600 font-sans",children:["Page ",t.currentPage," of ",t.totalPages,"(",t.totalItems," total records)"]}),S.jsxs("div",{className:"flex items-center justify-end space-x-0.5 md:space-x-0.5 sm:space-x-0.5",children:[S.jsx("button",{onClick:()=>e(t.currentPage-1),disabled:!t.hasPrev,className:`w-5 h-5 md:w-5 md:h-5 sm:w-4 sm:h-4 rounded-sm border text-xs md:text-xs sm:text-xs font-medium transition-colors font-sans ${t.hasPrev?"bg-white text-gray-600 hover:bg-gray-50 border-gray-200":"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200"}`,children:"‹"}),(()=>{const r=[],i=t.totalPages,a=t.currentPage;for(let o=1;o<=Math.min(2,i);o++)r.push(S.jsx("button",{onClick:()=>e(o),className:`w-5 h-5 md:w-5 md:h-5 sm:w-4 sm:h-4 rounded-sm border text-xs md:text-xs sm:text-xs font-medium transition-colors font-sans ${a===o?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-600 hover:bg-gray-50 border-gray-200"}`,children:o},o));if(i>4&&r.push(S.jsx("span",{className:"w-5 h-5 md:w-5 md:h-5 sm:w-4 sm:h-4 flex items-center justify-center text-xs md:text-xs sm:text-xs text-gray-600 border border-gray-200 rounded-sm font-sans",children:"..."},"ellipsis")),i>2)for(let o=Math.max(3,i-1);o<=i;o++)o>2&&r.push(S.jsx("button",{onClick:()=>e(o),className:`w-5 h-5 md:w-5 md:h-5 sm:w-4 sm:h-4 rounded-sm border text-xs md:text-xs sm:text-xs font-medium transition-colors font-sans ${a===o?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-600 hover:bg-gray-50 border-gray-200"}`,children:o},o));return r})(),S.jsx("button",{onClick:()=>e(t.currentPage+1),disabled:!t.hasNext,className:`w-5 h-5 md:w-5 md:h-5 sm:w-4 sm:h-4 rounded-sm border text-xs md:text-xs sm:text-xs font-medium transition-colors font-sans ${t.hasNext?"bg-white text-gray-600 hover:bg-gray-50 border-gray-200":"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200"}`,children:"›"})]})]})}function oB(){const{data:t,filteredData:e,currentData:n,isLoading:r,error:i,filters:a,updateFilters:o,paginationInfo:c,goToPage:f}=iB(aB.constables),[d,p]=E.useState(Sm.policeStation);if(console.log("ConstablesPage - Data:",t),console.log("ConstablesPage - PaginationInfo:",c),console.log("ConstablesPage - CurrentData:",c?.currentData),E.useEffect(()=>{p(Sm.policeStation)},[]),E.useEffect(()=>{if(t&&t.constables&&Array.isArray(t.constables)){const y=[...new Set(t.constables.map(N=>N.police_station).filter(N=>N))].sort();if(console.log("Updating dynamic police station filter with:",y),y.length>0){const N={key:"policeStation",type:"select",label:"Police Station",placeholder:"Select Police Station",options:[{value:"all",label:"All Police Stations"},...y.map(w=>({value:w,label:w}))]};p(N),a.policeStation&&a.policeStation!=="all"&&(y.includes(a.policeStation)||(console.log("Current police station selection is no longer valid, resetting to all"),o({policeStation:"all"})))}else console.log("No police stations found in data, keeping static fallback"),p(Sm.policeStation),a.policeStation&&a.policeStation!=="all"&&(console.log("Resetting police station filter to all due to no data"),o({policeStation:"all"}))}else t||(console.log("No data yet, using static fallback"),p(Sm.policeStation))},[t]),!t||!c)return S.jsx(wm,{title:"Constables",currentPage:"constables",children:S.jsx("div",{className:"flex-1 p-4 md:p-4 sm:p-3 bg-white",children:S.jsx("div",{className:"flex items-center justify-center h-64 md:h-56 sm:h-48",children:S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-gray-600 md:text-sm sm:text-xs mb-4 md:mb-3 sm:mb-2",children:r?"Loading constables...":"No data available"}),!r&&S.jsx("button",{onClick:()=>window.location.reload(),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm md:text-sm sm:text-xs",children:"Retry"})]})})})});const g=[{key:"login_id",header:"Login ID"},{key:"name",header:"Name"},{key:"police_station",header:"Police Station"},{key:"mobile",header:"Mobile Number"}],b=y=>{console.log("Clicked constable:",y)};return r?S.jsx(wm,{title:"Constables",currentPage:"constables",children:S.jsx("div",{className:"flex-1 p-4 md:p-4 sm:p-3 bg-white",children:S.jsx("div",{className:"flex items-center justify-center h-64 md:h-56 sm:h-48",children:S.jsxs("div",{className:"text-center",children:[S.jsx("div",{className:"animate-spin rounded-full h-12 w-12 md:h-10 md:w-10 sm:h-8 sm:w-8 border-b-2 border-blue-600 mx-auto mb-4 md:mb-3 sm:mb-2"}),S.jsx("p",{className:"text-gray-600 md:text-sm sm:text-xs",children:"Loading constables..."})]})})})}):i?S.jsx(wm,{title:"Constables",currentPage:"constables",children:S.jsx("div",{className:"flex-1 p-4 md:p-4 sm:p-3 bg-white",children:S.jsx("div",{className:"flex items-center justify-center h-64 md:h-56 sm:h-48",children:S.jsxs("div",{className:"text-center",children:[S.jsxs("p",{className:"text-red-600 md:text-sm sm:text-xs mb-4 md:mb-3 sm:mb-2",children:["Error loading constables: ",i]}),S.jsx("button",{onClick:()=>window.location.reload(),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm md:text-sm sm:text-xs",children:"Retry"})]})})})}):S.jsx(wm,{title:"Constables",currentPage:"constables",children:S.jsxs("div",{className:"flex-1 p-4 md:p-4 sm:p-3 space-y-4 md:space-y-3 sm:space-y-2 bg-white font-inter",children:[S.jsx(rB,{filters:a,onFilterChange:o,filterConfigs:[d],showSearch:!0,searchPlaceholder:"Search constables...",className:"mb-2 md:mb-2 sm:mb-1"}),S.jsx(nB,{data:c.currentData||[],columns:g,searchable:!1,pagination:!1,pageSize:c.pageSize,emptyMessage:c.currentData?c.currentData.length===0?"No constables found.":"No constables match the current filters.":"Loading constables...",onRowClick:b,className:"mt-4 md:mt-3 sm:mt-2",rowClassName:"hover:bg-gray-50 transition-colors",cellClassName:"py-4 md:py-3 sm:py-2"}),c&&c.totalPages>0?S.jsx(sB,{paginationInfo:c,onPageChange:f}):S.jsx("div",{className:"text-center text-gray-500 text-sm md:text-sm sm:text-xs mt-4 md:mt-3 sm:mt-2",children:c?"No pagination data available":"Loading pagination..."})]})})}var lB="Separator",yw="horizontal",cB=["horizontal","vertical"],K_=E.forwardRef((t,e)=>{const{decorative:n,orientation:r=yw,...i}=t,a=uB(r)?r:yw,c=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return S.jsx(xn.div,{"data-orientation":a,...c,...i,ref:e})});K_.displayName=lB;function uB(t){return cB.includes(t)}var Q_=K_;const fB=E.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},i)=>S.jsx(Q_,{ref:i,decorative:n,orientation:e,className:wt("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));fB.displayName=Q_.displayName;var J_="Dialog",[eN,WI]=$h(J_),[YI,xs]=eN(J_),tN="DialogTrigger",dB=E.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=xs(tN,n),a=cr(e,i.triggerRef);return S.jsx(xn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Yy(i.open),...r,ref:a,onClick:vn(t.onClick,i.onOpenToggle)})});dB.displayName=tN;var qy="DialogPortal",[hB,nN]=eN(qy,{forceMount:void 0}),rN=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,a=xs(qy,e);return S.jsx(hB,{scope:e,forceMount:n,children:E.Children.map(r,o=>S.jsx(cd,{present:n||a.open,children:S.jsx(Tg,{asChild:!0,container:i,children:o})}))})};rN.displayName=qy;var lg="DialogOverlay",iN=E.forwardRef((t,e)=>{const n=nN(lg,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,a=xs(lg,t.__scopeDialog);return a.modal?S.jsx(cd,{present:r||a.open,children:S.jsx(mB,{...i,ref:e})}):null});iN.displayName=lg;var pB=Mu("DialogOverlay.RemoveScroll"),mB=E.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=xs(lg,n);return S.jsx(Pg,{as:pB,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(xn.div,{"data-state":Yy(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Tu="DialogContent",aN=E.forwardRef((t,e)=>{const n=nN(Tu,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,a=xs(Tu,t.__scopeDialog);return S.jsx(cd,{present:r||a.open,children:a.modal?S.jsx(gB,{...i,ref:e}):S.jsx(yB,{...i,ref:e})})});aN.displayName=Tu;var gB=E.forwardRef((t,e)=>{const n=xs(Tu,t.__scopeDialog),r=E.useRef(null),i=cr(e,n.contentRef,r);return E.useEffect(()=>{const a=r.current;if(a)return By(a)},[]),S.jsx(sN,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:vn(t.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:vn(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&a.preventDefault()}),onFocusOutside:vn(t.onFocusOutside,a=>a.preventDefault())})}),yB=E.forwardRef((t,e)=>{const n=xs(Tu,t.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(sN,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;n.triggerRef.current?.contains(o)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),sN=E.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=t,c=xs(Tu,n),f=E.useRef(null),d=cr(e,f);return Cy(),S.jsxs(S.Fragment,{children:[S.jsx(Mg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:S.jsx(kg,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Yy(c.open),...o,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(vB,{titleId:c.titleId}),S.jsx(xB,{contentRef:f,descriptionId:c.descriptionId})]})]})}),Wy="DialogTitle",oN=E.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=xs(Wy,n);return S.jsx(xn.h2,{id:i.titleId,...r,ref:e})});oN.displayName=Wy;var lN="DialogDescription",cN=E.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=xs(lN,n);return S.jsx(xn.p,{id:i.descriptionId,...r,ref:e})});cN.displayName=lN;var uN="DialogClose",fN=E.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=xs(uN,n);return S.jsx(xn.button,{type:"button",...r,ref:e,onClick:vn(t.onClick,()=>i.onOpenChange(!1))})});fN.displayName=uN;function Yy(t){return t?"open":"closed"}var dN="DialogTitleWarning",[VI,hN]=Dj(dN,{contentName:Tu,titleName:Wy,docsSlug:"dialog"}),vB=({titleId:t})=>{const e=hN(dN),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return E.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},bB="DialogDescriptionWarning",xB=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hN(bB).contentName}}.`;return E.useEffect(()=>{const i=t.current?.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},wB=rN,pN=iN,mN=aN,gN=oN,yN=cN,SB=fN;const _B=wB,vN=E.forwardRef(({className:t,...e},n)=>S.jsx(pN,{ref:n,className:wt("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",t),...e}));vN.displayName=pN.displayName;const NB=E.forwardRef(({className:t,children:e,...n},r)=>S.jsxs(_B,{children:[S.jsx(vN,{}),S.jsxs(mN,{ref:r,className:wt("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:rounded-lg",t),...n,children:[e,S.jsxs(SB,{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:[S.jsx(k2,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));NB.displayName=mN.displayName;const AB=E.forwardRef(({className:t,...e},n)=>S.jsx(gN,{ref:n,className:wt("text-lg font-semibold leading-none tracking-tight",t),...e}));AB.displayName=gN.displayName;const CB=E.forwardRef(({className:t,...e},n)=>S.jsx(yN,{ref:n,className:wt("text-sm text-muted-foreground",t),...e}));CB.displayName=yN.displayName;const kB="modulepreload",MB=function(t){return"/"+t},vw={},E2=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let f=function(d){return Promise.all(d.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=o?.nonce||o?.getAttribute("nonce");i=f(n.map(d=>{if(d=MB(d),d in vw)return;vw[d]=!0;const p=d.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${g}`))return;const b=document.createElement("link");if(b.rel=p?"stylesheet":kB,p||(b.as="script"),b.crossOrigin="",b.href=d,c&&b.setAttribute("nonce",c),document.head.appendChild(b),p)return new Promise((y,N)=>{b.addEventListener("load",y),b.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return i.then(o=>{for(const c of o||[])c.status==="rejected"&&a(c.reason);return e().catch(a)})};function kn(t){"@babel/helpers - typeof";return kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kn(t)}var wi=Uint8Array,ba=Uint16Array,Vy=Int32Array,Ug=new wi([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),qg=new wi([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),D2=new wi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bN=function(t,e){for(var n=new ba(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var i=new Vy(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},xN=bN(Ug,2),wN=xN.b,j2=xN.r;wN[28]=258,j2[258]=28;var SN=bN(qg,0),LB=SN.b,bw=SN.r,O2=new ba(32768);for(var Wn=0;Wn<32768;++Wn){var fc=(Wn&43690)>>1|(Wn&21845)<<1;fc=(fc&52428)>>2|(fc&13107)<<2,fc=(fc&61680)>>4|(fc&3855)<<4,O2[Wn]=((fc&65280)>>8|(fc&255)<<8)>>1}var go=function(t,e,n){for(var r=t.length,i=0,a=new ba(e);i<r;++i)t[i]&&++a[t[i]-1];var o=new ba(e);for(i=1;i<e;++i)o[i]=o[i-1]+a[i-1]<<1;var c;if(n){c=new ba(1<<e);var f=15-e;for(i=0;i<r;++i)if(t[i])for(var d=i<<4|t[i],p=e-t[i],g=o[t[i]-1]++<<p,b=g|(1<<p)-1;g<=b;++g)c[O2[g]>>f]=d}else for(c=new ba(r),i=0;i<r;++i)t[i]&&(c[i]=O2[o[t[i]-1]++]>>15-t[i]);return c},Nc=new wi(288);for(var Wn=0;Wn<144;++Wn)Nc[Wn]=8;for(var Wn=144;Wn<256;++Wn)Nc[Wn]=9;for(var Wn=256;Wn<280;++Wn)Nc[Wn]=7;for(var Wn=280;Wn<288;++Wn)Nc[Wn]=8;var zh=new wi(32);for(var Wn=0;Wn<32;++Wn)zh[Wn]=5;var EB=go(Nc,9,0),DB=go(Nc,9,1),jB=go(zh,5,0),OB=go(zh,5,1),P1=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},us=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},B1=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},Gy=function(t){return(t+7)/8|0},_N=function(t,e,n){return(n==null||n>t.length)&&(n=t.length),new wi(t.subarray(e,n))},TB=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],hs=function(t,e,n){var r=new Error(e||TB[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,hs),!n)throw r;return r},RB=function(t,e,n,r){var i=t.length,a=0;if(!i||e.f&&!e.l)return n||new wi(0);var o=!n,c=o||e.i!=2,f=e.i;o&&(n=new wi(i*3));var d=function(He){var Je=n.length;if(He>Je){var it=new wi(Math.max(Je*2,He));it.set(n),n=it}},p=e.f||0,g=e.p||0,b=e.b||0,y=e.l,N=e.d,w=e.m,k=e.n,C=i*8;do{if(!y){p=us(t,g,1);var L=us(t,g+1,3);if(g+=3,L)if(L==1)y=DB,N=OB,w=9,k=5;else if(L==2){var K=us(t,g,31)+257,q=us(t,g+10,15)+4,H=K+us(t,g+5,31)+1;g+=14;for(var se=new wi(H),le=new wi(19),P=0;P<q;++P)le[D2[P]]=us(t,g+P*3,7);g+=q*3;for(var I=P1(le),ne=(1<<I)-1,te=go(le,I,1),P=0;P<H;){var de=te[us(t,g,ne)];g+=de&15;var j=de>>4;if(j<16)se[P++]=j;else{var X=0,J=0;for(j==16?(J=3+us(t,g,3),g+=2,X=se[P-1]):j==17?(J=3+us(t,g,7),g+=3):j==18&&(J=11+us(t,g,127),g+=7);J--;)se[P++]=X}}var G=se.subarray(0,K),me=se.subarray(K);w=P1(G),k=P1(me),y=go(G,w,1),N=go(me,k,1)}else hs(1);else{var j=Gy(g)+4,z=t[j-4]|t[j-3]<<8,O=j+z;if(O>i){f&&hs(0);break}c&&d(b+z),n.set(t.subarray(j,O),b),e.b=b+=z,e.p=g=O*8,e.f=p;continue}if(g>C){f&&hs(0);break}}c&&d(b+131072);for(var W=(1<<w)-1,xe=(1<<k)-1,R=g;;R=g){var X=y[B1(t,g)&W],V=X>>4;if(g+=X&15,g>C){f&&hs(0);break}if(X||hs(2),V<256)n[b++]=V;else if(V==256){R=g,y=null;break}else{var Q=V-254;if(V>264){var P=V-257,ae=Ug[P];Q=us(t,g,(1<<ae)-1)+wN[P],g+=ae}var ce=N[B1(t,g)&xe],he=ce>>4;ce||hs(3),g+=ce&15;var me=LB[he];if(he>3){var ae=qg[he];me+=B1(t,g)&(1<<ae)-1,g+=ae}if(g>C){f&&hs(0);break}c&&d(b+131072);var we=b+Q;if(b<me){var Se=a-me,Ve=Math.min(me,we);for(Se+b<0&&hs(3);b<Ve;++b)n[b]=r[Se+b]}for(;b<we;++b)n[b]=n[b-me]}}e.l=y,e.p=R,e.b=b,e.f=p,y&&(p=1,e.m=w,e.d=N,e.n=k)}while(!p);return b!=n.length&&o?_N(n,0,b):n.subarray(0,b)},il=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},ph=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},F1=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,a=n.slice();if(!i)return{t:AN,l:0};if(i==1){var o=new wi(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(O,K){return O.f-K.f}),n.push({s:-1,f:25001});var c=n[0],f=n[1],d=0,p=1,g=2;for(n[0]={s:-1,f:c.f+f.f,l:c,r:f};p!=i-1;)c=n[n[d].f<n[g].f?d++:g++],f=n[d!=p&&n[d].f<n[g].f?d++:g++],n[p++]={s:-1,f:c.f+f.f,l:c,r:f};for(var b=a[0].s,r=1;r<i;++r)a[r].s>b&&(b=a[r].s);var y=new ba(b+1),N=T2(n[p-1],y,0);if(N>e){var r=0,w=0,k=N-e,C=1<<k;for(a.sort(function(K,q){return y[q.s]-y[K.s]||K.f-q.f});r<i;++r){var L=a[r].s;if(y[L]>e)w+=C-(1<<N-y[L]),y[L]=e;else break}for(w>>=k;w>0;){var j=a[r].s;y[j]<e?w-=1<<e-y[j]++-1:++r}for(;r>=0&&w;--r){var z=a[r].s;y[z]==e&&(--y[z],++w)}N=e}return{t:new wi(y),l:N}},T2=function(t,e,n){return t.s==-1?Math.max(T2(t.l,e,n+1),T2(t.r,e,n+1)):e[t.s]=n},xw=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ba(++e),r=0,i=t[0],a=1,o=function(f){n[r++]=f},c=1;c<=e;++c)if(t[c]==i&&c!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=t[c]}return{c:n.subarray(0,r),n:e}},mh=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},NN=function(t,e,n){var r=n.length,i=Gy(e+2);t[i]=r&255,t[i+1]=r>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var a=0;a<r;++a)t[i+a+4]=n[a];return(i+4+r)*8},ww=function(t,e,n,r,i,a,o,c,f,d,p){il(e,p++,n),++i[256];for(var g=F1(i,15),b=g.t,y=g.l,N=F1(a,15),w=N.t,k=N.l,C=xw(b),L=C.c,j=C.n,z=xw(w),O=z.c,K=z.n,q=new ba(19),H=0;H<L.length;++H)++q[L[H]&31];for(var H=0;H<O.length;++H)++q[O[H]&31];for(var se=F1(q,7),le=se.t,P=se.l,I=19;I>4&&!le[D2[I-1]];--I);var ne=d+5<<3,te=mh(i,Nc)+mh(a,zh)+o,de=mh(i,b)+mh(a,w)+o+14+3*I+mh(q,le)+2*q[16]+3*q[17]+7*q[18];if(f>=0&&ne<=te&&ne<=de)return NN(e,p,t.subarray(f,f+d));var X,J,G,me;if(il(e,p,1+(de<te)),p+=2,de<te){X=go(b,y,0),J=b,G=go(w,k,0),me=w;var W=go(le,P,0);il(e,p,j-257),il(e,p+5,K-1),il(e,p+10,I-4),p+=14;for(var H=0;H<I;++H)il(e,p+3*H,le[D2[H]]);p+=3*I;for(var xe=[L,O],R=0;R<2;++R)for(var V=xe[R],H=0;H<V.length;++H){var Q=V[H]&31;il(e,p,W[Q]),p+=le[Q],Q>15&&(il(e,p,V[H]>>5&127),p+=V[H]>>12)}}else X=EB,J=Nc,G=jB,me=zh;for(var H=0;H<c;++H){var ae=r[H];if(ae>255){var Q=ae>>18&31;ph(e,p,X[Q+257]),p+=J[Q+257],Q>7&&(il(e,p,ae>>23&31),p+=Ug[Q]);var ce=ae&31;ph(e,p,G[ce]),p+=me[ce],ce>3&&(ph(e,p,ae>>5&8191),p+=qg[ce])}else ph(e,p,X[ae]),p+=J[ae]}return ph(e,p,X[256]),p+J[256]},PB=new Vy([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),AN=new wi(0),BB=function(t,e,n,r,i,a){var o=a.z||t.length,c=new wi(r+o+5*(1+Math.ceil(o/7e3))+i),f=c.subarray(r,c.length-i),d=a.l,p=(a.r||0)&7;if(e){p&&(f[0]=a.r>>3);for(var g=PB[e-1],b=g>>13,y=g&8191,N=(1<<n)-1,w=a.p||new ba(32768),k=a.h||new ba(N+1),C=Math.ceil(n/3),L=2*C,j=function(dt){return(t[dt]^t[dt+1]<<C^t[dt+2]<<L)&N},z=new Vy(25e3),O=new ba(288),K=new ba(32),q=0,H=0,se=a.i||0,le=0,P=a.w||0,I=0;se+2<o;++se){var ne=j(se),te=se&32767,de=k[ne];if(w[te]=de,k[ne]=te,P<=se){var X=o-se;if((q>7e3||le>24576)&&(X>423||!d)){p=ww(t,f,0,z,O,K,H,le,I,se-I,p),le=q=H=0,I=se;for(var J=0;J<286;++J)O[J]=0;for(var J=0;J<30;++J)K[J]=0}var G=2,me=0,W=y,xe=te-de&32767;if(X>2&&ne==j(se-xe))for(var R=Math.min(b,X)-1,V=Math.min(32767,se),Q=Math.min(258,X);xe<=V&&--W&&te!=de;){if(t[se+G]==t[se+G-xe]){for(var ae=0;ae<Q&&t[se+ae]==t[se+ae-xe];++ae);if(ae>G){if(G=ae,me=xe,ae>R)break;for(var ce=Math.min(xe,ae-2),he=0,J=0;J<ce;++J){var we=se-xe+J&32767,Se=w[we],Ve=we-Se&32767;Ve>he&&(he=Ve,de=we)}}}te=de,de=w[te],xe+=te-de&32767}if(me){z[le++]=268435456|j2[G]<<18|bw[me];var He=j2[G]&31,Je=bw[me]&31;H+=Ug[He]+qg[Je],++O[257+He],++K[Je],P=se+G,++q}else z[le++]=t[se],++O[t[se]]}}for(se=Math.max(se,P);se<o;++se)z[le++]=t[se],++O[t[se]];p=ww(t,f,d,z,O,K,H,le,I,se-I,p),d||(a.r=p&7|f[p/8|0]<<3,p-=7,a.h=k,a.p=w,a.i=se,a.w=P)}else{for(var se=a.w||0;se<o+d;se+=65535){var it=se+65535;it>=o&&(f[p/8|0]=d,it=o),p=NN(f,p+1,t.subarray(se,it))}a.i=o}return _N(c,0,r+Gy(p)+i)},CN=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,a=n.length|0,o=0;o!=a;){for(var c=Math.min(o+2655,a);o<c;++o)i+=r+=n[o];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}t=r,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},FB=function(t,e,n,r,i){if(!i&&(i={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),o=new wi(a.length+t.length);o.set(a),o.set(t,a.length),t=o,i.w=a.length}return BB(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,i)},kN=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},IB=function(t,e){var n=e.level,r=n==0?0:n<6?1:n==9?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=CN();i.p(e.dictionary),kN(t,2,i.d())}},zB=function(t,e){return((t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31)&&hs(6,"invalid zlib data"),(t[1]>>5&1)==1&&hs(6,"invalid zlib data: "+(t[1]&32?"need":"unexpected")+" dictionary"),(t[1]>>3&4)+2};function R2(t,e){e||(e={});var n=CN();n.p(t);var r=FB(t,e,e.dictionary?6:2,4);return IB(r,e),kN(r,r.length-4,n.d()),r}function HB(t,e){return RB(t.subarray(zB(t),-4),{i:2},e,e)}var UB=typeof TextDecoder<"u"&&new TextDecoder,qB=0;try{UB.decode(AN,{stream:!0}),qB=1}catch{}var Rt=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function I1(){Rt.console&&typeof Rt.console.log=="function"&&Rt.console.log.apply(Rt.console,arguments)}var Rn={log:I1,warn:function(t){Rt.console&&(typeof Rt.console.warn=="function"?Rt.console.warn.apply(Rt.console,arguments):I1.call(null,arguments))},error:function(t){Rt.console&&(typeof Rt.console.error=="function"?Rt.console.error.apply(Rt.console,arguments):I1(t))}};function z1(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){bu(r.response,e,n)},r.onerror=function(){Rn.error("could not download file")},r.send()}function Sw(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function _m(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var kh,P2,bu=Rt.saveAs||((typeof window>"u"?"undefined":kn(window))!=="object"||window!==Rt?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(t,e,n){var r=Rt.URL||Rt.webkitURL,i=document.createElement("a");e=e||t.name||"download",i.download=e,i.rel="noopener",typeof t=="string"?(i.href=t,i.origin!==location.origin?Sw(i.href)?z1(t,e,n):_m(i,i.target="_blank"):_m(i)):(i.href=r.createObjectURL(t),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){_m(i)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download",typeof t=="string")if(Sw(t))z1(t,e,n);else{var r=document.createElement("a");r.href=t,r.target="_blank",setTimeout(function(){_m(r)})}else navigator.msSaveOrOpenBlob(function(i,a){return a===void 0?a={autoBom:!1}:kn(a)!=="object"&&(Rn.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}(t,n),e)}:function(t,e,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof t=="string")return z1(t,e,n);var i=t.type==="application/octet-stream",a=/constructor/i.test(Rt.HTMLElement)||Rt.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a)&&(typeof FileReader>"u"?"undefined":kn(FileReader))==="object"){var c=new FileReader;c.onloadend=function(){var p=c.result;p=o?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=p:location=p,r=null},c.readAsDataURL(t)}else{var f=Rt.URL||Rt.webkitURL,d=f.createObjectURL(t);r?r.location=d:location.href=d,r=null,setTimeout(function(){f.revokeObjectURL(d)},4e4)}});/**
 * A class to parse color values
 * @author Stoyan Stefanov <sstoo@gmail.com>
 * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}
 * @license Use it if you like it
 */function MN(t){var e;t=t||"",this.ok=!1,t.charAt(0)=="#"&&(t=t.substr(1,6)),t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(c){return[parseInt(c[1]),parseInt(c[2]),parseInt(c[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(c){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(c){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,a=n[r].process,o=i.exec(t);o&&(e=a(o),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var c=this.r.toString(16),f=this.g.toString(16),d=this.b.toString(16);return c.length==1&&(c="0"+c),f.length==1&&(f="0"+f),d.length==1&&(d="0"+d),"#"+c+f+d}}/**
 * @license
 * Joseph Myers does not specify a particular license for his work.
 *
 * Author: Joseph Myers
 * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
 *
 * Modified by: Owen Leong
 */function H1(t,e){var n=t[0],r=t[1],i=t[2],a=t[3];n=mi(n,r,i,a,e[0],7,-680876936),a=mi(a,n,r,i,e[1],12,-389564586),i=mi(i,a,n,r,e[2],17,606105819),r=mi(r,i,a,n,e[3],22,-1044525330),n=mi(n,r,i,a,e[4],7,-176418897),a=mi(a,n,r,i,e[5],12,1200080426),i=mi(i,a,n,r,e[6],17,-1473231341),r=mi(r,i,a,n,e[7],22,-45705983),n=mi(n,r,i,a,e[8],7,1770035416),a=mi(a,n,r,i,e[9],12,-1958414417),i=mi(i,a,n,r,e[10],17,-42063),r=mi(r,i,a,n,e[11],22,-1990404162),n=mi(n,r,i,a,e[12],7,1804603682),a=mi(a,n,r,i,e[13],12,-40341101),i=mi(i,a,n,r,e[14],17,-1502002290),n=gi(n,r=mi(r,i,a,n,e[15],22,1236535329),i,a,e[1],5,-165796510),a=gi(a,n,r,i,e[6],9,-1069501632),i=gi(i,a,n,r,e[11],14,643717713),r=gi(r,i,a,n,e[0],20,-373897302),n=gi(n,r,i,a,e[5],5,-701558691),a=gi(a,n,r,i,e[10],9,38016083),i=gi(i,a,n,r,e[15],14,-660478335),r=gi(r,i,a,n,e[4],20,-405537848),n=gi(n,r,i,a,e[9],5,568446438),a=gi(a,n,r,i,e[14],9,-1019803690),i=gi(i,a,n,r,e[3],14,-187363961),r=gi(r,i,a,n,e[8],20,1163531501),n=gi(n,r,i,a,e[13],5,-1444681467),a=gi(a,n,r,i,e[2],9,-51403784),i=gi(i,a,n,r,e[7],14,1735328473),n=yi(n,r=gi(r,i,a,n,e[12],20,-1926607734),i,a,e[5],4,-378558),a=yi(a,n,r,i,e[8],11,-2022574463),i=yi(i,a,n,r,e[11],16,1839030562),r=yi(r,i,a,n,e[14],23,-35309556),n=yi(n,r,i,a,e[1],4,-1530992060),a=yi(a,n,r,i,e[4],11,1272893353),i=yi(i,a,n,r,e[7],16,-155497632),r=yi(r,i,a,n,e[10],23,-1094730640),n=yi(n,r,i,a,e[13],4,681279174),a=yi(a,n,r,i,e[0],11,-358537222),i=yi(i,a,n,r,e[3],16,-722521979),r=yi(r,i,a,n,e[6],23,76029189),n=yi(n,r,i,a,e[9],4,-640364487),a=yi(a,n,r,i,e[12],11,-421815835),i=yi(i,a,n,r,e[15],16,530742520),n=vi(n,r=yi(r,i,a,n,e[2],23,-995338651),i,a,e[0],6,-198630844),a=vi(a,n,r,i,e[7],10,1126891415),i=vi(i,a,n,r,e[14],15,-1416354905),r=vi(r,i,a,n,e[5],21,-57434055),n=vi(n,r,i,a,e[12],6,1700485571),a=vi(a,n,r,i,e[3],10,-1894986606),i=vi(i,a,n,r,e[10],15,-1051523),r=vi(r,i,a,n,e[1],21,-2054922799),n=vi(n,r,i,a,e[8],6,1873313359),a=vi(a,n,r,i,e[15],10,-30611744),i=vi(i,a,n,r,e[6],15,-1560198380),r=vi(r,i,a,n,e[13],21,1309151649),n=vi(n,r,i,a,e[4],6,-145523070),a=vi(a,n,r,i,e[11],10,-1120210379),i=vi(i,a,n,r,e[2],15,718787259),r=vi(r,i,a,n,e[9],21,-343485551),t[0]=bc(n,t[0]),t[1]=bc(r,t[1]),t[2]=bc(i,t[2]),t[3]=bc(a,t[3])}function Wg(t,e,n,r,i,a){return e=bc(bc(e,t),bc(r,a)),bc(e<<i|e>>>32-i,n)}function mi(t,e,n,r,i,a,o){return Wg(e&n|~e&r,t,e,i,a,o)}function gi(t,e,n,r,i,a,o){return Wg(e&r|n&~r,t,e,i,a,o)}function yi(t,e,n,r,i,a,o){return Wg(e^n^r,t,e,i,a,o)}function vi(t,e,n,r,i,a,o){return Wg(n^(e|~r),t,e,i,a,o)}function LN(t){var e,n=t.length,r=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)H1(r,WB(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)i[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(H1(r,i),e=0;e<16;e++)i[e]=0;return i[14]=8*n,H1(r,i),r}function WB(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}kh=Rt.atob.bind(Rt),P2=Rt.btoa.bind(Rt);var _w="0123456789abcdef".split("");function YB(t){for(var e="",n=0;n<4;n++)e+=_w[t>>8*n+4&15]+_w[t>>8*n&15];return e}function VB(t){return String.fromCharCode((255&t)>>0,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function B2(t){return LN(t).map(VB).join("")}var GB=function(t){for(var e=0;e<t.length;e++)t[e]=YB(t[e]);return t.join("")}(LN("hello"))!="5d41402abc4b2a76b9719d911017c592";function bc(t,e){if(GB){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}return t+e&4294967295}/**
 * @license
 * FPDF is released under a permissive license: there is no usage restriction.
 * You may embed it freely in your application (commercial or not), with or
 * without modifications.
 *
 * Reference: http://www.fpdf.org/en/script/script37.php
 */function F2(t,e){var n,r,i,a;if(t!==n){for(var o=(i=t,a=1+(256/t.length>>0),new Array(a+1).join(i)),c=[],f=0;f<256;f++)c[f]=f;var d=0;for(f=0;f<256;f++){var p=c[f];d=(d+p+o.charCodeAt(f))%256,c[f]=c[d],c[d]=p}n=t,r=c}else c=r;var g=e.length,b=0,y=0,N="";for(f=0;f<g;f++)y=(y+(p=c[b=(b+1)%256]))%256,c[b]=c[y],c[y]=p,o=c[(c[b]+c[y])%256],N+=String.fromCharCode(e.charCodeAt(f)^o);return N}/**
 * @license
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 * Author: Owen Leong (@owenl131)
 * Date: 15 Oct 2020
 * References:
 * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
 * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
 * http://www.fpdf.org/en/script/script37.php
 */var Nw={print:4,modify:8,copy:16,"annot-forms":32};function Rf(t,e,n,r){this.v=1,this.r=2;var i=192;t.forEach(function(c){if(Nw.perm!==void 0)throw new Error("Invalid permission: "+c);i+=Nw[c]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var a=(e+this.padding).substr(0,32),o=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,o),this.P=-(1+(255^i)),this.encryptionKey=B2(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=F2(this.encryptionKey,this.padding)}function Pf(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",n=t.length,r=0;r<n;r++){var i=t.charCodeAt(r);i<33||i===35||i===37||i===40||i===41||i===47||i===60||i===62||i===91||i===93||i===123||i===125||i>126?e+="#"+("0"+i.toString(16)).slice(-2):e+=t[r]}return e}function Aw(t){if(kn(t)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(n,r,i){if(i=i||!1,typeof n!="string"||typeof r!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(n)||(e[n]={});var a=Math.random().toString(35);return e[n][a]=[r,!!i],a},this.unsubscribe=function(n){for(var r in e)if(e[r][n])return delete e[r][n],Object.keys(e[r]).length===0&&delete e[r],!0;return!1},this.publish=function(n){if(e.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var a in e[n]){var o=e[n][a];try{o[0].apply(t,r)}catch(c){Rt.console&&Rn.error("jsPDF PubSub Error",c.message,c)}o[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function cg(t){if(!(this instanceof cg))return new cg(t);var e="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&e.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function EN(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function xu(t,e,n,r,i){if(!(this instanceof xu))return new xu(t,e,n,r,i);this.type=t==="axial"?2:3,this.coords=e,this.colors=n,EN.call(this,r,i)}function Bf(t,e,n,r,i){if(!(this instanceof Bf))return new Bf(t,e,n,r,i);this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,EN.call(this,r,i)}function Tt(t){var e,n=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],i=arguments[2],a=arguments[3],o=[],c=1,f=16,d="S",p=null;kn(t=t||{})==="object"&&(n=t.orientation,r=t.unit||r,i=t.format||i,a=t.compress||t.compressPdf||a,(p=t.encryption||null)!==null&&(p.userPassword=p.userPassword||"",p.ownerPassword=p.ownerPassword||"",p.userPermissions=p.userPermissions||[]),c=typeof t.userUnit=="number"?Math.abs(t.userUnit):1,t.precision!==void 0&&(e=t.precision),t.floatPrecision!==void 0&&(f=t.floatPrecision),d=t.defaultPathOperation||"S"),o=t.filters||(a===!0?["FlateEncode"]:o),r=r||"mm",n=(""+(n||"P")).toLowerCase();var g=t.putOnlyUsedFonts||!1,b={},y={internal:{},__private__:{}};y.__private__.PubSub=Aw;var N="1.3",w=y.__private__.getPdfVersion=function(){return N};y.__private__.setPdfVersion=function(A){N=A};var k={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};y.__private__.getPageFormats=function(){return k};var C=y.__private__.getPageFormat=function(A){return k[A]};i=i||"a4";var L={COMPAT:"compat",ADVANCED:"advanced"},j=L.COMPAT;function z(){this.saveGraphicsState(),ue(new xt($e,0,0,-$e,0,js()*$e).toString()+" cm"),this.setFontSize(this.getFontSize()/$e),d="n",j=L.ADVANCED}function O(){this.restoreGraphicsState(),d="S",j=L.COMPAT}var K=y.__private__.combineFontStyleAndFontWeight=function(A,F){if(A=="bold"&&F=="normal"||A=="bold"&&F==400||A=="normal"&&F=="italic"||A=="bold"&&F=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return F&&(A=F==400||F==="normal"?A==="italic"?"italic":"normal":F!=700&&F!=="bold"||A!=="normal"?(F==700?"bold":F)+""+A:"bold"),A};y.advancedAPI=function(A){var F=j===L.COMPAT;return F&&z.call(this),typeof A!="function"||(A(this),F&&O.call(this)),this},y.compatAPI=function(A){var F=j===L.ADVANCED;return F&&O.call(this),typeof A!="function"||(A(this),F&&z.call(this)),this},y.isAdvancedAPI=function(){return j===L.ADVANCED};var q,H=function(A){if(j!==L.ADVANCED)throw new Error(A+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},se=y.roundToPrecision=y.__private__.roundToPrecision=function(A,F){var oe=e||F;if(isNaN(A)||isNaN(oe))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return A.toFixed(oe).replace(/0+$/,"")};q=y.hpf=y.__private__.hpf=typeof f=="number"?function(A){if(isNaN(A))throw new Error("Invalid argument passed to jsPDF.hpf");return se(A,f)}:f==="smart"?function(A){if(isNaN(A))throw new Error("Invalid argument passed to jsPDF.hpf");return se(A,A>-1&&A<1?16:5)}:function(A){if(isNaN(A))throw new Error("Invalid argument passed to jsPDF.hpf");return se(A,16)};var le=y.f2=y.__private__.f2=function(A){if(isNaN(A))throw new Error("Invalid argument passed to jsPDF.f2");return se(A,2)},P=y.__private__.f3=function(A){if(isNaN(A))throw new Error("Invalid argument passed to jsPDF.f3");return se(A,3)},I=y.scale=y.__private__.scale=function(A){if(isNaN(A))throw new Error("Invalid argument passed to jsPDF.scale");return j===L.COMPAT?A*$e:j===L.ADVANCED?A:void 0},ne=function(A){return j===L.COMPAT?js()-A:j===L.ADVANCED?A:void 0},te=function(A){return I(ne(A))};y.__private__.setPrecision=y.setPrecision=function(A){typeof parseInt(A,10)=="number"&&(e=parseInt(A,10))};var de,X="00000000000000000000000000000000",J=y.__private__.getFileId=function(){return X},G=y.__private__.setFileId=function(A){return X=A!==void 0&&/^[a-fA-F0-9]{32}$/.test(A)?A.toUpperCase():X.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),p!==null&&(Er=new Rf(p.userPermissions,p.userPassword,p.ownerPassword,X)),X};y.setFileId=function(A){return G(A),this},y.getFileId=function(){return J()};var me=y.__private__.convertDateToPDFDate=function(A){var F=A.getTimezoneOffset(),oe=F<0?"+":"-",ge=Math.floor(Math.abs(F/60)),Me=Math.abs(F%60),Ye=[oe,Q(ge),"'",Q(Me),"'"].join("");return["D:",A.getFullYear(),Q(A.getMonth()+1),Q(A.getDate()),Q(A.getHours()),Q(A.getMinutes()),Q(A.getSeconds()),Ye].join("")},W=y.__private__.convertPDFDateToDate=function(A){var F=parseInt(A.substr(2,4),10),oe=parseInt(A.substr(6,2),10)-1,ge=parseInt(A.substr(8,2),10),Me=parseInt(A.substr(10,2),10),Ye=parseInt(A.substr(12,2),10),rt=parseInt(A.substr(14,2),10);return new Date(F,oe,ge,Me,Ye,rt,0)},xe=y.__private__.setCreationDate=function(A){var F;if(A===void 0&&(A=new Date),A instanceof Date)F=me(A);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(A))throw new Error("Invalid argument passed to jsPDF.setCreationDate");F=A}return de=F},R=y.__private__.getCreationDate=function(A){var F=de;return A==="jsDate"&&(F=W(de)),F};y.setCreationDate=function(A){return xe(A),this},y.getCreationDate=function(A){return R(A)};var V,Q=y.__private__.padd2=function(A){return("0"+parseInt(A)).slice(-2)},ae=y.__private__.padd2Hex=function(A){return("00"+(A=A.toString())).substr(A.length)},ce=0,he=[],we=[],Se=0,Ve=[],He=[],Je=!1,it=we,dt=function(){ce=0,Se=0,we=[],he=[],Ve=[],Ai=fr(),Ci=fr()};y.__private__.setCustomOutputDestination=function(A){Je=!0,it=A};var ze=function(A){Je||(it=A)};y.__private__.resetCustomOutputDestination=function(){Je=!1,it=we};var ue=y.__private__.out=function(A){return A=A.toString(),Se+=A.length+1,it.push(A),it},pt=y.__private__.write=function(A){return ue(arguments.length===1?A.toString():Array.prototype.join.call(arguments," "))},ht=y.__private__.getArrayBuffer=function(A){for(var F=A.length,oe=new ArrayBuffer(F),ge=new Uint8Array(oe);F--;)ge[F]=A.charCodeAt(F);return oe},fe=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];y.__private__.getStandardFonts=function(){return fe};var Ce=t.fontSize||16;y.__private__.setFontSize=y.setFontSize=function(A){return Ce=j===L.ADVANCED?A/$e:A,this};var Oe,Ge=y.__private__.getFontSize=y.getFontSize=function(){return j===L.COMPAT?Ce:Ce*$e},Ue=t.R2L||!1;y.__private__.setR2L=y.setR2L=function(A){return Ue=A,this},y.__private__.getR2L=y.getR2L=function(){return Ue};var ie,ye=y.__private__.setZoomMode=function(A){var F=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(A))Oe=A;else if(isNaN(A)){if(F.indexOf(A)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+A+'" is not recognized.');Oe=A}else Oe=parseInt(A,10)};y.__private__.getZoomMode=function(){return Oe};var Be,Le=y.__private__.setPageMode=function(A){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(A)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+A+'" is not recognized.');ie=A};y.__private__.getPageMode=function(){return ie};var Re=y.__private__.setLayoutMode=function(A){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(A)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+A+'" is not recognized.');Be=A};y.__private__.getLayoutMode=function(){return Be},y.__private__.setDisplayMode=y.setDisplayMode=function(A,F,oe){return ye(A),Re(F),Le(oe),this};var qe={title:"",subject:"",author:"",keywords:"",creator:""};y.__private__.getDocumentProperty=function(A){if(Object.keys(qe).indexOf(A)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return qe[A]},y.__private__.getDocumentProperties=function(){return qe},y.__private__.setDocumentProperties=y.setProperties=y.setDocumentProperties=function(A){for(var F in qe)qe.hasOwnProperty(F)&&A[F]&&(qe[F]=A[F]);return this},y.__private__.setDocumentProperty=function(A,F){if(Object.keys(qe).indexOf(A)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return qe[A]=F};var ft,$e,jt,Mt,mn,Ct={},Gt={},ur=[],ut={},nn={},Lt={},Yn={},jn=null,wn=0,mt=[],Ht=new Aw(y),Wt=t.hotfixes||[],Jn={},_i={},Pi=[],xt=function A(F,oe,ge,Me,Ye,rt){if(!(this instanceof A))return new A(F,oe,ge,Me,Ye,rt);isNaN(F)&&(F=1),isNaN(oe)&&(oe=0),isNaN(ge)&&(ge=0),isNaN(Me)&&(Me=1),isNaN(Ye)&&(Ye=0),isNaN(rt)&&(rt=0),this._matrix=[F,oe,ge,Me,Ye,rt]};Object.defineProperty(xt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(A){this._matrix[0]=A}}),Object.defineProperty(xt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(A){this._matrix[1]=A}}),Object.defineProperty(xt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(A){this._matrix[2]=A}}),Object.defineProperty(xt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(A){this._matrix[3]=A}}),Object.defineProperty(xt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(A){this._matrix[4]=A}}),Object.defineProperty(xt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(A){this._matrix[5]=A}}),Object.defineProperty(xt.prototype,"a",{get:function(){return this._matrix[0]},set:function(A){this._matrix[0]=A}}),Object.defineProperty(xt.prototype,"b",{get:function(){return this._matrix[1]},set:function(A){this._matrix[1]=A}}),Object.defineProperty(xt.prototype,"c",{get:function(){return this._matrix[2]},set:function(A){this._matrix[2]=A}}),Object.defineProperty(xt.prototype,"d",{get:function(){return this._matrix[3]},set:function(A){this._matrix[3]=A}}),Object.defineProperty(xt.prototype,"e",{get:function(){return this._matrix[4]},set:function(A){this._matrix[4]=A}}),Object.defineProperty(xt.prototype,"f",{get:function(){return this._matrix[5]},set:function(A){this._matrix[5]=A}}),Object.defineProperty(xt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(xt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(xt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(xt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),xt.prototype.join=function(A){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(q).join(A)},xt.prototype.multiply=function(A){var F=A.sx*this.sx+A.shy*this.shx,oe=A.sx*this.shy+A.shy*this.sy,ge=A.shx*this.sx+A.sy*this.shx,Me=A.shx*this.shy+A.sy*this.sy,Ye=A.tx*this.sx+A.ty*this.shx+this.tx,rt=A.tx*this.shy+A.ty*this.sy+this.ty;return new xt(F,oe,ge,Me,Ye,rt)},xt.prototype.decompose=function(){var A=this.sx,F=this.shy,oe=this.shx,ge=this.sy,Me=this.tx,Ye=this.ty,rt=Math.sqrt(A*A+F*F),lt=(A/=rt)*oe+(F/=rt)*ge;oe-=A*lt,ge-=F*lt;var St=Math.sqrt(oe*oe+ge*ge);return lt/=St,A*(ge/=St)<F*(oe/=St)&&(A=-A,F=-F,lt=-lt,rt=-rt),{scale:new xt(rt,0,0,St,0,0),translate:new xt(1,0,0,1,Me,Ye),rotate:new xt(A,F,-F,A,0,0),skew:new xt(1,0,lt,1,0,0)}},xt.prototype.toString=function(A){return this.join(" ")},xt.prototype.inversed=function(){var A=this.sx,F=this.shy,oe=this.shx,ge=this.sy,Me=this.tx,Ye=this.ty,rt=1/(A*ge-F*oe),lt=ge*rt,St=-F*rt,zt=-oe*rt,Ft=A*rt;return new xt(lt,St,zt,Ft,-lt*Me-zt*Ye,-St*Me-Ft*Ye)},xt.prototype.applyToPoint=function(A){var F=A.x*this.sx+A.y*this.shx+this.tx,oe=A.x*this.shy+A.y*this.sy+this.ty;return new Ll(F,oe)},xt.prototype.applyToRectangle=function(A){var F=this.applyToPoint(A),oe=this.applyToPoint(new Ll(A.x+A.w,A.y+A.h));return new zc(F.x,F.y,oe.x-F.x,oe.y-F.y)},xt.prototype.clone=function(){var A=this.sx,F=this.shy,oe=this.shx,ge=this.sy,Me=this.tx,Ye=this.ty;return new xt(A,F,oe,ge,Me,Ye)},y.Matrix=xt;var un=y.matrixMult=function(A,F){return F.multiply(A)},zn=new xt(1,0,0,1,0,0);y.unitMatrix=y.identityMatrix=zn;var vr=function(A,F){if(!nn[A]){var oe=(F instanceof xu?"Sh":"P")+(Object.keys(ut).length+1).toString(10);F.id=oe,nn[A]=oe,ut[oe]=F,Ht.publish("addPattern",F)}};y.ShadingPattern=xu,y.TilingPattern=Bf,y.addShadingPattern=function(A,F){return H("addShadingPattern()"),vr(A,F),this},y.beginTilingPattern=function(A){H("beginTilingPattern()"),El(A.boundingBox[0],A.boundingBox[1],A.boundingBox[2]-A.boundingBox[0],A.boundingBox[3]-A.boundingBox[1],A.matrix)},y.endTilingPattern=function(A,F){H("endTilingPattern()"),F.stream=He[V].join(`
`),vr(A,F),Ht.publish("endTilingPattern",F),Pi.pop().restore()};var er=y.__private__.newObject=function(){var A=fr();return Ni(A,!0),A},fr=y.__private__.newObjectDeferred=function(){return ce++,he[ce]=function(){return Se},ce},Ni=function(A,F){return F=typeof F=="boolean"&&F,he[A]=Se,F&&ue(A+" 0 obj"),A},Ao=y.__private__.newAdditionalObject=function(){var A={objId:fr(),content:""};return Ve.push(A),A},Ai=fr(),Ci=fr(),Wr=y.__private__.decodeColorString=function(A){var F=A.split(" ");if(F.length!==2||F[1]!=="g"&&F[1]!=="G")F.length===5&&(F[4]==="k"||F[4]==="K")&&(F=[(1-F[0])*(1-F[3]),(1-F[1])*(1-F[3]),(1-F[2])*(1-F[3]),"r"]);else{var oe=parseFloat(F[0]);F=[oe,oe,oe,"r"]}for(var ge="#",Me=0;Me<3;Me++)ge+=("0"+Math.floor(255*parseFloat(F[Me])).toString(16)).slice(-2);return ge},Yr=y.__private__.encodeColorString=function(A){var F;typeof A=="string"&&(A={ch1:A});var oe=A.ch1,ge=A.ch2,Me=A.ch3,Ye=A.ch4,rt=A.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof oe=="string"&&oe.charAt(0)!=="#"){var lt=new MN(oe);if(lt.ok)oe=lt.toHex();else if(!/^\d*\.?\d*$/.test(oe))throw new Error('Invalid color "'+oe+'" passed to jsPDF.encodeColorString.')}if(typeof oe=="string"&&/^#[0-9A-Fa-f]{3}$/.test(oe)&&(oe="#"+oe[1]+oe[1]+oe[2]+oe[2]+oe[3]+oe[3]),typeof oe=="string"&&/^#[0-9A-Fa-f]{6}$/.test(oe)){var St=parseInt(oe.substr(1),16);oe=St>>16&255,ge=St>>8&255,Me=255&St}if(ge===void 0||Ye===void 0&&oe===ge&&ge===Me)if(typeof oe=="string")F=oe+" "+rt[0];else switch(A.precision){case 2:F=le(oe/255)+" "+rt[0];break;case 3:default:F=P(oe/255)+" "+rt[0]}else if(Ye===void 0||kn(Ye)==="object"){if(Ye&&!isNaN(Ye.a)&&Ye.a===0)return F=["1.","1.","1.",rt[1]].join(" ");if(typeof oe=="string")F=[oe,ge,Me,rt[1]].join(" ");else switch(A.precision){case 2:F=[le(oe/255),le(ge/255),le(Me/255),rt[1]].join(" ");break;default:case 3:F=[P(oe/255),P(ge/255),P(Me/255),rt[1]].join(" ")}}else if(typeof oe=="string")F=[oe,ge,Me,Ye,rt[2]].join(" ");else switch(A.precision){case 2:F=[le(oe),le(ge),le(Me),le(Ye),rt[2]].join(" ");break;case 3:default:F=[P(oe),P(ge),P(Me),P(Ye),rt[2]].join(" ")}return F},si=y.__private__.getFilters=function(){return o},Fr=y.__private__.putStream=function(A){var F=(A=A||{}).data||"",oe=A.filters||si(),ge=A.alreadyAppliedFilters||[],Me=A.addLength1||!1,Ye=F.length,rt=A.objectId,lt=function(nr){return nr};if(p!==null&&rt===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");p!==null&&(lt=Er.encryptor(rt,0));var St={};oe===!0&&(oe=["FlateEncode"]);var zt=A.additionalKeyValues||[],Ft=(St=Tt.API.processDataByFilters!==void 0?Tt.API.processDataByFilters(F,oe):{data:F,reverseChain:[]}).reverseChain+(Array.isArray(ge)?ge.join(" "):ge.toString());if(St.data.length!==0&&(zt.push({key:"Length",value:St.data.length}),Me===!0&&zt.push({key:"Length1",value:Ye})),Ft.length!=0)if(Ft.split("/").length-1==1)zt.push({key:"Filter",value:Ft});else{zt.push({key:"Filter",value:"["+Ft+"]"});for(var Jt=0;Jt<zt.length;Jt+=1)if(zt[Jt].key==="DecodeParms"){for(var Bn=[],Hn=0;Hn<St.reverseChain.split("/").length-1;Hn+=1)Bn.push("null");Bn.push(zt[Jt].value),zt[Jt].value="["+Bn.join(" ")+"]"}}ue("<<");for(var tr=0;tr<zt.length;tr++)ue("/"+zt[tr].key+" "+zt[tr].value);ue(">>"),St.data.length!==0&&(ue("stream"),ue(lt(St.data)),ue("endstream"))},Sn=y.__private__.putPage=function(A){var F=A.number,oe=A.data,ge=A.objId,Me=A.contentsObjId;Ni(ge,!0),ue("<</Type /Page"),ue("/Parent "+A.rootDictionaryObjId+" 0 R"),ue("/Resources "+A.resourceDictionaryObjId+" 0 R"),ue("/MediaBox ["+parseFloat(q(A.mediaBox.bottomLeftX))+" "+parseFloat(q(A.mediaBox.bottomLeftY))+" "+q(A.mediaBox.topRightX)+" "+q(A.mediaBox.topRightY)+"]"),A.cropBox!==null&&ue("/CropBox ["+q(A.cropBox.bottomLeftX)+" "+q(A.cropBox.bottomLeftY)+" "+q(A.cropBox.topRightX)+" "+q(A.cropBox.topRightY)+"]"),A.bleedBox!==null&&ue("/BleedBox ["+q(A.bleedBox.bottomLeftX)+" "+q(A.bleedBox.bottomLeftY)+" "+q(A.bleedBox.topRightX)+" "+q(A.bleedBox.topRightY)+"]"),A.trimBox!==null&&ue("/TrimBox ["+q(A.trimBox.bottomLeftX)+" "+q(A.trimBox.bottomLeftY)+" "+q(A.trimBox.topRightX)+" "+q(A.trimBox.topRightY)+"]"),A.artBox!==null&&ue("/ArtBox ["+q(A.artBox.bottomLeftX)+" "+q(A.artBox.bottomLeftY)+" "+q(A.artBox.topRightX)+" "+q(A.artBox.topRightY)+"]"),typeof A.userUnit=="number"&&A.userUnit!==1&&ue("/UserUnit "+A.userUnit),Ht.publish("putPage",{objId:ge,pageContext:mt[F],pageNumber:F,page:oe}),ue("/Contents "+Me+" 0 R"),ue(">>"),ue("endobj");var Ye=oe.join(`
`);return j===L.ADVANCED&&(Ye+=`
Q`),Ni(Me,!0),Fr({data:Ye,filters:si(),objectId:Me}),ue("endobj"),ge},_s=y.__private__.putPages=function(){var A,F,oe=[];for(A=1;A<=wn;A++)mt[A].objId=fr(),mt[A].contentsObjId=fr();for(A=1;A<=wn;A++)oe.push(Sn({number:A,data:He[A],objId:mt[A].objId,contentsObjId:mt[A].contentsObjId,mediaBox:mt[A].mediaBox,cropBox:mt[A].cropBox,bleedBox:mt[A].bleedBox,trimBox:mt[A].trimBox,artBox:mt[A].artBox,userUnit:mt[A].userUnit,rootDictionaryObjId:Ai,resourceDictionaryObjId:Ci}));Ni(Ai,!0),ue("<</Type /Pages");var ge="/Kids [";for(F=0;F<wn;F++)ge+=oe[F]+" 0 R ";ue(ge+"]"),ue("/Count "+wn),ue(">>"),ue("endobj"),Ht.publish("postPutPages")},Co=function(A){Ht.publish("putFont",{font:A,out:ue,newObject:er,putStream:Fr}),A.isAlreadyPutted!==!0&&(A.objectNumber=er(),ue("<<"),ue("/Type /Font"),ue("/BaseFont /"+Pf(A.postScriptName)),ue("/Subtype /Type1"),typeof A.encoding=="string"&&ue("/Encoding /"+A.encoding),ue("/FirstChar 32"),ue("/LastChar 255"),ue(">>"),ue("endobj"))},Bi=function(){for(var A in Ct)Ct.hasOwnProperty(A)&&(g===!1||g===!0&&b.hasOwnProperty(A))&&Co(Ct[A])},Ji=function(A){A.objectNumber=er();var F=[];F.push({key:"Type",value:"/XObject"}),F.push({key:"Subtype",value:"/Form"}),F.push({key:"BBox",value:"["+[q(A.x),q(A.y),q(A.x+A.width),q(A.y+A.height)].join(" ")+"]"}),F.push({key:"Matrix",value:"["+A.matrix.toString()+"]"});var oe=A.pages[1].join(`
`);Fr({data:oe,additionalKeyValues:F,objectId:A.objectNumber}),ue("endobj")},bl=function(){for(var A in Jn)Jn.hasOwnProperty(A)&&Ji(Jn[A])},Lc=function(A,F){var oe,ge=[],Me=1/(F-1);for(oe=0;oe<1;oe+=Me)ge.push(oe);if(ge.push(1),A[0].offset!=0){var Ye={offset:0,color:A[0].color};A.unshift(Ye)}if(A[A.length-1].offset!=1){var rt={offset:1,color:A[A.length-1].color};A.push(rt)}for(var lt="",St=0,zt=0;zt<ge.length;zt++){for(oe=ge[zt];oe>A[St+1].offset;)St++;var Ft=A[St].offset,Jt=(oe-Ft)/(A[St+1].offset-Ft),Bn=A[St].color,Hn=A[St+1].color;lt+=ae(Math.round((1-Jt)*Bn[0]+Jt*Hn[0]).toString(16))+ae(Math.round((1-Jt)*Bn[1]+Jt*Hn[1]).toString(16))+ae(Math.round((1-Jt)*Bn[2]+Jt*Hn[2]).toString(16))}return lt.trim()},Iu=function(A,F){F||(F=21);var oe=er(),ge=Lc(A.colors,F),Me=[];Me.push({key:"FunctionType",value:"0"}),Me.push({key:"Domain",value:"[0.0 1.0]"}),Me.push({key:"Size",value:"["+F+"]"}),Me.push({key:"BitsPerSample",value:"8"}),Me.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Me.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Fr({data:ge,additionalKeyValues:Me,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:oe}),ue("endobj"),A.objectNumber=er(),ue("<< /ShadingType "+A.type),ue("/ColorSpace /DeviceRGB");var Ye="/Coords ["+q(parseFloat(A.coords[0]))+" "+q(parseFloat(A.coords[1]))+" ";A.type===2?Ye+=q(parseFloat(A.coords[2]))+" "+q(parseFloat(A.coords[3])):Ye+=q(parseFloat(A.coords[2]))+" "+q(parseFloat(A.coords[3]))+" "+q(parseFloat(A.coords[4]))+" "+q(parseFloat(A.coords[5])),ue(Ye+="]"),A.matrix&&ue("/Matrix ["+A.matrix.toString()+"]"),ue("/Function "+oe+" 0 R"),ue("/Extend [true true]"),ue(">>"),ue("endobj")},ud=function(A,F){var oe=fr(),ge=er();F.push({resourcesOid:oe,objectOid:ge}),A.objectNumber=ge;var Me=[];Me.push({key:"Type",value:"/Pattern"}),Me.push({key:"PatternType",value:"1"}),Me.push({key:"PaintType",value:"1"}),Me.push({key:"TilingType",value:"1"}),Me.push({key:"BBox",value:"["+A.boundingBox.map(q).join(" ")+"]"}),Me.push({key:"XStep",value:q(A.xStep)}),Me.push({key:"YStep",value:q(A.yStep)}),Me.push({key:"Resources",value:oe+" 0 R"}),A.matrix&&Me.push({key:"Matrix",value:"["+A.matrix.toString()+"]"}),Fr({data:A.stream,additionalKeyValues:Me,objectId:A.objectNumber}),ue("endobj")},Ia=function(A){var F;for(F in ut)ut.hasOwnProperty(F)&&(ut[F]instanceof xu?Iu(ut[F]):ut[F]instanceof Bf&&ud(ut[F],A))},ko=function(A){for(var F in A.objectNumber=er(),ue("<<"),A)switch(F){case"opacity":ue("/ca "+le(A[F]));break;case"stroke-opacity":ue("/CA "+le(A[F]))}ue(">>"),ue("endobj")},ea=function(){var A;for(A in Lt)Lt.hasOwnProperty(A)&&ko(Lt[A])},Mo=function(){for(var A in ue("/XObject <<"),Jn)Jn.hasOwnProperty(A)&&Jn[A].objectNumber>=0&&ue("/"+A+" "+Jn[A].objectNumber+" 0 R");Ht.publish("putXobjectDict"),ue(">>")},zu=function(){Er.oid=er(),ue("<<"),ue("/Filter /Standard"),ue("/V "+Er.v),ue("/R "+Er.r),ue("/U <"+Er.toHexString(Er.U)+">"),ue("/O <"+Er.toHexString(Er.O)+">"),ue("/P "+Er.P),ue(">>"),ue("endobj")},za=function(){for(var A in ue("/Font <<"),Ct)Ct.hasOwnProperty(A)&&(g===!1||g===!0&&b.hasOwnProperty(A))&&ue("/"+A+" "+Ct[A].objectNumber+" 0 R");ue(">>")},Ec=function(){if(Object.keys(ut).length>0){for(var A in ue("/Shading <<"),ut)ut.hasOwnProperty(A)&&ut[A]instanceof xu&&ut[A].objectNumber>=0&&ue("/"+A+" "+ut[A].objectNumber+" 0 R");Ht.publish("putShadingPatternDict"),ue(">>")}},Ns=function(A){if(Object.keys(ut).length>0){for(var F in ue("/Pattern <<"),ut)ut.hasOwnProperty(F)&&ut[F]instanceof y.TilingPattern&&ut[F].objectNumber>=0&&ut[F].objectNumber<A&&ue("/"+F+" "+ut[F].objectNumber+" 0 R");Ht.publish("putTilingPatternDict"),ue(">>")}},fd=function(){if(Object.keys(Lt).length>0){var A;for(A in ue("/ExtGState <<"),Lt)Lt.hasOwnProperty(A)&&Lt[A].objectNumber>=0&&ue("/"+A+" "+Lt[A].objectNumber+" 0 R");Ht.publish("putGStateDict"),ue(">>")}},Vn=function(A){Ni(A.resourcesOid,!0),ue("<<"),ue("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),za(),Ec(),Ns(A.objectOid),fd(),Mo(),ue(">>"),ue("endobj")},Jr=function(){var A=[];Bi(),ea(),bl(),Ia(A),Ht.publish("putResources"),A.forEach(Vn),Vn({resourcesOid:Ci,objectOid:Number.MAX_SAFE_INTEGER}),Ht.publish("postPutResources")},Dc=function(){Ht.publish("putAdditionalObjects");for(var A=0;A<Ve.length;A++){var F=Ve[A];Ni(F.objId,!0),ue(F.content),ue("endobj")}Ht.publish("postPutAdditionalObjects")},Hu=function(A){Gt[A.fontName]=Gt[A.fontName]||{},Gt[A.fontName][A.fontStyle]=A.id},As=function(A,F,oe,ge,Me){var Ye={id:"F"+(Object.keys(Ct).length+1).toString(10),postScriptName:A,fontName:F,fontStyle:oe,encoding:ge,isStandardFont:Me||!1,metadata:{}};return Ht.publish("addFont",{font:Ye,instance:this}),Ct[Ye.id]=Ye,Hu(Ye),Ye.id},Uu=function(A){for(var F=0,oe=fe.length;F<oe;F++){var ge=As.call(this,A[F][0],A[F][1],A[F][2],fe[F][3],!0);g===!1&&(b[ge]=!0);var Me=A[F][0].split("-");Hu({id:ge,fontName:Me[0],fontStyle:Me[1]||""})}Ht.publish("addFonts",{fonts:Ct,dictionary:Gt})},oi=function(A){return A.foo=function(){try{return A.apply(this,arguments)}catch(ge){var F=ge.stack||"";~F.indexOf(" at ")&&(F=F.split(" at ")[1]);var oe="Error in function "+F.split(`
`)[0].split("<")[0]+": "+ge.message;if(!Rt.console)throw new Error(oe);Rt.console.error(oe,ge),Rt.alert&&alert(oe)}},A.foo.bar=A,A.foo},xl=function(A,F){var oe,ge,Me,Ye,rt,lt,St,zt,Ft;if(Me=(F=F||{}).sourceEncoding||"Unicode",rt=F.outputEncoding,(F.autoencode||rt)&&Ct[ft].metadata&&Ct[ft].metadata[Me]&&Ct[ft].metadata[Me].encoding&&(Ye=Ct[ft].metadata[Me].encoding,!rt&&Ct[ft].encoding&&(rt=Ct[ft].encoding),!rt&&Ye.codePages&&(rt=Ye.codePages[0]),typeof rt=="string"&&(rt=Ye[rt]),rt)){for(St=!1,lt=[],oe=0,ge=A.length;oe<ge;oe++)(zt=rt[A.charCodeAt(oe)])?lt.push(String.fromCharCode(zt)):lt.push(A[oe]),lt[oe].charCodeAt(0)>>8&&(St=!0);A=lt.join("")}for(oe=A.length;St===void 0&&oe!==0;)A.charCodeAt(oe-1)>>8&&(St=!0),oe--;if(!St)return A;for(lt=F.noBOM?[]:[254,255],oe=0,ge=A.length;oe<ge;oe++){if((Ft=(zt=A.charCodeAt(oe))>>8)>>8)throw new Error("Character at position "+oe+" of string '"+A+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");lt.push(Ft),lt.push(zt-(Ft<<8))}return String.fromCharCode.apply(void 0,lt)},On=y.__private__.pdfEscape=y.pdfEscape=function(A,F){return xl(A,F).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Lo=y.__private__.beginPage=function(A){He[++wn]=[],mt[wn]={objId:0,contentsObjId:0,userUnit:Number(c),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(A[0]),topRightY:Number(A[1])}},Ha(wn),ze(He[V])},jc=function(A,F){var oe,ge,Me;switch(n=F||n,typeof A=="string"&&(oe=C(A.toLowerCase()),Array.isArray(oe)&&(ge=oe[0],Me=oe[1])),Array.isArray(A)&&(ge=A[0]*$e,Me=A[1]*$e),isNaN(ge)&&(ge=i[0],Me=i[1]),(ge>14400||Me>14400)&&(Rn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),ge=Math.min(14400,ge),Me=Math.min(14400,Me)),i=[ge,Me],n.substr(0,1)){case"l":Me>ge&&(i=[Me,ge]);break;case"p":ge>Me&&(i=[Me,ge])}Lo(i),$u(Ls),ue(ta),Ic!==0&&ue(Ic+" J"),Ml!==0&&ue(Ml+" j"),Ht.publish("addPage",{pageNumber:wn})},Oc=function(A){A>0&&A<=wn&&(He.splice(A,1),mt.splice(A,1),wn--,V>wn&&(V=wn),this.setPage(V))},Ha=function(A){A>0&&A<=wn&&(V=A)},qu=y.__private__.getNumberOfPages=y.getNumberOfPages=function(){return He.length-1},Tc=function(A,F,oe){var ge,Me=void 0;return oe=oe||{},A=A!==void 0?A:Ct[ft].fontName,F=F!==void 0?F:Ct[ft].fontStyle,ge=A.toLowerCase(),Gt[ge]!==void 0&&Gt[ge][F]!==void 0?Me=Gt[ge][F]:Gt[A]!==void 0&&Gt[A][F]!==void 0?Me=Gt[A][F]:oe.disableWarning===!1&&Rn.warn("Unable to look up font label for font '"+A+"', '"+F+"'. Refer to getFontList() for available fonts."),Me||oe.noFallback||(Me=Gt.times[F])==null&&(Me=Gt.times.normal),Me},Cs=y.__private__.putInfo=function(){var A=er(),F=function(ge){return ge};for(var oe in p!==null&&(F=Er.encryptor(A,0)),ue("<<"),ue("/Producer ("+On(F("jsPDF "+Tt.version))+")"),qe)qe.hasOwnProperty(oe)&&qe[oe]&&ue("/"+oe.substr(0,1).toUpperCase()+oe.substr(1)+" ("+On(F(qe[oe]))+")");ue("/CreationDate ("+On(F(de))+")"),ue(">>"),ue("endobj")},Rc=y.__private__.putCatalog=function(A){var F=(A=A||{}).rootDictionaryObjId||Ai;switch(er(),ue("<<"),ue("/Type /Catalog"),ue("/Pages "+F+" 0 R"),Oe||(Oe="fullwidth"),Oe){case"fullwidth":ue("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ue("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ue("/OpenAction [3 0 R /Fit]");break;case"original":ue("/OpenAction [3 0 R /XYZ null null 1]");break;default:var oe=""+Oe;oe.substr(oe.length-1)==="%"&&(Oe=parseInt(Oe)/100),typeof Oe=="number"&&ue("/OpenAction [3 0 R /XYZ null null "+le(Oe)+"]")}switch(Be||(Be="continuous"),Be){case"continuous":ue("/PageLayout /OneColumn");break;case"single":ue("/PageLayout /SinglePage");break;case"two":case"twoleft":ue("/PageLayout /TwoColumnLeft");break;case"tworight":ue("/PageLayout /TwoColumnRight")}ie&&ue("/PageMode /"+ie),Ht.publish("putCatalog"),ue(">>"),ue("endobj")},Wu=y.__private__.putTrailer=function(){ue("trailer"),ue("<<"),ue("/Size "+(ce+1)),ue("/Root "+ce+" 0 R"),ue("/Info "+(ce-1)+" 0 R"),p!==null&&ue("/Encrypt "+Er.oid+" 0 R"),ue("/ID [ <"+X+"> <"+X+"> ]"),ue(">>")},Yu=y.__private__.putHeader=function(){ue("%PDF-"+N),ue("%ºß¬à")},Pc=y.__private__.putXRef=function(){var A="0000000000";ue("xref"),ue("0 "+(ce+1)),ue("0000000000 65535 f ");for(var F=1;F<=ce;F++)typeof he[F]=="function"?ue((A+he[F]()).slice(-10)+" 00000 n "):he[F]!==void 0?ue((A+he[F]).slice(-10)+" 00000 n "):ue("0000000000 00000 n ")},Ua=y.__private__.buildDocument=function(){dt(),ze(we),Ht.publish("buildDocument"),Yu(),_s(),Dc(),Jr(),p!==null&&zu(),Cs(),Rc();var A=Se;return Pc(),Wu(),ue("startxref"),ue(""+A),ue("%%EOF"),ze(He[V]),we.join(`
`)},wl=y.__private__.getBlob=function(A){return new Blob([ht(A)],{type:"application/pdf"})},qa=y.output=y.__private__.output=oi(function(A,F){switch(typeof(F=F||{})=="string"?F={filename:F}:F.filename=F.filename||"generated.pdf",A){case void 0:return Ua();case"save":y.save(F.filename);break;case"arraybuffer":return ht(Ua());case"blob":return wl(Ua());case"bloburi":case"bloburl":if(Rt.URL!==void 0&&typeof Rt.URL.createObjectURL=="function")return Rt.URL&&Rt.URL.createObjectURL(wl(Ua()))||void 0;Rn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var oe="",ge=Ua();try{oe=P2(ge)}catch{oe=P2(unescape(encodeURIComponent(ge)))}return"data:application/pdf;filename="+F.filename+";base64,"+oe;case"pdfobjectnewwindow":if(Object.prototype.toString.call(Rt)==="[object Window]"){var Me="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Ye=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';F.pdfObjectUrl&&(Me=F.pdfObjectUrl,Ye="");var rt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><script src="'+Me+'"'+Ye+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(F)+");<\/script></body></html>",lt=Rt.open();return lt!==null&&lt.document.write(rt),lt}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(Rt)==="[object Window]"){var St='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe id="pdfViewer" src="'+(F.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+F.filename+'" width="500px" height="400px" /></body></html>',zt=Rt.open();if(zt!==null){zt.document.write(St);var Ft=this;zt.document.documentElement.querySelector("#pdfViewer").onload=function(){zt.document.title=F.filename,zt.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(Ft.output("bloburl"))}}return zt}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(Rt)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Jt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe src="'+this.output("datauristring",F)+'"></iframe></body></html>',Bn=Rt.open();if(Bn!==null&&(Bn.document.write(Jt),Bn.document.title=F.filename),Bn||typeof safari>"u")return Bn;break;case"datauri":case"dataurl":return Rt.document.location.href=this.output("datauristring",F);default:return null}}),Sl=function(A){return Array.isArray(Wt)===!0&&Wt.indexOf(A)>-1};switch(r){case"pt":$e=1;break;case"mm":$e=72/25.4;break;case"cm":$e=72/2.54;break;case"in":$e=72;break;case"px":$e=Sl("px_scaling")==1?.75:96/72;break;case"pc":case"em":$e=12;break;case"ex":$e=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);$e=r}var Er=null;xe(),G();var ks=function(A){return p!==null?Er.encryptor(A,0):function(F){return F}},Wa=y.__private__.getPageInfo=y.getPageInfo=function(A){if(isNaN(A)||A%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:mt[A].objId,pageNumber:A,pageContext:mt[A]}},Pt=y.__private__.getPageInfoByObjId=function(A){if(isNaN(A)||A%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var F in mt)if(mt[F].objId===A)break;return Wa(F)},Bc=y.__private__.getCurrentPageInfo=y.getCurrentPageInfo=function(){return{objId:mt[V].objId,pageNumber:V,pageContext:mt[V]}};y.addPage=function(){return jc.apply(this,arguments),this},y.setPage=function(){return Ha.apply(this,arguments),ze.call(this,He[V]),this},y.insertPage=function(A){return this.addPage(),this.movePage(V,A),this},y.movePage=function(A,F){var oe,ge;if(A>F){oe=He[A],ge=mt[A];for(var Me=A;Me>F;Me--)He[Me]=He[Me-1],mt[Me]=mt[Me-1];He[F]=oe,mt[F]=ge,this.setPage(F)}else if(A<F){oe=He[A],ge=mt[A];for(var Ye=A;Ye<F;Ye++)He[Ye]=He[Ye+1],mt[Ye]=mt[Ye+1];He[F]=oe,mt[F]=ge,this.setPage(F)}return this},y.deletePage=function(){return Oc.apply(this,arguments),this},y.__private__.text=y.text=function(A,F,oe,ge,Me){var Ye,rt,lt,St,zt,Ft,Jt,Bn,Hn,tr=(ge=ge||{}).scope||this;if(typeof A=="number"&&typeof F=="number"&&(typeof oe=="string"||Array.isArray(oe))){var nr=oe;oe=F,F=A,A=nr}if(arguments[3]instanceof xt?(H("The transform parameter of text() with a Matrix value"),Hn=Me):(lt=arguments[4],St=arguments[5],kn(Jt=arguments[3])==="object"&&Jt!==null||(typeof lt=="string"&&(St=lt,lt=null),typeof Jt=="string"&&(St=Jt,Jt=null),typeof Jt=="number"&&(lt=Jt,Jt=null),ge={flags:Jt,angle:lt,align:St})),isNaN(F)||isNaN(oe)||A==null)throw new Error("Invalid arguments passed to jsPDF.text");if(A.length===0)return tr;var Dr="",na=!1,Li=typeof ge.lineHeightFactor=="number"?ge.lineHeightFactor:ki,ra=tr.internal.scaleFactor;function qc(Xt){return Xt=Xt.split("	").join(Array(ge.TabLen||9).join(" ")),On(Xt,Jt)}function Va(Xt){for(var Zt,Mn=Xt.concat(),rr=[],Hi=Mn.length;Hi--;)typeof(Zt=Mn.shift())=="string"?rr.push(Zt):Array.isArray(Xt)&&(Zt.length===1||Zt[1]===void 0&&Zt[2]===void 0)?rr.push(Zt[0]):rr.push([Zt[0],Zt[1],Zt[2]]);return rr}function Ga(Xt,Zt){var Mn;if(typeof Xt=="string")Mn=Zt(Xt)[0];else if(Array.isArray(Xt)){for(var rr,Hi,Us=Xt.concat(),qs=[],Za=Us.length;Za--;)typeof(rr=Us.shift())=="string"?qs.push(Zt(rr)[0]):Array.isArray(rr)&&typeof rr[0]=="string"&&(Hi=Zt(rr[0],rr[1],rr[2]),qs.push([Hi[0],Hi[1],Hi[2]]));Mn=qs}return Mn}var Ol=!1,Os=!0;if(typeof A=="string")Ol=!0;else if(Array.isArray(A)){var Tl=A.concat();rt=[];for(var Oo,br=Tl.length;br--;)(typeof(Oo=Tl.shift())!="string"||Array.isArray(Oo)&&typeof Oo[0]!="string")&&(Os=!1);Ol=Os}if(Ol===!1)throw new Error('Type of text must be string or Array. "'+A+'" is not recognized.');typeof A=="string"&&(A=A.match(/[\r?\n]/)?A.split(/\r\n|\r|\n/g):[A]);var Ts=Ce/tr.internal.scaleFactor,To=Ts*(Li-1);switch(ge.baseline){case"bottom":oe-=To;break;case"top":oe+=Ts-To;break;case"hanging":oe+=Ts-2*To;break;case"middle":oe+=Ts/2-To}if((Ft=ge.maxWidth||0)>0&&(typeof A=="string"?A=tr.splitTextToSize(A,Ft):Object.prototype.toString.call(A)==="[object Array]"&&(A=A.reduce(function(Xt,Zt){return Xt.concat(tr.splitTextToSize(Zt,Ft))},[]))),Ye={text:A,x:F,y:oe,options:ge,mutex:{pdfEscape:On,activeFontKey:ft,fonts:Ct,activeFontSize:Ce}},Ht.publish("preProcessText",Ye),A=Ye.text,lt=(ge=Ye.options).angle,!(Hn instanceof xt)&&lt&&typeof lt=="number"){lt*=Math.PI/180,ge.rotationDirection===0&&(lt=-lt),j===L.ADVANCED&&(lt=-lt);var Ro=Math.cos(lt),Rl=Math.sin(lt);Hn=new xt(Ro,Rl,-Rl,Ro,0,0)}else lt&&lt instanceof xt&&(Hn=lt);j!==L.ADVANCED||Hn||(Hn=zn),(zt=ge.charSpace||kl)!==void 0&&(Dr+=q(I(zt))+` Tc
`,this.setCharSpace(this.getCharSpace()||0)),(Bn=ge.horizontalScale)!==void 0&&(Dr+=q(100*Bn)+` Tz
`),ge.lang;var ci=-1,gd=ge.renderingMode!==void 0?ge.renderingMode:ge.stroke,Wc=tr.internal.getCurrentPageInfo().pageContext;switch(gd){case 0:case!1:case"fill":ci=0;break;case 1:case!0:case"stroke":ci=1;break;case 2:case"fillThenStroke":ci=2;break;case 3:case"invisible":ci=3;break;case 4:case"fillAndAddForClipping":ci=4;break;case 5:case"strokeAndAddPathForClipping":ci=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":ci=6;break;case 7:case"addToPathForClipping":ci=7}var Zu=Wc.usedRenderingMode!==void 0?Wc.usedRenderingMode:-1;ci!==-1?Dr+=ci+` Tr
`:Zu!==-1&&(Dr+=`0 Tr
`),ci!==-1&&(Wc.usedRenderingMode=ci),St=ge.align||"left";var zi,jr=Ce*Li,Rs=tr.internal.pageSize.getWidth(),Yc=Ct[ft];zt=ge.charSpace||kl,Ft=ge.maxWidth||0,Jt=Object.assign({autoencode:!0,noBOM:!0},ge.flags);var $a=[],Ps=function(Xt){return tr.getStringUnitWidth(Xt,{font:Yc,charSpace:zt,fontSize:Ce,doKerning:!1})*Ce/ra};if(Object.prototype.toString.call(A)==="[object Array]"){var ei;rt=Va(A),St!=="left"&&(zi=rt.map(Ps));var Ir,Bs=0;if(St==="right"){F-=zi[0],A=[],br=rt.length;for(var ui=0;ui<br;ui++)ui===0?(Ir=Mi(F),ei=Na(oe)):(Ir=I(Bs-zi[ui]),ei=-jr),A.push([rt[ui],Ir,ei]),Bs=zi[ui]}else if(St==="center"){F-=zi[0]/2,A=[],br=rt.length;for(var ia=0;ia<br;ia++)ia===0?(Ir=Mi(F),ei=Na(oe)):(Ir=I((Bs-zi[ia])/2),ei=-jr),A.push([rt[ia],Ir,ei]),Bs=zi[ia]}else if(St==="left"){A=[],br=rt.length;for(var Aa=0;Aa<br;Aa++)A.push(rt[Aa])}else if(St==="justify"&&Yc.encoding==="Identity-H"){A=[],br=rt.length,Ft=Ft!==0?Ft:Rs;for(var aa=0,Gn=0;Gn<br;Gn++)if(ei=Gn===0?Na(oe):-jr,Ir=Gn===0?Mi(F):aa,Gn<br-1){var sa=I((Ft-zi[Gn])/(rt[Gn].split(" ").length-1)),dr=rt[Gn].split(" ");A.push([dr[0]+" ",Ir,ei]),aa=0;for(var fi=1;fi<dr.length;fi++){var Po=(Ps(dr[fi-1]+" "+dr[fi])-Ps(dr[fi]))*ra+sa;fi==dr.length-1?A.push([dr[fi],Po,0]):A.push([dr[fi]+" ",Po,0]),aa-=Po}}else A.push([rt[Gn],Ir,ei]);A.push(["",aa,0])}else{if(St!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(A=[],br=rt.length,Ft=Ft!==0?Ft:Rs,Gn=0;Gn<br;Gn++)ei=Gn===0?Na(oe):-jr,Ir=Gn===0?Mi(F):0,Gn<br-1?$a.push(q(I((Ft-zi[Gn])/(rt[Gn].split(" ").length-1)))):$a.push(0),A.push([rt[Gn],Ir,ei])}}var Ca=typeof ge.R2L=="boolean"?ge.R2L:Ue;Ca===!0&&(A=Ga(A,function(Xt,Zt,Mn){return[Xt.split("").reverse().join(""),Zt,Mn]})),Ye={text:A,x:F,y:oe,options:ge,mutex:{pdfEscape:On,activeFontKey:ft,fonts:Ct,activeFontSize:Ce}},Ht.publish("postProcessText",Ye),A=Ye.text,na=Ye.mutex.isHex||!1;var Pl=Ct[ft].encoding;Pl!=="WinAnsiEncoding"&&Pl!=="StandardEncoding"||(A=Ga(A,function(Xt,Zt,Mn){return[qc(Xt),Zt,Mn]})),rt=Va(A),A=[];for(var Fs,Is,zs,Bo=0,Bl=1,Hs=Array.isArray(rt[0])?Bl:Bo,Xa="",Fo=function(Xt,Zt,Mn){var rr="";return Mn instanceof xt?(Mn=typeof ge.angle=="number"?un(Mn,new xt(1,0,0,1,Xt,Zt)):un(new xt(1,0,0,1,Xt,Zt),Mn),j===L.ADVANCED&&(Mn=un(new xt(1,0,0,-1,0,0),Mn)),rr=Mn.join(" ")+` Tm
`):rr=q(Xt)+" "+q(Zt)+` Td
`,rr},$n=0;$n<rt.length;$n++){switch(Xa="",Hs){case Bl:zs=(na?"<":"(")+rt[$n][0]+(na?">":")"),Fs=parseFloat(rt[$n][1]),Is=parseFloat(rt[$n][2]);break;case Bo:zs=(na?"<":"(")+rt[$n]+(na?">":")"),Fs=Mi(F),Is=Na(oe)}$a!==void 0&&$a[$n]!==void 0&&(Xa=$a[$n]+` Tw
`),$n===0?A.push(Xa+Fo(Fs,Is,Hn)+zs):Hs===Bo?A.push(Xa+zs):Hs===Bl&&A.push(Xa+Fo(Fs,Is,Hn)+zs)}A=Hs===Bo?A.join(` Tj
T* `):A.join(` Tj
`),A+=` Tj
`;var Ei=`BT
/`;return Ei+=ft+" "+Ce+` Tf
`,Ei+=q(Ce*Li)+` TL
`,Ei+=Do+`
`,Ei+=Dr,Ei+=A,ue(Ei+="ET"),b[ft]=!0,tr};var Vu=y.__private__.clip=y.clip=function(A){return ue(A==="evenodd"?"W*":"W"),this};y.clipEvenOdd=function(){return Vu("evenodd")},y.__private__.discardPath=y.discardPath=function(){return ue("n"),this};var li=y.__private__.isValidStyle=function(A){var F=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(A)!==-1&&(F=!0),F};y.__private__.setDefaultPathOperation=y.setDefaultPathOperation=function(A){return li(A)&&(d=A),this};var Fi=y.__private__.getStyle=y.getStyle=function(A){var F=d;switch(A){case"D":case"S":F="S";break;case"F":F="f";break;case"FD":case"DF":F="B";break;case"f":case"f*":case"B":case"B*":F=A}return F},_l=y.close=function(){return ue("h"),this};y.stroke=function(){return ue("S"),this},y.fill=function(A){return wa("f",A),this},y.fillEvenOdd=function(A){return wa("f*",A),this},y.fillStroke=function(A){return wa("B",A),this},y.fillStrokeEvenOdd=function(A){return wa("B*",A),this};var wa=function(A,F){kn(F)==="object"?Nl(F,A):ue(A)},Ii=function(A){A===null||j===L.ADVANCED&&A===void 0||(A=Fi(A),ue(A))};function Fc(A,F,oe,ge,Me){var Ye=new Bf(F||this.boundingBox,oe||this.xStep,ge||this.yStep,this.gState,Me||this.matrix);Ye.stream=this.stream;var rt=A+"$$"+this.cloneIndex+++"$$";return vr(rt,Ye),Ye}var Nl=function(A,F){var oe=nn[A.key],ge=ut[oe];if(ge instanceof xu)ue("q"),ue(Gu(F)),ge.gState&&y.setGState(ge.gState),ue(A.matrix.toString()+" cm"),ue("/"+oe+" sh"),ue("Q");else if(ge instanceof Bf){var Me=new xt(1,0,0,-1,0,js());A.matrix&&(Me=Me.multiply(A.matrix||zn),oe=Fc.call(ge,A.key,A.boundingBox,A.xStep,A.yStep,Me).id),ue("q"),ue("/Pattern cs"),ue("/"+oe+" scn"),ge.gState&&y.setGState(ge.gState),ue(F),ue("Q")}},Gu=function(A){switch(A){case"f":case"F":return"W n";case"f*":return"W* n";case"B":return"W S";case"B*":return"W* S";case"S":return"W S";case"n":return"W n"}},Ms=y.moveTo=function(A,F){return ue(q(I(A))+" "+q(te(F))+" m"),this},Sa=y.lineTo=function(A,F){return ue(q(I(A))+" "+q(te(F))+" l"),this},Ya=y.curveTo=function(A,F,oe,ge,Me,Ye){return ue([q(I(A)),q(te(F)),q(I(oe)),q(te(ge)),q(I(Me)),q(te(Ye)),"c"].join(" ")),this};y.__private__.line=y.line=function(A,F,oe,ge,Me){if(isNaN(A)||isNaN(F)||isNaN(oe)||isNaN(ge)||!li(Me))throw new Error("Invalid arguments passed to jsPDF.line");return j===L.COMPAT?this.lines([[oe-A,ge-F]],A,F,[1,1],Me||"S"):this.lines([[oe-A,ge-F]],A,F,[1,1]).stroke()},y.__private__.lines=y.lines=function(A,F,oe,ge,Me,Ye){var rt,lt,St,zt,Ft,Jt,Bn,Hn,tr,nr,Dr,na;if(typeof A=="number"&&(na=oe,oe=F,F=A,A=na),ge=ge||[1,1],Ye=Ye||!1,isNaN(F)||isNaN(oe)||!Array.isArray(A)||!Array.isArray(ge)||!li(Me)||typeof Ye!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(Ms(F,oe),rt=ge[0],lt=ge[1],zt=A.length,nr=F,Dr=oe,St=0;St<zt;St++)(Ft=A[St]).length===2?(nr=Ft[0]*rt+nr,Dr=Ft[1]*lt+Dr,Sa(nr,Dr)):(Jt=Ft[0]*rt+nr,Bn=Ft[1]*lt+Dr,Hn=Ft[2]*rt+nr,tr=Ft[3]*lt+Dr,nr=Ft[4]*rt+nr,Dr=Ft[5]*lt+Dr,Ya(Jt,Bn,Hn,tr,nr,Dr));return Ye&&_l(),Ii(Me),this},y.path=function(A){for(var F=0;F<A.length;F++){var oe=A[F],ge=oe.c;switch(oe.op){case"m":Ms(ge[0],ge[1]);break;case"l":Sa(ge[0],ge[1]);break;case"c":Ya.apply(this,ge);break;case"h":_l()}}return this},y.__private__.rect=y.rect=function(A,F,oe,ge,Me){if(isNaN(A)||isNaN(F)||isNaN(oe)||isNaN(ge)||!li(Me))throw new Error("Invalid arguments passed to jsPDF.rect");return j===L.COMPAT&&(ge=-ge),ue([q(I(A)),q(te(F)),q(I(oe)),q(I(ge)),"re"].join(" ")),Ii(Me),this},y.__private__.triangle=y.triangle=function(A,F,oe,ge,Me,Ye,rt){if(isNaN(A)||isNaN(F)||isNaN(oe)||isNaN(ge)||isNaN(Me)||isNaN(Ye)||!li(rt))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[oe-A,ge-F],[Me-oe,Ye-ge],[A-Me,F-Ye]],A,F,[1,1],rt,!0),this},y.__private__.roundedRect=y.roundedRect=function(A,F,oe,ge,Me,Ye,rt){if(isNaN(A)||isNaN(F)||isNaN(oe)||isNaN(ge)||isNaN(Me)||isNaN(Ye)||!li(rt))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var lt=4/3*(Math.SQRT2-1);return Me=Math.min(Me,.5*oe),Ye=Math.min(Ye,.5*ge),this.lines([[oe-2*Me,0],[Me*lt,0,Me,Ye-Ye*lt,Me,Ye],[0,ge-2*Ye],[0,Ye*lt,-Me*lt,Ye,-Me,Ye],[2*Me-oe,0],[-Me*lt,0,-Me,-Ye*lt,-Me,-Ye],[0,2*Ye-ge],[0,-Ye*lt,Me*lt,-Ye,Me,-Ye]],A+Me,F,[1,1],rt,!0),this},y.__private__.ellipse=y.ellipse=function(A,F,oe,ge,Me){if(isNaN(A)||isNaN(F)||isNaN(oe)||isNaN(ge)||!li(Me))throw new Error("Invalid arguments passed to jsPDF.ellipse");var Ye=4/3*(Math.SQRT2-1)*oe,rt=4/3*(Math.SQRT2-1)*ge;return Ms(A+oe,F),Ya(A+oe,F-rt,A+Ye,F-ge,A,F-ge),Ya(A-Ye,F-ge,A-oe,F-rt,A-oe,F),Ya(A-oe,F+rt,A-Ye,F+ge,A,F+ge),Ya(A+Ye,F+ge,A+oe,F+rt,A+oe,F),Ii(Me),this},y.__private__.circle=y.circle=function(A,F,oe,ge){if(isNaN(A)||isNaN(F)||isNaN(oe)||!li(ge))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(A,F,oe,oe,ge)},y.setFont=function(A,F,oe){return oe&&(F=K(F,oe)),ft=Tc(A,F,{disableWarning:!1}),this};var Vr=y.__private__.getFont=y.getFont=function(){return Ct[Tc.apply(y,arguments)]};y.__private__.getFontList=y.getFontList=function(){var A,F,oe={};for(A in Gt)if(Gt.hasOwnProperty(A))for(F in oe[A]=[],Gt[A])Gt[A].hasOwnProperty(F)&&oe[A].push(F);return oe},y.addFont=function(A,F,oe,ge,Me){var Ye=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&Ye.indexOf(arguments[3])!==-1?Me=arguments[3]:arguments[3]&&Ye.indexOf(arguments[3])==-1&&(oe=K(oe,ge)),Me=Me||"Identity-H",As.call(this,A,F,oe,Me)};var ki,Ls=t.lineWidth||.200025,_a=y.__private__.getLineWidth=y.getLineWidth=function(){return Ls},$u=y.__private__.setLineWidth=y.setLineWidth=function(A){return Ls=A,ue(q(I(A))+" w"),this};y.__private__.setLineDash=Tt.API.setLineDash=Tt.API.setLineDashPattern=function(A,F){if(A=A||[],F=F||0,isNaN(F)||!Array.isArray(A))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return A=A.map(function(oe){return q(I(oe))}).join(" "),F=q(I(F)),ue("["+A+"] "+F+" d"),this};var Al=y.__private__.getLineHeight=y.getLineHeight=function(){return Ce*ki};y.__private__.getLineHeight=y.getLineHeight=function(){return Ce*ki};var Cl=y.__private__.setLineHeightFactor=y.setLineHeightFactor=function(A){return typeof(A=A||1.15)=="number"&&(ki=A),this},Es=y.__private__.getLineHeightFactor=y.getLineHeightFactor=function(){return ki};Cl(t.lineHeight);var Mi=y.__private__.getHorizontalCoordinate=function(A){return I(A)},Na=y.__private__.getVerticalCoordinate=function(A){return j===L.ADVANCED?A:mt[V].mediaBox.topRightY-mt[V].mediaBox.bottomLeftY-I(A)},dd=y.__private__.getHorizontalCoordinateString=y.getHorizontalCoordinateString=function(A){return q(Mi(A))},Ds=y.__private__.getVerticalCoordinateString=y.getVerticalCoordinateString=function(A){return q(Na(A))},ta=t.strokeColor||"0 G";y.__private__.getStrokeColor=y.getDrawColor=function(){return Wr(ta)},y.__private__.setStrokeColor=y.setDrawColor=function(A,F,oe,ge){return ta=Yr({ch1:A,ch2:F,ch3:oe,ch4:ge,pdfColorType:"draw",precision:2}),ue(ta),this};var Eo=t.fillColor||"0 g";y.__private__.getFillColor=y.getFillColor=function(){return Wr(Eo)},y.__private__.setFillColor=y.setFillColor=function(A,F,oe,ge){return Eo=Yr({ch1:A,ch2:F,ch3:oe,ch4:ge,pdfColorType:"fill",precision:2}),ue(Eo),this};var Do=t.textColor||"0 g",hd=y.__private__.getTextColor=y.getTextColor=function(){return Wr(Do)};y.__private__.setTextColor=y.setTextColor=function(A,F,oe,ge){return Do=Yr({ch1:A,ch2:F,ch3:oe,ch4:ge,pdfColorType:"text",precision:3}),this};var kl=t.charSpace,pd=y.__private__.getCharSpace=y.getCharSpace=function(){return parseFloat(kl||0)};y.__private__.setCharSpace=y.setCharSpace=function(A){if(isNaN(A))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return kl=A,this};var Ic=0;y.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},y.__private__.setLineCap=y.setLineCap=function(A){var F=y.CapJoinStyles[A];if(F===void 0)throw new Error("Line cap style of '"+A+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Ic=F,ue(F+" J"),this};var Ml=0;y.__private__.setLineJoin=y.setLineJoin=function(A){var F=y.CapJoinStyles[A];if(F===void 0)throw new Error("Line join style of '"+A+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Ml=F,ue(F+" j"),this},y.__private__.setLineMiterLimit=y.__private__.setMiterLimit=y.setLineMiterLimit=y.setMiterLimit=function(A){if(A=A||0,isNaN(A))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ue(q(I(A))+" M"),this},y.GState=cg,y.setGState=function(A){(A=typeof A=="string"?Lt[Yn[A]]:Xu(null,A)).equals(jn)||(ue("/"+A.id+" gs"),jn=A)};var Xu=function(A,F){if(!A||!Yn[A]){var oe=!1;for(var ge in Lt)if(Lt.hasOwnProperty(ge)&&Lt[ge].equals(F)){oe=!0;break}if(oe)F=Lt[ge];else{var Me="GS"+(Object.keys(Lt).length+1).toString(10);Lt[Me]=F,F.id=Me}return A&&(Yn[A]=F.id),Ht.publish("addGState",F),F}};y.addGState=function(A,F){return Xu(A,F),this},y.saveGraphicsState=function(){return ue("q"),ur.push({key:ft,size:Ce,color:Do}),this},y.restoreGraphicsState=function(){ue("Q");var A=ur.pop();return ft=A.key,Ce=A.size,Do=A.color,jn=null,this},y.setCurrentTransformationMatrix=function(A){return ue(A.toString()+" cm"),this},y.comment=function(A){return ue("#"+A),this};var Ll=function(A,F){var oe=A||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return oe},set:function(Ye){isNaN(Ye)||(oe=parseFloat(Ye))}});var ge=F||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return ge},set:function(Ye){isNaN(Ye)||(ge=parseFloat(Ye))}});var Me="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Me},set:function(Ye){Me=Ye.toString()}}),this},zc=function(A,F,oe,ge){Ll.call(this,A,F),this.type="rect";var Me=oe||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Me},set:function(rt){isNaN(rt)||(Me=parseFloat(rt))}});var Ye=ge||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return Ye},set:function(rt){isNaN(rt)||(Ye=parseFloat(rt))}}),this},Hc=function(){this.page=wn,this.currentPage=V,this.pages=He.slice(0),this.pagesContext=mt.slice(0),this.x=jt,this.y=Mt,this.matrix=mn,this.width=jo(V),this.height=js(V),this.outputDestination=it,this.id="",this.objectNumber=-1};Hc.prototype.restore=function(){wn=this.page,V=this.currentPage,mt=this.pagesContext,He=this.pages,jt=this.x,Mt=this.y,mn=this.matrix,jl(V,this.width),Uc(V,this.height),it=this.outputDestination};var El=function(A,F,oe,ge,Me){Pi.push(new Hc),wn=V=0,He=[],jt=A,Mt=F,mn=Me,Lo([oe,ge])},md=function(A){if(_i[A])Pi.pop().restore();else{var F=new Hc,oe="Xo"+(Object.keys(Jn).length+1).toString(10);F.id=oe,_i[A]=oe,Jn[oe]=F,Ht.publish("addFormObject",F),Pi.pop().restore()}};for(var Dl in y.beginFormObject=function(A,F,oe,ge,Me){return El(A,F,oe,ge,Me),this},y.endFormObject=function(A){return md(A),this},y.doFormObject=function(A,F){var oe=Jn[_i[A]];return ue("q"),ue(F.toString()+" cm"),ue("/"+oe.id+" Do"),ue("Q"),this},y.getFormObject=function(A){var F=Jn[_i[A]];return{x:F.x,y:F.y,width:F.width,height:F.height,matrix:F.matrix}},y.save=function(A,F){return A=A||"generated.pdf",(F=F||{}).returnPromise=F.returnPromise||!1,F.returnPromise===!1?(bu(wl(Ua()),A),typeof bu.unload=="function"&&Rt.setTimeout&&setTimeout(bu.unload,911),this):new Promise(function(oe,ge){try{var Me=bu(wl(Ua()),A);typeof bu.unload=="function"&&Rt.setTimeout&&setTimeout(bu.unload,911),oe(Me)}catch(Ye){ge(Ye.message)}})},Tt.API)Tt.API.hasOwnProperty(Dl)&&(Dl==="events"&&Tt.API.events.length?function(A,F){var oe,ge,Me;for(Me=F.length-1;Me!==-1;Me--)oe=F[Me][0],ge=F[Me][1],A.subscribe.apply(A,[oe].concat(typeof ge=="function"?[ge]:ge))}(Ht,Tt.API.events):y[Dl]=Tt.API[Dl]);var jo=y.getPageWidth=function(A){return(mt[A=A||V].mediaBox.topRightX-mt[A].mediaBox.bottomLeftX)/$e},jl=y.setPageWidth=function(A,F){mt[A].mediaBox.topRightX=F*$e+mt[A].mediaBox.bottomLeftX},js=y.getPageHeight=function(A){return(mt[A=A||V].mediaBox.topRightY-mt[A].mediaBox.bottomLeftY)/$e},Uc=y.setPageHeight=function(A,F){mt[A].mediaBox.topRightY=F*$e+mt[A].mediaBox.bottomLeftY};return y.internal={pdfEscape:On,getStyle:Fi,getFont:Vr,getFontSize:Ge,getCharSpace:pd,getTextColor:hd,getLineHeight:Al,getLineHeightFactor:Es,getLineWidth:_a,write:pt,getHorizontalCoordinate:Mi,getVerticalCoordinate:Na,getCoordinateString:dd,getVerticalCoordinateString:Ds,collections:{},newObject:er,newAdditionalObject:Ao,newObjectDeferred:fr,newObjectDeferredBegin:Ni,getFilters:si,putStream:Fr,events:Ht,scaleFactor:$e,pageSize:{getWidth:function(){return jo(V)},setWidth:function(A){jl(V,A)},getHeight:function(){return js(V)},setHeight:function(A){Uc(V,A)}},encryptionOptions:p,encryption:Er,getEncryptor:ks,output:qa,getNumberOfPages:qu,pages:He,out:ue,f2:le,f3:P,getPageInfo:Wa,getPageInfoByObjId:Pt,getCurrentPageInfo:Bc,getPDFVersion:w,Point:Ll,Rectangle:zc,Matrix:xt,hasHotfix:Sl},Object.defineProperty(y.internal.pageSize,"width",{get:function(){return jo(V)},set:function(A){jl(V,A)},enumerable:!0,configurable:!0}),Object.defineProperty(y.internal.pageSize,"height",{get:function(){return js(V)},set:function(A){Uc(V,A)},enumerable:!0,configurable:!0}),Uu.call(y,fe),ft="F1",jc(i,n),Ht.publish("initialized"),y}Rf.prototype.lsbFirstWord=function(t){return String.fromCharCode(t>>0&255,t>>8&255,t>>16&255,t>>24&255)},Rf.prototype.toHexString=function(t){return t.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Rf.prototype.hexToBytes=function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(String.fromCharCode(parseInt(t.substr(n,2),16)));return e.join("")},Rf.prototype.processOwnerPassword=function(t,e){return F2(B2(e).substr(0,5),t)},Rf.prototype.encryptor=function(t,e){var n=B2(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&e,e>>8&255)).substr(0,10);return function(r){return F2(n,r)}},cg.prototype.equals=function(t){var e,n="id,objectNumber,equals";if(!t||kn(t)!==kn(this))return!1;var r=0;for(e in this)if(!(n.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!t.hasOwnProperty(e)||this[e]!==t[e])return!1;r++}for(e in t)t.hasOwnProperty(e)&&n.indexOf(e)<0&&r--;return r===0},Tt.API={events:[]},Tt.version="3.0.1";var gr=Tt.API,$y=1,Fu=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Of=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Ut=function(t){return t.toFixed(2)},dc=function(t){return t.toFixed(5)};gr.__acroform__={};var Qi=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},Cw=function(t){return t*$y},ao=function(t){var e=new jN,n=bt.internal.getHeight(t)||0,r=bt.internal.getWidth(t)||0;return e.BBox=[0,0,Number(Ut(r)),Number(Ut(n))],e},$B=gr.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|=1<<e},XB=gr.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&=~(1<<e)},ZB=gr.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return(t&1<<e)==0?0:1},Ar=gr.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return ZB(t,e-1)},Cr=gr.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return $B(t,e-1)},kr=gr.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return XB(t,e-1)},KB=gr.__acroform__.calculateCoordinates=function(t,e){var n=e.internal.getHorizontalCoordinate,r=e.internal.getVerticalCoordinate,i=t[0],a=t[1],o=t[2],c=t[3],f={};return f.lowerLeft_X=n(i)||0,f.lowerLeft_Y=r(a+c)||0,f.upperRight_X=n(i+o)||0,f.upperRight_Y=r(a)||0,[Number(Ut(f.lowerLeft_X)),Number(Ut(f.lowerLeft_Y)),Number(Ut(f.upperRight_X)),Number(Ut(f.upperRight_Y))]},QB=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t._V||t.DV,r=I2(t,n),i=t.scope.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(t.scope.__private__.encodeColorString(t.color)),e.push("/"+i+" "+Ut(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var a=ao(t);return a.scope=t.scope,a.stream=e.join(`
`),a}},I2=function(t,e){var n=t.fontSize===0?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},i=(e=(e=e.substr(0,1)=="("?e.substr(1):e).substr(e.length-1)==")"?e.substr(0,e.length-1):e).split(" ");i=t.multiline?i.map(function(P){return P.split(`
`)}):i.map(function(P){return[P]});var a=n,o=bt.internal.getHeight(t)||0;o=o<0?-o:o;var c=bt.internal.getWidth(t)||0;c=c<0?-c:c;var f=function(P,I,ne){if(P+1<i.length){var te=I+" "+i[P+1][0];return Nm(te,t,ne).width<=c-4}return!1};a++;e:for(;a>0;){e="",a--;var d,p,g=Nm("3",t,a).height,b=t.multiline?o-a:(o-g)/2,y=b+=2,N=0,w=0,k=0;if(a<=0){e=`(...) Tj
`,e+="% Width of Text: "+Nm(e,t,a=12).width+", FieldWidth:"+c+`
`;break}for(var C="",L=0,j=0;j<i.length;j++)if(i.hasOwnProperty(j)){var z=!1;if(i[j].length!==1&&k!==i[j].length-1){if((g+2)*(L+2)+2>o)continue e;C+=i[j][k],z=!0,w=j,j--}else{C=(C+=i[j][k]+" ").substr(C.length-1)==" "?C.substr(0,C.length-1):C;var O=parseInt(j),K=f(O,C,a),q=j>=i.length-1;if(K&&!q){C+=" ",k=0;continue}if(K||q){if(q)w=O;else if(t.multiline&&(g+2)*(L+2)+2>o)continue e}else{if(!t.multiline||(g+2)*(L+2)+2>o)continue e;w=O}}for(var H="",se=N;se<=w;se++){var le=i[se];if(t.multiline){if(se===w){H+=le[k]+" ",k=(k+1)%le.length;continue}if(se===N){H+=le[le.length-1]+" ";continue}}H+=le[0]+" "}switch(H=H.substr(H.length-1)==" "?H.substr(0,H.length-1):H,p=Nm(H,t,a).width,t.textAlign){case"right":d=c-p-2;break;case"center":d=(c-p)/2;break;case"left":default:d=2}e+=Ut(d)+" "+Ut(y)+` Td
`,e+="("+Fu(H)+`) Tj
`,e+=-Ut(d)+` 0 Td
`,y=-(a+2),p=0,N=z?w:w+1,L++,C=""}break}return r.text=e,r.fontSize=a,r},Nm=function(t,e,n){var r=e.scope.internal.getFont(e.fontName,e.fontStyle),i=e.scope.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:e.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},JB={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},eF=function(t,e){var n={type:"reference",object:t};e.internal.getPageInfo(t.page).pageContext.annotations.find(function(r){return r.type===n.type&&r.object===n.object})===void 0&&e.internal.getPageInfo(t.page).pageContext.annotations.push(n)},tF=function(t,e){for(var n in t)if(t.hasOwnProperty(n)){var r=n,i=t[n];e.internal.newObjectDeferredBegin(i.objId,!0),kn(i)==="object"&&typeof i.putStream=="function"&&i.putStream(),delete t[r]}},nF=function(t,e){if(e.scope=t,t.internal!==void 0&&(t.internal.acroformPlugin===void 0||t.internal.acroformPlugin.isInitialized===!1)){if(ws.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(JB)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");$y=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new ON,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",function(){(function(n){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0})(t)}),t.internal.events.subscribe("buildDocument",function(){(function(n){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in r)if(r.hasOwnProperty(i)){var a=r[i];a.objId=void 0,a.hasAnnotation&&eF(a,n)}})(t)}),t.internal.events.subscribe("putCatalog",function(){(function(n){if(n.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(t)}),t.internal.events.subscribe("postPutPages",function(n){(function(r,i){var a=!r;for(var o in r||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(o)){var c=r[o],f=[],d=c.Rect;if(c.Rect&&(c.Rect=KB(c.Rect,i)),i.internal.newObjectDeferredBegin(c.objId,!0),c.DA=bt.createDefaultAppearanceStream(c),kn(c)==="object"&&typeof c.getKeyValueListForStream=="function"&&(f=c.getKeyValueListForStream()),c.Rect=d,c.hasAppearanceStream&&!c.appearanceStreamContent){var p=QB(c);f.push({key:"AP",value:"<</N "+p+">>"}),i.internal.acroformPlugin.xForms.push(p)}if(c.appearanceStreamContent){var g="";for(var b in c.appearanceStreamContent)if(c.appearanceStreamContent.hasOwnProperty(b)){var y=c.appearanceStreamContent[b];if(g+="/"+b+" ",g+="<<",Object.keys(y).length>=1||Array.isArray(y)){for(var o in y)if(y.hasOwnProperty(o)){var N=y[o];typeof N=="function"&&(N=N.call(i,c)),g+="/"+o+" "+N+" ",i.internal.acroformPlugin.xForms.indexOf(N)>=0||i.internal.acroformPlugin.xForms.push(N)}}else typeof(N=y)=="function"&&(N=N.call(i,c)),g+="/"+o+" "+N,i.internal.acroformPlugin.xForms.indexOf(N)>=0||i.internal.acroformPlugin.xForms.push(N);g+=">>"}f.push({key:"AP",value:`<<
`+g+">>"})}i.internal.putStream({additionalKeyValues:f,objectId:c.objId}),i.internal.out("endobj")}a&&tF(i.internal.acroformPlugin.xForms,i)})(n,t)}),t.internal.acroformPlugin.isInitialized=!0}},DN=gr.__acroform__.arrayToPdfArray=function(t,e,n){var r=function(o){return o};if(Array.isArray(t)){for(var i="[",a=0;a<t.length;a++)switch(a!==0&&(i+=" "),kn(t[a])){case"boolean":case"number":case"object":i+=t[a].toString();break;case"string":t[a].substr(0,1)!=="/"?(e!==void 0&&n&&(r=n.internal.getEncryptor(e)),i+="("+Fu(r(t[a].toString()))+")"):i+=t[a].toString()}return i+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},U1=function(t,e,n){var r=function(i){return i};return e!==void 0&&n&&(r=n.internal.getEncryptor(e)),(t=t||"").toString(),t="("+Fu(r(t))+")"},po=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};po.prototype.toString=function(){return this.objId+" 0 R"},po.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},po.prototype.getKeyValueListForStream=function(){var t=[],e=Object.getOwnPropertyNames(this).filter(function(a){return a!="content"&&a!="appearanceStreamContent"&&a!="scope"&&a!="objId"&&a.substring(0,1)!="_"});for(var n in e)if(Object.getOwnPropertyDescriptor(this,e[n]).configurable===!1){var r=e[n],i=this[r];i&&(Array.isArray(i)?t.push({key:r,value:DN(i,this.objId,this.scope)}):i instanceof po?(i.scope=this.scope,t.push({key:r,value:i.objId+" 0 R"})):typeof i!="function"&&t.push({key:r,value:i}))}return t};var jN=function(){po.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){t=n.trim()},get:function(){return t||null}})};Qi(jN,po);var ON=function(){po.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var n=function(r){return r};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Fu(n(t))+")"}},set:function(n){t=n}})};Qi(ON,po);var ws=function t(){po.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(C){if(isNaN(C))throw new Error('Invalid value "'+C+'" for attribute F supplied.');e=C}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Ar(e,3)},set:function(C){C?this.F=Cr(e,3):this.F=kr(e,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(C){if(isNaN(C))throw new Error('Invalid value "'+C+'" for attribute Ff supplied.');n=C}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(C){r=C!==void 0?C:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(C){r[0]=C}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(C){r[1]=C}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(C){r[2]=C}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(C){r[3]=C}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(C){switch(C){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=C;break;default:throw new Error('Invalid value "'+C+'" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof ug)return;a="FieldObject"+t.FieldNum++}var C=function(L){return L};return this.scope&&(C=this.scope.internal.getEncryptor(this.objId)),"("+Fu(C(a))+")"},set:function(C){a=C.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(C){a=C}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(C){o=C}});var c="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return c},set:function(C){c=C}});var f=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return f},set:function(C){f=C}});var d=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return d===void 0?50/$y:d},set:function(C){d=C}});var p="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return p},set:function(C){p=C}});var g="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!g||this instanceof ug||this instanceof Cu))return U1(g,this.objId,this.scope)},set:function(C){C=C.toString(),g=C}});var b=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(b)return this instanceof Kr?b:U1(b,this.objId,this.scope)},set:function(C){C=C.toString(),b=this instanceof Kr?C:C.substr(0,1)==="("?Of(C.substr(1,C.length-2)):Of(C)}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Kr?Of(b.substr(1,b.length-1)):b},set:function(C){C=C.toString(),b=this instanceof Kr?"/"+C:C}});var y=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(y)return y},set:function(C){this.V=C}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(y)return this instanceof Kr?y:U1(y,this.objId,this.scope)},set:function(C){C=C.toString(),y=this instanceof Kr?C:C.substr(0,1)==="("?Of(C.substr(1,C.length-2)):Of(C)}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Kr?Of(y.substr(1,y.length-1)):y},set:function(C){C=C.toString(),y=this instanceof Kr?"/"+C:C}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var N,w=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return w},set:function(C){C=!!C,w=C}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(N)return N},set:function(C){N=C}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,1)},set:function(C){C?this.Ff=Cr(this.Ff,1):this.Ff=kr(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,2)},set:function(C){C?this.Ff=Cr(this.Ff,2):this.Ff=kr(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,3)},set:function(C){C?this.Ff=Cr(this.Ff,3):this.Ff=kr(this.Ff,3)}});var k=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(k!==null)return k},set:function(C){if([0,1,2].indexOf(C)===-1)throw new Error('Invalid value "'+C+'" for attribute Q supplied.');k=C}}),Object.defineProperty(this,"textAlign",{get:function(){var C;switch(k){case 0:default:C="left";break;case 1:C="center";break;case 2:C="right"}return C},configurable:!0,enumerable:!0,set:function(C){switch(C){case"right":case 2:k=2;break;case"center":case 1:k=1;break;case"left":case 0:default:k=0}}})};Qi(ws,po);var Uf=function(){ws.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(n){t=n}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return DN(e,this.objId,this.scope)},set:function(n){var r,i;i=[],typeof(r=n)=="string"&&(i=function(a,o,c){c||(c=1);for(var f,d=[];f=o.exec(a);)d.push(f[c]);return d}(r,/\((.*?)\)/g)),e=i}}),this.getOptions=function(){return e},this.setOptions=function(n){e=n,this.sort&&e.sort()},this.addOption=function(n){n=(n=n||"").toString(),e.push(n),this.sort&&e.sort()},this.removeOption=function(n,r){for(r=r||!1,n=(n=n||"").toString();e.indexOf(n)!==-1&&(e.splice(e.indexOf(n),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,18)},set:function(n){n?this.Ff=Cr(this.Ff,18):this.Ff=kr(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=Cr(this.Ff,19):this.Ff=kr(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,20)},set:function(n){n?(this.Ff=Cr(this.Ff,20),e.sort()):this.Ff=kr(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,22)},set:function(n){n?this.Ff=Cr(this.Ff,22):this.Ff=kr(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,23)},set:function(n){n?this.Ff=Cr(this.Ff,23):this.Ff=kr(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,27)},set:function(n){n?this.Ff=Cr(this.Ff,27):this.Ff=kr(this.Ff,27)}}),this.hasAppearanceStream=!1};Qi(Uf,ws);var qf=function(){Uf.call(this),this.fontName="helvetica",this.combo=!1};Qi(qf,Uf);var Wf=function(){qf.call(this),this.combo=!0};Qi(Wf,qf);var Fm=function(){Wf.call(this),this.edit=!0};Qi(Fm,Wf);var Kr=function(){ws.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,15)},set:function(n){n?this.Ff=Cr(this.Ff,15):this.Ff=kr(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,16)},set:function(n){n?this.Ff=Cr(this.Ff,16):this.Ff=kr(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,17)},set:function(n){n?this.Ff=Cr(this.Ff,17):this.Ff=kr(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,26)},set:function(n){n?this.Ff=Cr(this.Ff,26):this.Ff=kr(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var n=function(a){return a};if(this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),Object.keys(e).length!==0){var r,i=[];for(r in i.push("<<"),e)i.push("/"+r+" ("+Fu(n(e[r]))+")");return i.push(">>"),i.join(`
`)}},set:function(n){kn(n)==="object"&&(e=n)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(n){typeof n=="string"&&(e.CA=n)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(n){t="/"+n}})};Qi(Kr,ws);var Im=function(){Kr.call(this),this.pushButton=!0};Qi(Im,Kr);var Yf=function(){Kr.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e!==void 0?e:[]}})};Qi(Yf,Kr);var ug=function(){var t,e;ws.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(i){e=i}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(c){return c};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var a,o=[];for(a in o.push("<<"),r)o.push("/"+a+" ("+Fu(i(r[a]))+")");return o.push(">>"),o.join(`
`)},set:function(i){kn(i)==="object"&&(r=i)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(i){typeof i=="string"&&(r.CA=i)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(i){n=i}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(i){n="/"+i}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=bt.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Qi(ug,ws),Yf.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},Yf.prototype.createOption=function(t){var e=new ug;return e.Parent=this,e.optionName=t,this.Kids.push(e),rF.call(this.scope,e),e};var zm=function(){Kr.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=bt.CheckBox.createAppearanceStream()};Qi(zm,Kr);var Cu=function(){ws.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,13)},set:function(e){e?this.Ff=Cr(this.Ff,13):this.Ff=kr(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,21)},set:function(e){e?this.Ff=Cr(this.Ff,21):this.Ff=kr(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,23)},set:function(e){e?this.Ff=Cr(this.Ff,23):this.Ff=kr(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,24)},set:function(e){e?this.Ff=Cr(this.Ff,24):this.Ff=kr(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,25)},set:function(e){e?this.Ff=Cr(this.Ff,25):this.Ff=kr(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,26)},set:function(e){e?this.Ff=Cr(this.Ff,26):this.Ff=kr(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Qi(Cu,ws);var Hm=function(){Cu.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Ar(this.Ff,14)},set:function(t){t?this.Ff=Cr(this.Ff,14):this.Ff=kr(this.Ff,14)}}),this.password=!0};Qi(Hm,Cu);var bt={CheckBox:{createAppearanceStream:function(){return{N:{On:bt.CheckBox.YesNormal},D:{On:bt.CheckBox.YesPushDown,Off:bt.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=ao(t);e.scope=t.scope;var n=[],r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,i=t.scope.__private__.encodeColorString(t.color),a=I2(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+Ut(bt.internal.getWidth(t))+" "+Ut(bt.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+Ut(a.fontSize)+" Tf "+i),n.push("BT"),n.push(a.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join(`
`),e},YesNormal:function(t){var e=ao(t);e.scope=t.scope;var n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color),i=[],a=bt.internal.getHeight(t),o=bt.internal.getWidth(t),c=I2(t,t.caption);return i.push("1 g"),i.push("0 0 "+Ut(o)+" "+Ut(a)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+Ut(o-1)+" "+Ut(a-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+Ut(c.fontSize)+" Tf "+r),i.push(c.text),i.push("ET"),i.push("Q"),e.stream=i.join(`
`),e},OffPushDown:function(t){var e=ao(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Ut(bt.internal.getWidth(t))+" "+Ut(bt.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join(`
`),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:bt.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=bt.RadioButton.Circle.YesNormal,e.D[t]=bt.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=ao(t);e.scope=t.scope;var n=[],r=bt.internal.getWidth(t)<=bt.internal.getHeight(t)?bt.internal.getWidth(t)/4:bt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=bt.internal.Bezier_C,a=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+dc(bt.internal.getWidth(t)/2)+" "+dc(bt.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
`),e},YesPushDown:function(t){var e=ao(t);e.scope=t.scope;var n=[],r=bt.internal.getWidth(t)<=bt.internal.getHeight(t)?bt.internal.getWidth(t)/4:bt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*bt.internal.Bezier_C).toFixed(5)),o=Number((r*bt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+dc(bt.internal.getWidth(t)/2)+" "+dc(bt.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),n.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),n.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),n.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+dc(bt.internal.getWidth(t)/2)+" "+dc(bt.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
`),e},OffPushDown:function(t){var e=ao(t);e.scope=t.scope;var n=[],r=bt.internal.getWidth(t)<=bt.internal.getHeight(t)?bt.internal.getWidth(t)/4:bt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*bt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+dc(bt.internal.getWidth(t)/2)+" "+dc(bt.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),n.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),n.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),n.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
`),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:bt.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=bt.RadioButton.Cross.YesNormal,e.D[t]=bt.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=ao(t);e.scope=t.scope;var n=[],r=bt.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+Ut(bt.internal.getWidth(t)-2)+" "+Ut(bt.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(Ut(r.x1.x)+" "+Ut(r.x1.y)+" m"),n.push(Ut(r.x2.x)+" "+Ut(r.x2.y)+" l"),n.push(Ut(r.x4.x)+" "+Ut(r.x4.y)+" m"),n.push(Ut(r.x3.x)+" "+Ut(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join(`
`),e},YesPushDown:function(t){var e=ao(t);e.scope=t.scope;var n=bt.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+Ut(bt.internal.getWidth(t))+" "+Ut(bt.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Ut(bt.internal.getWidth(t)-2)+" "+Ut(bt.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(Ut(n.x1.x)+" "+Ut(n.x1.y)+" m"),r.push(Ut(n.x2.x)+" "+Ut(n.x2.y)+" l"),r.push(Ut(n.x4.x)+" "+Ut(n.x4.y)+" m"),r.push(Ut(n.x3.x)+" "+Ut(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join(`
`),e},OffPushDown:function(t){var e=ao(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Ut(bt.internal.getWidth(t))+" "+Ut(bt.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join(`
`),e}}},createDefaultAppearanceStream:function(t){var e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};bt.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=bt.internal.getWidth(t),n=bt.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},bt.internal.getWidth=function(t){var e=0;return kn(t)==="object"&&(e=Cw(t.Rect[2])),e},bt.internal.getHeight=function(t){var e=0;return kn(t)==="object"&&(e=Cw(t.Rect[3])),e};var rF=gr.addField=function(t){if(nF(this,t),!(t instanceof ws))throw new Error("Invalid argument passed to jsPDF.addField.");var e;return(e=t).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};gr.AcroFormChoiceField=Uf,gr.AcroFormListBox=qf,gr.AcroFormComboBox=Wf,gr.AcroFormEditBox=Fm,gr.AcroFormButton=Kr,gr.AcroFormPushButton=Im,gr.AcroFormRadioButton=Yf,gr.AcroFormCheckBox=zm,gr.AcroFormTextField=Cu,gr.AcroFormPasswordField=Hm,gr.AcroFormAppearance=bt,gr.AcroForm={ChoiceField:Uf,ListBox:qf,ComboBox:Wf,EditBox:Fm,Button:Kr,PushButton:Im,RadioButton:Yf,CheckBox:zm,TextField:Cu,PasswordField:Hm,Appearance:bt},Tt.AcroForm={ChoiceField:Uf,ListBox:qf,ComboBox:Wf,EditBox:Fm,Button:Kr,PushButton:Im,RadioButton:Yf,CheckBox:zm,TextField:Cu,PasswordField:Hm,Appearance:bt};Tt.AcroForm;function TN(t){return t.reduce(function(e,n,r){return e[n]=r,e},{})}(function(t){t.__addimage__={};var e="UNKNOWN",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},r=t.__addimage__.getImageFileTypeByImageData=function(P,I){var ne,te,de,X,J,G=e;if((I=I||e)==="RGBA"||P.data!==void 0&&P.data instanceof Uint8ClampedArray&&"height"in P&&"width"in P)return"RGBA";if(K(P))for(J in n)for(de=n[J],ne=0;ne<de.length;ne+=1){for(X=!0,te=0;te<de[ne].length;te+=1)if(de[ne][te]!==void 0&&de[ne][te]!==P[te]){X=!1;break}if(X===!0){G=J;break}}else for(J in n)for(de=n[J],ne=0;ne<de.length;ne+=1){for(X=!0,te=0;te<de[ne].length;te+=1)if(de[ne][te]!==void 0&&de[ne][te]!==P.charCodeAt(te)){X=!1;break}if(X===!0){G=J;break}}return G===e&&I!==e&&(G=I),G},i=function P(I){for(var ne=this.internal.write,te=this.internal.putStream,de=(0,this.internal.getFilters)();de.indexOf("FlateEncode")!==-1;)de.splice(de.indexOf("FlateEncode"),1);I.objectId=this.internal.newObject();var X=[];if(X.push({key:"Type",value:"/XObject"}),X.push({key:"Subtype",value:"/Image"}),X.push({key:"Width",value:I.width}),X.push({key:"Height",value:I.height}),I.colorSpace===k.INDEXED?X.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(I.palette.length/3-1)+" "+("sMask"in I&&I.sMask!==void 0?I.objectId+2:I.objectId+1)+" 0 R]"}):(X.push({key:"ColorSpace",value:"/"+I.colorSpace}),I.colorSpace===k.DEVICE_CMYK&&X.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),X.push({key:"BitsPerComponent",value:I.bitsPerComponent}),"decodeParameters"in I&&I.decodeParameters!==void 0&&X.push({key:"DecodeParms",value:"<<"+I.decodeParameters+">>"}),"transparency"in I&&Array.isArray(I.transparency)){for(var J="",G=0,me=I.transparency.length;G<me;G++)J+=I.transparency[G]+" "+I.transparency[G]+" ";X.push({key:"Mask",value:"["+J+"]"})}I.sMask!==void 0&&X.push({key:"SMask",value:I.objectId+1+" 0 R"});var W=I.filter!==void 0?["/"+I.filter]:void 0;if(te({data:I.data,additionalKeyValues:X,alreadyAppliedFilters:W,objectId:I.objectId}),ne("endobj"),"sMask"in I&&I.sMask!==void 0){var xe="/Predictor "+I.predictor+" /Colors 1 /BitsPerComponent "+I.bitsPerComponent+" /Columns "+I.width,R={width:I.width,height:I.height,colorSpace:"DeviceGray",bitsPerComponent:I.bitsPerComponent,decodeParameters:xe,data:I.sMask};"filter"in I&&(R.filter=I.filter),P.call(this,R)}if(I.colorSpace===k.INDEXED){var V=this.internal.newObject();te({data:H(new Uint8Array(I.palette)),objectId:V}),ne("endobj")}},a=function(){var P=this.internal.collections.addImage_images;for(var I in P)i.call(this,P[I])},o=function(){var P,I=this.internal.collections.addImage_images,ne=this.internal.write;for(var te in I)ne("/I"+(P=I[te]).index,P.objectId,"0","R")},c=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",o))},f=function(){var P=this.internal.collections.addImage_images;return c.call(this),P},d=function(){return Object.keys(this.internal.collections.addImage_images).length},p=function(P){return typeof t["process"+P.toUpperCase()]=="function"},g=function(P){return kn(P)==="object"&&P.nodeType===1},b=function(P,I){if(P.nodeName==="IMG"&&P.hasAttribute("src")){var ne=""+P.getAttribute("src");if(ne.indexOf("data:image/")===0)return kh(unescape(ne).split("base64,").pop());var te=t.loadFile(ne,!0);if(te!==void 0)return te}if(P.nodeName==="CANVAS"){if(P.width===0||P.height===0)throw new Error("Given canvas must have data. Canvas width: "+P.width+", height: "+P.height);var de;switch(I){case"PNG":de="image/png";break;case"WEBP":de="image/webp";break;case"JPEG":case"JPG":default:de="image/jpeg"}return kh(P.toDataURL(de,1).split("base64,").pop())}},y=function(P){var I=this.internal.collections.addImage_images;if(I){for(var ne in I)if(P===I[ne].alias)return I[ne]}},N=function(P,I,ne){return P||I||(P=-96,I=-96),P<0&&(P=-1*ne.width*72/P/this.internal.scaleFactor),I<0&&(I=-1*ne.height*72/I/this.internal.scaleFactor),P===0&&(P=I*ne.width/ne.height),I===0&&(I=P*ne.height/ne.width),[P,I]},w=function(P,I,ne,te,de,X){var J=N.call(this,ne,te,de),G=this.internal.getCoordinateString,me=this.internal.getVerticalCoordinateString,W=f.call(this);if(ne=J[0],te=J[1],W[de.index]=de,X){X*=Math.PI/180;var xe=Math.cos(X),R=Math.sin(X),V=function(ae){return ae.toFixed(4)},Q=[V(xe),V(R),V(-1*R),V(xe),0,0,"cm"]}this.internal.write("q"),X?(this.internal.write([1,"0","0",1,G(P),me(I+te),"cm"].join(" ")),this.internal.write(Q.join(" ")),this.internal.write([G(ne),"0","0",G(te),"0","0","cm"].join(" "))):this.internal.write([G(ne),"0","0",G(te),G(P),me(I+te),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+de.index+" Do"),this.internal.write("Q")},k=t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var C=t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},L=t.__addimage__.sHashCode=function(P){var I,ne,te=0;if(typeof P=="string")for(ne=P.length,I=0;I<ne;I++)te=(te<<5)-te+P.charCodeAt(I),te|=0;else if(K(P))for(ne=P.byteLength/2,I=0;I<ne;I++)te=(te<<5)-te+P[I],te|=0;return te},j=t.__addimage__.validateStringAsBase64=function(P){(P=P||"").toString().trim();var I=!0;return P.length===0&&(I=!1),P.length%4!=0&&(I=!1),/^[A-Za-z0-9+/]+$/.test(P.substr(0,P.length-2))===!1&&(I=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(P.substr(-2))===!1&&(I=!1),I},z=t.__addimage__.extractImageFromDataUrl=function(P){if(P==null||!(P=P.trim()).startsWith("data:"))return null;var I=P.indexOf(",");return I<0?null:P.substring(0,I).trim().endsWith("base64")?P.substring(I+1):null},O=t.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};t.__addimage__.isArrayBuffer=function(P){return O()&&P instanceof ArrayBuffer};var K=t.__addimage__.isArrayBufferView=function(P){return O()&&typeof Uint32Array<"u"&&(P instanceof Int8Array||P instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&P instanceof Uint8ClampedArray||P instanceof Int16Array||P instanceof Uint16Array||P instanceof Int32Array||P instanceof Uint32Array||P instanceof Float32Array||P instanceof Float64Array)},q=t.__addimage__.binaryStringToUint8Array=function(P){for(var I=P.length,ne=new Uint8Array(I),te=0;te<I;te++)ne[te]=P.charCodeAt(te);return ne},H=t.__addimage__.arrayBufferToBinaryString=function(P){for(var I="",ne=K(P)?P:new Uint8Array(P),te=0;te<ne.length;te+=8192)I+=String.fromCharCode.apply(null,ne.subarray(te,te+8192));return I};t.addImage=function(){var P,I,ne,te,de,X,J,G,me;if(typeof arguments[1]=="number"?(I=e,ne=arguments[1],te=arguments[2],de=arguments[3],X=arguments[4],J=arguments[5],G=arguments[6],me=arguments[7]):(I=arguments[1],ne=arguments[2],te=arguments[3],de=arguments[4],X=arguments[5],J=arguments[6],G=arguments[7],me=arguments[8]),kn(P=arguments[0])==="object"&&!g(P)&&"imageData"in P){var W=P;P=W.imageData,I=W.format||I||e,ne=W.x||ne||0,te=W.y||te||0,de=W.w||W.width||de,X=W.h||W.height||X,J=W.alias||J,G=W.compression||G,me=W.rotation||W.angle||me}var xe=this.internal.getFilters();if(G===void 0&&xe.indexOf("FlateEncode")!==-1&&(G="SLOW"),isNaN(ne)||isNaN(te))throw new Error("Invalid coordinates passed to jsPDF.addImage");c.call(this);var R=se.call(this,P,I,J,G);return w.call(this,ne,te,de,X,R,me),this};var se=function(P,I,ne,te){var de,X,J;if(typeof P=="string"&&r(P)===e){P=unescape(P);var G=le(P,!1);(G!==""||(G=t.loadFile(P,!0))!==void 0)&&(P=G)}if(g(P)&&(P=b(P,I)),I=r(P,I),!p(I))throw new Error("addImage does not support files of type '"+I+"', please ensure that a plugin for '"+I+"' support is added.");if(((J=ne)==null||J.length===0)&&(ne=function(me){return typeof me=="string"||K(me)?L(me):K(me.data)?L(me.data):null}(P)),(de=y.call(this,ne))||(O()&&(P instanceof Uint8Array||I==="RGBA"||(X=P,P=q(P))),de=this["process"+I.toUpperCase()](P,d.call(this),ne,function(me){return me&&typeof me=="string"&&(me=me.toUpperCase()),me in t.image_compression?me:C.NONE}(te),X)),!de)throw new Error("An unknown error occurred whilst processing the image.");return de},le=t.__addimage__.convertBase64ToBinaryString=function(P,I){I=typeof I!="boolean"||I;var ne,te="";if(typeof P=="string"){var de;ne=(de=z(P))!==null&&de!==void 0?de:P;try{te=kh(ne)}catch(X){if(I)throw j(ne)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+X.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return te};t.getImageProperties=function(P){var I,ne,te="";if(g(P)&&(P=b(P)),typeof P=="string"&&r(P)===e&&((te=le(P,!1))===""&&(te=t.loadFile(P)||""),P=te),ne=r(P),!p(ne))throw new Error("addImage does not support files of type '"+ne+"', please ensure that a plugin for '"+ne+"' support is added.");if(!O()||P instanceof Uint8Array||(P=q(P)),!(I=this["process"+ne.toUpperCase()](P)))throw new Error("An unknown error occurred whilst processing the image");return I.fileType=ne,I}})(Tt.API),function(t){var e=function(n){if(n!==void 0&&n!="")return!0};Tt.API.events.push(["addPage",function(n){this.internal.getPageInfo(n.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(n){for(var r,i,a,o=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString,f=this.internal.getPageInfoByObjId(n.objId),d=n.pageContext.annotations,p=!1,g=0;g<d.length&&!p;g++)switch((r=d[g]).type){case"link":(e(r.options.url)||e(r.options.pageNumber))&&(p=!0);break;case"reference":case"text":case"freetext":p=!0}if(p!=0){this.internal.write("/Annots [");for(var b=0;b<d.length;b++){r=d[b];var y=this.internal.pdfEscape,N=this.internal.getEncryptor(n.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var w=this.internal.newAdditionalObject(),k=this.internal.newAdditionalObject(),C=this.internal.getEncryptor(w.objId),L=r.title||"Note";a="<</Type /Annot /Subtype /Text "+(i="/Rect ["+o(r.bounds.x)+" "+c(r.bounds.y+r.bounds.h)+" "+o(r.bounds.x+r.bounds.w)+" "+c(r.bounds.y)+"] ")+"/Contents ("+y(C(r.contents))+")",a+=" /Popup "+k.objId+" 0 R",a+=" /P "+f.objId+" 0 R",a+=" /T ("+y(C(L))+") >>",w.content=a;var j=w.objId+" 0 R";a="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+o(r.bounds.x+30)+" "+c(r.bounds.y+r.bounds.h)+" "+o(r.bounds.x+r.bounds.w+30)+" "+c(r.bounds.y)+"] ")+" /Parent "+j,r.open&&(a+=" /Open true"),a+=" >>",k.content=a,this.internal.write(w.objId,"0 R",k.objId,"0 R");break;case"freetext":i="/Rect ["+o(r.bounds.x)+" "+c(r.bounds.y)+" "+o(r.bounds.x+r.bounds.w)+" "+c(r.bounds.y+r.bounds.h)+"] ";var z=r.color||"#000000";a="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+y(N(r.contents))+")",a+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+z+")",a+=" /Border [0 0 0]",a+=" >>",this.internal.write(a);break;case"link":if(r.options.name){var O=this.annotations._nameMap[r.options.name];r.options.pageNumber=O.page,r.options.top=O.y}else r.options.top||(r.options.top=0);if(i="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",a="",r.options.url)a="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+y(N(r.options.url))+") >>";else if(r.options.pageNumber)switch(a="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":a+=" /Fit]";break;case"FitH":a+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,a+=" /FitV "+r.options.left+"]";break;case"XYZ":default:var K=c(r.options.top);r.options.left=r.options.left||0,r.options.zoom===void 0&&(r.options.zoom=0),a+=" /XYZ "+r.options.left+" "+K+" "+r.options.zoom+"]"}a!=""&&(a+=" >>",this.internal.write(a))}}this.internal.write("]")}}]),t.createAnnotation=function(n){var r=this.internal.getCurrentPageInfo();switch(n.type){case"link":this.link(n.bounds.x,n.bounds.y,n.bounds.w,n.bounds.h,n);break;case"text":case"freetext":r.pageContext.annotations.push(n)}},t.link=function(n,r,i,a,o){var c=this.internal.getCurrentPageInfo(),f=this.internal.getCoordinateString,d=this.internal.getVerticalCoordinateString;c.pageContext.annotations.push({finalBounds:{x:f(n),y:d(r),w:f(n+i),h:d(r+a)},options:o,type:"link"})},t.textWithLink=function(n,r,i,a){var o,c,f=this.getTextWidth(n),d=this.internal.getLineHeight()/this.internal.scaleFactor;if(a.maxWidth!==void 0){c=a.maxWidth;var p=this.splitTextToSize(n,c).length;o=Math.ceil(d*p)}else c=f,o=d;return this.text(n,r,i,a),i+=.2*d,a.align==="center"&&(r-=f/2),a.align==="right"&&(r-=f),this.link(r,i-d,c,o,a),f},t.getTextWidth=function(n){var r=this.internal.getFontSize();return this.getStringUnitWidth(n)*r/this.internal.scaleFactor}}(Tt.API),function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];t.__arabicParser__={};var a=t.__arabicParser__.isInArabicSubstitutionA=function(w){return e[w.charCodeAt(0)]!==void 0},o=t.__arabicParser__.isArabicLetter=function(w){return typeof w=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(w)},c=t.__arabicParser__.isArabicEndLetter=function(w){return o(w)&&a(w)&&e[w.charCodeAt(0)].length<=2},f=t.__arabicParser__.isArabicAlfLetter=function(w){return o(w)&&i.indexOf(w.charCodeAt(0))>=0};t.__arabicParser__.arabicLetterHasIsolatedForm=function(w){return o(w)&&a(w)&&e[w.charCodeAt(0)].length>=1};var d=t.__arabicParser__.arabicLetterHasFinalForm=function(w){return o(w)&&a(w)&&e[w.charCodeAt(0)].length>=2};t.__arabicParser__.arabicLetterHasInitialForm=function(w){return o(w)&&a(w)&&e[w.charCodeAt(0)].length>=3};var p=t.__arabicParser__.arabicLetterHasMedialForm=function(w){return o(w)&&a(w)&&e[w.charCodeAt(0)].length==4},g=t.__arabicParser__.resolveLigatures=function(w){var k=0,C=n,L="",j=0;for(k=0;k<w.length;k+=1)C[w.charCodeAt(k)]!==void 0?(j++,typeof(C=C[w.charCodeAt(k)])=="number"&&(L+=String.fromCharCode(C),C=n,j=0),k===w.length-1&&(C=n,L+=w.charAt(k-(j-1)),k-=j-1,j=0)):(C=n,L+=w.charAt(k-j),k-=j,j=0);return L};t.__arabicParser__.isArabicDiacritic=function(w){return w!==void 0&&r[w.charCodeAt(0)]!==void 0};var b=t.__arabicParser__.getCorrectForm=function(w,k,C){return o(w)?a(w)===!1?-1:!d(w)||!o(k)&&!o(C)||!o(C)&&c(k)||c(w)&&!o(k)||c(w)&&f(k)||c(w)&&c(k)?0:p(w)&&o(k)&&!c(k)&&o(C)&&d(C)?3:c(w)||!o(C)?1:2:-1},y=function(w){var k=0,C=0,L=0,j="",z="",O="",K=(w=w||"").split("\\s+"),q=[];for(k=0;k<K.length;k+=1){for(q.push(""),C=0;C<K[k].length;C+=1)j=K[k][C],z=K[k][C-1],O=K[k][C+1],o(j)?(L=b(j,z,O),q[k]+=L!==-1?String.fromCharCode(e[j.charCodeAt(0)][L]):j):q[k]+=j;q[k]=g(q[k])}return q.join(" ")},N=t.__arabicParser__.processArabic=t.processArabic=function(){var w,k=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,C=[];if(Array.isArray(k)){var L=0;for(C=[],L=0;L<k.length;L+=1)Array.isArray(k[L])?C.push([y(k[L][0]),k[L][1],k[L][2]]):C.push([y(k[L])]);w=C}else w=y(k);return typeof arguments[0]=="string"?w:(arguments[0].text=w,arguments[0])};t.events.push(["preProcessText",N])}(Tt.API),Tt.API.autoPrint=function(t){var e;switch((t=t||{}).variant=t.variant||"non-conform",t.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})}return this},function(t){var e=function(){var n=void 0;Object.defineProperty(this,"pdf",{get:function(){return n},set:function(c){n=c}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(c){r=isNaN(c)||Number.isInteger(c)===!1||c<0?150:c,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(c){i=isNaN(c)||Number.isInteger(c)===!1||c<0?300:c,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var a=[];Object.defineProperty(this,"childNodes",{get:function(){return a},set:function(c){a=c}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(c){o=c}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(n,r){var i;if((n=n||"2d")!=="2d")return null;for(i in r)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=r[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},t.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])}(Tt.API),function(t){var e={left:0,top:0,bottom:0,right:0},n=!1,r=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},e),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var f=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return f},set:function(w){f=w}});var d=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return d},set:function(w){d=w}});var p=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return p},set:function(w){p=w}});var g=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return g},set:function(w){g=w}});var b=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return b},set:function(w){b=w}});var y=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return y},set:function(w){y=w}});var N=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return N},set:function(w){N=w}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(f){return r.call(this),this.internal.__cell__.headerFunction=typeof f=="function"?f:void 0,this},t.getTextDimensions=function(f,d){r.call(this);var p=(d=d||{}).fontSize||this.getFontSize(),g=d.font||this.getFont(),b=d.scaleFactor||this.internal.scaleFactor,y=0,N=0,w=0,k=this;if(!Array.isArray(f)&&typeof f!="string"){if(typeof f!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");f=String(f)}var C=d.maxWidth;C>0?typeof f=="string"?f=this.splitTextToSize(f,C):Object.prototype.toString.call(f)==="[object Array]"&&(f=f.reduce(function(j,z){return j.concat(k.splitTextToSize(z,C))},[])):f=Array.isArray(f)?f:[f];for(var L=0;L<f.length;L++)y<(w=this.getStringUnitWidth(f[L],{font:g})*p)&&(y=w);return y!==0&&(N=f.length),{w:y/=b,h:Math.max((N*p*this.getLineHeightFactor()-p*(this.getLineHeightFactor()-1))/b,0)}},t.cellAddPage=function(){r.call(this),this.addPage();var f=this.internal.__cell__.margins||e;return this.internal.__cell__.lastCell=new a(f.left,f.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=t.cell=function(){var f;f=arguments[0]instanceof a?arguments[0]:new a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),r.call(this);var d=this.internal.__cell__.lastCell,p=this.internal.__cell__.padding,g=this.internal.__cell__.margins||e,b=this.internal.__cell__.tableHeaderRow,y=this.internal.__cell__.printHeaders;return d.lineNumber!==void 0&&(d.lineNumber===f.lineNumber?(f.x=(d.x||0)+(d.width||0),f.y=d.y||0):d.y+d.height+f.height+g.bottom>this.getPageHeight()?(this.cellAddPage(),f.y=g.top,y&&b&&(this.printHeaderRow(f.lineNumber,!0),f.y+=b[0].height)):f.y=d.y+d.height||f.y),f.text[0]!==void 0&&(this.rect(f.x,f.y,f.width,f.height,n===!0?"FD":void 0),f.align==="right"?this.text(f.text,f.x+f.width-p,f.y+p,{align:"right",baseline:"top"}):f.align==="center"?this.text(f.text,f.x+f.width/2,f.y+p,{align:"center",baseline:"top",maxWidth:f.width-p-p}):this.text(f.text,f.x+p,f.y+p,{align:"left",baseline:"top",maxWidth:f.width-p-p})),this.internal.__cell__.lastCell=f,this};t.table=function(f,d,p,g,b){if(r.call(this),!p)throw new Error("No data for PDF table.");var y,N,w,k,C=[],L=[],j=[],z={},O={},K=[],q=[],H=(b=b||{}).autoSize||!1,se=b.printHeaders!==!1,le=b.css&&b.css["font-size"]!==void 0?16*b.css["font-size"]:b.fontSize||12,P=b.margins||Object.assign({width:this.getPageWidth()},e),I=typeof b.padding=="number"?b.padding:3,ne=b.headerBackgroundColor||"#c8c8c8",te=b.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=se,this.internal.__cell__.margins=P,this.internal.__cell__.table_font_size=le,this.internal.__cell__.padding=I,this.internal.__cell__.headerBackgroundColor=ne,this.internal.__cell__.headerTextColor=te,this.setFontSize(le),g==null)L=C=Object.keys(p[0]),j=C.map(function(){return"left"});else if(Array.isArray(g)&&kn(g[0])==="object")for(C=g.map(function(W){return W.name}),L=g.map(function(W){return W.prompt||W.name||""}),j=g.map(function(W){return W.align||"left"}),y=0;y<g.length;y+=1)O[g[y].name]=g[y].width*(19.049976/25.4);else Array.isArray(g)&&typeof g[0]=="string"&&(L=C=g,j=C.map(function(){return"left"}));if(H||Array.isArray(g)&&typeof g[0]=="string")for(y=0;y<C.length;y+=1){for(z[k=C[y]]=p.map(function(W){return W[k]}),this.setFont(void 0,"bold"),K.push(this.getTextDimensions(L[y],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),N=z[k],this.setFont(void 0,"normal"),w=0;w<N.length;w+=1)K.push(this.getTextDimensions(N[w],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);O[k]=Math.max.apply(null,K)+I+I,K=[]}if(se){var de={};for(y=0;y<C.length;y+=1)de[C[y]]={},de[C[y]].text=L[y],de[C[y]].align=j[y];var X=c.call(this,de,O);q=C.map(function(W){return new a(f,d,O[W],X,de[W].text,void 0,de[W].align)}),this.setTableHeaderRow(q),this.printHeaderRow(1,!1)}var J=g.reduce(function(W,xe){return W[xe.name]=xe.align,W},{});for(y=0;y<p.length;y+=1){"rowStart"in b&&b.rowStart instanceof Function&&b.rowStart({row:y,data:p[y]},this);var G=c.call(this,p[y],O);for(w=0;w<C.length;w+=1){var me=p[y][C[w]];"cellStart"in b&&b.cellStart instanceof Function&&b.cellStart({row:y,col:w,data:me},this),o.call(this,new a(f,d,O[C[w]],G,me,y+2,J[C[w]]))}}return this.internal.__cell__.table_x=f,this.internal.__cell__.table_y=d,this};var c=function(f,d){var p=this.internal.__cell__.padding,g=this.internal.__cell__.table_font_size,b=this.internal.scaleFactor;return Object.keys(f).map(function(y){var N=f[y];return this.splitTextToSize(N.hasOwnProperty("text")?N.text:N,d[y]-p-p)},this).map(function(y){return this.getLineHeightFactor()*y.length*g/b+p+p},this).reduce(function(y,N){return Math.max(y,N)},0)};t.setTableHeaderRow=function(f){r.call(this),this.internal.__cell__.tableHeaderRow=f},t.printHeaderRow=function(f,d){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var p;if(n=!0,typeof this.internal.__cell__.headerFunction=="function"){var g=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new a(g[0],g[1],g[2],g[3],void 0,-1)}this.setFont(void 0,"bold");for(var b=[],y=0;y<this.internal.__cell__.tableHeaderRow.length;y+=1){p=this.internal.__cell__.tableHeaderRow[y].clone(),d&&(p.y=this.internal.__cell__.margins.top||0,b.push(p)),p.lineNumber=f;var N=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,p),this.setTextColor(N)}b.length>0&&this.setTableHeaderRow(b),this.setFont(void 0,"normal"),n=!1}}(Tt.API);var RN={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},PN=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],z2=TN(PN),BN=[100,200,300,400,500,600,700,800,900],iF=TN(BN);function H2(t){var e=t.family.replace(/"|'/g,"").toLowerCase(),n=function(a){return RN[a=a||"normal"]?a:"normal"}(t.style),r=function(a){if(!a)return 400;if(typeof a=="number")return a>=100&&a<=900&&a%100==0?a:400;if(/^\d00$/.test(a))return parseInt(a);switch(a){case"bold":return 700;case"normal":default:return 400}}(t.weight),i=function(a){return typeof z2[a=a||"normal"]=="number"?a:"normal"}(t.stretch);return{family:e,style:n,weight:r,stretch:i,src:t.src||[],ref:t.ref||{name:e,style:[i,n,r].join(" ")}}}function kw(t,e,n,r){var i;for(i=n;i>=0&&i<e.length;i+=r)if(t[e[i]])return t[e[i]];for(i=n;i>=0&&i<e.length;i-=r)if(t[e[i]])return t[e[i]]}var aF={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Mw={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Lw(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function sF(t,e,n){for(var r=(n=n||{}).defaultFontFamily||"times",i=Object.assign({},aF,n.genericFontFamilies||{}),a=null,o=null,c=0;c<e.length;++c)if(i[(a=H2(e[c])).family]&&(a.family=i[a.family]),t.hasOwnProperty(a.family)){o=t[a.family];break}if(!(o=o||t[r]))throw new Error("Could not find a font-family for the rule '"+Lw(a)+"' and default family '"+r+"'.");if(o=function(f,d){if(d[f])return d[f];var p=z2[f],g=p<=z2.normal?-1:1,b=kw(d,PN,p,g);if(!b)throw new Error("Could not find a matching font-stretch value for "+f);return b}(a.stretch,o),o=function(f,d){if(d[f])return d[f];for(var p=RN[f],g=0;g<p.length;++g)if(d[p[g]])return d[p[g]];throw new Error("Could not find a matching font-style for "+f)}(a.style,o),!(o=function(f,d){if(d[f])return d[f];if(f===400&&d[500])return d[500];if(f===500&&d[400])return d[400];var p=iF[f],g=kw(d,BN,p,f<400?-1:1);if(!g)throw new Error("Could not find a matching font-weight for value "+f);return g}(a.weight,o)))throw new Error("Failed to resolve a font for the rule '"+Lw(a)+"'.");return o}function Ew(t){return t.trimLeft()}function oF(t,e){for(var n=0;n<t.length;){if(t.charAt(n)===e)return[t.substring(0,n),t.substring(n+1)];n+=1}return null}function lF(t){var e=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return e===null?null:[e[0],t.substring(e[0].length)]}var Am,Dw,jw,q1=["times"];(function(t){var e,n,r,i,a,o,c,f,d,p=function(R){return R=R||{},this.isStrokeTransparent=R.isStrokeTransparent||!1,this.strokeOpacity=R.strokeOpacity||1,this.strokeStyle=R.strokeStyle||"#000000",this.fillStyle=R.fillStyle||"#000000",this.isFillTransparent=R.isFillTransparent||!1,this.fillOpacity=R.fillOpacity||1,this.font=R.font||"10px sans-serif",this.textBaseline=R.textBaseline||"alphabetic",this.textAlign=R.textAlign||"left",this.lineWidth=R.lineWidth||1,this.lineJoin=R.lineJoin||"miter",this.lineCap=R.lineCap||"butt",this.path=R.path||[],this.transform=R.transform!==void 0?R.transform.clone():new f,this.globalCompositeOperation=R.globalCompositeOperation||"normal",this.globalAlpha=R.globalAlpha||1,this.clip_path=R.clip_path||[],this.currentPoint=R.currentPoint||new o,this.miterLimit=R.miterLimit||10,this.lastPoint=R.lastPoint||new o,this.lineDashOffset=R.lineDashOffset||0,this.lineDash=R.lineDash||[],this.margin=R.margin||[0,0,0,0],this.prevPageLastElemOffset=R.prevPageLastElemOffset||0,this.ignoreClearRect=typeof R.ignoreClearRect!="boolean"||R.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new g(this),e=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,o=this.internal.Point,c=this.internal.Rectangle,f=this.internal.Matrix,d=new p}]);var g=function(R){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var V=R;Object.defineProperty(this,"pdf",{get:function(){return V}});var Q=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return Q},set:function(ze){Q=!!ze}});var ae=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return ae},set:function(ze){ae=!!ze}});var ce=0;Object.defineProperty(this,"posX",{get:function(){return ce},set:function(ze){isNaN(ze)||(ce=ze)}});var he=0;Object.defineProperty(this,"posY",{get:function(){return he},set:function(ze){isNaN(ze)||(he=ze)}}),Object.defineProperty(this,"margin",{get:function(){return d.margin},set:function(ze){var ue;typeof ze=="number"?ue=[ze,ze,ze,ze]:((ue=new Array(4))[0]=ze[0],ue[1]=ze.length>=2?ze[1]:ue[0],ue[2]=ze.length>=3?ze[2]:ue[0],ue[3]=ze.length>=4?ze[3]:ue[1]),d.margin=ue}});var we=!1;Object.defineProperty(this,"autoPaging",{get:function(){return we},set:function(ze){we=ze}});var Se=0;Object.defineProperty(this,"lastBreak",{get:function(){return Se},set:function(ze){Se=ze}});var Ve=[];Object.defineProperty(this,"pageBreaks",{get:function(){return Ve},set:function(ze){Ve=ze}}),Object.defineProperty(this,"ctx",{get:function(){return d},set:function(ze){ze instanceof p&&(d=ze)}}),Object.defineProperty(this,"path",{get:function(){return d.path},set:function(ze){d.path=ze}});var He=[];Object.defineProperty(this,"ctxStack",{get:function(){return He},set:function(ze){He=ze}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(ze){var ue;ue=b(ze),this.ctx.fillStyle=ue.style,this.ctx.isFillTransparent=ue.a===0,this.ctx.fillOpacity=ue.a,this.pdf.setFillColor(ue.r,ue.g,ue.b,{a:ue.a}),this.pdf.setTextColor(ue.r,ue.g,ue.b,{a:ue.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(ze){var ue=b(ze);this.ctx.strokeStyle=ue.style,this.ctx.isStrokeTransparent=ue.a===0,this.ctx.strokeOpacity=ue.a,ue.a===0?this.pdf.setDrawColor(255,255,255):(ue.a,this.pdf.setDrawColor(ue.r,ue.g,ue.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(ze){["butt","round","square"].indexOf(ze)!==-1&&(this.ctx.lineCap=ze,this.pdf.setLineCap(ze))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(ze){isNaN(ze)||(this.ctx.lineWidth=ze,this.pdf.setLineWidth(ze))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(ze){["bevel","round","miter"].indexOf(ze)!==-1&&(this.ctx.lineJoin=ze,this.pdf.setLineJoin(ze))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(ze){isNaN(ze)||(this.ctx.miterLimit=ze,this.pdf.setMiterLimit(ze))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(ze){this.ctx.textBaseline=ze}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(ze){["right","end","center","left","start"].indexOf(ze)!==-1&&(this.ctx.textAlign=ze)}});var Je=null;function it(ze,ue){if(Je===null){var pt=function(ht){var fe=[];return Object.keys(ht).forEach(function(Ce){ht[Ce].forEach(function(Oe){var Ge=null;switch(Oe){case"bold":Ge={family:Ce,weight:"bold"};break;case"italic":Ge={family:Ce,style:"italic"};break;case"bolditalic":Ge={family:Ce,weight:"bold",style:"italic"};break;case"":case"normal":Ge={family:Ce}}Ge!==null&&(Ge.ref={name:Ce,style:Oe},fe.push(Ge))})}),fe}(ze.getFontList());Je=function(ht){for(var fe={},Ce=0;Ce<ht.length;++Ce){var Oe=H2(ht[Ce]),Ge=Oe.family,Ue=Oe.stretch,ie=Oe.style,ye=Oe.weight;fe[Ge]=fe[Ge]||{},fe[Ge][Ue]=fe[Ge][Ue]||{},fe[Ge][Ue][ie]=fe[Ge][Ue][ie]||{},fe[Ge][Ue][ie][ye]=Oe}return fe}(pt.concat(ue))}return Je}var dt=null;Object.defineProperty(this,"fontFaces",{get:function(){return dt},set:function(ze){Je=null,dt=ze}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(ze){var ue;if(this.ctx.font=ze,(ue=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(ze))!==null){var pt=ue[1];ue[2];var ht=ue[3],fe=ue[4];ue[5];var Ce=ue[6],Oe=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(fe)[2];fe=Math.floor(Oe==="px"?parseFloat(fe)*this.pdf.internal.scaleFactor:Oe==="em"?parseFloat(fe)*this.pdf.getFontSize():parseFloat(fe)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(fe);var Ge=function(qe){var ft,$e,jt=[],Mt=qe.trim();if(Mt==="")return q1;if(Mt in Mw)return[Mw[Mt]];for(;Mt!=="";){switch($e=null,ft=(Mt=Ew(Mt)).charAt(0)){case'"':case"'":$e=oF(Mt.substring(1),ft);break;default:$e=lF(Mt)}if($e===null||(jt.push($e[0]),(Mt=Ew($e[1]))!==""&&Mt.charAt(0)!==","))return q1;Mt=Mt.replace(/^,/,"")}return jt}(Ce);if(this.fontFaces){var Ue=sF(it(this.pdf,this.fontFaces),Ge.map(function(qe){return{family:qe,stretch:"normal",weight:ht,style:pt}}));this.pdf.setFont(Ue.ref.name,Ue.ref.style)}else{var ie="";(ht==="bold"||parseInt(ht,10)>=700||pt==="bold")&&(ie="bold"),pt==="italic"&&(ie+="italic"),ie.length===0&&(ie="normal");for(var ye="",Be={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Le=0;Le<Ge.length;Le++){if(this.pdf.internal.getFont(Ge[Le],ie,{noFallback:!0,disableWarning:!0})!==void 0){ye=Ge[Le];break}if(ie==="bolditalic"&&this.pdf.internal.getFont(Ge[Le],"bold",{noFallback:!0,disableWarning:!0})!==void 0)ye=Ge[Le],ie="bold";else if(this.pdf.internal.getFont(Ge[Le],"normal",{noFallback:!0,disableWarning:!0})!==void 0){ye=Ge[Le],ie="normal";break}}if(ye===""){for(var Re=0;Re<Ge.length;Re++)if(Be[Ge[Re]]){ye=Be[Ge[Re]];break}}ye=ye===""?"Times":ye,this.pdf.setFont(ye,ie)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(ze){this.ctx.globalCompositeOperation=ze}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(ze){this.ctx.globalAlpha=ze}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(ze){this.ctx.lineDashOffset=ze,xe.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(ze){this.ctx.lineDash=ze,xe.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(ze){this.ctx.ignoreClearRect=!!ze}})};g.prototype.setLineDash=function(R){this.lineDash=R},g.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},g.prototype.fill=function(){z.call(this,"fill",!1)},g.prototype.stroke=function(){z.call(this,"stroke",!1)},g.prototype.beginPath=function(){this.path=[{type:"begin"}]},g.prototype.moveTo=function(R,V){if(isNaN(R)||isNaN(V))throw Rn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var Q=this.ctx.transform.applyToPoint(new o(R,V));this.path.push({type:"mt",x:Q.x,y:Q.y}),this.ctx.lastPoint=new o(R,V)},g.prototype.closePath=function(){var R=new o(0,0),V=0;for(V=this.path.length-1;V!==-1;V--)if(this.path[V].type==="begin"&&kn(this.path[V+1])==="object"&&typeof this.path[V+1].x=="number"){R=new o(this.path[V+1].x,this.path[V+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(R.x,R.y)},g.prototype.lineTo=function(R,V){if(isNaN(R)||isNaN(V))throw Rn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var Q=this.ctx.transform.applyToPoint(new o(R,V));this.path.push({type:"lt",x:Q.x,y:Q.y}),this.ctx.lastPoint=new o(Q.x,Q.y)},g.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),z.call(this,null,!0)},g.prototype.quadraticCurveTo=function(R,V,Q,ae){if(isNaN(Q)||isNaN(ae)||isNaN(R)||isNaN(V))throw Rn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var ce=this.ctx.transform.applyToPoint(new o(Q,ae)),he=this.ctx.transform.applyToPoint(new o(R,V));this.path.push({type:"qct",x1:he.x,y1:he.y,x:ce.x,y:ce.y}),this.ctx.lastPoint=new o(ce.x,ce.y)},g.prototype.bezierCurveTo=function(R,V,Q,ae,ce,he){if(isNaN(ce)||isNaN(he)||isNaN(R)||isNaN(V)||isNaN(Q)||isNaN(ae))throw Rn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var we=this.ctx.transform.applyToPoint(new o(ce,he)),Se=this.ctx.transform.applyToPoint(new o(R,V)),Ve=this.ctx.transform.applyToPoint(new o(Q,ae));this.path.push({type:"bct",x1:Se.x,y1:Se.y,x2:Ve.x,y2:Ve.y,x:we.x,y:we.y}),this.ctx.lastPoint=new o(we.x,we.y)},g.prototype.arc=function(R,V,Q,ae,ce,he){if(isNaN(R)||isNaN(V)||isNaN(Q)||isNaN(ae)||isNaN(ce))throw Rn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(he=!!he,!this.ctx.transform.isIdentity){var we=this.ctx.transform.applyToPoint(new o(R,V));R=we.x,V=we.y;var Se=this.ctx.transform.applyToPoint(new o(0,Q)),Ve=this.ctx.transform.applyToPoint(new o(0,0));Q=Math.sqrt(Math.pow(Se.x-Ve.x,2)+Math.pow(Se.y-Ve.y,2))}Math.abs(ce-ae)>=2*Math.PI&&(ae=0,ce=2*Math.PI),this.path.push({type:"arc",x:R,y:V,radius:Q,startAngle:ae,endAngle:ce,counterclockwise:he})},g.prototype.arcTo=function(R,V,Q,ae,ce){throw new Error("arcTo not implemented.")},g.prototype.rect=function(R,V,Q,ae){if(isNaN(R)||isNaN(V)||isNaN(Q)||isNaN(ae))throw Rn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(R,V),this.lineTo(R+Q,V),this.lineTo(R+Q,V+ae),this.lineTo(R,V+ae),this.lineTo(R,V),this.lineTo(R+Q,V),this.lineTo(R,V)},g.prototype.fillRect=function(R,V,Q,ae){if(isNaN(R)||isNaN(V)||isNaN(Q)||isNaN(ae))throw Rn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!y.call(this)){var ce={};this.lineCap!=="butt"&&(ce.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(ce.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(R,V,Q,ae),this.fill(),ce.hasOwnProperty("lineCap")&&(this.lineCap=ce.lineCap),ce.hasOwnProperty("lineJoin")&&(this.lineJoin=ce.lineJoin)}},g.prototype.strokeRect=function(R,V,Q,ae){if(isNaN(R)||isNaN(V)||isNaN(Q)||isNaN(ae))throw Rn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");N.call(this)||(this.beginPath(),this.rect(R,V,Q,ae),this.stroke())},g.prototype.clearRect=function(R,V,Q,ae){if(isNaN(R)||isNaN(V)||isNaN(Q)||isNaN(ae))throw Rn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(R,V,Q,ae))},g.prototype.save=function(R){R=typeof R!="boolean"||R;for(var V=this.pdf.internal.getCurrentPageInfo().pageNumber,Q=0;Q<this.pdf.internal.getNumberOfPages();Q++)this.pdf.setPage(Q+1),this.pdf.internal.out("q");if(this.pdf.setPage(V),R){this.ctx.fontSize=this.pdf.internal.getFontSize();var ae=new p(this.ctx);this.ctxStack.push(this.ctx),this.ctx=ae}},g.prototype.restore=function(R){R=typeof R!="boolean"||R;for(var V=this.pdf.internal.getCurrentPageInfo().pageNumber,Q=0;Q<this.pdf.internal.getNumberOfPages();Q++)this.pdf.setPage(Q+1),this.pdf.internal.out("Q");this.pdf.setPage(V),R&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},g.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var b=function(R){var V,Q,ae,ce;if(R.isCanvasGradient===!0&&(R=R.getColor()),!R)return{r:0,g:0,b:0,a:0,style:R};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(R))V=0,Q=0,ae=0,ce=0;else{var he=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(R);if(he!==null)V=parseInt(he[1]),Q=parseInt(he[2]),ae=parseInt(he[3]),ce=1;else if((he=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(R))!==null)V=parseInt(he[1]),Q=parseInt(he[2]),ae=parseInt(he[3]),ce=parseFloat(he[4]);else{if(ce=1,typeof R=="string"&&R.charAt(0)!=="#"){var we=new MN(R);R=we.ok?we.toHex():"#000000"}R.length===4?(V=R.substring(1,2),V+=V,Q=R.substring(2,3),Q+=Q,ae=R.substring(3,4),ae+=ae):(V=R.substring(1,3),Q=R.substring(3,5),ae=R.substring(5,7)),V=parseInt(V,16),Q=parseInt(Q,16),ae=parseInt(ae,16)}}return{r:V,g:Q,b:ae,a:ce,style:R}},y=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},N=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};g.prototype.fillText=function(R,V,Q,ae){if(isNaN(V)||isNaN(Q)||typeof R!="string")throw Rn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(ae=isNaN(ae)?void 0:ae,!y.call(this)){var ce=G(this.ctx.transform.rotation),he=this.ctx.transform.scaleX;I.call(this,{text:R,x:V,y:Q,scale:he,angle:ce,align:this.textAlign,maxWidth:ae})}},g.prototype.strokeText=function(R,V,Q,ae){if(isNaN(V)||isNaN(Q)||typeof R!="string")throw Rn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!N.call(this)){ae=isNaN(ae)?void 0:ae;var ce=G(this.ctx.transform.rotation),he=this.ctx.transform.scaleX;I.call(this,{text:R,x:V,y:Q,scale:he,renderingMode:"stroke",angle:ce,align:this.textAlign,maxWidth:ae})}},g.prototype.measureText=function(R){if(typeof R!="string")throw Rn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var V=this.pdf,Q=this.pdf.internal.scaleFactor,ae=V.internal.getFontSize(),ce=V.getStringUnitWidth(R)*ae/V.internal.scaleFactor,he=function(we){var Se=(we=we||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return Se}}),this};return new he({width:ce*=Math.round(96*Q/72*1e4)/1e4})},g.prototype.scale=function(R,V){if(isNaN(R)||isNaN(V))throw Rn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var Q=new f(R,0,0,V,0,0);this.ctx.transform=this.ctx.transform.multiply(Q)},g.prototype.rotate=function(R){if(isNaN(R))throw Rn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var V=new f(Math.cos(R),Math.sin(R),-Math.sin(R),Math.cos(R),0,0);this.ctx.transform=this.ctx.transform.multiply(V)},g.prototype.translate=function(R,V){if(isNaN(R)||isNaN(V))throw Rn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var Q=new f(1,0,0,1,R,V);this.ctx.transform=this.ctx.transform.multiply(Q)},g.prototype.transform=function(R,V,Q,ae,ce,he){if(isNaN(R)||isNaN(V)||isNaN(Q)||isNaN(ae)||isNaN(ce)||isNaN(he))throw Rn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var we=new f(R,V,Q,ae,ce,he);this.ctx.transform=this.ctx.transform.multiply(we)},g.prototype.setTransform=function(R,V,Q,ae,ce,he){R=isNaN(R)?1:R,V=isNaN(V)?0:V,Q=isNaN(Q)?0:Q,ae=isNaN(ae)?1:ae,ce=isNaN(ce)?0:ce,he=isNaN(he)?0:he,this.ctx.transform=new f(R,V,Q,ae,ce,he)};var w=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};g.prototype.drawImage=function(R,V,Q,ae,ce,he,we,Se,Ve){var He=this.pdf.getImageProperties(R),Je=1,it=1,dt=1,ze=1;ae!==void 0&&Se!==void 0&&(dt=Se/ae,ze=Ve/ce,Je=He.width/ae*Se/ae,it=He.height/ce*Ve/ce),he===void 0&&(he=V,we=Q,V=0,Q=0),ae!==void 0&&Se===void 0&&(Se=ae,Ve=ce),ae===void 0&&Se===void 0&&(Se=He.width,Ve=He.height);for(var ue,pt=this.ctx.transform.decompose(),ht=G(pt.rotate.shx),fe=new f,Ce=(fe=(fe=(fe=fe.multiply(pt.translate)).multiply(pt.skew)).multiply(pt.scale)).applyToRectangle(new c(he-V*dt,we-Q*ze,ae*Je,ce*it)),Oe=k.call(this,Ce),Ge=[],Ue=0;Ue<Oe.length;Ue+=1)Ge.indexOf(Oe[Ue])===-1&&Ge.push(Oe[Ue]);if(j(Ge),this.autoPaging)for(var ie=Ge[0],ye=Ge[Ge.length-1],Be=ie;Be<ye+1;Be++){this.pdf.setPage(Be);var Le=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Re=Be===1?this.posY+this.margin[0]:this.margin[0],qe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ft=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],$e=Be===1?0:qe+(Be-2)*ft;if(this.ctx.clip_path.length!==0){var jt=this.path;ue=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=L(ue,this.posX+this.margin[3],-$e+Re+this.ctx.prevPageLastElemOffset),O.call(this,"fill",!0),this.path=jt}var Mt=JSON.parse(JSON.stringify(Ce));Mt=L([Mt],this.posX+this.margin[3],-$e+Re+this.ctx.prevPageLastElemOffset)[0];var mn=(Be>ie||Be<ye)&&w.call(this);mn&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Le,ft,null).clip().discardPath()),this.pdf.addImage(R,"JPEG",Mt.x,Mt.y,Mt.w,Mt.h,null,null,ht),mn&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(R,"JPEG",Ce.x,Ce.y,Ce.w,Ce.h,null,null,ht)};var k=function(R,V,Q){var ae=[];V=V||this.pdf.internal.pageSize.width,Q=Q||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var ce=this.posY+this.ctx.prevPageLastElemOffset;switch(R.type){default:case"mt":case"lt":ae.push(Math.floor((R.y+ce)/Q)+1);break;case"arc":ae.push(Math.floor((R.y+ce-R.radius)/Q)+1),ae.push(Math.floor((R.y+ce+R.radius)/Q)+1);break;case"qct":var he=me(this.ctx.lastPoint.x,this.ctx.lastPoint.y,R.x1,R.y1,R.x,R.y);ae.push(Math.floor((he.y+ce)/Q)+1),ae.push(Math.floor((he.y+he.h+ce)/Q)+1);break;case"bct":var we=W(this.ctx.lastPoint.x,this.ctx.lastPoint.y,R.x1,R.y1,R.x2,R.y2,R.x,R.y);ae.push(Math.floor((we.y+ce)/Q)+1),ae.push(Math.floor((we.y+we.h+ce)/Q)+1);break;case"rect":ae.push(Math.floor((R.y+ce)/Q)+1),ae.push(Math.floor((R.y+R.h+ce)/Q)+1)}for(var Se=0;Se<ae.length;Se+=1)for(;this.pdf.internal.getNumberOfPages()<ae[Se];)C.call(this);return ae},C=function(){var R=this.fillStyle,V=this.strokeStyle,Q=this.font,ae=this.lineCap,ce=this.lineWidth,he=this.lineJoin;this.pdf.addPage(),this.fillStyle=R,this.strokeStyle=V,this.font=Q,this.lineCap=ae,this.lineWidth=ce,this.lineJoin=he},L=function(R,V,Q){for(var ae=0;ae<R.length;ae++)switch(R[ae].type){case"bct":R[ae].x2+=V,R[ae].y2+=Q;case"qct":R[ae].x1+=V,R[ae].y1+=Q;case"mt":case"lt":case"arc":default:R[ae].x+=V,R[ae].y+=Q}return R},j=function(R){return R.sort(function(V,Q){return V-Q})},z=function(R,V){for(var Q,ae,ce=this.fillStyle,he=this.strokeStyle,we=this.lineCap,Se=this.lineWidth,Ve=Math.abs(Se*this.ctx.transform.scaleX),He=this.lineJoin,Je=JSON.parse(JSON.stringify(this.path)),it=JSON.parse(JSON.stringify(this.path)),dt=[],ze=0;ze<it.length;ze++)if(it[ze].x!==void 0)for(var ue=k.call(this,it[ze]),pt=0;pt<ue.length;pt+=1)dt.indexOf(ue[pt])===-1&&dt.push(ue[pt]);for(var ht=0;ht<dt.length;ht++)for(;this.pdf.internal.getNumberOfPages()<dt[ht];)C.call(this);if(j(dt),this.autoPaging)for(var fe=dt[0],Ce=dt[dt.length-1],Oe=fe;Oe<Ce+1;Oe++){this.pdf.setPage(Oe),this.fillStyle=ce,this.strokeStyle=he,this.lineCap=we,this.lineWidth=Ve,this.lineJoin=He;var Ge=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ue=Oe===1?this.posY+this.margin[0]:this.margin[0],ie=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ye=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Be=Oe===1?0:ie+(Oe-2)*ye;if(this.ctx.clip_path.length!==0){var Le=this.path;Q=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=L(Q,this.posX+this.margin[3],-Be+Ue+this.ctx.prevPageLastElemOffset),O.call(this,R,!0),this.path=Le}if(ae=JSON.parse(JSON.stringify(Je)),this.path=L(ae,this.posX+this.margin[3],-Be+Ue+this.ctx.prevPageLastElemOffset),V===!1||Oe===0){var Re=(Oe>fe||Oe<Ce)&&w.call(this);Re&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ge,ye,null).clip().discardPath()),O.call(this,R,V),Re&&this.pdf.restoreGraphicsState()}this.lineWidth=Se}else this.lineWidth=Ve,O.call(this,R,V),this.lineWidth=Se;this.path=Je},O=function(R,V){if((R!=="stroke"||V||!N.call(this))&&(R==="stroke"||V||!y.call(this))){for(var Q,ae,ce=[],he=this.path,we=0;we<he.length;we++){var Se=he[we];switch(Se.type){case"begin":ce.push({begin:!0});break;case"close":ce.push({close:!0});break;case"mt":ce.push({start:Se,deltas:[],abs:[]});break;case"lt":var Ve=ce.length;if(he[we-1]&&!isNaN(he[we-1].x)&&(Q=[Se.x-he[we-1].x,Se.y-he[we-1].y],Ve>0)){for(;Ve>=0;Ve--)if(ce[Ve-1].close!==!0&&ce[Ve-1].begin!==!0){ce[Ve-1].deltas.push(Q),ce[Ve-1].abs.push(Se);break}}break;case"bct":Q=[Se.x1-he[we-1].x,Se.y1-he[we-1].y,Se.x2-he[we-1].x,Se.y2-he[we-1].y,Se.x-he[we-1].x,Se.y-he[we-1].y],ce[ce.length-1].deltas.push(Q);break;case"qct":var He=he[we-1].x+2/3*(Se.x1-he[we-1].x),Je=he[we-1].y+2/3*(Se.y1-he[we-1].y),it=Se.x+2/3*(Se.x1-Se.x),dt=Se.y+2/3*(Se.y1-Se.y),ze=Se.x,ue=Se.y;Q=[He-he[we-1].x,Je-he[we-1].y,it-he[we-1].x,dt-he[we-1].y,ze-he[we-1].x,ue-he[we-1].y],ce[ce.length-1].deltas.push(Q);break;case"arc":ce.push({deltas:[],abs:[],arc:!0}),Array.isArray(ce[ce.length-1].abs)&&ce[ce.length-1].abs.push(Se)}}ae=V?null:R==="stroke"?"stroke":"fill";for(var pt=!1,ht=0;ht<ce.length;ht++)if(ce[ht].arc)for(var fe=ce[ht].abs,Ce=0;Ce<fe.length;Ce++){var Oe=fe[Ce];Oe.type==="arc"?H.call(this,Oe.x,Oe.y,Oe.radius,Oe.startAngle,Oe.endAngle,Oe.counterclockwise,void 0,V,!pt):ne.call(this,Oe.x,Oe.y),pt=!0}else if(ce[ht].close===!0)this.pdf.internal.out("h"),pt=!1;else if(ce[ht].begin!==!0){var Ge=ce[ht].start.x,Ue=ce[ht].start.y;te.call(this,ce[ht].deltas,Ge,Ue),pt=!0}ae&&se.call(this,ae),V&&le.call(this)}},K=function(R){var V=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,Q=V*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return R-Q;case"top":return R+V-Q;case"hanging":return R+V-2*Q;case"middle":return R+V/2-Q;case"ideographic":return R;case"alphabetic":default:return R}},q=function(R){return R+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};g.prototype.createLinearGradient=function(){var R=function(){};return R.colorStops=[],R.addColorStop=function(V,Q){this.colorStops.push([V,Q])},R.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},R.isCanvasGradient=!0,R},g.prototype.createPattern=function(){return this.createLinearGradient()},g.prototype.createRadialGradient=function(){return this.createLinearGradient()};var H=function(R,V,Q,ae,ce,he,we,Se,Ve){for(var He=X.call(this,Q,ae,ce,he),Je=0;Je<He.length;Je++){var it=He[Je];Je===0&&(Ve?P.call(this,it.x1+R,it.y1+V):ne.call(this,it.x1+R,it.y1+V)),de.call(this,R,V,it.x2,it.y2,it.x3,it.y3,it.x4,it.y4)}Se?le.call(this):se.call(this,we)},se=function(R){switch(R){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},le=function(){this.pdf.clip(),this.pdf.discardPath()},P=function(R,V){this.pdf.internal.out(n(R)+" "+r(V)+" m")},I=function(R){var V;switch(R.align){case"right":case"end":V="right";break;case"center":V="center";break;case"left":case"start":default:V="left"}var Q=this.pdf.getTextDimensions(R.text),ae=K.call(this,R.y),ce=q.call(this,ae)-Q.h,he=this.ctx.transform.applyToPoint(new o(R.x,ae)),we=this.ctx.transform.decompose(),Se=new f;Se=(Se=(Se=Se.multiply(we.translate)).multiply(we.skew)).multiply(we.scale);for(var Ve,He,Je,it=this.ctx.transform.applyToRectangle(new c(R.x,ae,Q.w,Q.h)),dt=Se.applyToRectangle(new c(R.x,ce,Q.w,Q.h)),ze=k.call(this,dt),ue=[],pt=0;pt<ze.length;pt+=1)ue.indexOf(ze[pt])===-1&&ue.push(ze[pt]);if(j(ue),this.autoPaging)for(var ht=ue[0],fe=ue[ue.length-1],Ce=ht;Ce<fe+1;Ce++){this.pdf.setPage(Ce);var Oe=Ce===1?this.posY+this.margin[0]:this.margin[0],Ge=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ue=this.pdf.internal.pageSize.height-this.margin[2],ie=Ue-this.margin[0],ye=this.pdf.internal.pageSize.width-this.margin[1],Be=ye-this.margin[3],Le=Ce===1?0:Ge+(Ce-2)*ie;if(this.ctx.clip_path.length!==0){var Re=this.path;Ve=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=L(Ve,this.posX+this.margin[3],-1*Le+Oe),O.call(this,"fill",!0),this.path=Re}var qe=L([JSON.parse(JSON.stringify(dt))],this.posX+this.margin[3],-Le+Oe+this.ctx.prevPageLastElemOffset)[0];R.scale>=.01&&(He=this.pdf.internal.getFontSize(),this.pdf.setFontSize(He*R.scale),Je=this.lineWidth,this.lineWidth=Je*R.scale);var ft=this.autoPaging!=="text";if(ft||qe.y+qe.h<=Ue){if(ft||qe.y>=Oe&&qe.x<=ye){var $e=ft?R.text:this.pdf.splitTextToSize(R.text,R.maxWidth||ye-qe.x)[0],jt=L([JSON.parse(JSON.stringify(it))],this.posX+this.margin[3],-Le+Oe+this.ctx.prevPageLastElemOffset)[0],Mt=ft&&(Ce>ht||Ce<fe)&&w.call(this);Mt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Be,ie,null).clip().discardPath()),this.pdf.text($e,jt.x,jt.y,{angle:R.angle,align:V,renderingMode:R.renderingMode}),Mt&&this.pdf.restoreGraphicsState()}}else qe.y<Ue&&(this.ctx.prevPageLastElemOffset+=Ue-qe.y);R.scale>=.01&&(this.pdf.setFontSize(He),this.lineWidth=Je)}else R.scale>=.01&&(He=this.pdf.internal.getFontSize(),this.pdf.setFontSize(He*R.scale),Je=this.lineWidth,this.lineWidth=Je*R.scale),this.pdf.text(R.text,he.x+this.posX,he.y+this.posY,{angle:R.angle,align:V,renderingMode:R.renderingMode,maxWidth:R.maxWidth}),R.scale>=.01&&(this.pdf.setFontSize(He),this.lineWidth=Je)},ne=function(R,V,Q,ae){Q=Q||0,ae=ae||0,this.pdf.internal.out(n(R+Q)+" "+r(V+ae)+" l")},te=function(R,V,Q){return this.pdf.lines(R,V,Q,null,null)},de=function(R,V,Q,ae,ce,he,we,Se){this.pdf.internal.out([e(i(Q+R)),e(a(ae+V)),e(i(ce+R)),e(a(he+V)),e(i(we+R)),e(a(Se+V)),"c"].join(" "))},X=function(R,V,Q,ae){for(var ce=2*Math.PI,he=Math.PI/2;V>Q;)V-=ce;var we=Math.abs(Q-V);we<ce&&ae&&(we=ce-we);for(var Se=[],Ve=ae?-1:1,He=V;we>1e-5;){var Je=He+Ve*Math.min(we,he);Se.push(J.call(this,R,He,Je)),we-=Math.abs(Je-He),He=Je}return Se},J=function(R,V,Q){var ae=(Q-V)/2,ce=R*Math.cos(ae),he=R*Math.sin(ae),we=ce,Se=-he,Ve=we*we+Se*Se,He=Ve+we*ce+Se*he,Je=4/3*(Math.sqrt(2*Ve*He)-He)/(we*he-Se*ce),it=we-Je*Se,dt=Se+Je*we,ze=it,ue=-dt,pt=ae+V,ht=Math.cos(pt),fe=Math.sin(pt);return{x1:R*Math.cos(V),y1:R*Math.sin(V),x2:it*ht-dt*fe,y2:it*fe+dt*ht,x3:ze*ht-ue*fe,y3:ze*fe+ue*ht,x4:R*Math.cos(Q),y4:R*Math.sin(Q)}},G=function(R){return 180*R/Math.PI},me=function(R,V,Q,ae,ce,he){var we=R+.5*(Q-R),Se=V+.5*(ae-V),Ve=ce+.5*(Q-ce),He=he+.5*(ae-he),Je=Math.min(R,ce,we,Ve),it=Math.max(R,ce,we,Ve),dt=Math.min(V,he,Se,He),ze=Math.max(V,he,Se,He);return new c(Je,dt,it-Je,ze-dt)},W=function(R,V,Q,ae,ce,he,we,Se){var Ve,He,Je,it,dt,ze,ue,pt,ht,fe,Ce,Oe,Ge,Ue,ie=Q-R,ye=ae-V,Be=ce-Q,Le=he-ae,Re=we-ce,qe=Se-he;for(He=0;He<41;He++)ht=(ue=(Je=R+(Ve=He/40)*ie)+Ve*((dt=Q+Ve*Be)-Je))+Ve*(dt+Ve*(ce+Ve*Re-dt)-ue),fe=(pt=(it=V+Ve*ye)+Ve*((ze=ae+Ve*Le)-it))+Ve*(ze+Ve*(he+Ve*qe-ze)-pt),He==0?(Ce=ht,Oe=fe,Ge=ht,Ue=fe):(Ce=Math.min(Ce,ht),Oe=Math.min(Oe,fe),Ge=Math.max(Ge,ht),Ue=Math.max(Ue,fe));return new c(Math.round(Ce),Math.round(Oe),Math.round(Ge-Ce),Math.round(Ue-Oe))},xe=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var R,V,Q=(R=this.ctx.lineDash,V=this.ctx.lineDashOffset,JSON.stringify({lineDash:R,lineDashOffset:V}));this.prevLineDash!==Q&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=Q)}}})(Tt.API),function(t){var e=function(a){var o,c,f,d,p,g,b,y,N,w;for(c=[],f=0,d=(a+=o="\0\0\0\0".slice(a.length%4||4)).length;d>f;f+=4)(p=(a.charCodeAt(f)<<24)+(a.charCodeAt(f+1)<<16)+(a.charCodeAt(f+2)<<8)+a.charCodeAt(f+3))!==0?(g=(p=((p=((p=((p=(p-(w=p%85))/85)-(N=p%85))/85)-(y=p%85))/85)-(b=p%85))/85)%85,c.push(g+33,b+33,y+33,N+33,w+33)):c.push(122);return function(k,C){for(var L=C;L>0;L--)k.pop()}(c,o.length),String.fromCharCode.apply(String,c)+"~>"},n=function(a){var o,c,f,d,p,g=String,b="length",y=255,N="charCodeAt",w="slice",k="replace";for(a[w](-2),a=a[w](0,-2)[k](/\s/g,"")[k]("z","!!!!!"),f=[],d=0,p=(a+=o="uuuuu"[w](a[b]%5||5))[b];p>d;d+=5)c=52200625*(a[N](d)-33)+614125*(a[N](d+1)-33)+7225*(a[N](d+2)-33)+85*(a[N](d+3)-33)+(a[N](d+4)-33),f.push(y&c>>24,y&c>>16,y&c>>8,y&c);return function(C,L){for(var j=L;j>0;j--)C.pop()}(f,o[b]),g.fromCharCode.apply(g,f)},r=function(a){var o=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((a=a.replace(/\s/g,"")).indexOf(">")!==-1&&(a=a.substr(0,a.indexOf(">"))),a.length%2&&(a+="0"),o.test(a)===!1)return"";for(var c="",f=0;f<a.length;f+=2)c+=String.fromCharCode("0x"+(a[f]+a[f+1]));return c},i=function(a){for(var o=new Uint8Array(a.length),c=a.length;c--;)o[c]=a.charCodeAt(c);return a=(o=R2(o)).reduce(function(f,d){return f+String.fromCharCode(d)},"")};t.processDataByFilters=function(a,o){var c=0,f=a||"",d=[];for(typeof(o=o||[])=="string"&&(o=[o]),c=0;c<o.length;c+=1)switch(o[c]){case"ASCII85Decode":case"/ASCII85Decode":f=n(f),d.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":f=e(f),d.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":f=r(f),d.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":f=f.split("").map(function(p){return("0"+p.charCodeAt().toString(16)).slice(-2)}).join("")+">",d.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":f=i(f),d.push("/FlateDecode");break;default:throw new Error('The filter: "'+o[c]+'" is not implemented')}return{data:f,reverseChain:d.reverse().join(" ")}}}(Tt.API),function(t){t.loadFile=function(e,n,r){return function(i,a,o){a=a!==!1,o=typeof o=="function"?o:function(){};var c=void 0;try{c=function(f,d,p){var g=new XMLHttpRequest,b=0,y=function(N){var w=N.length,k=[],C=String.fromCharCode;for(b=0;b<w;b+=1)k.push(C(255&N.charCodeAt(b)));return k.join("")};if(g.open("GET",f,!d),g.overrideMimeType("text/plain; charset=x-user-defined"),d===!1&&(g.onload=function(){g.status===200?p(y(this.responseText)):p(void 0)}),g.send(null),d&&g.status===200)return y(g.responseText)}(i,a,o)}catch{}return c}(e,n,r)},t.loadImageFile=t.loadFile}(Tt.API),function(t){function e(){return(Rt.html2canvas?Promise.resolve(Rt.html2canvas):E2(()=>import("./html2canvas.esm-BfxBtG_O.js"),[])).catch(function(o){return Promise.reject(new Error("Could not load html2canvas: "+o))}).then(function(o){return o.default?o.default:o})}function n(){return(Rt.DOMPurify?Promise.resolve(Rt.DOMPurify):E2(()=>import("./purify.es-CQJ0hv7W.js"),[])).catch(function(o){return Promise.reject(new Error("Could not load dompurify: "+o))}).then(function(o){return o.default?o.default:o})}var r=function(o){var c=kn(o);return c==="undefined"?"undefined":c==="string"||o instanceof String?"string":c==="number"||o instanceof Number?"number":c==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":c==="object"?"object":"unknown"},i=function(o,c){var f=document.createElement(o);for(var d in c.className&&(f.className=c.className),c.innerHTML&&c.dompurify&&(f.innerHTML=c.dompurify.sanitize(c.innerHTML)),c.style)f.style[d]=c.style[d];return f},a=function o(c){var f=Object.assign(o.convert(Promise.resolve()),JSON.parse(JSON.stringify(o.template))),d=o.convert(Promise.resolve(),f);return d=(d=d.setProgress(1,o,1,[o])).set(c)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(o,c){return o.__proto__=c||a.prototype,o},a.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},a.prototype.from=function(o,c){return this.then(function(){switch(c=c||function(f){switch(r(f)){case"string":return"string";case"element":return f.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(o)){case"string":return this.then(n).then(function(f){return this.set({src:i("div",{innerHTML:o,dompurify:f})})});case"element":return this.set({src:o});case"canvas":return this.set({canvas:o});case"img":return this.set({img:o});default:return this.error("Unknown source type.")}})},a.prototype.to=function(o){switch(o){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},a.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var o={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},c=function f(d,p){for(var g=d.nodeType===3?document.createTextNode(d.nodeValue):d.cloneNode(!1),b=d.firstChild;b;b=b.nextSibling)p!==!0&&b.nodeType===1&&b.nodeName==="SCRIPT"||g.appendChild(f(b,p));return d.nodeType===1&&(d.nodeName==="CANVAS"?(g.width=d.width,g.height=d.height,g.getContext("2d").drawImage(d,0,0)):d.nodeName!=="TEXTAREA"&&d.nodeName!=="SELECT"||(g.value=d.value),g.addEventListener("load",function(){g.scrollTop=d.scrollTop,g.scrollLeft=d.scrollLeft},!0)),g}(this.prop.src,this.opt.html2canvas.javascriptEnabled);c.tagName==="BODY"&&(o.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:o}),this.prop.container.appendChild(c),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},a.prototype.toCanvas=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(e).then(function(c){var f=Object.assign({},this.opt.html2canvas);return delete f.onrendered,c(this.prop.container,f)}).then(function(c){(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(e).then(function(c){var f=this.opt.jsPDF,d=this.opt.fontFaces,p=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,g=Object.assign({async:!0,allowTaint:!0,scale:p,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete g.onrendered,f.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,f.context2d.posX=this.opt.x,f.context2d.posY=this.opt.y,f.context2d.margin=this.opt.margin,f.context2d.fontFaces=d,d)for(var b=0;b<d.length;++b){var y=d[b],N=y.src.find(function(w){return w.format==="truetype"});N&&f.addFont(N.url,y.ref.name,y.ref.style)}return g.windowHeight=g.windowHeight||0,g.windowHeight=g.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):g.windowHeight,f.context2d.save(!0),c(this.prop.container,g)}).then(function(c){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var o=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=o})},a.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},a.prototype.output=function(o,c,f){return(f=f||"pdf").toLowerCase()==="img"||f.toLowerCase()==="image"?this.outputImg(o,c):this.outputPdf(o,c)},a.prototype.outputPdf=function(o,c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,c)})},a.prototype.outputImg=function(o){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(o){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+o+'" is not supported.'}})},a.prototype.save=function(o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(o?{filename:o}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},a.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},a.prototype.set=function(o){if(r(o)!=="object")return this;var c=Object.keys(o||{}).map(function(f){if(f in a.template.prop)return function(){this.prop[f]=o[f]};switch(f){case"margin":return this.setMargin.bind(this,o.margin);case"jsPDF":return function(){return this.opt.jsPDF=o.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,o.pageSize);default:return function(){this.opt[f]=o[f]}}},this);return this.then(function(){return this.thenList(c)})},a.prototype.get=function(o,c){return this.then(function(){var f=o in a.template.prop?this.prop[o]:this.opt[o];return c?c(f):f})},a.prototype.setMargin=function(o){return this.then(function(){switch(r(o)){case"number":o=[o,o,o,o];case"array":if(o.length===2&&(o=[o[0],o[1],o[0],o[1]]),o.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=o}).then(this.setPageSize)},a.prototype.setPageSize=function(o){function c(f,d){return Math.floor(f*d/72*96)}return this.then(function(){(o=o||Tt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(o.inner={width:o.width-this.opt.margin[1]-this.opt.margin[3],height:o.height-this.opt.margin[0]-this.opt.margin[2]},o.inner.px={width:c(o.inner.width,o.k),height:c(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},a.prototype.setProgress=function(o,c,f,d){return o!=null&&(this.progress.val=o),c!=null&&(this.progress.state=c),f!=null&&(this.progress.n=f),d!=null&&(this.progress.stack=d),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(o,c,f,d){return this.setProgress(o?this.progress.val+o:null,c||null,f?this.progress.n+f:null,d?this.progress.stack.concat(d):null)},a.prototype.then=function(o,c){var f=this;return this.thenCore(o,c,function(d,p){return f.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(g){return f.updateProgress(null,d),g}).then(d,p).then(function(g){return f.updateProgress(1),g})})},a.prototype.thenCore=function(o,c,f){f=f||Promise.prototype.then,o&&(o=o.bind(this)),c&&(c=c.bind(this));var d=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:a.convert(Object.assign({},this),Promise.prototype),p=f.call(d,o,c);return a.convert(p,this.__proto__)},a.prototype.thenExternal=function(o,c){return Promise.prototype.then.call(this,o,c)},a.prototype.thenList=function(o){var c=this;return o.forEach(function(f){c=c.thenCore(f)}),c},a.prototype.catch=function(o){o&&(o=o.bind(this));var c=Promise.prototype.catch.call(this,o);return a.convert(c,this)},a.prototype.catchExternal=function(o){return Promise.prototype.catch.call(this,o)},a.prototype.error=function(o){return this.then(function(){throw new Error(o)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,Tt.getPageSize=function(o,c,f){if(kn(o)==="object"){var d=o;o=d.orientation,c=d.unit||c,f=d.format||f}c=c||"mm",f=f||"a4",o=(""+(o||"P")).toLowerCase();var p,g=(""+f).toLowerCase(),b={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(c){case"pt":p=1;break;case"mm":p=72/25.4;break;case"cm":p=72/2.54;break;case"in":p=72;break;case"px":p=.75;break;case"pc":case"em":p=12;break;case"ex":p=6;break;default:throw"Invalid unit: "+c}var y,N=0,w=0;if(b.hasOwnProperty(g))N=b[g][1]/p,w=b[g][0]/p;else try{N=f[1],w=f[0]}catch{throw new Error("Invalid format: "+f)}if(o==="p"||o==="portrait")o="p",w>N&&(y=w,w=N,N=y);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",N>w&&(y=w,w=N,N=y)}return{width:w,height:N,unit:c,k:p,orientation:o}},t.html=function(o,c){(c=c||{}).callback=c.callback||function(){},c.html2canvas=c.html2canvas||{},c.html2canvas.canvas=c.html2canvas.canvas||this.canvas,c.jsPDF=c.jsPDF||this,c.fontFaces=c.fontFaces?c.fontFaces.map(H2):null;var f=new a(c);return c.worker?f:f.from(o).doCallback()}}(Tt.API),Tt.API.addJS=function(t){return jw=t,this.internal.events.subscribe("postPutResources",function(){Am=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Am+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),Dw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+jw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){Am!==void 0&&Dw!==void 0&&this.internal.out("/Names <</JavaScript "+Am+" 0 R>>")}),this},function(t){var e;t.events.push(["postPutResources",function(){var n=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=n.outline.render().split(/\r\n/),a=0;a<i.length;a++){var o=i[a],c=r.exec(o);if(c!=null){var f=c[1];n.internal.newObjectDeferredBegin(f,!1)}n.internal.write(o)}if(this.outline.createNamedDestinations){var d=this.internal.pages.length,p=[];for(a=0;a<d;a++){var g=n.internal.newObject();p.push(g);var b=n.internal.getPageInfo(a+1);n.internal.write("<< /D["+b.objId+" 0 R /XYZ null null null]>> endobj")}var y=n.internal.newObject();for(n.internal.write("<< /Names [ "),a=0;a<p.length;a++)n.internal.write("(page_"+(a+1)+")"+p[a]+" 0 R");n.internal.write(" ] >>","endobj"),e=n.internal.newObject(),n.internal.write("<< /Dests "+y+" 0 R"),n.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+e+" 0 R"))}]),t.events.push(["initialized",function(){var n=this;n.outline={createNamedDestinations:!1,root:{children:[]}},n.outline.add=function(r,i,a){var o={title:i,options:a,children:[]};return r==null&&(r=this.root),r.children.push(o),o},n.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=n,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},n.outline.genIds_r=function(r){r.id=n.internal.newObjectDeferred();for(var i=0;i<r.children.length;i++)this.genIds_r(r.children[i])},n.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},n.outline.renderItems=function(r){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,a=0;a<r.children.length;a++){var o=r.children[a];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(r)),a>0&&this.line("/Prev "+this.makeRef(r.children[a-1])),a<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[a+1])),o.children.length>0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var c=this.count=this.count_r({count:0},o);if(c>0&&this.line("/Count "+c),o.options&&o.options.pageNumber){var f=n.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+f.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var d=0;d<r.children.length;d++)this.renderItems(r.children[d])},n.outline.line=function(r){this.ctx.val+=r+`\r
`},n.outline.makeRef=function(r){return r.id+" 0 R"},n.outline.makeString=function(r){return"("+n.internal.pdfEscape(r)+")"},n.outline.objStart=function(r){this.ctx.val+=`\r
`+r.id+` 0 obj\r
<<\r
`},n.outline.objEnd=function(){this.ctx.val+=`>> \r
endobj\r
`},n.outline.count_r=function(r,i){for(var a=0;a<i.children.length;a++)r.count++,this.count_r(r,i.children[a]);return r.count}}])}(Tt.API),function(t){var e=[192,193,194,195,196,197,198,199];t.processJPEG=function(n,r,i,a,o,c){var f,d=this.decode.DCT_DECODE,p=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=o||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,(f=function(g){for(var b,y=256*g.charCodeAt(4)+g.charCodeAt(5),N=g.length,w={width:0,height:0,numcomponents:1},k=4;k<N;k+=2){if(k+=y,e.indexOf(g.charCodeAt(k+1))!==-1){b=256*g.charCodeAt(k+5)+g.charCodeAt(k+6),w={width:256*g.charCodeAt(k+7)+g.charCodeAt(k+8),height:b,numcomponents:g.charCodeAt(k+9)};break}y=256*g.charCodeAt(k+2)+g.charCodeAt(k+3)}return w}(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n)).numcomponents){case 1:c=this.color_spaces.DEVICE_GRAY;break;case 4:c=this.color_spaces.DEVICE_CMYK;break;case 3:c=this.color_spaces.DEVICE_RGB}p={data:n,width:f.width,height:f.height,colorSpace:c,bitsPerComponent:8,filter:d,index:r,alias:i}}return p}}(Tt.API);var Tf,Cm,Ow,Tw,Rw,cF=function(){var t,e,n;function r(a){var o,c,f,d,p,g,b,y,N,w,k,C,L,j;for(this.data=a,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},g=null;;){switch(o=this.readUInt32(),N=(function(){var z,O;for(O=[],z=0;z<4;++z)O.push(String.fromCharCode(this.data[this.pos++]));return O}).call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(o);break;case"fcTL":g&&this.animation.frames.push(g),this.pos+=4,g={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},p=this.readUInt16(),d=this.readUInt16()||100,g.delay=1e3*p/d,g.disposeOp=this.data[this.pos++],g.blendOp=this.data[this.pos++],g.data=[];break;case"IDAT":case"fdAT":for(N==="fdAT"&&(this.pos+=4,o-=4),a=g?.data||this.imgData,C=0;0<=o?C<o:C>o;0<=o?++C:--C)a.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(f=this.palette.length/3,this.transparency.indexed=this.read(o),this.transparency.indexed.length>f)throw new Error("More transparent colors than palette size");if((w=f-this.transparency.indexed.length)>0)for(L=0;0<=w?L<w:L>w;0<=w?++L:--L)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(o)[0];break;case 2:this.transparency.rgb=this.read(o)}break;case"tEXt":b=(k=this.read(o)).indexOf(0),y=String.fromCharCode.apply(String,k.slice(0,b)),this.text[y]=String.fromCharCode.apply(String,k.slice(b+1));break;case"IEND":return g&&this.animation.frames.push(g),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(j=this.colorType)===4||j===6,c=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*c,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=o}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}r.prototype.read=function(a){var o,c;for(c=[],o=0;0<=a?o<a:o>a;0<=a?++o:--o)c.push(this.data[this.pos++]);return c},r.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.decodePixels=function(a){var o=this.pixelBitlength/8,c=new Uint8Array(this.width*this.height*o),f=0,d=this;if(a==null&&(a=this.imgData),a.length===0)return new Uint8Array(0);function p(g,b,y,N){var w,k,C,L,j,z,O,K,q,H,se,le,P,I,ne,te,de,X,J,G,me,W=Math.ceil((d.width-g)/y),xe=Math.ceil((d.height-b)/N),R=d.width==W&&d.height==xe;for(I=o*W,le=R?c:new Uint8Array(I*xe),z=a.length,P=0,k=0;P<xe&&f<z;){switch(a[f++]){case 0:for(L=de=0;de<I;L=de+=1)le[k++]=a[f++];break;case 1:for(L=X=0;X<I;L=X+=1)w=a[f++],j=L<o?0:le[k-o],le[k++]=(w+j)%256;break;case 2:for(L=J=0;J<I;L=J+=1)w=a[f++],C=(L-L%o)/o,ne=P&&le[(P-1)*I+C*o+L%o],le[k++]=(ne+w)%256;break;case 3:for(L=G=0;G<I;L=G+=1)w=a[f++],C=(L-L%o)/o,j=L<o?0:le[k-o],ne=P&&le[(P-1)*I+C*o+L%o],le[k++]=(w+Math.floor((j+ne)/2))%256;break;case 4:for(L=me=0;me<I;L=me+=1)w=a[f++],C=(L-L%o)/o,j=L<o?0:le[k-o],P===0?ne=te=0:(ne=le[(P-1)*I+C*o+L%o],te=C&&le[(P-1)*I+(C-1)*o+L%o]),O=j+ne-te,K=Math.abs(O-j),H=Math.abs(O-ne),se=Math.abs(O-te),q=K<=H&&K<=se?j:H<=se?ne:te,le[k++]=(w+q)%256;break;default:throw new Error("Invalid filter algorithm: "+a[f-1])}if(!R){var V=((b+P*N)*d.width+g)*o,Q=P*I;for(L=0;L<W;L+=1){for(var ae=0;ae<o;ae+=1)c[V++]=le[Q++];V+=(y-1)*o}}P++}}return a=HB(a),d.interlaceMethod==1?(p(0,0,8,8),p(4,0,8,8),p(0,4,4,8),p(2,0,4,4),p(0,2,2,4),p(1,0,2,2),p(0,1,1,2)):p(0,0,1,1),c},r.prototype.decodePalette=function(){var a,o,c,f,d,p,g,b,y;for(c=this.palette,p=this.transparency.indexed||[],d=new Uint8Array((p.length||0)+c.length),f=0,a=0,o=g=0,b=c.length;g<b;o=g+=3)d[f++]=c[o],d[f++]=c[o+1],d[f++]=c[o+2],d[f++]=(y=p[a++])!=null?y:255;return d},r.prototype.copyToImageData=function(a,o){var c,f,d,p,g,b,y,N,w,k,C;if(f=this.colors,w=null,c=this.hasAlphaChannel,this.palette.length&&(w=(C=this._decodedPalette)!=null?C:this._decodedPalette=this.decodePalette(),f=4,c=!0),N=(d=a.data||a).length,g=w||o,p=b=0,f===1)for(;p<N;)y=w?4*o[p/4]:b,k=g[y++],d[p++]=k,d[p++]=k,d[p++]=k,d[p++]=c?g[y++]:255,b=y;else for(;p<N;)y=w?4*o[p/4]:b,d[p++]=g[y++],d[p++]=g[y++],d[p++]=g[y++],d[p++]=c?g[y++]:255,b=y},r.prototype.decode=function(){var a;return a=new Uint8Array(this.width*this.height*4),this.copyToImageData(a,this.decodePixels()),a};var i=function(){if(Object.prototype.toString.call(Rt)==="[object Window]"){try{e=Rt.document.createElement("canvas"),n=e.getContext("2d")}catch{return!1}return!0}return!1};return i(),t=function(a){var o;if(i()===!0)return n.width=a.width,n.height=a.height,n.clearRect(0,0,a.width,a.height),n.putImageData(a,0,0),(o=new Image).src=e.toDataURL(),o;throw new Error("This method requires a Browser with Canvas-capability.")},r.prototype.decodeFrames=function(a){var o,c,f,d,p,g,b,y;if(this.animation){for(y=[],c=p=0,g=(b=this.animation.frames).length;p<g;c=++p)o=b[c],f=a.createImageData(o.width,o.height),d=this.decodePixels(new Uint8Array(o.data)),this.copyToImageData(f,d),o.imageData=f,y.push(o.image=t(f));return y}},r.prototype.renderFrame=function(a,o){var c,f,d;return c=(f=this.animation.frames)[o],d=f[o-1],o===0&&a.clearRect(0,0,this.width,this.height),d?.disposeOp===1?a.clearRect(d.xOffset,d.yOffset,d.width,d.height):d?.disposeOp===2&&a.putImageData(d.imageData,d.xOffset,d.yOffset),c.blendOp===0&&a.clearRect(c.xOffset,c.yOffset,c.width,c.height),a.drawImage(c.image,c.xOffset,c.yOffset)},r.prototype.animate=function(a){var o,c,f,d,p,g,b=this;return c=0,g=this.animation,d=g.numFrames,f=g.frames,p=g.numPlays,(o=function(){var y,N;if(y=c++%d,N=f[y],b.renderFrame(a,y),d>1&&c/d<p)return b.animation._timeout=setTimeout(o,N.delay)})()},r.prototype.stopAnimation=function(){var a;return clearTimeout((a=this.animation)!=null?a._timeout:void 0)},r.prototype.render=function(a){var o,c;return a._png&&a._png.stopAnimation(),a._png=this,a.width=this.width,a.height=this.height,o=a.getContext("2d"),this.animation?(this.decodeFrames(o),this.animate(o)):(c=o.createImageData(this.width,this.height),this.copyToImageData(c,this.decodePixels()),o.putImageData(c,0,0))},r}();/**
 * @license
 *
 * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * ====================================================================
 *//**
 * @license
 * (c) Dean McNamee <dean@gmail.com>, 2013.
 *
 * https://github.com/deanm/omggif
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 *
 * omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
 * including animation and compression.  It does not rely on any specific
 * underlying system, so should run in the browser, Node, or Plask.
 */function uF(t){var e=0;if(t[e++]!==71||t[e++]!==73||t[e++]!==70||t[e++]!==56||(t[e++]+1&253)!=56||t[e++]!==97)throw new Error("Invalid GIF 87a/89a header.");var n=t[e++]|t[e++]<<8,r=t[e++]|t[e++]<<8,i=t[e++],a=i>>7,o=1<<(7&i)+1;t[e++],t[e++];var c=null,f=null;a&&(c=e,f=o,e+=3*o);var d=!0,p=[],g=0,b=null,y=0,N=null;for(this.width=n,this.height=r;d&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(t[e]!==11||t[e+1]==78&&t[e+2]==69&&t[e+3]==84&&t[e+4]==83&&t[e+5]==67&&t[e+6]==65&&t[e+7]==80&&t[e+8]==69&&t[e+9]==50&&t[e+10]==46&&t[e+11]==48&&t[e+12]==3&&t[e+13]==1&&t[e+16]==0)e+=14,N=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((P=t[e++])>=0))throw Error("Invalid block size");if(P===0)break;e+=P}break;case 249:if(t[e++]!==4||t[e+4]!==0)throw new Error("Invalid graphics extension block.");var w=t[e++];g=t[e++]|t[e++]<<8,b=t[e++],(1&w)==0&&(b=null),y=w>>2&7,e++;break;case 254:for(;;){if(!((P=t[e++])>=0))throw Error("Invalid block size");if(P===0)break;e+=P}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var k=t[e++]|t[e++]<<8,C=t[e++]|t[e++]<<8,L=t[e++]|t[e++]<<8,j=t[e++]|t[e++]<<8,z=t[e++],O=z>>6&1,K=1<<(7&z)+1,q=c,H=f,se=!1;z>>7&&(se=!0,q=e,H=K,e+=3*K);var le=e;for(e++;;){var P;if(!((P=t[e++])>=0))throw Error("Invalid block size");if(P===0)break;e+=P}p.push({x:k,y:C,width:L,height:j,has_local_palette:se,palette_offset:q,palette_size:H,data_offset:le,data_length:e-le,transparent_index:b,interlaced:!!O,delay:g,disposal:y});break;case 59:d=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return p.length},this.loopCount=function(){return N},this.frameInfo=function(I){if(I<0||I>=p.length)throw new Error("Frame index out of range.");return p[I]},this.decodeAndBlitFrameBGRA=function(I,ne){var te=this.frameInfo(I),de=te.width*te.height,X=new Uint8Array(de);Pw(t,te.data_offset,X,de);var J=te.palette_offset,G=te.transparent_index;G===null&&(G=256);var me=te.width,W=n-me,xe=me,R=4*(te.y*n+te.x),V=4*((te.y+te.height)*n+te.x),Q=R,ae=4*W;te.interlaced===!0&&(ae+=4*n*7);for(var ce=8,he=0,we=X.length;he<we;++he){var Se=X[he];if(xe===0&&(xe=me,(Q+=ae)>=V&&(ae=4*W+4*n*(ce-1),Q=R+(me+W)*(ce<<1),ce>>=1)),Se===G)Q+=4;else{var Ve=t[J+3*Se],He=t[J+3*Se+1],Je=t[J+3*Se+2];ne[Q++]=Je,ne[Q++]=He,ne[Q++]=Ve,ne[Q++]=255}--xe}},this.decodeAndBlitFrameRGBA=function(I,ne){var te=this.frameInfo(I),de=te.width*te.height,X=new Uint8Array(de);Pw(t,te.data_offset,X,de);var J=te.palette_offset,G=te.transparent_index;G===null&&(G=256);var me=te.width,W=n-me,xe=me,R=4*(te.y*n+te.x),V=4*((te.y+te.height)*n+te.x),Q=R,ae=4*W;te.interlaced===!0&&(ae+=4*n*7);for(var ce=8,he=0,we=X.length;he<we;++he){var Se=X[he];if(xe===0&&(xe=me,(Q+=ae)>=V&&(ae=4*W+4*n*(ce-1),Q=R+(me+W)*(ce<<1),ce>>=1)),Se===G)Q+=4;else{var Ve=t[J+3*Se],He=t[J+3*Se+1],Je=t[J+3*Se+2];ne[Q++]=Ve,ne[Q++]=He,ne[Q++]=Je,ne[Q++]=255}--xe}}}function Pw(t,e,n,r){for(var i=t[e++],a=1<<i,o=a+1,c=o+1,f=i+1,d=(1<<f)-1,p=0,g=0,b=0,y=t[e++],N=new Int32Array(4096),w=null;;){for(;p<16&&y!==0;)g|=t[e++]<<p,p+=8,y===1?y=t[e++]:--y;if(p<f)break;var k=g&d;if(g>>=f,p-=f,k!==a){if(k===o)break;for(var C=k<c?k:w,L=0,j=C;j>a;)j=N[j]>>8,++L;var z=j;if(b+L+(C!==k?1:0)>r)return void Rn.log("Warning, gif stream longer than expected.");n[b++]=z;var O=b+=L;for(C!==k&&(n[b++]=z),j=C;L--;)j=N[j],n[--O]=255&j,j>>=8;w!==null&&c<4096&&(N[c++]=w<<8|z,c>=d+1&&f<12&&(++f,d=d<<1|1)),w=k}else c=o+1,d=(1<<(f=i+1))-1,w=null}return b!==r&&Rn.log("Warning, gif stream shorter than expected."),n}/**
 * @license
  Copyright (c) 2008, Adobe Systems Incorporated
  All rights reserved.

  Redistribution and use in source and binary forms, with or without 
  modification, are permitted provided that the following conditions are
  met:

  * Redistributions of source code must retain the above copyright notice, 
    this list of conditions and the following disclaimer.
  
  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the 
    documentation and/or other materials provided with the distribution.
  
  * Neither the name of Adobe Systems Incorporated nor the names of its 
    contributors may be used to endorse or promote products derived from 
    this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/function W1(t){var e,n,r,i,a,o=Math.floor,c=new Array(64),f=new Array(64),d=new Array(64),p=new Array(64),g=new Array(65535),b=new Array(65535),y=new Array(64),N=new Array(64),w=[],k=0,C=7,L=new Array(64),j=new Array(64),z=new Array(64),O=new Array(256),K=new Array(2048),q=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],H=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],se=[0,1,2,3,4,5,6,7,8,9,10,11],le=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],P=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],I=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],ne=[0,1,2,3,4,5,6,7,8,9,10,11],te=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],de=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function X(R,V){for(var Q=0,ae=0,ce=new Array,he=1;he<=16;he++){for(var we=1;we<=R[he];we++)ce[V[ae]]=[],ce[V[ae]][0]=Q,ce[V[ae]][1]=he,ae++,Q++;Q*=2}return ce}function J(R){for(var V=R[0],Q=R[1]-1;Q>=0;)V&1<<Q&&(k|=1<<C),Q--,--C<0&&(k==255?(G(255),G(0)):G(k),C=7,k=0)}function G(R){w.push(R)}function me(R){G(R>>8&255),G(255&R)}function W(R,V,Q,ae,ce){for(var he,we=ce[0],Se=ce[240],Ve=function(fe,Ce){var Oe,Ge,Ue,ie,ye,Be,Le,Re,qe,ft,$e=0;for(qe=0;qe<8;++qe){Oe=fe[$e],Ge=fe[$e+1],Ue=fe[$e+2],ie=fe[$e+3],ye=fe[$e+4],Be=fe[$e+5],Le=fe[$e+6];var jt=Oe+(Re=fe[$e+7]),Mt=Oe-Re,mn=Ge+Le,Ct=Ge-Le,Gt=Ue+Be,ur=Ue-Be,ut=ie+ye,nn=ie-ye,Lt=jt+ut,Yn=jt-ut,jn=mn+Gt,wn=mn-Gt;fe[$e]=Lt+jn,fe[$e+4]=Lt-jn;var mt=.707106781*(wn+Yn);fe[$e+2]=Yn+mt,fe[$e+6]=Yn-mt;var Ht=.382683433*((Lt=nn+ur)-(wn=Ct+Mt)),Wt=.5411961*Lt+Ht,Jn=1.306562965*wn+Ht,_i=.707106781*(jn=ur+Ct),Pi=Mt+_i,xt=Mt-_i;fe[$e+5]=xt+Wt,fe[$e+3]=xt-Wt,fe[$e+1]=Pi+Jn,fe[$e+7]=Pi-Jn,$e+=8}for($e=0,qe=0;qe<8;++qe){Oe=fe[$e],Ge=fe[$e+8],Ue=fe[$e+16],ie=fe[$e+24],ye=fe[$e+32],Be=fe[$e+40],Le=fe[$e+48];var un=Oe+(Re=fe[$e+56]),zn=Oe-Re,vr=Ge+Le,er=Ge-Le,fr=Ue+Be,Ni=Ue-Be,Ao=ie+ye,Ai=ie-ye,Ci=un+Ao,Wr=un-Ao,Yr=vr+fr,si=vr-fr;fe[$e]=Ci+Yr,fe[$e+32]=Ci-Yr;var Fr=.707106781*(si+Wr);fe[$e+16]=Wr+Fr,fe[$e+48]=Wr-Fr;var Sn=.382683433*((Ci=Ai+Ni)-(si=er+zn)),_s=.5411961*Ci+Sn,Co=1.306562965*si+Sn,Bi=.707106781*(Yr=Ni+er),Ji=zn+Bi,bl=zn-Bi;fe[$e+40]=bl+_s,fe[$e+24]=bl-_s,fe[$e+8]=Ji+Co,fe[$e+56]=Ji-Co,$e++}for(qe=0;qe<64;++qe)ft=fe[qe]*Ce[qe],y[qe]=ft>0?ft+.5|0:ft-.5|0;return y}(R,V),He=0;He<64;++He)N[q[He]]=Ve[He];var Je=N[0]-Q;Q=N[0],Je==0?J(ae[0]):(J(ae[b[he=32767+Je]]),J(g[he]));for(var it=63;it>0&&N[it]==0;)it--;if(it==0)return J(we),Q;for(var dt,ze=1;ze<=it;){for(var ue=ze;N[ze]==0&&ze<=it;)++ze;var pt=ze-ue;if(pt>=16){dt=pt>>4;for(var ht=1;ht<=dt;++ht)J(Se);pt&=15}he=32767+N[ze],J(ce[(pt<<4)+b[he]]),J(g[he]),ze++}return it!=63&&J(we),Q}function xe(R){R=Math.min(Math.max(R,1),100),a!=R&&(function(V){for(var Q=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],ae=0;ae<64;ae++){var ce=o((Q[ae]*V+50)/100);ce=Math.min(Math.max(ce,1),255),c[q[ae]]=ce}for(var he=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],we=0;we<64;we++){var Se=o((he[we]*V+50)/100);Se=Math.min(Math.max(Se,1),255),f[q[we]]=Se}for(var Ve=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],He=0,Je=0;Je<8;Je++)for(var it=0;it<8;it++)d[He]=1/(c[q[He]]*Ve[Je]*Ve[it]*8),p[He]=1/(f[q[He]]*Ve[Je]*Ve[it]*8),He++}(R<50?Math.floor(5e3/R):Math.floor(200-2*R)),a=R)}this.encode=function(R,V){V&&xe(V),w=new Array,k=0,C=7,me(65496),me(65504),me(16),G(74),G(70),G(73),G(70),G(0),G(1),G(1),G(0),me(1),me(1),G(0),G(0),function(){me(65499),me(132),G(0);for(var Ge=0;Ge<64;Ge++)G(c[Ge]);G(1);for(var Ue=0;Ue<64;Ue++)G(f[Ue])}(),function(Ge,Ue){me(65472),me(17),G(8),me(Ue),me(Ge),G(3),G(1),G(17),G(0),G(2),G(17),G(1),G(3),G(17),G(1)}(R.width,R.height),function(){me(65476),me(418),G(0);for(var Ge=0;Ge<16;Ge++)G(H[Ge+1]);for(var Ue=0;Ue<=11;Ue++)G(se[Ue]);G(16);for(var ie=0;ie<16;ie++)G(le[ie+1]);for(var ye=0;ye<=161;ye++)G(P[ye]);G(1);for(var Be=0;Be<16;Be++)G(I[Be+1]);for(var Le=0;Le<=11;Le++)G(ne[Le]);G(17);for(var Re=0;Re<16;Re++)G(te[Re+1]);for(var qe=0;qe<=161;qe++)G(de[qe])}(),me(65498),me(12),G(3),G(1),G(0),G(2),G(17),G(3),G(17),G(0),G(63),G(0);var Q=0,ae=0,ce=0;k=0,C=7,this.encode.displayName="_encode_";for(var he,we,Se,Ve,He,Je,it,dt,ze,ue=R.data,pt=R.width,ht=R.height,fe=4*pt,Ce=0;Ce<ht;){for(he=0;he<fe;){for(He=fe*Ce+he,it=-1,dt=0,ze=0;ze<64;ze++)Je=He+(dt=ze>>3)*fe+(it=4*(7&ze)),Ce+dt>=ht&&(Je-=fe*(Ce+1+dt-ht)),he+it>=fe&&(Je-=he+it-fe+4),we=ue[Je++],Se=ue[Je++],Ve=ue[Je++],L[ze]=(K[we]+K[Se+256>>0]+K[Ve+512>>0]>>16)-128,j[ze]=(K[we+768>>0]+K[Se+1024>>0]+K[Ve+1280>>0]>>16)-128,z[ze]=(K[we+1280>>0]+K[Se+1536>>0]+K[Ve+1792>>0]>>16)-128;Q=W(L,d,Q,e,r),ae=W(j,p,ae,n,i),ce=W(z,p,ce,n,i),he+=32}Ce+=8}if(C>=0){var Oe=[];Oe[1]=C+1,Oe[0]=(1<<C+1)-1,J(Oe)}return me(65497),new Uint8Array(w)},t=t||50,function(){for(var R=String.fromCharCode,V=0;V<256;V++)O[V]=R(V)}(),e=X(H,se),n=X(I,ne),r=X(le,P),i=X(te,de),function(){for(var R=1,V=2,Q=1;Q<=15;Q++){for(var ae=R;ae<V;ae++)b[32767+ae]=Q,g[32767+ae]=[],g[32767+ae][1]=Q,g[32767+ae][0]=ae;for(var ce=-(V-1);ce<=-R;ce++)b[32767+ce]=Q,g[32767+ce]=[],g[32767+ce][1]=Q,g[32767+ce][0]=V-1+ce;R<<=1,V<<=1}}(),function(){for(var R=0;R<256;R++)K[R]=19595*R,K[R+256>>0]=38470*R,K[R+512>>0]=7471*R+32768,K[R+768>>0]=-11059*R,K[R+1024>>0]=-21709*R,K[R+1280>>0]=32768*R+8421375,K[R+1536>>0]=-27439*R,K[R+1792>>0]=-5329*R}(),xe(t)}/**
 * @license
 * Copyright (c) 2017 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */function fs(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function Bw(t){function e(H){if(!H)throw Error("assert :P")}function n(H,se,le){for(var P=0;4>P;P++)if(H[se+P]!=le.charCodeAt(P))return!0;return!1}function r(H,se,le,P,I){for(var ne=0;ne<I;ne++)H[se+ne]=le[P+ne]}function i(H,se,le,P){for(var I=0;I<P;I++)H[se+I]=le}function a(H){return new Int32Array(H)}function o(H,se){for(var le=[],P=0;P<H;P++)le.push(new se);return le}function c(H,se){var le=[];return function P(I,ne,te){for(var de=te[ne],X=0;X<de&&(I.push(te.length>ne+1?[]:new se),!(te.length<ne+1));X++)P(I[X],ne+1,te)}(le,0,H),le}var f=function(){var H=this;function se(m,x){for(var M=1<<x-1>>>0;m&M;)M>>>=1;return M?(m&M-1)+M:m}function le(m,x,M,D,B){e(!(D%M));do m[x+(D-=M)]=B;while(0<D)}function P(m,x,M,D,B){if(e(2328>=B),512>=B)var U=a(512);else if((U=a(B))==null)return 0;return function(Y,$,ee,re,ve,je){var Ee,Ae,et=$,Ie=1<<ee,be=a(16),Ne=a(16);for(e(ve!=0),e(re!=null),e(Y!=null),e(0<ee),Ae=0;Ae<ve;++Ae){if(15<re[Ae])return 0;++be[re[Ae]]}if(be[0]==ve)return 0;for(Ne[1]=0,Ee=1;15>Ee;++Ee){if(be[Ee]>1<<Ee)return 0;Ne[Ee+1]=Ne[Ee]+be[Ee]}for(Ae=0;Ae<ve;++Ae)Ee=re[Ae],0<re[Ae]&&(je[Ne[Ee]++]=Ae);if(Ne[15]==1)return(re=new I).g=0,re.value=je[0],le(Y,et,1,Ie,re),Ie;var Xe,tt=-1,Ke=Ie-1,ct=0,at=1,_t=1,ot=1<<ee;for(Ae=0,Ee=1,ve=2;Ee<=ee;++Ee,ve<<=1){if(at+=_t<<=1,0>(_t-=be[Ee]))return 0;for(;0<be[Ee];--be[Ee])(re=new I).g=Ee,re.value=je[Ae++],le(Y,et+ct,ve,ot,re),ct=se(ct,Ee)}for(Ee=ee+1,ve=2;15>=Ee;++Ee,ve<<=1){if(at+=_t<<=1,0>(_t-=be[Ee]))return 0;for(;0<be[Ee];--be[Ee]){if(re=new I,(ct&Ke)!=tt){for(et+=ot,Xe=1<<(tt=Ee)-ee;15>tt&&!(0>=(Xe-=be[tt]));)++tt,Xe<<=1;Ie+=ot=1<<(Xe=tt-ee),Y[$+(tt=ct&Ke)].g=Xe+ee,Y[$+tt].value=et-$-tt}re.g=Ee-ee,re.value=je[Ae++],le(Y,et+(ct>>ee),ve,ot,re),ct=se(ct,Ee)}}return at!=2*Ne[15]-1?0:Ie}(m,x,M,D,B,U)}function I(){this.value=this.g=0}function ne(){this.value=this.g=0}function te(){this.G=o(5,I),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(br,ne)}function de(m,x,M,D){e(m!=null),e(x!=null),e(2147483648>D),m.Ca=254,m.I=0,m.b=-8,m.Ka=0,m.oa=x,m.pa=M,m.Jd=x,m.Yc=M+D,m.Zc=4<=D?M+D-4+1:M,he(m)}function X(m,x){for(var M=0;0<x--;)M|=Se(m,128)<<x;return M}function J(m,x){var M=X(m,x);return we(m)?-M:M}function G(m,x,M,D){var B,U=0;for(e(m!=null),e(x!=null),e(4294967288>D),m.Sb=D,m.Ra=0,m.u=0,m.h=0,4<D&&(D=4),B=0;B<D;++B)U+=x[M+B]<<8*B;m.Ra=U,m.bb=D,m.oa=x,m.pa=M}function me(m){for(;8<=m.u&&m.bb<m.Sb;)m.Ra>>>=8,m.Ra+=m.oa[m.pa+m.bb]<<Ro-8>>>0,++m.bb,m.u-=8;Q(m)&&(m.h=1,m.u=0)}function W(m,x){if(e(0<=x),!m.h&&x<=To){var M=V(m)&Ts[x];return m.u+=x,me(m),M}return m.h=1,m.u=0}function xe(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function R(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function V(m){return m.Ra>>>(m.u&Ro-1)>>>0}function Q(m){return e(m.bb<=m.Sb),m.h||m.bb==m.Sb&&m.u>Ro}function ae(m,x){m.u=x,m.h=Q(m)}function ce(m){m.u>=Rl&&(e(m.u>=Rl),me(m))}function he(m){e(m!=null&&m.oa!=null),m.pa<m.Zc?(m.I=(m.oa[m.pa++]|m.I<<8)>>>0,m.b+=8):(e(m!=null&&m.oa!=null),m.pa<m.Yc?(m.b+=8,m.I=m.oa[m.pa++]|m.I<<8):m.Ka?m.b=0:(m.I<<=8,m.b+=8,m.Ka=1))}function we(m){return X(m,1)}function Se(m,x){var M=m.Ca;0>m.b&&he(m);var D=m.b,B=M*x>>>8,U=(m.I>>>D>B)+0;for(U?(M-=B,m.I-=B+1<<D>>>0):M=B+1,D=M,B=0;256<=D;)B+=8,D>>=8;return D=7^B+ci[D],m.b-=D,m.Ca=(M<<D)-1,U}function Ve(m,x,M){m[x+0]=M>>24&255,m[x+1]=M>>16&255,m[x+2]=M>>8&255,m[x+3]=M>>0&255}function He(m,x){return m[x+0]<<0|m[x+1]<<8}function Je(m,x){return He(m,x)|m[x+2]<<16}function it(m,x){return He(m,x)|He(m,x+2)<<16}function dt(m,x){var M=1<<x;return e(m!=null),e(0<x),m.X=a(M),m.X==null?0:(m.Mb=32-x,m.Xa=x,1)}function ze(m,x){e(m!=null),e(x!=null),e(m.Xa==x.Xa),r(x.X,0,m.X,0,1<<x.Xa)}function ue(){this.X=[],this.Xa=this.Mb=0}function pt(m,x,M,D){e(M!=null),e(D!=null);var B=M[0],U=D[0];return B==0&&(B=(m*U+x/2)/x),U==0&&(U=(x*B+m/2)/m),0>=B||0>=U?0:(M[0]=B,D[0]=U,1)}function ht(m,x){return m+(1<<x)-1>>>x}function fe(m,x){return((4278255360&m)+(4278255360&x)>>>0&4278255360)+((16711935&m)+(16711935&x)>>>0&16711935)>>>0}function Ce(m,x){H[x]=function(M,D,B,U,Y,$,ee){var re;for(re=0;re<Y;++re){var ve=H[m]($[ee+re-1],B,U+re);$[ee+re]=fe(M[D+re],ve)}}}function Oe(){this.ud=this.hd=this.jd=0}function Ge(m,x){return((4278124286&(m^x))>>>1)+(m&x)>>>0}function Ue(m){return 0<=m&&256>m?m:0>m?0:255<m?255:void 0}function ie(m,x){return Ue(m+(m-x+.5>>1))}function ye(m,x,M){return Math.abs(x-M)-Math.abs(m-M)}function Be(m,x,M,D,B,U,Y){for(D=U[Y-1],M=0;M<B;++M)U[Y+M]=D=fe(m[x+M],D)}function Le(m,x,M,D,B){var U;for(U=0;U<M;++U){var Y=m[x+U],$=Y>>8&255,ee=16711935&(ee=(ee=16711935&Y)+(($<<16)+$));D[B+U]=(4278255360&Y)+ee>>>0}}function Re(m,x){x.jd=m>>0&255,x.hd=m>>8&255,x.ud=m>>16&255}function qe(m,x,M,D,B,U){var Y;for(Y=0;Y<D;++Y){var $=x[M+Y],ee=$>>>8,re=$,ve=255&(ve=(ve=$>>>16)+((m.jd<<24>>24)*(ee<<24>>24)>>>5));re=255&(re=(re=re+((m.hd<<24>>24)*(ee<<24>>24)>>>5))+((m.ud<<24>>24)*(ve<<24>>24)>>>5)),B[U+Y]=(4278255360&$)+(ve<<16)+re}}function ft(m,x,M,D,B){H[x]=function(U,Y,$,ee,re,ve,je,Ee,Ae){for(ee=je;ee<Ee;++ee)for(je=0;je<Ae;++je)re[ve++]=B($[D(U[Y++])])},H[m]=function(U,Y,$,ee,re,ve,je){var Ee=8>>U.b,Ae=U.Ea,et=U.K[0],Ie=U.w;if(8>Ee)for(U=(1<<U.b)-1,Ie=(1<<Ee)-1;Y<$;++Y){var be,Ne=0;for(be=0;be<Ae;++be)be&U||(Ne=D(ee[re++])),ve[je++]=B(et[Ne&Ie]),Ne>>=Ee}else H["VP8LMapColor"+M](ee,re,et,Ie,ve,je,Y,$,Ae)}}function $e(m,x,M,D,B){for(M=x+M;x<M;){var U=m[x++];D[B++]=U>>16&255,D[B++]=U>>8&255,D[B++]=U>>0&255}}function jt(m,x,M,D,B){for(M=x+M;x<M;){var U=m[x++];D[B++]=U>>16&255,D[B++]=U>>8&255,D[B++]=U>>0&255,D[B++]=U>>24&255}}function Mt(m,x,M,D,B){for(M=x+M;x<M;){var U=(Y=m[x++])>>16&240|Y>>12&15,Y=Y>>0&240|Y>>28&15;D[B++]=U,D[B++]=Y}}function mn(m,x,M,D,B){for(M=x+M;x<M;){var U=(Y=m[x++])>>16&248|Y>>13&7,Y=Y>>5&224|Y>>3&31;D[B++]=U,D[B++]=Y}}function Ct(m,x,M,D,B){for(M=x+M;x<M;){var U=m[x++];D[B++]=U>>0&255,D[B++]=U>>8&255,D[B++]=U>>16&255}}function Gt(m,x,M,D,B,U){if(U==0)for(M=x+M;x<M;)Ve(D,((U=m[x++])[0]>>24|U[1]>>8&65280|U[2]<<8&16711680|U[3]<<24)>>>0),B+=32;else r(D,B,m,x,M)}function ur(m,x){H[x][0]=H[m+"0"],H[x][1]=H[m+"1"],H[x][2]=H[m+"2"],H[x][3]=H[m+"3"],H[x][4]=H[m+"4"],H[x][5]=H[m+"5"],H[x][6]=H[m+"6"],H[x][7]=H[m+"7"],H[x][8]=H[m+"8"],H[x][9]=H[m+"9"],H[x][10]=H[m+"10"],H[x][11]=H[m+"11"],H[x][12]=H[m+"12"],H[x][13]=H[m+"13"],H[x][14]=H[m+"0"],H[x][15]=H[m+"0"]}function ut(m){return m==Gc||m==Ws||m==Qa||m==Il}function nn(){this.eb=[],this.size=this.A=this.fb=0}function Lt(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Yn(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new nn,this.f.kb=new Lt,this.sd=null}function jn(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function wn(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function mt(m){return alert("todo:WebPSamplerProcessPlane"),m.T}function Ht(m,x){var M=m.T,D=x.ba.f.RGBA,B=D.eb,U=D.fb+m.ka*D.A,Y=Tr[x.ba.S],$=m.y,ee=m.O,re=m.f,ve=m.N,je=m.ea,Ee=m.W,Ae=x.cc,et=x.dc,Ie=x.Mc,be=x.Nc,Ne=m.ka,Xe=m.ka+m.T,tt=m.U,Ke=tt+1>>1;for(Ne==0?Y($,ee,null,null,re,ve,je,Ee,re,ve,je,Ee,B,U,null,null,tt):(Y(x.ec,x.fc,$,ee,Ae,et,Ie,be,re,ve,je,Ee,B,U-D.A,B,U,tt),++M);Ne+2<Xe;Ne+=2)Ae=re,et=ve,Ie=je,be=Ee,ve+=m.Rc,Ee+=m.Rc,U+=2*D.A,Y($,(ee+=2*m.fa)-m.fa,$,ee,Ae,et,Ie,be,re,ve,je,Ee,B,U-D.A,B,U,tt);return ee+=m.fa,m.j+Xe<m.o?(r(x.ec,x.fc,$,ee,tt),r(x.cc,x.dc,re,ve,Ke),r(x.Mc,x.Nc,je,Ee,Ke),M--):1&Xe||Y($,ee,null,null,re,ve,je,Ee,re,ve,je,Ee,B,U+D.A,null,null,tt),M}function Wt(m,x,M){var D=m.F,B=[m.J];if(D!=null){var U=m.U,Y=x.ba.S,$=Y==zo||Y==Qa;x=x.ba.f.RGBA;var ee=[0],re=m.ka;ee[0]=m.T,m.Kb&&(re==0?--ee[0]:(--re,B[0]-=m.width),m.j+m.ka+m.T==m.o&&(ee[0]=m.o-m.j-re));var ve=x.eb;re=x.fb+re*x.A,m=Zt(D,B[0],m.width,U,ee,ve,re+($?0:3),x.A),e(M==ee),m&&ut(Y)&&Ei(ve,re,$,U,ee,x.A)}return 0}function Jn(m){var x=m.ma,M=x.ba.S,D=11>M,B=M==Fl||M==Vc||M==zo||M==Ka||M==12||ut(M);if(x.memory=null,x.Ib=null,x.Jb=null,x.Nd=null,!Os(x.Oa,m,B?11:12))return 0;if(B&&ut(M)&&rt(),m.da)alert("todo:use_scaling");else{if(D){if(x.Ib=mt,m.Kb){if(M=m.U+1>>1,x.memory=a(m.U+2*M),x.memory==null)return 0;x.ec=x.memory,x.fc=0,x.cc=x.ec,x.dc=x.fc+m.U,x.Mc=x.cc,x.Nc=x.dc+M,x.Ib=Ht,rt()}}else alert("todo:EmitYUV");B&&(x.Jb=Wt,D&&Me())}if(D&&!np){for(m=0;256>m;++m)Gg[m]=89858*(m-128)+wr>>Da,Zc[m]=-22014*(m-128)+wr,vd[m]=-45773*(m-128),Sr[m]=113618*(m-128)+wr>>Da;for(m=Gs;m<rf;++m)x=76283*(m-16)+wr>>Da,Kc[m-Gs]=Li(x,255),bd[m-Gs]=Li(x+8>>4,15);np=1}return 1}function _i(m){var x=m.ma,M=m.U,D=m.T;return e(!(1&m.ka)),0>=M||0>=D?0:(M=x.Ib(m,x),x.Jb!=null&&x.Jb(m,x,M),x.Dc+=M,1)}function Pi(m){m.ma.memory=null}function xt(m,x,M,D){return W(m,8)!=47?0:(x[0]=W(m,14)+1,M[0]=W(m,14)+1,D[0]=W(m,1),W(m,3)!=0?0:!m.h)}function un(m,x){if(4>m)return m+1;var M=m-2>>1;return(2+(1&m)<<M)+W(x,M)+1}function zn(m,x){return 120<x?x-120:1<=(M=((M=es[x-1])>>4)*m+(8-(15&M)))?M:1;var M}function vr(m,x,M){var D=V(M),B=m[x+=255&D].g-8;return 0<B&&(ae(M,M.u+8),D=V(M),x+=m[x].value,x+=D&(1<<B)-1),ae(M,M.u+m[x].g),m[x].value}function er(m,x,M){return M.g+=m.g,M.value+=m.value<<x>>>0,e(8>=M.g),m.g}function fr(m,x,M){var D=m.xc;return e((x=D==0?0:m.vc[m.md*(M>>D)+(x>>D)])<m.Wb),m.Ya[x]}function Ni(m,x,M,D){var B=m.ab,U=m.c*x,Y=m.C;x=Y+x;var $=M,ee=D;for(D=m.Ta,M=m.Ua;0<B--;){var re=m.gc[B],ve=Y,je=x,Ee=$,Ae=ee,et=(ee=D,$=M,re.Ea);switch(e(ve<je),e(je<=re.nc),re.hc){case 2:Zu(Ee,Ae,(je-ve)*et,ee,$);break;case 0:var Ie=ve,be=je,Ne=ee,Xe=$,tt=(ot=re).Ea;Ie==0&&(gd(Ee,Ae,null,null,1,Ne,Xe),Be(Ee,Ae+1,0,0,tt-1,Ne,Xe+1),Ae+=tt,Xe+=tt,++Ie);for(var Ke=1<<ot.b,ct=Ke-1,at=ht(tt,ot.b),_t=ot.K,ot=ot.w+(Ie>>ot.b)*at;Ie<be;){var an=_t,fn=ot,$t=1;for(Wc(Ee,Ae,Ne,Xe-tt,1,Ne,Xe);$t<tt;){var Yt=($t&~ct)+Ke;Yt>tt&&(Yt=tt),(0,$a[an[fn++]>>8&15])(Ee,Ae+ +$t,Ne,Xe+$t-tt,Yt-$t,Ne,Xe+$t),$t=Yt}Ae+=tt,Xe+=tt,++Ie&ct||(ot+=at)}je!=re.nc&&r(ee,$-et,ee,$+(je-ve-1)*et,et);break;case 1:for(et=Ee,be=Ae,tt=(Ee=re.Ea)-(Xe=Ee&~(Ne=(Ae=1<<re.b)-1)),Ie=ht(Ee,re.b),Ke=re.K,re=re.w+(ve>>re.b)*Ie;ve<je;){for(ct=Ke,at=re,_t=new Oe,ot=be+Xe,an=be+Ee;be<ot;)Re(ct[at++],_t),Ps(_t,et,be,Ae,ee,$),be+=Ae,$+=Ae;be<an&&(Re(ct[at++],_t),Ps(_t,et,be,tt,ee,$),be+=tt,$+=tt),++ve&Ne||(re+=Ie)}break;case 3:if(Ee==ee&&Ae==$&&0<re.b){for(be=ee,Ee=et=$+(je-ve)*et-(Xe=(je-ve)*ht(re.Ea,re.b)),Ae=ee,Ne=$,Ie=[],Xe=(tt=Xe)-1;0<=Xe;--Xe)Ie[Xe]=Ae[Ne+Xe];for(Xe=tt-1;0<=Xe;--Xe)be[Ee+Xe]=Ie[Xe];zi(re,ve,je,ee,et,ee,$)}else zi(re,ve,je,Ee,Ae,ee,$)}$=D,ee=M}ee!=M&&r(D,M,$,ee,U)}function Ao(m,x){var M=m.V,D=m.Ba+m.c*m.C,B=x-m.C;if(e(x<=m.l.o),e(16>=B),0<B){var U=m.l,Y=m.Ta,$=m.Ua,ee=U.width;if(Ni(m,B,M,D),B=$=[$],e((M=m.C)<(D=x)),e(U.v<U.va),D>U.o&&(D=U.o),M<U.j){var re=U.j-M;M=U.j,B[0]+=re*ee}if(M>=D?M=0:(B[0]+=4*U.v,U.ka=M-U.j,U.U=U.va-U.v,U.T=D-M,M=1),M){if($=$[0],11>(M=m.ca).S){var ve=M.f.RGBA,je=(D=M.S,B=U.U,U=U.T,re=ve.eb,ve.A),Ee=U;for(ve=ve.fb+m.Ma*ve.A;0<Ee--;){var Ae=Y,et=$,Ie=B,be=re,Ne=ve;switch(D){case Gr:ei(Ae,et,Ie,be,Ne);break;case Fl:Ir(Ae,et,Ie,be,Ne);break;case Gc:Ir(Ae,et,Ie,be,Ne),Ei(be,Ne,0,Ie,1,0);break;case ka:ia(Ae,et,Ie,be,Ne);break;case Vc:Gt(Ae,et,Ie,be,Ne,1);break;case Ws:Gt(Ae,et,Ie,be,Ne,1),Ei(be,Ne,0,Ie,1,0);break;case zo:Gt(Ae,et,Ie,be,Ne,0);break;case Qa:Gt(Ae,et,Ie,be,Ne,0),Ei(be,Ne,1,Ie,1,0);break;case Ka:Bs(Ae,et,Ie,be,Ne);break;case Il:Bs(Ae,et,Ie,be,Ne),Xt(be,Ne,Ie,1,0);break;case Qu:ui(Ae,et,Ie,be,Ne);break;default:e(0)}$+=ee,ve+=je}m.Ma+=U}else alert("todo:EmitRescaledRowsYUVA");e(m.Ma<=M.height)}}m.C=x,e(m.C<=m.i)}function Ai(m){var x;if(0<m.ua)return 0;for(x=0;x<m.Wb;++x){var M=m.Ya[x].G,D=m.Ya[x].H;if(0<M[1][D[1]+0].g||0<M[2][D[2]+0].g||0<M[3][D[3]+0].g)return 0}return 1}function Ci(m,x,M,D,B,U){if(m.Z!=0){var Y=m.qd,$=m.rd;for(e(La[m.Z]!=null);x<M;++x)La[m.Z](Y,$,D,B,D,B,U),Y=D,$=B,B+=U;m.qd=Y,m.rd=$}}function Wr(m,x){var M=m.l.ma,D=M.Z==0||M.Z==1?m.l.j:m.C;if(D=m.C<D?D:m.C,e(x<=m.l.o),x>D){var B=m.l.width,U=M.ca,Y=M.tb+B*D,$=m.V,ee=m.Ba+m.c*D,re=m.gc;e(m.ab==1),e(re[0].hc==3),Rs(re[0],D,x,$,ee,U,Y),Ci(M,D,x,U,Y,B)}m.C=m.Ma=x}function Yr(m,x,M,D,B,U,Y){var $=m.$/D,ee=m.$%D,re=m.m,ve=m.s,je=M+m.$,Ee=je;B=M+D*B;var Ae=M+D*U,et=280+ve.ua,Ie=m.Pb?$:16777216,be=0<ve.ua?ve.Wa:null,Ne=ve.wc,Xe=je<Ae?fr(ve,ee,$):null;e(m.C<U),e(Ae<=B);var tt=!1;e:for(;;){for(;tt||je<Ae;){var Ke=0;if($>=Ie){var ct=je-M;e((Ie=m).Pb),Ie.wd=Ie.m,Ie.xd=ct,0<Ie.s.ua&&ze(Ie.s.Wa,Ie.s.vb),Ie=$+Jh}if(ee&Ne||(Xe=fr(ve,ee,$)),e(Xe!=null),Xe.Qb&&(x[je]=Xe.qb,tt=!0),!tt)if(ce(re),Xe.jc){Ke=re,ct=x;var at=je,_t=Xe.pd[V(Ke)&br-1];e(Xe.jc),256>_t.g?(ae(Ke,Ke.u+_t.g),ct[at]=_t.value,Ke=0):(ae(Ke,Ke.u+_t.g-256),e(256<=_t.value),Ke=_t.value),Ke==0&&(tt=!0)}else Ke=vr(Xe.G[0],Xe.H[0],re);if(re.h)break;if(tt||256>Ke){if(!tt)if(Xe.nd)x[je]=(Xe.qb|Ke<<8)>>>0;else{if(ce(re),tt=vr(Xe.G[1],Xe.H[1],re),ce(re),ct=vr(Xe.G[2],Xe.H[2],re),at=vr(Xe.G[3],Xe.H[3],re),re.h)break;x[je]=(at<<24|tt<<16|Ke<<8|ct)>>>0}if(tt=!1,++je,++ee>=D&&(ee=0,++$,Y!=null&&$<=U&&!($%16)&&Y(m,$),be!=null))for(;Ee<je;)Ke=x[Ee++],be.X[(506832829*Ke&4294967295)>>>be.Mb]=Ke}else if(280>Ke){if(Ke=un(Ke-256,re),ct=vr(Xe.G[4],Xe.H[4],re),ce(re),ct=zn(D,ct=un(ct,re)),re.h)break;if(je-M<ct||B-je<Ke)break e;for(at=0;at<Ke;++at)x[je+at]=x[je+at-ct];for(je+=Ke,ee+=Ke;ee>=D;)ee-=D,++$,Y!=null&&$<=U&&!($%16)&&Y(m,$);if(e(je<=B),ee&Ne&&(Xe=fr(ve,ee,$)),be!=null)for(;Ee<je;)Ke=x[Ee++],be.X[(506832829*Ke&4294967295)>>>be.Mb]=Ke}else{if(!(Ke<et))break e;for(tt=Ke-280,e(be!=null);Ee<je;)Ke=x[Ee++],be.X[(506832829*Ke&4294967295)>>>be.Mb]=Ke;Ke=je,e(!(tt>>>(ct=be).Xa)),x[Ke]=ct.X[tt],tt=!0}tt||e(re.h==Q(re))}if(m.Pb&&re.h&&je<B)e(m.m.h),m.a=5,m.m=m.wd,m.$=m.xd,0<m.s.ua&&ze(m.s.vb,m.s.Wa);else{if(re.h)break e;Y?.(m,$>U?U:$),m.a=0,m.$=je-M}return 1}return m.a=3,0}function si(m){e(m!=null),m.vc=null,m.yc=null,m.Ya=null;var x=m.Wa;x!=null&&(x.X=null),m.vb=null,e(m!=null)}function Fr(){var m=new md;return m==null?null:(m.a=0,m.xb=zl,ur("Predictor","VP8LPredictors"),ur("Predictor","VP8LPredictors_C"),ur("PredictorAdd","VP8LPredictorsAdd"),ur("PredictorAdd","VP8LPredictorsAdd_C"),Zu=Le,Ps=qe,ei=$e,Ir=jt,Bs=Mt,ui=mn,ia=Ct,H.VP8LMapColor32b=jr,H.VP8LMapColor8b=Yc,m)}function Sn(m,x,M,D,B){var U=1,Y=[m],$=[x],ee=D.m,re=D.s,ve=null,je=0;e:for(;;){if(M)for(;U&&W(ee,1);){var Ee=Y,Ae=$,et=D,Ie=1,be=et.m,Ne=et.gc[et.ab],Xe=W(be,2);if(et.Oc&1<<Xe)U=0;else{switch(et.Oc|=1<<Xe,Ne.hc=Xe,Ne.Ea=Ee[0],Ne.nc=Ae[0],Ne.K=[null],++et.ab,e(4>=et.ab),Xe){case 0:case 1:Ne.b=W(be,3)+2,Ie=Sn(ht(Ne.Ea,Ne.b),ht(Ne.nc,Ne.b),0,et,Ne.K),Ne.K=Ne.K[0];break;case 3:var tt,Ke=W(be,8)+1,ct=16<Ke?0:4<Ke?1:2<Ke?2:3;if(Ee[0]=ht(Ne.Ea,ct),Ne.b=ct,tt=Ie=Sn(Ke,1,0,et,Ne.K)){var at,_t=Ke,ot=Ne,an=1<<(8>>ot.b),fn=a(an);if(fn==null)tt=0;else{var $t=ot.K[0],Yt=ot.w;for(fn[0]=ot.K[0][0],at=1;at<1*_t;++at)fn[at]=fe($t[Yt+at],fn[at-1]);for(;at<4*an;++at)fn[at]=0;ot.K[0]=null,ot.K[0]=fn,tt=1}}Ie=tt;break;case 2:break;default:e(0)}U=Ie}}if(Y=Y[0],$=$[0],U&&W(ee,1)&&!(U=1<=(je=W(ee,4))&&11>=je)){D.a=3;break e}var gn;if(gn=U)t:{var dn,It,_n,kt=D,Ot=Y,rn=$,sn=je,Rr=M,_r=kt.m,ir=kt.s,ar=[null],hr=1,Wi=0,hn=Uo[sn];n:for(;;){if(Rr&&W(_r,1)){var pr=W(_r,3)+2,oa=ht(Ot,pr),$s=ht(rn,pr),Yo=oa*$s;if(!Sn(oa,$s,0,kt,ar))break n;for(ar=ar[0],ir.xc=pr,dn=0;dn<Yo;++dn){var Xs=ar[dn]>>8&65535;ar[dn]=Xs,Xs>=hr&&(hr=Xs+1)}}if(_r.h)break n;for(It=0;5>It;++It){var Fn=Di[It];!It&&0<sn&&(Fn+=1<<sn),Wi<Fn&&(Wi=Fn)}var Qc=o(hr*hn,I),af=hr,ni=o(af,te);if(ni==null)var Un=null;else e(65536>=af),Un=ni;var Vo=a(Wi);if(Un==null||Vo==null||Qc==null){kt.a=1;break n}var Zs=Qc;for(dn=_n=0;dn<hr;++dn){var di=Un[dn],Ks=di.G,hi=di.H,Jc=0,Ul=1,sf=0;for(It=0;5>It;++It){Fn=Di[It],Ks[It]=Zs,hi[It]=_n,!It&&0<sn&&(Fn+=1<<sn);i:{var eu,of=Fn,tu=kt,ql=Vo,ap=Zs,sp=_n,nu=0,is=tu.m,Xg=W(is,1);if(i(ql,0,0,of),Xg){var op=W(is,1)+1,lp=W(is,1),xd=W(is,lp==0?1:8);ql[xd]=1,op==2&&(ql[xd=W(is,8)]=1);var Wl=1}else{var wd=a(19),Sd=W(is,4)+4;if(19<Sd){tu.a=3;var ru=0;break i}for(eu=0;eu<Sd;++eu)wd[Ja[eu]]=W(is,3);var lf=void 0,Yl=void 0,cp=tu,up=wd,as=of,iu=ql,cf=0,la=cp.m,Vl=8,_d=o(128,I);r:for(;P(_d,0,7,up,19);){if(W(la,1)){var fp=2+2*W(la,3);if((lf=2+W(la,fp))>as)break r}else lf=as;for(Yl=0;Yl<as&&lf--;){ce(la);var Nd=_d[0+(127&V(la))];ae(la,la.u+Nd.g);var Go=Nd.value;if(16>Go)iu[Yl++]=Go,Go!=0&&(Vl=Go);else{var dp=Go==16,Ad=Go-16,Cd=qi[Ad],kd=W(la,Ju[Ad])+Cd;if(Yl+kd>as)break r;for(var hp=dp?Vl:0;0<kd--;)iu[Yl++]=hp}}cf=1;break r}cf||(cp.a=3),Wl=cf}(Wl=Wl&&!is.h)&&(nu=P(ap,sp,8,ql,of)),Wl&&nu!=0?ru=nu:(tu.a=3,ru=0)}if(ru==0)break n;if(Ul&&Ho[It]==1&&(Ul=Zs[_n].g==0),Jc+=Zs[_n].g,_n+=ru,3>=It){var $o,uf=Vo[0];for($o=1;$o<Fn;++$o)Vo[$o]>uf&&(uf=Vo[$o]);sf+=uf}}if(di.nd=Ul,di.Qb=0,Ul&&(di.qb=(Ks[3][hi[3]+0].value<<24|Ks[1][hi[1]+0].value<<16|Ks[2][hi[2]+0].value)>>>0,Jc==0&&256>Ks[0][hi[0]+0].value&&(di.Qb=1,di.qb+=Ks[0][hi[0]+0].value<<8)),di.jc=!di.Qb&&6>sf,di.jc){var au,ss=di;for(au=0;au<br;++au){var ja=au,os=ss.pd[ja],su=ss.G[0][ss.H[0]+ja];256<=su.value?(os.g=su.g+256,os.value=su.value):(os.g=0,os.value=0,ja>>=er(su,8,os),ja>>=er(ss.G[1][ss.H[1]+ja],16,os),ja>>=er(ss.G[2][ss.H[2]+ja],0,os),er(ss.G[3][ss.H[3]+ja],24,os))}}}ir.vc=ar,ir.Wb=hr,ir.Ya=Un,ir.yc=Qc,gn=1;break t}gn=0}if(!(U=gn)){D.a=3;break e}if(0<je){if(re.ua=1<<je,!dt(re.Wa,je)){D.a=1,U=0;break e}}else re.ua=0;var ou=D,Md=Y,pp=$,Ld=ou.s,Ed=Ld.xc;if(ou.c=Md,ou.i=pp,Ld.md=ht(Md,Ed),Ld.wc=Ed==0?-1:(1<<Ed)-1,M){D.xb=tp;break e}if((ve=a(Y*$))==null){D.a=1,U=0;break e}U=(U=Yr(D,ve,0,Y,$,$,null))&&!ee.h;break e}return U?(B!=null?B[0]=ve:(e(ve==null),e(M)),D.$=0,M||si(re)):si(re),U}function _s(m,x){var M=m.c*m.i,D=M+x+16*x;return e(m.c<=x),m.V=a(D),m.V==null?(m.Ta=null,m.Ua=0,m.a=1,0):(m.Ta=m.V,m.Ua=m.Ba+M+x,1)}function Co(m,x){var M=m.C,D=x-M,B=m.V,U=m.Ba+m.c*M;for(e(x<=m.l.o);0<D;){var Y=16<D?16:D,$=m.l.ma,ee=m.l.width,re=ee*Y,ve=$.ca,je=$.tb+ee*M,Ee=m.Ta,Ae=m.Ua;Ni(m,Y,B,U),Mn(Ee,Ae,ve,je,re),Ci($,M,M+Y,ve,je,ee),D-=Y,B+=Y*m.c,M+=Y}e(M==x),m.C=m.Ma=x}function Bi(){this.ub=this.yd=this.td=this.Rb=0}function Ji(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function bl(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function Lc(){this.Yb=function(){var m=[];return function x(M,D,B){for(var U=B[D],Y=0;Y<U&&(M.push(B.length>D+1?[]:0),!(B.length<D+1));Y++)x(M[Y],D+1,B)}(m,0,[3,11]),m}()}function Iu(){this.jb=a(3),this.Wc=c([4,8],Lc),this.Xc=c([4,17],Lc)}function ud(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function Ia(){this.ld=this.La=this.dd=this.tc=0}function ko(){this.Na=this.la=0}function ea(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Mo(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function zu(){this.uc=this.M=this.Nb=0,this.wa=Array(new Ia),this.Y=0,this.ya=Array(new Mo),this.aa=0,this.l=new Ns}function za(){this.y=a(16),this.f=a(8),this.ea=a(8)}function Ec(){this.cb=this.a=0,this.sc="",this.m=new xe,this.Od=new Bi,this.Kc=new Ji,this.ed=new ud,this.Qa=new bl,this.Ic=this.$c=this.Aa=0,this.D=new zu,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,xe),this.ia=0,this.pb=o(4,ea),this.Pa=new Iu,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new za),this.Hd=0,this.rb=Array(new ko),this.sb=0,this.wa=Array(new Ia),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Mo),this.L=this.aa=0,this.gd=c([4,2],Ia),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Ns(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function fd(){var m=new Ec;return m!=null&&(m.a=0,m.sc="OK",m.cb=0,m.Xb=0,xr||(xr=Hu)),m}function Vn(m,x,M){return m.a==0&&(m.a=x,m.sc=M,m.cb=0),0}function Jr(m,x,M){return 3<=M&&m[x+0]==157&&m[x+1]==1&&m[x+2]==42}function Dc(m,x){if(m==null)return 0;if(m.a=0,m.sc="OK",x==null)return Vn(m,2,"null VP8Io passed to VP8GetHeaders()");var M=x.data,D=x.w,B=x.ha;if(4>B)return Vn(m,7,"Truncated header.");var U=M[D+0]|M[D+1]<<8|M[D+2]<<16,Y=m.Od;if(Y.Rb=!(1&U),Y.td=U>>1&7,Y.yd=U>>4&1,Y.ub=U>>5,3<Y.td)return Vn(m,3,"Incorrect keyframe parameters.");if(!Y.yd)return Vn(m,4,"Frame not displayable.");D+=3,B-=3;var $=m.Kc;if(Y.Rb){if(7>B)return Vn(m,7,"cannot parse picture header");if(!Jr(M,D,B))return Vn(m,3,"Bad code word");$.c=16383&(M[D+4]<<8|M[D+3]),$.Td=M[D+4]>>6,$.i=16383&(M[D+6]<<8|M[D+5]),$.Ud=M[D+6]>>6,D+=7,B-=7,m.za=$.c+15>>4,m.Ub=$.i+15>>4,x.width=$.c,x.height=$.i,x.Da=0,x.j=0,x.v=0,x.va=x.width,x.o=x.height,x.da=0,x.ib=x.width,x.hb=x.height,x.U=x.width,x.T=x.height,i((U=m.Pa).jb,0,255,U.jb.length),e((U=m.Qa)!=null),U.Cb=0,U.Bb=0,U.Fb=1,i(U.Zb,0,0,U.Zb.length),i(U.Lb,0,0,U.Lb)}if(Y.ub>B)return Vn(m,7,"bad partition length");de(U=m.m,M,D,Y.ub),D+=Y.ub,B-=Y.ub,Y.Rb&&($.Ld=we(U),$.Kd=we(U)),$=m.Qa;var ee,re=m.Pa;if(e(U!=null),e($!=null),$.Cb=we(U),$.Cb){if($.Bb=we(U),we(U)){for($.Fb=we(U),ee=0;4>ee;++ee)$.Zb[ee]=we(U)?J(U,7):0;for(ee=0;4>ee;++ee)$.Lb[ee]=we(U)?J(U,6):0}if($.Bb)for(ee=0;3>ee;++ee)re.jb[ee]=we(U)?X(U,8):255}else $.Bb=0;if(U.Ka)return Vn(m,3,"cannot parse segment header");if(($=m.ed).zd=we(U),$.Tb=X(U,6),$.wb=X(U,3),$.Pc=we(U),$.Pc&&we(U)){for(re=0;4>re;++re)we(U)&&($.vd[re]=J(U,6));for(re=0;4>re;++re)we(U)&&($.od[re]=J(U,6))}if(m.L=$.Tb==0?0:$.zd?1:2,U.Ka)return Vn(m,3,"cannot parse filter header");var ve=B;if(B=ee=D,D=ee+ve,$=ve,m.Xb=(1<<X(m.m,2))-1,ve<3*(re=m.Xb))M=7;else{for(ee+=3*re,$-=3*re,ve=0;ve<re;++ve){var je=M[B+0]|M[B+1]<<8|M[B+2]<<16;je>$&&(je=$),de(m.Jc[+ve],M,ee,je),ee+=je,$-=je,B+=3}de(m.Jc[+re],M,ee,$),M=ee<D?0:5}if(M!=0)return Vn(m,M,"cannot parse partitions");for(M=X(ee=m.m,7),B=we(ee)?J(ee,4):0,D=we(ee)?J(ee,4):0,$=we(ee)?J(ee,4):0,re=we(ee)?J(ee,4):0,ee=we(ee)?J(ee,4):0,ve=m.Qa,je=0;4>je;++je){if(ve.Cb){var Ee=ve.Zb[je];ve.Fb||(Ee+=M)}else{if(0<je){m.pb[je]=m.pb[0];continue}Ee=M}var Ae=m.pb[je];Ae.Sc[0]=$c[Li(Ee+B,127)],Ae.Sc[1]=Xc[Li(Ee+0,127)],Ae.Eb[0]=2*$c[Li(Ee+D,127)],Ae.Eb[1]=101581*Xc[Li(Ee+$,127)]>>16,8>Ae.Eb[1]&&(Ae.Eb[1]=8),Ae.Qc[0]=$c[Li(Ee+re,117)],Ae.Qc[1]=Xc[Li(Ee+ee,127)],Ae.lc=Ee+ee}if(!Y.Rb)return Vn(m,4,"Not a key frame.");for(we(U),Y=m.Pa,M=0;4>M;++M){for(B=0;8>B;++B)for(D=0;3>D;++D)for($=0;11>$;++$)re=Se(U,qo[M][B][D][$])?X(U,8):Ma[M][B][D][$],Y.Wc[M][B].Yb[D][$]=re;for(B=0;17>B;++B)Y.Xc[M][B]=Y.Wc[M][ep[B]]}return m.kc=we(U),m.kc&&(m.Bd=X(U,8)),m.cb=1}function Hu(m,x,M,D,B,U,Y){var $=x[B].Yb[M];for(M=0;16>B;++B){if(!Se(m,$[M+0]))return B;for(;!Se(m,$[M+1]);)if($=x[++B].Yb[0],M=0,B==16)return 16;var ee=x[B+1].Yb;if(Se(m,$[M+2])){var re=m,ve=0;if(Se(re,(Ee=$)[(je=M)+3]))if(Se(re,Ee[je+6])){for($=0,je=2*(ve=Se(re,Ee[je+8]))+(Ee=Se(re,Ee[je+9+ve])),ve=0,Ee=Xn[je];Ee[$];++$)ve+=ve+Se(re,Ee[$]);ve+=3+(8<<je)}else Se(re,Ee[je+7])?(ve=7+2*Se(re,165),ve+=Se(re,145)):ve=5+Se(re,159);else ve=Se(re,Ee[je+4])?3+Se(re,Ee[je+5]):2;$=ee[2]}else ve=1,$=ee[1];ee=Y+cn[B],0>(re=m).b&&he(re);var je,Ee=re.b,Ae=(je=re.Ca>>1)-(re.I>>Ee)>>31;--re.b,re.Ca+=Ae,re.Ca|=1,re.I-=(je+1&Ae)<<Ee,U[ee]=((ve^Ae)-Ae)*D[(0<B)+0]}return 16}function As(m){var x=m.rb[m.sb-1];x.la=0,x.Na=0,i(m.zc,0,0,m.zc.length),m.ja=0}function Uu(m,x){if(m==null)return 0;if(x==null)return Vn(m,2,"NULL VP8Io parameter in VP8Decode().");if(!m.cb&&!Dc(m,x))return 0;if(e(m.cb),x.ac==null||x.ac(x)){x.ob&&(m.L=0);var M=rs[m.L];if(m.L==2?(m.yb=0,m.zb=0):(m.yb=x.v-M>>4,m.zb=x.j-M>>4,0>m.yb&&(m.yb=0),0>m.zb&&(m.zb=0)),m.Va=x.o+15+M>>4,m.Hb=x.va+15+M>>4,m.Hb>m.za&&(m.Hb=m.za),m.Va>m.Ub&&(m.Va=m.Ub),0<m.L){var D=m.ed;for(M=0;4>M;++M){var B;if(m.Qa.Cb){var U=m.Qa.Lb[M];m.Qa.Fb||(U+=D.Tb)}else U=D.Tb;for(B=0;1>=B;++B){var Y=m.gd[M][B],$=U;if(D.Pc&&($+=D.vd[0],B&&($+=D.od[0])),0<($=0>$?0:63<$?63:$)){var ee=$;0<D.wb&&(ee=4<D.wb?ee>>2:ee>>1)>9-D.wb&&(ee=9-D.wb),1>ee&&(ee=1),Y.dd=ee,Y.tc=2*$+ee,Y.ld=40<=$?2:15<=$?1:0}else Y.tc=0;Y.La=B}}}M=0}else Vn(m,6,"Frame setup failed"),M=m.a;if(M=M==0){if(M){m.$c=0,0<m.Aa||(m.Ic=rp);e:{M=m.Ic,D=4*(ee=m.za);var re=32*ee,ve=ee+1,je=0<m.L?ee*(0<m.Aa?2:1):0,Ee=(m.Aa==2?2:1)*ee;if((Y=D+832+(B=3*(16*M+rs[m.L])/2*re)+(U=m.Fa!=null&&0<m.Fa.length?m.Kc.c*m.Kc.i:0))!=Y)M=0;else{if(Y>m.Vb){if(m.Vb=0,m.Ec=a(Y),m.Fc=0,m.Ec==null){M=Vn(m,1,"no memory during frame initialization.");break e}m.Vb=Y}Y=m.Ec,$=m.Fc,m.Ac=Y,m.Bc=$,$+=D,m.Gd=o(re,za),m.Hd=0,m.rb=o(ve+1,ko),m.sb=1,m.wa=je?o(je,Ia):null,m.Y=0,m.D.Nb=0,m.D.wa=m.wa,m.D.Y=m.Y,0<m.Aa&&(m.D.Y+=ee),e(!0),m.oc=Y,m.pc=$,$+=832,m.ya=o(Ee,Mo),m.aa=0,m.D.ya=m.ya,m.D.aa=m.aa,m.Aa==2&&(m.D.aa+=ee),m.R=16*ee,m.B=8*ee,ee=(re=rs[m.L])*m.R,re=re/2*m.B,m.sa=Y,m.ta=$+ee,m.qa=m.sa,m.ra=m.ta+16*M*m.R+re,m.Ha=m.qa,m.Ia=m.ra+8*M*m.B+re,m.$c=0,$+=B,m.mb=U?Y:null,m.nb=U?$:null,e($+U<=m.Fc+m.Vb),As(m),i(m.Ac,m.Bc,0,D),M=1}}if(M){if(x.ka=0,x.y=m.sa,x.O=m.ta,x.f=m.qa,x.N=m.ra,x.ea=m.Ha,x.Vd=m.Ia,x.fa=m.R,x.Rc=m.B,x.F=null,x.J=0,!Za){for(M=-255;255>=M;++M)rr[255+M]=0>M?-M:M;for(M=-1020;1020>=M;++M)Hi[1020+M]=-128>M?-128:127<M?127:M;for(M=-112;112>=M;++M)Us[112+M]=-16>M?-16:15<M?15:M;for(M=-255;510>=M;++M)qs[255+M]=0>M?0:255<M?255:M;Za=1}Aa=Cs,aa=Oc,sa=Ha,dr=qu,fi=Tc,Gn=jc,Po=Eo,Ca=Do,Pl=pd,Fs=Ic,Is=hd,zs=kl,Bo=Ml,Bl=Xu,Hs=Es,Xa=Mi,Fo=Na,$n=dd,ti[0]=li,ti[1]=Wu,ti[2]=Bc,ti[3]=Vu,ti[4]=Fi,ti[5]=wa,ti[6]=_l,ti[7]=Ii,ti[8]=Nl,ti[9]=Fc,ts[0]=Sl,ts[1]=Pc,ts[2]=Ua,ts[3]=wl,ts[4]=Er,ts[5]=ks,ts[6]=Wa,ji[0]=Ya,ji[1]=Yu,ji[2]=Gu,ji[3]=Ms,ji[4]=ki,ji[5]=Vr,ji[6]=Ls,M=1}else M=0}M&&(M=function(Ae,et){for(Ae.M=0;Ae.M<Ae.Va;++Ae.M){var Ie,be=Ae.Jc[Ae.M&Ae.Xb],Ne=Ae.m,Xe=Ae;for(Ie=0;Ie<Xe.za;++Ie){var tt=Ne,Ke=Xe,ct=Ke.Ac,at=Ke.Bc+4*Ie,_t=Ke.zc,ot=Ke.ya[Ke.aa+Ie];if(Ke.Qa.Bb?ot.$b=Se(tt,Ke.Pa.jb[0])?2+Se(tt,Ke.Pa.jb[2]):Se(tt,Ke.Pa.jb[1]):ot.$b=0,Ke.kc&&(ot.Ad=Se(tt,Ke.Bd)),ot.Za=!Se(tt,145)+0,ot.Za){var an=ot.Ob,fn=0;for(Ke=0;4>Ke;++Ke){var $t,Yt=_t[0+Ke];for($t=0;4>$t;++$t){Yt=yd[ct[at+$t]][Yt];for(var gn=Ys[Se(tt,Yt[0])];0<gn;)gn=Ys[2*gn+Se(tt,Yt[gn])];Yt=-gn,ct[at+$t]=Yt}r(an,fn,ct,at,4),fn+=4,_t[0+Ke]=Yt}}else Yt=Se(tt,156)?Se(tt,128)?1:3:Se(tt,163)?2:0,ot.Ob[0]=Yt,i(ct,at,Yt,4),i(_t,0,Yt,4);ot.Dd=Se(tt,142)?Se(tt,114)?Se(tt,183)?1:3:2:0}if(Xe.m.Ka)return Vn(Ae,7,"Premature end-of-partition0 encountered.");for(;Ae.ja<Ae.za;++Ae.ja){if(Xe=be,tt=(Ne=Ae).rb[Ne.sb-1],ct=Ne.rb[Ne.sb+Ne.ja],Ie=Ne.ya[Ne.aa+Ne.ja],at=Ne.kc?Ie.Ad:0)tt.la=ct.la=0,Ie.Za||(tt.Na=ct.Na=0),Ie.Hc=0,Ie.Gc=0,Ie.ia=0;else{var dn,It;if(tt=ct,ct=Xe,at=Ne.Pa.Xc,_t=Ne.ya[Ne.aa+Ne.ja],ot=Ne.pb[_t.$b],Ke=_t.ad,an=0,fn=Ne.rb[Ne.sb-1],Yt=$t=0,i(Ke,an,0,384),_t.Za)var _n=0,kt=at[3];else{gn=a(16);var Ot=tt.Na+fn.Na;if(Ot=xr(ct,at[1],Ot,ot.Eb,0,gn,0),tt.Na=fn.Na=(0<Ot)+0,1<Ot)Aa(gn,0,Ke,an);else{var rn=gn[0]+3>>3;for(gn=0;256>gn;gn+=16)Ke[an+gn]=rn}_n=1,kt=at[0]}var sn=15&tt.la,Rr=15&fn.la;for(gn=0;4>gn;++gn){var _r=1&Rr;for(rn=It=0;4>rn;++rn)sn=sn>>1|(_r=(Ot=xr(ct,kt,Ot=_r+(1&sn),ot.Sc,_n,Ke,an))>_n)<<7,It=It<<2|(3<Ot?3:1<Ot?2:Ke[an+0]!=0),an+=16;sn>>=4,Rr=Rr>>1|_r<<7,$t=($t<<8|It)>>>0}for(kt=sn,_n=Rr>>4,dn=0;4>dn;dn+=2){for(It=0,sn=tt.la>>4+dn,Rr=fn.la>>4+dn,gn=0;2>gn;++gn){for(_r=1&Rr,rn=0;2>rn;++rn)Ot=_r+(1&sn),sn=sn>>1|(_r=0<(Ot=xr(ct,at[2],Ot,ot.Qc,0,Ke,an)))<<3,It=It<<2|(3<Ot?3:1<Ot?2:Ke[an+0]!=0),an+=16;sn>>=2,Rr=Rr>>1|_r<<5}Yt|=It<<4*dn,kt|=sn<<4<<dn,_n|=(240&Rr)<<dn}tt.la=kt,fn.la=_n,_t.Hc=$t,_t.Gc=Yt,_t.ia=43690&Yt?0:ot.ia,at=!($t|Yt)}if(0<Ne.L&&(Ne.wa[Ne.Y+Ne.ja]=Ne.gd[Ie.$b][Ie.Za],Ne.wa[Ne.Y+Ne.ja].La|=!at),Xe.Ka)return Vn(Ae,7,"Premature end-of-file encountered.")}if(As(Ae),Ne=et,Xe=1,Ie=(be=Ae).D,tt=0<be.L&&be.M>=be.zb&&be.M<=be.Va,be.Aa==0)e:{if(Ie.M=be.M,Ie.uc=tt,Ga(be,Ie),Xe=1,Ie=(It=be.D).Nb,tt=(Yt=rs[be.L])*be.R,ct=Yt/2*be.B,gn=16*Ie*be.R,rn=8*Ie*be.B,at=be.sa,_t=be.ta-tt+gn,ot=be.qa,Ke=be.ra-ct+rn,an=be.Ha,fn=be.Ia-ct+rn,Rr=(sn=It.M)==0,$t=sn>=be.Va-1,be.Aa==2&&Ga(be,It),It.uc)for(_r=(Ot=be).D.M,e(Ot.D.uc),It=Ot.yb;It<Ot.Hb;++It){_n=It,kt=_r;var ir=(ar=(Fn=Ot).D).Nb;dn=Fn.R;var ar=ar.wa[ar.Y+_n],hr=Fn.sa,Wi=Fn.ta+16*ir*dn+16*_n,hn=ar.dd,pr=ar.tc;if(pr!=0)if(e(3<=pr),Fn.L==1)0<_n&&Xa(hr,Wi,dn,pr+4),ar.La&&$n(hr,Wi,dn,pr),0<kt&&Hs(hr,Wi,dn,pr+4),ar.La&&Fo(hr,Wi,dn,pr);else{var oa=Fn.B,$s=Fn.qa,Yo=Fn.ra+8*ir*oa+8*_n,Xs=Fn.Ha,Fn=Fn.Ia+8*ir*oa+8*_n;ir=ar.ld,0<_n&&(Ca(hr,Wi,dn,pr+4,hn,ir),Fs($s,Yo,Xs,Fn,oa,pr+4,hn,ir)),ar.La&&(zs(hr,Wi,dn,pr,hn,ir),Bl($s,Yo,Xs,Fn,oa,pr,hn,ir)),0<kt&&(Po(hr,Wi,dn,pr+4,hn,ir),Pl($s,Yo,Xs,Fn,oa,pr+4,hn,ir)),ar.La&&(Is(hr,Wi,dn,pr,hn,ir),Bo($s,Yo,Xs,Fn,oa,pr,hn,ir))}}if(be.ia&&alert("todo:DitherRow"),Ne.put!=null){if(It=16*sn,sn=16*(sn+1),Rr?(Ne.y=be.sa,Ne.O=be.ta+gn,Ne.f=be.qa,Ne.N=be.ra+rn,Ne.ea=be.Ha,Ne.W=be.Ia+rn):(It-=Yt,Ne.y=at,Ne.O=_t,Ne.f=ot,Ne.N=Ke,Ne.ea=an,Ne.W=fn),$t||(sn-=Yt),sn>Ne.o&&(sn=Ne.o),Ne.F=null,Ne.J=null,be.Fa!=null&&0<be.Fa.length&&It<sn&&(Ne.J=Uc(be,Ne,It,sn-It),Ne.F=be.mb,Ne.F==null&&Ne.F.length==0)){Xe=Vn(be,3,"Could not decode alpha data.");break e}It<Ne.j&&(Yt=Ne.j-It,It=Ne.j,e(!(1&Yt)),Ne.O+=be.R*Yt,Ne.N+=be.B*(Yt>>1),Ne.W+=be.B*(Yt>>1),Ne.F!=null&&(Ne.J+=Ne.width*Yt)),It<sn&&(Ne.O+=Ne.v,Ne.N+=Ne.v>>1,Ne.W+=Ne.v>>1,Ne.F!=null&&(Ne.J+=Ne.v),Ne.ka=It-Ne.j,Ne.U=Ne.va-Ne.v,Ne.T=sn-It,Xe=Ne.put(Ne))}Ie+1!=be.Ic||$t||(r(be.sa,be.ta-tt,at,_t+16*be.R,tt),r(be.qa,be.ra-ct,ot,Ke+8*be.B,ct),r(be.Ha,be.Ia-ct,an,fn+8*be.B,ct))}if(!Xe)return Vn(Ae,6,"Output aborted.")}return 1}(m,x)),x.bc!=null&&x.bc(x),M&=1}return M?(m.cb=0,M):0}function oi(m,x,M,D,B){B=m[x+M+32*D]+(B>>3),m[x+M+32*D]=-256&B?0>B?0:255:B}function xl(m,x,M,D,B,U){oi(m,x,0,M,D+B),oi(m,x,1,M,D+U),oi(m,x,2,M,D-U),oi(m,x,3,M,D-B)}function On(m){return(20091*m>>16)+m}function Lo(m,x,M,D){var B,U=0,Y=a(16);for(B=0;4>B;++B){var $=m[x+0]+m[x+8],ee=m[x+0]-m[x+8],re=(35468*m[x+4]>>16)-On(m[x+12]),ve=On(m[x+4])+(35468*m[x+12]>>16);Y[U+0]=$+ve,Y[U+1]=ee+re,Y[U+2]=ee-re,Y[U+3]=$-ve,U+=4,x++}for(B=U=0;4>B;++B)$=(m=Y[U+0]+4)+Y[U+8],ee=m-Y[U+8],re=(35468*Y[U+4]>>16)-On(Y[U+12]),oi(M,D,0,0,$+(ve=On(Y[U+4])+(35468*Y[U+12]>>16))),oi(M,D,1,0,ee+re),oi(M,D,2,0,ee-re),oi(M,D,3,0,$-ve),U++,D+=32}function jc(m,x,M,D){var B=m[x+0]+4,U=35468*m[x+4]>>16,Y=On(m[x+4]),$=35468*m[x+1]>>16;xl(M,D,0,B+Y,m=On(m[x+1]),$),xl(M,D,1,B+U,m,$),xl(M,D,2,B-U,m,$),xl(M,D,3,B-Y,m,$)}function Oc(m,x,M,D,B){Lo(m,x,M,D),B&&Lo(m,x+16,M,D+4)}function Ha(m,x,M,D){aa(m,x+0,M,D,1),aa(m,x+32,M,D+128,1)}function qu(m,x,M,D){var B;for(m=m[x+0]+4,B=0;4>B;++B)for(x=0;4>x;++x)oi(M,D,x,B,m)}function Tc(m,x,M,D){m[x+0]&&dr(m,x+0,M,D),m[x+16]&&dr(m,x+16,M,D+4),m[x+32]&&dr(m,x+32,M,D+128),m[x+48]&&dr(m,x+48,M,D+128+4)}function Cs(m,x,M,D){var B,U=a(16);for(B=0;4>B;++B){var Y=m[x+0+B]+m[x+12+B],$=m[x+4+B]+m[x+8+B],ee=m[x+4+B]-m[x+8+B],re=m[x+0+B]-m[x+12+B];U[0+B]=Y+$,U[8+B]=Y-$,U[4+B]=re+ee,U[12+B]=re-ee}for(B=0;4>B;++B)Y=(m=U[0+4*B]+3)+U[3+4*B],$=U[1+4*B]+U[2+4*B],ee=U[1+4*B]-U[2+4*B],re=m-U[3+4*B],M[D+0]=Y+$>>3,M[D+16]=re+ee>>3,M[D+32]=Y-$>>3,M[D+48]=re-ee>>3,D+=64}function Rc(m,x,M){var D,B=x-32,U=Or,Y=255-m[B-1];for(D=0;D<M;++D){var $,ee=U,re=Y+m[x-1];for($=0;$<M;++$)m[x+$]=ee[re+m[B+$]];x+=32}}function Wu(m,x){Rc(m,x,4)}function Yu(m,x){Rc(m,x,8)}function Pc(m,x){Rc(m,x,16)}function Ua(m,x){var M;for(M=0;16>M;++M)r(m,x+32*M,m,x-32,16)}function wl(m,x){var M;for(M=16;0<M;--M)i(m,x,m[x-1],16),x+=32}function qa(m,x,M){var D;for(D=0;16>D;++D)i(x,M+32*D,m,16)}function Sl(m,x){var M,D=16;for(M=0;16>M;++M)D+=m[x-1+32*M]+m[x+M-32];qa(D>>5,m,x)}function Er(m,x){var M,D=8;for(M=0;16>M;++M)D+=m[x-1+32*M];qa(D>>4,m,x)}function ks(m,x){var M,D=8;for(M=0;16>M;++M)D+=m[x+M-32];qa(D>>4,m,x)}function Wa(m,x){qa(128,m,x)}function Pt(m,x,M){return m+2*x+M+2>>2}function Bc(m,x){var M,D=x-32;for(D=new Uint8Array([Pt(m[D-1],m[D+0],m[D+1]),Pt(m[D+0],m[D+1],m[D+2]),Pt(m[D+1],m[D+2],m[D+3]),Pt(m[D+2],m[D+3],m[D+4])]),M=0;4>M;++M)r(m,x+32*M,D,0,D.length)}function Vu(m,x){var M=m[x-1],D=m[x-1+32],B=m[x-1+64],U=m[x-1+96];Ve(m,x+0,16843009*Pt(m[x-1-32],M,D)),Ve(m,x+32,16843009*Pt(M,D,B)),Ve(m,x+64,16843009*Pt(D,B,U)),Ve(m,x+96,16843009*Pt(B,U,U))}function li(m,x){var M,D=4;for(M=0;4>M;++M)D+=m[x+M-32]+m[x-1+32*M];for(D>>=3,M=0;4>M;++M)i(m,x+32*M,D,4)}function Fi(m,x){var M=m[x-1+0],D=m[x-1+32],B=m[x-1+64],U=m[x-1-32],Y=m[x+0-32],$=m[x+1-32],ee=m[x+2-32],re=m[x+3-32];m[x+0+96]=Pt(D,B,m[x-1+96]),m[x+1+96]=m[x+0+64]=Pt(M,D,B),m[x+2+96]=m[x+1+64]=m[x+0+32]=Pt(U,M,D),m[x+3+96]=m[x+2+64]=m[x+1+32]=m[x+0+0]=Pt(Y,U,M),m[x+3+64]=m[x+2+32]=m[x+1+0]=Pt($,Y,U),m[x+3+32]=m[x+2+0]=Pt(ee,$,Y),m[x+3+0]=Pt(re,ee,$)}function _l(m,x){var M=m[x+1-32],D=m[x+2-32],B=m[x+3-32],U=m[x+4-32],Y=m[x+5-32],$=m[x+6-32],ee=m[x+7-32];m[x+0+0]=Pt(m[x+0-32],M,D),m[x+1+0]=m[x+0+32]=Pt(M,D,B),m[x+2+0]=m[x+1+32]=m[x+0+64]=Pt(D,B,U),m[x+3+0]=m[x+2+32]=m[x+1+64]=m[x+0+96]=Pt(B,U,Y),m[x+3+32]=m[x+2+64]=m[x+1+96]=Pt(U,Y,$),m[x+3+64]=m[x+2+96]=Pt(Y,$,ee),m[x+3+96]=Pt($,ee,ee)}function wa(m,x){var M=m[x-1+0],D=m[x-1+32],B=m[x-1+64],U=m[x-1-32],Y=m[x+0-32],$=m[x+1-32],ee=m[x+2-32],re=m[x+3-32];m[x+0+0]=m[x+1+64]=U+Y+1>>1,m[x+1+0]=m[x+2+64]=Y+$+1>>1,m[x+2+0]=m[x+3+64]=$+ee+1>>1,m[x+3+0]=ee+re+1>>1,m[x+0+96]=Pt(B,D,M),m[x+0+64]=Pt(D,M,U),m[x+0+32]=m[x+1+96]=Pt(M,U,Y),m[x+1+32]=m[x+2+96]=Pt(U,Y,$),m[x+2+32]=m[x+3+96]=Pt(Y,$,ee),m[x+3+32]=Pt($,ee,re)}function Ii(m,x){var M=m[x+0-32],D=m[x+1-32],B=m[x+2-32],U=m[x+3-32],Y=m[x+4-32],$=m[x+5-32],ee=m[x+6-32],re=m[x+7-32];m[x+0+0]=M+D+1>>1,m[x+1+0]=m[x+0+64]=D+B+1>>1,m[x+2+0]=m[x+1+64]=B+U+1>>1,m[x+3+0]=m[x+2+64]=U+Y+1>>1,m[x+0+32]=Pt(M,D,B),m[x+1+32]=m[x+0+96]=Pt(D,B,U),m[x+2+32]=m[x+1+96]=Pt(B,U,Y),m[x+3+32]=m[x+2+96]=Pt(U,Y,$),m[x+3+64]=Pt(Y,$,ee),m[x+3+96]=Pt($,ee,re)}function Fc(m,x){var M=m[x-1+0],D=m[x-1+32],B=m[x-1+64],U=m[x-1+96];m[x+0+0]=M+D+1>>1,m[x+2+0]=m[x+0+32]=D+B+1>>1,m[x+2+32]=m[x+0+64]=B+U+1>>1,m[x+1+0]=Pt(M,D,B),m[x+3+0]=m[x+1+32]=Pt(D,B,U),m[x+3+32]=m[x+1+64]=Pt(B,U,U),m[x+3+64]=m[x+2+64]=m[x+0+96]=m[x+1+96]=m[x+2+96]=m[x+3+96]=U}function Nl(m,x){var M=m[x-1+0],D=m[x-1+32],B=m[x-1+64],U=m[x-1+96],Y=m[x-1-32],$=m[x+0-32],ee=m[x+1-32],re=m[x+2-32];m[x+0+0]=m[x+2+32]=M+Y+1>>1,m[x+0+32]=m[x+2+64]=D+M+1>>1,m[x+0+64]=m[x+2+96]=B+D+1>>1,m[x+0+96]=U+B+1>>1,m[x+3+0]=Pt($,ee,re),m[x+2+0]=Pt(Y,$,ee),m[x+1+0]=m[x+3+32]=Pt(M,Y,$),m[x+1+32]=m[x+3+64]=Pt(D,M,Y),m[x+1+64]=m[x+3+96]=Pt(B,D,M),m[x+1+96]=Pt(U,B,D)}function Gu(m,x){var M;for(M=0;8>M;++M)r(m,x+32*M,m,x-32,8)}function Ms(m,x){var M;for(M=0;8>M;++M)i(m,x,m[x-1],8),x+=32}function Sa(m,x,M){var D;for(D=0;8>D;++D)i(x,M+32*D,m,8)}function Ya(m,x){var M,D=8;for(M=0;8>M;++M)D+=m[x+M-32]+m[x-1+32*M];Sa(D>>4,m,x)}function Vr(m,x){var M,D=4;for(M=0;8>M;++M)D+=m[x+M-32];Sa(D>>3,m,x)}function ki(m,x){var M,D=4;for(M=0;8>M;++M)D+=m[x-1+32*M];Sa(D>>3,m,x)}function Ls(m,x){Sa(128,m,x)}function _a(m,x,M){var D=m[x-M],B=m[x+0],U=3*(B-D)+Ku[1020+m[x-2*M]-m[x+M]],Y=Io[112+(U+4>>3)];m[x-M]=Or[255+D+Io[112+(U+3>>3)]],m[x+0]=Or[255+B-Y]}function $u(m,x,M,D){var B=m[x+0],U=m[x+M];return Ui[255+m[x-2*M]-m[x-M]]>D||Ui[255+U-B]>D}function Al(m,x,M,D){return 4*Ui[255+m[x-M]-m[x+0]]+Ui[255+m[x-2*M]-m[x+M]]<=D}function Cl(m,x,M,D,B){var U=m[x-3*M],Y=m[x-2*M],$=m[x-M],ee=m[x+0],re=m[x+M],ve=m[x+2*M],je=m[x+3*M];return 4*Ui[255+$-ee]+Ui[255+Y-re]>D?0:Ui[255+m[x-4*M]-U]<=B&&Ui[255+U-Y]<=B&&Ui[255+Y-$]<=B&&Ui[255+je-ve]<=B&&Ui[255+ve-re]<=B&&Ui[255+re-ee]<=B}function Es(m,x,M,D){var B=2*D+1;for(D=0;16>D;++D)Al(m,x+D,M,B)&&_a(m,x+D,M)}function Mi(m,x,M,D){var B=2*D+1;for(D=0;16>D;++D)Al(m,x+D*M,1,B)&&_a(m,x+D*M,1)}function Na(m,x,M,D){var B;for(B=3;0<B;--B)Es(m,x+=4*M,M,D)}function dd(m,x,M,D){var B;for(B=3;0<B;--B)Mi(m,x+=4,M,D)}function Ds(m,x,M,D,B,U,Y,$){for(U=2*U+1;0<B--;){if(Cl(m,x,M,U,Y))if($u(m,x,M,$))_a(m,x,M);else{var ee=m,re=x,ve=M,je=ee[re-2*ve],Ee=ee[re-ve],Ae=ee[re+0],et=ee[re+ve],Ie=ee[re+2*ve],be=27*(Xe=Ku[1020+3*(Ae-Ee)+Ku[1020+je-et]])+63>>7,Ne=18*Xe+63>>7,Xe=9*Xe+63>>7;ee[re-3*ve]=Or[255+ee[re-3*ve]+Xe],ee[re-2*ve]=Or[255+je+Ne],ee[re-ve]=Or[255+Ee+be],ee[re+0]=Or[255+Ae-be],ee[re+ve]=Or[255+et-Ne],ee[re+2*ve]=Or[255+Ie-Xe]}x+=D}}function ta(m,x,M,D,B,U,Y,$){for(U=2*U+1;0<B--;){if(Cl(m,x,M,U,Y))if($u(m,x,M,$))_a(m,x,M);else{var ee=m,re=x,ve=M,je=ee[re-ve],Ee=ee[re+0],Ae=ee[re+ve],et=Io[112+((Ie=3*(Ee-je))+4>>3)],Ie=Io[112+(Ie+3>>3)],be=et+1>>1;ee[re-2*ve]=Or[255+ee[re-2*ve]+be],ee[re-ve]=Or[255+je+Ie],ee[re+0]=Or[255+Ee-et],ee[re+ve]=Or[255+Ae-be]}x+=D}}function Eo(m,x,M,D,B,U){Ds(m,x,M,1,16,D,B,U)}function Do(m,x,M,D,B,U){Ds(m,x,1,M,16,D,B,U)}function hd(m,x,M,D,B,U){var Y;for(Y=3;0<Y;--Y)ta(m,x+=4*M,M,1,16,D,B,U)}function kl(m,x,M,D,B,U){var Y;for(Y=3;0<Y;--Y)ta(m,x+=4,1,M,16,D,B,U)}function pd(m,x,M,D,B,U,Y,$){Ds(m,x,B,1,8,U,Y,$),Ds(M,D,B,1,8,U,Y,$)}function Ic(m,x,M,D,B,U,Y,$){Ds(m,x,1,B,8,U,Y,$),Ds(M,D,1,B,8,U,Y,$)}function Ml(m,x,M,D,B,U,Y,$){ta(m,x+4*B,B,1,8,U,Y,$),ta(M,D+4*B,B,1,8,U,Y,$)}function Xu(m,x,M,D,B,U,Y,$){ta(m,x+4,1,B,8,U,Y,$),ta(M,D+4,1,B,8,U,Y,$)}function Ll(){this.ba=new Yn,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new wn,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function zc(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Hc(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function El(){this.ua=0,this.Wa=new ue,this.vb=new ue,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new te,this.yc=new I}function md(){this.xb=this.a=0,this.l=new Ns,this.ca=new Yn,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new R,this.Pb=0,this.wd=new R,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new El,this.ab=0,this.gc=o(4,Hc),this.Oc=0}function Dl(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Ns,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function jo(m,x,M,D,B,U,Y){for(m=m==null?0:m[x+0],x=0;x<Y;++x)B[U+x]=m+M[D+x]&255,m=B[U+x]}function jl(m,x,M,D,B,U,Y){var $;if(m==null)jo(null,null,M,D,B,U,Y);else for($=0;$<Y;++$)B[U+$]=m[x+$]+M[D+$]&255}function js(m,x,M,D,B,U,Y){if(m==null)jo(null,null,M,D,B,U,Y);else{var $,ee=m[x+0],re=ee,ve=ee;for($=0;$<Y;++$)re=ve+(ee=m[x+$])-re,ve=M[D+$]+(-256&re?0>re?0:255:re)&255,re=ee,B[U+$]=ve}}function Uc(m,x,M,D){var B=x.width,U=x.o;if(e(m!=null&&x!=null),0>M||0>=D||M+D>U)return null;if(!m.Cc){if(m.ga==null){var Y;if(m.ga=new Dl,(Y=m.ga==null)||(Y=x.width*x.o,e(m.Gb.length==0),m.Gb=a(Y),m.Uc=0,m.Gb==null?Y=0:(m.mb=m.Gb,m.nb=m.Uc,m.rc=null,Y=1),Y=!Y),!Y){Y=m.ga;var $=m.Fa,ee=m.P,re=m.qc,ve=m.mb,je=m.nb,Ee=ee+1,Ae=re-1,et=Y.l;if(e($!=null&&ve!=null&&x!=null),La[0]=null,La[1]=jo,La[2]=jl,La[3]=js,Y.ca=ve,Y.tb=je,Y.c=x.width,Y.i=x.height,e(0<Y.c&&0<Y.i),1>=re)x=0;else if(Y.$a=$[ee+0]>>0&3,Y.Z=$[ee+0]>>2&3,Y.Lc=$[ee+0]>>4&3,ee=$[ee+0]>>6&3,0>Y.$a||1<Y.$a||4<=Y.Z||1<Y.Lc||ee)x=0;else if(et.put=_i,et.ac=Jn,et.bc=Pi,et.ma=Y,et.width=x.width,et.height=x.height,et.Da=x.Da,et.v=x.v,et.va=x.va,et.j=x.j,et.o=x.o,Y.$a)e:{e(Y.$a==1),x=Fr();t:for(;;){if(x==null){x=0;break e}if(e(Y!=null),Y.mc=x,x.c=Y.c,x.i=Y.i,x.l=Y.l,x.l.ma=Y,x.l.width=Y.c,x.l.height=Y.i,x.a=0,G(x.m,$,Ee,Ae),!Sn(Y.c,Y.i,1,x,null)||(x.ab==1&&x.gc[0].hc==3&&Ai(x.s)?(Y.ic=1,$=x.c*x.i,x.Ta=null,x.Ua=0,x.V=a($),x.Ba=0,x.V==null?(x.a=1,x=0):x=1):(Y.ic=0,x=_s(x,Y.c)),!x))break t;x=1;break e}Y.mc=null,x=0}else x=Ae>=Y.c*Y.i;Y=!x}if(Y)return null;m.ga.Lc!=1?m.Ga=0:D=U-M}e(m.ga!=null),e(M+D<=U);e:{if(x=($=m.ga).c,U=$.l.o,$.$a==0){if(Ee=m.rc,Ae=m.Vc,et=m.Fa,ee=m.P+1+M*x,re=m.mb,ve=m.nb+M*x,e(ee<=m.P+m.qc),$.Z!=0)for(e(La[$.Z]!=null),Y=0;Y<D;++Y)La[$.Z](Ee,Ae,et,ee,re,ve,x),Ee=re,Ae=ve,ve+=x,ee+=x;else for(Y=0;Y<D;++Y)r(re,ve,et,ee,x),Ee=re,Ae=ve,ve+=x,ee+=x;m.rc=Ee,m.Vc=Ae}else{if(e($.mc!=null),x=M+D,e((Y=$.mc)!=null),e(x<=Y.i),Y.C>=x)x=1;else if($.ic||Me(),$.ic){$=Y.V,Ee=Y.Ba,Ae=Y.c;var Ie=Y.i,be=(et=1,ee=Y.$/Ae,re=Y.$%Ae,ve=Y.m,je=Y.s,Y.$),Ne=Ae*Ie,Xe=Ae*x,tt=je.wc,Ke=be<Xe?fr(je,re,ee):null;e(be<=Ne),e(x<=Ie),e(Ai(je));t:for(;;){for(;!ve.h&&be<Xe;){if(re&tt||(Ke=fr(je,re,ee)),e(Ke!=null),ce(ve),256>(Ie=vr(Ke.G[0],Ke.H[0],ve)))$[Ee+be]=Ie,++be,++re>=Ae&&(re=0,++ee<=x&&!(ee%16)&&Wr(Y,ee));else{if(!(280>Ie)){et=0;break t}Ie=un(Ie-256,ve);var ct,at=vr(Ke.G[4],Ke.H[4],ve);if(ce(ve),!(be>=(at=zn(Ae,at=un(at,ve)))&&Ne-be>=Ie)){et=0;break t}for(ct=0;ct<Ie;++ct)$[Ee+be+ct]=$[Ee+be+ct-at];for(be+=Ie,re+=Ie;re>=Ae;)re-=Ae,++ee<=x&&!(ee%16)&&Wr(Y,ee);be<Xe&&re&tt&&(Ke=fr(je,re,ee))}e(ve.h==Q(ve))}Wr(Y,ee>x?x:ee);break t}!et||ve.h&&be<Ne?(et=0,Y.a=ve.h?5:3):Y.$=be,x=et}else x=Yr(Y,Y.V,Y.Ba,Y.c,Y.i,x,Co);if(!x){D=0;break e}}M+D>=U&&(m.Cc=1),D=1}if(!D)return null;if(m.Cc&&((D=m.ga)!=null&&(D.mc=null),m.ga=null,0<m.Ga))return alert("todo:WebPDequantizeLevels"),null}return m.nb+M*B}function A(m,x,M,D,B,U){for(;0<B--;){var Y,$=m,ee=x+(M?1:0),re=m,ve=x+(M?0:3);for(Y=0;Y<D;++Y){var je=re[ve+4*Y];je!=255&&(je*=32897,$[ee+4*Y+0]=$[ee+4*Y+0]*je>>23,$[ee+4*Y+1]=$[ee+4*Y+1]*je>>23,$[ee+4*Y+2]=$[ee+4*Y+2]*je>>23)}x+=U}}function F(m,x,M,D,B){for(;0<D--;){var U;for(U=0;U<M;++U){var Y=m[x+2*U+0],$=15&(re=m[x+2*U+1]),ee=4369*$,re=(240&re|re>>4)*ee>>16;m[x+2*U+0]=(240&Y|Y>>4)*ee>>16&240|(15&Y|Y<<4)*ee>>16>>4&15,m[x+2*U+1]=240&re|$}x+=B}}function oe(m,x,M,D,B,U,Y,$){var ee,re,ve=255;for(re=0;re<B;++re){for(ee=0;ee<D;++ee){var je=m[x+ee];U[Y+4*ee]=je,ve&=je}x+=M,Y+=$}return ve!=255}function ge(m,x,M,D,B){var U;for(U=0;U<B;++U)M[D+U]=m[x+U]>>8}function Me(){Ei=A,Xt=F,Zt=oe,Mn=ge}function Ye(m,x,M){H[m]=function(D,B,U,Y,$,ee,re,ve,je,Ee,Ae,et,Ie,be,Ne,Xe,tt){var Ke,ct=tt-1>>1,at=$[ee+0]|re[ve+0]<<16,_t=je[Ee+0]|Ae[et+0]<<16;e(D!=null);var ot=3*at+_t+131074>>2;for(x(D[B+0],255&ot,ot>>16,Ie,be),U!=null&&(ot=3*_t+at+131074>>2,x(U[Y+0],255&ot,ot>>16,Ne,Xe)),Ke=1;Ke<=ct;++Ke){var an=$[ee+Ke]|re[ve+Ke]<<16,fn=je[Ee+Ke]|Ae[et+Ke]<<16,$t=at+an+_t+fn+524296,Yt=$t+2*(an+_t)>>3;ot=Yt+at>>1,at=($t=$t+2*(at+fn)>>3)+an>>1,x(D[B+2*Ke-1],255&ot,ot>>16,Ie,be+(2*Ke-1)*M),x(D[B+2*Ke-0],255&at,at>>16,Ie,be+(2*Ke-0)*M),U!=null&&(ot=$t+_t>>1,at=Yt+fn>>1,x(U[Y+2*Ke-1],255&ot,ot>>16,Ne,Xe+(2*Ke-1)*M),x(U[Y+2*Ke+0],255&at,at>>16,Ne,Xe+(2*Ke+0)*M)),at=an,_t=fn}1&tt||(ot=3*at+_t+131074>>2,x(D[B+tt-1],255&ot,ot>>16,Ie,be+(tt-1)*M),U!=null&&(ot=3*_t+at+131074>>2,x(U[Y+tt-1],255&ot,ot>>16,Ne,Xe+(tt-1)*M)))}}function rt(){Tr[Gr]=ns,Tr[Fl]=Ea,Tr[ka]=Vs,Tr[Vc]=ef,Tr[zo]=tf,Tr[Ka]=Hl,Tr[Qu]=nf,Tr[Gc]=Ea,Tr[Ws]=ef,Tr[Qa]=tf,Tr[Il]=Hl}function lt(m){return m&-16384?0>m?0:255:m>>Vg}function St(m,x){return lt((19077*m>>8)+(26149*x>>8)-14234)}function zt(m,x,M){return lt((19077*m>>8)-(6419*x>>8)-(13320*M>>8)+8708)}function Ft(m,x){return lt((19077*m>>8)+(33050*x>>8)-17685)}function Jt(m,x,M,D,B){D[B+0]=St(m,M),D[B+1]=zt(m,x,M),D[B+2]=Ft(m,x)}function Bn(m,x,M,D,B){D[B+0]=Ft(m,x),D[B+1]=zt(m,x,M),D[B+2]=St(m,M)}function Hn(m,x,M,D,B){var U=zt(m,x,M);x=U<<3&224|Ft(m,x)>>3,D[B+0]=248&St(m,M)|U>>5,D[B+1]=x}function tr(m,x,M,D,B){var U=240&Ft(m,x)|15;D[B+0]=240&St(m,M)|zt(m,x,M)>>4,D[B+1]=U}function nr(m,x,M,D,B){D[B+0]=255,Jt(m,x,M,D,B+1)}function Dr(m,x,M,D,B){Bn(m,x,M,D,B),D[B+3]=255}function na(m,x,M,D,B){Jt(m,x,M,D,B),D[B+3]=255}function Li(m,x){return 0>m?0:m>x?x:m}function ra(m,x,M){H[m]=function(D,B,U,Y,$,ee,re,ve,je){for(var Ee=ve+(-2&je)*M;ve!=Ee;)x(D[B+0],U[Y+0],$[ee+0],re,ve),x(D[B+1],U[Y+0],$[ee+0],re,ve+M),B+=2,++Y,++ee,ve+=2*M;1&je&&x(D[B+0],U[Y+0],$[ee+0],re,ve)}}function qc(m,x,M){return M==0?m==0?x==0?6:5:x==0?4:0:M}function Va(m,x,M,D,B){switch(m>>>30){case 3:aa(x,M,D,B,0);break;case 2:Gn(x,M,D,B);break;case 1:dr(x,M,D,B)}}function Ga(m,x){var M,D,B=x.M,U=x.Nb,Y=m.oc,$=m.pc+40,ee=m.oc,re=m.pc+584,ve=m.oc,je=m.pc+600;for(M=0;16>M;++M)Y[$+32*M-1]=129;for(M=0;8>M;++M)ee[re+32*M-1]=129,ve[je+32*M-1]=129;for(0<B?Y[$-1-32]=ee[re-1-32]=ve[je-1-32]=129:(i(Y,$-32-1,127,21),i(ee,re-32-1,127,9),i(ve,je-32-1,127,9)),D=0;D<m.za;++D){var Ee=x.ya[x.aa+D];if(0<D){for(M=-1;16>M;++M)r(Y,$+32*M-4,Y,$+32*M+12,4);for(M=-1;8>M;++M)r(ee,re+32*M-4,ee,re+32*M+4,4),r(ve,je+32*M-4,ve,je+32*M+4,4)}var Ae=m.Gd,et=m.Hd+D,Ie=Ee.ad,be=Ee.Hc;if(0<B&&(r(Y,$-32,Ae[et].y,0,16),r(ee,re-32,Ae[et].f,0,8),r(ve,je-32,Ae[et].ea,0,8)),Ee.Za){var Ne=Y,Xe=$-32+16;for(0<B&&(D>=m.za-1?i(Ne,Xe,Ae[et].y[15],4):r(Ne,Xe,Ae[et+1].y,0,4)),M=0;4>M;M++)Ne[Xe+128+M]=Ne[Xe+256+M]=Ne[Xe+384+M]=Ne[Xe+0+M];for(M=0;16>M;++M,be<<=2)Ne=Y,Xe=$+Wo[M],ti[Ee.Ob[M]](Ne,Xe),Va(be,Ie,16*+M,Ne,Xe)}else if(Ne=qc(D,B,Ee.Ob[0]),ts[Ne](Y,$),be!=0)for(M=0;16>M;++M,be<<=2)Va(be,Ie,16*+M,Y,$+Wo[M]);for(M=Ee.Gc,Ne=qc(D,B,Ee.Dd),ji[Ne](ee,re),ji[Ne](ve,je),be=Ie,Ne=ee,Xe=re,255&(Ee=M>>0)&&(170&Ee?sa(be,256,Ne,Xe):fi(be,256,Ne,Xe)),Ee=ve,be=je,255&(M>>=8)&&(170&M?sa(Ie,320,Ee,be):fi(Ie,320,Ee,be)),B<m.Ub-1&&(r(Ae[et].y,0,Y,$+480,16),r(Ae[et].f,0,ee,re+224,8),r(Ae[et].ea,0,ve,je+224,8)),M=8*U*m.B,Ae=m.sa,et=m.ta+16*D+16*U*m.R,Ie=m.qa,Ee=m.ra+8*D+M,be=m.Ha,Ne=m.Ia+8*D+M,M=0;16>M;++M)r(Ae,et+M*m.R,Y,$+32*M,16);for(M=0;8>M;++M)r(Ie,Ee+M*m.B,ee,re+32*M,8),r(be,Ne+M*m.B,ve,je+32*M,8)}}function Ol(m,x,M,D,B,U,Y,$,ee){var re=[0],ve=[0],je=0,Ee=ee!=null?ee.kd:0,Ae=ee??new zc;if(m==null||12>M)return 7;Ae.data=m,Ae.w=x,Ae.ha=M,x=[x],M=[M],Ae.gb=[Ae.gb];e:{var et=x,Ie=M,be=Ae.gb;if(e(m!=null),e(Ie!=null),e(be!=null),be[0]=0,12<=Ie[0]&&!n(m,et[0],"RIFF")){if(n(m,et[0]+8,"WEBP")){be=3;break e}var Ne=it(m,et[0]+4);if(12>Ne||4294967286<Ne){be=3;break e}if(Ee&&Ne>Ie[0]-8){be=7;break e}be[0]=Ne,et[0]+=12,Ie[0]-=12}be=0}if(be!=0)return be;for(Ne=0<Ae.gb[0],M=M[0];;){e:{var Xe=m;Ie=x,be=M;var tt=re,Ke=ve,ct=et=[0];if((ot=je=[je])[0]=0,8>be[0])be=7;else{if(!n(Xe,Ie[0],"VP8X")){if(it(Xe,Ie[0]+4)!=10){be=3;break e}if(18>be[0]){be=7;break e}var at=it(Xe,Ie[0]+8),_t=1+Je(Xe,Ie[0]+12);if(2147483648<=_t*(Xe=1+Je(Xe,Ie[0]+15))){be=3;break e}ct!=null&&(ct[0]=at),tt!=null&&(tt[0]=_t),Ke!=null&&(Ke[0]=Xe),Ie[0]+=18,be[0]-=18,ot[0]=1}be=0}}if(je=je[0],et=et[0],be!=0)return be;if(Ie=!!(2&et),!Ne&&je)return 3;if(U!=null&&(U[0]=!!(16&et)),Y!=null&&(Y[0]=Ie),$!=null&&($[0]=0),Y=re[0],et=ve[0],je&&Ie&&ee==null){be=0;break}if(4>M){be=7;break}if(Ne&&je||!Ne&&!je&&!n(m,x[0],"ALPH")){M=[M],Ae.na=[Ae.na],Ae.P=[Ae.P],Ae.Sa=[Ae.Sa];e:{at=m,be=x,Ne=M;var ot=Ae.gb;tt=Ae.na,Ke=Ae.P,ct=Ae.Sa,_t=22,e(at!=null),e(Ne!=null),Xe=be[0];var an=Ne[0];for(e(tt!=null),e(ct!=null),tt[0]=null,Ke[0]=null,ct[0]=0;;){if(be[0]=Xe,Ne[0]=an,8>an){be=7;break e}var fn=it(at,Xe+4);if(4294967286<fn){be=3;break e}var $t=8+fn+1&-2;if(_t+=$t,0<ot&&_t>ot){be=3;break e}if(!n(at,Xe,"VP8 ")||!n(at,Xe,"VP8L")){be=0;break e}if(an[0]<$t){be=7;break e}n(at,Xe,"ALPH")||(tt[0]=at,Ke[0]=Xe+8,ct[0]=fn),Xe+=$t,an-=$t}}if(M=M[0],Ae.na=Ae.na[0],Ae.P=Ae.P[0],Ae.Sa=Ae.Sa[0],be!=0)break}M=[M],Ae.Ja=[Ae.Ja],Ae.xa=[Ae.xa];e:if(ot=m,be=x,Ne=M,tt=Ae.gb[0],Ke=Ae.Ja,ct=Ae.xa,at=be[0],Xe=!n(ot,at,"VP8 "),_t=!n(ot,at,"VP8L"),e(ot!=null),e(Ne!=null),e(Ke!=null),e(ct!=null),8>Ne[0])be=7;else{if(Xe||_t){if(ot=it(ot,at+4),12<=tt&&ot>tt-12){be=3;break e}if(Ee&&ot>Ne[0]-8){be=7;break e}Ke[0]=ot,be[0]+=8,Ne[0]-=8,ct[0]=_t}else ct[0]=5<=Ne[0]&&ot[at+0]==47&&!(ot[at+4]>>5),Ke[0]=Ne[0];be=0}if(M=M[0],Ae.Ja=Ae.Ja[0],Ae.xa=Ae.xa[0],x=x[0],be!=0)break;if(4294967286<Ae.Ja)return 3;if($==null||Ie||($[0]=Ae.xa?2:1),Y=[Y],et=[et],Ae.xa){if(5>M){be=7;break}$=Y,Ee=et,Ie=U,m==null||5>M?m=0:5<=M&&m[x+0]==47&&!(m[x+4]>>5)?(Ne=[0],ot=[0],tt=[0],G(Ke=new R,m,x,M),xt(Ke,Ne,ot,tt)?($!=null&&($[0]=Ne[0]),Ee!=null&&(Ee[0]=ot[0]),Ie!=null&&(Ie[0]=tt[0]),m=1):m=0):m=0}else{if(10>M){be=7;break}$=et,m==null||10>M||!Jr(m,x+3,M-3)?m=0:(Ee=m[x+0]|m[x+1]<<8|m[x+2]<<16,Ie=16383&(m[x+7]<<8|m[x+6]),m=16383&(m[x+9]<<8|m[x+8]),1&Ee||3<(Ee>>1&7)||!(Ee>>4&1)||Ee>>5>=Ae.Ja||!Ie||!m?m=0:(Y&&(Y[0]=Ie),$&&($[0]=m),m=1))}if(!m||(Y=Y[0],et=et[0],je&&(re[0]!=Y||ve[0]!=et)))return 3;ee!=null&&(ee[0]=Ae,ee.offset=x-ee.w,e(4294967286>x-ee.w),e(ee.offset==ee.ha-M));break}return be==0||be==7&&je&&ee==null?(U!=null&&(U[0]|=Ae.na!=null&&0<Ae.na.length),D!=null&&(D[0]=Y),B!=null&&(B[0]=et),0):be}function Os(m,x,M){var D=x.width,B=x.height,U=0,Y=0,$=D,ee=B;if(x.Da=m!=null&&0<m.Da,x.Da&&($=m.cd,ee=m.bd,U=m.v,Y=m.j,11>M||(U&=-2,Y&=-2),0>U||0>Y||0>=$||0>=ee||U+$>D||Y+ee>B))return 0;if(x.v=U,x.j=Y,x.va=U+$,x.o=Y+ee,x.U=$,x.T=ee,x.da=m!=null&&0<m.da,x.da){if(!pt($,ee,M=[m.ib],U=[m.hb]))return 0;x.ib=M[0],x.hb=U[0]}return x.ob=m!=null&&m.ob,x.Kb=m==null||!m.Sd,x.da&&(x.ob=x.ib<3*D/4&&x.hb<3*B/4,x.Kb=0),1}function Tl(m){if(m==null)return 2;if(11>m.S){var x=m.f.RGBA;x.fb+=(m.height-1)*x.A,x.A=-x.A}else x=m.f.kb,m=m.height,x.O+=(m-1)*x.fa,x.fa=-x.fa,x.N+=(m-1>>1)*x.Ab,x.Ab=-x.Ab,x.W+=(m-1>>1)*x.Db,x.Db=-x.Db,x.F!=null&&(x.J+=(m-1)*x.lb,x.lb=-x.lb);return 0}function Oo(m,x,M,D){if(D==null||0>=m||0>=x)return 2;if(M!=null){if(M.Da){var B=M.cd,U=M.bd,Y=-2&M.v,$=-2&M.j;if(0>Y||0>$||0>=B||0>=U||Y+B>m||$+U>x)return 2;m=B,x=U}if(M.da){if(!pt(m,x,B=[M.ib],U=[M.hb]))return 2;m=B[0],x=U[0]}}D.width=m,D.height=x;e:{var ee=D.width,re=D.height;if(m=D.S,0>=ee||0>=re||!(m>=Gr&&13>m))m=2;else{if(0>=D.Rd&&D.sd==null){Y=U=B=x=0;var ve=($=ee*ip[m])*re;if(11>m||(U=(re+1)/2*(x=(ee+1)/2),m==12&&(Y=(B=ee)*re)),(re=a(ve+2*U+Y))==null){m=1;break e}D.sd=re,11>m?((ee=D.f.RGBA).eb=re,ee.fb=0,ee.A=$,ee.size=ve):((ee=D.f.kb).y=re,ee.O=0,ee.fa=$,ee.Fd=ve,ee.f=re,ee.N=0+ve,ee.Ab=x,ee.Cd=U,ee.ea=re,ee.W=0+ve+U,ee.Db=x,ee.Ed=U,m==12&&(ee.F=re,ee.J=0+ve+2*U),ee.Tc=Y,ee.lb=B)}if(x=1,B=D.S,U=D.width,Y=D.height,B>=Gr&&13>B)if(11>B)m=D.f.RGBA,x&=($=Math.abs(m.A))*(Y-1)+U<=m.size,x&=$>=U*ip[B],x&=m.eb!=null;else{m=D.f.kb,$=(U+1)/2,ve=(Y+1)/2,ee=Math.abs(m.fa),re=Math.abs(m.Ab);var je=Math.abs(m.Db),Ee=Math.abs(m.lb),Ae=Ee*(Y-1)+U;x&=ee*(Y-1)+U<=m.Fd,x&=re*(ve-1)+$<=m.Cd,x=(x&=je*(ve-1)+$<=m.Ed)&ee>=U&re>=$&je>=$,x&=m.y!=null,x&=m.f!=null,x&=m.ea!=null,B==12&&(x&=Ee>=U,x&=Ae<=m.Tc,x&=m.F!=null)}else x=0;m=x?0:2}}return m!=0||M!=null&&M.fd&&(m=Tl(D)),m}var br=64,Ts=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],To=24,Ro=32,Rl=8,ci=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Ce("Predictor0","PredictorAdd0"),H.Predictor0=function(){return 4278190080},H.Predictor1=function(m){return m},H.Predictor2=function(m,x,M){return x[M+0]},H.Predictor3=function(m,x,M){return x[M+1]},H.Predictor4=function(m,x,M){return x[M-1]},H.Predictor5=function(m,x,M){return Ge(Ge(m,x[M+1]),x[M+0])},H.Predictor6=function(m,x,M){return Ge(m,x[M-1])},H.Predictor7=function(m,x,M){return Ge(m,x[M+0])},H.Predictor8=function(m,x,M){return Ge(x[M-1],x[M+0])},H.Predictor9=function(m,x,M){return Ge(x[M+0],x[M+1])},H.Predictor10=function(m,x,M){return Ge(Ge(m,x[M-1]),Ge(x[M+0],x[M+1]))},H.Predictor11=function(m,x,M){var D=x[M+0];return 0>=ye(D>>24&255,m>>24&255,(x=x[M-1])>>24&255)+ye(D>>16&255,m>>16&255,x>>16&255)+ye(D>>8&255,m>>8&255,x>>8&255)+ye(255&D,255&m,255&x)?D:m},H.Predictor12=function(m,x,M){var D=x[M+0];return(Ue((m>>24&255)+(D>>24&255)-((x=x[M-1])>>24&255))<<24|Ue((m>>16&255)+(D>>16&255)-(x>>16&255))<<16|Ue((m>>8&255)+(D>>8&255)-(x>>8&255))<<8|Ue((255&m)+(255&D)-(255&x)))>>>0},H.Predictor13=function(m,x,M){var D=x[M-1];return(ie((m=Ge(m,x[M+0]))>>24&255,D>>24&255)<<24|ie(m>>16&255,D>>16&255)<<16|ie(m>>8&255,D>>8&255)<<8|ie(m>>0&255,D>>0&255))>>>0};var gd=H.PredictorAdd0;H.PredictorAdd1=Be,Ce("Predictor2","PredictorAdd2"),Ce("Predictor3","PredictorAdd3"),Ce("Predictor4","PredictorAdd4"),Ce("Predictor5","PredictorAdd5"),Ce("Predictor6","PredictorAdd6"),Ce("Predictor7","PredictorAdd7"),Ce("Predictor8","PredictorAdd8"),Ce("Predictor9","PredictorAdd9"),Ce("Predictor10","PredictorAdd10"),Ce("Predictor11","PredictorAdd11"),Ce("Predictor12","PredictorAdd12"),Ce("Predictor13","PredictorAdd13");var Wc=H.PredictorAdd2;ft("ColorIndexInverseTransform","MapARGB","32b",function(m){return m>>8&255},function(m){return m}),ft("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(m){return m},function(m){return m>>8&255});var Zu,zi=H.ColorIndexInverseTransform,jr=H.MapARGB,Rs=H.VP8LColorIndexInverseTransformAlpha,Yc=H.MapAlpha,$a=H.VP8LPredictorsAdd=[];$a.length=16,(H.VP8LPredictors=[]).length=16,(H.VP8LPredictorsAdd_C=[]).length=16,(H.VP8LPredictors_C=[]).length=16;var Ps,ei,Ir,Bs,ui,ia,Aa,aa,Gn,sa,dr,fi,Po,Ca,Pl,Fs,Is,zs,Bo,Bl,Hs,Xa,Fo,$n,Ei,Xt,Zt,Mn,rr=a(511),Hi=a(2041),Us=a(225),qs=a(767),Za=0,Ku=Hi,Io=Us,Or=qs,Ui=rr,Gr=0,Fl=1,ka=2,Vc=3,zo=4,Ka=5,Qu=6,Gc=7,Ws=8,Qa=9,Il=10,Ju=[2,3,7],qi=[3,3,11],Di=[280,256,256,256,40],Ho=[0,1,1,1,0],Ja=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],es=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Uo=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Jh=8,$c=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Xc=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],xr=null,Xn=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],cn=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Ys=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Ma=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],yd=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],qo=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],ep=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ts=[],ti=[],ji=[],tp=1,zl=2,La=[],Tr=[];Ye("UpsampleRgbLinePair",Jt,3),Ye("UpsampleBgrLinePair",Bn,3),Ye("UpsampleRgbaLinePair",na,4),Ye("UpsampleBgraLinePair",Dr,4),Ye("UpsampleArgbLinePair",nr,4),Ye("UpsampleRgba4444LinePair",tr,2),Ye("UpsampleRgb565LinePair",Hn,2);var ns=H.UpsampleRgbLinePair,Vs=H.UpsampleBgrLinePair,Ea=H.UpsampleRgbaLinePair,ef=H.UpsampleBgraLinePair,tf=H.UpsampleArgbLinePair,Hl=H.UpsampleRgba4444LinePair,nf=H.UpsampleRgb565LinePair,Da=16,wr=1<<Da-1,Gs=-227,rf=482,Vg=6,np=0,Gg=a(256),Sr=a(256),vd=a(256),Zc=a(256),Kc=a(rf-Gs),bd=a(rf-Gs);ra("YuvToRgbRow",Jt,3),ra("YuvToBgrRow",Bn,3),ra("YuvToRgbaRow",na,4),ra("YuvToBgraRow",Dr,4),ra("YuvToArgbRow",nr,4),ra("YuvToRgba4444Row",tr,2),ra("YuvToRgb565Row",Hn,2);var Wo=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],rs=[0,2,8],$g=[8,7,6,4,4,2,2,2,1,1,1,1],rp=1;this.WebPDecodeRGBA=function(m,x,M,D,B){var U=Fl,Y=new Ll,$=new Yn;Y.ba=$,$.S=U,$.width=[$.width],$.height=[$.height];var ee=$.width,re=$.height,ve=new jn;if(ve==null||m==null)var je=2;else e(ve!=null),je=Ol(m,x,M,ve.width,ve.height,ve.Pd,ve.Qd,ve.format,null);if(je!=0?ee=0:(ee!=null&&(ee[0]=ve.width[0]),re!=null&&(re[0]=ve.height[0]),ee=1),ee){$.width=$.width[0],$.height=$.height[0],D!=null&&(D[0]=$.width),B!=null&&(B[0]=$.height);e:{if(D=new Ns,(B=new zc).data=m,B.w=x,B.ha=M,B.kd=1,x=[0],e(B!=null),((m=Ol(B.data,B.w,B.ha,null,null,null,x,null,B))==0||m==7)&&x[0]&&(m=4),(x=m)==0){if(e(Y!=null),D.data=B.data,D.w=B.w+B.offset,D.ha=B.ha-B.offset,D.put=_i,D.ac=Jn,D.bc=Pi,D.ma=Y,B.xa){if((m=Fr())==null){Y=1;break e}if(function(Ee,Ae){var et=[0],Ie=[0],be=[0];t:for(;;){if(Ee==null)return 0;if(Ae==null)return Ee.a=2,0;if(Ee.l=Ae,Ee.a=0,G(Ee.m,Ae.data,Ae.w,Ae.ha),!xt(Ee.m,et,Ie,be)){Ee.a=3;break t}if(Ee.xb=zl,Ae.width=et[0],Ae.height=Ie[0],!Sn(et[0],Ie[0],1,Ee,null))break t;return 1}return e(Ee.a!=0),0}(m,D)){if(D=(x=Oo(D.width,D.height,Y.Oa,Y.ba))==0){t:{D=m;n:for(;;){if(D==null){D=0;break t}if(e(D.s.yc!=null),e(D.s.Ya!=null),e(0<D.s.Wb),e((M=D.l)!=null),e((B=M.ma)!=null),D.xb!=0){if(D.ca=B.ba,D.tb=B.tb,e(D.ca!=null),!Os(B.Oa,M,Vc)){D.a=2;break n}if(!_s(D,M.width)||M.da)break n;if((M.da||ut(D.ca.S))&&Me(),11>D.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),D.ca.f.kb.F!=null&&Me()),D.Pb&&0<D.s.ua&&D.s.vb.X==null&&!dt(D.s.vb,D.s.Wa.Xa)){D.a=1;break n}D.xb=0}if(!Yr(D,D.V,D.Ba,D.c,D.i,M.o,Ao))break n;B.Dc=D.Ma,D=1;break t}e(D.a!=0),D=0}D=!D}D&&(x=m.a)}else x=m.a}else{if((m=new fd)==null){Y=1;break e}if(m.Fa=B.na,m.P=B.P,m.qc=B.Sa,Dc(m,D)){if((x=Oo(D.width,D.height,Y.Oa,Y.ba))==0){if(m.Aa=0,M=Y.Oa,e((B=m)!=null),M!=null){if(0<(ee=0>(ee=M.Md)?0:100<ee?255:255*ee/100)){for(re=ve=0;4>re;++re)12>(je=B.pb[re]).lc&&(je.ia=ee*$g[0>je.lc?0:je.lc]>>3),ve|=je.ia;ve&&(alert("todo:VP8InitRandom"),B.ia=1)}B.Ga=M.Id,100<B.Ga?B.Ga=100:0>B.Ga&&(B.Ga=0)}Uu(m,D)||(x=m.a)}}else x=m.a}x==0&&Y.Oa!=null&&Y.Oa.fd&&(x=Tl(Y.ba))}Y=x}U=Y!=0?null:11>U?$.f.RGBA.eb:$.f.kb.y}else U=null;return U};var ip=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function d(H,se){for(var le="",P=0;P<4;P++)le+=String.fromCharCode(H[se++]);return le}function p(H,se){return(H[se+0]<<0|H[se+1]<<8|H[se+2]<<16)>>>0}function g(H,se){return(H[se+0]<<0|H[se+1]<<8|H[se+2]<<16|H[se+3]<<24)>>>0}new f;var b=[0],y=[0],N=[],w=new f,k=t,C=function(H,se){var le={},P=0,I=!1,ne=0,te=0;if(le.frames=[],!function(V,Q,ae,ce){for(var he=0;he<ce;he++)if(V[Q+he]!=ae.charCodeAt(he))return!0;return!1}(H,se,"RIFF",4)){for(g(H,se+=4),se+=8;se<H.length;){var de=d(H,se),X=g(H,se+=4);se+=4;var J=X+(1&X);switch(de){case"VP8 ":case"VP8L":le.frames[P]===void 0&&(le.frames[P]={}),(W=le.frames[P]).src_off=I?te:se-8,W.src_size=ne+X+8,P++,I&&(I=!1,ne=0,te=0);break;case"VP8X":(W=le.header={}).feature_flags=H[se];var G=se+4;W.canvas_width=1+p(H,G),G+=3,W.canvas_height=1+p(H,G),G+=3;break;case"ALPH":I=!0,ne=J+8,te=se-8;break;case"ANIM":(W=le.header).bgcolor=g(H,se),G=se+4,W.loop_count=(xe=H)[(R=G)+0]<<0|xe[R+1]<<8,G+=2;break;case"ANMF":var me,W;(W=le.frames[P]={}).offset_x=2*p(H,se),se+=3,W.offset_y=2*p(H,se),se+=3,W.width=1+p(H,se),se+=3,W.height=1+p(H,se),se+=3,W.duration=p(H,se),se+=3,me=H[se++],W.dispose=1&me,W.blend=me>>1&1}de!="ANMF"&&(se+=J)}var xe,R;return le}}(k,0);C.response=k,C.rgbaoutput=!0,C.dataurl=!1;var L=C.header?C.header:null,j=C.frames?C.frames:null;if(L){L.loop_counter=L.loop_count,b=[L.canvas_height],y=[L.canvas_width];for(var z=0;z<j.length&&j[z].blend!=0;z++);}var O=j[0],K=w.WebPDecodeRGBA(k,O.src_off,O.src_size,y,b);O.rgba=K,O.imgwidth=y[0],O.imgheight=b[0];for(var q=0;q<y[0]*b[0]*4;q++)N[q]=K[q];return this.width=y,this.height=b,this.data=N,this}(function(t){var e=function(){return typeof R2=="function"},n=function(b,y,N,w){var k=4,C=o;switch(w){case t.image_compression.FAST:k=1,C=a;break;case t.image_compression.MEDIUM:k=6,C=c;break;case t.image_compression.SLOW:k=9,C=f}b=r(b,y,N,C);var L=R2(b,{level:k});return t.__addimage__.arrayBufferToBinaryString(L)},r=function(b,y,N,w){for(var k,C,L,j=b.length/y,z=new Uint8Array(b.length+j),O=p(),K=0;K<j;K+=1){if(L=K*y,k=b.subarray(L,L+y),w)z.set(w(k,N,C),L+K);else{for(var q,H=O.length,se=[];q<H;q+=1)se[q]=O[q](k,N,C);var le=g(se.concat());z.set(se[le],L+K)}C=k}return z},i=function(b){var y=Array.apply([],b);return y.unshift(0),y},a=function(b,y){var N,w=[],k=b.length;w[0]=1;for(var C=0;C<k;C+=1)N=b[C-y]||0,w[C+1]=b[C]-N+256&255;return w},o=function(b,y,N){var w,k=[],C=b.length;k[0]=2;for(var L=0;L<C;L+=1)w=N&&N[L]||0,k[L+1]=b[L]-w+256&255;return k},c=function(b,y,N){var w,k,C=[],L=b.length;C[0]=3;for(var j=0;j<L;j+=1)w=b[j-y]||0,k=N&&N[j]||0,C[j+1]=b[j]+256-(w+k>>>1)&255;return C},f=function(b,y,N){var w,k,C,L,j=[],z=b.length;j[0]=4;for(var O=0;O<z;O+=1)w=b[O-y]||0,k=N&&N[O]||0,C=N&&N[O-y]||0,L=d(w,k,C),j[O+1]=b[O]-L+256&255;return j},d=function(b,y,N){if(b===y&&y===N)return b;var w=Math.abs(y-N),k=Math.abs(b-N),C=Math.abs(b+y-N-N);return w<=k&&w<=C?b:k<=C?y:N},p=function(){return[i,a,o,c,f]},g=function(b){var y=b.map(function(N){return N.reduce(function(w,k){return w+Math.abs(k)},0)});return y.indexOf(Math.min.apply(null,y))};t.processPNG=function(b,y,N,w){var k,C,L,j,z,O,K,q,H,se,le,P,I,ne,te,de=this.decode.FLATE_DECODE,X="";if(this.__addimage__.isArrayBuffer(b)&&(b=new Uint8Array(b)),this.__addimage__.isArrayBufferView(b)){if(b=(L=new cF(b)).imgData,C=L.bits,k=L.colorSpace,z=L.colors,[4,6].indexOf(L.colorType)!==-1){if(L.bits===8){H=(q=L.pixelBitlength==32?new Uint32Array(L.decodePixels().buffer):L.pixelBitlength==16?new Uint16Array(L.decodePixels().buffer):new Uint8Array(L.decodePixels().buffer)).length,le=new Uint8Array(H*L.colors),se=new Uint8Array(H);var J,G=L.pixelBitlength-L.bits;for(ne=0,te=0;ne<H;ne++){for(I=q[ne],J=0;J<G;)le[te++]=I>>>J&255,J+=L.bits;se[ne]=I>>>J&255}}if(L.bits===16){H=(q=new Uint32Array(L.decodePixels().buffer)).length,le=new Uint8Array(H*(32/L.pixelBitlength)*L.colors),se=new Uint8Array(H*(32/L.pixelBitlength)),P=L.colors>1,ne=0,te=0;for(var me=0;ne<H;)I=q[ne++],le[te++]=I>>>0&255,P&&(le[te++]=I>>>16&255,I=q[ne++],le[te++]=I>>>0&255),se[me++]=I>>>16&255;C=8}w!==t.image_compression.NONE&&e()?(b=n(le,L.width*L.colors,L.colors,w),K=n(se,L.width,1,w)):(b=le,K=se,de=void 0)}if(L.colorType===3&&(k=this.color_spaces.INDEXED,O=L.palette,L.transparency.indexed)){var W=L.transparency.indexed,xe=0;for(ne=0,H=W.length;ne<H;++ne)xe+=W[ne];if((xe/=255)===H-1&&W.indexOf(0)!==-1)j=[W.indexOf(0)];else if(xe!==H){for(q=L.decodePixels(),se=new Uint8Array(q.length),ne=0,H=q.length;ne<H;ne++)se[ne]=W[q[ne]];K=n(se,L.width,1)}}var R=function(V){var Q;switch(V){case t.image_compression.FAST:Q=11;break;case t.image_compression.MEDIUM:Q=13;break;case t.image_compression.SLOW:Q=14;break;default:Q=12}return Q}(w);return de===this.decode.FLATE_DECODE&&(X="/Predictor "+R+" "),X+="/Colors "+z+" /BitsPerComponent "+C+" /Columns "+L.width,(this.__addimage__.isArrayBuffer(b)||this.__addimage__.isArrayBufferView(b))&&(b=this.__addimage__.arrayBufferToBinaryString(b)),(K&&this.__addimage__.isArrayBuffer(K)||this.__addimage__.isArrayBufferView(K))&&(K=this.__addimage__.arrayBufferToBinaryString(K)),{alias:N,data:b,index:y,filter:de,decodeParameters:X,transparency:j,palette:O,sMask:K,predictor:R,width:L.width,height:L.height,bitsPerComponent:C,colorSpace:k}}}})(Tt.API),function(t){t.processGIF89A=function(e,n,r,i){var a=new uF(e),o=a.width,c=a.height,f=[];a.decodeAndBlitFrameRGBA(0,f);var d={data:f,width:o,height:c},p=new W1(100).encode(d,100);return t.processJPEG.call(this,p,n,r,i)},t.processGIF87A=t.processGIF89A}(Tt.API),fs.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:r,blue:n,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},fs.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(n){Rn.log("bit decode error:"+n)}},fs.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),n=e%4;for(t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,i=0;i<e;i++)for(var a=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+8*i*4,c=0;c<8&&8*i+c<this.width;c++){var f=this.palette[a>>7-c&1];this.data[o+4*c]=f.blue,this.data[o+4*c+1]=f.green,this.data[o+4*c+2]=f.red,this.data[o+4*c+3]=255}n!==0&&(this.pos+=4-n)}},fs.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++){var a=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+2*i*4,c=a>>4,f=15&a,d=this.palette[c];if(this.data[o]=d.blue,this.data[o+1]=d.green,this.data[o+2]=d.red,this.data[o+3]=255,2*i+1>=this.width)break;d=this.palette[f],this.data[o+4]=d.blue,this.data[o+4+1]=d.green,this.data[o+4+2]=d.red,this.data[o+4+3]=255}e!==0&&(this.pos+=4-e)}},fs.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+4*r;if(i<this.palette.length){var o=this.palette[i];this.data[a]=o.red,this.data[a+1]=o.green,this.data[a+2]=o.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}t!==0&&(this.pos+=4-t)}},fs.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&e)/e*255|0,c=(a>>5&e)/e*255|0,f=(a>>10&e)/e*255|0,d=a>>15?255:0,p=r*this.width*4+4*i;this.data[p]=f,this.data[p+1]=c,this.data[p+2]=o,this.data[p+3]=d}this.pos+=t}},fs.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,a=0;a<this.width;a++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var c=(o&e)/e*255|0,f=(o>>5&n)/n*255|0,d=(o>>11)/e*255|0,p=i*this.width*4+4*a;this.data[p]=d,this.data[p+1]=f,this.data[p+2]=c,this.data[p+3]=255}this.pos+=t}},fs.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=e*this.width*4+4*n;this.data[o]=a,this.data[o+1]=i,this.data[o+2]=r,this.data[o+3]=255}this.pos+=this.width%4}},fs.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),c=e*this.width*4+4*n;this.data[c]=a,this.data[c+1]=i,this.data[c+2]=r,this.data[c+3]=o}},fs.prototype.getData=function(){return this.data},function(t){t.processBMP=function(e,n,r,i){var a=new fs(e,!1),o=a.width,c=a.height,f={data:a.getData(),width:o,height:c},d=new W1(100).encode(f,100);return t.processJPEG.call(this,d,n,r,i)}}(Tt.API),Bw.prototype.getData=function(){return this.data},function(t){t.processWEBP=function(e,n,r,i){var a=new Bw(e),o=a.width,c=a.height,f={data:a.getData(),width:o,height:c},d=new W1(100).encode(f,100);return t.processJPEG.call(this,d,n,r,i)}}(Tt.API),Tt.API.processRGBA=function(t,e,n){for(var r=t.data,i=r.length,a=new Uint8Array(i/4*3),o=new Uint8Array(i/4),c=0,f=0,d=0;d<i;d+=4){var p=r[d],g=r[d+1],b=r[d+2],y=r[d+3];a[c++]=p,a[c++]=g,a[c++]=b,o[f++]=y}var N=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:N,index:e,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},Tt.API.setLanguage=function(t){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]!==void 0&&(this.internal.languageSettings.languageCode=t,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},Tf=Tt.API,Cm=Tf.getCharWidthsArray=function(t,e){var n,r,i=(e=e||{}).font||this.internal.getFont(),a=e.fontSize||this.internal.getFontSize(),o=e.charSpace||this.internal.getCharSpace(),c=e.widths?e.widths:i.metadata.Unicode.widths,f=c.fof?c.fof:1,d=e.kerning?e.kerning:i.metadata.Unicode.kerning,p=d.fof?d.fof:1,g=e.doKerning!==!1,b=0,y=t.length,N=0,w=c[0]||f,k=[];for(n=0;n<y;n++)r=t.charCodeAt(n),typeof i.metadata.widthOfString=="function"?k.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+o*(1e3/a)||0)/1e3):(b=g&&kn(d[r])==="object"&&!isNaN(parseInt(d[r][N],10))?d[r][N]/p:0,k.push((c[r]||w)/f+b)),N=r;return k},Ow=Tf.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return Tf.processArabic&&(t=Tf.processArabic(t)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(t,n,i)/n:Cm.apply(this,arguments).reduce(function(a,o){return a+o},0)},Tw=function(t,e,n,r){for(var i=[],a=0,o=t.length,c=0;a!==o&&c+e[a]<n;)c+=e[a],a++;i.push(t.slice(0,a));var f=a;for(c=0;a!==o;)c+e[a]>r&&(i.push(t.slice(f,a)),c=0,f=a),c+=e[a],a++;return f!==a&&i.push(t.slice(f,a)),i},Rw=function(t,e,n){n||(n={});var r,i,a,o,c,f,d,p=[],g=[p],b=n.textIndent||0,y=0,N=0,w=t.split(" "),k=Cm.apply(this,[" ",n])[0];if(f=n.lineIndent===-1?w[0].length+2:n.lineIndent||0){var C=Array(f).join(" "),L=[];w.map(function(z){(z=z.split(/\s*\n/)).length>1?L=L.concat(z.map(function(O,K){return(K&&O.length?`
`:"")+O})):L.push(z[0])}),w=L,f=Ow.apply(this,[C,n])}for(a=0,o=w.length;a<o;a++){var j=0;if(r=w[a],f&&r[0]==`
`&&(r=r.substr(1),j=1),b+y+(N=(i=Cm.apply(this,[r,n])).reduce(function(z,O){return z+O},0))>e||j){if(N>e){for(c=Tw.apply(this,[r,i,e-(b+y),e]),p.push(c.shift()),p=[c.pop()];c.length;)g.push([c.shift()]);N=i.slice(r.length-(p[0]?p[0].length:0)).reduce(function(z,O){return z+O},0)}else p=[r];g.push(p),b=N+f,y=k}else p.push(r),b+=y+N,y=k}return d=f?function(z,O){return(O?C:"")+z.join(" ")}:function(z){return z.join(" ")},g.map(d)},Tf.splitTextToSize=function(t,e,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),a=(function(p){if(p.widths&&p.kerning)return{widths:p.widths,kerning:p.kerning};var g=this.internal.getFont(p.fontName,p.fontStyle);return g.metadata.Unicode?{widths:g.metadata.Unicode.widths||{0:1},kerning:g.metadata.Unicode.kerning||{}}:{font:g.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(t)?t:String(t).split(/\r?\n/);var o=1*this.internal.scaleFactor*e/i;a.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=n.lineIndent;var c,f,d=[];for(c=0,f=r.length;c<f;c++)d=d.concat(Rw.apply(this,[r[c],o,a]));return d},function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="klmnopqrstuvwxyz",n={},r={},i=0;i<e.length;i++)n[e[i]]="0123456789abcdef"[i],r["0123456789abcdef"[i]]=e[i];var a=function(g){return"0x"+parseInt(g,10).toString(16)},o=t.__fontmetrics__.compress=function(g){var b,y,N,w,k=["{"];for(var C in g){if(b=g[C],isNaN(parseInt(C,10))?y="'"+C+"'":(C=parseInt(C,10),y=(y=a(C).slice(2)).slice(0,-1)+r[y.slice(-1)]),typeof b=="number")b<0?(N=a(b).slice(3),w="-"):(N=a(b).slice(2),w=""),N=w+N.slice(0,-1)+r[N.slice(-1)];else{if(kn(b)!=="object")throw new Error("Don't know what to do with value type "+kn(b)+".");N=o(b)}k.push(y+N)}return k.push("}"),k.join("")},c=t.__fontmetrics__.uncompress=function(g){if(typeof g!="string")throw new Error("Invalid argument passed to uncompress.");for(var b,y,N,w,k={},C=1,L=k,j=[],z="",O="",K=g.length-1,q=1;q<K;q+=1)(w=g[q])=="'"?b?(N=b.join(""),b=void 0):b=[]:b?b.push(w):w=="{"?(j.push([L,N]),L={},N=void 0):w=="}"?((y=j.pop())[0][y[1]]=L,N=void 0,L=y[0]):w=="-"?C=-1:N===void 0?n.hasOwnProperty(w)?(z+=n[w],N=parseInt(z,16)*C,C=1,z=""):z+=w:n.hasOwnProperty(w)?(O+=n[w],L[N]=parseInt(O,16)*C,C=1,N=void 0,O=""):O+=w;return k},f={codePages:["WinAnsiEncoding"],WinAnsiEncoding:c("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={Unicode:{Courier:f,"Courier-Bold":f,"Courier-BoldOblique":f,"Courier-Oblique":f,Helvetica:f,"Helvetica-Bold":f,"Helvetica-BoldOblique":f,"Helvetica-Oblique":f,"Times-Roman":f,"Times-Bold":f,"Times-BoldItalic":f,"Times-Italic":f}},p={Unicode:{"Courier-Oblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":c("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":c("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:c("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:c("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":c("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":c("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};t.events.push(["addFont",function(g){var b=g.font,y=p.Unicode[b.postScriptName];y&&(b.metadata.Unicode={},b.metadata.Unicode.widths=y.widths,b.metadata.Unicode.kerning=y.kerning);var N=d.Unicode[b.postScriptName];N&&(b.metadata.Unicode.encoding=N,b.encoding=N.codePages[0])}])}(Tt.API),function(t){var e=function(n){for(var r=n.length,i=new Uint8Array(r),a=0;a<r;a++)i[a]=n.charCodeAt(a);return i};t.API.events.push(["addFont",function(n){var r=void 0,i=n.font,a=n.instance;if(!i.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(r=a.existsFileInVFS(i.postScriptName)===!1?a.loadFile(i.postScriptName):a.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(o,c){c=/^\x00\x01\x00\x00/.test(c)?e(c):e(kh(c)),o.metadata=t.API.TTFFont.open(c),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(i,r)}}])}(Tt),function(t){function e(){return(Rt.canvg?Promise.resolve(Rt.canvg):E2(()=>import("./index.es-U3QHQeF7.js"),[])).catch(function(n){return Promise.reject(new Error("Could not load canvg: "+n))}).then(function(n){return n.default?n.default:n})}Tt.API.addSvgAsImage=function(n,r,i,a,o,c,f,d){if(isNaN(r)||isNaN(i))throw Rn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(a)||isNaN(o))throw Rn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var p=document.createElement("canvas");p.width=a,p.height=o;var g=p.getContext("2d");g.fillStyle="#fff",g.fillRect(0,0,p.width,p.height);var b={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},y=this;return e().then(function(N){return N.fromString(g,n,b)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(N){return N.render(b)}).then(function(){y.addImage(p.toDataURL("image/jpeg",1),r,i,a,o,f,d)})}}(),Tt.API.putTotalPages=function(t){var e,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),n=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(e,n);return this},Tt.API.viewerPreferences=function(t,e){var n;t=t||{},e=e||!1;var r,i,a,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(o),f=[],d=0,p=0,g=0;function b(N,w){var k,C=!1;for(k=0;k<N.length;k+=1)N[k]===w&&(C=!0);return C}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,t==="reset"||e===!0){var y=c.length;for(g=0;g<y;g+=1)n[c[g]].value=n[c[g]].defaultValue,n[c[g]].explicitSet=!1}if(kn(t)==="object"){for(i in t)if(a=t[i],b(c,i)&&a!==void 0){if(n[i].type==="boolean"&&typeof a=="boolean")n[i].value=a;else if(n[i].type==="name"&&b(n[i].valueSet,a))n[i].value=a;else if(n[i].type==="integer"&&Number.isInteger(a))n[i].value=a;else if(n[i].type==="array"){for(d=0;d<a.length;d+=1)if(r=!0,a[d].length===1&&typeof a[d][0]=="number")f.push(String(a[d]-1));else if(a[d].length>1){for(p=0;p<a[d].length;p+=1)typeof a[d][p]!="number"&&(r=!1);r===!0&&f.push([a[d][0]-1,a[d][1]-1].join(" "))}n[i].value="["+f.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var N,w=[];for(N in n)n[N].explicitSet===!0&&(n[N].type==="name"?w.push("/"+N+" /"+n[N].value):w.push("/"+N+" "+n[N].value));w.length!==0&&this.internal.write(`/ViewerPreferences
<<
`+w.join(`
`)+`
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},function(t){var e=function(){var r='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',i=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),a=unescape(encodeURIComponent(r)),o=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),c=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),f=unescape(encodeURIComponent("</x:xmpmeta>")),d=a.length+o.length+c.length+i.length+f.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+d+" >>"),this.internal.write("stream"),this.internal.write(i+a+o+c+f),this.internal.write("endstream"),this.internal.write("endobj")},n=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};t.addMetadata=function(r,i){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:r,namespaceuri:i||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",n),this.internal.events.subscribe("postPutResources",e)),this}}(Tt.API),function(t){var e=t.API,n=e.pdfEscape16=function(a,o){for(var c,f=o.metadata.Unicode.widths,d=["","0","00","000","0000"],p=[""],g=0,b=a.length;g<b;++g){if(c=o.metadata.characterToGlyph(a.charCodeAt(g)),o.metadata.glyIdsUsed.push(c),o.metadata.toUnicode[c]=a.charCodeAt(g),f.indexOf(c)==-1&&(f.push(c),f.push([parseInt(o.metadata.widthOfGlyph(c),10)])),c=="0")return p.join("");c=c.toString(16),p.push(d[4-c.length],c)}return p.join("")},r=function(a){var o,c,f,d,p,g,b;for(p=`/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo <<
  /Registry (Adobe)
  /Ordering (UCS)
  /Supplement 0
>> def
/CMapName /Adobe-Identity-UCS def
/CMapType 2 def
1 begincodespacerange
<0000><ffff>
endcodespacerange`,f=[],g=0,b=(c=Object.keys(a).sort(function(y,N){return y-N})).length;g<b;g++)o=c[g],f.length>=100&&(p+=`
`+f.length+` beginbfchar
`+f.join(`
`)+`
endbfchar`,f=[]),a[o]!==void 0&&a[o]!==null&&typeof a[o].toString=="function"&&(d=("0000"+a[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),f.push("<"+o+"><"+d+">"));return f.length&&(p+=`
`+f.length+` beginbfchar
`+f.join(`
`)+`
endbfchar
`),p+=`endcmap
CMapName currentdict /CMap defineresource pop
end
end`};e.events.push(["putFont",function(a){(function(o){var c=o.font,f=o.out,d=o.newObject,p=o.putStream;if(c.metadata instanceof t.API.TTFFont&&c.encoding==="Identity-H"){for(var g=c.metadata.Unicode.widths,b=c.metadata.subset.encode(c.metadata.glyIdsUsed,1),y="",N=0;N<b.length;N++)y+=String.fromCharCode(b[N]);var w=d();p({data:y,addLength1:!0,objectId:w}),f("endobj");var k=d();p({data:r(c.metadata.toUnicode),addLength1:!0,objectId:k}),f("endobj");var C=d();f("<<"),f("/Type /FontDescriptor"),f("/FontName /"+Pf(c.fontName)),f("/FontFile2 "+w+" 0 R"),f("/FontBBox "+t.API.PDFObject.convert(c.metadata.bbox)),f("/Flags "+c.metadata.flags),f("/StemV "+c.metadata.stemV),f("/ItalicAngle "+c.metadata.italicAngle),f("/Ascent "+c.metadata.ascender),f("/Descent "+c.metadata.decender),f("/CapHeight "+c.metadata.capHeight),f(">>"),f("endobj");var L=d();f("<<"),f("/Type /Font"),f("/BaseFont /"+Pf(c.fontName)),f("/FontDescriptor "+C+" 0 R"),f("/W "+t.API.PDFObject.convert(g)),f("/CIDToGIDMap /Identity"),f("/DW 1000"),f("/Subtype /CIDFontType2"),f("/CIDSystemInfo"),f("<<"),f("/Supplement 0"),f("/Registry (Adobe)"),f("/Ordering ("+c.encoding+")"),f(">>"),f(">>"),f("endobj"),c.objectNumber=d(),f("<<"),f("/Type /Font"),f("/Subtype /Type0"),f("/ToUnicode "+k+" 0 R"),f("/BaseFont /"+Pf(c.fontName)),f("/Encoding /"+c.encoding),f("/DescendantFonts ["+L+" 0 R]"),f(">>"),f("endobj"),c.isAlreadyPutted=!0}})(a)}]),e.events.push(["putFont",function(a){(function(o){var c=o.font,f=o.out,d=o.newObject,p=o.putStream;if(c.metadata instanceof t.API.TTFFont&&c.encoding==="WinAnsiEncoding"){for(var g=c.metadata.rawData,b="",y=0;y<g.length;y++)b+=String.fromCharCode(g[y]);var N=d();p({data:b,addLength1:!0,objectId:N}),f("endobj");var w=d();p({data:r(c.metadata.toUnicode),addLength1:!0,objectId:w}),f("endobj");var k=d();f("<<"),f("/Descent "+c.metadata.decender),f("/CapHeight "+c.metadata.capHeight),f("/StemV "+c.metadata.stemV),f("/Type /FontDescriptor"),f("/FontFile2 "+N+" 0 R"),f("/Flags 96"),f("/FontBBox "+t.API.PDFObject.convert(c.metadata.bbox)),f("/FontName /"+Pf(c.fontName)),f("/ItalicAngle "+c.metadata.italicAngle),f("/Ascent "+c.metadata.ascender),f(">>"),f("endobj"),c.objectNumber=d();for(var C=0;C<c.metadata.hmtx.widths.length;C++)c.metadata.hmtx.widths[C]=parseInt(c.metadata.hmtx.widths[C]*(1e3/c.metadata.head.unitsPerEm));f("<</Subtype/TrueType/Type/Font/ToUnicode "+w+" 0 R/BaseFont/"+Pf(c.fontName)+"/FontDescriptor "+k+" 0 R/Encoding/"+c.encoding+" /FirstChar 29 /LastChar 255 /Widths "+t.API.PDFObject.convert(c.metadata.hmtx.widths)+">>"),f("endobj"),c.isAlreadyPutted=!0}})(a)}]);var i=function(a){var o,c=a.text||"",f=a.x,d=a.y,p=a.options||{},g=a.mutex||{},b=g.pdfEscape,y=g.activeFontKey,N=g.fonts,w=y,k="",C=0,L="",j=N[w].encoding;if(N[w].encoding!=="Identity-H")return{text:c,x:f,y:d,options:p,mutex:g};for(L=c,w=y,Array.isArray(c)&&(L=c[0]),C=0;C<L.length;C+=1)N[w].metadata.hasOwnProperty("cmap")&&(o=N[w].metadata.cmap.unicode.codeMap[L[C].charCodeAt(0)]),o||L[C].charCodeAt(0)<256&&N[w].metadata.hasOwnProperty("Unicode")?k+=L[C]:k+="";var z="";return parseInt(w.slice(1))<14||j==="WinAnsiEncoding"?z=b(k,w).split("").map(function(O){return O.charCodeAt(0).toString(16)}).join(""):j==="Identity-H"&&(z=n(k,N[w])),g.isHex=!0,{text:z,x:f,y:d,options:p,mutex:g}};e.events.push(["postProcessText",function(a){var o=a.text||"",c=[],f={text:o,x:a.x,y:a.y,options:a.options,mutex:a.mutex};if(Array.isArray(o)){var d=0;for(d=0;d<o.length;d+=1)Array.isArray(o[d])&&o[d].length===3?c.push([i(Object.assign({},f,{text:o[d][0]})).text,o[d][1],o[d][2]]):c.push(i(Object.assign({},f,{text:o[d]})).text);a.text=c}else a.text=i(Object.assign({},f,{text:o})).text}])}(Tt),function(t){var e=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};t.existsFileInVFS=function(n){return e.call(this),this.internal.vFS[n]!==void 0},t.addFileToVFS=function(n,r){return e.call(this),this.internal.vFS[n]=r,this},t.getFileFromVFS=function(n){return e.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}}(Tt.API),function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(r){var i,a,o,c,f,d,p,g=e,b=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],y=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],N={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},w={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},k=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],C=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),L=!1,j=0;this.__bidiEngine__={};var z=function(P){var I=P.charCodeAt(),ne=I>>8,te=w[ne];return te!==void 0?g[256*te+(255&I)]:ne===252||ne===253?"AL":C.test(ne)?"L":ne===8?"R":"N"},O=function(P){for(var I,ne=0;ne<P.length;ne++){if((I=z(P.charAt(ne)))==="L")return!1;if(I==="R")return!0}return!1},K=function(P,I,ne,te){var de,X,J,G,me=I[te];switch(me){case"L":case"R":L=!1;break;case"N":case"AN":break;case"EN":L&&(me="AN");break;case"AL":L=!0,me="R";break;case"WS":me="N";break;case"CS":te<1||te+1>=I.length||(de=ne[te-1])!=="EN"&&de!=="AN"||(X=I[te+1])!=="EN"&&X!=="AN"?me="N":L&&(X="AN"),me=X===de?X:"N";break;case"ES":me=(de=te>0?ne[te-1]:"B")==="EN"&&te+1<I.length&&I[te+1]==="EN"?"EN":"N";break;case"ET":if(te>0&&ne[te-1]==="EN"){me="EN";break}if(L){me="N";break}for(J=te+1,G=I.length;J<G&&I[J]==="ET";)J++;me=J<G&&I[J]==="EN"?"EN":"N";break;case"NSM":if(o&&!c){for(G=I.length,J=te+1;J<G&&I[J]==="NSM";)J++;if(J<G){var W=P[te],xe=W>=1425&&W<=2303||W===64286;if(de=I[J],xe&&(de==="R"||de==="AL")){me="R";break}}}me=te<1||(de=I[te-1])==="B"?"N":ne[te-1];break;case"B":L=!1,i=!0,me=j;break;case"S":a=!0,me="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":L=!1;break;case"BN":me="N"}return me},q=function(P,I,ne){var te=P.split("");return ne&&H(te,ne,{hiLevel:j}),te.reverse(),I&&I.reverse(),te.join("")},H=function(P,I,ne){var te,de,X,J,G,me=-1,W=P.length,xe=0,R=[],V=j?y:b,Q=[];for(L=!1,i=!1,a=!1,de=0;de<W;de++)Q[de]=z(P[de]);for(X=0;X<W;X++){if(G=xe,R[X]=K(P,Q,R,X),te=240&(xe=V[G][N[R[X]]]),xe&=15,I[X]=J=V[xe][5],te>0)if(te===16){for(de=me;de<X;de++)I[de]=1;me=-1}else me=-1;if(V[xe][6])me===-1&&(me=X);else if(me>-1){for(de=me;de<X;de++)I[de]=J;me=-1}Q[X]==="B"&&(I[X]=0),ne.hiLevel|=J}a&&function(ae,ce,he){for(var we=0;we<he;we++)if(ae[we]==="S"){ce[we]=j;for(var Se=we-1;Se>=0&&ae[Se]==="WS";Se--)ce[Se]=j}}(Q,I,W)},se=function(P,I,ne,te,de){if(!(de.hiLevel<P)){if(P===1&&j===1&&!i)return I.reverse(),void(ne&&ne.reverse());for(var X,J,G,me,W=I.length,xe=0;xe<W;){if(te[xe]>=P){for(G=xe+1;G<W&&te[G]>=P;)G++;for(me=xe,J=G-1;me<J;me++,J--)X=I[me],I[me]=I[J],I[J]=X,ne&&(X=ne[me],ne[me]=ne[J],ne[J]=X);xe=G}xe++}}},le=function(P,I,ne){var te=P.split(""),de={hiLevel:j};return ne||(ne=[]),H(te,ne,de),function(X,J,G){if(G.hiLevel!==0&&p)for(var me,W=0;W<X.length;W++)J[W]===1&&(me=k.indexOf(X[W]))>=0&&(X[W]=k[me+1])}(te,ne,de),se(2,te,I,ne,de),se(1,te,I,ne,de),te.join("")};return this.__bidiEngine__.doBidiReorder=function(P,I,ne){if(function(de,X){if(X)for(var J=0;J<de.length;J++)X[J]=J;c===void 0&&(c=O(de)),d===void 0&&(d=O(de))}(P,I),o||!f||d)if(o&&f&&c^d)j=c?1:0,P=q(P,I,ne);else if(!o&&f&&d)j=c?1:0,P=le(P,I,ne),P=q(P,I);else if(!o||c||f||d){if(o&&!f&&c^d)P=q(P,I),c?(j=0,P=le(P,I,ne)):(j=1,P=le(P,I,ne),P=q(P,I));else if(o&&c&&!f&&d)j=1,P=le(P,I,ne),P=q(P,I);else if(!o&&!f&&c^d){var te=p;c?(j=1,P=le(P,I,ne),j=0,p=!1,P=le(P,I,ne),p=te):(j=0,P=le(P,I,ne),P=q(P,I),j=1,p=!1,P=le(P,I,ne),p=te,P=q(P,I))}}else j=0,P=le(P,I,ne);else j=c?1:0,P=le(P,I,ne);return P},this.__bidiEngine__.setOptions=function(P){P&&(o=P.isInputVisual,f=P.isOutputVisual,c=P.isInputRtl,d=P.isOutputRtl,p=P.isSymmetricSwapping)},this.__bidiEngine__.setOptions(r),this.__bidiEngine__};var e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(r){var i=r.text;r.x,r.y;var a=r.options||{};r.mutex,a.lang;var o=[];if(a.isInputVisual=typeof a.isInputVisual!="boolean"||a.isInputVisual,n.setOptions(a),Object.prototype.toString.call(i)==="[object Array]"){var c=0;for(o=[],c=0;c<i.length;c+=1)Object.prototype.toString.call(i[c])==="[object Array]"?o.push([n.doBidiReorder(i[c][0]),i[c][1],i[c][2]]):o.push([n.doBidiReorder(i[c])]);r.text=o}else r.text=n.doBidiReorder(i);n.setOptions({isInputVisual:!0})}])}(Tt),Tt.API.TTFFont=function(){function t(e){var n;if(this.rawData=e,n=this.contents=new Ac(e),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new AF(this),this.registerTTF()}return t.open=function(e){return new t(e)},t.prototype.parse=function(){return this.directory=new fF(this.contents),this.head=new hF(this),this.name=new vF(this),this.cmap=new FN(this),this.toUnicode={},this.hhea=new pF(this),this.maxp=new bF(this),this.hmtx=new xF(this),this.post=new gF(this),this.os2=new mF(this),this.loca=new NF(this),this.glyf=new wF(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var e,n,r,i,a;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var o,c,f,d;for(d=[],o=0,c=(f=this.bbox).length;o<c;o++)e=f[o],d.push(Math.round(e*this.scaleFactor));return d}).call(this),this.stemV=0,this.post.exists?(r=255&(i=this.post.italic_angle),(32768&(n=i>>16))!=0&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+r)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(a=this.familyClass)===1||a===2||a===3||a===4||a===5||a===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},t.prototype.characterToGlyph=function(e){var n;return((n=this.cmap.unicode)!=null?n.codeMap[e]:void 0)||0},t.prototype.widthOfGlyph=function(e){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*n},t.prototype.widthOfString=function(e,n,r){var i,a,o,c;for(o=0,a=0,c=(e=""+e).length;0<=c?a<c:a>c;a=0<=c?++a:--a)i=e.charCodeAt(a),o+=this.widthOfGlyph(this.characterToGlyph(i))+r*(1e3/n)||0;return o*(n/1e3)},t.prototype.lineHeight=function(e,n){var r;return n==null&&(n=!1),r=n?this.lineGap:0,(this.ascender+r-this.decender)/1e3*e},t}();var Ss,Ac=function(){function t(e){this.data=e??[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(e){return this.data[this.pos++]=e},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},t.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},t.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},t.prototype.readString=function(e){var n,r;for(r=[],n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)r[n]=String.fromCharCode(this.readByte());return r.join("")},t.prototype.writeString=function(e){var n,r,i;for(i=[],n=0,r=e.length;0<=r?n<r:n>r;n=0<=r?++n:--n)i.push(this.writeByte(e.charCodeAt(n)));return i},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(e){return this.writeInt16(e)},t.prototype.readLongLong=function(){var e,n,r,i,a,o,c,f;return e=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),a=this.readByte(),o=this.readByte(),c=this.readByte(),f=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^n)+1099511627776*(255^r)+4294967296*(255^i)+16777216*(255^a)+65536*(255^o)+256*(255^c)+(255^f)+1):72057594037927940*e+281474976710656*n+1099511627776*r+4294967296*i+16777216*a+65536*o+256*c+f},t.prototype.writeLongLong=function(e){var n,r;return n=Math.floor(e/4294967296),r=4294967295&e,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(e){return this.writeInt32(e)},t.prototype.read=function(e){var n,r;for(n=[],r=0;0<=e?r<e:r>e;r=0<=e?++r:--r)n.push(this.readByte());return n},t.prototype.write=function(e){var n,r,i,a;for(a=[],r=0,i=e.length;r<i;r++)n=e[r],a.push(this.writeByte(n));return a},t}(),fF=function(){var t;function e(n){var r,i,a;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},i=0,a=this.tableCount;0<=a?i<a:i>a;i=0<=a?++i:--i)r={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[r.tag]=r}return e.prototype.encode=function(n){var r,i,a,o,c,f,d,p,g,b,y,N,w;for(w in y=Object.keys(n).length,f=Math.log(2),g=16*Math.floor(Math.log(y)/f),o=Math.floor(g/f),p=16*y-g,(i=new Ac).writeInt(this.scalarType),i.writeShort(y),i.writeShort(g),i.writeShort(o),i.writeShort(p),a=16*y,d=i.pos+a,c=null,N=[],n)for(b=n[w],i.writeString(w),i.writeInt(t(b)),i.writeInt(d),i.writeInt(b.length),N=N.concat(b),w==="head"&&(c=d),d+=b.length;d%4;)N.push(0),d++;return i.write(N),r=2981146554-t(i.data),i.pos=c+8,i.writeUInt32(r),i.data},t=function(n){var r,i,a,o;for(n=IN.call(n);n.length%4;)n.push(0);for(a=new Ac(n),i=0,r=0,o=n.length;r<o;r=r+=4)i+=a.readUInt32();return 4294967295&i},e}(),dF={}.hasOwnProperty,No=function(t,e){for(var n in e)dF.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t};Ss=function(){function t(e){var n;this.file=e,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}();var hF=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return No(e,Ss),e.prototype.tag="head",e.prototype.parse=function(n){return n.pos=this.offset,this.version=n.readInt(),this.revision=n.readInt(),this.checkSumAdjustment=n.readInt(),this.magicNumber=n.readInt(),this.flags=n.readShort(),this.unitsPerEm=n.readShort(),this.created=n.readLongLong(),this.modified=n.readLongLong(),this.xMin=n.readShort(),this.yMin=n.readShort(),this.xMax=n.readShort(),this.yMax=n.readShort(),this.macStyle=n.readShort(),this.lowestRecPPEM=n.readShort(),this.fontDirectionHint=n.readShort(),this.indexToLocFormat=n.readShort(),this.glyphDataFormat=n.readShort()},e.prototype.encode=function(n){var r;return(r=new Ac).writeInt(this.version),r.writeInt(this.revision),r.writeInt(this.checkSumAdjustment),r.writeInt(this.magicNumber),r.writeShort(this.flags),r.writeShort(this.unitsPerEm),r.writeLongLong(this.created),r.writeLongLong(this.modified),r.writeShort(this.xMin),r.writeShort(this.yMin),r.writeShort(this.xMax),r.writeShort(this.yMax),r.writeShort(this.macStyle),r.writeShort(this.lowestRecPPEM),r.writeShort(this.fontDirectionHint),r.writeShort(n),r.writeShort(this.glyphDataFormat),r.data},e}(),Fw=function(){function t(e,n){var r,i,a,o,c,f,d,p,g,b,y,N,w,k,C,L,j;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=n+e.readInt(),g=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(f=0;f<256;++f)this.codeMap[f]=e.readByte();break;case 4:for(y=e.readUInt16(),b=y/2,e.pos+=6,a=function(){var z,O;for(O=[],f=z=0;0<=b?z<b:z>b;f=0<=b?++z:--z)O.push(e.readUInt16());return O}(),e.pos+=2,w=function(){var z,O;for(O=[],f=z=0;0<=b?z<b:z>b;f=0<=b?++z:--z)O.push(e.readUInt16());return O}(),d=function(){var z,O;for(O=[],f=z=0;0<=b?z<b:z>b;f=0<=b?++z:--z)O.push(e.readUInt16());return O}(),p=function(){var z,O;for(O=[],f=z=0;0<=b?z<b:z>b;f=0<=b?++z:--z)O.push(e.readUInt16());return O}(),i=(this.length-e.pos+this.offset)/2,c=function(){var z,O;for(O=[],f=z=0;0<=i?z<i:z>i;f=0<=i?++z:--z)O.push(e.readUInt16());return O}(),f=C=0,j=a.length;C<j;f=++C)for(k=a[f],r=L=N=w[f];N<=k?L<=k:L>=k;r=N<=k?++L:--L)p[f]===0?o=r+d[f]:(o=c[p[f]/2+(r-N)-(b-f)]||0)!==0&&(o+=d[f]),this.codeMap[r]=65535&o}e.pos=g}return t.encode=function(e,n){var r,i,a,o,c,f,d,p,g,b,y,N,w,k,C,L,j,z,O,K,q,H,se,le,P,I,ne,te,de,X,J,G,me,W,xe,R,V,Q,ae,ce,he,we,Se,Ve,He,Je;switch(te=new Ac,o=Object.keys(e).sort(function(it,dt){return it-dt}),n){case"macroman":for(w=0,k=function(){var it=[];for(N=0;N<256;++N)it.push(0);return it}(),L={0:0},a={},de=0,me=o.length;de<me;de++)L[Se=e[i=o[de]]]==null&&(L[Se]=++w),a[i]={old:e[i],new:L[e[i]]},k[i]=L[e[i]];return te.writeUInt16(1),te.writeUInt16(0),te.writeUInt32(12),te.writeUInt16(0),te.writeUInt16(262),te.writeUInt16(0),te.write(k),{charMap:a,subtable:te.data,maxGlyphID:w+1};case"unicode":for(I=[],g=[],j=0,L={},r={},C=d=null,X=0,W=o.length;X<W;X++)L[O=e[i=o[X]]]==null&&(L[O]=++j),r[i]={old:O,new:L[O]},c=L[O]-i,C!=null&&c===d||(C&&g.push(C),I.push(i),d=c),C=i;for(C&&g.push(C),g.push(65535),I.push(65535),le=2*(se=I.length),H=2*Math.pow(Math.log(se)/Math.LN2,2),b=Math.log(H/2)/Math.LN2,q=2*se-H,f=[],K=[],y=[],N=J=0,xe=I.length;J<xe;N=++J){if(P=I[N],p=g[N],P===65535){f.push(0),K.push(0);break}if(P-(ne=r[P].new)>=32768)for(f.push(0),K.push(2*(y.length+se-N)),i=G=P;P<=p?G<=p:G>=p;i=P<=p?++G:--G)y.push(r[i].new);else f.push(ne-P),K.push(0)}for(te.writeUInt16(3),te.writeUInt16(1),te.writeUInt32(12),te.writeUInt16(4),te.writeUInt16(16+8*se+2*y.length),te.writeUInt16(0),te.writeUInt16(le),te.writeUInt16(H),te.writeUInt16(b),te.writeUInt16(q),he=0,R=g.length;he<R;he++)i=g[he],te.writeUInt16(i);for(te.writeUInt16(0),we=0,V=I.length;we<V;we++)i=I[we],te.writeUInt16(i);for(Ve=0,Q=f.length;Ve<Q;Ve++)c=f[Ve],te.writeUInt16(c);for(He=0,ae=K.length;He<ae;He++)z=K[He],te.writeUInt16(z);for(Je=0,ce=y.length;Je<ce;Je++)w=y[Je],te.writeUInt16(w);return{charMap:r,subtable:te.data,maxGlyphID:j+1}}},t}(),FN=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return No(e,Ss),e.prototype.tag="cmap",e.prototype.parse=function(n){var r,i,a;for(n.pos=this.offset,this.version=n.readUInt16(),a=n.readUInt16(),this.tables=[],this.unicode=null,i=0;0<=a?i<a:i>a;i=0<=a?++i:--i)r=new Fw(n,this.offset),this.tables.push(r),r.isUnicode&&this.unicode==null&&(this.unicode=r);return!0},e.encode=function(n,r){var i,a;return r==null&&(r="macroman"),i=Fw.encode(n,r),(a=new Ac).writeUInt16(0),a.writeUInt16(1),i.table=a.data.concat(i.subtable),i},e}(),pF=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return No(e,Ss),e.prototype.tag="hhea",e.prototype.parse=function(n){return n.pos=this.offset,this.version=n.readInt(),this.ascender=n.readShort(),this.decender=n.readShort(),this.lineGap=n.readShort(),this.advanceWidthMax=n.readShort(),this.minLeftSideBearing=n.readShort(),this.minRightSideBearing=n.readShort(),this.xMaxExtent=n.readShort(),this.caretSlopeRise=n.readShort(),this.caretSlopeRun=n.readShort(),this.caretOffset=n.readShort(),n.pos+=8,this.metricDataFormat=n.readShort(),this.numberOfMetrics=n.readUInt16()},e}(),mF=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return No(e,Ss),e.prototype.tag="OS/2",e.prototype.parse=function(n){if(n.pos=this.offset,this.version=n.readUInt16(),this.averageCharWidth=n.readShort(),this.weightClass=n.readUInt16(),this.widthClass=n.readUInt16(),this.type=n.readShort(),this.ySubscriptXSize=n.readShort(),this.ySubscriptYSize=n.readShort(),this.ySubscriptXOffset=n.readShort(),this.ySubscriptYOffset=n.readShort(),this.ySuperscriptXSize=n.readShort(),this.ySuperscriptYSize=n.readShort(),this.ySuperscriptXOffset=n.readShort(),this.ySuperscriptYOffset=n.readShort(),this.yStrikeoutSize=n.readShort(),this.yStrikeoutPosition=n.readShort(),this.familyClass=n.readShort(),this.panose=function(){var r,i;for(i=[],r=0;r<10;++r)i.push(n.readByte());return i}(),this.charRange=function(){var r,i;for(i=[],r=0;r<4;++r)i.push(n.readInt());return i}(),this.vendorID=n.readString(4),this.selection=n.readShort(),this.firstCharIndex=n.readShort(),this.lastCharIndex=n.readShort(),this.version>0&&(this.ascent=n.readShort(),this.descent=n.readShort(),this.lineGap=n.readShort(),this.winAscent=n.readShort(),this.winDescent=n.readShort(),this.codePageRange=function(){var r,i;for(i=[],r=0;r<2;r=++r)i.push(n.readInt());return i}(),this.version>1))return this.xHeight=n.readShort(),this.capHeight=n.readShort(),this.defaultChar=n.readShort(),this.breakChar=n.readShort(),this.maxContext=n.readShort()},e}(),gF=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return No(e,Ss),e.prototype.tag="post",e.prototype.parse=function(n){var r,i,a;switch(n.pos=this.offset,this.format=n.readInt(),this.italicAngle=n.readInt(),this.underlinePosition=n.readShort(),this.underlineThickness=n.readShort(),this.isFixedPitch=n.readInt(),this.minMemType42=n.readInt(),this.maxMemType42=n.readInt(),this.minMemType1=n.readInt(),this.maxMemType1=n.readInt(),this.format){case 65536:break;case 131072:var o;for(i=n.readUInt16(),this.glyphNameIndex=[],o=0;0<=i?o<i:o>i;o=0<=i?++o:--o)this.glyphNameIndex.push(n.readUInt16());for(this.names=[],a=[];n.pos<this.offset+this.length;)r=n.readByte(),a.push(this.names.push(n.readString(r)));return a;case 151552:return i=n.readUInt16(),this.offsets=n.read(i);case 196608:break;case 262144:return this.map=(function(){var c,f,d;for(d=[],o=c=0,f=this.file.maxp.numGlyphs;0<=f?c<f:c>f;o=0<=f?++c:--c)d.push(n.readUInt32());return d}).call(this)}},e}(),yF=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},vF=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return No(e,Ss),e.prototype.tag="name",e.prototype.parse=function(n){var r,i,a,o,c,f,d,p,g,b,y;for(n.pos=this.offset,n.readShort(),r=n.readShort(),f=n.readShort(),i=[],o=0;0<=r?o<r:o>r;o=0<=r?++o:--o)i.push({platformID:n.readShort(),encodingID:n.readShort(),languageID:n.readShort(),nameID:n.readShort(),length:n.readShort(),offset:this.offset+f+n.readShort()});for(d={},o=g=0,b=i.length;g<b;o=++g)a=i[o],n.pos=a.offset,p=n.readString(a.length),c=new yF(p,a),d[y=a.nameID]==null&&(d[y]=[]),d[a.nameID].push(c);this.strings=d,this.copyright=d[0],this.fontFamily=d[1],this.fontSubfamily=d[2],this.uniqueSubfamily=d[3],this.fontName=d[4],this.version=d[5];try{this.postscriptName=d[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=d[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=d[7],this.manufacturer=d[8],this.designer=d[9],this.description=d[10],this.vendorUrl=d[11],this.designerUrl=d[12],this.license=d[13],this.licenseUrl=d[14],this.preferredFamily=d[15],this.preferredSubfamily=d[17],this.compatibleFull=d[18],this.sampleText=d[19]},e}(),bF=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return No(e,Ss),e.prototype.tag="maxp",e.prototype.parse=function(n){return n.pos=this.offset,this.version=n.readInt(),this.numGlyphs=n.readUInt16(),this.maxPoints=n.readUInt16(),this.maxContours=n.readUInt16(),this.maxCompositePoints=n.readUInt16(),this.maxComponentContours=n.readUInt16(),this.maxZones=n.readUInt16(),this.maxTwilightPoints=n.readUInt16(),this.maxStorage=n.readUInt16(),this.maxFunctionDefs=n.readUInt16(),this.maxInstructionDefs=n.readUInt16(),this.maxStackElements=n.readUInt16(),this.maxSizeOfInstructions=n.readUInt16(),this.maxComponentElements=n.readUInt16(),this.maxComponentDepth=n.readUInt16()},e}(),xF=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return No(e,Ss),e.prototype.tag="hmtx",e.prototype.parse=function(n){var r,i,a,o,c,f,d;for(n.pos=this.offset,this.metrics=[],r=0,f=this.file.hhea.numberOfMetrics;0<=f?r<f:r>f;r=0<=f?++r:--r)this.metrics.push({advance:n.readUInt16(),lsb:n.readInt16()});for(a=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var p,g;for(g=[],r=p=0;0<=a?p<a:p>a;r=0<=a?++p:--p)g.push(n.readInt16());return g}(),this.widths=(function(){var p,g,b,y;for(y=[],p=0,g=(b=this.metrics).length;p<g;p++)o=b[p],y.push(o.advance);return y}).call(this),i=this.widths[this.widths.length-1],d=[],r=c=0;0<=a?c<a:c>a;r=0<=a?++c:--c)d.push(this.widths.push(i));return d},e.prototype.forGlyph=function(n){return n in this.metrics?this.metrics[n]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[n-this.metrics.length]}},e}(),IN=[].slice,wF=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return No(e,Ss),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(n){var r,i,a,o,c,f,d,p,g,b;return n in this.cache?this.cache[n]:(o=this.file.loca,r=this.file.contents,i=o.indexOf(n),(a=o.lengthOf(n))===0?this.cache[n]=null:(r.pos=this.offset+i,c=(f=new Ac(r.read(a))).readShort(),p=f.readShort(),b=f.readShort(),d=f.readShort(),g=f.readShort(),this.cache[n]=c===-1?new _F(f,p,b,d,g):new SF(f,c,p,b,d,g),this.cache[n]))},e.prototype.encode=function(n,r,i){var a,o,c,f,d;for(c=[],o=[],f=0,d=r.length;f<d;f++)a=n[r[f]],o.push(c.length),a&&(c=c.concat(a.encode(i)));return o.push(c.length),{table:c,offsets:o}},e}(),SF=function(){function t(e,n,r,i,a,o){this.raw=e,this.numberOfContours=n,this.xMin=r,this.yMin=i,this.xMax=a,this.yMax=o,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),_F=function(){function t(e,n,r,i,a){var o,c;for(this.raw=e,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=a,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;c=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&c;)o.pos+=1&c?4:2,128&c?o.pos+=8:64&c?o.pos+=4:8&c&&(o.pos+=2)}return t.prototype.encode=function(){var e,n,r;for(n=new Ac(IN.call(this.raw.data)),e=0,r=this.glyphIDs.length;e<r;++e)n.pos=this.glyphOffsets[e];return n.data},t}(),NF=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return No(e,Ss),e.prototype.tag="loca",e.prototype.parse=function(n){var r,i;return n.pos=this.offset,r=this.file.head.indexToLocFormat,this.offsets=r===0?(function(){var a,o;for(o=[],i=0,a=this.length;i<a;i+=2)o.push(2*n.readUInt16());return o}).call(this):(function(){var a,o;for(o=[],i=0,a=this.length;i<a;i+=4)o.push(n.readUInt32());return o}).call(this)},e.prototype.indexOf=function(n){return this.offsets[n]},e.prototype.lengthOf=function(n){return this.offsets[n+1]-this.offsets[n]},e.prototype.encode=function(n,r){for(var i=new Uint32Array(this.offsets.length),a=0,o=0,c=0;c<i.length;++c)if(i[c]=a,o<r.length&&r[o]==c){++o,i[c]=a;var f=this.offsets[c],d=this.offsets[c+1]-f;d>0&&(a+=d)}for(var p=new Array(4*i.length),g=0;g<i.length;++g)p[4*g+3]=255&i[g],p[4*g+2]=(65280&i[g])>>8,p[4*g+1]=(16711680&i[g])>>16,p[4*g]=(4278190080&i[g])>>24;return p},e}(),AF=function(){function t(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var e,n,r,i,a;for(n in i=this.font.cmap.tables[0].codeMap,e={},a=this.subset)r=a[n],e[n]=i[r];return e},t.prototype.glyphsFor=function(e){var n,r,i,a,o,c,f;for(i={},o=0,c=e.length;o<c;o++)i[a=e[o]]=this.font.glyf.glyphFor(a);for(a in n=[],i)(r=i[a])!=null&&r.compound&&n.push.apply(n,r.glyphIDs);if(n.length>0)for(a in f=this.glyphsFor(n))r=f[a],i[a]=r;return i},t.prototype.encode=function(e,n){var r,i,a,o,c,f,d,p,g,b,y,N,w,k,C;for(i in r=FN.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(e),y={0:0},C=r.charMap)y[(f=C[i]).old]=f.new;for(N in b=r.maxGlyphID,o)N in y||(y[N]=b++);return p=function(L){var j,z;for(j in z={},L)z[L[j]]=j;return z}(y),g=Object.keys(p).sort(function(L,j){return L-j}),w=function(){var L,j,z;for(z=[],L=0,j=g.length;L<j;L++)c=g[L],z.push(p[c]);return z}(),a=this.font.glyf.encode(o,w,y),d=this.font.loca.encode(a.offsets,w),k={cmap:this.font.cmap.raw(),glyf:a.table,loca:d,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(k["OS/2"]=this.font.os2.raw()),this.font.directory.encode(k)},t}();Tt.API.PDFObject=function(){var t;function e(){}return t=function(n,r){return(Array(r+1).join("0")+n).slice(-r)},e.convert=function(n){var r,i,a,o;if(Array.isArray(n))return"["+function(){var c,f,d;for(d=[],c=0,f=n.length;c<f;c++)r=n[c],d.push(e.convert(r));return d}().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n?.isString)return"("+n+")";if(n instanceof Date)return"(D:"+t(n.getUTCFullYear(),4)+t(n.getUTCMonth(),2)+t(n.getUTCDate(),2)+t(n.getUTCHours(),2)+t(n.getUTCMinutes(),2)+t(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(i in a=["<<"],n)o=n[i],a.push("/"+i+" "+e.convert(o));return a.push(">>"),a.join(`
`)}return""+n},e}();function zN(t,e,n,r,i){r=r||{};var a=1.15,o=i.internal.scaleFactor,c=i.internal.getFontSize()/o,f=i.getLineHeightFactor?i.getLineHeightFactor():a,d=c*f,p=/\r\n|\r|\n/g,g="",b=1;if((r.valign==="middle"||r.valign==="bottom"||r.halign==="center"||r.halign==="right")&&(g=typeof t=="string"?t.split(p):t,b=g.length||1),n+=c*(2-a),r.valign==="middle"?n-=b/2*d:r.valign==="bottom"&&(n-=b*d),r.halign==="center"||r.halign==="right"){var y=c;if(r.halign==="center"&&(y*=.5),g&&b>=1){for(var N=0;N<g.length;N++)i.text(g[N],e-i.getStringUnitWidth(g[N])*y,n),n+=d;return i}e-=i.getStringUnitWidth(t)*y}return r.halign==="justify"?i.text(t,e,n,{maxWidth:r.maxWidth||100,align:"justify"}):i.text(t,e,n),i}var Iw={},Vf=function(){function t(e){this.jsPDFDocument=e,this.userStyles={textColor:e.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:e.internal.getFontSize(),fontStyle:e.internal.getFont().fontStyle,font:e.internal.getFont().fontName,lineWidth:e.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:e.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return t.setDefaults=function(e,n){n===void 0&&(n=null),n?n.__autoTableDocumentDefaults=e:Iw=e},t.unifyColor=function(e){return Array.isArray(e)?e:typeof e=="number"?[e,e,e]:typeof e=="string"?[e]:null},t.prototype.applyStyles=function(e,n){var r,i,a;n===void 0&&(n=!1),e.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(e.fontStyle);var o=this.jsPDFDocument.internal.getFont(),c=o.fontStyle,f=o.fontName;if(e.font&&(f=e.font),e.fontStyle){c=e.fontStyle;var d=this.getFontList()[f];d&&d.indexOf(c)===-1&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(d[0]),c=d[0])}if(this.jsPDFDocument.setFont(f,c),e.fontSize&&this.jsPDFDocument.setFontSize(e.fontSize),!n){var p=t.unifyColor(e.fillColor);p&&(r=this.jsPDFDocument).setFillColor.apply(r,p),p=t.unifyColor(e.textColor),p&&(i=this.jsPDFDocument).setTextColor.apply(i,p),p=t.unifyColor(e.lineColor),p&&(a=this.jsPDFDocument).setDrawColor.apply(a,p),typeof e.lineWidth=="number"&&this.jsPDFDocument.setLineWidth(e.lineWidth)}},t.prototype.splitTextToSize=function(e,n,r){return this.jsPDFDocument.splitTextToSize(e,n,r)},t.prototype.rect=function(e,n,r,i,a){return this.jsPDFDocument.rect(e,n,r,i,a)},t.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},t.prototype.getTextWidth=function(e){return this.jsPDFDocument.getTextWidth(e)},t.prototype.getDocument=function(){return this.jsPDFDocument},t.prototype.setPage=function(e){this.jsPDFDocument.setPage(e)},t.prototype.addPage=function(){return this.jsPDFDocument.addPage()},t.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},t.prototype.getGlobalOptions=function(){return Iw||{}},t.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},t.prototype.pageSize=function(){var e=this.jsPDFDocument.internal.pageSize;return e.width==null&&(e={width:e.getWidth(),height:e.getHeight()}),e},t.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},t.prototype.getLineHeightFactor=function(){var e=this.jsPDFDocument;return e.getLineHeightFactor?e.getLineHeightFactor():1.15},t.prototype.getLineHeight=function(e){return e/this.scaleFactor()*this.getLineHeightFactor()},t.prototype.pageNumber=function(){var e=this.jsPDFDocument.internal.getCurrentPageInfo();return e?e.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},t}(),U2=function(t,e){return U2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},U2(t,e)};function HN(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");U2(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var UN=function(t){HN(e,t);function e(n){var r=t.call(this)||this;return r._element=n,r}return e}(Array);function CF(t){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/t,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}}function kF(t){var e={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}};return e[t]}function fg(t,e,n){n.applyStyles(e,!0);var r=Array.isArray(t)?t:[t],i=r.map(function(a){return n.getTextWidth(a)}).reduce(function(a,o){return Math.max(a,o)},0);return i}function qN(t,e,n,r){var i=e.settings.tableLineWidth,a=e.settings.tableLineColor;t.applyStyles({lineWidth:i,lineColor:a});var o=WN(i,!1);o&&t.rect(n.x,n.y,e.getWidth(t.pageSize().width),r.y-n.y,o)}function WN(t,e){var n=t>0,r=e||e===0;return n&&r?"DF":n?"S":r?"F":null}function Yg(t,e){var n,r,i,a;if(t=t||e,Array.isArray(t)){if(t.length>=4)return{top:t[0],right:t[1],bottom:t[2],left:t[3]};if(t.length===3)return{top:t[0],right:t[1],bottom:t[2],left:t[1]};if(t.length===2)return{top:t[0],right:t[1],bottom:t[0],left:t[1]};t.length===1?t=t[0]:t=e}return typeof t=="object"?(typeof t.vertical=="number"&&(t.top=t.vertical,t.bottom=t.vertical),typeof t.horizontal=="number"&&(t.right=t.horizontal,t.left=t.horizontal),{left:(n=t.left)!==null&&n!==void 0?n:e,top:(r=t.top)!==null&&r!==void 0?r:e,right:(i=t.right)!==null&&i!==void 0?i:e,bottom:(a=t.bottom)!==null&&a!==void 0?a:e}):(typeof t!="number"&&(t=e),{top:t,right:t,bottom:t,left:t})}function YN(t,e){var n=Yg(e.settings.margin,0);return t.pageSize().width-(n.left+n.right)}function MF(t,e,n,r,i){var a={},o=1.3333333333333333,c=Y1(e,function(j){return i.getComputedStyle(j).backgroundColor});c!=null&&(a.fillColor=c);var f=Y1(e,function(j){return i.getComputedStyle(j).color});f!=null&&(a.textColor=f);var d=EF(r,n);d&&(a.cellPadding=d);var p="borderTopColor",g=o*n,b=r.borderTopWidth;if(r.borderBottomWidth===b&&r.borderRightWidth===b&&r.borderLeftWidth===b){var y=(parseFloat(b)||0)/g;y&&(a.lineWidth=y)}else a.lineWidth={top:(parseFloat(r.borderTopWidth)||0)/g,right:(parseFloat(r.borderRightWidth)||0)/g,bottom:(parseFloat(r.borderBottomWidth)||0)/g,left:(parseFloat(r.borderLeftWidth)||0)/g},a.lineWidth.top||(a.lineWidth.right?p="borderRightColor":a.lineWidth.bottom?p="borderBottomColor":a.lineWidth.left&&(p="borderLeftColor"));var N=Y1(e,function(j){return i.getComputedStyle(j)[p]});N!=null&&(a.lineColor=N);var w=["left","right","center","justify"];w.indexOf(r.textAlign)!==-1&&(a.halign=r.textAlign),w=["middle","bottom","top"],w.indexOf(r.verticalAlign)!==-1&&(a.valign=r.verticalAlign);var k=parseInt(r.fontSize||"");isNaN(k)||(a.fontSize=k/o);var C=LF(r);C&&(a.fontStyle=C);var L=(r.fontFamily||"").toLowerCase();return t.indexOf(L)!==-1&&(a.font=L),a}function LF(t){var e="";return(t.fontWeight==="bold"||t.fontWeight==="bolder"||parseInt(t.fontWeight)>=700)&&(e="bold"),(t.fontStyle==="italic"||t.fontStyle==="oblique")&&(e+="italic"),e}function Y1(t,e){var n=VN(t,e);if(!n)return null;var r=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var i=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],a=parseInt(r[4]);return a===0||isNaN(i[0])||isNaN(i[1])||isNaN(i[2])?null:i}function VN(t,e){var n=e(t);return n==="rgba(0, 0, 0, 0)"||n==="transparent"||n==="initial"||n==="inherit"?t.parentElement==null?null:VN(t.parentElement,e):n}function EF(t,e){var n=[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft],r=96/(72/e),i=(parseInt(t.lineHeight)-parseInt(t.fontSize))/e/2,a=n.map(function(c){return parseInt(c||"0")/r}),o=Yg(a,0);return i>o.top&&(o.top=i),i>o.bottom&&(o.bottom=i),o}function GN(t,e,n,r,i){var a,o;r===void 0&&(r=!1),i===void 0&&(i=!1);var c;typeof e=="string"?c=n.document.querySelector(e):c=e;var f=Object.keys(t.getFontList()),d=t.scaleFactor(),p=[],g=[],b=[];if(!c)return console.error("Html table could not be found with input: ",e),{head:p,body:g,foot:b};for(var y=0;y<c.rows.length;y++){var N=c.rows[y],w=(o=(a=N?.parentElement)===null||a===void 0?void 0:a.tagName)===null||o===void 0?void 0:o.toLowerCase(),k=DF(f,d,n,N,r,i);k&&(w==="thead"?p.push(k):w==="tfoot"?b.push(k):g.push(k))}return{head:p,body:g,foot:b}}function DF(t,e,n,r,i,a){for(var o=new UN(r),c=0;c<r.cells.length;c++){var f=r.cells[c],d=n.getComputedStyle(f);if(i||d.display!=="none"){var p=void 0;a&&(p=MF(t,f,e,d,n)),o.push({rowSpan:f.rowSpan,colSpan:f.colSpan,styles:p,_element:f,content:jF(f)})}}var g=n.getComputedStyle(r);if(o.length>0&&(i||g.display!=="none"))return o}function jF(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split(/<br.*?>/).map(function(n){return n.trim()}).join(`
`),e.innerText||e.textContent||""}function OF(t,e,n){for(var r=0,i=[t,e,n];r<i.length;r++){var a=i[r];a&&typeof a!="object"&&console.error("The options parameter should be of type object, is: "+typeof a),a.startY&&typeof a.startY!="number"&&(console.error("Invalid value for startY option",a.startY),delete a.startY)}}function fl(t,e,n,r,i){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var a=Object(t),o=1;o<arguments.length;o++){var c=arguments[o];if(c!=null)for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(a[f]=c[f])}return a}function TF(t,e){var n=new Vf(t),r=n.getDocumentOptions(),i=n.getGlobalOptions();OF(i,r,e);var a=fl({},i,r,e),o;typeof window<"u"&&(o=window);var c=RF(i,r,e),f=PF(i,r,e),d=BF(n,a),p=IF(n,a,o);return{id:e.tableId,content:p,hooks:f,styles:c,settings:d}}function RF(t,e,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},i=function(f){if(f==="columnStyles"){var d=t[f],p=e[f],g=n[f];r.columnStyles=fl({},d,p,g)}else{var b=[t,e,n],y=b.map(function(N){return N[f]||{}});r[f]=fl({},y[0],y[1],y[2])}},a=0,o=Object.keys(r);a<o.length;a++){var c=o[a];i(c)}return r}function PF(t,e,n){for(var r=[t,e,n],i={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},a=0,o=r;a<o.length;a++){var c=o[a];c.didParseCell&&i.didParseCell.push(c.didParseCell),c.willDrawCell&&i.willDrawCell.push(c.willDrawCell),c.didDrawCell&&i.didDrawCell.push(c.didDrawCell),c.willDrawPage&&i.willDrawPage.push(c.willDrawPage),c.didDrawPage&&i.didDrawPage.push(c.didDrawPage)}return i}function BF(t,e){var n,r,i,a,o,c,f,d,p,g,b,y,N=Yg(e.margin,40/t.scaleFactor()),w=(n=FF(t,e.startY))!==null&&n!==void 0?n:N.top,k;e.showFoot===!0?k="everyPage":e.showFoot===!1?k="never":k=(r=e.showFoot)!==null&&r!==void 0?r:"everyPage";var C;e.showHead===!0?C="everyPage":e.showHead===!1?C="never":C=(i=e.showHead)!==null&&i!==void 0?i:"everyPage";var L=(a=e.useCss)!==null&&a!==void 0?a:!1,j=e.theme||(L?"plain":"striped"),z=!!e.horizontalPageBreak,O=(o=e.horizontalPageBreakRepeat)!==null&&o!==void 0?o:null;return{includeHiddenHtml:(c=e.includeHiddenHtml)!==null&&c!==void 0?c:!1,useCss:L,theme:j,startY:w,margin:N,pageBreak:(f=e.pageBreak)!==null&&f!==void 0?f:"auto",rowPageBreak:(d=e.rowPageBreak)!==null&&d!==void 0?d:"auto",tableWidth:(p=e.tableWidth)!==null&&p!==void 0?p:"auto",showHead:C,showFoot:k,tableLineWidth:(g=e.tableLineWidth)!==null&&g!==void 0?g:0,tableLineColor:(b=e.tableLineColor)!==null&&b!==void 0?b:200,horizontalPageBreak:z,horizontalPageBreakRepeat:O,horizontalPageBreakBehaviour:(y=e.horizontalPageBreakBehaviour)!==null&&y!==void 0?y:"afterAllRows"}}function FF(t,e){var n=t.getLastAutoTable(),r=t.scaleFactor(),i=t.pageNumber(),a=!1;if(n&&n.startPageNumber){var o=n.startPageNumber+n.pageNumber-1;a=o===i}return typeof e=="number"?e:(e==null||e===!1)&&a&&n?.finalY!=null?n.finalY+20/r:null}function IF(t,e,n){var r=e.head||[],i=e.body||[],a=e.foot||[];if(e.html){var o=e.includeHiddenHtml;if(n){var c=GN(t,e.html,n,o,e.useCss)||{};r=c.head||r,i=c.body||r,a=c.foot||r}else console.error("Cannot parse html in non browser environment")}var f=e.columns||zF(r,i,a);return{columns:f,head:r,body:i,foot:a}}function zF(t,e,n){var r=t[0]||e[0]||n[0]||[],i=[];return Object.keys(r).filter(function(a){return a!=="_element"}).forEach(function(a){var o=1,c;Array.isArray(r)?c=r[parseInt(a)]:c=r[a],typeof c=="object"&&!Array.isArray(c)&&(o=c?.colSpan||1);for(var f=0;f<o;f++){var d=void 0;Array.isArray(r)?d=i.length:d=a+(f>0?"_".concat(f):"");var p={dataKey:d};i.push(p)}}),i}var q2=function(){function t(e,n,r){this.table=n,this.pageNumber=n.pageNumber,this.settings=n.settings,this.cursor=r,this.doc=e.getDocument()}return t}(),HF=function(t){HN(e,t);function e(n,r,i,a,o,c){var f=t.call(this,n,r,c)||this;return f.cell=i,f.row=a,f.column=o,f.section=a.section,f}return e}(q2),UF=function(){function t(e,n){this.pageNumber=1,this.id=e.id,this.settings=e.settings,this.styles=e.styles,this.hooks=e.hooks,this.columns=n.columns,this.head=n.head,this.body=n.body,this.foot=n.foot}return t.prototype.getHeadHeight=function(e){return this.head.reduce(function(n,r){return n+r.getMaxCellHeight(e)},0)},t.prototype.getFootHeight=function(e){return this.foot.reduce(function(n,r){return n+r.getMaxCellHeight(e)},0)},t.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},t.prototype.callCellHooks=function(e,n,r,i,a,o){for(var c=0,f=n;c<f.length;c++){var d=f[c],p=new HF(e,this,r,i,a,o),g=d(p)===!1;if(r.text=Array.isArray(r.text)?r.text:[r.text],g)return!1}return!0},t.prototype.callEndPageHooks=function(e,n){e.applyStyles(e.userStyles);for(var r=0,i=this.hooks.didDrawPage;r<i.length;r++){var a=i[r];a(new q2(e,this,n))}},t.prototype.callWillDrawPageHooks=function(e,n){for(var r=0,i=this.hooks.willDrawPage;r<i.length;r++){var a=i[r];a(new q2(e,this,n))}},t.prototype.getWidth=function(e){if(typeof this.settings.tableWidth=="number")return this.settings.tableWidth;if(this.settings.tableWidth==="wrap"){var n=this.columns.reduce(function(i,a){return i+a.wrappedWidth},0);return n}else{var r=this.settings.margin;return e-r.left-r.right}},t}(),$N=function(){function t(e,n,r,i,a){a===void 0&&(a=!1),this.height=0,this.raw=e,e instanceof UN&&(this.raw=e._element,this.element=e._element),this.index=n,this.section=r,this.cells=i,this.spansMultiplePages=a}return t.prototype.getMaxCellHeight=function(e){var n=this;return e.reduce(function(r,i){var a;return Math.max(r,((a=n.cells[i.index])===null||a===void 0?void 0:a.height)||0)},0)},t.prototype.hasRowSpan=function(e){var n=this;return e.filter(function(r){var i=n.cells[r.index];return i?i.rowSpan>1:!1}).length>0},t.prototype.canEntireRowFit=function(e,n){return this.getMaxCellHeight(n)<=e},t.prototype.getMinimumRowHeight=function(e,n){var r=this;return e.reduce(function(i,a){var o=r.cells[a.index];if(!o)return 0;var c=n.getLineHeight(o.styles.fontSize),f=o.padding("vertical"),d=f+c;return d>i?d:i},0)},t}(),XN=function(){function t(e,n,r){var i;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.x=0,this.y=0,this.styles=n,this.section=r,this.raw=e;var a=e;e!=null&&typeof e=="object"&&!Array.isArray(e)?(this.rowSpan=e.rowSpan||1,this.colSpan=e.colSpan||1,a=(i=e.content)!==null&&i!==void 0?i:e,e._element&&(this.raw=e._element)):(this.rowSpan=1,this.colSpan=1);var o=a!=null?""+a:"",c=/\r\n|\r|\n/g;this.text=o.split(c)}return t.prototype.getTextPos=function(){var e;if(this.styles.valign==="top")e=this.y+this.padding("top");else if(this.styles.valign==="bottom")e=this.y+this.height-this.padding("bottom");else{var n=this.height-this.padding("vertical");e=this.y+n/2+this.padding("top")}var r;if(this.styles.halign==="right")r=this.x+this.width-this.padding("right");else if(this.styles.halign==="center"){var i=this.width-this.padding("horizontal");r=this.x+i/2+this.padding("left")}else r=this.x+this.padding("left");return{x:r,y:e}},t.prototype.getContentHeight=function(e,n){n===void 0&&(n=1.15);var r=Array.isArray(this.text)?this.text.length:1,i=this.styles.fontSize/e*n,a=r*i+this.padding("vertical");return Math.max(a,this.styles.minCellHeight)},t.prototype.padding=function(e){var n=Yg(this.styles.cellPadding,0);return e==="vertical"?n.top+n.bottom:e==="horizontal"?n.left+n.right:n[e]},t}(),qF=function(){function t(e,n,r){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=e,this.raw=n,this.index=r}return t.prototype.getMaxCustomCellWidth=function(e){for(var n=0,r=0,i=e.allRows();r<i.length;r++){var a=i[r],o=a.cells[this.index];o&&typeof o.styles.cellWidth=="number"&&(n=Math.max(n,o.styles.cellWidth))}return n},t}();function WF(t,e){YF(t,e);var n=[],r=0;e.columns.forEach(function(a){var o=a.getMaxCustomCellWidth(e);o?a.width=o:(a.width=a.wrappedWidth,n.push(a)),r+=a.width});var i=e.getWidth(t.pageSize().width)-r;i&&(i=W2(n,i,function(a){return Math.max(a.minReadableWidth,a.minWidth)})),i&&(i=W2(n,i,function(a){return a.minWidth})),i=Math.abs(i),!e.settings.horizontalPageBreak&&i>.1/t.scaleFactor()&&(i=i<1?i:Math.round(i),console.warn("Of the table content, ".concat(i," units width could not fit page"))),GF(e),$F(e,t),VF(e)}function YF(t,e){var n=t.scaleFactor(),r=e.settings.horizontalPageBreak,i=YN(t,e);e.allRows().forEach(function(a){for(var o=0,c=e.columns;o<c.length;o++){var f=c[o],d=a.cells[f.index];if(d){var p=e.hooks.didParseCell;e.callCellHooks(t,p,d,a,f,null);var g=d.padding("horizontal");d.contentWidth=fg(d.text,d.styles,t)+g;var b=fg(d.text.join(" ").split(/[^\S\u00A0]+/),d.styles,t);if(d.minReadableWidth=b+d.padding("horizontal"),typeof d.styles.cellWidth=="number")d.minWidth=d.styles.cellWidth,d.wrappedWidth=d.styles.cellWidth;else if(d.styles.cellWidth==="wrap"||r===!0)d.contentWidth>i?(d.minWidth=i,d.wrappedWidth=i):(d.minWidth=d.contentWidth,d.wrappedWidth=d.contentWidth);else{var y=10/n;d.minWidth=d.styles.minCellWidth||y,d.wrappedWidth=d.contentWidth,d.minWidth>d.wrappedWidth&&(d.wrappedWidth=d.minWidth)}}}}),e.allRows().forEach(function(a){for(var o=0,c=e.columns;o<c.length;o++){var f=c[o],d=a.cells[f.index];if(d&&d.colSpan===1)f.wrappedWidth=Math.max(f.wrappedWidth,d.wrappedWidth),f.minWidth=Math.max(f.minWidth,d.minWidth),f.minReadableWidth=Math.max(f.minReadableWidth,d.minReadableWidth);else{var p=e.styles.columnStyles[f.dataKey]||e.styles.columnStyles[f.index]||{},g=p.cellWidth||p.minCellWidth;g&&typeof g=="number"&&(f.minWidth=g,f.wrappedWidth=g)}d&&(d.colSpan>1&&!f.minWidth&&(f.minWidth=d.minWidth),d.colSpan>1&&!f.wrappedWidth&&(f.wrappedWidth=d.minWidth))}})}function W2(t,e,n){for(var r=e,i=t.reduce(function(y,N){return y+N.wrappedWidth},0),a=0;a<t.length;a++){var o=t[a],c=o.wrappedWidth/i,f=r*c,d=o.width+f,p=n(o),g=d<p?p:d;e-=g-o.width,o.width=g}if(e=Math.round(e*1e10)/1e10,e){var b=t.filter(function(y){return e<0?y.width>n(y):!0});b.length&&(e=W2(b,e,n))}return e}function VF(t){for(var e={},n=1,r=t.allRows(),i=0;i<r.length;i++)for(var a=r[i],o=0,c=t.columns;o<c.length;o++){var f=c[o],d=e[f.index];if(n>1)n--,delete a.cells[f.index];else if(d)d.cell.height+=a.height,n=d.cell.colSpan,delete a.cells[f.index],d.left--,d.left<=1&&delete e[f.index];else{var p=a.cells[f.index];if(!p)continue;if(p.height=a.height,p.rowSpan>1){var g=r.length-i,b=p.rowSpan>g?g:p.rowSpan;e[f.index]={cell:p,left:b,row:a}}}}}function GF(t){for(var e=t.allRows(),n=0;n<e.length;n++)for(var r=e[n],i=null,a=0,o=0,c=0;c<t.columns.length;c++){var f=t.columns[c];if(o-=1,o>1&&t.columns[c+1])a+=f.width,delete r.cells[f.index];else if(i){var d=i;delete r.cells[f.index],i=null,d.width=f.width+a}else{var d=r.cells[f.index];if(!d)continue;if(o=d.colSpan,a=0,d.colSpan>1){i=d,a+=f.width;continue}d.width=f.width+a}}}function $F(t,e){for(var n={count:0,height:0},r=0,i=t.allRows();r<i.length;r++){for(var a=i[r],o=0,c=t.columns;o<c.length;o++){var f=c[o],d=a.cells[f.index];if(d){e.applyStyles(d.styles,!0);var p=d.width-d.padding("horizontal");if(d.styles.overflow==="linebreak")d.text=e.splitTextToSize(d.text,p+1/e.scaleFactor(),{fontSize:d.styles.fontSize});else if(d.styles.overflow==="ellipsize")d.text=zw(d.text,p,d.styles,e,"...");else if(d.styles.overflow==="hidden")d.text=zw(d.text,p,d.styles,e,"");else if(typeof d.styles.overflow=="function"){var g=d.styles.overflow(d.text,p);typeof g=="string"?d.text=[g]:d.text=g}d.contentHeight=d.getContentHeight(e.scaleFactor(),e.getLineHeightFactor());var b=d.contentHeight/d.rowSpan;d.rowSpan>1&&n.count*n.height<b*d.rowSpan?n={height:b,count:d.rowSpan}:n&&n.count>0&&n.height>b&&(b=n.height),b>a.height&&(a.height=b)}}n.count--}}function zw(t,e,n,r,i){return t.map(function(a){return XF(a,e,n,r,i)})}function XF(t,e,n,r,i){var a=1e4*r.scaleFactor();if(e=Math.ceil(e*a)/a,e>=fg(t,n,r))return t;for(;e<fg(t+i,n,r)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+i}function ZF(t,e){var n=new Vf(t),r=KF(e,n.scaleFactor()),i=new UF(e,r);return WF(n,i),n.applyStyles(n.userStyles),i}function KF(t,e){var n=t.content,r=JF(n.columns);if(n.head.length===0){var i=Hw(r,"head");i&&n.head.push(i)}if(n.foot.length===0){var i=Hw(r,"foot");i&&n.foot.push(i)}var a=t.settings.theme,o=t.styles;return{columns:r,head:V1("head",n.head,r,o,a,e),body:V1("body",n.body,r,o,a,e),foot:V1("foot",n.foot,r,o,a,e)}}function V1(t,e,n,r,i,a){var o={},c=e.map(function(f,d){for(var p=0,g={},b=0,y=0,N=0,w=n;N<w.length;N++){var k=w[N];if(o[k.index]==null||o[k.index].left===0)if(y===0){var C=void 0;Array.isArray(f)?C=f[k.index-b-p]:C=f[k.dataKey];var L={};typeof C=="object"&&!Array.isArray(C)&&(L=C?.styles||{});var j=eI(t,k,d,i,r,a,L),z=new XN(C,j,t);g[k.dataKey]=z,g[k.index]=z,y=z.colSpan-1,o[k.index]={left:z.rowSpan-1,times:y}}else y--,b++;else o[k.index].left--,y=o[k.index].times,p++}return new $N(f,d,t,g)});return c}function Hw(t,e){var n={};return t.forEach(function(r){if(r.raw!=null){var i=QF(e,r.raw);i!=null&&(n[r.dataKey]=i)}}),Object.keys(n).length>0?n:null}function QF(t,e){if(t==="head"){if(typeof e=="object")return e.header||null;if(typeof e=="string"||typeof e=="number")return e}else if(t==="foot"&&typeof e=="object")return e.footer;return null}function JF(t){return t.map(function(e,n){var r,i;return typeof e=="object"?i=(r=e.dataKey)!==null&&r!==void 0?r:n:i=n,new qF(i,e,n)})}function eI(t,e,n,r,i,a,o){var c=kF(r),f;t==="head"?f=i.headStyles:t==="body"?f=i.bodyStyles:t==="foot"&&(f=i.footStyles);var d=fl({},c.table,c[t],i.styles,f),p=i.columnStyles[e.dataKey]||i.columnStyles[e.index]||{},g=t==="body"?p:{},b=t==="body"&&n%2===0?fl({},c.alternateRow,i.alternateRowStyles):{},y=CF(a),N=fl({},y,d,b,g);return fl(N,o)}function tI(t,e,n){var r;n===void 0&&(n={});var i=YN(t,e),a=new Map,o=[],c=[],f=[];Array.isArray(e.settings.horizontalPageBreakRepeat)?f=e.settings.horizontalPageBreakRepeat:(typeof e.settings.horizontalPageBreakRepeat=="string"||typeof e.settings.horizontalPageBreakRepeat=="number")&&(f=[e.settings.horizontalPageBreakRepeat]),f.forEach(function(b){var y=e.columns.find(function(N){return N.dataKey===b||N.index===b});y&&!a.has(y.index)&&(a.set(y.index,!0),o.push(y.index),c.push(e.columns[y.index]),i-=y.wrappedWidth)});for(var d=!0,p=(r=n?.start)!==null&&r!==void 0?r:0;p<e.columns.length;){if(a.has(p)){p++;continue}var g=e.columns[p].wrappedWidth;if(d||i>=g)d=!1,o.push(p),c.push(e.columns[p]),i-=g;else break;p++}return{colIndexes:o,columns:c,lastIndex:p-1}}function nI(t,e){for(var n=[],r=0;r<e.columns.length;r++){var i=tI(t,e,{start:r});i.columns.length&&(n.push(i),r=i.lastIndex)}return n}function rI(t,e){var n=e.settings,r=n.startY,i=n.margin,a={x:i.left,y:r},o=e.getHeadHeight(e.columns)+e.getFootHeight(e.columns),c=r+i.bottom+o;if(n.pageBreak==="avoid"){var f=e.body,d=f.reduce(function(b,y){return b+y.height},0);c+=d}var p=new Vf(t);(n.pageBreak==="always"||n.startY!=null&&c>p.pageSize().height)&&(KN(p),a.y=i.top),e.callWillDrawPageHooks(p,a);var g=fl({},a);e.startPageNumber=p.pageNumber(),n.horizontalPageBreak?iI(p,e,g,a):(p.applyStyles(p.userStyles),(n.showHead==="firstPage"||n.showHead==="everyPage")&&e.head.forEach(function(b){return yl(p,e,b,a,e.columns)}),p.applyStyles(p.userStyles),e.body.forEach(function(b,y){var N=y===e.body.length-1;dg(p,e,b,N,g,a,e.columns)}),p.applyStyles(p.userStyles),(n.showFoot==="lastPage"||n.showFoot==="everyPage")&&e.foot.forEach(function(b){return yl(p,e,b,a,e.columns)})),qN(p,e,g,a),e.callEndPageHooks(p,a),e.finalY=a.y,t.lastAutoTable=e,p.applyStyles(p.userStyles)}function iI(t,e,n,r){var i=nI(t,e),a=e.settings;if(a.horizontalPageBreakBehaviour==="afterAllRows")i.forEach(function(d,p){t.applyStyles(t.userStyles),p>0?Mh(t,e,n,r,d.columns,!0):Uw(t,e,r,d.columns),aI(t,e,n,r,d.columns),G1(t,e,r,d.columns)});else for(var o=-1,c=i[0],f=function(){var d=o;if(c){t.applyStyles(t.userStyles);var p=c.columns;o>=0?Mh(t,e,n,r,p,!0):Uw(t,e,r,p),d=qw(t,e,o+1,r,p),G1(t,e,r,p)}var g=d-o;i.slice(1).forEach(function(b){t.applyStyles(t.userStyles),Mh(t,e,n,r,b.columns,!0),qw(t,e,o+1,r,b.columns,g),G1(t,e,r,b.columns)}),o=d};o<e.body.length-1;)f()}function Uw(t,e,n,r){var i=e.settings;t.applyStyles(t.userStyles),(i.showHead==="firstPage"||i.showHead==="everyPage")&&e.head.forEach(function(a){return yl(t,e,a,n,r)})}function aI(t,e,n,r,i){t.applyStyles(t.userStyles),e.body.forEach(function(a,o){var c=o===e.body.length-1;dg(t,e,a,c,n,r,i)})}function qw(t,e,n,r,i,a){t.applyStyles(t.userStyles),a=a??e.body.length;var o=Math.min(n+a,e.body.length),c=-1;return e.body.slice(n,o).forEach(function(f,d){var p=n+d===e.body.length-1,g=ZN(t,e,p,r);f.canEntireRowFit(g,i)&&(yl(t,e,f,r,i),c=n+d)}),c}function G1(t,e,n,r){var i=e.settings;t.applyStyles(t.userStyles),(i.showFoot==="lastPage"||i.showFoot==="everyPage")&&e.foot.forEach(function(a){return yl(t,e,a,n,r)})}function sI(t,e,n){var r=n.getLineHeight(t.styles.fontSize),i=t.padding("vertical"),a=Math.floor((e-i)/r);return Math.max(0,a)}function oI(t,e,n,r){var i={};t.spansMultiplePages=!0,t.height=0;for(var a=0,o=0,c=n.columns;o<c.length;o++){var f=c[o],d=t.cells[f.index];if(d){Array.isArray(d.text)||(d.text=[d.text]);var p=new XN(d.raw,d.styles,d.section);p=fl(p,d),p.text=[];var g=sI(d,e,r);d.text.length>g&&(p.text=d.text.splice(g,d.text.length));var b=r.scaleFactor(),y=r.getLineHeightFactor();d.contentHeight=d.getContentHeight(b,y),d.contentHeight>=e&&(d.contentHeight=e,p.styles.minCellHeight-=e),d.contentHeight>t.height&&(t.height=d.contentHeight),p.contentHeight=p.getContentHeight(b,y),p.contentHeight>a&&(a=p.contentHeight),i[f.index]=p}}var N=new $N(t.raw,-1,t.section,i,!0);N.height=a;for(var w=0,k=n.columns;w<k.length;w++){var f=k[w],p=N.cells[f.index];p&&(p.height=N.height);var d=t.cells[f.index];d&&(d.height=t.height)}return N}function lI(t,e,n,r){var i=t.pageSize().height,a=r.settings.margin,o=a.top+a.bottom,c=i-o;e.section==="body"&&(c-=r.getHeadHeight(r.columns)+r.getFootHeight(r.columns));var f=e.getMinimumRowHeight(r.columns,t),d=f<n;if(f>c)return console.error("Will not be able to print row ".concat(e.index," correctly since it's minimum height is larger than page height")),!0;if(!d)return!1;var p=e.hasRowSpan(r.columns),g=e.getMaxCellHeight(r.columns)>c;return g?(p&&console.error("The content of row ".concat(e.index," will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.")),!0):!(p||r.settings.rowPageBreak==="avoid")}function dg(t,e,n,r,i,a,o){var c=ZN(t,e,r,a);if(n.canEntireRowFit(c,o))yl(t,e,n,a,o);else if(lI(t,n,c,e)){var f=oI(n,c,e,t);yl(t,e,n,a,o),Mh(t,e,i,a,o),dg(t,e,f,r,i,a,o)}else Mh(t,e,i,a,o),dg(t,e,n,r,i,a,o)}function yl(t,e,n,r,i){r.x=e.settings.margin.left;for(var a=0,o=i;a<o.length;a++){var c=o[a],f=n.cells[c.index];if(!f){r.x+=c.width;continue}t.applyStyles(f.styles),f.x=r.x,f.y=r.y;var d=e.callCellHooks(t,e.hooks.willDrawCell,f,n,c,r);if(d===!1){r.x+=c.width;continue}cI(t,f,r);var p=f.getTextPos();zN(f.text,p.x,p.y,{halign:f.styles.halign,valign:f.styles.valign,maxWidth:Math.ceil(f.width-f.padding("left")-f.padding("right"))},t.getDocument()),e.callCellHooks(t,e.hooks.didDrawCell,f,n,c,r),r.x+=c.width}r.y+=n.height}function cI(t,e,n){var r=e.styles;if(t.getDocument().setFillColor(t.getDocument().getFillColor()),typeof r.lineWidth=="number"){var i=WN(r.lineWidth,r.fillColor);i&&t.rect(e.x,n.y,e.width,e.height,i)}else typeof r.lineWidth=="object"&&(r.fillColor&&t.rect(e.x,n.y,e.width,e.height,"F"),uI(t,e,n,r.lineWidth))}function uI(t,e,n,r){var i,a,o,c;r.top&&(i=n.x,a=n.y,o=n.x+e.width,c=n.y,r.right&&(o+=.5*r.right),r.left&&(i-=.5*r.left),f(r.top,i,a,o,c)),r.bottom&&(i=n.x,a=n.y+e.height,o=n.x+e.width,c=n.y+e.height,r.right&&(o+=.5*r.right),r.left&&(i-=.5*r.left),f(r.bottom,i,a,o,c)),r.left&&(i=n.x,a=n.y,o=n.x,c=n.y+e.height,r.top&&(a-=.5*r.top),r.bottom&&(c+=.5*r.bottom),f(r.left,i,a,o,c)),r.right&&(i=n.x+e.width,a=n.y,o=n.x+e.width,c=n.y+e.height,r.top&&(a-=.5*r.top),r.bottom&&(c+=.5*r.bottom),f(r.right,i,a,o,c));function f(d,p,g,b,y){t.getDocument().setLineWidth(d),t.getDocument().line(p,g,b,y,"S")}}function ZN(t,e,n,r){var i=e.settings.margin.bottom,a=e.settings.showFoot;return(a==="everyPage"||a==="lastPage"&&n)&&(i+=e.getFootHeight(e.columns)),t.pageSize().height-r.y-i}function Mh(t,e,n,r,i,a){i===void 0&&(i=[]),a===void 0&&(a=!1),t.applyStyles(t.userStyles),e.settings.showFoot==="everyPage"&&!a&&e.foot.forEach(function(c){return yl(t,e,c,r,i)}),e.callEndPageHooks(t,r);var o=e.settings.margin;qN(t,e,n,r),KN(t),e.pageNumber++,r.x=o.left,r.y=o.top,n.y=o.top,e.callWillDrawPageHooks(t,r),e.settings.showHead==="everyPage"&&(e.head.forEach(function(c){return yl(t,e,c,r,i)}),t.applyStyles(t.userStyles))}function KN(t){var e=t.pageNumber();t.setPage(e+1);var n=t.pageNumber();return n===e?(t.addPage(),!0):!1}function fI(t){t.API.autoTable=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],i=TF(this,r),a=ZF(this,i);return rI(this,a),this},t.API.lastAutoTable=!1,t.API.autoTableText=function(e,n,r,i){zN(e,n,r,i,this)},t.API.autoTableSetDefaults=function(e){return Vf.setDefaults(e,this),this},t.autoTableSetDefaults=function(e,n){Vf.setDefaults(e,n)},t.API.autoTableHtmlToJson=function(e,n){var r;if(n===void 0&&(n=!1),typeof window>"u")return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;var i=new Vf(this),a=GN(i,e,window,n,!1),o=a.head,c=a.body,f=((r=o[0])===null||r===void 0?void 0:r.map(function(d){return d.content}))||[];return{columns:f,rows:c,data:c}}}var $1;try{if(typeof window<"u"&&window){var Ww=window,Yw=Ww.jsPDF||(($1=Ww.jspdf)===null||$1===void 0?void 0:$1.jsPDF);Yw&&fI(Yw)}}catch(t){console.error("Could not apply autoTable plugin",t)}function dI({initialViolation:t,onBack:e,onUpdate:n,onNextViolation:r}){const i=Pu(),{id:a}=HA(),[o,c]=E.useState(t),[f,d]=E.useState(!1),[p,g]=E.useState(!1),[b,y]=E.useState(!1),[N,w]=E.useState(!t&&!a),[k,C]=E.useState(!1),[L,j]=E.useState(!0),[z,O]=E.useState(!1),[K,q]=E.useState(""),[H,se]=E.useState({x:0,y:0,imageX:0,imageY:0}),[le,P]=E.useState(!1),[I,ne]=E.useState(!1),[te,de]=E.useState([]),[X,J]=E.useState(""),[G,me]=E.useState(!1),[W,xe]=E.useState(""),[R,V]=E.useState(!1),[Q,ae]=E.useState(!1),[ce,he]=E.useState({show:!1,message:"",type:"success"});E.useEffect(()=>{P(!1)},[o?.id]),E.useEffect(()=>{const ie=async()=>{const Be=a||t?.id;if(!Be){console.error("No violation ID available"),w(!1),c(null);return}w(!0);try{const Le=await or.get(`/violations/${Be}`),Re=Le.data.violation||Le.data,qe=$e=>!$e||$e==="null"||$e==="undefined"?null:$e.startsWith("http")?$e:$e.startsWith("/images/")?`https://cyberhawk.pushpak.cloud${$e}`:$e.startsWith("/")?`https://cyberhawk.pushpak.cloud/images/${$e.split("/").pop()}`:`https://cyberhawk.pushpak.cloud/images/${$e}`;let ft;if(t){const $e=jt=>jt?jt.startsWith("/images/")?jt:`/images/${jt.split("/").pop()}`:null;ft={...Re,officer:Le.data.officer||Re.officer,vehicle:Le.data.vehicle||Re.vehicle,composite_image_path:qe($e(t?.composite_image_path))||qe($e(Re?.composite_image_path)),license_plate_crop_path:qe($e(t?.license_plate_crop_path))||qe($e(Re?.license_plate_crop_path)),junction_name:t?.junction_name||Re?.junction_name,police_station:t?.police_station||Re?.police_station,police_station_code:t?.police_station_code||Re?.police_station_code,junction_code:t?.junction_code||Re?.junction_code,location_text:t?.location_text||Re?.location_text,latitude:t?.latitude||Re?.latitude,longitude:t?.longitude||Re?.longitude,roi:t?.roi||Re?.roi,timestamp:t?.timestamp||Re?.timestamp,license_plate_number:t?.license_plate_number||Re?.license_plate_number,challan_status:t?.challan_status||Re?.challan_status,rejection_reason:t?.rejection_reason||Re?.rejection_reason,device_id:t?.device_id||Re?.device_id,login_id:t?.login_id||Re?.login_id}}else{const $e=jt=>jt?jt.startsWith("/images/")?jt:`/images/${jt.split("/").pop()}`:null;ft={...Re,officer:Le.data.officer||Re.officer,vehicle:Le.data.vehicle||Re.vehicle,composite_image_path:qe($e(Re?.composite_image_path)),license_plate_crop_path:qe($e(Re?.license_plate_crop_path))}}c(ft),q(ft.license_plate_number||""),ye()}catch(Le){console.error("Error fetching violation details:",Le),t?(c(t),q(t.license_plate_number||"")):c(null)}finally{w(!1)}},ye=async()=>{V(!0);try{const Le=(await or.get("/violation-types/")).data;Le&&(Array.isArray(Le)||typeof Le=="object")?de(Le):(console.warn("Invalid violation types data received in ViolationDetail:",Le),de([]))}catch(Be){console.error("Failed to fetch violation types:",Be),de([])}finally{V(!1)}};a||t?.id?(ie(),ye()):(w(!1),c(null))},[a,t?.id,i]),E.useEffect(()=>{a&&!o&&!N&&(async()=>{w(!0);try{const ye=await or.get(`/violations/${a}`),Be=ye.data.violation||ye.data,Le=qe=>!qe||qe==="null"||qe==="undefined"?null:qe.startsWith("http")?qe:qe.startsWith("/images/")?`https://cyberhawk.pushpak.cloud${qe}`:qe.startsWith("/")?`https://cyberhawk.pushpak.cloud/images/${qe.split("/").pop()}`:`https://cyberhawk.pushpak.cloud/images/${qe}`,Re={...Be,officer:ye.data.officer||Be.officer,vehicle:ye.data.vehicle||Be.vehicle,composite_image_path:Le(Be?.composite_image_path),license_plate_crop_path:Le(Be?.license_plate_crop_path)};c(Re),q(Re.license_plate_number||"")}catch(ye){console.error("Error fetching violation details on ID change:",ye),c(null)}finally{w(!1)}})()},[a,o,N]);const we=e||(()=>i("/dashboard")),Se=n||(()=>{}),Ve=async()=>{const ie=a||t?.id;if(!ie){i("/dashboard");return}w(!0);try{const ye=await or.get(`/violations/${ie}`),Be=ye.data.violation||ye.data,Le=qe=>!qe||qe==="null"||qe==="undefined"?null:qe.startsWith("http")?qe:qe.startsWith("/images/")?`https://cyberhawk.pushpak.cloud${qe}`:qe.startsWith("/")?`https://cyberhawk.pushpak.cloud/images/${qe.split("/").pop()}`:`https://cyberhawk.pushpak.cloud/images/${qe}`,Re={...Be,officer:ye.data.officer||Be.officer,vehicle:ye.data.vehicle||Be.vehicle,composite_image_path:Le(Be?.composite_image_path),license_plate_crop_path:Le(Be?.license_plate_crop_path)};c(Re),q(Re.license_plate_number||"")}catch(ye){console.error("Error retrying violation fetch:",ye),c(null)}finally{w(!1)}},He=r||(async()=>{try{const ye=(await or.get("/violations/")).data?.violations||[];if(ye.length===0){i("/dashboard");return}const Be=ye.findIndex(Re=>Re.id===o?.id);if(Be===-1){i("/dashboard");return}let Le=null;for(let Re=Be+1;Re<ye.length;Re++)if(ye[Re].challan_status?.toLowerCase()==="new"){Le=ye[Re];break}if(!Le){for(let Re=0;Re<Be;Re++)if(ye[Re].challan_status?.toLowerCase()==="new"){Le=ye[Re];break}}i(Le?`/violation/${Le.id}`:"/dashboard")}catch(ie){console.error("Failed to find next violation:",ie),i("/dashboard")}});E.useEffect(()=>{const ie=ye=>{b&&!ye.target.closest(".user-menu-container")&&y(!1)};return document.addEventListener("mousedown",ie),()=>{document.removeEventListener("mousedown",ie)}},[b]),E.useEffect(()=>{const ie=ye=>{G&&!ye.target.closest(".violation-types-container")&&me(!1)};return document.addEventListener("mousedown",ie),()=>{document.removeEventListener("mousedown",ie)}},[G]),E.useMemo(()=>{let ie=[];try{ie=o?.violation_types?JSON.parse(o.violation_types):[]}catch{ie=Array.isArray(o?.violation_types)?o.violation_types:[o?.violation_types].filter(Boolean)}if(ie=Array.isArray(ie)?ie:[ie].filter(Boolean),!Array.isArray(te)&&typeof te=="object"){const ye=[];return Object.entries(te).forEach(([Le,Re])=>{Array.isArray(Re)?Re.forEach(qe=>{qe.toLowerCase().includes(W.toLowerCase())&&ye.push(qe)}):typeof Re=="string"&&Re.toLowerCase().includes(W.toLowerCase())&&ye.push(Re)}),ye.sort((Le,Re)=>{const qe=ie.includes(Le),ft=ie.includes(Re);return qe&&!ft?-1:!qe&&ft?1:Le.localeCompare(Re)})}else return te.filter(Le=>Le.toLowerCase().includes(W.toLowerCase())).sort((Le,Re)=>{const qe=ie.includes(Le),ft=ie.includes(Re);return qe&&!ft?-1:!qe&&ft?1:Le.localeCompare(Re)})},[o?.violation_types,te,W]);const Je=(ie,ye="success")=>{he({show:!0,message:ie,type:ye}),setTimeout(()=>{he({show:!1,message:"",type:"success"})},3e3)},it=async()=>{d(!0);try{console.log("Raising challan for violation:",o.id);const ie=await or.patch(`/violations/${o.id}/raise`,{});if(console.log("Raise challan API Response:",ie.data),ie.data&&ie.data.ResponseCode==="0"){const ye={...o,challan_status:"raised"};console.log("Updated violation after raising challan:",ye),c(ye),Se&&Se(ye);const Be=ie.data.ResponseDesc||"Unknown";Je(`Challan raised successfully! Challan Number: ${Be}`),setTimeout(()=>{He?He():i("/dashboard")},1500)}else{const ye=ie.data?.ResponseDesc||"Failed to raise challan";console.error("API Error:",ie.data),Je(ye,"error")}}catch(ie){console.error("Failed to raise challan",ie),Je("Failed to raise challan","error")}finally{d(!1)}},dt=async()=>{d(!0);try{const ie=o?.composite_image_path,ye=o?.license_plate_crop_path,Be=o?.license_plate_number,Le=o?.violation_types,Re=o?.location_text,qe=o?.timestamp,ft=o?.vehicle,$e=o?.device_id,jt=o?.officer,Mt=o?.junction,mn=await or.patch(`/violations/${o.id}/reject`,{reason:"Violation rejected by officer"});console.log("Reject API Response:",mn.data),console.log("Current device_id before rejection:",$e);const Ct=mn.data.violation||mn.data;console.log("Device ID in API response:",Ct.device_id);const Gt={...Ct,composite_image_path:ie||Ct.composite_image_path,license_plate_crop_path:ye||Ct.license_plate_path,license_plate_number:Be||Ct.license_plate_number,violation_types:Le||Ct.violation_types,location_text:Re||Ct.location_text,timestamp:qe||Ct.timestamp,vehicle:ft||Ct.vehicle,device_id:$e||Ct.device_id,officer:jt||Ct.officer,junction:Mt||Ct.junction};console.log("Updated violation after preserving data:",Gt),c(Gt),Se&&Se(Gt),Je("Challan rejected successfully!"),setTimeout(()=>{He?He():i("/dashboard")},1500)}catch(ie){console.error("Failed to reject violation",ie),Je("Failed to reject challan","error")}finally{d(!1)}},ze=async()=>{if(!(!K||K.trim()==="")){d(!0);try{console.log("Current violation data before update:",o);const ie=await or.patch(`/violations/${o.id}/update-plate`,{new_plate_number:K.toUpperCase().trim()});console.log("Update plate API response:",ie.data);try{const Be=(await or.get(`/violations/${o.id}`)).data,Le={...o,...Be.violation,officer:Be.officer||o.officer,vehicle:Be.vehicle||o.vehicle,license_plate_number:K.toUpperCase().trim()};c(Le),Se&&Se(Le)}catch(ye){console.error("Failed to refresh violation data after plate update:",ye);const Be=ie.data.violation||ie.data,Le={...o,...Be,license_plate_number:K.toUpperCase().trim()};c(Le),Se&&Se(Le)}O(!1)}catch(ie){console.error("Failed to update license plate",ie)}finally{d(!1)}}},ue=()=>{localStorage.removeItem("accessToken"),i("/login")},pt=async ie=>{if(!(!ie||ie.trim()===""))try{let ye=[];try{ye=o?.violation_types?JSON.parse(o.violation_types):[]}catch{ye=Array.isArray(o?.violation_types)?o.violation_types:[o?.violation_types].filter(Boolean)}if(ye.includes(ie))return;const Be=[...ye,ie];try{ae(!0),console.log("Current violation data before violation types update:",o);const Le=await or.patch(`/violations/${o.id}/update-violation-type`,{new_violation_types:Be});console.log("Update violation types API response:",Le.data);const Re=Le.data.violation||Le.data,qe=fe(o,Le.data,{violation_types:JSON.stringify(Be)});console.log("Updated violation data:",qe),c(qe),Se&&Se(qe)}catch(Le){console.warn("API update failed, updating local state only:",Le);const Re={...o,violation_types:JSON.stringify(Be)};c(Re),Se&&Se(Re)}finally{ae(!1)}J("")}catch(ye){console.error("Failed to add violation type:",ye)}},ht=async ie=>{try{let ye=[];try{ye=o?.violation_types?JSON.parse(o.violation_types):[]}catch{ye=Array.isArray(o?.violation_types)?o.violation_types:[o?.violation_types].filter(Boolean)}const Be=ye.filter(Le=>Le!==ie);try{ae(!0),console.log("Current violation data before violation types update:",o);const Le=await or.patch(`/violations/${o.id}/update-violation-type`,{new_violation_types:Be});console.log("Update violation types API response:",Le.data);const Re=Le.data.violation||Le.data,qe=fe(o,Le.data,{violation_types:JSON.stringify(Be)});console.log("Updated violation data:",qe),c(qe),Se&&Se(qe)}catch(Le){console.warn("API update failed, updating local state only:",Le);const Re={...o,violation_types:JSON.stringify(Be)};c(Re),Se&&Se(Re)}finally{ae(!1)}}catch(ye){console.error("Failed to remove violation type:",ye)}},fe=(ie,ye,Be={})=>{const Le={...ie};if(Object.assign(Le,Be),ye){const qe=ye.violation||ye;Object.entries(qe).forEach(([ft,$e])=>{$e!=null&&$e!==""&&(Le[ft]=$e)})}return["id","device_id","login_id","police_station","police_station_code","junction_name","junction_code","location_text","latitude","longitude","roi","timestamp","license_plate_crop_path","composite_image_path","challan_status","rejection_reason","officer","vehicle","junction"].forEach(qe=>{ie[qe]&&!Le[qe]&&(Le[qe]=ie[qe])}),console.log("Merged violation data:",Le),Le},Ce=ie=>{const ye=ie?.composite_image_path||ie?.composite_image||ie?.image_path||ie?.image;if(!ye){const Le=Object.keys(ie||{}).filter(Re=>Re.toLowerCase().includes("image")||Re.toLowerCase().includes("photo")||Re.toLowerCase().includes("img"));if(Le.length>0){const Re=Le[0],qe=ie[Re];if(qe)return qe}}if(!ye||ye==="null"||ye==="undefined")return console.log("No image path, using fallback"),"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSIjRjNGNEY2Ii8+Cjx0ZXh0IHg9IjUwIiB5PSI1MCIgZm9ntC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmaWxsPSIjNjc3NDhCIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+SW1hZ2U8L3RleHQ+Cjx0ZXh0IHg9IjUwIiB5PSI2NSIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmaWxsPSIjNjc3NDhCIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+Tm90IEF2YWlsYWJsZTwvdGV4dD4KPC9zdmc+";if(ye.startsWith("http"))return console.log("Using full URL directly:",ye),ye;if(ye.startsWith("/images/")){const Be=`https://cyberhawk.pushpak.cloud${ye}`;return console.log("Constructed full URL from /images/ path:",Be),Be}if(ye.startsWith("/")){const Le=`/images/${ye.split("/").pop()}`;console.log(`Converting path to /images/: ${ye} → ${Le}`);const Re=`https://cyberhawk.pushpak.cloud${Le}`;return console.log("Constructed full URL from converted path:",Re),Re}if(ye&&!ye.startsWith("/")){const Be=`https://cyberhawk.pushpak.cloud/images/${ye}`;return console.log("Constructed full URL from filename:",Be),Be}return console.log("Using default fallback image"),"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSIjRjNGNEY2Ii8+Cjx0ZXh0IHg9IjUwIiB5PSI1MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmaWxsPSIjNjc3NDhCIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+SW1hZ2U8L3RleHQ+Cjx0ZXh0IHg9IjUwIiB5PSI2NSIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmaWxsPSIjNjc3NDhCIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+Tm90IEF2YWlsYWJsZTwvdGV4dD4KPC9zdmc+"};console.log("About to construct image URLs for violation:",o);const Oe=Ce(o);console.log("Final composite image URL:",Oe);const Ue=(ie=>{const ye=ie?.license_plate_crop_path||ie?.license_plate_image||ie?.plate_image||ie?.plate_crop_path;if(!ye){const Le=Object.keys(ie||{}).filter(Re=>Re.toLowerCase().includes("plate")||Re.toLowerCase().includes("license")||Re.toLowerCase().includes("crop"));if(Le.length>0){const Re=Le[0],qe=ie[Re];if(qe)return qe}}return!ye||ye==="null"||ye==="undefined"?null:ye.startsWith("http")?ye:ye.startsWith("/images/")?`https://cyberhawk.pushpak.cloud${ye}`:ye.startsWith("/")?`https://cyberhawk.pushpak.cloud${`/images/${ye.split("/").pop()}`}`:ye&&!ye.startsWith("/")?`https://cyberhawk.pushpak.cloud/images/${ye}`:ye})(o);return S.jsxs("div",{className:"flex h-screen bg-gray-50 overflow-hidden",children:[S.jsxs("div",{className:`${L?"w-48 lg:w-48 md:w-40 sm:w-32 xs:w-24":"w-16 lg:w-16 md:w-12 sm:w-10 xs:w-8"} bg-white border-r border-gray-200 flex flex-col fixed left-0 top-20 lg:top-20 md:top-16 sm:top-12 xs:top-10 h-full z-30 transition-all duration-300`,children:[S.jsx("div",{className:"p-2 border-b border-gray-200",children:S.jsx("button",{onClick:()=>j(!L),className:"w-8 h-8 flex items-center justify-center text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-md transition-colors",children:S.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:L?"M6 18L18 6M6 6l12 12":"M4 6h16M4 12h16M4 18h16"})})})}),S.jsxs("nav",{className:"flex-1 p-4 lg:p-4 md:p-4 sm:p-2 xs:p-2 space-y-2",children:[S.jsxs("div",{className:"flex items-center justify-between p-3 lg:p-3 md:p-3 sm:p-2 xs:p-2 rounded-lg bg-blue-50 cursor-pointer hover:bg-blue-100 transition-colors",onClick:()=>i("/dashboard"),children:[S.jsxs("div",{className:"flex items-center space-x-3 lg:space-x-3 md:space-x-3 sm:space-x-2 xs:space-x-1",children:[S.jsx("div",{className:"w-5 h-5 lg:w-5 lg:h-5 md:w-5 md:h-5 sm:w-4 sm:h-4 xs:w-3 xs:h-3 flex items-center justify-center",children:S.jsx("svg",{className:"w-5 h-5 lg:w-5 lg:h-5 md:w-5 md:h-5 sm:w-4 sm:h-4 xs:w-3 xs:h-3 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}),L&&S.jsx("span",{className:"text-sm lg:text-sm md:text-sm sm:text-xs xs:text-xs font-medium text-blue-700",children:"Violations"})]}),L&&S.jsx("div",{className:"w-2 h-2 lg:w-2 lg:h-2 md:w-2 md:h-2 sm:w-1.5 sm:h-1.5 xs:w-1 xs:h-1 bg-blue-500 rounded-full"})]}),S.jsx("div",{className:"flex items-center justify-between p-3 lg:p-3 md:p-3 sm:p-2 xs:p-2 rounded-lg bg-gray-50 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>i("/constables"),children:S.jsxs("div",{className:"flex items-center space-x-3 lg:space-x-3 md:space-x-3 sm:space-x-2 xs:space-x-1",children:[S.jsx("div",{className:"w-5 h-5 lg:w-5 lg:h-5 md:w-5 md:h-5 sm:w-4 sm:h-4 xs:w-3 xs:h-3 flex items-center justify-center",children:S.jsx("svg",{className:"w-5 h-5 lg:w-5 lg:h-5 md:w-5 md:h-5 sm:w-4 sm:h-4 xs:w-3 xs:h-3 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),L&&S.jsx("span",{className:"text-sm lg:text-sm md:text-sm sm:text-xs xs:text-xs font-medium text-gray-600",children:"Constables"})]})})]})]}),k&&S.jsx("div",{className:"md:hidden sm:block fixed inset-0 bg-black bg-opacity-50 z-20",children:S.jsxs("div",{className:"fixed left-0 top-0 h-full w-64 bg-white shadow-lg transform transition-transform duration-300 ease-in-out",children:[S.jsx("div",{className:"p-4 border-b border-gray-200",children:S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("h2",{className:"text-lg font-semibold text-gray-800",children:"Menu"}),S.jsx("button",{onClick:()=>C(!1),className:"w-8 h-8 flex items-center justify-center text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-md transition-colors",children:S.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),S.jsxs("nav",{className:"p-4 space-y-2",children:[S.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 cursor-pointer hover:bg-blue-100 transition-colors",onClick:()=>{i("/dashboard"),C(!1)},children:[S.jsxs("div",{className:"flex items-center space-x-3",children:[S.jsx("div",{className:"w-5 h-5 flex items-center justify-center",children:S.jsx("svg",{className:"w-5 h-5 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}),S.jsx("span",{className:"text-sm font-medium text-blue-700",children:"Violations"})]}),S.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full"})]}),S.jsx("div",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>{i("/constables"),C(!1)},children:S.jsxs("div",{className:"flex items-center space-x-3",children:[S.jsx("div",{className:"w-5 h-5 flex items-center justify-center",children:S.jsx("svg",{className:"w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),S.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Constables"})]})})]})]})}),S.jsxs("div",{className:`flex-1 flex flex-col transition-all duration-300 ${L?"ml-48 lg:ml-48 md:ml-40 sm:ml-32 xs:ml-24":"ml-16 lg:ml-16 md:ml-12 sm:ml-10 xs:ml-8"}`,children:[ce.show&&S.jsx("div",{className:`fixed top-20 md:top-20 sm:top-16 right-6 md:right-4 sm:right-3 z-50 px-4 md:px-3 sm:px-2 py-3 md:py-2 sm:py-1.5 rounded-lg shadow-lg transition-all duration-300 ${ce.type==="success"?"bg-green-500 text-white":"bg-red-500 text-white"}`,children:S.jsxs("div",{className:"flex items-center space-x-2 md:space-x-2 sm:space-x-1",children:[ce.type==="success"?S.jsx("svg",{className:"w-5 h-5 md:w-4 md:h-4 sm:w-3.5 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):S.jsx("svg",{className:"w-5 h-5 md:w-4 md:h-4 sm:w-3.5 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),S.jsx("span",{className:"font-medium text-sm md:text-sm sm:text-xs",children:ce.message})]})}),S.jsx("header",{className:"bg-white border-b border-gray-200 px-6 md:px-4 sm:px-3 py-2 md:py-2 sm:py-1 fixed top-0 left-0 right-0 z-20",children:S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-6 md:space-x-4 sm:space-x-3 xs:space-x-2",children:[S.jsx("div",{className:"flex items-center",children:S.jsx("img",{src:Pr("pushpakAI-logo.svg"),alt:"PUSHPAK.AI",className:"h-14 w-[145px] lg:h-14 lg:w-[145px] md:h-12 md:w-[120px] sm:h-10 sm:w-[100px] xs:h-8 xs:w-[80px]",onError:ie=>{console.error("Logo failed to load in ViolationDetail:",ie.target.src),ie.target.src!=="/image/pushpakAI-logo.svg"&&(ie.target.src="/image/pushpakAI-logo.svg")},onLoad:()=>{console.log("Logo loaded successfully in ViolationDetail:",Pr("pushpakAI-logo.svg"))}})}),S.jsx("div",{className:"border-l border-gray-300 h-12 lg:h-12 md:h-10 sm:h-8 xs:h-6"}),S.jsxs("div",{className:"flex items-center space-x-4 lg:space-x-4 md:space-x-3 sm:space-x-2 xs:space-x-1",children:[S.jsx(Ti,{variant:"ghost",onClick:we,className:"p-2 md:p-2 sm:p-1.5 hover:bg-gray-100",children:S.jsx("img",{src:Pr("left-arrow-icon.svg"),alt:"Back",className:"w-2 h-2 md:w-2 md:h-2 sm:w-1.5 sm:h-1.5",onError:ie=>{console.error("Back arrow failed to load:",ie.target.src),ie.target.src!=="/image/left-arrow-icon.svg"&&(ie.target.src="/image/left-arrow-icon.svg")},onLoad:()=>{console.log("Back arrow loaded successfully:",Pr("left-arrow-icon.svg"))}})}),S.jsx("h2",{className:"text-base md:text-base sm:text-sm font-semibold text-gray-600 font-inter",children:"Violation Detail"})]})]}),S.jsxs("div",{className:"relative user-menu-container",children:[S.jsx("button",{onClick:()=>y(!b),className:"w-12 h-12 lg:w-11 lg:h-11 md:w-10 md:h-10 sm:w-9 sm:h-9 xs:w-8 xs:h-8 rounded-full flex items-center justify-center hover:bg-gray-100 transition-colors cursor-pointer border-2 border-gray-200 hover:border-gray-300",children:S.jsx("img",{src:Pr("user-circle-icon.svg"),alt:"User",className:"w-10 h-10 lg:w-9 lg:h-9 md:w-8 md:h-8 sm:w-7 sm:h-7 xs:w-6 xs:h-6",onError:ie=>{console.error("User icon failed to load in ViolationDetail:",ie.target.src),ie.target.src!=="/image/user-circle-icon.svg"&&(ie.target.src="/image/user-circle-icon.svg")},onLoad:()=>{console.log("User icon loaded successfully in ViolationDetail:",Pr("user-circle-icon.svg"))}})}),b&&S.jsx("div",{className:"absolute right-0 mt-2 w-48 md:w-40 sm:w-36 bg-white rounded-md shadow-lg border border-gray-200 z-20",children:S.jsx("div",{className:"py-1",children:S.jsxs("button",{onClick:ue,className:"w-full text-left px-4 md:px-3 sm:px-2 py-2 md:py-1.5 sm:py-1 text-sm md:text-sm sm:text-xs text-gray-700 hover:bg-gray-100 transition-colors flex items-center gap-2",children:[S.jsx("svg",{className:"w-4 h-4 md:w-3.5 md:h-3.5 sm:w-3 sm:h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})}),"Logout"]})})})]})]})}),S.jsx("div",{className:"flex-1 p-4 lg:p-4 md:p-3 sm:p-2 xs:p-1 space-y-2 lg:space-y-2 md:space-y-2 sm:space-y-1 xs:space-y-1 mt-16 lg:mt-16 md:mt-12 sm:mt-10 xs:mt-8 bg-white font-inter flex flex-col",children:N?S.jsx("div",{className:"flex items-center justify-center h-64 md:h-56 sm:h-48",children:S.jsxs("div",{className:"text-center",children:[S.jsx("div",{className:"animate-spin rounded-full h-12 w-12 md:h-10 md:w-10 sm:h-8 sm:w-8 border-b-2 border-blue-600 mx-auto mb-4 md:mb-3 sm:mb-2"}),S.jsx("p",{className:"text-gray-600 md:text-sm sm:text-xs",children:"Loading violation details..."}),!a&&!t?.id&&S.jsx("p",{className:"text-gray-500 text-xs mt-2",children:"Waiting for violation ID..."})]})}):o?S.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-10 gap-4 md:gap-3 sm:gap-2 w-full flex-grow",children:[S.jsxs("div",{className:"lg:col-span-5 md:col-span-10 sm:col-span-10 space-y-4 md:space-y-3 sm:space-y-2",children:[S.jsxs("div",{children:[S.jsx("h3",{className:"text-lg md:text-base sm:text-sm font-semibold text-gray-700 mb-6 md:mb-5 sm:mb-4 font-inter text-left",children:"License Plate"}),S.jsx("div",{className:"w-full max-w-[202px] md:max-w-[182px] sm:max-w-[162px] mx-auto border-2 border-gray-300 rounded-lg p-1",children:S.jsx("div",{className:"aspect-[3/1] bg-gray-100 rounded-md flex items-center justify-center overflow-hidden border border-gray-200",children:Ue&&!le?S.jsx("img",{src:Ue,alt:"License Plate",className:"w-full h-full object-contain",onLoad:()=>{P(!1)},onError:ie=>{console.error("License plate crop image failed to load:",Ue),P(!0)}}):S.jsx("div",{className:"flex items-center justify-center text-gray-500",children:S.jsx("span",{className:"text-sm",children:"No License Plate Available"})})})})]}),S.jsx("div",{className:"h-8 md:h-6 sm:h-4"}),S.jsx("div",{className:"text-center border-2 border-gray-100",children:S.jsxs("div",{className:"relative overflow-hidden rounded-lg w-full mx-auto",children:[S.jsx("img",{ref:ie=>{ie&&(ie.onload=()=>{const ye=ie.parentElement.offsetWidth,Be=ie.parentElement.offsetHeight;ie.naturalWidth/ie.naturalHeight;const Le=ye/ie.naturalWidth,Re=Be/ie.naturalHeight,qe=Math.min(Le,Re),ft=ie.naturalWidth*qe,$e=ie.naturalHeight*qe,jt=(ye-ft)/2,Mt=(Be-$e)/2;ie.dataset.scale=qe,ie.dataset.containerWidth=ye,ie.dataset.containerHeight=Be,ie.dataset.naturalWidth=ie.naturalWidth,ie.dataset.naturalHeight=ie.naturalHeight,ie.dataset.displayedWidth=ft,ie.dataset.displayedHeight=$e,ie.dataset.offsetX=jt,ie.dataset.offsetY=Mt})},src:Oe,alt:`Evidence for violation #${o?.id}`,className:"rounded-lg w-full h-[320px] md:h-[280px] sm:h-[240px] max-h-[600px] object-contain mx-auto cursor-pointer",onLoad:()=>{},onError:ie=>{console.error("Image failed to load:",Oe),ie.target.src!==Pr("Capture.PNG")?ie.target.src=Pr("Capture.PNG"):ie.target.style.display="none"},onMouseMove:ie=>{const ye=ie.currentTarget,Be=ye.getBoundingClientRect(),Le=ie.clientX-Be.left,Re=ie.clientY-Be.top,qe=parseFloat(ye.dataset.offsetX)||0,ft=parseFloat(ye.dataset.offsetY)||0,$e=parseFloat(ye.dataset.displayedWidth)||Be.width,jt=parseFloat(ye.dataset.displayedHeight)||Be.height;if(!ye.dataset.naturalWidth||!ye.dataset.naturalHeight){se({x:Le,y:Re,imageX:Le,imageY:Re}),ne(!0);return}const Mt=Le-qe,mn=Re-ft;if(Mt<0||Mt>$e||mn<0||mn>jt){ne(!1);return}const Ct=Math.round(Mt),Gt=Math.round(mn);se({x:Le,y:Re,imageX:Ct,imageY:Gt}),ne(!0)},onMouseLeave:()=>{ne(!1)}}),I&&H&&(()=>{const ie=document.querySelector('img[src*="'+Ce(o).split("/").pop()+'"]');if(!ie)return null;const ye=parseInt(ie.dataset.naturalWidth)||ie.naturalWidth||1e3,Be=parseInt(ie.dataset.naturalHeight)||ie.naturalHeight||1e3,Le=1.2,Re=H.imageX||0,qe=H.imageY||0,ft=parseFloat(ie.dataset.displayedWidth)||ie.offsetWidth,$e=parseFloat(ie.dataset.displayedHeight)||ie.offsetHeight;parseFloat(ie.dataset.offsetX),parseFloat(ie.dataset.offsetY);const jt=128/Le,Mt=Re/ft*ye,mn=qe/$e*Be,Ct=Mt-jt/2,Gt=mn-jt/2,ur=ie.src||Ce(o);return S.jsx("div",{className:"absolute w-32 h-32 rounded-full shadow-2xl pointer-events-none z-10 transition-all duration-200 ease-out overflow-hidden",style:{left:`${H.x-64}px`,top:`${H.y-64}px`,boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)"},children:S.jsx("img",{src:ur,alt:"Magnified view",className:"w-full h-full",style:{width:"128px",height:"128px",objectPosition:`${-Ct}px ${-Gt}px`,objectFit:"none",imageRendering:"crisp-edges",transform:"scale(1)",backfaceVisibility:"hidden"},onError:ut=>{console.error("Magnifier image failed to load:",ur),ut.target.style.display="none"}})})})()]})})]}),S.jsx("div",{className:"lg:col-span-5 md:col-span-10 sm:col-span-10",children:S.jsx("div",{className:"space-y-4 md:space-y-3 sm:space-y-2 max-h-[calc(100vh-120px)] overflow-y-auto pr-2",children:S.jsxs("div",{className:"w-full max-w-[420px] md:max-w-full sm:max-w-full",children:[S.jsx(Eh,{className:"shadow-lg border-2 border-gray-100",children:S.jsxs(jh,{className:"p-5 md:p-4 sm:p-3",children:[S.jsxs("div",{className:"flex items-center justify-between mb-3",children:[S.jsx(Dh,{className:"font-inter text-sm md:text-sm sm:text-xs",children:"Violation Details"}),o?.challan_status&&S.jsx(yu,{className:`${o.challan_status.toLowerCase()==="new"?"bg-blue-100 text-blue-800 border-blue-200":o.challan_status.toLowerCase()==="raised"?"bg-green-100 text-green-800 border-green-200":o.challan_status.toLowerCase()==="rejected"?"bg-red-100 text-red-800 border-red-200":"bg-gray-100 text-gray-800 border-gray-200"} hover:bg-opacity-80 text-xs`,children:o.challan_status})]}),S.jsxs("div",{className:"space-y-3",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("span",{className:"font-medium text-xs md:text-xs sm:text-xs",children:"Vehicle number"}),S.jsxs("div",{className:"relative",children:[z?S.jsx(yo,{value:K,onChange:ie=>q(ie.target.value.toUpperCase()),className:"font-mono h-6 md:h-6 sm:h-5 pr-8 text-xs md:text-xs sm:text-xs bg-white border border-blue-500 ring-1 ring-blue-500 rounded-md",disabled:f,maxLength:20,placeholder:"Enter vehicle number",autoFocus:!0}):S.jsxs("div",{className:"h-6 md:h-6 sm:h-5 px-2 py-1 bg-gray-50 border border-gray-300 rounded-md flex items-center justify-between",children:[S.jsx("span",{className:"font-mono text-xs md:text-xs sm:text-xs text-gray-700",children:o?.license_plate_number||"No plate number"}),o?.challan_status?.toLowerCase()==="new"?S.jsx(Ti,{type:"button",size:"icon",variant:"ghost",className:"h-4 w-4 md:h-4 md:w-4 sm:h-3 sm:w-3 hover:bg-gray-100",onClick:ie=>{ie.preventDefault(),ie.stopPropagation(),O(!0),q(o?.license_plate_number||"")},children:S.jsx(VR,{className:"h-2 w-2 md:h-2 md:w-2 sm:h-1.5 sm:w-1.5 text-gray-500"})}):S.jsx("div",{className:"h-4 w-4 md:h-4 md:w-4 sm:h-3 sm:w-3 flex items-center justify-center",children:S.jsx("div",{className:"h-2 w-2 md:h-2 md:w-2 sm:h-1.5 sm:w-1.5 bg-gray-300 rounded-full"})})]}),z&&S.jsxs("div",{className:"absolute right-1 top-1/2 transform -translate-y-1/2 flex gap-1",children:[S.jsx(Ti,{type:"button",size:"icon",variant:"ghost",className:"h-4 w-4 md:h-4 md:w-4 sm:h-3 sm:w-3 hover:bg-green-100 text-green-600",onClick:ze,disabled:f,children:f?S.jsx("div",{className:"animate-spin rounded-full h-2 w-2 md:h-2 md:w-2 sm:h-1.5 sm:w-1.5 border-b border-green-600"}):S.jsx(WR,{className:"h-2 w-2 md:h-2 md:w-2 sm:h-1.5 sm:w-1.5"})}),S.jsx(Ti,{type:"button",size:"icon",variant:"ghost",className:"h-4 w-4 md:h-4 md:w-4 sm:h-3 sm:w-3 hover:bg-red-100 text-red-600",onClick:()=>{O(!1),q(o?.license_plate_number||"")},disabled:f,children:S.jsx(k2,{className:"h-2 w-2 md:h-2 md:w-2 sm:h-1.5 sm:w-1.5"})})]})]})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("span",{className:"font-medium text-xs md:text-xs sm:text-xs",children:"Violation type"}),S.jsxs("div",{className:"relative violation-types-container",children:[S.jsx("div",{className:`min-h-[20px] bg-white border border-gray-300 rounded-md p-0.5 flex flex-wrap gap-0.5 items-center transition-colors ${Q?"cursor-not-allowed opacity-50":o?.challan_status?.toLowerCase()==="new"?"cursor-pointer hover:border-gray-400":"cursor-default"}`,onClick:()=>{Q||o?.challan_status?.toLowerCase()==="new"&&(G||xe(""),me(!G))},children:(()=>{try{const ie=o?.violation_types?JSON.parse(o.violation_types):[],ye=Array.isArray(ie)?ie:[ie].filter(Boolean);return ye.length===0?S.jsx("span",{className:"text-gray-500 text-xs",children:"-"}):ye.map((Be,Le)=>S.jsxs("div",{className:"flex items-center gap-0.5 bg-red-100 text-red-800 border border-red-300 text-xs md:text-xs sm:text-xs px-1 py-0.5 rounded-md",children:[Be,Q?S.jsx("div",{className:"animate-spin rounded-full h-2 w-2 md:h-2 md:w-2 sm:h-1.5 sm:w-1.5 border-b border-red-600"}):o?.challan_status?.toLowerCase()==="new"?S.jsx(k2,{className:"h-2 w-2 md:h-2 md:w-2 sm:h-1.5 sm:w-1.5 cursor-pointer text-red-600 hover:text-red-800",onClick:Re=>{Re.stopPropagation(),ht(Be)}}):S.jsx("div",{className:"h-2 w-2 md:h-2 md:w-2 sm:h-1.5 sm:w-1.5 bg-gray-300 rounded-full"})]},Le))}catch{return S.jsx("span",{className:"text-gray-500 text-xs",children:"-"})}})()}),S.jsx("div",{className:"absolute right-2 top-1/2 transform -translate-y-1/2 pointer-events-none",children:S.jsx("svg",{className:`w-4 h-4 md:w-4 md:h-4 sm:w-3 sm:h-3 text-gray-400 transition-transform ${G?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})}),G&&S.jsxs("div",{className:"absolute top-full left-0 right-0 mt-1 bg-white border border-gray-300 rounded-md shadow-lg z-50 max-h-[258px] overflow-y-auto",children:[S.jsx("div",{className:"sticky top-0 bg-white border-b border-gray-200 p-2",children:S.jsx(yo,{type:"text",placeholder:"Search violation types...",value:W,onChange:ie=>xe(ie.target.value),className:"h-8 md:h-7 sm:h-6 text-xs md:text-xs sm:text-xs border-gray-300 focus:border-blue-500 focus:ring-1 focus:ring-blue-500",onClick:ie=>ie.stopPropagation()})}),R?S.jsx("div",{className:"px-3 py-4 text-sm md:text-sm sm:text-xs text-gray-500 text-center",children:"Loading violation types..."}):Array.isArray(te)&&te.length>0||typeof te=="object"&&te!==null&&Object.keys(te).length>0?S.jsxs(S.Fragment,{children:[(()=>{let ie=[];try{ie=o?.violation_types?JSON.parse(o.violation_types):[],ie=Array.isArray(ie)?ie:[ie].filter(Boolean)}catch{ie=Array.isArray(o?.violation_types)?o.violation_types:[o?.violation_types].filter(Boolean)}return ie.length>0?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"px-3 py-2 text-xs md:text-xs sm:text-xs font-semibold text-gray-700 bg-gray-100 border-b border-gray-200",children:"Current Violation Types"}),ie.map(ye=>S.jsx("div",{className:`px-3 py-2 text-sm md:text-sm sm:text-xs text-gray-700 border-b border-gray-100 last:border-b-0 bg-green-50 ${Q?"cursor-not-allowed opacity-50":"hover:bg-gray-100 cursor-pointer"}`,onClick:()=>{Q||(pt(ye),me(!1),xe(""))},children:S.jsxs("span",{className:"text-green-700",children:["✓ ",ye]})},ye))]}):null})(),(()=>{if(Array.isArray(te)){const ie=te.filter(ye=>{try{const Be=o?.violation_types?JSON.parse(o.violation_types):[];return!(Array.isArray(Be)?Be:[Be].filter(Boolean)).includes(ye)&&ye.toLowerCase().includes(W.toLowerCase())}catch{return ye.toLowerCase().includes(W.toLowerCase())}});if(ie.length>0)return S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"px-3 py-2 text-xs md:text-xs sm:text-xs font-semibold text-gray-700 bg-gray-100 border-b border-gray-200",children:"Available Violation Types"}),ie.map(ye=>S.jsx("div",{className:`px-3 py-2 text-sm md:text-sm sm:text-xs text-gray-700 border-b border-gray-100 last:border-b-0 ${Q?"cursor-not-allowed opacity-50":"hover:bg-gray-100 cursor-pointer"}`,onClick:()=>{Q||(pt(ye),me(!1),xe(""))},children:ye},ye))]})}else if(typeof te=="object"&&te!==null)return Object.entries(te).map(([ie,ye])=>{let Be=[];if(Array.isArray(ye))Be=ye.filter(Le=>{try{const Re=o?.violation_types?JSON.parse(o.violation_types):[];return!(Array.isArray(Re)?Re:[Re].filter(Boolean)).includes(Le)&&Le.toLowerCase().includes(W.toLowerCase())}catch{return Le.toLowerCase().includes(W.toLowerCase())}});else if(typeof ye=="string")try{const Le=o?.violation_types?JSON.parse(o.violation_types):[];!(Array.isArray(Le)?Le:[Le].filter(Boolean)).includes(ye)&&ye.toLowerCase().includes(W.toLowerCase())&&(Be=[ye])}catch{ye.toLowerCase().includes(W.toLowerCase())&&(Be=[ye])}return Be.length>0?S.jsxs("div",{children:[S.jsx("div",{className:"px-3 py-2 text-xs md:text-xs sm:text-xs font-semibold text-gray-700 bg-gray-100 border-b border-gray-200",children:ie}),Be.map((Le,Re)=>S.jsx("div",{className:`px-3 py-2 text-sm md:text-sm sm:text-xs text-gray-700 border-b border-gray-100 last:border-b-0 pl-4 ${Q?"cursor-not-allowed opacity-50":"hover:bg-gray-100 cursor-pointer"}`,onClick:()=>{Q||(pt(Le),me(!1),xe(""))},children:Le},`${ie}-${Re}`))]},ie):null});return null})()]}):S.jsx("div",{className:"px-3 py-4 text-sm md:text-sm sm:text-xs text-gray-500 text-center",children:te.length===0?"No violation types available":"No violation types found"})]})]})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("span",{className:"font-medium text-xs md:text-xs sm:text-xs",children:"Location and Time"}),S.jsxs("div",{className:"space-y-2 text-xs md:text-xs sm:text-xs text-gray-600",children:[S.jsx("div",{children:o?.location_text||"-"}),S.jsx("div",{children:o?.timestamp?Oi(new Date(o.timestamp+"Z"),"dd - MMM - yyyy | hh:mm a"):"-"})]})]}),S.jsxs("div",{className:"space-y-3",children:[S.jsx("span",{className:"font-medium text-xs md:text-xs sm:text-xs",children:"Vehicle Details"}),S.jsx("div",{className:"border border-gray-200 rounded-md overflow-hidden",children:S.jsx("table",{className:"w-full text-xs md:text-xs sm:text-xs",children:S.jsxs("tbody",{children:[S.jsxs("tr",{className:"border-b border-gray-100",children:[S.jsx("td",{className:"px-2 py-1 text-gray-600 font-medium bg-gray-50 text-xs md:text-xs sm:text-xs",children:"Type"}),S.jsx("td",{className:"px-2 py-1 text-xs md:text-xs sm:text-xs",children:o?.vehicle?.vehicle_type||"-"})]}),S.jsxs("tr",{className:"border-b border-gray-100",children:[S.jsx("td",{className:"px-2 py-1 text-gray-600 font-medium bg-gray-50 text-xs md:text-xs sm:text-xs",children:"Maker"}),S.jsx("td",{className:"px-2 py-1 text-xs md:text-xs sm:text-xs",children:o?.vehicle?.vehicle_maker||"-"})]}),S.jsxs("tr",{className:"border-b border-gray-100",children:[S.jsx("td",{className:"px-2 py-1 text-gray-600 font-medium bg-gray-50 text-xs md:text-xs sm:text-xs",children:"Model"}),S.jsx("td",{className:"px-1 py-0.5 text-xs md:text-xs sm:text-xs",children:o?.vehicle?.vehicle_model||"-"})]}),S.jsxs("tr",{children:[S.jsx("td",{className:"px-2 py-1 text-gray-600 font-medium bg-gray-50 text-xs md:text-xs sm:text-xs",children:"Color"}),S.jsx("td",{className:"px-2 py-1 text-xs md:text-xs sm:text-xs",children:o?.vehicle?.vehicle_color||"-"})]})]})})})]}),S.jsx("div",{className:"space-y-2 pt-5",children:S.jsxs("div",{className:"flex gap-2 md:gap-2 sm:gap-1",children:[S.jsx(Ti,{variant:"destructive",className:"flex-1 h-8 md:h-8 sm:h-7 text-sm md:text-sm sm:text-xs",onClick:o?.challan_status?.toLowerCase()==="rejected"||o?.challan_status?.toLowerCase()==="raised"?void 0:dt,disabled:f||o?.challan_status?.toLowerCase()==="rejected"||o?.challan_status?.toLowerCase()==="raised",children:"Reject"}),S.jsx(Ti,{className:"flex-1 h-8 md:h-8 sm:h-7 text-sm md:text-sm sm:text-xs bg-green-600 hover:bg-green-700",onClick:o?.challan_status?.toLowerCase()==="raised"||o?.challan_status?.toLowerCase()==="rejected"?void 0:it,disabled:f||o?.challan_status?.toLowerCase()==="raised"||o?.challan_status?.toLowerCase()==="rejected",children:"Raise"})]})})]})]})}),S.jsx(Eh,{className:"shadow-lg border-2 border-gray-100",children:S.jsxs(jh,{className:"p-5 md:p-4 sm:p-3",children:[S.jsx("div",{className:"flex items-center justify-between mb-3",children:S.jsx(Dh,{className:"font-inter text-sm md:text-sm sm:text-xs",children:"Officer Details"})}),S.jsxs("div",{className:"space-y-3",children:[S.jsxs("div",{className:"space-y-1",children:[S.jsx("span",{className:"font-medium text-xs md:text-xs sm:text-xs",children:"Login ID"}),S.jsx("div",{className:"text-xs md:text-xs sm:text-xs text-gray-600",children:o?.officer?.login_id||"-"})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("span",{className:"font-medium text-xs md:text-xs sm:text-xs",children:"Name"}),S.jsx("div",{className:"text-xs md:text-xs sm:text-xs text-gray-600",children:o?.officer?.name||"-"})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("span",{className:"font-medium text-xs md:text-xs sm:text-xs",children:"Mobile number"}),S.jsx("div",{className:"text-xs md:text-xs sm:text-xs text-gray-600",children:o?.officer?.mobile||"-"})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("span",{className:"font-medium text-xs md:text-xs sm:text-xs",children:"Police station"}),S.jsx("div",{className:"text-xs md:text-xs sm:text-xs text-gray-600",children:o?.officer?.police_station||"-"})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("span",{className:"font-medium text-xs md:text-xs sm:text-xs",children:"Junction"}),S.jsx("div",{className:"text-xs md:text-xs sm:text-xs text-gray-600",children:o?.officer?.junction_name||"-"})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("span",{className:"font-medium text-xs md:text-xs sm:text-xs",children:"Device ID"}),S.jsx("div",{className:"text-xs md:text-xs sm:text-xs text-gray-600",children:o?.device_id||"-"})]})]})]})})]})})})]}):S.jsx("div",{className:"flex items-center justify-center h-64 md:h-56 sm:h-48",children:S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-gray-600 md:text-sm sm:text-xs",children:!a&&!t?.id?"No violation ID provided":"Violation not found or failed to load"}),S.jsxs("div",{className:"flex gap-2 mt-4 md:mt-3 sm:mt-2 justify-center",children:[S.jsx(Ti,{onClick:Ve,className:"bg-blue-600 hover:bg-blue-700",children:!a&&!t?.id?"Go to Dashboard":"Retry"}),S.jsx(Ti,{onClick:()=>i("/dashboard"),variant:"outline",children:"Back to Dashboard"})]})]})})}),S.jsx("div",{className:"bg-white px-4 md:px-3 sm:px-2 py-2 text-left text-sm md:text-sm sm:text-xs text-gray-400 border-t border-gray-200",children:S.jsx("p",{children:"© 2025 PushpakAI. All rights reserved."})})]})]})}function X1({children:t}){const[e,n]=E.useState(!0),[r,i]=E.useState(!1),a=xo();return E.useEffect(()=>{const o=localStorage.getItem("accessToken"),f=setTimeout(()=>{i(!!o),n(!1)},100);return()=>clearTimeout(f)},[]),e?S.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-50",children:S.jsxs("div",{className:"text-center",children:[S.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),S.jsx("p",{className:"text-gray-600",children:"Loading..."})]})}):r?t:S.jsx(Z1,{to:"/login",state:{from:a},replace:!0})}const hI=()=>S.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-50",children:S.jsxs("div",{className:"text-center",children:[S.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),S.jsx("p",{className:"text-gray-600",children:"Loading application..."})]})});class pI extends st.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("Route Error:",e,n)}render(){return this.state.hasError?S.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-50",children:S.jsxs("div",{className:"text-center max-w-md mx-auto p-6",children:[S.jsx("h1",{className:"text-xl font-semibold text-gray-800 mb-4",children:"Page Not Found"}),S.jsx("p",{className:"text-gray-600 mb-4",children:"The page you're looking for doesn't exist or there was an error loading it."}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("button",{onClick:()=>window.location.href="/dashboard",className:"w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700",children:"Go to Dashboard"}),S.jsx("button",{onClick:()=>window.location.reload(),className:"w-full px-4 py-2 bg-gray-600 text-white rounded-md hover:bg-gray-700",children:"Refresh Page"})]})]})}):this.props.children}}function mI(){return S.jsx(pI,{children:S.jsx(E.Suspense,{fallback:S.jsx(hI,{}),children:S.jsxs(tC,{children:[S.jsx(hc,{path:"/login",element:S.jsx(sM,{})}),S.jsx(hc,{path:"/verify-otp",element:S.jsx(KS,{})}),S.jsx(hc,{path:"/",element:S.jsx(Z1,{to:"/login",replace:!0})}),S.jsx(hc,{path:"/dashboard",element:S.jsx(X1,{children:S.jsx(tB,{})})}),S.jsx(hc,{path:"/constables",element:S.jsx(X1,{children:S.jsx(oB,{})})}),S.jsx(hc,{path:"/violation/:id",element:S.jsx(X1,{children:S.jsx(dI,{})})}),S.jsx(hc,{path:"*",element:S.jsx(Z1,{to:"/login",replace:!0})})]})})})}const gI=window.location.hostname==="localhost"&&window.location.port==="3000";class yI extends st.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,n){console.error("Router Error:",e,n)}render(){return this.state.hasError?S.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-50",children:S.jsxs("div",{className:"text-center",children:[S.jsx("h1",{className:"text-xl font-semibold text-gray-800 mb-4",children:"Something went wrong"}),S.jsx("p",{className:"text-gray-600 mb-4",children:"Please refresh the page or try again."}),S.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700",children:"Refresh Page"})]})}):this.props.children}}const vI=gI?CC:AC;uA.createRoot(document.getElementById("root")).render(S.jsx(st.StrictMode,{children:S.jsx(yI,{children:S.jsx(vI,{children:S.jsx(mI,{})})})}));export{kn as _,bI as c,Y2 as g};
