var PyGWalkerApp=function(){"use strict";var kpi=Object.defineProperty;var Jpi=(kh,hi,iu)=>hi in kh?kpi(kh,hi,{enumerable:!0,configurable:!0,writable:!0,value:iu}):kh[hi]=iu;var LB=(kh,hi,iu)=>(Jpi(kh,typeof hi!="symbol"?hi+"":hi,iu),iu);function kh(A,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const n in i)if(n!=="default"&&!(n in A)){const o=Object.getOwnPropertyDescriptor(i,n);o&&Object.defineProperty(A,n,o.get?o:{enumerable:!0,get:()=>i[n]})}}}return Object.freeze(Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}))}var hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function iu(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var SR={},dfe={get exports(){return SR},set exports(A){SR=A}},QW={};/**
 * @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 hfe=Symbol.for("react.transitional.element"),mfe=Symbol.for("react.fragment");function rbA(A,e,t){var i=null;if(t!==void 0&&(i=""+t),e.key!==void 0&&(i=""+e.key),"key"in e){t={};for(var n in e)n!=="key"&&(t[n]=e[n])}else t=e;return e=t.ref,{$$typeof:hfe,type:A,key:i,ref:e!==void 0?e:null,props:t}}QW.Fragment=mfe,QW.jsx=rbA,QW.jsxs=rbA,function(A){A.exports=QW}(dfe);const ua=SR.Fragment,IA=SR.jsx,PA=SR.jsxs;var p={},pfe={get exports(){return p},set exports(A){p=A}},ot={};/**
 * @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 EP=Symbol.for("react.transitional.element"),ffe=Symbol.for("react.portal"),yfe=Symbol.for("react.fragment"),bfe=Symbol.for("react.strict_mode"),wfe=Symbol.for("react.profiler"),Dfe=Symbol.for("react.consumer"),Gfe=Symbol.for("react.context"),kfe=Symbol.for("react.forward_ref"),Jfe=Symbol.for("react.suspense"),Nfe=Symbol.for("react.memo"),IbA=Symbol.for("react.lazy"),Yfe=Symbol.for("react.activity"),CbA=Symbol.iterator;function Rfe(A){return A===null||typeof A!="object"?null:(A=CbA&&A[CbA]||A["@@iterator"],typeof A=="function"?A:null)}var lbA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cbA=Object.assign,BbA={};function pD(A,e,t){this.props=A,this.context=e,this.refs=BbA,this.updater=t||lbA}pD.prototype.isReactComponent={},pD.prototype.setState=function(A,e){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,e,"setState")},pD.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function QbA(){}QbA.prototype=pD.prototype;function uP(A,e,t){this.props=A,this.context=e,this.refs=BbA,this.updater=t||lbA}var dP=uP.prototype=new QbA;dP.constructor=uP,cbA(dP,pD.prototype),dP.isPureReactComponent=!0;var EbA=Array.isArray;function hP(){}var un={H:null,A:null,T:null,S:null},ubA=Object.prototype.hasOwnProperty;function mP(A,e,t){var i=t.ref;return{$$typeof:EP,type:A,key:e,ref:i!==void 0?i:null,props:t}}function xfe(A,e){return mP(A.type,e,A.props)}function pP(A){return typeof A=="object"&&A!==null&&A.$$typeof===EP}function Ffe(A){var e={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(t){return e[t]})}var dbA=/\/+/g;function fP(A,e){return typeof A=="object"&&A!==null&&A.key!=null?Ffe(""+A.key):e.toString(36)}function Mfe(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(hP,hP):(A.status="pending",A.then(function(e){A.status==="pending"&&(A.status="fulfilled",A.value=e)},function(e){A.status==="pending"&&(A.status="rejected",A.reason=e)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function fD(A,e,t,i,n){var o=typeof A;(o==="undefined"||o==="boolean")&&(A=null);var g=!1;if(A===null)g=!0;else switch(o){case"bigint":case"string":case"number":g=!0;break;case"object":switch(A.$$typeof){case EP:case ffe:g=!0;break;case IbA:return g=A._init,fD(g(A._payload),e,t,i,n)}}if(g)return n=n(A),g=i===""?"."+fP(A,0):i,EbA(n)?(t="",g!=null&&(t=g.replace(dbA,"$&/")+"/"),fD(n,e,t,"",function(I){return I})):n!=null&&(pP(n)&&(n=xfe(n,t+(n.key==null||A&&A.key===n.key?"":(""+n.key).replace(dbA,"$&/")+"/")+g)),e.push(n)),1;g=0;var a=i===""?".":i+":";if(EbA(A))for(var s=0;s<A.length;s++)i=A[s],o=a+fP(i,s),g+=fD(i,e,t,o,n);else if(s=Rfe(A),typeof s=="function")for(A=s.call(A),s=0;!(i=A.next()).done;)i=i.value,o=a+fP(i,s++),g+=fD(i,e,t,o,n);else if(o==="object"){if(typeof A.then=="function")return fD(Mfe(A),e,t,i,n);throw e=String(A),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return g}function EW(A,e,t){if(A==null)return A;var i=[],n=0;return fD(A,i,"","",function(o){return e.call(t,o,n++)}),i}function vfe(A){if(A._status===-1){var e=A._result;e=e(),e.then(function(t){(A._status===0||A._status===-1)&&(A._status=1,A._result=t)},function(t){(A._status===0||A._status===-1)&&(A._status=2,A._result=t)}),A._status===-1&&(A._status=0,A._result=e)}if(A._status===1)return A._result.default;throw A._result}var hbA=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},Lfe={map:EW,forEach:function(A,e,t){EW(A,function(){e.apply(this,arguments)},t)},count:function(A){var e=0;return EW(A,function(){e++}),e},toArray:function(A){return EW(A,function(e){return e})||[]},only:function(A){if(!pP(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};ot.Activity=Yfe,ot.Children=Lfe,ot.Component=pD,ot.Fragment=yfe,ot.Profiler=wfe,ot.PureComponent=uP,ot.StrictMode=bfe,ot.Suspense=Jfe,ot.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=un,ot.__COMPILER_RUNTIME={__proto__:null,c:function(A){return un.H.useMemoCache(A)}},ot.cache=function(A){return function(){return A.apply(null,arguments)}},ot.cacheSignal=function(){return null},ot.cloneElement=function(A,e,t){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var i=cbA({},A.props),n=A.key;if(e!=null)for(o in e.key!==void 0&&(n=""+e.key),e)!ubA.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=t;else if(1<o){for(var g=Array(o),a=0;a<o;a++)g[a]=arguments[a+2];i.children=g}return mP(A.type,n,i)},ot.createContext=function(A){return A={$$typeof:Gfe,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:Dfe,_context:A},A},ot.createElement=function(A,e,t){var i,n={},o=null;if(e!=null)for(i in e.key!==void 0&&(o=""+e.key),e)ubA.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(n[i]=e[i]);var g=arguments.length-2;if(g===1)n.children=t;else if(1<g){for(var a=Array(g),s=0;s<g;s++)a[s]=arguments[s+2];n.children=a}if(A&&A.defaultProps)for(i in g=A.defaultProps,g)n[i]===void 0&&(n[i]=g[i]);return mP(A,o,n)},ot.createRef=function(){return{current:null}},ot.forwardRef=function(A){return{$$typeof:kfe,render:A}},ot.isValidElement=pP,ot.lazy=function(A){return{$$typeof:IbA,_payload:{_status:-1,_result:A},_init:vfe}},ot.memo=function(A,e){return{$$typeof:Nfe,type:A,compare:e===void 0?null:e}},ot.startTransition=function(A){var e=un.T,t={};un.T=t;try{var i=A(),n=un.S;n!==null&&n(t,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(hP,hbA)}catch(o){hbA(o)}finally{e!==null&&t.types!==null&&(e.types=t.types),un.T=e}},ot.unstable_useCacheRefresh=function(){return un.H.useCacheRefresh()},ot.use=function(A){return un.H.use(A)},ot.useActionState=function(A,e,t){return un.H.useActionState(A,e,t)},ot.useCallback=function(A,e){return un.H.useCallback(A,e)},ot.useContext=function(A){return un.H.useContext(A)},ot.useDebugValue=function(){},ot.useDeferredValue=function(A,e){return un.H.useDeferredValue(A,e)},ot.useEffect=function(A,e){return un.H.useEffect(A,e)},ot.useEffectEvent=function(A){return un.H.useEffectEvent(A)},ot.useId=function(){return un.H.useId()},ot.useImperativeHandle=function(A,e,t){return un.H.useImperativeHandle(A,e,t)},ot.useInsertionEffect=function(A,e){return un.H.useInsertionEffect(A,e)},ot.useLayoutEffect=function(A,e){return un.H.useLayoutEffect(A,e)},ot.useMemo=function(A,e){return un.H.useMemo(A,e)},ot.useOptimistic=function(A,e){return un.H.useOptimistic(A,e)},ot.useReducer=function(A,e,t){return un.H.useReducer(A,e,t)},ot.useRef=function(A){return un.H.useRef(A)},ot.useState=function(A){return un.H.useState(A)},ot.useSyncExternalStore=function(A,e,t){return un.H.useSyncExternalStore(A,e,t)},ot.useTransition=function(){return un.H.useTransition()},ot.version="19.2.3",function(A){A.exports=ot}(pfe);const b=iu(p),bf=kh({__proto__:null,default:b},[p]);var wf={},Sfe={get exports(){return wf},set exports(A){wf=A}},uW={},yP={},Hfe={get exports(){return yP},set exports(A){yP=A}},mbA={};/**
 * @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.
 */(function(A){function e(V,X){var _=V.length;V.push(X);A:for(;0<_;){var q=_-1>>>1,$=V[q];if(0<n($,X))V[q]=X,V[_]=$,_=q;else break A}}function t(V){return V.length===0?null:V[0]}function i(V){if(V.length===0)return null;var X=V[0],_=V.pop();if(_!==X){V[0]=_;A:for(var q=0,$=V.length,nA=$>>>1;q<nA;){var j=2*(q+1)-1,O=V[j],eA=j+1,oA=V[eA];if(0>n(O,_))eA<$&&0>n(oA,O)?(V[q]=oA,V[eA]=_,q=eA):(V[q]=O,V[j]=_,q=j);else if(eA<$&&0>n(oA,_))V[q]=oA,V[eA]=_,q=eA;else break A}}return X}function n(V,X){var _=V.sortIndex-X.sortIndex;return _!==0?_:V.id-X.id}if(A.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;A.unstable_now=function(){return o.now()}}else{var g=Date,a=g.now();A.unstable_now=function(){return g.now()-a}}var s=[],I=[],r=1,C=null,l=3,c=!1,B=!1,E=!1,u=!1,d=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function y(V){for(var X=t(I);X!==null;){if(X.callback===null)i(I);else if(X.startTime<=V)i(I),X.sortIndex=X.expirationTime,e(s,X);else break;X=t(I)}}function G(V){if(E=!1,y(V),!B)if(t(s)!==null)B=!0,R||(R=!0,N());else{var X=t(I);X!==null&&U(G,X.startTime-V)}}var R=!1,x=-1,F=5,Q=-1;function k(){return u?!0:!(A.unstable_now()-Q<F)}function h(){if(u=!1,R){var V=A.unstable_now();Q=V;var X=!0;try{A:{B=!1,E&&(E=!1,f(x),x=-1),c=!0;var _=l;try{e:{for(y(V),C=t(s);C!==null&&!(C.expirationTime>V&&k());){var q=C.callback;if(typeof q=="function"){C.callback=null,l=C.priorityLevel;var $=q(C.expirationTime<=V);if(V=A.unstable_now(),typeof $=="function"){C.callback=$,y(V),X=!0;break e}C===t(s)&&i(s),y(V)}else i(s);C=t(s)}if(C!==null)X=!0;else{var nA=t(I);nA!==null&&U(G,nA.startTime-V),X=!1}}break A}finally{C=null,l=_,c=!1}X=void 0}}finally{X?N():R=!1}}}var N;if(typeof w=="function")N=function(){w(h)};else if(typeof MessageChannel<"u"){var v=new MessageChannel,K=v.port2;v.port1.onmessage=h,N=function(){K.postMessage(null)}}else N=function(){d(h,0)};function U(V,X){x=d(function(){V(A.unstable_now())},X)}A.unstable_IdlePriority=5,A.unstable_ImmediatePriority=1,A.unstable_LowPriority=4,A.unstable_NormalPriority=3,A.unstable_Profiling=null,A.unstable_UserBlockingPriority=2,A.unstable_cancelCallback=function(V){V.callback=null},A.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<V?Math.floor(1e3/V):5},A.unstable_getCurrentPriorityLevel=function(){return l},A.unstable_next=function(V){switch(l){case 1:case 2:case 3:var X=3;break;default:X=l}var _=l;l=X;try{return V()}finally{l=_}},A.unstable_requestPaint=function(){u=!0},A.unstable_runWithPriority=function(V,X){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var _=l;l=V;try{return X()}finally{l=_}},A.unstable_scheduleCallback=function(V,X,_){var q=A.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?q+_:q):_=q,V){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=_+$,V={id:r++,callback:X,priorityLevel:V,startTime:_,expirationTime:$,sortIndex:-1},_>q?(V.sortIndex=_,e(I,V),t(s)===null&&V===t(I)&&(E?(f(x),x=-1):E=!0,U(G,_-q))):(V.sortIndex=$,e(s,V),B||c||(B=!0,R||(R=!0,N()))),V},A.unstable_shouldYield=k,A.unstable_wrapCallback=function(V){var X=l;return function(){var _=l;l=X;try{return V.apply(this,arguments)}finally{l=_}}}})(mbA),function(A){A.exports=mbA}(Hfe);var bt={},Zfe={get exports(){return bt},set exports(A){bt=A}},qa={};/**
 * @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 Wfe=p;function pbA(A){var e="https://react.dev/errors/"+A;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+A+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Jh(){}var ja={d:{f:Jh,r:function(){throw Error(pbA(522))},D:Jh,C:Jh,L:Jh,m:Jh,X:Jh,S:Jh,M:Jh},p:0,findDOMNode:null},Kfe=Symbol.for("react.portal");function Ufe(A,e,t){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Kfe,key:i==null?null:""+i,children:A,containerInfo:e,implementation:t}}var HR=Wfe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function dW(A,e){if(A==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}qa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ja,qa.createPortal=function(A,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(pbA(299));return Ufe(A,e,null,t)},qa.flushSync=function(A){var e=HR.T,t=ja.p;try{if(HR.T=null,ja.p=2,A)return A()}finally{HR.T=e,ja.p=t,ja.d.f()}},qa.preconnect=function(A,e){typeof A=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,ja.d.C(A,e))},qa.prefetchDNS=function(A){typeof A=="string"&&ja.d.D(A)},qa.preinit=function(A,e){if(typeof A=="string"&&e&&typeof e.as=="string"){var t=e.as,i=dW(t,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?ja.d.S(A,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:n,fetchPriority:o}):t==="script"&&ja.d.X(A,{crossOrigin:i,integrity:n,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}},qa.preinitModule=function(A,e){if(typeof A=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=dW(e.as,e.crossOrigin);ja.d.M(A,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&ja.d.M(A)},qa.preload=function(A,e){if(typeof A=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,i=dW(t,e.crossOrigin);ja.d.L(A,t,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}},qa.preloadModule=function(A,e){if(typeof A=="string")if(e){var t=dW(e.as,e.crossOrigin);ja.d.m(A,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else ja.d.m(A)},qa.requestFormReset=function(A){ja.d.r(A)},qa.unstable_batchedUpdates=function(A,e){return A(e)},qa.useFormState=function(A,e,t){return HR.H.useFormState(A,e,t)},qa.useFormStatus=function(){return HR.H.useHostTransitionStatus()},qa.version="19.2.3",function(A){function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}e(),A.exports=qa}(Zfe);const bP=iu(bt);/**
 * @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 Uo=yP,fbA=p,Vfe=bt;function MA(A){var e="https://react.dev/errors/"+A;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+A+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ybA(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)}function ZR(A){var e=A,t=A;if(A.alternate)for(;e.return;)e=e.return;else{A=e;do e=A,e.flags&4098&&(t=e.return),A=e.return;while(A)}return e.tag===3?t:null}function bbA(A){if(A.tag===13){var e=A.memoizedState;if(e===null&&(A=A.alternate,A!==null&&(e=A.memoizedState)),e!==null)return e.dehydrated}return null}function wbA(A){if(A.tag===31){var e=A.memoizedState;if(e===null&&(A=A.alternate,A!==null&&(e=A.memoizedState)),e!==null)return e.dehydrated}return null}function DbA(A){if(ZR(A)!==A)throw Error(MA(188))}function Xfe(A){var e=A.alternate;if(!e){if(e=ZR(A),e===null)throw Error(MA(188));return e!==A?null:A}for(var t=A,i=e;;){var n=t.return;if(n===null)break;var o=n.alternate;if(o===null){if(i=n.return,i!==null){t=i;continue}break}if(n.child===o.child){for(o=n.child;o;){if(o===t)return DbA(n),A;if(o===i)return DbA(n),e;o=o.sibling}throw Error(MA(188))}if(t.return!==i.return)t=n,i=o;else{for(var g=!1,a=n.child;a;){if(a===t){g=!0,t=n,i=o;break}if(a===i){g=!0,i=n,t=o;break}a=a.sibling}if(!g){for(a=o.child;a;){if(a===t){g=!0,t=o,i=n;break}if(a===i){g=!0,i=o,t=n;break}a=a.sibling}if(!g)throw Error(MA(189))}}if(t.alternate!==i)throw Error(MA(190))}if(t.tag!==3)throw Error(MA(188));return t.stateNode.current===t?A:e}function GbA(A){var e=A.tag;if(e===5||e===26||e===27||e===6)return A;for(A=A.child;A!==null;){if(e=GbA(A),e!==null)return e;A=A.sibling}return null}var dn=Object.assign,zfe=Symbol.for("react.element"),hW=Symbol.for("react.transitional.element"),WR=Symbol.for("react.portal"),yD=Symbol.for("react.fragment"),kbA=Symbol.for("react.strict_mode"),wP=Symbol.for("react.profiler"),JbA=Symbol.for("react.consumer"),nu=Symbol.for("react.context"),DP=Symbol.for("react.forward_ref"),GP=Symbol.for("react.suspense"),kP=Symbol.for("react.suspense_list"),JP=Symbol.for("react.memo"),Nh=Symbol.for("react.lazy"),NP=Symbol.for("react.activity"),Tfe=Symbol.for("react.memo_cache_sentinel"),NbA=Symbol.iterator;function KR(A){return A===null||typeof A!="object"?null:(A=NbA&&A[NbA]||A["@@iterator"],typeof A=="function"?A:null)}var _fe=Symbol.for("react.client.reference");function YP(A){if(A==null)return null;if(typeof A=="function")return A.$$typeof===_fe?null:A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case yD:return"Fragment";case wP:return"Profiler";case kbA:return"StrictMode";case GP:return"Suspense";case kP:return"SuspenseList";case NP:return"Activity"}if(typeof A=="object")switch(A.$$typeof){case WR:return"Portal";case nu:return A.displayName||"Context";case JbA:return(A._context.displayName||"Context")+".Consumer";case DP:var e=A.render;return A=A.displayName,A||(A=e.displayName||e.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case JP:return e=A.displayName||null,e!==null?e:YP(A.type)||"Memo";case Nh:e=A._payload,A=A._init;try{return YP(A(e))}catch{}}return null}var UR=Array.isArray,Ze=fbA.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Bi=Vfe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Df={pending:!1,data:null,method:null,action:null},RP=[],bD=-1;function SB(A){return{current:A}}function ag(A){0>bD||(A.current=RP[bD],RP[bD]=null,bD--)}function nn(A,e){bD++,RP[bD]=A.current,A.current=e}var HB=SB(null),VR=SB(null),Yh=SB(null),mW=SB(null);function pW(A,e){switch(nn(Yh,e),nn(VR,A),nn(HB,null),e.nodeType){case 9:case 11:A=(A=e.documentElement)&&(A=A.namespaceURI)?ekA(A):0;break;default:if(A=e.tagName,e=e.namespaceURI)e=ekA(e),A=tkA(e,A);else switch(A){case"svg":A=1;break;case"math":A=2;break;default:A=0}}ag(HB),nn(HB,A)}function wD(){ag(HB),ag(VR),ag(Yh)}function xP(A){A.memoizedState!==null&&nn(mW,A);var e=HB.current,t=tkA(e,A.type);e!==t&&(nn(VR,A),nn(HB,t))}function fW(A){VR.current===A&&(ag(HB),ag(VR)),mW.current===A&&(ag(mW),x1._currentValue=Df)}var FP,YbA;function Gf(A){if(FP===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);FP=e&&e[1]||"",YbA=-1<t.stack.indexOf(`
    at`)?" (<anonymous>)":-1<t.stack.indexOf("@")?"@unknown:0:0":""}return`
`+FP+A+YbA}var MP=!1;function vP(A,e){if(!A||MP)return"";MP=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(c){var l=c}Reflect.construct(A,[],C)}else{try{C.call()}catch(c){l=c}A.call(C.prototype)}}else{try{throw Error()}catch(c){l=c}(C=A())&&typeof C.catch=="function"&&C.catch(function(){})}}catch(c){if(c&&l&&typeof c.stack=="string")return[c.stack,l.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),g=o[0],a=o[1];if(g&&a){var s=g.split(`
`),I=a.split(`
`);for(n=i=0;i<s.length&&!s[i].includes("DetermineComponentFrameRoot");)i++;for(;n<I.length&&!I[n].includes("DetermineComponentFrameRoot");)n++;if(i===s.length||n===I.length)for(i=s.length-1,n=I.length-1;1<=i&&0<=n&&s[i]!==I[n];)n--;for(;1<=i&&0<=n;i--,n--)if(s[i]!==I[n]){if(i!==1||n!==1)do if(i--,n--,0>n||s[i]!==I[n]){var r=`
`+s[i].replace(" at new "," at ");return A.displayName&&r.includes("<anonymous>")&&(r=r.replace("<anonymous>",A.displayName)),r}while(1<=i&&0<=n);break}}}finally{MP=!1,Error.prepareStackTrace=t}return(t=A?A.displayName||A.name:"")?Gf(t):""}function Ofe(A,e){switch(A.tag){case 26:case 27:case 5:return Gf(A.type);case 16:return Gf("Lazy");case 13:return A.child!==e&&e!==null?Gf("Suspense Fallback"):Gf("Suspense");case 19:return Gf("SuspenseList");case 0:case 15:return vP(A.type,!1);case 11:return vP(A.type.render,!1);case 1:return vP(A.type,!0);case 31:return Gf("Activity");default:return""}}function RbA(A){try{var e="",t=null;do e+=Ofe(A,t),t=A,A=A.return;while(A);return e}catch(i){return`
Error generating stack: `+i.message+`
`+i.stack}}var LP=Object.prototype.hasOwnProperty,SP=Uo.unstable_scheduleCallback,HP=Uo.unstable_cancelCallback,qfe=Uo.unstable_shouldYield,jfe=Uo.unstable_requestPaint,Tr=Uo.unstable_now,Pfe=Uo.unstable_getCurrentPriorityLevel,xbA=Uo.unstable_ImmediatePriority,FbA=Uo.unstable_UserBlockingPriority,yW=Uo.unstable_NormalPriority,$fe=Uo.unstable_LowPriority,MbA=Uo.unstable_IdlePriority,Aye=Uo.log,eye=Uo.unstable_setDisableYieldValue,XR=null,_r=null;function Rh(A){if(typeof Aye=="function"&&eye(A),_r&&typeof _r.setStrictMode=="function")try{_r.setStrictMode(XR,A)}catch{}}var Or=Math.clz32?Math.clz32:nye,tye=Math.log,iye=Math.LN2;function nye(A){return A>>>=0,A===0?32:31-(tye(A)/iye|0)|0}var bW=256,wW=262144,DW=4194304;function kf(A){var e=A&42;if(e!==0)return e;switch(A&-A){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:return A&261888;case 262144:case 524288:case 1048576:case 2097152:return A&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return A&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return A}}function GW(A,e,t){var i=A.pendingLanes;if(i===0)return 0;var n=0,o=A.suspendedLanes,g=A.pingedLanes;A=A.warmLanes;var a=i&134217727;return a!==0?(i=a&~o,i!==0?n=kf(i):(g&=a,g!==0?n=kf(g):t||(t=a&~A,t!==0&&(n=kf(t))))):(a=i&~o,a!==0?n=kf(a):g!==0?n=kf(g):t||(t=i&~A,t!==0&&(n=kf(t)))),n===0?0:e!==0&&e!==n&&!(e&o)&&(o=n&-n,t=e&-e,o>=t||o===32&&(t&4194048)!==0)?e:n}function zR(A,e){return(A.pendingLanes&~(A.suspendedLanes&~A.pingedLanes)&e)===0}function oye(A,e){switch(A){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 vbA(){var A=DW;return DW<<=1,!(DW&62914560)&&(DW=4194304),A}function ZP(A){for(var e=[],t=0;31>t;t++)e.push(A);return e}function TR(A,e){A.pendingLanes|=e,e!==268435456&&(A.suspendedLanes=0,A.pingedLanes=0,A.warmLanes=0)}function gye(A,e,t,i,n,o){var g=A.pendingLanes;A.pendingLanes=t,A.suspendedLanes=0,A.pingedLanes=0,A.warmLanes=0,A.expiredLanes&=t,A.entangledLanes&=t,A.errorRecoveryDisabledLanes&=t,A.shellSuspendCounter=0;var a=A.entanglements,s=A.expirationTimes,I=A.hiddenUpdates;for(t=g&~t;0<t;){var r=31-Or(t),C=1<<r;a[r]=0,s[r]=-1;var l=I[r];if(l!==null)for(I[r]=null,r=0;r<l.length;r++){var c=l[r];c!==null&&(c.lane&=-536870913)}t&=~C}i!==0&&LbA(A,i,0),o!==0&&n===0&&A.tag!==0&&(A.suspendedLanes|=o&~(g&~e))}function LbA(A,e,t){A.pendingLanes|=e,A.suspendedLanes&=~e;var i=31-Or(e);A.entangledLanes|=e,A.entanglements[i]=A.entanglements[i]|1073741824|t&261930}function SbA(A,e){var t=A.entangledLanes|=e;for(A=A.entanglements;t;){var i=31-Or(t),n=1<<i;n&e|A[i]&e&&(A[i]|=e),t&=~n}}function HbA(A,e){var t=e&-e;return t=t&42?1:WP(t),t&(A.suspendedLanes|e)?0:t}function WP(A){switch(A){case 2:A=1;break;case 8:A=4;break;case 32:A=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:A=128;break;case 268435456:A=134217728;break;default:A=0}return A}function KP(A){return A&=-A,2<A?8<A?A&134217727?32:268435456:8:2}function ZbA(){var A=Bi.p;return A!==0?A:(A=window.event,A===void 0?32:wkA(A.type))}function WbA(A,e){var t=Bi.p;try{return Bi.p=A,e()}finally{Bi.p=t}}var xh=Math.random().toString(36).slice(2),Lg="__reactFiber$"+xh,zs="__reactProps$"+xh,DD="__reactContainer$"+xh,UP="__reactEvents$"+xh,aye="__reactListeners$"+xh,sye="__reactHandles$"+xh,KbA="__reactResources$"+xh,_R="__reactMarker$"+xh;function VP(A){delete A[Lg],delete A[zs],delete A[UP],delete A[aye],delete A[sye]}function GD(A){var e=A[Lg];if(e)return e;for(var t=A.parentNode;t;){if(e=t[DD]||t[Lg]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(A=rkA(A);A!==null;){if(t=A[Lg])return t;A=rkA(A)}return e}A=t,t=A.parentNode}return null}function kD(A){if(A=A[Lg]||A[DD]){var e=A.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return A}return null}function OR(A){var e=A.tag;if(e===5||e===26||e===27||e===6)return A.stateNode;throw Error(MA(33))}function JD(A){var e=A[KbA];return e||(e=A[KbA]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function sg(A){A[_R]=!0}var UbA=new Set,VbA={};function Jf(A,e){ND(A,e),ND(A+"Capture",e)}function ND(A,e){for(VbA[A]=e,A=0;A<e.length;A++)UbA.add(e[A])}var rye=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]*$"),XbA={},zbA={};function Iye(A){return LP.call(zbA,A)?!0:LP.call(XbA,A)?!1:rye.test(A)?zbA[A]=!0:(XbA[A]=!0,!1)}function kW(A,e,t){if(Iye(e))if(t===null)A.removeAttribute(e);else{switch(typeof t){case"undefined":case"function":case"symbol":A.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){A.removeAttribute(e);return}}A.setAttribute(e,""+t)}}function JW(A,e,t){if(t===null)A.removeAttribute(e);else{switch(typeof t){case"undefined":case"function":case"symbol":case"boolean":A.removeAttribute(e);return}A.setAttribute(e,""+t)}}function ou(A,e,t,i){if(i===null)A.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":A.removeAttribute(t);return}A.setAttributeNS(e,t,""+i)}}function cC(A){switch(typeof A){case"bigint":case"boolean":case"number":case"string":case"undefined":return A;case"object":return A;default:return""}}function TbA(A){var e=A.type;return(A=A.nodeName)&&A.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Cye(A,e,t){var i=Object.getOwnPropertyDescriptor(A.constructor.prototype,e);if(!A.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var n=i.get,o=i.set;return Object.defineProperty(A,e,{configurable:!0,get:function(){return n.call(this)},set:function(g){t=""+g,o.call(this,g)}}),Object.defineProperty(A,e,{enumerable:i.enumerable}),{getValue:function(){return t},setValue:function(g){t=""+g},stopTracking:function(){A._valueTracker=null,delete A[e]}}}}function XP(A){if(!A._valueTracker){var e=TbA(A)?"checked":"value";A._valueTracker=Cye(A,e,""+A[e])}}function _bA(A){if(!A)return!1;var e=A._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return A&&(i=TbA(A)?A.checked?"true":"false":A.value),A=i,A!==t?(e.setValue(A),!0):!1}function NW(A){if(A=A||(typeof document<"u"?document:void 0),typeof A>"u")return null;try{return A.activeElement||A.body}catch{return A.body}}var lye=/[\n"\\]/g;function BC(A){return A.replace(lye,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function zP(A,e,t,i,n,o,g,a){A.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?A.type=g:A.removeAttribute("type"),e!=null?g==="number"?(e===0&&A.value===""||A.value!=e)&&(A.value=""+cC(e)):A.value!==""+cC(e)&&(A.value=""+cC(e)):g!=="submit"&&g!=="reset"||A.removeAttribute("value"),e!=null?TP(A,g,cC(e)):t!=null?TP(A,g,cC(t)):i!=null&&A.removeAttribute("value"),n==null&&o!=null&&(A.defaultChecked=!!o),n!=null&&(A.checked=n&&typeof n!="function"&&typeof n!="symbol"),a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?A.name=""+cC(a):A.removeAttribute("name")}function ObA(A,e,t,i,n,o,g,a){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(A.type=o),e!=null||t!=null){if(!(o!=="submit"&&o!=="reset"||e!=null)){XP(A);return}t=t!=null?""+cC(t):"",e=e!=null?""+cC(e):t,a||e===A.value||(A.value=e),A.defaultValue=e}i=i??n,i=typeof i!="function"&&typeof i!="symbol"&&!!i,A.checked=a?A.checked:!!i,A.defaultChecked=!!i,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(A.name=g),XP(A)}function TP(A,e,t){e==="number"&&NW(A.ownerDocument)===A||A.defaultValue===""+t||(A.defaultValue=""+t)}function YD(A,e,t,i){if(A=A.options,e){e={};for(var n=0;n<t.length;n++)e["$"+t[n]]=!0;for(t=0;t<A.length;t++)n=e.hasOwnProperty("$"+A[t].value),A[t].selected!==n&&(A[t].selected=n),n&&i&&(A[t].defaultSelected=!0)}else{for(t=""+cC(t),e=null,n=0;n<A.length;n++){if(A[n].value===t){A[n].selected=!0,i&&(A[n].defaultSelected=!0);return}e!==null||A[n].disabled||(e=A[n])}e!==null&&(e.selected=!0)}}function qbA(A,e,t){if(e!=null&&(e=""+cC(e),e!==A.value&&(A.value=e),t==null)){A.defaultValue!==e&&(A.defaultValue=e);return}A.defaultValue=t!=null?""+cC(t):""}function jbA(A,e,t,i){if(e==null){if(i!=null){if(t!=null)throw Error(MA(92));if(UR(i)){if(1<i.length)throw Error(MA(93));i=i[0]}t=i}t==null&&(t=""),e=t}t=cC(e),A.defaultValue=t,i=A.textContent,i===t&&i!==""&&i!==null&&(A.value=i),XP(A)}function RD(A,e){if(e){var t=A.firstChild;if(t&&t===A.lastChild&&t.nodeType===3){t.nodeValue=e;return}}A.textContent=e}var cye=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 PbA(A,e,t){var i=e.indexOf("--")===0;t==null||typeof t=="boolean"||t===""?i?A.setProperty(e,""):e==="float"?A.cssFloat="":A[e]="":i?A.setProperty(e,t):typeof t!="number"||t===0||cye.has(e)?e==="float"?A.cssFloat=t:A[e]=(""+t).trim():A[e]=t+"px"}function $bA(A,e,t){if(e!=null&&typeof e!="object")throw Error(MA(62));if(A=A.style,t!=null){for(var i in t)!t.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?A.setProperty(i,""):i==="float"?A.cssFloat="":A[i]="");for(var n in e)i=e[n],e.hasOwnProperty(n)&&t[n]!==i&&PbA(A,n,i)}else for(var o in e)e.hasOwnProperty(o)&&PbA(A,o,e[o])}function _P(A){if(A.indexOf("-")===-1)return!1;switch(A){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 Bye=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"]]),Qye=/^[\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 YW(A){return Qye.test(""+A)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":A}function gu(){}var OP=null;function qP(A){return A=A.target||A.srcElement||window,A.correspondingUseElement&&(A=A.correspondingUseElement),A.nodeType===3?A.parentNode:A}var xD=null,FD=null;function AwA(A){var e=kD(A);if(e&&(A=e.stateNode)){var t=A[zs]||null;A:switch(A=e.stateNode,e.type){case"input":if(zP(A,t.value,t.defaultValue,t.defaultValue,t.checked,t.defaultChecked,t.type,t.name),e=t.name,t.type==="radio"&&e!=null){for(t=A;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll('input[name="'+BC(""+e)+'"][type="radio"]'),e=0;e<t.length;e++){var i=t[e];if(i!==A&&i.form===A.form){var n=i[zs]||null;if(!n)throw Error(MA(90));zP(i,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(e=0;e<t.length;e++)i=t[e],i.form===A.form&&_bA(i)}break A;case"textarea":qbA(A,t.value,t.defaultValue);break A;case"select":e=t.value,e!=null&&YD(A,!!t.multiple,e,!1)}}}var jP=!1;function ewA(A,e,t){if(jP)return A(e,t);jP=!0;try{var i=A(e);return i}finally{if(jP=!1,(xD!==null||FD!==null)&&(d3(),xD&&(e=xD,A=FD,FD=xD=null,AwA(e),A)))for(e=0;e<A.length;e++)AwA(A[e])}}function qR(A,e){var t=A.stateNode;if(t===null)return null;var i=t[zs]||null;if(i===null)return null;t=i[e];A:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(A=A.type,i=!(A==="button"||A==="input"||A==="select"||A==="textarea")),A=!i;break A;default:A=!1}if(A)return null;if(t&&typeof t!="function")throw Error(MA(231,e,typeof t));return t}var au=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),PP=!1;if(au)try{var jR={};Object.defineProperty(jR,"passive",{get:function(){PP=!0}}),window.addEventListener("test",jR,jR),window.removeEventListener("test",jR,jR)}catch{PP=!1}var Fh=null,$P=null,RW=null;function twA(){if(RW)return RW;var A,e=$P,t=e.length,i,n="value"in Fh?Fh.value:Fh.textContent,o=n.length;for(A=0;A<t&&e[A]===n[A];A++);var g=t-A;for(i=1;i<=g&&e[t-i]===n[o-i];i++);return RW=n.slice(A,1<i?1-i:void 0)}function xW(A){var e=A.keyCode;return"charCode"in A?(A=A.charCode,A===0&&e===13&&(A=13)):A=e,A===10&&(A=13),32<=A||A===13?A:0}function FW(){return!0}function iwA(){return!1}function Ts(A){function e(t,i,n,o,g){this._reactName=t,this._targetInst=n,this.type=i,this.nativeEvent=o,this.target=g,this.currentTarget=null;for(var a in A)A.hasOwnProperty(a)&&(t=A[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?FW:iwA,this.isPropagationStopped=iwA,this}return dn(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=FW)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=FW)},persist:function(){},isPersistent:FW}),e}var Nf={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(A){return A.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},MW=Ts(Nf),PR=dn({},Nf,{view:0,detail:0}),Eye=Ts(PR),A7,e7,$R,vW=dn({},PR,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:i7,button:0,buttons:0,relatedTarget:function(A){return A.relatedTarget===void 0?A.fromElement===A.srcElement?A.toElement:A.fromElement:A.relatedTarget},movementX:function(A){return"movementX"in A?A.movementX:(A!==$R&&($R&&A.type==="mousemove"?(A7=A.screenX-$R.screenX,e7=A.screenY-$R.screenY):e7=A7=0,$R=A),A7)},movementY:function(A){return"movementY"in A?A.movementY:e7}}),nwA=Ts(vW),uye=dn({},vW,{dataTransfer:0}),dye=Ts(uye),hye=dn({},PR,{relatedTarget:0}),t7=Ts(hye),mye=dn({},Nf,{animationName:0,elapsedTime:0,pseudoElement:0}),pye=Ts(mye),fye=dn({},Nf,{clipboardData:function(A){return"clipboardData"in A?A.clipboardData:window.clipboardData}}),yye=Ts(fye),bye=dn({},Nf,{data:0}),owA=Ts(bye),wye={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dye={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"},Gye={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kye(A){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(A):(A=Gye[A])?!!e[A]:!1}function i7(){return kye}var Jye=dn({},PR,{key:function(A){if(A.key){var e=wye[A.key]||A.key;if(e!=="Unidentified")return e}return A.type==="keypress"?(A=xW(A),A===13?"Enter":String.fromCharCode(A)):A.type==="keydown"||A.type==="keyup"?Dye[A.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:i7,charCode:function(A){return A.type==="keypress"?xW(A):0},keyCode:function(A){return A.type==="keydown"||A.type==="keyup"?A.keyCode:0},which:function(A){return A.type==="keypress"?xW(A):A.type==="keydown"||A.type==="keyup"?A.keyCode:0}}),Nye=Ts(Jye),Yye=dn({},vW,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gwA=Ts(Yye),Rye=dn({},PR,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:i7}),xye=Ts(Rye),Fye=dn({},Nf,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mye=Ts(Fye),vye=dn({},vW,{deltaX:function(A){return"deltaX"in A?A.deltaX:"wheelDeltaX"in A?-A.wheelDeltaX:0},deltaY:function(A){return"deltaY"in A?A.deltaY:"wheelDeltaY"in A?-A.wheelDeltaY:"wheelDelta"in A?-A.wheelDelta:0},deltaZ:0,deltaMode:0}),Lye=Ts(vye),Sye=dn({},Nf,{newState:0,oldState:0}),Hye=Ts(Sye),Zye=[9,13,27,32],n7=au&&"CompositionEvent"in window,A1=null;au&&"documentMode"in document&&(A1=document.documentMode);var Wye=au&&"TextEvent"in window&&!A1,awA=au&&(!n7||A1&&8<A1&&11>=A1),swA=String.fromCharCode(32),rwA=!1;function IwA(A,e){switch(A){case"keyup":return Zye.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function CwA(A){return A=A.detail,typeof A=="object"&&"data"in A?A.data:null}var MD=!1;function Kye(A,e){switch(A){case"compositionend":return CwA(e);case"keypress":return e.which!==32?null:(rwA=!0,swA);case"textInput":return A=e.data,A===swA&&rwA?null:A;default:return null}}function Uye(A,e){if(MD)return A==="compositionend"||!n7&&IwA(A,e)?(A=twA(),RW=$P=Fh=null,MD=!1,A):null;switch(A){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return awA&&e.locale!=="ko"?null:e.data;default:return null}}var Vye={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 lwA(A){var e=A&&A.nodeName&&A.nodeName.toLowerCase();return e==="input"?!!Vye[A.type]:e==="textarea"}function cwA(A,e,t,i){xD?FD?FD.push(i):FD=[i]:xD=i,e=w3(e,"onChange"),0<e.length&&(t=new MW("onChange","change",null,t,i),A.push({event:t,listeners:e}))}var e1=null,t1=null;function Xye(A){OGA(A,0)}function LW(A){var e=OR(A);if(_bA(e))return A}function BwA(A,e){if(A==="change")return e}var QwA=!1;if(au){var o7;if(au){var g7="oninput"in document;if(!g7){var EwA=document.createElement("div");EwA.setAttribute("oninput","return;"),g7=typeof EwA.oninput=="function"}o7=g7}else o7=!1;QwA=o7&&(!document.documentMode||9<document.documentMode)}function uwA(){e1&&(e1.detachEvent("onpropertychange",dwA),t1=e1=null)}function dwA(A){if(A.propertyName==="value"&&LW(t1)){var e=[];cwA(e,t1,A,qP(A)),ewA(Xye,e)}}function zye(A,e,t){A==="focusin"?(uwA(),e1=e,t1=t,e1.attachEvent("onpropertychange",dwA)):A==="focusout"&&uwA()}function Tye(A){if(A==="selectionchange"||A==="keyup"||A==="keydown")return LW(t1)}function _ye(A,e){if(A==="click")return LW(e)}function Oye(A,e){if(A==="input"||A==="change")return LW(e)}function qye(A,e){return A===e&&(A!==0||1/A===1/e)||A!==A&&e!==e}var qr=typeof Object.is=="function"?Object.is:qye;function i1(A,e){if(qr(A,e))return!0;if(typeof A!="object"||A===null||typeof e!="object"||e===null)return!1;var t=Object.keys(A),i=Object.keys(e);if(t.length!==i.length)return!1;for(i=0;i<t.length;i++){var n=t[i];if(!LP.call(e,n)||!qr(A[n],e[n]))return!1}return!0}function hwA(A){for(;A&&A.firstChild;)A=A.firstChild;return A}function mwA(A,e){var t=hwA(A);A=0;for(var i;t;){if(t.nodeType===3){if(i=A+t.textContent.length,A<=e&&i>=e)return{node:t,offset:e-A};A=i}A:{for(;t;){if(t.nextSibling){t=t.nextSibling;break A}t=t.parentNode}t=void 0}t=hwA(t)}}function pwA(A,e){return A&&e?A===e?!0:A&&A.nodeType===3?!1:e&&e.nodeType===3?pwA(A,e.parentNode):"contains"in A?A.contains(e):A.compareDocumentPosition?!!(A.compareDocumentPosition(e)&16):!1:!1}function fwA(A){A=A!=null&&A.ownerDocument!=null&&A.ownerDocument.defaultView!=null?A.ownerDocument.defaultView:window;for(var e=NW(A.document);e instanceof A.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)A=e.contentWindow;else break;e=NW(A.document)}return e}function a7(A){var e=A&&A.nodeName&&A.nodeName.toLowerCase();return e&&(e==="input"&&(A.type==="text"||A.type==="search"||A.type==="tel"||A.type==="url"||A.type==="password")||e==="textarea"||A.contentEditable==="true")}var jye=au&&"documentMode"in document&&11>=document.documentMode,vD=null,s7=null,n1=null,r7=!1;function ywA(A,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;r7||vD==null||vD!==NW(i)||(i=vD,"selectionStart"in i&&a7(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),n1&&i1(n1,i)||(n1=i,i=w3(s7,"onSelect"),0<i.length&&(e=new MW("onSelect","select",null,e,t),A.push({event:e,listeners:i}),e.target=vD)))}function Yf(A,e){var t={};return t[A.toLowerCase()]=e.toLowerCase(),t["Webkit"+A]="webkit"+e,t["Moz"+A]="moz"+e,t}var LD={animationend:Yf("Animation","AnimationEnd"),animationiteration:Yf("Animation","AnimationIteration"),animationstart:Yf("Animation","AnimationStart"),transitionrun:Yf("Transition","TransitionRun"),transitionstart:Yf("Transition","TransitionStart"),transitioncancel:Yf("Transition","TransitionCancel"),transitionend:Yf("Transition","TransitionEnd")},I7={},bwA={};au&&(bwA=document.createElement("div").style,"AnimationEvent"in window||(delete LD.animationend.animation,delete LD.animationiteration.animation,delete LD.animationstart.animation),"TransitionEvent"in window||delete LD.transitionend.transition);function Rf(A){if(I7[A])return I7[A];if(!LD[A])return A;var e=LD[A],t;for(t in e)if(e.hasOwnProperty(t)&&t in bwA)return I7[A]=e[t];return A}var wwA=Rf("animationend"),DwA=Rf("animationiteration"),GwA=Rf("animationstart"),Pye=Rf("transitionrun"),$ye=Rf("transitionstart"),Abe=Rf("transitioncancel"),kwA=Rf("transitionend"),JwA=new Map,C7="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(" ");C7.push("scrollEnd");function Vl(A,e){JwA.set(A,e),Jf(e,[A])}var SW=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},QC=[],SD=0,l7=0;function HW(){for(var A=SD,e=l7=SD=0;e<A;){var t=QC[e];QC[e++]=null;var i=QC[e];QC[e++]=null;var n=QC[e];QC[e++]=null;var o=QC[e];if(QC[e++]=null,i!==null&&n!==null){var g=i.pending;g===null?n.next=n:(n.next=g.next,g.next=n),i.pending=n}o!==0&&NwA(t,n,o)}}function ZW(A,e,t,i){QC[SD++]=A,QC[SD++]=e,QC[SD++]=t,QC[SD++]=i,l7|=i,A.lanes|=i,A=A.alternate,A!==null&&(A.lanes|=i)}function c7(A,e,t,i){return ZW(A,e,t,i),WW(A)}function xf(A,e){return ZW(A,null,null,e),WW(A)}function NwA(A,e,t){A.lanes|=t;var i=A.alternate;i!==null&&(i.lanes|=t);for(var n=!1,o=A.return;o!==null;)o.childLanes|=t,i=o.alternate,i!==null&&(i.childLanes|=t),o.tag===22&&(A=o.stateNode,A===null||A._visibility&1||(n=!0)),A=o,o=o.return;return A.tag===3?(o=A.stateNode,n&&e!==null&&(n=31-Or(t),A=o.hiddenUpdates,i=A[n],i===null?A[n]=[e]:i.push(e),e.lane=t|536870912),o):null}function WW(A){if(50<D1)throw D1=0,f$=null,Error(MA(185));for(var e=A.return;e!==null;)A=e,e=A.return;return A.tag===3?A.stateNode:null}var HD={};function ebe(A,e,t,i){this.tag=A,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(A,e,t,i){return new ebe(A,e,t,i)}function B7(A){return A=A.prototype,!(!A||!A.isReactComponent)}function su(A,e){var t=A.alternate;return t===null?(t=jr(A.tag,e,A.key,A.mode),t.elementType=A.elementType,t.type=A.type,t.stateNode=A.stateNode,t.alternate=A,A.alternate=t):(t.pendingProps=e,t.type=A.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=A.flags&65011712,t.childLanes=A.childLanes,t.lanes=A.lanes,t.child=A.child,t.memoizedProps=A.memoizedProps,t.memoizedState=A.memoizedState,t.updateQueue=A.updateQueue,e=A.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=A.sibling,t.index=A.index,t.ref=A.ref,t.refCleanup=A.refCleanup,t}function YwA(A,e){A.flags&=65011714;var t=A.alternate;return t===null?(A.childLanes=0,A.lanes=e,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=t.childLanes,A.lanes=t.lanes,A.child=t.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=t.memoizedProps,A.memoizedState=t.memoizedState,A.updateQueue=t.updateQueue,A.type=t.type,e=t.dependencies,A.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),A}function KW(A,e,t,i,n,o){var g=0;if(i=A,typeof A=="function")B7(A)&&(g=1);else if(typeof A=="string")g=gwe(A,t,HB.current)?26:A==="html"||A==="head"||A==="body"?27:5;else A:switch(A){case NP:return A=jr(31,t,e,n),A.elementType=NP,A.lanes=o,A;case yD:return Ff(t.children,n,o,e);case kbA:g=8,n|=24;break;case wP:return A=jr(12,t,e,n|2),A.elementType=wP,A.lanes=o,A;case GP:return A=jr(13,t,e,n),A.elementType=GP,A.lanes=o,A;case kP:return A=jr(19,t,e,n),A.elementType=kP,A.lanes=o,A;default:if(typeof A=="object"&&A!==null)switch(A.$$typeof){case nu:g=10;break A;case JbA:g=9;break A;case DP:g=11;break A;case JP:g=14;break A;case Nh:g=16,i=null;break A}g=29,t=Error(MA(130,A===null?"null":typeof A,"")),i=null}return e=jr(g,t,e,n),e.elementType=A,e.type=i,e.lanes=o,e}function Ff(A,e,t,i){return A=jr(7,A,i,e),A.lanes=t,A}function Q7(A,e,t){return A=jr(6,A,null,e),A.lanes=t,A}function RwA(A){var e=jr(18,null,null,0);return e.stateNode=A,e}function E7(A,e,t){return e=jr(4,A.children!==null?A.children:[],A.key,e),e.lanes=t,e.stateNode={containerInfo:A.containerInfo,pendingChildren:null,implementation:A.implementation},e}var xwA=new WeakMap;function EC(A,e){if(typeof A=="object"&&A!==null){var t=xwA.get(A);return t!==void 0?t:(e={value:A,source:e,stack:RbA(e)},xwA.set(A,e),e)}return{value:A,source:e,stack:RbA(e)}}var ZD=[],WD=0,UW=null,o1=0,uC=[],dC=0,Mh=null,ZB=1,WB="";function ru(A,e){ZD[WD++]=o1,ZD[WD++]=UW,UW=A,o1=e}function FwA(A,e,t){uC[dC++]=ZB,uC[dC++]=WB,uC[dC++]=Mh,Mh=A;var i=ZB;A=WB;var n=32-Or(i)-1;i&=~(1<<n),t+=1;var o=32-Or(e)+n;if(30<o){var g=n-n%5;o=(i&(1<<g)-1).toString(32),i>>=g,n-=g,ZB=1<<32-Or(e)+n|t<<n|i,WB=o+A}else ZB=1<<o|t<<n|i,WB=A}function u7(A){A.return!==null&&(ru(A,1),FwA(A,1,0))}function d7(A){for(;A===UW;)UW=ZD[--WD],ZD[WD]=null,o1=ZD[--WD],ZD[WD]=null;for(;A===Mh;)Mh=uC[--dC],uC[dC]=null,WB=uC[--dC],uC[dC]=null,ZB=uC[--dC],uC[dC]=null}function MwA(A,e){uC[dC++]=ZB,uC[dC++]=WB,uC[dC++]=Mh,ZB=e.id,WB=e.overflow,Mh=A}var Sg=null,hn=null,Kt=!1,vh=null,hC=!1,h7=Error(MA(519));function Lh(A){var e=Error(MA(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw g1(EC(e,A)),h7}function vwA(A){var e=A.stateNode,t=A.type,i=A.memoizedProps;switch(e[Lg]=A,e[zs]=i,t){case"dialog":Yt("cancel",e),Yt("close",e);break;case"iframe":case"object":case"embed":Yt("load",e);break;case"video":case"audio":for(t=0;t<k1.length;t++)Yt(k1[t],e);break;case"source":Yt("error",e);break;case"img":case"image":case"link":Yt("error",e),Yt("load",e);break;case"details":Yt("toggle",e);break;case"input":Yt("invalid",e),ObA(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Yt("invalid",e);break;case"textarea":Yt("invalid",e),jbA(e,i.value,i.defaultValue,i.children)}t=i.children,typeof t!="string"&&typeof t!="number"&&typeof t!="bigint"||e.textContent===""+t||i.suppressHydrationWarning===!0||$GA(e.textContent,t)?(i.popover!=null&&(Yt("beforetoggle",e),Yt("toggle",e)),i.onScroll!=null&&Yt("scroll",e),i.onScrollEnd!=null&&Yt("scrollend",e),i.onClick!=null&&(e.onclick=gu),e=!0):e=!1,e||Lh(A,!0)}function LwA(A){for(Sg=A.return;Sg;)switch(Sg.tag){case 5:case 31:case 13:hC=!1;return;case 27:case 3:hC=!0;return;default:Sg=Sg.return}}function KD(A){if(A!==Sg)return!1;if(!Kt)return LwA(A),Kt=!0,!1;var e=A.tag,t;if((t=e!==3&&e!==27)&&((t=e===5)&&(t=A.type,t=!(t!=="form"&&t!=="button")||L$(A.type,A.memoizedProps)),t=!t),t&&hn&&Lh(A),LwA(A),e===13){if(A=A.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(MA(317));hn=skA(A)}else if(e===31){if(A=A.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(MA(317));hn=skA(A)}else e===27?(e=hn,jh(A.type)?(A=K$,K$=null,hn=A):hn=e):hn=Sg?pC(A.stateNode.nextSibling):null;return!0}function Mf(){hn=Sg=null,Kt=!1}function m7(){var A=vh;return A!==null&&(js===null?js=A:js.push.apply(js,A),vh=null),A}function g1(A){vh===null?vh=[A]:vh.push(A)}var p7=SB(null),vf=null,Iu=null;function Sh(A,e,t){nn(p7,e._currentValue),e._currentValue=t}function Cu(A){A._currentValue=p7.current,ag(p7)}function f7(A,e,t){for(;A!==null;){var i=A.alternate;if((A.childLanes&e)!==e?(A.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),A===t)break;A=A.return}}function y7(A,e,t,i){var n=A.child;for(n!==null&&(n.return=A);n!==null;){var o=n.dependencies;if(o!==null){var g=n.child;o=o.firstContext;A:for(;o!==null;){var a=o;o=n;for(var s=0;s<e.length;s++)if(a.context===e[s]){o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),f7(o.return,t,A),i||(g=null);break A}o=a.next}}else if(n.tag===18){if(g=n.return,g===null)throw Error(MA(341));g.lanes|=t,o=g.alternate,o!==null&&(o.lanes|=t),f7(g,t,A),g=null}else g=n.child;if(g!==null)g.return=n;else for(g=n;g!==null;){if(g===A){g=null;break}if(n=g.sibling,n!==null){n.return=g.return,g=n;break}g=g.return}n=g}}function UD(A,e,t,i){A=null;for(var n=e,o=!1;n!==null;){if(!o){if(n.flags&524288)o=!0;else if(n.flags&262144)break}if(n.tag===10){var g=n.alternate;if(g===null)throw Error(MA(387));if(g=g.memoizedProps,g!==null){var a=n.type;qr(n.pendingProps.value,g.value)||(A!==null?A.push(a):A=[a])}}else if(n===mW.current){if(g=n.alternate,g===null)throw Error(MA(387));g.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(A!==null?A.push(x1):A=[x1])}n=n.return}A!==null&&y7(e,A,t,i),e.flags|=262144}function VW(A){for(A=A.firstContext;A!==null;){if(!qr(A.context._currentValue,A.memoizedValue))return!0;A=A.next}return!1}function Lf(A){vf=A,Iu=null,A=A.dependencies,A!==null&&(A.firstContext=null)}function Hg(A){return SwA(vf,A)}function XW(A,e){return vf===null&&Lf(A),SwA(A,e)}function SwA(A,e){var t=e._currentValue;if(e={context:e,memoizedValue:t,next:null},Iu===null){if(A===null)throw Error(MA(308));Iu=e,A.dependencies={lanes:0,firstContext:e},A.flags|=524288}else Iu=Iu.next=e;return t}var tbe=typeof AbortController<"u"?AbortController:function(){var A=[],e=this.signal={aborted:!1,addEventListener:function(t,i){A.push(i)}};this.abort=function(){e.aborted=!0,A.forEach(function(t){return t()})}},ibe=Uo.unstable_scheduleCallback,nbe=Uo.unstable_NormalPriority,Jo={$$typeof:nu,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function b7(){return{controller:new tbe,data:new Map,refCount:0}}function a1(A){A.refCount--,A.refCount===0&&ibe(nbe,function(){A.controller.abort()})}var s1=null,w7=0,VD=0,XD=null;function obe(A,e){if(s1===null){var t=s1=[];w7=0,VD=k$(),XD={status:"pending",value:void 0,then:function(i){t.push(i)}}}return w7++,e.then(HwA,HwA),e}function HwA(){if(--w7===0&&s1!==null){XD!==null&&(XD.status="fulfilled");var A=s1;s1=null,VD=0,XD=null;for(var e=0;e<A.length;e++)(0,A[e])()}}function gbe(A,e){var t=[],i={status:"pending",value:null,reason:null,then:function(n){t.push(n)}};return A.then(function(){i.status="fulfilled",i.value=e;for(var n=0;n<t.length;n++)(0,t[n])(e)},function(n){for(i.status="rejected",i.reason=n,n=0;n<t.length;n++)(0,t[n])(void 0)}),i}var ZwA=Ze.S;Ze.S=function(A,e){yGA=Tr(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&obe(A,e),ZwA!==null&&ZwA(A,e)};var Sf=SB(null);function D7(){var A=Sf.current;return A!==null?A:Xi.pooledCache}function zW(A,e){e===null?nn(Sf,Sf.current):nn(Sf,e.pool)}function WwA(){var A=D7();return A===null?null:{parent:Jo._currentValue,pool:A}}var zD=Error(MA(460)),G7=Error(MA(474)),TW=Error(MA(542)),_W={then:function(){}};function KwA(A){return A=A.status,A==="fulfilled"||A==="rejected"}function UwA(A,e,t){switch(t=A[t],t===void 0?A.push(e):t!==e&&(e.then(gu,gu),e=t),e.status){case"fulfilled":return e.value;case"rejected":throw A=e.reason,XwA(A),A;default:if(typeof e.status=="string")e.then(gu,gu);else{if(A=Xi,A!==null&&100<A.shellSuspendCounter)throw Error(MA(482));A=e,A.status="pending",A.then(function(i){if(e.status==="pending"){var n=e;n.status="fulfilled",n.value=i}},function(i){if(e.status==="pending"){var n=e;n.status="rejected",n.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw A=e.reason,XwA(A),A}throw Zf=e,zD}}function Hf(A){try{var e=A._init;return e(A._payload)}catch(t){throw t!==null&&typeof t=="object"&&typeof t.then=="function"?(Zf=t,zD):t}}var Zf=null;function VwA(){if(Zf===null)throw Error(MA(459));var A=Zf;return Zf=null,A}function XwA(A){if(A===zD||A===TW)throw Error(MA(483))}var TD=null,r1=0;function OW(A){var e=r1;return r1+=1,TD===null&&(TD=[]),UwA(TD,A,e)}function I1(A,e){e=e.props.ref,A.ref=e!==void 0?e:null}function qW(A,e){throw e.$$typeof===zfe?Error(MA(525)):(A=Object.prototype.toString.call(e),Error(MA(31,A==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":A)))}function zwA(A){function e(d,f){if(A){var w=d.deletions;w===null?(d.deletions=[f],d.flags|=16):w.push(f)}}function t(d,f){if(!A)return null;for(;f!==null;)e(d,f),f=f.sibling;return null}function i(d){for(var f=new Map;d!==null;)d.key!==null?f.set(d.key,d):f.set(d.index,d),d=d.sibling;return f}function n(d,f){return d=su(d,f),d.index=0,d.sibling=null,d}function o(d,f,w){return d.index=w,A?(w=d.alternate,w!==null?(w=w.index,w<f?(d.flags|=67108866,f):w):(d.flags|=67108866,f)):(d.flags|=1048576,f)}function g(d){return A&&d.alternate===null&&(d.flags|=67108866),d}function a(d,f,w,y){return f===null||f.tag!==6?(f=Q7(w,d.mode,y),f.return=d,f):(f=n(f,w),f.return=d,f)}function s(d,f,w,y){var G=w.type;return G===yD?r(d,f,w.props.children,y,w.key):f!==null&&(f.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Nh&&Hf(G)===f.type)?(f=n(f,w.props),I1(f,w),f.return=d,f):(f=KW(w.type,w.key,w.props,null,d.mode,y),I1(f,w),f.return=d,f)}function I(d,f,w,y){return f===null||f.tag!==4||f.stateNode.containerInfo!==w.containerInfo||f.stateNode.implementation!==w.implementation?(f=E7(w,d.mode,y),f.return=d,f):(f=n(f,w.children||[]),f.return=d,f)}function r(d,f,w,y,G){return f===null||f.tag!==7?(f=Ff(w,d.mode,y,G),f.return=d,f):(f=n(f,w),f.return=d,f)}function C(d,f,w){if(typeof f=="string"&&f!==""||typeof f=="number"||typeof f=="bigint")return f=Q7(""+f,d.mode,w),f.return=d,f;if(typeof f=="object"&&f!==null){switch(f.$$typeof){case hW:return w=KW(f.type,f.key,f.props,null,d.mode,w),I1(w,f),w.return=d,w;case WR:return f=E7(f,d.mode,w),f.return=d,f;case Nh:return f=Hf(f),C(d,f,w)}if(UR(f)||KR(f))return f=Ff(f,d.mode,w,null),f.return=d,f;if(typeof f.then=="function")return C(d,OW(f),w);if(f.$$typeof===nu)return C(d,XW(d,f),w);qW(d,f)}return null}function l(d,f,w,y){var G=f!==null?f.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return G!==null?null:a(d,f,""+w,y);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case hW:return w.key===G?s(d,f,w,y):null;case WR:return w.key===G?I(d,f,w,y):null;case Nh:return w=Hf(w),l(d,f,w,y)}if(UR(w)||KR(w))return G!==null?null:r(d,f,w,y,null);if(typeof w.then=="function")return l(d,f,OW(w),y);if(w.$$typeof===nu)return l(d,f,XW(d,w),y);qW(d,w)}return null}function c(d,f,w,y,G){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return d=d.get(w)||null,a(f,d,""+y,G);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case hW:return d=d.get(y.key===null?w:y.key)||null,s(f,d,y,G);case WR:return d=d.get(y.key===null?w:y.key)||null,I(f,d,y,G);case Nh:return y=Hf(y),c(d,f,w,y,G)}if(UR(y)||KR(y))return d=d.get(w)||null,r(f,d,y,G,null);if(typeof y.then=="function")return c(d,f,w,OW(y),G);if(y.$$typeof===nu)return c(d,f,w,XW(f,y),G);qW(f,y)}return null}function B(d,f,w,y){for(var G=null,R=null,x=f,F=f=0,Q=null;x!==null&&F<w.length;F++){x.index>F?(Q=x,x=null):Q=x.sibling;var k=l(d,x,w[F],y);if(k===null){x===null&&(x=Q);break}A&&x&&k.alternate===null&&e(d,x),f=o(k,f,F),R===null?G=k:R.sibling=k,R=k,x=Q}if(F===w.length)return t(d,x),Kt&&ru(d,F),G;if(x===null){for(;F<w.length;F++)x=C(d,w[F],y),x!==null&&(f=o(x,f,F),R===null?G=x:R.sibling=x,R=x);return Kt&&ru(d,F),G}for(x=i(x);F<w.length;F++)Q=c(x,d,F,w[F],y),Q!==null&&(A&&Q.alternate!==null&&x.delete(Q.key===null?F:Q.key),f=o(Q,f,F),R===null?G=Q:R.sibling=Q,R=Q);return A&&x.forEach(function(h){return e(d,h)}),Kt&&ru(d,F),G}function E(d,f,w,y){if(w==null)throw Error(MA(151));for(var G=null,R=null,x=f,F=f=0,Q=null,k=w.next();x!==null&&!k.done;F++,k=w.next()){x.index>F?(Q=x,x=null):Q=x.sibling;var h=l(d,x,k.value,y);if(h===null){x===null&&(x=Q);break}A&&x&&h.alternate===null&&e(d,x),f=o(h,f,F),R===null?G=h:R.sibling=h,R=h,x=Q}if(k.done)return t(d,x),Kt&&ru(d,F),G;if(x===null){for(;!k.done;F++,k=w.next())k=C(d,k.value,y),k!==null&&(f=o(k,f,F),R===null?G=k:R.sibling=k,R=k);return Kt&&ru(d,F),G}for(x=i(x);!k.done;F++,k=w.next())k=c(x,d,F,k.value,y),k!==null&&(A&&k.alternate!==null&&x.delete(k.key===null?F:k.key),f=o(k,f,F),R===null?G=k:R.sibling=k,R=k);return A&&x.forEach(function(N){return e(d,N)}),Kt&&ru(d,F),G}function u(d,f,w,y){if(typeof w=="object"&&w!==null&&w.type===yD&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case hW:A:{for(var G=w.key;f!==null;){if(f.key===G){if(G=w.type,G===yD){if(f.tag===7){t(d,f.sibling),y=n(f,w.props.children),y.return=d,d=y;break A}}else if(f.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Nh&&Hf(G)===f.type){t(d,f.sibling),y=n(f,w.props),I1(y,w),y.return=d,d=y;break A}t(d,f);break}else e(d,f);f=f.sibling}w.type===yD?(y=Ff(w.props.children,d.mode,y,w.key),y.return=d,d=y):(y=KW(w.type,w.key,w.props,null,d.mode,y),I1(y,w),y.return=d,d=y)}return g(d);case WR:A:{for(G=w.key;f!==null;){if(f.key===G)if(f.tag===4&&f.stateNode.containerInfo===w.containerInfo&&f.stateNode.implementation===w.implementation){t(d,f.sibling),y=n(f,w.children||[]),y.return=d,d=y;break A}else{t(d,f);break}else e(d,f);f=f.sibling}y=E7(w,d.mode,y),y.return=d,d=y}return g(d);case Nh:return w=Hf(w),u(d,f,w,y)}if(UR(w))return B(d,f,w,y);if(KR(w)){if(G=KR(w),typeof G!="function")throw Error(MA(150));return w=G.call(w),E(d,f,w,y)}if(typeof w.then=="function")return u(d,f,OW(w),y);if(w.$$typeof===nu)return u(d,f,XW(d,w),y);qW(d,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,f!==null&&f.tag===6?(t(d,f.sibling),y=n(f,w),y.return=d,d=y):(t(d,f),y=Q7(w,d.mode,y),y.return=d,d=y),g(d)):t(d,f)}return function(d,f,w,y){try{r1=0;var G=u(d,f,w,y);return TD=null,G}catch(x){if(x===zD||x===TW)throw x;var R=jr(29,x,null,d.mode);return R.lanes=y,R.return=d,R}finally{}}}var Wf=zwA(!0),TwA=zwA(!1),Hh=!1;function k7(A){A.updateQueue={baseState:A.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function J7(A,e){A=A.updateQueue,e.updateQueue===A&&(e.updateQueue={baseState:A.baseState,firstBaseUpdate:A.firstBaseUpdate,lastBaseUpdate:A.lastBaseUpdate,shared:A.shared,callbacks:null})}function Zh(A){return{lane:A,tag:0,payload:null,callback:null,next:null}}function Wh(A,e,t){var i=A.updateQueue;if(i===null)return null;if(i=i.shared,Qi&2){var n=i.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),i.pending=e,e=WW(A),NwA(A,null,t),e}return ZW(A,i,e,t),WW(A)}function C1(A,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194048)!==0)){var i=e.lanes;i&=A.pendingLanes,t|=i,e.lanes=t,SbA(A,t)}}function N7(A,e){var t=A.updateQueue,i=A.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var n=null,o=null;if(t=t.firstBaseUpdate,t!==null){do{var g={lane:t.lane,tag:t.tag,payload:t.payload,callback:null,next:null};o===null?n=o=g:o=o.next=g,t=t.next}while(t!==null);o===null?n=o=e:o=o.next=e}else n=o=e;t={baseState:i.baseState,firstBaseUpdate:n,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},A.updateQueue=t;return}A=t.lastBaseUpdate,A===null?t.firstBaseUpdate=e:A.next=e,t.lastBaseUpdate=e}var Y7=!1;function l1(){if(Y7){var A=XD;if(A!==null)throw A}}function c1(A,e,t,i){Y7=!1;var n=A.updateQueue;Hh=!1;var o=n.firstBaseUpdate,g=n.lastBaseUpdate,a=n.shared.pending;if(a!==null){n.shared.pending=null;var s=a,I=s.next;s.next=null,g===null?o=I:g.next=I,g=s;var r=A.alternate;r!==null&&(r=r.updateQueue,a=r.lastBaseUpdate,a!==g&&(a===null?r.firstBaseUpdate=I:a.next=I,r.lastBaseUpdate=s))}if(o!==null){var C=n.baseState;g=0,r=I=s=null,a=o;do{var l=a.lane&-536870913,c=l!==a.lane;if(c?(vt&l)===l:(i&l)===l){l!==0&&l===VD&&(Y7=!0),r!==null&&(r=r.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});A:{var B=A,E=a;l=e;var u=t;switch(E.tag){case 1:if(B=E.payload,typeof B=="function"){C=B.call(u,C,l);break A}C=B;break A;case 3:B.flags=B.flags&-65537|128;case 0:if(B=E.payload,l=typeof B=="function"?B.call(u,C,l):B,l==null)break A;C=dn({},C,l);break A;case 2:Hh=!0}}l=a.callback,l!==null&&(A.flags|=64,c&&(A.flags|=8192),c=n.callbacks,c===null?n.callbacks=[l]:c.push(l))}else c={lane:l,tag:a.tag,payload:a.payload,callback:a.callback,next:null},r===null?(I=r=c,s=C):r=r.next=c,g|=l;if(a=a.next,a===null){if(a=n.shared.pending,a===null)break;c=a,a=c.next,c.next=null,n.lastBaseUpdate=c,n.shared.pending=null}}while(1);r===null&&(s=C),n.baseState=s,n.firstBaseUpdate=I,n.lastBaseUpdate=r,o===null&&(n.shared.lanes=0),zh|=g,A.lanes=g,A.memoizedState=C}}function _wA(A,e){if(typeof A!="function")throw Error(MA(191,A));A.call(e)}function OwA(A,e){var t=A.callbacks;if(t!==null)for(A.callbacks=null,A=0;A<t.length;A++)_wA(t[A],e)}var _D=SB(null),jW=SB(0);function qwA(A,e){A=mu,nn(jW,A),nn(_D,e),mu=A|e.baseLanes}function R7(){nn(jW,mu),nn(_D,_D.current)}function x7(){mu=jW.current,ag(_D),ag(jW)}var Pr=SB(null),mC=null;function Kh(A){var e=A.alternate;nn(mo,mo.current&1),nn(Pr,A),mC===null&&(e===null||_D.current!==null||e.memoizedState!==null)&&(mC=A)}function F7(A){nn(mo,mo.current),nn(Pr,A),mC===null&&(mC=A)}function jwA(A){A.tag===22?(nn(mo,mo.current),nn(Pr,A),mC===null&&(mC=A)):Uh()}function Uh(){nn(mo,mo.current),nn(Pr,Pr.current)}function $r(A){ag(Pr),mC===A&&(mC=null),ag(mo)}var mo=SB(0);function PW(A){for(var e=A;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||Z$(t)||W$(t)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===A)break;for(;e.sibling===null;){if(e.return===null||e.return===A)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var lu=0,It=null,Hi=null,No=null,$W=!1,OD=!1,Kf=!1,A3=0,B1=0,qD=null,abe=0;function to(){throw Error(MA(321))}function M7(A,e){if(e===null)return!1;for(var t=0;t<e.length&&t<A.length;t++)if(!qr(A[t],e[t]))return!1;return!0}function v7(A,e,t,i,n,o){return lu=o,It=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Ze.H=A===null||A.memoizedState===null?FDA:j7,Kf=!1,o=t(i,n),Kf=!1,OD&&(o=$wA(e,t,i,n)),PwA(A),o}function PwA(A){Ze.H=u1;var e=Hi!==null&&Hi.next!==null;if(lu=0,No=Hi=It=null,$W=!1,B1=0,qD=null,e)throw Error(MA(300));A===null||Yo||(A=A.dependencies,A!==null&&VW(A)&&(Yo=!0))}function $wA(A,e,t,i){It=A;var n=0;do{if(OD&&(qD=null),B1=0,OD=!1,25<=n)throw Error(MA(301));if(n+=1,No=Hi=null,A.updateQueue!=null){var o=A.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}Ze.H=MDA,o=e(t,i)}while(OD);return o}function sbe(){var A=Ze.H,e=A.useState()[0];return e=typeof e.then=="function"?Q1(e):e,A=A.useState()[0],(Hi!==null?Hi.memoizedState:null)!==A&&(It.flags|=1024),e}function L7(){var A=A3!==0;return A3=0,A}function S7(A,e,t){e.updateQueue=A.updateQueue,e.flags&=-2053,A.lanes&=~t}function H7(A){if($W){for(A=A.memoizedState;A!==null;){var e=A.queue;e!==null&&(e.pending=null),A=A.next}$W=!1}lu=0,No=Hi=It=null,OD=!1,B1=A3=0,qD=null}function Pa(){var A={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return No===null?It.memoizedState=No=A:No=No.next=A,No}function po(){if(Hi===null){var A=It.alternate;A=A!==null?A.memoizedState:null}else A=Hi.next;var e=No===null?It.memoizedState:No.next;if(e!==null)No=e,Hi=A;else{if(A===null)throw It.alternate===null?Error(MA(467)):Error(MA(310));Hi=A,A={memoizedState:Hi.memoizedState,baseState:Hi.baseState,baseQueue:Hi.baseQueue,queue:Hi.queue,next:null},No===null?It.memoizedState=No=A:No=No.next=A}return No}function e3(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Q1(A){var e=B1;return B1+=1,qD===null&&(qD=[]),A=UwA(qD,A,e),e=It,(No===null?e.memoizedState:No.next)===null&&(e=e.alternate,Ze.H=e===null||e.memoizedState===null?FDA:j7),A}function t3(A){if(A!==null&&typeof A=="object"){if(typeof A.then=="function")return Q1(A);if(A.$$typeof===nu)return Hg(A)}throw Error(MA(438,String(A)))}function Z7(A){var e=null,t=It.updateQueue;if(t!==null&&(e=t.memoCache),e==null){var i=It.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(n){return n.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),t===null&&(t=e3(),It.updateQueue=t),t.memoCache=e,t=e.data[e.index],t===void 0)for(t=e.data[e.index]=Array(A),i=0;i<A;i++)t[i]=Tfe;return e.index++,t}function cu(A,e){return typeof e=="function"?e(A):e}function i3(A){var e=po();return W7(e,Hi,A)}function W7(A,e,t){var i=A.queue;if(i===null)throw Error(MA(311));i.lastRenderedReducer=t;var n=A.baseQueue,o=i.pending;if(o!==null){if(n!==null){var g=n.next;n.next=o.next,o.next=g}e.baseQueue=n=o,i.pending=null}if(o=A.baseState,n===null)A.memoizedState=o;else{e=n.next;var a=g=null,s=null,I=e,r=!1;do{var C=I.lane&-536870913;if(C!==I.lane?(vt&C)===C:(lu&C)===C){var l=I.revertLane;if(l===0)s!==null&&(s=s.next={lane:0,revertLane:0,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),C===VD&&(r=!0);else if((lu&l)===l){I=I.next,l===VD&&(r=!0);continue}else C={lane:0,revertLane:I.revertLane,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},s===null?(a=s=C,g=o):s=s.next=C,It.lanes|=l,zh|=l;C=I.action,Kf&&t(o,C),o=I.hasEagerState?I.eagerState:t(o,C)}else l={lane:C,revertLane:I.revertLane,gesture:I.gesture,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},s===null?(a=s=l,g=o):s=s.next=l,It.lanes|=C,zh|=C;I=I.next}while(I!==null&&I!==e);if(s===null?g=o:s.next=a,!qr(o,A.memoizedState)&&(Yo=!0,r&&(t=XD,t!==null)))throw t;A.memoizedState=o,A.baseState=g,A.baseQueue=s,i.lastRenderedState=o}return n===null&&(i.lanes=0),[A.memoizedState,i.dispatch]}function K7(A){var e=po(),t=e.queue;if(t===null)throw Error(MA(311));t.lastRenderedReducer=A;var i=t.dispatch,n=t.pending,o=e.memoizedState;if(n!==null){t.pending=null;var g=n=n.next;do o=A(o,g.action),g=g.next;while(g!==n);qr(o,e.memoizedState)||(Yo=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),t.lastRenderedState=o}return[o,i]}function ADA(A,e,t){var i=It,n=po(),o=Kt;if(o){if(t===void 0)throw Error(MA(407));t=t()}else t=e();var g=!qr((Hi||n).memoizedState,t);if(g&&(n.memoizedState=t,Yo=!0),n=n.queue,X7(iDA.bind(null,i,n,A),[A]),n.getSnapshot!==e||g||No!==null&&No.memoizedState.tag&1){if(i.flags|=2048,jD(9,{destroy:void 0},tDA.bind(null,i,n,t,e),null),Xi===null)throw Error(MA(349));o||lu&127||eDA(i,e,t)}return t}function eDA(A,e,t){A.flags|=16384,A={getSnapshot:e,value:t},e=It.updateQueue,e===null?(e=e3(),It.updateQueue=e,e.stores=[A]):(t=e.stores,t===null?e.stores=[A]:t.push(A))}function tDA(A,e,t,i){e.value=t,e.getSnapshot=i,nDA(e)&&oDA(A)}function iDA(A,e,t){return t(function(){nDA(e)&&oDA(A)})}function nDA(A){var e=A.getSnapshot;A=A.value;try{var t=e();return!qr(A,t)}catch{return!0}}function oDA(A){var e=xf(A,2);e!==null&&Ps(e,A,2)}function U7(A){var e=Pa();if(typeof A=="function"){var t=A;if(A=t(),Kf){Rh(!0);try{t()}finally{Rh(!1)}}}return e.memoizedState=e.baseState=A,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cu,lastRenderedState:A},e}function gDA(A,e,t,i){return A.baseState=t,W7(A,Hi,typeof i=="function"?i:cu)}function rbe(A,e,t,i,n){if(g3(A))throw Error(MA(485));if(A=e.action,A!==null){var o={payload:n,action:A,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){o.listeners.push(g)}};Ze.T!==null?t(!0):o.isTransition=!1,i(o),t=e.pending,t===null?(o.next=e.pending=o,aDA(e,o)):(o.next=t.next,e.pending=t.next=o)}}function aDA(A,e){var t=e.action,i=e.payload,n=A.state;if(e.isTransition){var o=Ze.T,g={};Ze.T=g;try{var a=t(n,i),s=Ze.S;s!==null&&s(g,a),sDA(A,e,a)}catch(I){V7(A,e,I)}finally{o!==null&&g.types!==null&&(o.types=g.types),Ze.T=o}}else try{o=t(n,i),sDA(A,e,o)}catch(I){V7(A,e,I)}}function sDA(A,e,t){t!==null&&typeof t=="object"&&typeof t.then=="function"?t.then(function(i){rDA(A,e,i)},function(i){return V7(A,e,i)}):rDA(A,e,t)}function rDA(A,e,t){e.status="fulfilled",e.value=t,IDA(e),A.state=t,e=A.pending,e!==null&&(t=e.next,t===e?A.pending=null:(t=t.next,e.next=t,aDA(A,t)))}function V7(A,e,t){var i=A.pending;if(A.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=t,IDA(e),e=e.next;while(e!==i)}A.action=null}function IDA(A){A=A.listeners;for(var e=0;e<A.length;e++)(0,A[e])()}function CDA(A,e){return e}function lDA(A,e){if(Kt){var t=Xi.formState;if(t!==null){A:{var i=It;if(Kt){if(hn){e:{for(var n=hn,o=hC;n.nodeType!==8;){if(!o){n=null;break e}if(n=pC(n.nextSibling),n===null){n=null;break e}}o=n.data,n=o==="F!"||o==="F"?n:null}if(n){hn=pC(n.nextSibling),i=n.data==="F!";break A}}Lh(i)}i=!1}i&&(e=t[0])}}return t=Pa(),t.memoizedState=t.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:CDA,lastRenderedState:e},t.queue=i,t=YDA.bind(null,It,i),i.dispatch=t,i=U7(!1),o=q7.bind(null,It,!1,i.queue),i=Pa(),n={state:e,dispatch:null,action:A,pending:null},i.queue=n,t=rbe.bind(null,It,n,o,t),n.dispatch=t,i.memoizedState=A,[e,t,!1]}function cDA(A){var e=po();return BDA(e,Hi,A)}function BDA(A,e,t){if(e=W7(A,e,CDA)[0],A=i3(cu)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Q1(e)}catch(g){throw g===zD?TW:g}else i=e;e=po();var n=e.queue,o=n.dispatch;return t!==e.memoizedState&&(It.flags|=2048,jD(9,{destroy:void 0},Ibe.bind(null,n,t),null)),[i,o,A]}function Ibe(A,e){A.action=e}function QDA(A){var e=po(),t=Hi;if(t!==null)return BDA(e,t,A);po(),e=e.memoizedState,t=po();var i=t.queue.dispatch;return t.memoizedState=A,[e,i,!1]}function jD(A,e,t,i){return A={tag:A,create:t,deps:i,inst:e,next:null},e=It.updateQueue,e===null&&(e=e3(),It.updateQueue=e),t=e.lastEffect,t===null?e.lastEffect=A.next=A:(i=t.next,t.next=A,A.next=i,e.lastEffect=A),A}function EDA(){return po().memoizedState}function n3(A,e,t,i){var n=Pa();It.flags|=A,n.memoizedState=jD(1|e,{destroy:void 0},t,i===void 0?null:i)}function o3(A,e,t,i){var n=po();i=i===void 0?null:i;var o=n.memoizedState.inst;Hi!==null&&i!==null&&M7(i,Hi.memoizedState.deps)?n.memoizedState=jD(e,o,t,i):(It.flags|=A,n.memoizedState=jD(1|e,o,t,i))}function uDA(A,e){n3(8390656,8,A,e)}function X7(A,e){o3(2048,8,A,e)}function Cbe(A){It.flags|=4;var e=It.updateQueue;if(e===null)e=e3(),It.updateQueue=e,e.events=[A];else{var t=e.events;t===null?e.events=[A]:t.push(A)}}function dDA(A){var e=po().memoizedState;return Cbe({ref:e,nextImpl:A}),function(){if(Qi&2)throw Error(MA(440));return e.impl.apply(void 0,arguments)}}function hDA(A,e){return o3(4,2,A,e)}function mDA(A,e){return o3(4,4,A,e)}function pDA(A,e){if(typeof e=="function"){A=A();var t=e(A);return function(){typeof t=="function"?t():e(null)}}if(e!=null)return A=A(),e.current=A,function(){e.current=null}}function fDA(A,e,t){t=t!=null?t.concat([A]):null,o3(4,4,pDA.bind(null,e,A),t)}function z7(){}function yDA(A,e){var t=po();e=e===void 0?null:e;var i=t.memoizedState;return e!==null&&M7(e,i[1])?i[0]:(t.memoizedState=[A,e],A)}function bDA(A,e){var t=po();e=e===void 0?null:e;var i=t.memoizedState;if(e!==null&&M7(e,i[1]))return i[0];if(i=A(),Kf){Rh(!0);try{A()}finally{Rh(!1)}}return t.memoizedState=[i,e],i}function T7(A,e,t){return t===void 0||lu&1073741824&&!(vt&261930)?A.memoizedState=e:(A.memoizedState=t,A=wGA(),It.lanes|=A,zh|=A,t)}function wDA(A,e,t,i){return qr(t,e)?t:_D.current!==null?(A=T7(A,t,i),qr(A,e)||(Yo=!0),A):!(lu&42)||lu&1073741824&&!(vt&261930)?(Yo=!0,A.memoizedState=t):(A=wGA(),It.lanes|=A,zh|=A,e)}function DDA(A,e,t,i,n){var o=Bi.p;Bi.p=o!==0&&8>o?o:8;var g=Ze.T,a={};Ze.T=a,q7(A,!1,e,t);try{var s=n(),I=Ze.S;if(I!==null&&I(a,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var r=gbe(s,i);E1(A,e,r,tI(A))}else E1(A,e,i,tI(A))}catch(C){E1(A,e,{then:function(){},status:"rejected",reason:C},tI())}finally{Bi.p=o,g!==null&&a.types!==null&&(g.types=a.types),Ze.T=g}}function lbe(){}function _7(A,e,t,i){if(A.tag!==5)throw Error(MA(476));var n=GDA(A).queue;DDA(A,n,e,Df,t===null?lbe:function(){return kDA(A),t(i)})}function GDA(A){var e=A.memoizedState;if(e!==null)return e;e={memoizedState:Df,baseState:Df,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cu,lastRenderedState:Df},next:null};var t={};return e.next={memoizedState:t,baseState:t,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cu,lastRenderedState:t},next:null},A.memoizedState=e,A=A.alternate,A!==null&&(A.memoizedState=e),e}function kDA(A){var e=GDA(A);e.next===null&&(e=A.alternate.memoizedState),E1(A,e.next.queue,{},tI())}function O7(){return Hg(x1)}function JDA(){return po().memoizedState}function NDA(){return po().memoizedState}function cbe(A){for(var e=A.return;e!==null;){switch(e.tag){case 24:case 3:var t=tI();A=Zh(t);var i=Wh(e,A,t);i!==null&&(Ps(i,e,t),C1(i,e,t)),e={cache:b7()},A.payload=e;return}e=e.return}}function Bbe(A,e,t){var i=tI();t={lane:i,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null},g3(A)?RDA(e,t):(t=c7(A,e,t,i),t!==null&&(Ps(t,A,i),xDA(t,e,i)))}function YDA(A,e,t){var i=tI();E1(A,e,t,i)}function E1(A,e,t,i){var n={lane:i,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null};if(g3(A))RDA(e,n);else{var o=A.alternate;if(A.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var g=e.lastRenderedState,a=o(g,t);if(n.hasEagerState=!0,n.eagerState=a,qr(a,g))return ZW(A,e,n,0),Xi===null&&HW(),!1}catch{}finally{}if(t=c7(A,e,n,i),t!==null)return Ps(t,A,i),xDA(t,e,i),!0}return!1}function q7(A,e,t,i){if(i={lane:2,revertLane:k$(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},g3(A)){if(e)throw Error(MA(479))}else e=c7(A,t,i,2),e!==null&&Ps(e,A,2)}function g3(A){var e=A.alternate;return A===It||e!==null&&e===It}function RDA(A,e){OD=$W=!0;var t=A.pending;t===null?e.next=e:(e.next=t.next,t.next=e),A.pending=e}function xDA(A,e,t){if(t&4194048){var i=e.lanes;i&=A.pendingLanes,t|=i,e.lanes=t,SbA(A,t)}}var u1={readContext:Hg,use:t3,useCallback:to,useContext:to,useEffect:to,useImperativeHandle:to,useLayoutEffect:to,useInsertionEffect:to,useMemo:to,useReducer:to,useRef:to,useState:to,useDebugValue:to,useDeferredValue:to,useTransition:to,useSyncExternalStore:to,useId:to,useHostTransitionStatus:to,useFormState:to,useActionState:to,useOptimistic:to,useMemoCache:to,useCacheRefresh:to};u1.useEffectEvent=to;var FDA={readContext:Hg,use:t3,useCallback:function(A,e){return Pa().memoizedState=[A,e===void 0?null:e],A},useContext:Hg,useEffect:uDA,useImperativeHandle:function(A,e,t){t=t!=null?t.concat([A]):null,n3(4194308,4,pDA.bind(null,e,A),t)},useLayoutEffect:function(A,e){return n3(4194308,4,A,e)},useInsertionEffect:function(A,e){n3(4,2,A,e)},useMemo:function(A,e){var t=Pa();e=e===void 0?null:e;var i=A();if(Kf){Rh(!0);try{A()}finally{Rh(!1)}}return t.memoizedState=[i,e],i},useReducer:function(A,e,t){var i=Pa();if(t!==void 0){var n=t(e);if(Kf){Rh(!0);try{t(e)}finally{Rh(!1)}}}else n=e;return i.memoizedState=i.baseState=n,A={pending:null,lanes:0,dispatch:null,lastRenderedReducer:A,lastRenderedState:n},i.queue=A,A=A.dispatch=Bbe.bind(null,It,A),[i.memoizedState,A]},useRef:function(A){var e=Pa();return A={current:A},e.memoizedState=A},useState:function(A){A=U7(A);var e=A.queue,t=YDA.bind(null,It,e);return e.dispatch=t,[A.memoizedState,t]},useDebugValue:z7,useDeferredValue:function(A,e){var t=Pa();return T7(t,A,e)},useTransition:function(){var A=U7(!1);return A=DDA.bind(null,It,A.queue,!0,!1),Pa().memoizedState=A,[!1,A]},useSyncExternalStore:function(A,e,t){var i=It,n=Pa();if(Kt){if(t===void 0)throw Error(MA(407));t=t()}else{if(t=e(),Xi===null)throw Error(MA(349));vt&127||eDA(i,e,t)}n.memoizedState=t;var o={value:t,getSnapshot:e};return n.queue=o,uDA(iDA.bind(null,i,o,A),[A]),i.flags|=2048,jD(9,{destroy:void 0},tDA.bind(null,i,o,t,e),null),t},useId:function(){var A=Pa(),e=Xi.identifierPrefix;if(Kt){var t=WB,i=ZB;t=(i&~(1<<32-Or(i)-1)).toString(32)+t,e="_"+e+"R_"+t,t=A3++,0<t&&(e+="H"+t.toString(32)),e+="_"}else t=abe++,e="_"+e+"r_"+t.toString(32)+"_";return A.memoizedState=e},useHostTransitionStatus:O7,useFormState:lDA,useActionState:lDA,useOptimistic:function(A){var e=Pa();e.memoizedState=e.baseState=A;var t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=t,e=q7.bind(null,It,!0,t),t.dispatch=e,[A,e]},useMemoCache:Z7,useCacheRefresh:function(){return Pa().memoizedState=cbe.bind(null,It)},useEffectEvent:function(A){var e=Pa(),t={impl:A};return e.memoizedState=t,function(){if(Qi&2)throw Error(MA(440));return t.impl.apply(void 0,arguments)}}},j7={readContext:Hg,use:t3,useCallback:yDA,useContext:Hg,useEffect:X7,useImperativeHandle:fDA,useInsertionEffect:hDA,useLayoutEffect:mDA,useMemo:bDA,useReducer:i3,useRef:EDA,useState:function(){return i3(cu)},useDebugValue:z7,useDeferredValue:function(A,e){var t=po();return wDA(t,Hi.memoizedState,A,e)},useTransition:function(){var A=i3(cu)[0],e=po().memoizedState;return[typeof A=="boolean"?A:Q1(A),e]},useSyncExternalStore:ADA,useId:JDA,useHostTransitionStatus:O7,useFormState:cDA,useActionState:cDA,useOptimistic:function(A,e){var t=po();return gDA(t,Hi,A,e)},useMemoCache:Z7,useCacheRefresh:NDA};j7.useEffectEvent=dDA;var MDA={readContext:Hg,use:t3,useCallback:yDA,useContext:Hg,useEffect:X7,useImperativeHandle:fDA,useInsertionEffect:hDA,useLayoutEffect:mDA,useMemo:bDA,useReducer:K7,useRef:EDA,useState:function(){return K7(cu)},useDebugValue:z7,useDeferredValue:function(A,e){var t=po();return Hi===null?T7(t,A,e):wDA(t,Hi.memoizedState,A,e)},useTransition:function(){var A=K7(cu)[0],e=po().memoizedState;return[typeof A=="boolean"?A:Q1(A),e]},useSyncExternalStore:ADA,useId:JDA,useHostTransitionStatus:O7,useFormState:QDA,useActionState:QDA,useOptimistic:function(A,e){var t=po();return Hi!==null?gDA(t,Hi,A,e):(t.baseState=A,[A,t.queue.dispatch])},useMemoCache:Z7,useCacheRefresh:NDA};MDA.useEffectEvent=dDA;function P7(A,e,t,i){e=A.memoizedState,t=t(i,e),t=t==null?e:dn({},e,t),A.memoizedState=t,A.lanes===0&&(A.updateQueue.baseState=t)}var $7={enqueueSetState:function(A,e,t){A=A._reactInternals;var i=tI(),n=Zh(i);n.payload=e,t!=null&&(n.callback=t),e=Wh(A,n,i),e!==null&&(Ps(e,A,i),C1(e,A,i))},enqueueReplaceState:function(A,e,t){A=A._reactInternals;var i=tI(),n=Zh(i);n.tag=1,n.payload=e,t!=null&&(n.callback=t),e=Wh(A,n,i),e!==null&&(Ps(e,A,i),C1(e,A,i))},enqueueForceUpdate:function(A,e){A=A._reactInternals;var t=tI(),i=Zh(t);i.tag=2,e!=null&&(i.callback=e),e=Wh(A,i,t),e!==null&&(Ps(e,A,t),C1(e,A,t))}};function vDA(A,e,t,i,n,o,g){return A=A.stateNode,typeof A.shouldComponentUpdate=="function"?A.shouldComponentUpdate(i,o,g):e.prototype&&e.prototype.isPureReactComponent?!i1(t,i)||!i1(n,o):!0}function LDA(A,e,t,i){A=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,i),e.state!==A&&$7.enqueueReplaceState(e,e.state,null)}function Uf(A,e){var t=e;if("ref"in e){t={};for(var i in e)i!=="ref"&&(t[i]=e[i])}if(A=A.defaultProps){t===e&&(t=dn({},t));for(var n in A)t[n]===void 0&&(t[n]=A[n])}return t}function SDA(A){SW(A)}function HDA(A){console.error(A)}function ZDA(A){SW(A)}function a3(A,e){try{var t=A.onUncaughtError;t(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function WDA(A,e,t){try{var i=A.onCaughtError;i(t.value,{componentStack:t.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function A$(A,e,t){return t=Zh(t),t.tag=3,t.payload={element:null},t.callback=function(){a3(A,e)},t}function KDA(A){return A=Zh(A),A.tag=3,A}function UDA(A,e,t,i){var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var o=i.value;A.payload=function(){return n(o)},A.callback=function(){WDA(e,t,i)}}var g=t.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(A.callback=function(){WDA(e,t,i),typeof n!="function"&&(Th===null?Th=new Set([this]):Th.add(this));var a=i.stack;this.componentDidCatch(i.value,{componentStack:a!==null?a:""})})}function Qbe(A,e,t,i,n){if(t.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=t.alternate,e!==null&&UD(e,t,n,!0),t=Pr.current,t!==null){switch(t.tag){case 31:case 13:return mC===null?h3():t.alternate===null&&io===0&&(io=3),t.flags&=-257,t.flags|=65536,t.lanes=n,i===_W?t.flags|=16384:(e=t.updateQueue,e===null?t.updateQueue=new Set([i]):e.add(i),w$(A,i,n)),!1;case 22:return t.flags|=65536,i===_W?t.flags|=16384:(e=t.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},t.updateQueue=e):(t=e.retryQueue,t===null?e.retryQueue=new Set([i]):t.add(i)),w$(A,i,n)),!1}throw Error(MA(435,t.tag))}return w$(A,i,n),h3(),!1}if(Kt)return e=Pr.current,e!==null?(!(e.flags&65536)&&(e.flags|=256),e.flags|=65536,e.lanes=n,i!==h7&&(A=Error(MA(422),{cause:i}),g1(EC(A,t)))):(i!==h7&&(e=Error(MA(423),{cause:i}),g1(EC(e,t))),A=A.current.alternate,A.flags|=65536,n&=-n,A.lanes|=n,i=EC(i,t),n=A$(A.stateNode,i,n),N7(A,n),io!==4&&(io=2)),!1;var o=Error(MA(520),{cause:i});if(o=EC(o,t),w1===null?w1=[o]:w1.push(o),io!==4&&(io=2),e===null)return!0;i=EC(i,t),t=e;do{switch(t.tag){case 3:return t.flags|=65536,A=n&-n,t.lanes|=A,A=A$(t.stateNode,i,A),N7(t,A),!1;case 1:if(e=t.type,o=t.stateNode,(t.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Th===null||!Th.has(o))))return t.flags|=65536,n&=-n,t.lanes|=n,n=KDA(n),UDA(n,A,t,i),N7(t,n),!1}t=t.return}while(t!==null);return!1}var e$=Error(MA(461)),Yo=!1;function Zg(A,e,t,i){e.child=A===null?TwA(e,null,t,i):Wf(e,A.child,t,i)}function VDA(A,e,t,i,n){t=t.render;var o=e.ref;if("ref"in i){var g={};for(var a in i)a!=="ref"&&(g[a]=i[a])}else g=i;return Lf(e),i=v7(A,e,t,g,o,n),a=L7(),A!==null&&!Yo?(S7(A,e,n),Bu(A,e,n)):(Kt&&a&&u7(e),e.flags|=1,Zg(A,e,i,n),e.child)}function XDA(A,e,t,i,n){if(A===null){var o=t.type;return typeof o=="function"&&!B7(o)&&o.defaultProps===void 0&&t.compare===null?(e.tag=15,e.type=o,zDA(A,e,o,i,n)):(A=KW(t.type,null,i,e,e.mode,n),A.ref=e.ref,A.return=e,e.child=A)}if(o=A.child,!r$(A,n)){var g=o.memoizedProps;if(t=t.compare,t=t!==null?t:i1,t(g,i)&&A.ref===e.ref)return Bu(A,e,n)}return e.flags|=1,A=su(o,i),A.ref=e.ref,A.return=e,e.child=A}function zDA(A,e,t,i,n){if(A!==null){var o=A.memoizedProps;if(i1(o,i)&&A.ref===e.ref)if(Yo=!1,e.pendingProps=i=o,r$(A,n))A.flags&131072&&(Yo=!0);else return e.lanes=A.lanes,Bu(A,e,n)}return t$(A,e,t,i,n)}function TDA(A,e,t,i){var n=i.children,o=A!==null?A.memoizedState:null;if(A===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if(e.flags&128){if(o=o!==null?o.baseLanes|t:t,A!==null){for(i=e.child=A.child,n=0;i!==null;)n=n|i.lanes|i.childLanes,i=i.sibling;i=n&~o}else i=0,e.child=null;return _DA(A,e,o,t,i)}if(t&536870912)e.memoizedState={baseLanes:0,cachePool:null},A!==null&&zW(e,o!==null?o.cachePool:null),o!==null?qwA(e,o):R7(),jwA(e);else return i=e.lanes=536870912,_DA(A,e,o!==null?o.baseLanes|t:t,t,i)}else o!==null?(zW(e,o.cachePool),qwA(e,o),Uh(),e.memoizedState=null):(A!==null&&zW(e,null),R7(),Uh());return Zg(A,e,n,t),e.child}function d1(A,e){return A!==null&&A.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function _DA(A,e,t,i,n){var o=D7();return o=o===null?null:{parent:Jo._currentValue,pool:o},e.memoizedState={baseLanes:t,cachePool:o},A!==null&&zW(e,null),R7(),jwA(e),A!==null&&UD(A,e,i,!0),e.childLanes=n,null}function s3(A,e){return e=I3({mode:e.mode,children:e.children},A.mode),e.ref=A.ref,A.child=e,e.return=A,e}function ODA(A,e,t){return Wf(e,A.child,null,t),A=s3(e,e.pendingProps),A.flags|=2,$r(e),e.memoizedState=null,A}function Ebe(A,e,t){var i=e.pendingProps,n=(e.flags&128)!==0;if(e.flags&=-129,A===null){if(Kt){if(i.mode==="hidden")return A=s3(e,i),e.lanes=536870912,d1(null,A);if(F7(e),(A=hn)?(A=akA(A,hC),A=A!==null&&A.data==="&"?A:null,A!==null&&(e.memoizedState={dehydrated:A,treeContext:Mh!==null?{id:ZB,overflow:WB}:null,retryLane:536870912,hydrationErrors:null},t=RwA(A),t.return=e,e.child=t,Sg=e,hn=null)):A=null,A===null)throw Lh(e);return e.lanes=536870912,null}return s3(e,i)}var o=A.memoizedState;if(o!==null){var g=o.dehydrated;if(F7(e),n)if(e.flags&256)e.flags&=-257,e=ODA(A,e,t);else if(e.memoizedState!==null)e.child=A.child,e.flags|=128,e=null;else throw Error(MA(558));else if(Yo||UD(A,e,t,!1),n=(t&A.childLanes)!==0,Yo||n){if(i=Xi,i!==null&&(g=HbA(i,t),g!==0&&g!==o.retryLane))throw o.retryLane=g,xf(A,g),Ps(i,A,g),e$;h3(),e=ODA(A,e,t)}else A=o.treeContext,hn=pC(g.nextSibling),Sg=e,Kt=!0,vh=null,hC=!1,A!==null&&MwA(e,A),e=s3(e,i),e.flags|=4096;return e}return A=su(A.child,{mode:i.mode,children:i.children}),A.ref=e.ref,e.child=A,A.return=e,A}function r3(A,e){var t=e.ref;if(t===null)A!==null&&A.ref!==null&&(e.flags|=4194816);else{if(typeof t!="function"&&typeof t!="object")throw Error(MA(284));(A===null||A.ref!==t)&&(e.flags|=4194816)}}function t$(A,e,t,i,n){return Lf(e),t=v7(A,e,t,i,void 0,n),i=L7(),A!==null&&!Yo?(S7(A,e,n),Bu(A,e,n)):(Kt&&i&&u7(e),e.flags|=1,Zg(A,e,t,n),e.child)}function qDA(A,e,t,i,n,o){return Lf(e),e.updateQueue=null,t=$wA(e,i,t,n),PwA(A),i=L7(),A!==null&&!Yo?(S7(A,e,o),Bu(A,e,o)):(Kt&&i&&u7(e),e.flags|=1,Zg(A,e,t,o),e.child)}function jDA(A,e,t,i,n){if(Lf(e),e.stateNode===null){var o=HD,g=t.contextType;typeof g=="object"&&g!==null&&(o=Hg(g)),o=new t(i,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=$7,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=i,o.state=e.memoizedState,o.refs={},k7(e),g=t.contextType,o.context=typeof g=="object"&&g!==null?Hg(g):HD,o.state=e.memoizedState,g=t.getDerivedStateFromProps,typeof g=="function"&&(P7(e,t,g,i),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(g=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),g!==o.state&&$7.enqueueReplaceState(o,o.state,null),c1(e,i,o,n),l1(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(A===null){o=e.stateNode;var a=e.memoizedProps,s=Uf(t,a);o.props=s;var I=o.context,r=t.contextType;g=HD,typeof r=="object"&&r!==null&&(g=Hg(r));var C=t.getDerivedStateFromProps;r=typeof C=="function"||typeof o.getSnapshotBeforeUpdate=="function",a=e.pendingProps!==a,r||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a||I!==g)&&LDA(e,o,i,g),Hh=!1;var l=e.memoizedState;o.state=l,c1(e,i,o,n),l1(),I=e.memoizedState,a||l!==I||Hh?(typeof C=="function"&&(P7(e,t,C,i),I=e.memoizedState),(s=Hh||vDA(e,t,s,i,l,I,g))?(r||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=I),o.props=i,o.state=I,o.context=g,i=s):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,J7(A,e),g=e.memoizedProps,r=Uf(t,g),o.props=r,C=e.pendingProps,l=o.context,I=t.contextType,s=HD,typeof I=="object"&&I!==null&&(s=Hg(I)),a=t.getDerivedStateFromProps,(I=typeof a=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(g!==C||l!==s)&&LDA(e,o,i,s),Hh=!1,l=e.memoizedState,o.state=l,c1(e,i,o,n),l1();var c=e.memoizedState;g!==C||l!==c||Hh||A!==null&&A.dependencies!==null&&VW(A.dependencies)?(typeof a=="function"&&(P7(e,t,a,i),c=e.memoizedState),(r=Hh||vDA(e,t,r,i,l,c,s)||A!==null&&A.dependencies!==null&&VW(A.dependencies))?(I||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,c,s),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,c,s)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||g===A.memoizedProps&&l===A.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||g===A.memoizedProps&&l===A.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=c),o.props=i,o.state=c,o.context=s,i=r):(typeof o.componentDidUpdate!="function"||g===A.memoizedProps&&l===A.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||g===A.memoizedProps&&l===A.memoizedState||(e.flags|=1024),i=!1)}return o=i,r3(A,e),i=(e.flags&128)!==0,o||i?(o=e.stateNode,t=i&&typeof t.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,A!==null&&i?(e.child=Wf(e,A.child,null,n),e.child=Wf(e,null,t,n)):Zg(A,e,t,n),e.memoizedState=o.state,A=e.child):A=Bu(A,e,n),A}function PDA(A,e,t,i){return Mf(),e.flags|=256,Zg(A,e,t,i),e.child}var i$={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function n$(A){return{baseLanes:A,cachePool:WwA()}}function o$(A,e,t){return A=A!==null?A.childLanes&~t:0,e&&(A|=eI),A}function $DA(A,e,t){var i=e.pendingProps,n=!1,o=(e.flags&128)!==0,g;if((g=o)||(g=A!==null&&A.memoizedState===null?!1:(mo.current&2)!==0),g&&(n=!0,e.flags&=-129),g=(e.flags&32)!==0,e.flags&=-33,A===null){if(Kt){if(n?Kh(e):Uh(),(A=hn)?(A=akA(A,hC),A=A!==null&&A.data!=="&"?A:null,A!==null&&(e.memoizedState={dehydrated:A,treeContext:Mh!==null?{id:ZB,overflow:WB}:null,retryLane:536870912,hydrationErrors:null},t=RwA(A),t.return=e,e.child=t,Sg=e,hn=null)):A=null,A===null)throw Lh(e);return W$(A)?e.lanes=32:e.lanes=536870912,null}var a=i.children;return i=i.fallback,n?(Uh(),n=e.mode,a=I3({mode:"hidden",children:a},n),i=Ff(i,n,t,null),a.return=e,i.return=e,a.sibling=i,e.child=a,i=e.child,i.memoizedState=n$(t),i.childLanes=o$(A,g,t),e.memoizedState=i$,d1(null,i)):(Kh(e),g$(e,a))}var s=A.memoizedState;if(s!==null&&(a=s.dehydrated,a!==null)){if(o)e.flags&256?(Kh(e),e.flags&=-257,e=a$(A,e,t)):e.memoizedState!==null?(Uh(),e.child=A.child,e.flags|=128,e=null):(Uh(),a=i.fallback,n=e.mode,i=I3({mode:"visible",children:i.children},n),a=Ff(a,n,t,null),a.flags|=2,i.return=e,a.return=e,i.sibling=a,e.child=i,Wf(e,A.child,null,t),i=e.child,i.memoizedState=n$(t),i.childLanes=o$(A,g,t),e.memoizedState=i$,e=d1(null,i));else if(Kh(e),W$(a)){if(g=a.nextSibling&&a.nextSibling.dataset,g)var I=g.dgst;g=I,i=Error(MA(419)),i.stack="",i.digest=g,g1({value:i,source:null,stack:null}),e=a$(A,e,t)}else if(Yo||UD(A,e,t,!1),g=(t&A.childLanes)!==0,Yo||g){if(g=Xi,g!==null&&(i=HbA(g,t),i!==0&&i!==s.retryLane))throw s.retryLane=i,xf(A,i),Ps(g,A,i),e$;Z$(a)||h3(),e=a$(A,e,t)}else Z$(a)?(e.flags|=192,e.child=A.child,e=null):(A=s.treeContext,hn=pC(a.nextSibling),Sg=e,Kt=!0,vh=null,hC=!1,A!==null&&MwA(e,A),e=g$(e,i.children),e.flags|=4096);return e}return n?(Uh(),a=i.fallback,n=e.mode,s=A.child,I=s.sibling,i=su(s,{mode:"hidden",children:i.children}),i.subtreeFlags=s.subtreeFlags&65011712,I!==null?a=su(I,a):(a=Ff(a,n,t,null),a.flags|=2),a.return=e,i.return=e,i.sibling=a,e.child=i,d1(null,i),i=e.child,a=A.child.memoizedState,a===null?a=n$(t):(n=a.cachePool,n!==null?(s=Jo._currentValue,n=n.parent!==s?{parent:s,pool:s}:n):n=WwA(),a={baseLanes:a.baseLanes|t,cachePool:n}),i.memoizedState=a,i.childLanes=o$(A,g,t),e.memoizedState=i$,d1(A.child,i)):(Kh(e),t=A.child,A=t.sibling,t=su(t,{mode:"visible",children:i.children}),t.return=e,t.sibling=null,A!==null&&(g=e.deletions,g===null?(e.deletions=[A],e.flags|=16):g.push(A)),e.child=t,e.memoizedState=null,t)}function g$(A,e){return e=I3({mode:"visible",children:e},A.mode),e.return=A,A.child=e}function I3(A,e){return A=jr(22,A,null,e),A.lanes=0,A}function a$(A,e,t){return Wf(e,A.child,null,t),A=g$(e,e.pendingProps.children),A.flags|=2,e.memoizedState=null,A}function AGA(A,e,t){A.lanes|=e;var i=A.alternate;i!==null&&(i.lanes|=e),f7(A.return,e,t)}function s$(A,e,t,i,n,o){var g=A.memoizedState;g===null?A.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:n,treeForkCount:o}:(g.isBackwards=e,g.rendering=null,g.renderingStartTime=0,g.last=i,g.tail=t,g.tailMode=n,g.treeForkCount=o)}function eGA(A,e,t){var i=e.pendingProps,n=i.revealOrder,o=i.tail;i=i.children;var g=mo.current,a=(g&2)!==0;if(a?(g=g&1|2,e.flags|=128):g&=1,nn(mo,g),Zg(A,e,i,t),i=Kt?o1:0,!a&&A!==null&&A.flags&128)A:for(A=e.child;A!==null;){if(A.tag===13)A.memoizedState!==null&&AGA(A,t,e);else if(A.tag===19)AGA(A,t,e);else if(A.child!==null){A.child.return=A,A=A.child;continue}if(A===e)break A;for(;A.sibling===null;){if(A.return===null||A.return===e)break A;A=A.return}A.sibling.return=A.return,A=A.sibling}switch(n){case"forwards":for(t=e.child,n=null;t!==null;)A=t.alternate,A!==null&&PW(A)===null&&(n=t),t=t.sibling;t=n,t===null?(n=e.child,e.child=null):(n=t.sibling,t.sibling=null),s$(e,!1,n,t,o,i);break;case"backwards":case"unstable_legacy-backwards":for(t=null,n=e.child,e.child=null;n!==null;){if(A=n.alternate,A!==null&&PW(A)===null){e.child=n;break}A=n.sibling,n.sibling=t,t=n,n=A}s$(e,!0,t,null,o,i);break;case"together":s$(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function Bu(A,e,t){if(A!==null&&(e.dependencies=A.dependencies),zh|=e.lanes,!(t&e.childLanes))if(A!==null){if(UD(A,e,t,!1),(t&e.childLanes)===0)return null}else return null;if(A!==null&&e.child!==A.child)throw Error(MA(153));if(e.child!==null){for(A=e.child,t=su(A,A.pendingProps),e.child=t,t.return=e;A.sibling!==null;)A=A.sibling,t=t.sibling=su(A,A.pendingProps),t.return=e;t.sibling=null}return e.child}function r$(A,e){return A.lanes&e?!0:(A=A.dependencies,!!(A!==null&&VW(A)))}function ube(A,e,t){switch(e.tag){case 3:pW(e,e.stateNode.containerInfo),Sh(e,Jo,A.memoizedState.cache),Mf();break;case 27:case 5:xP(e);break;case 4:pW(e,e.stateNode.containerInfo);break;case 10:Sh(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,F7(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(Kh(e),e.flags|=128,null):t&e.child.childLanes?$DA(A,e,t):(Kh(e),A=Bu(A,e,t),A!==null?A.sibling:null);Kh(e);break;case 19:var n=(A.flags&128)!==0;if(i=(t&e.childLanes)!==0,i||(UD(A,e,t,!1),i=(t&e.childLanes)!==0),n){if(i)return eGA(A,e,t);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),nn(mo,mo.current),i)break;return null;case 22:return e.lanes=0,TDA(A,e,t,e.pendingProps);case 24:Sh(e,Jo,A.memoizedState.cache)}return Bu(A,e,t)}function tGA(A,e,t){if(A!==null)if(A.memoizedProps!==e.pendingProps)Yo=!0;else{if(!r$(A,t)&&!(e.flags&128))return Yo=!1,ube(A,e,t);Yo=!!(A.flags&131072)}else Yo=!1,Kt&&e.flags&1048576&&FwA(e,o1,e.index);switch(e.lanes=0,e.tag){case 16:A:{var i=e.pendingProps;if(A=Hf(e.elementType),e.type=A,typeof A=="function")B7(A)?(i=Uf(A,i),e.tag=1,e=jDA(null,e,A,i,t)):(e.tag=0,e=t$(null,e,A,i,t));else{if(A!=null){var n=A.$$typeof;if(n===DP){e.tag=11,e=VDA(null,e,A,i,t);break A}else if(n===JP){e.tag=14,e=XDA(null,e,A,i,t);break A}}throw e=YP(A)||A,Error(MA(306,e,""))}}return e;case 0:return t$(A,e,e.type,e.pendingProps,t);case 1:return i=e.type,n=Uf(i,e.pendingProps),jDA(A,e,i,n,t);case 3:A:{if(pW(e,e.stateNode.containerInfo),A===null)throw Error(MA(387));i=e.pendingProps;var o=e.memoizedState;n=o.element,J7(A,e),c1(e,i,null,t);var g=e.memoizedState;if(i=g.cache,Sh(e,Jo,i),i!==o.cache&&y7(e,[Jo],t,!0),l1(),i=g.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:g.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=PDA(A,e,i,t);break A}else if(i!==n){n=EC(Error(MA(424)),e),g1(n),e=PDA(A,e,i,t);break A}else{switch(A=e.stateNode.containerInfo,A.nodeType){case 9:A=A.body;break;default:A=A.nodeName==="HTML"?A.ownerDocument.body:A}for(hn=pC(A.firstChild),Sg=e,Kt=!0,vh=null,hC=!0,t=TwA(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling}else{if(Mf(),i===n){e=Bu(A,e,t);break A}Zg(A,e,i,t)}e=e.child}return e;case 26:return r3(A,e),A===null?(t=ckA(e.type,null,e.pendingProps,null))?e.memoizedState=t:Kt||(t=e.type,A=e.pendingProps,i=D3(Yh.current).createElement(t),i[Lg]=e,i[zs]=A,Wg(i,t,A),sg(i),e.stateNode=i):e.memoizedState=ckA(e.type,A.memoizedProps,e.pendingProps,A.memoizedState),null;case 27:return xP(e),A===null&&Kt&&(i=e.stateNode=IkA(e.type,e.pendingProps,Yh.current),Sg=e,hC=!0,n=hn,jh(e.type)?(K$=n,hn=pC(i.firstChild)):hn=n),Zg(A,e,e.pendingProps.children,t),r3(A,e),A===null&&(e.flags|=4194304),e.child;case 5:return A===null&&Kt&&((n=i=hn)&&(i=Tbe(i,e.type,e.pendingProps,hC),i!==null?(e.stateNode=i,Sg=e,hn=pC(i.firstChild),hC=!1,n=!0):n=!1),n||Lh(e)),xP(e),n=e.type,o=e.pendingProps,g=A!==null?A.memoizedProps:null,i=o.children,L$(n,o)?i=null:g!==null&&L$(n,g)&&(e.flags|=32),e.memoizedState!==null&&(n=v7(A,e,sbe,null,null,t),x1._currentValue=n),r3(A,e),Zg(A,e,i,t),e.child;case 6:return A===null&&Kt&&((A=t=hn)&&(t=_be(t,e.pendingProps,hC),t!==null?(e.stateNode=t,Sg=e,hn=null,A=!0):A=!1),A||Lh(e)),null;case 13:return $DA(A,e,t);case 4:return pW(e,e.stateNode.containerInfo),i=e.pendingProps,A===null?e.child=Wf(e,null,i,t):Zg(A,e,i,t),e.child;case 11:return VDA(A,e,e.type,e.pendingProps,t);case 7:return Zg(A,e,e.pendingProps,t),e.child;case 8:return Zg(A,e,e.pendingProps.children,t),e.child;case 12:return Zg(A,e,e.pendingProps.children,t),e.child;case 10:return i=e.pendingProps,Sh(e,e.type,i.value),Zg(A,e,i.children,t),e.child;case 9:return n=e.type._context,i=e.pendingProps.children,Lf(e),n=Hg(n),i=i(n),e.flags|=1,Zg(A,e,i,t),e.child;case 14:return XDA(A,e,e.type,e.pendingProps,t);case 15:return zDA(A,e,e.type,e.pendingProps,t);case 19:return eGA(A,e,t);case 31:return Ebe(A,e,t);case 22:return TDA(A,e,t,e.pendingProps);case 24:return Lf(e),i=Hg(Jo),A===null?(n=D7(),n===null&&(n=Xi,o=b7(),n.pooledCache=o,o.refCount++,o!==null&&(n.pooledCacheLanes|=t),n=o),e.memoizedState={parent:i,cache:n},k7(e),Sh(e,Jo,n)):(A.lanes&t&&(J7(A,e),c1(e,null,null,t),l1()),n=A.memoizedState,o=e.memoizedState,n.parent!==i?(n={parent:i,cache:i},e.memoizedState=n,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=n),Sh(e,Jo,i)):(i=o.cache,Sh(e,Jo,i),i!==n.cache&&y7(e,[Jo],t,!0))),Zg(A,e,e.pendingProps.children,t),e.child;case 29:throw e.pendingProps}throw Error(MA(156,e.tag))}function Qu(A){A.flags|=4}function I$(A,e,t,i,n){if((e=(A.mode&32)!==0)&&(e=!1),e){if(A.flags|=16777216,(n&335544128)===n)if(A.stateNode.complete)A.flags|=8192;else if(JGA())A.flags|=8192;else throw Zf=_W,G7}else A.flags&=-16777217}function iGA(A,e){if(e.type!=="stylesheet"||e.state.loading&4)A.flags&=-16777217;else if(A.flags|=16777216,!dkA(e))if(JGA())A.flags|=8192;else throw Zf=_W,G7}function C3(A,e){e!==null&&(A.flags|=4),A.flags&16384&&(e=A.tag!==22?vbA():536870912,A.lanes|=e,eG|=e)}function h1(A,e){if(!Kt)switch(A.tailMode){case"hidden":e=A.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?A.tail=null:t.sibling=null;break;case"collapsed":t=A.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||A.tail===null?A.tail=null:A.tail.sibling=null:i.sibling=null}}function mn(A){var e=A.alternate!==null&&A.alternate.child===A.child,t=0,i=0;if(e)for(var n=A.child;n!==null;)t|=n.lanes|n.childLanes,i|=n.subtreeFlags&65011712,i|=n.flags&65011712,n.return=A,n=n.sibling;else for(n=A.child;n!==null;)t|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=A,n=n.sibling;return A.subtreeFlags|=i,A.childLanes=t,e}function dbe(A,e,t){var i=e.pendingProps;switch(d7(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mn(e),null;case 1:return mn(e),null;case 3:return t=e.stateNode,i=null,A!==null&&(i=A.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),Cu(Jo),wD(),t.pendingContext&&(t.context=t.pendingContext,t.pendingContext=null),(A===null||A.child===null)&&(KD(e)?Qu(e):A===null||A.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,m7())),mn(e),null;case 26:var n=e.type,o=e.memoizedState;return A===null?(Qu(e),o!==null?(mn(e),iGA(e,o)):(mn(e),I$(e,n,null,i,t))):o?o!==A.memoizedState?(Qu(e),mn(e),iGA(e,o)):(mn(e),e.flags&=-16777217):(A=A.memoizedProps,A!==i&&Qu(e),mn(e),I$(e,n,A,i,t)),null;case 27:if(fW(e),t=Yh.current,n=e.type,A!==null&&e.stateNode!=null)A.memoizedProps!==i&&Qu(e);else{if(!i){if(e.stateNode===null)throw Error(MA(166));return mn(e),null}A=HB.current,KD(e)?vwA(e):(A=IkA(n,i,t),e.stateNode=A,Qu(e))}return mn(e),null;case 5:if(fW(e),n=e.type,A!==null&&e.stateNode!=null)A.memoizedProps!==i&&Qu(e);else{if(!i){if(e.stateNode===null)throw Error(MA(166));return mn(e),null}if(o=HB.current,KD(e))vwA(e);else{var g=D3(Yh.current);switch(o){case 1:o=g.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:o=g.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":o=g.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":o=g.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":o=g.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?g.createElement("select",{is:i.is}):g.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?g.createElement(n,{is:i.is}):g.createElement(n)}}o[Lg]=e,o[zs]=i;A:for(g=e.child;g!==null;){if(g.tag===5||g.tag===6)o.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===e)break A;for(;g.sibling===null;){if(g.return===null||g.return===e)break A;g=g.return}g.sibling.return=g.return,g=g.sibling}e.stateNode=o;A:switch(Wg(o,n,i),n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break A;case"img":i=!0;break A;default:i=!1}i&&Qu(e)}}return mn(e),I$(e,e.type,A===null?null:A.memoizedProps,e.pendingProps,t),null;case 6:if(A&&e.stateNode!=null)A.memoizedProps!==i&&Qu(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(MA(166));if(A=Yh.current,KD(e)){if(A=e.stateNode,t=e.memoizedProps,i=null,n=Sg,n!==null)switch(n.tag){case 27:case 5:i=n.memoizedProps}A[Lg]=e,A=!!(A.nodeValue===t||i!==null&&i.suppressHydrationWarning===!0||$GA(A.nodeValue,t)),A||Lh(e,!0)}else A=D3(A).createTextNode(i),A[Lg]=e,e.stateNode=A}return mn(e),null;case 31:if(t=e.memoizedState,A===null||A.memoizedState!==null){if(i=KD(e),t!==null){if(A===null){if(!i)throw Error(MA(318));if(A=e.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(MA(557));A[Lg]=e}else Mf(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;mn(e),A=!1}else t=m7(),A!==null&&A.memoizedState!==null&&(A.memoizedState.hydrationErrors=t),A=!0;if(!A)return e.flags&256?($r(e),e):($r(e),null);if(e.flags&128)throw Error(MA(558))}return mn(e),null;case 13:if(i=e.memoizedState,A===null||A.memoizedState!==null&&A.memoizedState.dehydrated!==null){if(n=KD(e),i!==null&&i.dehydrated!==null){if(A===null){if(!n)throw Error(MA(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(MA(317));n[Lg]=e}else Mf(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;mn(e),n=!1}else n=m7(),A!==null&&A.memoizedState!==null&&(A.memoizedState.hydrationErrors=n),n=!0;if(!n)return e.flags&256?($r(e),e):($r(e),null)}return $r(e),e.flags&128?(e.lanes=t,e):(t=i!==null,A=A!==null&&A.memoizedState!==null,t&&(i=e.child,n=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(n=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==n&&(i.flags|=2048)),t!==A&&t&&(e.child.flags|=8192),C3(e,e.updateQueue),mn(e),null);case 4:return wD(),A===null&&R$(e.stateNode.containerInfo),mn(e),null;case 10:return Cu(e.type),mn(e),null;case 19:if(ag(mo),i=e.memoizedState,i===null)return mn(e),null;if(n=(e.flags&128)!==0,o=i.rendering,o===null)if(n)h1(i,!1);else{if(io!==0||A!==null&&A.flags&128)for(A=e.child;A!==null;){if(o=PW(A),o!==null){for(e.flags|=128,h1(i,!1),A=o.updateQueue,e.updateQueue=A,C3(e,A),e.subtreeFlags=0,A=t,t=e.child;t!==null;)YwA(t,A),t=t.sibling;return nn(mo,mo.current&1|2),Kt&&ru(e,i.treeForkCount),e.child}A=A.sibling}i.tail!==null&&Tr()>E3&&(e.flags|=128,n=!0,h1(i,!1),e.lanes=4194304)}else{if(!n)if(A=PW(o),A!==null){if(e.flags|=128,n=!0,A=A.updateQueue,e.updateQueue=A,C3(e,A),h1(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Kt)return mn(e),null}else 2*Tr()-i.renderingStartTime>E3&&t!==536870912&&(e.flags|=128,n=!0,h1(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(A=i.last,A!==null?A.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(A=i.tail,i.rendering=A,i.tail=A.sibling,i.renderingStartTime=Tr(),A.sibling=null,t=mo.current,nn(mo,n?t&1|2:t&1),Kt&&ru(e,i.treeForkCount),A):(mn(e),null);case 22:case 23:return $r(e),x7(),i=e.memoizedState!==null,A!==null?A.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?t&536870912&&!(e.flags&128)&&(mn(e),e.subtreeFlags&6&&(e.flags|=8192)):mn(e),t=e.updateQueue,t!==null&&C3(e,t.retryQueue),t=null,A!==null&&A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(t=A.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==t&&(e.flags|=2048),A!==null&&ag(Sf),null;case 24:return t=null,A!==null&&(t=A.memoizedState.cache),e.memoizedState.cache!==t&&(e.flags|=2048),Cu(Jo),mn(e),null;case 25:return null;case 30:return null}throw Error(MA(156,e.tag))}function hbe(A,e){switch(d7(e),e.tag){case 1:return A=e.flags,A&65536?(e.flags=A&-65537|128,e):null;case 3:return Cu(Jo),wD(),A=e.flags,A&65536&&!(A&128)?(e.flags=A&-65537|128,e):null;case 26:case 27:case 5:return fW(e),null;case 31:if(e.memoizedState!==null){if($r(e),e.alternate===null)throw Error(MA(340));Mf()}return A=e.flags,A&65536?(e.flags=A&-65537|128,e):null;case 13:if($r(e),A=e.memoizedState,A!==null&&A.dehydrated!==null){if(e.alternate===null)throw Error(MA(340));Mf()}return A=e.flags,A&65536?(e.flags=A&-65537|128,e):null;case 19:return ag(mo),null;case 4:return wD(),null;case 10:return Cu(e.type),null;case 22:case 23:return $r(e),x7(),A!==null&&ag(Sf),A=e.flags,A&65536?(e.flags=A&-65537|128,e):null;case 24:return Cu(Jo),null;case 25:return null;default:return null}}function nGA(A,e){switch(d7(e),e.tag){case 3:Cu(Jo),wD();break;case 26:case 27:case 5:fW(e);break;case 4:wD();break;case 31:e.memoizedState!==null&&$r(e);break;case 13:$r(e);break;case 19:ag(mo);break;case 10:Cu(e.type);break;case 22:case 23:$r(e),x7(),A!==null&&ag(Sf);break;case 24:Cu(Jo)}}function m1(A,e){try{var t=e.updateQueue,i=t!==null?t.lastEffect:null;if(i!==null){var n=i.next;t=n;do{if((t.tag&A)===A){i=void 0;var o=t.create,g=t.inst;i=o(),g.destroy=i}t=t.next}while(t!==n)}}catch(a){Ji(e,e.return,a)}}function Vh(A,e,t){try{var i=e.updateQueue,n=i!==null?i.lastEffect:null;if(n!==null){var o=n.next;i=o;do{if((i.tag&A)===A){var g=i.inst,a=g.destroy;if(a!==void 0){g.destroy=void 0,n=e;var s=t,I=a;try{I()}catch(r){Ji(n,s,r)}}}i=i.next}while(i!==o)}}catch(r){Ji(e,e.return,r)}}function oGA(A){var e=A.updateQueue;if(e!==null){var t=A.stateNode;try{OwA(e,t)}catch(i){Ji(A,A.return,i)}}}function gGA(A,e,t){t.props=Uf(A.type,A.memoizedProps),t.state=A.memoizedState;try{t.componentWillUnmount()}catch(i){Ji(A,e,i)}}function p1(A,e){try{var t=A.ref;if(t!==null){switch(A.tag){case 26:case 27:case 5:var i=A.stateNode;break;case 30:i=A.stateNode;break;default:i=A.stateNode}typeof t=="function"?A.refCleanup=t(i):t.current=i}}catch(n){Ji(A,e,n)}}function KB(A,e){var t=A.ref,i=A.refCleanup;if(t!==null)if(typeof i=="function")try{i()}catch(n){Ji(A,e,n)}finally{A.refCleanup=null,A=A.alternate,A!=null&&(A.refCleanup=null)}else if(typeof t=="function")try{t(null)}catch(n){Ji(A,e,n)}else t.current=null}function aGA(A){var e=A.type,t=A.memoizedProps,i=A.stateNode;try{A:switch(e){case"button":case"input":case"select":case"textarea":t.autoFocus&&i.focus();break A;case"img":t.src?i.src=t.src:t.srcSet&&(i.srcset=t.srcSet)}}catch(n){Ji(A,A.return,n)}}function C$(A,e,t){try{var i=A.stateNode;Wbe(i,A.type,t,e),i[zs]=e}catch(n){Ji(A,A.return,n)}}function sGA(A){return A.tag===5||A.tag===3||A.tag===26||A.tag===27&&jh(A.type)||A.tag===4}function l$(A){A:for(;;){for(;A.sibling===null;){if(A.return===null||sGA(A.return))return null;A=A.return}for(A.sibling.return=A.return,A=A.sibling;A.tag!==5&&A.tag!==6&&A.tag!==18;){if(A.tag===27&&jh(A.type)||A.flags&2||A.child===null||A.tag===4)continue A;A.child.return=A,A=A.child}if(!(A.flags&2))return A.stateNode}}function c$(A,e,t){var i=A.tag;if(i===5||i===6)A=A.stateNode,e?(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t).insertBefore(A,e):(e=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,e.appendChild(A),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=gu));else if(i!==4&&(i===27&&jh(A.type)&&(t=A.stateNode,e=null),A=A.child,A!==null))for(c$(A,e,t),A=A.sibling;A!==null;)c$(A,e,t),A=A.sibling}function l3(A,e,t){var i=A.tag;if(i===5||i===6)A=A.stateNode,e?t.insertBefore(A,e):t.appendChild(A);else if(i!==4&&(i===27&&jh(A.type)&&(t=A.stateNode),A=A.child,A!==null))for(l3(A,e,t),A=A.sibling;A!==null;)l3(A,e,t),A=A.sibling}function rGA(A){var e=A.stateNode,t=A.memoizedProps;try{for(var i=A.type,n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Wg(e,i,t),e[Lg]=A,e[zs]=t}catch(o){Ji(A,A.return,o)}}var Eu=!1,Ro=!1,B$=!1,IGA=typeof WeakSet=="function"?WeakSet:Set,rg=null;function mbe(A,e){if(A=A.containerInfo,M$=x3,A=fwA(A),a7(A)){if("selectionStart"in A)var t={start:A.selectionStart,end:A.selectionEnd};else A:{t=(t=A.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var n=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break A}var g=0,a=-1,s=-1,I=0,r=0,C=A,l=null;e:for(;;){for(var c;C!==t||n!==0&&C.nodeType!==3||(a=g+n),C!==o||i!==0&&C.nodeType!==3||(s=g+i),C.nodeType===3&&(g+=C.nodeValue.length),(c=C.firstChild)!==null;)l=C,C=c;for(;;){if(C===A)break e;if(l===t&&++I===n&&(a=g),l===o&&++r===i&&(s=g),(c=C.nextSibling)!==null)break;C=l,l=C.parentNode}C=c}t=a===-1||s===-1?null:{start:a,end:s}}else t=null}t=t||{start:0,end:0}}else t=null;for(v$={focusedElem:A,selectionRange:t},x3=!1,rg=e;rg!==null;)if(e=rg,A=e.child,(e.subtreeFlags&1028)!==0&&A!==null)A.return=e,rg=A;else for(;rg!==null;){switch(e=rg,o=e.alternate,A=e.flags,e.tag){case 0:if(A&4&&(A=e.updateQueue,A=A!==null?A.events:null,A!==null))for(t=0;t<A.length;t++)n=A[t],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if(A&1024&&o!==null){A=void 0,t=e,n=o.memoizedProps,o=o.memoizedState,i=t.stateNode;try{var B=Uf(t.type,n);A=i.getSnapshotBeforeUpdate(B,o),i.__reactInternalSnapshotBeforeUpdate=A}catch(E){Ji(t,t.return,E)}}break;case 3:if(A&1024){if(A=e.stateNode.containerInfo,t=A.nodeType,t===9)H$(A);else if(t===1)switch(A.nodeName){case"HEAD":case"HTML":case"BODY":H$(A);break;default:A.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(A&1024)throw Error(MA(163))}if(A=e.sibling,A!==null){A.return=e.return,rg=A;break}rg=e.return}}function CGA(A,e,t){var i=t.flags;switch(t.tag){case 0:case 11:case 15:du(A,t),i&4&&m1(5,t);break;case 1:if(du(A,t),i&4)if(A=t.stateNode,e===null)try{A.componentDidMount()}catch(g){Ji(t,t.return,g)}else{var n=Uf(t.type,e.memoizedProps);e=e.memoizedState;try{A.componentDidUpdate(n,e,A.__reactInternalSnapshotBeforeUpdate)}catch(g){Ji(t,t.return,g)}}i&64&&oGA(t),i&512&&p1(t,t.return);break;case 3:if(du(A,t),i&64&&(A=t.updateQueue,A!==null)){if(e=null,t.child!==null)switch(t.child.tag){case 27:case 5:e=t.child.stateNode;break;case 1:e=t.child.stateNode}try{OwA(A,e)}catch(g){Ji(t,t.return,g)}}break;case 27:e===null&&i&4&&rGA(t);case 26:case 5:du(A,t),e===null&&i&4&&aGA(t),i&512&&p1(t,t.return);break;case 12:du(A,t);break;case 31:du(A,t),i&4&&BGA(A,t);break;case 13:du(A,t),i&4&&QGA(A,t),i&64&&(A=t.memoizedState,A!==null&&(A=A.dehydrated,A!==null&&(t=Jbe.bind(null,t),Obe(A,t))));break;case 22:if(i=t.memoizedState!==null||Eu,!i){e=e!==null&&e.memoizedState!==null||Ro,n=Eu;var o=Ro;Eu=i,(Ro=e)&&!o?hu(A,t,(t.subtreeFlags&8772)!==0):du(A,t),Eu=n,Ro=o}break;case 30:break;default:du(A,t)}}function lGA(A){var e=A.alternate;e!==null&&(A.alternate=null,lGA(e)),A.child=null,A.deletions=null,A.sibling=null,A.tag===5&&(e=A.stateNode,e!==null&&VP(e)),A.stateNode=null,A.return=null,A.dependencies=null,A.memoizedProps=null,A.memoizedState=null,A.pendingProps=null,A.stateNode=null,A.updateQueue=null}var xn=null,_s=!1;function uu(A,e,t){for(t=t.child;t!==null;)cGA(A,e,t),t=t.sibling}function cGA(A,e,t){if(_r&&typeof _r.onCommitFiberUnmount=="function")try{_r.onCommitFiberUnmount(XR,t)}catch{}switch(t.tag){case 26:Ro||KB(t,e),uu(A,e,t),t.memoizedState?t.memoizedState.count--:t.stateNode&&(t=t.stateNode,t.parentNode.removeChild(t));break;case 27:Ro||KB(t,e);var i=xn,n=_s;jh(t.type)&&(xn=t.stateNode,_s=!1),uu(A,e,t),N1(t.stateNode),xn=i,_s=n;break;case 5:Ro||KB(t,e);case 6:if(i=xn,n=_s,xn=null,uu(A,e,t),xn=i,_s=n,xn!==null)if(_s)try{(xn.nodeType===9?xn.body:xn.nodeName==="HTML"?xn.ownerDocument.body:xn).removeChild(t.stateNode)}catch(o){Ji(t,e,o)}else try{xn.removeChild(t.stateNode)}catch(o){Ji(t,e,o)}break;case 18:xn!==null&&(_s?(A=xn,okA(A.nodeType===9?A.body:A.nodeName==="HTML"?A.ownerDocument.body:A,t.stateNode),rG(A)):okA(xn,t.stateNode));break;case 4:i=xn,n=_s,xn=t.stateNode.containerInfo,_s=!0,uu(A,e,t),xn=i,_s=n;break;case 0:case 11:case 14:case 15:Vh(2,t,e),Ro||Vh(4,t,e),uu(A,e,t);break;case 1:Ro||(KB(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"&&gGA(t,e,i)),uu(A,e,t);break;case 21:uu(A,e,t);break;case 22:Ro=(i=Ro)||t.memoizedState!==null,uu(A,e,t),Ro=i;break;default:uu(A,e,t)}}function BGA(A,e){if(e.memoizedState===null&&(A=e.alternate,A!==null&&(A=A.memoizedState,A!==null))){A=A.dehydrated;try{rG(A)}catch(t){Ji(e,e.return,t)}}}function QGA(A,e){if(e.memoizedState===null&&(A=e.alternate,A!==null&&(A=A.memoizedState,A!==null&&(A=A.dehydrated,A!==null))))try{rG(A)}catch(t){Ji(e,e.return,t)}}function pbe(A){switch(A.tag){case 31:case 13:case 19:var e=A.stateNode;return e===null&&(e=A.stateNode=new IGA),e;case 22:return A=A.stateNode,e=A._retryCache,e===null&&(e=A._retryCache=new IGA),e;default:throw Error(MA(435,A.tag))}}function c3(A,e){var t=pbe(A);e.forEach(function(i){if(!t.has(i)){t.add(i);var n=Nbe.bind(null,A,i);i.then(n,n)}})}function Os(A,e){var t=e.deletions;if(t!==null)for(var i=0;i<t.length;i++){var n=t[i],o=A,g=e,a=g;A:for(;a!==null;){switch(a.tag){case 27:if(jh(a.type)){xn=a.stateNode,_s=!1;break A}break;case 5:xn=a.stateNode,_s=!1;break A;case 3:case 4:xn=a.stateNode.containerInfo,_s=!0;break A}a=a.return}if(xn===null)throw Error(MA(160));cGA(o,g,n),xn=null,_s=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)EGA(e,A),e=e.sibling}var Xl=null;function EGA(A,e){var t=A.alternate,i=A.flags;switch(A.tag){case 0:case 11:case 14:case 15:Os(e,A),qs(A),i&4&&(Vh(3,A,A.return),m1(3,A),Vh(5,A,A.return));break;case 1:Os(e,A),qs(A),i&512&&(Ro||t===null||KB(t,t.return)),i&64&&Eu&&(A=A.updateQueue,A!==null&&(i=A.callbacks,i!==null&&(t=A.shared.hiddenCallbacks,A.shared.hiddenCallbacks=t===null?i:t.concat(i))));break;case 26:var n=Xl;if(Os(e,A),qs(A),i&512&&(Ro||t===null||KB(t,t.return)),i&4){var o=t!==null?t.memoizedState:null;if(i=A.memoizedState,t===null)if(i===null)if(A.stateNode===null){A:{i=A.type,t=A.memoizedProps,n=n.ownerDocument||n;e:switch(i){case"title":o=n.getElementsByTagName("title")[0],(!o||o[_R]||o[Lg]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=n.createElement(i),n.head.insertBefore(o,n.querySelector("head > title"))),Wg(o,i,t),o[Lg]=A,sg(o),i=o;break A;case"link":var g=EkA("link","href",n).get(i+(t.href||""));if(g){for(var a=0;a<g.length;a++)if(o=g[a],o.getAttribute("href")===(t.href==null||t.href===""?null:t.href)&&o.getAttribute("rel")===(t.rel==null?null:t.rel)&&o.getAttribute("title")===(t.title==null?null:t.title)&&o.getAttribute("crossorigin")===(t.crossOrigin==null?null:t.crossOrigin)){g.splice(a,1);break e}}o=n.createElement(i),Wg(o,i,t),n.head.appendChild(o);break;case"meta":if(g=EkA("meta","content",n).get(i+(t.content||""))){for(a=0;a<g.length;a++)if(o=g[a],o.getAttribute("content")===(t.content==null?null:""+t.content)&&o.getAttribute("name")===(t.name==null?null:t.name)&&o.getAttribute("property")===(t.property==null?null:t.property)&&o.getAttribute("http-equiv")===(t.httpEquiv==null?null:t.httpEquiv)&&o.getAttribute("charset")===(t.charSet==null?null:t.charSet)){g.splice(a,1);break e}}o=n.createElement(i),Wg(o,i,t),n.head.appendChild(o);break;default:throw Error(MA(468,i))}o[Lg]=A,sg(o),i=o}A.stateNode=i}else ukA(n,A.type,A.stateNode);else A.stateNode=QkA(n,i,A.memoizedProps);else o!==i?(o===null?t.stateNode!==null&&(t=t.stateNode,t.parentNode.removeChild(t)):o.count--,i===null?ukA(n,A.type,A.stateNode):QkA(n,i,A.memoizedProps)):i===null&&A.stateNode!==null&&C$(A,A.memoizedProps,t.memoizedProps)}break;case 27:Os(e,A),qs(A),i&512&&(Ro||t===null||KB(t,t.return)),t!==null&&i&4&&C$(A,A.memoizedProps,t.memoizedProps);break;case 5:if(Os(e,A),qs(A),i&512&&(Ro||t===null||KB(t,t.return)),A.flags&32){n=A.stateNode;try{RD(n,"")}catch(B){Ji(A,A.return,B)}}i&4&&A.stateNode!=null&&(n=A.memoizedProps,C$(A,n,t!==null?t.memoizedProps:n)),i&1024&&(B$=!0);break;case 6:if(Os(e,A),qs(A),i&4){if(A.stateNode===null)throw Error(MA(162));i=A.memoizedProps,t=A.stateNode;try{t.nodeValue=i}catch(B){Ji(A,A.return,B)}}break;case 3:if(J3=null,n=Xl,Xl=G3(e.containerInfo),Os(e,A),Xl=n,qs(A),i&4&&t!==null&&t.memoizedState.isDehydrated)try{rG(e.containerInfo)}catch(B){Ji(A,A.return,B)}B$&&(B$=!1,uGA(A));break;case 4:i=Xl,Xl=G3(A.stateNode.containerInfo),Os(e,A),qs(A),Xl=i;break;case 12:Os(e,A),qs(A);break;case 31:Os(e,A),qs(A),i&4&&(i=A.updateQueue,i!==null&&(A.updateQueue=null,c3(A,i)));break;case 13:Os(e,A),qs(A),A.child.flags&8192&&A.memoizedState!==null!=(t!==null&&t.memoizedState!==null)&&(Q3=Tr()),i&4&&(i=A.updateQueue,i!==null&&(A.updateQueue=null,c3(A,i)));break;case 22:n=A.memoizedState!==null;var s=t!==null&&t.memoizedState!==null,I=Eu,r=Ro;if(Eu=I||n,Ro=r||s,Os(e,A),Ro=r,Eu=I,qs(A),i&8192)A:for(e=A.stateNode,e._visibility=n?e._visibility&-2:e._visibility|1,n&&(t===null||s||Eu||Ro||Vf(A)),t=null,e=A;;){if(e.tag===5||e.tag===26){if(t===null){s=t=e;try{if(o=s.stateNode,n)g=o.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{a=s.stateNode;var C=s.memoizedProps.style,l=C!=null&&C.hasOwnProperty("display")?C.display:null;a.style.display=l==null||typeof l=="boolean"?"":(""+l).trim()}}catch(B){Ji(s,s.return,B)}}}else if(e.tag===6){if(t===null){s=e;try{s.stateNode.nodeValue=n?"":s.memoizedProps}catch(B){Ji(s,s.return,B)}}}else if(e.tag===18){if(t===null){s=e;try{var c=s.stateNode;n?gkA(c,!0):gkA(s.stateNode,!1)}catch(B){Ji(s,s.return,B)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===A)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===A)break A;for(;e.sibling===null;){if(e.return===null||e.return===A)break A;t===e&&(t=null),e=e.return}t===e&&(t=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=A.updateQueue,i!==null&&(t=i.retryQueue,t!==null&&(i.retryQueue=null,c3(A,t))));break;case 19:Os(e,A),qs(A),i&4&&(i=A.updateQueue,i!==null&&(A.updateQueue=null,c3(A,i)));break;case 30:break;case 21:break;default:Os(e,A),qs(A)}}function qs(A){var e=A.flags;if(e&2){try{for(var t,i=A.return;i!==null;){if(sGA(i)){t=i;break}i=i.return}if(t==null)throw Error(MA(160));switch(t.tag){case 27:var n=t.stateNode,o=l$(A);l3(A,o,n);break;case 5:var g=t.stateNode;t.flags&32&&(RD(g,""),t.flags&=-33);var a=l$(A);l3(A,a,g);break;case 3:case 4:var s=t.stateNode.containerInfo,I=l$(A);c$(A,I,s);break;default:throw Error(MA(161))}}catch(r){Ji(A,A.return,r)}A.flags&=-3}e&4096&&(A.flags&=-4097)}function uGA(A){if(A.subtreeFlags&1024)for(A=A.child;A!==null;){var e=A;uGA(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),A=A.sibling}}function du(A,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)CGA(A,e.alternate,e),e=e.sibling}function Vf(A){for(A=A.child;A!==null;){var e=A;switch(e.tag){case 0:case 11:case 14:case 15:Vh(4,e,e.return),Vf(e);break;case 1:KB(e,e.return);var t=e.stateNode;typeof t.componentWillUnmount=="function"&&gGA(e,e.return,t),Vf(e);break;case 27:N1(e.stateNode);case 26:case 5:KB(e,e.return),Vf(e);break;case 22:e.memoizedState===null&&Vf(e);break;case 30:Vf(e);break;default:Vf(e)}A=A.sibling}}function hu(A,e,t){for(t=t&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,n=A,o=e,g=o.flags;switch(o.tag){case 0:case 11:case 15:hu(n,o,t),m1(4,o);break;case 1:if(hu(n,o,t),i=o,n=i.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(I){Ji(i,i.return,I)}if(i=o,n=i.updateQueue,n!==null){var a=i.stateNode;try{var s=n.shared.hiddenCallbacks;if(s!==null)for(n.shared.hiddenCallbacks=null,n=0;n<s.length;n++)_wA(s[n],a)}catch(I){Ji(i,i.return,I)}}t&&g&64&&oGA(o),p1(o,o.return);break;case 27:rGA(o);case 26:case 5:hu(n,o,t),t&&i===null&&g&4&&aGA(o),p1(o,o.return);break;case 12:hu(n,o,t);break;case 31:hu(n,o,t),t&&g&4&&BGA(n,o);break;case 13:hu(n,o,t),t&&g&4&&QGA(n,o);break;case 22:o.memoizedState===null&&hu(n,o,t),p1(o,o.return);break;case 30:break;default:hu(n,o,t)}e=e.sibling}}function Q$(A,e){var t=null;A!==null&&A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(t=A.memoizedState.cachePool.pool),A=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(A=e.memoizedState.cachePool.pool),A!==t&&(A!=null&&A.refCount++,t!=null&&a1(t))}function E$(A,e){A=null,e.alternate!==null&&(A=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==A&&(e.refCount++,A!=null&&a1(A))}function zl(A,e,t,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)dGA(A,e,t,i),e=e.sibling}function dGA(A,e,t,i){var n=e.flags;switch(e.tag){case 0:case 11:case 15:zl(A,e,t,i),n&2048&&m1(9,e);break;case 1:zl(A,e,t,i);break;case 3:zl(A,e,t,i),n&2048&&(A=null,e.alternate!==null&&(A=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==A&&(e.refCount++,A!=null&&a1(A)));break;case 12:if(n&2048){zl(A,e,t,i),A=e.stateNode;try{var o=e.memoizedProps,g=o.id,a=o.onPostCommit;typeof a=="function"&&a(g,e.alternate===null?"mount":"update",A.passiveEffectDuration,-0)}catch(s){Ji(e,e.return,s)}}else zl(A,e,t,i);break;case 31:zl(A,e,t,i);break;case 13:zl(A,e,t,i);break;case 23:break;case 22:o=e.stateNode,g=e.alternate,e.memoizedState!==null?o._visibility&2?zl(A,e,t,i):f1(A,e):o._visibility&2?zl(A,e,t,i):(o._visibility|=2,PD(A,e,t,i,(e.subtreeFlags&10256)!==0||!1)),n&2048&&Q$(g,e);break;case 24:zl(A,e,t,i),n&2048&&E$(e.alternate,e);break;default:zl(A,e,t,i)}}function PD(A,e,t,i,n){for(n=n&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=A,g=e,a=t,s=i,I=g.flags;switch(g.tag){case 0:case 11:case 15:PD(o,g,a,s,n),m1(8,g);break;case 23:break;case 22:var r=g.stateNode;g.memoizedState!==null?r._visibility&2?PD(o,g,a,s,n):f1(o,g):(r._visibility|=2,PD(o,g,a,s,n)),n&&I&2048&&Q$(g.alternate,g);break;case 24:PD(o,g,a,s,n),n&&I&2048&&E$(g.alternate,g);break;default:PD(o,g,a,s,n)}e=e.sibling}}function f1(A,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var t=A,i=e,n=i.flags;switch(i.tag){case 22:f1(t,i),n&2048&&Q$(i.alternate,i);break;case 24:f1(t,i),n&2048&&E$(i.alternate,i);break;default:f1(t,i)}e=e.sibling}}var y1=8192;function $D(A,e,t){if(A.subtreeFlags&y1)for(A=A.child;A!==null;)hGA(A,e,t),A=A.sibling}function hGA(A,e,t){switch(A.tag){case 26:$D(A,e,t),A.flags&y1&&A.memoizedState!==null&&awe(t,Xl,A.memoizedState,A.memoizedProps);break;case 5:$D(A,e,t);break;case 3:case 4:var i=Xl;Xl=G3(A.stateNode.containerInfo),$D(A,e,t),Xl=i;break;case 22:A.memoizedState===null&&(i=A.alternate,i!==null&&i.memoizedState!==null?(i=y1,y1=16777216,$D(A,e,t),y1=i):$D(A,e,t));break;default:$D(A,e,t)}}function mGA(A){var e=A.alternate;if(e!==null&&(A=e.child,A!==null)){e.child=null;do e=A.sibling,A.sibling=null,A=e;while(A!==null)}}function b1(A){var e=A.deletions;if(A.flags&16){if(e!==null)for(var t=0;t<e.length;t++){var i=e[t];rg=i,fGA(i,A)}mGA(A)}if(A.subtreeFlags&10256)for(A=A.child;A!==null;)pGA(A),A=A.sibling}function pGA(A){switch(A.tag){case 0:case 11:case 15:b1(A),A.flags&2048&&Vh(9,A,A.return);break;case 3:b1(A);break;case 12:b1(A);break;case 22:var e=A.stateNode;A.memoizedState!==null&&e._visibility&2&&(A.return===null||A.return.tag!==13)?(e._visibility&=-3,B3(A)):b1(A);break;default:b1(A)}}function B3(A){var e=A.deletions;if(A.flags&16){if(e!==null)for(var t=0;t<e.length;t++){var i=e[t];rg=i,fGA(i,A)}mGA(A)}for(A=A.child;A!==null;){switch(e=A,e.tag){case 0:case 11:case 15:Vh(8,e,e.return),B3(e);break;case 22:t=e.stateNode,t._visibility&2&&(t._visibility&=-3,B3(e));break;default:B3(e)}A=A.sibling}}function fGA(A,e){for(;rg!==null;){var t=rg;switch(t.tag){case 0:case 11:case 15:Vh(8,t,e);break;case 23:case 22:if(t.memoizedState!==null&&t.memoizedState.cachePool!==null){var i=t.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:a1(t.memoizedState.cache)}if(i=t.child,i!==null)i.return=t,rg=i;else A:for(t=A;rg!==null;){i=rg;var n=i.sibling,o=i.return;if(lGA(i),i===t){rg=null;break A}if(n!==null){n.return=o,rg=n;break A}rg=o}}}var fbe={getCacheForType:function(A){var e=Hg(Jo),t=e.data.get(A);return t===void 0&&(t=A(),e.data.set(A,t)),t},cacheSignal:function(){return Hg(Jo).controller.signal}},ybe=typeof WeakMap=="function"?WeakMap:Map,Qi=0,Xi=null,Nt=null,vt=0,ki=0,AI=null,Xh=!1,AG=!1,u$=!1,mu=0,io=0,zh=0,Xf=0,d$=0,eI=0,eG=0,w1=null,js=null,h$=!1,Q3=0,yGA=0,E3=1/0,u3=null,Th=null,Vo=0,_h=null,tG=null,pu=0,m$=0,p$=null,bGA=null,D1=0,f$=null;function tI(){return Qi&2&&vt!==0?vt&-vt:Ze.T!==null?k$():ZbA()}function wGA(){if(eI===0)if(!(vt&536870912)||Kt){var A=wW;wW<<=1,!(wW&3932160)&&(wW=262144),eI=A}else eI=536870912;return A=Pr.current,A!==null&&(A.flags|=32),eI}function Ps(A,e,t){(A===Xi&&(ki===2||ki===9)||A.cancelPendingCommit!==null)&&(iG(A,0),Oh(A,vt,eI,!1)),TR(A,t),(!(Qi&2)||A!==Xi)&&(A===Xi&&(!(Qi&2)&&(Xf|=t),io===4&&Oh(A,vt,eI,!1)),UB(A))}function DGA(A,e,t){if(Qi&6)throw Error(MA(327));var i=!t&&(e&127)===0&&(e&A.expiredLanes)===0||zR(A,e),n=i?Dbe(A,e):b$(A,e,!0),o=i;do{if(n===0){AG&&!i&&Oh(A,e,0,!1);break}else{if(t=A.current.alternate,o&&!bbe(t)){n=b$(A,e,!1),o=!1;continue}if(n===2){if(o=e,A.errorRecoveryDisabledLanes&o)var g=0;else g=A.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){e=g;A:{var a=A;n=w1;var s=a.current.memoizedState.isDehydrated;if(s&&(iG(a,g).flags|=256),g=b$(a,g,!1),g!==2){if(u$&&!s){a.errorRecoveryDisabledLanes|=o,Xf|=o,n=4;break A}o=js,js=n,o!==null&&(js===null?js=o:js.push.apply(js,o))}n=g}if(o=!1,n!==2)continue}}if(n===1){iG(A,0),Oh(A,e,0,!0);break}A:{switch(i=A,o=n,o){case 0:case 1:throw Error(MA(345));case 4:if((e&4194048)!==e)break;case 6:Oh(i,e,eI,!Xh);break A;case 2:js=null;break;case 3:case 5:break;default:throw Error(MA(329))}if((e&62914560)===e&&(n=Q3+300-Tr(),10<n)){if(Oh(i,e,eI,!Xh),GW(i,0,!0)!==0)break A;pu=e,i.timeoutHandle=ikA(GGA.bind(null,i,t,js,u3,h$,e,eI,Xf,eG,Xh,o,"Throttled",-0,0),n);break A}GGA(i,t,js,u3,h$,e,eI,Xf,eG,Xh,o,null,-0,0)}}break}while(1);UB(A)}function GGA(A,e,t,i,n,o,g,a,s,I,r,C,l,c){if(A.timeoutHandle=-1,C=e.subtreeFlags,C&8192||(C&16785408)===16785408){C={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gu},hGA(e,o,C);var B=(o&62914560)===o?Q3-Tr():(o&4194048)===o?yGA-Tr():0;if(B=swe(C,B),B!==null){pu=o,A.cancelPendingCommit=B(MGA.bind(null,A,e,o,t,i,n,g,a,s,r,C,null,l,c)),Oh(A,o,g,!I);return}}MGA(A,e,o,t,i,n,g,a,s)}function bbe(A){for(var e=A;;){var t=e.tag;if((t===0||t===11||t===15)&&e.flags&16384&&(t=e.updateQueue,t!==null&&(t=t.stores,t!==null)))for(var i=0;i<t.length;i++){var n=t[i],o=n.getSnapshot;n=n.value;try{if(!qr(o(),n))return!1}catch{return!1}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===A)break;for(;e.sibling===null;){if(e.return===null||e.return===A)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Oh(A,e,t,i){e&=~d$,e&=~Xf,A.suspendedLanes|=e,A.pingedLanes&=~e,i&&(A.warmLanes|=e),i=A.expirationTimes;for(var n=e;0<n;){var o=31-Or(n),g=1<<o;i[o]=-1,n&=~g}t!==0&&LbA(A,t,e)}function d3(){return Qi&6?!0:(G1(0,!1),!1)}function y$(){if(Nt!==null){if(ki===0)var A=Nt.return;else A=Nt,Iu=vf=null,H7(A),TD=null,r1=0,A=Nt;for(;A!==null;)nGA(A.alternate,A),A=A.return;Nt=null}}function iG(A,e){var t=A.timeoutHandle;t!==-1&&(A.timeoutHandle=-1,Vbe(t)),t=A.cancelPendingCommit,t!==null&&(A.cancelPendingCommit=null,t()),pu=0,y$(),Xi=A,Nt=t=su(A.current,null),vt=e,ki=0,AI=null,Xh=!1,AG=zR(A,e),u$=!1,eG=eI=d$=Xf=zh=io=0,js=w1=null,h$=!1,e&8&&(e|=e&32);var i=A.entangledLanes;if(i!==0)for(A=A.entanglements,i&=e;0<i;){var n=31-Or(i),o=1<<n;e|=A[n],i&=~o}return mu=e,HW(),t}function kGA(A,e){It=null,Ze.H=u1,e===zD||e===TW?(e=VwA(),ki=3):e===G7?(e=VwA(),ki=4):ki=e===e$?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,AI=e,Nt===null&&(io=1,a3(A,EC(e,A.current)))}function JGA(){var A=Pr.current;return A===null?!0:(vt&4194048)===vt?mC===null:(vt&62914560)===vt||vt&536870912?A===mC:!1}function NGA(){var A=Ze.H;return Ze.H=u1,A===null?u1:A}function YGA(){var A=Ze.A;return Ze.A=fbe,A}function h3(){io=4,Xh||(vt&4194048)!==vt&&Pr.current!==null||(AG=!0),!(zh&134217727)&&!(Xf&134217727)||Xi===null||Oh(Xi,vt,eI,!1)}function b$(A,e,t){var i=Qi;Qi|=2;var n=NGA(),o=YGA();(Xi!==A||vt!==e)&&(u3=null,iG(A,e)),e=!1;var g=io;A:do try{if(ki!==0&&Nt!==null){var a=Nt,s=AI;switch(ki){case 8:y$(),g=6;break A;case 3:case 2:case 9:case 6:Pr.current===null&&(e=!0);var I=ki;if(ki=0,AI=null,nG(A,a,s,I),t&&AG){g=0;break A}break;default:I=ki,ki=0,AI=null,nG(A,a,s,I)}}wbe(),g=io;break}catch(r){kGA(A,r)}while(1);return e&&A.shellSuspendCounter++,Iu=vf=null,Qi=i,Ze.H=n,Ze.A=o,Nt===null&&(Xi=null,vt=0,HW()),g}function wbe(){for(;Nt!==null;)RGA(Nt)}function Dbe(A,e){var t=Qi;Qi|=2;var i=NGA(),n=YGA();Xi!==A||vt!==e?(u3=null,E3=Tr()+500,iG(A,e)):AG=zR(A,e);A:do try{if(ki!==0&&Nt!==null){e=Nt;var o=AI;e:switch(ki){case 1:ki=0,AI=null,nG(A,e,o,1);break;case 2:case 9:if(KwA(o)){ki=0,AI=null,xGA(e);break}e=function(){ki!==2&&ki!==9||Xi!==A||(ki=7),UB(A)},o.then(e,e);break A;case 3:ki=7;break A;case 4:ki=5;break A;case 7:KwA(o)?(ki=0,AI=null,xGA(e)):(ki=0,AI=null,nG(A,e,o,7));break;case 5:var g=null;switch(Nt.tag){case 26:g=Nt.memoizedState;case 5:case 27:var a=Nt;if(g?dkA(g):a.stateNode.complete){ki=0,AI=null;var s=a.sibling;if(s!==null)Nt=s;else{var I=a.return;I!==null?(Nt=I,m3(I)):Nt=null}break e}}ki=0,AI=null,nG(A,e,o,5);break;case 6:ki=0,AI=null,nG(A,e,o,6);break;case 8:y$(),io=6;break A;default:throw Error(MA(462))}}Gbe();break}catch(r){kGA(A,r)}while(1);return Iu=vf=null,Ze.H=i,Ze.A=n,Qi=t,Nt!==null?0:(Xi=null,vt=0,HW(),io)}function Gbe(){for(;Nt!==null&&!qfe();)RGA(Nt)}function RGA(A){var e=tGA(A.alternate,A,mu);A.memoizedProps=A.pendingProps,e===null?m3(A):Nt=e}function xGA(A){var e=A,t=e.alternate;switch(e.tag){case 15:case 0:e=qDA(t,e,e.pendingProps,e.type,void 0,vt);break;case 11:e=qDA(t,e,e.pendingProps,e.type.render,e.ref,vt);break;case 5:H7(e);default:nGA(t,e),e=Nt=YwA(e,mu),e=tGA(t,e,mu)}A.memoizedProps=A.pendingProps,e===null?m3(A):Nt=e}function nG(A,e,t,i){Iu=vf=null,H7(e),TD=null,r1=0;var n=e.return;try{if(Qbe(A,n,e,t,vt)){io=1,a3(A,EC(t,A.current)),Nt=null;return}}catch(o){if(n!==null)throw Nt=n,o;io=1,a3(A,EC(t,A.current)),Nt=null;return}e.flags&32768?(Kt||i===1?A=!0:AG||vt&536870912?A=!1:(Xh=A=!0,(i===2||i===9||i===3||i===6)&&(i=Pr.current,i!==null&&i.tag===13&&(i.flags|=16384))),FGA(e,A)):m3(e)}function m3(A){var e=A;do{if(e.flags&32768){FGA(e,Xh);return}A=e.return;var t=dbe(e.alternate,e,mu);if(t!==null){Nt=t;return}if(e=e.sibling,e!==null){Nt=e;return}Nt=e=A}while(e!==null);io===0&&(io=5)}function FGA(A,e){do{var t=hbe(A.alternate,A);if(t!==null){t.flags&=32767,Nt=t;return}if(t=A.return,t!==null&&(t.flags|=32768,t.subtreeFlags=0,t.deletions=null),!e&&(A=A.sibling,A!==null)){Nt=A;return}Nt=A=t}while(A!==null);io=6,Nt=null}function MGA(A,e,t,i,n,o,g,a,s){A.cancelPendingCommit=null;do p3();while(Vo!==0);if(Qi&6)throw Error(MA(327));if(e!==null){if(e===A.current)throw Error(MA(177));if(o=e.lanes|e.childLanes,o|=l7,gye(A,t,o,g,a,s),A===Xi&&(Nt=Xi=null,vt=0),tG=e,_h=A,pu=t,m$=o,p$=n,bGA=i,e.subtreeFlags&10256||e.flags&10256?(A.callbackNode=null,A.callbackPriority=0,Ybe(yW,function(){return ZGA(),null})):(A.callbackNode=null,A.callbackPriority=0),i=(e.flags&13878)!==0,e.subtreeFlags&13878||i){i=Ze.T,Ze.T=null,n=Bi.p,Bi.p=2,g=Qi,Qi|=4;try{mbe(A,e,t)}finally{Qi=g,Bi.p=n,Ze.T=i}}Vo=1,vGA(),LGA(),SGA()}}function vGA(){if(Vo===1){Vo=0;var A=_h,e=tG,t=(e.flags&13878)!==0;if(e.subtreeFlags&13878||t){t=Ze.T,Ze.T=null;var i=Bi.p;Bi.p=2;var n=Qi;Qi|=4;try{EGA(e,A);var o=v$,g=fwA(A.containerInfo),a=o.focusedElem,s=o.selectionRange;if(g!==a&&a&&a.ownerDocument&&pwA(a.ownerDocument.documentElement,a)){if(s!==null&&a7(a)){var I=s.start,r=s.end;if(r===void 0&&(r=I),"selectionStart"in a)a.selectionStart=I,a.selectionEnd=Math.min(r,a.value.length);else{var C=a.ownerDocument||document,l=C&&C.defaultView||window;if(l.getSelection){var c=l.getSelection(),B=a.textContent.length,E=Math.min(s.start,B),u=s.end===void 0?E:Math.min(s.end,B);!c.extend&&E>u&&(g=u,u=E,E=g);var d=mwA(a,E),f=mwA(a,u);if(d&&f&&(c.rangeCount!==1||c.anchorNode!==d.node||c.anchorOffset!==d.offset||c.focusNode!==f.node||c.focusOffset!==f.offset)){var w=C.createRange();w.setStart(d.node,d.offset),c.removeAllRanges(),E>u?(c.addRange(w),c.extend(f.node,f.offset)):(w.setEnd(f.node,f.offset),c.addRange(w))}}}}for(C=[],c=a;c=c.parentNode;)c.nodeType===1&&C.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<C.length;a++){var y=C[a];y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}x3=!!M$,v$=M$=null}finally{Qi=n,Bi.p=i,Ze.T=t}}A.current=e,Vo=2}}function LGA(){if(Vo===2){Vo=0;var A=_h,e=tG,t=(e.flags&8772)!==0;if(e.subtreeFlags&8772||t){t=Ze.T,Ze.T=null;var i=Bi.p;Bi.p=2;var n=Qi;Qi|=4;try{CGA(A,e.alternate,e)}finally{Qi=n,Bi.p=i,Ze.T=t}}Vo=3}}function SGA(){if(Vo===4||Vo===3){Vo=0,jfe();var A=_h,e=tG,t=pu,i=bGA;e.subtreeFlags&10256||e.flags&10256?Vo=5:(Vo=0,tG=_h=null,HGA(A,A.pendingLanes));var n=A.pendingLanes;if(n===0&&(Th=null),KP(t),e=e.stateNode,_r&&typeof _r.onCommitFiberRoot=="function")try{_r.onCommitFiberRoot(XR,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Ze.T,n=Bi.p,Bi.p=2,Ze.T=null;try{for(var o=A.onRecoverableError,g=0;g<i.length;g++){var a=i[g];o(a.value,{componentStack:a.stack})}}finally{Ze.T=e,Bi.p=n}}pu&3&&p3(),UB(A),n=A.pendingLanes,t&261930&&n&42?A===f$?D1++:(D1=0,f$=A):D1=0,G1(0,!1)}}function HGA(A,e){(A.pooledCacheLanes&=e)===0&&(e=A.pooledCache,e!=null&&(A.pooledCache=null,a1(e)))}function p3(){return vGA(),LGA(),SGA(),ZGA()}function ZGA(){if(Vo!==5)return!1;var A=_h,e=m$;m$=0;var t=KP(pu),i=Ze.T,n=Bi.p;try{Bi.p=32>t?32:t,Ze.T=null,t=p$,p$=null;var o=_h,g=pu;if(Vo=0,tG=_h=null,pu=0,Qi&6)throw Error(MA(331));var a=Qi;if(Qi|=4,pGA(o.current),dGA(o,o.current,g,t),Qi=a,G1(0,!1),_r&&typeof _r.onPostCommitFiberRoot=="function")try{_r.onPostCommitFiberRoot(XR,o)}catch{}return!0}finally{Bi.p=n,Ze.T=i,HGA(A,e)}}function WGA(A,e,t){e=EC(t,e),e=A$(A.stateNode,e,2),A=Wh(A,e,2),A!==null&&(TR(A,2),UB(A))}function Ji(A,e,t){if(A.tag===3)WGA(A,A,t);else for(;e!==null;){if(e.tag===3){WGA(e,A,t);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Th===null||!Th.has(i))){A=EC(t,A),t=KDA(2),i=Wh(e,t,2),i!==null&&(UDA(t,i,e,A),TR(i,2),UB(i));break}}e=e.return}}function w$(A,e,t){var i=A.pingCache;if(i===null){i=A.pingCache=new ybe;var n=new Set;i.set(e,n)}else n=i.get(e),n===void 0&&(n=new Set,i.set(e,n));n.has(t)||(u$=!0,n.add(t),A=kbe.bind(null,A,e,t),e.then(A,A))}function kbe(A,e,t){var i=A.pingCache;i!==null&&i.delete(e),A.pingedLanes|=A.suspendedLanes&t,A.warmLanes&=~t,Xi===A&&(vt&t)===t&&(io===4||io===3&&(vt&62914560)===vt&&300>Tr()-Q3?!(Qi&2)&&iG(A,0):d$|=t,eG===vt&&(eG=0)),UB(A)}function KGA(A,e){e===0&&(e=vbA()),A=xf(A,e),A!==null&&(TR(A,e),UB(A))}function Jbe(A){var e=A.memoizedState,t=0;e!==null&&(t=e.retryLane),KGA(A,t)}function Nbe(A,e){var t=0;switch(A.tag){case 31:case 13:var i=A.stateNode,n=A.memoizedState;n!==null&&(t=n.retryLane);break;case 19:i=A.stateNode;break;case 22:i=A.stateNode._retryCache;break;default:throw Error(MA(314))}i!==null&&i.delete(e),KGA(A,t)}function Ybe(A,e){return SP(A,e)}var f3=null,oG=null,D$=!1,y3=!1,G$=!1,qh=0;function UB(A){A!==oG&&A.next===null&&(oG===null?f3=oG=A:oG=oG.next=A),y3=!0,D$||(D$=!0,xbe())}function G1(A,e){if(!G$&&y3){G$=!0;do for(var t=!1,i=f3;i!==null;){if(!e)if(A!==0){var n=i.pendingLanes;if(n===0)var o=0;else{var g=i.suspendedLanes,a=i.pingedLanes;o=(1<<31-Or(42|A)+1)-1,o&=n&~(g&~a),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(t=!0,zGA(i,o))}else o=vt,o=GW(i,i===Xi?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(o&3)||zR(i,o)||(t=!0,zGA(i,o));i=i.next}while(t);G$=!1}}function Rbe(){UGA()}function UGA(){y3=D$=!1;var A=0;qh!==0&&Ube()&&(A=qh);for(var e=Tr(),t=null,i=f3;i!==null;){var n=i.next,o=VGA(i,e);o===0?(i.next=null,t===null?f3=n:t.next=n,n===null&&(oG=t)):(t=i,(A!==0||o&3)&&(y3=!0)),i=n}Vo!==0&&Vo!==5||G1(A,!1),qh!==0&&(qh=0)}function VGA(A,e){for(var t=A.suspendedLanes,i=A.pingedLanes,n=A.expirationTimes,o=A.pendingLanes&-62914561;0<o;){var g=31-Or(o),a=1<<g,s=n[g];s===-1?(!(a&t)||a&i)&&(n[g]=oye(a,e)):s<=e&&(A.expiredLanes|=a),o&=~a}if(e=Xi,t=vt,t=GW(A,A===e?t:0,A.cancelPendingCommit!==null||A.timeoutHandle!==-1),i=A.callbackNode,t===0||A===e&&(ki===2||ki===9)||A.cancelPendingCommit!==null)return i!==null&&i!==null&&HP(i),A.callbackNode=null,A.callbackPriority=0;if(!(t&3)||zR(A,t)){if(e=t&-t,e===A.callbackPriority)return e;switch(i!==null&&HP(i),KP(t)){case 2:case 8:t=FbA;break;case 32:t=yW;break;case 268435456:t=MbA;break;default:t=yW}return i=XGA.bind(null,A),t=SP(t,i),A.callbackPriority=e,A.callbackNode=t,e}return i!==null&&i!==null&&HP(i),A.callbackPriority=2,A.callbackNode=null,2}function XGA(A,e){if(Vo!==0&&Vo!==5)return A.callbackNode=null,A.callbackPriority=0,null;var t=A.callbackNode;if(p3()&&A.callbackNode!==t)return null;var i=vt;return i=GW(A,A===Xi?i:0,A.cancelPendingCommit!==null||A.timeoutHandle!==-1),i===0?null:(DGA(A,i,e),VGA(A,Tr()),A.callbackNode!=null&&A.callbackNode===t?XGA.bind(null,A):null)}function zGA(A,e){if(p3())return null;DGA(A,e,!0)}function xbe(){Xbe(function(){Qi&6?SP(xbA,Rbe):UGA()})}function k$(){if(qh===0){var A=VD;A===0&&(A=bW,bW<<=1,!(bW&261888)&&(bW=256)),qh=A}return qh}function TGA(A){return A==null||typeof A=="symbol"||typeof A=="boolean"?null:typeof A=="function"?A:YW(""+A)}function _GA(A,e){var t=e.ownerDocument.createElement("input");return t.name=e.name,t.value=e.value,A.id&&t.setAttribute("form",A.id),e.parentNode.insertBefore(t,e),A=new FormData(A),t.parentNode.removeChild(t),A}function Fbe(A,e,t,i,n){if(e==="submit"&&t&&t.stateNode===n){var o=TGA((n[zs]||null).action),g=i.submitter;g&&(e=(e=g[zs]||null)?TGA(e.formAction):g.getAttribute("formAction"),e!==null&&(o=e,g=null));var a=new MW("action","action",null,i,n);A.push({event:a,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(qh!==0){var s=g?_GA(n,g):new FormData(n);_7(t,{pending:!0,data:s,method:n.method,action:o},null,s)}}else typeof o=="function"&&(a.preventDefault(),s=g?_GA(n,g):new FormData(n),_7(t,{pending:!0,data:s,method:n.method,action:o},o,s))},currentTarget:n}]})}}for(var J$=0;J$<C7.length;J$++){var N$=C7[J$],Mbe=N$.toLowerCase(),vbe=N$[0].toUpperCase()+N$.slice(1);Vl(Mbe,"on"+vbe)}Vl(wwA,"onAnimationEnd"),Vl(DwA,"onAnimationIteration"),Vl(GwA,"onAnimationStart"),Vl("dblclick","onDoubleClick"),Vl("focusin","onFocus"),Vl("focusout","onBlur"),Vl(Pye,"onTransitionRun"),Vl($ye,"onTransitionStart"),Vl(Abe,"onTransitionCancel"),Vl(kwA,"onTransitionEnd"),ND("onMouseEnter",["mouseout","mouseover"]),ND("onMouseLeave",["mouseout","mouseover"]),ND("onPointerEnter",["pointerout","pointerover"]),ND("onPointerLeave",["pointerout","pointerover"]),Jf("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jf("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jf("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jf("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jf("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jf("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var k1="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(" "),Lbe=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(k1));function OGA(A,e){e=(e&4)!==0;for(var t=0;t<A.length;t++){var i=A[t],n=i.event;i=i.listeners;A:{var o=void 0;if(e)for(var g=i.length-1;0<=g;g--){var a=i[g],s=a.instance,I=a.currentTarget;if(a=a.listener,s!==o&&n.isPropagationStopped())break A;o=a,n.currentTarget=I;try{o(n)}catch(r){SW(r)}n.currentTarget=null,o=s}else for(g=0;g<i.length;g++){if(a=i[g],s=a.instance,I=a.currentTarget,a=a.listener,s!==o&&n.isPropagationStopped())break A;o=a,n.currentTarget=I;try{o(n)}catch(r){SW(r)}n.currentTarget=null,o=s}}}}function Yt(A,e){var t=e[UP];t===void 0&&(t=e[UP]=new Set);var i=A+"__bubble";t.has(i)||(qGA(e,A,2,!1),t.add(i))}function Y$(A,e,t){var i=0;e&&(i|=4),qGA(t,A,i,e)}var b3="_reactListening"+Math.random().toString(36).slice(2);function R$(A){if(!A[b3]){A[b3]=!0,UbA.forEach(function(t){t!=="selectionchange"&&(Lbe.has(t)||Y$(t,!1,A),Y$(t,!0,A))});var e=A.nodeType===9?A:A.ownerDocument;e===null||e[b3]||(e[b3]=!0,Y$("selectionchange",!1,e))}}function qGA(A,e,t,i){switch(wkA(e)){case 2:var n=Cwe;break;case 8:n=lwe;break;default:n=T$}t=n.bind(null,e,t,A),n=void 0,!PP||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(n=!0),i?n!==void 0?A.addEventListener(e,t,{capture:!0,passive:n}):A.addEventListener(e,t,!0):n!==void 0?A.addEventListener(e,t,{passive:n}):A.addEventListener(e,t,!1)}function x$(A,e,t,i,n){var o=i;if(!(e&1)&&!(e&2)&&i!==null)A:for(;;){if(i===null)return;var g=i.tag;if(g===3||g===4){var a=i.stateNode.containerInfo;if(a===n)break;if(g===4)for(g=i.return;g!==null;){var s=g.tag;if((s===3||s===4)&&g.stateNode.containerInfo===n)return;g=g.return}for(;a!==null;){if(g=GD(a),g===null)return;if(s=g.tag,s===5||s===6||s===26||s===27){i=o=g;continue A}a=a.parentNode}}i=i.return}ewA(function(){var I=o,r=qP(t),C=[];A:{var l=JwA.get(A);if(l!==void 0){var c=MW,B=A;switch(A){case"keypress":if(xW(t)===0)break A;case"keydown":case"keyup":c=Nye;break;case"focusin":B="focus",c=t7;break;case"focusout":B="blur",c=t7;break;case"beforeblur":case"afterblur":c=t7;break;case"click":if(t.button===2)break A;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=nwA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=dye;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=xye;break;case wwA:case DwA:case GwA:c=pye;break;case kwA:c=Mye;break;case"scroll":case"scrollend":c=Eye;break;case"wheel":c=Lye;break;case"copy":case"cut":case"paste":c=yye;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=gwA;break;case"toggle":case"beforetoggle":c=Hye}var E=(e&4)!==0,u=!E&&(A==="scroll"||A==="scrollend"),d=E?l!==null?l+"Capture":null:l;E=[];for(var f=I,w;f!==null;){var y=f;if(w=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||w===null||d===null||(y=qR(f,d),y!=null&&E.push(J1(f,y,w))),u)break;f=f.return}0<E.length&&(l=new c(l,B,null,t,r),C.push({event:l,listeners:E}))}}if(!(e&7)){A:{if(l=A==="mouseover"||A==="pointerover",c=A==="mouseout"||A==="pointerout",l&&t!==OP&&(B=t.relatedTarget||t.fromElement)&&(GD(B)||B[DD]))break A;if((c||l)&&(l=r.window===r?r:(l=r.ownerDocument)?l.defaultView||l.parentWindow:window,c?(B=t.relatedTarget||t.toElement,c=I,B=B?GD(B):null,B!==null&&(u=ZR(B),E=B.tag,B!==u||E!==5&&E!==27&&E!==6)&&(B=null)):(c=null,B=I),c!==B)){if(E=nwA,y="onMouseLeave",d="onMouseEnter",f="mouse",(A==="pointerout"||A==="pointerover")&&(E=gwA,y="onPointerLeave",d="onPointerEnter",f="pointer"),u=c==null?l:OR(c),w=B==null?l:OR(B),l=new E(y,f+"leave",c,t,r),l.target=u,l.relatedTarget=w,y=null,GD(r)===I&&(E=new E(d,f+"enter",B,t,r),E.target=w,E.relatedTarget=u,y=E),u=y,c&&B)e:{for(E=Sbe,d=c,f=B,w=0,y=d;y;y=E(y))w++;y=0;for(var G=f;G;G=E(G))y++;for(;0<w-y;)d=E(d),w--;for(;0<y-w;)f=E(f),y--;for(;w--;){if(d===f||f!==null&&d===f.alternate){E=d;break e}d=E(d),f=E(f)}E=null}else E=null;c!==null&&jGA(C,l,c,E,!1),B!==null&&u!==null&&jGA(C,u,B,E,!0)}}A:{if(l=I?OR(I):window,c=l.nodeName&&l.nodeName.toLowerCase(),c==="select"||c==="input"&&l.type==="file")var R=BwA;else if(lwA(l))if(QwA)R=Oye;else{R=Tye;var x=zye}else c=l.nodeName,!c||c.toLowerCase()!=="input"||l.type!=="checkbox"&&l.type!=="radio"?I&&_P(I.elementType)&&(R=BwA):R=_ye;if(R&&(R=R(A,I))){cwA(C,R,t,r);break A}x&&x(A,l,I),A==="focusout"&&I&&l.type==="number"&&I.memoizedProps.value!=null&&TP(l,"number",l.value)}switch(x=I?OR(I):window,A){case"focusin":(lwA(x)||x.contentEditable==="true")&&(vD=x,s7=I,n1=null);break;case"focusout":n1=s7=vD=null;break;case"mousedown":r7=!0;break;case"contextmenu":case"mouseup":case"dragend":r7=!1,ywA(C,t,r);break;case"selectionchange":if(jye)break;case"keydown":case"keyup":ywA(C,t,r)}var F;if(n7)A:{switch(A){case"compositionstart":var Q="onCompositionStart";break A;case"compositionend":Q="onCompositionEnd";break A;case"compositionupdate":Q="onCompositionUpdate";break A}Q=void 0}else MD?IwA(A,t)&&(Q="onCompositionEnd"):A==="keydown"&&t.keyCode===229&&(Q="onCompositionStart");Q&&(awA&&t.locale!=="ko"&&(MD||Q!=="onCompositionStart"?Q==="onCompositionEnd"&&MD&&(F=twA()):(Fh=r,$P="value"in Fh?Fh.value:Fh.textContent,MD=!0)),x=w3(I,Q),0<x.length&&(Q=new owA(Q,A,null,t,r),C.push({event:Q,listeners:x}),F?Q.data=F:(F=CwA(t),F!==null&&(Q.data=F)))),(F=Wye?Kye(A,t):Uye(A,t))&&(Q=w3(I,"onBeforeInput"),0<Q.length&&(x=new owA("onBeforeInput","beforeinput",null,t,r),C.push({event:x,listeners:Q}),x.data=F)),Fbe(C,A,I,t,r)}OGA(C,e)})}function J1(A,e,t){return{instance:A,listener:e,currentTarget:t}}function w3(A,e){for(var t=e+"Capture",i=[];A!==null;){var n=A,o=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||o===null||(n=qR(A,t),n!=null&&i.unshift(J1(A,n,o)),n=qR(A,e),n!=null&&i.push(J1(A,n,o))),A.tag===3)return i;A=A.return}return[]}function Sbe(A){if(A===null)return null;do A=A.return;while(A&&A.tag!==5&&A.tag!==27);return A||null}function jGA(A,e,t,i,n){for(var o=e._reactName,g=[];t!==null&&t!==i;){var a=t,s=a.alternate,I=a.stateNode;if(a=a.tag,s!==null&&s===i)break;a!==5&&a!==26&&a!==27||I===null||(s=I,n?(I=qR(t,o),I!=null&&g.unshift(J1(t,I,s))):n||(I=qR(t,o),I!=null&&g.push(J1(t,I,s)))),t=t.return}g.length!==0&&A.push({event:e,listeners:g})}var Hbe=/\r\n?/g,Zbe=/\u0000|\uFFFD/g;function PGA(A){return(typeof A=="string"?A:""+A).replace(Hbe,`
`).replace(Zbe,"")}function $GA(A,e){return e=PGA(e),PGA(A)===e}function Zi(A,e,t,i,n,o){switch(t){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||RD(A,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&RD(A,""+i);break;case"className":JW(A,"class",i);break;case"tabIndex":JW(A,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":JW(A,t,i);break;case"style":$bA(A,i,o);break;case"data":if(e!=="object"){JW(A,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||t!=="href")){A.removeAttribute(t);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){A.removeAttribute(t);break}i=YW(""+i),A.setAttribute(t,i);break;case"action":case"formAction":if(typeof i=="function"){A.setAttribute(t,"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 o=="function"&&(t==="formAction"?(e!=="input"&&Zi(A,e,"name",n.name,n,null),Zi(A,e,"formEncType",n.formEncType,n,null),Zi(A,e,"formMethod",n.formMethod,n,null),Zi(A,e,"formTarget",n.formTarget,n,null)):(Zi(A,e,"encType",n.encType,n,null),Zi(A,e,"method",n.method,n,null),Zi(A,e,"target",n.target,n,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){A.removeAttribute(t);break}i=YW(""+i),A.setAttribute(t,i);break;case"onClick":i!=null&&(A.onclick=gu);break;case"onScroll":i!=null&&Yt("scroll",A);break;case"onScrollEnd":i!=null&&Yt("scrollend",A);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(MA(61));if(t=i.__html,t!=null){if(n.children!=null)throw Error(MA(60));A.innerHTML=t}}break;case"multiple":A.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":A.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){A.removeAttribute("xlink:href");break}t=YW(""+i),A.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?A.setAttribute(t,""+i):A.removeAttribute(t);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":i&&typeof i!="function"&&typeof i!="symbol"?A.setAttribute(t,""):A.removeAttribute(t);break;case"capture":case"download":i===!0?A.setAttribute(t,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?A.setAttribute(t,i):A.removeAttribute(t);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?A.setAttribute(t,i):A.removeAttribute(t);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?A.removeAttribute(t):A.setAttribute(t,i);break;case"popover":Yt("beforetoggle",A),Yt("toggle",A),kW(A,"popover",i);break;case"xlinkActuate":ou(A,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":ou(A,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":ou(A,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":ou(A,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":ou(A,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":ou(A,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":ou(A,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":ou(A,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":ou(A,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":kW(A,"is",i);break;case"innerText":case"textContent":break;default:(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(t=Bye.get(t)||t,kW(A,t,i))}}function F$(A,e,t,i,n,o){switch(t){case"style":$bA(A,i,o);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(MA(61));if(t=i.__html,t!=null){if(n.children!=null)throw Error(MA(60));A.innerHTML=t}}break;case"children":typeof i=="string"?RD(A,i):(typeof i=="number"||typeof i=="bigint")&&RD(A,""+i);break;case"onScroll":i!=null&&Yt("scroll",A);break;case"onScrollEnd":i!=null&&Yt("scrollend",A);break;case"onClick":i!=null&&(A.onclick=gu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!VbA.hasOwnProperty(t))A:{if(t[0]==="o"&&t[1]==="n"&&(n=t.endsWith("Capture"),e=t.slice(2,n?t.length-7:void 0),o=A[zs]||null,o=o!=null?o[t]:null,typeof o=="function"&&A.removeEventListener(e,o,n),typeof i=="function")){typeof o!="function"&&o!==null&&(t in A?A[t]=null:A.hasAttribute(t)&&A.removeAttribute(t)),A.addEventListener(e,i,n);break A}t in A?A[t]=i:i===!0?A.setAttribute(t,""):kW(A,t,i)}}}function Wg(A,e,t){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Yt("error",A),Yt("load",A);var i=!1,n=!1,o;for(o in t)if(t.hasOwnProperty(o)){var g=t[o];if(g!=null)switch(o){case"src":i=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(MA(137,e));default:Zi(A,e,o,g,t,null)}}n&&Zi(A,e,"srcSet",t.srcSet,t,null),i&&Zi(A,e,"src",t.src,t,null);return;case"input":Yt("invalid",A);var a=o=g=n=null,s=null,I=null;for(i in t)if(t.hasOwnProperty(i)){var r=t[i];if(r!=null)switch(i){case"name":n=r;break;case"type":g=r;break;case"checked":s=r;break;case"defaultChecked":I=r;break;case"value":o=r;break;case"defaultValue":a=r;break;case"children":case"dangerouslySetInnerHTML":if(r!=null)throw Error(MA(137,e));break;default:Zi(A,e,i,r,t,null)}}ObA(A,o,a,s,I,g,n,!1);return;case"select":Yt("invalid",A),i=g=o=null;for(n in t)if(t.hasOwnProperty(n)&&(a=t[n],a!=null))switch(n){case"value":o=a;break;case"defaultValue":g=a;break;case"multiple":i=a;default:Zi(A,e,n,a,t,null)}e=o,t=g,A.multiple=!!i,e!=null?YD(A,!!i,e,!1):t!=null&&YD(A,!!i,t,!0);return;case"textarea":Yt("invalid",A),o=n=i=null;for(g in t)if(t.hasOwnProperty(g)&&(a=t[g],a!=null))switch(g){case"value":i=a;break;case"defaultValue":n=a;break;case"children":o=a;break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(MA(91));break;default:Zi(A,e,g,a,t,null)}jbA(A,i,n,o);return;case"option":for(s in t)if(t.hasOwnProperty(s)&&(i=t[s],i!=null))switch(s){case"selected":A.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Zi(A,e,s,i,t,null)}return;case"dialog":Yt("beforetoggle",A),Yt("toggle",A),Yt("cancel",A),Yt("close",A);break;case"iframe":case"object":Yt("load",A);break;case"video":case"audio":for(i=0;i<k1.length;i++)Yt(k1[i],A);break;case"image":Yt("error",A),Yt("load",A);break;case"details":Yt("toggle",A);break;case"embed":case"source":case"link":Yt("error",A),Yt("load",A);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(I in t)if(t.hasOwnProperty(I)&&(i=t[I],i!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(MA(137,e));default:Zi(A,e,I,i,t,null)}return;default:if(_P(e)){for(r in t)t.hasOwnProperty(r)&&(i=t[r],i!==void 0&&F$(A,e,r,i,t,void 0));return}}for(a in t)t.hasOwnProperty(a)&&(i=t[a],i!=null&&Zi(A,e,a,i,t,null))}function Wbe(A,e,t,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,o=null,g=null,a=null,s=null,I=null,r=null;for(c in t){var C=t[c];if(t.hasOwnProperty(c)&&C!=null)switch(c){case"checked":break;case"value":break;case"defaultValue":s=C;default:i.hasOwnProperty(c)||Zi(A,e,c,null,i,C)}}for(var l in i){var c=i[l];if(C=t[l],i.hasOwnProperty(l)&&(c!=null||C!=null))switch(l){case"type":o=c;break;case"name":n=c;break;case"checked":I=c;break;case"defaultChecked":r=c;break;case"value":g=c;break;case"defaultValue":a=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(MA(137,e));break;default:c!==C&&Zi(A,e,l,c,i,C)}}zP(A,g,a,s,I,r,o,n);return;case"select":c=g=a=l=null;for(o in t)if(s=t[o],t.hasOwnProperty(o)&&s!=null)switch(o){case"value":break;case"multiple":c=s;default:i.hasOwnProperty(o)||Zi(A,e,o,null,i,s)}for(n in i)if(o=i[n],s=t[n],i.hasOwnProperty(n)&&(o!=null||s!=null))switch(n){case"value":l=o;break;case"defaultValue":a=o;break;case"multiple":g=o;default:o!==s&&Zi(A,e,n,o,i,s)}e=a,t=g,i=c,l!=null?YD(A,!!t,l,!1):!!i!=!!t&&(e!=null?YD(A,!!t,e,!0):YD(A,!!t,t?[]:"",!1));return;case"textarea":c=l=null;for(a in t)if(n=t[a],t.hasOwnProperty(a)&&n!=null&&!i.hasOwnProperty(a))switch(a){case"value":break;case"children":break;default:Zi(A,e,a,null,i,n)}for(g in i)if(n=i[g],o=t[g],i.hasOwnProperty(g)&&(n!=null||o!=null))switch(g){case"value":l=n;break;case"defaultValue":c=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(MA(91));break;default:n!==o&&Zi(A,e,g,n,i,o)}qbA(A,l,c);return;case"option":for(var B in t)if(l=t[B],t.hasOwnProperty(B)&&l!=null&&!i.hasOwnProperty(B))switch(B){case"selected":A.selected=!1;break;default:Zi(A,e,B,null,i,l)}for(s in i)if(l=i[s],c=t[s],i.hasOwnProperty(s)&&l!==c&&(l!=null||c!=null))switch(s){case"selected":A.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Zi(A,e,s,l,i,c)}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 E in t)l=t[E],t.hasOwnProperty(E)&&l!=null&&!i.hasOwnProperty(E)&&Zi(A,e,E,null,i,l);for(I in i)if(l=i[I],c=t[I],i.hasOwnProperty(I)&&l!==c&&(l!=null||c!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(l!=null)throw Error(MA(137,e));break;default:Zi(A,e,I,l,i,c)}return;default:if(_P(e)){for(var u in t)l=t[u],t.hasOwnProperty(u)&&l!==void 0&&!i.hasOwnProperty(u)&&F$(A,e,u,void 0,i,l);for(r in i)l=i[r],c=t[r],!i.hasOwnProperty(r)||l===c||l===void 0&&c===void 0||F$(A,e,r,l,i,c);return}}for(var d in t)l=t[d],t.hasOwnProperty(d)&&l!=null&&!i.hasOwnProperty(d)&&Zi(A,e,d,null,i,l);for(C in i)l=i[C],c=t[C],!i.hasOwnProperty(C)||l===c||l==null&&c==null||Zi(A,e,C,l,i,c)}function AkA(A){switch(A){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Kbe(){if(typeof performance.getEntriesByType=="function"){for(var A=0,e=0,t=performance.getEntriesByType("resource"),i=0;i<t.length;i++){var n=t[i],o=n.transferSize,g=n.initiatorType,a=n.duration;if(o&&a&&AkA(g)){for(g=0,a=n.responseEnd,i+=1;i<t.length;i++){var s=t[i],I=s.startTime;if(I>a)break;var r=s.transferSize,C=s.initiatorType;r&&AkA(C)&&(s=s.responseEnd,g+=r*(s<a?1:(a-I)/(s-I)))}if(--i,e+=8*(o+g)/(n.duration/1e3),A++,10<A)break}}if(0<A)return e/A/1e6}return navigator.connection&&(A=navigator.connection.downlink,typeof A=="number")?A:5}var M$=null,v$=null;function D3(A){return A.nodeType===9?A:A.ownerDocument}function ekA(A){switch(A){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function tkA(A,e){if(A===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return A===1&&e==="foreignObject"?0:A}function L$(A,e){return A==="textarea"||A==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var S$=null;function Ube(){var A=window.event;return A&&A.type==="popstate"?A===S$?!1:(S$=A,!0):(S$=null,!1)}var ikA=typeof setTimeout=="function"?setTimeout:void 0,Vbe=typeof clearTimeout=="function"?clearTimeout:void 0,nkA=typeof Promise=="function"?Promise:void 0,Xbe=typeof queueMicrotask=="function"?queueMicrotask:typeof nkA<"u"?function(A){return nkA.resolve(null).then(A).catch(zbe)}:ikA;function zbe(A){setTimeout(function(){throw A})}function jh(A){return A==="head"}function okA(A,e){var t=e,i=0;do{var n=t.nextSibling;if(A.removeChild(t),n&&n.nodeType===8)if(t=n.data,t==="/$"||t==="/&"){if(i===0){A.removeChild(n),rG(e);return}i--}else if(t==="$"||t==="$?"||t==="$~"||t==="$!"||t==="&")i++;else if(t==="html")N1(A.ownerDocument.documentElement);else if(t==="head"){t=A.ownerDocument.head,N1(t);for(var o=t.firstChild;o;){var g=o.nextSibling,a=o.nodeName;o[_R]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&o.rel.toLowerCase()==="stylesheet"||t.removeChild(o),o=g}}else t==="body"&&N1(A.ownerDocument.body);t=n}while(t);rG(e)}function gkA(A,e){var t=A;A=0;do{var i=t.nextSibling;if(t.nodeType===1?e?(t._stashedDisplay=t.style.display,t.style.display="none"):(t.style.display=t._stashedDisplay||"",t.getAttribute("style")===""&&t.removeAttribute("style")):t.nodeType===3&&(e?(t._stashedText=t.nodeValue,t.nodeValue=""):t.nodeValue=t._stashedText||""),i&&i.nodeType===8)if(t=i.data,t==="/$"){if(A===0)break;A--}else t!=="$"&&t!=="$?"&&t!=="$~"&&t!=="$!"||A++;t=i}while(t)}function H$(A){var e=A.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var t=e;switch(e=e.nextSibling,t.nodeName){case"HTML":case"HEAD":case"BODY":H$(t),VP(t);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(t.rel.toLowerCase()==="stylesheet")continue}A.removeChild(t)}}function Tbe(A,e,t,i){for(;A.nodeType===1;){var n=t;if(A.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(A.nodeName!=="INPUT"||A.type!=="hidden"))break}else if(i){if(!A[_R])switch(e){case"meta":if(!A.hasAttribute("itemprop"))break;return A;case"link":if(o=A.getAttribute("rel"),o==="stylesheet"&&A.hasAttribute("data-precedence"))break;if(o!==n.rel||A.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||A.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||A.getAttribute("title")!==(n.title==null?null:n.title))break;return A;case"style":if(A.hasAttribute("data-precedence"))break;return A;case"script":if(o=A.getAttribute("src"),(o!==(n.src==null?null:n.src)||A.getAttribute("type")!==(n.type==null?null:n.type)||A.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&o&&A.hasAttribute("async")&&!A.hasAttribute("itemprop"))break;return A;default:return A}}else if(e==="input"&&A.type==="hidden"){var o=n.name==null?null:""+n.name;if(n.type==="hidden"&&A.getAttribute("name")===o)return A}else return A;if(A=pC(A.nextSibling),A===null)break}return null}function _be(A,e,t){if(e==="")return null;for(;A.nodeType!==3;)if((A.nodeType!==1||A.nodeName!=="INPUT"||A.type!=="hidden")&&!t||(A=pC(A.nextSibling),A===null))return null;return A}function akA(A,e){for(;A.nodeType!==8;)if((A.nodeType!==1||A.nodeName!=="INPUT"||A.type!=="hidden")&&!e||(A=pC(A.nextSibling),A===null))return null;return A}function Z$(A){return A.data==="$?"||A.data==="$~"}function W$(A){return A.data==="$!"||A.data==="$?"&&A.ownerDocument.readyState!=="loading"}function Obe(A,e){var t=A.ownerDocument;if(A.data==="$~")A._reactRetry=e;else if(A.data!=="$?"||t.readyState!=="loading")e();else{var i=function(){e(),t.removeEventListener("DOMContentLoaded",i)};t.addEventListener("DOMContentLoaded",i),A._reactRetry=i}}function pC(A){for(;A!=null;A=A.nextSibling){var e=A.nodeType;if(e===1||e===3)break;if(e===8){if(e=A.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return A}var K$=null;function skA(A){A=A.nextSibling;for(var e=0;A;){if(A.nodeType===8){var t=A.data;if(t==="/$"||t==="/&"){if(e===0)return pC(A.nextSibling);e--}else t!=="$"&&t!=="$!"&&t!=="$?"&&t!=="$~"&&t!=="&"||e++}A=A.nextSibling}return null}function rkA(A){A=A.previousSibling;for(var e=0;A;){if(A.nodeType===8){var t=A.data;if(t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"){if(e===0)return A;e--}else t!=="/$"&&t!=="/&"||e++}A=A.previousSibling}return null}function IkA(A,e,t){switch(e=D3(t),A){case"html":if(A=e.documentElement,!A)throw Error(MA(452));return A;case"head":if(A=e.head,!A)throw Error(MA(453));return A;case"body":if(A=e.body,!A)throw Error(MA(454));return A;default:throw Error(MA(451))}}function N1(A){for(var e=A.attributes;e.length;)A.removeAttributeNode(e[0]);VP(A)}var fC=new Map,CkA=new Set;function G3(A){return typeof A.getRootNode=="function"?A.getRootNode():A.nodeType===9?A:A.ownerDocument}var fu=Bi.d;Bi.d={f:qbe,r:jbe,D:Pbe,C:$be,L:Awe,m:ewe,X:iwe,S:twe,M:nwe};function qbe(){var A=fu.f(),e=d3();return A||e}function jbe(A){var e=kD(A);e!==null&&e.tag===5&&e.type==="form"?kDA(e):fu.r(A)}var gG=typeof document>"u"?null:document;function lkA(A,e,t){var i=gG;if(i&&typeof e=="string"&&e){var n=BC(e);n='link[rel="'+A+'"][href="'+n+'"]',typeof t=="string"&&(n+='[crossorigin="'+t+'"]'),CkA.has(n)||(CkA.add(n),A={rel:A,crossOrigin:t,href:e},i.querySelector(n)===null&&(e=i.createElement("link"),Wg(e,"link",A),sg(e),i.head.appendChild(e)))}}function Pbe(A){fu.D(A),lkA("dns-prefetch",A,null)}function $be(A,e){fu.C(A,e),lkA("preconnect",A,e)}function Awe(A,e,t){fu.L(A,e,t);var i=gG;if(i&&A&&e){var n='link[rel="preload"][as="'+BC(e)+'"]';e==="image"&&t&&t.imageSrcSet?(n+='[imagesrcset="'+BC(t.imageSrcSet)+'"]',typeof t.imageSizes=="string"&&(n+='[imagesizes="'+BC(t.imageSizes)+'"]')):n+='[href="'+BC(A)+'"]';var o=n;switch(e){case"style":o=aG(A);break;case"script":o=sG(A)}fC.has(o)||(A=dn({rel:"preload",href:e==="image"&&t&&t.imageSrcSet?void 0:A,as:e},t),fC.set(o,A),i.querySelector(n)!==null||e==="style"&&i.querySelector(Y1(o))||e==="script"&&i.querySelector(R1(o))||(e=i.createElement("link"),Wg(e,"link",A),sg(e),i.head.appendChild(e)))}}function ewe(A,e){fu.m(A,e);var t=gG;if(t&&A){var i=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+BC(i)+'"][href="'+BC(A)+'"]',o=n;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=sG(A)}if(!fC.has(o)&&(A=dn({rel:"modulepreload",href:A},e),fC.set(o,A),t.querySelector(n)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(t.querySelector(R1(o)))return}i=t.createElement("link"),Wg(i,"link",A),sg(i),t.head.appendChild(i)}}}function twe(A,e,t){fu.S(A,e,t);var i=gG;if(i&&A){var n=JD(i).hoistableStyles,o=aG(A);e=e||"default";var g=n.get(o);if(!g){var a={loading:0,preload:null};if(g=i.querySelector(Y1(o)))a.loading=5;else{A=dn({rel:"stylesheet",href:A,"data-precedence":e},t),(t=fC.get(o))&&U$(A,t);var s=g=i.createElement("link");sg(s),Wg(s,"link",A),s._p=new Promise(function(I,r){s.onload=I,s.onerror=r}),s.addEventListener("load",function(){a.loading|=1}),s.addEventListener("error",function(){a.loading|=2}),a.loading|=4,k3(g,e,i)}g={type:"stylesheet",instance:g,count:1,state:a},n.set(o,g)}}}function iwe(A,e){fu.X(A,e);var t=gG;if(t&&A){var i=JD(t).hoistableScripts,n=sG(A),o=i.get(n);o||(o=t.querySelector(R1(n)),o||(A=dn({src:A,async:!0},e),(e=fC.get(n))&&V$(A,e),o=t.createElement("script"),sg(o),Wg(o,"link",A),t.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(n,o))}}function nwe(A,e){fu.M(A,e);var t=gG;if(t&&A){var i=JD(t).hoistableScripts,n=sG(A),o=i.get(n);o||(o=t.querySelector(R1(n)),o||(A=dn({src:A,async:!0,type:"module"},e),(e=fC.get(n))&&V$(A,e),o=t.createElement("script"),sg(o),Wg(o,"link",A),t.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(n,o))}}function ckA(A,e,t,i){var n=(n=Yh.current)?G3(n):null;if(!n)throw Error(MA(446));switch(A){case"meta":case"title":return null;case"style":return typeof t.precedence=="string"&&typeof t.href=="string"?(e=aG(t.href),t=JD(n).hoistableStyles,i=t.get(e),i||(i={type:"style",instance:null,count:0,state:null},t.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(t.rel==="stylesheet"&&typeof t.href=="string"&&typeof t.precedence=="string"){A=aG(t.href);var o=JD(n).hoistableStyles,g=o.get(A);if(g||(n=n.ownerDocument||n,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(A,g),(o=n.querySelector(Y1(A)))&&!o._p&&(g.instance=o,g.state.loading=5),fC.has(A)||(t={rel:"preload",as:"style",href:t.href,crossOrigin:t.crossOrigin,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy},fC.set(A,t),o||owe(n,A,t,g.state))),e&&i===null)throw Error(MA(528,""));return g}if(e&&i!==null)throw Error(MA(529,""));return null;case"script":return e=t.async,t=t.src,typeof t=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=sG(t),t=JD(n).hoistableScripts,i=t.get(e),i||(i={type:"script",instance:null,count:0,state:null},t.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(MA(444,A))}}function aG(A){return'href="'+BC(A)+'"'}function Y1(A){return'link[rel="stylesheet"]['+A+"]"}function BkA(A){return dn({},A,{"data-precedence":A.precedence,precedence:null})}function owe(A,e,t,i){A.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=A.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),Wg(e,"link",t),sg(e),A.head.appendChild(e))}function sG(A){return'[src="'+BC(A)+'"]'}function R1(A){return"script[async]"+A}function QkA(A,e,t){if(e.count++,e.instance===null)switch(e.type){case"style":var i=A.querySelector('style[data-href~="'+BC(t.href)+'"]');if(i)return e.instance=i,sg(i),i;var n=dn({},t,{"data-href":t.href,"data-precedence":t.precedence,href:null,precedence:null});return i=(A.ownerDocument||A).createElement("style"),sg(i),Wg(i,"style",n),k3(i,t.precedence,A),e.instance=i;case"stylesheet":n=aG(t.href);var o=A.querySelector(Y1(n));if(o)return e.state.loading|=4,e.instance=o,sg(o),o;i=BkA(t),(n=fC.get(n))&&U$(i,n),o=(A.ownerDocument||A).createElement("link"),sg(o);var g=o;return g._p=new Promise(function(a,s){g.onload=a,g.onerror=s}),Wg(o,"link",i),e.state.loading|=4,k3(o,t.precedence,A),e.instance=o;case"script":return o=sG(t.src),(n=A.querySelector(R1(o)))?(e.instance=n,sg(n),n):(i=t,(n=fC.get(o))&&(i=dn({},t),V$(i,n)),A=A.ownerDocument||A,n=A.createElement("script"),sg(n),Wg(n,"link",i),A.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(MA(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(i=e.instance,e.state.loading|=4,k3(i,t.precedence,A));return e.instance}function k3(A,e,t){for(var i=t.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=i.length?i[i.length-1]:null,o=n,g=0;g<i.length;g++){var a=i[g];if(a.dataset.precedence===e)o=a;else if(o!==n)break}o?o.parentNode.insertBefore(A,o.nextSibling):(e=t.nodeType===9?t.head:t,e.insertBefore(A,e.firstChild))}function U$(A,e){A.crossOrigin==null&&(A.crossOrigin=e.crossOrigin),A.referrerPolicy==null&&(A.referrerPolicy=e.referrerPolicy),A.title==null&&(A.title=e.title)}function V$(A,e){A.crossOrigin==null&&(A.crossOrigin=e.crossOrigin),A.referrerPolicy==null&&(A.referrerPolicy=e.referrerPolicy),A.integrity==null&&(A.integrity=e.integrity)}var J3=null;function EkA(A,e,t){if(J3===null){var i=new Map,n=J3=new Map;n.set(t,i)}else n=J3,i=n.get(t),i||(i=new Map,n.set(t,i));if(i.has(A))return i;for(i.set(A,null),t=t.getElementsByTagName(A),n=0;n<t.length;n++){var o=t[n];if(!(o[_R]||o[Lg]||A==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var g=o.getAttribute(e)||"";g=A+g;var a=i.get(g);a?a.push(o):i.set(g,[o])}}return i}function ukA(A,e,t){A=A.ownerDocument||A,A.head.insertBefore(t,e==="title"?A.querySelector("head > title"):null)}function gwe(A,e,t){if(t===1||e.itemProp!=null)return!1;switch(A){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return A=e.disabled,typeof e.precedence=="string"&&A==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function dkA(A){return!(A.type==="stylesheet"&&!(A.state.loading&3))}function awe(A,e,t,i){if(t.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var n=aG(i.href),o=e.querySelector(Y1(n));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(A.count++,A=N3.bind(A),e.then(A,A)),t.state.loading|=4,t.instance=o,sg(o);return}o=e.ownerDocument||e,i=BkA(i),(n=fC.get(n))&&U$(i,n),o=o.createElement("link"),sg(o);var g=o;g._p=new Promise(function(a,s){g.onload=a,g.onerror=s}),Wg(o,"link",i),t.instance=o}A.stylesheets===null&&(A.stylesheets=new Map),A.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(A.count++,t=N3.bind(A),e.addEventListener("load",t),e.addEventListener("error",t))}}var X$=0;function swe(A,e){return A.stylesheets&&A.count===0&&R3(A,A.stylesheets),0<A.count||0<A.imgCount?function(t){var i=setTimeout(function(){if(A.stylesheets&&R3(A,A.stylesheets),A.unsuspend){var o=A.unsuspend;A.unsuspend=null,o()}},6e4+e);0<A.imgBytes&&X$===0&&(X$=62500*Kbe());var n=setTimeout(function(){if(A.waitingForImages=!1,A.count===0&&(A.stylesheets&&R3(A,A.stylesheets),A.unsuspend)){var o=A.unsuspend;A.unsuspend=null,o()}},(A.imgBytes>X$?50:800)+e);return A.unsuspend=t,function(){A.unsuspend=null,clearTimeout(i),clearTimeout(n)}}:null}function N3(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)R3(this,this.stylesheets);else if(this.unsuspend){var A=this.unsuspend;this.unsuspend=null,A()}}}var Y3=null;function R3(A,e){A.stylesheets=null,A.unsuspend!==null&&(A.count++,Y3=new Map,e.forEach(rwe,A),Y3=null,N3.call(A))}function rwe(A,e){if(!(e.state.loading&4)){var t=Y3.get(A);if(t)var i=t.get(null);else{t=new Map,Y3.set(A,t);for(var n=A.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<n.length;o++){var g=n[o];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(t.set(g.dataset.precedence,g),i=g)}i&&t.set(null,i)}n=e.instance,g=n.getAttribute("data-precedence"),o=t.get(g)||i,o===i&&t.set(null,n),t.set(g,n),this.count++,i=N3.bind(this),n.addEventListener("load",i),n.addEventListener("error",i),o?o.parentNode.insertBefore(n,o.nextSibling):(A=A.nodeType===9?A.head:A,A.insertBefore(n,A.firstChild)),e.state.loading|=4}}var x1={$$typeof:nu,Provider:null,Consumer:null,_currentValue:Df,_currentValue2:Df,_threadCount:0};function Iwe(A,e,t,i,n,o,g,a,s){this.tag=1,this.containerInfo=A,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=ZP(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ZP(0),this.hiddenUpdates=ZP(null),this.identifierPrefix=i,this.onUncaughtError=n,this.onCaughtError=o,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function hkA(A,e,t,i,n,o,g,a,s,I,r,C){return A=new Iwe(A,e,t,g,s,I,r,C,a),e=1,o===!0&&(e|=24),o=jr(3,null,null,e),A.current=o,o.stateNode=A,e=b7(),e.refCount++,A.pooledCache=e,e.refCount++,o.memoizedState={element:i,isDehydrated:t,cache:e},k7(o),A}function mkA(A){return A?(A=HD,A):HD}function pkA(A,e,t,i,n,o){n=mkA(n),i.context===null?i.context=n:i.pendingContext=n,i=Zh(e),i.payload={element:t},o=o===void 0?null:o,o!==null&&(i.callback=o),t=Wh(A,i,e),t!==null&&(Ps(t,A,e),C1(t,A,e))}function fkA(A,e){if(A=A.memoizedState,A!==null&&A.dehydrated!==null){var t=A.retryLane;A.retryLane=t!==0&&t<e?t:e}}function z$(A,e){fkA(A,e),(A=A.alternate)&&fkA(A,e)}function ykA(A){if(A.tag===13||A.tag===31){var e=xf(A,67108864);e!==null&&Ps(e,A,67108864),z$(A,67108864)}}function bkA(A){if(A.tag===13||A.tag===31){var e=tI();e=WP(e);var t=xf(A,e);t!==null&&Ps(t,A,e),z$(A,e)}}var x3=!0;function Cwe(A,e,t,i){var n=Ze.T;Ze.T=null;var o=Bi.p;try{Bi.p=2,T$(A,e,t,i)}finally{Bi.p=o,Ze.T=n}}function lwe(A,e,t,i){var n=Ze.T;Ze.T=null;var o=Bi.p;try{Bi.p=8,T$(A,e,t,i)}finally{Bi.p=o,Ze.T=n}}function T$(A,e,t,i){if(x3){var n=_$(i);if(n===null)x$(A,e,i,F3,t),DkA(A,i);else if(Bwe(n,A,e,t,i))i.stopPropagation();else if(DkA(A,i),e&4&&-1<cwe.indexOf(A)){for(;n!==null;){var o=kD(n);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var g=kf(o.pendingLanes);if(g!==0){var a=o;for(a.pendingLanes|=2,a.entangledLanes|=2;g;){var s=1<<31-Or(g);a.entanglements[1]|=s,g&=~s}UB(o),!(Qi&6)&&(E3=Tr()+500,G1(0,!1))}}break;case 31:case 13:a=xf(o,2),a!==null&&Ps(a,o,2),d3(),z$(o,2)}if(o=_$(i),o===null&&x$(A,e,i,F3,t),o===n)break;n=o}n!==null&&i.stopPropagation()}else x$(A,e,i,null,t)}}function _$(A){return A=qP(A),O$(A)}var F3=null;function O$(A){if(F3=null,A=GD(A),A!==null){var e=ZR(A);if(e===null)A=null;else{var t=e.tag;if(t===13){if(A=bbA(e),A!==null)return A;A=null}else if(t===31){if(A=wbA(e),A!==null)return A;A=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;A=null}else e!==A&&(A=null)}}return F3=A,null}function wkA(A){switch(A){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(Pfe()){case xbA:return 2;case FbA:return 8;case yW:case $fe:return 32;case MbA:return 268435456;default:return 32}default:return 32}}var q$=!1,Ph=null,$h=null,Am=null,F1=new Map,M1=new Map,em=[],cwe="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 DkA(A,e){switch(A){case"focusin":case"focusout":Ph=null;break;case"dragenter":case"dragleave":$h=null;break;case"mouseover":case"mouseout":Am=null;break;case"pointerover":case"pointerout":F1.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":M1.delete(e.pointerId)}}function v1(A,e,t,i,n,o){return A===null||A.nativeEvent!==o?(A={blockedOn:e,domEventName:t,eventSystemFlags:i,nativeEvent:o,targetContainers:[n]},e!==null&&(e=kD(e),e!==null&&ykA(e)),A):(A.eventSystemFlags|=i,e=A.targetContainers,n!==null&&e.indexOf(n)===-1&&e.push(n),A)}function Bwe(A,e,t,i,n){switch(e){case"focusin":return Ph=v1(Ph,A,e,t,i,n),!0;case"dragenter":return $h=v1($h,A,e,t,i,n),!0;case"mouseover":return Am=v1(Am,A,e,t,i,n),!0;case"pointerover":var o=n.pointerId;return F1.set(o,v1(F1.get(o)||null,A,e,t,i,n)),!0;case"gotpointercapture":return o=n.pointerId,M1.set(o,v1(M1.get(o)||null,A,e,t,i,n)),!0}return!1}function GkA(A){var e=GD(A.target);if(e!==null){var t=ZR(e);if(t!==null){if(e=t.tag,e===13){if(e=bbA(t),e!==null){A.blockedOn=e,WbA(A.priority,function(){bkA(t)});return}}else if(e===31){if(e=wbA(t),e!==null){A.blockedOn=e,WbA(A.priority,function(){bkA(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){A.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}A.blockedOn=null}function M3(A){if(A.blockedOn!==null)return!1;for(var e=A.targetContainers;0<e.length;){var t=_$(A.nativeEvent);if(t===null){t=A.nativeEvent;var i=new t.constructor(t.type,t);OP=i,t.target.dispatchEvent(i),OP=null}else return e=kD(t),e!==null&&ykA(e),A.blockedOn=t,!1;e.shift()}return!0}function kkA(A,e,t){M3(A)&&t.delete(e)}function Qwe(){q$=!1,Ph!==null&&M3(Ph)&&(Ph=null),$h!==null&&M3($h)&&($h=null),Am!==null&&M3(Am)&&(Am=null),F1.forEach(kkA),M1.forEach(kkA)}function v3(A,e){A.blockedOn===e&&(A.blockedOn=null,q$||(q$=!0,Uo.unstable_scheduleCallback(Uo.unstable_NormalPriority,Qwe)))}var L3=null;function JkA(A){L3!==A&&(L3=A,Uo.unstable_scheduleCallback(Uo.unstable_NormalPriority,function(){L3===A&&(L3=null);for(var e=0;e<A.length;e+=3){var t=A[e],i=A[e+1],n=A[e+2];if(typeof i!="function"){if(O$(i||t)===null)continue;break}var o=kD(t);o!==null&&(A.splice(e,3),e-=3,_7(o,{pending:!0,data:n,method:t.method,action:i},i,n))}}))}function rG(A){function e(s){return v3(s,A)}Ph!==null&&v3(Ph,A),$h!==null&&v3($h,A),Am!==null&&v3(Am,A),F1.forEach(e),M1.forEach(e);for(var t=0;t<em.length;t++){var i=em[t];i.blockedOn===A&&(i.blockedOn=null)}for(;0<em.length&&(t=em[0],t.blockedOn===null);)GkA(t),t.blockedOn===null&&em.shift();if(t=(A.ownerDocument||A).$$reactFormReplay,t!=null)for(i=0;i<t.length;i+=3){var n=t[i],o=t[i+1],g=n[zs]||null;if(typeof o=="function")g||JkA(t);else if(g){var a=null;if(o&&o.hasAttribute("formAction")){if(n=o,g=o[zs]||null)a=g.formAction;else if(O$(n)!==null)continue}else a=g.action;typeof a=="function"?t[i+1]=a:(t.splice(i,3),i-=3),JkA(t)}}}function NkA(){function A(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(g){return n=g})},focusReset:"manual",scroll:"manual"})}function e(){n!==null&&(n(),n=null),i||setTimeout(t,20)}function t(){if(!i&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,n=null;return navigation.addEventListener("navigate",A),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(t,100),function(){i=!0,navigation.removeEventListener("navigate",A),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),n!==null&&(n(),n=null)}}}function j$(A){this._internalRoot=A}S3.prototype.render=j$.prototype.render=function(A){var e=this._internalRoot;if(e===null)throw Error(MA(409));var t=e.current,i=tI();pkA(t,i,A,e,null,null)},S3.prototype.unmount=j$.prototype.unmount=function(){var A=this._internalRoot;if(A!==null){this._internalRoot=null;var e=A.containerInfo;pkA(A.current,2,null,A,null,null),d3(),e[DD]=null}};function S3(A){this._internalRoot=A}S3.prototype.unstable_scheduleHydration=function(A){if(A){var e=ZbA();A={blockedOn:null,target:A,priority:e};for(var t=0;t<em.length&&e!==0&&e<em[t].priority;t++);em.splice(t,0,A),t===0&&GkA(A)}};var YkA=fbA.version;if(YkA!=="19.2.3")throw Error(MA(527,YkA,"19.2.3"));Bi.findDOMNode=function(A){var e=A._reactInternals;if(e===void 0)throw typeof A.render=="function"?Error(MA(188)):(A=Object.keys(A).join(","),Error(MA(268,A)));return A=Xfe(e),A=A!==null?GbA(A):null,A=A===null?null:A.stateNode,A};var Ewe={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:Ze,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var H3=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!H3.isDisabled&&H3.supportsFiber)try{XR=H3.inject(Ewe),_r=H3}catch{}}uW.createRoot=function(A,e){if(!ybA(A))throw Error(MA(299));var t=!1,i="",n=SDA,o=HDA,g=ZDA;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(n=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(g=e.onRecoverableError)),e=hkA(A,1,!1,null,null,t,i,null,n,o,g,NkA),A[DD]=e.current,R$(A),new j$(e)},uW.hydrateRoot=function(A,e,t){if(!ybA(A))throw Error(MA(299));var i=!1,n="",o=SDA,g=HDA,a=ZDA,s=null;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(g=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError),t.formState!==void 0&&(s=t.formState)),e=hkA(A,1,!0,e,t??null,i,n,s,o,g,a,NkA),e.context=mkA(null),t=e.current,i=tI(),i=WP(i),n=Zh(i),n.callback=null,Wh(t,n,i),t=i,e.current.lanes=t,TR(e,t),UB(e),A[DD]=e.current,R$(A),new S3(e)},uW.version="19.2.3",function(A){function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}e(),A.exports=uW}(Sfe);function Ai(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];throw new Error(typeof A=="number"?"[MobX] minified error nr: "+A+(t.length?" "+t.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+A)}var uwe={};function Z3(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:uwe}var RkA=Object.assign,W3=Object.getOwnPropertyDescriptor,VB=Object.defineProperty,K3=Object.prototype,P$=[];Object.freeze(P$);var $$={};Object.freeze($$);var dwe=typeof Proxy<"u",hwe=Object.toString();function xkA(){dwe||Ai("Proxy not available")}function FkA(A){var e=!1;return function(){if(!e)return e=!0,A.apply(this,arguments)}}var IG=function(){};function Tl(A){return typeof A=="function"}function zf(A){var e=typeof A;switch(e){case"string":case"symbol":case"number":return!0}return!1}function U3(A){return A!==null&&typeof A=="object"}function tm(A){if(!U3(A))return!1;var e=Object.getPrototypeOf(A);if(e==null)return!0;var t=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t.toString()===hwe}function MkA(A){var e=A==null?void 0:A.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function V3(A,e,t){VB(A,e,{enumerable:!1,writable:!0,configurable:!0,value:t})}function vkA(A,e,t){VB(A,e,{enumerable:!1,writable:!1,configurable:!0,value:t})}function Tf(A,e){var t="isMobX"+A;return e.prototype[t]=!0,function(i){return U3(i)&&i[t]===!0}}function CG(A){return A!=null&&Object.prototype.toString.call(A)==="[object Map]"}function mwe(A){var e=Object.getPrototypeOf(A),t=Object.getPrototypeOf(e),i=Object.getPrototypeOf(t);return i===null}function yu(A){return A!=null&&Object.prototype.toString.call(A)==="[object Set]"}var LkA=typeof Object.getOwnPropertySymbols<"u";function pwe(A){var e=Object.keys(A);if(!LkA)return e;var t=Object.getOwnPropertySymbols(A);return t.length?[].concat(e,t.filter(function(i){return K3.propertyIsEnumerable.call(A,i)})):e}var X3=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:LkA?function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:Object.getOwnPropertyNames;function SkA(A){return A===null?null:typeof A=="object"?""+A:A}function bu(A,e){return K3.hasOwnProperty.call(A,e)}var fwe=Object.getOwnPropertyDescriptors||function(e){var t={};return X3(e).forEach(function(i){t[i]=W3(e,i)}),t};function iI(A,e){return!!(A&e)}function nI(A,e,t){return t?A|=e:A&=~e,A}function HkA(A,e){(e==null||e>A.length)&&(e=A.length);for(var t=0,i=Array(e);t<e;t++)i[t]=A[t];return i}function ZkA(A,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(A,bwe(i.key),i)}}function lG(A,e,t){return e&&ZkA(A.prototype,e),t&&ZkA(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A}function cG(A,e){var t=typeof Symbol<"u"&&A[Symbol.iterator]||A["@@iterator"];if(t)return(t=t.call(A)).next.bind(t);if(Array.isArray(A)||(t=wwe(A))||e&&A&&typeof A.length=="number"){t&&(A=t);var i=0;return function(){return i>=A.length?{done:!0}:{done:!1,value:A[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _f(){return _f=Object.assign?Object.assign.bind():function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},_f.apply(null,arguments)}function WkA(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,AAA(A,e)}function AAA(A,e){return AAA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},AAA(A,e)}function ywe(A,e){if(typeof A!="object"||!A)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var i=t.call(A,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function bwe(A){var e=ywe(A,"string");return typeof e=="symbol"?e:e+""}function wwe(A,e){if(A){if(typeof A=="string")return HkA(A,e);var t={}.toString.call(A).slice(8,-1);return t==="Object"&&A.constructor&&(t=A.constructor.name),t==="Map"||t==="Set"?Array.from(A):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?HkA(A,e):void 0}}var XB=Symbol("mobx-stored-annotations");function zB(A){function e(t,i){if(S1(i))return A.decorate_20223_(t,i);L1(t,i,A)}return Object.assign(e,A)}function L1(A,e,t){bu(A,XB)||V3(A,XB,_f({},A[XB])),Fwe(t)||(A[XB][e]=t)}function Dwe(A){return bu(A,XB)||V3(A,XB,_f({},A[XB])),A[XB]}function S1(A){return typeof A=="object"&&typeof A.kind=="string"}var Ue=Symbol("mobx administration"),im=function(){function A(t){t===void 0&&(t="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=gi.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=t}var e=A.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(i){return i()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(i){return i()})},e.reportObserved=function(){return gJA(this)},e.reportChanged=function(){yC(),aJA(this),bC()},e.toString=function(){return this.name_},lG(A,[{key:"isBeingObserved",get:function(){return iI(this.flags_,A.isBeingObservedMask_)},set:function(i){this.flags_=nI(this.flags_,A.isBeingObservedMask_,i)}},{key:"isPendingUnobservation",get:function(){return iI(this.flags_,A.isPendingUnobservationMask_)},set:function(i){this.flags_=nI(this.flags_,A.isPendingUnobservationMask_,i)}},{key:"diffValue",get:function(){return iI(this.flags_,A.diffValueMask_)?1:0},set:function(i){this.flags_=nI(this.flags_,A.diffValueMask_,i===1)}}])}();im.isBeingObservedMask_=1,im.isPendingUnobservationMask_=2,im.diffValueMask_=4;var eAA=Tf("Atom",im);function KkA(A,e,t){e===void 0&&(e=IG),t===void 0&&(t=IG);var i=new im(A);return e!==IG&&ZDe(i,e),t!==IG&&cJA(i,t),i}function Gwe(A,e){return A===e}function kwe(A,e){return uAA(A,e)}function Jwe(A,e){return uAA(A,e,1)}function Nwe(A,e){return Object.is?Object.is(A,e):A===e?A!==0||1/A===1/e:A!==A&&e!==e}var BG={identity:Gwe,structural:kwe,default:Nwe,shallow:Jwe};function Of(A,e,t){return dJA(A)?A:Array.isArray(A)?on.array(A,{name:t}):tm(A)?on.object(A,void 0,{name:t}):CG(A)?on.map(A,{name:t}):yu(A)?on.set(A,{name:t}):typeof A=="function"&&!QG(A)&&!U1(A)?MkA(A)?EG(A):K1(t,A):A}function Ywe(A,e,t){if(A==null||z1(A)||rK(A)||$f(A)||_B(A))return A;if(Array.isArray(A))return on.array(A,{name:t,deep:!1});if(tm(A))return on.object(A,void 0,{name:t,deep:!1});if(CG(A))return on.map(A,{name:t,deep:!1});if(yu(A))return on.set(A,{name:t,deep:!1})}function z3(A){return A}function Rwe(A,e){return uAA(A,e)?e:A}var xwe="override";function Fwe(A){return A.annotationType_===xwe}function H1(A,e){return{annotationType_:A,options_:e,make_:Mwe,extend_:vwe,decorate_20223_:Lwe}}function Mwe(A,e,t,i){var n;if((n=this.options_)!=null&&n.bound)return this.extend_(A,e,t,!1)===null?0:1;if(i===A.target_)return this.extend_(A,e,t,!1)===null?0:2;if(QG(t.value))return 1;var o=UkA(A,this,e,t,!1);return VB(i,e,o),2}function vwe(A,e,t,i){var n=UkA(A,this,e,t);return A.defineProperty_(e,n,i)}function Lwe(A,e){var t=e.kind,i=e.name,n=e.addInitializer,o=this,g=function(I){var r,C,l,c;return qf((r=(C=o.options_)==null?void 0:C.name)!=null?r:i.toString(),I,(l=(c=o.options_)==null?void 0:c.autoAction)!=null?l:!1)};if(t=="field")return function(s){var I,r=s;return QG(r)||(r=g(r)),(I=o.options_)!=null&&I.bound&&(r=r.bind(this),r.isMobxAction=!0),r};if(t=="method"){var a;return QG(A)||(A=g(A)),(a=this.options_)!=null&&a.bound&&n(function(){var s=this,I=s[i].bind(s);I.isMobxAction=!0,s[i]=I}),A}Ai("Cannot apply '"+o.annotationType_+"' to '"+String(i)+"' (kind: "+t+"):"+(`
'`+o.annotationType_+"' can only be used on properties with a function value."))}function Swe(A,e,t,i){e.annotationType_,i.value}function UkA(A,e,t,i,n){var o,g,a,s,I,r,C;n===void 0&&(n=ee.safeDescriptors),Swe(A,e,t,i);var l=i.value;if((o=e.options_)!=null&&o.bound){var c;l=l.bind((c=A.proxy_)!=null?c:A.target_)}return{value:qf((g=(a=e.options_)==null?void 0:a.name)!=null?g:t.toString(),l,(s=(I=e.options_)==null?void 0:I.autoAction)!=null?s:!1,(r=e.options_)!=null&&r.bound?(C=A.proxy_)!=null?C:A.target_:void 0),configurable:n?A.isPlainObject_:!0,enumerable:!1,writable:!n}}function VkA(A,e){return{annotationType_:A,options_:e,make_:Hwe,extend_:Zwe,decorate_20223_:Wwe}}function Hwe(A,e,t,i){var n;if(i===A.target_)return this.extend_(A,e,t,!1)===null?0:2;if((n=this.options_)!=null&&n.bound&&(!bu(A.target_,e)||!U1(A.target_[e]))&&this.extend_(A,e,t,!1)===null)return 0;if(U1(t.value))return 1;var o=XkA(A,this,e,t,!1,!1);return VB(i,e,o),2}function Zwe(A,e,t,i){var n,o=XkA(A,this,e,t,(n=this.options_)==null?void 0:n.bound);return A.defineProperty_(e,o,i)}function Wwe(A,e){var t,i=e.name,n=e.addInitializer;return U1(A)||(A=EG(A)),(t=this.options_)!=null&&t.bound&&n(function(){var o=this,g=o[i].bind(o);g.isMobXFlow=!0,o[i]=g}),A}function Kwe(A,e,t,i){e.annotationType_,i.value}function XkA(A,e,t,i,n,o){o===void 0&&(o=ee.safeDescriptors),Kwe(A,e,t,i);var g=i.value;if(U1(g)||(g=EG(g)),n){var a;g=g.bind((a=A.proxy_)!=null?a:A.target_),g.isMobXFlow=!0}return{value:g,configurable:o?A.isPlainObject_:!0,enumerable:!1,writable:!o}}function tAA(A,e){return{annotationType_:A,options_:e,make_:Uwe,extend_:Vwe,decorate_20223_:Xwe}}function Uwe(A,e,t){return this.extend_(A,e,t,!1)===null?0:1}function Vwe(A,e,t,i){return zwe(A,this,e,t),A.defineComputedProperty_(e,_f({},this.options_,{get:t.get,set:t.set}),i)}function Xwe(A,e){var t=this,i=e.name,n=e.addInitializer;return n(function(){var o=dG(this)[Ue],g=_f({},t.options_,{get:A,context:this});g.name||(g.name="ObservableObject."+i.toString()),o.values_.set(i,new _l(g))}),function(){return this[Ue].getObservablePropValue_(i)}}function zwe(A,e,t,i){e.annotationType_,i.get}function T3(A,e){return{annotationType_:A,options_:e,make_:Twe,extend_:_we,decorate_20223_:Owe}}function Twe(A,e,t){return this.extend_(A,e,t,!1)===null?0:1}function _we(A,e,t,i){var n,o;return qwe(A,this),A.defineObservableProperty_(e,t.value,(n=(o=this.options_)==null?void 0:o.enhancer)!=null?n:Of,i)}function Owe(A,e){var t=this,i=e.kind,n=e.name,o=new WeakSet;function g(a,s){var I,r,C=dG(a)[Ue],l=new jf(s,(I=(r=t.options_)==null?void 0:r.enhancer)!=null?I:Of,"ObservableObject."+n.toString(),!1);C.values_.set(n,l),o.add(a)}if(i=="accessor")return{get:function(){return o.has(this)||g(this,A.get.call(this)),this[Ue].getObservablePropValue_(n)},set:function(s){return o.has(this)||g(this,s),this[Ue].setObservablePropValue_(n,s)},init:function(s){return o.has(this)||g(this,s),s}}}function qwe(A,e,t,i){e.annotationType_}var jwe="true",Pwe=zkA();function zkA(A){return{annotationType_:jwe,options_:A,make_:$we,extend_:ADe,decorate_20223_:eDe}}function $we(A,e,t,i){var n,o;if(t.get)return q3.make_(A,e,t,i);if(t.set){var g=QG(t.set)?t.set:qf(e.toString(),t.set);return i===A.target_?A.defineProperty_(e,{configurable:ee.safeDescriptors?A.isPlainObject_:!0,set:g})===null?0:2:(VB(i,e,{configurable:!0,set:g}),2)}if(i!==A.target_&&typeof t.value=="function"){var a;if(MkA(t.value)){var s,I=(s=this.options_)!=null&&s.autoBind?EG.bound:EG;return I.make_(A,e,t,i)}var r=(a=this.options_)!=null&&a.autoBind?K1.bound:K1;return r.make_(A,e,t,i)}var C=((n=this.options_)==null?void 0:n.deep)===!1?on.ref:on;if(typeof t.value=="function"&&(o=this.options_)!=null&&o.autoBind){var l;t.value=t.value.bind((l=A.proxy_)!=null?l:A.target_)}return C.make_(A,e,t,i)}function ADe(A,e,t,i){var n,o;if(t.get)return q3.extend_(A,e,t,i);if(t.set)return A.defineProperty_(e,{configurable:ee.safeDescriptors?A.isPlainObject_:!0,set:qf(e.toString(),t.set)},i);if(typeof t.value=="function"&&(n=this.options_)!=null&&n.autoBind){var g;t.value=t.value.bind((g=A.proxy_)!=null?g:A.target_)}var a=((o=this.options_)==null?void 0:o.deep)===!1?on.ref:on;return a.extend_(A,e,t,i)}function eDe(A,e){Ai("'"+this.annotationType_+"' cannot be used as a decorator")}var tDe="observable",iDe="observable.ref",nDe="observable.shallow",oDe="observable.struct",TkA={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(TkA);function _3(A){return A||TkA}var iAA=T3(tDe),gDe=T3(iDe,{enhancer:z3}),aDe=T3(nDe,{enhancer:Ywe}),sDe=T3(oDe,{enhancer:Rwe}),_kA=zB(iAA);function O3(A){return A.deep===!0?Of:A.deep===!1?z3:IDe(A.defaultDecorator)}function rDe(A){var e;return A?(e=A.defaultDecorator)!=null?e:zkA(A):void 0}function IDe(A){var e,t;return A&&(e=(t=A.options_)==null?void 0:t.enhancer)!=null?e:Of}function OkA(A,e,t){if(S1(e))return iAA.decorate_20223_(A,e);if(zf(e)){L1(A,e,iAA);return}return dJA(A)?A:tm(A)?on.object(A,e,t):Array.isArray(A)?on.array(A,e):CG(A)?on.map(A,e):yu(A)?on.set(A,e):typeof A=="object"&&A!==null?A:on.box(A,e)}RkA(OkA,_kA);var CDe={box:function(e,t){var i=_3(t);return new jf(e,O3(i),i.name,!0,i.equals)},array:function(e,t){var i=_3(t);return(ee.useProxies===!1||i.proxy===!1?IGe:AGe)(e,O3(i),i.name)},map:function(e,t){var i=_3(t);return new pJA(e,O3(i),i.name)},set:function(e,t){var i=_3(t);return new yJA(e,O3(i),i.name)},object:function(e,t,i){return Ay(function(){return VDe(ee.useProxies===!1||(i==null?void 0:i.proxy)===!1?dG({},i):jDe({},i),e,t)})},ref:zB(gDe),shallow:zB(aDe),deep:_kA,struct:zB(sDe)},on=RkA(OkA,CDe),qkA="computed",lDe="computed.struct",nAA=tAA(qkA),cDe=tAA(lDe,{equals:BG.structural}),q3=function(e,t){if(S1(t))return nAA.decorate_20223_(e,t);if(zf(t))return L1(e,t,nAA);if(tm(e))return zB(tAA(qkA,e));var i=tm(t)?t:{};return i.get=e,i.name||(i.name=e.name||""),new _l(i)};Object.assign(q3,nAA),q3.struct=zB(cDe);var jkA,PkA,j3=0,BDe=1,QDe=(jkA=(PkA=W3(function(){},"name"))==null?void 0:PkA.configurable)!=null?jkA:!1,$kA={value:"action",configurable:!0,writable:!1,enumerable:!1};function qf(A,e,t,i){t===void 0&&(t=!1);function n(){return EDe(A,t,e,i||this,arguments)}return n.isMobxAction=!0,n.toString=function(){return e.toString()},QDe&&($kA.value=A,VB(n,"name",$kA)),n}function EDe(A,e,t,i,n){var o=uDe(A,e);try{return t.apply(i,n)}catch(g){throw o.error_=g,g}finally{dDe(o)}}function uDe(A,e,t,i){var n=!1,o=0,g=ee.trackingDerivation,a=!e||!g;yC();var s=ee.allowStateChanges;a&&(Pf(),s=P3(!0));var I=aAA(!0),r={runAsAction_:a,prevDerivation_:g,prevAllowStateChanges_:s,prevAllowStateReads_:I,notifySpy_:n,startTime_:o,actionId_:BDe++,parentActionId_:j3};return j3=r.actionId_,r}function dDe(A){j3!==A.actionId_&&Ai(30),j3=A.parentActionId_,A.error_!==void 0&&(ee.suppressReactionErrors=!0),$3(A.prevAllowStateChanges_),Z1(A.prevAllowStateReads_),bC(),A.runAsAction_&&wu(A.prevDerivation_),ee.suppressReactionErrors=!1}function hDe(A,e){var t=P3(A);try{return e()}finally{$3(t)}}function P3(A){var e=ee.allowStateChanges;return ee.allowStateChanges=A,e}function $3(A){ee.allowStateChanges=A}var jf=function(A){function e(i,n,o,g,a){var s;return o===void 0&&(o="ObservableValue"),a===void 0&&(a=BG.default),s=A.call(this,o)||this,s.enhancer=void 0,s.name_=void 0,s.equals=void 0,s.hasUnreportedChange_=!1,s.interceptors_=void 0,s.changeListeners_=void 0,s.value_=void 0,s.dehancer=void 0,s.enhancer=n,s.name_=o,s.equals=a,s.value_=n(i,void 0,o),s}WkA(e,A);var t=e.prototype;return t.dehanceValue=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.set=function(n){this.value_,n=this.prepareNewValue_(n),n!==ee.UNCHANGED&&this.setNewValue_(n)},t.prepareNewValue_=function(n){if(wC(this)){var o=DC(this,{object:this,type:TB,newValue:n});if(!o)return ee.UNCHANGED;n=o.newValue}return n=this.enhancer(n,this.value_,this.name_),this.equals(this.value_,n)?ee.UNCHANGED:n},t.setNewValue_=function(n){var o=this.value_;this.value_=n,this.reportChanged(),ql(this)&&jl(this,{type:TB,object:this,newValue:n,oldValue:o})},t.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},t.intercept_=function(n){return V1(this,n)},t.observe_=function(n,o){return o&&n({observableKind:"value",debugObjectName:this.name_,object:this,type:TB,newValue:this.value_,oldValue:void 0}),X1(this,n)},t.raw=function(){return this.value_},t.toJSON=function(){return this.get()},t.toString=function(){return this.name_+"["+this.value_+"]"},t.valueOf=function(){return SkA(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},e}(im),_l=function(){function A(t){this.dependenciesState_=gi.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=gi.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new tK(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=eK.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,t.get||Ai(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=qf("ComputedValue-setter",t.set)),this.equals_=t.equals||(t.compareStructural||t.struct?BG.structural:BG.default),this.scope_=t.context,this.requiresReaction_=t.requiresReaction,this.keepAlive_=!!t.keepAlive}var e=A.prototype;return e.onBecomeStale_=function(){bDe(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(i){return i()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(i){return i()})},e.get=function(){if(this.isComputing&&Ai(32,this.name_,this.derivation),ee.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)oAA(this)&&(this.warnAboutUntrackedRead_(),yC(),this.value_=this.computeValue_(!1),bC());else if(gJA(this),oAA(this)){var i=ee.trackingContext;this.keepAlive_&&!i&&(ee.trackingContext=this),this.trackAndCompute()&&yDe(this),ee.trackingContext=i}var n=this.value_;if(iK(n))throw n.cause;return n},e.set=function(i){if(this.setter_){this.isRunningSetter&&Ai(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,i)}finally{this.isRunningSetter=!1}}else Ai(34,this.name_)},e.trackAndCompute=function(){var i=this.value_,n=this.dependenciesState_===gi.NOT_TRACKING_,o=this.computeValue_(!0),g=n||iK(i)||iK(o)||!this.equals_(i,o);return g&&(this.value_=o),g},e.computeValue_=function(i){this.isComputing=!0;var n=P3(!1),o;if(i)o=AJA(this,this.derivation,this.scope_);else if(ee.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(g){o=new tK(g)}return $3(n),this.isComputing=!1,o},e.suspend_=function(){this.keepAlive_||(gAA(this),this.value_=void 0)},e.observe_=function(i,n){var o=this,g=!0,a=void 0;return FDe(function(){var s=o.get();if(!g||n){var I=Pf();i({observableKind:"computed",debugObjectName:o.name_,type:TB,object:o,newValue:s,oldValue:a}),wu(I)}g=!1,a=s})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return SkA(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},lG(A,[{key:"isComputing",get:function(){return iI(this.flags_,A.isComputingMask_)},set:function(i){this.flags_=nI(this.flags_,A.isComputingMask_,i)}},{key:"isRunningSetter",get:function(){return iI(this.flags_,A.isRunningSetterMask_)},set:function(i){this.flags_=nI(this.flags_,A.isRunningSetterMask_,i)}},{key:"isBeingObserved",get:function(){return iI(this.flags_,A.isBeingObservedMask_)},set:function(i){this.flags_=nI(this.flags_,A.isBeingObservedMask_,i)}},{key:"isPendingUnobservation",get:function(){return iI(this.flags_,A.isPendingUnobservationMask_)},set:function(i){this.flags_=nI(this.flags_,A.isPendingUnobservationMask_,i)}},{key:"diffValue",get:function(){return iI(this.flags_,A.diffValueMask_)?1:0},set:function(i){this.flags_=nI(this.flags_,A.diffValueMask_,i===1)}}])}();_l.isComputingMask_=1,_l.isRunningSetterMask_=2,_l.isBeingObservedMask_=4,_l.isPendingUnobservationMask_=8,_l.diffValueMask_=16;var AK=Tf("ComputedValue",_l),gi;(function(A){A[A.NOT_TRACKING_=-1]="NOT_TRACKING_",A[A.UP_TO_DATE_=0]="UP_TO_DATE_",A[A.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",A[A.STALE_=2]="STALE_"})(gi||(gi={}));var eK;(function(A){A[A.NONE=0]="NONE",A[A.LOG=1]="LOG",A[A.BREAK=2]="BREAK"})(eK||(eK={}));var tK=function(e){this.cause=void 0,this.cause=e};function iK(A){return A instanceof tK}function oAA(A){switch(A.dependenciesState_){case gi.UP_TO_DATE_:return!1;case gi.NOT_TRACKING_:case gi.STALE_:return!0;case gi.POSSIBLY_STALE_:{for(var e=aAA(!0),t=Pf(),i=A.observing_,n=i.length,o=0;o<n;o++){var g=i[o];if(AK(g)){if(ee.disableErrorBoundaries)g.get();else try{g.get()}catch{return wu(t),Z1(e),!0}if(A.dependenciesState_===gi.STALE_)return wu(t),Z1(e),!0}}return tJA(A),wu(t),Z1(e),!1}}}function Npi(A){}function AJA(A,e,t){var i=aAA(!0);tJA(A),A.newObserving_=new Array(A.runId_===0?100:A.observing_.length),A.unboundDepsCount_=0,A.runId_=++ee.runId;var n=ee.trackingDerivation;ee.trackingDerivation=A,ee.inBatch++;var o;if(ee.disableErrorBoundaries===!0)o=e.call(t);else try{o=e.call(t)}catch(g){o=new tK(g)}return ee.inBatch--,ee.trackingDerivation=n,mDe(A),Z1(i),o}function mDe(A){for(var e=A.observing_,t=A.observing_=A.newObserving_,i=gi.UP_TO_DATE_,n=0,o=A.unboundDepsCount_,g=0;g<o;g++){var a=t[g];a.diffValue===0&&(a.diffValue=1,n!==g&&(t[n]=a),n++),a.dependenciesState_>i&&(i=a.dependenciesState_)}for(t.length=n,A.newObserving_=null,o=e.length;o--;){var s=e[o];s.diffValue===0&&nJA(s,A),s.diffValue=0}for(;n--;){var I=t[n];I.diffValue===1&&(I.diffValue=0,fDe(I,A))}i!==gi.UP_TO_DATE_&&(A.dependenciesState_=i,A.onBecomeStale_())}function gAA(A){var e=A.observing_;A.observing_=[];for(var t=e.length;t--;)nJA(e[t],A);A.dependenciesState_=gi.NOT_TRACKING_}function eJA(A){var e=Pf();try{return A()}finally{wu(e)}}function Pf(){var A=ee.trackingDerivation;return ee.trackingDerivation=null,A}function wu(A){ee.trackingDerivation=A}function aAA(A){var e=ee.allowStateReads;return ee.allowStateReads=A,e}function Z1(A){ee.allowStateReads=A}function tJA(A){if(A.dependenciesState_!==gi.UP_TO_DATE_){A.dependenciesState_=gi.UP_TO_DATE_;for(var e=A.observing_,t=e.length;t--;)e[t].lowestObserverState_=gi.UP_TO_DATE_}}var nK=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},oK=!0,iJA=!1,ee=function(){var A=Z3();return A.__mobxInstanceCount>0&&!A.__mobxGlobals&&(oK=!1),A.__mobxGlobals&&A.__mobxGlobals.version!==new nK().version&&(oK=!1),oK?A.__mobxGlobals?(A.__mobxInstanceCount+=1,A.__mobxGlobals.UNCHANGED||(A.__mobxGlobals.UNCHANGED={}),A.__mobxGlobals):(A.__mobxInstanceCount=1,A.__mobxGlobals=new nK):(setTimeout(function(){iJA||Ai(35)},1),new nK)}();function pDe(){if((ee.pendingReactions.length||ee.inBatch||ee.isRunningReactions)&&Ai(36),iJA=!0,oK){var A=Z3();--A.__mobxInstanceCount===0&&(A.__mobxGlobals=void 0),ee=new nK}}function fDe(A,e){A.observers_.add(e),A.lowestObserverState_>e.dependenciesState_&&(A.lowestObserverState_=e.dependenciesState_)}function nJA(A,e){A.observers_.delete(e),A.observers_.size===0&&oJA(A)}function oJA(A){A.isPendingUnobservation===!1&&(A.isPendingUnobservation=!0,ee.pendingUnobservations.push(A))}function yC(){ee.inBatch++}function bC(){if(--ee.inBatch===0){sJA();for(var A=ee.pendingUnobservations,e=0;e<A.length;e++){var t=A[e];t.isPendingUnobservation=!1,t.observers_.size===0&&(t.isBeingObserved&&(t.isBeingObserved=!1,t.onBUO()),t instanceof _l&&t.suspend_())}ee.pendingUnobservations=[]}}function gJA(A){var e=ee.trackingDerivation;return e!==null?(e.runId_!==A.lastAccessedBy_&&(A.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=A,!A.isBeingObserved&&ee.trackingContext&&(A.isBeingObserved=!0,A.onBO())),A.isBeingObserved):(A.observers_.size===0&&ee.inBatch>0&&oJA(A),!1)}function aJA(A){A.lowestObserverState_!==gi.STALE_&&(A.lowestObserverState_=gi.STALE_,A.observers_.forEach(function(e){e.dependenciesState_===gi.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=gi.STALE_}))}function yDe(A){A.lowestObserverState_!==gi.STALE_&&(A.lowestObserverState_=gi.STALE_,A.observers_.forEach(function(e){e.dependenciesState_===gi.POSSIBLY_STALE_?e.dependenciesState_=gi.STALE_:e.dependenciesState_===gi.UP_TO_DATE_&&(A.lowestObserverState_=gi.UP_TO_DATE_)}))}function bDe(A){A.lowestObserverState_===gi.UP_TO_DATE_&&(A.lowestObserverState_=gi.POSSIBLY_STALE_,A.observers_.forEach(function(e){e.dependenciesState_===gi.UP_TO_DATE_&&(e.dependenciesState_=gi.POSSIBLY_STALE_,e.onBecomeStale_())}))}var Ol=function(){function A(t,i,n,o){t===void 0&&(t="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=gi.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=eK.NONE,this.name_=t,this.onInvalidate_=i,this.errorHandler_=n,this.requiresObservable_=o}var e=A.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,ee.pendingReactions.push(this),sJA())},e.runReaction_=function(){if(!this.isDisposed){yC(),this.isScheduled=!1;var i=ee.trackingContext;if(ee.trackingContext=this,oAA(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(n){this.reportExceptionInDerivation_(n)}}ee.trackingContext=i,bC()}},e.track=function(i){if(!this.isDisposed){yC(),this.isRunning=!0;var n=ee.trackingContext;ee.trackingContext=this;var o=AJA(this,i,void 0);ee.trackingContext=n,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&gAA(this),iK(o)&&this.reportExceptionInDerivation_(o.cause),bC()}},e.reportExceptionInDerivation_=function(i){var n=this;if(this.errorHandler_){this.errorHandler_(i,this);return}if(ee.disableErrorBoundaries)throw i;var o="[mobx] uncaught error in '"+this+"'";ee.suppressReactionErrors||console.error(o,i),ee.globalReactionErrorHandlers.forEach(function(g){return g(i,n)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(yC(),gAA(this),bC()))},e.getDisposer_=function(i){var n=this,o=function g(){n.dispose(),i==null||i.removeEventListener==null||i.removeEventListener("abort",g)};return i==null||i.addEventListener==null||i.addEventListener("abort",o),o[Ue]=this,"dispose"in Symbol&&typeof Symbol.dispose=="symbol"&&(o[Symbol.dispose]=o),o},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(i){},lG(A,[{key:"isDisposed",get:function(){return iI(this.flags_,A.isDisposedMask_)},set:function(i){this.flags_=nI(this.flags_,A.isDisposedMask_,i)}},{key:"isScheduled",get:function(){return iI(this.flags_,A.isScheduledMask_)},set:function(i){this.flags_=nI(this.flags_,A.isScheduledMask_,i)}},{key:"isTrackPending",get:function(){return iI(this.flags_,A.isTrackPendingMask_)},set:function(i){this.flags_=nI(this.flags_,A.isTrackPendingMask_,i)}},{key:"isRunning",get:function(){return iI(this.flags_,A.isRunningMask_)},set:function(i){this.flags_=nI(this.flags_,A.isRunningMask_,i)}},{key:"diffValue",get:function(){return iI(this.flags_,A.diffValueMask_)?1:0},set:function(i){this.flags_=nI(this.flags_,A.diffValueMask_,i===1)}}])}();Ol.isDisposedMask_=1,Ol.isScheduledMask_=2,Ol.isTrackPendingMask_=4,Ol.isRunningMask_=8,Ol.diffValueMask_=16;var wDe=100,sAA=function(e){return e()};function sJA(){ee.inBatch>0||ee.isRunningReactions||sAA(DDe)}function DDe(){ee.isRunningReactions=!0;for(var A=ee.pendingReactions,e=0;A.length>0;){++e===wDe&&(console.error("[mobx] cycle in reaction: "+A[0]),A.splice(0));for(var t=A.splice(0),i=0,n=t.length;i<n;i++)t[i].runReaction_()}ee.isRunningReactions=!1}var gK=Tf("Reaction",Ol);function GDe(A){var e=sAA;sAA=function(i){return A(function(){return e(i)})}}function W1(){return!1}function Ypi(A){}function Rpi(A){}function xpi(A){}function kDe(A){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var rJA="action",JDe="action.bound",IJA="autoAction",NDe="autoAction.bound",YDe="<unnamed action>",rAA=H1(rJA),RDe=H1(JDe,{bound:!0}),IAA=H1(IJA,{autoAction:!0}),xDe=H1(NDe,{autoAction:!0,bound:!0});function CJA(A){var e=function(i,n){if(Tl(i))return qf(i.name||YDe,i,A);if(Tl(n))return qf(i,n,A);if(S1(n))return(A?IAA:rAA).decorate_20223_(i,n);if(zf(n))return L1(i,n,A?IAA:rAA);if(zf(i))return zB(H1(A?IJA:rJA,{name:i,autoAction:A}))};return e}var da=CJA(!1);Object.assign(da,rAA);var K1=CJA(!0);Object.assign(K1,IAA),da.bound=zB(RDe),K1.bound=zB(xDe);function QG(A){return Tl(A)&&A.isMobxAction===!0}function FDe(A,e){var t,i,n,o;e===void 0&&(e=$$);var g=(t=(i=e)==null?void 0:i.name)!=null?t:"Autorun",a=!e.scheduler&&!e.delay,s;if(a)s=new Ol(g,function(){this.track(C)},e.onError,e.requiresObservable);else{var I=lJA(e),r=!1;s=new Ol(g,function(){r||(r=!0,I(function(){r=!1,s.isDisposed||s.track(C)}))},e.onError,e.requiresObservable)}function C(){A(s)}return(n=e)!=null&&(n=n.signal)!=null&&n.aborted||s.schedule_(),s.getDisposer_((o=e)==null?void 0:o.signal)}var MDe=function(e){return e()};function lJA(A){return A.scheduler?A.scheduler:A.delay?function(e){return setTimeout(e,A.delay)}:MDe}function vDe(A,e,t){var i,n,o;t===void 0&&(t=$$);var g=(i=t.name)!=null?i:"Reaction",a=da(g,t.onError?LDe(t.onError,e):e),s=!t.scheduler&&!t.delay,I=lJA(t),r=!0,C=!1,l,c=t.compareStructural?BG.structural:t.equals||BG.default,B=new Ol(g,function(){r||s?E():C||(C=!0,I(E))},t.onError,t.requiresObservable);function E(){if(C=!1,!B.isDisposed){var u=!1,d=l;B.track(function(){var f=hDe(!1,function(){return A(B)});u=r||!c(l,f),l=f}),(r&&t.fireImmediately||!r&&u)&&a(l,d,B),r=!1}}return(n=t)!=null&&(n=n.signal)!=null&&n.aborted||B.schedule_(),B.getDisposer_((o=t)==null?void 0:o.signal)}function LDe(A,e){return function(){try{return e.apply(this,arguments)}catch(t){A.call(this,t)}}}var SDe="onBO",HDe="onBUO";function ZDe(A,e,t){return BJA(SDe,A,e,t)}function cJA(A,e,t){return BJA(HDe,A,e,t)}function BJA(A,e,t,i){var n=typeof i=="function"?hG(e,t):hG(e),o=Tl(i)?i:t,g=A+"L";return n[g]?n[g].add(o):n[g]=new Set([o]),function(){var a=n[g];a&&(a.delete(o),a.size===0&&delete n[g])}}var WDe="never",aK="always",KDe="observed";function UDe(A){A.isolateGlobalState===!0&&pDe();var e=A.useProxies,t=A.enforceActions;if(e!==void 0&&(ee.useProxies=e===aK?!0:e===WDe?!1:typeof Proxy<"u"),e==="ifavailable"&&(ee.verifyProxies=!0),t!==void 0){var i=t===aK?aK:t===KDe;ee.enforceActions=i,ee.allowStateChanges=!(i===!0||i===aK)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(n){n in A&&(ee[n]=!!A[n])}),ee.allowStateReads=!ee.observableRequiresReaction,A.reactionScheduler&&GDe(A.reactionScheduler)}function VDe(A,e,t,i){var n=fwe(e);return Ay(function(){var o=dG(A,i)[Ue];X3(n).forEach(function(g){o.extend_(g,n[g],t&&g in t?t[g]:!0)})}),A}function XDe(A,e){return QJA(hG(A,e))}function QJA(A){var e={name:A.name_};return A.observing_&&A.observing_.length>0&&(e.dependencies=zDe(A.observing_).map(QJA)),e}function zDe(A){return Array.from(new Set(A))}var TDe=0;function EJA(){this.message="FLOW_CANCELLED"}EJA.prototype=Object.create(Error.prototype);var CAA=VkA("flow"),_De=VkA("flow.bound",{bound:!0}),EG=Object.assign(function(e,t){if(S1(t))return CAA.decorate_20223_(e,t);if(zf(t))return L1(e,t,CAA);var i=e,n=i.name||"<unnamed flow>",o=function(){var a=this,s=arguments,I=++TDe,r=da(n+" - runid: "+I+" - init",i).apply(a,s),C,l=void 0,c=new Promise(function(B,E){var u=0;C=E;function d(y){l=void 0;var G;try{G=da(n+" - runid: "+I+" - yield "+u++,r.next).call(r,y)}catch(R){return E(R)}w(G)}function f(y){l=void 0;var G;try{G=da(n+" - runid: "+I+" - yield "+u++,r.throw).call(r,y)}catch(R){return E(R)}w(G)}function w(y){if(Tl(y==null?void 0:y.then)){y.then(w,E);return}return y.done?B(y.value):(l=Promise.resolve(y.value),l.then(d,f))}d(void 0)});return c.cancel=da(n+" - runid: "+I+" - cancel",function(){try{l&&uJA(l);var B=r.return(void 0),E=Promise.resolve(B.value);E.then(IG,IG),uJA(E),C(new EJA)}catch(u){C(u)}}),c};return o.isMobXFlow=!0,o},CAA);EG.bound=zB(_De);function uJA(A){Tl(A.cancel)&&A.cancel()}function U1(A){return(A==null?void 0:A.isMobXFlow)===!0}function ODe(A,e){return A?e!==void 0?z1(A)?A[Ue].values_.has(e):!1:z1(A)||!!A[Ue]||eAA(A)||gK(A)||AK(A):!1}function dJA(A){return ODe(A)}function Du(A,e){e===void 0&&(e=void 0),yC();try{return A.apply(e)}finally{bC()}}function uG(A){return A[Ue]}var qDe={has:function(e,t){return uG(e).has_(t)},get:function(e,t){return uG(e).get_(t)},set:function(e,t,i){var n;return zf(t)?(n=uG(e).set_(t,i,!0))!=null?n:!0:!1},deleteProperty:function(e,t){var i;return zf(t)?(i=uG(e).delete_(t,!0))!=null?i:!0:!1},defineProperty:function(e,t,i){var n;return(n=uG(e).defineProperty_(t,i))!=null?n:!0},ownKeys:function(e){return uG(e).ownKeys_()},preventExtensions:function(e){Ai(13)}};function jDe(A,e){var t,i;return xkA(),A=dG(A,e),(i=(t=A[Ue]).proxy_)!=null?i:t.proxy_=new Proxy(A,qDe)}function wC(A){return A.interceptors_!==void 0&&A.interceptors_.length>0}function V1(A,e){var t=A.interceptors_||(A.interceptors_=[]);return t.push(e),FkA(function(){var i=t.indexOf(e);i!==-1&&t.splice(i,1)})}function DC(A,e){var t=Pf();try{for(var i=[].concat(A.interceptors_||[]),n=0,o=i.length;n<o&&(e=i[n](e),e&&!e.type&&Ai(14),!!e);n++);return e}finally{wu(t)}}function ql(A){return A.changeListeners_!==void 0&&A.changeListeners_.length>0}function X1(A,e){var t=A.changeListeners_||(A.changeListeners_=[]);return t.push(e),FkA(function(){var i=t.indexOf(e);i!==-1&&t.splice(i,1)})}function jl(A,e){var t=Pf(),i=A.changeListeners_;if(i){i=i.slice();for(var n=0,o=i.length;n<o;n++)i[n](e);wu(t)}}function lAA(A,e,t){return Ay(function(){var i,n=dG(A,t)[Ue];(i=e)!=null||(e=Dwe(A)),X3(e).forEach(function(o){return n.make_(o,e[o])})}),A}var hJA="splice",TB="update",PDe=1e4,$De={get:function(e,t){var i=e[Ue];return t===Ue?i:t==="length"?i.getArrayLength_():typeof t=="string"&&!isNaN(t)?i.get_(parseInt(t)):bu(sK,t)?sK[t]:e[t]},set:function(e,t,i){var n=e[Ue];return t==="length"&&n.setArrayLength_(i),typeof t=="symbol"||isNaN(t)?e[t]=i:n.set_(parseInt(t),i),!0},preventExtensions:function(){Ai(15)}},cAA=function(){function A(t,i,n,o){t===void 0&&(t="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=o,this.atom_=new im(t),this.enhancer_=function(g,a){return i(g,a,"ObservableArray[..]")}}var e=A.prototype;return e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.dehanceValues_=function(i){return this.dehancer!==void 0&&i.length>0?i.map(this.dehancer):i},e.intercept_=function(i){return V1(this,i)},e.observe_=function(i,n){return n===void 0&&(n=!1),n&&i({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),X1(this,i)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(i){(typeof i!="number"||isNaN(i)||i<0)&&Ai("Out of range: "+i);var n=this.values_.length;if(i!==n)if(i>n){for(var o=new Array(i-n),g=0;g<i-n;g++)o[g]=void 0;this.spliceWithArray_(n,0,o)}else this.spliceWithArray_(i,n-i)},e.updateArrayLength_=function(i,n){i!==this.lastKnownLength_&&Ai(16),this.lastKnownLength_+=n,this.legacyMode_&&n>0&&RJA(i+n+1)},e.spliceWithArray_=function(i,n,o){var g=this;this.atom_;var a=this.values_.length;if(i===void 0?i=0:i>a?i=a:i<0&&(i=Math.max(0,a+i)),arguments.length===1?n=a-i:n==null?n=0:n=Math.max(0,Math.min(n,a-i)),o===void 0&&(o=P$),wC(this)){var s=DC(this,{object:this.proxy_,type:hJA,index:i,removedCount:n,added:o});if(!s)return P$;n=s.removedCount,o=s.added}if(o=o.length===0?o:o.map(function(C){return g.enhancer_(C,void 0)}),this.legacyMode_){var I=o.length-n;this.updateArrayLength_(a,I)}var r=this.spliceItemsIntoValues_(i,n,o);return(n!==0||o.length!==0)&&this.notifyArraySplice_(i,o,r),this.dehanceValues_(r)},e.spliceItemsIntoValues_=function(i,n,o){if(o.length<PDe){var g;return(g=this.values_).splice.apply(g,[i,n].concat(o))}else{var a=this.values_.slice(i,i+n),s=this.values_.slice(i+n);this.values_.length+=o.length-n;for(var I=0;I<o.length;I++)this.values_[i+I]=o[I];for(var r=0;r<s.length;r++)this.values_[i+o.length+r]=s[r];return a}},e.notifyArrayChildUpdate_=function(i,n,o){var g=!this.owned_&&W1(),a=ql(this),s=a||g?{observableKind:"array",object:this.proxy_,type:TB,debugObjectName:this.atom_.name_,index:i,newValue:n,oldValue:o}:null;this.atom_.reportChanged(),a&&jl(this,s)},e.notifyArraySplice_=function(i,n,o){var g=!this.owned_&&W1(),a=ql(this),s=a||g?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:hJA,index:i,removed:o,added:n,removedCount:o.length,addedCount:n.length}:null;this.atom_.reportChanged(),a&&jl(this,s)},e.get_=function(i){if(this.legacyMode_&&i>=this.values_.length){console.warn("[mobx] Out of bounds read: "+i);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[i])},e.set_=function(i,n){var o=this.values_;if(this.legacyMode_&&i>o.length&&Ai(17,i,o.length),i<o.length){this.atom_;var g=o[i];if(wC(this)){var a=DC(this,{type:TB,object:this.proxy_,index:i,newValue:n});if(!a)return;n=a.newValue}n=this.enhancer_(n,g);var s=n!==g;s&&(o[i]=n,this.notifyArrayChildUpdate_(i,n,g))}else{for(var I=new Array(i+1-o.length),r=0;r<I.length-1;r++)I[r]=void 0;I[I.length-1]=n,this.spliceWithArray_(o.length,0,I)}},A}();function AGe(A,e,t,i){return t===void 0&&(t="ObservableArray"),i===void 0&&(i=!1),xkA(),Ay(function(){var n=new cAA(t,e,i,!1);vkA(n.values_,Ue,n);var o=new Proxy(n.values_,$De);return n.proxy_=o,A&&A.length&&n.spliceWithArray_(0,0,A),o})}var sK={clear:function(){return this.splice(0)},replace:function(e){var t=this[Ue];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),o=2;o<i;o++)n[o-2]=arguments[o];var g=this[Ue];switch(arguments.length){case 0:return[];case 1:return g.spliceWithArray_(e);case 2:return g.spliceWithArray_(e,t)}return g.spliceWithArray_(e,t,n)},spliceWithArray:function(e,t,i){return this[Ue].spliceWithArray_(e,t,i)},push:function(){for(var e=this[Ue],t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return e.spliceWithArray_(e.values_.length,0,i),e.values_.length},pop:function(){return this.splice(Math.max(this[Ue].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[Ue],t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return e.spliceWithArray_(0,0,i),e.values_.length},reverse:function(){return ee.trackingDerivation&&Ai(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){ee.trackingDerivation&&Ai(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[Ue],i=t.dehanceValues_(t.values_).indexOf(e);return i>-1?(this.splice(i,1),!0):!1}};gn("at",oI),gn("concat",oI),gn("flat",oI),gn("includes",oI),gn("indexOf",oI),gn("join",oI),gn("lastIndexOf",oI),gn("slice",oI),gn("toString",oI),gn("toLocaleString",oI),gn("toSorted",oI),gn("toSpliced",oI),gn("with",oI),gn("every",Pl),gn("filter",Pl),gn("find",Pl),gn("findIndex",Pl),gn("findLast",Pl),gn("findLastIndex",Pl),gn("flatMap",Pl),gn("forEach",Pl),gn("map",Pl),gn("some",Pl),gn("toReversed",Pl),gn("reduce",mJA),gn("reduceRight",mJA);function gn(A,e){typeof Array.prototype[A]=="function"&&(sK[A]=e(A))}function oI(A){return function(){var e=this[Ue];e.atom_.reportObserved();var t=e.dehanceValues_(e.values_);return t[A].apply(t,arguments)}}function Pl(A){return function(e,t){var i=this,n=this[Ue];n.atom_.reportObserved();var o=n.dehanceValues_(n.values_);return o[A](function(g,a){return e.call(t,g,a,i)})}}function mJA(A){return function(){var e=this,t=this[Ue];t.atom_.reportObserved();var i=t.dehanceValues_(t.values_),n=arguments[0];return arguments[0]=function(o,g,a){return n(o,g,a,e)},i[A].apply(i,arguments)}}var eGe=Tf("ObservableArrayAdministration",cAA);function rK(A){return U3(A)&&eGe(A[Ue])}var tGe={},nm="add",IK="delete",pJA=function(){function A(t,i,n){var o=this;i===void 0&&(i=Of),n===void 0&&(n="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ue]=tGe,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=i,this.name_=n,Tl(Map)||Ai(18),Ay(function(){o.keysAtom_=KkA("ObservableMap.keys()"),o.data_=new Map,o.hasMap_=new Map,t&&o.merge(t)})}var e=A.prototype;return e.has_=function(i){return this.data_.has(i)},e.has=function(i){var n=this;if(!ee.trackingDerivation)return this.has_(i);var o=this.hasMap_.get(i);if(!o){var g=o=new jf(this.has_(i),z3,"ObservableMap.key?",!1);this.hasMap_.set(i,g),cJA(g,function(){return n.hasMap_.delete(i)})}return o.get()},e.set=function(i,n){var o=this.has_(i);if(wC(this)){var g=DC(this,{type:o?TB:nm,object:this,newValue:n,name:i});if(!g)return this;n=g.newValue}return o?this.updateValue_(i,n):this.addValue_(i,n),this},e.delete=function(i){var n=this;if(this.keysAtom_,wC(this)){var o=DC(this,{type:IK,object:this,name:i});if(!o)return!1}if(this.has_(i)){var g=W1(),a=ql(this),s=a||g?{observableKind:"map",debugObjectName:this.name_,type:IK,object:this,oldValue:this.data_.get(i).value_,name:i}:null;return Du(function(){var I;n.keysAtom_.reportChanged(),(I=n.hasMap_.get(i))==null||I.setNewValue_(!1);var r=n.data_.get(i);r.setNewValue_(void 0),n.data_.delete(i)}),a&&jl(this,s),!0}return!1},e.updateValue_=function(i,n){var o=this.data_.get(i);if(n=o.prepareNewValue_(n),n!==ee.UNCHANGED){var g=W1(),a=ql(this),s=a||g?{observableKind:"map",debugObjectName:this.name_,type:TB,object:this,oldValue:o.value_,name:i,newValue:n}:null;o.setNewValue_(n),a&&jl(this,s)}},e.addValue_=function(i,n){var o=this;this.keysAtom_,Du(function(){var I,r=new jf(n,o.enhancer_,"ObservableMap.key",!1);o.data_.set(i,r),n=r.value_,(I=o.hasMap_.get(i))==null||I.setNewValue_(!0),o.keysAtom_.reportChanged()});var g=W1(),a=ql(this),s=a||g?{observableKind:"map",debugObjectName:this.name_,type:nm,object:this,name:i,newValue:n}:null;a&&jl(this,s)},e.get=function(i){return this.has(i)?this.dehanceValue_(this.data_.get(i).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var i=this,n=this.keys();return fJA({next:function(){var g=n.next(),a=g.done,s=g.value;return{done:a,value:a?void 0:i.get(s)}}})},e.entries=function(){var i=this,n=this.keys();return fJA({next:function(){var g=n.next(),a=g.done,s=g.value;return{done:a,value:a?void 0:[s,i.get(s)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(i,n){for(var o=cG(this),g;!(g=o()).done;){var a=g.value,s=a[0],I=a[1];i.call(n,I,s,this)}},e.merge=function(i){var n=this;return $f(i)&&(i=new Map(i)),Du(function(){tm(i)?pwe(i).forEach(function(o){return n.set(o,i[o])}):Array.isArray(i)?i.forEach(function(o){var g=o[0],a=o[1];return n.set(g,a)}):CG(i)?(mwe(i)||Ai(19,i),i.forEach(function(o,g){return n.set(g,o)})):i!=null&&Ai(20,i)}),this},e.clear=function(){var i=this;Du(function(){eJA(function(){for(var n=cG(i.keys()),o;!(o=n()).done;){var g=o.value;i.delete(g)}})})},e.replace=function(i){var n=this;return Du(function(){for(var o=iGe(i),g=new Map,a=!1,s=cG(n.data_.keys()),I;!(I=s()).done;){var r=I.value;if(!o.has(r)){var C=n.delete(r);if(C)a=!0;else{var l=n.data_.get(r);g.set(r,l)}}}for(var c=cG(o.entries()),B;!(B=c()).done;){var E=B.value,u=E[0],d=E[1],f=n.data_.has(u);if(n.set(u,d),n.data_.has(u)){var w=n.data_.get(u);g.set(u,w),f||(a=!0)}}if(!a)if(n.data_.size!==g.size)n.keysAtom_.reportChanged();else for(var y=n.data_.keys(),G=g.keys(),R=y.next(),x=G.next();!R.done;){if(R.value!==x.value){n.keysAtom_.reportChanged();break}R=y.next(),x=G.next()}n.data_=g}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(i,n){return X1(this,i)},e.intercept_=function(i){return V1(this,i)},lG(A,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),$f=Tf("ObservableMap",pJA);function fJA(A){return A[Symbol.toStringTag]="MapIterator",hAA(A)}function iGe(A){if(CG(A)||$f(A))return A;if(Array.isArray(A))return new Map(A);if(tm(A)){var e=new Map;for(var t in A)e.set(t,A[t]);return e}else return Ai(21,A)}var nGe={},yJA=function(){function A(t,i,n){var o=this;i===void 0&&(i=Of),n===void 0&&(n="ObservableSet"),this.name_=void 0,this[Ue]=nGe,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,Tl(Set)||Ai(22),this.enhancer_=function(g,a){return i(g,a,n)},Ay(function(){o.atom_=KkA(o.name_),t&&o.replace(t)})}var e=A.prototype;return e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.clear=function(){var i=this;Du(function(){eJA(function(){for(var n=cG(i.data_.values()),o;!(o=n()).done;){var g=o.value;i.delete(g)}})})},e.forEach=function(i,n){for(var o=cG(this),g;!(g=o()).done;){var a=g.value;i.call(n,a,a,this)}},e.add=function(i){var n=this;if(this.atom_,wC(this)){var o=DC(this,{type:nm,object:this,newValue:i});if(!o)return this;i=o.newValue}if(!this.has(i)){Du(function(){n.data_.add(n.enhancer_(i,void 0)),n.atom_.reportChanged()});var g=!1,a=ql(this),s=a||g?{observableKind:"set",debugObjectName:this.name_,type:nm,object:this,newValue:i}:null;a&&jl(this,s)}return this},e.delete=function(i){var n=this;if(wC(this)){var o=DC(this,{type:IK,object:this,oldValue:i});if(!o)return!1}if(this.has(i)){var g=!1,a=ql(this),s=a||g?{observableKind:"set",debugObjectName:this.name_,type:IK,object:this,oldValue:i}:null;return Du(function(){n.atom_.reportChanged(),n.data_.delete(i)}),a&&jl(this,s),!0}return!1},e.has=function(i){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(i))},e.entries=function(){var i=this.values();return bJA({next:function(){var o=i.next(),g=o.value,a=o.done;return a?{value:void 0,done:a}:{value:[g,g],done:a}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var i=this,n=this.data_.values();return bJA({next:function(){var g=n.next(),a=g.value,s=g.done;return s?{value:void 0,done:s}:{value:i.dehanceValue_(a),done:s}}})},e.intersection=function(i){if(yu(i)&&!_B(i))return i.intersection(this);var n=new Set(this);return n.intersection(i)},e.union=function(i){if(yu(i)&&!_B(i))return i.union(this);var n=new Set(this);return n.union(i)},e.difference=function(i){return new Set(this).difference(i)},e.symmetricDifference=function(i){if(yu(i)&&!_B(i))return i.symmetricDifference(this);var n=new Set(this);return n.symmetricDifference(i)},e.isSubsetOf=function(i){return new Set(this).isSubsetOf(i)},e.isSupersetOf=function(i){return new Set(this).isSupersetOf(i)},e.isDisjointFrom=function(i){if(yu(i)&&!_B(i))return i.isDisjointFrom(this);var n=new Set(this);return n.isDisjointFrom(i)},e.replace=function(i){var n=this;return _B(i)&&(i=new Set(i)),Du(function(){Array.isArray(i)?(n.clear(),i.forEach(function(o){return n.add(o)})):yu(i)?(n.clear(),i.forEach(function(o){return n.add(o)})):i!=null&&Ai("Cannot initialize set from "+i)}),this},e.observe_=function(i,n){return X1(this,i)},e.intercept_=function(i){return V1(this,i)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},lG(A,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),_B=Tf("ObservableSet",yJA);function bJA(A){return A[Symbol.toStringTag]="SetIterator",hAA(A)}var wJA=Object.create(null),DJA="remove",GJA=function(){function A(t,i,n,o){i===void 0&&(i=new Map),o===void 0&&(o=Pwe),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=t,this.values_=i,this.name_=n,this.defaultAnnotation_=o,this.keysAtom_=new im("ObservableObject.keys"),this.isPlainObject_=tm(this.target_)}var e=A.prototype;return e.getObservablePropValue_=function(i){return this.values_.get(i).get()},e.setObservablePropValue_=function(i,n){var o=this.values_.get(i);if(o instanceof _l)return o.set(n),!0;if(wC(this)){var g=DC(this,{type:TB,object:this.proxy_||this.target_,name:i,newValue:n});if(!g)return null;n=g.newValue}if(n=o.prepareNewValue_(n),n!==ee.UNCHANGED){var a=ql(this),s=!1,I=a||s?{type:TB,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:i,newValue:n}:null;o.setNewValue_(n),a&&jl(this,I)}return!0},e.get_=function(i){return ee.trackingDerivation&&!bu(this.target_,i)&&this.has_(i),this.target_[i]},e.set_=function(i,n,o){return o===void 0&&(o=!1),bu(this.target_,i)?this.values_.has(i)?this.setObservablePropValue_(i,n):o?Reflect.set(this.target_,i,n):(this.target_[i]=n,!0):this.extend_(i,{value:n,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},e.has_=function(i){if(!ee.trackingDerivation)return i in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var n=this.pendingKeys_.get(i);return n||(n=new jf(i in this.target_,z3,"ObservableObject.key?",!1),this.pendingKeys_.set(i,n)),n.get()},e.make_=function(i,n){if(n===!0&&(n=this.defaultAnnotation_),n!==!1){if(!(i in this.target_)){var o;if((o=this.target_[XB])!=null&&o[i])return;Ai(1,n.annotationType_,this.name_+"."+i.toString())}for(var g=this.target_;g&&g!==K3;){var a=W3(g,i);if(a){var s=n.make_(this,i,a,g);if(s===0)return;if(s===1)break}g=Object.getPrototypeOf(g)}JJA(this,n,i)}},e.extend_=function(i,n,o,g){if(g===void 0&&(g=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(i,n,g);var a=o.extend_(this,i,n,g);return a&&JJA(this,o,i),a},e.defineProperty_=function(i,n,o){o===void 0&&(o=!1),this.keysAtom_;try{yC();var g=this.delete_(i);if(!g)return g;if(wC(this)){var a=DC(this,{object:this.proxy_||this.target_,name:i,type:nm,newValue:n.value});if(!a)return null;var s=a.newValue;n.value!==s&&(n=_f({},n,{value:s}))}if(o){if(!Reflect.defineProperty(this.target_,i,n))return!1}else VB(this.target_,i,n);this.notifyPropertyAddition_(i,n.value)}finally{bC()}return!0},e.defineObservableProperty_=function(i,n,o,g){g===void 0&&(g=!1),this.keysAtom_;try{yC();var a=this.delete_(i);if(!a)return a;if(wC(this)){var s=DC(this,{object:this.proxy_||this.target_,name:i,type:nm,newValue:n});if(!s)return null;n=s.newValue}var I=kJA(i),r={configurable:ee.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:I.get,set:I.set};if(g){if(!Reflect.defineProperty(this.target_,i,r))return!1}else VB(this.target_,i,r);var C=new jf(n,o,"ObservableObject.key",!1);this.values_.set(i,C),this.notifyPropertyAddition_(i,C.value_)}finally{bC()}return!0},e.defineComputedProperty_=function(i,n,o){o===void 0&&(o=!1),this.keysAtom_;try{yC();var g=this.delete_(i);if(!g)return g;if(wC(this)){var a=DC(this,{object:this.proxy_||this.target_,name:i,type:nm,newValue:void 0});if(!a)return null}n.name||(n.name="ObservableObject.key"),n.context=this.proxy_||this.target_;var s=kJA(i),I={configurable:ee.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:s.get,set:s.set};if(o){if(!Reflect.defineProperty(this.target_,i,I))return!1}else VB(this.target_,i,I);this.values_.set(i,new _l(n)),this.notifyPropertyAddition_(i,void 0)}finally{bC()}return!0},e.delete_=function(i,n){if(n===void 0&&(n=!1),this.keysAtom_,!bu(this.target_,i))return!0;if(wC(this)){var o=DC(this,{object:this.proxy_||this.target_,name:i,type:DJA});if(!o)return null}try{var g;yC();var a=ql(this),s=!1,I=this.values_.get(i),r=void 0;if(!I&&(a||s)){var C;r=(C=W3(this.target_,i))==null?void 0:C.value}if(n){if(!Reflect.deleteProperty(this.target_,i))return!1}else delete this.target_[i];if(I&&(this.values_.delete(i),I instanceof jf&&(r=I.value_),aJA(I)),this.keysAtom_.reportChanged(),(g=this.pendingKeys_)==null||(g=g.get(i))==null||g.set(i in this.target_),a||s){var l={type:DJA,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:r,name:i};a&&jl(this,l)}}finally{bC()}return!0},e.observe_=function(i,n){return X1(this,i)},e.intercept_=function(i){return V1(this,i)},e.notifyPropertyAddition_=function(i,n){var o,g=ql(this),a=!1;if(g||a){var s=g||a?{type:nm,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:i,newValue:n}:null;g&&jl(this,s)}(o=this.pendingKeys_)==null||(o=o.get(i))==null||o.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),X3(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},A}();function dG(A,e){var t;if(bu(A,Ue))return A;var i=(t=e==null?void 0:e.name)!=null?t:"ObservableObject",n=new GJA(A,new Map,String(i),rDe(e));return V3(A,Ue,n),A}var oGe=Tf("ObservableObjectAdministration",GJA);function kJA(A){return wJA[A]||(wJA[A]={get:function(){return this[Ue].getObservablePropValue_(A)},set:function(t){return this[Ue].setObservablePropValue_(A,t)}})}function z1(A){return U3(A)?oGe(A[Ue]):!1}function JJA(A,e,t){var i;(i=A.target_[XB])==null||delete i[t]}var gGe=YJA(0),aGe=function(){var A=!1,e={};return Object.defineProperty(e,"0",{set:function(){A=!0}}),Object.create(e)[0]=1,A===!1}(),BAA=0,NJA=function(){};function sGe(A,e){Object.setPrototypeOf?Object.setPrototypeOf(A.prototype,e):A.prototype.__proto__!==void 0?A.prototype.__proto__=e:A.prototype=e}sGe(NJA,Array.prototype);var QAA=function(A){function e(i,n,o,g){var a;return o===void 0&&(o="ObservableArray"),g===void 0&&(g=!1),a=A.call(this)||this,Ay(function(){var s=new cAA(o,n,g,!0);s.proxy_=a,vkA(a,Ue,s),i&&i.length&&a.spliceWithArray(0,0,i),aGe&&Object.defineProperty(a,"0",gGe)}),a}WkA(e,A);var t=e.prototype;return t.concat=function(){this[Ue].atom_.reportObserved();for(var n=arguments.length,o=new Array(n),g=0;g<n;g++)o[g]=arguments[g];return Array.prototype.concat.apply(this.slice(),o.map(function(a){return rK(a)?a.slice():a}))},t[Symbol.iterator]=function(){var i=this,n=0;return hAA({next:function(){return n<i.length?{value:i[n++],done:!1}:{done:!0,value:void 0}}})},lG(e,[{key:"length",get:function(){return this[Ue].getArrayLength_()},set:function(n){this[Ue].setArrayLength_(n)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(NJA);Object.entries(sK).forEach(function(A){var e=A[0],t=A[1];e!=="concat"&&V3(QAA.prototype,e,t)});function YJA(A){return{enumerable:!1,configurable:!0,get:function(){return this[Ue].get_(A)},set:function(t){this[Ue].set_(A,t)}}}function rGe(A){VB(QAA.prototype,""+A,YJA(A))}function RJA(A){if(A>BAA){for(var e=BAA;e<A+100;e++)rGe(e);BAA=A}}RJA(1e3);function IGe(A,e,t){return new QAA(A,e,t)}function hG(A,e){if(typeof A=="object"&&A!==null){if(rK(A))return e!==void 0&&Ai(23),A[Ue].atom_;if(_B(A))return A.atom_;if($f(A)){if(e===void 0)return A.keysAtom_;var t=A.data_.get(e)||A.hasMap_.get(e);return t||Ai(25,e,EAA(A)),t}if(z1(A)){if(!e)return Ai(26);var i=A[Ue].values_.get(e);return i||Ai(27,e,EAA(A)),i}if(eAA(A)||AK(A)||gK(A))return A}else if(Tl(A)&&gK(A[Ue]))return A[Ue];Ai(28)}function xJA(A,e){if(A||Ai(29),e!==void 0)return xJA(hG(A,e));if(eAA(A)||AK(A)||gK(A)||$f(A)||_B(A))return A;if(A[Ue])return A[Ue];Ai(24,A)}function EAA(A,e){var t;if(e!==void 0)t=hG(A,e);else{if(QG(A))return A.name;z1(A)||$f(A)||_B(A)?t=xJA(A):t=hG(A)}return t.name_}function Ay(A){var e=Pf(),t=P3(!0);yC();try{return A()}finally{bC(),$3(t),wu(e)}}var FJA=K3.toString;function uAA(A,e,t){return t===void 0&&(t=-1),dAA(A,e,t)}function dAA(A,e,t,i,n){if(A===e)return A!==0||1/A===1/e;if(A==null||e==null)return!1;if(A!==A)return e!==e;var o=typeof A;if(o!=="function"&&o!=="object"&&typeof e!="object")return!1;var g=FJA.call(A);if(g!==FJA.call(e))return!1;switch(g){case"[object RegExp]":case"[object String]":return""+A==""+e;case"[object Number]":return+A!=+A?+e!=+e:+A==0?1/+A===1/e:+A==+e;case"[object Date]":case"[object Boolean]":return+A==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(A)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":t>=0&&t++;break}A=MJA(A),e=MJA(e);var a=g==="[object Array]";if(!a){if(typeof A!="object"||typeof e!="object")return!1;var s=A.constructor,I=e.constructor;if(s!==I&&!(Tl(s)&&s instanceof s&&Tl(I)&&I instanceof I)&&"constructor"in A&&"constructor"in e)return!1}if(t===0)return!1;t<0&&(t=-1),i=i||[],n=n||[];for(var r=i.length;r--;)if(i[r]===A)return n[r]===e;if(i.push(A),n.push(e),a){if(r=A.length,r!==e.length)return!1;for(;r--;)if(!dAA(A[r],e[r],t-1,i,n))return!1}else{var C=Object.keys(A),l=C.length;if(Object.keys(e).length!==l)return!1;for(var c=0;c<l;c++){var B=C[c];if(!(bu(e,B)&&dAA(A[B],e[B],t-1,i,n)))return!1}}return i.pop(),n.pop(),!0}function MJA(A){return rK(A)?A.slice():CG(A)||$f(A)||yu(A)||_B(A)?Array.from(A.entries()):A}var vJA,CGe=((vJA=Z3().Iterator)==null?void 0:vJA.prototype)||{};function hAA(A){return A[Symbol.iterator]=lGe,Object.assign(Object.create(CGe),A)}function lGe(){return this}if(["Symbol","Map","Set"].forEach(function(A){var e=Z3();typeof e[A]>"u"&&Ai("MobX requires global '"+A+"' to be available or polyfilled")}),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:kDe,extras:{getDebugName:EAA},$mobx:Ue}),!p.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!lAA)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function cGe(A){A()}function BGe(A){A||(A=cGe),UDe({reactionScheduler:A})}function QGe(A){return XDe(A)}var EGe=1e4,uGe=1e4,dGe=function(){function A(e){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(i){i===void 0&&(i=EGe),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var n=Date.now();t.registrations.forEach(function(o,g){n-o.registeredAt>=i&&(t.finalize(o.value),t.registrations.delete(g))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(A.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,i){this.registrations.set(i,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(A.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(A.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,uGe))}}),A}(),hGe=typeof FinalizationRegistry<"u"?FinalizationRegistry:dGe,mAA=new hGe(function(A){var e;(e=A.reaction)===null||e===void 0||e.dispose(),A.reaction=null}),LJA=globalThis&&globalThis.__read||function(A,e){var t=typeof Symbol=="function"&&A[Symbol.iterator];if(!t)return A;var i=t.call(A),n,o=[],g;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(a){g={error:a}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(g)throw g.error}}return o};function SJA(A){return"observer".concat(A)}var mGe=function(){function A(){}return A}();function pGe(){return new mGe}function fGe(A,e){e===void 0&&(e="observed");var t=LJA(b.useState(pGe),1),i=t[0],n=LJA(b.useState(),2),o=n[1],g=function(){return o([])},a=b.useRef(null);a.current||(a.current={reaction:null,mounted:!1,changedBeforeMount:!1});var s=a.current;s.reaction||(s.reaction=new Ol(SJA(e),function(){s.mounted?g():s.changedBeforeMount=!0}),mAA.register(i,s,s)),b.useDebugValue(s.reaction,QGe),b.useEffect(function(){return mAA.unregister(s),s.mounted=!0,s.reaction?s.changedBeforeMount&&(s.changedBeforeMount=!1,g()):(s.reaction=new Ol(SJA(e),function(){g()}),g()),function(){s.reaction.dispose(),s.reaction=null,s.mounted=!1,s.changedBeforeMount=!1}},[]);var I,r;if(s.reaction.track(function(){try{I=A()}catch(C){r=C}}),r)throw r;return I}var HJA=typeof Symbol=="function"&&Symbol.for,ZJA=HJA?Symbol.for("react.forward_ref"):typeof p.forwardRef=="function"&&p.forwardRef(function(A){return null}).$$typeof,WJA=HJA?Symbol.for("react.memo"):typeof p.memo=="function"&&p.memo(function(A){return null}).$$typeof;function Gu(A,e){var t;if(WJA&&A.$$typeof===WJA)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var i=(t=e==null?void 0:e.forwardRef)!==null&&t!==void 0?t:!1,n=A,o=A.displayName||A.name;if(ZJA&&A.$$typeof===ZJA&&(i=!0,n=A.render,typeof n!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var g=function(a,s){return fGe(function(){return n(a,s)},o)};return o!==""&&(g.displayName=o),A.contextTypes&&(g.contextTypes=A.contextTypes),i&&(g=p.forwardRef(g)),g=p.memo(g),bGe(A,g),g}var yGe={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function bGe(A,e){Object.keys(A).forEach(function(t){yGe[t]||Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}globalThis&&globalThis.__read;var pAA;BGe(bt.unstable_batchedUpdates),pAA=mAA.finalizeAllImmediately;var T1={},wGe={get exports(){return T1},set exports(A){T1=A}},Ni={};/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ig=typeof Symbol=="function"&&Symbol.for,fAA=Ig?Symbol.for("react.element"):60103,yAA=Ig?Symbol.for("react.portal"):60106,CK=Ig?Symbol.for("react.fragment"):60107,lK=Ig?Symbol.for("react.strict_mode"):60108,cK=Ig?Symbol.for("react.profiler"):60114,BK=Ig?Symbol.for("react.provider"):60109,QK=Ig?Symbol.for("react.context"):60110,bAA=Ig?Symbol.for("react.async_mode"):60111,EK=Ig?Symbol.for("react.concurrent_mode"):60111,uK=Ig?Symbol.for("react.forward_ref"):60112,dK=Ig?Symbol.for("react.suspense"):60113,DGe=Ig?Symbol.for("react.suspense_list"):60120,hK=Ig?Symbol.for("react.memo"):60115,mK=Ig?Symbol.for("react.lazy"):60116,GGe=Ig?Symbol.for("react.block"):60121,kGe=Ig?Symbol.for("react.fundamental"):60117,JGe=Ig?Symbol.for("react.responder"):60118,NGe=Ig?Symbol.for("react.scope"):60119;function gI(A){if(typeof A=="object"&&A!==null){var e=A.$$typeof;switch(e){case fAA:switch(A=A.type,A){case bAA:case EK:case CK:case cK:case lK:case dK:return A;default:switch(A=A&&A.$$typeof,A){case QK:case uK:case mK:case hK:case BK:return A;default:return e}}case yAA:return e}}}function KJA(A){return gI(A)===EK}Ni.AsyncMode=bAA,Ni.ConcurrentMode=EK,Ni.ContextConsumer=QK,Ni.ContextProvider=BK,Ni.Element=fAA,Ni.ForwardRef=uK,Ni.Fragment=CK,Ni.Lazy=mK,Ni.Memo=hK,Ni.Portal=yAA,Ni.Profiler=cK,Ni.StrictMode=lK,Ni.Suspense=dK,Ni.isAsyncMode=function(A){return KJA(A)||gI(A)===bAA},Ni.isConcurrentMode=KJA,Ni.isContextConsumer=function(A){return gI(A)===QK},Ni.isContextProvider=function(A){return gI(A)===BK},Ni.isElement=function(A){return typeof A=="object"&&A!==null&&A.$$typeof===fAA},Ni.isForwardRef=function(A){return gI(A)===uK},Ni.isFragment=function(A){return gI(A)===CK},Ni.isLazy=function(A){return gI(A)===mK},Ni.isMemo=function(A){return gI(A)===hK},Ni.isPortal=function(A){return gI(A)===yAA},Ni.isProfiler=function(A){return gI(A)===cK},Ni.isStrictMode=function(A){return gI(A)===lK},Ni.isSuspense=function(A){return gI(A)===dK},Ni.isValidElementType=function(A){return typeof A=="string"||typeof A=="function"||A===CK||A===EK||A===cK||A===lK||A===dK||A===DGe||typeof A=="object"&&A!==null&&(A.$$typeof===mK||A.$$typeof===hK||A.$$typeof===BK||A.$$typeof===QK||A.$$typeof===uK||A.$$typeof===kGe||A.$$typeof===JGe||A.$$typeof===NGe||A.$$typeof===GGe)},Ni.typeOf=gI,function(A){A.exports=Ni}(wGe);var YGe=function(e,t,i,n){var o=i?i.call(n,e,t):void 0;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var g=Object.keys(e),a=Object.keys(t);if(g.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),I=0;I<g.length;I++){var r=g[I];if(!s(r))return!1;var C=e[r],l=t[r];if(o=i?i.call(n,C,l,r):void 0,o===!1||o===void 0&&C!==l)return!1}return!0};function RGe(A){function e(j,O,eA,oA,tA){for(var sA=0,gA=0,iA=0,aA=0,lA,CA,QA=0,uA=0,fA,hA=fA=lA=0,yA=0,mA=0,LA=0,UA=0,ne=eA.length,SA=ne-1,ae,EA="",wA="",se="",we="",be;yA<ne;){if(CA=eA.charCodeAt(yA),yA===SA&&gA+aA+iA+sA!==0&&(gA!==0&&(CA=gA===47?10:47),aA=iA=sA=0,ne++,SA++),gA+aA+iA+sA===0){if(yA===SA&&(0<mA&&(EA=EA.replace(l,"")),0<EA.trim().length)){switch(CA){case 32:case 9:case 59:case 13:case 10:break;default:EA+=eA.charAt(yA)}CA=59}switch(CA){case 123:for(EA=EA.trim(),lA=EA.charCodeAt(0),fA=1,UA=++yA;yA<ne;){switch(CA=eA.charCodeAt(yA)){case 123:fA++;break;case 125:fA--;break;case 47:switch(CA=eA.charCodeAt(yA+1)){case 42:case 47:A:{for(hA=yA+1;hA<SA;++hA)switch(eA.charCodeAt(hA)){case 47:if(CA===42&&eA.charCodeAt(hA-1)===42&&yA+2!==hA){yA=hA+1;break A}break;case 10:if(CA===47){yA=hA+1;break A}}yA=hA}}break;case 91:CA++;case 40:CA++;case 34:case 39:for(;yA++<SA&&eA.charCodeAt(yA)!==CA;);}if(fA===0)break;yA++}switch(fA=eA.substring(UA,yA),lA===0&&(lA=(EA=EA.replace(C,"").trim()).charCodeAt(0)),lA){case 64:switch(0<mA&&(EA=EA.replace(l,"")),CA=EA.charCodeAt(1),CA){case 100:case 109:case 115:case 45:mA=O;break;default:mA=V}if(fA=e(O,mA,fA,CA,tA+1),UA=fA.length,0<_&&(mA=t(V,EA,LA),be=a(3,fA,mA,O,v,N,UA,CA,tA,oA),EA=mA.join(""),be!==void 0&&(UA=(fA=be.trim()).length)===0&&(CA=0,fA="")),0<UA)switch(CA){case 115:EA=EA.replace(R,g);case 100:case 109:case 45:fA=EA+"{"+fA+"}";break;case 107:EA=EA.replace(f,"$1 $2"),fA=EA+"{"+fA+"}",fA=U===1||U===2&&o("@"+fA,3)?"@-webkit-"+fA+"@"+fA:"@"+fA;break;default:fA=EA+fA,oA===112&&(fA=(wA+=fA,""))}else fA="";break;default:fA=e(O,t(O,EA,LA),fA,oA,tA+1)}se+=fA,fA=LA=mA=hA=lA=0,EA="",CA=eA.charCodeAt(++yA);break;case 125:case 59:if(EA=(0<mA?EA.replace(l,""):EA).trim(),1<(UA=EA.length))switch(hA===0&&(lA=EA.charCodeAt(0),lA===45||96<lA&&123>lA)&&(UA=(EA=EA.replace(" ",":")).length),0<_&&(be=a(1,EA,O,j,v,N,wA.length,oA,tA,oA))!==void 0&&(UA=(EA=be.trim()).length)===0&&(EA="\0\0"),lA=EA.charCodeAt(0),CA=EA.charCodeAt(1),lA){case 0:break;case 64:if(CA===105||CA===99){we+=EA+eA.charAt(yA);break}default:EA.charCodeAt(UA-1)!==58&&(wA+=n(EA,lA,CA,EA.charCodeAt(2)))}LA=mA=hA=lA=0,EA="",CA=eA.charCodeAt(++yA)}}switch(CA){case 13:case 10:gA===47?gA=0:1+lA===0&&oA!==107&&0<EA.length&&(mA=1,EA+="\0"),0<_*$&&a(0,EA,O,j,v,N,wA.length,oA,tA,oA),N=1,v++;break;case 59:case 125:if(gA+aA+iA+sA===0){N++;break}default:switch(N++,ae=eA.charAt(yA),CA){case 9:case 32:if(aA+sA+gA===0)switch(QA){case 44:case 58:case 9:case 32:ae="";break;default:CA!==32&&(ae=" ")}break;case 0:ae="\\0";break;case 12:ae="\\f";break;case 11:ae="\\v";break;case 38:aA+gA+sA===0&&(mA=LA=1,ae="\f"+ae);break;case 108:if(aA+gA+sA+K===0&&0<hA)switch(yA-hA){case 2:QA===112&&eA.charCodeAt(yA-3)===58&&(K=QA);case 8:uA===111&&(K=uA)}break;case 58:aA+gA+sA===0&&(hA=yA);break;case 44:gA+iA+aA+sA===0&&(mA=1,ae+="\r");break;case 34:case 39:gA===0&&(aA=aA===CA?0:aA===0?CA:aA);break;case 91:aA+gA+iA===0&&sA++;break;case 93:aA+gA+iA===0&&sA--;break;case 41:aA+gA+sA===0&&iA--;break;case 40:if(aA+gA+sA===0){if(lA===0)switch(2*QA+3*uA){case 533:break;default:lA=1}iA++}break;case 64:gA+iA+aA+sA+hA+fA===0&&(fA=1);break;case 42:case 47:if(!(0<aA+sA+iA))switch(gA){case 0:switch(2*CA+3*eA.charCodeAt(yA+1)){case 235:gA=47;break;case 220:UA=yA,gA=42}break;case 42:CA===47&&QA===42&&UA+2!==yA&&(eA.charCodeAt(UA+2)===33&&(wA+=eA.substring(UA,yA+1)),ae="",gA=0)}}gA===0&&(EA+=ae)}uA=QA,QA=CA,yA++}if(UA=wA.length,0<UA){if(mA=O,0<_&&(be=a(2,wA,mA,j,v,N,UA,oA,tA,oA),be!==void 0&&(wA=be).length===0))return we+wA+se;if(wA=mA.join(",")+"{"+wA+"}",U*K!==0){switch(U!==2||o(wA,2)||(K=0),K){case 111:wA=wA.replace(y,":-moz-$1")+wA;break;case 112:wA=wA.replace(w,"::-webkit-input-$1")+wA.replace(w,"::-moz-$1")+wA.replace(w,":-ms-input-$1")+wA}K=0}}return we+wA+se}function t(j,O,eA){var oA=O.trim().split(u);O=oA;var tA=oA.length,sA=j.length;switch(sA){case 0:case 1:var gA=0;for(j=sA===0?"":j[0]+" ";gA<tA;++gA)O[gA]=i(j,O[gA],eA).trim();break;default:var iA=gA=0;for(O=[];gA<tA;++gA)for(var aA=0;aA<sA;++aA)O[iA++]=i(j[aA]+" ",oA[gA],eA).trim()}return O}function i(j,O,eA){var oA=O.charCodeAt(0);switch(33>oA&&(oA=(O=O.trim()).charCodeAt(0)),oA){case 38:return O.replace(d,"$1"+j.trim());case 58:return j.trim()+O.replace(d,"$1"+j.trim());default:if(0<1*eA&&0<O.indexOf("\f"))return O.replace(d,(j.charCodeAt(0)===58?"":"$1")+j.trim())}return j+O}function n(j,O,eA,oA){var tA=j+";",sA=2*O+3*eA+4*oA;if(sA===944){j=tA.indexOf(":",9)+1;var gA=tA.substring(j,tA.length-1).trim();return gA=tA.substring(0,j).trim()+gA+";",U===1||U===2&&o(gA,1)?"-webkit-"+gA+gA:gA}if(U===0||U===2&&!o(tA,1))return tA;switch(sA){case 1015:return tA.charCodeAt(10)===97?"-webkit-"+tA+tA:tA;case 951:return tA.charCodeAt(3)===116?"-webkit-"+tA+tA:tA;case 963:return tA.charCodeAt(5)===110?"-webkit-"+tA+tA:tA;case 1009:if(tA.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+tA+tA;case 978:return"-webkit-"+tA+"-moz-"+tA+tA;case 1019:case 983:return"-webkit-"+tA+"-moz-"+tA+"-ms-"+tA+tA;case 883:if(tA.charCodeAt(8)===45)return"-webkit-"+tA+tA;if(0<tA.indexOf("image-set(",11))return tA.replace(h,"$1-webkit-$2")+tA;break;case 932:if(tA.charCodeAt(4)===45)switch(tA.charCodeAt(5)){case 103:return"-webkit-box-"+tA.replace("-grow","")+"-webkit-"+tA+"-ms-"+tA.replace("grow","positive")+tA;case 115:return"-webkit-"+tA+"-ms-"+tA.replace("shrink","negative")+tA;case 98:return"-webkit-"+tA+"-ms-"+tA.replace("basis","preferred-size")+tA}return"-webkit-"+tA+"-ms-"+tA+tA;case 964:return"-webkit-"+tA+"-ms-flex-"+tA+tA;case 1023:if(tA.charCodeAt(8)!==99)break;return gA=tA.substring(tA.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+gA+"-webkit-"+tA+"-ms-flex-pack"+gA+tA;case 1005:return B.test(tA)?tA.replace(c,":-webkit-")+tA.replace(c,":-moz-")+tA:tA;case 1e3:switch(gA=tA.substring(13).trim(),O=gA.indexOf("-")+1,gA.charCodeAt(0)+gA.charCodeAt(O)){case 226:gA=tA.replace(G,"tb");break;case 232:gA=tA.replace(G,"tb-rl");break;case 220:gA=tA.replace(G,"lr");break;default:return tA}return"-webkit-"+tA+"-ms-"+gA+tA;case 1017:if(tA.indexOf("sticky",9)===-1)break;case 975:switch(O=(tA=j).length-10,gA=(tA.charCodeAt(O)===33?tA.substring(0,O):tA).substring(j.indexOf(":",7)+1).trim(),sA=gA.charCodeAt(0)+(gA.charCodeAt(7)|0)){case 203:if(111>gA.charCodeAt(8))break;case 115:tA=tA.replace(gA,"-webkit-"+gA)+";"+tA;break;case 207:case 102:tA=tA.replace(gA,"-webkit-"+(102<sA?"inline-":"")+"box")+";"+tA.replace(gA,"-webkit-"+gA)+";"+tA.replace(gA,"-ms-"+gA+"box")+";"+tA}return tA+";";case 938:if(tA.charCodeAt(5)===45)switch(tA.charCodeAt(6)){case 105:return gA=tA.replace("-items",""),"-webkit-"+tA+"-webkit-box-"+gA+"-ms-flex-"+gA+tA;case 115:return"-webkit-"+tA+"-ms-flex-item-"+tA.replace(F,"")+tA;default:return"-webkit-"+tA+"-ms-flex-line-pack"+tA.replace("align-content","").replace(F,"")+tA}break;case 973:case 989:if(tA.charCodeAt(3)!==45||tA.charCodeAt(4)===122)break;case 931:case 953:if(k.test(j)===!0)return(gA=j.substring(j.indexOf(":")+1)).charCodeAt(0)===115?n(j.replace("stretch","fill-available"),O,eA,oA).replace(":fill-available",":stretch"):tA.replace(gA,"-webkit-"+gA)+tA.replace(gA,"-moz-"+gA.replace("fill-",""))+tA;break;case 962:if(tA="-webkit-"+tA+(tA.charCodeAt(5)===102?"-ms-"+tA:"")+tA,eA+oA===211&&tA.charCodeAt(13)===105&&0<tA.indexOf("transform",10))return tA.substring(0,tA.indexOf(";",27)+1).replace(E,"$1-webkit-$2")+tA}return tA}function o(j,O){var eA=j.indexOf(O===1?":":"{"),oA=j.substring(0,O!==3?eA:10);return eA=j.substring(eA+1,j.length-1),q(O!==2?oA:oA.replace(Q,"$1"),eA,O)}function g(j,O){var eA=n(O,O.charCodeAt(0),O.charCodeAt(1),O.charCodeAt(2));return eA!==O+";"?eA.replace(x," or ($1)").substring(4):"("+O+")"}function a(j,O,eA,oA,tA,sA,gA,iA,aA,lA){for(var CA=0,QA=O,uA;CA<_;++CA)switch(uA=X[CA].call(r,j,QA,eA,oA,tA,sA,gA,iA,aA,lA)){case void 0:case!1:case!0:case null:break;default:QA=uA}if(QA!==O)return QA}function s(j){switch(j){case void 0:case null:_=X.length=0;break;default:if(typeof j=="function")X[_++]=j;else if(typeof j=="object")for(var O=0,eA=j.length;O<eA;++O)s(j[O]);else $=!!j|0}return s}function I(j){return j=j.prefix,j!==void 0&&(q=null,j?typeof j!="function"?U=1:(U=2,q=j):U=0),I}function r(j,O){var eA=j;if(33>eA.charCodeAt(0)&&(eA=eA.trim()),nA=eA,eA=[nA],0<_){var oA=a(-1,O,eA,eA,v,N,0,0,0,0);oA!==void 0&&typeof oA=="string"&&(O=oA)}var tA=e(V,eA,O,0,0);return 0<_&&(oA=a(-2,tA,eA,eA,v,N,tA.length,0,0,0),oA!==void 0&&(tA=oA)),nA="",K=0,N=v=1,tA}var C=/^\0+/g,l=/[\0\r\f]/g,c=/: */g,B=/zoo|gra/,E=/([,: ])(transform)/g,u=/,\r+?/g,d=/([\t\r\n ])*\f?&/g,f=/@(k\w+)\s*(\S*)\s*/,w=/::(place)/g,y=/:(read-only)/g,G=/[svh]\w+-[tblr]{2}/,R=/\(\s*(.*)\s*\)/g,x=/([\s\S]*?);/g,F=/-self|flex-/g,Q=/[^]*?(:[rp][el]a[\w-]+)[^]*/,k=/stretch|:\s*\w+\-(?:conte|avail)/,h=/([^-])(image-set\()/,N=1,v=1,K=0,U=1,V=[],X=[],_=0,q=null,$=0,nA="";return r.use=s,r.set=I,A!==void 0&&I(A),r}var xGe={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function FGe(A){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=A(t)),e[t]}}var MGe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,UJA=FGe(function(A){return MGe.test(A)||A.charCodeAt(0)===111&&A.charCodeAt(1)===110&&A.charCodeAt(2)<91}),wAA=T1,vGe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},LGe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},SGe={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},VJA={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},DAA={};DAA[wAA.ForwardRef]=SGe,DAA[wAA.Memo]=VJA;function XJA(A){return wAA.isMemo(A)?VJA:DAA[A.$$typeof]||vGe}var HGe=Object.defineProperty,ZGe=Object.getOwnPropertyNames,zJA=Object.getOwnPropertySymbols,WGe=Object.getOwnPropertyDescriptor,KGe=Object.getPrototypeOf,TJA=Object.prototype;function _JA(A,e,t){if(typeof e!="string"){if(TJA){var i=KGe(e);i&&i!==TJA&&_JA(A,i,t)}var n=ZGe(e);zJA&&(n=n.concat(zJA(e)));for(var o=XJA(A),g=XJA(e),a=0;a<n.length;++a){var s=n[a];if(!LGe[s]&&!(t&&t[s])&&!(g&&g[s])&&!(o&&o[s])){var I=WGe(e,s);try{HGe(A,s,I)}catch{}}}}return A}var OJA=_JA;function ku(){return(ku=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A}).apply(this,arguments)}var qJA=function(A,e){for(var t=[A[0]],i=0,n=e.length;i<n;i+=1)t.push(e[i],A[i+1]);return t},GAA=function(A){return A!==null&&typeof A=="object"&&(A.toString?A.toString():Object.prototype.toString.call(A))==="[object Object]"&&!T1.typeOf(A)},pK=Object.freeze([]),om=Object.freeze({});function _1(A){return typeof A=="function"}function jJA(A){return A.displayName||A.name||"Component"}function kAA(A){return A&&typeof A.styledComponentId=="string"}var mG=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",JAA=typeof window<"u"&&"HTMLElement"in window,UGe=Boolean(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:!1));function O1(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];throw new Error("An error occurred. See https://git.io/JUIaE#"+A+" for more information."+(t.length>0?" Args: "+t.join(", "):""))}var VGe=function(){function A(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}var e=A.prototype;return e.indexOfGroup=function(t){for(var i=0,n=0;n<t;n++)i+=this.groupSizes[n];return i},e.insertRules=function(t,i){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,g=o;t>=g;)(g<<=1)<0&&O1(16,""+t);this.groupSizes=new Uint32Array(g),this.groupSizes.set(n),this.length=g;for(var a=o;a<g;a++)this.groupSizes[a]=0}for(var s=this.indexOfGroup(t+1),I=0,r=i.length;I<r;I++)this.tag.insertRule(s,i[I])&&(this.groupSizes[t]++,s++)},e.clearGroup=function(t){if(t<this.length){var i=this.groupSizes[t],n=this.indexOfGroup(t),o=n+i;this.groupSizes[t]=0;for(var g=n;g<o;g++)this.tag.deleteRule(n)}},e.getGroup=function(t){var i="";if(t>=this.length||this.groupSizes[t]===0)return i;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),g=o+n,a=o;a<g;a++)i+=this.tag.getRule(a)+`/*!sc*/
`;return i},A}(),fK=new Map,yK=new Map,q1=1,bK=function(A){if(fK.has(A))return fK.get(A);for(;yK.has(q1);)q1++;var e=q1++;return fK.set(A,e),yK.set(e,A),e},XGe=function(A){return yK.get(A)},zGe=function(A,e){e>=q1&&(q1=e+1),fK.set(A,e),yK.set(e,A)},TGe="style["+mG+'][data-styled-version="5.3.11"]',_Ge=new RegExp("^"+mG+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),OGe=function(A,e,t){for(var i,n=t.split(","),o=0,g=n.length;o<g;o++)(i=n[o])&&A.registerName(e,i)},qGe=function(A,e){for(var t=(e.textContent||"").split(`/*!sc*/
`),i=[],n=0,o=t.length;n<o;n++){var g=t[n].trim();if(g){var a=g.match(_Ge);if(a){var s=0|parseInt(a[1],10),I=a[2];s!==0&&(zGe(I,s),OGe(A,I,a[3]),A.getTag().insertRules(s,i)),i.length=0}else i.push(g)}}},jGe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null},PJA=function(A){var e=document.head,t=A||e,i=document.createElement("style"),n=function(a){for(var s=a.childNodes,I=s.length;I>=0;I--){var r=s[I];if(r&&r.nodeType===1&&r.hasAttribute(mG))return r}}(t),o=n!==void 0?n.nextSibling:null;i.setAttribute(mG,"active"),i.setAttribute("data-styled-version","5.3.11");var g=jGe();return g&&i.setAttribute("nonce",g),t.insertBefore(i,o),i},PGe=function(){function A(t){var i=this.element=PJA(t);i.appendChild(document.createTextNode("")),this.sheet=function(n){if(n.sheet)return n.sheet;for(var o=document.styleSheets,g=0,a=o.length;g<a;g++){var s=o[g];if(s.ownerNode===n)return s}O1(17)}(i),this.length=0}var e=A.prototype;return e.insertRule=function(t,i){try{return this.sheet.insertRule(i,t),this.length++,!0}catch{return!1}},e.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.getRule=function(t){var i=this.sheet.cssRules[t];return i!==void 0&&typeof i.cssText=="string"?i.cssText:""},A}(),$Ge=function(){function A(t){var i=this.element=PJA(t);this.nodes=i.childNodes,this.length=0}var e=A.prototype;return e.insertRule=function(t,i){if(t<=this.length&&t>=0){var n=document.createTextNode(i),o=this.nodes[t];return this.element.insertBefore(n,o||null),this.length++,!0}return!1},e.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},A}(),Ake=function(){function A(t){this.rules=[],this.length=0}var e=A.prototype;return e.insertRule=function(t,i){return t<=this.length&&(this.rules.splice(t,0,i),this.length++,!0)},e.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.getRule=function(t){return t<this.length?this.rules[t]:""},A}(),$JA=JAA,eke={isServer:!JAA,useCSSOMInjection:!UGe},A2A=function(){function A(t,i,n){t===void 0&&(t=om),i===void 0&&(i={}),this.options=ku({},eke,{},t),this.gs=i,this.names=new Map(n),this.server=!!t.isServer,!this.server&&JAA&&$JA&&($JA=!1,function(o){for(var g=document.querySelectorAll(TGe),a=0,s=g.length;a<s;a++){var I=g[a];I&&I.getAttribute(mG)!=="active"&&(qGe(o,I),I.parentNode&&I.parentNode.removeChild(I))}}(this))}A.registerId=function(t){return bK(t)};var e=A.prototype;return e.reconstructWithOptions=function(t,i){return i===void 0&&(i=!0),new A(ku({},this.options,{},t),this.gs,i&&this.names||void 0)},e.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.getTag=function(){return this.tag||(this.tag=(n=(i=this.options).isServer,o=i.useCSSOMInjection,g=i.target,t=n?new Ake(g):o?new PGe(g):new $Ge(g),new VGe(t)));var t,i,n,o,g},e.hasNameForId=function(t,i){return this.names.has(t)&&this.names.get(t).has(i)},e.registerName=function(t,i){if(bK(t),this.names.has(t))this.names.get(t).add(i);else{var n=new Set;n.add(i),this.names.set(t,n)}},e.insertRules=function(t,i,n){this.registerName(t,i),this.getTag().insertRules(bK(t),n)},e.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.clearRules=function(t){this.getTag().clearGroup(bK(t)),this.clearNames(t)},e.clearTag=function(){this.tag=void 0},e.toString=function(){return function(t){for(var i=t.getTag(),n=i.length,o="",g=0;g<n;g++){var a=XGe(g);if(a!==void 0){var s=t.names.get(a),I=i.getGroup(g);if(s&&I&&s.size){var r=mG+".g"+g+'[id="'+a+'"]',C="";s!==void 0&&s.forEach(function(l){l.length>0&&(C+=l+",")}),o+=""+I+r+'{content:"'+C+`"}/*!sc*/
`}}}return o}(this)},A}(),tke=/(a)(d)/gi,e2A=function(A){return String.fromCharCode(A+(A>25?39:97))};function NAA(A){var e,t="";for(e=Math.abs(A);e>52;e=e/52|0)t=e2A(e%52)+t;return(e2A(e%52)+t).replace(tke,"$1-$2")}var pG=function(A,e){for(var t=e.length;t;)A=33*A^e.charCodeAt(--t);return A},t2A=function(A){return pG(5381,A)};function ike(A){for(var e=0;e<A.length;e+=1){var t=A[e];if(_1(t)&&!kAA(t))return!1}return!0}var nke=t2A("5.3.11"),oke=function(){function A(e,t,i){this.rules=e,this.staticRulesId="",this.isStatic=(i===void 0||i.isStatic)&&ike(e),this.componentId=t,this.baseHash=pG(nke,t),this.baseStyle=i,A2A.registerId(t)}return A.prototype.generateAndInjectStyles=function(e,t,i){var n=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,i)),this.isStatic&&!i.hash)if(this.staticRulesId&&t.hasNameForId(n,this.staticRulesId))o.push(this.staticRulesId);else{var g=fG(this.rules,e,t,i).join(""),a=NAA(pG(this.baseHash,g)>>>0);if(!t.hasNameForId(n,a)){var s=i(g,"."+a,void 0,n);t.insertRules(n,a,s)}o.push(a),this.staticRulesId=a}else{for(var I=this.rules.length,r=pG(this.baseHash,i.hash),C="",l=0;l<I;l++){var c=this.rules[l];if(typeof c=="string")C+=c;else if(c){var B=fG(c,e,t,i),E=Array.isArray(B)?B.join(""):B;r=pG(r,E+l),C+=E}}if(C){var u=NAA(r>>>0);if(!t.hasNameForId(n,u)){var d=i(C,"."+u,void 0,n);t.insertRules(n,u,d)}o.push(u)}}return o.join(" ")},A}(),gke=/^\s*\/\/.*$/gm,ake=[":","[",".","#"];function i2A(A){var e,t,i,n,o=A===void 0?om:A,g=o.options,a=g===void 0?om:g,s=o.plugins,I=s===void 0?pK:s,r=new RGe(a),C=[],l=function(E){function u(d){if(d)try{E(d+"}")}catch{}}return function(d,f,w,y,G,R,x,F,Q,k){switch(d){case 1:if(Q===0&&f.charCodeAt(0)===64)return E(f+";"),"";break;case 2:if(F===0)return f+"/*|*/";break;case 3:switch(F){case 102:case 112:return E(w[0]+f),"";default:return f+(k===0?"/*|*/":"")}case-2:f.split("/*|*/}").forEach(u)}}}(function(E){C.push(E)}),c=function(E,u,d){return u===0&&ake.indexOf(d[t.length])!==-1||d.match(n)?E:"."+e};function B(E,u,d,f){f===void 0&&(f="&");var w=E.replace(gke,""),y=u&&d?d+" "+u+" { "+w+" }":w;return e=f,t=u,i=new RegExp("\\"+t+"\\b","g"),n=new RegExp("(\\"+t+"\\b){2,}"),r(d||!u?"":u,y)}return r.use([].concat(I,[function(E,u,d){E===2&&d.length&&d[0].lastIndexOf(t)>0&&(d[0]=d[0].replace(i,c))},l,function(E){if(E===-2){var u=C;return C=[],u}}])),B.hash=I.length?I.reduce(function(E,u){return u.name||O1(15),pG(E,u.name)},5381).toString():"",B}var YAA=b.createContext();YAA.Consumer;var RAA=b.createContext(),ske=(RAA.Consumer,new A2A),xAA=i2A();function n2A(){return p.useContext(YAA)||ske}function rke(){return p.useContext(RAA)||xAA}function Ike(A){var e=p.useState(A.stylisPlugins),t=e[0],i=e[1],n=n2A(),o=p.useMemo(function(){var a=n;return A.sheet?a=A.sheet:A.target&&(a=a.reconstructWithOptions({target:A.target},!1)),A.disableCSSOMInjection&&(a=a.reconstructWithOptions({useCSSOMInjection:!1})),a},[A.disableCSSOMInjection,A.sheet,A.target]),g=p.useMemo(function(){return i2A({options:{prefix:!A.disableVendorPrefixes},plugins:t})},[A.disableVendorPrefixes,t]);return p.useEffect(function(){YGe(t,A.stylisPlugins)||i(A.stylisPlugins)},[A.stylisPlugins]),b.createElement(YAA.Provider,{value:o},b.createElement(RAA.Provider,{value:g},A.children))}var Cke=function(){function A(e,t){var i=this;this.inject=function(n,o){o===void 0&&(o=xAA);var g=i.name+o.hash;n.hasNameForId(i.id,g)||n.insertRules(i.id,g,o(i.rules,g,"@keyframes"))},this.toString=function(){return O1(12,String(i.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return A.prototype.getName=function(e){return e===void 0&&(e=xAA),this.name+e.hash},A}(),lke=/([A-Z])/,cke=/([A-Z])/g,Bke=/^ms-/,Qke=function(A){return"-"+A.toLowerCase()};function o2A(A){return lke.test(A)?A.replace(cke,Qke).replace(Bke,"-ms-"):A}var g2A=function(A){return A==null||A===!1||A===""};function fG(A,e,t,i){if(Array.isArray(A)){for(var n,o=[],g=0,a=A.length;g<a;g+=1)(n=fG(A[g],e,t,i))!==""&&(Array.isArray(n)?o.push.apply(o,n):o.push(n));return o}if(g2A(A))return"";if(kAA(A))return"."+A.styledComponentId;if(_1(A)){if(typeof(I=A)!="function"||I.prototype&&I.prototype.isReactComponent||!e)return A;var s=A(e);return fG(s,e,t,i)}var I;return A instanceof Cke?t?(A.inject(t,i),A.getName(i)):A:GAA(A)?function r(C,l){var c,B,E=[];for(var u in C)C.hasOwnProperty(u)&&!g2A(C[u])&&(Array.isArray(C[u])&&C[u].isCss||_1(C[u])?E.push(o2A(u)+":",C[u],";"):GAA(C[u])?E.push.apply(E,r(C[u],u)):E.push(o2A(u)+": "+(c=u,(B=C[u])==null||typeof B=="boolean"||B===""?"":typeof B!="number"||B===0||c in xGe||c.startsWith("--")?String(B).trim():B+"px")+";"));return l?[l+" {"].concat(E,["}"]):E}(A):A.toString()}var a2A=function(A){return Array.isArray(A)&&(A.isCss=!0),A};function Eke(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return _1(A)||GAA(A)?a2A(fG(qJA(pK,[A].concat(t)))):t.length===0&&A.length===1&&typeof A[0]=="string"?A:a2A(fG(qJA(A,t)))}var uke=function(A,e,t){return t===void 0&&(t=om),A.theme!==t.theme&&A.theme||e||t.theme},dke=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,hke=/(^-|-$)/g;function FAA(A){return A.replace(dke,"-").replace(hke,"")}var mke=function(A){return NAA(t2A(A)>>>0)};function wK(A){return typeof A=="string"&&!0}var MAA=function(A){return typeof A=="function"||typeof A=="object"&&A!==null&&!Array.isArray(A)},pke=function(A){return A!=="__proto__"&&A!=="constructor"&&A!=="prototype"};function fke(A,e,t){var i=A[t];MAA(e)&&MAA(i)?s2A(i,e):A[t]=e}function s2A(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];for(var n=0,o=t;n<o.length;n++){var g=o[n];if(MAA(g))for(var a in g)pke(a)&&fke(A,g[a],a)}return A}var r2A=b.createContext();r2A.Consumer;var vAA={};function I2A(A,e,t){var i=kAA(A),n=!wK(A),o=e.attrs,g=o===void 0?pK:o,a=e.componentId,s=a===void 0?function(f,w){var y=typeof f!="string"?"sc":FAA(f);vAA[y]=(vAA[y]||0)+1;var G=y+"-"+mke("5.3.11"+y+vAA[y]);return w?w+"-"+G:G}(e.displayName,e.parentComponentId):a,I=e.displayName,r=I===void 0?function(f){return wK(f)?"styled."+f:"Styled("+jJA(f)+")"}(A):I,C=e.displayName&&e.componentId?FAA(e.displayName)+"-"+e.componentId:e.componentId||s,l=i&&A.attrs?Array.prototype.concat(A.attrs,g).filter(Boolean):g,c=e.shouldForwardProp;i&&A.shouldForwardProp&&(c=e.shouldForwardProp?function(f,w,y){return A.shouldForwardProp(f,w,y)&&e.shouldForwardProp(f,w,y)}:A.shouldForwardProp);var B,E=new oke(t,C,i?A.componentStyle:void 0),u=E.isStatic&&g.length===0,d=function(f,w){return function(y,G,R,x){var F=y.attrs,Q=y.componentStyle,k=y.defaultProps,h=y.foldedComponentIds,N=y.shouldForwardProp,v=y.styledComponentId,K=y.target,U=function(oA,tA,sA){oA===void 0&&(oA=om);var gA=ku({},tA,{theme:oA}),iA={};return sA.forEach(function(aA){var lA,CA,QA,uA=aA;for(lA in _1(uA)&&(uA=uA(gA)),uA)gA[lA]=iA[lA]=lA==="className"?(CA=iA[lA],QA=uA[lA],CA&&QA?CA+" "+QA:CA||QA):uA[lA]}),[gA,iA]}(uke(G,p.useContext(r2A),k)||om,G,F),V=U[0],X=U[1],_=function(oA,tA,sA,gA){var iA=n2A(),aA=rke(),lA=tA?oA.generateAndInjectStyles(om,iA,aA):oA.generateAndInjectStyles(sA,iA,aA);return lA}(Q,x,V),q=R,$=X.$as||G.$as||X.as||G.as||K,nA=wK($),j=X!==G?ku({},G,{},X):G,O={};for(var eA in j)eA[0]!=="$"&&eA!=="as"&&(eA==="forwardedAs"?O.as=j[eA]:(N?N(eA,UJA,$):!nA||UJA(eA))&&(O[eA]=j[eA]));return G.style&&X.style!==G.style&&(O.style=ku({},G.style,{},X.style)),O.className=Array.prototype.concat(h,v,_!==v?_:null,G.className,X.className).filter(Boolean).join(" "),O.ref=q,p.createElement($,O)}(B,f,w,u)};return d.displayName=r,(B=b.forwardRef(d)).attrs=l,B.componentStyle=E,B.displayName=r,B.shouldForwardProp=c,B.foldedComponentIds=i?Array.prototype.concat(A.foldedComponentIds,A.styledComponentId):pK,B.styledComponentId=C,B.target=i?A.target:A,B.withComponent=function(f){var w=e.componentId,y=function(R,x){if(R==null)return{};var F,Q,k={},h=Object.keys(R);for(Q=0;Q<h.length;Q++)F=h[Q],x.indexOf(F)>=0||(k[F]=R[F]);return k}(e,["componentId"]),G=w&&w+"-"+(wK(f)?f:FAA(jJA(f)));return I2A(f,ku({},y,{attrs:l,componentId:G}),t)},Object.defineProperty(B,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(f){this._foldedDefaultProps=i?s2A({},A.defaultProps,f):f}}),Object.defineProperty(B,"toString",{value:function(){return"."+B.styledComponentId}}),n&&OJA(B,A,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),B}var LAA=function(A){return function e(t,i,n){if(n===void 0&&(n=om),!T1.isValidElementType(i))return O1(1,String(i));var o=function(){return t(i,n,Eke.apply(void 0,arguments))};return o.withConfig=function(g){return e(t,i,ku({},n,{},g))},o.attrs=function(g){return e(t,i,ku({},n,{attrs:Array.prototype.concat(n.attrs,g).filter(Boolean)}))},o}(I2A,A)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(A){LAA[A]=LAA(A)});const an=LAA;var DK={};/**
 * @license React
 * react-dom-server-legacy.browser.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 C2A=p,yke=bt;function Qe(A){var e="https://react.dev/errors/"+A;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+A+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l2A=Symbol.for("react.transitional.element"),c2A=Symbol.for("react.portal"),B2A=Symbol.for("react.fragment"),Q2A=Symbol.for("react.strict_mode"),E2A=Symbol.for("react.profiler"),u2A=Symbol.for("react.consumer"),GK=Symbol.for("react.context"),SAA=Symbol.for("react.forward_ref"),kK=Symbol.for("react.suspense"),HAA=Symbol.for("react.suspense_list"),ZAA=Symbol.for("react.memo"),JK=Symbol.for("react.lazy"),bke=Symbol.for("react.scope"),d2A=Symbol.for("react.activity"),wke=Symbol.for("react.legacy_hidden"),Dke=Symbol.for("react.memo_cache_sentinel"),Gke=Symbol.for("react.view_transition"),h2A=Symbol.iterator;function m2A(A){return A===null||typeof A!="object"?null:(A=h2A&&A[h2A]||A["@@iterator"],typeof A=="function"?A:null)}var NK=Array.isArray;function p2A(A,e){var t=A.length&3,i=A.length-t,n=e;for(e=0;e<i;){var o=A.charCodeAt(e)&255|(A.charCodeAt(++e)&255)<<8|(A.charCodeAt(++e)&255)<<16|(A.charCodeAt(++e)&255)<<24;++e,o=3432918353*(o&65535)+((3432918353*(o>>>16)&65535)<<16)&4294967295,o=o<<15|o>>>17,o=461845907*(o&65535)+((461845907*(o>>>16)&65535)<<16)&4294967295,n^=o,n=n<<13|n>>>19,n=5*(n&65535)+((5*(n>>>16)&65535)<<16)&4294967295,n=(n&65535)+27492+(((n>>>16)+58964&65535)<<16)}switch(o=0,t){case 3:o^=(A.charCodeAt(e+2)&255)<<16;case 2:o^=(A.charCodeAt(e+1)&255)<<8;case 1:o^=A.charCodeAt(e)&255,o=3432918353*(o&65535)+((3432918353*(o>>>16)&65535)<<16)&4294967295,o=o<<15|o>>>17,n^=461845907*(o&65535)+((461845907*(o>>>16)&65535)<<16)&4294967295}return n^=A.length,n^=n>>>16,n=2246822507*(n&65535)+((2246822507*(n>>>16)&65535)<<16)&4294967295,n^=n>>>13,n=3266489909*(n&65535)+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^n>>>16)>>>0}var $s=Object.assign,Fn=Object.prototype.hasOwnProperty,kke=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]*$"),f2A={},y2A={};function WAA(A){return Fn.call(y2A,A)?!0:Fn.call(f2A,A)?!1:kke.test(A)?y2A[A]=!0:(f2A[A]=!0,!1)}var Jke=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(" ")),Nke=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"]]),Yke=/["'&<>]/;function Rt(A){if(typeof A=="boolean"||typeof A=="number"||typeof A=="bigint")return""+A;A=""+A;var e=Yke.exec(A);if(e){var t="",i,n=0;for(i=e.index;i<A.length;i++){switch(A.charCodeAt(i)){case 34:e="&quot;";break;case 38:e="&amp;";break;case 39:e="&#x27;";break;case 60:e="&lt;";break;case 62:e="&gt;";break;default:continue}n!==i&&(t+=A.slice(n,i)),n=i+1,t+=e}A=n!==i?t+A.slice(n,i):t}return A}var Rke=/([A-Z])/g,xke=/^ms-/,Fke=/^[\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 j1(A){return Fke.test(""+A)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":A}var yG=C2A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,b2A=yke.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Mke={pending:!1,data:null,method:null,action:null},Ju=b2A.d;b2A.d={f:Ju.f,r:Ju.r,D:$ke,C:AJe,L:eJe,m:tJe,X:nJe,S:iJe,M:oJe};var GC=[],bG=null,w2A=/(<\/|<)(s)(cript)/gi;function D2A(A,e,t,i){return""+e+(t==="s"?"\\u0073":"\\u0053")+i}function vke(A,e,t,i,n){return{idPrefix:A===void 0?"":A,nextFormID:0,streamingFormat:0,bootstrapScriptContent:t,bootstrapScripts:i,bootstrapModules:n,instructions:0,hasBody:!1,hasHtml:!1,unknownResources:{},dnsResources:{},connectResources:{default:{},anonymous:{},credentials:{}},imageResources:{},styleResources:{},scriptResources:{},moduleUnknownResources:{},moduleScriptResources:{}}}function Kg(A,e,t,i){return{insertionMode:A,selectedValue:e,tagScope:t,viewTransition:i}}function G2A(A,e,t){var i=A.tagScope&-25;switch(e){case"noscript":return Kg(2,null,i|1,null);case"select":return Kg(2,t.value!=null?t.value:t.defaultValue,i,null);case"svg":return Kg(4,null,i,null);case"picture":return Kg(2,null,i|2,null);case"math":return Kg(5,null,i,null);case"foreignObject":return Kg(2,null,i,null);case"table":return Kg(6,null,i,null);case"thead":case"tbody":case"tfoot":return Kg(7,null,i,null);case"colgroup":return Kg(9,null,i,null);case"tr":return Kg(8,null,i,null);case"head":if(2>A.insertionMode)return Kg(3,null,i,null);break;case"html":if(A.insertionMode===0)return Kg(1,null,i,null)}return 6<=A.insertionMode||2>A.insertionMode?Kg(2,null,i,null):A.tagScope!==i?Kg(A.insertionMode,A.selectedValue,i,null):A}function k2A(A){return A===null?null:{update:A.update,enter:"none",exit:"none",share:A.update,name:A.autoName,autoName:A.autoName,nameIdx:0}}function KAA(A,e){return e.tagScope&32&&(A.instructions|=128),Kg(e.insertionMode,e.selectedValue,e.tagScope|12,k2A(e.viewTransition))}function YK(A,e){A=k2A(e.viewTransition);var t=e.tagScope|16;return A!==null&&A.share!=="none"&&(t|=64),Kg(e.insertionMode,e.selectedValue,t,A)}var J2A=new Map;function N2A(A,e){if(typeof e!="object")throw Error(Qe(62));var t=!0,i;for(i in e)if(Fn.call(e,i)){var n=e[i];if(n!=null&&typeof n!="boolean"&&n!==""){if(i.indexOf("--")===0){var o=Rt(i);n=Rt((""+n).trim())}else o=J2A.get(i),o===void 0&&(o=Rt(i.replace(Rke,"-$1").toLowerCase().replace(xke,"-ms-")),J2A.set(i,o)),n=typeof n=="number"?n===0||Jke.has(i)?""+n:n+"px":Rt((""+n).trim());t?(t=!1,A.push(' style="',o,":",n)):A.push(";",o,":",n)}}t||A.push('"')}function UAA(A,e,t){t&&typeof t!="function"&&typeof t!="symbol"&&A.push(" ",e,'=""')}function ha(A,e,t){typeof t!="function"&&typeof t!="symbol"&&typeof t!="boolean"&&A.push(" ",e,'="',Rt(t),'"')}var Y2A=Rt("javascript:throw new Error('React form unexpectedly submitted.')");function VAA(A,e){this.push('<input type="hidden"'),R2A(A),ha(this,"name",e),ha(this,"value",A),this.push("/>")}function R2A(A){if(typeof A!="string")throw Error(Qe(480))}function x2A(A,e){if(typeof e.$$FORM_ACTION=="function"){var t=A.nextFormID++;A=A.idPrefix+t;try{var i=e.$$FORM_ACTION(A);if(i){var n=i.data;n!=null&&n.forEach(R2A)}return i}catch(o){if(typeof o=="object"&&o!==null&&typeof o.then=="function")throw o}}return null}function F2A(A,e,t,i,n,o,g,a){var s=null;if(typeof i=="function"){var I=x2A(e,i);I!==null?(a=I.name,i=I.action||"",n=I.encType,o=I.method,g=I.target,s=I.data):(A.push(" ","formAction",'="',Y2A,'"'),g=o=n=i=a=null,M2A(e,t))}return a!=null&&Yi(A,"name",a),i!=null&&Yi(A,"formAction",i),n!=null&&Yi(A,"formEncType",n),o!=null&&Yi(A,"formMethod",o),g!=null&&Yi(A,"formTarget",g),s}function Yi(A,e,t){switch(e){case"className":ha(A,"class",t);break;case"tabIndex":ha(A,"tabindex",t);break;case"dir":case"role":case"viewBox":case"width":case"height":ha(A,e,t);break;case"style":N2A(A,t);break;case"src":case"href":if(t==="")break;case"action":case"formAction":if(t==null||typeof t=="function"||typeof t=="symbol"||typeof t=="boolean")break;t=j1(""+t),A.push(" ",e,'="',Rt(t),'"');break;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"autoFocus":case"multiple":case"muted":UAA(A,e.toLowerCase(),t);break;case"xlinkHref":if(typeof t=="function"||typeof t=="symbol"||typeof t=="boolean")break;t=j1(""+t),A.push(" ","xlink:href",'="',Rt(t),'"');break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":typeof t!="function"&&typeof t!="symbol"&&A.push(" ",e,'="',Rt(t),'"');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":t&&typeof t!="function"&&typeof t!="symbol"&&A.push(" ",e,'=""');break;case"capture":case"download":t===!0?A.push(" ",e,'=""'):t!==!1&&typeof t!="function"&&typeof t!="symbol"&&A.push(" ",e,'="',Rt(t),'"');break;case"cols":case"rows":case"size":case"span":typeof t!="function"&&typeof t!="symbol"&&!isNaN(t)&&1<=t&&A.push(" ",e,'="',Rt(t),'"');break;case"rowSpan":case"start":typeof t=="function"||typeof t=="symbol"||isNaN(t)||A.push(" ",e,'="',Rt(t),'"');break;case"xlinkActuate":ha(A,"xlink:actuate",t);break;case"xlinkArcrole":ha(A,"xlink:arcrole",t);break;case"xlinkRole":ha(A,"xlink:role",t);break;case"xlinkShow":ha(A,"xlink:show",t);break;case"xlinkTitle":ha(A,"xlink:title",t);break;case"xlinkType":ha(A,"xlink:type",t);break;case"xmlBase":ha(A,"xml:base",t);break;case"xmlLang":ha(A,"xml:lang",t);break;case"xmlSpace":ha(A,"xml:space",t);break;default:if((!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(e=Nke.get(e)||e,WAA(e))){switch(typeof t){case"function":case"symbol":return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-")return}A.push(" ",e,'="',Rt(t),'"')}}}function aI(A,e,t){if(e!=null){if(t!=null)throw Error(Qe(60));if(typeof e!="object"||!("__html"in e))throw Error(Qe(61));e=e.__html,e!=null&&A.push(""+e)}}function Lke(A){var e="";return C2A.Children.forEach(A,function(t){t!=null&&(e+=t)}),e}function M2A(A,e){if(!(A.instructions&16)){A.instructions|=16;var t=e.preamble,i=e.bootstrapChunks;(t.htmlChunks||t.headChunks)&&i.length===0?(i.push(e.startInlineScript),MK(i,A),i.push(">",`addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error('React form unexpectedly submitted.')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});`,"<\/script>")):i.unshift(e.startInlineScript,">",`addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error('React form unexpectedly submitted.')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});`,"<\/script>")}}function ma(A,e){A.push(Xo("link"));for(var t in e)if(Fn.call(e,t)){var i=e[t];if(i!=null)switch(t){case"children":case"dangerouslySetInnerHTML":throw Error(Qe(399,"link"));default:Yi(A,t,i)}}return A.push("/>"),null}var v2A=/(<\/|<)(s)(tyle)/gi;function L2A(A,e,t,i){return""+e+(t==="s"?"\\73 ":"\\53 ")+i}function wG(A,e,t){A.push(Xo(t));for(var i in e)if(Fn.call(e,i)){var n=e[i];if(n!=null)switch(i){case"children":case"dangerouslySetInnerHTML":throw Error(Qe(399,t));default:Yi(A,i,n)}}return A.push("/>"),null}function S2A(A,e){A.push(Xo("title"));var t=null,i=null,n;for(n in e)if(Fn.call(e,n)){var o=e[n];if(o!=null)switch(n){case"children":t=o;break;case"dangerouslySetInnerHTML":i=o;break;default:Yi(A,n,o)}}return A.push(">"),e=Array.isArray(t)?2>t.length?t[0]:null:t,typeof e!="function"&&typeof e!="symbol"&&e!==null&&e!==void 0&&A.push(Rt(""+e)),aI(A,i,t),A.push(ey("title")),null}function RK(A,e){A.push(Xo("script"));var t=null,i=null,n;for(n in e)if(Fn.call(e,n)){var o=e[n];if(o!=null)switch(n){case"children":t=o;break;case"dangerouslySetInnerHTML":i=o;break;default:Yi(A,n,o)}}return A.push(">"),aI(A,i,t),typeof t=="string"&&A.push((""+t).replace(w2A,D2A)),A.push(ey("script")),null}function XAA(A,e,t){A.push(Xo(t));var i=t=null,n;for(n in e)if(Fn.call(e,n)){var o=e[n];if(o!=null)switch(n){case"children":t=o;break;case"dangerouslySetInnerHTML":i=o;break;default:Yi(A,n,o)}}return A.push(">"),aI(A,i,t),t}function xK(A,e,t){A.push(Xo(t));var i=t=null,n;for(n in e)if(Fn.call(e,n)){var o=e[n];if(o!=null)switch(n){case"children":t=o;break;case"dangerouslySetInnerHTML":i=o;break;default:Yi(A,n,o)}}return A.push(">"),aI(A,i,t),typeof t=="string"?(A.push(Rt(t)),null):t}var Ske=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,H2A=new Map;function Xo(A){var e=H2A.get(A);if(e===void 0){if(!Ske.test(A))throw Error(Qe(65,A));e="<"+A,H2A.set(A,e)}return e}function Hke(A,e,t,i,n,o,g,a,s){switch(e){case"div":case"span":case"svg":case"path":break;case"a":A.push(Xo("a"));var I=null,r=null,C;for(C in t)if(Fn.call(t,C)){var l=t[C];if(l!=null)switch(C){case"children":I=l;break;case"dangerouslySetInnerHTML":r=l;break;case"href":l===""?ha(A,"href",""):Yi(A,C,l);break;default:Yi(A,C,l)}}if(A.push(">"),aI(A,r,I),typeof I=="string"){A.push(Rt(I));var c=null}else c=I;return c;case"g":case"p":case"li":break;case"select":A.push(Xo("select"));var B=null,E=null,u;for(u in t)if(Fn.call(t,u)){var d=t[u];if(d!=null)switch(u){case"children":B=d;break;case"dangerouslySetInnerHTML":E=d;break;case"defaultValue":case"value":break;default:Yi(A,u,d)}}return A.push(">"),aI(A,E,B),B;case"option":var f=a.selectedValue;A.push(Xo("option"));var w=null,y=null,G=null,R=null,x;for(x in t)if(Fn.call(t,x)){var F=t[x];if(F!=null)switch(x){case"children":w=F;break;case"selected":G=F;break;case"dangerouslySetInnerHTML":R=F;break;case"value":y=F;default:Yi(A,x,F)}}if(f!=null){var Q=y!==null?""+y:Lke(w);if(NK(f)){for(var k=0;k<f.length;k++)if(""+f[k]===Q){A.push(' selected=""');break}}else""+f===Q&&A.push(' selected=""')}else G&&A.push(' selected=""');return A.push(">"),aI(A,R,w),w;case"textarea":A.push(Xo("textarea"));var h=null,N=null,v=null,K;for(K in t)if(Fn.call(t,K)){var U=t[K];if(U!=null)switch(K){case"children":v=U;break;case"value":h=U;break;case"defaultValue":N=U;break;case"dangerouslySetInnerHTML":throw Error(Qe(91));default:Yi(A,K,U)}}if(h===null&&N!==null&&(h=N),A.push(">"),v!=null){if(h!=null)throw Error(Qe(92));if(NK(v)){if(1<v.length)throw Error(Qe(93));h=""+v[0]}h=""+v}return typeof h=="string"&&h[0]===`
`&&A.push(`
`),h!==null&&A.push(Rt(""+h)),null;case"input":A.push(Xo("input"));var V=null,X=null,_=null,q=null,$=null,nA=null,j=null,O=null,eA=null,oA;for(oA in t)if(Fn.call(t,oA)){var tA=t[oA];if(tA!=null)switch(oA){case"children":case"dangerouslySetInnerHTML":throw Error(Qe(399,"input"));case"name":V=tA;break;case"formAction":X=tA;break;case"formEncType":_=tA;break;case"formMethod":q=tA;break;case"formTarget":$=tA;break;case"defaultChecked":eA=tA;break;case"defaultValue":j=tA;break;case"checked":O=tA;break;case"value":nA=tA;break;default:Yi(A,oA,tA)}}var sA=F2A(A,i,n,X,_,q,$,V);return O!==null?UAA(A,"checked",O):eA!==null&&UAA(A,"checked",eA),nA!==null?Yi(A,"value",nA):j!==null&&Yi(A,"value",j),A.push("/>"),sA!=null&&sA.forEach(VAA,A),null;case"button":A.push(Xo("button"));var gA=null,iA=null,aA=null,lA=null,CA=null,QA=null,uA=null,fA;for(fA in t)if(Fn.call(t,fA)){var hA=t[fA];if(hA!=null)switch(fA){case"children":gA=hA;break;case"dangerouslySetInnerHTML":iA=hA;break;case"name":aA=hA;break;case"formAction":lA=hA;break;case"formEncType":CA=hA;break;case"formMethod":QA=hA;break;case"formTarget":uA=hA;break;default:Yi(A,fA,hA)}}var yA=F2A(A,i,n,lA,CA,QA,uA,aA);if(A.push(">"),yA!=null&&yA.forEach(VAA,A),aI(A,iA,gA),typeof gA=="string"){A.push(Rt(gA));var mA=null}else mA=gA;return mA;case"form":A.push(Xo("form"));var LA=null,UA=null,ne=null,SA=null,ae=null,EA=null,wA;for(wA in t)if(Fn.call(t,wA)){var se=t[wA];if(se!=null)switch(wA){case"children":LA=se;break;case"dangerouslySetInnerHTML":UA=se;break;case"action":ne=se;break;case"encType":SA=se;break;case"method":ae=se;break;case"target":EA=se;break;default:Yi(A,wA,se)}}var we=null,be=null;if(typeof ne=="function"){var Oe=x2A(i,ne);Oe!==null?(ne=Oe.action||"",SA=Oe.encType,ae=Oe.method,EA=Oe.target,we=Oe.data,be=Oe.name):(A.push(" ","action",'="',Y2A,'"'),EA=ae=SA=ne=null,M2A(i,n))}if(ne!=null&&Yi(A,"action",ne),SA!=null&&Yi(A,"encType",SA),ae!=null&&Yi(A,"method",ae),EA!=null&&Yi(A,"target",EA),A.push(">"),be!==null&&(A.push('<input type="hidden"'),ha(A,"name",be),A.push("/>"),we!=null&&we.forEach(VAA,A)),aI(A,UA,LA),typeof LA=="string"){A.push(Rt(LA));var VA=null}else VA=LA;return VA;case"menuitem":A.push(Xo("menuitem"));for(var ZA in t)if(Fn.call(t,ZA)){var le=t[ZA];if(le!=null)switch(ZA){case"children":case"dangerouslySetInnerHTML":throw Error(Qe(400));default:Yi(A,ZA,le)}}return A.push(">"),null;case"object":A.push(Xo("object"));var ce=null,de=null,rt;for(rt in t)if(Fn.call(t,rt)){var en=t[rt];if(en!=null)switch(rt){case"children":ce=en;break;case"dangerouslySetInnerHTML":de=en;break;case"data":var Ot=j1(""+en);if(Ot==="")break;A.push(" ","data",'="',Rt(Ot),'"');break;default:Yi(A,rt,en)}}if(A.push(">"),aI(A,de,ce),typeof ce=="string"){A.push(Rt(ce));var og=null}else og=ce;return og;case"title":var Oa=a.tagScope&1,hh=a.tagScope&4;if(a.insertionMode===4||Oa||t.itemProp!=null)var Ss=S2A(A,t);else hh?Ss=null:(S2A(n.hoistableChunks,t),Ss=void 0);return Ss;case"link":var kR=a.tagScope&1,iW=a.tagScope&4,nW=t.rel,gg=t.href,DB=t.precedence;if(a.insertionMode===4||kR||t.itemProp!=null||typeof nW!="string"||typeof gg!="string"||gg===""){ma(A,t);var sC=null}else if(t.rel==="stylesheet")if(typeof DB!="string"||t.disabled!=null||t.onLoad||t.onError)sC=ma(A,t);else{var Hs=n.styles.get(DB),rC=i.styleResources.hasOwnProperty(gg)?i.styleResources[gg]:void 0;if(rC!==null){i.styleResources[gg]=null,Hs||(Hs={precedence:Rt(DB),rules:[],hrefs:[],sheets:new Map},n.styles.set(DB,Hs));var GB={state:0,props:$s({},t,{"data-precedence":t.precedence,precedence:null})};if(rC){rC.length===2&&$1(GB.props,rC);var mh=n.preloads.stylesheets.get(gg);mh&&0<mh.length?mh.length=0:GB.state=1}Hs.sheets.set(gg,GB),g&&g.stylesheets.add(GB)}else if(Hs){var lD=Hs.sheets.get(gg);lD&&g&&g.stylesheets.add(lD)}s&&A.push("<!-- -->"),sC=null}else t.onLoad||t.onError?sC=ma(A,t):(s&&A.push("<!-- -->"),sC=iW?null:ma(n.hoistableChunks,t));return sC;case"script":var oW=a.tagScope&1,Rg=t.async;if(typeof t.src!="string"||!t.src||!Rg||typeof Rg=="function"||typeof Rg=="symbol"||t.onLoad||t.onError||a.insertionMode===4||oW||t.itemProp!=null)var he=RK(A,t);else{var vl=t.src;if(t.type==="module")var Ll=i.moduleScriptResources,df=n.preloads.moduleScripts;else Ll=i.scriptResources,df=n.preloads.scripts;var Sl=Ll.hasOwnProperty(vl)?Ll[vl]:void 0;if(Sl!==null){Ll[vl]=null;var kB=t;if(Sl){Sl.length===2&&(kB=$s({},t),$1(kB,Sl));var hf=df.get(vl);hf&&(hf.length=0)}var Hl=[];n.scripts.add(Hl),RK(Hl,kB)}s&&A.push("<!-- -->"),he=null}return he;case"style":var JR=a.tagScope&1,JB=t.precedence,Zs=t.href,gW=t.nonce;if(a.insertionMode===4||JR||t.itemProp!=null||typeof JB!="string"||typeof Zs!="string"||Zs===""){A.push(Xo("style"));var Ws=null,mf=null,IC;for(IC in t)if(Fn.call(t,IC)){var Xr=t[IC];if(Xr!=null)switch(IC){case"children":Ws=Xr;break;case"dangerouslySetInnerHTML":mf=Xr;break;default:Yi(A,IC,Xr)}}A.push(">");var CC=Array.isArray(Ws)?2>Ws.length?Ws[0]:null:Ws;typeof CC!="function"&&typeof CC!="symbol"&&CC!==null&&CC!==void 0&&A.push((""+CC).replace(v2A,L2A)),aI(A,mf,Ws),A.push(ey("style"));var cD=null}else{var la=n.styles.get(JB);if((i.styleResources.hasOwnProperty(Zs)?i.styleResources[Zs]:void 0)!==null){i.styleResources[Zs]=null,la||(la={precedence:Rt(JB),rules:[],hrefs:[],sheets:new Map},n.styles.set(JB,la));var BD=n.nonce.style;if(!BD||BD===gW){la.hrefs.push(Rt(Zs));var QD=la.rules,ca=null,NB=null,Zl;for(Zl in t)if(Fn.call(t,Zl)){var OE=t[Zl];if(OE!=null)switch(Zl){case"children":ca=OE;break;case"dangerouslySetInnerHTML":NB=OE}}var Ba=Array.isArray(ca)?2>ca.length?ca[0]:null:ca;typeof Ba!="function"&&typeof Ba!="symbol"&&Ba!==null&&Ba!==void 0&&QD.push((""+Ba).replace(v2A,L2A)),aI(QD,NB,ca)}}la&&g&&g.styles.add(la),s&&A.push("<!-- -->"),cD=void 0}return cD;case"meta":var Zt=a.tagScope&1,tn=a.tagScope&4;if(a.insertionMode===4||Zt||t.itemProp!=null)var qE=wG(A,t,"meta");else s&&A.push("<!-- -->"),qE=tn?null:typeof t.charSet=="string"?wG(n.charsetChunks,t,"meta"):t.name==="viewport"?wG(n.viewportChunks,t,"meta"):wG(n.hoistableChunks,t,"meta");return qE;case"listing":case"pre":A.push(Xo(e));var xg=null,Fg=null,Ks;for(Ks in t)if(Fn.call(t,Ks)){var Se=t[Ks];if(Se!=null)switch(Ks){case"children":xg=Se;break;case"dangerouslySetInnerHTML":Fg=Se;break;default:Yi(A,Ks,Se)}}if(A.push(">"),Fg!=null){if(xg!=null)throw Error(Qe(60));if(typeof Fg!="object"||!("__html"in Fg))throw Error(Qe(61));var Mt=Fg.__html;Mt!=null&&(typeof Mt=="string"&&0<Mt.length&&Mt[0]===`
`?A.push(`
`,Mt):A.push(""+Mt))}return typeof xg=="string"&&xg[0]===`
`&&A.push(`
`),xg;case"img":var ED=a.tagScope&3,kt=t.src,We=t.srcSet;if(!(t.loading==="lazy"||!kt&&!We||typeof kt!="string"&&kt!=null||typeof We!="string"&&We!=null||t.fetchPriority==="low"||ED)&&(typeof kt!="string"||kt[4]!==":"||kt[0]!=="d"&&kt[0]!=="D"||kt[1]!=="a"&&kt[1]!=="A"||kt[2]!=="t"&&kt[2]!=="T"||kt[3]!=="a"&&kt[3]!=="A")&&(typeof We!="string"||We[4]!==":"||We[0]!=="d"&&We[0]!=="D"||We[1]!=="a"&&We[1]!=="A"||We[2]!=="t"&&We[2]!=="T"||We[3]!=="a"&&We[3]!=="A")){g!==null&&a.tagScope&64&&(g.suspenseyImages=!0);var uD=typeof t.sizes=="string"?t.sizes:void 0,Mg=We?We+`
`+(uD||""):kt,Us=n.preloads.images,Wt=Us.get(Mg);if(Wt)(t.fetchPriority==="high"||10>n.highImagePreloads.size)&&(Us.delete(Mg),n.highImagePreloads.add(Wt));else if(!i.imageResources.hasOwnProperty(Mg)){i.imageResources[Mg]=GC;var Vs=t.crossOrigin,YB=typeof Vs=="string"?Vs==="use-credentials"?Vs:"":void 0,ko=n.headers,RB;ko&&0<ko.remainingCapacity&&typeof t.srcSet!="string"&&(t.fetchPriority==="high"||500>ko.highImagePreloads.length)&&(RB=vK(kt,"image",{imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:YB,integrity:t.integrity,nonce:t.nonce,type:t.type,fetchPriority:t.fetchPriority,referrerPolicy:t.refererPolicy}),0<=(ko.remainingCapacity-=RB.length+2))?(n.resets.image[Mg]=GC,ko.highImagePreloads&&(ko.highImagePreloads+=", "),ko.highImagePreloads+=RB):(Wt=[],ma(Wt,{rel:"preload",as:"image",href:We?void 0:kt,imageSrcSet:We,imageSizes:uD,crossOrigin:YB,integrity:t.integrity,type:t.type,fetchPriority:t.fetchPriority,referrerPolicy:t.referrerPolicy}),t.fetchPriority==="high"||10>n.highImagePreloads.size?n.highImagePreloads.add(Wt):(n.bulkPreloads.add(Wt),Us.set(Mg,Wt)))}}return wG(A,t,"img");case"base":case"area":case"br":case"col":case"embed":case"hr":case"keygen":case"param":case"source":case"track":case"wbr":return wG(A,t,e);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":break;case"head":if(2>a.insertionMode){var lC=o||n.preamble;if(lC.headChunks)throw Error(Qe(545,"`<head>`"));o!==null&&A.push("<!--head-->"),lC.headChunks=[];var ph=XAA(lC.headChunks,t,"head")}else ph=xK(A,t,"head");return ph;case"body":if(2>a.insertionMode){var xB=o||n.preamble;if(xB.bodyChunks)throw Error(Qe(545,"`<body>`"));o!==null&&A.push("<!--body-->"),xB.bodyChunks=[];var jE=XAA(xB.bodyChunks,t,"body")}else jE=xK(A,t,"body");return jE;case"html":if(a.insertionMode===0){var FB=o||n.preamble;if(FB.htmlChunks)throw Error(Qe(545,"`<html>`"));o!==null&&A.push("<!--html-->"),FB.htmlChunks=[""];var fh=XAA(FB.htmlChunks,t,"html")}else fh=xK(A,t,"html");return fh;default:if(e.indexOf("-")!==-1){A.push(Xo(e));var Wl=null,pf=null,Qa;for(Qa in t)if(Fn.call(t,Qa)){var Rn=t[Qa];if(Rn!=null){var Ke=Qa;switch(Qa){case"children":Wl=Rn;break;case"dangerouslySetInnerHTML":pf=Rn;break;case"style":N2A(A,Rn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"className":Ke="class";default:if(WAA(Qa)&&typeof Rn!="function"&&typeof Rn!="symbol"&&Rn!==!1){if(Rn===!0)Rn="";else if(typeof Rn=="object")continue;A.push(" ",Ke,'="',Rt(Rn),'"')}}}}return A.push(">"),aI(A,pf,Wl),Wl}}return xK(A,t,e)}var Z2A=new Map;function ey(A){var e=Z2A.get(A);return e===void 0&&(e="</"+A+">",Z2A.set(A,e)),e}function W2A(A,e){A=A.preamble,A.htmlChunks===null&&e.htmlChunks&&(A.htmlChunks=e.htmlChunks),A.headChunks===null&&e.headChunks&&(A.headChunks=e.headChunks),A.bodyChunks===null&&e.bodyChunks&&(A.bodyChunks=e.bodyChunks)}function K2A(A,e){e=e.bootstrapChunks;for(var t=0;t<e.length-1;t++)A.push(e[t]);return t<e.length?(t=e[t],e.length=0,A.push(t)):!0}function U2A(A,e,t){if(A.push('<!--$?--><template id="'),t===null)throw Error(Qe(395));return A.push(e.boundaryPrefix),e=t.toString(16),A.push(e),A.push('"></template>')}function Zke(A,e,t,i){switch(t.insertionMode){case 0:case 1:case 3:case 2:return A.push('<div hidden id="'),A.push(e.segmentPrefix),e=i.toString(16),A.push(e),A.push('">');case 4:return A.push('<svg aria-hidden="true" style="display:none" id="'),A.push(e.segmentPrefix),e=i.toString(16),A.push(e),A.push('">');case 5:return A.push('<math aria-hidden="true" style="display:none" id="'),A.push(e.segmentPrefix),e=i.toString(16),A.push(e),A.push('">');case 6:return A.push('<table hidden id="'),A.push(e.segmentPrefix),e=i.toString(16),A.push(e),A.push('">');case 7:return A.push('<table hidden><tbody id="'),A.push(e.segmentPrefix),e=i.toString(16),A.push(e),A.push('">');case 8:return A.push('<table hidden><tr id="'),A.push(e.segmentPrefix),e=i.toString(16),A.push(e),A.push('">');case 9:return A.push('<table hidden><colgroup id="'),A.push(e.segmentPrefix),e=i.toString(16),A.push(e),A.push('">');default:throw Error(Qe(397))}}function Wke(A,e){switch(e.insertionMode){case 0:case 1:case 3:case 2:return A.push("</div>");case 4:return A.push("</svg>");case 5:return A.push("</math>");case 6:return A.push("</table>");case 7:return A.push("</tbody></table>");case 8:return A.push("</tr></table>");case 9:return A.push("</colgroup></table>");default:throw Error(Qe(397))}}var Kke=/[<\u2028\u2029]/g;function Uke(A){return JSON.stringify(A).replace(Kke,function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var Vke=/[&><\u2028\u2029]/g;function P1(A){return JSON.stringify(A).replace(Vke,function(e){switch(e){case"&":return"\\u0026";case">":return"\\u003e";case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var FK=!1,zAA=!0;function Xke(A){var e=A.rules,t=A.hrefs,i=0;if(t.length){for(this.push(bG.startInlineStyle),this.push(' media="not all" data-precedence="'),this.push(A.precedence),this.push('" data-href="');i<t.length-1;i++)this.push(t[i]),this.push(" ");for(this.push(t[i]),this.push('">'),i=0;i<e.length;i++)this.push(e[i]);zAA=this.push("</style>"),FK=!0,e.length=0,t.length=0}}function zke(A){return A.state!==2?FK=!0:!1}function V2A(A,e,t){return FK=!1,zAA=!0,bG=t,e.styles.forEach(Xke,A),bG=null,e.stylesheets.forEach(zke),FK&&(t.stylesToHoist=!0),zAA}function $l(A){for(var e=0;e<A.length;e++)this.push(A[e]);A.length=0}var gm=[];function Tke(A){ma(gm,A.props);for(var e=0;e<gm.length;e++)this.push(gm[e]);gm.length=0,A.state=2}function _ke(A){var e=0<A.sheets.size;A.sheets.forEach(Tke,this),A.sheets.clear();var t=A.rules,i=A.hrefs;if(!e||i.length){if(this.push(bG.startInlineStyle),this.push(' data-precedence="'),this.push(A.precedence),A=0,i.length){for(this.push('" data-href="');A<i.length-1;A++)this.push(i[A]),this.push(" ");this.push(i[A])}for(this.push('">'),A=0;A<t.length;A++)this.push(t[A]);this.push("</style>"),t.length=0,i.length=0}}function Oke(A){if(A.state===0){A.state=1;var e=A.props;for(ma(gm,{rel:"preload",as:"style",href:A.props.href,crossOrigin:e.crossOrigin,fetchPriority:e.fetchPriority,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy}),A=0;A<gm.length;A++)this.push(gm[A]);gm.length=0}}function qke(A){A.sheets.forEach(Oke,this),A.sheets.clear()}function MK(A,e){!(e.instructions&32)&&(e.instructions|=32,A.push(' id="',Rt("_"+e.idPrefix+"R_"),'"'))}function jke(A,e){A.push("[");var t="[";e.stylesheets.forEach(function(i){if(i.state!==2)if(i.state===3)A.push(t),i=P1(""+i.props.href),A.push(i),A.push("]"),t=",[";else{A.push(t);var n=i.props["data-precedence"],o=i.props,g=j1(""+i.props.href);g=P1(g),A.push(g),n=""+n,A.push(","),n=P1(n),A.push(n);for(var a in o)if(Fn.call(o,a)&&(n=o[a],n!=null))switch(a){case"href":case"rel":case"precedence":case"data-precedence":break;case"children":case"dangerouslySetInnerHTML":throw Error(Qe(399,"link"));default:Pke(A,a,n)}A.push("]"),t=",[",i.state=3}}),A.push("]")}function Pke(A,e,t){var i=e.toLowerCase();switch(typeof t){case"function":case"symbol":return}switch(e){case"innerHTML":case"dangerouslySetInnerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"style":case"ref":return;case"className":i="class",e=""+t;break;case"hidden":if(t===!1)return;e="";break;case"src":case"href":t=j1(t),e=""+t;break;default:if(2<e.length&&(e[0]==="o"||e[0]==="O")&&(e[1]==="n"||e[1]==="N")||!WAA(e))return;e=""+t}A.push(","),i=P1(i),A.push(i),A.push(","),i=P1(e),A.push(i)}function TAA(){return{styles:new Set,stylesheets:new Set,suspenseyImages:!1}}function $ke(A){var e=Ug||null;if(e){var t=e.resumableState,i=e.renderState;if(typeof A=="string"&&A){if(!t.dnsResources.hasOwnProperty(A)){t.dnsResources[A]=null,t=i.headers;var n,o;(o=t&&0<t.remainingCapacity)&&(o=(n="<"+(""+A).replace(_AA,OAA)+">; rel=dns-prefetch",0<=(t.remainingCapacity-=n.length+2))),o?(i.resets.dns[A]=null,t.preconnects&&(t.preconnects+=", "),t.preconnects+=n):(n=[],ma(n,{href:A,rel:"dns-prefetch"}),i.preconnects.add(n))}oy(e)}}else Ju.D(A)}function AJe(A,e){var t=Ug||null;if(t){var i=t.resumableState,n=t.renderState;if(typeof A=="string"&&A){var o=e==="use-credentials"?"credentials":typeof e=="string"?"anonymous":"default";if(!i.connectResources[o].hasOwnProperty(A)){i.connectResources[o][A]=null,i=n.headers;var g,a;if(a=i&&0<i.remainingCapacity){if(a="<"+(""+A).replace(_AA,OAA)+">; rel=preconnect",typeof e=="string"){var s=(""+e).replace(qAA,jAA);a+='; crossorigin="'+s+'"'}a=(g=a,0<=(i.remainingCapacity-=g.length+2))}a?(n.resets.connect[o][A]=null,i.preconnects&&(i.preconnects+=", "),i.preconnects+=g):(o=[],ma(o,{rel:"preconnect",href:A,crossOrigin:e}),n.preconnects.add(o))}oy(t)}}else Ju.C(A,e)}function eJe(A,e,t){var i=Ug||null;if(i){var n=i.resumableState,o=i.renderState;if(e&&A){switch(e){case"image":if(t)var g=t.imageSrcSet,a=t.imageSizes,s=t.fetchPriority;var I=g?g+`
`+(a||""):A;if(n.imageResources.hasOwnProperty(I))return;n.imageResources[I]=GC,n=o.headers;var r;n&&0<n.remainingCapacity&&typeof g!="string"&&s==="high"&&(r=vK(A,e,t),0<=(n.remainingCapacity-=r.length+2))?(o.resets.image[I]=GC,n.highImagePreloads&&(n.highImagePreloads+=", "),n.highImagePreloads+=r):(n=[],ma(n,$s({rel:"preload",href:g?void 0:A,as:e},t)),s==="high"?o.highImagePreloads.add(n):(o.bulkPreloads.add(n),o.preloads.images.set(I,n)));break;case"style":if(n.styleResources.hasOwnProperty(A))return;g=[],ma(g,$s({rel:"preload",href:A,as:e},t)),n.styleResources[A]=!t||typeof t.crossOrigin!="string"&&typeof t.integrity!="string"?GC:[t.crossOrigin,t.integrity],o.preloads.stylesheets.set(A,g),o.bulkPreloads.add(g);break;case"script":if(n.scriptResources.hasOwnProperty(A))return;g=[],o.preloads.scripts.set(A,g),o.bulkPreloads.add(g),ma(g,$s({rel:"preload",href:A,as:e},t)),n.scriptResources[A]=!t||typeof t.crossOrigin!="string"&&typeof t.integrity!="string"?GC:[t.crossOrigin,t.integrity];break;default:if(n.unknownResources.hasOwnProperty(e)){if(g=n.unknownResources[e],g.hasOwnProperty(A))return}else g={},n.unknownResources[e]=g;if(g[A]=GC,(n=o.headers)&&0<n.remainingCapacity&&e==="font"&&(I=vK(A,e,t),0<=(n.remainingCapacity-=I.length+2)))o.resets.font[A]=GC,n.fontPreloads&&(n.fontPreloads+=", "),n.fontPreloads+=I;else switch(n=[],A=$s({rel:"preload",href:A,as:e},t),ma(n,A),e){case"font":o.fontPreloads.add(n);break;default:o.bulkPreloads.add(n)}}oy(i)}}else Ju.L(A,e,t)}function tJe(A,e){var t=Ug||null;if(t){var i=t.resumableState,n=t.renderState;if(A){var o=e&&typeof e.as=="string"?e.as:"script";switch(o){case"script":if(i.moduleScriptResources.hasOwnProperty(A))return;o=[],i.moduleScriptResources[A]=!e||typeof e.crossOrigin!="string"&&typeof e.integrity!="string"?GC:[e.crossOrigin,e.integrity],n.preloads.moduleScripts.set(A,o);break;default:if(i.moduleUnknownResources.hasOwnProperty(o)){var g=i.unknownResources[o];if(g.hasOwnProperty(A))return}else g={},i.moduleUnknownResources[o]=g;o=[],g[A]=GC}ma(o,$s({rel:"modulepreload",href:A},e)),n.bulkPreloads.add(o),oy(t)}}else Ju.m(A,e)}function iJe(A,e,t){var i=Ug||null;if(i){var n=i.resumableState,o=i.renderState;if(A){e=e||"default";var g=o.styles.get(e),a=n.styleResources.hasOwnProperty(A)?n.styleResources[A]:void 0;a!==null&&(n.styleResources[A]=null,g||(g={precedence:Rt(e),rules:[],hrefs:[],sheets:new Map},o.styles.set(e,g)),e={state:0,props:$s({rel:"stylesheet",href:A,"data-precedence":e},t)},a&&(a.length===2&&$1(e.props,a),(o=o.preloads.stylesheets.get(A))&&0<o.length?o.length=0:e.state=1),g.sheets.set(A,e),oy(i))}}else Ju.S(A,e,t)}function nJe(A,e){var t=Ug||null;if(t){var i=t.resumableState,n=t.renderState;if(A){var o=i.scriptResources.hasOwnProperty(A)?i.scriptResources[A]:void 0;o!==null&&(i.scriptResources[A]=null,e=$s({src:A,async:!0},e),o&&(o.length===2&&$1(e,o),A=n.preloads.scripts.get(A))&&(A.length=0),A=[],n.scripts.add(A),RK(A,e),oy(t))}}else Ju.X(A,e)}function oJe(A,e){var t=Ug||null;if(t){var i=t.resumableState,n=t.renderState;if(A){var o=i.moduleScriptResources.hasOwnProperty(A)?i.moduleScriptResources[A]:void 0;o!==null&&(i.moduleScriptResources[A]=null,e=$s({src:A,type:"module",async:!0},e),o&&(o.length===2&&$1(e,o),A=n.preloads.moduleScripts.get(A))&&(A.length=0),A=[],n.scripts.add(A),RK(A,e),oy(t))}}else Ju.M(A,e)}function $1(A,e){A.crossOrigin==null&&(A.crossOrigin=e[0]),A.integrity==null&&(A.integrity=e[1])}function vK(A,e,t){A=(""+A).replace(_AA,OAA),e=(""+e).replace(qAA,jAA),e="<"+A+'>; rel=preload; as="'+e+'"';for(var i in t)Fn.call(t,i)&&(A=t[i],typeof A=="string"&&(e+="; "+i.toLowerCase()+'="'+(""+A).replace(qAA,jAA)+'"'));return e}var _AA=/[<>\r\n]/g;function OAA(A){switch(A){case"<":return"%3C";case">":return"%3E";case`
`:return"%0A";case"\r":return"%0D";default:throw Error("escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}var qAA=/["';,\r\n]/g;function jAA(A){switch(A){case'"':return"%22";case"'":return"%27";case";":return"%3B";case",":return"%2C";case`
`:return"%0A";case"\r":return"%0D";default:throw Error("escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}function gJe(A){this.styles.add(A)}function aJe(A){this.stylesheets.add(A)}function DG(A,e){e.styles.forEach(gJe,A),e.stylesheets.forEach(aJe,A),e.suspenseyImages&&(A.suspenseyImages=!0)}function sJe(A,e){var t=A.idPrefix,i=[],n=A.bootstrapScriptContent,o=A.bootstrapScripts,g=A.bootstrapModules;n!==void 0&&(i.push("<script"),MK(i,A),i.push(">",(""+n).replace(w2A,D2A),"<\/script>")),n=t+"P:";var a=t+"S:";t+="B:";var s=new Set,I=new Set,r=new Set,C=new Map,l=new Set,c=new Set,B=new Set,E={images:new Map,stylesheets:new Map,scripts:new Map,moduleScripts:new Map};if(o!==void 0)for(var u=0;u<o.length;u++){var d=o[u],f,w=void 0,y=void 0,G={rel:"preload",as:"script",fetchPriority:"low",nonce:void 0};typeof d=="string"?G.href=f=d:(G.href=f=d.src,G.integrity=y=typeof d.integrity=="string"?d.integrity:void 0,G.crossOrigin=w=typeof d=="string"||d.crossOrigin==null?void 0:d.crossOrigin==="use-credentials"?"use-credentials":""),d=A;var R=f;d.scriptResources[R]=null,d.moduleScriptResources[R]=null,d=[],ma(d,G),l.add(d),i.push('<script src="',Rt(f),'"'),typeof y=="string"&&i.push(' integrity="',Rt(y),'"'),typeof w=="string"&&i.push(' crossorigin="',Rt(w),'"'),MK(i,A),i.push(' async=""><\/script>')}if(g!==void 0)for(o=0;o<g.length;o++)G=g[o],w=f=void 0,y={rel:"modulepreload",fetchPriority:"low",nonce:void 0},typeof G=="string"?y.href=u=G:(y.href=u=G.src,y.integrity=w=typeof G.integrity=="string"?G.integrity:void 0,y.crossOrigin=f=typeof G=="string"||G.crossOrigin==null?void 0:G.crossOrigin==="use-credentials"?"use-credentials":""),G=A,d=u,G.scriptResources[d]=null,G.moduleScriptResources[d]=null,G=[],ma(G,y),l.add(G),i.push('<script type="module" src="',Rt(u),'"'),typeof w=="string"&&i.push(' integrity="',Rt(w),'"'),typeof f=="string"&&i.push(' crossorigin="',Rt(f),'"'),MK(i,A),i.push(' async=""><\/script>');return{placeholderPrefix:n,segmentPrefix:a,boundaryPrefix:t,startInlineScript:"<script",startInlineStyle:"<style",preamble:{htmlChunks:null,headChunks:null,bodyChunks:null},externalRuntimeScript:null,bootstrapChunks:i,importMapChunks:[],onHeaders:void 0,headers:null,resets:{font:{},dns:{},connect:{default:{},anonymous:{},credentials:{}},image:{},style:{}},charsetChunks:[],viewportChunks:[],hoistableChunks:[],preconnects:s,fontPreloads:I,highImagePreloads:r,styles:C,bootstrapScripts:l,scripts:c,bulkPreloads:B,preloads:E,nonce:{script:void 0,style:void 0},stylesToHoist:!1,generateStaticMarkup:e}}function X2A(A,e,t,i){return t.generateStaticMarkup?(A.push(Rt(e)),!1):(e===""?A=i:(i&&A.push("<!-- -->"),A.push(Rt(e)),A=!0),A)}function Ax(A,e,t,i){e.generateStaticMarkup||t&&i&&A.push("<!-- -->")}var rJe=Function.prototype.bind,IJe=Symbol.for("react.client.reference");function LK(A){if(A==null)return null;if(typeof A=="function")return A.$$typeof===IJe?null:A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case B2A:return"Fragment";case E2A:return"Profiler";case Q2A:return"StrictMode";case kK:return"Suspense";case HAA:return"SuspenseList";case d2A:return"Activity"}if(typeof A=="object")switch(A.$$typeof){case c2A:return"Portal";case GK:return A.displayName||"Context";case u2A:return(A._context.displayName||"Context")+".Consumer";case SAA:var e=A.render;return A=A.displayName,A||(A=e.displayName||e.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case ZAA:return e=A.displayName||null,e!==null?e:LK(A.type)||"Memo";case JK:e=A._payload,A=A._init;try{return LK(A(e))}catch{}}return null}var z2A={},ty=null;function SK(A,e){if(A!==e){A.context._currentValue2=A.parentValue,A=A.parent;var t=e.parent;if(A===null){if(t!==null)throw Error(Qe(401))}else{if(t===null)throw Error(Qe(401));SK(A,t)}e.context._currentValue2=e.value}}function T2A(A){A.context._currentValue2=A.parentValue,A=A.parent,A!==null&&T2A(A)}function _2A(A){var e=A.parent;e!==null&&_2A(e),A.context._currentValue2=A.value}function O2A(A,e){if(A.context._currentValue2=A.parentValue,A=A.parent,A===null)throw Error(Qe(402));A.depth===e.depth?SK(A,e):O2A(A,e)}function q2A(A,e){var t=e.parent;if(t===null)throw Error(Qe(402));A.depth===t.depth?SK(A,t):q2A(A,t),e.context._currentValue2=e.value}function am(A){var e=ty;e!==A&&(e===null?_2A(A):A===null?T2A(e):e.depth===A.depth?SK(e,A):e.depth>A.depth?O2A(e,A):q2A(e,A),ty=A)}var j2A={enqueueSetState:function(A,e){A=A._reactInternals,A.queue!==null&&A.queue.push(e)},enqueueReplaceState:function(A,e){A=A._reactInternals,A.replace=!0,A.queue=[e]},enqueueForceUpdate:function(){}},CJe={id:1,overflow:""};function iy(A,e,t){var i=A.id;A=A.overflow;var n=32-HK(i)-1;i&=~(1<<n),t+=1;var o=32-HK(e)+n;if(30<o){var g=n-n%5;return o=(i&(1<<g)-1).toString(32),i>>=g,n-=g,{id:1<<32-HK(e)+n|t<<n|i,overflow:o+A}}return{id:1<<o|t<<n|i,overflow:A}}var HK=Math.clz32?Math.clz32:BJe,lJe=Math.log,cJe=Math.LN2;function BJe(A){return A>>>=0,A===0?32:31-(lJe(A)/cJe|0)|0}function $a(){}var sI=Error(Qe(460));function QJe(A,e,t){switch(t=A[t],t===void 0?A.push(e):t!==e&&(e.then($a,$a),e=t),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then($a,$a):(A=e,A.status="pending",A.then(function(i){if(e.status==="pending"){var n=e;n.status="fulfilled",n.value=i}},function(i){if(e.status==="pending"){var n=e;n.status="rejected",n.reason=i}})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}throw ZK=e,sI}}var ZK=null;function WK(){if(ZK===null)throw Error(Qe(459));var A=ZK;return ZK=null,A}function EJe(A,e){return A===e&&(A!==0||1/A===1/e)||A!==A&&e!==e}var uJe=typeof Object.is=="function"?Object.is:EJe,Nu=null,PAA=null,$AA=null,AeA=null,KK=null,sn=null,ex=!1,UK=!1,tx=0,ix=0,nx=-1,VK=0,GG=null,sm=null,XK=0;function Yu(){if(Nu===null)throw Error(Qe(321));return Nu}function P2A(){if(0<XK)throw Error(Qe(312));return{memoizedState:null,queue:null,next:null}}function eeA(){return sn===null?KK===null?(ex=!1,KK=sn=P2A()):(ex=!0,sn=KK):sn.next===null?(ex=!1,sn=sn.next=P2A()):(ex=!0,sn=sn.next),sn}function kG(){var A=GG;return GG=null,A}function ox(){AeA=$AA=PAA=Nu=null,UK=!1,KK=null,XK=0,sn=sm=null}function $2A(A,e){return typeof e=="function"?e(A):e}function ANA(A,e,t){if(Nu=Yu(),sn=eeA(),ex){var i=sn.queue;if(e=i.dispatch,sm!==null&&(t=sm.get(i),t!==void 0)){sm.delete(i),i=sn.memoizedState;do i=A(i,t.action),t=t.next;while(t!==null);return sn.memoizedState=i,[i,e]}return[sn.memoizedState,e]}return A=A===$2A?typeof e=="function"?e():e:t!==void 0?t(e):e,sn.memoizedState=A,A=sn.queue={last:null,dispatch:null},A=A.dispatch=dJe.bind(null,Nu,A),[sn.memoizedState,A]}function eNA(A,e){if(Nu=Yu(),sn=eeA(),e=e===void 0?null:e,sn!==null){var t=sn.memoizedState;if(t!==null&&e!==null){var i=t[1];A:if(i===null)i=!1;else{for(var n=0;n<i.length&&n<e.length;n++)if(!uJe(e[n],i[n])){i=!1;break A}i=!0}if(i)return t[0]}}return A=A(),sn.memoizedState=[A,e],A}function dJe(A,e,t){if(25<=XK)throw Error(Qe(301));if(A===Nu)if(UK=!0,A={action:t,next:null},sm===null&&(sm=new Map),t=sm.get(e),t===void 0)sm.set(e,A);else{for(e=t;e.next!==null;)e=e.next;e.next=A}}function hJe(){throw Error(Qe(440))}function mJe(){throw Error(Qe(394))}function pJe(){throw Error(Qe(479))}function tNA(A,e,t){Yu();var i=ix++,n=$AA;if(typeof A.$$FORM_ACTION=="function"){var o=null,g=AeA;n=n.formState;var a=A.$$IS_SIGNATURE_EQUAL;if(n!==null&&typeof a=="function"){var s=n[1];a.call(A,n[2],n[3])&&(o=t!==void 0?"p"+t:"k"+p2A(JSON.stringify([g,null,i]),0),s===o&&(nx=i,e=n[0]))}var I=A.bind(null,e);return A=function(C){I(C)},typeof I.$$FORM_ACTION=="function"&&(A.$$FORM_ACTION=function(C){C=I.$$FORM_ACTION(C),t!==void 0&&(t+="",C.action=t);var l=C.data;return l&&(o===null&&(o=t!==void 0?"p"+t:"k"+p2A(JSON.stringify([g,null,i]),0)),l.append("$ACTION_KEY",o)),C}),[e,A,!1]}var r=A.bind(null,e);return[e,function(C){r(C)},!1]}function iNA(A){var e=VK;return VK+=1,GG===null&&(GG=[]),QJe(GG,A,e)}function fJe(){throw Error(Qe(393))}var nNA={readContext:function(A){return A._currentValue2},use:function(A){if(A!==null&&typeof A=="object"){if(typeof A.then=="function")return iNA(A);if(A.$$typeof===GK)return A._currentValue2}throw Error(Qe(438,String(A)))},useContext:function(A){return Yu(),A._currentValue2},useMemo:eNA,useReducer:ANA,useRef:function(A){Nu=Yu(),sn=eeA();var e=sn.memoizedState;return e===null?(A={current:A},sn.memoizedState=A):e},useState:function(A){return ANA($2A,A)},useInsertionEffect:$a,useLayoutEffect:$a,useCallback:function(A,e){return eNA(function(){return A},e)},useImperativeHandle:$a,useEffect:$a,useDebugValue:$a,useDeferredValue:function(A,e){return Yu(),e!==void 0?e:A},useTransition:function(){return Yu(),[!1,mJe]},useId:function(){var A=PAA.treeContext,e=A.overflow;A=A.id,A=(A&~(1<<32-HK(A)-1)).toString(32)+e;var t=zK;if(t===null)throw Error(Qe(404));return e=tx++,A="_"+t.idPrefix+"R_"+A,0<e&&(A+="H"+e.toString(32)),A+"_"},useSyncExternalStore:function(A,e,t){if(t===void 0)throw Error(Qe(407));return t()},useOptimistic:function(A){return Yu(),[A,pJe]},useActionState:tNA,useFormState:tNA,useHostTransitionStatus:function(){return Yu(),Mke},useMemoCache:function(A){for(var e=Array(A),t=0;t<A;t++)e[t]=Dke;return e},useCacheRefresh:function(){return fJe},useEffectEvent:function(){return hJe}},zK=null,yJe={getCacheForType:function(){throw Error(Qe(248))},cacheSignal:function(){throw Error(Qe(248))}},teA,oNA;function JG(A){if(teA===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);teA=e&&e[1]||"",oNA=-1<t.stack.indexOf(`
    at`)?" (<anonymous>)":-1<t.stack.indexOf("@")?"@unknown:0:0":""}return`
`+teA+A+oNA}var ieA=!1;function TK(A,e){if(!A||ieA)return"";ieA=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(c){var l=c}Reflect.construct(A,[],C)}else{try{C.call()}catch(c){l=c}A.call(C.prototype)}}else{try{throw Error()}catch(c){l=c}(C=A())&&typeof C.catch=="function"&&C.catch(function(){})}}catch(c){if(c&&l&&typeof c.stack=="string")return[c.stack,l.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),g=o[0],a=o[1];if(g&&a){var s=g.split(`
`),I=a.split(`
`);for(n=i=0;i<s.length&&!s[i].includes("DetermineComponentFrameRoot");)i++;for(;n<I.length&&!I[n].includes("DetermineComponentFrameRoot");)n++;if(i===s.length||n===I.length)for(i=s.length-1,n=I.length-1;1<=i&&0<=n&&s[i]!==I[n];)n--;for(;1<=i&&0<=n;i--,n--)if(s[i]!==I[n]){if(i!==1||n!==1)do if(i--,n--,0>n||s[i]!==I[n]){var r=`
`+s[i].replace(" at new "," at ");return A.displayName&&r.includes("<anonymous>")&&(r=r.replace("<anonymous>",A.displayName)),r}while(1<=i&&0<=n);break}}}finally{ieA=!1,Error.prepareStackTrace=t}return(t=A?A.displayName||A.name:"")?JG(t):""}function gNA(A){if(typeof A=="string")return JG(A);if(typeof A=="function")return A.prototype&&A.prototype.isReactComponent?TK(A,!0):TK(A,!1);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case SAA:return TK(A.render,!1);case ZAA:return TK(A.type,!1);case JK:var e=A,t=e._payload;e=e._init;try{A=e(t)}catch{return JG("Lazy")}return gNA(A)}if(typeof A.name=="string"){A:{t=A.name,e=A.env;var i=A.debugLocation;if(i!=null&&(A=Error.prepareStackTrace,Error.prepareStackTrace=void 0,i=i.stack,Error.prepareStackTrace=A,i.startsWith(`Error: react-stack-top-frame
`)&&(i=i.slice(29)),A=i.indexOf(`
`),A!==-1&&(i=i.slice(A+1)),A=i.indexOf("react_stack_bottom_frame"),A!==-1&&(A=i.lastIndexOf(`
`,A)),A=A!==-1?i=i.slice(0,A):"",i=A.lastIndexOf(`
`),A=i===-1?A:A.slice(i+1),A.indexOf(t)!==-1)){t=`
`+A;break A}t=JG(t+(e?" ["+e+"]":""))}return t}}switch(A){case HAA:return JG("SuspenseList");case kK:return JG("Suspense")}return""}function NG(A,e){return(500<e.byteSize||!1)&&e.contentPreamble===null}function bJe(A){if(typeof A=="object"&&A!==null&&typeof A.environmentName=="string"){var e=A.environmentName;A=[A].slice(0),typeof A[0]=="string"?A.splice(0,1,"[%s] "+A[0]," "+e+" "):A.splice(0,0,"[%s]"," "+e+" "),A.unshift(console),e=rJe.apply(console.error,A),e()}else console.error(A);return null}function wJe(A,e,t,i,n,o,g,a,s,I,r){var C=new Set;this.destination=null,this.flushScheduled=!1,this.resumableState=A,this.renderState=e,this.rootFormatContext=t,this.progressiveChunkSize=i===void 0?12800:i,this.status=10,this.fatalError=null,this.pendingRootTasks=this.allPendingTasks=this.nextSegmentId=0,this.completedPreambleSegments=this.completedRootSegment=null,this.byteSize=0,this.abortableTasks=C,this.pingedTasks=[],this.clientRenderedBoundaries=[],this.completedBoundaries=[],this.partialBoundaries=[],this.trackedPostpones=null,this.onError=n===void 0?bJe:n,this.onPostpone=I===void 0?$a:I,this.onAllReady=o===void 0?$a:o,this.onShellReady=g===void 0?$a:g,this.onShellError=a===void 0?$a:a,this.onFatalError=s===void 0?$a:s,this.formState=r===void 0?null:r}function DJe(A,e,t,i,n,o,g,a,s,I,r,C){return e=new wJe(e,t,i,n,o,g,a,s,I,r,C),t=ny(e,0,null,i,!1,!1),t.parentFlushed=!0,A=_K(e,null,A,-1,null,t,null,null,e.abortableTasks,null,i,null,CJe,null,null),gx(A),e.pingedTasks.push(A),e}var Ug=null;function aNA(A,e){A.pingedTasks.push(e),A.pingedTasks.length===1&&(A.flushScheduled=A.destination!==null,QNA(A))}function neA(A,e,t,i,n){return t={status:0,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,row:e,completedSegments:[],byteSize:0,fallbackAbortableTasks:t,errorDigest:null,contentState:TAA(),fallbackState:TAA(),contentPreamble:i,fallbackPreamble:n,trackedContentKeyPath:null,trackedFallbackNode:null},e!==null&&(e.pendingTasks++,i=e.boundaries,i!==null&&(A.allPendingTasks++,t.pendingTasks++,i.push(t)),A=e.inheritedHoistables,A!==null&&DG(t.contentState,A)),t}function _K(A,e,t,i,n,o,g,a,s,I,r,C,l,c,B){A.allPendingTasks++,n===null?A.pendingRootTasks++:n.pendingTasks++,c!==null&&c.pendingTasks++;var E={replay:null,node:t,childIndex:i,ping:function(){return aNA(A,E)},blockedBoundary:n,blockedSegment:o,blockedPreamble:g,hoistableState:a,abortSet:s,keyPath:I,formatContext:r,context:C,treeContext:l,row:c,componentStack:B,thenableState:e};return s.add(E),E}function sNA(A,e,t,i,n,o,g,a,s,I,r,C,l,c){A.allPendingTasks++,o===null?A.pendingRootTasks++:o.pendingTasks++,l!==null&&l.pendingTasks++,t.pendingTasks++;var B={replay:t,node:i,childIndex:n,ping:function(){return aNA(A,B)},blockedBoundary:o,blockedSegment:null,blockedPreamble:null,hoistableState:g,abortSet:a,keyPath:s,formatContext:I,context:r,treeContext:C,row:l,componentStack:c,thenableState:e};return a.add(B),B}function ny(A,e,t,i,n,o){return{status:0,parentFlushed:!1,id:-1,index:e,chunks:[],children:[],preambleChildren:[],parentFormatContext:i,boundary:t,lastPushedText:n,textEmbedded:o}}function gx(A){var e=A.node;if(typeof e=="object"&&e!==null)switch(e.$$typeof){case l2A:A.componentStack={parent:A.componentStack,type:e.type}}}function oeA(A){return A===null?null:{parent:A.parent,type:"Suspense Fallback"}}function rm(A){var e={};return A&&Object.defineProperty(e,"componentStack",{configurable:!0,enumerable:!0,get:function(){try{var t="",i=A;do t+=gNA(i.type),i=i.parent;while(i);var n=t}catch(o){n=`
Error generating stack: `+o.message+`
`+o.stack}return Object.defineProperty(e,"componentStack",{value:n}),n}}),e}function pa(A,e,t){if(A=A.onError,e=A(e,t),e==null||typeof e=="string")return e}function ax(A,e){var t=A.onShellError,i=A.onFatalError;t(e),i(e),A.destination!==null?(A.status=14,A.destination.destroy(e)):(A.status=13,A.fatalError=e)}function fa(A,e){geA(A,e.next,e.hoistables)}function geA(A,e,t){for(;e!==null;){t!==null&&(DG(e.hoistables,t),e.inheritedHoistables=t);var i=e.boundaries;if(i!==null){e.boundaries=null;for(var n=0;n<i.length;n++){var o=i[n];t!==null&&DG(o.contentState,t),Im(A,o,null,null)}}if(e.pendingTasks--,0<e.pendingTasks)break;t=e.hoistables,e=e.next}}function aeA(A,e){var t=e.boundaries;if(t!==null&&e.pendingTasks===t.length){for(var i=!0,n=0;n<t.length;n++){var o=t[n];if(o.pendingTasks!==1||o.parentFlushed||NG(A,o)){i=!1;break}}i&&geA(A,e,e.hoistables)}}function sx(A){var e={pendingTasks:1,boundaries:null,hoistables:TAA(),inheritedHoistables:null,together:!1,next:null};return A!==null&&0<A.pendingTasks&&(e.pendingTasks++,e.boundaries=[],A.next=e),e}function rNA(A,e,t,i,n){var o=e.keyPath,g=e.treeContext,a=e.row;e.keyPath=t,t=i.length;var s=null;if(e.replay!==null){var I=e.replay.slots;if(I!==null&&typeof I=="object")for(var r=0;r<t;r++){var C=n!=="backwards"&&n!=="unstable_legacy-backwards"?r:t-1-r,l=i[C];e.row=s=sx(s),e.treeContext=iy(g,t,C);var c=I[C];typeof c=="number"?(qK(A,e,c,l,C),delete I[C]):Cg(A,e,l,C),--s.pendingTasks===0&&fa(A,s)}else for(I=0;I<t;I++)r=n!=="backwards"&&n!=="unstable_legacy-backwards"?I:t-1-I,C=i[r],e.row=s=sx(s),e.treeContext=iy(g,t,r),Cg(A,e,C,r),--s.pendingTasks===0&&fa(A,s)}else if(n!=="backwards"&&n!=="unstable_legacy-backwards")for(n=0;n<t;n++)I=i[n],e.row=s=sx(s),e.treeContext=iy(g,t,n),Cg(A,e,I,n),--s.pendingTasks===0&&fa(A,s);else{for(n=e.blockedSegment,I=n.children.length,r=n.chunks.length,C=t-1;0<=C;C--){l=i[C],e.row=s=sx(s),e.treeContext=iy(g,t,C),c=ny(A,r,null,e.formatContext,C===0?n.lastPushedText:!0,!0),n.children.splice(I,0,c),e.blockedSegment=c;try{Cg(A,e,l,C),Ax(c.chunks,A.renderState,c.lastPushedText,c.textEmbedded),c.status=1,--s.pendingTasks===0&&fa(A,s)}catch(B){throw c.status=A.status===12?3:4,B}}e.blockedSegment=n,n.lastPushedText=!1}a!==null&&s!==null&&0<s.pendingTasks&&(a.pendingTasks++,s.next=a),e.treeContext=g,e.row=a,e.keyPath=o}function INA(A,e,t,i,n,o){var g=e.thenableState;for(e.thenableState=null,Nu={},PAA=e,$AA=A,AeA=t,ix=tx=0,nx=-1,VK=0,GG=g,A=i(n,o);UK;)UK=!1,ix=tx=0,nx=-1,VK=0,XK+=1,sn=null,A=i(n,o);return ox(),A}function CNA(A,e,t,i,n,o,g){var a=!1;if(o!==0&&A.formState!==null){var s=e.blockedSegment;if(s!==null){a=!0,s=s.chunks;for(var I=0;I<o;I++)I===g?s.push("<!--F!-->"):s.push("<!--F-->")}}o=e.keyPath,e.keyPath=t,n?(t=e.treeContext,e.treeContext=iy(t,1,0),Cg(A,e,i,-1),e.treeContext=t):a?Cg(A,e,i,-1):kC(A,e,i,-1),e.keyPath=o}function OK(A,e,t,i,n,o){if(typeof i=="function")if(i.prototype&&i.prototype.isReactComponent){var g=n;if("ref"in n){g={};for(var a in n)a!=="ref"&&(g[a]=n[a])}var s=i.defaultProps;if(s){g===n&&(g=$s({},g,n));for(var I in s)g[I]===void 0&&(g[I]=s[I])}n=g,g=z2A,s=i.contextType,typeof s=="object"&&s!==null&&(g=s._currentValue2),g=new i(n,g);var r=g.state!==void 0?g.state:null;if(g.updater=j2A,g.props=n,g.state=r,s={queue:[],replace:!1},g._reactInternals=s,o=i.contextType,g.context=typeof o=="object"&&o!==null?o._currentValue2:z2A,o=i.getDerivedStateFromProps,typeof o=="function"&&(o=o(n,r),r=o==null?r:$s({},r,o),g.state=r),typeof i.getDerivedStateFromProps!="function"&&typeof g.getSnapshotBeforeUpdate!="function"&&(typeof g.UNSAFE_componentWillMount=="function"||typeof g.componentWillMount=="function"))if(i=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),i!==g.state&&j2A.enqueueReplaceState(g,g.state,null),s.queue!==null&&0<s.queue.length)if(i=s.queue,o=s.replace,s.queue=null,s.replace=!1,o&&i.length===1)g.state=i[0];else{for(s=o?i[0]:g.state,r=!0,o=o?1:0;o<i.length;o++)I=i[o],I=typeof I=="function"?I.call(g,s,n,void 0):I,I!=null&&(r?(r=!1,s=$s({},s,I)):$s(s,I));g.state=s}else s.queue=null;if(i=g.render(),A.status===12)throw null;n=e.keyPath,e.keyPath=t,kC(A,e,i,-1),e.keyPath=n}else{if(i=INA(A,e,t,i,n,void 0),A.status===12)throw null;CNA(A,e,t,i,tx!==0,ix,nx)}else if(typeof i=="string")if(g=e.blockedSegment,g===null)g=n.children,s=e.formatContext,r=e.keyPath,e.formatContext=G2A(s,i,n),e.keyPath=t,Cg(A,e,g,-1),e.formatContext=s,e.keyPath=r;else{if(r=Hke(g.chunks,i,n,A.resumableState,A.renderState,e.blockedPreamble,e.hoistableState,e.formatContext,g.lastPushedText),g.lastPushedText=!1,s=e.formatContext,o=e.keyPath,e.keyPath=t,(e.formatContext=G2A(s,i,n)).insertionMode===3){t=ny(A,0,null,e.formatContext,!1,!1),g.preambleChildren.push(t),e.blockedSegment=t;try{t.status=6,Cg(A,e,r,-1),Ax(t.chunks,A.renderState,t.lastPushedText,t.textEmbedded),t.status=1}finally{e.blockedSegment=g}}else Cg(A,e,r,-1);e.formatContext=s,e.keyPath=o;A:{switch(e=g.chunks,A=A.resumableState,i){case"title":case"style":case"script":case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break A;case"body":if(1>=s.insertionMode){A.hasBody=!0;break A}break;case"html":if(s.insertionMode===0){A.hasHtml=!0;break A}break;case"head":if(1>=s.insertionMode)break A}e.push(ey(i))}g.lastPushedText=!1}else{switch(i){case wke:case Q2A:case E2A:case B2A:i=e.keyPath,e.keyPath=t,kC(A,e,n.children,-1),e.keyPath=i;return;case d2A:i=e.blockedSegment,i===null?n.mode!=="hidden"&&(i=e.keyPath,e.keyPath=t,Cg(A,e,n.children,-1),e.keyPath=i):n.mode!=="hidden"&&(A.renderState.generateStaticMarkup||i.chunks.push("<!--&-->"),i.lastPushedText=!1,g=e.keyPath,e.keyPath=t,Cg(A,e,n.children,-1),e.keyPath=g,A.renderState.generateStaticMarkup||i.chunks.push("<!--/&-->"),i.lastPushedText=!1);return;case HAA:A:{if(i=n.children,n=n.revealOrder,n==="forwards"||n==="backwards"||n==="unstable_legacy-backwards"){if(NK(i)){rNA(A,e,t,i,n);break A}if((g=m2A(i))&&(g=g.call(i))){if(s=g.next(),!s.done){do s=g.next();while(!s.done);rNA(A,e,t,i,n)}break A}}n==="together"?(n=e.keyPath,g=e.row,s=e.row=sx(null),s.boundaries=[],s.together=!0,e.keyPath=t,kC(A,e,i,-1),--s.pendingTasks===0&&fa(A,s),e.keyPath=n,e.row=g,g!==null&&0<s.pendingTasks&&(g.pendingTasks++,s.next=g)):(n=e.keyPath,e.keyPath=t,kC(A,e,i,-1),e.keyPath=n)}return;case Gke:case bke:throw Error(Qe(343));case kK:A:if(e.replay!==null){i=e.keyPath,g=e.formatContext,s=e.row,e.keyPath=t,e.formatContext=YK(A.resumableState,g),e.row=null,t=n.children;try{Cg(A,e,t,-1)}finally{e.keyPath=i,e.formatContext=g,e.row=s}}else{i=e.keyPath,o=e.formatContext;var C=e.row,l=e.blockedBoundary;I=e.blockedPreamble;var c=e.hoistableState;a=e.blockedSegment;var B=n.fallback;n=n.children;var E=new Set,u=neA(A,e.row,E,null,null);A.trackedPostpones!==null&&(u.trackedContentKeyPath=t);var d=ny(A,a.chunks.length,u,e.formatContext,!1,!1);a.children.push(d),a.lastPushedText=!1;var f=ny(A,0,null,e.formatContext,!1,!1);if(f.parentFlushed=!0,A.trackedPostpones!==null){g=e.componentStack,s=[t[0],"Suspense Fallback",t[2]],r=[s[1],s[2],[],null],A.trackedPostpones.workingMap.set(s,r),u.trackedFallbackNode=r,e.blockedSegment=d,e.blockedPreamble=u.fallbackPreamble,e.keyPath=s,e.formatContext=KAA(A.resumableState,o),e.componentStack=oeA(g),d.status=6;try{Cg(A,e,B,-1),Ax(d.chunks,A.renderState,d.lastPushedText,d.textEmbedded),d.status=1}catch(w){throw d.status=A.status===12?3:4,w}finally{e.blockedSegment=a,e.blockedPreamble=I,e.keyPath=i,e.formatContext=o}e=_K(A,null,n,-1,u,f,u.contentPreamble,u.contentState,e.abortSet,t,YK(A.resumableState,e.formatContext),e.context,e.treeContext,null,g),gx(e),A.pingedTasks.push(e)}else{e.blockedBoundary=u,e.blockedPreamble=u.contentPreamble,e.hoistableState=u.contentState,e.blockedSegment=f,e.keyPath=t,e.formatContext=YK(A.resumableState,o),e.row=null,f.status=6;try{if(Cg(A,e,n,-1),Ax(f.chunks,A.renderState,f.lastPushedText,f.textEmbedded),f.status=1,Ix(u,f),u.pendingTasks===0&&u.status===0){if(u.status=1,!NG(A,u)){C!==null&&--C.pendingTasks===0&&fa(A,C),A.pendingRootTasks===0&&e.blockedPreamble&&Cx(A);break A}}else C!==null&&C.together&&aeA(A,C)}catch(w){u.status=4,A.status===12?(f.status=3,g=A.fatalError):(f.status=4,g=w),s=rm(e.componentStack),r=pa(A,g,s),u.errorDigest=r,CeA(A,u)}finally{e.blockedBoundary=l,e.blockedPreamble=I,e.hoistableState=c,e.blockedSegment=a,e.keyPath=i,e.formatContext=o,e.row=C}e=_K(A,null,B,-1,l,d,u.fallbackPreamble,u.fallbackState,E,[t[0],"Suspense Fallback",t[2]],KAA(A.resumableState,e.formatContext),e.context,e.treeContext,e.row,oeA(e.componentStack)),gx(e),A.pingedTasks.push(e)}}return}if(typeof i=="object"&&i!==null)switch(i.$$typeof){case SAA:if("ref"in n)for(B in g={},n)B!=="ref"&&(g[B]=n[B]);else g=n;i=INA(A,e,t,i.render,g,o),CNA(A,e,t,i,tx!==0,ix,nx);return;case ZAA:OK(A,e,t,i.type,n,o);return;case GK:if(s=n.children,g=e.keyPath,n=n.value,r=i._currentValue2,i._currentValue2=n,o=ty,ty=i={parent:o,depth:o===null?0:o.depth+1,context:i,parentValue:r,value:n},e.context=i,e.keyPath=t,kC(A,e,s,-1),A=ty,A===null)throw Error(Qe(403));A.context._currentValue2=A.parentValue,A=ty=A.parent,e.context=A,e.keyPath=g;return;case u2A:n=n.children,i=n(i._context._currentValue2),n=e.keyPath,e.keyPath=t,kC(A,e,i,-1),e.keyPath=n;return;case JK:if(g=i._init,i=g(i._payload),A.status===12)throw null;OK(A,e,t,i,n,o);return}throw Error(Qe(130,i==null?i:typeof i,""))}}function qK(A,e,t,i,n){var o=e.replay,g=e.blockedBoundary,a=ny(A,0,null,e.formatContext,!1,!1);a.id=t,a.parentFlushed=!0;try{e.replay=null,e.blockedSegment=a,Cg(A,e,i,n),a.status=1,g===null?A.completedRootSegment=a:(Ix(g,a),g.parentFlushed&&A.partialBoundaries.push(g))}finally{e.replay=o,e.blockedSegment=null}}function kC(A,e,t,i){e.replay!==null&&typeof e.replay.slots=="number"?qK(A,e,e.replay.slots,t,i):(e.node=t,e.childIndex=i,t=e.componentStack,gx(e),seA(A,e),e.componentStack=t)}function seA(A,e){var t=e.node,i=e.childIndex;if(t!==null){if(typeof t=="object"){switch(t.$$typeof){case l2A:var n=t.type,o=t.key,g=t.props;t=g.ref;var a=t!==void 0?t:null,s=LK(n),I=o??(i===-1?0:i);if(o=[e.keyPath,s,I],e.replay!==null)A:{var r=e.replay;for(i=r.nodes,t=0;t<i.length;t++){var C=i[t];if(I===C[1]){if(C.length===4){if(s!==null&&s!==C[0])throw Error(Qe(490,C[0],s));var l=C[2];s=C[3],I=e.node,e.replay={nodes:l,slots:s,pendingTasks:1};try{if(OK(A,e,o,n,g,a),e.replay.pendingTasks===1&&0<e.replay.nodes.length)throw Error(Qe(488));e.replay.pendingTasks--}catch(R){if(typeof R=="object"&&R!==null&&(R===sI||typeof R.then=="function"))throw e.node===I?e.replay=r:i.splice(t,1),R;e.replay.pendingTasks--,g=rm(e.componentStack),o=A,A=e.blockedBoundary,n=R,g=pa(o,n,g),rx(o,A,l,s,n,g)}e.replay=r}else{if(n!==kK)throw Error(Qe(490,"Suspense",LK(n)||"Unknown"));e:{r=void 0,n=C[5],a=C[2],s=C[3],I=C[4]===null?[]:C[4][2],C=C[4]===null?null:C[4][3];var c=e.keyPath,B=e.formatContext,E=e.row,u=e.replay,d=e.blockedBoundary,f=e.hoistableState,w=g.children,y=g.fallback,G=new Set;g=neA(A,e.row,G,null,null),g.parentFlushed=!0,g.rootSegmentID=n,e.blockedBoundary=g,e.hoistableState=g.contentState,e.keyPath=o,e.formatContext=YK(A.resumableState,B),e.row=null,e.replay={nodes:a,slots:s,pendingTasks:1};try{if(Cg(A,e,w,-1),e.replay.pendingTasks===1&&0<e.replay.nodes.length)throw Error(Qe(488));if(e.replay.pendingTasks--,g.pendingTasks===0&&g.status===0){g.status=1,A.completedBoundaries.push(g);break e}}catch(R){g.status=4,l=rm(e.componentStack),r=pa(A,R,l),g.errorDigest=r,e.replay.pendingTasks--,A.clientRenderedBoundaries.push(g)}finally{e.blockedBoundary=d,e.hoistableState=f,e.replay=u,e.keyPath=c,e.formatContext=B,e.row=E}l=sNA(A,null,{nodes:I,slots:C,pendingTasks:0},y,-1,d,g.fallbackState,G,[o[0],"Suspense Fallback",o[2]],KAA(A.resumableState,e.formatContext),e.context,e.treeContext,e.row,oeA(e.componentStack)),gx(l),A.pingedTasks.push(l)}}i.splice(t,1);break A}}}else OK(A,e,o,n,g,a);return;case c2A:throw Error(Qe(257));case JK:if(l=t._init,t=l(t._payload),A.status===12)throw null;kC(A,e,t,i);return}if(NK(t)){reA(A,e,t,i);return}if((l=m2A(t))&&(l=l.call(t))){if(t=l.next(),!t.done){g=[];do g.push(t.value),t=l.next();while(!t.done);reA(A,e,g,i)}return}if(typeof t.then=="function")return e.thenableState=null,kC(A,e,iNA(t),i);if(t.$$typeof===GK)return kC(A,e,t._currentValue2,i);throw i=Object.prototype.toString.call(t),Error(Qe(31,i==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":i))}typeof t=="string"?(i=e.blockedSegment,i!==null&&(i.lastPushedText=X2A(i.chunks,t,A.renderState,i.lastPushedText))):(typeof t=="number"||typeof t=="bigint")&&(i=e.blockedSegment,i!==null&&(i.lastPushedText=X2A(i.chunks,""+t,A.renderState,i.lastPushedText)))}}function reA(A,e,t,i){var n=e.keyPath;if(i!==-1&&(e.keyPath=[e.keyPath,"Fragment",i],e.replay!==null)){for(var o=e.replay,g=o.nodes,a=0;a<g.length;a++){var s=g[a];if(s[1]===i){i=s[2],s=s[3],e.replay={nodes:i,slots:s,pendingTasks:1};try{if(reA(A,e,t,-1),e.replay.pendingTasks===1&&0<e.replay.nodes.length)throw Error(Qe(488));e.replay.pendingTasks--}catch(C){if(typeof C=="object"&&C!==null&&(C===sI||typeof C.then=="function"))throw C;e.replay.pendingTasks--,t=rm(e.componentStack);var I=e.blockedBoundary,r=C;t=pa(A,r,t),rx(A,I,i,s,r,t)}e.replay=o,g.splice(a,1);break}}e.keyPath=n;return}if(o=e.treeContext,g=t.length,e.replay!==null&&(a=e.replay.slots,a!==null&&typeof a=="object")){for(i=0;i<g;i++)s=t[i],e.treeContext=iy(o,g,i),I=a[i],typeof I=="number"?(qK(A,e,I,s,i),delete a[i]):Cg(A,e,s,i);e.treeContext=o,e.keyPath=n;return}for(a=0;a<g;a++)i=t[a],e.treeContext=iy(o,g,a),Cg(A,e,i,a);e.treeContext=o,e.keyPath=n}function lNA(A,e,t){if(t.status=5,t.rootSegmentID=A.nextSegmentId++,A=t.trackedContentKeyPath,A===null)throw Error(Qe(486));var i=t.trackedFallbackNode,n=[],o=e.workingMap.get(A);return o===void 0?(t=[A[1],A[2],n,null,i,t.rootSegmentID],e.workingMap.set(A,t),eU(t,A[0],e),t):(o[4]=i,o[5]=t.rootSegmentID,o)}function IeA(A,e,t,i){i.status=5;var n=t.keyPath,o=t.blockedBoundary;if(o===null)i.id=A.nextSegmentId++,e.rootSlots=i.id,A.completedRootSegment!==null&&(A.completedRootSegment.status=5);else{if(o!==null&&o.status===0){var g=lNA(A,e,o);if(o.trackedContentKeyPath===n&&t.childIndex===-1){i.id===-1&&(i.id=i.parentFlushed?o.rootSegmentID:A.nextSegmentId++),g[3]=i.id;return}}if(i.id===-1&&(i.id=i.parentFlushed&&o!==null?o.rootSegmentID:A.nextSegmentId++),t.childIndex===-1)n===null?e.rootSlots=i.id:(t=e.workingMap.get(n),t===void 0?(t=[n[1],n[2],[],i.id],eU(t,n[0],e)):t[3]=i.id);else{if(n===null){if(A=e.rootSlots,A===null)A=e.rootSlots={};else if(typeof A=="number")throw Error(Qe(491))}else if(o=e.workingMap,g=o.get(n),g===void 0)A={},g=[n[1],n[2],[],A],o.set(n,g),eU(g,n[0],e);else if(A=g[3],A===null)A=g[3]={};else if(typeof A=="number")throw Error(Qe(491));A[t.childIndex]=i.id}}}function CeA(A,e){A=A.trackedPostpones,A!==null&&(e=e.trackedContentKeyPath,e!==null&&(e=A.workingMap.get(e),e!==void 0&&(e.length=4,e[2]=[],e[3]=null)))}function cNA(A,e,t){return sNA(A,t,e.replay,e.node,e.childIndex,e.blockedBoundary,e.hoistableState,e.abortSet,e.keyPath,e.formatContext,e.context,e.treeContext,e.row,e.componentStack)}function BNA(A,e,t){var i=e.blockedSegment,n=ny(A,i.chunks.length,null,e.formatContext,i.lastPushedText,!0);return i.children.push(n),i.lastPushedText=!1,_K(A,t,e.node,e.childIndex,e.blockedBoundary,n,e.blockedPreamble,e.hoistableState,e.abortSet,e.keyPath,e.formatContext,e.context,e.treeContext,e.row,e.componentStack)}function Cg(A,e,t,i){var n=e.formatContext,o=e.context,g=e.keyPath,a=e.treeContext,s=e.componentStack,I=e.blockedSegment;if(I===null){I=e.replay;try{return kC(A,e,t,i)}catch(l){if(ox(),t=l===sI?WK():l,A.status!==12&&typeof t=="object"&&t!==null){if(typeof t.then=="function"){i=l===sI?kG():null,A=cNA(A,e,i).ping,t.then(A,A),e.formatContext=n,e.context=o,e.keyPath=g,e.treeContext=a,e.componentStack=s,e.replay=I,am(o);return}if(t.message==="Maximum call stack size exceeded"){t=l===sI?kG():null,t=cNA(A,e,t),A.pingedTasks.push(t),e.formatContext=n,e.context=o,e.keyPath=g,e.treeContext=a,e.componentStack=s,e.replay=I,am(o);return}}}}else{var r=I.children.length,C=I.chunks.length;try{return kC(A,e,t,i)}catch(l){if(ox(),I.children.length=r,I.chunks.length=C,t=l===sI?WK():l,A.status!==12&&typeof t=="object"&&t!==null){if(typeof t.then=="function"){I=t,t=l===sI?kG():null,A=BNA(A,e,t).ping,I.then(A,A),e.formatContext=n,e.context=o,e.keyPath=g,e.treeContext=a,e.componentStack=s,am(o);return}if(t.message==="Maximum call stack size exceeded"){I=l===sI?kG():null,I=BNA(A,e,I),A.pingedTasks.push(I),e.formatContext=n,e.context=o,e.keyPath=g,e.treeContext=a,e.componentStack=s,am(o);return}}}}throw e.formatContext=n,e.context=o,e.keyPath=g,e.treeContext=a,am(o),t}function GJe(A){var e=A.blockedBoundary,t=A.blockedSegment;t!==null&&(t.status=3,Im(this,e,A.row,t))}function rx(A,e,t,i,n,o){for(var g=0;g<t.length;g++){var a=t[g];if(a.length===4)rx(A,e,a[2],a[3],n,o);else{a=a[5];var s=A,I=o,r=neA(s,null,new Set,null,null);r.parentFlushed=!0,r.rootSegmentID=a,r.status=4,r.errorDigest=I,r.parentFlushed&&s.clientRenderedBoundaries.push(r)}}if(t.length=0,i!==null){if(e===null)throw Error(Qe(487));if(e.status!==4&&(e.status=4,e.errorDigest=o,e.parentFlushed&&A.clientRenderedBoundaries.push(e)),typeof i=="object")for(var C in i)delete i[C]}}function leA(A,e,t){var i=A.blockedBoundary,n=A.blockedSegment;if(n!==null){if(n.status===6)return;n.status=3}var o=rm(A.componentStack);if(i===null){if(e.status!==13&&e.status!==14){if(i=A.replay,i===null){e.trackedPostpones!==null&&n!==null?(i=e.trackedPostpones,pa(e,t,o),IeA(e,i,A,n),Im(e,null,A.row,n)):(pa(e,t,o),ax(e,t));return}i.pendingTasks--,i.pendingTasks===0&&0<i.nodes.length&&(n=pa(e,t,o),rx(e,null,i.nodes,i.slots,t,n)),e.pendingRootTasks--,e.pendingRootTasks===0&&BeA(e)}}else{var g=e.trackedPostpones;if(i.status!==4){if(g!==null&&n!==null)return pa(e,t,o),IeA(e,g,A,n),i.fallbackAbortableTasks.forEach(function(a){return leA(a,e,t)}),i.fallbackAbortableTasks.clear(),Im(e,i,A.row,n);i.status=4,n=pa(e,t,o),i.status=4,i.errorDigest=n,CeA(e,i),i.parentFlushed&&e.clientRenderedBoundaries.push(i)}i.pendingTasks--,n=i.row,n!==null&&--n.pendingTasks===0&&fa(e,n),i.fallbackAbortableTasks.forEach(function(a){return leA(a,e,t)}),i.fallbackAbortableTasks.clear()}A=A.row,A!==null&&--A.pendingTasks===0&&fa(e,A),e.allPendingTasks--,e.allPendingTasks===0&&jK(e)}function ceA(A,e){try{var t=A.renderState,i=t.onHeaders;if(i){var n=t.headers;if(n){t.headers=null;var o=n.preconnects;if(n.fontPreloads&&(o&&(o+=", "),o+=n.fontPreloads),n.highImagePreloads&&(o&&(o+=", "),o+=n.highImagePreloads),!e){var g=t.styles.values(),a=g.next();A:for(;0<n.remainingCapacity&&!a.done;a=g.next())for(var s=a.value.sheets.values(),I=s.next();0<n.remainingCapacity&&!I.done;I=s.next()){var r=I.value,C=r.props,l=C.href,c=r.props,B=vK(c.href,"style",{crossOrigin:c.crossOrigin,integrity:c.integrity,nonce:c.nonce,type:c.type,fetchPriority:c.fetchPriority,referrerPolicy:c.referrerPolicy,media:c.media});if(0<=(n.remainingCapacity-=B.length+2))t.resets.style[l]=GC,o&&(o+=", "),o+=B,t.resets.style[l]=typeof C.crossOrigin=="string"||typeof C.integrity=="string"?[C.crossOrigin,C.integrity]:GC;else break A}}i(o?{Link:o}:{})}}}catch(E){pa(A,E,{})}}function BeA(A){A.trackedPostpones===null&&ceA(A,!0),A.trackedPostpones===null&&Cx(A),A.onShellError=$a,A=A.onShellReady,A()}function jK(A){ceA(A,A.trackedPostpones===null?!0:A.completedRootSegment===null||A.completedRootSegment.status!==5),Cx(A),A=A.onAllReady,A()}function Ix(A,e){if(e.chunks.length===0&&e.children.length===1&&e.children[0].boundary===null&&e.children[0].id===-1){var t=e.children[0];t.id=e.id,t.parentFlushed=!0,t.status!==1&&t.status!==3&&t.status!==4||Ix(A,t)}else A.completedSegments.push(e)}function Im(A,e,t,i){if(t!==null&&(--t.pendingTasks===0?fa(A,t):t.together&&aeA(A,t)),A.allPendingTasks--,e===null){if(i!==null&&i.parentFlushed){if(A.completedRootSegment!==null)throw Error(Qe(389));A.completedRootSegment=i}A.pendingRootTasks--,A.pendingRootTasks===0&&BeA(A)}else if(e.pendingTasks--,e.status!==4)if(e.pendingTasks===0){if(e.status===0&&(e.status=1),i!==null&&i.parentFlushed&&(i.status===1||i.status===3)&&Ix(e,i),e.parentFlushed&&A.completedBoundaries.push(e),e.status===1)t=e.row,t!==null&&DG(t.hoistables,e.contentState),NG(A,e)||(e.fallbackAbortableTasks.forEach(GJe,A),e.fallbackAbortableTasks.clear(),t!==null&&--t.pendingTasks===0&&fa(A,t)),A.pendingRootTasks===0&&A.trackedPostpones===null&&e.contentPreamble!==null&&Cx(A);else if(e.status===5&&(e=e.row,e!==null)){if(A.trackedPostpones!==null){t=A.trackedPostpones;var n=e.next;if(n!==null&&(i=n.boundaries,i!==null))for(n.boundaries=null,n=0;n<i.length;n++){var o=i[n];lNA(A,t,o),Im(A,o,null,null)}}--e.pendingTasks===0&&fa(A,e)}}else i===null||!i.parentFlushed||i.status!==1&&i.status!==3||(Ix(e,i),e.completedSegments.length===1&&e.parentFlushed&&A.partialBoundaries.push(e)),e=e.row,e!==null&&e.together&&aeA(A,e);A.allPendingTasks===0&&jK(A)}function QNA(A){if(A.status!==14&&A.status!==13){var e=ty,t=yG.H;yG.H=nNA;var i=yG.A;yG.A=yJe;var n=Ug;Ug=A;var o=zK;zK=A.resumableState;try{var g=A.pingedTasks,a;for(a=0;a<g.length;a++){var s=g[a],I=A,r=s.blockedSegment;if(r===null){var C=I;if(s.replay.pendingTasks!==0){am(s.context);try{if(typeof s.replay.slots=="number"?qK(C,s,s.replay.slots,s.node,s.childIndex):seA(C,s),s.replay.pendingTasks===1&&0<s.replay.nodes.length)throw Error(Qe(488));s.replay.pendingTasks--,s.abortSet.delete(s),Im(C,s.blockedBoundary,s.row,null)}catch(K){ox();var l=K===sI?WK():K;if(typeof l=="object"&&l!==null&&typeof l.then=="function"){var c=s.ping;l.then(c,c),s.thenableState=K===sI?kG():null}else{s.replay.pendingTasks--,s.abortSet.delete(s);var B=rm(s.componentStack);I=void 0;var E=C,u=s.blockedBoundary,d=C.status===12?C.fatalError:l,f=s.replay.nodes,w=s.replay.slots;I=pa(E,d,B),rx(E,u,f,w,d,I),C.pendingRootTasks--,C.pendingRootTasks===0&&BeA(C),C.allPendingTasks--,C.allPendingTasks===0&&jK(C)}}finally{}}}else if(C=void 0,E=r,E.status===0){E.status=6,am(s.context);var y=E.children.length,G=E.chunks.length;try{seA(I,s),Ax(E.chunks,I.renderState,E.lastPushedText,E.textEmbedded),s.abortSet.delete(s),E.status=1,Im(I,s.blockedBoundary,s.row,E)}catch(K){ox(),E.children.length=y,E.chunks.length=G;var R=K===sI?WK():I.status===12?I.fatalError:K;if(I.status===12&&I.trackedPostpones!==null){var x=I.trackedPostpones,F=rm(s.componentStack);s.abortSet.delete(s),pa(I,R,F),IeA(I,x,s,E),Im(I,s.blockedBoundary,s.row,E)}else if(typeof R=="object"&&R!==null&&typeof R.then=="function"){E.status=0,s.thenableState=K===sI?kG():null;var Q=s.ping;R.then(Q,Q)}else{var k=rm(s.componentStack);s.abortSet.delete(s),E.status=4;var h=s.blockedBoundary,N=s.row;if(N!==null&&--N.pendingTasks===0&&fa(I,N),I.allPendingTasks--,C=pa(I,R,k),h===null)ax(I,R);else if(h.pendingTasks--,h.status!==4){h.status=4,h.errorDigest=C,CeA(I,h);var v=h.row;v!==null&&--v.pendingTasks===0&&fa(I,v),h.parentFlushed&&I.clientRenderedBoundaries.push(h),I.pendingRootTasks===0&&I.trackedPostpones===null&&h.contentPreamble!==null&&Cx(I)}I.allPendingTasks===0&&jK(I)}}finally{}}}g.splice(0,a),A.destination!==null&&AU(A,A.destination)}catch(K){pa(A,K,{}),ax(A,K)}finally{zK=o,yG.H=t,yG.A=i,t===nNA&&am(e),Ug=n}}}function QeA(A,e,t){e.preambleChildren.length&&t.push(e.preambleChildren);for(var i=!1,n=0;n<e.children.length;n++)i=ENA(A,e.children[n],t)||i;return i}function ENA(A,e,t){var i=e.boundary;if(i===null)return QeA(A,e,t);var n=i.contentPreamble,o=i.fallbackPreamble;if(n===null||o===null)return!1;switch(i.status){case 1:if(W2A(A.renderState,n),A.byteSize+=i.byteSize,e=i.completedSegments[0],!e)throw Error(Qe(391));return QeA(A,e,t);case 5:if(A.trackedPostpones!==null)return!0;case 4:if(e.status===1)return W2A(A.renderState,o),QeA(A,e,t);default:return!0}}function Cx(A){if(A.completedRootSegment&&A.completedPreambleSegments===null){var e=[],t=A.byteSize,i=ENA(A,A.completedRootSegment,e),n=A.renderState.preamble;i===!1||n.headChunks&&n.bodyChunks?A.completedPreambleSegments=e:A.byteSize=t}}function PK(A,e,t,i){switch(t.parentFlushed=!0,t.status){case 0:t.id=A.nextSegmentId++;case 5:return i=t.id,t.lastPushedText=!1,t.textEmbedded=!1,A=A.renderState,e.push('<template id="'),e.push(A.placeholderPrefix),A=i.toString(16),e.push(A),e.push('"></template>');case 1:t.status=2;var n=!0,o=t.chunks,g=0;t=t.children;for(var a=0;a<t.length;a++){for(n=t[a];g<n.index;g++)e.push(o[g]);n=cx(A,e,n,i)}for(;g<o.length-1;g++)e.push(o[g]);return g<o.length&&(n=e.push(o[g])),n;case 3:return!0;default:throw Error(Qe(390))}}var lx=0;function cx(A,e,t,i){var n=t.boundary;if(n===null)return PK(A,e,t,i);if(n.parentFlushed=!0,n.status===4){var o=n.row;return o!==null&&--o.pendingTasks===0&&fa(A,o),A.renderState.generateStaticMarkup||(n=n.errorDigest,e.push("<!--$!-->"),e.push("<template"),n&&(e.push(' data-dgst="'),n=Rt(n),e.push(n),e.push('"')),e.push("></template>")),PK(A,e,t,i),A=A.renderState.generateStaticMarkup?!0:e.push("<!--/$-->"),A}if(n.status!==1)return n.status===0&&(n.rootSegmentID=A.nextSegmentId++),0<n.completedSegments.length&&A.partialBoundaries.push(n),U2A(e,A.renderState,n.rootSegmentID),i&&DG(i,n.fallbackState),PK(A,e,t,i),e.push("<!--/$-->");if(!$K&&NG(A,n)&&lx+n.byteSize>A.progressiveChunkSize)return n.rootSegmentID=A.nextSegmentId++,A.completedBoundaries.push(n),U2A(e,A.renderState,n.rootSegmentID),PK(A,e,t,i),e.push("<!--/$-->");if(lx+=n.byteSize,i&&DG(i,n.contentState),t=n.row,t!==null&&NG(A,n)&&--t.pendingTasks===0&&fa(A,t),A.renderState.generateStaticMarkup||e.push("<!--$-->"),t=n.completedSegments,t.length!==1)throw Error(Qe(391));return cx(A,e,t[0],i),A=A.renderState.generateStaticMarkup?!0:e.push("<!--/$-->"),A}function EeA(A,e,t,i){return Zke(e,A.renderState,t.parentFormatContext,t.id),cx(A,e,t,i),Wke(e,t.parentFormatContext)}function uNA(A,e,t){lx=t.byteSize;for(var i=t.completedSegments,n=0;n<i.length;n++)dNA(A,e,t,i[n]);i.length=0,i=t.row,i!==null&&NG(A,t)&&--i.pendingTasks===0&&fa(A,i),V2A(e,t.contentState,A.renderState),i=A.resumableState,A=A.renderState,n=t.rootSegmentID,t=t.contentState;var o=A.stylesToHoist;return A.stylesToHoist=!1,e.push(A.startInlineScript),e.push(">"),o?(!(i.instructions&4)&&(i.instructions|=4,e.push('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};')),!(i.instructions&2)&&(i.instructions|=2,e.push(`$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};
$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};`)),i.instructions&8?e.push('$RR("'):(i.instructions|=8,e.push(`$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=e[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&$RM.set(b.getAttribute("href"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement("link");a.href=d;a.rel=
"stylesheet";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute("media");!g||d&&!matchMedia(d).matches||b.push(g);if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=
"$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("`))):(!(i.instructions&2)&&(i.instructions|=2,e.push(`$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};
$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};`)),e.push('$RC("')),i=n.toString(16),e.push(A.boundaryPrefix),e.push(i),e.push('","'),e.push(A.segmentPrefix),e.push(i),o?(e.push('",'),jke(e,t)):e.push('"'),t=e.push(")<\/script>"),K2A(e,A)&&t}function dNA(A,e,t,i){if(i.status===2)return!0;var n=t.contentState,o=i.id;if(o===-1){if((i.id=t.rootSegmentID)===-1)throw Error(Qe(392));return EeA(A,e,i,n)}return o===t.rootSegmentID?EeA(A,e,i,n):(EeA(A,e,i,n),t=A.resumableState,A=A.renderState,e.push(A.startInlineScript),e.push(">"),t.instructions&1?e.push('$RS("'):(t.instructions|=1,e.push('$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("')),e.push(A.segmentPrefix),o=o.toString(16),e.push(o),e.push('","'),e.push(A.placeholderPrefix),e.push(o),e=e.push('")<\/script>'),e)}var $K=!1;function AU(A,e){try{if(!(0<A.pendingRootTasks)){var t,i=A.completedRootSegment;if(i!==null){if(i.status===5)return;var n=A.completedPreambleSegments;if(n===null)return;lx=A.byteSize;var o=A.resumableState,g=A.renderState,a=g.preamble,s=a.htmlChunks,I=a.headChunks,r;if(s){for(r=0;r<s.length;r++)e.push(s[r]);if(I)for(r=0;r<I.length;r++)e.push(I[r]);else{var C=Xo("head");e.push(C),e.push(">")}}else if(I)for(r=0;r<I.length;r++)e.push(I[r]);var l=g.charsetChunks;for(r=0;r<l.length;r++)e.push(l[r]);l.length=0,g.preconnects.forEach($l,e),g.preconnects.clear();var c=g.viewportChunks;for(r=0;r<c.length;r++)e.push(c[r]);c.length=0,g.fontPreloads.forEach($l,e),g.fontPreloads.clear(),g.highImagePreloads.forEach($l,e),g.highImagePreloads.clear(),bG=g,g.styles.forEach(_ke,e),bG=null;var B=g.importMapChunks;for(r=0;r<B.length;r++)e.push(B[r]);B.length=0,g.bootstrapScripts.forEach($l,e),g.scripts.forEach($l,e),g.scripts.clear(),g.bulkPreloads.forEach($l,e),g.bulkPreloads.clear(),o.instructions|=32;var E=g.hoistableChunks;for(r=0;r<E.length;r++)e.push(E[r]);for(o=E.length=0;o<n.length;o++){var u=n[o];for(g=0;g<u.length;g++)cx(A,e,u[g],null)}var d=A.renderState.preamble,f=d.headChunks;if(d.htmlChunks||f){var w=ey("head");e.push(w)}var y=d.bodyChunks;if(y)for(n=0;n<y.length;n++)e.push(y[n]);cx(A,e,i,null),A.completedRootSegment=null;var G=A.renderState;if(A.allPendingTasks!==0||A.clientRenderedBoundaries.length!==0||A.completedBoundaries.length!==0||A.trackedPostpones!==null&&(A.trackedPostpones.rootNodes.length!==0||A.trackedPostpones.rootSlots!==null)){var R=A.resumableState;if(!(R.instructions&64)){if(R.instructions|=64,e.push(G.startInlineScript),!(R.instructions&32)){R.instructions|=32;var x="_"+R.idPrefix+"R_";e.push(' id="');var F=Rt(x);e.push(F),e.push('"')}e.push(">"),e.push("requestAnimationFrame(function(){$RT=performance.now()});"),e.push("<\/script>")}}K2A(e,G)}var Q=A.renderState;i=0;var k=Q.viewportChunks;for(i=0;i<k.length;i++)e.push(k[i]);k.length=0,Q.preconnects.forEach($l,e),Q.preconnects.clear(),Q.fontPreloads.forEach($l,e),Q.fontPreloads.clear(),Q.highImagePreloads.forEach($l,e),Q.highImagePreloads.clear(),Q.styles.forEach(qke,e),Q.scripts.forEach($l,e),Q.scripts.clear(),Q.bulkPreloads.forEach($l,e),Q.bulkPreloads.clear();var h=Q.hoistableChunks;for(i=0;i<h.length;i++)e.push(h[i]);h.length=0;var N=A.clientRenderedBoundaries;for(t=0;t<N.length;t++){var v=N[t];Q=e;var K=A.resumableState,U=A.renderState,V=v.rootSegmentID,X=v.errorDigest;Q.push(U.startInlineScript),Q.push(">"),K.instructions&4?Q.push('$RX("'):(K.instructions|=4,Q.push('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("')),Q.push(U.boundaryPrefix);var _=V.toString(16);if(Q.push(_),Q.push('"'),X){Q.push(",");var q=Uke(X||"");Q.push(q)}var $=Q.push(")<\/script>");if(!$){A.destination=null,t++,N.splice(0,t);return}}N.splice(0,t);var nA=A.completedBoundaries;for(t=0;t<nA.length;t++)if(!uNA(A,e,nA[t])){A.destination=null,t++,nA.splice(0,t);return}nA.splice(0,t),$K=!0;var j=A.partialBoundaries;for(t=0;t<j.length;t++){var O=j[t];A:{N=A,v=e,lx=O.byteSize;var eA=O.completedSegments;for($=0;$<eA.length;$++)if(!dNA(N,v,O,eA[$])){$++,eA.splice(0,$);var oA=!1;break A}eA.splice(0,$);var tA=O.row;tA!==null&&tA.together&&O.pendingTasks===1&&(tA.pendingTasks===1?geA(N,tA,tA.hoistables):tA.pendingTasks--),oA=V2A(v,O.contentState,N.renderState)}if(!oA){A.destination=null,t++,j.splice(0,t);return}}j.splice(0,t),$K=!1;var sA=A.completedBoundaries;for(t=0;t<sA.length;t++)if(!uNA(A,e,sA[t])){A.destination=null,t++,sA.splice(0,t);return}sA.splice(0,t)}}finally{$K=!1,A.allPendingTasks===0&&A.clientRenderedBoundaries.length===0&&A.completedBoundaries.length===0&&(A.flushScheduled=!1,t=A.resumableState,t.hasBody&&(j=ey("body"),e.push(j)),t.hasHtml&&(t=ey("html"),e.push(t)),A.status=14,e.push(null),A.destination=null)}}function oy(A){if(A.flushScheduled===!1&&A.pingedTasks.length===0&&A.destination!==null){A.flushScheduled=!0;var e=A.destination;e?AU(A,e):A.flushScheduled=!1}}function kJe(A,e){if(A.status===13)A.status=14,e.destroy(A.fatalError);else if(A.status!==14&&A.destination===null){A.destination=e;try{AU(A,e)}catch(t){pa(A,t,{}),ax(A,t)}}}function JJe(A,e){(A.status===11||A.status===10)&&(A.status=12);try{var t=A.abortableTasks;if(0<t.size){var i=e===void 0?Error(Qe(432)):typeof e=="object"&&e!==null&&typeof e.then=="function"?Error(Qe(530)):e;A.fatalError=i,t.forEach(function(n){return leA(n,A,i)}),t.clear()}A.destination!==null&&AU(A,A.destination)}catch(n){pa(A,n,{}),ax(A,n)}}function eU(A,e,t){if(e===null)t.rootNodes.push(A);else{var i=t.workingMap,n=i.get(e);n===void 0&&(n=[e[1],e[2],[],null],i.set(e,n),eU(n,e[0],t)),n[2].push(A)}}function NJe(){}function hNA(A,e,t,i){var n=!1,o=null,g="",a=!1;if(e=vke(e?e.identifierPrefix:void 0),A=DJe(A,e,sJe(e,t),Kg(0,null,0,null),1/0,NJe,void 0,function(){a=!0},void 0,void 0,void 0),A.flushScheduled=A.destination!==null,QNA(A),A.status===10&&(A.status=11),A.trackedPostpones===null&&ceA(A,A.pendingRootTasks===0),JJe(A,i),kJe(A,{push:function(s){return s!==null&&(g+=s),!0},destroy:function(s){n=!0,o=s}}),n&&o!==i)throw o;if(!a)throw Error(Qe(426));return g}DK.renderToStaticMarkup=function(A,e){return hNA(A,e,!0,'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},DK.renderToString=function(A,e){return hNA(A,e,!1,'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},DK.version="19.2.3";var YG={};/**
 * @license React
 * react-dom-server.browser.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 ueA=p,YJe=bt;function Ee(A){var e="https://react.dev/errors/"+A;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+A+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var mNA=Symbol.for("react.transitional.element"),pNA=Symbol.for("react.portal"),fNA=Symbol.for("react.fragment"),yNA=Symbol.for("react.strict_mode"),bNA=Symbol.for("react.profiler"),wNA=Symbol.for("react.consumer"),tU=Symbol.for("react.context"),deA=Symbol.for("react.forward_ref"),iU=Symbol.for("react.suspense"),heA=Symbol.for("react.suspense_list"),meA=Symbol.for("react.memo"),nU=Symbol.for("react.lazy"),RJe=Symbol.for("react.scope"),DNA=Symbol.for("react.activity"),xJe=Symbol.for("react.legacy_hidden"),FJe=Symbol.for("react.memo_cache_sentinel"),MJe=Symbol.for("react.view_transition"),GNA=Symbol.iterator;function kNA(A){return A===null||typeof A!="object"?null:(A=GNA&&A[GNA]||A["@@iterator"],typeof A=="function"?A:null)}var oU=Array.isArray;function JNA(A,e){var t=A.length&3,i=A.length-t,n=e;for(e=0;e<i;){var o=A.charCodeAt(e)&255|(A.charCodeAt(++e)&255)<<8|(A.charCodeAt(++e)&255)<<16|(A.charCodeAt(++e)&255)<<24;++e,o=3432918353*(o&65535)+((3432918353*(o>>>16)&65535)<<16)&4294967295,o=o<<15|o>>>17,o=461845907*(o&65535)+((461845907*(o>>>16)&65535)<<16)&4294967295,n^=o,n=n<<13|n>>>19,n=5*(n&65535)+((5*(n>>>16)&65535)<<16)&4294967295,n=(n&65535)+27492+(((n>>>16)+58964&65535)<<16)}switch(o=0,t){case 3:o^=(A.charCodeAt(e+2)&255)<<16;case 2:o^=(A.charCodeAt(e+1)&255)<<8;case 1:o^=A.charCodeAt(e)&255,o=3432918353*(o&65535)+((3432918353*(o>>>16)&65535)<<16)&4294967295,o=o<<15|o>>>17,n^=461845907*(o&65535)+((461845907*(o>>>16)&65535)<<16)&4294967295}return n^=A.length,n^=n>>>16,n=2246822507*(n&65535)+((2246822507*(n>>>16)&65535)<<16)&4294967295,n^=n>>>13,n=3266489909*(n&65535)+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^n>>>16)>>>0}var NNA=new MessageChannel,YNA=[];NNA.port1.onmessage=function(){var A=YNA.shift();A&&A()};function peA(A){YNA.push(A),NNA.port2.postMessage(null)}function vJe(A){setTimeout(function(){throw A})}var LJe=Promise,RNA=typeof queueMicrotask=="function"?queueMicrotask:function(A){LJe.resolve(null).then(A).catch(vJe)},rI=null,II=0;function JA(A,e){if(e.byteLength!==0)if(2048<e.byteLength)0<II&&(A.enqueue(new Uint8Array(rI.buffer,0,II)),rI=new Uint8Array(2048),II=0),A.enqueue(e);else{var t=rI.length-II;t<e.byteLength&&(t===0?A.enqueue(rI):(rI.set(e.subarray(0,t),II),A.enqueue(rI),e=e.subarray(t)),rI=new Uint8Array(2048),II=0),rI.set(e,II),II+=e.byteLength}}function zi(A,e){return JA(A,e),!0}function feA(A){rI&&0<II&&(A.enqueue(new Uint8Array(rI.buffer,0,II)),rI=null,II=0)}var xNA=new TextEncoder;function Ae(A){return xNA.encode(A)}function NA(A){return xNA.encode(A)}function SJe(A){return A.byteLength}function FNA(A,e){typeof A.error=="function"?A.error(e):A.close()}var Ar=Object.assign,Mn=Object.prototype.hasOwnProperty,HJe=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]*$"),MNA={},vNA={};function yeA(A){return Mn.call(vNA,A)?!0:Mn.call(MNA,A)?!1:HJe.test(A)?vNA[A]=!0:(MNA[A]=!0,!1)}var ZJe=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(" ")),WJe=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"]]),KJe=/["'&<>]/;function mt(A){if(typeof A=="boolean"||typeof A=="number"||typeof A=="bigint")return""+A;A=""+A;var e=KJe.exec(A);if(e){var t="",i,n=0;for(i=e.index;i<A.length;i++){switch(A.charCodeAt(i)){case 34:e="&quot;";break;case 38:e="&amp;";break;case 39:e="&#x27;";break;case 60:e="&lt;";break;case 62:e="&gt;";break;default:continue}n!==i&&(t+=A.slice(n,i)),n=i+1,t+=e}A=n!==i?t+A.slice(n,i):t}return A}var UJe=/([A-Z])/g,VJe=/^ms-/,XJe=/^[\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 Bx(A){return XJe.test(""+A)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":A}var RG=ueA.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,LNA=YJe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,zJe={pending:!1,data:null,method:null,action:null},Ru=LNA.d;LNA.d={f:Ru.f,r:Ru.r,D:JNe,C:NNe,L:YNe,m:RNe,X:FNe,S:xNe,M:MNe};var JC=[],xG=null;NA('"></template>');var TJe=NA("<script"),gU=NA("<\/script>"),_Je=NA('<script src="'),OJe=NA('<script type="module" src="'),SNA=NA(' nonce="'),HNA=NA(' integrity="'),ZNA=NA(' crossorigin="'),WNA=NA(' async=""><\/script>'),qJe=NA("<style"),beA=/(<\/|<)(s)(cript)/gi;function weA(A,e,t,i){return""+e+(t==="s"?"\\u0073":"\\u0053")+i}var jJe=NA('<script type="importmap">'),PJe=NA("<\/script>");function aU(A,e,t,i,n,o){t=typeof e=="string"?e:e&&e.script;var g=t===void 0?TJe:NA('<script nonce="'+mt(t)+'"'),a=typeof e=="string"?void 0:e&&e.style,s=a===void 0?qJe:NA('<style nonce="'+mt(a)+'"'),I=A.idPrefix,r=[],C=A.bootstrapScriptContent,l=A.bootstrapScripts,c=A.bootstrapModules;if(C!==void 0&&(r.push(g),lU(r,A),r.push(_n,Ae((""+C).replace(beA,weA)),gU)),C=[],i!==void 0&&(C.push(jJe),C.push(Ae((""+JSON.stringify(i)).replace(beA,weA))),C.push(PJe)),i=n?{preconnects:"",fontPreloads:"",highImagePreloads:"",remainingCapacity:2+(typeof o=="number"?o:2e3)}:null,n={placeholderPrefix:NA(I+"P:"),segmentPrefix:NA(I+"S:"),boundaryPrefix:NA(I+"B:"),startInlineScript:g,startInlineStyle:s,preamble:Qx(),externalRuntimeScript:null,bootstrapChunks:r,importMapChunks:C,onHeaders:n,headers:i,resets:{font:{},dns:{},connect:{default:{},anonymous:{},credentials:{}},image:{},style:{}},charsetChunks:[],viewportChunks:[],hoistableChunks:[],preconnects:new Set,fontPreloads:new Set,highImagePreloads:new Set,styles:new Map,bootstrapScripts:new Set,scripts:new Set,bulkPreloads:new Set,preloads:{images:new Map,stylesheets:new Map,scripts:new Map,moduleScripts:new Map},nonce:{script:t,style:a},hoistableState:null,stylesToHoist:!1},l!==void 0)for(i=0;i<l.length;i++)I=l[i],a=g=void 0,s={rel:"preload",as:"script",fetchPriority:"low",nonce:e},typeof I=="string"?s.href=o=I:(s.href=o=I.src,s.integrity=a=typeof I.integrity=="string"?I.integrity:void 0,s.crossOrigin=g=typeof I=="string"||I.crossOrigin==null?void 0:I.crossOrigin==="use-credentials"?"use-credentials":""),I=A,C=o,I.scriptResources[C]=null,I.moduleScriptResources[C]=null,I=[],ba(I,s),n.bootstrapScripts.add(I),r.push(_Je,Ae(mt(o)),Tn),t&&r.push(SNA,Ae(mt(t)),Tn),typeof a=="string"&&r.push(HNA,Ae(mt(a)),Tn),typeof g=="string"&&r.push(ZNA,Ae(mt(g)),Tn),lU(r,A),r.push(WNA);if(c!==void 0)for(e=0;e<c.length;e++)a=c[e],o=i=void 0,g={rel:"modulepreload",fetchPriority:"low",nonce:t},typeof a=="string"?g.href=l=a:(g.href=l=a.src,g.integrity=o=typeof a.integrity=="string"?a.integrity:void 0,g.crossOrigin=i=typeof a=="string"||a.crossOrigin==null?void 0:a.crossOrigin==="use-credentials"?"use-credentials":""),a=A,s=l,a.scriptResources[s]=null,a.moduleScriptResources[s]=null,a=[],ba(a,g),n.bootstrapScripts.add(a),r.push(OJe,Ae(mt(l)),Tn),t&&r.push(SNA,Ae(mt(t)),Tn),typeof o=="string"&&r.push(HNA,Ae(mt(o)),Tn),typeof i=="string"&&r.push(ZNA,Ae(mt(i)),Tn),lU(r,A),r.push(WNA);return n}function KNA(A,e,t,i,n){return{idPrefix:A===void 0?"":A,nextFormID:0,streamingFormat:0,bootstrapScriptContent:t,bootstrapScripts:i,bootstrapModules:n,instructions:0,hasBody:!1,hasHtml:!1,unknownResources:{},dnsResources:{},connectResources:{default:{},anonymous:{},credentials:{}},imageResources:{},styleResources:{},scriptResources:{},moduleUnknownResources:{},moduleScriptResources:{}}}function Qx(){return{htmlChunks:null,headChunks:null,bodyChunks:null}}function Vg(A,e,t,i){return{insertionMode:A,selectedValue:e,tagScope:t,viewTransition:i}}function UNA(A){return Vg(A==="http://www.w3.org/2000/svg"?4:A==="http://www.w3.org/1998/Math/MathML"?5:0,null,0,null)}function VNA(A,e,t){var i=A.tagScope&-25;switch(e){case"noscript":return Vg(2,null,i|1,null);case"select":return Vg(2,t.value!=null?t.value:t.defaultValue,i,null);case"svg":return Vg(4,null,i,null);case"picture":return Vg(2,null,i|2,null);case"math":return Vg(5,null,i,null);case"foreignObject":return Vg(2,null,i,null);case"table":return Vg(6,null,i,null);case"thead":case"tbody":case"tfoot":return Vg(7,null,i,null);case"colgroup":return Vg(9,null,i,null);case"tr":return Vg(8,null,i,null);case"head":if(2>A.insertionMode)return Vg(3,null,i,null);break;case"html":if(A.insertionMode===0)return Vg(1,null,i,null)}return 6<=A.insertionMode||2>A.insertionMode?Vg(2,null,i,null):A.tagScope!==i?Vg(A.insertionMode,A.selectedValue,i,null):A}function XNA(A){return A===null?null:{update:A.update,enter:"none",exit:"none",share:A.update,name:A.autoName,autoName:A.autoName,nameIdx:0}}function DeA(A,e){return e.tagScope&32&&(A.instructions|=128),Vg(e.insertionMode,e.selectedValue,e.tagScope|12,XNA(e.viewTransition))}function sU(A,e){A=XNA(e.viewTransition);var t=e.tagScope|16;return A!==null&&A.share!=="none"&&(t|=64),Vg(e.insertionMode,e.selectedValue,t,A)}var Ac=NA("<!-- -->");function zNA(A,e,t,i){return e===""?i:(i&&A.push(Ac),A.push(Ae(mt(e))),!0)}var TNA=new Map,$Je=NA(' style="'),_NA=NA(":"),A2e=NA(";");function ONA(A,e){if(typeof e!="object")throw Error(Ee(62));var t=!0,i;for(i in e)if(Mn.call(e,i)){var n=e[i];if(n!=null&&typeof n!="boolean"&&n!==""){if(i.indexOf("--")===0){var o=Ae(mt(i));n=Ae(mt((""+n).trim()))}else o=TNA.get(i),o===void 0&&(o=NA(mt(i.replace(UJe,"-$1").toLowerCase().replace(VJe,"-ms-"))),TNA.set(i,o)),n=typeof n=="number"?n===0||ZJe.has(i)?Ae(""+n):Ae(n+"px"):Ae(mt((""+n).trim()));t?(t=!1,A.push($Je,o,_NA,n)):A.push(A2e,o,_NA,n)}}t||A.push(Tn)}var As=NA(" "),NC=NA('="'),Tn=NA('"'),GeA=NA('=""');function keA(A,e,t){t&&typeof t!="function"&&typeof t!="symbol"&&A.push(As,Ae(e),GeA)}function ya(A,e,t){typeof t!="function"&&typeof t!="symbol"&&typeof t!="boolean"&&A.push(As,Ae(e),NC,Ae(mt(t)),Tn)}var qNA=NA(mt("javascript:throw new Error('React form unexpectedly submitted.')")),jNA=NA('<input type="hidden"');function JeA(A,e){this.push(jNA),PNA(A),ya(this,"name",e),ya(this,"value",A),this.push(Ex)}function PNA(A){if(typeof A!="string")throw Error(Ee(480))}function $NA(A,e){if(typeof e.$$FORM_ACTION=="function"){var t=A.nextFormID++;A=A.idPrefix+t;try{var i=e.$$FORM_ACTION(A);if(i){var n=i.data;n!=null&&n.forEach(PNA)}return i}catch(o){if(typeof o=="object"&&o!==null&&typeof o.then=="function")throw o}}return null}function AYA(A,e,t,i,n,o,g,a){var s=null;if(typeof i=="function"){var I=$NA(e,i);I!==null?(a=I.name,i=I.action||"",n=I.encType,o=I.method,g=I.target,s=I.data):(A.push(As,Ae("formAction"),NC,qNA,Tn),g=o=n=i=a=null,tYA(e,t))}return a!=null&&Ri(A,"name",a),i!=null&&Ri(A,"formAction",i),n!=null&&Ri(A,"formEncType",n),o!=null&&Ri(A,"formMethod",o),g!=null&&Ri(A,"formTarget",g),s}function Ri(A,e,t){switch(e){case"className":ya(A,"class",t);break;case"tabIndex":ya(A,"tabindex",t);break;case"dir":case"role":case"viewBox":case"width":case"height":ya(A,e,t);break;case"style":ONA(A,t);break;case"src":case"href":if(t==="")break;case"action":case"formAction":if(t==null||typeof t=="function"||typeof t=="symbol"||typeof t=="boolean")break;t=Bx(""+t),A.push(As,Ae(e),NC,Ae(mt(t)),Tn);break;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"autoFocus":case"multiple":case"muted":keA(A,e.toLowerCase(),t);break;case"xlinkHref":if(typeof t=="function"||typeof t=="symbol"||typeof t=="boolean")break;t=Bx(""+t),A.push(As,Ae("xlink:href"),NC,Ae(mt(t)),Tn);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":typeof t!="function"&&typeof t!="symbol"&&A.push(As,Ae(e),NC,Ae(mt(t)),Tn);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":t&&typeof t!="function"&&typeof t!="symbol"&&A.push(As,Ae(e),GeA);break;case"capture":case"download":t===!0?A.push(As,Ae(e),GeA):t!==!1&&typeof t!="function"&&typeof t!="symbol"&&A.push(As,Ae(e),NC,Ae(mt(t)),Tn);break;case"cols":case"rows":case"size":case"span":typeof t!="function"&&typeof t!="symbol"&&!isNaN(t)&&1<=t&&A.push(As,Ae(e),NC,Ae(mt(t)),Tn);break;case"rowSpan":case"start":typeof t=="function"||typeof t=="symbol"||isNaN(t)||A.push(As,Ae(e),NC,Ae(mt(t)),Tn);break;case"xlinkActuate":ya(A,"xlink:actuate",t);break;case"xlinkArcrole":ya(A,"xlink:arcrole",t);break;case"xlinkRole":ya(A,"xlink:role",t);break;case"xlinkShow":ya(A,"xlink:show",t);break;case"xlinkTitle":ya(A,"xlink:title",t);break;case"xlinkType":ya(A,"xlink:type",t);break;case"xmlBase":ya(A,"xml:base",t);break;case"xmlLang":ya(A,"xml:lang",t);break;case"xmlSpace":ya(A,"xml:space",t);break;default:if((!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(e=WJe.get(e)||e,yeA(e))){switch(typeof t){case"function":case"symbol":return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-")return}A.push(As,Ae(e),NC,Ae(mt(t)),Tn)}}}var _n=NA(">"),Ex=NA("/>");function CI(A,e,t){if(e!=null){if(t!=null)throw Error(Ee(60));if(typeof e!="object"||!("__html"in e))throw Error(Ee(61));e=e.__html,e!=null&&A.push(Ae(""+e))}}function e2e(A){var e="";return ueA.Children.forEach(A,function(t){t!=null&&(e+=t)}),e}var NeA=NA(' selected=""'),eYA=NA(`addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error('React form unexpectedly submitted.')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});`);function tYA(A,e){if(!(A.instructions&16)){A.instructions|=16;var t=e.preamble,i=e.bootstrapChunks;(t.htmlChunks||t.headChunks)&&i.length===0?(i.push(e.startInlineScript),lU(i,A),i.push(_n,eYA,gU)):i.unshift(e.startInlineScript,_n,eYA,gU)}}var t2e=NA("<!--F!-->"),i2e=NA("<!--F-->");function ba(A,e){A.push(zo("link"));for(var t in e)if(Mn.call(e,t)){var i=e[t];if(i!=null)switch(t){case"children":case"dangerouslySetInnerHTML":throw Error(Ee(399,"link"));default:Ri(A,t,i)}}return A.push(Ex),null}var iYA=/(<\/|<)(s)(tyle)/gi;function nYA(A,e,t,i){return""+e+(t==="s"?"\\73 ":"\\53 ")+i}function FG(A,e,t){A.push(zo(t));for(var i in e)if(Mn.call(e,i)){var n=e[i];if(n!=null)switch(i){case"children":case"dangerouslySetInnerHTML":throw Error(Ee(399,t));default:Ri(A,i,n)}}return A.push(Ex),null}function oYA(A,e){A.push(zo("title"));var t=null,i=null,n;for(n in e)if(Mn.call(e,n)){var o=e[n];if(o!=null)switch(n){case"children":t=o;break;case"dangerouslySetInnerHTML":i=o;break;default:Ri(A,n,o)}}return A.push(_n),e=Array.isArray(t)?2>t.length?t[0]:null:t,typeof e!="function"&&typeof e!="symbol"&&e!==null&&e!==void 0&&A.push(Ae(mt(""+e))),CI(A,i,t),A.push(gy("title")),null}var n2e=NA("<!--head-->"),o2e=NA("<!--body-->"),g2e=NA("<!--html-->");function rU(A,e){A.push(zo("script"));var t=null,i=null,n;for(n in e)if(Mn.call(e,n)){var o=e[n];if(o!=null)switch(n){case"children":t=o;break;case"dangerouslySetInnerHTML":i=o;break;default:Ri(A,n,o)}}return A.push(_n),CI(A,i,t),typeof t=="string"&&A.push(Ae((""+t).replace(beA,weA))),A.push(gy("script")),null}function YeA(A,e,t){A.push(zo(t));var i=t=null,n;for(n in e)if(Mn.call(e,n)){var o=e[n];if(o!=null)switch(n){case"children":t=o;break;case"dangerouslySetInnerHTML":i=o;break;default:Ri(A,n,o)}}return A.push(_n),CI(A,i,t),t}function IU(A,e,t){A.push(zo(t));var i=t=null,n;for(n in e)if(Mn.call(e,n)){var o=e[n];if(o!=null)switch(n){case"children":t=o;break;case"dangerouslySetInnerHTML":i=o;break;default:Ri(A,n,o)}}return A.push(_n),CI(A,i,t),typeof t=="string"?(A.push(Ae(mt(t))),null):t}var ReA=NA(`
`),a2e=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,gYA=new Map;function zo(A){var e=gYA.get(A);if(e===void 0){if(!a2e.test(A))throw Error(Ee(65,A));e=NA("<"+A),gYA.set(A,e)}return e}var s2e=NA("<!DOCTYPE html>");function r2e(A,e,t,i,n,o,g,a,s){switch(e){case"div":case"span":case"svg":case"path":break;case"a":A.push(zo("a"));var I=null,r=null,C;for(C in t)if(Mn.call(t,C)){var l=t[C];if(l!=null)switch(C){case"children":I=l;break;case"dangerouslySetInnerHTML":r=l;break;case"href":l===""?ya(A,"href",""):Ri(A,C,l);break;default:Ri(A,C,l)}}if(A.push(_n),CI(A,r,I),typeof I=="string"){A.push(Ae(mt(I)));var c=null}else c=I;return c;case"g":case"p":case"li":break;case"select":A.push(zo("select"));var B=null,E=null,u;for(u in t)if(Mn.call(t,u)){var d=t[u];if(d!=null)switch(u){case"children":B=d;break;case"dangerouslySetInnerHTML":E=d;break;case"defaultValue":case"value":break;default:Ri(A,u,d)}}return A.push(_n),CI(A,E,B),B;case"option":var f=a.selectedValue;A.push(zo("option"));var w=null,y=null,G=null,R=null,x;for(x in t)if(Mn.call(t,x)){var F=t[x];if(F!=null)switch(x){case"children":w=F;break;case"selected":G=F;break;case"dangerouslySetInnerHTML":R=F;break;case"value":y=F;default:Ri(A,x,F)}}if(f!=null){var Q=y!==null?""+y:e2e(w);if(oU(f)){for(var k=0;k<f.length;k++)if(""+f[k]===Q){A.push(NeA);break}}else""+f===Q&&A.push(NeA)}else G&&A.push(NeA);return A.push(_n),CI(A,R,w),w;case"textarea":A.push(zo("textarea"));var h=null,N=null,v=null,K;for(K in t)if(Mn.call(t,K)){var U=t[K];if(U!=null)switch(K){case"children":v=U;break;case"value":h=U;break;case"defaultValue":N=U;break;case"dangerouslySetInnerHTML":throw Error(Ee(91));default:Ri(A,K,U)}}if(h===null&&N!==null&&(h=N),A.push(_n),v!=null){if(h!=null)throw Error(Ee(92));if(oU(v)){if(1<v.length)throw Error(Ee(93));h=""+v[0]}h=""+v}return typeof h=="string"&&h[0]===`
`&&A.push(ReA),h!==null&&A.push(Ae(mt(""+h))),null;case"input":A.push(zo("input"));var V=null,X=null,_=null,q=null,$=null,nA=null,j=null,O=null,eA=null,oA;for(oA in t)if(Mn.call(t,oA)){var tA=t[oA];if(tA!=null)switch(oA){case"children":case"dangerouslySetInnerHTML":throw Error(Ee(399,"input"));case"name":V=tA;break;case"formAction":X=tA;break;case"formEncType":_=tA;break;case"formMethod":q=tA;break;case"formTarget":$=tA;break;case"defaultChecked":eA=tA;break;case"defaultValue":j=tA;break;case"checked":O=tA;break;case"value":nA=tA;break;default:Ri(A,oA,tA)}}var sA=AYA(A,i,n,X,_,q,$,V);return O!==null?keA(A,"checked",O):eA!==null&&keA(A,"checked",eA),nA!==null?Ri(A,"value",nA):j!==null&&Ri(A,"value",j),A.push(Ex),sA!=null&&sA.forEach(JeA,A),null;case"button":A.push(zo("button"));var gA=null,iA=null,aA=null,lA=null,CA=null,QA=null,uA=null,fA;for(fA in t)if(Mn.call(t,fA)){var hA=t[fA];if(hA!=null)switch(fA){case"children":gA=hA;break;case"dangerouslySetInnerHTML":iA=hA;break;case"name":aA=hA;break;case"formAction":lA=hA;break;case"formEncType":CA=hA;break;case"formMethod":QA=hA;break;case"formTarget":uA=hA;break;default:Ri(A,fA,hA)}}var yA=AYA(A,i,n,lA,CA,QA,uA,aA);if(A.push(_n),yA!=null&&yA.forEach(JeA,A),CI(A,iA,gA),typeof gA=="string"){A.push(Ae(mt(gA)));var mA=null}else mA=gA;return mA;case"form":A.push(zo("form"));var LA=null,UA=null,ne=null,SA=null,ae=null,EA=null,wA;for(wA in t)if(Mn.call(t,wA)){var se=t[wA];if(se!=null)switch(wA){case"children":LA=se;break;case"dangerouslySetInnerHTML":UA=se;break;case"action":ne=se;break;case"encType":SA=se;break;case"method":ae=se;break;case"target":EA=se;break;default:Ri(A,wA,se)}}var we=null,be=null;if(typeof ne=="function"){var Oe=$NA(i,ne);Oe!==null?(ne=Oe.action||"",SA=Oe.encType,ae=Oe.method,EA=Oe.target,we=Oe.data,be=Oe.name):(A.push(As,Ae("action"),NC,qNA,Tn),EA=ae=SA=ne=null,tYA(i,n))}if(ne!=null&&Ri(A,"action",ne),SA!=null&&Ri(A,"encType",SA),ae!=null&&Ri(A,"method",ae),EA!=null&&Ri(A,"target",EA),A.push(_n),be!==null&&(A.push(jNA),ya(A,"name",be),A.push(Ex),we!=null&&we.forEach(JeA,A)),CI(A,UA,LA),typeof LA=="string"){A.push(Ae(mt(LA)));var VA=null}else VA=LA;return VA;case"menuitem":A.push(zo("menuitem"));for(var ZA in t)if(Mn.call(t,ZA)){var le=t[ZA];if(le!=null)switch(ZA){case"children":case"dangerouslySetInnerHTML":throw Error(Ee(400));default:Ri(A,ZA,le)}}return A.push(_n),null;case"object":A.push(zo("object"));var ce=null,de=null,rt;for(rt in t)if(Mn.call(t,rt)){var en=t[rt];if(en!=null)switch(rt){case"children":ce=en;break;case"dangerouslySetInnerHTML":de=en;break;case"data":var Ot=Bx(""+en);if(Ot==="")break;A.push(As,Ae("data"),NC,Ae(mt(Ot)),Tn);break;default:Ri(A,rt,en)}}if(A.push(_n),CI(A,de,ce),typeof ce=="string"){A.push(Ae(mt(ce)));var og=null}else og=ce;return og;case"title":var Oa=a.tagScope&1,hh=a.tagScope&4;if(a.insertionMode===4||Oa||t.itemProp!=null)var Ss=oYA(A,t);else hh?Ss=null:(oYA(n.hoistableChunks,t),Ss=void 0);return Ss;case"link":var kR=a.tagScope&1,iW=a.tagScope&4,nW=t.rel,gg=t.href,DB=t.precedence;if(a.insertionMode===4||kR||t.itemProp!=null||typeof nW!="string"||typeof gg!="string"||gg===""){ba(A,t);var sC=null}else if(t.rel==="stylesheet")if(typeof DB!="string"||t.disabled!=null||t.onLoad||t.onError)sC=ba(A,t);else{var Hs=n.styles.get(DB),rC=i.styleResources.hasOwnProperty(gg)?i.styleResources[gg]:void 0;if(rC!==null){i.styleResources[gg]=null,Hs||(Hs={precedence:Ae(mt(DB)),rules:[],hrefs:[],sheets:new Map},n.styles.set(DB,Hs));var GB={state:0,props:Ar({},t,{"data-precedence":t.precedence,precedence:null})};if(rC){rC.length===2&&dx(GB.props,rC);var mh=n.preloads.stylesheets.get(gg);mh&&0<mh.length?mh.length=0:GB.state=1}Hs.sheets.set(gg,GB),g&&g.stylesheets.add(GB)}else if(Hs){var lD=Hs.sheets.get(gg);lD&&g&&g.stylesheets.add(lD)}s&&A.push(Ac),sC=null}else t.onLoad||t.onError?sC=ba(A,t):(s&&A.push(Ac),sC=iW?null:ba(n.hoistableChunks,t));return sC;case"script":var oW=a.tagScope&1,Rg=t.async;if(typeof t.src!="string"||!t.src||!Rg||typeof Rg=="function"||typeof Rg=="symbol"||t.onLoad||t.onError||a.insertionMode===4||oW||t.itemProp!=null)var he=rU(A,t);else{var vl=t.src;if(t.type==="module")var Ll=i.moduleScriptResources,df=n.preloads.moduleScripts;else Ll=i.scriptResources,df=n.preloads.scripts;var Sl=Ll.hasOwnProperty(vl)?Ll[vl]:void 0;if(Sl!==null){Ll[vl]=null;var kB=t;if(Sl){Sl.length===2&&(kB=Ar({},t),dx(kB,Sl));var hf=df.get(vl);hf&&(hf.length=0)}var Hl=[];n.scripts.add(Hl),rU(Hl,kB)}s&&A.push(Ac),he=null}return he;case"style":var JR=a.tagScope&1,JB=t.precedence,Zs=t.href,gW=t.nonce;if(a.insertionMode===4||JR||t.itemProp!=null||typeof JB!="string"||typeof Zs!="string"||Zs===""){A.push(zo("style"));var Ws=null,mf=null,IC;for(IC in t)if(Mn.call(t,IC)){var Xr=t[IC];if(Xr!=null)switch(IC){case"children":Ws=Xr;break;case"dangerouslySetInnerHTML":mf=Xr;break;default:Ri(A,IC,Xr)}}A.push(_n);var CC=Array.isArray(Ws)?2>Ws.length?Ws[0]:null:Ws;typeof CC!="function"&&typeof CC!="symbol"&&CC!==null&&CC!==void 0&&A.push(Ae((""+CC).replace(iYA,nYA))),CI(A,mf,Ws),A.push(gy("style"));var cD=null}else{var la=n.styles.get(JB);if((i.styleResources.hasOwnProperty(Zs)?i.styleResources[Zs]:void 0)!==null){i.styleResources[Zs]=null,la||(la={precedence:Ae(mt(JB)),rules:[],hrefs:[],sheets:new Map},n.styles.set(JB,la));var BD=n.nonce.style;if(!BD||BD===gW){la.hrefs.push(Ae(mt(Zs)));var QD=la.rules,ca=null,NB=null,Zl;for(Zl in t)if(Mn.call(t,Zl)){var OE=t[Zl];if(OE!=null)switch(Zl){case"children":ca=OE;break;case"dangerouslySetInnerHTML":NB=OE}}var Ba=Array.isArray(ca)?2>ca.length?ca[0]:null:ca;typeof Ba!="function"&&typeof Ba!="symbol"&&Ba!==null&&Ba!==void 0&&QD.push(Ae((""+Ba).replace(iYA,nYA))),CI(QD,NB,ca)}}la&&g&&g.styles.add(la),s&&A.push(Ac),cD=void 0}return cD;case"meta":var Zt=a.tagScope&1,tn=a.tagScope&4;if(a.insertionMode===4||Zt||t.itemProp!=null)var qE=FG(A,t,"meta");else s&&A.push(Ac),qE=tn?null:typeof t.charSet=="string"?FG(n.charsetChunks,t,"meta"):t.name==="viewport"?FG(n.viewportChunks,t,"meta"):FG(n.hoistableChunks,t,"meta");return qE;case"listing":case"pre":A.push(zo(e));var xg=null,Fg=null,Ks;for(Ks in t)if(Mn.call(t,Ks)){var Se=t[Ks];if(Se!=null)switch(Ks){case"children":xg=Se;break;case"dangerouslySetInnerHTML":Fg=Se;break;default:Ri(A,Ks,Se)}}if(A.push(_n),Fg!=null){if(xg!=null)throw Error(Ee(60));if(typeof Fg!="object"||!("__html"in Fg))throw Error(Ee(61));var Mt=Fg.__html;Mt!=null&&(typeof Mt=="string"&&0<Mt.length&&Mt[0]===`
`?A.push(ReA,Ae(Mt)):A.push(Ae(""+Mt)))}return typeof xg=="string"&&xg[0]===`
`&&A.push(ReA),xg;case"img":var ED=a.tagScope&3,kt=t.src,We=t.srcSet;if(!(t.loading==="lazy"||!kt&&!We||typeof kt!="string"&&kt!=null||typeof We!="string"&&We!=null||t.fetchPriority==="low"||ED)&&(typeof kt!="string"||kt[4]!==":"||kt[0]!=="d"&&kt[0]!=="D"||kt[1]!=="a"&&kt[1]!=="A"||kt[2]!=="t"&&kt[2]!=="T"||kt[3]!=="a"&&kt[3]!=="A")&&(typeof We!="string"||We[4]!==":"||We[0]!=="d"&&We[0]!=="D"||We[1]!=="a"&&We[1]!=="A"||We[2]!=="t"&&We[2]!=="T"||We[3]!=="a"&&We[3]!=="A")){g!==null&&a.tagScope&64&&(g.suspenseyImages=!0);var uD=typeof t.sizes=="string"?t.sizes:void 0,Mg=We?We+`
`+(uD||""):kt,Us=n.preloads.images,Wt=Us.get(Mg);if(Wt)(t.fetchPriority==="high"||10>n.highImagePreloads.size)&&(Us.delete(Mg),n.highImagePreloads.add(Wt));else if(!i.imageResources.hasOwnProperty(Mg)){i.imageResources[Mg]=JC;var Vs=t.crossOrigin,YB=typeof Vs=="string"?Vs==="use-credentials"?Vs:"":void 0,ko=n.headers,RB;ko&&0<ko.remainingCapacity&&typeof t.srcSet!="string"&&(t.fetchPriority==="high"||500>ko.highImagePreloads.length)&&(RB=cU(kt,"image",{imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:YB,integrity:t.integrity,nonce:t.nonce,type:t.type,fetchPriority:t.fetchPriority,referrerPolicy:t.refererPolicy}),0<=(ko.remainingCapacity-=RB.length+2))?(n.resets.image[Mg]=JC,ko.highImagePreloads&&(ko.highImagePreloads+=", "),ko.highImagePreloads+=RB):(Wt=[],ba(Wt,{rel:"preload",as:"image",href:We?void 0:kt,imageSrcSet:We,imageSizes:uD,crossOrigin:YB,integrity:t.integrity,type:t.type,fetchPriority:t.fetchPriority,referrerPolicy:t.referrerPolicy}),t.fetchPriority==="high"||10>n.highImagePreloads.size?n.highImagePreloads.add(Wt):(n.bulkPreloads.add(Wt),Us.set(Mg,Wt)))}}return FG(A,t,"img");case"base":case"area":case"br":case"col":case"embed":case"hr":case"keygen":case"param":case"source":case"track":case"wbr":return FG(A,t,e);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":break;case"head":if(2>a.insertionMode){var lC=o||n.preamble;if(lC.headChunks)throw Error(Ee(545,"`<head>`"));o!==null&&A.push(n2e),lC.headChunks=[];var ph=YeA(lC.headChunks,t,"head")}else ph=IU(A,t,"head");return ph;case"body":if(2>a.insertionMode){var xB=o||n.preamble;if(xB.bodyChunks)throw Error(Ee(545,"`<body>`"));o!==null&&A.push(o2e),xB.bodyChunks=[];var jE=YeA(xB.bodyChunks,t,"body")}else jE=IU(A,t,"body");return jE;case"html":if(a.insertionMode===0){var FB=o||n.preamble;if(FB.htmlChunks)throw Error(Ee(545,"`<html>`"));o!==null&&A.push(g2e),FB.htmlChunks=[s2e];var fh=YeA(FB.htmlChunks,t,"html")}else fh=IU(A,t,"html");return fh;default:if(e.indexOf("-")!==-1){A.push(zo(e));var Wl=null,pf=null,Qa;for(Qa in t)if(Mn.call(t,Qa)){var Rn=t[Qa];if(Rn!=null){var Ke=Qa;switch(Qa){case"children":Wl=Rn;break;case"dangerouslySetInnerHTML":pf=Rn;break;case"style":ONA(A,Rn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"className":Ke="class";default:if(yeA(Qa)&&typeof Rn!="function"&&typeof Rn!="symbol"&&Rn!==!1){if(Rn===!0)Rn="";else if(typeof Rn=="object")continue;A.push(As,Ae(Ke),NC,Ae(mt(Rn)),Tn)}}}}return A.push(_n),CI(A,pf,Wl),Wl}}return IU(A,t,e)}var aYA=new Map;function gy(A){var e=aYA.get(A);return e===void 0&&(e=NA("</"+A+">"),aYA.set(A,e)),e}function sYA(A,e){A=A.preamble,A.htmlChunks===null&&e.htmlChunks&&(A.htmlChunks=e.htmlChunks),A.headChunks===null&&e.headChunks&&(A.headChunks=e.headChunks),A.bodyChunks===null&&e.bodyChunks&&(A.bodyChunks=e.bodyChunks)}function rYA(A,e){e=e.bootstrapChunks;for(var t=0;t<e.length-1;t++)JA(A,e[t]);return t<e.length?(t=e[t],e.length=0,zi(A,t)):!0}var I2e=NA("requestAnimationFrame(function(){$RT=performance.now()});"),C2e=NA('<template id="'),l2e=NA('"></template>'),c2e=NA("<!--&-->"),B2e=NA("<!--/&-->"),Q2e=NA("<!--$-->"),E2e=NA('<!--$?--><template id="'),u2e=NA('"></template>'),d2e=NA("<!--$!-->"),h2e=NA("<!--/$-->"),m2e=NA("<template"),p2e=NA('"'),f2e=NA(' data-dgst="');NA(' data-msg="'),NA(' data-stck="'),NA(' data-cstck="');var y2e=NA("></template>");function IYA(A,e,t){if(JA(A,E2e),t===null)throw Error(Ee(395));return JA(A,e.boundaryPrefix),JA(A,Ae(t.toString(16))),zi(A,u2e)}var b2e=NA('<div hidden id="'),w2e=NA('">'),D2e=NA("</div>"),G2e=NA('<svg aria-hidden="true" style="display:none" id="'),k2e=NA('">'),J2e=NA("</svg>"),N2e=NA('<math aria-hidden="true" style="display:none" id="'),Y2e=NA('">'),R2e=NA("</math>"),x2e=NA('<table hidden id="'),F2e=NA('">'),M2e=NA("</table>"),v2e=NA('<table hidden><tbody id="'),L2e=NA('">'),S2e=NA("</tbody></table>"),H2e=NA('<table hidden><tr id="'),Z2e=NA('">'),W2e=NA("</tr></table>"),K2e=NA('<table hidden><colgroup id="'),U2e=NA('">'),V2e=NA("</colgroup></table>");function X2e(A,e,t,i){switch(t.insertionMode){case 0:case 1:case 3:case 2:return JA(A,b2e),JA(A,e.segmentPrefix),JA(A,Ae(i.toString(16))),zi(A,w2e);case 4:return JA(A,G2e),JA(A,e.segmentPrefix),JA(A,Ae(i.toString(16))),zi(A,k2e);case 5:return JA(A,N2e),JA(A,e.segmentPrefix),JA(A,Ae(i.toString(16))),zi(A,Y2e);case 6:return JA(A,x2e),JA(A,e.segmentPrefix),JA(A,Ae(i.toString(16))),zi(A,F2e);case 7:return JA(A,v2e),JA(A,e.segmentPrefix),JA(A,Ae(i.toString(16))),zi(A,L2e);case 8:return JA(A,H2e),JA(A,e.segmentPrefix),JA(A,Ae(i.toString(16))),zi(A,Z2e);case 9:return JA(A,K2e),JA(A,e.segmentPrefix),JA(A,Ae(i.toString(16))),zi(A,U2e);default:throw Error(Ee(397))}}function z2e(A,e){switch(e.insertionMode){case 0:case 1:case 3:case 2:return zi(A,D2e);case 4:return zi(A,J2e);case 5:return zi(A,R2e);case 6:return zi(A,M2e);case 7:return zi(A,S2e);case 8:return zi(A,W2e);case 9:return zi(A,V2e);default:throw Error(Ee(397))}}var T2e=NA('$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),_2e=NA('$RS("'),O2e=NA('","'),q2e=NA('")<\/script>');NA('<template data-rsi="" data-sid="'),NA('" data-pid="');var CYA=NA(`$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};
$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};`);Ae(`$RV=function(A,g){function k(a,b){var e=a.getAttribute(b);e&&(b=a.style,l.push(a,b.viewTransitionName,b.viewTransitionClass),"auto"!==e&&(b.viewTransitionClass=e),(a=a.getAttribute("vt-name"))||(a="_T_"+K++ +"_"),b.viewTransitionName=a,B=!0)}var B=!1,K=0,l=[];try{var f=document.__reactViewTransition;if(f){f.finished.finally($RV.bind(null,g));return}var m=new Map;for(f=1;f<g.length;f+=2)for(var h=g[f].querySelectorAll("[vt-share]"),d=0;d<h.length;d++){var c=h[d];m.set(c.getAttribute("vt-name"),c)}var u=[];for(h=0;h<g.length;h+=2){var C=g[h],x=C.parentNode;if(x){var v=x.getBoundingClientRect();if(v.left||v.top||v.width||v.height){c=C;for(f=0;c;){if(8===c.nodeType){var r=c.data;if("/$"===r)if(0===f)break;else f--;else"$"!==r&&"$?"!==r&&"$~"!==r&&"$!"!==r||f++}else if(1===c.nodeType){d=c;var D=d.getAttribute("vt-name"),y=m.get(D);k(d,y?"vt-share":"vt-exit");y&&(k(y,"vt-share"),m.set(D,null));var E=d.querySelectorAll("[vt-share]");for(d=0;d<E.length;d++){var F=E[d],G=F.getAttribute("vt-name"),
H=m.get(G);H&&(k(F,"vt-share"),k(H,"vt-share"),m.set(G,null))}}c=c.nextSibling}for(var I=g[h+1],t=I.firstElementChild;t;)null!==m.get(t.getAttribute("vt-name"))&&k(t,"vt-enter"),t=t.nextElementSibling;c=x;do for(var n=c.firstElementChild;n;){var J=n.getAttribute("vt-update");J&&"none"!==J&&!l.includes(n)&&k(n,"vt-update");n=n.nextElementSibling}while((c=c.parentNode)&&1===c.nodeType&&"none"!==c.getAttribute("vt-update"));u.push.apply(u,I.querySelectorAll('img[src]:not([loading="lazy"])'))}}}if(B){var z=
document.__reactViewTransition=document.startViewTransition({update:function(){A(g);for(var a=[document.documentElement.clientHeight,document.fonts.ready],b={},e=0;e<u.length;b={g:b.g},e++)if(b.g=u[e],!b.g.complete){var p=b.g.getBoundingClientRect();0<p.bottom&&0<p.right&&p.top<window.innerHeight&&p.left<window.innerWidth&&(p=new Promise(function(w){return function(q){w.g.addEventListener("load",q);w.g.addEventListener("error",q)}}(b)),a.push(p))}return Promise.race([Promise.all(a),new Promise(function(w){var q=
performance.now();setTimeout(w,2300>q&&2E3<q?2300-q:500)})])},types:[]});z.ready.finally(function(){for(var a=l.length-3;0<=a;a-=3){var b=l[a],e=b.style;e.viewTransitionName=l[a+1];e.viewTransitionClass=l[a+1];""===b.getAttribute("style")&&b.removeAttribute("style")}});z.finished.finally(function(){document.__reactViewTransition===z&&(document.__reactViewTransition=null)});$RB=[];return}}catch(a){}A(g)}.bind(null,$RV);`);var j2e=NA('$RC("'),P2e=NA(`$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=e[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&$RM.set(b.getAttribute("href"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement("link");a.href=d;a.rel=
"stylesheet";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute("media");!g||d&&!matchMedia(d).matches||b.push(g);if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=
"$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("`),$2e=NA('$RR("'),ANe=NA('","'),eNe=NA('",'),tNe=NA('"'),iNe=NA(")<\/script>");NA('<template data-rci="" data-bid="'),NA('<template data-rri="" data-bid="'),NA('" data-sid="'),NA('" data-sty="');var nNe=NA('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'),oNe=NA('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("'),gNe=NA('$RX("'),aNe=NA('"'),sNe=NA(","),rNe=NA(")<\/script>");NA('<template data-rxi="" data-bid="'),NA('" data-dgst="'),NA('" data-msg="'),NA('" data-stck="'),NA('" data-cstck="');var INe=/[<\u2028\u2029]/g;function CNe(A){return JSON.stringify(A).replace(INe,function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var lNe=/[&><\u2028\u2029]/g;function ux(A){return JSON.stringify(A).replace(lNe,function(e){switch(e){case"&":return"\\u0026";case">":return"\\u003e";case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var cNe=NA(' media="not all" data-precedence="'),BNe=NA('" data-href="'),QNe=NA('">'),ENe=NA("</style>"),CU=!1,xeA=!0;function uNe(A){var e=A.rules,t=A.hrefs,i=0;if(t.length){for(JA(this,xG.startInlineStyle),JA(this,cNe),JA(this,A.precedence),JA(this,BNe);i<t.length-1;i++)JA(this,t[i]),JA(this,cYA);for(JA(this,t[i]),JA(this,QNe),i=0;i<e.length;i++)JA(this,e[i]);xeA=zi(this,ENe),CU=!0,e.length=0,t.length=0}}function dNe(A){return A.state!==2?CU=!0:!1}function lYA(A,e,t){return CU=!1,xeA=!0,xG=t,e.styles.forEach(uNe,A),xG=null,e.stylesheets.forEach(dNe),CU&&(t.stylesToHoist=!0),xeA}function ec(A){for(var e=0;e<A.length;e++)JA(this,A[e]);A.length=0}var Cm=[];function hNe(A){ba(Cm,A.props);for(var e=0;e<Cm.length;e++)JA(this,Cm[e]);Cm.length=0,A.state=2}var mNe=NA(' data-precedence="'),pNe=NA('" data-href="'),cYA=NA(" "),fNe=NA('">'),yNe=NA("</style>");function bNe(A){var e=0<A.sheets.size;A.sheets.forEach(hNe,this),A.sheets.clear();var t=A.rules,i=A.hrefs;if(!e||i.length){if(JA(this,xG.startInlineStyle),JA(this,mNe),JA(this,A.precedence),A=0,i.length){for(JA(this,pNe);A<i.length-1;A++)JA(this,i[A]),JA(this,cYA);JA(this,i[A])}for(JA(this,fNe),A=0;A<t.length;A++)JA(this,t[A]);JA(this,yNe),t.length=0,i.length=0}}function wNe(A){if(A.state===0){A.state=1;var e=A.props;for(ba(Cm,{rel:"preload",as:"style",href:A.props.href,crossOrigin:e.crossOrigin,fetchPriority:e.fetchPriority,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy}),A=0;A<Cm.length;A++)JA(this,Cm[A]);Cm.length=0}}function DNe(A){A.sheets.forEach(wNe,this),A.sheets.clear()}NA('<link rel="expect" href="#'),NA('" blocking="render"/>');var BYA=NA(' id="');function lU(A,e){!(e.instructions&32)&&(e.instructions|=32,A.push(BYA,Ae(mt("_"+e.idPrefix+"R_")),Tn))}var QYA=NA("["),EYA=NA(",["),FeA=NA(","),MeA=NA("]");function GNe(A,e){JA(A,QYA);var t=QYA;e.stylesheets.forEach(function(i){if(i.state!==2)if(i.state===3)JA(A,t),JA(A,Ae(ux(""+i.props.href))),JA(A,MeA),t=EYA;else{JA(A,t);var n=i.props["data-precedence"],o=i.props,g=Bx(""+i.props.href);JA(A,Ae(ux(g))),n=""+n,JA(A,FeA),JA(A,Ae(ux(n)));for(var a in o)if(Mn.call(o,a)&&(n=o[a],n!=null))switch(a){case"href":case"rel":case"precedence":case"data-precedence":break;case"children":case"dangerouslySetInnerHTML":throw Error(Ee(399,"link"));default:kNe(A,a,n)}JA(A,MeA),t=EYA,i.state=3}}),JA(A,MeA)}function kNe(A,e,t){var i=e.toLowerCase();switch(typeof t){case"function":case"symbol":return}switch(e){case"innerHTML":case"dangerouslySetInnerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"style":case"ref":return;case"className":i="class",e=""+t;break;case"hidden":if(t===!1)return;e="";break;case"src":case"href":t=Bx(t),e=""+t;break;default:if(2<e.length&&(e[0]==="o"||e[0]==="O")&&(e[1]==="n"||e[1]==="N")||!yeA(e))return;e=""+t}JA(A,FeA),JA(A,Ae(ux(i))),JA(A,FeA),JA(A,Ae(ux(e)))}function veA(){return{styles:new Set,stylesheets:new Set,suspenseyImages:!1}}function JNe(A){var e=Xg||null;if(e){var t=e.resumableState,i=e.renderState;if(typeof A=="string"&&A){if(!t.dnsResources.hasOwnProperty(A)){t.dnsResources[A]=null,t=i.headers;var n,o;(o=t&&0<t.remainingCapacity)&&(o=(n="<"+(""+A).replace(LeA,SeA)+">; rel=dns-prefetch",0<=(t.remainingCapacity-=n.length+2))),o?(i.resets.dns[A]=null,t.preconnects&&(t.preconnects+=", "),t.preconnects+=n):(n=[],ba(n,{href:A,rel:"dns-prefetch"}),i.preconnects.add(n))}Iy(e)}}else Ru.D(A)}function NNe(A,e){var t=Xg||null;if(t){var i=t.resumableState,n=t.renderState;if(typeof A=="string"&&A){var o=e==="use-credentials"?"credentials":typeof e=="string"?"anonymous":"default";if(!i.connectResources[o].hasOwnProperty(A)){i.connectResources[o][A]=null,i=n.headers;var g,a;if(a=i&&0<i.remainingCapacity){if(a="<"+(""+A).replace(LeA,SeA)+">; rel=preconnect",typeof e=="string"){var s=(""+e).replace(HeA,ZeA);a+='; crossorigin="'+s+'"'}a=(g=a,0<=(i.remainingCapacity-=g.length+2))}a?(n.resets.connect[o][A]=null,i.preconnects&&(i.preconnects+=", "),i.preconnects+=g):(o=[],ba(o,{rel:"preconnect",href:A,crossOrigin:e}),n.preconnects.add(o))}Iy(t)}}else Ru.C(A,e)}function YNe(A,e,t){var i=Xg||null;if(i){var n=i.resumableState,o=i.renderState;if(e&&A){switch(e){case"image":if(t)var g=t.imageSrcSet,a=t.imageSizes,s=t.fetchPriority;var I=g?g+`
`+(a||""):A;if(n.imageResources.hasOwnProperty(I))return;n.imageResources[I]=JC,n=o.headers;var r;n&&0<n.remainingCapacity&&typeof g!="string"&&s==="high"&&(r=cU(A,e,t),0<=(n.remainingCapacity-=r.length+2))?(o.resets.image[I]=JC,n.highImagePreloads&&(n.highImagePreloads+=", "),n.highImagePreloads+=r):(n=[],ba(n,Ar({rel:"preload",href:g?void 0:A,as:e},t)),s==="high"?o.highImagePreloads.add(n):(o.bulkPreloads.add(n),o.preloads.images.set(I,n)));break;case"style":if(n.styleResources.hasOwnProperty(A))return;g=[],ba(g,Ar({rel:"preload",href:A,as:e},t)),n.styleResources[A]=!t||typeof t.crossOrigin!="string"&&typeof t.integrity!="string"?JC:[t.crossOrigin,t.integrity],o.preloads.stylesheets.set(A,g),o.bulkPreloads.add(g);break;case"script":if(n.scriptResources.hasOwnProperty(A))return;g=[],o.preloads.scripts.set(A,g),o.bulkPreloads.add(g),ba(g,Ar({rel:"preload",href:A,as:e},t)),n.scriptResources[A]=!t||typeof t.crossOrigin!="string"&&typeof t.integrity!="string"?JC:[t.crossOrigin,t.integrity];break;default:if(n.unknownResources.hasOwnProperty(e)){if(g=n.unknownResources[e],g.hasOwnProperty(A))return}else g={},n.unknownResources[e]=g;if(g[A]=JC,(n=o.headers)&&0<n.remainingCapacity&&e==="font"&&(I=cU(A,e,t),0<=(n.remainingCapacity-=I.length+2)))o.resets.font[A]=JC,n.fontPreloads&&(n.fontPreloads+=", "),n.fontPreloads+=I;else switch(n=[],A=Ar({rel:"preload",href:A,as:e},t),ba(n,A),e){case"font":o.fontPreloads.add(n);break;default:o.bulkPreloads.add(n)}}Iy(i)}}else Ru.L(A,e,t)}function RNe(A,e){var t=Xg||null;if(t){var i=t.resumableState,n=t.renderState;if(A){var o=e&&typeof e.as=="string"?e.as:"script";switch(o){case"script":if(i.moduleScriptResources.hasOwnProperty(A))return;o=[],i.moduleScriptResources[A]=!e||typeof e.crossOrigin!="string"&&typeof e.integrity!="string"?JC:[e.crossOrigin,e.integrity],n.preloads.moduleScripts.set(A,o);break;default:if(i.moduleUnknownResources.hasOwnProperty(o)){var g=i.unknownResources[o];if(g.hasOwnProperty(A))return}else g={},i.moduleUnknownResources[o]=g;o=[],g[A]=JC}ba(o,Ar({rel:"modulepreload",href:A},e)),n.bulkPreloads.add(o),Iy(t)}}else Ru.m(A,e)}function xNe(A,e,t){var i=Xg||null;if(i){var n=i.resumableState,o=i.renderState;if(A){e=e||"default";var g=o.styles.get(e),a=n.styleResources.hasOwnProperty(A)?n.styleResources[A]:void 0;a!==null&&(n.styleResources[A]=null,g||(g={precedence:Ae(mt(e)),rules:[],hrefs:[],sheets:new Map},o.styles.set(e,g)),e={state:0,props:Ar({rel:"stylesheet",href:A,"data-precedence":e},t)},a&&(a.length===2&&dx(e.props,a),(o=o.preloads.stylesheets.get(A))&&0<o.length?o.length=0:e.state=1),g.sheets.set(A,e),Iy(i))}}else Ru.S(A,e,t)}function FNe(A,e){var t=Xg||null;if(t){var i=t.resumableState,n=t.renderState;if(A){var o=i.scriptResources.hasOwnProperty(A)?i.scriptResources[A]:void 0;o!==null&&(i.scriptResources[A]=null,e=Ar({src:A,async:!0},e),o&&(o.length===2&&dx(e,o),A=n.preloads.scripts.get(A))&&(A.length=0),A=[],n.scripts.add(A),rU(A,e),Iy(t))}}else Ru.X(A,e)}function MNe(A,e){var t=Xg||null;if(t){var i=t.resumableState,n=t.renderState;if(A){var o=i.moduleScriptResources.hasOwnProperty(A)?i.moduleScriptResources[A]:void 0;o!==null&&(i.moduleScriptResources[A]=null,e=Ar({src:A,type:"module",async:!0},e),o&&(o.length===2&&dx(e,o),A=n.preloads.moduleScripts.get(A))&&(A.length=0),A=[],n.scripts.add(A),rU(A,e),Iy(t))}}else Ru.M(A,e)}function dx(A,e){A.crossOrigin==null&&(A.crossOrigin=e[0]),A.integrity==null&&(A.integrity=e[1])}function cU(A,e,t){A=(""+A).replace(LeA,SeA),e=(""+e).replace(HeA,ZeA),e="<"+A+'>; rel=preload; as="'+e+'"';for(var i in t)Mn.call(t,i)&&(A=t[i],typeof A=="string"&&(e+="; "+i.toLowerCase()+'="'+(""+A).replace(HeA,ZeA)+'"'));return e}var LeA=/[<>\r\n]/g;function SeA(A){switch(A){case"<":return"%3C";case">":return"%3E";case`
`:return"%0A";case"\r":return"%0D";default:throw Error("escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}var HeA=/["';,\r\n]/g;function ZeA(A){switch(A){case'"':return"%22";case"'":return"%27";case";":return"%3B";case",":return"%2C";case`
`:return"%0A";case"\r":return"%0D";default:throw Error("escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}function vNe(A){this.styles.add(A)}function LNe(A){this.stylesheets.add(A)}function MG(A,e){e.styles.forEach(vNe,A),e.stylesheets.forEach(LNe,A),e.suspenseyImages&&(A.suspenseyImages=!0)}function uYA(A){return 0<A.stylesheets.size||A.suspenseyImages}var SNe=Function.prototype.bind,HNe=Symbol.for("react.client.reference");function BU(A){if(A==null)return null;if(typeof A=="function")return A.$$typeof===HNe?null:A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case fNA:return"Fragment";case bNA:return"Profiler";case yNA:return"StrictMode";case iU:return"Suspense";case heA:return"SuspenseList";case DNA:return"Activity"}if(typeof A=="object")switch(A.$$typeof){case pNA:return"Portal";case tU:return A.displayName||"Context";case wNA:return(A._context.displayName||"Context")+".Consumer";case deA:var e=A.render;return A=A.displayName,A||(A=e.displayName||e.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case meA:return e=A.displayName||null,e!==null?e:BU(A.type)||"Memo";case nU:e=A._payload,A=A._init;try{return BU(A(e))}catch{}}return null}var dYA={},ay=null;function QU(A,e){if(A!==e){A.context._currentValue=A.parentValue,A=A.parent;var t=e.parent;if(A===null){if(t!==null)throw Error(Ee(401))}else{if(t===null)throw Error(Ee(401));QU(A,t)}e.context._currentValue=e.value}}function hYA(A){A.context._currentValue=A.parentValue,A=A.parent,A!==null&&hYA(A)}function mYA(A){var e=A.parent;e!==null&&mYA(e),A.context._currentValue=A.value}function pYA(A,e){if(A.context._currentValue=A.parentValue,A=A.parent,A===null)throw Error(Ee(402));A.depth===e.depth?QU(A,e):pYA(A,e)}function fYA(A,e){var t=e.parent;if(t===null)throw Error(Ee(402));A.depth===t.depth?QU(A,t):fYA(A,t),e.context._currentValue=e.value}function lm(A){var e=ay;e!==A&&(e===null?mYA(A):A===null?hYA(e):e.depth===A.depth?QU(e,A):e.depth>A.depth?pYA(e,A):fYA(e,A),ay=A)}var yYA={enqueueSetState:function(A,e){A=A._reactInternals,A.queue!==null&&A.queue.push(e)},enqueueReplaceState:function(A,e){A=A._reactInternals,A.replace=!0,A.queue=[e]},enqueueForceUpdate:function(){}},WeA={id:1,overflow:""};function sy(A,e,t){var i=A.id;A=A.overflow;var n=32-EU(i)-1;i&=~(1<<n),t+=1;var o=32-EU(e)+n;if(30<o){var g=n-n%5;return o=(i&(1<<g)-1).toString(32),i>>=g,n-=g,{id:1<<32-EU(e)+n|t<<n|i,overflow:o+A}}return{id:1<<o|t<<n|i,overflow:A}}var EU=Math.clz32?Math.clz32:KNe,ZNe=Math.log,WNe=Math.LN2;function KNe(A){return A>>>=0,A===0?32:31-(ZNe(A)/WNe|0)|0}function es(){}var lI=Error(Ee(460));function UNe(A,e,t){switch(t=A[t],t===void 0?A.push(e):t!==e&&(e.then(es,es),e=t),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(es,es):(A=e,A.status="pending",A.then(function(i){if(e.status==="pending"){var n=e;n.status="fulfilled",n.value=i}},function(i){if(e.status==="pending"){var n=e;n.status="rejected",n.reason=i}})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}throw uU=e,lI}}var uU=null;function dU(){if(uU===null)throw Error(Ee(459));var A=uU;return uU=null,A}function VNe(A,e){return A===e&&(A!==0||1/A===1/e)||A!==A&&e!==e}var XNe=typeof Object.is=="function"?Object.is:VNe,xu=null,KeA=null,UeA=null,VeA=null,hU=null,rn=null,hx=!1,mU=!1,mx=0,px=0,fx=-1,pU=0,vG=null,cm=null,fU=0;function Fu(){if(xu===null)throw Error(Ee(321));return xu}function bYA(){if(0<fU)throw Error(Ee(312));return{memoizedState:null,queue:null,next:null}}function XeA(){return rn===null?hU===null?(hx=!1,hU=rn=bYA()):(hx=!0,rn=hU):rn.next===null?(hx=!1,rn=rn.next=bYA()):(hx=!0,rn=rn.next),rn}function LG(){var A=vG;return vG=null,A}function yx(){VeA=UeA=KeA=xu=null,mU=!1,hU=null,fU=0,rn=cm=null}function wYA(A,e){return typeof e=="function"?e(A):e}function DYA(A,e,t){if(xu=Fu(),rn=XeA(),hx){var i=rn.queue;if(e=i.dispatch,cm!==null&&(t=cm.get(i),t!==void 0)){cm.delete(i),i=rn.memoizedState;do i=A(i,t.action),t=t.next;while(t!==null);return rn.memoizedState=i,[i,e]}return[rn.memoizedState,e]}return A=A===wYA?typeof e=="function"?e():e:t!==void 0?t(e):e,rn.memoizedState=A,A=rn.queue={last:null,dispatch:null},A=A.dispatch=zNe.bind(null,xu,A),[rn.memoizedState,A]}function GYA(A,e){if(xu=Fu(),rn=XeA(),e=e===void 0?null:e,rn!==null){var t=rn.memoizedState;if(t!==null&&e!==null){var i=t[1];A:if(i===null)i=!1;else{for(var n=0;n<i.length&&n<e.length;n++)if(!XNe(e[n],i[n])){i=!1;break A}i=!0}if(i)return t[0]}}return A=A(),rn.memoizedState=[A,e],A}function zNe(A,e,t){if(25<=fU)throw Error(Ee(301));if(A===xu)if(mU=!0,A={action:t,next:null},cm===null&&(cm=new Map),t=cm.get(e),t===void 0)cm.set(e,A);else{for(e=t;e.next!==null;)e=e.next;e.next=A}}function TNe(){throw Error(Ee(440))}function _Ne(){throw Error(Ee(394))}function ONe(){throw Error(Ee(479))}function kYA(A,e,t){Fu();var i=px++,n=UeA;if(typeof A.$$FORM_ACTION=="function"){var o=null,g=VeA;n=n.formState;var a=A.$$IS_SIGNATURE_EQUAL;if(n!==null&&typeof a=="function"){var s=n[1];a.call(A,n[2],n[3])&&(o=t!==void 0?"p"+t:"k"+JNA(JSON.stringify([g,null,i]),0),s===o&&(fx=i,e=n[0]))}var I=A.bind(null,e);return A=function(C){I(C)},typeof I.$$FORM_ACTION=="function"&&(A.$$FORM_ACTION=function(C){C=I.$$FORM_ACTION(C),t!==void 0&&(t+="",C.action=t);var l=C.data;return l&&(o===null&&(o=t!==void 0?"p"+t:"k"+JNA(JSON.stringify([g,null,i]),0)),l.append("$ACTION_KEY",o)),C}),[e,A,!1]}var r=A.bind(null,e);return[e,function(C){r(C)},!1]}function JYA(A){var e=pU;return pU+=1,vG===null&&(vG=[]),UNe(vG,A,e)}function qNe(){throw Error(Ee(393))}var NYA={readContext:function(A){return A._currentValue},use:function(A){if(A!==null&&typeof A=="object"){if(typeof A.then=="function")return JYA(A);if(A.$$typeof===tU)return A._currentValue}throw Error(Ee(438,String(A)))},useContext:function(A){return Fu(),A._currentValue},useMemo:GYA,useReducer:DYA,useRef:function(A){xu=Fu(),rn=XeA();var e=rn.memoizedState;return e===null?(A={current:A},rn.memoizedState=A):e},useState:function(A){return DYA(wYA,A)},useInsertionEffect:es,useLayoutEffect:es,useCallback:function(A,e){return GYA(function(){return A},e)},useImperativeHandle:es,useEffect:es,useDebugValue:es,useDeferredValue:function(A,e){return Fu(),e!==void 0?e:A},useTransition:function(){return Fu(),[!1,_Ne]},useId:function(){var A=KeA.treeContext,e=A.overflow;A=A.id,A=(A&~(1<<32-EU(A)-1)).toString(32)+e;var t=yU;if(t===null)throw Error(Ee(404));return e=mx++,A="_"+t.idPrefix+"R_"+A,0<e&&(A+="H"+e.toString(32)),A+"_"},useSyncExternalStore:function(A,e,t){if(t===void 0)throw Error(Ee(407));return t()},useOptimistic:function(A){return Fu(),[A,ONe]},useActionState:kYA,useFormState:kYA,useHostTransitionStatus:function(){return Fu(),zJe},useMemoCache:function(A){for(var e=Array(A),t=0;t<A;t++)e[t]=FJe;return e},useCacheRefresh:function(){return qNe},useEffectEvent:function(){return TNe}},yU=null,jNe={getCacheForType:function(){throw Error(Ee(248))},cacheSignal:function(){throw Error(Ee(248))}},zeA,YYA;function SG(A){if(zeA===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);zeA=e&&e[1]||"",YYA=-1<t.stack.indexOf(`
    at`)?" (<anonymous>)":-1<t.stack.indexOf("@")?"@unknown:0:0":""}return`
`+zeA+A+YYA}var TeA=!1;function bU(A,e){if(!A||TeA)return"";TeA=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(c){var l=c}Reflect.construct(A,[],C)}else{try{C.call()}catch(c){l=c}A.call(C.prototype)}}else{try{throw Error()}catch(c){l=c}(C=A())&&typeof C.catch=="function"&&C.catch(function(){})}}catch(c){if(c&&l&&typeof c.stack=="string")return[c.stack,l.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),g=o[0],a=o[1];if(g&&a){var s=g.split(`
`),I=a.split(`
`);for(n=i=0;i<s.length&&!s[i].includes("DetermineComponentFrameRoot");)i++;for(;n<I.length&&!I[n].includes("DetermineComponentFrameRoot");)n++;if(i===s.length||n===I.length)for(i=s.length-1,n=I.length-1;1<=i&&0<=n&&s[i]!==I[n];)n--;for(;1<=i&&0<=n;i--,n--)if(s[i]!==I[n]){if(i!==1||n!==1)do if(i--,n--,0>n||s[i]!==I[n]){var r=`
`+s[i].replace(" at new "," at ");return A.displayName&&r.includes("<anonymous>")&&(r=r.replace("<anonymous>",A.displayName)),r}while(1<=i&&0<=n);break}}}finally{TeA=!1,Error.prepareStackTrace=t}return(t=A?A.displayName||A.name:"")?SG(t):""}function RYA(A){if(typeof A=="string")return SG(A);if(typeof A=="function")return A.prototype&&A.prototype.isReactComponent?bU(A,!0):bU(A,!1);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case deA:return bU(A.render,!1);case meA:return bU(A.type,!1);case nU:var e=A,t=e._payload;e=e._init;try{A=e(t)}catch{return SG("Lazy")}return RYA(A)}if(typeof A.name=="string"){A:{t=A.name,e=A.env;var i=A.debugLocation;if(i!=null&&(A=Error.prepareStackTrace,Error.prepareStackTrace=void 0,i=i.stack,Error.prepareStackTrace=A,i.startsWith(`Error: react-stack-top-frame
`)&&(i=i.slice(29)),A=i.indexOf(`
`),A!==-1&&(i=i.slice(A+1)),A=i.indexOf("react_stack_bottom_frame"),A!==-1&&(A=i.lastIndexOf(`
`,A)),A=A!==-1?i=i.slice(0,A):"",i=A.lastIndexOf(`
`),A=i===-1?A:A.slice(i+1),A.indexOf(t)!==-1)){t=`
`+A;break A}t=SG(t+(e?" ["+e+"]":""))}return t}}switch(A){case heA:return SG("SuspenseList");case iU:return SG("Suspense")}return""}function HG(A,e){return(500<e.byteSize||uYA(e.contentState))&&e.contentPreamble===null}function PNe(A){if(typeof A=="object"&&A!==null&&typeof A.environmentName=="string"){var e=A.environmentName;A=[A].slice(0),typeof A[0]=="string"?A.splice(0,1,"%c%s%c "+A[0],"background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px"," "+e+" ",""):A.splice(0,0,"%c%s%c","background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px"," "+e+" ",""),A.unshift(console),e=SNe.apply(console.error,A),e()}else console.error(A);return null}function xYA(A,e,t,i,n,o,g,a,s,I,r){var C=new Set;this.destination=null,this.flushScheduled=!1,this.resumableState=A,this.renderState=e,this.rootFormatContext=t,this.progressiveChunkSize=i===void 0?12800:i,this.status=10,this.fatalError=null,this.pendingRootTasks=this.allPendingTasks=this.nextSegmentId=0,this.completedPreambleSegments=this.completedRootSegment=null,this.byteSize=0,this.abortableTasks=C,this.pingedTasks=[],this.clientRenderedBoundaries=[],this.completedBoundaries=[],this.partialBoundaries=[],this.trackedPostpones=null,this.onError=n===void 0?PNe:n,this.onPostpone=I===void 0?es:I,this.onAllReady=o===void 0?es:o,this.onShellReady=g===void 0?es:g,this.onShellError=a===void 0?es:a,this.onFatalError=s===void 0?es:s,this.formState=r===void 0?null:r}function FYA(A,e,t,i,n,o,g,a,s,I,r,C){return e=new xYA(e,t,i,n,o,g,a,s,I,r,C),t=Bm(e,0,null,i,!1,!1),t.parentFlushed=!0,A=wx(e,null,A,-1,null,t,null,null,e.abortableTasks,null,i,null,WeA,null,null),ry(A),e.pingedTasks.push(A),e}function $Ne(A,e,t,i,n,o,g,a,s,I,r){return A=FYA(A,e,t,i,n,o,g,a,s,I,r,void 0),A.trackedPostpones={workingMap:new Map,rootNodes:[],rootSlots:null},A}function MYA(A,e,t,i,n,o,g,a,s){return t=new xYA(e.resumableState,t,e.rootFormatContext,e.progressiveChunkSize,i,n,o,g,a,s,null),t.nextSegmentId=e.nextSegmentId,typeof e.replaySlots=="number"?(i=Bm(t,0,null,e.rootFormatContext,!1,!1),i.parentFlushed=!0,A=wx(t,null,A,-1,null,i,null,null,t.abortableTasks,null,e.rootFormatContext,null,WeA,null,null),ry(A),t.pingedTasks.push(A),t):(A=_eA(t,null,{nodes:e.replayNodes,slots:e.replaySlots,pendingTasks:0},A,-1,null,null,t.abortableTasks,null,e.rootFormatContext,null,WeA,null,null),ry(A),t.pingedTasks.push(A),t)}function AYe(A,e,t,i,n,o,g,a,s){return A=MYA(A,e,t,i,n,o,g,a,s),A.trackedPostpones={workingMap:new Map,rootNodes:[],rootSlots:null},A}var Xg=null;function vYA(A,e){A.pingedTasks.push(e),A.pingedTasks.length===1&&(A.flushScheduled=A.destination!==null,A.trackedPostpones!==null||A.status===10?RNA(function(){return otA(A)}):peA(function(){return otA(A)}))}function bx(A,e,t,i,n){return t={status:0,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,row:e,completedSegments:[],byteSize:0,fallbackAbortableTasks:t,errorDigest:null,contentState:veA(),fallbackState:veA(),contentPreamble:i,fallbackPreamble:n,trackedContentKeyPath:null,trackedFallbackNode:null},e!==null&&(e.pendingTasks++,i=e.boundaries,i!==null&&(A.allPendingTasks++,t.pendingTasks++,i.push(t)),A=e.inheritedHoistables,A!==null&&MG(t.contentState,A)),t}function wx(A,e,t,i,n,o,g,a,s,I,r,C,l,c,B){A.allPendingTasks++,n===null?A.pendingRootTasks++:n.pendingTasks++,c!==null&&c.pendingTasks++;var E={replay:null,node:t,childIndex:i,ping:function(){return vYA(A,E)},blockedBoundary:n,blockedSegment:o,blockedPreamble:g,hoistableState:a,abortSet:s,keyPath:I,formatContext:r,context:C,treeContext:l,row:c,componentStack:B,thenableState:e};return s.add(E),E}function _eA(A,e,t,i,n,o,g,a,s,I,r,C,l,c){A.allPendingTasks++,o===null?A.pendingRootTasks++:o.pendingTasks++,l!==null&&l.pendingTasks++,t.pendingTasks++;var B={replay:t,node:i,childIndex:n,ping:function(){return vYA(A,B)},blockedBoundary:o,blockedSegment:null,blockedPreamble:null,hoistableState:g,abortSet:a,keyPath:s,formatContext:I,context:r,treeContext:C,row:l,componentStack:c,thenableState:e};return a.add(B),B}function Bm(A,e,t,i,n,o){return{status:0,parentFlushed:!1,id:-1,index:e,chunks:[],children:[],preambleChildren:[],parentFormatContext:i,boundary:t,lastPushedText:n,textEmbedded:o}}function ry(A){var e=A.node;if(typeof e=="object"&&e!==null)switch(e.$$typeof){case mNA:A.componentStack={parent:A.componentStack,type:e.type}}}function OeA(A){return A===null?null:{parent:A.parent,type:"Suspense Fallback"}}function Qm(A){var e={};return A&&Object.defineProperty(e,"componentStack",{configurable:!0,enumerable:!0,get:function(){try{var t="",i=A;do t+=RYA(i.type),i=i.parent;while(i);var n=t}catch(o){n=`
Error generating stack: `+o.message+`
`+o.stack}return Object.defineProperty(e,"componentStack",{value:n}),n}}),e}function wa(A,e,t){if(A=A.onError,e=A(e,t),e==null||typeof e=="string")return e}function Dx(A,e){var t=A.onShellError,i=A.onFatalError;t(e),i(e),A.destination!==null?(A.status=14,FNA(A.destination,e)):(A.status=13,A.fatalError=e)}function Da(A,e){qeA(A,e.next,e.hoistables)}function qeA(A,e,t){for(;e!==null;){t!==null&&(MG(e.hoistables,t),e.inheritedHoistables=t);var i=e.boundaries;if(i!==null){e.boundaries=null;for(var n=0;n<i.length;n++){var o=i[n];t!==null&&MG(o.contentState,t),Em(A,o,null,null)}}if(e.pendingTasks--,0<e.pendingTasks)break;t=e.hoistables,e=e.next}}function jeA(A,e){var t=e.boundaries;if(t!==null&&e.pendingTasks===t.length){for(var i=!0,n=0;n<t.length;n++){var o=t[n];if(o.pendingTasks!==1||o.parentFlushed||HG(A,o)){i=!1;break}}i&&qeA(A,e,e.hoistables)}}function Gx(A){var e={pendingTasks:1,boundaries:null,hoistables:veA(),inheritedHoistables:null,together:!1,next:null};return A!==null&&0<A.pendingTasks&&(e.pendingTasks++,e.boundaries=[],A.next=e),e}function LYA(A,e,t,i,n){var o=e.keyPath,g=e.treeContext,a=e.row;e.keyPath=t,t=i.length;var s=null;if(e.replay!==null){var I=e.replay.slots;if(I!==null&&typeof I=="object")for(var r=0;r<t;r++){var C=n!=="backwards"&&n!=="unstable_legacy-backwards"?r:t-1-r,l=i[C];e.row=s=Gx(s),e.treeContext=sy(g,t,C);var c=I[C];typeof c=="number"?(DU(A,e,c,l,C),delete I[C]):lg(A,e,l,C),--s.pendingTasks===0&&Da(A,s)}else for(I=0;I<t;I++)r=n!=="backwards"&&n!=="unstable_legacy-backwards"?I:t-1-I,C=i[r],e.row=s=Gx(s),e.treeContext=sy(g,t,r),lg(A,e,C,r),--s.pendingTasks===0&&Da(A,s)}else if(n!=="backwards"&&n!=="unstable_legacy-backwards")for(n=0;n<t;n++)I=i[n],e.row=s=Gx(s),e.treeContext=sy(g,t,n),lg(A,e,I,n),--s.pendingTasks===0&&Da(A,s);else{for(n=e.blockedSegment,I=n.children.length,r=n.chunks.length,C=t-1;0<=C;C--){l=i[C],e.row=s=Gx(s),e.treeContext=sy(g,t,C),c=Bm(A,r,null,e.formatContext,C===0?n.lastPushedText:!0,!0),n.children.splice(I,0,c),e.blockedSegment=c;try{lg(A,e,l,C),c.lastPushedText&&c.textEmbedded&&c.chunks.push(Ac),c.status=1,ZG(A,e.blockedBoundary,c),--s.pendingTasks===0&&Da(A,s)}catch(B){throw c.status=A.status===12?3:4,B}}e.blockedSegment=n,n.lastPushedText=!1}a!==null&&s!==null&&0<s.pendingTasks&&(a.pendingTasks++,s.next=a),e.treeContext=g,e.row=a,e.keyPath=o}function SYA(A,e,t,i,n,o){var g=e.thenableState;for(e.thenableState=null,xu={},KeA=e,UeA=A,VeA=t,px=mx=0,fx=-1,pU=0,vG=g,A=i(n,o);mU;)mU=!1,px=mx=0,fx=-1,pU=0,fU+=1,rn=null,A=i(n,o);return yx(),A}function HYA(A,e,t,i,n,o,g){var a=!1;if(o!==0&&A.formState!==null){var s=e.blockedSegment;if(s!==null){a=!0,s=s.chunks;for(var I=0;I<o;I++)I===g?s.push(t2e):s.push(i2e)}}o=e.keyPath,e.keyPath=t,n?(t=e.treeContext,e.treeContext=sy(t,1,0),lg(A,e,i,-1),e.treeContext=t):a?lg(A,e,i,-1):YC(A,e,i,-1),e.keyPath=o}function wU(A,e,t,i,n,o){if(typeof i=="function")if(i.prototype&&i.prototype.isReactComponent){var g=n;if("ref"in n){g={};for(var a in n)a!=="ref"&&(g[a]=n[a])}var s=i.defaultProps;if(s){g===n&&(g=Ar({},g,n));for(var I in s)g[I]===void 0&&(g[I]=s[I])}n=g,g=dYA,s=i.contextType,typeof s=="object"&&s!==null&&(g=s._currentValue),g=new i(n,g);var r=g.state!==void 0?g.state:null;if(g.updater=yYA,g.props=n,g.state=r,s={queue:[],replace:!1},g._reactInternals=s,o=i.contextType,g.context=typeof o=="object"&&o!==null?o._currentValue:dYA,o=i.getDerivedStateFromProps,typeof o=="function"&&(o=o(n,r),r=o==null?r:Ar({},r,o),g.state=r),typeof i.getDerivedStateFromProps!="function"&&typeof g.getSnapshotBeforeUpdate!="function"&&(typeof g.UNSAFE_componentWillMount=="function"||typeof g.componentWillMount=="function"))if(i=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),i!==g.state&&yYA.enqueueReplaceState(g,g.state,null),s.queue!==null&&0<s.queue.length)if(i=s.queue,o=s.replace,s.queue=null,s.replace=!1,o&&i.length===1)g.state=i[0];else{for(s=o?i[0]:g.state,r=!0,o=o?1:0;o<i.length;o++)I=i[o],I=typeof I=="function"?I.call(g,s,n,void 0):I,I!=null&&(r?(r=!1,s=Ar({},s,I)):Ar(s,I));g.state=s}else s.queue=null;if(i=g.render(),A.status===12)throw null;n=e.keyPath,e.keyPath=t,YC(A,e,i,-1),e.keyPath=n}else{if(i=SYA(A,e,t,i,n,void 0),A.status===12)throw null;HYA(A,e,t,i,mx!==0,px,fx)}else if(typeof i=="string")if(g=e.blockedSegment,g===null)g=n.children,s=e.formatContext,r=e.keyPath,e.formatContext=VNA(s,i,n),e.keyPath=t,lg(A,e,g,-1),e.formatContext=s,e.keyPath=r;else{if(r=r2e(g.chunks,i,n,A.resumableState,A.renderState,e.blockedPreamble,e.hoistableState,e.formatContext,g.lastPushedText),g.lastPushedText=!1,s=e.formatContext,o=e.keyPath,e.keyPath=t,(e.formatContext=VNA(s,i,n)).insertionMode===3){t=Bm(A,0,null,e.formatContext,!1,!1),g.preambleChildren.push(t),e.blockedSegment=t;try{t.status=6,lg(A,e,r,-1),t.lastPushedText&&t.textEmbedded&&t.chunks.push(Ac),t.status=1,ZG(A,e.blockedBoundary,t)}finally{e.blockedSegment=g}}else lg(A,e,r,-1);e.formatContext=s,e.keyPath=o;A:{switch(e=g.chunks,A=A.resumableState,i){case"title":case"style":case"script":case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break A;case"body":if(1>=s.insertionMode){A.hasBody=!0;break A}break;case"html":if(s.insertionMode===0){A.hasHtml=!0;break A}break;case"head":if(1>=s.insertionMode)break A}e.push(gy(i))}g.lastPushedText=!1}else{switch(i){case xJe:case yNA:case bNA:case fNA:i=e.keyPath,e.keyPath=t,YC(A,e,n.children,-1),e.keyPath=i;return;case DNA:i=e.blockedSegment,i===null?n.mode!=="hidden"&&(i=e.keyPath,e.keyPath=t,lg(A,e,n.children,-1),e.keyPath=i):n.mode!=="hidden"&&(i.chunks.push(c2e),i.lastPushedText=!1,g=e.keyPath,e.keyPath=t,lg(A,e,n.children,-1),e.keyPath=g,i.chunks.push(B2e),i.lastPushedText=!1);return;case heA:A:{if(i=n.children,n=n.revealOrder,n==="forwards"||n==="backwards"||n==="unstable_legacy-backwards"){if(oU(i)){LYA(A,e,t,i,n);break A}if((g=kNA(i))&&(g=g.call(i))){if(s=g.next(),!s.done){do s=g.next();while(!s.done);LYA(A,e,t,i,n)}break A}}n==="together"?(n=e.keyPath,g=e.row,s=e.row=Gx(null),s.boundaries=[],s.together=!0,e.keyPath=t,YC(A,e,i,-1),--s.pendingTasks===0&&Da(A,s),e.keyPath=n,e.row=g,g!==null&&0<s.pendingTasks&&(g.pendingTasks++,s.next=g)):(n=e.keyPath,e.keyPath=t,YC(A,e,i,-1),e.keyPath=n)}return;case MJe:case RJe:throw Error(Ee(343));case iU:A:if(e.replay!==null){i=e.keyPath,g=e.formatContext,s=e.row,e.keyPath=t,e.formatContext=sU(A.resumableState,g),e.row=null,t=n.children;try{lg(A,e,t,-1)}finally{e.keyPath=i,e.formatContext=g,e.row=s}}else{i=e.keyPath,o=e.formatContext;var C=e.row;I=e.blockedBoundary,a=e.blockedPreamble;var l=e.hoistableState,c=e.blockedSegment,B=n.fallback;n=n.children;var E=new Set,u=2>e.formatContext.insertionMode?bx(A,e.row,E,Qx(),Qx()):bx(A,e.row,E,null,null);A.trackedPostpones!==null&&(u.trackedContentKeyPath=t);var d=Bm(A,c.chunks.length,u,e.formatContext,!1,!1);c.children.push(d),c.lastPushedText=!1;var f=Bm(A,0,null,e.formatContext,!1,!1);if(f.parentFlushed=!0,A.trackedPostpones!==null){g=e.componentStack,s=[t[0],"Suspense Fallback",t[2]],r=[s[1],s[2],[],null],A.trackedPostpones.workingMap.set(s,r),u.trackedFallbackNode=r,e.blockedSegment=d,e.blockedPreamble=u.fallbackPreamble,e.keyPath=s,e.formatContext=DeA(A.resumableState,o),e.componentStack=OeA(g),d.status=6;try{lg(A,e,B,-1),d.lastPushedText&&d.textEmbedded&&d.chunks.push(Ac),d.status=1,ZG(A,I,d)}catch(w){throw d.status=A.status===12?3:4,w}finally{e.blockedSegment=c,e.blockedPreamble=a,e.keyPath=i,e.formatContext=o}e=wx(A,null,n,-1,u,f,u.contentPreamble,u.contentState,e.abortSet,t,sU(A.resumableState,e.formatContext),e.context,e.treeContext,null,g),ry(e),A.pingedTasks.push(e)}else{e.blockedBoundary=u,e.blockedPreamble=u.contentPreamble,e.hoistableState=u.contentState,e.blockedSegment=f,e.keyPath=t,e.formatContext=sU(A.resumableState,o),e.row=null,f.status=6;try{if(lg(A,e,n,-1),f.lastPushedText&&f.textEmbedded&&f.chunks.push(Ac),f.status=1,ZG(A,u,f),Jx(u,f),u.pendingTasks===0&&u.status===0){if(u.status=1,!HG(A,u)){C!==null&&--C.pendingTasks===0&&Da(A,C),A.pendingRootTasks===0&&e.blockedPreamble&&Nx(A);break A}}else C!==null&&C.together&&jeA(A,C)}catch(w){u.status=4,A.status===12?(f.status=3,g=A.fatalError):(f.status=4,g=w),s=Qm(e.componentStack),r=wa(A,g,s),u.errorDigest=r,etA(A,u)}finally{e.blockedBoundary=I,e.blockedPreamble=a,e.hoistableState=l,e.blockedSegment=c,e.keyPath=i,e.formatContext=o,e.row=C}e=wx(A,null,B,-1,I,d,u.fallbackPreamble,u.fallbackState,E,[t[0],"Suspense Fallback",t[2]],DeA(A.resumableState,e.formatContext),e.context,e.treeContext,e.row,OeA(e.componentStack)),ry(e),A.pingedTasks.push(e)}}return}if(typeof i=="object"&&i!==null)switch(i.$$typeof){case deA:if("ref"in n)for(c in g={},n)c!=="ref"&&(g[c]=n[c]);else g=n;i=SYA(A,e,t,i.render,g,o),HYA(A,e,t,i,mx!==0,px,fx);return;case meA:wU(A,e,t,i.type,n,o);return;case tU:if(s=n.children,g=e.keyPath,n=n.value,r=i._currentValue,i._currentValue=n,o=ay,ay=i={parent:o,depth:o===null?0:o.depth+1,context:i,parentValue:r,value:n},e.context=i,e.keyPath=t,YC(A,e,s,-1),A=ay,A===null)throw Error(Ee(403));A.context._currentValue=A.parentValue,A=ay=A.parent,e.context=A,e.keyPath=g;return;case wNA:n=n.children,i=n(i._context._currentValue),n=e.keyPath,e.keyPath=t,YC(A,e,i,-1),e.keyPath=n;return;case nU:if(g=i._init,i=g(i._payload),A.status===12)throw null;wU(A,e,t,i,n,o);return}throw Error(Ee(130,i==null?i:typeof i,""))}}function DU(A,e,t,i,n){var o=e.replay,g=e.blockedBoundary,a=Bm(A,0,null,e.formatContext,!1,!1);a.id=t,a.parentFlushed=!0;try{e.replay=null,e.blockedSegment=a,lg(A,e,i,n),a.status=1,ZG(A,g,a),g===null?A.completedRootSegment=a:(Jx(g,a),g.parentFlushed&&A.partialBoundaries.push(g))}finally{e.replay=o,e.blockedSegment=null}}function YC(A,e,t,i){e.replay!==null&&typeof e.replay.slots=="number"?DU(A,e,e.replay.slots,t,i):(e.node=t,e.childIndex=i,t=e.componentStack,ry(e),PeA(A,e),e.componentStack=t)}function PeA(A,e){var t=e.node,i=e.childIndex;if(t!==null){if(typeof t=="object"){switch(t.$$typeof){case mNA:var n=t.type,o=t.key,g=t.props;t=g.ref;var a=t!==void 0?t:null,s=BU(n),I=o??(i===-1?0:i);if(o=[e.keyPath,s,I],e.replay!==null)A:{var r=e.replay;for(i=r.nodes,t=0;t<i.length;t++){var C=i[t];if(I===C[1]){if(C.length===4){if(s!==null&&s!==C[0])throw Error(Ee(490,C[0],s));var l=C[2];s=C[3],I=e.node,e.replay={nodes:l,slots:s,pendingTasks:1};try{if(wU(A,e,o,n,g,a),e.replay.pendingTasks===1&&0<e.replay.nodes.length)throw Error(Ee(488));e.replay.pendingTasks--}catch(R){if(typeof R=="object"&&R!==null&&(R===lI||typeof R.then=="function"))throw e.node===I?e.replay=r:i.splice(t,1),R;e.replay.pendingTasks--,g=Qm(e.componentStack),o=A,A=e.blockedBoundary,n=R,g=wa(o,n,g),kx(o,A,l,s,n,g)}e.replay=r}else{if(n!==iU)throw Error(Ee(490,"Suspense",BU(n)||"Unknown"));e:{r=void 0,n=C[5],a=C[2],s=C[3],I=C[4]===null?[]:C[4][2],C=C[4]===null?null:C[4][3];var c=e.keyPath,B=e.formatContext,E=e.row,u=e.replay,d=e.blockedBoundary,f=e.hoistableState,w=g.children,y=g.fallback,G=new Set;g=2>e.formatContext.insertionMode?bx(A,e.row,G,Qx(),Qx()):bx(A,e.row,G,null,null),g.parentFlushed=!0,g.rootSegmentID=n,e.blockedBoundary=g,e.hoistableState=g.contentState,e.keyPath=o,e.formatContext=sU(A.resumableState,B),e.row=null,e.replay={nodes:a,slots:s,pendingTasks:1};try{if(lg(A,e,w,-1),e.replay.pendingTasks===1&&0<e.replay.nodes.length)throw Error(Ee(488));if(e.replay.pendingTasks--,g.pendingTasks===0&&g.status===0){g.status=1,A.completedBoundaries.push(g);break e}}catch(R){g.status=4,l=Qm(e.componentStack),r=wa(A,R,l),g.errorDigest=r,e.replay.pendingTasks--,A.clientRenderedBoundaries.push(g)}finally{e.blockedBoundary=d,e.hoistableState=f,e.replay=u,e.keyPath=c,e.formatContext=B,e.row=E}l=_eA(A,null,{nodes:I,slots:C,pendingTasks:0},y,-1,d,g.fallbackState,G,[o[0],"Suspense Fallback",o[2]],DeA(A.resumableState,e.formatContext),e.context,e.treeContext,e.row,OeA(e.componentStack)),ry(l),A.pingedTasks.push(l)}}i.splice(t,1);break A}}}else wU(A,e,o,n,g,a);return;case pNA:throw Error(Ee(257));case nU:if(l=t._init,t=l(t._payload),A.status===12)throw null;YC(A,e,t,i);return}if(oU(t)){$eA(A,e,t,i);return}if((l=kNA(t))&&(l=l.call(t))){if(t=l.next(),!t.done){g=[];do g.push(t.value),t=l.next();while(!t.done);$eA(A,e,g,i)}return}if(typeof t.then=="function")return e.thenableState=null,YC(A,e,JYA(t),i);if(t.$$typeof===tU)return YC(A,e,t._currentValue,i);throw i=Object.prototype.toString.call(t),Error(Ee(31,i==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":i))}typeof t=="string"?(i=e.blockedSegment,i!==null&&(i.lastPushedText=zNA(i.chunks,t,A.renderState,i.lastPushedText))):(typeof t=="number"||typeof t=="bigint")&&(i=e.blockedSegment,i!==null&&(i.lastPushedText=zNA(i.chunks,""+t,A.renderState,i.lastPushedText)))}}function $eA(A,e,t,i){var n=e.keyPath;if(i!==-1&&(e.keyPath=[e.keyPath,"Fragment",i],e.replay!==null)){for(var o=e.replay,g=o.nodes,a=0;a<g.length;a++){var s=g[a];if(s[1]===i){i=s[2],s=s[3],e.replay={nodes:i,slots:s,pendingTasks:1};try{if($eA(A,e,t,-1),e.replay.pendingTasks===1&&0<e.replay.nodes.length)throw Error(Ee(488));e.replay.pendingTasks--}catch(C){if(typeof C=="object"&&C!==null&&(C===lI||typeof C.then=="function"))throw C;e.replay.pendingTasks--,t=Qm(e.componentStack);var I=e.blockedBoundary,r=C;t=wa(A,r,t),kx(A,I,i,s,r,t)}e.replay=o,g.splice(a,1);break}}e.keyPath=n;return}if(o=e.treeContext,g=t.length,e.replay!==null&&(a=e.replay.slots,a!==null&&typeof a=="object")){for(i=0;i<g;i++)s=t[i],e.treeContext=sy(o,g,i),I=a[i],typeof I=="number"?(DU(A,e,I,s,i),delete a[i]):lg(A,e,s,i);e.treeContext=o,e.keyPath=n;return}for(a=0;a<g;a++)i=t[a],e.treeContext=sy(o,g,a),lg(A,e,i,a);e.treeContext=o,e.keyPath=n}function ZYA(A,e,t){if(t.status=5,t.rootSegmentID=A.nextSegmentId++,A=t.trackedContentKeyPath,A===null)throw Error(Ee(486));var i=t.trackedFallbackNode,n=[],o=e.workingMap.get(A);return o===void 0?(t=[A[1],A[2],n,null,i,t.rootSegmentID],e.workingMap.set(A,t),xU(t,A[0],e),t):(o[4]=i,o[5]=t.rootSegmentID,o)}function AtA(A,e,t,i){i.status=5;var n=t.keyPath,o=t.blockedBoundary;if(o===null)i.id=A.nextSegmentId++,e.rootSlots=i.id,A.completedRootSegment!==null&&(A.completedRootSegment.status=5);else{if(o!==null&&o.status===0){var g=ZYA(A,e,o);if(o.trackedContentKeyPath===n&&t.childIndex===-1){i.id===-1&&(i.id=i.parentFlushed?o.rootSegmentID:A.nextSegmentId++),g[3]=i.id;return}}if(i.id===-1&&(i.id=i.parentFlushed&&o!==null?o.rootSegmentID:A.nextSegmentId++),t.childIndex===-1)n===null?e.rootSlots=i.id:(t=e.workingMap.get(n),t===void 0?(t=[n[1],n[2],[],i.id],xU(t,n[0],e)):t[3]=i.id);else{if(n===null){if(A=e.rootSlots,A===null)A=e.rootSlots={};else if(typeof A=="number")throw Error(Ee(491))}else if(o=e.workingMap,g=o.get(n),g===void 0)A={},g=[n[1],n[2],[],A],o.set(n,g),xU(g,n[0],e);else if(A=g[3],A===null)A=g[3]={};else if(typeof A=="number")throw Error(Ee(491));A[t.childIndex]=i.id}}}function etA(A,e){A=A.trackedPostpones,A!==null&&(e=e.trackedContentKeyPath,e!==null&&(e=A.workingMap.get(e),e!==void 0&&(e.length=4,e[2]=[],e[3]=null)))}function WYA(A,e,t){return _eA(A,t,e.replay,e.node,e.childIndex,e.blockedBoundary,e.hoistableState,e.abortSet,e.keyPath,e.formatContext,e.context,e.treeContext,e.row,e.componentStack)}function KYA(A,e,t){var i=e.blockedSegment,n=Bm(A,i.chunks.length,null,e.formatContext,i.lastPushedText,!0);return i.children.push(n),i.lastPushedText=!1,wx(A,t,e.node,e.childIndex,e.blockedBoundary,n,e.blockedPreamble,e.hoistableState,e.abortSet,e.keyPath,e.formatContext,e.context,e.treeContext,e.row,e.componentStack)}function lg(A,e,t,i){var n=e.formatContext,o=e.context,g=e.keyPath,a=e.treeContext,s=e.componentStack,I=e.blockedSegment;if(I===null){I=e.replay;try{return YC(A,e,t,i)}catch(l){if(yx(),t=l===lI?dU():l,A.status!==12&&typeof t=="object"&&t!==null){if(typeof t.then=="function"){i=l===lI?LG():null,A=WYA(A,e,i).ping,t.then(A,A),e.formatContext=n,e.context=o,e.keyPath=g,e.treeContext=a,e.componentStack=s,e.replay=I,lm(o);return}if(t.message==="Maximum call stack size exceeded"){t=l===lI?LG():null,t=WYA(A,e,t),A.pingedTasks.push(t),e.formatContext=n,e.context=o,e.keyPath=g,e.treeContext=a,e.componentStack=s,e.replay=I,lm(o);return}}}}else{var r=I.children.length,C=I.chunks.length;try{return YC(A,e,t,i)}catch(l){if(yx(),I.children.length=r,I.chunks.length=C,t=l===lI?dU():l,A.status!==12&&typeof t=="object"&&t!==null){if(typeof t.then=="function"){I=t,t=l===lI?LG():null,A=KYA(A,e,t).ping,I.then(A,A),e.formatContext=n,e.context=o,e.keyPath=g,e.treeContext=a,e.componentStack=s,lm(o);return}if(t.message==="Maximum call stack size exceeded"){I=l===lI?LG():null,I=KYA(A,e,I),A.pingedTasks.push(I),e.formatContext=n,e.context=o,e.keyPath=g,e.treeContext=a,e.componentStack=s,lm(o);return}}}}throw e.formatContext=n,e.context=o,e.keyPath=g,e.treeContext=a,lm(o),t}function eYe(A){var e=A.blockedBoundary,t=A.blockedSegment;t!==null&&(t.status=3,Em(this,e,A.row,t))}function kx(A,e,t,i,n,o){for(var g=0;g<t.length;g++){var a=t[g];if(a.length===4)kx(A,e,a[2],a[3],n,o);else{a=a[5];var s=A,I=o,r=bx(s,null,new Set,null,null);r.parentFlushed=!0,r.rootSegmentID=a,r.status=4,r.errorDigest=I,r.parentFlushed&&s.clientRenderedBoundaries.push(r)}}if(t.length=0,i!==null){if(e===null)throw Error(Ee(487));if(e.status!==4&&(e.status=4,e.errorDigest=o,e.parentFlushed&&A.clientRenderedBoundaries.push(e)),typeof i=="object")for(var C in i)delete i[C]}}function ttA(A,e,t){var i=A.blockedBoundary,n=A.blockedSegment;if(n!==null){if(n.status===6)return;n.status=3}var o=Qm(A.componentStack);if(i===null){if(e.status!==13&&e.status!==14){if(i=A.replay,i===null){e.trackedPostpones!==null&&n!==null?(i=e.trackedPostpones,wa(e,t,o),AtA(e,i,A,n),Em(e,null,A.row,n)):(wa(e,t,o),Dx(e,t));return}i.pendingTasks--,i.pendingTasks===0&&0<i.nodes.length&&(n=wa(e,t,o),kx(e,null,i.nodes,i.slots,t,n)),e.pendingRootTasks--,e.pendingRootTasks===0&&ntA(e)}}else{var g=e.trackedPostpones;if(i.status!==4){if(g!==null&&n!==null)return wa(e,t,o),AtA(e,g,A,n),i.fallbackAbortableTasks.forEach(function(a){return ttA(a,e,t)}),i.fallbackAbortableTasks.clear(),Em(e,i,A.row,n);i.status=4,n=wa(e,t,o),i.status=4,i.errorDigest=n,etA(e,i),i.parentFlushed&&e.clientRenderedBoundaries.push(i)}i.pendingTasks--,n=i.row,n!==null&&--n.pendingTasks===0&&Da(e,n),i.fallbackAbortableTasks.forEach(function(a){return ttA(a,e,t)}),i.fallbackAbortableTasks.clear()}A=A.row,A!==null&&--A.pendingTasks===0&&Da(e,A),e.allPendingTasks--,e.allPendingTasks===0&&GU(e)}function itA(A,e){try{var t=A.renderState,i=t.onHeaders;if(i){var n=t.headers;if(n){t.headers=null;var o=n.preconnects;if(n.fontPreloads&&(o&&(o+=", "),o+=n.fontPreloads),n.highImagePreloads&&(o&&(o+=", "),o+=n.highImagePreloads),!e){var g=t.styles.values(),a=g.next();A:for(;0<n.remainingCapacity&&!a.done;a=g.next())for(var s=a.value.sheets.values(),I=s.next();0<n.remainingCapacity&&!I.done;I=s.next()){var r=I.value,C=r.props,l=C.href,c=r.props,B=cU(c.href,"style",{crossOrigin:c.crossOrigin,integrity:c.integrity,nonce:c.nonce,type:c.type,fetchPriority:c.fetchPriority,referrerPolicy:c.referrerPolicy,media:c.media});if(0<=(n.remainingCapacity-=B.length+2))t.resets.style[l]=JC,o&&(o+=", "),o+=B,t.resets.style[l]=typeof C.crossOrigin=="string"||typeof C.integrity=="string"?[C.crossOrigin,C.integrity]:JC;else break A}}i(o?{Link:o}:{})}}}catch(E){wa(A,E,{})}}function ntA(A){A.trackedPostpones===null&&itA(A,!0),A.trackedPostpones===null&&Nx(A),A.onShellError=es,A=A.onShellReady,A()}function GU(A){itA(A,A.trackedPostpones===null?!0:A.completedRootSegment===null||A.completedRootSegment.status!==5),Nx(A),A=A.onAllReady,A()}function Jx(A,e){if(e.chunks.length===0&&e.children.length===1&&e.children[0].boundary===null&&e.children[0].id===-1){var t=e.children[0];t.id=e.id,t.parentFlushed=!0,t.status!==1&&t.status!==3&&t.status!==4||Jx(A,t)}else A.completedSegments.push(e)}function ZG(A,e,t){if(SJe!==null){t=t.chunks;for(var i=0,n=0;n<t.length;n++)i+=t[n].byteLength;e===null?A.byteSize+=i:e.byteSize+=i}}function Em(A,e,t,i){if(t!==null&&(--t.pendingTasks===0?Da(A,t):t.together&&jeA(A,t)),A.allPendingTasks--,e===null){if(i!==null&&i.parentFlushed){if(A.completedRootSegment!==null)throw Error(Ee(389));A.completedRootSegment=i}A.pendingRootTasks--,A.pendingRootTasks===0&&ntA(A)}else if(e.pendingTasks--,e.status!==4)if(e.pendingTasks===0){if(e.status===0&&(e.status=1),i!==null&&i.parentFlushed&&(i.status===1||i.status===3)&&Jx(e,i),e.parentFlushed&&A.completedBoundaries.push(e),e.status===1)t=e.row,t!==null&&MG(t.hoistables,e.contentState),HG(A,e)||(e.fallbackAbortableTasks.forEach(eYe,A),e.fallbackAbortableTasks.clear(),t!==null&&--t.pendingTasks===0&&Da(A,t)),A.pendingRootTasks===0&&A.trackedPostpones===null&&e.contentPreamble!==null&&Nx(A);else if(e.status===5&&(e=e.row,e!==null)){if(A.trackedPostpones!==null){t=A.trackedPostpones;var n=e.next;if(n!==null&&(i=n.boundaries,i!==null))for(n.boundaries=null,n=0;n<i.length;n++){var o=i[n];ZYA(A,t,o),Em(A,o,null,null)}}--e.pendingTasks===0&&Da(A,e)}}else i===null||!i.parentFlushed||i.status!==1&&i.status!==3||(Jx(e,i),e.completedSegments.length===1&&e.parentFlushed&&A.partialBoundaries.push(e)),e=e.row,e!==null&&e.together&&jeA(A,e);A.allPendingTasks===0&&GU(A)}function otA(A){if(A.status!==14&&A.status!==13){var e=ay,t=RG.H;RG.H=NYA;var i=RG.A;RG.A=jNe;var n=Xg;Xg=A;var o=yU;yU=A.resumableState;try{var g=A.pingedTasks,a;for(a=0;a<g.length;a++){var s=g[a],I=A,r=s.blockedSegment;if(r===null){var C=I;if(s.replay.pendingTasks!==0){lm(s.context);try{if(typeof s.replay.slots=="number"?DU(C,s,s.replay.slots,s.node,s.childIndex):PeA(C,s),s.replay.pendingTasks===1&&0<s.replay.nodes.length)throw Error(Ee(488));s.replay.pendingTasks--,s.abortSet.delete(s),Em(C,s.blockedBoundary,s.row,null)}catch(K){yx();var l=K===lI?dU():K;if(typeof l=="object"&&l!==null&&typeof l.then=="function"){var c=s.ping;l.then(c,c),s.thenableState=K===lI?LG():null}else{s.replay.pendingTasks--,s.abortSet.delete(s);var B=Qm(s.componentStack);I=void 0;var E=C,u=s.blockedBoundary,d=C.status===12?C.fatalError:l,f=s.replay.nodes,w=s.replay.slots;I=wa(E,d,B),kx(E,u,f,w,d,I),C.pendingRootTasks--,C.pendingRootTasks===0&&ntA(C),C.allPendingTasks--,C.allPendingTasks===0&&GU(C)}}finally{}}}else if(C=void 0,E=r,E.status===0){E.status=6,lm(s.context);var y=E.children.length,G=E.chunks.length;try{PeA(I,s),E.lastPushedText&&E.textEmbedded&&E.chunks.push(Ac),s.abortSet.delete(s),E.status=1,ZG(I,s.blockedBoundary,E),Em(I,s.blockedBoundary,s.row,E)}catch(K){yx(),E.children.length=y,E.chunks.length=G;var R=K===lI?dU():I.status===12?I.fatalError:K;if(I.status===12&&I.trackedPostpones!==null){var x=I.trackedPostpones,F=Qm(s.componentStack);s.abortSet.delete(s),wa(I,R,F),AtA(I,x,s,E),Em(I,s.blockedBoundary,s.row,E)}else if(typeof R=="object"&&R!==null&&typeof R.then=="function"){E.status=0,s.thenableState=K===lI?LG():null;var Q=s.ping;R.then(Q,Q)}else{var k=Qm(s.componentStack);s.abortSet.delete(s),E.status=4;var h=s.blockedBoundary,N=s.row;if(N!==null&&--N.pendingTasks===0&&Da(I,N),I.allPendingTasks--,C=wa(I,R,k),h===null)Dx(I,R);else if(h.pendingTasks--,h.status!==4){h.status=4,h.errorDigest=C,etA(I,h);var v=h.row;v!==null&&--v.pendingTasks===0&&Da(I,v),h.parentFlushed&&I.clientRenderedBoundaries.push(h),I.pendingRootTasks===0&&I.trackedPostpones===null&&h.contentPreamble!==null&&Nx(I)}I.allPendingTasks===0&&GU(I)}}finally{}}}g.splice(0,a),A.destination!==null&&NU(A,A.destination)}catch(K){wa(A,K,{}),Dx(A,K)}finally{yU=o,RG.H=t,RG.A=i,t===NYA&&lm(e),Xg=n}}}function gtA(A,e,t){e.preambleChildren.length&&t.push(e.preambleChildren);for(var i=!1,n=0;n<e.children.length;n++)i=UYA(A,e.children[n],t)||i;return i}function UYA(A,e,t){var i=e.boundary;if(i===null)return gtA(A,e,t);var n=i.contentPreamble,o=i.fallbackPreamble;if(n===null||o===null)return!1;switch(i.status){case 1:if(sYA(A.renderState,n),A.byteSize+=i.byteSize,e=i.completedSegments[0],!e)throw Error(Ee(391));return gtA(A,e,t);case 5:if(A.trackedPostpones!==null)return!0;case 4:if(e.status===1)return sYA(A.renderState,o),gtA(A,e,t);default:return!0}}function Nx(A){if(A.completedRootSegment&&A.completedPreambleSegments===null){var e=[],t=A.byteSize,i=UYA(A,A.completedRootSegment,e),n=A.renderState.preamble;i===!1||n.headChunks&&n.bodyChunks?A.completedPreambleSegments=e:A.byteSize=t}}function kU(A,e,t,i){switch(t.parentFlushed=!0,t.status){case 0:t.id=A.nextSegmentId++;case 5:return i=t.id,t.lastPushedText=!1,t.textEmbedded=!1,A=A.renderState,JA(e,C2e),JA(e,A.placeholderPrefix),A=Ae(i.toString(16)),JA(e,A),zi(e,l2e);case 1:t.status=2;var n=!0,o=t.chunks,g=0;t=t.children;for(var a=0;a<t.length;a++){for(n=t[a];g<n.index;g++)JA(e,o[g]);n=Rx(A,e,n,i)}for(;g<o.length-1;g++)JA(e,o[g]);return g<o.length&&(n=zi(e,o[g])),n;case 3:return!0;default:throw Error(Ee(390))}}var Yx=0;function Rx(A,e,t,i){var n=t.boundary;if(n===null)return kU(A,e,t,i);if(n.parentFlushed=!0,n.status===4){var o=n.row;o!==null&&--o.pendingTasks===0&&Da(A,o),n=n.errorDigest,zi(e,d2e),JA(e,m2e),n&&(JA(e,f2e),JA(e,Ae(mt(n))),JA(e,p2e)),zi(e,y2e),kU(A,e,t,i)}else if(n.status!==1)n.status===0&&(n.rootSegmentID=A.nextSegmentId++),0<n.completedSegments.length&&A.partialBoundaries.push(n),IYA(e,A.renderState,n.rootSegmentID),i&&MG(i,n.fallbackState),kU(A,e,t,i);else if(!JU&&HG(A,n)&&(Yx+n.byteSize>A.progressiveChunkSize||uYA(n.contentState)))n.rootSegmentID=A.nextSegmentId++,A.completedBoundaries.push(n),IYA(e,A.renderState,n.rootSegmentID),kU(A,e,t,i);else{if(Yx+=n.byteSize,i&&MG(i,n.contentState),t=n.row,t!==null&&HG(A,n)&&--t.pendingTasks===0&&Da(A,t),zi(e,Q2e),t=n.completedSegments,t.length!==1)throw Error(Ee(391));Rx(A,e,t[0],i)}return zi(e,h2e)}function atA(A,e,t,i){return X2e(e,A.renderState,t.parentFormatContext,t.id),Rx(A,e,t,i),z2e(e,t.parentFormatContext)}function VYA(A,e,t){Yx=t.byteSize;for(var i=t.completedSegments,n=0;n<i.length;n++)XYA(A,e,t,i[n]);i.length=0,i=t.row,i!==null&&HG(A,t)&&--i.pendingTasks===0&&Da(A,i),lYA(e,t.contentState,A.renderState),i=A.resumableState,A=A.renderState,n=t.rootSegmentID,t=t.contentState;var o=A.stylesToHoist;return A.stylesToHoist=!1,JA(e,A.startInlineScript),JA(e,_n),o?(!(i.instructions&4)&&(i.instructions|=4,JA(e,nNe)),!(i.instructions&2)&&(i.instructions|=2,JA(e,CYA)),i.instructions&8?JA(e,$2e):(i.instructions|=8,JA(e,P2e))):(!(i.instructions&2)&&(i.instructions|=2,JA(e,CYA)),JA(e,j2e)),i=Ae(n.toString(16)),JA(e,A.boundaryPrefix),JA(e,i),JA(e,ANe),JA(e,A.segmentPrefix),JA(e,i),o?(JA(e,eNe),GNe(e,t)):JA(e,tNe),t=zi(e,iNe),rYA(e,A)&&t}function XYA(A,e,t,i){if(i.status===2)return!0;var n=t.contentState,o=i.id;if(o===-1){if((i.id=t.rootSegmentID)===-1)throw Error(Ee(392));return atA(A,e,i,n)}return o===t.rootSegmentID?atA(A,e,i,n):(atA(A,e,i,n),t=A.resumableState,A=A.renderState,JA(e,A.startInlineScript),JA(e,_n),t.instructions&1?JA(e,_2e):(t.instructions|=1,JA(e,T2e)),JA(e,A.segmentPrefix),o=Ae(o.toString(16)),JA(e,o),JA(e,O2e),JA(e,A.placeholderPrefix),JA(e,o),e=zi(e,q2e),e)}var JU=!1;function NU(A,e){rI=new Uint8Array(2048),II=0;try{if(!(0<A.pendingRootTasks)){var t,i=A.completedRootSegment;if(i!==null){if(i.status===5)return;var n=A.completedPreambleSegments;if(n===null)return;Yx=A.byteSize;var o=A.resumableState,g=A.renderState,a=g.preamble,s=a.htmlChunks,I=a.headChunks,r;if(s){for(r=0;r<s.length;r++)JA(e,s[r]);if(I)for(r=0;r<I.length;r++)JA(e,I[r]);else JA(e,zo("head")),JA(e,_n)}else if(I)for(r=0;r<I.length;r++)JA(e,I[r]);var C=g.charsetChunks;for(r=0;r<C.length;r++)JA(e,C[r]);C.length=0,g.preconnects.forEach(ec,e),g.preconnects.clear();var l=g.viewportChunks;for(r=0;r<l.length;r++)JA(e,l[r]);l.length=0,g.fontPreloads.forEach(ec,e),g.fontPreloads.clear(),g.highImagePreloads.forEach(ec,e),g.highImagePreloads.clear(),xG=g,g.styles.forEach(bNe,e),xG=null;var c=g.importMapChunks;for(r=0;r<c.length;r++)JA(e,c[r]);c.length=0,g.bootstrapScripts.forEach(ec,e),g.scripts.forEach(ec,e),g.scripts.clear(),g.bulkPreloads.forEach(ec,e),g.bulkPreloads.clear(),s||I||(o.instructions|=32);var B=g.hoistableChunks;for(r=0;r<B.length;r++)JA(e,B[r]);for(o=B.length=0;o<n.length;o++){var E=n[o];for(g=0;g<E.length;g++)Rx(A,e,E[g],null)}var u=A.renderState.preamble,d=u.headChunks;(u.htmlChunks||d)&&JA(e,gy("head"));var f=u.bodyChunks;if(f)for(n=0;n<f.length;n++)JA(e,f[n]);Rx(A,e,i,null),A.completedRootSegment=null;var w=A.renderState;if(A.allPendingTasks!==0||A.clientRenderedBoundaries.length!==0||A.completedBoundaries.length!==0||A.trackedPostpones!==null&&(A.trackedPostpones.rootNodes.length!==0||A.trackedPostpones.rootSlots!==null)){var y=A.resumableState;if(!(y.instructions&64)){if(y.instructions|=64,JA(e,w.startInlineScript),!(y.instructions&32)){y.instructions|=32;var G="_"+y.idPrefix+"R_";JA(e,BYA),JA(e,Ae(mt(G))),JA(e,Tn)}JA(e,_n),JA(e,I2e),zi(e,gU)}}rYA(e,w)}var R=A.renderState;i=0;var x=R.viewportChunks;for(i=0;i<x.length;i++)JA(e,x[i]);x.length=0,R.preconnects.forEach(ec,e),R.preconnects.clear(),R.fontPreloads.forEach(ec,e),R.fontPreloads.clear(),R.highImagePreloads.forEach(ec,e),R.highImagePreloads.clear(),R.styles.forEach(DNe,e),R.scripts.forEach(ec,e),R.scripts.clear(),R.bulkPreloads.forEach(ec,e),R.bulkPreloads.clear();var F=R.hoistableChunks;for(i=0;i<F.length;i++)JA(e,F[i]);F.length=0;var Q=A.clientRenderedBoundaries;for(t=0;t<Q.length;t++){var k=Q[t];R=e;var h=A.resumableState,N=A.renderState,v=k.rootSegmentID,K=k.errorDigest;JA(R,N.startInlineScript),JA(R,_n),h.instructions&4?JA(R,gNe):(h.instructions|=4,JA(R,oNe)),JA(R,N.boundaryPrefix),JA(R,Ae(v.toString(16))),JA(R,aNe),K&&(JA(R,sNe),JA(R,Ae(CNe(K||""))));var U=zi(R,rNe);if(!U){A.destination=null,t++,Q.splice(0,t);return}}Q.splice(0,t);var V=A.completedBoundaries;for(t=0;t<V.length;t++)if(!VYA(A,e,V[t])){A.destination=null,t++,V.splice(0,t);return}V.splice(0,t),feA(e),rI=new Uint8Array(2048),II=0,JU=!0;var X=A.partialBoundaries;for(t=0;t<X.length;t++){var _=X[t];A:{Q=A,k=e,Yx=_.byteSize;var q=_.completedSegments;for(U=0;U<q.length;U++)if(!XYA(Q,k,_,q[U])){U++,q.splice(0,U);var $=!1;break A}q.splice(0,U);var nA=_.row;nA!==null&&nA.together&&_.pendingTasks===1&&(nA.pendingTasks===1?qeA(Q,nA,nA.hoistables):nA.pendingTasks--),$=lYA(k,_.contentState,Q.renderState)}if(!$){A.destination=null,t++,X.splice(0,t);return}}X.splice(0,t),JU=!1;var j=A.completedBoundaries;for(t=0;t<j.length;t++)if(!VYA(A,e,j[t])){A.destination=null,t++,j.splice(0,t);return}j.splice(0,t)}}finally{JU=!1,A.allPendingTasks===0&&A.clientRenderedBoundaries.length===0&&A.completedBoundaries.length===0?(A.flushScheduled=!1,t=A.resumableState,t.hasBody&&JA(e,gy("body")),t.hasHtml&&JA(e,gy("html")),feA(e),A.status=14,e.close(),A.destination=null):feA(e)}}function YU(A){A.flushScheduled=A.destination!==null,RNA(function(){return otA(A)}),peA(function(){A.status===10&&(A.status=11),A.trackedPostpones===null&&itA(A,A.pendingRootTasks===0)})}function Iy(A){A.flushScheduled===!1&&A.pingedTasks.length===0&&A.destination!==null&&(A.flushScheduled=!0,peA(function(){var e=A.destination;e?NU(A,e):A.flushScheduled=!1}))}function RU(A,e){if(A.status===13)A.status=14,FNA(e,A.fatalError);else if(A.status!==14&&A.destination===null){A.destination=e;try{NU(A,e)}catch(t){wa(A,t,{}),Dx(A,t)}}}function RC(A,e){(A.status===11||A.status===10)&&(A.status=12);try{var t=A.abortableTasks;if(0<t.size){var i=e===void 0?Error(Ee(432)):typeof e=="object"&&e!==null&&typeof e.then=="function"?Error(Ee(530)):e;A.fatalError=i,t.forEach(function(n){return ttA(n,A,i)}),t.clear()}A.destination!==null&&NU(A,A.destination)}catch(n){wa(A,n,{}),Dx(A,n)}}function xU(A,e,t){if(e===null)t.rootNodes.push(A);else{var i=t.workingMap,n=i.get(e);n===void 0&&(n=[e[1],e[2],[],null],i.set(e,n),xU(n,e[0],t)),n[2].push(A)}}function zYA(A){var e=A.trackedPostpones;if(e===null||e.rootNodes.length===0&&e.rootSlots===null)return A.trackedPostpones=null;if(A.completedRootSegment===null||A.completedRootSegment.status!==5&&A.completedPreambleSegments!==null){var t=A.nextSegmentId,i=e.rootSlots,n=A.resumableState;n.bootstrapScriptContent=void 0,n.bootstrapScripts=void 0,n.bootstrapModules=void 0}else{t=0,i=-1,n=A.resumableState;var o=A.renderState;n.nextFormID=0,n.hasBody=!1,n.hasHtml=!1,n.unknownResources={font:o.resets.font},n.dnsResources=o.resets.dns,n.connectResources=o.resets.connect,n.imageResources=o.resets.image,n.styleResources=o.resets.style,n.scriptResources={},n.moduleUnknownResources={},n.moduleScriptResources={},n.instructions=0}return{nextSegmentId:t,rootFormatContext:A.rootFormatContext,progressiveChunkSize:A.progressiveChunkSize,resumableState:A.resumableState,replayNodes:e.rootNodes,replaySlots:i}}function TYA(){var A=ueA.version;if(A!=="19.2.3")throw Error(Ee(527,A,"19.2.3"))}TYA(),TYA(),YG.prerender=function(A,e){return new Promise(function(t,i){var n=e?e.onHeaders:void 0,o;n&&(o=function(r){n(new Headers(r))});var g=KNA(e?e.identifierPrefix:void 0,e?e.unstable_externalRuntimeSrc:void 0,e?e.bootstrapScriptContent:void 0,e?e.bootstrapScripts:void 0,e?e.bootstrapModules:void 0),a=$Ne(A,g,aU(g,void 0,e?e.unstable_externalRuntimeSrc:void 0,e?e.importMap:void 0,o,e?e.maxHeadersLength:void 0),UNA(e?e.namespaceURI:void 0),e?e.progressiveChunkSize:void 0,e?e.onError:void 0,function(){var r=new ReadableStream({type:"bytes",pull:function(C){RU(a,C)},cancel:function(C){a.destination=null,RC(a,C)}},{highWaterMark:0});r={postponed:zYA(a),prelude:r},t(r)},void 0,void 0,i,e?e.onPostpone:void 0);if(e&&e.signal){var s=e.signal;if(s.aborted)RC(a,s.reason);else{var I=function(){RC(a,s.reason),s.removeEventListener("abort",I)};s.addEventListener("abort",I)}}YU(a)})},YG.renderToReadableStream=function(A,e){return new Promise(function(t,i){var n,o,g=new Promise(function(c,B){o=c,n=B}),a=e?e.onHeaders:void 0,s;a&&(s=function(c){a(new Headers(c))});var I=KNA(e?e.identifierPrefix:void 0,e?e.unstable_externalRuntimeSrc:void 0,e?e.bootstrapScriptContent:void 0,e?e.bootstrapScripts:void 0,e?e.bootstrapModules:void 0),r=FYA(A,I,aU(I,e?e.nonce:void 0,e?e.unstable_externalRuntimeSrc:void 0,e?e.importMap:void 0,s,e?e.maxHeadersLength:void 0),UNA(e?e.namespaceURI:void 0),e?e.progressiveChunkSize:void 0,e?e.onError:void 0,o,function(){var c=new ReadableStream({type:"bytes",pull:function(B){RU(r,B)},cancel:function(B){r.destination=null,RC(r,B)}},{highWaterMark:0});c.allReady=g,t(c)},function(c){g.catch(function(){}),i(c)},n,e?e.onPostpone:void 0,e?e.formState:void 0);if(e&&e.signal){var C=e.signal;if(C.aborted)RC(r,C.reason);else{var l=function(){RC(r,C.reason),C.removeEventListener("abort",l)};C.addEventListener("abort",l)}}YU(r)})},YG.resume=function(A,e,t){return new Promise(function(i,n){var o,g,a=new Promise(function(C,l){g=C,o=l}),s=MYA(A,e,aU(e.resumableState,t?t.nonce:void 0,void 0,void 0,void 0,void 0),t?t.onError:void 0,g,function(){var C=new ReadableStream({type:"bytes",pull:function(l){RU(s,l)},cancel:function(l){s.destination=null,RC(s,l)}},{highWaterMark:0});C.allReady=a,i(C)},function(C){a.catch(function(){}),n(C)},o,t?t.onPostpone:void 0);if(t&&t.signal){var I=t.signal;if(I.aborted)RC(s,I.reason);else{var r=function(){RC(s,I.reason),I.removeEventListener("abort",r)};I.addEventListener("abort",r)}}YU(s)})},YG.resumeAndPrerender=function(A,e,t){return new Promise(function(i,n){var o=AYe(A,e,aU(e.resumableState,void 0,void 0,void 0,void 0,void 0),t?t.onError:void 0,function(){var s=new ReadableStream({type:"bytes",pull:function(I){RU(o,I)},cancel:function(I){o.destination=null,RC(o,I)}},{highWaterMark:0});s={postponed:zYA(o),prelude:s},i(s)},void 0,void 0,n,t?t.onPostpone:void 0);if(t&&t.signal){var g=t.signal;if(g.aborted)RC(o,g.reason);else{var a=function(){RC(o,g.reason),g.removeEventListener("abort",a)};g.addEventListener("abort",a)}}YU(o)})},YG.version="19.2.3";var FU,stA;FU=DK,stA=YG,FU.version;var tYe=FU.renderToString;FU.renderToStaticMarkup,stA.renderToReadableStream,stA.resume;var iYe=Object.defineProperty,nYe=(A,e,t)=>e in A?iYe(A,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):A[e]=t,ai=(A,e,t)=>(nYe(A,typeof e!="symbol"?e+"":e,t),t);function MU(A,e){return MU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},MU(A,e)}function _YA(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,MU(A,e)}function qe(){return qe=Object.assign?Object.assign.bind():function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},qe.apply(this,arguments)}function tc(A){return tc=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},tc(A)}function oYe(A,e){if(tc(A)!=="object"||A===null)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var i=t.call(A,e||"default");if(tc(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function OYA(A){var e=oYe(A,"string");return tc(e)==="symbol"?e:String(e)}function ic(A,e,t){return e=OYA(e),e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function qYA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function jYA(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qYA(Object(t),!0).forEach(function(i){ic(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):qYA(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function er(A){return"Minified Redux error #"+A+"; visit https://redux.js.org/Errors?code="+A+" for the full message or use the non-minified dev environment for full errors. "}var PYA=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),rtA=function(){return Math.random().toString(36).substring(7).split("").join(".")},$YA={INIT:"@@redux/INIT"+rtA(),REPLACE:"@@redux/REPLACE"+rtA(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+rtA()}};function gYe(A){if(typeof A!="object"||A===null)return!1;for(var e=A;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(A)===e}function ARA(A,e,t){var i;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(er(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(er(1));return t(ARA)(A,e)}if(typeof A!="function")throw new Error(er(2));var n=A,o=e,g=[],a=g,s=!1;function I(){a===g&&(a=g.slice())}function r(){if(s)throw new Error(er(3));return o}function C(E){if(typeof E!="function")throw new Error(er(4));if(s)throw new Error(er(5));var u=!0;return I(),a.push(E),function(){if(u){if(s)throw new Error(er(6));u=!1,I();var d=a.indexOf(E);a.splice(d,1),g=null}}}function l(E){if(!gYe(E))throw new Error(er(7));if(typeof E.type>"u")throw new Error(er(8));if(s)throw new Error(er(9));try{s=!0,o=n(o,E)}finally{s=!1}for(var u=g=a,d=0;d<u.length;d++){var f=u[d];f()}return E}function c(E){if(typeof E!="function")throw new Error(er(10));n=E,l({type:$YA.REPLACE})}function B(){var E,u=C;return E={subscribe:function(d){if(typeof d!="object"||d===null)throw new Error(er(11));function f(){d.next&&d.next(r())}f();var w=u(f);return{unsubscribe:w}}},E[PYA]=function(){return this},E}return l({type:$YA.INIT}),i={dispatch:l,subscribe:C,getState:r,replaceReducer:c},i[PYA]=B,i}function eRA(A,e){return function(){return e(A.apply(this,arguments))}}function tRA(A,e){if(typeof A=="function")return eRA(A,e);if(typeof A!="object"||A===null)throw new Error(er(16));var t={};for(var i in A){var n=A[i];typeof n=="function"&&(t[i]=eRA(n,e))}return t}function iRA(){for(var A=arguments.length,e=new Array(A),t=0;t<A;t++)e[t]=arguments[t];return e.length===0?function(i){return i}:e.length===1?e[0]:e.reduce(function(i,n){return function(){return i(n.apply(void 0,arguments))}})}function aYe(){for(var A=arguments.length,e=new Array(A),t=0;t<A;t++)e[t]=arguments[t];return function(i){return function(){var n=i.apply(void 0,arguments),o=function(){throw new Error(er(15))},g={getState:n.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=e.map(function(s){return s(g)});return o=iRA.apply(void 0,a)(n.dispatch),jYA(jYA({},n),{},{dispatch:o})}}}var um=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xC(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var nRA={exports:{}},ItA={};/**
 * @license React
 * use-sync-external-store-shim.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var oRA;function sYe(){if(oRA)return ItA;oRA=1;var A=b;function e(C,l){return C===l&&(C!==0||1/C===1/l)||C!==C&&l!==l}var t=typeof Object.is=="function"?Object.is:e,i=A.useState,n=A.useEffect,o=A.useLayoutEffect,g=A.useDebugValue;function a(C,l){var c=l(),B=i({inst:{value:c,getSnapshot:l}}),E=B[0].inst,u=B[1];return o(function(){E.value=c,E.getSnapshot=l,s(E)&&u({inst:E})},[C,c,l]),n(function(){return s(E)&&u({inst:E}),C(function(){s(E)&&u({inst:E})})},[C]),g(c),c}function s(C){var l=C.getSnapshot;C=C.value;try{var c=l();return!t(C,c)}catch{return!0}}function I(C,l){return l()}var r=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?I:a;return ItA.useSyncExternalStore=A.useSyncExternalStore!==void 0?A.useSyncExternalStore:r,ItA}nRA.exports=sYe();var gRA=nRA.exports,CtA={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var aRA;function rYe(){if(aRA)return CtA;aRA=1;var A=b,e=gRA;function t(I,r){return I===r&&(I!==0||1/I===1/r)||I!==I&&r!==r}var i=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,o=A.useRef,g=A.useEffect,a=A.useMemo,s=A.useDebugValue;return CtA.useSyncExternalStoreWithSelector=function(I,r,C,l,c){var B=o(null);if(B.current===null){var E={hasValue:!1,value:null};B.current=E}else E=B.current;B=a(function(){function d(R){if(!f){if(f=!0,w=R,R=l(R),c!==void 0&&E.hasValue){var x=E.value;if(c(x,R))return y=x}return y=R}if(x=y,i(w,R))return x;var F=l(R);return c!==void 0&&c(x,F)?x:(w=R,y=F)}var f=!1,w,y,G=C===void 0?null:C;return[function(){return d(r())},G===null?void 0:function(){return d(G())}]},[r,C,l,c]);var u=n(I,B[0],B[1]);return g(function(){E.hasValue=!0,E.value=u},[u]),s(u),u},CtA}rYe();function IYe(A){A()}let sRA=IYe;const CYe=A=>sRA=A,lYe=()=>sRA,rRA=Symbol.for("react-redux-context"),IRA=typeof globalThis<"u"?globalThis:{};function cYe(){var A;if(!p.createContext)return{};const e=(A=IRA[rRA])!=null?A:IRA[rRA]=new Map;let t=e.get(p.createContext);return t||(t=p.createContext(null),e.set(p.createContext,t)),t}const CRA=cYe(),BYe=()=>{throw new Error("uSES not initialized!")};function WG(){return WG=Object.assign?Object.assign.bind():function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},WG.apply(this,arguments)}function lRA(A,e){if(A==null)return{};var t={},i=Object.keys(A),n,o;for(o=0;o<i.length;o++)n=i[o],!(e.indexOf(n)>=0)&&(t[n]=A[n]);return t}var cRA={exports:{}},mi={};/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var BRA;function QYe(){if(BRA)return mi;BRA=1;var A=typeof Symbol=="function"&&Symbol.for,e=A?Symbol.for("react.element"):60103,t=A?Symbol.for("react.portal"):60106,i=A?Symbol.for("react.fragment"):60107,n=A?Symbol.for("react.strict_mode"):60108,o=A?Symbol.for("react.profiler"):60114,g=A?Symbol.for("react.provider"):60109,a=A?Symbol.for("react.context"):60110,s=A?Symbol.for("react.async_mode"):60111,I=A?Symbol.for("react.concurrent_mode"):60111,r=A?Symbol.for("react.forward_ref"):60112,C=A?Symbol.for("react.suspense"):60113,l=A?Symbol.for("react.suspense_list"):60120,c=A?Symbol.for("react.memo"):60115,B=A?Symbol.for("react.lazy"):60116,E=A?Symbol.for("react.block"):60121,u=A?Symbol.for("react.fundamental"):60117,d=A?Symbol.for("react.responder"):60118,f=A?Symbol.for("react.scope"):60119;function w(G){if(typeof G=="object"&&G!==null){var R=G.$$typeof;switch(R){case e:switch(G=G.type,G){case s:case I:case i:case o:case n:case C:return G;default:switch(G=G&&G.$$typeof,G){case a:case r:case B:case c:case g:return G;default:return R}}case t:return R}}}function y(G){return w(G)===I}return mi.AsyncMode=s,mi.ConcurrentMode=I,mi.ContextConsumer=a,mi.ContextProvider=g,mi.Element=e,mi.ForwardRef=r,mi.Fragment=i,mi.Lazy=B,mi.Memo=c,mi.Portal=t,mi.Profiler=o,mi.StrictMode=n,mi.Suspense=C,mi.isAsyncMode=function(G){return y(G)||w(G)===s},mi.isConcurrentMode=y,mi.isContextConsumer=function(G){return w(G)===a},mi.isContextProvider=function(G){return w(G)===g},mi.isElement=function(G){return typeof G=="object"&&G!==null&&G.$$typeof===e},mi.isForwardRef=function(G){return w(G)===r},mi.isFragment=function(G){return w(G)===i},mi.isLazy=function(G){return w(G)===B},mi.isMemo=function(G){return w(G)===c},mi.isPortal=function(G){return w(G)===t},mi.isProfiler=function(G){return w(G)===o},mi.isStrictMode=function(G){return w(G)===n},mi.isSuspense=function(G){return w(G)===C},mi.isValidElementType=function(G){return typeof G=="string"||typeof G=="function"||G===i||G===I||G===o||G===n||G===C||G===l||typeof G=="object"&&G!==null&&(G.$$typeof===B||G.$$typeof===c||G.$$typeof===g||G.$$typeof===a||G.$$typeof===r||G.$$typeof===u||G.$$typeof===d||G.$$typeof===f||G.$$typeof===E)},mi.typeOf=w,mi}var QRA;function EYe(){return QRA||(QRA=1,cRA.exports=QYe()),cRA.exports}var ltA=EYe(),uYe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},dYe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},hYe={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ERA={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ctA={};ctA[ltA.ForwardRef]=hYe,ctA[ltA.Memo]=ERA;function uRA(A){return ltA.isMemo(A)?ERA:ctA[A.$$typeof]||uYe}var mYe=Object.defineProperty,pYe=Object.getOwnPropertyNames,dRA=Object.getOwnPropertySymbols,fYe=Object.getOwnPropertyDescriptor,yYe=Object.getPrototypeOf,hRA=Object.prototype;function mRA(A,e,t){if(typeof e!="string"){if(hRA){var i=yYe(e);i&&i!==hRA&&mRA(A,i,t)}var n=pYe(e);dRA&&(n=n.concat(dRA(e)));for(var o=uRA(A),g=uRA(e),a=0;a<n.length;++a){var s=n[a];if(!dYe[s]&&!(t&&t[s])&&!(g&&g[s])&&!(o&&o[s])){var I=fYe(e,s);try{mYe(A,s,I)}catch{}}}}return A}var bYe=mRA;const pRA=xC(bYe);var fRA={exports:{}},pi={};/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var yRA;function wYe(){if(yRA)return pi;yRA=1;var A=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),g=Symbol.for("react.context"),a=Symbol.for("react.server_context"),s=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),r=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),c=Symbol.for("react.offscreen"),B;B=Symbol.for("react.module.reference");function E(u){if(typeof u=="object"&&u!==null){var d=u.$$typeof;switch(d){case A:switch(u=u.type,u){case t:case n:case i:case I:case r:return u;default:switch(u=u&&u.$$typeof,u){case a:case g:case s:case l:case C:case o:return u;default:return d}}case e:return d}}}return pi.ContextConsumer=g,pi.ContextProvider=o,pi.Element=A,pi.ForwardRef=s,pi.Fragment=t,pi.Lazy=l,pi.Memo=C,pi.Portal=e,pi.Profiler=n,pi.StrictMode=i,pi.Suspense=I,pi.SuspenseList=r,pi.isAsyncMode=function(){return!1},pi.isConcurrentMode=function(){return!1},pi.isContextConsumer=function(u){return E(u)===g},pi.isContextProvider=function(u){return E(u)===o},pi.isElement=function(u){return typeof u=="object"&&u!==null&&u.$$typeof===A},pi.isForwardRef=function(u){return E(u)===s},pi.isFragment=function(u){return E(u)===t},pi.isLazy=function(u){return E(u)===l},pi.isMemo=function(u){return E(u)===C},pi.isPortal=function(u){return E(u)===e},pi.isProfiler=function(u){return E(u)===n},pi.isStrictMode=function(u){return E(u)===i},pi.isSuspense=function(u){return E(u)===I},pi.isSuspenseList=function(u){return E(u)===r},pi.isValidElementType=function(u){return typeof u=="string"||typeof u=="function"||u===t||u===n||u===i||u===I||u===r||u===c||typeof u=="object"&&u!==null&&(u.$$typeof===l||u.$$typeof===C||u.$$typeof===o||u.$$typeof===g||u.$$typeof===s||u.$$typeof===B||u.getModuleId!==void 0)},pi.typeOf=E,pi}fRA.exports=wYe();var DYe=fRA.exports;const GYe=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function kYe(A,e,t,i,{areStatesEqual:n,areOwnPropsEqual:o,areStatePropsEqual:g}){let a=!1,s,I,r,C,l;function c(f,w){return s=f,I=w,r=A(s,I),C=e(i,I),l=t(r,C,I),a=!0,l}function B(){return r=A(s,I),e.dependsOnOwnProps&&(C=e(i,I)),l=t(r,C,I),l}function E(){return A.dependsOnOwnProps&&(r=A(s,I)),e.dependsOnOwnProps&&(C=e(i,I)),l=t(r,C,I),l}function u(){const f=A(s,I),w=!g(f,r);return r=f,w&&(l=t(r,C,I)),l}function d(f,w){const y=!o(w,I),G=!n(f,s,w,I);return s=f,I=w,y&&G?B():y?E():G?u():l}return function(f,w){return a?d(f,w):c(f,w)}}function JYe(A,e){let{initMapStateToProps:t,initMapDispatchToProps:i,initMergeProps:n}=e,o=lRA(e,GYe);const g=t(A,o),a=i(A,o),s=n(A,o);return kYe(g,a,s,A,o)}function NYe(A,e){const t={};for(const i in A){const n=A[i];typeof n=="function"&&(t[i]=(...o)=>e(n(...o)))}return t}function BtA(A){return function(e){const t=A(e);function i(){return t}return i.dependsOnOwnProps=!1,i}}function bRA(A){return A.dependsOnOwnProps?!!A.dependsOnOwnProps:A.length!==1}function wRA(A,e){return function(t,{displayName:i}){const n=function(o,g){return n.dependsOnOwnProps?n.mapToProps(o,g):n.mapToProps(o,void 0)};return n.dependsOnOwnProps=!0,n.mapToProps=function(o,g){n.mapToProps=A,n.dependsOnOwnProps=bRA(A);let a=n(o,g);return typeof a=="function"&&(n.mapToProps=a,n.dependsOnOwnProps=bRA(a),a=n(o,g)),a},n}}function QtA(A,e){return(t,i)=>{throw new Error(`Invalid value of type ${typeof A} for ${e} argument when connecting component ${i.wrappedComponentName}.`)}}function YYe(A){return A&&typeof A=="object"?BtA(e=>NYe(A,e)):A?typeof A=="function"?wRA(A):QtA(A,"mapDispatchToProps"):BtA(e=>({dispatch:e}))}function RYe(A){return A?typeof A=="function"?wRA(A):QtA(A,"mapStateToProps"):BtA(()=>({}))}function xYe(A,e,t){return WG({},t,A,e)}function FYe(A){return function(e,{displayName:t,areMergedPropsEqual:i}){let n=!1,o;return function(g,a,s){const I=A(g,a,s);return n?i(I,o)||(o=I):(n=!0,o=I),o}}}function MYe(A){return A?typeof A=="function"?FYe(A):QtA(A,"mergeProps"):()=>xYe}function vYe(){const A=lYe();let e=null,t=null;return{clear(){e=null,t=null},notify(){A(()=>{let i=e;for(;i;)i.callback(),i=i.next})},get(){let i=[],n=e;for(;n;)i.push(n),n=n.next;return i},subscribe(i){let n=!0,o=t={callback:i,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!n||e===null||(n=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}const DRA={notify(){},get:()=>[]};function GRA(A,e){let t,i=DRA,n=0,o=!1;function g(E){r();const u=i.subscribe(E);let d=!1;return()=>{d||(d=!0,u(),C())}}function a(){i.notify()}function s(){B.onStateChange&&B.onStateChange()}function I(){return o}function r(){n++,t||(t=e?e.addNestedSub(s):A.subscribe(s),i=vYe())}function C(){n--,t&&n===0&&(t(),t=void 0,i.clear(),i=DRA)}function l(){o||(o=!0,r())}function c(){o&&(o=!1,C())}const B={addNestedSub:g,notifyNestedSubs:a,handleChangeWrapper:s,isSubscribed:I,trySubscribe:l,tryUnsubscribe:c,getListeners:()=>i};return B}const LYe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vU=LYe?p.useLayoutEffect:p.useEffect;function kRA(A,e){return A===e?A!==0||e!==0||1/A===1/e:A!==A&&e!==e}function EtA(A,e){if(kRA(A,e))return!0;if(typeof A!="object"||A===null||typeof e!="object"||e===null)return!1;const t=Object.keys(A),i=Object.keys(e);if(t.length!==i.length)return!1;for(let n=0;n<t.length;n++)if(!Object.prototype.hasOwnProperty.call(e,t[n])||!kRA(A[t[n]],e[t[n]]))return!1;return!0}const SYe=["reactReduxForwardedRef"];let JRA=BYe;const HYe=A=>{JRA=A},ZYe=[null,null];function WYe(A,e,t){vU(()=>A(...e),t)}function KYe(A,e,t,i,n,o){A.current=i,t.current=!1,n.current&&(n.current=null,o())}function UYe(A,e,t,i,n,o,g,a,s,I,r){if(!A)return()=>{};let C=!1,l=null;const c=()=>{if(C||!a.current)return;const B=e.getState();let E,u;try{E=i(B,n.current)}catch(d){u=d,l=d}u||(l=null),E===o.current?g.current||I():(o.current=E,s.current=E,g.current=!0,r())};return t.onStateChange=c,t.trySubscribe(),c(),()=>{if(C=!0,t.tryUnsubscribe(),t.onStateChange=null,l)throw l}}function VYe(A,e){return A===e}function NRA(A,e,t,{pure:i,areStatesEqual:n=VYe,areOwnPropsEqual:o=EtA,areStatePropsEqual:g=EtA,areMergedPropsEqual:a=EtA,forwardRef:s=!1,context:I=CRA}={}){const r=I,C=RYe(A),l=YYe(e),c=MYe(t),B=!!A;return E=>{const u=E.displayName||E.name||"Component",d=`Connect(${u})`,f={shouldHandleStateChanges:B,displayName:d,wrappedComponentName:u,WrappedComponent:E,initMapStateToProps:C,initMapDispatchToProps:l,initMergeProps:c,areStatesEqual:n,areStatePropsEqual:g,areOwnPropsEqual:o,areMergedPropsEqual:a};function w(G){const[R,x,F]=p.useMemo(()=>{const{reactReduxForwardedRef:iA}=G,aA=lRA(G,SYe);return[G.context,iA,aA]},[G]),Q=p.useMemo(()=>R&&R.Consumer&&DYe.isContextConsumer(p.createElement(R.Consumer,null))?R:r,[R,r]),k=p.useContext(Q),h=!!G.store&&!!G.store.getState&&!!G.store.dispatch,N=!!k&&!!k.store,v=h?G.store:k.store,K=N?k.getServerState:v.getState,U=p.useMemo(()=>JYe(v.dispatch,f),[v]),[V,X]=p.useMemo(()=>{if(!B)return ZYe;const iA=GRA(v,h?void 0:k.subscription),aA=iA.notifyNestedSubs.bind(iA);return[iA,aA]},[v,h,k]),_=p.useMemo(()=>h?k:WG({},k,{subscription:V}),[h,k,V]),q=p.useRef(),$=p.useRef(F),nA=p.useRef(),j=p.useRef(!1);p.useRef(!1);const O=p.useRef(!1),eA=p.useRef();vU(()=>(O.current=!0,()=>{O.current=!1}),[]);const oA=p.useMemo(()=>()=>nA.current&&F===$.current?nA.current:U(v.getState(),F),[v,F]),tA=p.useMemo(()=>iA=>V?UYe(B,v,V,U,$,q,j,O,nA,X,iA):()=>{},[V]);WYe(KYe,[$,q,j,F,nA,X]);let sA;try{sA=JRA(tA,oA,K?()=>U(K(),F):oA)}catch(iA){throw eA.current&&(iA.message+=`
The error may be correlated with this previous error:
${eA.current.stack}

`),iA}vU(()=>{eA.current=void 0,nA.current=void 0,q.current=sA});const gA=p.useMemo(()=>p.createElement(E,WG({},sA,{ref:x})),[x,E,sA]);return p.useMemo(()=>B?p.createElement(Q.Provider,{value:_},gA):gA,[Q,gA,_])}const y=p.memo(w);if(y.WrappedComponent=E,y.displayName=w.displayName=d,s){const G=p.forwardRef(function(R,x){return p.createElement(y,WG({},R,{reactReduxForwardedRef:x}))});return G.displayName=d,G.WrappedComponent=E,pRA(G,E)}return pRA(y,E)}}function XYe({store:A,context:e,children:t,serverState:i,stabilityCheck:n="once",noopCheck:o="once"}){const g=p.useMemo(()=>{const I=GRA(A);return{store:A,subscription:I,getServerState:i?()=>i:void 0,stabilityCheck:n,noopCheck:o}},[A,i,n,o]),a=p.useMemo(()=>A.getState(),[A]);vU(()=>{const{subscription:I}=g;return I.onStateChange=I.notifyNestedSubs,I.trySubscribe(),a!==A.getState()&&I.notifyNestedSubs(),()=>{I.tryUnsubscribe(),I.onStateChange=void 0}},[g,a]);const s=e||CRA;return p.createElement(s.Provider,{value:g},t)}HYe(gRA.useSyncExternalStore),CYe(bt.unstable_batchedUpdates);function zYe(A,e){if(A.length!==e.length)return!1;for(var t=0;t<A.length;t++)if(A[t]!==e[t])return!1;return!0}function YRA(A,e){var t=p.useState(function(){return{inputs:e,result:A()}})[0],i=p.useRef(!0),n=p.useRef(t),o=i.current||!!(e&&n.current.inputs&&zYe(e,n.current.inputs)),g=o?n.current:{inputs:e,result:A()};return p.useEffect(function(){i.current=!1,n.current=g},[g]),g.result}function TYe(A,e){return YRA(function(){return A},e)}var ei=YRA,Ge=TYe,_Ye="Invariant failed";function OYe(A,e){if(!A)throw new Error(_Ye)}var nc=function(A){var e=A.top,t=A.right,i=A.bottom,n=A.left,o=t-n,g=i-e,a={top:e,right:t,bottom:i,left:n,width:o,height:g,x:n,y:e,center:{x:(t+n)/2,y:(i+e)/2}};return a},utA=function(A,e){return{top:A.top-e.top,left:A.left-e.left,bottom:A.bottom+e.bottom,right:A.right+e.right}},RRA=function(A,e){return{top:A.top+e.top,left:A.left+e.left,bottom:A.bottom-e.bottom,right:A.right-e.right}},qYe=function(A,e){return{top:A.top+e.y,left:A.left+e.x,bottom:A.bottom+e.y,right:A.right+e.x}},dtA={top:0,right:0,bottom:0,left:0},htA=function(A){var e=A.borderBox,t=A.margin,i=t===void 0?dtA:t,n=A.border,o=n===void 0?dtA:n,g=A.padding,a=g===void 0?dtA:g,s=nc(utA(e,i)),I=nc(RRA(e,o)),r=nc(RRA(I,a));return{marginBox:s,borderBox:nc(e),paddingBox:I,contentBox:r,margin:i,border:o,padding:a}},FC=function(A){var e=A.slice(0,-2),t=A.slice(-2);if(t!=="px")return 0;var i=Number(e);return isNaN(i)&&OYe(!1),i},jYe=function(){return{x:window.pageXOffset,y:window.pageYOffset}},LU=function(A,e){var t=A.borderBox,i=A.border,n=A.margin,o=A.padding,g=qYe(t,e);return htA({borderBox:g,border:i,margin:n,padding:o})},SU=function(A,e){return e===void 0&&(e=jYe()),LU(A,e)},xRA=function(A,e){var t={top:FC(e.marginTop),right:FC(e.marginRight),bottom:FC(e.marginBottom),left:FC(e.marginLeft)},i={top:FC(e.paddingTop),right:FC(e.paddingRight),bottom:FC(e.paddingBottom),left:FC(e.paddingLeft)},n={top:FC(e.borderTopWidth),right:FC(e.borderRightWidth),bottom:FC(e.borderBottomWidth),left:FC(e.borderLeftWidth)};return htA({borderBox:A,margin:t,padding:i,border:n})},FRA=function(A){var e=A.getBoundingClientRect(),t=window.getComputedStyle(A);return xRA(e,t)},MRA=Number.isNaN||function(A){return typeof A=="number"&&A!==A};function PYe(A,e){return!!(A===e||MRA(A)&&MRA(e))}function $Ye(A,e){if(A.length!==e.length)return!1;for(var t=0;t<A.length;t++)if(!PYe(A[t],e[t]))return!1;return!0}function cg(A,e){e===void 0&&(e=$Ye);var t,i=[],n,o=!1;function g(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return o&&t===this&&e(a,i)||(n=A.apply(this,a),o=!0,t=this,i=a),n}return g}var ARe=function(A){var e=[],t=null,i=function(){for(var n=arguments.length,o=new Array(n),g=0;g<n;g++)o[g]=arguments[g];e=o,!t&&(t=requestAnimationFrame(function(){t=null,A.apply(void 0,e)}))};return i.cancel=function(){t&&(cancelAnimationFrame(t),t=null)},i};const xx=ARe;var vRA=p.createContext({head:document.head,body:document.body}),oc=function(){return p.useContext(vRA)},mtA=vRA.Provider;function LRA(A,e){}var Fpi=LRA.bind(null,"warn");LRA.bind(null,"error");function dm(){}function eRe(A,e){return qe({},A,{},e)}function MC(A,e,t){var i=e.map(function(n){var o=eRe(t,n.options);return A.addEventListener(n.eventName,n.fn,o),function(){A.removeEventListener(n.eventName,n.fn,o)}});return function(){i.forEach(function(n){n()})}}var tRe="Invariant failed";function HU(A){this.message=A}HU.prototype.toString=function(){return this.message};function $A(A,e){if(!A)throw new HU(tRe)}var iRe=function(A){_YA(e,A);function e(){for(var i,n=arguments.length,o=new Array(n),g=0;g<n;g++)o[g]=arguments[g];return i=A.call.apply(A,[this].concat(o))||this,i.callbacks=null,i.unbind=dm,i.onWindowError=function(a){var s=i.getCallbacks();s.isDragging()&&s.tryAbort();var I=a.error;I instanceof HU&&a.preventDefault()},i.getCallbacks=function(){if(!i.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return i.callbacks},i.setCallbacks=function(a){i.callbacks=a},i}var t=e.prototype;return t.componentDidMount=function(){this.unbind=MC(window,[{eventName:"error",fn:this.onWindowError}])},t.componentDidCatch=function(i){if(i instanceof HU){this.setState({});return}throw i},t.componentWillUnmount=function(){this.unbind()},t.render=function(){return this.props.children(this.setCallbacks)},e}(b.Component),nRe=`
  Press space bar to start a drag.
  When dragging you can use the arrow keys to move the item around and escape to cancel.
  Some screen readers may require you to be in focus mode or to use your pass through key
`,ZU=function(A){return A+1},oRe=function(A){return`
  You have lifted an item in position `+ZU(A.source.index)+`
`},SRA=function(A,e){var t=A.droppableId===e.droppableId,i=ZU(A.index),n=ZU(e.index);return t?`
      You have moved the item from position `+i+`
      to position `+n+`
    `:`
    You have moved the item from position `+i+`
    in list `+A.droppableId+`
    to list `+e.droppableId+`
    in position `+n+`
  `},HRA=function(A,e,t){var i=e.droppableId===t.droppableId;return i?`
      The item `+A+`
      has been combined with `+t.draggableId:`
      The item `+A+`
      in list `+e.droppableId+`
      has been combined with `+t.draggableId+`
      in list `+t.droppableId+`
    `},gRe=function(A){var e=A.destination;if(e)return SRA(A.source,e);var t=A.combine;return t?HRA(A.draggableId,A.source,t):"You are over an area that cannot be dropped on"},ZRA=function(A){return`
  The item has returned to its starting position
  of `+ZU(A.index)+`
`},aRe=function(A){if(A.reason==="CANCEL")return`
      Movement cancelled.
      `+ZRA(A.source)+`
    `;var e=A.destination,t=A.combine;return e?`
      You have dropped the item.
      `+SRA(A.source,e)+`
    `:t?`
      You have dropped the item.
      `+HRA(A.draggableId,A.source,t)+`
    `:`
    The item has been dropped while not over a drop area.
    `+ZRA(A.source)+`
  `},WU={dragHandleUsageInstructions:nRe,onDragStart:oRe,onDragUpdate:gRe,onDragEnd:aRe},Bg={x:0,y:0},zg=function(A,e){return{x:A.x+e.x,y:A.y+e.y}},cI=function(A,e){return{x:A.x-e.x,y:A.y-e.y}},hm=function(A,e){return A.x===e.x&&A.y===e.y},KG=function(A){return{x:A.x!==0?-A.x:0,y:A.y!==0?-A.y:0}},Cy=function(A,e,t){var i;return t===void 0&&(t=0),i={},i[A]=e,i[A==="x"?"y":"x"]=t,i},Fx=function(A,e){return Math.sqrt(Math.pow(e.x-A.x,2)+Math.pow(e.y-A.y,2))},WRA=function(A,e){return Math.min.apply(Math,e.map(function(t){return Fx(A,t)}))},KRA=function(A){return function(e){return{x:A(e.x),y:A(e.y)}}},sRe=function(A,e){var t=nc({top:Math.max(e.top,A.top),right:Math.min(e.right,A.right),bottom:Math.min(e.bottom,A.bottom),left:Math.max(e.left,A.left)});return t.width<=0||t.height<=0?null:t},Mx=function(A,e){return{top:A.top+e.y,left:A.left+e.x,bottom:A.bottom+e.y,right:A.right+e.x}},URA=function(A){return[{x:A.left,y:A.top},{x:A.right,y:A.top},{x:A.left,y:A.bottom},{x:A.right,y:A.bottom}]},rRe={top:0,right:0,bottom:0,left:0},IRe=function(A,e){return e?Mx(A,e.scroll.diff.displacement):A},CRe=function(A,e,t){if(t&&t.increasedBy){var i;return qe({},A,(i={},i[e.end]=A[e.end]+t.increasedBy[e.line],i))}return A},lRe=function(A,e){return e&&e.shouldClipSubject?sRe(e.pageMarginBox,A):nc(A)},UG=function(A){var e=A.page,t=A.withPlaceholder,i=A.axis,n=A.frame,o=IRe(e.marginBox,n),g=CRe(o,i,t),a=lRe(g,n);return{page:e,withPlaceholder:t,active:a}},ptA=function(A,e){A.frame||$A(!1);var t=A.frame,i=cI(e,t.scroll.initial),n=KG(i),o=qe({},t,{scroll:{initial:t.scroll.initial,current:e,diff:{value:i,displacement:n},max:t.scroll.max}}),g=UG({page:A.subject.page,withPlaceholder:A.subject.withPlaceholder,axis:A.axis,frame:o}),a=qe({},A,{frame:o,subject:g});return a};function KU(A){return Object.values?Object.values(A):Object.keys(A).map(function(e){return A[e]})}function ftA(A,e){if(A.findIndex)return A.findIndex(e);for(var t=0;t<A.length;t++)if(e(A[t]))return t;return-1}function mm(A,e){if(A.find)return A.find(e);var t=ftA(A,e);if(t!==-1)return A[t]}function VRA(A){return Array.prototype.slice.call(A)}var XRA=cg(function(A){return A.reduce(function(e,t){return e[t.descriptor.id]=t,e},{})}),zRA=cg(function(A){return A.reduce(function(e,t){return e[t.descriptor.id]=t,e},{})}),UU=cg(function(A){return KU(A)}),cRe=cg(function(A){return KU(A)}),VG=cg(function(A,e){var t=cRe(e).filter(function(i){return A===i.descriptor.droppableId}).sort(function(i,n){return i.descriptor.index-n.descriptor.index});return t});function ytA(A){return A.at&&A.at.type==="REORDER"?A.at.destination:null}function VU(A){return A.at&&A.at.type==="COMBINE"?A.at.combine:null}var XU=cg(function(A,e){return e.filter(function(t){return t.descriptor.id!==A.descriptor.id})}),BRe=function(A){var e=A.isMovingForward,t=A.draggable,i=A.destination,n=A.insideDestination,o=A.previousImpact;if(!i.isCombineEnabled)return null;var g=ytA(o);if(!g)return null;function a(E){var u={type:"COMBINE",combine:{draggableId:E,droppableId:i.descriptor.id}};return qe({},o,{at:u})}var s=o.displaced.all,I=s.length?s[0]:null;if(e)return I?a(I):null;var r=XU(t,n);if(!I){if(!r.length)return null;var C=r[r.length-1];return a(C.descriptor.id)}var l=ftA(r,function(E){return E.descriptor.id===I});l===-1&&$A(!1);var c=l-1;if(c<0)return null;var B=r[c];return a(B.descriptor.id)},XG=function(A,e){return A.descriptor.droppableId===e.descriptor.id},TRA={point:Bg,value:0},vx={invisible:{},visible:{},all:[]},QRe={displaced:vx,displacedBy:TRA,at:null},vC=function(A,e){return function(t){return A<=t&&t<=e}},_RA=function(A){var e=vC(A.top,A.bottom),t=vC(A.left,A.right);return function(i){var n=e(i.top)&&e(i.bottom)&&t(i.left)&&t(i.right);if(n)return!0;var o=e(i.top)||e(i.bottom),g=t(i.left)||t(i.right),a=o&&g;if(a)return!0;var s=i.top<A.top&&i.bottom>A.bottom,I=i.left<A.left&&i.right>A.right,r=s&&I;if(r)return!0;var C=s&&g||I&&o;return C}},ERe=function(A){var e=vC(A.top,A.bottom),t=vC(A.left,A.right);return function(i){var n=e(i.top)&&e(i.bottom)&&t(i.left)&&t(i.right);return n}},btA={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},ORA={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},uRe=function(A){return function(e){var t=vC(e.top,e.bottom),i=vC(e.left,e.right);return function(n){return A===btA?t(n.top)&&t(n.bottom):i(n.left)&&i(n.right)}}},dRe=function(A,e){var t=e.frame?e.frame.scroll.diff.displacement:Bg;return Mx(A,t)},hRe=function(A,e,t){return e.subject.active?t(e.subject.active)(A):!1},mRe=function(A,e,t){return t(e)(A)},wtA=function(A){var e=A.target,t=A.destination,i=A.viewport,n=A.withDroppableDisplacement,o=A.isVisibleThroughFrameFn,g=n?dRe(e,t):e;return hRe(g,t,o)&&mRe(g,i,o)},pRe=function(A){return wtA(qe({},A,{isVisibleThroughFrameFn:_RA}))},qRA=function(A){return wtA(qe({},A,{isVisibleThroughFrameFn:ERe}))},fRe=function(A){return wtA(qe({},A,{isVisibleThroughFrameFn:uRe(A.destination.axis)}))},yRe=function(A,e,t){if(typeof t=="boolean")return t;if(!e)return!0;var i=e.invisible,n=e.visible;if(i[A])return!1;var o=n[A];return o?o.shouldAnimate:!0};function bRe(A,e){var t=A.page.marginBox,i={top:e.point.y,right:0,bottom:0,left:e.point.x};return nc(utA(t,i))}function Lx(A){var e=A.afterDragging,t=A.destination,i=A.displacedBy,n=A.viewport,o=A.forceShouldAnimate,g=A.last;return e.reduce(function(a,s){var I=bRe(s,i),r=s.descriptor.id;a.all.push(r);var C=pRe({target:I,destination:t,viewport:n,withDroppableDisplacement:!0});if(!C)return a.invisible[s.descriptor.id]=!0,a;var l=yRe(r,g,o),c={draggableId:r,shouldAnimate:l};return a.visible[r]=c,a},{all:[],visible:{},invisible:{}})}function wRe(A,e){if(!A.length)return 0;var t=A[A.length-1].descriptor.index;return e.inHomeList?t:t+1}function jRA(A){var e=A.insideDestination,t=A.inHomeList,i=A.displacedBy,n=A.destination,o=wRe(e,{inHomeList:t});return{displaced:vx,displacedBy:i,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:o}}}}function zU(A){var e=A.draggable,t=A.insideDestination,i=A.destination,n=A.viewport,o=A.displacedBy,g=A.last,a=A.index,s=A.forceShouldAnimate,I=XG(e,i);if(a==null)return jRA({insideDestination:t,inHomeList:I,displacedBy:o,destination:i});var r=mm(t,function(E){return E.descriptor.index===a});if(!r)return jRA({insideDestination:t,inHomeList:I,displacedBy:o,destination:i});var C=XU(e,t),l=t.indexOf(r),c=C.slice(l),B=Lx({afterDragging:c,destination:i,displacedBy:o,last:g,viewport:n.frame,forceShouldAnimate:s});return{displaced:B,displacedBy:o,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:a}}}}function pm(A,e){return!!e.effected[A]}var DRe=function(A){var e=A.isMovingForward,t=A.destination,i=A.draggables,n=A.combine,o=A.afterCritical;if(!t.isCombineEnabled)return null;var g=n.draggableId,a=i[g],s=a.descriptor.index,I=pm(g,o);return I?e?s:s-1:e?s+1:s},GRe=function(A){var e=A.isMovingForward,t=A.isInHomeList,i=A.insideDestination,n=A.location;if(!i.length)return null;var o=n.index,g=e?o+1:o-1,a=i[0].descriptor.index,s=i[i.length-1].descriptor.index,I=t?s:s+1;return g<a||g>I?null:g},kRe=function(A){var e=A.isMovingForward,t=A.isInHomeList,i=A.draggable,n=A.draggables,o=A.destination,g=A.insideDestination,a=A.previousImpact,s=A.viewport,I=A.afterCritical,r=a.at;if(r||$A(!1),r.type==="REORDER"){var C=GRe({isMovingForward:e,isInHomeList:t,location:r.destination,insideDestination:g});return C==null?null:zU({draggable:i,insideDestination:g,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:C})}var l=DRe({isMovingForward:e,destination:o,displaced:a.displaced,draggables:n,combine:r.combine,afterCritical:I});return l==null?null:zU({draggable:i,insideDestination:g,destination:o,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:l})},JRe=function(A){var e=A.displaced,t=A.afterCritical,i=A.combineWith,n=A.displacedBy,o=!!(e.visible[i]||e.invisible[i]);return pm(i,t)?o?Bg:KG(n.point):o?n.point:Bg},NRe=function(A){var e=A.afterCritical,t=A.impact,i=A.draggables,n=VU(t);n||$A(!1);var o=n.draggableId,g=i[o].page.borderBox.center,a=JRe({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return zg(g,a)},PRA=function(A,e){return e.margin[A.start]+e.borderBox[A.size]/2},YRe=function(A,e){return e.margin[A.end]+e.borderBox[A.size]/2},DtA=function(A,e,t){return e[A.crossAxisStart]+t.margin[A.crossAxisStart]+t.borderBox[A.crossAxisSize]/2},$RA=function(A){var e=A.axis,t=A.moveRelativeTo,i=A.isMoving;return Cy(e.line,t.marginBox[e.end]+PRA(e,i),DtA(e,t.marginBox,i))},A1A=function(A){var e=A.axis,t=A.moveRelativeTo,i=A.isMoving;return Cy(e.line,t.marginBox[e.start]-YRe(e,i),DtA(e,t.marginBox,i))},RRe=function(A){var e=A.axis,t=A.moveInto,i=A.isMoving;return Cy(e.line,t.contentBox[e.start]+PRA(e,i),DtA(e,t.contentBox,i))},xRe=function(A){var e=A.impact,t=A.draggable,i=A.draggables,n=A.droppable,o=A.afterCritical,g=VG(n.descriptor.id,i),a=t.page,s=n.axis;if(!g.length)return RRe({axis:s,moveInto:n.page,isMoving:a});var I=e.displaced,r=e.displacedBy,C=I.all[0];if(C){var l=i[C];if(pm(C,o))return A1A({axis:s,moveRelativeTo:l.page,isMoving:a});var c=LU(l.page,r.point);return A1A({axis:s,moveRelativeTo:c,isMoving:a})}var B=g[g.length-1];if(B.descriptor.id===t.descriptor.id)return a.borderBox.center;if(pm(B.descriptor.id,o)){var E=LU(B.page,KG(o.displacedBy.point));return $RA({axis:s,moveRelativeTo:E,isMoving:a})}return $RA({axis:s,moveRelativeTo:B.page,isMoving:a})},GtA=function(A,e){var t=A.frame;return t?zg(e,t.scroll.diff.displacement):e},FRe=function(A){var e=A.impact,t=A.draggable,i=A.droppable,n=A.draggables,o=A.afterCritical,g=t.page.borderBox.center,a=e.at;return!i||!a?g:a.type==="REORDER"?xRe({impact:e,draggable:t,draggables:n,droppable:i,afterCritical:o}):NRe({impact:e,draggables:n,afterCritical:o})},TU=function(A){var e=FRe(A),t=A.droppable,i=t?GtA(t,e):e;return i},e1A=function(A,e){var t=cI(e,A.scroll.initial),i=KG(t),n=nc({top:e.y,bottom:e.y+A.frame.height,left:e.x,right:e.x+A.frame.width}),o={frame:n,scroll:{initial:A.scroll.initial,max:A.scroll.max,current:e,diff:{value:t,displacement:i}}};return o};function t1A(A,e){return A.map(function(t){return e[t]})}function MRe(A,e){for(var t=0;t<e.length;t++){var i=e[t].visible[A];if(i)return i}return null}var vRe=function(A){var e=A.impact,t=A.viewport,i=A.destination,n=A.draggables,o=A.maxScrollChange,g=e1A(t,zg(t.scroll.current,o)),a=i.frame?ptA(i,zg(i.frame.scroll.current,o)):i,s=e.displaced,I=Lx({afterDragging:t1A(s.all,n),destination:i,displacedBy:e.displacedBy,viewport:g.frame,last:s,forceShouldAnimate:!1}),r=Lx({afterDragging:t1A(s.all,n),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:s,forceShouldAnimate:!1}),C={},l={},c=[s,I,r];s.all.forEach(function(E){var u=MRe(E,c);if(u){l[E]=u;return}C[E]=!0});var B=qe({},e,{displaced:{all:s.all,invisible:C,visible:l}});return B},LRe=function(A,e){return zg(A.scroll.diff.displacement,e)},ktA=function(A){var e=A.pageBorderBoxCenter,t=A.draggable,i=A.viewport,n=LRe(i,e),o=cI(n,t.page.borderBox.center);return zg(t.client.borderBox.center,o)},i1A=function(A){var e=A.draggable,t=A.destination,i=A.newPageBorderBoxCenter,n=A.viewport,o=A.withDroppableDisplacement,g=A.onlyOnMainAxis,a=g===void 0?!1:g,s=cI(i,e.page.borderBox.center),I=Mx(e.page.borderBox,s),r={target:I,destination:t,withDroppableDisplacement:o,viewport:n};return a?fRe(r):qRA(r)},SRe=function(A){var e=A.isMovingForward,t=A.draggable,i=A.destination,n=A.draggables,o=A.previousImpact,g=A.viewport,a=A.previousPageBorderBoxCenter,s=A.previousClientSelection,I=A.afterCritical;if(!i.isEnabled)return null;var r=VG(i.descriptor.id,n),C=XG(t,i),l=BRe({isMovingForward:e,draggable:t,destination:i,insideDestination:r,previousImpact:o})||kRe({isMovingForward:e,isInHomeList:C,draggable:t,draggables:n,destination:i,insideDestination:r,previousImpact:o,viewport:g,afterCritical:I});if(!l)return null;var c=TU({impact:l,draggable:t,droppable:i,draggables:n,afterCritical:I}),B=i1A({draggable:t,destination:i,newPageBorderBoxCenter:c,viewport:g.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(B){var E=ktA({pageBorderBoxCenter:c,draggable:t,viewport:g});return{clientSelection:E,impact:l,scrollJumpRequest:null}}var u=cI(c,a),d=vRe({impact:l,viewport:g,destination:i,draggables:n,maxScrollChange:u});return{clientSelection:s,impact:d,scrollJumpRequest:u}},ts=function(A){var e=A.subject.active;return e||$A(!1),e},HRe=function(A){var e=A.isMovingForward,t=A.pageBorderBoxCenter,i=A.source,n=A.droppables,o=A.viewport,g=i.subject.active;if(!g)return null;var a=i.axis,s=vC(g[a.start],g[a.end]),I=UU(n).filter(function(C){return C!==i}).filter(function(C){return C.isEnabled}).filter(function(C){return!!C.subject.active}).filter(function(C){return _RA(o.frame)(ts(C))}).filter(function(C){var l=ts(C);return e?g[a.crossAxisEnd]<l[a.crossAxisEnd]:l[a.crossAxisStart]<g[a.crossAxisStart]}).filter(function(C){var l=ts(C),c=vC(l[a.start],l[a.end]);return s(l[a.start])||s(l[a.end])||c(g[a.start])||c(g[a.end])}).sort(function(C,l){var c=ts(C)[a.crossAxisStart],B=ts(l)[a.crossAxisStart];return e?c-B:B-c}).filter(function(C,l,c){return ts(C)[a.crossAxisStart]===ts(c[0])[a.crossAxisStart]});if(!I.length)return null;if(I.length===1)return I[0];var r=I.filter(function(C){var l=vC(ts(C)[a.start],ts(C)[a.end]);return l(t[a.line])});return r.length===1?r[0]:r.length>1?r.sort(function(C,l){return ts(C)[a.start]-ts(l)[a.start]})[0]:I.sort(function(C,l){var c=WRA(t,URA(ts(C))),B=WRA(t,URA(ts(l)));return c!==B?c-B:ts(C)[a.start]-ts(l)[a.start]})[0]},n1A=function(A,e){var t=A.page.borderBox.center;return pm(A.descriptor.id,e)?cI(t,e.displacedBy.point):t},ZRe=function(A,e){var t=A.page.borderBox;return pm(A.descriptor.id,e)?Mx(t,KG(e.displacedBy.point)):t},WRe=function(A){var e=A.pageBorderBoxCenter,t=A.viewport,i=A.destination,n=A.insideDestination,o=A.afterCritical,g=n.filter(function(a){return qRA({target:ZRe(a,o),destination:i,viewport:t.frame,withDroppableDisplacement:!0})}).sort(function(a,s){var I=Fx(e,GtA(i,n1A(a,o))),r=Fx(e,GtA(i,n1A(s,o)));return I<r?-1:r<I?1:a.descriptor.index-s.descriptor.index});return g[0]||null},Sx=cg(function(A,e){var t=e[A.line];return{value:t,point:Cy(A.line,t)}}),KRe=function(A,e,t){var i=A.axis;if(A.descriptor.mode==="virtual")return Cy(i.line,e[i.line]);var n=A.subject.page.contentBox[i.size],o=VG(A.descriptor.id,t),g=o.reduce(function(I,r){return I+r.client.marginBox[i.size]},0),a=g+e[i.line],s=a-n;return s<=0?null:Cy(i.line,s)},o1A=function(A,e){return qe({},A,{scroll:qe({},A.scroll,{max:e})})},g1A=function(A,e,t){var i=A.frame;XG(e,A)&&$A(!1),A.subject.withPlaceholder&&$A(!1);var n=Sx(A.axis,e.displaceBy).point,o=KRe(A,n,t),g={placeholderSize:n,increasedBy:o,oldFrameMaxScroll:A.frame?A.frame.scroll.max:null};if(!i){var a=UG({page:A.subject.page,withPlaceholder:g,axis:A.axis,frame:A.frame});return qe({},A,{subject:a})}var s=o?zg(i.scroll.max,o):i.scroll.max,I=o1A(i,s),r=UG({page:A.subject.page,withPlaceholder:g,axis:A.axis,frame:I});return qe({},A,{subject:r,frame:I})},URe=function(A){var e=A.subject.withPlaceholder;e||$A(!1);var t=A.frame;if(!t){var i=UG({page:A.subject.page,axis:A.axis,frame:null,withPlaceholder:null});return qe({},A,{subject:i})}var n=e.oldFrameMaxScroll;n||$A(!1);var o=o1A(t,n),g=UG({page:A.subject.page,axis:A.axis,frame:o,withPlaceholder:null});return qe({},A,{subject:g,frame:o})},VRe=function(A){var e=A.previousPageBorderBoxCenter,t=A.moveRelativeTo,i=A.insideDestination,n=A.draggable,o=A.draggables,g=A.destination,a=A.viewport,s=A.afterCritical;if(!t){if(i.length)return null;var I={displaced:vx,displacedBy:TRA,at:{type:"REORDER",destination:{droppableId:g.descriptor.id,index:0}}},r=TU({impact:I,draggable:n,droppable:g,draggables:o,afterCritical:s}),C=XG(n,g)?g:g1A(g,n,o),l=i1A({draggable:n,destination:C,newPageBorderBoxCenter:r,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return l?I:null}var c=e[g.axis.line]<=t.page.borderBox.center[g.axis.line],B=function(){var u=t.descriptor.index;return t.descriptor.id===n.descriptor.id||c?u:u+1}(),E=Sx(g.axis,n.displaceBy);return zU({draggable:n,insideDestination:i,destination:g,viewport:a,displacedBy:E,last:vx,index:B})},XRe=function(A){var e=A.isMovingForward,t=A.previousPageBorderBoxCenter,i=A.draggable,n=A.isOver,o=A.draggables,g=A.droppables,a=A.viewport,s=A.afterCritical,I=HRe({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:g,viewport:a});if(!I)return null;var r=VG(I.descriptor.id,o),C=WRe({pageBorderBoxCenter:t,viewport:a,destination:I,insideDestination:r,afterCritical:s}),l=VRe({previousPageBorderBoxCenter:t,destination:I,draggable:i,draggables:o,moveRelativeTo:C,insideDestination:r,viewport:a,afterCritical:s});if(!l)return null;var c=TU({impact:l,draggable:i,droppable:I,draggables:o,afterCritical:s}),B=ktA({pageBorderBoxCenter:c,draggable:i,viewport:a});return{clientSelection:B,impact:l,scrollJumpRequest:null}},BI=function(A){var e=A.at;return e?e.type==="REORDER"?e.destination.droppableId:e.combine.droppableId:null},zRe=function(A,e){var t=BI(A);return t?e[t]:null},TRe=function(A){var e=A.state,t=A.type,i=zRe(e.impact,e.dimensions.droppables),n=!!i,o=e.dimensions.droppables[e.critical.droppable.id],g=i||o,a=g.axis.direction,s=a==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||a==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(s&&!n)return null;var I=t==="MOVE_DOWN"||t==="MOVE_RIGHT",r=e.dimensions.draggables[e.critical.draggable.id],C=e.current.page.borderBoxCenter,l=e.dimensions,c=l.draggables,B=l.droppables;return s?SRe({isMovingForward:I,previousPageBorderBoxCenter:C,draggable:r,destination:g,draggables:c,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):XRe({isMovingForward:I,previousPageBorderBoxCenter:C,draggable:r,isOver:g,draggables:c,droppables:B,viewport:e.viewport,afterCritical:e.afterCritical})};function ly(A){return A.phase==="DRAGGING"||A.phase==="COLLECTING"}function a1A(A){var e=vC(A.top,A.bottom),t=vC(A.left,A.right);return function(i){return e(i.y)&&t(i.x)}}function _Re(A,e){return A.left<e.right&&A.right>e.left&&A.top<e.bottom&&A.bottom>e.top}function ORe(A){var e=A.pageBorderBox,t=A.draggable,i=A.candidates,n=t.page.borderBox.center,o=i.map(function(g){var a=g.axis,s=Cy(g.axis.line,e.center[a.line],g.page.borderBox.center[a.crossAxisLine]);return{id:g.descriptor.id,distance:Fx(n,s)}}).sort(function(g,a){return a.distance-g.distance});return o[0]?o[0].id:null}function qRe(A){var e=A.pageBorderBox,t=A.draggable,i=A.droppables,n=UU(i).filter(function(o){if(!o.isEnabled)return!1;var g=o.subject.active;if(!g||!_Re(e,g))return!1;if(a1A(g)(e.center))return!0;var a=o.axis,s=g.center[a.crossAxisLine],I=e[a.crossAxisStart],r=e[a.crossAxisEnd],C=vC(g[a.crossAxisStart],g[a.crossAxisEnd]),l=C(I),c=C(r);return!l&&!c?!0:l?I<s:r>s});return n.length?n.length===1?n[0].descriptor.id:ORe({pageBorderBox:e,draggable:t,candidates:n}):null}var s1A=function(A,e){return nc(Mx(A,e))},jRe=function(A,e){var t=A.frame;return t?s1A(e,t.scroll.diff.value):e};function r1A(A){var e=A.displaced,t=A.id;return!!(e.visible[t]||e.invisible[t])}function PRe(A){var e=A.draggable,t=A.closest,i=A.inHomeList;return t?i&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var $Re=function(A){var e=A.pageBorderBoxWithDroppableScroll,t=A.draggable,i=A.destination,n=A.insideDestination,o=A.last,g=A.viewport,a=A.afterCritical,s=i.axis,I=Sx(i.axis,t.displaceBy),r=I.value,C=e[s.start],l=e[s.end],c=XU(t,n),B=mm(c,function(u){var d=u.descriptor.id,f=u.page.borderBox.center[s.line],w=pm(d,a),y=r1A({displaced:o,id:d});return w?y?l<=f:C<f-r:y?l<=f+r:C<f}),E=PRe({draggable:t,closest:B,inHomeList:XG(t,i)});return zU({draggable:t,insideDestination:n,destination:i,viewport:g,last:o,displacedBy:I,index:E})},A1e=4,e1e=function(A){var e=A.draggable,t=A.pageBorderBoxWithDroppableScroll,i=A.previousImpact,n=A.destination,o=A.insideDestination,g=A.afterCritical;if(!n.isCombineEnabled)return null;var a=n.axis,s=Sx(n.axis,e.displaceBy),I=s.value,r=t[a.start],C=t[a.end],l=XU(e,o),c=mm(l,function(E){var u=E.descriptor.id,d=E.page.borderBox,f=d[a.size],w=f/A1e,y=pm(u,g),G=r1A({displaced:i.displaced,id:u});return y?G?C>d[a.start]+w&&C<d[a.end]-w:r>d[a.start]-I+w&&r<d[a.end]-I-w:G?C>d[a.start]+I+w&&C<d[a.end]+I-w:r>d[a.start]+w&&r<d[a.end]-w});if(!c)return null;var B={displacedBy:s,displaced:i.displaced,at:{type:"COMBINE",combine:{draggableId:c.descriptor.id,droppableId:n.descriptor.id}}};return B},I1A=function(A){var e=A.pageOffset,t=A.draggable,i=A.draggables,n=A.droppables,o=A.previousImpact,g=A.viewport,a=A.afterCritical,s=s1A(t.page.borderBox,e),I=qRe({pageBorderBox:s,draggable:t,droppables:n});if(!I)return QRe;var r=n[I],C=VG(r.descriptor.id,i),l=jRe(r,s);return e1e({pageBorderBoxWithDroppableScroll:l,draggable:t,previousImpact:o,destination:r,insideDestination:C,afterCritical:a})||$Re({pageBorderBoxWithDroppableScroll:l,draggable:t,destination:r,insideDestination:C,last:o.displaced,viewport:g,afterCritical:a})},JtA=function(A,e){var t;return qe({},A,(t={},t[e.descriptor.id]=e,t))},t1e=function(A){var e=A.previousImpact,t=A.impact,i=A.droppables,n=BI(e),o=BI(t);if(!n||n===o)return i;var g=i[n];if(!g.subject.withPlaceholder)return i;var a=URe(g);return JtA(i,a)},i1e=function(A){var e=A.draggable,t=A.draggables,i=A.droppables,n=A.previousImpact,o=A.impact,g=t1e({previousImpact:n,impact:o,droppables:i}),a=BI(o);if(!a)return g;var s=i[a];if(XG(e,s)||s.subject.withPlaceholder)return g;var I=g1A(s,e,t);return JtA(g,I)},Hx=function(A){var e=A.state,t=A.clientSelection,i=A.dimensions,n=A.viewport,o=A.impact,g=A.scrollJumpRequest,a=n||e.viewport,s=i||e.dimensions,I=t||e.current.client.selection,r=cI(I,e.initial.client.selection),C={offset:r,selection:I,borderBoxCenter:zg(e.initial.client.borderBoxCenter,r)},l={selection:zg(C.selection,a.scroll.current),borderBoxCenter:zg(C.borderBoxCenter,a.scroll.current),offset:zg(C.offset,a.scroll.diff.value)},c={client:C,page:l};if(e.phase==="COLLECTING")return qe({phase:"COLLECTING"},e,{dimensions:s,viewport:a,current:c});var B=s.draggables[e.critical.draggable.id],E=o||I1A({pageOffset:l.offset,draggable:B,draggables:s.draggables,droppables:s.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),u=i1e({draggable:B,impact:E,previousImpact:e.impact,draggables:s.draggables,droppables:s.droppables}),d=qe({},e,{current:c,dimensions:{draggables:s.draggables,droppables:u},impact:E,viewport:a,scrollJumpRequest:g||null,forceShouldAnimate:g?!1:null});return d};function n1e(A,e){return A.map(function(t){return e[t]})}var C1A=function(A){var e=A.impact,t=A.viewport,i=A.draggables,n=A.destination,o=A.forceShouldAnimate,g=e.displaced,a=n1e(g.all,i),s=Lx({afterDragging:a,destination:n,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:g});return qe({},e,{displaced:s})},l1A=function(A){var e=A.impact,t=A.draggable,i=A.droppable,n=A.draggables,o=A.viewport,g=A.afterCritical,a=TU({impact:e,draggable:t,draggables:n,droppable:i,afterCritical:g});return ktA({pageBorderBoxCenter:a,draggable:t,viewport:o})},c1A=function(A){var e=A.state,t=A.dimensions,i=A.viewport;e.movementMode!=="SNAP"&&$A(!1);var n=e.impact,o=i||e.viewport,g=t||e.dimensions,a=g.draggables,s=g.droppables,I=a[e.critical.draggable.id],r=BI(n);r||$A(!1);var C=s[r],l=C1A({impact:n,viewport:o,destination:C,draggables:a}),c=l1A({impact:l,draggable:I,droppable:C,draggables:a,viewport:o,afterCritical:e.afterCritical});return Hx({impact:l,clientSelection:c,state:e,dimensions:g,viewport:o})},o1e=function(A){return{index:A.index,droppableId:A.droppableId}},B1A=function(A){var e=A.draggable,t=A.home,i=A.draggables,n=A.viewport,o=Sx(t.axis,e.displaceBy),g=VG(t.descriptor.id,i),a=g.indexOf(e);a===-1&&$A(!1);var s=g.slice(a+1),I=s.reduce(function(c,B){return c[B.descriptor.id]=!0,c},{}),r={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:I},C=Lx({afterDragging:s,destination:t,displacedBy:o,last:null,viewport:n.frame,forceShouldAnimate:!1}),l={displaced:C,displacedBy:o,at:{type:"REORDER",destination:o1e(e.descriptor)}};return{impact:l,afterCritical:r}},g1e=function(A,e){return{draggables:A.draggables,droppables:JtA(A.droppables,e)}},a1e=function(A){var e=A.draggable,t=A.offset,i=A.initialWindowScroll,n=LU(e.client,t),o=SU(n,i),g=qe({},e,{placeholder:qe({},e.placeholder,{client:n}),client:n,page:o});return g},s1e=function(A){var e=A.frame;return e||$A(!1),e},r1e=function(A){var e=A.additions,t=A.updatedDroppables,i=A.viewport,n=i.scroll.diff.value;return e.map(function(o){var g=o.descriptor.droppableId,a=t[g],s=s1e(a),I=s.scroll.diff.value,r=zg(n,I),C=a1e({draggable:o,offset:r,initialWindowScroll:i.scroll.initial});return C})},I1e=function(A){var e=A.state,t=A.published,i=t.modified.map(function(w){var y=e.dimensions.droppables[w.droppableId],G=ptA(y,w.scroll);return G}),n=qe({},e.dimensions.droppables,{},XRA(i)),o=zRA(r1e({additions:t.additions,updatedDroppables:n,viewport:e.viewport})),g=qe({},e.dimensions.draggables,{},o);t.removals.forEach(function(w){delete g[w]});var a={droppables:n,draggables:g},s=BI(e.impact),I=s?a.droppables[s]:null,r=a.draggables[e.critical.draggable.id],C=a.droppables[e.critical.droppable.id],l=B1A({draggable:r,home:C,draggables:g,viewport:e.viewport}),c=l.impact,B=l.afterCritical,E=I&&I.isCombineEnabled?e.impact:c,u=I1A({pageOffset:e.current.page.offset,draggable:a.draggables[e.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:E,viewport:e.viewport,afterCritical:B}),d=qe({phase:"DRAGGING"},e,{phase:"DRAGGING",impact:u,onLiftImpact:c,dimensions:a,afterCritical:B,forceShouldAnimate:!1});if(e.phase==="COLLECTING")return d;var f=qe({phase:"DROP_PENDING"},d,{phase:"DROP_PENDING",reason:e.reason,isWaiting:!1});return f},NtA=function(A){return A.movementMode==="SNAP"},YtA=function(A,e,t){var i=g1e(A.dimensions,e);return!NtA(A)||t?Hx({state:A,dimensions:i}):c1A({state:A,dimensions:i})};function Q1A(A){return A.isDragging&&A.movementMode==="SNAP"?qe({phase:"DRAGGING"},A,{scrollJumpRequest:null}):A}var E1A={phase:"IDLE",completed:null,shouldFlush:!1},C1e=function(A,e){if(A===void 0&&(A=E1A),e.type==="FLUSH")return qe({},E1A,{shouldFlush:!0});if(e.type==="INITIAL_PUBLISH"){A.phase!=="IDLE"&&$A(!1);var t=e.payload,i=t.critical,n=t.clientSelection,o=t.viewport,g=t.dimensions,a=t.movementMode,s=g.draggables[i.draggable.id],I=g.droppables[i.droppable.id],r={selection:n,borderBoxCenter:s.client.borderBox.center,offset:Bg},C={client:r,page:{selection:zg(r.selection,o.scroll.initial),borderBoxCenter:zg(r.selection,o.scroll.initial),offset:zg(r.selection,o.scroll.diff.value)}},l=UU(g.droppables).every(function(lA){return!lA.isFixedOnPage}),c=B1A({draggable:s,home:I,draggables:g.draggables,viewport:o}),B=c.impact,E=c.afterCritical,u={phase:"DRAGGING",isDragging:!0,critical:i,movementMode:a,dimensions:g,initial:C,current:C,isWindowScrollAllowed:l,impact:B,afterCritical:E,onLiftImpact:B,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null};return u}if(e.type==="COLLECTION_STARTING"){if(A.phase==="COLLECTING"||A.phase==="DROP_PENDING")return A;A.phase!=="DRAGGING"&&$A(!1);var d=qe({phase:"COLLECTING"},A,{phase:"COLLECTING"});return d}if(e.type==="PUBLISH_WHILE_DRAGGING")return A.phase==="COLLECTING"||A.phase==="DROP_PENDING"||$A(!1),I1e({state:A,published:e.payload});if(e.type==="MOVE"){if(A.phase==="DROP_PENDING")return A;ly(A)||$A(!1);var f=e.payload.client;return hm(f,A.current.client.selection)?A:Hx({state:A,clientSelection:f,impact:NtA(A)?A.impact:null})}if(e.type==="UPDATE_DROPPABLE_SCROLL"){if(A.phase==="DROP_PENDING"||A.phase==="COLLECTING")return Q1A(A);ly(A)||$A(!1);var w=e.payload,y=w.id,G=w.newScroll,R=A.dimensions.droppables[y];if(!R)return A;var x=ptA(R,G);return YtA(A,x,!1)}if(e.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(A.phase==="DROP_PENDING")return A;ly(A)||$A(!1);var F=e.payload,Q=F.id,k=F.isEnabled,h=A.dimensions.droppables[Q];h||$A(!1),h.isEnabled===k&&$A(!1);var N=qe({},h,{isEnabled:k});return YtA(A,N,!0)}if(e.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(A.phase==="DROP_PENDING")return A;ly(A)||$A(!1);var v=e.payload,K=v.id,U=v.isCombineEnabled,V=A.dimensions.droppables[K];V||$A(!1),V.isCombineEnabled===U&&$A(!1);var X=qe({},V,{isCombineEnabled:U});return YtA(A,X,!0)}if(e.type==="MOVE_BY_WINDOW_SCROLL"){if(A.phase==="DROP_PENDING"||A.phase==="DROP_ANIMATING")return A;ly(A)||$A(!1),A.isWindowScrollAllowed||$A(!1);var _=e.payload.newScroll;if(hm(A.viewport.scroll.current,_))return Q1A(A);var q=e1A(A.viewport,_);return NtA(A)?c1A({state:A,viewport:q}):Hx({state:A,viewport:q})}if(e.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!ly(A))return A;var $=e.payload.maxScroll;if(hm($,A.viewport.scroll.max))return A;var nA=qe({},A.viewport,{scroll:qe({},A.viewport.scroll,{max:$})});return qe({phase:"DRAGGING"},A,{viewport:nA})}if(e.type==="MOVE_UP"||e.type==="MOVE_DOWN"||e.type==="MOVE_LEFT"||e.type==="MOVE_RIGHT"){if(A.phase==="COLLECTING"||A.phase==="DROP_PENDING")return A;A.phase!=="DRAGGING"&&$A(!1);var j=TRe({state:A,type:e.type});return j?Hx({state:A,impact:j.impact,clientSelection:j.clientSelection,scrollJumpRequest:j.scrollJumpRequest}):A}if(e.type==="DROP_PENDING"){var O=e.payload.reason;A.phase!=="COLLECTING"&&$A(!1);var eA=qe({phase:"DROP_PENDING"},A,{phase:"DROP_PENDING",isWaiting:!0,reason:O});return eA}if(e.type==="DROP_ANIMATE"){var oA=e.payload,tA=oA.completed,sA=oA.dropDuration,gA=oA.newHomeClientOffset;A.phase==="DRAGGING"||A.phase==="DROP_PENDING"||$A(!1);var iA={phase:"DROP_ANIMATING",completed:tA,dropDuration:sA,newHomeClientOffset:gA,dimensions:A.dimensions};return iA}if(e.type==="DROP_COMPLETE"){var aA=e.payload.completed;return{phase:"IDLE",completed:aA,shouldFlush:!1}}return A},l1e=function(A){return{type:"BEFORE_INITIAL_CAPTURE",payload:A}},c1e=function(A){return{type:"LIFT",payload:A}},B1e=function(A){return{type:"INITIAL_PUBLISH",payload:A}},Q1e=function(A){return{type:"PUBLISH_WHILE_DRAGGING",payload:A}},E1e=function(){return{type:"COLLECTION_STARTING",payload:null}},u1e=function(A){return{type:"UPDATE_DROPPABLE_SCROLL",payload:A}},d1e=function(A){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:A}},h1e=function(A){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:A}},u1A=function(A){return{type:"MOVE",payload:A}},m1e=function(A){return{type:"MOVE_BY_WINDOW_SCROLL",payload:A}},p1e=function(A){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:A}},f1e=function(){return{type:"MOVE_UP",payload:null}},y1e=function(){return{type:"MOVE_DOWN",payload:null}},b1e=function(){return{type:"MOVE_RIGHT",payload:null}},w1e=function(){return{type:"MOVE_LEFT",payload:null}},RtA=function(){return{type:"FLUSH",payload:null}},D1e=function(A){return{type:"DROP_ANIMATE",payload:A}},xtA=function(A){return{type:"DROP_COMPLETE",payload:A}},d1A=function(A){return{type:"DROP",payload:A}},G1e=function(A){return{type:"DROP_PENDING",payload:A}},h1A=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}},k1e=function(A){return function(e){var t=e.getState,i=e.dispatch;return function(n){return function(o){if(o.type!=="LIFT"){n(o);return}var g=o.payload,a=g.id,s=g.clientSelection,I=g.movementMode,r=t();r.phase==="DROP_ANIMATING"&&i(xtA({completed:r.completed})),t().phase!=="IDLE"&&$A(!1),i(RtA()),i(l1e({draggableId:a,movementMode:I}));var C={shouldPublishImmediately:I==="SNAP"},l={draggableId:a,scrollOptions:C},c=A.startPublishing(l),B=c.critical,E=c.dimensions,u=c.viewport;i(B1e({critical:B,dimensions:E,clientSelection:s,movementMode:I,viewport:u}))}}}},J1e=function(A){return function(){return function(e){return function(t){t.type==="INITIAL_PUBLISH"&&A.dragging(),t.type==="DROP_ANIMATE"&&A.dropping(t.payload.completed.result.reason),(t.type==="FLUSH"||t.type==="DROP_COMPLETE")&&A.resting(),e(t)}}}},FtA={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Zx={opacity:{drop:0,combining:.7},scale:{drop:.75}},MtA={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},cy=MtA.outOfTheWay+"s "+FtA.outOfTheWay,Wx={fluid:"opacity "+cy,snap:"transform "+cy+", opacity "+cy,drop:function(A){var e=A+"s "+FtA.drop;return"transform "+e+", opacity "+e},outOfTheWay:"transform "+cy,placeholder:"height "+cy+", width "+cy+", margin "+cy},m1A=function(A){return hm(A,Bg)?null:"translate("+A.x+"px, "+A.y+"px)"},vtA={moveTo:m1A,drop:function(A,e){var t=m1A(A);return t?e?t+" scale("+Zx.scale.drop+")":t:null}},LtA=MtA.minDropTime,p1A=MtA.maxDropTime,N1e=p1A-LtA,f1A=1500,Y1e=.6,R1e=function(A){var e=A.current,t=A.destination,i=A.reason,n=Fx(e,t);if(n<=0)return LtA;if(n>=f1A)return p1A;var o=n/f1A,g=LtA+N1e*o,a=i==="CANCEL"?g*Y1e:g;return Number(a.toFixed(2))},x1e=function(A){var e=A.impact,t=A.draggable,i=A.dimensions,n=A.viewport,o=A.afterCritical,g=i.draggables,a=i.droppables,s=BI(e),I=s?a[s]:null,r=a[t.descriptor.droppableId],C=l1A({impact:e,draggable:t,draggables:g,afterCritical:o,droppable:I||r,viewport:n}),l=cI(C,t.client.borderBox.center);return l},F1e=function(A){var e=A.draggables,t=A.reason,i=A.lastImpact,n=A.home,o=A.viewport,g=A.onLiftImpact;if(!i.at||t!=="DROP"){var a=C1A({draggables:e,impact:g,destination:n,viewport:o,forceShouldAnimate:!0});return{impact:a,didDropInsideDroppable:!1}}if(i.at.type==="REORDER")return{impact:i,didDropInsideDroppable:!0};var s=qe({},i,{displaced:vx});return{impact:s,didDropInsideDroppable:!0}},M1e=function(A){var e=A.getState,t=A.dispatch;return function(i){return function(n){if(n.type!=="DROP"){i(n);return}var o=e(),g=n.payload.reason;if(o.phase==="COLLECTING"){t(G1e({reason:g}));return}if(o.phase!=="IDLE"){var a=o.phase==="DROP_PENDING"&&o.isWaiting;a&&$A(!1),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||$A(!1);var s=o.critical,I=o.dimensions,r=I.draggables[o.critical.draggable.id],C=F1e({reason:g,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),l=C.impact,c=C.didDropInsideDroppable,B=c?ytA(l):null,E=c?VU(l):null,u={index:s.draggable.index,droppableId:s.droppable.id},d={draggableId:r.descriptor.id,type:r.descriptor.type,source:u,reason:g,mode:o.movementMode,destination:B,combine:E},f=x1e({impact:l,draggable:r,dimensions:I,viewport:o.viewport,afterCritical:o.afterCritical}),w={critical:o.critical,afterCritical:o.afterCritical,result:d,impact:l},y=!hm(o.current.client.offset,f)||!!d.combine;if(!y){t(xtA({completed:w}));return}var G=R1e({current:o.current.client.offset,destination:f,reason:g}),R={newHomeClientOffset:f,dropDuration:G,completed:w};t(D1e(R))}}}},y1A=function(){return window["__react-beautiful-dnd-disable-scroll-hack"]?{x:0,y:0}:{x:window.pageXOffset,y:window.pageYOffset}};function v1e(A){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(e){e.target!==window&&e.target!==window.document||A()}}}function L1e(A){var e=A.onWindowScroll;function t(){e(y1A())}var i=xx(t),n=v1e(i),o=dm;function g(){return o!==dm}function a(){g()&&$A(!1),o=MC(window,[n])}function s(){g()||$A(!1),i.cancel(),o(),o=dm}return{start:a,stop:s,isActive:g}}var S1e=function(A){return A.type==="DROP_COMPLETE"||A.type==="DROP_ANIMATE"||A.type==="FLUSH"},H1e=function(A){var e=L1e({onWindowScroll:function(t){A.dispatch(m1e({newScroll:t}))}});return function(t){return function(i){!e.isActive()&&i.type==="INITIAL_PUBLISH"&&e.start(),e.isActive()&&S1e(i)&&e.stop(),t(i)}}},Z1e=function(A){var e=!1,t=!1,i=setTimeout(function(){t=!0}),n=function(o){e||t||(e=!0,A(o),clearTimeout(i))};return n.wasCalled=function(){return e},n},W1e=function(){var A=[],e=function(n){var o=ftA(A,function(s){return s.timerId===n});o===-1&&$A(!1);var g=A.splice(o,1),a=g[0];a.callback()},t=function(n){var o=setTimeout(function(){return e(o)}),g={timerId:o,callback:n};A.push(g)},i=function(){if(A.length){var n=[].concat(A);A.length=0,n.forEach(function(o){clearTimeout(o.timerId),o.callback()})}};return{add:t,flush:i}},K1e=function(A,e){return A==null&&e==null?!0:A==null||e==null?!1:A.droppableId===e.droppableId&&A.index===e.index},U1e=function(A,e){return A==null&&e==null?!0:A==null||e==null?!1:A.draggableId===e.draggableId&&A.droppableId===e.droppableId},V1e=function(A,e){if(A===e)return!0;var t=A.draggable.id===e.draggable.id&&A.draggable.droppableId===e.draggable.droppableId&&A.draggable.type===e.draggable.type&&A.draggable.index===e.draggable.index,i=A.droppable.id===e.droppable.id&&A.droppable.type===e.droppable.type;return t&&i},Kx=function(A,e){e()},_U=function(A,e){return{draggableId:A.draggable.id,type:A.droppable.type,source:{droppableId:A.droppable.id,index:A.draggable.index},mode:e}},StA=function(A,e,t,i){if(!A){t(i(e));return}var n=Z1e(t),o={announce:n};A(e,o),n.wasCalled()||t(i(e))},X1e=function(A,e){var t=W1e(),i=null,n=function(C,l){i&&$A(!1),Kx("onBeforeCapture",function(){var c=A().onBeforeCapture;if(c){var B={draggableId:C,mode:l};c(B)}})},o=function(C,l){i&&$A(!1),Kx("onBeforeDragStart",function(){var c=A().onBeforeDragStart;c&&c(_U(C,l))})},g=function(C,l){i&&$A(!1);var c=_U(C,l);i={mode:l,lastCritical:C,lastLocation:c.source,lastCombine:null},t.add(function(){Kx("onDragStart",function(){return StA(A().onDragStart,c,e,WU.onDragStart)})})},a=function(C,l){var c=ytA(l),B=VU(l);i||$A(!1);var E=!V1e(C,i.lastCritical);E&&(i.lastCritical=C);var u=!K1e(i.lastLocation,c);u&&(i.lastLocation=c);var d=!U1e(i.lastCombine,B);if(d&&(i.lastCombine=B),!(!E&&!u&&!d)){var f=qe({},_U(C,i.mode),{combine:B,destination:c});t.add(function(){Kx("onDragUpdate",function(){return StA(A().onDragUpdate,f,e,WU.onDragUpdate)})})}},s=function(){i||$A(!1),t.flush()},I=function(C){i||$A(!1),i=null,Kx("onDragEnd",function(){return StA(A().onDragEnd,C,e,WU.onDragEnd)})},r=function(){if(i){var C=qe({},_U(i.lastCritical,i.mode),{combine:null,destination:null,reason:"CANCEL"});I(C)}};return{beforeCapture:n,beforeStart:o,start:g,update:a,flush:s,drop:I,abort:r}},z1e=function(A,e){var t=X1e(A,e);return function(i){return function(n){return function(o){if(o.type==="BEFORE_INITIAL_CAPTURE"){t.beforeCapture(o.payload.draggableId,o.payload.movementMode);return}if(o.type==="INITIAL_PUBLISH"){var g=o.payload.critical;t.beforeStart(g,o.payload.movementMode),n(o),t.start(g,o.payload.movementMode);return}if(o.type==="DROP_COMPLETE"){var a=o.payload.completed.result;t.flush(),n(o),t.drop(a);return}if(n(o),o.type==="FLUSH"){t.abort();return}var s=i.getState();s.phase==="DRAGGING"&&t.update(s.critical,s.impact)}}}},T1e=function(A){return function(e){return function(t){if(t.type!=="DROP_ANIMATION_FINISHED"){e(t);return}var i=A.getState();i.phase!=="DROP_ANIMATING"&&$A(!1),A.dispatch(xtA({completed:i.completed}))}}},_1e=function(A){var e=null,t=null;function i(){t&&(cancelAnimationFrame(t),t=null),e&&(e(),e=null)}return function(n){return function(o){if((o.type==="FLUSH"||o.type==="DROP_COMPLETE"||o.type==="DROP_ANIMATION_FINISHED")&&i(),n(o),o.type==="DROP_ANIMATE"){var g={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var a=A.getState();a.phase==="DROP_ANIMATING"&&A.dispatch(h1A())}};t=requestAnimationFrame(function(){t=null,e=MC(window,[g])})}}}},O1e=function(A){return function(){return function(e){return function(t){(t.type==="DROP_COMPLETE"||t.type==="FLUSH"||t.type==="DROP_ANIMATE")&&A.stopPublishing(),e(t)}}}},q1e=function(A){var e=!1;return function(){return function(t){return function(i){if(i.type==="INITIAL_PUBLISH"){e=!0,A.tryRecordFocus(i.payload.critical.draggable.id),t(i),A.tryRestoreFocusRecorded();return}if(t(i),!!e){if(i.type==="FLUSH"){e=!1,A.tryRestoreFocusRecorded();return}if(i.type==="DROP_COMPLETE"){e=!1;var n=i.payload.completed.result;n.combine&&A.tryShiftRecord(n.draggableId,n.combine.draggableId),A.tryRestoreFocusRecorded()}}}}}},j1e=function(A){return A.type==="DROP_COMPLETE"||A.type==="DROP_ANIMATE"||A.type==="FLUSH"},P1e=function(A){return function(e){return function(t){return function(i){if(j1e(i)){A.stop(),t(i);return}if(i.type==="INITIAL_PUBLISH"){t(i);var n=e.getState();n.phase!=="DRAGGING"&&$A(!1),A.start(n);return}t(i),A.scroll(e.getState())}}}},$1e=function(A){return function(e){return function(t){if(e(t),t.type==="PUBLISH_WHILE_DRAGGING"){var i=A.getState();i.phase==="DROP_PENDING"&&(i.isWaiting||A.dispatch(d1A({reason:i.reason})))}}}},Axe=iRA,exe=function(A){var e=A.dimensionMarshal,t=A.focusMarshal,i=A.styleMarshal,n=A.getResponders,o=A.announce,g=A.autoScroller;return ARA(C1e,Axe(aYe(J1e(i),O1e(e),k1e(e),M1e,T1e,_1e,$1e,P1e(g),H1e,q1e(t),z1e(n,o))))},HtA=function(){return{additions:{},removals:{},modified:{}}};function txe(A){var e=A.registry,t=A.callbacks,i=HtA(),n=null,o=function(){n||(t.collectionStarting(),n=requestAnimationFrame(function(){n=null;var I=i,r=I.additions,C=I.removals,l=I.modified,c=Object.keys(r).map(function(u){return e.draggable.getById(u).getDimension(Bg)}).sort(function(u,d){return u.descriptor.index-d.descriptor.index}),B=Object.keys(l).map(function(u){var d=e.droppable.getById(u),f=d.callbacks.getScrollWhileDragging();return{droppableId:u,scroll:f}}),E={additions:c,removals:Object.keys(C),modified:B};i=HtA(),t.publish(E)}))},g=function(I){var r=I.descriptor.id;i.additions[r]=I,i.modified[I.descriptor.droppableId]=!0,i.removals[r]&&delete i.removals[r],o()},a=function(I){var r=I.descriptor;i.removals[r.id]=!0,i.modified[r.droppableId]=!0,i.additions[r.id]&&delete i.additions[r.id],o()},s=function(){n&&(cancelAnimationFrame(n),n=null,i=HtA())};return{add:g,remove:a,stop:s}}var b1A=function(A){var e=A.scrollHeight,t=A.scrollWidth,i=A.height,n=A.width,o=cI({x:t,y:e},{x:n,y:i}),g={x:Math.max(0,o.x),y:Math.max(0,o.y)};return g},w1A=function(){var A=document.documentElement;return A||$A(!1),A},D1A=function(){var A=w1A(),e=b1A({scrollHeight:A.scrollHeight,scrollWidth:A.scrollWidth,width:A.clientWidth,height:A.clientHeight});return e},ixe=function(){var A=y1A(),e=D1A(),t=A.y,i=A.x,n=w1A(),o=n.clientWidth,g=n.clientHeight,a=i+o,s=t+g,I=nc({top:t,left:i,right:a,bottom:s}),r={frame:I,scroll:{initial:A,current:A,max:e,diff:{value:Bg,displacement:Bg}}};return r},nxe=function(A){var e=A.critical,t=A.scrollOptions,i=A.registry,n=ixe(),o=n.scroll.current,g=e.droppable,a=i.droppable.getAllByType(g.type).map(function(C){return C.callbacks.getDimensionAndWatchScroll(o,t)}),s=i.draggable.getAllByType(e.draggable.type).map(function(C){return C.getDimension(o)}),I={draggables:zRA(s),droppables:XRA(a)},r={dimensions:I,critical:e,viewport:n};return r};function G1A(A,e,t){if(t.descriptor.id===e.id||t.descriptor.type!==e.type)return!1;var i=A.droppable.getById(t.descriptor.droppableId);return i.descriptor.mode==="virtual"}var oxe=function(A,e){var t=null,i=txe({callbacks:{publish:e.publishWhileDragging,collectionStarting:e.collectionStarting},registry:A}),n=function(l,c){A.droppable.exists(l)||$A(!1),t&&e.updateDroppableIsEnabled({id:l,isEnabled:c})},o=function(l,c){t&&(A.droppable.exists(l)||$A(!1),e.updateDroppableIsCombineEnabled({id:l,isCombineEnabled:c}))},g=function(l,c){t&&(A.droppable.exists(l)||$A(!1),e.updateDroppableScroll({id:l,newScroll:c}))},a=function(l,c){t&&A.droppable.getById(l).callbacks.scroll(c)},s=function(){if(t){i.stop();var l=t.critical.droppable;A.droppable.getAllByType(l.type).forEach(function(c){return c.callbacks.dragStopped()}),t.unsubscribe(),t=null}},I=function(l){t||$A(!1);var c=t.critical.draggable;l.type==="ADDITION"&&G1A(A,c,l.value)&&i.add(l.value),l.type==="REMOVAL"&&G1A(A,c,l.value)&&i.remove(l.value)},r=function(l){t&&$A(!1);var c=A.draggable.getById(l.draggableId),B=A.droppable.getById(c.descriptor.droppableId),E={draggable:c.descriptor,droppable:B.descriptor},u=A.subscribe(I);return t={critical:E,unsubscribe:u},nxe({critical:E,registry:A,scrollOptions:l.scrollOptions})},C={updateDroppableIsEnabled:n,updateDroppableIsCombineEnabled:o,scrollDroppable:a,updateDroppableScroll:g,startPublishing:r,stopPublishing:s};return C},k1A=function(A,e){return A.phase==="IDLE"?!0:A.phase!=="DROP_ANIMATING"||A.completed.result.draggableId===e?!1:A.completed.result.reason==="DROP"},gxe=function(A){window.scrollBy(A.x,A.y)},axe=cg(function(A){return UU(A).filter(function(e){return!(!e.isEnabled||!e.frame)})}),sxe=function(A,e){var t=mm(axe(e),function(i){return i.frame||$A(!1),a1A(i.frame.pageMarginBox)(A)});return t},rxe=function(A){var e=A.center,t=A.destination,i=A.droppables;if(t){var n=i[t];return n.frame?n:null}var o=sxe(e,i);return o},fm={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(A){return Math.pow(A,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},Ixe=function(A,e){var t=A[e.size]*fm.startFromPercentage,i=A[e.size]*fm.maxScrollAtPercentage,n={startScrollingFrom:t,maxScrollValueAt:i};return n},J1A=function(A){var e=A.startOfRange,t=A.endOfRange,i=A.current,n=t-e;if(n===0)return 0;var o=i-e,g=o/n;return g},ZtA=1,Cxe=function(A,e){if(A>e.startScrollingFrom)return 0;if(A<=e.maxScrollValueAt)return fm.maxPixelScroll;if(A===e.startScrollingFrom)return ZtA;var t=J1A({startOfRange:e.maxScrollValueAt,endOfRange:e.startScrollingFrom,current:A}),i=1-t,n=fm.maxPixelScroll*fm.ease(i);return Math.ceil(n)},N1A=fm.durationDampening.accelerateAt,Y1A=fm.durationDampening.stopDampeningAt,lxe=function(A,e){var t=e,i=Y1A,n=Date.now(),o=n-t;if(o>=Y1A)return A;if(o<N1A)return ZtA;var g=J1A({startOfRange:N1A,endOfRange:i,current:o}),a=A*fm.ease(g);return Math.ceil(a)},R1A=function(A){var e=A.distanceToEdge,t=A.thresholds,i=A.dragStartTime,n=A.shouldUseTimeDampening,o=Cxe(e,t);return o===0?0:n?Math.max(lxe(o,i),ZtA):o},x1A=function(A){var e=A.container,t=A.distanceToEdges,i=A.dragStartTime,n=A.axis,o=A.shouldUseTimeDampening,g=Ixe(e,n),a=t[n.end]<t[n.start];return a?R1A({distanceToEdge:t[n.end],thresholds:g,dragStartTime:i,shouldUseTimeDampening:o}):-1*R1A({distanceToEdge:t[n.start],thresholds:g,dragStartTime:i,shouldUseTimeDampening:o})},cxe=function(A){var e=A.container,t=A.subject,i=A.proposedScroll,n=t.height>e.height,o=t.width>e.width;return!o&&!n?i:o&&n?null:{x:o?0:i.x,y:n?0:i.y}},Bxe=KRA(function(A){return A===0?0:A}),F1A=function(A){var e=A.dragStartTime,t=A.container,i=A.subject,n=A.center,o=A.shouldUseTimeDampening,g={top:n.y-t.top,right:t.right-n.x,bottom:t.bottom-n.y,left:n.x-t.left},a=x1A({container:t,distanceToEdges:g,dragStartTime:e,axis:btA,shouldUseTimeDampening:o}),s=x1A({container:t,distanceToEdges:g,dragStartTime:e,axis:ORA,shouldUseTimeDampening:o}),I=Bxe({x:s,y:a});if(hm(I,Bg))return null;var r=cxe({container:t,subject:i,proposedScroll:I});return r?hm(r,Bg)?null:r:null},Qxe=KRA(function(A){return A===0?0:A>0?1:-1}),WtA=function(){var A=function(e,t){return e<0?e:e>t?e-t:0};return function(e){var t=e.current,i=e.max,n=e.change,o=zg(t,n),g={x:A(o.x,i.x),y:A(o.y,i.y)};return hm(g,Bg)?null:g}}(),M1A=function(A){var e=A.max,t=A.current,i=A.change,n={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=Qxe(i),g=WtA({max:n,current:t,change:o});return!g||o.x!==0&&g.x===0||o.y!==0&&g.y===0},KtA=function(A,e){return M1A({current:A.scroll.current,max:A.scroll.max,change:e})},Exe=function(A,e){if(!KtA(A,e))return null;var t=A.scroll.max,i=A.scroll.current;return WtA({current:i,max:t,change:e})},UtA=function(A,e){var t=A.frame;return t?M1A({current:t.scroll.current,max:t.scroll.max,change:e}):!1},uxe=function(A,e){var t=A.frame;return!t||!UtA(A,e)?null:WtA({current:t.scroll.current,max:t.scroll.max,change:e})},dxe=function(A){var e=A.viewport,t=A.subject,i=A.center,n=A.dragStartTime,o=A.shouldUseTimeDampening,g=F1A({dragStartTime:n,container:e.frame,subject:t,center:i,shouldUseTimeDampening:o});return g&&KtA(e,g)?g:null},hxe=function(A){var e=A.droppable,t=A.subject,i=A.center,n=A.dragStartTime,o=A.shouldUseTimeDampening,g=e.frame;if(!g)return null;var a=F1A({dragStartTime:n,container:g.pageMarginBox,subject:t,center:i,shouldUseTimeDampening:o});return a&&UtA(e,a)?a:null},v1A=function(A){var e=A.state,t=A.dragStartTime,i=A.shouldUseTimeDampening,n=A.scrollWindow,o=A.scrollDroppable,g=e.current.page.borderBoxCenter,a=e.dimensions.draggables[e.critical.draggable.id],s=a.page.marginBox;if(e.isWindowScrollAllowed){var I=e.viewport,r=dxe({dragStartTime:t,viewport:I,subject:s,center:g,shouldUseTimeDampening:i});if(r){n(r);return}}var C=rxe({center:g,destination:BI(e.impact),droppables:e.dimensions.droppables});if(C){var l=hxe({dragStartTime:t,droppable:C,subject:s,center:g,shouldUseTimeDampening:i});l&&o(C.descriptor.id,l)}},mxe=function(A){var e=A.scrollWindow,t=A.scrollDroppable,i=xx(e),n=xx(t),o=null,g=function(I){o||$A(!1);var r=o,C=r.shouldUseTimeDampening,l=r.dragStartTime;v1A({state:I,scrollWindow:i,scrollDroppable:n,dragStartTime:l,shouldUseTimeDampening:C})},a=function(I){o&&$A(!1);var r=Date.now(),C=!1,l=function(){C=!0};v1A({state:I,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:l,scrollDroppable:l}),o={dragStartTime:r,shouldUseTimeDampening:C},C&&g(I)},s=function(){o&&(i.cancel(),n.cancel(),o=null)};return{start:a,stop:s,scroll:g}},pxe=function(A){var e=A.move,t=A.scrollDroppable,i=A.scrollWindow,n=function(s,I){var r=zg(s.current.client.selection,I);e({client:r})},o=function(s,I){if(!UtA(s,I))return I;var r=uxe(s,I);if(!r)return t(s.descriptor.id,I),null;var C=cI(I,r);t(s.descriptor.id,C);var l=cI(I,C);return l},g=function(s,I,r){if(!s||!KtA(I,r))return r;var C=Exe(I,r);if(!C)return i(r),null;var l=cI(r,C);i(l);var c=cI(r,l);return c},a=function(s){var I=s.scrollJumpRequest;if(I){var r=BI(s.impact);r||$A(!1);var C=o(s.dimensions.droppables[r],I);if(C){var l=s.viewport,c=g(s.isWindowScrollAllowed,l,C);c&&n(s,c)}}};return a},fxe=function(A){var e=A.scrollDroppable,t=A.scrollWindow,i=A.move,n=mxe({scrollWindow:t,scrollDroppable:e}),o=pxe({move:i,scrollWindow:t,scrollDroppable:e}),g=function(s){if(s.phase==="DRAGGING"){if(s.movementMode==="FLUID"){n.scroll(s);return}s.scrollJumpRequest&&o(s)}},a={scroll:g,start:n.start,stop:n.stop};return a},zG="data-rbd",TG=function(){var A=zG+"-drag-handle";return{base:A,draggableId:A+"-draggable-id",contextId:A+"-context-id"}}(),VtA=function(){var A=zG+"-draggable";return{base:A,contextId:A+"-context-id",id:A+"-id"}}(),yxe=function(){var A=zG+"-droppable";return{base:A,contextId:A+"-context-id",id:A+"-id"}}(),L1A={contextId:zG+"-scroll-container-context-id"},bxe=function(A){return function(e){return"["+e+'="'+A+'"]'}},Ux=function(A,e){return A.map(function(t){var i=t.styles[e];return i?t.selector+" { "+i+" }":""}).join(" ")},wxe="pointer-events: none;",Dxe=function(A){var e=bxe(A),t=function(){var a=`
      cursor: -webkit-grab;
      cursor: grab;
    `;return{selector:e(TG.contextId),styles:{always:`
          -webkit-touch-callout: none;
          -webkit-tap-highlight-color: rgba(0,0,0,0);
          touch-action: manipulation;
        `,resting:a,dragging:wxe,dropAnimating:a}}}(),i=function(){var a=`
      transition: `+Wx.outOfTheWay+`;
    `;return{selector:e(VtA.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}}(),n={selector:e(yxe.contextId),styles:{always:"overflow-anchor: none;"}},o={selector:"body",styles:{dragging:`
        cursor: grabbing;
        cursor: -webkit-grabbing;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        overflow-anchor: none;
      `}},g=[i,t,n,o];return{always:Ux(g,"always"),resting:Ux(g,"resting"),dragging:Ux(g,"dragging"),dropAnimating:Ux(g,"dropAnimating"),userCancel:Ux(g,"userCancel")}},QI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?p.useLayoutEffect:p.useEffect,S1A=function(A){var e=document.createElement("style");return A&&e.setAttribute("nonce",A),e.type="text/css",e};function Gxe(A,e){var t=ei(function(){return Dxe(A)},[A]),i=p.useRef(null),n=p.useRef(null),o=oc(),g=Ge(cg(function(l){var c=n.current;c||$A(!1),c.textContent=l}),[]),a=Ge(function(l){var c=i.current;c||$A(!1),c.textContent=l},[]);QI(function(){!i.current&&!n.current||$A(!1);var l=S1A(e),c=S1A(e);return i.current=l,n.current=c,l.setAttribute(zG+"-always",A),c.setAttribute(zG+"-dynamic",A),o.head.appendChild(l),o.head.appendChild(c),a(t.always),g(t.resting),function(){var B=function(E){var u=E.current;u||$A(!1),o.head.removeChild(u),E.current=null};B(i),B(n)}},[e,a,g,t.always,t.resting,A]);var s=Ge(function(){return g(t.dragging)},[g,t.dragging]),I=Ge(function(l){if(l==="DROP"){g(t.dropAnimating);return}g(t.userCancel)},[g,t.dropAnimating,t.userCancel]),r=Ge(function(){n.current&&g(t.resting)},[g,t.resting]),C=ei(function(){return{dragging:s,dropping:I,resting:r}},[s,I,r]);return C}var H1A=function(A){return A&&A.ownerDocument?A.ownerDocument.defaultView:window};function OU(A){return A instanceof H1A(A).HTMLElement}function kxe(A,e,t){var i="["+TG.contextId+'="'+e+'"]',n=VRA(A.querySelectorAll(i));if(!n.length)return null;var o=mm(n,function(g){return g.getAttribute(TG.draggableId)===t});return o&&OU(o)?o:null}function Jxe(A){var e=p.useRef({}),t=p.useRef(null),i=p.useRef(null),n=p.useRef(!1),o=Ge(function(l,c){var B={id:l,focus:c};return e.current[l]=B,function(){var E=e.current,u=E[l];u!==B&&delete E[l]}},[]),g=oc(),a=Ge(function(l){var c=kxe(g.body,A,l);c&&c!==document.activeElement&&c.focus()},[A]),s=Ge(function(l,c){t.current===l&&(t.current=c)},[]),I=Ge(function(){i.current||n.current&&(i.current=requestAnimationFrame(function(){i.current=null;var l=t.current;l&&a(l)}))},[a]),r=Ge(function(l){t.current=null;var c=document.activeElement;c&&c.getAttribute(TG.draggableId)===l&&(t.current=l)},[]);QI(function(){return n.current=!0,function(){n.current=!1;var l=i.current;l&&cancelAnimationFrame(l)}},[]);var C=ei(function(){return{register:o,tryRecordFocus:r,tryRestoreFocusRecorded:I,tryShiftRecord:s}},[o,r,I,s]);return C}function Nxe(){var A={draggables:{},droppables:{}},e=[];function t(C){return e.push(C),function(){var l=e.indexOf(C);l!==-1&&e.splice(l,1)}}function i(C){e.length&&e.forEach(function(l){return l(C)})}function n(C){return A.draggables[C]||null}function o(C){var l=n(C);return l||$A(!1),l}var g={register:function(C){A.draggables[C.descriptor.id]=C,i({type:"ADDITION",value:C})},update:function(C,l){var c=A.draggables[l.descriptor.id];c&&c.uniqueId===C.uniqueId&&(delete A.draggables[l.descriptor.id],A.draggables[C.descriptor.id]=C)},unregister:function(C){var l=C.descriptor.id,c=n(l);c&&C.uniqueId===c.uniqueId&&(delete A.draggables[l],i({type:"REMOVAL",value:C}))},getById:o,findById:n,exists:function(C){return!!n(C)},getAllByType:function(C){return KU(A.draggables).filter(function(l){return l.descriptor.type===C})}};function a(C){return A.droppables[C]||null}function s(C){var l=a(C);return l||$A(!1),l}var I={register:function(C){A.droppables[C.descriptor.id]=C},unregister:function(C){var l=a(C.descriptor.id);l&&C.uniqueId===l.uniqueId&&delete A.droppables[C.descriptor.id]},getById:s,findById:a,exists:function(C){return!!a(C)},getAllByType:function(C){return KU(A.droppables).filter(function(l){return l.descriptor.type===C})}};function r(){A.draggables={},A.droppables={},e.length=0}return{draggable:g,droppable:I,subscribe:t,clean:r}}function Yxe(){var A=ei(Nxe,[]),e=p.useRef();return p.useEffect(function(){return e.current&&cancelAnimationFrame(e.current),function(){e.current=requestAnimationFrame(A.clean)}},[A]),A}var XtA=b.createContext(null),Rxe={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},xxe=function(A){return"rbd-announcement-"+A};function Fxe(A){var e=ei(function(){return xxe(A)},[A]),t=p.useRef(null),i=oc();p.useEffect(function(){var o=document.createElement("div");return t.current=o,o.id=e,o.setAttribute("aria-live","assertive"),o.setAttribute("aria-atomic","true"),qe(o.style,Rxe),i.body.appendChild(o),function(){setTimeout(function(){var g=i.body;g.contains(o)&&g.removeChild(o),o===t.current&&(t.current=null)})}},[e]);var n=Ge(function(o){var g=t.current;if(g){g.textContent=o;return}},[]);return n}var Mxe=0,vxe={separator:"::"};function ztA(A,e){return e===void 0&&(e=vxe),ei(function(){return""+A+e.separator+Mxe++},[e.separator,A])}function Lxe(A){var e=A.contextId,t=A.uniqueId;return"rbd-hidden-text-"+e+"-"+t}function Sxe(A){var e=A.contextId,t=A.text,i=ztA("hidden-text",{separator:"-"}),n=ei(function(){return Lxe({contextId:e,uniqueId:i})},[i,e]),o=oc();return p.useEffect(function(){var g=document.createElement("div");return g.id=n,g.textContent=t,g.style.display="none",o.body.appendChild(g),function(){var a=o.body;a.contains(g)&&a.removeChild(g)}},[n,t]),n}var qU=b.createContext(null);function Z1A(A){var e=p.useRef(A);return p.useEffect(function(){e.current=A}),e}function Hxe(){var A=null;function e(){return!!A}function t(g){return g===A}function i(g){A&&$A(!1);var a={abandon:g};return A=a,a}function n(){A||$A(!1),A=null}function o(){A&&(A.abandon(),n())}return{isClaimed:e,isActive:t,claim:i,release:n,tryAbandon:o}}var Zxe=9,Wxe=13,TtA=27,W1A=32,Kxe=33,Uxe=34,Vxe=35,Xxe=36,zxe=37,Txe=38,_xe=39,Oxe=40,jU,qxe=(jU={},jU[Wxe]=!0,jU[Zxe]=!0,jU),K1A=function(A){qxe[A.keyCode]&&A.preventDefault()},PU=function(){var A="visibilitychange";if(typeof document>"u")return A;var e=[A,"ms"+A,"webkit"+A,"moz"+A,"o"+A],t=mm(e,function(i){return"on"+i in document});return t||A}(),U1A=0,V1A=5;function jxe(A,e){return Math.abs(e.x-A.x)>=V1A||Math.abs(e.y-A.y)>=V1A}var X1A={type:"IDLE"};function Pxe(A){var e=A.cancel,t=A.completed,i=A.getPhase,n=A.setPhase;return[{eventName:"mousemove",fn:function(o){var g=o.button,a=o.clientX,s=o.clientY;if(g===U1A){var I={x:a,y:s},r=i();if(r.type==="DRAGGING"){o.preventDefault(),r.actions.move(I);return}r.type!=="PENDING"&&$A(!1);var C=r.point;if(jxe(C,I)){o.preventDefault();var l=r.actions.fluidLift(I);n({type:"DRAGGING",actions:l})}}}},{eventName:"mouseup",fn:function(o){var g=i();if(g.type!=="DRAGGING"){e();return}o.preventDefault(),g.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:function(o){i().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:function(o){var g=i();if(g.type==="PENDING"){e();return}if(o.keyCode===TtA){o.preventDefault(),e();return}K1A(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){i().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:function(o){var g=i();if(g.type==="IDLE"&&$A(!1),g.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:PU,fn:e}]}function z1A(A){var e=p.useRef(X1A),t=p.useRef(dm),i=oc(),n=ei(function(){return{eventName:"mousedown",fn:function(C){if(!C.defaultPrevented&&C.button===U1A&&!(C.ctrlKey||C.metaKey||C.shiftKey||C.altKey)){var l=A.findClosestDraggableId(C);if(l){var c=A.tryGetLock(l,a,{sourceEvent:C});if(c){C.preventDefault();var B={x:C.clientX,y:C.clientY};t.current(),r(c,B)}}}}}},[A]),o=ei(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(C){if(!C.defaultPrevented){var l=A.findClosestDraggableId(C);if(l){var c=A.findOptionsForDraggable(l);c&&(c.shouldRespectForcePress||A.canGetLock(l)&&C.preventDefault())}}}}},[A]),g=Ge(function(){var C={passive:!1,capture:!0};t.current=MC(i.body,[o,n],C)},[o,n]),a=Ge(function(){var C=e.current;C.type!=="IDLE"&&(e.current=X1A,t.current(),g())},[g]),s=Ge(function(){var C=e.current;a(),C.type==="DRAGGING"&&C.actions.cancel({shouldBlockNextClick:!0}),C.type==="PENDING"&&C.actions.abort()},[a]),I=Ge(function(){var C={capture:!0,passive:!1},l=Pxe({cancel:s,completed:a,getPhase:function(){return e.current},setPhase:function(c){e.current=c}});t.current=MC(i.body,l,C)},[s,a]),r=Ge(function(C,l){e.current.type!=="IDLE"&&$A(!1),e.current={type:"PENDING",point:l,actions:C},I()},[I]);QI(function(){return g(),function(){t.current()}},[g])}var _G;function $xe(){}var AFe=(_G={},_G[Uxe]=!0,_G[Kxe]=!0,_G[Xxe]=!0,_G[Vxe]=!0,_G);function eFe(A,e){function t(){e(),A.cancel()}function i(){e(),A.drop()}return[{eventName:"keydown",fn:function(n){if(n.keyCode===TtA){n.preventDefault(),t();return}if(n.keyCode===W1A){n.preventDefault(),i();return}if(n.keyCode===Oxe){n.preventDefault(),A.moveDown();return}if(n.keyCode===Txe){n.preventDefault(),A.moveUp();return}if(n.keyCode===_xe){n.preventDefault(),A.moveRight();return}if(n.keyCode===zxe){n.preventDefault(),A.moveLeft();return}if(AFe[n.keyCode]){n.preventDefault();return}K1A(n)}},{eventName:"mousedown",fn:t},{eventName:"mouseup",fn:t},{eventName:"click",fn:t},{eventName:"touchstart",fn:t},{eventName:"resize",fn:t},{eventName:"wheel",fn:t,options:{passive:!0}},{eventName:PU,fn:t}]}function T1A(A){var e=p.useRef($xe),t=oc(),i=ei(function(){return{eventName:"keydown",fn:function(o){if(o.defaultPrevented||o.keyCode!==W1A)return;var g=A.findClosestDraggableId(o);if(!g)return;var a=A.tryGetLock(g,r,{sourceEvent:o});if(!a)return;o.preventDefault();var s=!0,I=a.snapLift();e.current();function r(){s||$A(!1),s=!1,e.current(),n()}e.current=MC(t.body,eFe(I,r),{capture:!0,passive:!1})}}},[A]),n=Ge(function(){var o={passive:!1,capture:!0};e.current=MC(t.body,[i],o)},[i]);QI(function(){return n(),function(){e.current()}},[n])}var _tA={type:"IDLE"},tFe=120,iFe=.15;function nFe(A){var e=A.cancel,t=A.getPhase;return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:function(i){i.preventDefault()}},{eventName:"keydown",fn:function(i){if(t().type!=="DRAGGING"){e();return}i.keyCode===TtA&&i.preventDefault(),e()}},{eventName:PU,fn:e}]}function oFe(A){var e=A.cancel,t=A.completed,i=A.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(n){var o=i();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;var g=n.touches[0],a=g.clientX,s=g.clientY,I={x:a,y:s};n.preventDefault(),o.actions.move(I)}},{eventName:"touchend",fn:function(n){var o=i();if(o.type!=="DRAGGING"){e();return}n.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:function(n){if(i().type!=="DRAGGING"){e();return}n.preventDefault(),e()}},{eventName:"touchforcechange",fn:function(n){var o=i();o.type==="IDLE"&&$A(!1);var g=n.touches[0];if(g){var a=g.force>=iFe;if(a){var s=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){s&&e();return}if(s){if(o.hasMoved){n.preventDefault();return}e();return}n.preventDefault()}}}},{eventName:PU,fn:e}]}function _1A(A){var e=p.useRef(_tA),t=p.useRef(dm),i=oc(),n=Ge(function(){return e.current},[]),o=Ge(function(c){e.current=c},[]),g=ei(function(){return{eventName:"touchstart",fn:function(c){if(!c.defaultPrevented){var B=A.findClosestDraggableId(c);if(B){var E=A.tryGetLock(B,s,{sourceEvent:c});if(E){var u=c.touches[0],d=u.clientX,f=u.clientY,w={x:d,y:f};t.current(),l(E,w)}}}}}},[A]),a=Ge(function(){var c={capture:!0,passive:!1};t.current=MC(i.body,[g],c)},[g]),s=Ge(function(){var c=e.current;c.type!=="IDLE"&&(c.type==="PENDING"&&clearTimeout(c.longPressTimerId),o(_tA),t.current(),a())},[a,o]),I=Ge(function(){var c=e.current;s(),c.type==="DRAGGING"&&c.actions.cancel({shouldBlockNextClick:!0}),c.type==="PENDING"&&c.actions.abort()},[s]),r=Ge(function(){var c={capture:!0,passive:!1},B={cancel:I,completed:s,getPhase:n},E=MC(i.body,oFe(B),c),u=MC(i.body,nFe(B),c);t.current=function(){E(),u()}},[I,n,s]),C=Ge(function(){var c=n();c.type!=="PENDING"&&$A(!1);var B=c.actions.fluidLift(c.point);o({type:"DRAGGING",actions:B,hasMoved:!1})},[n,o]),l=Ge(function(c,B){n().type!=="IDLE"&&$A(!1);var E=setTimeout(C,tFe);o({type:"PENDING",point:B,actions:c,longPressTimerId:E}),r()},[r,n,o,C]);QI(function(){return a(),function(){t.current();var c=n();c.type==="PENDING"&&(clearTimeout(c.longPressTimerId),o(_tA))}},[n,a,o]),QI(function(){var c=MC(i.body,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return c},[])}var gFe={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function O1A(A,e){if(e==null)return!1;var t=!!gFe[e.tagName.toLowerCase()];if(t)return!0;var i=e.getAttribute("contenteditable");return i==="true"||i===""?!0:e===A?!1:O1A(A,e.parentElement)}function aFe(A,e){var t=e.target;return OU(t)?O1A(A,t):!1}var sFe=function(A){return nc(A.getBoundingClientRect()).center};function rFe(A){return A instanceof H1A(A).Element}var IFe=function(){var A="matches";if(typeof document>"u")return A;var e=[A,"msMatchesSelector","webkitMatchesSelector"],t=mm(e,function(i){return i in Element.prototype});return t||A}();function q1A(A,e){return A==null?null:A[IFe](e)?A:q1A(A.parentElement,e)}function CFe(A,e){return A.closest?A.closest(e):q1A(A,e)}function lFe(A){return"["+TG.contextId+'="'+A+'"]'}function cFe(A,e){var t=e.target;if(!rFe(t))return null;var i=lFe(A),n=CFe(t,i);return n&&OU(n)?n:null}function BFe(A,e){var t=cFe(A,e);return t?t.getAttribute(TG.draggableId):null}function QFe(A,e,t){var i="["+VtA.contextId+'="'+e+'"]',n=VRA(A.querySelectorAll(i)),o=mm(n,function(g){return g.getAttribute(VtA.id)===t});return o&&OU(o)?o:null}function EFe(A){A.preventDefault()}function $U(A){var e=A.expected,t=A.phase,i=A.isLockActive,n=A.shouldWarn;return i()?e===t:!1}function j1A(A){var e=A.lockAPI,t=A.store,i=A.registry,n=A.draggableId;if(e.isClaimed())return!1;var o=i.draggable.findById(n);return o?!(!o.options.isEnabled||!k1A(t.getState(),n)):!1}function uFe(A){var e=A.body,t=A.lockAPI,i=A.contextId,n=A.store,o=A.registry,g=A.draggableId,a=A.forceSensorStop,s=A.sourceEvent,I=j1A({lockAPI:t,store:n,registry:o,draggableId:g});if(!I)return null;var r=o.draggable.getById(g),C=QFe(e,i,r.descriptor.id);if(!C||s&&!r.options.canDragInteractiveElements&&aFe(C,s))return null;var l=t.claim(a||dm),c="PRE_DRAG";function B(){return r.options.shouldRespectForcePress}function E(){return t.isActive(l)}function u(x,F){$U({expected:x,phase:c,isLockActive:E,shouldWarn:!0})&&n.dispatch(F())}var d=u.bind(null,"DRAGGING");function f(x){function F(){t.release(),c="COMPLETED"}c!=="PRE_DRAG"&&(F(),c!=="PRE_DRAG"&&$A(!1)),n.dispatch(c1e(x.liftActionArgs)),c="DRAGGING";function Q(k,h){if(h===void 0&&(h={shouldBlockNextClick:!1}),x.cleanup(),h.shouldBlockNextClick){var N=MC(window,[{eventName:"click",fn:EFe,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(N)}F(),n.dispatch(d1A({reason:k}))}return qe({isActive:function(){return $U({expected:"DRAGGING",phase:c,isLockActive:E,shouldWarn:!1})},shouldRespectForcePress:B,drop:function(k){return Q("DROP",k)},cancel:function(k){return Q("CANCEL",k)}},x.actions)}function w(x){var F=xx(function(k){d(function(){return u1A({client:k})})}),Q=f({liftActionArgs:{id:g,clientSelection:x,movementMode:"FLUID"},cleanup:function(){return F.cancel()},actions:{move:F}});return qe({},Q,{move:F})}function y(){var x={moveUp:function(){return d(f1e)},moveRight:function(){return d(b1e)},moveDown:function(){return d(y1e)},moveLeft:function(){return d(w1e)}};return f({liftActionArgs:{id:g,clientSelection:sFe(C),movementMode:"SNAP"},cleanup:dm,actions:x})}function G(){var x=$U({expected:"PRE_DRAG",phase:c,isLockActive:E,shouldWarn:!0});x&&t.release()}var R={isActive:function(){return $U({expected:"PRE_DRAG",phase:c,isLockActive:E,shouldWarn:!1})},shouldRespectForcePress:B,fluidLift:w,snapLift:y,abort:G};return R}var dFe=[z1A,T1A,_1A];function hFe(A){var e=A.contextId,t=A.store,i=A.registry,n=A.customSensors,o=A.enableDefaultSensors,g=[].concat(o?dFe:[],n||[]),a=p.useState(function(){return Hxe()})[0],s=Ge(function(f,w){f.isDragging&&!w.isDragging&&a.tryAbandon()},[a]);QI(function(){var f=t.getState(),w=t.subscribe(function(){var y=t.getState();s(f,y),f=y});return w},[a,t,s]),QI(function(){return a.tryAbandon},[a.tryAbandon]);for(var I=oc(),r=Ge(function(f){return j1A({lockAPI:a,registry:i,store:t,draggableId:f})},[a,i,t]),C=Ge(function(f,w,y){return uFe({body:I.body,lockAPI:a,registry:i,contextId:e,store:t,draggableId:f,forceSensorStop:w,sourceEvent:y&&y.sourceEvent?y.sourceEvent:null})},[e,a,i,t,I]),l=Ge(function(f){return BFe(e,f)},[e]),c=Ge(function(f){var w=i.draggable.findById(f);return w?w.options:null},[i.draggable]),B=Ge(function(){a.isClaimed()&&(a.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(RtA()))},[a,t]),E=Ge(a.isClaimed,[a]),u=ei(function(){return{canGetLock:r,tryGetLock:C,findClosestDraggableId:l,findOptionsForDraggable:c,tryReleaseLock:B,isLockClaimed:E}},[r,C,l,c,B,E]),d=0;d<g.length;d++)g[d](u)}var mFe=function(A){return{onBeforeCapture:A.onBeforeCapture,onBeforeDragStart:A.onBeforeDragStart,onDragStart:A.onDragStart,onDragEnd:A.onDragEnd,onDragUpdate:A.onDragUpdate}};function Vx(A){return A.current||$A(!1),A.current}function pFe(A){var e=A.contextId,t=A.setCallbacks,i=A.sensors,n=A.nonce,o=A.dragHandleUsageInstructions,g=p.useRef(null),a=Z1A(A),s=Ge(function(){return mFe(a.current)},[a]),I=Fxe(e),r=Sxe({contextId:e,text:o}),C=Gxe(e,n),l=Ge(function(Q){Vx(g).dispatch(Q)},[]),c=ei(function(){return tRA({publishWhileDragging:Q1e,updateDroppableScroll:u1e,updateDroppableIsEnabled:d1e,updateDroppableIsCombineEnabled:h1e,collectionStarting:E1e},l)},[l]),B=Yxe(),E=ei(function(){return oxe(B,c)},[B,c]),u=ei(function(){return fxe(qe({scrollWindow:gxe,scrollDroppable:E.scrollDroppable},tRA({move:u1A},l)))},[E.scrollDroppable,l]),d=Jxe(e),f=ei(function(){return exe({announce:I,autoScroller:u,dimensionMarshal:E,focusMarshal:d,getResponders:s,styleMarshal:C})},[I,u,E,d,s,C]);g.current=f;var w=Ge(function(){var Q=Vx(g),k=Q.getState();k.phase!=="IDLE"&&Q.dispatch(RtA())},[]),y=Ge(function(){var Q=Vx(g).getState();return Q.isDragging||Q.phase==="DROP_ANIMATING"},[]),G=ei(function(){return{isDragging:y,tryAbort:w}},[y,w]);t(G);var R=Ge(function(Q){return k1A(Vx(g).getState(),Q)},[]),x=Ge(function(){return ly(Vx(g).getState())},[]),F=ei(function(){return{marshal:E,focus:d,contextId:e,canLift:R,isMovementAllowed:x,dragHandleUsageInstructionsId:r,registry:B}},[e,E,r,d,R,x,B]);return hFe({contextId:e,store:f,registry:B,customSensors:i,enableDefaultSensors:A.enableDefaultSensors!==!1}),p.useEffect(function(){return w},[w]),b.createElement(qU.Provider,{value:F},b.createElement(XYe,{context:XtA,store:f},A.children))}var fFe=0;function yFe(){return ei(function(){return""+fFe++},[])}function bFe(A){var e=yFe(),t=A.dragHandleUsageInstructions||WU.dragHandleUsageInstructions;return b.createElement(iRe,null,function(i){return b.createElement(pFe,{nonce:A.nonce,contextId:e,setCallbacks:i,dragHandleUsageInstructions:t,enableDefaultSensors:A.enableDefaultSensors,sensors:A.sensors,onBeforeCapture:A.onBeforeCapture,onBeforeDragStart:A.onBeforeDragStart,onDragStart:A.onDragStart,onDragUpdate:A.onDragUpdate,onDragEnd:A.onDragEnd},A.children)})}var P1A=function(A){return function(e){return A===e}},wFe=P1A("scroll"),DFe=P1A("auto"),$1A=function(A,e){return e(A.overflowX)||e(A.overflowY)},GFe=function(A){var e=window.getComputedStyle(A),t={overflowX:e.overflowX,overflowY:e.overflowY};return $1A(t,wFe)||$1A(t,DFe)},kFe=function(A){return!1},JFe=function A(e,t){return t==null?null:t===document.body?kFe()?t:null:t===document.documentElement?null:GFe(t)?t:A(e,t.parentElement)},OtA=function(A){return{x:A.scrollLeft,y:A.scrollTop}},NFe=function A(e){if(!e)return!1;var t=window.getComputedStyle(e);return t.position==="fixed"?!0:A(e.parentElement)},YFe=function(A,e){var t=JFe(A,e),i=NFe(e);return{closestScrollable:t,isFixedOnPage:i}},RFe=function(A){var e=A.descriptor,t=A.isEnabled,i=A.isCombineEnabled,n=A.isFixedOnPage,o=A.direction,g=A.client,a=A.page,s=A.closest,I=function(){if(!s)return null;var c=s.scrollSize,B=s.client,E=b1A({scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth,height:B.paddingBox.height,width:B.paddingBox.width});return{pageMarginBox:s.page.marginBox,frameClient:B,scrollSize:c,shouldClipSubject:s.shouldClipSubject,scroll:{initial:s.scroll,current:s.scroll,max:E,diff:{value:Bg,displacement:Bg}}}}(),r=o==="vertical"?btA:ORA,C=UG({page:a,withPlaceholder:null,axis:r,frame:I}),l={descriptor:e,isCombineEnabled:i,isFixedOnPage:n,axis:r,isEnabled:t,client:g,page:a,frame:I,subject:C};return l},xFe=function(A,e){var t=FRA(A);if(!e||A!==e)return t;var i=t.paddingBox.top-e.scrollTop,n=t.paddingBox.left-e.scrollLeft,o=i+e.scrollHeight,g=n+e.scrollWidth,a={top:i,right:g,bottom:o,left:n},s=utA(a,t.border),I=htA({borderBox:s,margin:t.margin,border:t.border,padding:t.padding});return I},FFe=function(A){var e=A.ref,t=A.descriptor,i=A.env,n=A.windowScroll,o=A.direction,g=A.isDropDisabled,a=A.isCombineEnabled,s=A.shouldClipSubject,I=i.closestScrollable,r=xFe(e,I),C=SU(r,n),l=function(){if(!I)return null;var B=FRA(I),E={scrollHeight:I.scrollHeight,scrollWidth:I.scrollWidth};return{client:B,page:SU(B,n),scroll:OtA(I),scrollSize:E,shouldClipSubject:s}}(),c=RFe({descriptor:t,isEnabled:!g,isCombineEnabled:a,isFixedOnPage:i.isFixedOnPage,direction:o,client:r,page:C,closest:l});return c},MFe={passive:!1},vFe={passive:!0},AxA=function(A){return A.shouldPublishImmediately?MFe:vFe};function AV(A){var e=p.useContext(A);return e||$A(!1),e}var eV=function(A){return A&&A.env.closestScrollable||null};function LFe(A){var e=p.useRef(null),t=AV(qU),i=ztA("droppable"),n=t.registry,o=t.marshal,g=Z1A(A),a=ei(function(){return{id:A.droppableId,type:A.type,mode:A.mode}},[A.droppableId,A.mode,A.type]),s=p.useRef(a),I=ei(function(){return cg(function(G,R){e.current||$A(!1);var x={x:G,y:R};o.updateDroppableScroll(a.id,x)})},[a.id,o]),r=Ge(function(){var G=e.current;return!G||!G.env.closestScrollable?Bg:OtA(G.env.closestScrollable)},[]),C=Ge(function(){var G=r();I(G.x,G.y)},[r,I]),l=ei(function(){return xx(C)},[C]),c=Ge(function(){var G=e.current,R=eV(G);G&&R||$A(!1);var x=G.scrollOptions;if(x.shouldPublishImmediately){C();return}l()},[l,C]),B=oc(),E=Ge(function(G,R){e.current&&$A(!1);var x=g.current,F=x.getDroppableRef();F||$A(!1);var Q=YFe(B.body,F),k={ref:F,descriptor:a,env:Q,scrollOptions:R};e.current=k;var h=FFe({ref:F,descriptor:a,env:Q,windowScroll:G,direction:x.direction,isDropDisabled:x.isDropDisabled,isCombineEnabled:x.isCombineEnabled,shouldClipSubject:!x.ignoreContainerClipping}),N=Q.closestScrollable;return N&&(N.setAttribute(L1A.contextId,t.contextId),N.addEventListener("scroll",c,AxA(k.scrollOptions))),h},[t.contextId,a,c,g,B]),u=Ge(function(){var G=e.current,R=eV(G);return G&&R||$A(!1),OtA(R)},[]),d=Ge(function(){var G=e.current;G||$A(!1);var R=eV(G);e.current=null,R&&(l.cancel(),R.removeAttribute(L1A.contextId),R.removeEventListener("scroll",c,AxA(G.scrollOptions)))},[c,l]),f=Ge(function(G){var R=e.current;R||$A(!1);var x=eV(R);x||$A(!1),x.scrollTop+=G.y,x.scrollLeft+=G.x},[]),w=ei(function(){return{getDimensionAndWatchScroll:E,getScrollWhileDragging:u,dragStopped:d,scroll:f}},[d,E,u,f]),y=ei(function(){return{uniqueId:i,descriptor:a,callbacks:w}},[w,a,i]);QI(function(){return s.current=y.descriptor,n.droppable.register(y),function(){e.current&&d(),n.droppable.unregister(y)}},[w,a,d,y,o,n.droppable]),QI(function(){e.current&&o.updateDroppableIsEnabled(s.current.id,!A.isDropDisabled)},[A.isDropDisabled,o]),QI(function(){e.current&&o.updateDroppableIsCombineEnabled(s.current.id,A.isCombineEnabled)},[A.isCombineEnabled,o])}function qtA(){}var SFe={width:0,height:0,margin:rRe},HFe=function(A){var e=A.isAnimatingOpenOnMount,t=A.placeholder,i=A.animate;return e||i==="close"?SFe:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin}},ZFe=function(A){var e=A.isAnimatingOpenOnMount,t=A.placeholder,i=A.animate,n=HFe({isAnimatingOpenOnMount:e,placeholder:t,animate:i});return{display:t.display,boxSizing:"border-box",width:n.width,height:n.height,marginTop:n.margin.top,marginRight:n.margin.right,marginBottom:n.margin.bottom,marginLeft:n.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:i!=="none"?Wx.placeholder:null}};function WFe(A){var e=p.useRef(null),t=Ge(function(){e.current&&(clearTimeout(e.current),e.current=null)},[]),i=A.animate,n=A.onTransitionEnd,o=A.onClose,g=A.contextId,a=p.useState(A.animate==="open"),s=a[0],I=a[1];p.useEffect(function(){return s?i!=="open"?(t(),I(!1),qtA):e.current?qtA:(e.current=setTimeout(function(){e.current=null,I(!1)}),t):qtA},[i,s,t]);var r=Ge(function(l){l.propertyName==="height"&&(n(),i==="close"&&o())},[i,o,n]),C=ZFe({isAnimatingOpenOnMount:s,animate:A.animate,placeholder:A.placeholder});return b.createElement(A.placeholder.tagName,{style:C,"data-rbd-placeholder-context-id":g,onTransitionEnd:r,ref:A.innerRef})}var KFe=b.memo(WFe),jtA=b.createContext(null),UFe=function(A){_YA(e,A);function e(){for(var i,n=arguments.length,o=new Array(n),g=0;g<n;g++)o[g]=arguments[g];return i=A.call.apply(A,[this].concat(o))||this,i.state={isVisible:!!i.props.on,data:i.props.on,animate:i.props.shouldAnimate&&i.props.on?"open":"none"},i.onClose=function(){i.state.animate==="close"&&i.setState({isVisible:!1})},i}e.getDerivedStateFromProps=function(i,n){return i.shouldAnimate?i.on?{isVisible:!0,data:i.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!i.on,data:i.on,animate:"none"}};var t=e.prototype;return t.render=function(){if(!this.state.isVisible)return null;var i={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(i)},e}(b.PureComponent),exA={dragging:5e3,dropAnimating:4500},VFe=function(A,e){return e?Wx.drop(e.duration):A?Wx.snap:Wx.fluid},XFe=function(A,e){return A?e?Zx.opacity.drop:Zx.opacity.combining:null},zFe=function(A){return A.forceShouldAnimate!=null?A.forceShouldAnimate:A.mode==="SNAP"};function TFe(A){var e=A.dimension,t=e.client,i=A.offset,n=A.combineWith,o=A.dropping,g=!!n,a=zFe(A),s=!!o,I=s?vtA.drop(i,g):vtA.moveTo(i),r={position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:VFe(a,o),transform:I,opacity:XFe(g,s),zIndex:s?exA.dropAnimating:exA.dragging,pointerEvents:"none"};return r}function _Fe(A){return{transform:vtA.moveTo(A.offset),transition:A.shouldAnimateDisplacement?null:"none"}}function OFe(A){return A.type==="DRAGGING"?TFe(A):_Fe(A)}function qFe(A,e,t){t===void 0&&(t=Bg);var i=window.getComputedStyle(e),n=e.getBoundingClientRect(),o=xRA(n,i),g=SU(o,t),a={client:o,tagName:e.tagName.toLowerCase(),display:i.display},s={x:o.marginBox.width,y:o.marginBox.height},I={descriptor:A,placeholder:a,displaceBy:s,client:o,page:g};return I}function jFe(A){var e=ztA("draggable"),t=A.descriptor,i=A.registry,n=A.getDraggableRef,o=A.canDragInteractiveElements,g=A.shouldRespectForcePress,a=A.isEnabled,s=ei(function(){return{canDragInteractiveElements:o,shouldRespectForcePress:g,isEnabled:a}},[o,a,g]),I=Ge(function(c){var B=n();return B||$A(!1),qFe(t,B,c)},[t,n]),r=ei(function(){return{uniqueId:e,descriptor:t,options:s,getDimension:I}},[t,I,s,e]),C=p.useRef(r),l=p.useRef(!0);QI(function(){return i.draggable.register(C.current),function(){return i.draggable.unregister(C.current)}},[i.draggable]),QI(function(){if(l.current){l.current=!1;return}var c=C.current;C.current=r,i.draggable.update(r,c)},[r,i.draggable])}function PFe(A,e,t){oc()}function $Fe(A){A.preventDefault()}function AMe(A){var e=p.useRef(null),t=Ge(function(Q){e.current=Q},[]),i=Ge(function(){return e.current},[]),n=AV(qU),o=n.contextId,g=n.dragHandleUsageInstructionsId,a=n.registry,s=AV(jtA),I=s.type,r=s.droppableId,C=ei(function(){return{id:A.draggableId,index:A.index,type:I,droppableId:r}},[A.draggableId,A.index,I,r]),l=A.children,c=A.draggableId,B=A.isEnabled,E=A.shouldRespectForcePress,u=A.canDragInteractiveElements,d=A.isClone,f=A.mapped,w=A.dropAnimationFinished;if(PFe(),!d){var y=ei(function(){return{descriptor:C,registry:a,getDraggableRef:i,canDragInteractiveElements:u,shouldRespectForcePress:E,isEnabled:B}},[C,a,i,u,E,B]);jFe(y)}var G=ei(function(){return B?{tabIndex:0,role:"button","aria-describedby":g,"data-rbd-drag-handle-draggable-id":c,"data-rbd-drag-handle-context-id":o,draggable:!1,onDragStart:$Fe}:null},[o,g,c,B]),R=Ge(function(Q){f.type==="DRAGGING"&&f.dropping&&Q.propertyName==="transform"&&w()},[w,f]),x=ei(function(){var Q=OFe(f),k=f.type==="DRAGGING"&&f.dropping?R:null,h={innerRef:t,draggableProps:{"data-rbd-draggable-context-id":o,"data-rbd-draggable-id":c,style:Q,onTransitionEnd:k},dragHandleProps:G};return h},[o,G,c,f,R,t]),F=ei(function(){return{draggableId:C.id,type:C.type,source:{index:C.index,droppableId:C.droppableId}}},[C.droppableId,C.id,C.index,C.type]);return l(x,f.snapshot,F)}var txA=function(A,e){return A===e},ixA=function(A){var e=A.combine,t=A.destination;return t?t.droppableId:e?e.droppableId:null},eMe=function(A){return A.combine?A.combine.draggableId:null},tMe=function(A){return A.at&&A.at.type==="COMBINE"?A.at.combine.draggableId:null};function iMe(){var A=cg(function(n,o){return{x:n,y:o}}),e=cg(function(n,o,g,a,s){return{isDragging:!0,isClone:o,isDropAnimating:!!s,dropAnimation:s,mode:n,draggingOver:g,combineWith:a,combineTargetFor:null}}),t=cg(function(n,o,g,a,s,I,r){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:s,combineWith:I,mode:o,offset:n,dimension:g,forceShouldAnimate:r,snapshot:e(o,a,s,I,null)}}}),i=function(n,o){if(n.isDragging){if(n.critical.draggable.id!==o.draggableId)return null;var g=n.current.client.offset,a=n.dimensions.draggables[o.draggableId],s=BI(n.impact),I=tMe(n.impact),r=n.forceShouldAnimate;return t(A(g.x,g.y),n.movementMode,a,o.isClone,s,I,r)}if(n.phase==="DROP_ANIMATING"){var C=n.completed;if(C.result.draggableId!==o.draggableId)return null;var l=o.isClone,c=n.dimensions.draggables[o.draggableId],B=C.result,E=B.mode,u=ixA(B),d=eMe(B),f=n.dropDuration,w={duration:f,curve:FtA.drop,moveTo:n.newHomeClientOffset,opacity:d?Zx.opacity.drop:null,scale:d?Zx.scale.drop:null};return{mapped:{type:"DRAGGING",offset:n.newHomeClientOffset,dimension:c,dropping:w,draggingOver:u,combineWith:d,mode:E,forceShouldAnimate:null,snapshot:e(E,l,u,d,w)}}}return null};return i}function nxA(A){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:A,combineWith:null}}var nMe={mapped:{type:"SECONDARY",offset:Bg,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:nxA(null)}};function oMe(){var A=cg(function(g,a){return{x:g,y:a}}),e=cg(nxA),t=cg(function(g,a,s){return a===void 0&&(a=null),{mapped:{type:"SECONDARY",offset:g,combineTargetFor:a,shouldAnimateDisplacement:s,snapshot:e(a)}}}),i=function(g){return g?t(Bg,g,!0):null},n=function(g,a,s,I){var r=s.displaced.visible[g],C=!!(I.inVirtualList&&I.effected[g]),l=VU(s),c=l&&l.draggableId===g?a:null;if(!r){if(!C)return i(c);if(s.displaced.invisible[g])return null;var B=KG(I.displacedBy.point),E=A(B.x,B.y);return t(E,c,!0)}if(C)return i(c);var u=s.displacedBy.point,d=A(u.x,u.y);return t(d,c,r.shouldAnimate)},o=function(g,a){if(g.isDragging)return g.critical.draggable.id===a.draggableId?null:n(a.draggableId,g.critical.draggable.id,g.impact,g.afterCritical);if(g.phase==="DROP_ANIMATING"){var s=g.completed;return s.result.draggableId===a.draggableId?null:n(a.draggableId,s.result.draggableId,s.impact,s.afterCritical)}return null};return o}var gMe=function(){var A=iMe(),e=oMe(),t=function(i,n){return A(i,n)||e(i,n)||nMe};return t},aMe={dropAnimationFinished:h1A},sMe=NRA(gMe,aMe,null,{context:XtA,areStatePropsEqual:txA})(AMe);function oxA(A){var e=AV(jtA),t=e.isUsingCloneFor;return t===A.draggableId&&!A.isClone?null:b.createElement(sMe,A)}function OG(A){var e=typeof A.isDragDisabled=="boolean"?!A.isDragDisabled:!0,t=!!A.disableInteractiveElementBlocking,i=!!A.shouldRespectForcePress;return b.createElement(oxA,qe({},A,{isClone:!1,isEnabled:e,canDragInteractiveElements:t,shouldRespectForcePress:i}))}function rMe(A){var e=p.useContext(qU);e||$A(!1);var t=e.contextId,i=e.isMovementAllowed,n=p.useRef(null),o=p.useRef(null),g=A.children,a=A.droppableId,s=A.type,I=A.mode,r=A.direction,C=A.ignoreContainerClipping,l=A.isDropDisabled,c=A.isCombineEnabled,B=A.snapshot,E=A.useClone,u=A.updateViewportMaxScroll,d=A.getContainerForClone,f=Ge(function(){return n.current},[]),w=Ge(function(N){n.current=N},[]);Ge(function(){return o.current},[]);var y=Ge(function(N){o.current=N},[]),G=Ge(function(){i()&&u({maxScroll:D1A()})},[i,u]);LFe({droppableId:a,type:s,mode:I,direction:r,isDropDisabled:l,isCombineEnabled:c,ignoreContainerClipping:C,getDroppableRef:f});var R=b.createElement(UFe,{on:A.placeholder,shouldAnimate:A.shouldAnimatePlaceholder},function(N){var v=N.onClose,K=N.data,U=N.animate;return b.createElement(KFe,{placeholder:K,onClose:v,innerRef:y,animate:U,contextId:t,onTransitionEnd:G})}),x=ei(function(){return{innerRef:w,placeholder:R,droppableProps:{"data-rbd-droppable-id":a,"data-rbd-droppable-context-id":t}}},[t,a,R,w]),F=E?E.dragging.draggableId:null,Q=ei(function(){return{droppableId:a,type:s,isUsingCloneFor:F}},[a,F,s]),k=oc();function h(){if(!E)return null;var N=E.dragging,v=E.render,K=b.createElement(oxA,{draggableId:N.draggableId,index:N.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(U,V){return v(U,V,N)});return bP.createPortal(K,d?d():k.body)}return b.createElement(jtA.Provider,{value:Q},g(x,B),h())}var PtA=function(A,e){return A===e.droppable.type},gxA=function(A,e){return e.draggables[A.draggable.id]},IMe=function(){var A={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},e=qe({},A,{shouldAnimatePlaceholder:!1}),t=cg(function(o){return{draggableId:o.id,type:o.type,source:{index:o.index,droppableId:o.droppableId}}}),i=cg(function(o,g,a,s,I,r){var C=I.descriptor.id,l=I.descriptor.droppableId===o;if(l){var c=r?{render:r,dragging:t(I.descriptor)}:null,B={isDraggingOver:a,draggingOverWith:a?C:null,draggingFromThisWith:C,isUsingPlaceholder:!0};return{placeholder:I.placeholder,shouldAnimatePlaceholder:!1,snapshot:B,useClone:c}}if(!g)return e;if(!s)return A;var E={isDraggingOver:a,draggingOverWith:C,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:I.placeholder,shouldAnimatePlaceholder:!0,snapshot:E,useClone:null}}),n=function(o,g){var a=g.droppableId,s=g.type,I=!g.isDropDisabled,r=g.renderClone;if(o.isDragging){var C=o.critical;if(!PtA(s,C))return e;var l=gxA(C,o.dimensions),c=BI(o.impact)===a;return i(a,I,c,c,l,r)}if(o.phase==="DROP_ANIMATING"){var B=o.completed;if(!PtA(s,B.critical))return e;var E=gxA(B.critical,o.dimensions);return i(a,I,ixA(B.result)===a,BI(B.impact)===a,E,r)}if(o.phase==="IDLE"&&o.completed&&!o.shouldFlush){var u=o.completed;if(!PtA(s,u.critical))return e;var d=BI(u.impact)===a,f=!!(u.impact.at&&u.impact.at.type==="COMBINE"),w=u.critical.droppable.id===a;return d?f?A:e:w?A:e}return e};return n},CMe={updateViewportMaxScroll:p1e},lMe={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:null},By=NRA(IMe,CMe,null,{context:XtA,areStatePropsEqual:txA})(rMe);By.defaultProps=lMe;function qt(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];throw new Error(typeof A=="number"?"[MobX] minified error nr: "+A+(t.length?" "+t.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+A)}var cMe={};function $tA(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:cMe}var axA=Object.assign,tV=Object.getOwnPropertyDescriptor,OB=Object.defineProperty,Xx=Object.prototype,AiA=[];Object.freeze(AiA);var eiA={};Object.freeze(eiA);var BMe=typeof Proxy<"u",QMe=Object.toString();function sxA(){BMe||qt("Proxy not available")}function rxA(A){var e=!1;return function(){if(!e)return e=!0,A.apply(this,arguments)}}var qG=function(){};function gc(A){return typeof A=="function"}function Qy(A){var e=typeof A;switch(e){case"string":case"symbol":case"number":return!0}return!1}function iV(A){return A!==null&&typeof A=="object"}function Mu(A){if(!iV(A))return!1;var e=Object.getPrototypeOf(A);if(e==null)return!0;var t=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t.toString()===QMe}function IxA(A){var e=A==null?void 0:A.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function zx(A,e,t){OB(A,e,{enumerable:!1,writable:!0,configurable:!0,value:t})}function CxA(A,e,t){OB(A,e,{enumerable:!1,writable:!1,configurable:!0,value:t})}function ym(A,e){var t="isMobX"+A;return e.prototype[t]=!0,function(i){return iV(i)&&i[t]===!0}}function jG(A){return A instanceof Map}function Tx(A){return A instanceof Set}var lxA=typeof Object.getOwnPropertySymbols<"u";function EMe(A){var e=Object.keys(A);if(!lxA)return e;var t=Object.getOwnPropertySymbols(A);return t.length?[].concat(e,t.filter(function(i){return Xx.propertyIsEnumerable.call(A,i)})):e}var PG=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:lxA?function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:Object.getOwnPropertyNames;function cxA(A){return A===null?null:typeof A=="object"?""+A:A}function vu(A,e){return Xx.hasOwnProperty.call(A,e)}var uMe=Object.getOwnPropertyDescriptors||function(A){var e={};return PG(A).forEach(function(t){e[t]=tV(A,t)}),e};function BxA(A,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(A,mMe(i.key),i)}}function tiA(A,e,t){return e&&BxA(A.prototype,e),t&&BxA(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A}function Ey(){return Ey=Object.assign?Object.assign.bind():function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},Ey.apply(this,arguments)}function QxA(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,iiA(A,e)}function iiA(A,e){return iiA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},iiA(A,e)}function niA(A){if(A===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function dMe(A,e){if(A){if(typeof A=="string")return ExA(A,e);var t=Object.prototype.toString.call(A).slice(8,-1);if(t==="Object"&&A.constructor&&(t=A.constructor.name),t==="Map"||t==="Set")return Array.from(A);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ExA(A,e)}}function ExA(A,e){(e==null||e>A.length)&&(e=A.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=A[t];return i}function $G(A,e){var t=typeof Symbol<"u"&&A[Symbol.iterator]||A["@@iterator"];if(t)return(t=t.call(A)).next.bind(t);if(Array.isArray(A)||(t=dMe(A))||e&&A&&typeof A.length=="number"){t&&(A=t);var i=0;return function(){return i>=A.length?{done:!0}:{done:!1,value:A[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hMe(A,e){if(typeof A!="object"||A===null)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var i=t.call(A,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function mMe(A){var e=hMe(A,"string");return typeof e=="symbol"?e:String(e)}var qB=Symbol("mobx-stored-annotations");function jB(A){function e(t,i){if(_x(i))return A.decorate_20223_(t,i);Ak(t,i,A)}return Object.assign(e,A)}function Ak(A,e,t){vu(A,qB)||zx(A,qB,Ey({},A[qB])),JMe(t)||(A[qB][e]=t)}function pMe(A){return vu(A,qB)||zx(A,qB,Ey({},A[qB])),A[qB]}function _x(A){return typeof A=="object"&&typeof A.kind=="string"}var Le=Symbol("mobx administration"),Ox=function(){function A(t){t===void 0&&(t="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.batchId_=void 0,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=si.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=t,this.batchId_=qA.inBatch?qA.batchId:NaN}var e=A.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(t){return t()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(t){return t()})},e.reportObserved=function(){return SxA(this)},e.reportChanged=function(){(!qA.inBatch||this.batchId_!==qA.batchId)&&(qA.stateVersion=qA.stateVersion<Number.MAX_SAFE_INTEGER?qA.stateVersion+1:Number.MIN_SAFE_INTEGER,this.batchId_=NaN),LC(),HxA(this),SC()},e.toString=function(){return this.name_},A}(),oiA=ym("Atom",Ox);function uxA(A,e,t){e===void 0&&(e=qG),t===void 0&&(t=qG);var i=new Ox(A);return e!==qG&&Fve(i,e),t!==qG&&TxA(i,t),i}function fMe(A,e){return A===e}function yMe(A,e){return fiA(A,e)}function bMe(A,e){return fiA(A,e,1)}function wMe(A,e){return Object.is?Object.is(A,e):A===e?A!==0||1/A===1/e:A!==A&&e!==e}var ek={identity:fMe,structural:yMe,default:wMe,shallow:bMe};function tk(A,e,t){return EiA(A)?A:Array.isArray(A)?xo.array(A,{name:t}):Mu(A)?xo.object(A,void 0,{name:t}):jG(A)?xo.map(A,{name:t}):Tx(A)?xo.set(A,{name:t}):typeof A=="function"&&!uV(A)&&!tF(A)?IxA(A)?ok(A):eF(t,A):A}function DMe(A,e,t){if(A==null||sk(A)||oF(A)||Gm(A)||my(A))return A;if(Array.isArray(A))return xo.array(A,{name:t,deep:!1});if(Mu(A))return xo.object(A,void 0,{name:t,deep:!1});if(jG(A))return xo.map(A,{name:t,deep:!1});if(Tx(A))return xo.set(A,{name:t,deep:!1})}function nV(A){return A}function GMe(A,e){return fiA(A,e)?e:A}var kMe="override";function JMe(A){return A.annotationType_===kMe}function qx(A,e){return{annotationType_:A,options_:e,make_:NMe,extend_:YMe,decorate_20223_:RMe}}function NMe(A,e,t,i){var n;if((n=this.options_)!=null&&n.bound)return this.extend_(A,e,t,!1)===null?0:1;if(i===A.target_)return this.extend_(A,e,t,!1)===null?0:2;if(uV(t.value))return 1;var o=dxA(A,this,e,t,!1);return OB(i,e,o),2}function YMe(A,e,t,i){var n=dxA(A,this,e,t);return A.defineProperty_(e,n,i)}function RMe(A,e){var t=e.kind,i=e.name,n=e.addInitializer,o=this,g=function(s){var I,r,C,l;return uy((I=(r=o.options_)==null?void 0:r.name)!=null?I:i.toString(),s,(C=(l=o.options_)==null?void 0:l.autoAction)!=null?C:!1)};if(t=="field"){n(function(){Ak(this,i,o)});return}if(t=="method"){var a;return uV(A)||(A=g(A)),(a=this.options_)!=null&&a.bound&&n(function(){var s=this,I=s[i].bind(s);I.isMobxAction=!0,s[i]=I}),A}qt("Cannot apply '"+o.annotationType_+"' to '"+String(i)+"' (kind: "+t+"):"+(`
'`+o.annotationType_+"' can only be used on properties with a function value."))}function xMe(A,e,t,i){e.annotationType_,i.value}function dxA(A,e,t,i,n){var o,g,a,s,I,r,C;n===void 0&&(n=qA.safeDescriptors),xMe(A,e,t,i);var l=i.value;if((o=e.options_)!=null&&o.bound){var c;l=l.bind((c=A.proxy_)!=null?c:A.target_)}return{value:uy((g=(a=e.options_)==null?void 0:a.name)!=null?g:t.toString(),l,(s=(I=e.options_)==null?void 0:I.autoAction)!=null?s:!1,(r=e.options_)!=null&&r.bound?(C=A.proxy_)!=null?C:A.target_:void 0),configurable:n?A.isPlainObject_:!0,enumerable:!1,writable:!n}}function hxA(A,e){return{annotationType_:A,options_:e,make_:FMe,extend_:MMe,decorate_20223_:vMe}}function FMe(A,e,t,i){var n;if(i===A.target_)return this.extend_(A,e,t,!1)===null?0:2;if((n=this.options_)!=null&&n.bound&&(!vu(A.target_,e)||!tF(A.target_[e]))&&this.extend_(A,e,t,!1)===null)return 0;if(tF(t.value))return 1;var o=mxA(A,this,e,t,!1,!1);return OB(i,e,o),2}function MMe(A,e,t,i){var n,o=mxA(A,this,e,t,(n=this.options_)==null?void 0:n.bound);return A.defineProperty_(e,o,i)}function vMe(A,e){var t,i=e.name,n=e.addInitializer;return tF(A)||(A=ok(A)),(t=this.options_)!=null&&t.bound&&n(function(){var o=this,g=o[i].bind(o);g.isMobXFlow=!0,o[i]=g}),A}function LMe(A,e,t,i){e.annotationType_,i.value}function mxA(A,e,t,i,n,o){o===void 0&&(o=qA.safeDescriptors),LMe(A,e,t,i);var g=i.value;if(tF(g)||(g=ok(g)),n){var a;g=g.bind((a=A.proxy_)!=null?a:A.target_),g.isMobXFlow=!0}return{value:g,configurable:o?A.isPlainObject_:!0,enumerable:!1,writable:!o}}function giA(A,e){return{annotationType_:A,options_:e,make_:SMe,extend_:HMe,decorate_20223_:ZMe}}function SMe(A,e,t){return this.extend_(A,e,t,!1)===null?0:1}function HMe(A,e,t,i){return WMe(A,this,e,t),A.defineComputedProperty_(e,Ey({},this.options_,{get:t.get,set:t.set}),i)}function ZMe(A,e){var t=this,i=e.name,n=e.addInitializer;return n(function(){var o=py(this)[Le],g=Ey({},t.options_,{get:A,context:this});g.name||(g.name="ObservableObject."+i.toString()),o.values_.set(i,new ik(g))}),function(){return this[Le].getObservablePropValue_(i)}}function WMe(A,e,t,i){e.annotationType_,i.get}function oV(A,e){return{annotationType_:A,options_:e,make_:KMe,extend_:UMe,decorate_20223_:VMe}}function KMe(A,e,t){return this.extend_(A,e,t,!1)===null?0:1}function UMe(A,e,t,i){var n,o;return XMe(A,this),A.defineObservableProperty_(e,t.value,(n=(o=this.options_)==null?void 0:o.enhancer)!=null?n:tk,i)}function VMe(A,e){var t=this,i=e.kind,n=e.name,o=new WeakSet;function g(a,s){var I,r,C=py(a)[Le],l=new bm(s,(I=(r=t.options_)==null?void 0:r.enhancer)!=null?I:tk,"ObservableObject."+n.toString(),!1);C.values_.set(n,l),o.add(a)}if(i=="accessor")return{get:function(){return o.has(this)||g(this,A.get.call(this)),this[Le].getObservablePropValue_(n)},set:function(a){return o.has(this)||g(this,a),this[Le].setObservablePropValue_(n,a)},init:function(a){return o.has(this)||g(this,a),a}}}function XMe(A,e,t,i){e.annotationType_}var zMe="true",TMe=pxA();function pxA(A){return{annotationType_:zMe,options_:A,make_:_Me,extend_:OMe,decorate_20223_:qMe}}function _Me(A,e,t,i){var n,o;if(t.get)return jx.make_(A,e,t,i);if(t.set){var g=uy(e.toString(),t.set);return i===A.target_?A.defineProperty_(e,{configurable:qA.safeDescriptors?A.isPlainObject_:!0,set:g})===null?0:2:(OB(i,e,{configurable:!0,set:g}),2)}if(i!==A.target_&&typeof t.value=="function"){var a;if(IxA(t.value)){var s,I=(s=this.options_)!=null&&s.autoBind?ok.bound:ok;return I.make_(A,e,t,i)}var r=(a=this.options_)!=null&&a.autoBind?eF.bound:eF;return r.make_(A,e,t,i)}var C=((n=this.options_)==null?void 0:n.deep)===!1?xo.ref:xo;if(typeof t.value=="function"&&(o=this.options_)!=null&&o.autoBind){var l;t.value=t.value.bind((l=A.proxy_)!=null?l:A.target_)}return C.make_(A,e,t,i)}function OMe(A,e,t,i){var n,o;if(t.get)return jx.extend_(A,e,t,i);if(t.set)return A.defineProperty_(e,{configurable:qA.safeDescriptors?A.isPlainObject_:!0,set:uy(e.toString(),t.set)},i);if(typeof t.value=="function"&&(n=this.options_)!=null&&n.autoBind){var g;t.value=t.value.bind((g=A.proxy_)!=null?g:A.target_)}var a=((o=this.options_)==null?void 0:o.deep)===!1?xo.ref:xo;return a.extend_(A,e,t,i)}function qMe(A,e){qt("'"+this.annotationType_+"' cannot be used as a decorator")}var jMe="observable",PMe="observable.ref",$Me="observable.shallow",Ave="observable.struct",fxA={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(fxA);function gV(A){return A||fxA}var aiA=oV(jMe),eve=oV(PMe,{enhancer:nV}),tve=oV($Me,{enhancer:DMe}),ive=oV(Ave,{enhancer:GMe}),yxA=jB(aiA);function aV(A){return A.deep===!0?tk:A.deep===!1?nV:ove(A.defaultDecorator)}function nve(A){var e;return A?(e=A.defaultDecorator)!=null?e:pxA(A):void 0}function ove(A){var e,t;return A&&(e=(t=A.options_)==null?void 0:t.enhancer)!=null?e:tk}function bxA(A,e,t){if(_x(e))return aiA.decorate_20223_(A,e);if(Qy(e)){Ak(A,e,aiA);return}return EiA(A)?A:Mu(A)?xo.object(A,e,t):Array.isArray(A)?xo.array(A,e):jG(A)?xo.map(A,e):Tx(A)?xo.set(A,e):typeof A=="object"&&A!==null?A:xo.box(A,e)}axA(bxA,yxA);var gve={box:function(A,e){var t=gV(e);return new bm(A,aV(t),t.name,!0,t.equals)},array:function(A,e){var t=gV(e);return(qA.useProxies===!1||t.proxy===!1?gLe:qve)(A,aV(t),t.name)},map:function(A,e){var t=gV(e);return new iFA(A,aV(t),t.name)},set:function(A,e){var t=gV(e);return new gFA(A,aV(t),t.name)},object:function(A,e,t){return km(function(){return OxA(qA.useProxies===!1||(t==null?void 0:t.proxy)===!1?py({},t):Xve({},t),A,e)})},ref:jB(eve),shallow:jB(tve),deep:yxA,struct:jB(ive)},xo=axA(bxA,gve),wxA="computed",ave="computed.struct",siA=giA(wxA),sve=giA(ave,{equals:ek.structural}),jx=function(A,e){if(_x(e))return siA.decorate_20223_(A,e);if(Qy(e))return Ak(A,e,siA);if(Mu(A))return jB(giA(wxA,A));var t=Mu(e)?e:{};return t.get=A,t.name||(t.name=A.name||""),new ik(t)};Object.assign(jx,siA),jx.struct=jB(sve);var DxA,GxA,sV=0,rve=1,Ive=(DxA=(GxA=tV(function(){},"name"))==null?void 0:GxA.configurable)!=null?DxA:!1,kxA={value:"action",configurable:!0,writable:!1,enumerable:!1};function uy(A,e,t,i){t===void 0&&(t=!1);function n(){return JxA(A,t,e,i||this,arguments)}return n.isMobxAction=!0,Ive&&(kxA.value=A,OB(n,"name",kxA)),n}function JxA(A,e,t,i,n){var o=Cve(A,e);try{return t.apply(i,n)}catch(g){throw o.error_=g,g}finally{lve(o)}}function Cve(A,e,t,i){var n=!1,o=0,g=qA.trackingDerivation,a=!e||!g;LC();var s=qA.allowStateChanges;a&&(dy(),s=rV(!0));var I=CiA(!0),r={runAsAction_:a,prevDerivation_:g,prevAllowStateChanges_:s,prevAllowStateReads_:I,notifySpy_:n,startTime_:o,actionId_:rve++,parentActionId_:sV};return sV=r.actionId_,r}function lve(A){sV!==A.actionId_&&qt(30),sV=A.parentActionId_,A.error_!==void 0&&(qA.suppressReactionErrors=!0),IV(A.prevAllowStateChanges_),$x(A.prevAllowStateReads_),SC(),A.runAsAction_&&Lu(A.prevDerivation_),qA.suppressReactionErrors=!1}function cve(A,e){var t=rV(A);try{return e()}finally{IV(t)}}function rV(A){var e=qA.allowStateChanges;return qA.allowStateChanges=A,e}function IV(A){qA.allowStateChanges=A}var NxA;NxA=Symbol.toPrimitive;var bm=function(A){QxA(e,A);function e(i,n,o,g,a){var s;return o===void 0&&(o="ObservableValue"),a===void 0&&(a=ek.default),s=A.call(this,o)||this,s.enhancer=void 0,s.name_=void 0,s.equals=void 0,s.hasUnreportedChange_=!1,s.interceptors_=void 0,s.changeListeners_=void 0,s.value_=void 0,s.dehancer=void 0,s.enhancer=n,s.name_=o,s.equals=a,s.value_=n(i,void 0,o),s}var t=e.prototype;return t.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},t.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==qA.UNCHANGED&&this.setNewValue_(i)},t.prepareNewValue_=function(i){if(HC(this)){var n=ZC(this,{object:this,type:PB,newValue:i});if(!n)return qA.UNCHANGED;i=n.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?qA.UNCHANGED:i},t.setNewValue_=function(i){var n=this.value_;this.value_=i,this.reportChanged(),ac(this)&&sc(this,{type:PB,object:this,newValue:i,oldValue:n})},t.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},t.intercept_=function(i){return iF(this,i)},t.observe_=function(i,n){return n&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:PB,newValue:this.value_,oldValue:void 0}),nF(this,i)},t.raw=function(){return this.value_},t.toJSON=function(){return this.get()},t.toString=function(){return this.name_+"["+this.value_+"]"},t.valueOf=function(){return cxA(this.get())},t[NxA]=function(){return this.valueOf()},e}(Ox),Bve=ym("ObservableValue",bm),YxA;YxA=Symbol.toPrimitive;var ik=function(){function A(t){this.dependenciesState_=si.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=si.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new lV(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=CV.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,t.get||qt(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=uy("ComputedValue-setter",t.set)),this.equals_=t.equals||(t.compareStructural||t.struct?ek.structural:ek.default),this.scope_=t.context,this.requiresReaction_=t.requiresReaction,this.keepAlive_=!!t.keepAlive}var e=A.prototype;return e.onBecomeStale_=function(){hve(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(t){return t()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(t){return t()})},e.get=function(){if(this.isComputing_&&qt(32,this.name_,this.derivation),qA.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)riA(this)&&(this.warnAboutUntrackedRead_(),LC(),this.value_=this.computeValue_(!1),SC());else if(SxA(this),riA(this)){var t=qA.trackingContext;this.keepAlive_&&!t&&(qA.trackingContext=this),this.trackAndCompute()&&dve(this),qA.trackingContext=t}var i=this.value_;if(cV(i))throw i.cause;return i},e.set=function(t){if(this.setter_){this.isRunningSetter_&&qt(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,t)}finally{this.isRunningSetter_=!1}}else qt(34,this.name_)},e.trackAndCompute=function(){var t=this.value_,i=this.dependenciesState_===si.NOT_TRACKING_,n=this.computeValue_(!0),o=i||cV(t)||cV(n)||!this.equals_(t,n);return o&&(this.value_=n),o},e.computeValue_=function(t){this.isComputing_=!0;var i=rV(!1),n;if(t)n=RxA(this,this.derivation,this.scope_);else if(qA.disableErrorBoundaries===!0)n=this.derivation.call(this.scope_);else try{n=this.derivation.call(this.scope_)}catch(o){n=new lV(o)}return IV(i),this.isComputing_=!1,n},e.suspend_=function(){this.keepAlive_||(IiA(this),this.value_=void 0)},e.observe_=function(t,i){var n=this,o=!0,g=void 0;return kve(function(){var a=n.get();if(!o||i){var s=dy();t({observableKind:"computed",debugObjectName:n.name_,type:PB,object:n,newValue:a,oldValue:g}),Lu(s)}o=!1,g=a})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return cxA(this.get())},e[YxA]=function(){return this.valueOf()},A}(),Px=ym("ComputedValue",ik),si;(function(A){A[A.NOT_TRACKING_=-1]="NOT_TRACKING_",A[A.UP_TO_DATE_=0]="UP_TO_DATE_",A[A.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",A[A.STALE_=2]="STALE_"})(si||(si={}));var CV;(function(A){A[A.NONE=0]="NONE",A[A.LOG=1]="LOG",A[A.BREAK=2]="BREAK"})(CV||(CV={}));var lV=function(A){this.cause=void 0,this.cause=A};function cV(A){return A instanceof lV}function riA(A){switch(A.dependenciesState_){case si.UP_TO_DATE_:return!1;case si.NOT_TRACKING_:case si.STALE_:return!0;case si.POSSIBLY_STALE_:{for(var e=CiA(!0),t=dy(),i=A.observing_,n=i.length,o=0;o<n;o++){var g=i[o];if(Px(g)){if(qA.disableErrorBoundaries)g.get();else try{g.get()}catch{return Lu(t),$x(e),!0}if(A.dependenciesState_===si.STALE_)return Lu(t),$x(e),!0}}return FxA(A),Lu(t),$x(e),!1}}}function Mpi(A){}function RxA(A,e,t){var i=CiA(!0);FxA(A),A.newObserving_=new Array(A.observing_.length+100),A.unboundDepsCount_=0,A.runId_=++qA.runId;var n=qA.trackingDerivation;qA.trackingDerivation=A,qA.inBatch++;var o;if(qA.disableErrorBoundaries===!0)o=e.call(t);else try{o=e.call(t)}catch(g){o=new lV(g)}return qA.inBatch--,qA.trackingDerivation=n,Qve(A),$x(i),o}function Qve(A){for(var e=A.observing_,t=A.observing_=A.newObserving_,i=si.UP_TO_DATE_,n=0,o=A.unboundDepsCount_,g=0;g<o;g++){var a=t[g];a.diffValue_===0&&(a.diffValue_=1,n!==g&&(t[n]=a),n++),a.dependenciesState_>i&&(i=a.dependenciesState_)}for(t.length=n,A.newObserving_=null,o=e.length;o--;){var s=e[o];s.diffValue_===0&&vxA(s,A),s.diffValue_=0}for(;n--;){var I=t[n];I.diffValue_===1&&(I.diffValue_=0,uve(I,A))}i!==si.UP_TO_DATE_&&(A.dependenciesState_=i,A.onBecomeStale_())}function IiA(A){var e=A.observing_;A.observing_=[];for(var t=e.length;t--;)vxA(e[t],A);A.dependenciesState_=si.NOT_TRACKING_}function xxA(A){var e=dy();try{return A()}finally{Lu(e)}}function dy(){var A=qA.trackingDerivation;return qA.trackingDerivation=null,A}function Lu(A){qA.trackingDerivation=A}function CiA(A){var e=qA.allowStateReads;return qA.allowStateReads=A,e}function $x(A){qA.allowStateReads=A}function FxA(A){if(A.dependenciesState_!==si.UP_TO_DATE_){A.dependenciesState_=si.UP_TO_DATE_;for(var e=A.observing_,t=e.length;t--;)e[t].lowestObserverState_=si.UP_TO_DATE_}}var BV=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.batchId=Number.MIN_SAFE_INTEGER,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0,this.stateVersion=Number.MIN_SAFE_INTEGER},QV=!0,MxA=!1,qA=function(){var A=$tA();return A.__mobxInstanceCount>0&&!A.__mobxGlobals&&(QV=!1),A.__mobxGlobals&&A.__mobxGlobals.version!==new BV().version&&(QV=!1),QV?A.__mobxGlobals?(A.__mobxInstanceCount+=1,A.__mobxGlobals.UNCHANGED||(A.__mobxGlobals.UNCHANGED={}),A.__mobxGlobals):(A.__mobxInstanceCount=1,A.__mobxGlobals=new BV):(setTimeout(function(){MxA||qt(35)},1),new BV)}();function Eve(){if((qA.pendingReactions.length||qA.inBatch||qA.isRunningReactions)&&qt(36),MxA=!0,QV){var A=$tA();--A.__mobxInstanceCount===0&&(A.__mobxGlobals=void 0),qA=new BV}}function uve(A,e){A.observers_.add(e),A.lowestObserverState_>e.dependenciesState_&&(A.lowestObserverState_=e.dependenciesState_)}function vxA(A,e){A.observers_.delete(e),A.observers_.size===0&&LxA(A)}function LxA(A){A.isPendingUnobservation_===!1&&(A.isPendingUnobservation_=!0,qA.pendingUnobservations.push(A))}function LC(){qA.inBatch===0&&(qA.batchId=qA.batchId<Number.MAX_SAFE_INTEGER?qA.batchId+1:Number.MIN_SAFE_INTEGER),qA.inBatch++}function SC(){if(--qA.inBatch===0){ZxA();for(var A=qA.pendingUnobservations,e=0;e<A.length;e++){var t=A[e];t.isPendingUnobservation_=!1,t.observers_.size===0&&(t.isBeingObserved_&&(t.isBeingObserved_=!1,t.onBUO()),t instanceof ik&&t.suspend_())}qA.pendingUnobservations=[]}}function SxA(A){var e=qA.trackingDerivation;return e!==null?(e.runId_!==A.lastAccessedBy_&&(A.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=A,!A.isBeingObserved_&&qA.trackingContext&&(A.isBeingObserved_=!0,A.onBO())),A.isBeingObserved_):(A.observers_.size===0&&qA.inBatch>0&&LxA(A),!1)}function HxA(A){A.lowestObserverState_!==si.STALE_&&(A.lowestObserverState_=si.STALE_,A.observers_.forEach(function(e){e.dependenciesState_===si.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=si.STALE_}))}function dve(A){A.lowestObserverState_!==si.STALE_&&(A.lowestObserverState_=si.STALE_,A.observers_.forEach(function(e){e.dependenciesState_===si.POSSIBLY_STALE_?e.dependenciesState_=si.STALE_:e.dependenciesState_===si.UP_TO_DATE_&&(A.lowestObserverState_=si.UP_TO_DATE_)}))}function hve(A){A.lowestObserverState_===si.UP_TO_DATE_&&(A.lowestObserverState_=si.POSSIBLY_STALE_,A.observers_.forEach(function(e){e.dependenciesState_===si.UP_TO_DATE_&&(e.dependenciesState_=si.POSSIBLY_STALE_,e.onBecomeStale_())}))}var nk=function(){function A(t,i,n,o){t===void 0&&(t="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=si.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=CV.NONE,this.name_=t,this.onInvalidate_=i,this.errorHandler_=n,this.requiresObservable_=o}var e=A.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,qA.pendingReactions.push(this),ZxA())},e.isScheduled=function(){return this.isScheduled_},e.runReaction_=function(){if(!this.isDisposed_){LC(),this.isScheduled_=!1;var t=qA.trackingContext;if(qA.trackingContext=this,riA(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}qA.trackingContext=t,SC()}},e.track=function(t){if(!this.isDisposed_){LC(),this.isRunning_=!0;var i=qA.trackingContext;qA.trackingContext=this;var n=RxA(this,t,void 0);qA.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&IiA(this),cV(n)&&this.reportExceptionInDerivation_(n.cause),SC()}},e.reportExceptionInDerivation_=function(t){var i=this;if(this.errorHandler_){this.errorHandler_(t,this);return}if(qA.disableErrorBoundaries)throw t;var n="[mobx] uncaught error in '"+this+"'";qA.suppressReactionErrors||console.error(n,t),qA.globalReactionErrorHandlers.forEach(function(o){return o(t,i)})},e.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(LC(),IiA(this),SC()))},e.getDisposer_=function(t){var i=this,n=function o(){i.dispose(),t==null||t.removeEventListener==null||t.removeEventListener("abort",o)};return t==null||t.addEventListener==null||t.addEventListener("abort",n),n[Le]=this,n},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(t){},A}(),mve=100,liA=function(A){return A()};function ZxA(){qA.inBatch>0||qA.isRunningReactions||liA(pve)}function pve(){qA.isRunningReactions=!0;for(var A=qA.pendingReactions,e=0;A.length>0;){++e===mve&&(console.error("[mobx] cycle in reaction: "+A[0]),A.splice(0));for(var t=A.splice(0),i=0,n=t.length;i<n;i++)t[i].runReaction_()}qA.isRunningReactions=!1}var EV=ym("Reaction",nk);function fve(A){var e=liA;liA=function(t){return A(function(){return e(t)})}}function AF(){return!1}function vpi(A){}function Lpi(A){}function Spi(A){}function yve(A){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var WxA="action",bve="action.bound",KxA="autoAction",wve="autoAction.bound",UxA="<unnamed action>",ciA=qx(WxA),Dve=qx(bve,{bound:!0}),BiA=qx(KxA,{autoAction:!0}),Gve=qx(wve,{autoAction:!0,bound:!0});function VxA(A){var e=function(t,i){if(gc(t))return uy(t.name||UxA,t,A);if(gc(i))return uy(t,i,A);if(_x(i))return(A?BiA:ciA).decorate_20223_(t,i);if(Qy(i))return Ak(t,i,A?BiA:ciA);if(Qy(t))return jB(qx(A?KxA:WxA,{name:t,autoAction:A}))};return e}var hy=VxA(!1);Object.assign(hy,ciA);var eF=VxA(!0);Object.assign(eF,BiA),hy.bound=jB(Dve),eF.bound=jB(Gve);function XxA(A){return JxA(A.name||UxA,!1,A,this,void 0)}function uV(A){return gc(A)&&A.isMobxAction===!0}function kve(A,e){var t,i,n,o,g;e===void 0&&(e=eiA);var a=(t=(i=e)==null?void 0:i.name)!=null?t:"Autorun",s=!e.scheduler&&!e.delay,I;if(s)I=new nk(a,function(){this.track(l)},e.onError,e.requiresObservable);else{var r=zxA(e),C=!1;I=new nk(a,function(){C||(C=!0,r(function(){C=!1,I.isDisposed_||I.track(l)}))},e.onError,e.requiresObservable)}function l(){A(I)}return(n=e)!=null&&(o=n.signal)!=null&&o.aborted||I.schedule_(),I.getDisposer_((g=e)==null?void 0:g.signal)}var Jve=function(A){return A()};function zxA(A){return A.scheduler?A.scheduler:A.delay?function(e){return setTimeout(e,A.delay)}:Jve}function Nve(A,e,t){var i,n,o,g;t===void 0&&(t=eiA);var a=(i=t.name)!=null?i:"Reaction",s=hy(a,t.onError?Yve(t.onError,e):e),I=!t.scheduler&&!t.delay,r=zxA(t),C=!0,l=!1,c,B,E=t.compareStructural?ek.structural:t.equals||ek.default,u=new nk(a,function(){C||I?d():l||(l=!0,r(d))},t.onError,t.requiresObservable);function d(){if(l=!1,!u.isDisposed_){var f=!1;u.track(function(){var w=cve(!1,function(){return A(u)});f=C||!E(c,w),B=c,c=w}),(C&&t.fireImmediately||!C&&f)&&s(c,B,u),C=!1}}return(n=t)!=null&&(o=n.signal)!=null&&o.aborted||u.schedule_(),u.getDisposer_((g=t)==null?void 0:g.signal)}function Yve(A,e){return function(){try{return e.apply(this,arguments)}catch(t){A.call(this,t)}}}var Rve="onBO",xve="onBUO";function Fve(A,e,t){return _xA(Rve,A,e,t)}function TxA(A,e,t){return _xA(xve,A,e,t)}function _xA(A,e,t,i){var n=typeof i=="function"?rk(e,t):rk(e),o=gc(i)?i:t,g=A+"L";return n[g]?n[g].add(o):n[g]=new Set([o]),function(){var a=n[g];a&&(a.delete(o),a.size===0&&delete n[g])}}var Mve="never",dV="always",vve="observed";function Lve(A){A.isolateGlobalState===!0&&Eve();var e=A.useProxies,t=A.enforceActions;if(e!==void 0&&(qA.useProxies=e===dV?!0:e===Mve?!1:typeof Proxy<"u"),e==="ifavailable"&&(qA.verifyProxies=!0),t!==void 0){var i=t===dV?dV:t===vve;qA.enforceActions=i,qA.allowStateChanges=!(i===!0||i===dV)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(n){n in A&&(qA[n]=!!A[n])}),qA.allowStateReads=!qA.observableRequiresReaction,A.reactionScheduler&&fve(A.reactionScheduler)}function OxA(A,e,t,i){var n=uMe(e);return km(function(){var o=py(A,i)[Le];PG(n).forEach(function(g){o.extend_(g,n[g],t&&g in t?t[g]:!0)})}),A}function Sve(A,e){return qxA(rk(A,e))}function qxA(A){var e={name:A.name_};return A.observing_&&A.observing_.length>0&&(e.dependencies=Hve(A.observing_).map(qxA)),e}function Hve(A){return Array.from(new Set(A))}var Zve=0;function jxA(){this.message="FLOW_CANCELLED"}jxA.prototype=Object.create(Error.prototype);var QiA=hxA("flow"),Wve=hxA("flow.bound",{bound:!0}),ok=Object.assign(function(A,e){if(_x(e))return QiA.decorate_20223_(A,e);if(Qy(e))return Ak(A,e,QiA);var t=A,i=t.name||"<unnamed flow>",n=function(){var o=this,g=arguments,a=++Zve,s=hy(i+" - runid: "+a+" - init",t).apply(o,g),I,r=void 0,C=new Promise(function(l,c){var B=0;I=c;function E(f){r=void 0;var w;try{w=hy(i+" - runid: "+a+" - yield "+B++,s.next).call(s,f)}catch(y){return c(y)}d(w)}function u(f){r=void 0;var w;try{w=hy(i+" - runid: "+a+" - yield "+B++,s.throw).call(s,f)}catch(y){return c(y)}d(w)}function d(f){if(gc(f==null?void 0:f.then)){f.then(d,c);return}return f.done?l(f.value):(r=Promise.resolve(f.value),r.then(E,u))}E(void 0)});return C.cancel=hy(i+" - runid: "+a+" - cancel",function(){try{r&&PxA(r);var l=s.return(void 0),c=Promise.resolve(l.value);c.then(qG,qG),PxA(c),I(new jxA)}catch(B){I(B)}}),C};return n.isMobXFlow=!0,n},QiA);ok.bound=jB(Wve);function PxA(A){gc(A.cancel)&&A.cancel()}function tF(A){return(A==null?void 0:A.isMobXFlow)===!0}function Kve(A,e){return A?e!==void 0?sk(A)?A[Le].values_.has(e):!1:sk(A)||!!A[Le]||oiA(A)||EV(A)||Px(A):!1}function EiA(A){return Kve(A)}function Uve(A){if(sk(A))return A[Le].ownKeys_();qt(38)}function hV(A,e,t){return A.set(e,t),t}function gk(A,e){if(A==null||typeof A!="object"||A instanceof Date||!EiA(A))return A;if(Bve(A)||Px(A))return gk(A.get(),e);if(e.has(A))return e.get(A);if(oF(A)){var t=hV(e,A,new Array(A.length));return A.forEach(function(g,a){t[a]=gk(g,e)}),t}if(my(A)){var i=hV(e,A,new Set);return A.forEach(function(g){i.add(gk(g,e))}),i}if(Gm(A)){var n=hV(e,A,new Map);return A.forEach(function(g,a){n.set(a,gk(g,e))}),n}else{var o=hV(e,A,{});return Uve(A).forEach(function(g){Xx.propertyIsEnumerable.call(A,g)&&(o[g]=gk(A[g],e))}),o}}function mV(A,e){return gk(A,new Map)}function Su(A,e){e===void 0&&(e=void 0),LC();try{return A.apply(e)}finally{SC()}}function ak(A){return A[Le]}var Vve={has:function(A,e){return ak(A).has_(e)},get:function(A,e){return ak(A).get_(e)},set:function(A,e,t){var i;return Qy(e)?(i=ak(A).set_(e,t,!0))!=null?i:!0:!1},deleteProperty:function(A,e){var t;return Qy(e)?(t=ak(A).delete_(e,!0))!=null?t:!0:!1},defineProperty:function(A,e,t){var i;return(i=ak(A).defineProperty_(e,t))!=null?i:!0},ownKeys:function(A){return ak(A).ownKeys_()},preventExtensions:function(A){qt(13)}};function Xve(A,e){var t,i;return sxA(),A=py(A,e),(i=(t=A[Le]).proxy_)!=null?i:t.proxy_=new Proxy(A,Vve)}function HC(A){return A.interceptors_!==void 0&&A.interceptors_.length>0}function iF(A,e){var t=A.interceptors_||(A.interceptors_=[]);return t.push(e),rxA(function(){var i=t.indexOf(e);i!==-1&&t.splice(i,1)})}function ZC(A,e){var t=dy();try{for(var i=[].concat(A.interceptors_||[]),n=0,o=i.length;n<o&&(e=i[n](e),e&&!e.type&&qt(14),!!e);n++);return e}finally{Lu(t)}}function ac(A){return A.changeListeners_!==void 0&&A.changeListeners_.length>0}function nF(A,e){var t=A.changeListeners_||(A.changeListeners_=[]);return t.push(e),rxA(function(){var i=t.indexOf(e);i!==-1&&t.splice(i,1)})}function sc(A,e){var t=dy(),i=A.changeListeners_;if(i){i=i.slice();for(var n=0,o=i.length;n<o;n++)i[n](e);Lu(t)}}function zve(A,e,t){return km(function(){var i,n=py(A,t)[Le];(i=e)!=null||(e=pMe(A)),PG(e).forEach(function(o){return n.make_(o,e[o])})}),A}var uiA=Symbol("mobx-keys");function Tve(A,e,t){return Mu(A)?OxA(A,A,e,t):(km(function(){var i=py(A,t)[Le];if(!A[uiA]){var n=Object.getPrototypeOf(A),o=new Set([].concat(PG(A),PG(n)));o.delete("constructor"),o.delete(Le),zx(n,uiA,o)}A[uiA].forEach(function(g){return i.make_(g,e&&g in e?e[g]:!0)})}),A)}var $xA="splice",PB="update",_ve=1e4,Ove={get:function(A,e){var t=A[Le];return e===Le?t:e==="length"?t.getArrayLength_():typeof e=="string"&&!isNaN(e)?t.get_(parseInt(e)):vu(pV,e)?pV[e]:A[e]},set:function(A,e,t){var i=A[Le];return e==="length"&&i.setArrayLength_(t),typeof e=="symbol"||isNaN(e)?A[e]=t:i.set_(parseInt(e),t),!0},preventExtensions:function(){qt(15)}},diA=function(){function A(t,i,n,o){t===void 0&&(t="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=o,this.atom_=new Ox(t),this.enhancer_=function(g,a){return i(g,a,"ObservableArray[..]")}}var e=A.prototype;return e.dehanceValue_=function(t){return this.dehancer!==void 0?this.dehancer(t):t},e.dehanceValues_=function(t){return this.dehancer!==void 0&&t.length>0?t.map(this.dehancer):t},e.intercept_=function(t){return iF(this,t)},e.observe_=function(t,i){return i===void 0&&(i=!1),i&&t({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),nF(this,t)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(t){(typeof t!="number"||isNaN(t)||t<0)&&qt("Out of range: "+t);var i=this.values_.length;if(t!==i)if(t>i){for(var n=new Array(t-i),o=0;o<t-i;o++)n[o]=void 0;this.spliceWithArray_(i,0,n)}else this.spliceWithArray_(t,i-t)},e.updateArrayLength_=function(t,i){t!==this.lastKnownLength_&&qt(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&BFA(t+i+1)},e.spliceWithArray_=function(t,i,n){var o=this;this.atom_;var g=this.values_.length;if(t===void 0?t=0:t>g?t=g:t<0&&(t=Math.max(0,g+t)),arguments.length===1?i=g-t:i==null?i=0:i=Math.max(0,Math.min(i,g-t)),n===void 0&&(n=AiA),HC(this)){var a=ZC(this,{object:this.proxy_,type:$xA,index:t,removedCount:i,added:n});if(!a)return AiA;i=a.removedCount,n=a.added}if(n=n.length===0?n:n.map(function(r){return o.enhancer_(r,void 0)}),this.legacyMode_||!1){var s=n.length-i;this.updateArrayLength_(g,s)}var I=this.spliceItemsIntoValues_(t,i,n);return(i!==0||n.length!==0)&&this.notifyArraySplice_(t,n,I),this.dehanceValues_(I)},e.spliceItemsIntoValues_=function(t,i,n){if(n.length<_ve){var o;return(o=this.values_).splice.apply(o,[t,i].concat(n))}else{var g=this.values_.slice(t,t+i),a=this.values_.slice(t+i);this.values_.length+=n.length-i;for(var s=0;s<n.length;s++)this.values_[t+s]=n[s];for(var I=0;I<a.length;I++)this.values_[t+n.length+I]=a[I];return g}},e.notifyArrayChildUpdate_=function(t,i,n){var o=!this.owned_&&AF(),g=ac(this),a=g||o?{observableKind:"array",object:this.proxy_,type:PB,debugObjectName:this.atom_.name_,index:t,newValue:i,oldValue:n}:null;this.atom_.reportChanged(),g&&sc(this,a)},e.notifyArraySplice_=function(t,i,n){var o=!this.owned_&&AF(),g=ac(this),a=g||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:$xA,index:t,removed:n,added:i,removedCount:n.length,addedCount:i.length}:null;this.atom_.reportChanged(),g&&sc(this,a)},e.get_=function(t){if(this.legacyMode_&&t>=this.values_.length){console.warn("[mobx] Out of bounds read: "+t);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[t])},e.set_=function(t,i){var n=this.values_;if(this.legacyMode_&&t>n.length&&qt(17,t,n.length),t<n.length){this.atom_;var o=n[t];if(HC(this)){var g=ZC(this,{type:PB,object:this.proxy_,index:t,newValue:i});if(!g)return;i=g.newValue}i=this.enhancer_(i,o);var a=i!==o;a&&(n[t]=i,this.notifyArrayChildUpdate_(t,i,o))}else{for(var s=new Array(t+1-n.length),I=0;I<s.length-1;I++)s[I]=void 0;s[s.length-1]=i,this.spliceWithArray_(n.length,0,s)}},A}();function qve(A,e,t,i){return t===void 0&&(t="ObservableArray"),i===void 0&&(i=!1),sxA(),km(function(){var n=new diA(t,e,i,!1);CxA(n.values_,Le,n);var o=new Proxy(n.values_,Ove);return n.proxy_=o,A&&A.length&&n.spliceWithArray_(0,0,A),o})}var pV={clear:function(){return this.splice(0)},replace:function(A){var e=this[Le];return e.spliceWithArray_(0,e.values_.length,A)},toJSON:function(){return this.slice()},splice:function(A,e){for(var t=arguments.length,i=new Array(t>2?t-2:0),n=2;n<t;n++)i[n-2]=arguments[n];var o=this[Le];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(A);case 2:return o.spliceWithArray_(A,e)}return o.spliceWithArray_(A,e,i)},spliceWithArray:function(A,e,t){return this[Le].spliceWithArray_(A,e,t)},push:function(){for(var A=this[Le],e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return A.spliceWithArray_(A.values_.length,0,t),A.values_.length},pop:function(){return this.splice(Math.max(this[Le].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var A=this[Le],e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return A.spliceWithArray_(0,0,t),A.values_.length},reverse:function(){return qA.trackingDerivation&&qt(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){qA.trackingDerivation&&qt(37,"sort");var A=this.slice();return A.sort.apply(A,arguments),this.replace(A),this},remove:function(A){var e=this[Le],t=e.dehanceValues_(e.values_).indexOf(A);return t>-1?(this.splice(t,1),!0):!1}};To("concat",Hu),To("flat",Hu),To("includes",Hu),To("indexOf",Hu),To("join",Hu),To("lastIndexOf",Hu),To("slice",Hu),To("toString",Hu),To("toLocaleString",Hu),To("every",wm),To("filter",wm),To("find",wm),To("findIndex",wm),To("flatMap",wm),To("forEach",wm),To("map",wm),To("some",wm),To("reduce",AFA),To("reduceRight",AFA);function To(A,e){typeof Array.prototype[A]=="function"&&(pV[A]=e(A))}function Hu(A){return function(){var e=this[Le];e.atom_.reportObserved();var t=e.dehanceValues_(e.values_);return t[A].apply(t,arguments)}}function wm(A){return function(e,t){var i=this,n=this[Le];n.atom_.reportObserved();var o=n.dehanceValues_(n.values_);return o[A](function(g,a){return e.call(t,g,a,i)})}}function AFA(A){return function(){var e=this,t=this[Le];t.atom_.reportObserved();var i=t.dehanceValues_(t.values_),n=arguments[0];return arguments[0]=function(o,g,a){return n(o,g,a,e)},i[A].apply(i,arguments)}}var jve=ym("ObservableArrayAdministration",diA);function oF(A){return iV(A)&&jve(A[Le])}var eFA,tFA,Pve={},Dm="add",fV="delete";eFA=Symbol.iterator,tFA=Symbol.toStringTag;var iFA=function(){function A(t,i,n){var o=this;i===void 0&&(i=tk),n===void 0&&(n="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Le]=Pve,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=i,this.name_=n,gc(Map)||qt(18),km(function(){o.keysAtom_=uxA("ObservableMap.keys()"),o.data_=new Map,o.hasMap_=new Map,t&&o.merge(t)})}var e=A.prototype;return e.has_=function(t){return this.data_.has(t)},e.has=function(t){var i=this;if(!qA.trackingDerivation)return this.has_(t);var n=this.hasMap_.get(t);if(!n){var o=n=new bm(this.has_(t),nV,"ObservableMap.key?",!1);this.hasMap_.set(t,o),TxA(o,function(){return i.hasMap_.delete(t)})}return n.get()},e.set=function(t,i){var n=this.has_(t);if(HC(this)){var o=ZC(this,{type:n?PB:Dm,object:this,newValue:i,name:t});if(!o)return this;i=o.newValue}return n?this.updateValue_(t,i):this.addValue_(t,i),this},e.delete=function(t){var i=this;if(this.keysAtom_,HC(this)){var n=ZC(this,{type:fV,object:this,name:t});if(!n)return!1}if(this.has_(t)){var o=AF(),g=ac(this),a=g||o?{observableKind:"map",debugObjectName:this.name_,type:fV,object:this,oldValue:this.data_.get(t).value_,name:t}:null;return Su(function(){var s;i.keysAtom_.reportChanged(),(s=i.hasMap_.get(t))==null||s.setNewValue_(!1);var I=i.data_.get(t);I.setNewValue_(void 0),i.data_.delete(t)}),g&&sc(this,a),!0}return!1},e.updateValue_=function(t,i){var n=this.data_.get(t);if(i=n.prepareNewValue_(i),i!==qA.UNCHANGED){var o=AF(),g=ac(this),a=g||o?{observableKind:"map",debugObjectName:this.name_,type:PB,object:this,oldValue:n.value_,name:t,newValue:i}:null;n.setNewValue_(i),g&&sc(this,a)}},e.addValue_=function(t,i){var n=this;this.keysAtom_,Su(function(){var s,I=new bm(i,n.enhancer_,"ObservableMap.key",!1);n.data_.set(t,I),i=I.value_,(s=n.hasMap_.get(t))==null||s.setNewValue_(!0),n.keysAtom_.reportChanged()});var o=AF(),g=ac(this),a=g||o?{observableKind:"map",debugObjectName:this.name_,type:Dm,object:this,name:t,newValue:i}:null;g&&sc(this,a)},e.get=function(t){return this.has(t)?this.dehanceValue_(this.data_.get(t).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(t){return this.dehancer!==void 0?this.dehancer(t):t},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var t=this,i=this.keys();return gF({next:function(){var n=i.next(),o=n.done,g=n.value;return{done:o,value:o?void 0:t.get(g)}}})},e.entries=function(){var t=this,i=this.keys();return gF({next:function(){var n=i.next(),o=n.done,g=n.value;return{done:o,value:o?void 0:[g,t.get(g)]}}})},e[eFA]=function(){return this.entries()},e.forEach=function(t,i){for(var n=$G(this),o;!(o=n()).done;){var g=o.value,a=g[0],s=g[1];t.call(i,s,a,this)}},e.merge=function(t){var i=this;return Gm(t)&&(t=new Map(t)),Su(function(){Mu(t)?EMe(t).forEach(function(n){return i.set(n,t[n])}):Array.isArray(t)?t.forEach(function(n){var o=n[0],g=n[1];return i.set(o,g)}):jG(t)?(t.constructor!==Map&&qt(19,t),t.forEach(function(n,o){return i.set(o,n)})):t!=null&&qt(20,t)}),this},e.clear=function(){var t=this;Su(function(){xxA(function(){for(var i=$G(t.keys()),n;!(n=i()).done;){var o=n.value;t.delete(o)}})})},e.replace=function(t){var i=this;return Su(function(){for(var n=$ve(t),o=new Map,g=!1,a=$G(i.data_.keys()),s;!(s=a()).done;){var I=s.value;if(!n.has(I)){var r=i.delete(I);if(r)g=!0;else{var C=i.data_.get(I);o.set(I,C)}}}for(var l=$G(n.entries()),c;!(c=l()).done;){var B=c.value,E=B[0],u=B[1],d=i.data_.has(E);if(i.set(E,u),i.data_.has(E)){var f=i.data_.get(E);o.set(E,f),d||(g=!0)}}if(!g)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var w=i.data_.keys(),y=o.keys(),G=w.next(),R=y.next();!G.done;){if(G.value!==R.value){i.keysAtom_.reportChanged();break}G=w.next(),R=y.next()}i.data_=o}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(t,i){return nF(this,t)},e.intercept_=function(t){return iF(this,t)},tiA(A,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:tFA,get:function(){return"Map"}}]),A}(),Gm=ym("ObservableMap",iFA);function $ve(A){if(jG(A)||Gm(A))return A;if(Array.isArray(A))return new Map(A);if(Mu(A)){var e=new Map;for(var t in A)e.set(t,A[t]);return e}else return qt(21,A)}var nFA,oFA,ALe={};nFA=Symbol.iterator,oFA=Symbol.toStringTag;var gFA=function(){function A(t,i,n){var o=this;i===void 0&&(i=tk),n===void 0&&(n="ObservableSet"),this.name_=void 0,this[Le]=ALe,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,gc(Set)||qt(22),this.enhancer_=function(g,a){return i(g,a,n)},km(function(){o.atom_=uxA(o.name_),t&&o.replace(t)})}var e=A.prototype;return e.dehanceValue_=function(t){return this.dehancer!==void 0?this.dehancer(t):t},e.clear=function(){var t=this;Su(function(){xxA(function(){for(var i=$G(t.data_.values()),n;!(n=i()).done;){var o=n.value;t.delete(o)}})})},e.forEach=function(t,i){for(var n=$G(this),o;!(o=n()).done;){var g=o.value;t.call(i,g,g,this)}},e.add=function(t){var i=this;if(this.atom_,HC(this)){var n=ZC(this,{type:Dm,object:this,newValue:t});if(!n)return this}if(!this.has(t)){Su(function(){i.data_.add(i.enhancer_(t,void 0)),i.atom_.reportChanged()});var o=!1,g=ac(this),a=g||o?{observableKind:"set",debugObjectName:this.name_,type:Dm,object:this,newValue:t}:null;g&&sc(this,a)}return this},e.delete=function(t){var i=this;if(HC(this)){var n=ZC(this,{type:fV,object:this,oldValue:t});if(!n)return!1}if(this.has(t)){var o=!1,g=ac(this),a=g||o?{observableKind:"set",debugObjectName:this.name_,type:fV,object:this,oldValue:t}:null;return Su(function(){i.atom_.reportChanged(),i.data_.delete(t)}),g&&sc(this,a),!0}return!1},e.has=function(t){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(t))},e.entries=function(){var t=0,i=Array.from(this.keys()),n=Array.from(this.values());return gF({next:function(){var o=t;return t+=1,o<n.length?{value:[i[o],n[o]],done:!1}:{done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var t=this,i=0,n=Array.from(this.data_.values());return gF({next:function(){return i<n.length?{value:t.dehanceValue_(n[i++]),done:!1}:{done:!0}}})},e.replace=function(t){var i=this;return my(t)&&(t=new Set(t)),Su(function(){Array.isArray(t)?(i.clear(),t.forEach(function(n){return i.add(n)})):Tx(t)?(i.clear(),t.forEach(function(n){return i.add(n)})):t!=null&&qt("Cannot initialize set from "+t)}),this},e.observe_=function(t,i){return nF(this,t)},e.intercept_=function(t){return iF(this,t)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[nFA]=function(){return this.values()},tiA(A,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:oFA,get:function(){return"Set"}}]),A}(),my=ym("ObservableSet",gFA),aFA=Object.create(null),sFA="remove",rFA=function(){function A(t,i,n,o){i===void 0&&(i=new Map),o===void 0&&(o=TMe),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=t,this.values_=i,this.name_=n,this.defaultAnnotation_=o,this.keysAtom_=new Ox("ObservableObject.keys"),this.isPlainObject_=Mu(this.target_)}var e=A.prototype;return e.getObservablePropValue_=function(t){return this.values_.get(t).get()},e.setObservablePropValue_=function(t,i){var n=this.values_.get(t);if(n instanceof ik)return n.set(i),!0;if(HC(this)){var o=ZC(this,{type:PB,object:this.proxy_||this.target_,name:t,newValue:i});if(!o)return null;i=o.newValue}if(i=n.prepareNewValue_(i),i!==qA.UNCHANGED){var g=ac(this),a=!1,s=g||a?{type:PB,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:t,newValue:i}:null;n.setNewValue_(i),g&&sc(this,s)}return!0},e.get_=function(t){return qA.trackingDerivation&&!vu(this.target_,t)&&this.has_(t),this.target_[t]},e.set_=function(t,i,n){return n===void 0&&(n=!1),vu(this.target_,t)?this.values_.has(t)?this.setObservablePropValue_(t,i):n?Reflect.set(this.target_,t,i):(this.target_[t]=i,!0):this.extend_(t,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},e.has_=function(t){if(!qA.trackingDerivation)return t in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(t);return i||(i=new bm(t in this.target_,nV,"ObservableObject.key?",!1),this.pendingKeys_.set(t,i)),i.get()},e.make_=function(t,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(t in this.target_)){var n;if((n=this.target_[qB])!=null&&n[t])return;qt(1,i.annotationType_,this.name_+"."+t.toString())}for(var o=this.target_;o&&o!==Xx;){var g=tV(o,t);if(g){var a=i.make_(this,t,g,o);if(a===0)return;if(a===1)break}o=Object.getPrototypeOf(o)}CFA(this,i,t)}},e.extend_=function(t,i,n,o){if(o===void 0&&(o=!1),n===!0&&(n=this.defaultAnnotation_),n===!1)return this.defineProperty_(t,i,o);var g=n.extend_(this,t,i,o);return g&&CFA(this,n,t),g},e.defineProperty_=function(t,i,n){n===void 0&&(n=!1),this.keysAtom_;try{LC();var o=this.delete_(t);if(!o)return o;if(HC(this)){var g=ZC(this,{object:this.proxy_||this.target_,name:t,type:Dm,newValue:i.value});if(!g)return null;var a=g.newValue;i.value!==a&&(i=Ey({},i,{value:a}))}if(n){if(!Reflect.defineProperty(this.target_,t,i))return!1}else OB(this.target_,t,i);this.notifyPropertyAddition_(t,i.value)}finally{SC()}return!0},e.defineObservableProperty_=function(t,i,n,o){o===void 0&&(o=!1),this.keysAtom_;try{LC();var g=this.delete_(t);if(!g)return g;if(HC(this)){var a=ZC(this,{object:this.proxy_||this.target_,name:t,type:Dm,newValue:i});if(!a)return null;i=a.newValue}var s=IFA(t),I={configurable:qA.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:s.get,set:s.set};if(o){if(!Reflect.defineProperty(this.target_,t,I))return!1}else OB(this.target_,t,I);var r=new bm(i,n,"ObservableObject.key",!1);this.values_.set(t,r),this.notifyPropertyAddition_(t,r.value_)}finally{SC()}return!0},e.defineComputedProperty_=function(t,i,n){n===void 0&&(n=!1),this.keysAtom_;try{LC();var o=this.delete_(t);if(!o)return o;if(HC(this)){var g=ZC(this,{object:this.proxy_||this.target_,name:t,type:Dm,newValue:void 0});if(!g)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var a=IFA(t),s={configurable:qA.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:a.get,set:a.set};if(n){if(!Reflect.defineProperty(this.target_,t,s))return!1}else OB(this.target_,t,s);this.values_.set(t,new ik(i)),this.notifyPropertyAddition_(t,void 0)}finally{SC()}return!0},e.delete_=function(t,i){if(i===void 0&&(i=!1),this.keysAtom_,!vu(this.target_,t))return!0;if(HC(this)){var n=ZC(this,{object:this.proxy_||this.target_,name:t,type:sFA});if(!n)return null}try{var o,g;LC();var a=ac(this),s=!1,I=this.values_.get(t),r=void 0;if(!I&&(a||s)){var C;r=(C=tV(this.target_,t))==null?void 0:C.value}if(i){if(!Reflect.deleteProperty(this.target_,t))return!1}else delete this.target_[t];if(I&&(this.values_.delete(t),I instanceof bm&&(r=I.value_),HxA(I)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(g=o.get(t))==null||g.set(t in this.target_),a||s){var l={type:sFA,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:r,name:t};a&&sc(this,l)}}finally{SC()}return!0},e.observe_=function(t,i){return nF(this,t)},e.intercept_=function(t){return iF(this,t)},e.notifyPropertyAddition_=function(t,i){var n,o,g=ac(this),a=!1;if(g||a){var s=g||a?{type:Dm,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:t,newValue:i}:null;g&&sc(this,s)}(n=this.pendingKeys_)==null||(o=n.get(t))==null||o.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),PG(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},A}();function py(A,e){var t;if(vu(A,Le))return A;var i=(t=e==null?void 0:e.name)!=null?t:"ObservableObject",n=new rFA(A,new Map,String(i),nve(e));return zx(A,Le,n),A}var eLe=ym("ObservableObjectAdministration",rFA);function IFA(A){return aFA[A]||(aFA[A]={get:function(){return this[Le].getObservablePropValue_(A)},set:function(e){return this[Le].setObservablePropValue_(A,e)}})}function sk(A){return iV(A)?eLe(A[Le]):!1}function CFA(A,e,t){var i;(i=A.target_[qB])==null||delete i[t]}var tLe=cFA(0),iLe=function(){var A=!1,e={};return Object.defineProperty(e,"0",{set:function(){A=!0}}),Object.create(e)[0]=1,A===!1}(),hiA=0,lFA=function(){};function nLe(A,e){Object.setPrototypeOf?Object.setPrototypeOf(A.prototype,e):A.prototype.__proto__!==void 0?A.prototype.__proto__=e:A.prototype=e}nLe(lFA,Array.prototype);var miA=function(A,e,t){QxA(i,A);function i(o,g,a,s){var I;return a===void 0&&(a="ObservableArray"),s===void 0&&(s=!1),I=A.call(this)||this,km(function(){var r=new diA(a,g,s,!0);r.proxy_=niA(I),CxA(niA(I),Le,r),o&&o.length&&I.spliceWithArray(0,0,o),iLe&&Object.defineProperty(niA(I),"0",tLe)}),I}var n=i.prototype;return n.concat=function(){this[Le].atom_.reportObserved();for(var o=arguments.length,g=new Array(o),a=0;a<o;a++)g[a]=arguments[a];return Array.prototype.concat.apply(this.slice(),g.map(function(s){return oF(s)?s.slice():s}))},n[t]=function(){var o=this,g=0;return gF({next:function(){return g<o.length?{value:o[g++],done:!1}:{done:!0,value:void 0}}})},tiA(i,[{key:"length",get:function(){return this[Le].getArrayLength_()},set:function(o){this[Le].setArrayLength_(o)}},{key:e,get:function(){return"Array"}}]),i}(lFA,Symbol.toStringTag,Symbol.iterator);Object.entries(pV).forEach(function(A){var e=A[0],t=A[1];e!=="concat"&&zx(miA.prototype,e,t)});function cFA(A){return{enumerable:!1,configurable:!0,get:function(){return this[Le].get_(A)},set:function(e){this[Le].set_(A,e)}}}function oLe(A){OB(miA.prototype,""+A,cFA(A))}function BFA(A){if(A>hiA){for(var e=hiA;e<A+100;e++)oLe(e);hiA=A}}BFA(1e3);function gLe(A,e,t){return new miA(A,e,t)}function rk(A,e){if(typeof A=="object"&&A!==null){if(oF(A))return e!==void 0&&qt(23),A[Le].atom_;if(my(A))return A.atom_;if(Gm(A)){if(e===void 0)return A.keysAtom_;var t=A.data_.get(e)||A.hasMap_.get(e);return t||qt(25,e,piA(A)),t}if(sk(A)){if(!e)return qt(26);var i=A[Le].values_.get(e);return i||qt(27,e,piA(A)),i}if(oiA(A)||Px(A)||EV(A))return A}else if(gc(A)&&EV(A[Le]))return A[Le];qt(28)}function QFA(A,e){if(A||qt(29),e!==void 0)return QFA(rk(A,e));if(oiA(A)||Px(A)||EV(A)||Gm(A)||my(A))return A;if(A[Le])return A[Le];qt(24,A)}function piA(A,e){var t;if(e!==void 0)t=rk(A,e);else{if(uV(A))return A.name;sk(A)||Gm(A)||my(A)?t=QFA(A):t=rk(A)}return t.name_}function km(A){var e=dy(),t=rV(!0);LC();try{return A()}finally{SC(),IV(t),Lu(e)}}var EFA=Xx.toString;function fiA(A,e,t){return t===void 0&&(t=-1),yiA(A,e,t)}function yiA(A,e,t,i,n){if(A===e)return A!==0||1/A===1/e;if(A==null||e==null)return!1;if(A!==A)return e!==e;var o=typeof A;if(o!=="function"&&o!=="object"&&typeof e!="object")return!1;var g=EFA.call(A);if(g!==EFA.call(e))return!1;switch(g){case"[object RegExp]":case"[object String]":return""+A==""+e;case"[object Number]":return+A!=+A?+e!=+e:+A==0?1/+A===1/e:+A==+e;case"[object Date]":case"[object Boolean]":return+A==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(A)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":t>=0&&t++;break}A=uFA(A),e=uFA(e);var a=g==="[object Array]";if(!a){if(typeof A!="object"||typeof e!="object")return!1;var s=A.constructor,I=e.constructor;if(s!==I&&!(gc(s)&&s instanceof s&&gc(I)&&I instanceof I)&&"constructor"in A&&"constructor"in e)return!1}if(t===0)return!1;t<0&&(t=-1),i=i||[],n=n||[];for(var r=i.length;r--;)if(i[r]===A)return n[r]===e;if(i.push(A),n.push(e),a){if(r=A.length,r!==e.length)return!1;for(;r--;)if(!yiA(A[r],e[r],t-1,i,n))return!1}else{var C=Object.keys(A),l;if(r=C.length,Object.keys(e).length!==r)return!1;for(;r--;)if(l=C[r],!(vu(e,l)&&yiA(A[l],e[l],t-1,i,n)))return!1}return i.pop(),n.pop(),!0}function uFA(A){return oF(A)?A.slice():jG(A)||Gm(A)||Tx(A)||my(A)?Array.from(A.entries()):A}function gF(A){return A[Symbol.iterator]=aLe,A}function aLe(){return this}if(["Symbol","Map","Set"].forEach(function(A){var e=$tA();typeof e[A]>"u"&&qt("MobX requires global '"+A+"' to be available or polyfilled")}),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:yve,extras:{getDebugName:piA},$mobx:Le}),!p.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!zve)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function sLe(A){A()}function rLe(A){A||(A=sLe),Lve({reactionScheduler:A})}function ILe(A){return Sve(A)}var CLe=1e4,lLe=1e4,cLe=function(){function A(e){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(i){i===void 0&&(i=CLe),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var n=Date.now();t.registrations.forEach(function(o,g){n-o.registeredAt>=i&&(t.finalize(o.value),t.registrations.delete(g))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(A.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,i){this.registrations.set(i,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(A.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(A.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,lLe))}}),A}(),BLe=typeof FinalizationRegistry<"u"?FinalizationRegistry:cLe,biA=new BLe(function(A){var e;(e=A.reaction)===null||e===void 0||e.dispose(),A.reaction=null}),dFA=globalThis&&globalThis.__read||function(A,e){var t=typeof Symbol=="function"&&A[Symbol.iterator];if(!t)return A;var i=t.call(A),n,o=[],g;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(a){g={error:a}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(g)throw g.error}}return o};function hFA(A){return"observer".concat(A)}var QLe=function(){function A(){}return A}();function ELe(){return new QLe}function uLe(A,e){e===void 0&&(e="observed");var t=dFA(b.useState(ELe),1),i=t[0],n=dFA(b.useState(),2),o=n[1],g=function(){return o([])},a=b.useRef(null);a.current||(a.current={reaction:null,mounted:!1,changedBeforeMount:!1});var s=a.current;s.reaction||(s.reaction=new nk(hFA(e),function(){s.mounted?g():s.changedBeforeMount=!0}),biA.register(i,s,s)),b.useDebugValue(s.reaction,ILe),b.useEffect(function(){return biA.unregister(s),s.mounted=!0,s.reaction?s.changedBeforeMount&&(s.changedBeforeMount=!1,g()):(s.reaction=new nk(hFA(e),function(){g()}),g()),function(){s.reaction.dispose(),s.reaction=null,s.mounted=!1,s.changedBeforeMount=!1}},[]);var I,r;if(s.reaction.track(function(){try{I=A()}catch(C){r=C}}),r)throw r;return I}var mFA=typeof Symbol=="function"&&Symbol.for,pFA=mFA?Symbol.for("react.forward_ref"):typeof p.forwardRef=="function"&&p.forwardRef(function(A){return null}).$$typeof,fFA=mFA?Symbol.for("react.memo"):typeof p.memo=="function"&&p.memo(function(A){return null}).$$typeof;function ze(A,e){var t;if(fFA&&A.$$typeof===fFA)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var i=(t=e==null?void 0:e.forwardRef)!==null&&t!==void 0?t:!1,n=A,o=A.displayName||A.name;if(pFA&&A.$$typeof===pFA&&(i=!0,n=A.render,typeof n!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var g=function(a,s){return uLe(function(){return n(a,s)},o)};return o!==""&&(g.displayName=o),A.contextTypes&&(g.contextTypes=A.contextTypes),i&&(g=p.forwardRef(g)),g=p.memo(g),hLe(A,g),g}var dLe={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function hLe(A,e){Object.keys(A).forEach(function(t){dLe[t]||Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}rLe(bt.unstable_batchedUpdates),biA.finalizeAllImmediately;function WC(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function yFA(A,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(A,OYA(i.key),i)}}function KC(A,e,t){return e&&yFA(A.prototype,e),t&&yFA(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A}var mLe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,pLe={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},fLe=function(A){return pLe[A]},yLe=function(A){return A.replace(mLe,fLe)};function bFA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function wFA(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bFA(Object(t),!0).forEach(function(i){ic(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):bFA(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}var wiA={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:yLe},DFA,bLe=p.createContext();function wLe(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wiA=wFA(wFA({},wiA),A)}function DLe(){return wiA}var GLe=function(){function A(){WC(this,A),this.usedNamespaces={}}return KC(A,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach(function(i){t.usedNamespaces[i]||(t.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),A}();function kLe(A){DFA=A}function JLe(){return DFA}var NLe={type:"3rdParty",init:function(A){wLe(A.options.react),kLe(A)}};function YLe(){if(console&&console.warn){for(var A,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];typeof t[0]=="string"&&(t[0]="react-i18next:: ".concat(t[0])),(A=console).warn.apply(A,t)}}var GFA={};function DiA(){for(var A=arguments.length,e=new Array(A),t=0;t<A;t++)e[t]=arguments[t];typeof e[0]=="string"&&GFA[e[0]]||(typeof e[0]=="string"&&(GFA[e[0]]=new Date),YLe.apply(void 0,e))}function kFA(A,e,t){A.loadNamespaces(e,function(){if(A.isInitialized)t();else{var i=function n(){setTimeout(function(){A.off("initialized",n)},0),t()};A.on("initialized",i)}})}function RLe(A,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=e.languages[0],n=e.options?e.options.fallbackLng:!1,o=e.languages[e.languages.length-1];if(i.toLowerCase()==="cimode")return!0;var g=function(a,s){var I=e.services.backendConnector.state["".concat(a,"|").concat(s)];return I===-1||I===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!g(e.isLanguageChangingTo,A)?!1:!!(e.hasResourceBundle(i,A)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||g(i,A)&&(!n||g(o,A)))}function xLe(A,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return DiA("i18n.languages were undefined or empty",e.languages),!0;var i=e.options.ignoreJSONStructure!==void 0;return i?e.hasLoadedNamespace(A,{precheck:function(n,o){if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,A))return!1}}):RLe(A,e,t)}function JFA(A){if(Array.isArray(A))return A}function FLe(A,e){var t=A==null?null:typeof Symbol<"u"&&A[Symbol.iterator]||A["@@iterator"];if(t!=null){var i,n,o,g,a=[],s=!0,I=!1;try{if(o=(t=t.call(A)).next,e===0){if(Object(t)!==t)return;s=!1}else for(;!(s=(i=o.call(t)).done)&&(a.push(i.value),a.length!==e);s=!0);}catch(r){I=!0,n=r}finally{try{if(!s&&t.return!=null&&(g=t.return(),Object(g)!==g))return}finally{if(I)throw n}}return a}}function NFA(A,e){(e==null||e>A.length)&&(e=A.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=A[t];return i}function YFA(A,e){if(A){if(typeof A=="string")return NFA(A,e);var t=Object.prototype.toString.call(A).slice(8,-1);if(t==="Object"&&A.constructor&&(t=A.constructor.name),t==="Map"||t==="Set")return Array.from(A);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return NFA(A,e)}}function RFA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MLe(A,e){return JFA(A)||FLe(A,e)||YFA(A,e)||RFA()}function xFA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function GiA(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xFA(Object(t),!0).forEach(function(i){ic(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):xFA(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}var vLe=function(A,e){var t=p.useRef();return p.useEffect(function(){t.current=e?t.current:A},[A,e]),t.current};function ve(A){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.i18n,i=p.useContext(bLe)||{},n=i.i18n,o=i.defaultNS,g=t||n||JLe();if(g&&!g.reportNamespaces&&(g.reportNamespaces=new GLe),!g){DiA("You will need to pass in an i18next instance by using initReactI18next");var a=function(F){return Array.isArray(F)?F[F.length-1]:F},s=[a,{},!1];return s.t=a,s.i18n={},s.ready=!1,s}g.options.react&&g.options.react.wait!==void 0&&DiA("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var I=GiA(GiA(GiA({},DLe()),g.options.react),e),r=I.useSuspense,C=I.keyPrefix,l=A||o||g.options&&g.options.defaultNS;l=typeof l=="string"?[l]:l||["translation"],g.reportNamespaces.addUsedNamespaces&&g.reportNamespaces.addUsedNamespaces(l);var c=(g.isInitialized||g.initializedStoreOnce)&&l.every(function(F){return xLe(F,g,I)});function B(){return g.getFixedT(null,I.nsMode==="fallback"?l:l[0],C)}var E=p.useState(B),u=MLe(E,2),d=u[0],f=u[1],w=l.join(),y=vLe(w),G=p.useRef(!0);p.useEffect(function(){var F=I.bindI18n,Q=I.bindI18nStore;G.current=!0,!c&&!r&&kFA(g,l,function(){G.current&&f(B)}),c&&y&&y!==w&&G.current&&f(B);function k(){G.current&&f(B)}return F&&g&&g.on(F,k),Q&&g&&g.store.on(Q,k),function(){G.current=!1,F&&g&&F.split(" ").forEach(function(h){return g.off(h,k)}),Q&&g&&Q.split(" ").forEach(function(h){return g.store.off(h,k)})}},[g,w]);var R=p.useRef(!0);p.useEffect(function(){G.current&&!R.current&&f(B),R.current=!1},[g,C]);var x=[d,g,c];if(x.t=d,x.i18n=g,x.ready=c,c||!c&&!r)return x;throw new Promise(function(F){kFA(g,l,function(){F()})})}var Zu;(function(A){A.vis="vis",A.data="data",A.chat="chat"})(Zu||(Zu={}));function aF(A){return Object.fromEntries(A.map(e=>[e,e]))}aF(["accent","category10","category20","category20b","category20c","dark2","paired","pastel1","pastel2","set1","set2","set3","tableau10","tableau20"]),aF(["blues","tealblues","teals","greens","browns","oranges","reds","purples","warmgreys","greys"]),aF(["viridis","magma","inferno","plasma","cividis","turbo","bluegreen","bluepurple","goldgreen","goldorange","goldred","greenblue","orangered","purplebluegreen","purpleblue","purplered","redpurple","yellowgreenblue","yellowgreen","yelloworangebrown","yelloworangered","darkblue","darkgold","darkgreen","darkmulti","darkred","lightgreyred","lightgreyteal","lightmulti","lightorange","lighttealblue"]),aF(["blueorange","brownbluegreen","purplegreen","pinkyellowgreen","purpleorange","redblue","redgrey","redyellowblue","redyellowgreen","spectral"]),aF(["rainbow","sinebow"]);function LLe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const SLe=p.forwardRef(LLe),HLe=SLe;function ZLe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const WLe=p.forwardRef(ZLe),KLe=WLe;function ULe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 15 3 9m0 0 6-6M3 9h12a6 6 0 0 1 0 12h-3"}))}const VLe=p.forwardRef(ULe),XLe=VLe;function zLe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 15 6-6m0 0-6-6m6 6H9a6 6 0 0 0 0 12h3"}))}const TLe=p.forwardRef(zLe),_Le=TLe;function OLe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"}))}const qLe=p.forwardRef(OLe),jLe=qLe;function PLe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0-3.75-3.75M17.25 21 21 17.25"}))}const $Le=p.forwardRef(PLe),kiA=$Le;function ASe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12"}))}const eSe=p.forwardRef(ASe),JiA=eSe;function tSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"}))}const iSe=p.forwardRef(tSe),nSe=iSe;function oSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6a7.5 7.5 0 1 0 7.5 7.5h-7.5V6Z"}),p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5H21A7.5 7.5 0 0 0 13.5 3v7.5Z"}))}const gSe=p.forwardRef(oSe),aSe=gSe;function sSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"}))}const rSe=p.forwardRef(sSe),ISe=rSe;function CSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const lSe=p.forwardRef(CSe),FFA=lSe;function cSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 18.75 7.5-7.5 7.5 7.5"}),p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 7.5-7.5 7.5 7.5"}))}const BSe=p.forwardRef(cSe),QSe=BSe;function ESe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const uSe=p.forwardRef(ESe),dSe=uSe;function hSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const mSe=p.forwardRef(hSe),pSe=mSe;function fSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"}))}const ySe=p.forwardRef(fSe),sF=ySe;function bSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const wSe=p.forwardRef(bSe),DSe=wSe;function GSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"}))}const kSe=p.forwardRef(GSe),JSe=kSe;function NSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const YSe=p.forwardRef(NSe),MFA=YSe;function RSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"}))}const xSe=p.forwardRef(RSe),FSe=xSe;function MSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"}))}const vSe=p.forwardRef(MSe),LSe=vSe;function SSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const HSe=p.forwardRef(SSe),ZSe=HSe;function WSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const KSe=p.forwardRef(WSe),USe=KSe;function VSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z"}))}const XSe=p.forwardRef(VSe),rF=XSe;function zSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"}))}const TSe=p.forwardRef(zSe),_Se=TSe;function OSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const qSe=p.forwardRef(OSe),jSe=qSe;function PSe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6.115 5.19.319 1.913A6 6 0 0 0 8.11 10.36L9.75 12l-.387.775c-.217.433-.132.956.21 1.298l1.348 1.348c.21.21.329.497.329.795v1.089c0 .426.24.815.622 1.006l.153.076c.433.217.956.132 1.298-.21l.723-.723a8.7 8.7 0 0 0 2.288-4.042 1.087 1.087 0 0 0-.358-1.099l-1.33-1.108c-.251-.21-.582-.299-.905-.245l-1.17.195a1.125 1.125 0 0 1-.98-.314l-.295-.295a1.125 1.125 0 0 1 0-1.591l.13-.132a1.125 1.125 0 0 1 1.3-.21l.603.302a.809.809 0 0 0 1.086-1.086L14.25 7.5l1.256-.837a4.5 4.5 0 0 0 1.528-1.732l.146-.292M6.115 5.19A9 9 0 1 0 17.18 4.64M6.115 5.19A8.965 8.965 0 0 1 12 3c1.929 0 3.716.607 5.18 1.64"}))}const $Se=p.forwardRef(PSe),AHe=$Se;function eHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.498 15.25H4.372c-1.026 0-1.945-.694-2.054-1.715a12.137 12.137 0 0 1-.068-1.285c0-2.848.992-5.464 2.649-7.521C5.287 4.247 5.886 4 6.504 4h4.016a4.5 4.5 0 0 1 1.423.23l3.114 1.04a4.5 4.5 0 0 0 1.423.23h1.294M7.498 15.25c.618 0 .991.724.725 1.282A7.471 7.471 0 0 0 7.5 19.75 2.25 2.25 0 0 0 9.75 22a.75.75 0 0 0 .75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 0 0 2.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384m-10.253 1.5H9.7m8.075-9.75c.01.05.027.1.05.148.593 1.2.925 2.55.925 3.977 0 1.487-.36 2.89-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398-.306.774-1.086 1.227-1.918 1.227h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 0 0 .303-.54"}))}const tHe=p.forwardRef(eHe),iHe=tHe;function nHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.633 10.25c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75a.75.75 0 0 1 .75-.75 2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282m0 0h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23H5.904m10.598-9.75H14.25M5.904 18.5c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 0 1-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h1.053c.472 0 .745.556.5.96a8.958 8.958 0 0 0-1.302 4.665c0 1.194.232 2.333.654 3.375Z"}))}const oHe=p.forwardRef(nHe),gHe=oHe;function aHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"}))}const sHe=p.forwardRef(aHe),rHe=sHe;function IHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"}))}const CHe=p.forwardRef(IHe),vFA=CHe;function lHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const cHe=p.forwardRef(lHe),BHe=cHe;function QHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}),p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"}))}const EHe=p.forwardRef(QHe),uHe=EHe;function dHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const hHe=p.forwardRef(dHe),LFA=hHe;function mHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Zm0 0a15.998 15.998 0 0 0 3.388-1.62m-5.043-.025a15.994 15.994 0 0 1 1.622-3.395m3.42 3.42a15.995 15.995 0 0 0 4.764-4.648l3.876-5.814a1.151 1.151 0 0 0-1.597-1.597L14.146 6.32a15.996 15.996 0 0 0-4.649 4.763m3.42 3.42a6.776 6.776 0 0 0-3.42-3.42"}))}const pHe=p.forwardRef(mHe),fHe=pHe;function yHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12 3.269 3.125A59.769 59.769 0 0 1 21.485 12 59.768 59.768 0 0 1 3.27 20.875L5.999 12Zm0 0h7.5"}))}const bHe=p.forwardRef(yHe),wHe=bHe;function DHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const GHe=p.forwardRef(DHe),kHe=GHe;function JHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v6m3-3H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const NHe=p.forwardRef(JHe),SFA=NHe;function YHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 0 1-1.125-1.125v-3.75ZM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-8.25ZM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-2.25Z"}))}const RHe=p.forwardRef(YHe),xHe=RHe;function FHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.429 9.75 2.25 12l4.179 2.25m0-4.5 5.571 3 5.571-3m-11.142 0L2.25 7.5 12 2.25l9.75 5.25-4.179 2.25m0 0L21.75 12l-4.179 2.25m0 0 4.179 2.25L12 21.75 2.25 16.5l4.179-2.25m11.142 0-5.571 3-5.571-3"}))}const MHe=p.forwardRef(FHe),vHe=MHe;function LHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"}))}const SHe=p.forwardRef(LHe),HHe=SHe;function ZHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"}))}const WHe=p.forwardRef(ZHe),HFA=WHe;function KHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const UHe=p.forwardRef(KHe),yV=UHe;function VHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}))}const XHe=p.forwardRef(VHe),zHe=XHe;function THe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75a4.5 4.5 0 0 1-4.884 4.484c-1.076-.091-2.264.071-2.95.904l-7.152 8.684a2.548 2.548 0 1 1-3.586-3.586l8.684-7.152c.833-.686.995-1.874.904-2.95a4.5 4.5 0 0 1 6.336-4.486l-3.276 3.276a3.004 3.004 0 0 0 2.25 2.25l3.276-3.276c.256.565.398 1.192.398 1.852Z"}),p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.867 19.125h.008v.008h-.008v-.008Z"}))}const _He=p.forwardRef(THe),OHe=_He;function qHe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const jHe=p.forwardRef(qHe),PHe=jHe;function UC(A){var e=typeof A;return A!=null&&(e=="object"||e=="function")}var $He=typeof global=="object"&&global&&global.Object===Object&&global;const ZFA=$He;var AZe=typeof self=="object"&&self&&self.Object===Object&&self,eZe=ZFA||AZe||Function("return this")();const rc=eZe;var tZe=function(){return rc.Date.now()};const NiA=tZe;var iZe=/\s/;function nZe(A){for(var e=A.length;e--&&iZe.test(A.charAt(e)););return e}var oZe=/^\s+/;function gZe(A){return A&&A.slice(0,nZe(A)+1).replace(oZe,"")}var aZe=rc.Symbol;const Jm=aZe;var WFA=Object.prototype,sZe=WFA.hasOwnProperty,rZe=WFA.toString,IF=Jm?Jm.toStringTag:void 0;function IZe(A){var e=sZe.call(A,IF),t=A[IF];try{A[IF]=void 0;var i=!0}catch{}var n=rZe.call(A);return i&&(e?A[IF]=t:delete A[IF]),n}var CZe=Object.prototype,lZe=CZe.toString;function cZe(A){return lZe.call(A)}var BZe="[object Null]",QZe="[object Undefined]",KFA=Jm?Jm.toStringTag:void 0;function fy(A){return A==null?A===void 0?QZe:BZe:KFA&&KFA in Object(A)?IZe(A):cZe(A)}function Nm(A){return A!=null&&typeof A=="object"}var EZe="[object Symbol]";function bV(A){return typeof A=="symbol"||Nm(A)&&fy(A)==EZe}var UFA=0/0,uZe=/^[-+]0x[0-9a-f]+$/i,dZe=/^0b[01]+$/i,hZe=/^0o[0-7]+$/i,mZe=parseInt;function YiA(A){if(typeof A=="number")return A;if(bV(A))return UFA;if(UC(A)){var e=typeof A.valueOf=="function"?A.valueOf():A;A=UC(e)?e+"":e}if(typeof A!="string")return A===0?A:+A;A=gZe(A);var t=dZe.test(A);return t||hZe.test(A)?mZe(A.slice(2),t?2:8):uZe.test(A)?UFA:+A}var pZe="Expected a function",fZe=Math.max,yZe=Math.min;function Ik(A,e,t){var i,n,o,g,a,s,I=0,r=!1,C=!1,l=!0;if(typeof A!="function")throw new TypeError(pZe);e=YiA(e)||0,UC(t)&&(r=!!t.leading,C="maxWait"in t,o=C?fZe(YiA(t.maxWait)||0,e):o,l="trailing"in t?!!t.trailing:l);function c(R){var x=i,F=n;return i=n=void 0,I=R,g=A.apply(F,x),g}function B(R){return I=R,a=setTimeout(d,e),r?c(R):g}function E(R){var x=R-s,F=R-I,Q=e-x;return C?yZe(Q,o-F):Q}function u(R){var x=R-s,F=R-I;return s===void 0||x>=e||x<0||C&&F>=o}function d(){var R=NiA();if(u(R))return f(R);a=setTimeout(d,E(R))}function f(R){return a=void 0,l&&i?c(R):(i=n=void 0,g)}function w(){a!==void 0&&clearTimeout(a),I=0,i=s=n=a=void 0}function y(){return a===void 0?g:f(NiA())}function G(){var R=NiA(),x=u(R);if(i=arguments,n=this,s=R,x){if(a===void 0)return B(s);if(C)return clearTimeout(a),a=setTimeout(d,e),c(s)}return a===void 0&&(a=setTimeout(d,e)),g}return G.cancel=w,G.flush=y,G}function RiA(A){return function(e){const[t,i]=p.useState(e),n=p.useCallback(A(i),[]);return p.useEffect(()=>n(e),[e]),t}}function VFA(A){const e=RiA(A);return function(t,i){const[n,o]=p.useState(t),g=e(n),a=p.useRef(!0);return p.useEffect(()=>o(t),[t]),p.useEffect(()=>{a.current?a.current=!1:i(g)},[g]),[n,o]}}const xiA=VFA(A=>Ik(A,200));function XFA(A){const[e,t]=b.useState(A),i=b.useRef(e);i.current=e;const n=b.useRef(A),o=b.useRef(!1);n.current!==A&&(n.current=A,o.current=!1);const g=b.useCallback(a=>{o.current?t(a):(o.current=!0,t(typeof a=="function"?a(n.current):a))},[]);return[o.current?e:A,g]}function wV(A,[e,t]){return Math.min(t,Math.max(e,A))}function TA(A,e,{checkForDefaultPrevented:t=!0}={}){return function(i){if(A==null||A(i),t===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function zFA(A,e){if(typeof A=="function")return A(e);A!=null&&(A.current=e)}function Wu(...A){return e=>{let t=!1;const i=A.map(n=>{const o=zFA(n,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let n=0;n<i.length;n++){const o=i[n];typeof o=="function"?o():zFA(A[n],null)}}}}function Te(...A){return p.useCallback(Wu(...A),A)}var TFA={exports:{}},CF={};/**
 * @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 _FA;function bZe(){if(_FA)return CF;_FA=1;var A=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,n,o){var g=null;if(o!==void 0&&(g=""+o),n.key!==void 0&&(g=""+n.key),"key"in n){o={};for(var a in n)a!=="key"&&(o[a]=n[a])}else o=n;return n=o.ref,{$$typeof:A,type:i,key:g,ref:n!==void 0?n:null,props:o}}return CF.Fragment=e,CF.jsx=t,CF.jsxs=t,CF}TFA.exports=bZe();var FiA=TFA.exports;const yy=FiA.Fragment,cA=FiA.jsx,Ic=FiA.jsxs;function wZe(A,e){const t=p.createContext(e),i=o=>{const{children:g,...a}=o,s=p.useMemo(()=>a,Object.values(a));return cA(t.Provider,{value:s,children:g})};i.displayName=A+"Provider";function n(o){const g=p.useContext(t);if(g)return g;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${A}\``)}return[i,n]}function Tg(A,e=[]){let t=[];function i(o,g){const a=p.createContext(g),s=t.length;t=[...t,g];const I=C=>{var l;const{scope:c,children:B,...E}=C,u=((l=c==null?void 0:c[A])==null?void 0:l[s])||a,d=p.useMemo(()=>E,Object.values(E));return cA(u.Provider,{value:d,children:B})};I.displayName=o+"Provider";function r(C,l){var c;const B=((c=l==null?void 0:l[A])==null?void 0:c[s])||a,E=p.useContext(B);if(E)return E;if(g!==void 0)return g;throw new Error(`\`${C}\` must be used within \`${o}\``)}return[I,r]}const n=()=>{const o=t.map(g=>p.createContext(g));return function(g){const a=(g==null?void 0:g[A])||o;return p.useMemo(()=>({[`__scope${A}`]:{...g,[A]:a}}),[g,a])}};return n.scopeName=A,[i,DZe(n,...e)]}function DZe(...A){const e=A[0];if(A.length===1)return e;const t=()=>{const i=A.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(n){const o=i.reduce((g,{useScope:a,scopeName:s})=>{const I=a(n)[`__scope${s}`];return{...g,...I}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}var _g=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},GZe=bf[" useInsertionEffect ".trim().toString()]||_g;function is({prop:A,defaultProp:e,onChange:t=()=>{},caller:i}){const[n,o,g]=kZe({defaultProp:e,onChange:t}),a=A!==void 0,s=a?A:n;{const r=p.useRef(A!==void 0);p.useEffect(()=>{const C=r.current;C!==a&&console.warn(`${i} is changing from ${C?"controlled":"uncontrolled"} to ${a?"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.`),r.current=a},[a,i])}const I=p.useCallback(r=>{var C;if(a){const l=JZe(r)?r(A):r;l!==A&&((C=g.current)==null||C.call(g,l))}else o(r)},[a,A,o,g]);return[s,I]}function kZe({defaultProp:A,onChange:e}){const[t,i]=p.useState(A),n=p.useRef(t),o=p.useRef(e);return GZe(()=>{o.current=e},[e]),p.useEffect(()=>{var g;n.current!==t&&((g=o.current)==null||g.call(o,t),n.current=t)},[t,n]),[t,i,o]}function JZe(A){return typeof A=="function"}var NZe=p.createContext(void 0);function Ck(A){const e=p.useContext(NZe);return A||e||"ltr"}function lF(A){const e=p.useRef({value:A,previous:A});return p.useMemo(()=>(e.current.value!==A&&(e.current.previous=e.current.value,e.current.value=A),e.current.previous),[A])}function cF(A){const[e,t]=p.useState(void 0);return _g(()=>{if(A){t({width:A.offsetWidth,height:A.offsetHeight});const i=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const o=n[0];let g,a;if("borderBoxSize"in o){const s=o.borderBoxSize,I=Array.isArray(s)?s[0]:s;g=I.inlineSize,a=I.blockSize}else g=A.offsetWidth,a=A.offsetHeight;t({width:g,height:a})});return i.observe(A,{box:"border-box"}),()=>i.unobserve(A)}else t(void 0)},[A]),e}function Ym(A){const e=RZe(A),t=p.forwardRef((i,n)=>{const{children:o,...g}=i,a=p.Children.toArray(o),s=a.find(FZe);if(s){const I=s.props.children,r=a.map(C=>C===s?p.Children.count(I)>1?p.Children.only(null):p.isValidElement(I)?I.props.children:null:C);return cA(e,{...g,ref:n,children:p.isValidElement(I)?p.cloneElement(I,void 0,r):null})}return cA(e,{...g,ref:n,children:o})});return t.displayName=`${A}.Slot`,t}var YZe=Ym("Slot");function RZe(A){const e=p.forwardRef((t,i)=>{const{children:n,...o}=t;if(p.isValidElement(n)){const g=vZe(n),a=MZe(o,n.props);return n.type!==p.Fragment&&(a.ref=i?Wu(i,g):g),p.cloneElement(n,a)}return p.Children.count(n)>1?p.Children.only(null):null});return e.displayName=`${A}.SlotClone`,e}var OFA=Symbol("radix.slottable");function xZe(A){const e=({children:t})=>cA(yy,{children:t});return e.displayName=`${A}.Slottable`,e.__radixId=OFA,e}function FZe(A){return p.isValidElement(A)&&typeof A.type=="function"&&"__radixId"in A.type&&A.type.__radixId===OFA}function MZe(A,e){const t={...e};for(const i in e){const n=A[i],o=e[i];/^on[A-Z]/.test(i)?n&&o?t[i]=(...g)=>{const a=o(...g);return n(...g),a}:n&&(t[i]=n):i==="style"?t[i]={...n,...o}:i==="className"&&(t[i]=[n,o].filter(Boolean).join(" "))}return{...A,...t}}function vZe(A){var e,t;let i=(e=Object.getOwnPropertyDescriptor(A.props,"ref"))==null?void 0:e.get,n=i&&"isReactWarning"in i&&i.isReactWarning;return n?A.ref:(i=(t=Object.getOwnPropertyDescriptor(A,"ref"))==null?void 0:t.get,n=i&&"isReactWarning"in i&&i.isReactWarning,n?A.props.ref:A.props.ref||A.ref)}var LZe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],re=LZe.reduce((A,e)=>{const t=Ym(`Primitive.${e}`),i=p.forwardRef((n,o)=>{const{asChild:g,...a}=n,s=g?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),cA(s,{...a,ref:o})});return i.displayName=`Primitive.${e}`,{...A,[e]:i}},{});function qFA(A,e){A&&bt.flushSync(()=>A.dispatchEvent(e))}function DV(A){const e=A+"CollectionProvider",[t,i]=Tg(e),[n,o]=t(e,{collectionRef:{current:null},itemMap:new Map}),g=E=>{const{scope:u,children:d}=E,f=b.useRef(null),w=b.useRef(new Map).current;return cA(n,{scope:u,itemMap:w,collectionRef:f,children:d})};g.displayName=e;const a=A+"CollectionSlot",s=Ym(a),I=b.forwardRef((E,u)=>{const{scope:d,children:f}=E,w=o(a,d),y=Te(u,w.collectionRef);return cA(s,{ref:y,children:f})});I.displayName=a;const r=A+"CollectionItemSlot",C="data-radix-collection-item",l=Ym(r),c=b.forwardRef((E,u)=>{const{scope:d,children:f,...w}=E,y=b.useRef(null),G=Te(u,y),R=o(r,d);return b.useEffect(()=>(R.itemMap.set(y,{ref:y,...w}),()=>void R.itemMap.delete(y))),cA(l,{[C]:"",ref:G,children:f})});c.displayName=r;function B(E){const u=o(A+"CollectionConsumer",E);return b.useCallback(()=>{const d=u.collectionRef.current;if(!d)return[];const f=Array.from(d.querySelectorAll(`[${C}]`));return Array.from(u.itemMap.values()).sort((w,y)=>f.indexOf(w.ref.current)-f.indexOf(y.ref.current))},[u.collectionRef,u.itemMap])}return[{Provider:g,Slot:I,ItemSlot:c},B,i]}var jFA=["PageUp","PageDown"],PFA=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],$FA={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},lk="Slider",[MiA,SZe,HZe]=DV(lk),[AMA,Hpi]=Tg(lk,[HZe]),[ZZe,GV]=AMA(lk),eMA=p.forwardRef((A,e)=>{const{name:t,min:i=0,max:n=100,step:o=1,orientation:g="horizontal",disabled:a=!1,minStepsBetweenThumbs:s=0,defaultValue:I=[i],value:r,onValueChange:C=()=>{},onValueCommit:l=()=>{},inverted:c=!1,form:B,...E}=A,u=p.useRef(new Set),d=p.useRef(0),f=g==="horizontal"?WZe:KZe,[w=[],y]=is({prop:r,defaultProp:I,onChange:k=>{var h;(h=[...u.current][d.current])==null||h.focus(),C(k)}}),G=p.useRef(w);function R(k){const h=TZe(w,k);Q(k,h)}function x(k){Q(k,d.current)}function F(){const k=G.current[d.current];w[d.current]!==k&&l(w)}function Q(k,h,{commit:N}={commit:!1}){const v=jZe(o),K=PZe(Math.round((k-i)/o)*o+i,v),U=wV(K,[i,n]);y((V=[])=>{const X=XZe(V,U,h);if(qZe(X,s*o)){d.current=X.indexOf(U);const _=String(X)!==String(V);return _&&N&&l(X),_?X:V}else return V})}return cA(ZZe,{scope:A.__scopeSlider,name:t,disabled:a,min:i,max:n,valueIndexToChangeRef:d,thumbs:u.current,values:w,orientation:g,form:B,children:cA(MiA.Provider,{scope:A.__scopeSlider,children:cA(MiA.Slot,{scope:A.__scopeSlider,children:cA(f,{"aria-disabled":a,"data-disabled":a?"":void 0,...E,ref:e,onPointerDown:TA(E.onPointerDown,()=>{a||(G.current=w)}),min:i,max:n,inverted:c,onSlideStart:a?void 0:R,onSlideMove:a?void 0:x,onSlideEnd:a?void 0:F,onHomeKeyDown:()=>!a&&Q(i,0,{commit:!0}),onEndKeyDown:()=>!a&&Q(n,w.length-1,{commit:!0}),onStepKeyDown:({event:k,direction:h})=>{if(!a){const N=jFA.includes(k.key)||k.shiftKey&&PFA.includes(k.key)?10:1,v=d.current,K=w[v],U=o*N*h;Q(K+U,v,{commit:!0})}}})})})})});eMA.displayName=lk;var[tMA,iMA]=AMA(lk,{startEdge:"left",endEdge:"right",size:"width",direction:1}),WZe=p.forwardRef((A,e)=>{const{min:t,max:i,dir:n,inverted:o,onSlideStart:g,onSlideMove:a,onSlideEnd:s,onStepKeyDown:I,...r}=A,[C,l]=p.useState(null),c=Te(e,w=>l(w)),B=p.useRef(void 0),E=Ck(n),u=E==="ltr",d=u&&!o||!u&&o;function f(w){const y=B.current||C.getBoundingClientRect(),G=[0,y.width],R=SiA(G,d?[t,i]:[i,t]);return B.current=y,R(w-y.left)}return cA(tMA,{scope:A.__scopeSlider,startEdge:d?"left":"right",endEdge:d?"right":"left",direction:d?1:-1,size:"width",children:cA(nMA,{dir:E,"data-orientation":"horizontal",...r,ref:c,style:{...r.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const y=f(w.clientX);g==null||g(y)},onSlideMove:w=>{const y=f(w.clientX);a==null||a(y)},onSlideEnd:()=>{B.current=void 0,s==null||s()},onStepKeyDown:w=>{const y=$FA[d?"from-left":"from-right"].includes(w.key);I==null||I({event:w,direction:y?-1:1})}})})}),KZe=p.forwardRef((A,e)=>{const{min:t,max:i,inverted:n,onSlideStart:o,onSlideMove:g,onSlideEnd:a,onStepKeyDown:s,...I}=A,r=p.useRef(null),C=Te(e,r),l=p.useRef(void 0),c=!n;function B(E){const u=l.current||r.current.getBoundingClientRect(),d=[0,u.height],f=SiA(d,c?[i,t]:[t,i]);return l.current=u,f(E-u.top)}return cA(tMA,{scope:A.__scopeSlider,startEdge:c?"bottom":"top",endEdge:c?"top":"bottom",size:"height",direction:c?1:-1,children:cA(nMA,{"data-orientation":"vertical",...I,ref:C,style:{...I.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:E=>{const u=B(E.clientY);o==null||o(u)},onSlideMove:E=>{const u=B(E.clientY);g==null||g(u)},onSlideEnd:()=>{l.current=void 0,a==null||a()},onStepKeyDown:E=>{const u=$FA[c?"from-bottom":"from-top"].includes(E.key);s==null||s({event:E,direction:u?-1:1})}})})}),nMA=p.forwardRef((A,e)=>{const{__scopeSlider:t,onSlideStart:i,onSlideMove:n,onSlideEnd:o,onHomeKeyDown:g,onEndKeyDown:a,onStepKeyDown:s,...I}=A,r=GV(lk,t);return cA(re.span,{...I,ref:e,onKeyDown:TA(A.onKeyDown,C=>{C.key==="Home"?(g(C),C.preventDefault()):C.key==="End"?(a(C),C.preventDefault()):jFA.concat(PFA).includes(C.key)&&(s(C),C.preventDefault())}),onPointerDown:TA(A.onPointerDown,C=>{const l=C.target;l.setPointerCapture(C.pointerId),C.preventDefault(),r.thumbs.has(l)?l.focus():i(C)}),onPointerMove:TA(A.onPointerMove,C=>{C.target.hasPointerCapture(C.pointerId)&&n(C)}),onPointerUp:TA(A.onPointerUp,C=>{const l=C.target;l.hasPointerCapture(C.pointerId)&&(l.releasePointerCapture(C.pointerId),o(C))})})}),oMA="SliderTrack",gMA=p.forwardRef((A,e)=>{const{__scopeSlider:t,...i}=A,n=GV(oMA,t);return cA(re.span,{"data-disabled":n.disabled?"":void 0,"data-orientation":n.orientation,...i,ref:e})});gMA.displayName=oMA;var viA="SliderRange",aMA=p.forwardRef((A,e)=>{const{__scopeSlider:t,...i}=A,n=GV(viA,t),o=iMA(viA,t),g=p.useRef(null),a=Te(e,g),s=n.values.length,I=n.values.map(l=>IMA(l,n.min,n.max)),r=s>1?Math.min(...I):0,C=100-Math.max(...I);return cA(re.span,{"data-orientation":n.orientation,"data-disabled":n.disabled?"":void 0,...i,ref:a,style:{...A.style,[o.startEdge]:r+"%",[o.endEdge]:C+"%"}})});aMA.displayName=viA;var LiA="SliderThumb",sMA=p.forwardRef((A,e)=>{const t=SZe(A.__scopeSlider),[i,n]=p.useState(null),o=Te(e,a=>n(a)),g=p.useMemo(()=>i?t().findIndex(a=>a.ref.current===i):-1,[t,i]);return cA(UZe,{...A,ref:o,index:g})}),UZe=p.forwardRef((A,e)=>{const{__scopeSlider:t,index:i,name:n,...o}=A,g=GV(LiA,t),a=iMA(LiA,t),[s,I]=p.useState(null),r=Te(e,f=>I(f)),C=s?g.form||!!s.closest("form"):!0,l=cF(s),c=g.values[i],B=c===void 0?0:IMA(c,g.min,g.max),E=zZe(i,g.values.length),u=l==null?void 0:l[a.size],d=u?_Ze(u,B,a.direction):0;return p.useEffect(()=>{if(s)return g.thumbs.add(s),()=>{g.thumbs.delete(s)}},[s,g.thumbs]),Ic("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${B}% + ${d}px)`},children:[cA(MiA.ItemSlot,{scope:A.__scopeSlider,children:cA(re.span,{role:"slider","aria-label":A["aria-label"]||E,"aria-valuemin":g.min,"aria-valuenow":c,"aria-valuemax":g.max,"aria-orientation":g.orientation,"data-orientation":g.orientation,"data-disabled":g.disabled?"":void 0,tabIndex:g.disabled?void 0:0,...o,ref:r,style:c===void 0?{display:"none"}:A.style,onFocus:TA(A.onFocus,()=>{g.valueIndexToChangeRef.current=i})})}),C&&cA(rMA,{name:n??(g.name?g.name+(g.values.length>1?"[]":""):void 0),form:g.form,value:c},i)]})});sMA.displayName=LiA;var VZe="RadioBubbleInput",rMA=p.forwardRef(({__scopeSlider:A,value:e,...t},i)=>{const n=p.useRef(null),o=Te(n,i),g=lF(e);return p.useEffect(()=>{const a=n.current;if(!a)return;const s=window.HTMLInputElement.prototype,I=Object.getOwnPropertyDescriptor(s,"value").set;if(g!==e&&I){const r=new Event("input",{bubbles:!0});I.call(a,e),a.dispatchEvent(r)}},[g,e]),cA(re.input,{style:{display:"none"},...t,ref:o,defaultValue:e})});rMA.displayName=VZe;function XZe(A=[],e,t){const i=[...A];return i[t]=e,i.sort((n,o)=>n-o)}function IMA(A,e,t){const i=100/(t-e)*(A-e);return wV(i,[0,100])}function zZe(A,e){return e>2?`Value ${A+1} of ${e}`:e===2?["Minimum","Maximum"][A]:void 0}function TZe(A,e){if(A.length===1)return 0;const t=A.map(n=>Math.abs(n-e)),i=Math.min(...t);return t.indexOf(i)}function _Ze(A,e,t){const i=A/2,n=SiA([0,50],[0,i]);return(i-n(e)*t)*t}function OZe(A){return A.slice(0,-1).map((e,t)=>A[t+1]-e)}function qZe(A,e){if(e>0){const t=OZe(A);return Math.min(...t)>=e}return!0}function SiA(A,e){return t=>{if(A[0]===A[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(A[1]-A[0]);return e[0]+i*(t-A[0])}}function jZe(A){return(String(A).split(".")[1]||"").length}function PZe(A,e){const t=Math.pow(10,e);return Math.round(A*t)/t}var kV=eMA,CMA=gMA,lMA=aMA,HiA=sMA;function Rm(A){if(A===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function JV(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&MU(A,e)}function BF(A,e){if(e&&(tc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rm(A)}function $B(A){return $B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$B(A)}function $Ze(A){if(typeof Symbol<"u"&&A[Symbol.iterator]!=null||A["@@iterator"]!=null)return Array.from(A)}function AWe(A){return JFA(A)||$Ze(A)||YFA(A)||RFA()}function cMA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function BMA(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?cMA(Object(t),!0).forEach(function(i){ic(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):cMA(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}var eWe={type:"logger",log:function(A){this.output("log",A)},warn:function(A){this.output("warn",A)},error:function(A){this.output("error",A)},output:function(A,e){console&&console[A]&&console[A].apply(console,e)}},tWe=function(){function A(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};WC(this,A),this.init(e,t)}return KC(A,[{key:"init",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||eWe,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,i,n){return n&&!this.debug?null:(typeof e[0]=="string"&&(e[0]="".concat(i).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(e){return new A(this.logger,BMA(BMA({},{prefix:"".concat(this.prefix,":").concat(e,":")}),this.options))}},{key:"clone",value:function(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new A(this.logger,e)}}]),A}(),AQ=new tWe,xm=function(){function A(){WC(this,A),this.observers={}}return KC(A,[{key:"on",value:function(e,t){var i=this;return e.split(" ").forEach(function(n){i.observers[n]=i.observers[n]||[],i.observers[n].push(t)}),this}},{key:"off",value:function(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(function(i){return i!==t})}}},{key:"emit",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];if(this.observers[e]){var o=[].concat(this.observers[e]);o.forEach(function(a){a.apply(void 0,i)})}if(this.observers["*"]){var g=[].concat(this.observers["*"]);g.forEach(function(a){a.apply(a,[e].concat(i))})}}}]),A}();function QF(){var A,e,t=new Promise(function(i,n){A=i,e=n});return t.resolve=A,t.reject=e,t}function QMA(A){return A==null?"":""+A}function iWe(A,e,t){A.forEach(function(i){e[i]&&(t[i]=e[i])})}function ZiA(A,e,t){function i(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function n(){return!A||typeof A=="string"}for(var o=typeof e!="string"?[].concat(e):e.split(".");o.length>1;){if(n())return{};var g=i(o.shift());!A[g]&&t&&(A[g]=new t),Object.prototype.hasOwnProperty.call(A,g)?A=A[g]:A={}}return n()?{}:{obj:A,k:i(o.shift())}}function EMA(A,e,t){var i=ZiA(A,e,Object),n=i.obj,o=i.k;n[o]=t}function nWe(A,e,t,i){var n=ZiA(A,e,Object),o=n.obj,g=n.k;o[g]=o[g]||[],i&&(o[g]=o[g].concat(t)),i||o[g].push(t)}function NV(A,e){var t=ZiA(A,e),i=t.obj,n=t.k;if(i)return i[n]}function uMA(A,e,t){var i=NV(A,t);return i!==void 0?i:NV(e,t)}function dMA(A,e,t){for(var i in e)i!=="__proto__"&&i!=="constructor"&&(i in A?typeof A[i]=="string"||A[i]instanceof String||typeof e[i]=="string"||e[i]instanceof String?t&&(A[i]=e[i]):dMA(A[i],e[i],t):A[i]=e[i]);return A}function ck(A){return A.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var oWe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function gWe(A){return typeof A=="string"?A.replace(/[&<>"'\/]/g,function(e){return oWe[e]}):A}var YV=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,aWe=[" ",",","?","!",";"];function sWe(A,e,t){e=e||"",t=t||"";var i=aWe.filter(function(a){return e.indexOf(a)<0&&t.indexOf(a)<0});if(i.length===0)return!0;var n=new RegExp("(".concat(i.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!n.test(A);if(!o){var g=A.indexOf(t);g>0&&!n.test(A.substring(0,g))&&(o=!0)}return o}function hMA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function RV(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hMA(Object(t),!0).forEach(function(i){ic(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):hMA(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function rWe(A){var e=IWe();return function(){var t=$B(A),i;if(e){var n=$B(this).constructor;i=Reflect.construct(t,arguments,n)}else i=t.apply(this,arguments);return BF(this,i)}}function IWe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function mMA(A,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(A){if(A[e])return A[e];for(var i=e.split(t),n=A,o=0;o<i.length;++o){if(!n||typeof n[i[o]]=="string"&&o+1<i.length)return;if(n[i[o]]===void 0){for(var g=2,a=i.slice(o,o+g).join(t),s=n[a];s===void 0&&i.length>o+g;)g++,a=i.slice(o,o+g).join(t),s=n[a];if(s===void 0)return;if(s===null)return null;if(e.endsWith(a)){if(typeof s=="string")return s;if(a&&typeof s[a]=="string")return s[a]}var I=i.slice(o+g).join(t);return I?mMA(s,I,t):void 0}n=n[i[o]]}return n}}var CWe=function(A){JV(t,A);var e=rWe(t);function t(i){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return WC(this,t),n=e.call(this),YV&&xm.call(Rm(n)),n.data=i||{},n.options=o,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.options.ignoreJSONStructure===void 0&&(n.options.ignoreJSONStructure=!0),n}return KC(t,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var n=this.options.ns.indexOf(i);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function(i,n,o){var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=g.keySeparator!==void 0?g.keySeparator:this.options.keySeparator,s=g.ignoreJSONStructure!==void 0?g.ignoreJSONStructure:this.options.ignoreJSONStructure,I=[i,n];o&&typeof o!="string"&&(I=I.concat(o)),o&&typeof o=="string"&&(I=I.concat(a?o.split(a):o)),i.indexOf(".")>-1&&(I=i.split("."));var r=NV(this.data,I);return r||!s||typeof o!="string"?r:mMA(this.data&&this.data[i]&&this.data[i][n],o,a)}},{key:"addResource",value:function(i,n,o,g){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},s=this.options.keySeparator;s===void 0&&(s=".");var I=[i,n];o&&(I=I.concat(s?o.split(s):o)),i.indexOf(".")>-1&&(I=i.split("."),g=n,n=I[1]),this.addNamespaces(n),EMA(this.data,I,g),a.silent||this.emit("added",i,n,o,g)}},{key:"addResources",value:function(i,n,o){var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var a in o)(typeof o[a]=="string"||Object.prototype.toString.apply(o[a])==="[object Array]")&&this.addResource(i,n,a,o[a],{silent:!0});g.silent||this.emit("added",i,n,o)}},{key:"addResourceBundle",value:function(i,n,o,g,a){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},I=[i,n];i.indexOf(".")>-1&&(I=i.split("."),g=o,o=n,n=I[1]),this.addNamespaces(n);var r=NV(this.data,I)||{};g?dMA(r,o,a):r=RV(RV({},r),o),EMA(this.data,I,r),s.silent||this.emit("added",i,n,o)}},{key:"removeResourceBundle",value:function(i,n){this.hasResourceBundle(i,n)&&delete this.data[i][n],this.removeNamespaces(n),this.emit("removed",i,n)}},{key:"hasResourceBundle",value:function(i,n){return this.getResource(i,n)!==void 0}},{key:"getResourceBundle",value:function(i,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?RV(RV({},{}),this.getResource(i,n)):this.getResource(i,n)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var n=this.getDataByLanguage(i),o=n&&Object.keys(n)||[];return!!o.find(function(g){return n[g]&&Object.keys(n[g]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),t}(xm),pMA={processors:{},addPostProcessor:function(A){this.processors[A.name]=A},handle:function(A,e,t,i,n){var o=this;return A.forEach(function(g){o.processors[g]&&(e=o.processors[g].process(e,t,i,n))}),e}};function fMA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function ns(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fMA(Object(t),!0).forEach(function(i){ic(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):fMA(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function lWe(A){var e=cWe();return function(){var t=$B(A),i;if(e){var n=$B(this).constructor;i=Reflect.construct(t,arguments,n)}else i=t.apply(this,arguments);return BF(this,i)}}function cWe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var yMA={},bMA=function(A){JV(t,A);var e=lWe(t);function t(i){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return WC(this,t),n=e.call(this),YV&&xm.call(Rm(n)),iWe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,Rm(n)),n.options=o,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.logger=AQ.create("translator"),n}return KC(t,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var o=this.resolve(i,n);return o&&o.res!==void 0}},{key:"extractFromKey",value:function(i,n){var o=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");var g=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ns||this.options.defaultNS||[],s=o&&i.indexOf(o)>-1,I=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!sWe(i,o,g);if(s&&!I){var r=i.match(this.interpolator.nestingRegexp);if(r&&r.length>0)return{key:i,namespaces:a};var C=i.split(o);(o!==g||o===g&&this.options.ns.indexOf(C[0])>-1)&&(a=C.shift()),i=C.join(g)}return typeof a=="string"&&(a=[a]),{key:i,namespaces:a}}},{key:"translate",value:function(i,n,o){var g=this;if(tc(n)!=="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var a=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,I=this.extractFromKey(i[i.length-1],n),r=I.key,C=I.namespaces,l=C[C.length-1],c=n.lng||this.language,B=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(B){var E=n.nsSeparator||this.options.nsSeparator;return a?(u.res="".concat(l).concat(E).concat(r),u):"".concat(l).concat(E).concat(r)}return a?(u.res=r,u):r}var u=this.resolve(i,n),d=u&&u.res,f=u&&u.usedKey||r,w=u&&u.exactUsedKey||r,y=Object.prototype.toString.apply(d),G=["[object Number]","[object Function]","[object RegExp]"],R=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,F=typeof d!="string"&&typeof d!="boolean"&&typeof d!="number";if(x&&d&&F&&G.indexOf(y)<0&&!(typeof R=="string"&&y==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var Q=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,d,ns(ns({},n),{},{ns:C})):"key '".concat(r," (").concat(this.language,")' returned an object instead of string.");return a?(u.res=Q,u):Q}if(s){var k=y==="[object Array]",h=k?[]:{},N=k?w:f;for(var v in d)if(Object.prototype.hasOwnProperty.call(d,v)){var K="".concat(N).concat(s).concat(v);h[v]=this.translate(K,ns(ns({},n),{joinArrays:!1,ns:C})),h[v]===K&&(h[v]=d[v])}d=h}}else if(x&&typeof R=="string"&&y==="[object Array]")d=d.join(R),d&&(d=this.extendTranslation(d,i,n,o));else{var U=!1,V=!1,X=n.count!==void 0&&typeof n.count!="string",_=t.hasDefaultValue(n),q=X?this.pluralResolver.getSuffix(c,n.count,n):"",$=n["defaultValue".concat(q)]||n.defaultValue;!this.isValidLookup(d)&&_&&(U=!0,d=$),this.isValidLookup(d)||(V=!0,d=r);var nA=n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,j=nA&&V?void 0:d,O=_&&$!==d&&this.options.updateMissing;if(V||U||O){if(this.logger.log(O?"updateKey":"missingKey",c,l,r,O?$:d),s){var eA=this.resolve(r,ns(ns({},n),{},{keySeparator:!1}));eA&&eA.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var oA=[],tA=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&tA&&tA[0])for(var sA=0;sA<tA.length;sA++)oA.push(tA[sA]);else this.options.saveMissingTo==="all"?oA=this.languageUtils.toResolveHierarchy(n.lng||this.language):oA.push(n.lng||this.language);var gA=function(iA,aA,lA){var CA=_&&lA!==d?lA:j;g.options.missingKeyHandler?g.options.missingKeyHandler(iA,l,aA,CA,O,n):g.backendConnector&&g.backendConnector.saveMissing&&g.backendConnector.saveMissing(iA,l,aA,CA,O,n),g.emit("missingKey",iA,l,aA,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&X?oA.forEach(function(iA){g.pluralResolver.getSuffixes(iA,n).forEach(function(aA){gA([iA],r+aA,n["defaultValue".concat(aA)]||$)})}):gA(oA,r,$))}d=this.extendTranslation(d,i,n,u,o),V&&d===r&&this.options.appendNamespaceToMissingKey&&(d="".concat(l,":").concat(r)),(V||U)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(l,":").concat(r):r,U?d:void 0):d=this.options.parseMissingKeyHandler(d))}return a?(u.res=d,u):d}},{key:"extendTranslation",value:function(i,n,o,g,a){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,ns(ns({},this.options.interpolation.defaultVariables),o),g.usedLng,g.usedNS,g.usedKey,{resolved:g});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init(ns(ns({},o),{interpolation:ns(ns({},this.options.interpolation),o.interpolation)}));var I=typeof i=="string"&&(o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),r;if(I){var C=i.match(this.interpolator.nestingRegexp);r=C&&C.length}var l=o.replace&&typeof o.replace!="string"?o.replace:o;if(this.options.interpolation.defaultVariables&&(l=ns(ns({},this.options.interpolation.defaultVariables),l)),i=this.interpolator.interpolate(i,l,o.lng||this.language,o),I){var c=i.match(this.interpolator.nestingRegexp),B=c&&c.length;r<B&&(o.nest=!1)}o.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var d=arguments.length,f=new Array(d),w=0;w<d;w++)f[w]=arguments[w];return a&&a[0]===f[0]&&!o.context?(s.logger.warn("It seems you are nesting recursively key: ".concat(f[0]," in key: ").concat(n[0])),null):s.translate.apply(s,f.concat([n]))},o)),o.interpolation&&this.interpolator.reset()}var E=o.postProcess||this.options.postProcess,u=typeof E=="string"?[E]:E;return i!=null&&u&&u.length&&o.applyPostProcessor!==!1&&(i=pMA.handle(u,i,n,this.options&&this.options.postProcessPassResolved?ns({i18nResolved:g},o):o,this)),i}},{key:"resolve",value:function(i){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g,a,s,I,r;return typeof i=="string"&&(i=[i]),i.forEach(function(C){if(!n.isValidLookup(g)){var l=n.extractFromKey(C,o),c=l.key;a=c;var B=l.namespaces;n.options.fallbackNS&&(B=B.concat(n.options.fallbackNS));var E=o.count!==void 0&&typeof o.count!="string",u=E&&!o.ordinal&&o.count===0&&n.pluralResolver.shouldUseIntlApi(),d=o.context!==void 0&&(typeof o.context=="string"||typeof o.context=="number")&&o.context!=="",f=o.lngs?o.lngs:n.languageUtils.toResolveHierarchy(o.lng||n.language,o.fallbackLng);B.forEach(function(w){n.isValidLookup(g)||(r=w,!yMA["".concat(f[0],"-").concat(w)]&&n.utils&&n.utils.hasLoadedNamespace&&!n.utils.hasLoadedNamespace(r)&&(yMA["".concat(f[0],"-").concat(w)]=!0,n.logger.warn('key "'.concat(a,'" for languages "').concat(f.join(", "),`" won't get resolved as namespace "`).concat(r,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(function(y){if(!n.isValidLookup(g)){I=y;var G=[c];if(n.i18nFormat&&n.i18nFormat.addLookupKeys)n.i18nFormat.addLookupKeys(G,c,y,w,o);else{var R;E&&(R=n.pluralResolver.getSuffix(y,o.count,o));var x="".concat(n.options.pluralSeparator,"zero");if(E&&(G.push(c+R),u&&G.push(c+x)),d){var F="".concat(c).concat(n.options.contextSeparator).concat(o.context);G.push(F),E&&(G.push(F+R),u&&G.push(F+x))}}for(var Q;Q=G.pop();)n.isValidLookup(g)||(s=Q,g=n.getResource(y,w,Q,o))}}))})}}),{res:g,usedKey:a,exactUsedKey:s,usedLng:I,usedNS:r}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,n,o){var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,n,o,g):this.resourceStore.getResource(i,n,o,g)}}],[{key:"hasDefaultValue",value:function(i){var n="defaultValue";for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o)&&n===o.substring(0,n.length)&&i[o]!==void 0)return!0;return!1}}]),t}(xm);function WiA(A){return A.charAt(0).toUpperCase()+A.slice(1)}var BWe=function(){function A(e){WC(this,A),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=AQ.create("languageUtils")}return KC(A,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if(typeof e=="string"&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],i=e.split("-");return this.options.lowerCaseLng?i=i.map(function(n){return n.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=WiA(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=WiA(i[1].toLowerCase())),t.indexOf(i[2].toLowerCase())>-1&&(i[2]=WiA(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t=this;if(!e)return null;var i;return e.forEach(function(n){if(!i){var o=t.formatLanguageCode(n);(!t.options.supportedLngs||t.isSupportedCode(o))&&(i=o)}}),!i&&this.options.supportedLngs&&e.forEach(function(n){if(!i){var o=t.getLanguagePartFromCode(n);if(t.isSupportedCode(o))return i=o;i=t.options.supportedLngs.find(function(g){if(g.indexOf(o)===0)return g})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!t)return e.default||[];var i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}},{key:"toResolveHierarchy",value:function(e,t){var i=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],g=function(a){a&&(i.isSupportedCode(a)?o.push(a):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(a)))};return typeof e=="string"&&e.indexOf("-")>-1?(this.options.load!=="languageOnly"&&g(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&g(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&g(this.getLanguagePartFromCode(e))):typeof e=="string"&&g(this.formatLanguageCode(e)),n.forEach(function(a){o.indexOf(a)<0&&g(i.formatLanguageCode(a))}),o}}]),A}(),QWe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],EWe={1:function(A){return+(A>1)},2:function(A){return+(A!=1)},3:function(A){return 0},4:function(A){return A%10==1&&A%100!=11?0:A%10>=2&&A%10<=4&&(A%100<10||A%100>=20)?1:2},5:function(A){return A==0?0:A==1?1:A==2?2:A%100>=3&&A%100<=10?3:A%100>=11?4:5},6:function(A){return A==1?0:A>=2&&A<=4?1:2},7:function(A){return A==1?0:A%10>=2&&A%10<=4&&(A%100<10||A%100>=20)?1:2},8:function(A){return A==1?0:A==2?1:A!=8&&A!=11?2:3},9:function(A){return+(A>=2)},10:function(A){return A==1?0:A==2?1:A<7?2:A<11?3:4},11:function(A){return A==1||A==11?0:A==2||A==12?1:A>2&&A<20?2:3},12:function(A){return+(A%10!=1||A%100==11)},13:function(A){return+(A!==0)},14:function(A){return A==1?0:A==2?1:A==3?2:3},15:function(A){return A%10==1&&A%100!=11?0:A%10>=2&&(A%100<10||A%100>=20)?1:2},16:function(A){return A%10==1&&A%100!=11?0:A!==0?1:2},17:function(A){return A==1||A%10==1&&A%100!=11?0:1},18:function(A){return A==0?0:A==1?1:2},19:function(A){return A==1?0:A==0||A%100>1&&A%100<11?1:A%100>10&&A%100<20?2:3},20:function(A){return A==1?0:A==0||A%100>0&&A%100<20?1:2},21:function(A){return A%100==1?1:A%100==2?2:A%100==3||A%100==4?3:0},22:function(A){return A==1?0:A==2?1:(A<0||A>10)&&A%10==0?2:3}},uWe=["v1","v2","v3"],wMA={zero:0,one:1,two:2,few:3,many:4,other:5};function dWe(){var A={};return QWe.forEach(function(e){e.lngs.forEach(function(t){A[t]={numbers:e.nr,plurals:EWe[e.fc]}})}),A}var hWe=function(){function A(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};WC(this,A),this.languageUtils=e,this.options=t,this.logger=AQ.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=dWe()}return KC(A,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(e,t);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,i).map(function(n){return"".concat(t).concat(n)})}},{key:"getSuffixes",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,i);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort(function(o,g){return wMA[o]-wMA[g]}).map(function(o){return"".concat(t.options.prepend).concat(o)}):n.numbers.map(function(o){return t.getSuffix(e,o,i)}):[]}},{key:"getSuffix",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=this.getRule(e,i);return n?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(n.select(t)):this.getSuffixRetroCompatible(n,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var i=this,n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[n];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));var g=function(){return i.options.prepend&&o.toString()?i.options.prepend+o.toString():o.toString()};return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?"_plural_".concat(o.toString()):g():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?g():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}},{key:"shouldUseIntlApi",value:function(){return!uWe.includes(this.options.compatibilityJSON)}}]),A}();function DMA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function Cc(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?DMA(Object(t),!0).forEach(function(i){ic(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):DMA(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}var mWe=function(){function A(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};WC(this,A),this.logger=AQ.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return KC(A,[{key:"init",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=t.escape!==void 0?t.escape:gWe,this.escapeValue=t.escapeValue!==void 0?t.escapeValue:!0,this.useRawValueToEscape=t.useRawValueToEscape!==void 0?t.useRawValueToEscape:!1,this.prefix=t.prefix?ck(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?ck(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?ck(t.nestingPrefix):t.nestingPrefixEscaped||ck("$t("),this.nestingSuffix=t.nestingSuffix?ck(t.nestingSuffix):t.nestingSuffixEscaped||ck(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=t.alwaysFormat!==void 0?t.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(e,t,i,n){var o=this,g,a,s,I=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function r(E){return E.replace(/\$/g,"$$$$")}var C=function(E){if(E.indexOf(o.formatSeparator)<0){var u=uMA(t,I,E);return o.alwaysFormat?o.format(u,void 0,i,Cc(Cc(Cc({},n),t),{},{interpolationkey:E})):u}var d=E.split(o.formatSeparator),f=d.shift().trim(),w=d.join(o.formatSeparator).trim();return o.format(uMA(t,I,f),w,i,Cc(Cc(Cc({},n),t),{},{interpolationkey:f}))};this.resetRegExp();var l=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,B=[{regex:this.regexpUnescape,safeValue:function(E){return r(E)}},{regex:this.regexp,safeValue:function(E){return o.escapeValue?r(o.escape(E)):r(E)}}];return B.forEach(function(E){for(s=0;g=E.regex.exec(e);){var u=g[1].trim();if(a=C(u),a===void 0)if(typeof l=="function"){var d=l(e,g,n);a=typeof d=="string"?d:""}else if(n&&n.hasOwnProperty(u))a="";else if(c){a=g[0];continue}else o.logger.warn("missed to pass in variable ".concat(u," for interpolating ").concat(e)),a="";else typeof a!="string"&&!o.useRawValueToEscape&&(a=QMA(a));var f=E.safeValue(a);if(e=e.replace(g[0],f),c?(E.regex.lastIndex+=a.length,E.regex.lastIndex-=g[0].length):E.regex.lastIndex=0,s++,s>=o.maxReplaces)break}}),e}},{key:"nest",value:function(e,t){var i=this,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,g,a=Cc({},n);a.applyPostProcessor=!1,delete a.defaultValue;function s(l,c){var B=this.nestingOptionsSeparator;if(l.indexOf(B)<0)return l;var E=l.split(new RegExp("".concat(B,"[ ]*{"))),u="{".concat(E[1]);l=E[0],u=this.interpolate(u,a);var d=u.match(/'/g),f=u.match(/"/g);(d&&d.length%2===0&&!f||f.length%2!==0)&&(u=u.replace(/'/g,'"'));try{a=JSON.parse(u),c&&(a=Cc(Cc({},c),a))}catch(w){return this.logger.warn("failed parsing options string in nesting for key ".concat(l),w),"".concat(l).concat(B).concat(u)}return delete a.defaultValue,l}for(;o=this.nestingRegexp.exec(e);){var I=[],r=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){var C=o[1].split(this.formatSeparator).map(function(l){return l.trim()});o[1]=C.shift(),I=C,r=!0}if(g=t(s.call(this,o[1].trim(),a),a),g&&o[0]===e&&typeof g!="string")return g;typeof g!="string"&&(g=QMA(g)),g||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(e)),g=""),r&&(g=I.reduce(function(l,c){return i.format(l,c,n.lng,Cc(Cc({},n),{},{interpolationkey:o[1].trim()}))},g.trim())),e=e.replace(o[0],g),this.regexp.lastIndex=0}return e}}]),A}();function GMA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function Fm(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?GMA(Object(t),!0).forEach(function(i){ic(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):GMA(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function pWe(A){var e=A.toLowerCase().trim(),t={};if(A.indexOf("(")>-1){var i=A.split("(");e=i[0].toLowerCase().trim();var n=i[1].substring(0,i[1].length-1);if(e==="currency"&&n.indexOf(":")<0)t.currency||(t.currency=n.trim());else if(e==="relativetime"&&n.indexOf(":")<0)t.range||(t.range=n.trim());else{var o=n.split(";");o.forEach(function(g){if(g){var a=g.split(":"),s=AWe(a),I=s[0],r=s.slice(1),C=r.join(":").trim().replace(/^'+|'+$/g,"");t[I.trim()]||(t[I.trim()]=C),C==="false"&&(t[I.trim()]=!1),C==="true"&&(t[I.trim()]=!0),isNaN(C)||(t[I.trim()]=parseInt(C,10))}})}}return{formatName:e,formatOptions:t}}function Bk(A){var e={};return function(t,i,n){var o=i+JSON.stringify(n),g=e[o];return g||(g=A(i,n),e[o]=g),g(t)}}var fWe=function(){function A(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};WC(this,A),this.logger=AQ.create("formatter"),this.options=e,this.formats={number:Bk(function(t,i){var n=new Intl.NumberFormat(t,i);return function(o){return n.format(o)}}),currency:Bk(function(t,i){var n=new Intl.NumberFormat(t,Fm(Fm({},i),{},{style:"currency"}));return function(o){return n.format(o)}}),datetime:Bk(function(t,i){var n=new Intl.DateTimeFormat(t,Fm({},i));return function(o){return n.format(o)}}),relativetime:Bk(function(t,i){var n=new Intl.RelativeTimeFormat(t,Fm({},i));return function(o){return n.format(o,i.range||"day")}}),list:Bk(function(t,i){var n=new Intl.ListFormat(t,Fm({},i));return function(o){return n.format(o)}})},this.init(e)}return KC(A,[{key:"init",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=t.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=Bk(t)}},{key:"format",value:function(e,t,i,n){var o=this,g=t.split(this.formatSeparator),a=g.reduce(function(s,I){var r=pWe(I),C=r.formatName,l=r.formatOptions;if(o.formats[C]){var c=s;try{var B=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},E=B.locale||B.lng||n.locale||n.lng||i;c=o.formats[C](s,E,Fm(Fm(Fm({},l),n),B))}catch(u){o.logger.warn(u)}return c}else o.logger.warn("there was no format function for ".concat(C));return s},e);return a}}]),A}();function kMA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function JMA(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kMA(Object(t),!0).forEach(function(i){ic(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):kMA(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function yWe(A){var e=bWe();return function(){var t=$B(A),i;if(e){var n=$B(this).constructor;i=Reflect.construct(t,arguments,n)}else i=t.apply(this,arguments);return BF(this,i)}}function bWe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wWe(A,e){A.pending[e]!==void 0&&(delete A.pending[e],A.pendingCount--)}var DWe=function(A){JV(t,A);var e=yWe(t);function t(i,n,o){var g,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return WC(this,t),g=e.call(this),YV&&xm.call(Rm(g)),g.backend=i,g.store=n,g.services=o,g.languageUtils=o.languageUtils,g.options=a,g.logger=AQ.create("backendConnector"),g.waitingReads=[],g.maxParallelReads=a.maxParallelReads||10,g.readingCalls=0,g.maxRetries=a.maxRetries>=0?a.maxRetries:5,g.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,g.state={},g.queue=[],g.backend&&g.backend.init&&g.backend.init(o,a.backend,a),g}return KC(t,[{key:"queueLoad",value:function(i,n,o,g){var a=this,s={},I={},r={},C={};return i.forEach(function(l){var c=!0;n.forEach(function(B){var E="".concat(l,"|").concat(B);!o.reload&&a.store.hasResourceBundle(l,B)?a.state[E]=2:a.state[E]<0||(a.state[E]===1?I[E]===void 0&&(I[E]=!0):(a.state[E]=1,c=!1,I[E]===void 0&&(I[E]=!0),s[E]===void 0&&(s[E]=!0),C[B]===void 0&&(C[B]=!0)))}),c||(r[l]=!0)}),(Object.keys(s).length||Object.keys(I).length)&&this.queue.push({pending:I,pendingCount:Object.keys(I).length,loaded:{},errors:[],callback:g}),{toLoad:Object.keys(s),pending:Object.keys(I),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(C)}}},{key:"loaded",value:function(i,n,o){var g=i.split("|"),a=g[0],s=g[1];n&&this.emit("failedLoading",a,s,n),o&&this.store.addResourceBundle(a,s,o),this.state[i]=n?-1:2;var I={};this.queue.forEach(function(r){nWe(r.loaded,[a],s),wWe(r,i),n&&r.errors.push(n),r.pendingCount===0&&!r.done&&(Object.keys(r.loaded).forEach(function(C){I[C]||(I[C]={});var l=r.loaded[C];l.length&&l.forEach(function(c){I[C][c]===void 0&&(I[C][c]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",I),this.queue=this.queue.filter(function(r){return!r.done})}},{key:"read",value:function(i,n,o){var g=this,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,I=arguments.length>5?arguments[5]:void 0;if(!i.length)return I(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:n,fcName:o,tried:a,wait:s,callback:I});return}return this.readingCalls++,this.backend[o](i,n,function(r,C){if(g.readingCalls--,g.waitingReads.length>0){var l=g.waitingReads.shift();g.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}if(r&&C&&a<g.maxRetries){setTimeout(function(){g.read.call(g,i,n,o,a+1,s*2,I)},s);return}I(r,C)})}},{key:"prepareLoading",value:function(i,n){var o=this,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof n=="string"&&(n=[n]);var s=this.queueLoad(i,n,g,a);if(!s.toLoad.length)return s.pending.length||a(),null;s.toLoad.forEach(function(I){o.loadOne(I)})}},{key:"load",value:function(i,n,o){this.prepareLoading(i,n,{},o)}},{key:"reload",value:function(i,n,o){this.prepareLoading(i,n,{reload:!0},o)}},{key:"loadOne",value:function(i){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",g=i.split("|"),a=g[0],s=g[1];this.read(a,s,"read",void 0,void 0,function(I,r){I&&n.logger.warn("".concat(o,"loading namespace ").concat(s," for language ").concat(a," failed"),I),!I&&r&&n.logger.log("".concat(o,"loaded namespace ").concat(s," for language ").concat(a),r),n.loaded(i,I,r)})}},{key:"saveMissing",value:function(i,n,o,g,a){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}o==null||o===""||(this.backend&&this.backend.create&&this.backend.create(i,n,o,g,null,JMA(JMA({},s),{},{isUpdate:a})),!(!i||!i[0])&&this.store.addResource(i[0],n,o,g))}}]),t}(xm);function GWe(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(A){var e={};if(tc(A[1])==="object"&&(e=A[1]),typeof A[1]=="string"&&(e.defaultValue=A[1]),typeof A[2]=="string"&&(e.tDescription=A[2]),tc(A[2])==="object"||tc(A[3])==="object"){var t=A[3]||A[2];Object.keys(t).forEach(function(i){e[i]=t[i]})}return e},interpolation:{escapeValue:!0,format:function(A,e,t,i){return A},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function NMA(A){return typeof A.ns=="string"&&(A.ns=[A.ns]),typeof A.fallbackLng=="string"&&(A.fallbackLng=[A.fallbackLng]),typeof A.fallbackNS=="string"&&(A.fallbackNS=[A.fallbackNS]),A.supportedLngs&&A.supportedLngs.indexOf("cimode")<0&&(A.supportedLngs=A.supportedLngs.concat(["cimode"])),A}function YMA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function eQ(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?YMA(Object(t),!0).forEach(function(i){ic(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):YMA(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function kWe(A){var e=JWe();return function(){var t=$B(A),i;if(e){var n=$B(this).constructor;i=Reflect.construct(t,arguments,n)}else i=t.apply(this,arguments);return BF(this,i)}}function JWe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xV(){}function NWe(A){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(A));e.forEach(function(t){typeof A[t]=="function"&&(A[t]=A[t].bind(A))})}var FV=function(A){JV(t,A);var e=kWe(t);function t(){var i,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(WC(this,t),i=e.call(this),YV&&xm.call(Rm(i)),i.options=NMA(n),i.services={},i.logger=AQ,i.modules={external:[]},NWe(Rm(i)),o&&!i.isInitialized&&!n.isClone){if(!i.options.initImmediate)return i.init(n,o),BF(i,Rm(i));setTimeout(function(){i.init(n,o)},0)}return i}return KC(t,[{key:"init",value:function(){var i=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(o=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));var g=GWe();this.options=eQ(eQ(eQ({},g),this.options),NMA(n)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=eQ(eQ({},g.interpolation),this.options.interpolation)),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function a(u){return u?typeof u=="function"?new u:u:null}if(!this.options.isClone){this.modules.logger?AQ.init(a(this.modules.logger),this.options):AQ.init(null,this.options);var s;this.modules.formatter?s=this.modules.formatter:typeof Intl<"u"&&(s=fWe);var I=new BWe(this.options);this.store=new CWe(this.options.resources,this.options);var r=this.services;r.logger=AQ,r.resourceStore=this.store,r.languageUtils=I,r.pluralResolver=new hWe(I,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s&&(!this.options.interpolation.format||this.options.interpolation.format===g.interpolation.format)&&(r.formatter=a(s),r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new mWe(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new DWe(a(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",function(u){for(var d=arguments.length,f=new Array(d>1?d-1:0),w=1;w<d;w++)f[w-1]=arguments[w];i.emit.apply(i,[u].concat(f))}),this.modules.languageDetector&&(r.languageDetector=a(this.modules.languageDetector),r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=a(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new bMA(this.services,this.options),this.translator.on("*",function(u){for(var d=arguments.length,f=new Array(d>1?d-1:0),w=1;w<d;w++)f[w-1]=arguments[w];i.emit.apply(i,[u].concat(f))}),this.modules.external.forEach(function(u){u.init&&u.init(i)})}if(this.format=this.options.interpolation.format,o||(o=xV),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var C=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);C.length>0&&C[0]!=="dev"&&(this.options.lng=C[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var l=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach(function(u){i[u]=function(){var d;return(d=i.store)[u].apply(d,arguments)}});var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach(function(u){i[u]=function(){var d;return(d=i.store)[u].apply(d,arguments),i}});var B=QF(),E=function(){var u=function(d,f){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),B.resolve(f),o(d,f)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return u(null,i.t.bind(i));i.changeLanguage(i.options.lng,u)};return this.options.resources||!this.options.initImmediate?E():setTimeout(E,0),B}},{key:"loadResources",value:function(i){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xV,g=o,a=typeof i=="string"?i:this.language;if(typeof i=="function"&&(g=i),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode")return g();var s=[],I=function(C){if(C){var l=n.services.languageUtils.toResolveHierarchy(C);l.forEach(function(c){s.indexOf(c)<0&&s.push(c)})}};if(a)I(a);else{var r=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);r.forEach(function(C){return I(C)})}this.options.preload&&this.options.preload.forEach(function(C){return I(C)}),this.services.backendConnector.load(s,this.options.ns,function(C){!C&&!n.resolvedLanguage&&n.language&&n.setResolvedLanguage(n.language),g(C)})}else g(null)}},{key:"reloadResources",value:function(i,n,o){var g=QF();return i||(i=this.languages),n||(n=this.options.ns),o||(o=xV),this.services.backendConnector.reload(i,n,function(a){g.resolve(),o(a)}),g}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&pMA.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var n=0;n<this.languages.length;n++){var o=this.languages[n];if(!(["cimode","dev"].indexOf(o)>-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}}},{key:"changeLanguage",value:function(i,n){var o=this;this.isLanguageChangingTo=i;var g=QF();this.emit("languageChanging",i);var a=function(r){o.language=r,o.languages=o.services.languageUtils.toResolveHierarchy(r),o.resolvedLanguage=void 0,o.setResolvedLanguage(r)},s=function(r,C){C?(a(C),o.translator.changeLanguage(C),o.isLanguageChangingTo=void 0,o.emit("languageChanged",C),o.logger.log("languageChanged",C)):o.isLanguageChangingTo=void 0,g.resolve(function(){return o.t.apply(o,arguments)}),n&&n(r,function(){return o.t.apply(o,arguments)})},I=function(r){!i&&!r&&o.services.languageDetector&&(r=[]);var C=typeof r=="string"?r:o.services.languageUtils.getBestMatchFromCodes(r);C&&(o.language||a(C),o.translator.language||o.translator.changeLanguage(C),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage(C)),o.loadResources(C,function(l){s(l,C)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?I(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(I):I(i),g}},{key:"getFixedT",value:function(i,n,o){var g=this,a=function s(I,r){var C;if(tc(r)!=="object"){for(var l=arguments.length,c=new Array(l>2?l-2:0),B=2;B<l;B++)c[B-2]=arguments[B];C=g.options.overloadTranslationOptionHandler([I,r].concat(c))}else C=eQ({},r);C.lng=C.lng||s.lng,C.lngs=C.lngs||s.lngs,C.ns=C.ns||s.ns,C.keyPrefix=C.keyPrefix||o||s.keyPrefix;var E=g.options.keySeparator||".",u=C.keyPrefix?"".concat(C.keyPrefix).concat(E).concat(I):I;return g.t(u,C)};return typeof i=="string"?a.lng=i:a.lngs=i,a.ns=n,a.keyPrefix=o,a}},{key:"t",value:function(){var i;return this.translator&&(i=this.translator).translate.apply(i,arguments)}},{key:"exists",value:function(){var i;return this.translator&&(i=this.translator).exists.apply(i,arguments)}},{key:"setDefaultNamespace",value:function(i){this.options.defaultNS=i}},{key:"hasLoadedNamespace",value:function(i){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var g=this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(g.toLowerCase()==="cimode")return!0;var I=function(C,l){var c=n.services.backendConnector.state["".concat(C,"|").concat(l)];return c===-1||c===2};if(o.precheck){var r=o.precheck(this,I);if(r!==void 0)return r}return!!(this.hasResourceBundle(g,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||I(g,i)&&(!a||I(s,i)))}},{key:"loadNamespaces",value:function(i,n){var o=this,g=QF();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(a){o.options.ns.indexOf(a)<0&&o.options.ns.push(a)}),this.loadResources(function(a){g.resolve(),n&&n(a)}),g):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function(i,n){var o=QF();typeof i=="string"&&(i=[i]);var g=this.options.preload||[],a=i.filter(function(s){return g.indexOf(s)<0});return a.length?(this.options.preload=g.concat(a),this.loadResources(function(s){o.resolve(),n&&n(s)}),o):(n&&n(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return n.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xV,g=eQ(eQ(eQ({},this.options),n),{isClone:!0}),a=new t(g);(n.debug!==void 0||n.prefix!==void 0)&&(a.logger=a.logger.clone(n));var s=["store","services","language"];return s.forEach(function(I){a[I]=i[I]}),a.services=eQ({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new bMA(a.services,a.options),a.translator.on("*",function(I){for(var r=arguments.length,C=new Array(r>1?r-1:0),l=1;l<r;l++)C[l-1]=arguments[l];a.emit.apply(a,[I].concat(C))}),a.init(g,o),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),t}(xm);ic(FV,"createInstance",function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new FV(A,e)});var os=FV.createInstance();os.createInstance=FV.createInstance,os.createInstance,os.init,os.loadResources,os.reloadResources,os.use,os.changeLanguage,os.getFixedT,os.t,os.exists,os.setDefaultNamespace,os.hasLoadedNamespace,os.loadNamespaces,os.loadLanguages;const Qk=os,no="gw_count_fid",YWe=["year","quarter","month","week","day","hour","minute","second","iso_year","iso_week"],RWe=["year","quarter","month","week","weekday","day","hour","minute","second","iso_year","iso_week","iso_weekday"],fi="gw_mea_key_fid",yi="gw_mea_val_fid",In="gw_paint_fid";function RMA(A){var e,t,i="";if(typeof A=="string"||typeof A=="number")i+=A;else if(typeof A=="object")if(Array.isArray(A)){var n=A.length;for(e=0;e<n;e++)A[e]&&(t=RMA(A[e]))&&(i&&(i+=" "),i+=t)}else for(t in A)A[t]&&(i&&(i+=" "),i+=t);return i}function xWe(){for(var A,e,t=0,i="",n=arguments.length;t<n;t++)(A=arguments[t])&&(e=RMA(A))&&(i&&(i+=" "),i+=e);return i}const KiA="-";function FWe(A){const e=vWe(A),{conflictingClassGroups:t,conflictingClassGroupModifiers:i}=A;function n(g){const a=g.split(KiA);return a[0]===""&&a.length!==1&&a.shift(),xMA(a,e)||MWe(g)}function o(g,a){const s=t[g]||[];return a&&i[g]?[...s,...i[g]]:s}return{getClassGroupId:n,getConflictingClassGroupIds:o}}function xMA(A,e){var t;if(A.length===0)return e.classGroupId;const i=A[0],n=e.nextPart.get(i),o=n?xMA(A.slice(1),n):void 0;if(o)return o;if(e.validators.length===0)return;const g=A.join(KiA);return(t=e.validators.find(({validator:a})=>a(g)))==null?void 0:t.classGroupId}const FMA=/^\[(.+)\]$/;function MWe(A){if(FMA.test(A)){const e=FMA.exec(A)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function vWe(A){const{theme:e,prefix:t}=A,i={nextPart:new Map,validators:[]};return SWe(Object.entries(A.classGroups),t).forEach(([n,o])=>{UiA(o,i,n,e)}),i}function UiA(A,e,t,i){A.forEach(n=>{if(typeof n=="string"){const o=n===""?e:MMA(e,n);o.classGroupId=t;return}if(typeof n=="function"){if(LWe(n)){UiA(n(i),e,t,i);return}e.validators.push({validator:n,classGroupId:t});return}Object.entries(n).forEach(([o,g])=>{UiA(g,MMA(e,o),t,i)})})}function MMA(A,e){let t=A;return e.split(KiA).forEach(i=>{t.nextPart.has(i)||t.nextPart.set(i,{nextPart:new Map,validators:[]}),t=t.nextPart.get(i)}),t}function LWe(A){return A.isThemeGetter}function SWe(A,e){return e?A.map(([t,i])=>{const n=i.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([g,a])=>[e+g,a])):o);return[t,n]}):A}function HWe(A){if(A<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,i=new Map;function n(o,g){t.set(o,g),e++,e>A&&(e=0,i=t,t=new Map)}return{get(o){let g=t.get(o);if(g!==void 0)return g;if((g=i.get(o))!==void 0)return n(o,g),g},set(o,g){t.has(o)?t.set(o,g):n(o,g)}}}const vMA="!";function ZWe(A){const e=A.separator,t=e.length===1,i=e[0],n=e.length;return function(o){const g=[];let a=0,s=0,I;for(let B=0;B<o.length;B++){let E=o[B];if(a===0){if(E===i&&(t||o.slice(B,B+n)===e)){g.push(o.slice(s,B)),s=B+n;continue}if(E==="/"){I=B;continue}}E==="["?a++:E==="]"&&a--}const r=g.length===0?o:o.substring(s),C=r.startsWith(vMA),l=C?r.substring(1):r,c=I&&I>s?I-s:void 0;return{modifiers:g,hasImportantModifier:C,baseClassName:l,maybePostfixModifierPosition:c}}}function WWe(A){if(A.length<=1)return A;const e=[];let t=[];return A.forEach(i=>{i[0]==="["?(e.push(...t.sort(),i),t=[]):t.push(i)}),e.push(...t.sort()),e}function KWe(A){return{cache:HWe(A.cacheSize),splitModifiers:ZWe(A),...FWe(A)}}const UWe=/\s+/;function VWe(A,e){const{splitModifiers:t,getClassGroupId:i,getConflictingClassGroupIds:n}=e,o=new Set;return A.trim().split(UWe).map(g=>{const{modifiers:a,hasImportantModifier:s,baseClassName:I,maybePostfixModifierPosition:r}=t(g);let C=i(r?I.substring(0,r):I),l=!!r;if(!C){if(!r)return{isTailwindClass:!1,originalClassName:g};if(C=i(I),!C)return{isTailwindClass:!1,originalClassName:g};l=!1}const c=WWe(a).join(":");return{isTailwindClass:!0,modifierId:s?c+vMA:c,classGroupId:C,originalClassName:g,hasPostfixModifier:l}}).reverse().filter(g=>{if(!g.isTailwindClass)return!0;const{modifierId:a,classGroupId:s,hasPostfixModifier:I}=g,r=a+s;return o.has(r)?!1:(o.add(r),n(s,I).forEach(C=>o.add(a+C)),!0)}).reverse().map(g=>g.originalClassName).join(" ")}function XWe(){let A=0,e,t,i="";for(;A<arguments.length;)(e=arguments[A++])&&(t=LMA(e))&&(i&&(i+=" "),i+=t);return i}function LMA(A){if(typeof A=="string")return A;let e,t="";for(let i=0;i<A.length;i++)A[i]&&(e=LMA(A[i]))&&(t&&(t+=" "),t+=e);return t}function zWe(A,...e){let t,i,n,o=g;function g(s){const I=e.reduce((r,C)=>C(r),A());return t=KWe(I),i=t.cache.get,n=t.cache.set,o=a,a(s)}function a(s){const I=i(s);if(I)return I;const r=VWe(s,t);return n(s,r),r}return function(){return o(XWe.apply(null,arguments))}}function pn(A){const e=t=>t[A]||[];return e.isThemeGetter=!0,e}const SMA=/^\[(?:([a-z-]+):)?(.+)\]$/i,TWe=/^\d+\/\d+$/,_We=new Set(["px","full","screen"]),OWe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qWe=/\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$/,jWe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,PWe=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$We=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Ku(A){return by(A)||_We.has(A)||TWe.test(A)}function Mm(A){return Ek(A,"length",a3e)}function by(A){return!!A&&!Number.isNaN(Number(A))}function MV(A){return Ek(A,"number",by)}function EF(A){return!!A&&Number.isInteger(Number(A))}function A3e(A){return A.endsWith("%")&&by(A.slice(0,-1))}function Et(A){return SMA.test(A)}function vm(A){return OWe.test(A)}const e3e=new Set(["length","size","percentage"]);function t3e(A){return Ek(A,e3e,HMA)}function i3e(A){return Ek(A,"position",HMA)}const n3e=new Set(["image","url"]);function o3e(A){return Ek(A,n3e,r3e)}function g3e(A){return Ek(A,"",s3e)}function uF(){return!0}function Ek(A,e,t){const i=SMA.exec(A);return i?i[1]?typeof e=="string"?i[1]===e:e.has(i[1]):t(i[2]):!1}function a3e(A){return qWe.test(A)&&!jWe.test(A)}function HMA(){return!1}function s3e(A){return PWe.test(A)}function r3e(A){return $We.test(A)}function I3e(){const A=pn("colors"),e=pn("spacing"),t=pn("blur"),i=pn("brightness"),n=pn("borderColor"),o=pn("borderRadius"),g=pn("borderSpacing"),a=pn("borderWidth"),s=pn("contrast"),I=pn("grayscale"),r=pn("hueRotate"),C=pn("invert"),l=pn("gap"),c=pn("gradientColorStops"),B=pn("gradientColorStopPositions"),E=pn("inset"),u=pn("margin"),d=pn("opacity"),f=pn("padding"),w=pn("saturate"),y=pn("scale"),G=pn("sepia"),R=pn("skew"),x=pn("space"),F=pn("translate"),Q=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],h=()=>["auto",Et,e],N=()=>[Et,e],v=()=>["",Ku,Mm],K=()=>["auto",by,Et],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],_=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",Et],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],nA=()=>[by,MV],j=()=>[by,Et];return{cacheSize:500,separator:":",theme:{colors:[uF],spacing:[Ku,Mm],blur:["none","",vm,Et],brightness:nA(),borderColor:[A],borderRadius:["none","","full",vm,Et],borderSpacing:N(),borderWidth:v(),contrast:nA(),grayscale:q(),hueRotate:j(),invert:q(),gap:N(),gradientColorStops:[A],gradientColorStopPositions:[A3e,Mm],inset:h(),margin:h(),opacity:nA(),padding:N(),saturate:nA(),scale:nA(),sepia:q(),skew:j(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",Et]}],container:["container"],columns:[{columns:[vm]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),Et]}],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:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",EF,Et]}],basis:[{basis:h()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Et]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",EF,Et]}],"grid-cols":[{"grid-cols":[uF]}],"col-start-end":[{col:["auto",{span:["full",EF,Et]},Et]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[uF]}],"row-start-end":[{row:["auto",{span:[EF,Et]},Et]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Et]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Et]}],gap:[{gap:[l]}],"gap-x":[{"gap-x":[l]}],"gap-y":[{"gap-y":[l]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],mt:[{mt:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[x]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[x]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Et,e]}],"min-w":[{"min-w":[Et,e,"min","max","fit"]}],"max-w":[{"max-w":[Et,e,"none","full","min","max","fit","prose",{screen:[vm]},vm]}],h:[{h:[Et,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Et,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Et,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Et,e,"auto","min","max","fit"]}],"font-size":[{text:["base",vm,Mm]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",MV]}],"font-family":[{font:[uF]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Et]}],"line-clamp":[{"line-clamp":["none",by,MV]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ku,Et]}],"list-image":[{"list-image":["none",Et]}],"list-style-type":[{list:["none","disc","decimal",Et]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[A]}],"placeholder-opacity":[{"placeholder-opacity":[d]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[A]}],"text-opacity":[{"text-opacity":[d]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ku,Mm]}],"underline-offset":[{"underline-offset":["auto",Ku,Et]}],"text-decoration-color":[{decoration:[A]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Et]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Et]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[d]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),i3e]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",t3e]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},o3e]}],"bg-color":[{bg:[A]}],"gradient-from-pos":[{from:[B]}],"gradient-via-pos":[{via:[B]}],"gradient-to-pos":[{to:[B]}],"gradient-from":[{from:[c]}],"gradient-via":[{via:[c]}],"gradient-to":[{to:[c]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[d]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[d]}],"divide-style":[{divide:V()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[Ku,Et]}],"outline-w":[{outline:[Ku,Mm]}],"outline-color":[{outline:[A]}],"ring-w":[{ring:v()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[A]}],"ring-opacity":[{"ring-opacity":[d]}],"ring-offset-w":[{"ring-offset":[Ku,Mm]}],"ring-offset-color":[{"ring-offset":[A]}],shadow:[{shadow:["","inner","none",vm,g3e]}],"shadow-color":[{shadow:[uF]}],opacity:[{opacity:[d]}],"mix-blend":[{"mix-blend":X()}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[i]}],contrast:[{contrast:[s]}],"drop-shadow":[{"drop-shadow":["","none",vm,Et]}],grayscale:[{grayscale:[I]}],"hue-rotate":[{"hue-rotate":[r]}],invert:[{invert:[C]}],saturate:[{saturate:[w]}],sepia:[{sepia:[G]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[s]}],"backdrop-grayscale":[{"backdrop-grayscale":[I]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[r]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[d]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[G]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[g]}],"border-spacing-x":[{"border-spacing-x":[g]}],"border-spacing-y":[{"border-spacing-y":[g]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Et]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",Et]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",Et]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[EF,Et]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Et]}],accent:[{accent:["auto",A]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Et]}],"caret-color":[{caret:[A]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",Et]}],fill:[{fill:[A,"none"]}],"stroke-w":[{stroke:[Ku,Mm,MV]}],stroke:[{stroke:[A,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const C3e=zWe(I3e);function l3e(A,e){return A.filter(t=>e.every(i=>i.type==="continuous"?t[i.key]>=i.range[0]&&t[i.key]<=i.range[1]:i.range.has(t[i.key])))}function c3e(){return{fid:no,name:Qk.t("constant.row_count"),analyticType:"measure",semanticType:"quantitative",aggName:"sum",computed:!0,expression:{op:"one",params:[],as:no}}}function B3e(){return[{fid:fi,name:Qk.t("constant.mea_key"),analyticType:"dimension",semanticType:"nominal"},{fid:yi,name:Qk.t("constant.mea_val"),analyticType:"measure",semanticType:"quantitative",aggName:"sum"}]}function EI(A){return A.fid}function lc(...A){return A.filter(Boolean).join(" ")}function wy(A,e){return!e||e==="expr"?A:`${e}(${A})`}function Fo(A,e){return!e||e==="expr"?A:`${A}_${e}`}function Dy(A){return A.enableAgg&&A.aggName?Fo(A.fid,A.aggName):A.fid}function uk({rows:A,columns:e}){return A.length&&!A.find(t=>t.analyticType==="measure")?A[A.length-1].sort||"none":e.length&&!e.find(t=>t.analyticType==="measure")&&e[e.length-1].sort||"none"}function ZMA({rows:A,columns:e}){return A.length&&!A.find(t=>t.analyticType==="measure")?"row":e.length&&!e.find(t=>t.analyticType==="measure")?"column":"none"}function dk(A){return A instanceof Error?A.message:typeof A=="string"?A:String(A)}const Uu=A=>{if(!A)return"null";const e=A.getFullYear(),t=A.getMonth()+1,i=A.getDate(),n=A.getHours(),o=A.getMinutes(),g=A.getSeconds(),a=s=>`${s}`.padStart(2,"0");return`${e}-${a(t)}-${a(i)} ${a(n)}:${a(o)}:${a(g)}`},xi=A=>A!=null;function Q3e(A){let e=A.value;return A.regexp||(e=e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")),A.word&&(e=`\\b${e}\\b`),new RegExp(e,A.caseSenstive?"":"i")}function E3e(A,e,t){if(A.length===0)throw new Error("there is no item in arr.");let i=0,n=A.length-1,o=A[0];for(;i<=n;){const g=Math.floor((i+n)/2),a=A[g],s=t(a);if((o===null||Math.abs(s-e)<Math.abs(t(o)-e))&&(o=a),s===e)return a;s<e?i=g+1:n=g-1}return o}function ViA(A){Promise.resolve().then(A)}function Ce(...A){return C3e(xWe(A))}function tQ(A){return typeof A=="object"?JSON.stringify(A):A}function WMA(A,e){if(A.length!==e.length)return!1;for(let t=0;t<A.length;t++)if(A[t]!==e[t])return!1;return!0}const dF=p.forwardRef(({className:A,...e},t)=>p.createElement(kV,{ref:t,className:Ce("relative flex w-full touch-none select-none items-center",A),...e},p.createElement(CMA,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20"},p.createElement(lMA,{className:"absolute h-full bg-primary"})),p.createElement(HiA,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})));dF.displayName=kV.displayName;const u3e=A=>{const{onWidthChange:e,onHeightChange:t,width:i,height:n,children:o}=A,{t:g}=ve("translation",{keyPrefix:"main.tabpanel.settings.size_setting"}),[a,s]=xiA(i,e),[I,r]=xiA(n,t),C=p.useMemo(()=>[Math.sqrt(a/1e3)],[a]),l=p.useMemo(()=>[Math.sqrt(I/1e3)],[I]);return b.createElement("div",{className:"w-60 p-2"},o,b.createElement("div",{className:"mt-4"},b.createElement(dF,{min:0,max:1,step:.01,name:"width",className:"w-full",onValueChange:([c])=>s(Math.round(c**2*1e3)),value:C}),b.createElement("div",{className:"ml-1 mt-1 text-xs"},`${g("width")}: ${a}`)),b.createElement("div",{className:"mt-4"},b.createElement(dF,{min:0,max:1,step:.01,name:"height",className:"w-full",onValueChange:([c])=>r(Math.round(c**2*1e3)),value:l}),b.createElement("div",{className:"ml-1 mt-1 text-xs"}," ",`${g("height")}: ${I}`)))},d3e={generic:["auto","bar","line","area","trail","point","circle","tick","rect","arc","text","boxplot","table"],geographic:["poi","choropleth"]},h3e=["generic","geographic"],m3e=["none","stack","normalize","center"],p3e=["auto","fixed","full"],f3e={rows:1/0,columns:1/0,color:1,opacity:1,size:1,shape:1,theta:1,radius:1,details:1/0,text:1},y3e=["dimensions","measures"],b3e=["x","y"],w3e=["color","opacity","shape","size"],D3e=["sum","mean","median","count","min","max","variance","stdev"],G3e=["data_interpretation","data_view"],k3e=["vega-lite","observable-plot"],ke={AGGREGATOR_LIST:D3e,CHART_LAYOUT_TYPE:p3e,COORD_TYPES:h3e,GEOM_TYPES:d3e,MAX_HISTORY_SIZE:20,STACK_MODE:m3e,META_FIELD_KEYS:y3e,CHANNEL_LIMIT:f3e,POSITION_CHANNEL_CONFIG_LIST:b3e,NON_POSITION_CHANNEL_CONFIG_LIST:w3e,EMBEDED_MENU_LIST:G3e,RENDERER_TYPES:k3e,PAINT_MAP_SIZE:128,PAINT_SIZE_FACTOR:4,PAINT_MIN_BRUSH_SIZE:1,PAINT_DEFAULT_BRUSH_SIZE:9,PAINT_MAX_BRUSH_SIZE:36,KEYWORD_DEBOUNCE_SETTING:{timeout:300,leading:!0,trailing:!0}};function J3e(){return{dimensions:[],measures:[],rows:[],columns:[],color:[],opacity:[],size:[],shape:[],radius:[],theta:[],longitude:[],latitude:[],geoId:[],details:[],filters:[],text:[]}}function N3e(){const[A]=ke.GEOM_TYPES.generic;return{defaultAggregated:!0,geoms:[A],showTableSummary:!1,coordSystem:"generic",stack:"stack",showActions:!1,interactiveScale:!1,sorted:"none",zeroScale:!0,scaleIncludeUnmatchedChoropleth:!1,background:void 0,size:{mode:"auto",width:320,height:200},format:{numberFormat:void 0,timeFormat:void 0,normalizedNumberFormat:void 0},geoKey:"name",resolve:{x:!1,y:!1,color:!1,opacity:!1,shape:!1,size:!1},limit:-1}}const KMA={showActions:!1,showTableSummary:!1,stack:"stack",interactiveScale:!1,zeroScale:!0,background:void 0,size:{mode:"auto",width:320,height:200},format:{numberFormat:void 0,timeFormat:void 0,normalizedNumberFormat:void 0},geoKey:"name",resolve:{x:!1,y:!1,color:!1,opacity:!1,shape:!1,size:!1},renderer:"vega-lite"},XiA={defaultAggregated:!0,geoms:[ke.GEOM_TYPES.generic[0]],coordSystem:"generic",limit:-1},ziA={dimensions:[],measures:[],rows:[],columns:[],color:[],opacity:[],size:[],shape:[],radius:[],theta:[],longitude:[],latitude:[],geoId:[],details:[],filters:[],text:[]};function UMA(A){return{...A,encodings:{...J3e(),...A.encodings}}}const VMA=A=>({...A,config:{...N3e(),...A.config}});function Y3e(A,e,t){var i=new Blob([A],{type:t});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(i,e);else{var n=document.createElement("a"),o=URL.createObjectURL(i);n.href=o,n.download=e,document.body.appendChild(n),n.click(),setTimeout(function(){document.body.removeChild(n),window.URL.revokeObjectURL(o)},0)}}function R3e(A,e){if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(A,e);else{var t=document.createElement("a"),i=URL.createObjectURL(A);t.href=i,t.download=e,document.body.appendChild(t),t.click(),setTimeout(function(){document.body.removeChild(t),window.URL.revokeObjectURL(i)},0)}}let XMA=(A=21)=>crypto.getRandomValues(new Uint8Array(A)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");function VC(){return"gw_"+XMA(4)}const vV=(A,e,t)=>t===A.length?A.concat([e]):A.flatMap((i,n)=>n===t?[e,i]:[i]),zMA=(A,e)=>A.filter((t,i)=>i!==e),Lm=(A,e,t)=>A.map((i,n)=>n===e?t(i):i);function jt(A,e,t){const i=(n,o,g)=>{const[a,...s]=o;return s.length===0?{...n,[a]:g(n[a])}:{...n,[a]:i(n[a],s,g)}};return i(A,e.split("."),t)}const TiA=A=>Math.floor(Math.sqrt(2*A));function x3e(A){return(e,t)=>{const{base:i,cache:n,cursor:o,now:g,timeline:a}=e;return{base:i,now:A(g,t),cursor:o+1,cache:o-n.cursor>TiA(o)?{value:A(n.value,a[n.cursor]),cursor:n.cursor+1}:n,timeline:a.slice(0,o).concat([t])}}}function F3e(A){return e=>{const{base:t,cache:i,cursor:n,timeline:o}=e,g=n-1;if(g<0)return e;const a=g<i.cursor,s=a?Math.max(0,g-TiA(g)):i.cursor,I=a?o.slice(0,s).reduce(A,t):i.value;return{base:t,now:o.slice(s,g).reduce(A,I),cache:a?{value:I,cursor:s}:i,cursor:g,timeline:o}}}function M3e(A){return e=>{const{base:t,cache:i,cursor:n,now:o,timeline:g}=e;return n===g.length?e:{base:t,now:A(o,g[n]),cursor:n+1,cache:n-i.cursor>TiA(n)?{value:A(i.value,g[i.cursor]),cursor:i.cursor+1}:i,timeline:g}}}function v3e(A){return(e,t)=>t>e.cursor?e.now:t>e.cache.cursor?e.timeline.slice(e.cache.cursor,t).reduce(A,e.cache.value):e.timeline.slice(0,t).reduce(A,e.base)}function TMA(A){return{base:A,cursor:0,cache:{value:A,cursor:0},now:A,timeline:[]}}const iQ={measureAfterDimension(A){return A.filter(e=>e.analyticType==="dimension").concat(A.filter(e=>e.analyticType==="measure"))},crossLimit(A){return function(e){let t=0;return e.reduce((i,n)=>(n.analyticType==="dimension"&&t<A&&(i.push(n),t++),n.analyticType==="measure"&&i.push(n),i),[])}},forceAnalyticType(A){return function(e){return e.map(t=>({...t,analyticType:A}))}},forceSemanticType(A){return function(e){return e.map(t=>({...t,semanticType:A}))}}};function LV(A,e){return e.reduce((t,i)=>i(t),A)}function _MA(A,e){const t={};return e.rows&&e.rows.length>0&&(t.rows=LV(e.rows,[iQ.measureAfterDimension,iQ.crossLimit(A==="table"?1/0:2)])),e.columns&&e.columns.length>0&&(t.columns=LV(e.columns,[iQ.measureAfterDimension,iQ.crossLimit(A==="table"?1/0:2)])),e.latitude&&e.latitude.length>0&&(t.latitude=LV(e.latitude,[iQ.forceAnalyticType("dimension"),iQ.forceSemanticType("quantitative"),iQ.crossLimit(1)])),e.longitude&&e.longitude.length>0&&(t.longitude=LV(e.longitude,[iQ.forceAnalyticType("dimension"),iQ.forceSemanticType("quantitative"),iQ.crossLimit(1)])),t}var hF={},OMA={exports:{}},qMA;function L3e(){return qMA||(qMA=1,function(A){(function(e,t){A.exports?A.exports=t():e.moo=t()})(um,function(){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,i=typeof new RegExp().sticky=="boolean";function n(h){return h&&t.call(h)==="[object RegExp]"}function o(h){return h&&typeof h=="object"&&!n(h)&&!Array.isArray(h)}function g(h){return h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(h){var N=new RegExp("|"+h);return N.exec("").length-1}function s(h){return"("+h+")"}function I(h){if(!h.length)return"(?!)";var N=h.map(function(v){return"(?:"+v+")"}).join("|");return"(?:"+N+")"}function r(h){if(typeof h=="string")return"(?:"+g(h)+")";if(n(h)){if(h.ignoreCase)throw new Error("RegExp /i flag not allowed");if(h.global)throw new Error("RegExp /g flag is implied");if(h.sticky)throw new Error("RegExp /y flag is implied");if(h.multiline)throw new Error("RegExp /m flag is implied");return h.source}else throw new Error("Not a pattern: "+h)}function C(h,N){return h.length>N?h:Array(N-h.length+1).join(" ")+h}function l(h,N){for(var v=h.length,K=0;;){var U=h.lastIndexOf(`
`,v-1);if(U===-1||(K++,v=U,K===N)||v===0)break}var V=K<N?0:v+1;return h.substring(V).split(`
`)}function c(h){for(var N=Object.getOwnPropertyNames(h),v=[],K=0;K<N.length;K++){var U=N[K],V=h[U],X=[].concat(V);if(U==="include"){for(var _=0;_<X.length;_++)v.push({include:X[_]});continue}var q=[];X.forEach(function($){o($)?(q.length&&v.push(E(U,q)),v.push(E(U,$)),q=[]):q.push($)}),q.length&&v.push(E(U,q))}return v}function B(h){for(var N=[],v=0;v<h.length;v++){var K=h[v];if(K.include){for(var U=[].concat(K.include),V=0;V<U.length;V++)N.push({include:U[V]});continue}if(!K.type)throw new Error("Rule has no type: "+JSON.stringify(K));N.push(E(K.type,K))}return N}function E(h,N){if(o(N)||(N={match:N}),N.include)throw new Error("Matching rules cannot also include states");var v={defaultType:h,lineBreaks:!!N.error||!!N.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var K in N)e.call(N,K)&&(v[K]=N[K]);if(typeof v.type=="string"&&h!==v.type)throw new Error("Type transform cannot be a string (type '"+v.type+"' for token '"+h+"')");var U=v.match;return v.match=Array.isArray(U)?U:U?[U]:[],v.match.sort(function(V,X){return n(V)&&n(X)?0:n(X)?-1:n(V)?1:X.length-V.length}),v}function u(h){return Array.isArray(h)?B(h):c(h)}var d=E("error",{lineBreaks:!0,shouldThrow:!0});function f(h,N){for(var v=null,K=Object.create(null),U=!0,V=null,X=[],_=[],q=0;q<h.length;q++)h[q].fallback&&(U=!1);for(var q=0;q<h.length;q++){var $=h[q];if($.include)throw new Error("Inheritance is not allowed in stateless lexers");if($.error||$.fallback){if(v)throw!$.fallback==!v.fallback?new Error("Multiple "+($.fallback?"fallback":"error")+" rules not allowed (for token '"+$.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+$.defaultType+"')");v=$}var nA=$.match.slice();if(U)for(;nA.length&&typeof nA[0]=="string"&&nA[0].length===1;){var j=nA.shift();K[j.charCodeAt(0)]=$}if($.pop||$.push||$.next){if(!N)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+$.defaultType+"')");if($.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+$.defaultType+"')")}if(nA.length!==0){U=!1,X.push($);for(var O=0;O<nA.length;O++){var eA=nA[O];if(n(eA)){if(V===null)V=eA.unicode;else if(V!==eA.unicode&&$.fallback===!1)throw new Error("If one rule is /u then all must be")}}var oA=I(nA.map(r)),tA=new RegExp(oA);if(tA.test(""))throw new Error("RegExp matches empty string: "+tA);var sA=a(oA);if(sA>0)throw new Error("RegExp has capture groups: "+tA+`
Use (?: … ) instead`);if(!$.lineBreaks&&tA.test(`
`))throw new Error("Rule should declare lineBreaks: "+tA);_.push(s(oA))}}var gA=v&&v.fallback,iA=i&&!gA?"ym":"gm",aA=i||gA?"":"|";V===!0&&(iA+="u");var lA=new RegExp(I(_)+aA,iA);return{regexp:lA,groups:X,fast:K,error:v||d}}function w(h){var N=f(u(h));return new x({start:N},"start")}function y(h,N,v){var K=h&&(h.push||h.next);if(K&&!v[K])throw new Error("Missing state '"+K+"' (in token '"+h.defaultType+"' of state '"+N+"')");if(h&&h.pop&&+h.pop!=1)throw new Error("pop must be 1 (in token '"+h.defaultType+"' of state '"+N+"')")}function G(h,N){var v=h.$all?u(h.$all):[];delete h.$all;var K=Object.getOwnPropertyNames(h);N||(N=K[0]);for(var U=Object.create(null),V=0;V<K.length;V++){var X=K[V];U[X]=u(h[X]).concat(v)}for(var V=0;V<K.length;V++)for(var X=K[V],_=U[X],q=Object.create(null),$=0;$<_.length;$++){var nA=_[$];if(nA.include){var j=[$,1];if(nA.include!==X&&!q[nA.include]){q[nA.include]=!0;var O=U[nA.include];if(!O)throw new Error("Cannot include nonexistent state '"+nA.include+"' (in state '"+X+"')");for(var eA=0;eA<O.length;eA++){var oA=O[eA];_.indexOf(oA)===-1&&j.push(oA)}}_.splice.apply(_,j),$--}}for(var tA=Object.create(null),V=0;V<K.length;V++){var X=K[V];tA[X]=f(U[X],!0)}for(var V=0;V<K.length;V++){for(var sA=K[V],gA=tA[sA],iA=gA.groups,$=0;$<iA.length;$++)y(iA[$],sA,tA);for(var aA=Object.getOwnPropertyNames(gA.fast),$=0;$<aA.length;$++)y(gA.fast[aA[$]],sA,tA)}return new x(tA,N)}function R(h){for(var N=typeof Map<"u",v=N?new Map:Object.create(null),K=Object.getOwnPropertyNames(h),U=0;U<K.length;U++){var V=K[U],X=h[V],_=Array.isArray(X)?X:[X];_.forEach(function(q){if(typeof q!="string")throw new Error("keyword must be string (in keyword '"+V+"')");N?v.set(q,V):v[q]=V})}return function(q){return N?v.get(q):v[q]}}var x=function(h,N){this.startState=N,this.states=h,this.buffer="",this.stack=[],this.reset()};x.prototype.reset=function(h,N){return this.buffer=h||"",this.index=0,this.line=N?N.line:1,this.col=N?N.col:1,this.queuedToken=N?N.queuedToken:null,this.queuedText=N?N.queuedText:"",this.queuedThrow=N?N.queuedThrow:null,this.setState(N?N.state:this.startState),this.stack=N&&N.stack?N.stack.slice():[],this},x.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},x.prototype.setState=function(h){if(!(!h||this.state===h)){this.state=h;var N=this.states[h];this.groups=N.groups,this.error=N.error,this.re=N.regexp,this.fast=N.fast}},x.prototype.popState=function(){this.setState(this.stack.pop())},x.prototype.pushState=function(h){this.stack.push(this.state),this.setState(h)};var F=i?function(h,N){return h.exec(N)}:function(h,N){var v=h.exec(N);return v[0].length===0?null:v};x.prototype._getGroup=function(h){for(var N=this.groups.length,v=0;v<N;v++)if(h[v+1]!==void 0)return this.groups[v];throw new Error("Cannot find token type for matched text")};function Q(){return this.value}if(x.prototype.next=function(){var h=this.index;if(this.queuedGroup){var N=this._token(this.queuedGroup,this.queuedText,h);return this.queuedGroup=null,this.queuedText="",N}var v=this.buffer;if(h!==v.length){var X=this.fast[v.charCodeAt(h)];if(X)return this._token(X,v.charAt(h),h);var K=this.re;K.lastIndex=h;var U=F(K,v),V=this.error;if(U==null)return this._token(V,v.slice(h,v.length),h);var X=this._getGroup(U),_=U[0];return V.fallback&&U.index!==h?(this.queuedGroup=X,this.queuedText=_,this._token(V,v.slice(h,U.index),h)):this._token(X,_,h)}},x.prototype._token=function(h,N,v){var K=0;if(h.lineBreaks){var U=/\n/g,V=1;if(N===`
`)K=1;else for(;U.exec(N);)K++,V=U.lastIndex}var X={type:typeof h.type=="function"&&h.type(N)||h.defaultType,value:typeof h.value=="function"?h.value(N):N,text:N,toString:Q,offset:v,lineBreaks:K,line:this.line,col:this.col},_=N.length;if(this.index+=_,this.line+=K,K!==0?this.col=_-V+1:this.col+=_,h.shouldThrow){var q=new Error(this.formatError(X,"invalid syntax"));throw q}return h.pop?this.popState():h.push?this.pushState(h.push):h.next&&this.setState(h.next),X},typeof Symbol<"u"&&Symbol.iterator){var k=function(h){this.lexer=h};k.prototype.next=function(){var h=this.lexer.next();return{value:h,done:!h}},k.prototype[Symbol.iterator]=function(){return this},x.prototype[Symbol.iterator]=function(){return new k(this)}}return x.prototype.formatError=function(K,N){if(K==null)var v=this.buffer.slice(this.index),K={text:v,offset:this.index,lineBreaks:v.indexOf(`
`)===-1?0:1,line:this.line,col:this.col};var U=2,V=Math.max(K.line-U,1),X=K.line+U,_=String(X).length,q=l(this.buffer,this.line-K.line+U+1).slice(0,5),$=[];$.push(N+" at line "+K.line+" col "+K.col+":"),$.push("");for(var nA=0;nA<q.length;nA++){var j=q[nA],O=V+nA;$.push(C(String(O),_)+"  "+j),O===K.line&&$.push(C("",_+K.col+1)+"^")}return $.join(`
`)},x.prototype.clone=function(){return new x(this.states,this.state)},x.prototype.has=function(h){return!0},{compile:w,states:G,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:R}})}(OMA)),OMA.exports}var jMA={exports:{}},PMA;function S3e(){return PMA||(PMA=1,function(A){(function(e,t){A.exports?A.exports=t():e.nearley=t()})(um,function(){function e(I,r,C){return this.id=++e.highestId,this.name=I,this.symbols=r,this.postprocess=C,this}e.highestId=0,e.prototype.toString=function(I){var r=typeof I>"u"?this.symbols.map(s).join(" "):this.symbols.slice(0,I).map(s).join(" ")+" ● "+this.symbols.slice(I).map(s).join(" ");return this.name+" → "+r};function t(I,r,C,l){this.rule=I,this.dot=r,this.reference=C,this.data=[],this.wantedBy=l,this.isComplete=this.dot===I.symbols.length}t.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},t.prototype.nextState=function(I){var r=new t(this.rule,this.dot+1,this.reference,this.wantedBy);return r.left=this,r.right=I,r.isComplete&&(r.data=r.build(),r.right=void 0),r},t.prototype.build=function(){var I=[],r=this;do I.push(r.right.data),r=r.left;while(r.left);return I.reverse(),I},t.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,g.fail))};function i(I,r){this.grammar=I,this.index=r,this.states=[],this.wants={},this.scannable=[],this.completed={}}i.prototype.process=function(I){for(var r=this.states,C=this.wants,l=this.completed,c=0;c<r.length;c++){var B=r[c];if(B.isComplete){if(B.finish(),B.data!==g.fail){for(var E=B.wantedBy,u=E.length;u--;){var d=E[u];this.complete(d,B)}if(B.reference===this.index){var f=B.rule.name;(this.completed[f]=this.completed[f]||[]).push(B)}}}else{var f=B.rule.symbols[B.dot];if(typeof f!="string"){this.scannable.push(B);continue}if(C[f]){if(C[f].push(B),l.hasOwnProperty(f))for(var w=l[f],u=0;u<w.length;u++){var y=w[u];this.complete(B,y)}}else C[f]=[B],this.predict(f)}}},i.prototype.predict=function(I){for(var r=this.grammar.byName[I]||[],C=0;C<r.length;C++){var l=r[C],c=this.wants[I],B=new t(l,0,this.index,c);this.states.push(B)}},i.prototype.complete=function(I,r){var C=I.nextState(r);this.states.push(C)};function n(I,r){this.rules=I,this.start=r||this.rules[0].name;var C=this.byName={};this.rules.forEach(function(l){C.hasOwnProperty(l.name)||(C[l.name]=[]),C[l.name].push(l)})}n.fromCompiled=function(l,r){var C=l.Lexer;l.ParserStart&&(r=l.ParserStart,l=l.ParserRules);var l=l.map(function(B){return new e(B.name,B.symbols,B.postprocess)}),c=new n(l,r);return c.lexer=C,c};function o(){this.reset("")}o.prototype.reset=function(I,r){this.buffer=I,this.index=0,this.line=r?r.line:1,this.lastLineBreak=r?-r.col:0},o.prototype.next=function(){if(this.index<this.buffer.length){var I=this.buffer[this.index++];return I===`
`&&(this.line+=1,this.lastLineBreak=this.index),{value:I}}},o.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},o.prototype.formatError=function(I,r){var C=this.buffer;if(typeof C=="string"){var l=C.split(`
`).slice(Math.max(0,this.line-5),this.line),c=C.indexOf(`
`,this.index);c===-1&&(c=C.length);var B=this.index-this.lastLineBreak,E=String(this.line).length;return r+=" at line "+this.line+" col "+B+`:

`,r+=l.map(function(d,f){return u(this.line-l.length+f+1,E)+" "+d},this).join(`
`),r+=`
`+u("",E+B)+`^
`,r}else return r+" at index "+(this.index-1);function u(d,f){var w=String(d);return Array(f-w.length+1).join(" ")+w}};function g(I,r,l){if(I instanceof n)var c=I,l=r;else var c=n.fromCompiled(I,r);this.grammar=c,this.options={keepHistory:!1,lexer:c.lexer||new o};for(var B in l||{})this.options[B]=l[B];this.lexer=this.options.lexer,this.lexerState=void 0;var E=new i(c,0);this.table=[E],E.wants[c.start]=[],E.predict(c.start),E.process(),this.current=0}g.fail={},g.prototype.feed=function(I){var r=this.lexer;r.reset(I,this.lexerState);for(var C;;){try{if(C=r.next(),!C)break}catch(x){var E=new i(this.grammar,this.current+1);this.table.push(E);var l=new Error(this.reportLexerError(x));throw l.offset=this.current,l.token=x.token,l}var c=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var B=this.current+1,E=new i(this.grammar,B);this.table.push(E);for(var u=C.text!==void 0?C.text:C.value,d=r.constructor===o?C.value:C,f=c.scannable,w=f.length;w--;){var y=f[w],G=y.rule.symbols[y.dot];if(G.test?G.test(d):G.type?G.type===C.type:G.literal===u){var R=y.nextState({data:d,token:C,isToken:!0,reference:B-1});E.states.push(R)}}if(E.process(),E.states.length===0){var l=new Error(this.reportError(C));throw l.offset=this.current,l.token=C,l}this.options.keepHistory&&(c.lexerState=r.save()),this.current++}return c&&(this.lexerState=r.save()),this.results=this.finish(),this},g.prototype.reportLexerError=function(I){var r,C,l=I.token;return l?(r="input "+JSON.stringify(l.text[0])+" (lexer error)",C=this.lexer.formatError(l,"Syntax error")):(r="input (lexer error)",C=I.message),this.reportErrorCommon(C,r)},g.prototype.reportError=function(I){var r=(I.type?I.type+" token: ":"")+JSON.stringify(I.value!==void 0?I.value:I),C=this.lexer.formatError(I,"Syntax error");return this.reportErrorCommon(C,r)},g.prototype.reportErrorCommon=function(I,r){var C=[];C.push(I);var l=this.table.length-2,c=this.table[l],B=c.states.filter(function(u){var d=u.rule.symbols[u.dot];return d&&typeof d!="string"});if(B.length===0)C.push("Unexpected "+r+`. I did not expect any more input. Here is the state of my parse table:
`),this.displayStateStack(c.states,C);else{C.push("Unexpected "+r+`. Instead, I was expecting to see one of the following:
`);var E=B.map(function(u){return this.buildFirstStateStack(u,[])||[u]},this);E.forEach(function(u){var d=u[0],f=d.rule.symbols[d.dot],w=this.getSymbolDisplay(f);C.push("A "+w+" based on:"),this.displayStateStack(u,C)},this)}return C.push(""),C.join(`
`)},g.prototype.displayStateStack=function(I,r){for(var C,l=0,c=0;c<I.length;c++){var B=I[c],E=B.rule.toString(B.dot);E===C?l++:(l>0&&r.push("    ^ "+l+" more lines identical to this"),l=0,r.push("    "+E)),C=E}},g.prototype.getSymbolDisplay=function(I){return a(I)},g.prototype.buildFirstStateStack=function(I,r){if(r.indexOf(I)!==-1)return null;if(I.wantedBy.length===0)return[I];var C=I.wantedBy[0],l=[I].concat(r),c=this.buildFirstStateStack(C,l);return c===null?null:[I].concat(c)},g.prototype.save=function(){var I=this.table[this.current];return I.lexerState=this.lexerState,I},g.prototype.restore=function(I){var r=I.index;this.current=r,this.table[r]=I,this.table.splice(r+1),this.lexerState=I.lexerState,this.results=this.finish()},g.prototype.rewind=function(I){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[I])},g.prototype.finish=function(){var I=[],r=this.grammar.start,C=this.table[this.table.length-1];return C.states.forEach(function(l){l.rule.name===r&&l.dot===l.rule.symbols.length&&l.reference===0&&l.data!==g.fail&&I.push(l)}),I.map(function(l){return l.data})};function a(I){var r=typeof I;if(r==="string")return I;if(r==="object"){if(I.literal)return JSON.stringify(I.literal);if(I instanceof RegExp)return"character matching "+I;if(I.type)return I.type+" token";if(I.test)return"token matching "+String(I.test);throw new Error("Unknown symbol type: "+I)}}function s(I){var r=typeof I;if(r==="string")return I;if(r==="object"){if(I.literal)return JSON.stringify(I.literal);if(I instanceof RegExp)return I.toString();if(I.type)return"%"+I.type;if(I.test)return"<"+String(I.test)+">";throw new Error("Unknown symbol type: "+I)}}return{Parser:g,Grammar:n,Rule:e}})}(jMA)),jMA.exports}(function(A){(function(e,t){for(var i in t)e[i]=t[i]})(A,function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=e,i.c=t,i.d=function(n,o,g){i.o(n,o)||Object.defineProperty(n,o,{enumerable:!0,get:g})},i.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},i.t=function(n,o){if(o&1&&(n=i(n)),o&8||o&4&&typeof n=="object"&&n&&n.__esModule)return n;var g=Object.create(null);if(i.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:n}),o&2&&typeof n!="string")for(var a in n)i.d(g,a,function(s){return n[s]}.bind(null,a));return g},i.n=function(n){var o=n&&n.__esModule?function(){return n.default}:function(){return n};return i.d(o,"a",o),o},i.o=function(n,o){return Object.prototype.hasOwnProperty.call(n,o)},i.p="",i(i.s=7)}([function(e,t){e.exports=L3e()},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.unbox=t.doubleQuoted=t.box=t.track=t.tracking=t.trackingComments=t.lexerAny=t.lexer=void 0;const n=i(0),o=i(3),g={};for(const G of o.sqlKeywords)g["kw_"+G.toLowerCase()]=G;const a=G=>{const R=(0,n.keywords)(G);return x=>R(x.toUpperCase())};t.lexer=(0,n.compile)({word:{match:/[eE](?!')[A-Za-z0-9_]*|[a-df-zA-DF-Z_][A-Za-z0-9_]*/,type:a(g),value:G=>G.toLowerCase()},wordQuoted:{match:/"(?:[^"\*]|"")+"/,type:()=>"quoted_word",value:G=>G.substring(1,G.length-1)},string:{match:/'(?:[^']|\'\')*'/,value:G=>G.substring(1,G.length-1).replace(/''/g,"'")},eString:{match:/\b(?:e|E)'(?:[^'\\]|[\r\n\s]|(?:\\\s)|(?:\\\n)|(?:\\.)|(?:\'\'))+'/,value:G=>G.substring(2,G.length-1).replace(/''/g,"'").replace(/\\([\s\n])/g,(R,x)=>x).replace(/\\./g,R=>JSON.parse('"'+R+'"'))},qparam:{match:/\$\d+/},commentLine:/\-\-.*?$[\s\r\n]*/,commentFullOpen:/\/\*/,commentFullClose:/\*\/[\s\r\n]*/,star:"*",comma:",",space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},int:/\-?\d+(?![\.\d])/,float:/\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,lparen:"(",rparen:")",lbracket:"[",rbracket:"]",semicolon:";",dot:/\.(?!\d)/,op_cast:"::",op_colon:":",op_plus:"+",op_eq:"=",op_neq:{match:/(?:!=)|(?:\<\>)/,value:()=>"!="},op_membertext:"->>",op_member:"->",op_minus:"-",op_div:/\//,op_not_ilike:/\!~~\*/,op_not_like:/\!~~/,op_ilike:/~~\*/,op_like:/~~/,op_mod:"%",op_exp:"^",op_additive:{match:["||","-","#-","&&"]},op_compare:{match:[">",">=","<","<=","@>","<@","?","?|","?&","#>>",">>","<<","~","~*","!~","!~*","@@"]},ops_others:{match:["|","&","^","#"]},codeblock:{match:/\$\$(?:.|[\s\t\n\v\f\r])*?\$\$/s,lineBreaks:!0,value:G=>G.substring(2,G.length-2)}}),t.lexer.next=(G=>()=>{let R,x=null;for(;R=G.call(t.lexer);){if(R.type==="commentFullOpen"){if(x===null){x={nested:0,offset:R.offset,text:R.text};continue}x.nested++}if(x!=null){if(x.text+=R.text,R.type==="commentFullClose"){if(x.nested===0){s==null||s.push(I(x)),x=null;continue}x.nested--}continue}if(R.type!=="space"){if(R.type==="commentLine"){s==null||s.push(I(R));continue}break}}if(C&&R){const F=R.offset,Q={start:F,end:F+R.text.length};R._location=Q}return R})(t.lexer.next),t.lexerAny=t.lexer;let s=null;const I=({offset:G,text:R})=>({_location:{start:G,end:G+R.length},comment:R});function r(G){if(s)throw new Error("WAT ? Recursive comments tracking 🤔🤨 ?");try{s=[];const R=G();return{comments:s,ast:R}}finally{s=null}}t.trackingComments=r;let C=!1;function l(G){if(C)return G();try{return C=!0,G()}finally{C=!1}}t.tracking=l;function c(G,R){if(!C||!R||typeof R!="object")return R;const x=y(G,!0),F=y(G,!1);if(!x||!F)return R;if(x===F)R._location=x;else{const Q={start:x.start,end:F.end};R._location=Q}return R}t.track=c;const B=Symbol("_literal"),E=Symbol("_doublequoted");function u(G,R,x){return!C&&!x?R:c(G,{[B]:R,[E]:x})}t.box=u;function d(G){return Array.isArray(G)&&G.length===1&&(G=d(G[0])),Array.isArray(G)&&!G.length?null:G}function f(G){const R=d(G);if(typeof G=="object"&&R!=null&&R[E])return{doubleQuoted:!0}}t.doubleQuoted=f;function w(G){var R;return typeof G=="object"&&(R=G==null?void 0:G[B])!==null&&R!==void 0?R:G}t.unbox=w;function y(G,R){if(!G)return null;if(Array.isArray(G)){const x=R?1:-1;for(let F=R?0:G.length-1;F>=0&&F<G.length;F+=x){const Q=y(G[F],R);if(Q)return Q}return null}return typeof G!="object"?null:G._location}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.AstDefaultMapper=t.arrayNilMap=t.assignChanged=t.astMapper=void 0;const n=i(6);function o(l){const c=new I;return c.wrapped=l(c),c}t.astMapper=o;function g(l,c){if(!l)return l;let B=!1;for(const E of Object.keys(c))if(l[E]!==c[E]){B=!0;break}return B?(0,n.trimNullish)({...l,...c},0):l}t.assignChanged=g;function a(l,c){if(!(l!=null&&l.length))return l;let B=!1,E=l;for(let u=0;u<l.length;u++){const d=l[u],f=c(d);!B&&(!f||f!==d)&&(B=!0,E=l.slice(0,u)),f&&B&&E.push(f)}return E}t.arrayNilMap=a;function s(l){switch(l==null?void 0:l.type){case"select":case"delete":case"insert":case"update":case"union":case"union all":case"with":return!0;default:return!1}}class I{super(){return new C(this)}statement(c){switch(c.type){case"alter table":return this.alterTable(c);case"alter index":return this.alterIndex(c);case"commit":case"start transaction":case"rollback":return this.transaction(c);case"create index":return this.createIndex(c);case"create table":return this.createTable(c);case"truncate table":return this.truncateTable(c);case"delete":return this.delete(c);case"insert":return this.insert(c);case"with":return this.with(c);case"with recursive":return this.withRecursive(c);case"select":return this.selection(c);case"update":return this.update(c);case"create extension":return this.createExtension(c);case"tablespace":return this.tablespace(c);case"set":return this.setGlobal(c);case"set timezone":return this.setTimezone(c);case"create sequence":return this.createSequence(c);case"alter sequence":return this.alterSequence(c);case"begin":return this.begin(c);case"drop table":case"drop index":case"drop sequence":case"drop type":case"drop trigger":return this.drop(c);case"create enum":return this.createEnum(c);case"create composite type":return this.createCompositeType(c);case"union":case"union all":return this.union(c);case"show":return this.show(c);case"prepare":return this.prepare(c);case"deallocate":return this.deallocate(c);case"create view":return this.createView(c);case"create materialized view":return this.createMaterializedView(c);case"refresh materialized view":return this.refreshMaterializedView(c);case"create schema":return this.createSchema(c);case"raise":return this.raise(c);case"comment":return this.comment(c);case"do":return this.do(c);case"create function":return this.createFunction(c);case"drop function":return this.dropFunction(c);case"values":return this.values(c);default:throw n.NotSupported.never(c)}}comment(c){return c}createView(c){const B=this.select(c.query);if(!B)return null;const E=this.tableRef(c.name);return E?g(c,{query:B,name:E}):null}createMaterializedView(c){const B=this.select(c.query);if(!B)return null;const E=this.tableRef(c.name);return E?g(c,{query:B,name:E}):null}refreshMaterializedView(c){return c}do(c){return c}createFunction(c){const B=a(c.arguments,u=>{const d=this.dataType(u.type);return g(u,{type:d})});let E;if(c.returns)switch(c.returns.kind){case"table":E=g(c.returns,{columns:a(c.returns.columns,u=>{const d=this.dataType(u.type);return d&&g(u,{type:d})})});break;case void 0:case null:case"array":E=this.dataType(c.returns);break;default:throw n.NotSupported.never(c.returns)}return g(c,{returns:E,arguments:B})}dropFunction(c){const B=a(c.arguments,E=>{const u=this.dataType(E.type);return g(E,{type:u})});return g(c,{arguments:B})}show(c){return c}createEnum(c){return c}createCompositeType(c){const B=a(c.attributes,E=>g(E,{dataType:this.dataType(E.dataType)}));return g(c,{attributes:B})}drop(c){return c}alterSequence(c){return c.change.type==="set options"&&c.change.as&&this.dataType(c.change.as),c}begin(c){return c}createSequence(c){return c.options.as&&this.dataType(c.options.as),c}tablespace(c){return c}setGlobal(c){return c}setTimezone(c){return c}update(c){if(!c)return c;const B=this.tableRef(c.table);if(!B)return null;const E=c.from&&this.from(c.from),u=c.where&&this.expr(c.where),d=a(c.sets,w=>this.set(w));if(!(d!=null&&d.length))return null;const f=a(c.returning,w=>this.selectionColumn(w));return g(c,{table:B,where:u,sets:d,from:E,returning:f})}insert(c){var B,E;const u=this.tableRef(c.into);if(!u)return null;const d=c.insert&&this.select(c.insert);if(!d)return null;const f=a(c.returning,G=>this.selectionColumn(G));let w=(B=c.onConflict)===null||B===void 0?void 0:B.on;switch(w==null?void 0:w.type){case"on constraint":break;case"on expr":w=g(w,{exprs:a(w.exprs,G=>this.expr(G))});break;case null:case void 0:break;default:throw n.NotSupported.never(w)}let y=(E=c.onConflict)===null||E===void 0?void 0:E.do;if(y&&y!=="do nothing"){const G=a(y.sets,R=>this.set(R));G!=null&&G.length?y.sets!==G&&(y={sets:G}):y="do nothing"}return g(c,{into:u,insert:d,returning:f,onConflict:y?g(c.onConflict,{do:y,on:w}):c.onConflict})}raise(c){return g(c,{formatExprs:c.formatExprs&&a(c.formatExprs,B=>this.expr(B)),using:c.using&&a(c.using,B=>g(B,{value:this.expr(B.value)}))})}delete(c){const B=this.tableRef(c.from);if(!B)return null;const E=c.where&&this.expr(c.where),u=a(c.returning,d=>this.selectionColumn(d));return g(c,{where:E,returning:u,from:B})}createSchema(c){return c}createTable(c){const B=a(c.columns,E=>{switch(E.kind){case"column":return this.createColumn(E);case"like table":return this.likeTable(E);default:throw n.NotSupported.never(E)}});return B!=null&&B.length?g(c,{columns:B}):null}likeTable(c){const B=this.tableRef(c.like);return B?g(c,{like:B}):null}truncateTable(c){return c}constraint(c){switch(c.type){case"not null":case"null":case"primary key":case"unique":case"add generated":return c;case"default":{const B=this.expr(c.default);return B?g(c,{default:B}):null}case"check":{const B=this.expr(c.expr);return B?g(c,{expr:B}):null}case"reference":{const B=this.tableRef(c.foreignTable);return B?g(c,{foreignTable:B}):null}default:throw n.NotSupported.never(c)}}set(c){const B=this.expr(c.value);return B?g(c,{value:B}):null}dataType(c){return c}tableRef(c){return c}transaction(c){return c}createExtension(c){return c}createIndex(c){const B=a(c.expressions,E=>{const u=this.expr(E.expression);return u===E.expression?E:u?{...E,expression:u}:null});return B!=null&&B.length?g(c,{expressions:B}):null}prepare(c){const B=this.statement(c.statement);return B?g(c,{args:a(c.args,E=>this.dataType(E)),statement:B}):null}deallocate(c){return c}alterIndex(c){return c}alterTable(c){var B;const E=this.tableRef(c.table);if(!E)return null;let u=[],d=!1;for(let f=0;f<(((B=c.changes)===null||B===void 0?void 0:B.length)||0);f++){const w=c.changes[f],y=this.tableAlteration(w,c.table);d=d||y!=w,y&&u.push(y)}return u.length?d?g(c,{table:E,changes:u}):c:null}tableAlteration(c,B){switch(c.type){case"add column":return this.addColumn(c,B);case"add constraint":return this.addConstraint(c,B);case"alter column":return this.alterColumn(c,B);case"rename":return this.renameTable(c,B);case"rename column":return this.renameColumn(c,B);case"rename constraint":return this.renameConstraint(c,B);case"drop column":return this.dropColumn(c,B);case"drop constraint":return this.dropConstraint(c,B);case"owner":return this.setTableOwner(c,B);default:throw n.NotSupported.never(c)}}dropColumn(c,B){return c}dropConstraint(c,B){return c}setTableOwner(c,B){return c}renameConstraint(c,B){return c}renameColumn(c,B){return c}renameTable(c,B){return c}alterColumn(c,B){let E;switch(c.alter.type){case"set default":E=this.setColumnDefault(c.alter,B,c.column);break;case"set type":E=this.setColumnType(c.alter,B,c.column);break;case"drop default":case"set not null":case"drop not null":E=this.alterColumnSimple(c.alter,B,c.column);break;case"add generated":E=this.alterColumnAddGenerated(c.alter,B,c.column);break;default:throw n.NotSupported.never(c.alter)}return E?g(c,{alter:E}):null}setColumnType(c,B,E){const u=this.dataType(c.dataType);return g(c,{dataType:u})}alterColumnAddGenerated(c,B,E){return c}alterColumnSimple(c,B,E){return c}setColumnDefault(c,B,E){const u=this.expr(c.default);return u?g(c,{default:u}):null}addConstraint(c,B){return c}addColumn(c,B){const E=this.createColumn(c.column);return E?g(c,{column:E}):null}createColumn(c){var B;const E=this.dataType(c.dataType);if(!E)return null;const u=(B=a(c.constraints,d=>this.constraint(d)))!==null&&B!==void 0?B:void 0;return g(c,{dataType:E,constraints:u})}select(c){switch(c.type){case"select":return this.selection(c);case"union":case"union all":return this.union(c);case"with":return this.with(c);case"values":return this.values(c);case"with recursive":return this.withRecursive(c);default:throw n.NotSupported.never(c)}}selection(c){var B,E;const u=a(c.from,x=>this.from(x)),d=a(c.columns,x=>this.selectionColumn(x)),f=c.where&&this.expr(c.where),w=a(c.groupBy,x=>this.expr(x)),y=c.having&&this.expr(c.having),G=this.orderBy(c.orderBy),R=g(c.limit,{limit:this.expr((B=c.limit)===null||B===void 0?void 0:B.limit),offset:this.expr((E=c.limit)===null||E===void 0?void 0:E.offset)});return g(c,{from:u,columns:d,where:f,groupBy:w,having:y,orderBy:G,limit:R})}orderBy(c){return a(c,B=>{const E=this.expr(B.by);return E?E===B.by?B:{...B,by:E}:null})}union(c){const B=this.select(c.left),E=this.select(c.right);return!B||!E?B??E:g(c,{left:B,right:E})}with(c){const B=a(c.bind,u=>{const d=this.statement(u.statement);return s(d)?g(u,{statement:d}):null});if(!B)return null;const E=this.statement(c.in);return s(E)?g(c,{bind:B,in:E}):null}withRecursive(c){const B=this.union(c.bind);if(!B||B.type!=="union"&&B.type!=="union all")return null;const E=this.statement(c.in);return s(E)?g(c,{bind:B,in:E}):null}from(c){switch(c.type){case"table":return this.fromTable(c);case"statement":return this.fromStatement(c);case"call":return this.fromCall(c);default:throw n.NotSupported.never(c)}}fromCall(c){const B=this.call(c);return!B||B.type!=="call"?null:g(c,B)}fromStatement(c){const B=this.select(c.statement);if(!B)return null;const E=c.join&&this.join(c.join);return g(c,{statement:B,join:E})}values(c){const B=a(c.values,E=>a(E,u=>this.expr(u)));return B!=null&&B.length?g(c,{values:B}):null}join(c){const B=c.on&&this.expr(c.on);return!B&&!c.using?c:g(c,{on:B})}fromTable(c){const B=this.tableRef(c.name);if(!B)return null;const E=c.join&&this.join(c.join);return g(c,{name:B,join:E})}selectionColumn(c){const B=this.expr(c.expr);return B?g(c,{expr:B}):null}expr(c){if(!c)return c;switch(c.type){case"binary":return this.binary(c);case"unary":return this.unary(c);case"ref":return this.ref(c);case"string":case"numeric":case"integer":case"boolean":case"constant":case"null":return this.constant(c);case"list":case"array":return this.array(c);case"array select":return this.arraySelect(c);case"call":return this.call(c);case"cast":return this.cast(c);case"case":return this.case(c);case"member":return this.member(c);case"arrayIndex":return this.arrayIndex(c);case"ternary":return this.ternary(c);case"select":case"union":case"union all":case"with":case"with recursive":return this.select(c);case"keyword":return this.valueKeyword(c);case"parameter":return this.parameter(c);case"extract":return this.extract(c);case"overlay":return this.callOverlay(c);case"substring":return this.callSubstring(c);case"values":return this.values(c);case"default":return this.default(c);default:throw n.NotSupported.never(c)}}arraySelect(c){const B=this.select(c.select);return B?g(c,{select:B}):null}extract(c){const B=this.expr(c.from);return B?g(c,{from:B}):null}valueKeyword(c){return c}ternary(c){const B=this.expr(c.value),E=this.expr(c.lo),u=this.expr(c.hi);return!B||!E||!u?null:g(c,{value:B,lo:E,hi:u})}parameter(c){return c}arrayIndex(c){const B=this.expr(c.array),E=this.expr(c.index);return!B||!E?null:g(c,{array:B,index:E})}member(c){const B=this.expr(c.operand);return B?g(c,{operand:B}):null}case(c){const B=c.value&&this.expr(c.value),E=a(c.whens,d=>{const f=this.expr(d.when),w=this.expr(d.value);return!f||!w?null:g(d,{value:w,when:f})});if(!(E!=null&&E.length))return null;const u=c.else&&this.expr(c.else);return g(c,{value:B,whens:E,else:u})}cast(c){const B=this.expr(c.operand);return B?g(c,{operand:B}):null}call(c){const B=a(c.args,d=>this.expr(d));if(!B)return null;const E=this.orderBy(c.orderBy),u=this.expr(c.filter);return g(c,{args:B,orderBy:E,filter:u})}callSubstring(c){return g(c,{value:this.expr(c.value),from:this.expr(c.from),for:this.expr(c.for)})}callOverlay(c){return g(c,{value:this.expr(c.value),placing:this.expr(c.placing),from:this.expr(c.from),for:this.expr(c.for)})}array(c){const B=a(c.expressions,E=>this.expr(E));return B?g(c,{expressions:B}):null}constant(c){return c}default(c){return c}ref(c){return c}unary(c){const B=this.expr(c.operand);return B?g(c,{operand:B}):null}binary(c){const B=this.expr(c.left),E=this.expr(c.right);return!B||!E?null:g(c,{left:B,right:E})}}t.AstDefaultMapper=I;const r=I.prototype;for(const l of Object.getOwnPropertyNames(r)){const c=r[l];l==="constructor"||l==="super"||typeof c!="function"||Object.defineProperty(r,l,{configurable:!1,get(){return function(...B){var E;if(this.skipNext)return this.skipNext=!1,c.apply(this,B);const u=(E=this.wrapped)===null||E===void 0?void 0:E[l];return u?u.apply(this.wrapped,B):c.apply(this,B)}}})}class C extends I{constructor(c){super(),this.parent=c}}for(const l of Object.getOwnPropertyNames(r)){const c=r[l];l==="constructor"||l==="super"||typeof c!="function"||Object.defineProperty(C.prototype,l,{configurable:!1,get(){return function(...B){return this.parent.skipNext=!0,c.apply(this.parent,B)}}})}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.sqlKeywords=void 0,t.sqlKeywords=["ALL","ANALYSE","ANALYZE","AND","ANY","ARRAY","AS","ASC","ASYMMETRIC","AUTHORIZATION","BINARY","BOTH","CASE","CAST","CHECK","COLLATE","COLLATION","CONCURRENTLY","CONSTRAINT","CREATE","CROSS","CURRENT_CATALOG","CURRENT_DATE","CURRENT_ROLE","CURRENT_SCHEMA","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","DEFAULT","DEFERRABLE","DESC","DISTINCT","DO","ELSE","END","EXCEPT","FALSE","FETCH","FOR","FOREIGN","FREEZE","FROM","FULL","GRANT","GROUP","HAVING","ILIKE","IN","INITIALLY","INNER","INTERSECT","INTO","IS","ISNULL","JOIN","LATERAL","LEADING","LEFT","LIKE","LIMIT","LOCALTIME","LOCALTIMESTAMP","NATURAL","NOT","NOTNULL","NULL","OFFSET","ON","ONLY","OR","ORDER","OUTER","OVERLAPS","PLACING","PRIMARY","REFERENCES","RETURNING","RIGHT","SELECT","SESSION_USER","SIMILAR","SOME","SYMMETRIC","TABLE","TABLESAMPLE","THEN","TO","TRAILING","TRUE","UNION","UNIQUE","USER","USING","VARIADIC","VERBOSE","WHEN","WHERE","WINDOW","WITH","PRECISION"]},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.intervalToString=t.normalizeInterval=t.buildInterval=void 0;const n=[["years",12],["months",30],["days",24],["hours",60],["minutes",60],["seconds",1e3],["milliseconds",0]];function*o(C){if(typeof C[1]=="number")yield C;else for(const l of C)yield*o(l)}function g(C,l){var c;const B={};if(l==="invalid")throw new Error(`invalid input syntax for type interval: "${C}"`);for(const[E,u]of o(l))B[E]=((c=B[E])!==null&&c!==void 0?c:0)+u;return B}t.buildInterval=g;function a(C){var l,c,B,E,u,d,f,w,y;const G={...C};for(let F=0;F<n.length;F++){const[Q,k]=n[F],h=(l=G[Q])!==null&&l!==void 0?l:0,N=h>=0?Math.floor(h):Math.ceil(h);if(!h||N===h)continue;const v=(c=n[F+1])===null||c===void 0?void 0:c[0];v&&(G[v]=((B=G[v])!==null&&B!==void 0?B:0)+k*(h-N)),G[Q]=N}if(G.months||G.years){const F=((E=G.months)!==null&&E!==void 0?E:0)+((u=G.years)!==null&&u!==void 0?u:0)*12;G.months=F%12,G.years=(F-G.months)/12}let R=((d=G.hours)!==null&&d!==void 0?d:0)*3600+((f=G.minutes)!==null&&f!==void 0?f:0)*60+((w=G.seconds)!==null&&w!==void 0?w:0)+((y=G.milliseconds)!==null&&y!==void 0?y:0)/1e3,x=1;R<0&&(x=-1,R=-R),R>=3600?(G.hours=x*Math.floor(R/3600),R-=x*G.hours*3600):delete G.hours,R>=60?(G.minutes=x*Math.floor(R/60),R-=x*G.minutes*60):delete G.minutes,R>0?(G.seconds=x*Math.floor(R),R-=x*G.seconds):delete G.seconds,R>0?G.milliseconds=x*Math.round(R*1e3):delete G.milliseconds;for(const[F]of n)G[F]||delete G[F];return G}t.normalizeInterval=a;function s(C){var l,c,B;C=a(C);const E=[];if(C.years&&E.push(C.years===1?"1 year":C.years+" years"),C.months&&E.push(C.months===1?"1 month":C.months+" months"),C.days&&E.push(C.days===1?"1 day":C.days+" days"),C.hours||C.minutes||C.seconds||C.milliseconds){let u=`${I((l=C.hours)!==null&&l!==void 0?l:0)}:${I((c=C.minutes)!==null&&c!==void 0?c:0)}:${I((B=C.seconds)!==null&&B!==void 0?B:0)}`;C.milliseconds&&(u=u+(C.milliseconds/1e3).toString().substr(1)),(r(C.hours)||r(C.minutes)||r(C.seconds)||r(C.milliseconds))&&(u="-"+u),E.push(u)}return E.join(" ")}t.intervalToString=s;function I(C){return C=Math.abs(C),C<10?"0"+C:C.toString()}function r(C){return C&&C<0}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.astVisitor=void 0;const n=i(2);class o{super(){return new a(this)}}const g=n.AstDefaultMapper.prototype;for(const I of Object.getOwnPropertyNames(g)){const r=g[I];I==="constructor"||I==="super"||typeof r!="function"||Object.defineProperty(o.prototype,I,{configurable:!1,get(){return function(...C){const l=this.visitor[I];return l?(l.apply(this.visitor,C),C[0]):r.apply(this,C)}}})}class a{constructor(r){this.parent=r}}for(const I of Object.getOwnPropertyNames(g)){const r=g[I];I==="constructor"||I==="super"||typeof r!="function"||Object.defineProperty(a.prototype,I,{configurable:!1,get(){return function(...C){return r.apply(this.parent,C)}}})}function s(I){return(0,n.astMapper)(r=>{const C=new o;return C.mapper=r,C.visitor=I(C),C})}t.astVisitor=s},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.trimNullish=t.NotSupported=void 0;class n extends Error{constructor(a){super("Not supported"+(a?": "+a:""))}static never(a,s){return new n(`${s??""} ${JSON.stringify(a)}`)}}t.NotSupported=n;function o(g,a=5){if(a<0||(g instanceof Array&&g.forEach(s=>o(s,a-1)),typeof g!="object"||g instanceof Date)||!g)return g;for(const s of Object.keys(g)){const I=g[s];I==null?delete g[s]:o(I,a-1)}return g}t.trimNullish=o},function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(C,l,c,B){B===void 0&&(B=c);var E=Object.getOwnPropertyDescriptor(l,c);(!E||("get"in E?!l.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return l[c]}}),Object.defineProperty(C,B,E)}:function(C,l,c,B){B===void 0&&(B=c),C[B]=l[c]}),o=this&&this.__exportStar||function(C,l){for(var c in C)c!=="default"&&!Object.prototype.hasOwnProperty.call(l,c)&&n(l,C,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeInterval=t.intervalToString=t.toSql=t.astMapper=t.assignChanged=t.arrayNilMap=t.astVisitor=t.parseWithComments=t.parseIntervalLiteral=t.parseGeometricLiteral=t.parseArrayLiteral=t.parseFirst=t.parse=void 0;var g=i(8);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return g.parse}}),Object.defineProperty(t,"parseFirst",{enumerable:!0,get:function(){return g.parseFirst}}),Object.defineProperty(t,"parseArrayLiteral",{enumerable:!0,get:function(){return g.parseArrayLiteral}}),Object.defineProperty(t,"parseGeometricLiteral",{enumerable:!0,get:function(){return g.parseGeometricLiteral}}),Object.defineProperty(t,"parseIntervalLiteral",{enumerable:!0,get:function(){return g.parseIntervalLiteral}}),Object.defineProperty(t,"parseWithComments",{enumerable:!0,get:function(){return g.parseWithComments}});var a=i(5);Object.defineProperty(t,"astVisitor",{enumerable:!0,get:function(){return a.astVisitor}});var s=i(2);Object.defineProperty(t,"arrayNilMap",{enumerable:!0,get:function(){return s.arrayNilMap}}),Object.defineProperty(t,"assignChanged",{enumerable:!0,get:function(){return s.assignChanged}}),Object.defineProperty(t,"astMapper",{enumerable:!0,get:function(){return s.astMapper}});var I=i(19);Object.defineProperty(t,"toSql",{enumerable:!0,get:function(){return I.toSql}}),o(i(21),t);var r=i(4);Object.defineProperty(t,"intervalToString",{enumerable:!0,get:function(){return r.intervalToString}}),Object.defineProperty(t,"normalizeInterval",{enumerable:!0,get:function(){return r.normalizeInterval}})},function(e,t,i){var n=this&&this.__importDefault||function(Q){return Q&&Q.__esModule?Q:{default:Q}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseGeometricLiteral=t.parseIntervalLiteral=t.parseArrayLiteral=t.parse=t.parseWithComments=t.parseFirst=void 0;const o=i(9),g=n(i(10)),a=n(i(11)),s=n(i(13)),I=n(i(15)),r=n(i(17)),C=i(4),l=i(1);let c,B,E,u,d;function f(Q){return y(Q)[0]}t.parseFirst=f;function w(Q,k){return(0,l.trackingComments)(()=>y(Q,k))}t.parseWithComments=w;function y(Q,k){c||(c=o.Grammar.fromCompiled(g.default));const h=typeof k=="string"?k:k==null?void 0:k.entry,N=typeof k=="string"?null:k,v=()=>F(Q,c,h);let K=N!=null&&N.locationTracking?(0,l.tracking)(v):v();return typeof k!="string"&&!Array.isArray(K)&&(K=[K]),K}t.parse=y;function G(Q){return B||(B=o.Grammar.fromCompiled(a.default)),F(Q,B)}t.parseArrayLiteral=G;function R(Q){if(Q.startsWith("P"))return d||(d=o.Grammar.fromCompiled(r.default)),(0,C.buildInterval)(Q,F(Q,d));{u||(u=o.Grammar.fromCompiled(I.default));const k=Q.toLowerCase();return(0,C.buildInterval)(Q,F(k,u))}}t.parseIntervalLiteral=R;function x(Q,k){return E||(E=o.Grammar.fromCompiled(s.default)),F(Q,E,k)}t.parseGeometricLiteral=x;function F(Q,k,h){try{k.start=h??"main";const N=new o.Parser(k);N.feed(Q);const v=N.finish();if(v.length){if(v.length!==1)throw new Error(`💀 Ambiguous SQL syntax: Please file an issue stating the request that has failed at https://github.com/oguimbal/pgsql-ast-parser:

        ${Q}

        `)}else throw new Error("Unexpected end of input");return v[0]}catch(N){if(typeof(N==null?void 0:N.message)!="string")throw N;let v=N.message,K=null;const U=[],V=/A (.+) token based on:/g;let X;for(;X=V.exec(v);)K=K??v.substr(0,X.index),U.push(`    - A "${X[1]}" token`);throw K&&(v=K+U.join(`
`)+`

`),N.message=v,N}}},function(e,t){e.exports=S3e()},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});function n(Q){return Q[0]}const o=i(1),g=i(1);function a(Q){return s(Q,void 0)}function s(Q,k){const h=u(Q);return!k||k.length===0?(0,g.track)(Q,{name:h}):(0,g.track)(Q,{name:h,columns:k.map(N=>({name:u(N)}))})}function I(Q){const k=u(Q);return(0,g.track)(Q,{value:k})}function r(Q){return Array.isArray(Q)&&Q.length===1&&(Q=r(Q[0])),Array.isArray(Q)&&!Q.length?null:(0,g.unbox)(Q)}const C=Q=>k=>(0,g.track)(k,k[Q]),l=Q=>Array.isArray(Q)?(0,g.track)(Q[Q.length-1],Q[Q.length-1]):Q;function c(Q){if(Array.isArray(Q)){const k=[];for(const h of Q)k.push(...c(h));return k}return Q?[Q]:[]}function B(Q){var k;return Q=(0,g.unbox)(Q),(k=Q==null?void 0:Q.value)!==null&&k!==void 0?k:Q}function E(Q){return c((0,g.unbox)(Q)).filter(k=>!!k).map(k=>B(k)).filter(k=>typeof k=="string").map(k=>k.trim()).filter(k=>!!k)}function u(Q,k){return E(Q).join(k||"")}function d(Q){const k={};for(const[h,N]of Q)k[h]=N;return k}const f={sensitivity:"accent"},w=(Q,k)=>Q.localeCompare(k,void 0,f)===0,y=Q=>(k,h,N)=>{const v=B(k[0]);return w(v,Q)?(0,g.box)(k,Q):N},G=y,R=(...Q)=>{const k=new Set(Q);return(h,N,v)=>{const K=typeof h[0]=="string"?h[0]:h[0].value;return k.has(K)?K:v}};function x(Q,k){const h=new Set,N=k.map(g.unbox);for(const[v,K]of N){if(h.has(v))throw new Error("conflicting or redundant options");h.add(v),Q[v]=(0,g.unbox)(K)}}const F={Lexer:o.lexerAny,ParserRules:[{name:"lparen",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen]},{name:"rparen",symbols:[o.lexerAny.has("rparen")?{type:"rparen"}:rparen]},{name:"number$subexpression$1",symbols:["float"]},{name:"number$subexpression$1",symbols:["int"]},{name:"number",symbols:["number$subexpression$1"],postprocess:r},{name:"dot",symbols:[o.lexerAny.has("dot")?{type:"dot"}:dot],postprocess:n},{name:"float",symbols:[o.lexerAny.has("float")?{type:"float"}:float],postprocess:Q=>(0,g.box)(Q,parseFloat(r(Q)))},{name:"int",symbols:[o.lexerAny.has("int")?{type:"int"}:int],postprocess:Q=>(0,g.box)(Q,parseInt(r(Q),10))},{name:"comma",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma],postprocess:n},{name:"star",symbols:[o.lexerAny.has("star")?{type:"star"}:star],postprocess:Q=>(0,g.box)(Q,Q[0].value)},{name:"string$subexpression$1",symbols:[o.lexerAny.has("string")?{type:"string"}:string]},{name:"string$subexpression$1",symbols:[o.lexerAny.has("eString")?{type:"eString"}:eString]},{name:"string",symbols:["string$subexpression$1"],postprocess:Q=>(0,g.box)(Q,r(Q[0]).value)},{name:"ident",symbols:["word"],postprocess:C(0)},{name:"word",symbols:[o.lexerAny.has("kw_primary")?{type:"kw_primary"}:kw_primary],postprocess:Q=>(0,g.box)(Q,"primary")},{name:"word",symbols:[o.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique],postprocess:Q=>(0,g.box)(Q,"unique")},{name:"word",symbols:[o.lexerAny.has("quoted_word")?{type:"quoted_word"}:quoted_word],postprocess:Q=>(0,g.box)(Q,Q[0].value,!0)},{name:"word",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:Q=>(0,g.box)(Q,Q[0].value)},{name:"collist_paren",symbols:["lparen","collist","rparen"],postprocess:C(1)},{name:"collist$ebnf$1",symbols:[]},{name:"collist$ebnf$1$subexpression$1",symbols:["comma","ident"],postprocess:l},{name:"collist$ebnf$1",symbols:["collist$ebnf$1","collist$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"collist",symbols:["ident","collist$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"kw_between",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("between")},{name:"kw_conflict",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("conflict")},{name:"kw_nothing",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("nothing")},{name:"kw_begin",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("begin")},{name:"kw_if",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("if")},{name:"kw_exists",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("exists")},{name:"kw_key",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("key")},{name:"kw_index",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("index")},{name:"kw_extension",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("extension")},{name:"kw_schema",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("schema")},{name:"kw_nulls",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("nulls")},{name:"kw_first",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("first")},{name:"kw_last",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("last")},{name:"kw_start",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("start")},{name:"kw_restart",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("restart")},{name:"kw_filter",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("filter")},{name:"kw_commit",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("commit")},{name:"kw_tablespace",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("tablespace")},{name:"kw_transaction",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("transaction")},{name:"kw_work",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("work")},{name:"kw_read",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("read")},{name:"kw_write",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("write")},{name:"kw_isolation",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("isolation")},{name:"kw_level",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("level")},{name:"kw_serializable",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("serializable")},{name:"kw_rollback",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("rollback")},{name:"kw_insert",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("insert")},{name:"kw_value",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("value")},{name:"kw_values",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("values")},{name:"kw_update",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("update")},{name:"kw_column",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("column")},{name:"kw_set",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("set")},{name:"kw_version",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("version")},{name:"kw_alter",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("alter")},{name:"kw_rename",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("rename")},{name:"kw_sequence",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("sequence")},{name:"kw_temp",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("temp")},{name:"kw_temporary",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("temporary")},{name:"kw_add",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("add")},{name:"kw_owner",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("owner")},{name:"kw_owned",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("owned")},{name:"kw_including",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("including")},{name:"kw_excluding",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("excluding")},{name:"kw_none",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("none")},{name:"kw_drop",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("drop")},{name:"kw_operator",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("operator")},{name:"kw_minvalue",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("minvalue")},{name:"kw_maxvalue",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("maxvalue")},{name:"kw_data",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("data")},{name:"kw_type",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("type")},{name:"kw_trigger",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("trigger")},{name:"kw_delete",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("delete")},{name:"kw_cache",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("cache")},{name:"kw_cascade",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("cascade")},{name:"kw_no",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("no")},{name:"kw_timestamp",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("timestamp")},{name:"kw_cycle",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("cycle")},{name:"kw_function",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("function")},{name:"kw_returns",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("returns")},{name:"kw_language",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("language")},{name:"kw_out",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("out")},{name:"kw_inout",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("inout")},{name:"kw_variadic",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("variadic")},{name:"kw_action",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("action")},{name:"kw_restrict",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("restrict")},{name:"kw_truncate",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("truncate")},{name:"kw_increment",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("increment")},{name:"kw_by",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("by")},{name:"kw_row",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("row")},{name:"kw_rows",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("rows")},{name:"kw_next",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("next")},{name:"kw_match",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("match")},{name:"kw_replace",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("replace")},{name:"kw_recursive",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("recursive")},{name:"kw_view",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("view")},{name:"kw_cascaded",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("cascaded")},{name:"kw_unlogged",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("unlogged")},{name:"kw_global",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("global")},{name:"kw_option",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("option")},{name:"kw_materialized",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("materialized")},{name:"kw_partial",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("partial")},{name:"kw_partition",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("partition")},{name:"kw_simple",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("simple")},{name:"kw_generated",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("generated")},{name:"kw_always",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("always")},{name:"kw_identity",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("identity")},{name:"kw_name",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("name")},{name:"kw_enum",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("enum")},{name:"kw_show",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("show")},{name:"kw_ordinality",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("ordinality")},{name:"kw_overriding",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("overriding")},{name:"kw_over",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("over")},{name:"kw_system",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("system")},{name:"kw_comment",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("comment")},{name:"kw_time",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("time")},{name:"kw_at",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("at")},{name:"kw_zone",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("zone")},{name:"kw_interval",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("interval")},{name:"kw_hour",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("hour")},{name:"kw_minute",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("minute")},{name:"kw_local",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("local")},{name:"kw_prepare",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("prepare")},{name:"kw_deallocate",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("deallocate")},{name:"kw_raise",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("raise")},{name:"kw_continue",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("continue")},{name:"kw_share",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("share")},{name:"kw_refresh",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("refresh")},{name:"kw_nowait",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("nowait")},{name:"kw_skip",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("skip")},{name:"kw_locked",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("locked")},{name:"kw_ifnotexists",symbols:["kw_if",o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not,"kw_exists"]},{name:"kw_ifexists",symbols:["kw_if","kw_exists"]},{name:"kw_withordinality",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"kw_ordinality"]},{name:"kw_not_null",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not,o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"kw_primary_key",symbols:[o.lexerAny.has("kw_primary")?{type:"kw_primary"}:kw_primary,"kw_key"]},{name:"data_type$ebnf$1$subexpression$1$macrocall$2",symbols:["int"]},{name:"data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1",symbols:[]},{name:"data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"data_type$ebnf$1$subexpression$1$macrocall$2"],postprocess:l},{name:"data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1",symbols:["data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1","data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"data_type$ebnf$1$subexpression$1$macrocall$1",symbols:["data_type$ebnf$1$subexpression$1$macrocall$2","data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"data_type$ebnf$1$subexpression$1",symbols:["lparen","data_type$ebnf$1$subexpression$1$macrocall$1","rparen"],postprocess:C(1)},{name:"data_type$ebnf$1",symbols:["data_type$ebnf$1$subexpression$1"],postprocess:n},{name:"data_type$ebnf$1",symbols:[],postprocess:()=>null},{name:"data_type$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1",symbols:["data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1"]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$2",symbols:[o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1",symbols:["data_type$ebnf$2$subexpression$1$ebnf$1","data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$2"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"data_type$ebnf$2$subexpression$1",symbols:["data_type$ebnf$2$subexpression$1$ebnf$1"]},{name:"data_type$ebnf$2",symbols:["data_type$ebnf$2$subexpression$1"],postprocess:n},{name:"data_type$ebnf$2",symbols:[],postprocess:()=>null},{name:"data_type",symbols:["data_type_simple","data_type$ebnf$1","data_type$ebnf$2"],postprocess:Q=>{let k=Q[2];const h=r(Q[0]);let N;if(N={...h,...Array.isArray(Q[1])&&Q[1].length?{config:Q[1].map(r)}:{}},k){k[0].type==="kw_array"&&(k=[["array"]]);for(const v of k[0])N={kind:"array",arrayOf:N}}return(0,g.track)(Q,N)}},{name:"data_type_list$ebnf$1",symbols:[]},{name:"data_type_list$ebnf$1$subexpression$1",symbols:["comma","data_type"],postprocess:l},{name:"data_type_list$ebnf$1",symbols:["data_type_list$ebnf$1","data_type_list$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"data_type_list",symbols:["data_type","data_type_list$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"data_type_simple",symbols:["data_type_text"],postprocess:Q=>(0,g.track)(Q,{name:u(Q," ")})},{name:"data_type_simple",symbols:["data_type_numeric"],postprocess:Q=>(0,g.track)(Q,{name:u(Q," ")})},{name:"data_type_simple",symbols:["data_type_date"]},{name:"data_type_simple",symbols:["qualified_name_mark_quotes"]},{name:"data_type_numeric$subexpression$1",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("double")},{name:"data_type_numeric",symbols:["data_type_numeric$subexpression$1",o.lexerAny.has("kw_precision")?{type:"kw_precision"}:kw_precision]},{name:"data_type_text$subexpression$1",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("character","bit")},{name:"data_type_text$subexpression$2",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("varying")},{name:"data_type_text",symbols:["data_type_text$subexpression$1","data_type_text$subexpression$2"]},{name:"data_type_date$subexpression$1",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("timestamp","time")},{name:"data_type_date$subexpression$2",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with]},{name:"data_type_date$subexpression$2",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("without")},{name:"data_type_date$subexpression$3",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("time")},{name:"data_type_date$subexpression$4",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("zone")},{name:"data_type_date",symbols:["data_type_date$subexpression$1","data_type_date$subexpression$2","data_type_date$subexpression$3","data_type_date$subexpression$4"],postprocess:Q=>(0,g.track)(Q,{name:u(Q," ")})},{name:"data_type_date$subexpression$5",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("timestamp","time")},{name:"data_type_date$subexpression$6",symbols:["lparen","int","rparen"],postprocess:C(1)},{name:"data_type_date$subexpression$7",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with]},{name:"data_type_date$subexpression$7",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("without")},{name:"data_type_date$subexpression$8",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("time")},{name:"data_type_date$subexpression$9",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("zone")},{name:"data_type_date",symbols:["data_type_date$subexpression$5","data_type_date$subexpression$6","data_type_date$subexpression$7","data_type_date$subexpression$8","data_type_date$subexpression$9"],postprocess:Q=>(0,g.track)(Q,{name:`timestamp ${u(Q[2])} time zone`,config:[(0,g.unbox)(Q[1])]})},{name:"ident_aliased$subexpression$1",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"ident"],postprocess:l},{name:"ident_aliased",symbols:["ident_aliased$subexpression$1"]},{name:"ident_aliased",symbols:["ident"],postprocess:r},{name:"table_ref",symbols:["qualified_name"],postprocess:r},{name:"qcolumn$ebnf$1$subexpression$1",symbols:["dot","ident"],postprocess:l},{name:"qcolumn$ebnf$1",symbols:["qcolumn$ebnf$1$subexpression$1"],postprocess:n},{name:"qcolumn$ebnf$1",symbols:[],postprocess:()=>null},{name:"qcolumn",symbols:["ident","dot","ident","qcolumn$ebnf$1"],postprocess:Q=>Q[3]?(0,g.track)(Q,{schema:(0,g.unbox)(Q[0]),table:(0,g.unbox)(Q[2]),column:(0,g.unbox)(Q[3])}):(0,g.track)(Q,{table:(0,g.unbox)(Q[0]),column:(0,g.unbox)(Q[2])})},{name:"table_ref_aliased$ebnf$1",symbols:["ident_aliased"],postprocess:n},{name:"table_ref_aliased$ebnf$1",symbols:[],postprocess:()=>null},{name:"table_ref_aliased",symbols:["table_ref","table_ref_aliased$ebnf$1"],postprocess:Q=>{const k=r(Q[1]);return(0,g.track)(Q,{...r(Q[0]),...k?{alias:k}:{}})}},{name:"qualified_name",symbols:["qname_ident"],postprocess:Q=>(0,g.track)(Q,{name:u(Q)})},{name:"qualified_name",symbols:["ident","dot","ident_extended"],postprocess:Q=>{const k=u(Q[0]),h=u(Q[2]);return(0,g.track)(Q,{schema:k,name:h})}},{name:"qualified_name",symbols:[o.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema],postprocess:Q=>(0,g.track)(Q,{name:"current_schema"})},{name:"qualified_name_mark_quotes",symbols:["qname_ident"],postprocess:Q=>(0,g.track)(Q,{name:u(Q),...(0,g.doubleQuoted)(Q)})},{name:"qualified_name_mark_quotes",symbols:["ident","dot","ident_extended"],postprocess:Q=>{const k=u(Q[0]),h=u(Q[2]);return(0,g.track)(Q,{schema:k,name:h,...(0,g.doubleQuoted)(Q[2])})}},{name:"qualified_name_mark_quotes",symbols:[o.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema],postprocess:Q=>(0,g.track)(Q,{name:"current_schema"})},{name:"qname_ident",symbols:["ident"]},{name:"qname_ident",symbols:[o.lexerAny.has("kw_precision")?{type:"kw_precision"}:kw_precision]},{name:"qname",symbols:["qualified_name"],postprocess:r},{name:"any_keyword",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_analyse")?{type:"kw_analyse"}:kw_analyse]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_analyze")?{type:"kw_analyze"}:kw_analyze]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_and")?{type:"kw_and"}:kw_and]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_any")?{type:"kw_any"}:kw_any]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_asc")?{type:"kw_asc"}:kw_asc]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_asymmetric")?{type:"kw_asymmetric"}:kw_asymmetric]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_authorization")?{type:"kw_authorization"}:kw_authorization]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_binary")?{type:"kw_binary"}:kw_binary]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_both")?{type:"kw_both"}:kw_both]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_case")?{type:"kw_case"}:kw_case]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_cast")?{type:"kw_cast"}:kw_cast]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_collate")?{type:"kw_collate"}:kw_collate]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_collation")?{type:"kw_collation"}:kw_collation]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_concurrently")?{type:"kw_concurrently"}:kw_concurrently]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_cross")?{type:"kw_cross"}:kw_cross]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_catalog")?{type:"kw_current_catalog"}:kw_current_catalog]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_date")?{type:"kw_current_date"}:kw_current_date]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_role")?{type:"kw_current_role"}:kw_current_role]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_time")?{type:"kw_current_time"}:kw_current_time]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_timestamp")?{type:"kw_current_timestamp"}:kw_current_timestamp]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_user")?{type:"kw_current_user"}:kw_current_user]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_deferrable")?{type:"kw_deferrable"}:kw_deferrable]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_desc")?{type:"kw_desc"}:kw_desc]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_distinct")?{type:"kw_distinct"}:kw_distinct]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_else")?{type:"kw_else"}:kw_else]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_end")?{type:"kw_end"}:kw_end]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_except")?{type:"kw_except"}:kw_except]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_fetch")?{type:"kw_fetch"}:kw_fetch]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_foreign")?{type:"kw_foreign"}:kw_foreign]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_freeze")?{type:"kw_freeze"}:kw_freeze]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_full")?{type:"kw_full"}:kw_full]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_grant")?{type:"kw_grant"}:kw_grant]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_group")?{type:"kw_group"}:kw_group]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_having")?{type:"kw_having"}:kw_having]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_ilike")?{type:"kw_ilike"}:kw_ilike]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_in")?{type:"kw_in"}:kw_in]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_initially")?{type:"kw_initially"}:kw_initially]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_inner")?{type:"kw_inner"}:kw_inner]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_intersect")?{type:"kw_intersect"}:kw_intersect]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_into")?{type:"kw_into"}:kw_into]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_isnull")?{type:"kw_isnull"}:kw_isnull]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_join")?{type:"kw_join"}:kw_join]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_lateral")?{type:"kw_lateral"}:kw_lateral]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_leading")?{type:"kw_leading"}:kw_leading]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_left")?{type:"kw_left"}:kw_left]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_like")?{type:"kw_like"}:kw_like]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_limit")?{type:"kw_limit"}:kw_limit]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_localtime")?{type:"kw_localtime"}:kw_localtime]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_localtimestamp")?{type:"kw_localtimestamp"}:kw_localtimestamp]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_natural")?{type:"kw_natural"}:kw_natural]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_notnull")?{type:"kw_notnull"}:kw_notnull]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_offset")?{type:"kw_offset"}:kw_offset]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_order")?{type:"kw_order"}:kw_order]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_overlaps")?{type:"kw_overlaps"}:kw_overlaps]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_placing")?{type:"kw_placing"}:kw_placing]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_primary")?{type:"kw_primary"}:kw_primary]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_references")?{type:"kw_references"}:kw_references]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_right")?{type:"kw_right"}:kw_right]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_select")?{type:"kw_select"}:kw_select]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_session_user")?{type:"kw_session_user"}:kw_session_user]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_similar")?{type:"kw_similar"}:kw_similar]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_some")?{type:"kw_some"}:kw_some]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_symmetric")?{type:"kw_symmetric"}:kw_symmetric]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_tablesample")?{type:"kw_tablesample"}:kw_tablesample]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_then")?{type:"kw_then"}:kw_then]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_trailing")?{type:"kw_trailing"}:kw_trailing]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_union")?{type:"kw_union"}:kw_union]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_user")?{type:"kw_user"}:kw_user]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_variadic")?{type:"kw_variadic"}:kw_variadic]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_verbose")?{type:"kw_verbose"}:kw_verbose]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_when")?{type:"kw_when"}:kw_when]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_window")?{type:"kw_window"}:kw_window]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with]},{name:"ident_extended",symbols:["ident"]},{name:"ident_extended",symbols:["any_keyword"]},{name:"select_statement$ebnf$1",symbols:["select_from"],postprocess:n},{name:"select_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$2",symbols:["select_where"],postprocess:n},{name:"select_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$3$subexpression$1$ebnf$1",symbols:["select_having"],postprocess:n},{name:"select_statement$ebnf$3$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$3$subexpression$1",symbols:["select_groupby","select_statement$ebnf$3$subexpression$1$ebnf$1"]},{name:"select_statement$ebnf$3",symbols:["select_statement$ebnf$3$subexpression$1"],postprocess:n},{name:"select_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$4",symbols:["select_order_by"],postprocess:n},{name:"select_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$5",symbols:["select_limit_offset"],postprocess:n},{name:"select_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$6$subexpression$1$ebnf$1",symbols:["select_skip"],postprocess:n},{name:"select_statement$ebnf$6$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$6$subexpression$1",symbols:["select_for","select_statement$ebnf$6$subexpression$1$ebnf$1"]},{name:"select_statement$ebnf$6",symbols:["select_statement$ebnf$6$subexpression$1"],postprocess:n},{name:"select_statement$ebnf$6",symbols:[],postprocess:()=>null},{name:"select_statement",symbols:["select_what","select_statement$ebnf$1","select_statement$ebnf$2","select_statement$ebnf$3","select_statement$ebnf$4","select_statement$ebnf$5","select_statement$ebnf$6"],postprocess:Q=>{let[k,h,N,v,K,U,V]=Q;h=r(h);let X=v&&v[0],_=v&&v[1];X=X&&(X.length===1&&X[0].type==="list"?X[0].expressions:X),_=_&&r(_);let q=V&&V[0],$=V&&V[1];return $=r($),(0,g.track)(Q,{...k,...h?{from:Array.isArray(h)?h:[h]}:{},...X?{groupBy:X}:{},..._?{having:_}:{},...U?{limit:r(U)}:{},...K?{orderBy:K}:{},...N?{where:N}:{},...q?{for:q[1]}:{},...$?{skip:$}:{},type:"select"})}},{name:"select_from",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"select_from_items"],postprocess:l},{name:"select_from_items$ebnf$1",symbols:[]},{name:"select_from_items$ebnf$1$subexpression$1",symbols:["comma","select_from_item"],postprocess:l},{name:"select_from_items$ebnf$1",symbols:["select_from_items$ebnf$1","select_from_items$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"select_from_items",symbols:["select_from_item","select_from_items$ebnf$1"],postprocess:([Q,k])=>[...Q,...c(k)||[]]},{name:"select_from_item",symbols:["select_from_subject"]},{name:"select_from_item",symbols:["select_from_item_joins"],postprocess:C(0)},{name:"select_from_item_joins$subexpression$1",symbols:["select_from_item"],postprocess:C(0)},{name:"select_from_item_joins",symbols:["select_from_item_joins$subexpression$1","select_table_join"],postprocess:c},{name:"select_from_item_joins",symbols:["lparen","select_from_item_joins","rparen"],postprocess:C(1)},{name:"select_from_subject",symbols:["stb_table"],postprocess:r},{name:"select_from_subject",symbols:["stb_statement"],postprocess:r},{name:"select_from_subject",symbols:["stb_call"],postprocess:r},{name:"stb_opts$ebnf$1",symbols:["collist_paren"],postprocess:n},{name:"stb_opts$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_opts",symbols:["ident_aliased","stb_opts$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{alias:u(Q[0]),...Q[1]&&{columnNames:(0,g.unbox)(Q[1]).map(a)}})},{name:"stb_table$ebnf$1",symbols:["stb_opts"],postprocess:n},{name:"stb_table$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_table",symbols:["table_ref","stb_table$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{type:"table",name:(0,g.track)(Q,{...Q[0],...Q[1]})})},{name:"stb_statement",symbols:["selection_paren","stb_opts"],postprocess:Q=>(0,g.track)(Q,{type:"statement",statement:r(Q[0]),...Q[1]})},{name:"select_values",symbols:["kw_values","insert_values"],postprocess:Q=>(0,g.track)(Q,{type:"values",values:Q[1]})},{name:"stb_call$ebnf$1",symbols:["kw_withordinality"],postprocess:n},{name:"stb_call$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_call$ebnf$2",symbols:["stb_call_alias"],postprocess:n},{name:"stb_call$ebnf$2",symbols:[],postprocess:()=>null},{name:"stb_call",symbols:["expr_function_call","stb_call$ebnf$1","stb_call$ebnf$2"],postprocess:Q=>{const k=Q[1],h=Q[2];return!k&&!h?Q[0]:(0,g.track)(Q,{...Q[0],...k&&{withOrdinality:!0},alias:h?s(h[0],h[1]):void 0})}},{name:"stb_call_alias$subexpression$1$ebnf$1",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as],postprocess:n},{name:"stb_call_alias$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_call_alias$subexpression$1",symbols:["stb_call_alias$subexpression$1$ebnf$1","ident"],postprocess:l},{name:"stb_call_alias$ebnf$1",symbols:["stb_call_alias_list"],postprocess:n},{name:"stb_call_alias$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_call_alias",symbols:["stb_call_alias$subexpression$1","stb_call_alias$ebnf$1"]},{name:"stb_call_alias_list",symbols:["lparen","stb_call_alias_list_raw","rparen"],postprocess:C(1)},{name:"stb_call_alias_list_raw$ebnf$1",symbols:[]},{name:"stb_call_alias_list_raw$ebnf$1$subexpression$1",symbols:["comma","ident"],postprocess:l},{name:"stb_call_alias_list_raw$ebnf$1",symbols:["stb_call_alias_list_raw$ebnf$1","stb_call_alias_list_raw$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"stb_call_alias_list_raw",symbols:["ident","stb_call_alias_list_raw$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"select_table_join$ebnf$1",symbols:["select_table_join_clause"],postprocess:n},{name:"select_table_join$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_table_join",symbols:["select_join_op",o.lexerAny.has("kw_join")?{type:"kw_join"}:kw_join,"select_from_subject","select_table_join$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{...r(Q[2]),join:{type:u(Q[0]," "),...Q[3]&&r(Q[3])}})},{name:"select_table_join_clause",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"expr"],postprocess:Q=>(0,g.track)(Q,{on:l(Q)})},{name:"select_table_join_clause$macrocall$2",symbols:["ident"]},{name:"select_table_join_clause$macrocall$1$ebnf$1",symbols:[]},{name:"select_table_join_clause$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"select_table_join_clause$macrocall$2"],postprocess:l},{name:"select_table_join_clause$macrocall$1$ebnf$1",symbols:["select_table_join_clause$macrocall$1$ebnf$1","select_table_join_clause$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"select_table_join_clause$macrocall$1",symbols:["select_table_join_clause$macrocall$2","select_table_join_clause$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"select_table_join_clause",symbols:[o.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using,"lparen","select_table_join_clause$macrocall$1","rparen"],postprocess:Q=>(0,g.track)(Q,{using:Q[2].map(a)})},{name:"select_join_op$subexpression$1$ebnf$1",symbols:[o.lexerAny.has("kw_inner")?{type:"kw_inner"}:kw_inner],postprocess:n},{name:"select_join_op$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$1",symbols:["select_join_op$subexpression$1$ebnf$1"],postprocess:Q=>(0,g.box)(Q,"INNER JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$1"]},{name:"select_join_op$subexpression$2",symbols:[o.lexerAny.has("kw_cross")?{type:"kw_cross"}:kw_cross],postprocess:Q=>(0,g.box)(Q,"CROSS JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$2"]},{name:"select_join_op$subexpression$3$ebnf$1",symbols:[o.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer],postprocess:n},{name:"select_join_op$subexpression$3$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$3",symbols:[o.lexerAny.has("kw_left")?{type:"kw_left"}:kw_left,"select_join_op$subexpression$3$ebnf$1"],postprocess:Q=>(0,g.box)(Q,"LEFT JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$3"]},{name:"select_join_op$subexpression$4$ebnf$1",symbols:[o.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer],postprocess:n},{name:"select_join_op$subexpression$4$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$4",symbols:[o.lexerAny.has("kw_right")?{type:"kw_right"}:kw_right,"select_join_op$subexpression$4$ebnf$1"],postprocess:Q=>(0,g.box)(Q,"RIGHT JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$4"]},{name:"select_join_op$subexpression$5$ebnf$1",symbols:[o.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer],postprocess:n},{name:"select_join_op$subexpression$5$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$5",symbols:[o.lexerAny.has("kw_full")?{type:"kw_full"}:kw_full,"select_join_op$subexpression$5$ebnf$1"],postprocess:Q=>(0,g.box)(Q,"FULL JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$5"]},{name:"select_what$ebnf$1",symbols:["select_distinct"],postprocess:n},{name:"select_what$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_what$ebnf$2",symbols:["select_expr_list_aliased"],postprocess:n},{name:"select_what$ebnf$2",symbols:[],postprocess:()=>null},{name:"select_what",symbols:[o.lexerAny.has("kw_select")?{type:"kw_select"}:kw_select,"select_what$ebnf$1","select_what$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{columns:Q[2],...Q[1]&&{distinct:(0,g.unbox)(Q[1])}})},{name:"select_expr_list_aliased$ebnf$1",symbols:[]},{name:"select_expr_list_aliased$ebnf$1$subexpression$1",symbols:["comma","select_expr_list_item"],postprocess:l},{name:"select_expr_list_aliased$ebnf$1",symbols:["select_expr_list_aliased$ebnf$1","select_expr_list_aliased$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"select_expr_list_aliased",symbols:["select_expr_list_item","select_expr_list_aliased$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"select_expr_list_item$ebnf$1",symbols:["ident_aliased"],postprocess:n},{name:"select_expr_list_item$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_expr_list_item",symbols:["expr","select_expr_list_item$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{expr:Q[0],...Q[1]?{alias:a(Q[1])}:{}})},{name:"select_distinct",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all],postprocess:Q=>(0,g.box)(Q,"all")},{name:"select_distinct$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"lparen","expr_list_raw","rparen"],postprocess:C(2)},{name:"select_distinct$ebnf$1",symbols:["select_distinct$ebnf$1$subexpression$1"],postprocess:n},{name:"select_distinct$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_distinct",symbols:[o.lexerAny.has("kw_distinct")?{type:"kw_distinct"}:kw_distinct,"select_distinct$ebnf$1"],postprocess:Q=>(0,g.box)(Q,Q[1]||"distinct")},{name:"select_where",symbols:[o.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr"],postprocess:l},{name:"select_groupby",symbols:[o.lexerAny.has("kw_group")?{type:"kw_group"}:kw_group,"kw_by","expr_list_raw"],postprocess:l},{name:"select_having",symbols:[o.lexerAny.has("kw_having")?{type:"kw_having"}:kw_having,"expr"],postprocess:l},{name:"select_limit_offset$ebnf$1$subexpression$1",symbols:["select_offset"]},{name:"select_limit_offset$ebnf$1$subexpression$1",symbols:["select_limit"]},{name:"select_limit_offset$ebnf$1",symbols:["select_limit_offset$ebnf$1$subexpression$1"]},{name:"select_limit_offset$ebnf$1$subexpression$2",symbols:["select_offset"]},{name:"select_limit_offset$ebnf$1$subexpression$2",symbols:["select_limit"]},{name:"select_limit_offset$ebnf$1",symbols:["select_limit_offset$ebnf$1","select_limit_offset$ebnf$1$subexpression$2"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"select_limit_offset",symbols:["select_limit_offset$ebnf$1"],postprocess:(Q,k)=>{const h=r(Q);if(!Array.isArray(h))return(0,g.track)(Q,h);if(h.length!=2)return k;const N=r(h[0]),v=r(h[1]);return N.offset&&v.offset||N.limit&&v.limit?k:(0,g.track)(Q,{...N,...v})}},{name:"select_offset$ebnf$1$subexpression$1",symbols:["kw_row"]},{name:"select_offset$ebnf$1$subexpression$1",symbols:["kw_rows"]},{name:"select_offset$ebnf$1",symbols:["select_offset$ebnf$1$subexpression$1"],postprocess:n},{name:"select_offset$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_offset",symbols:[o.lexerAny.has("kw_offset")?{type:"kw_offset"}:kw_offset,"expr_nostar","select_offset$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{offset:r(Q[1])})},{name:"select_limit$subexpression$1",symbols:["select_limit_1"]},{name:"select_limit$subexpression$1",symbols:["select_limit_2"]},{name:"select_limit",symbols:["select_limit$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{limit:r(Q)})},{name:"select_limit_1",symbols:[o.lexerAny.has("kw_limit")?{type:"kw_limit"}:kw_limit,"expr_nostar"],postprocess:l},{name:"select_limit_2$ebnf$1$subexpression$1",symbols:["kw_first"]},{name:"select_limit_2$ebnf$1$subexpression$1",symbols:["kw_next"]},{name:"select_limit_2$ebnf$1",symbols:["select_limit_2$ebnf$1$subexpression$1"],postprocess:n},{name:"select_limit_2$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_limit_2$subexpression$1",symbols:["kw_row"]},{name:"select_limit_2$subexpression$1",symbols:["kw_rows"]},{name:"select_limit_2",symbols:[o.lexerAny.has("kw_fetch")?{type:"kw_fetch"}:kw_fetch,"select_limit_2$ebnf$1","expr_nostar","select_limit_2$subexpression$1",o.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only],postprocess:C(2)},{name:"select_for$subexpression$1",symbols:["kw_update"],postprocess:Q=>(0,g.track)(Q,{type:"update"})},{name:"select_for$subexpression$1",symbols:["kw_no","kw_key","kw_update"],postprocess:Q=>(0,g.track)(Q,{type:"no key update"})},{name:"select_for$subexpression$1",symbols:["kw_share"],postprocess:Q=>(0,g.track)(Q,{type:"share"})},{name:"select_for$subexpression$1",symbols:["kw_key","kw_share"],postprocess:Q=>(0,g.track)(Q,{type:"key share"})},{name:"select_for",symbols:[o.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for,"select_for$subexpression$1"]},{name:"select_skip$subexpression$1",symbols:["kw_nowait"],postprocess:Q=>(0,g.track)(Q,{type:"nowait"})},{name:"select_skip$subexpression$1",symbols:["kw_skip","kw_locked"],postprocess:Q=>(0,g.track)(Q,{type:"skip locked"})},{name:"select_skip",symbols:["select_skip$subexpression$1"]},{name:"select_order_by$subexpression$1",symbols:[o.lexerAny.has("kw_order")?{type:"kw_order"}:kw_order,"kw_by"]},{name:"select_order_by$ebnf$1",symbols:[]},{name:"select_order_by$ebnf$1$subexpression$1",symbols:["comma","select_order_by_expr"],postprocess:l},{name:"select_order_by$ebnf$1",symbols:["select_order_by$ebnf$1","select_order_by$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"select_order_by",symbols:["select_order_by$subexpression$1","select_order_by_expr","select_order_by$ebnf$1"],postprocess:([Q,k,h])=>[k,...h||[]]},{name:"select_order_by_expr$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_asc")?{type:"kw_asc"}:kw_asc]},{name:"select_order_by_expr$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_desc")?{type:"kw_desc"}:kw_desc]},{name:"select_order_by_expr$ebnf$1",symbols:["select_order_by_expr$ebnf$1$subexpression$1"],postprocess:n},{name:"select_order_by_expr$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_order_by_expr$ebnf$2$subexpression$1$subexpression$1",symbols:["kw_first"]},{name:"select_order_by_expr$ebnf$2$subexpression$1$subexpression$1",symbols:["kw_last"]},{name:"select_order_by_expr$ebnf$2$subexpression$1",symbols:["kw_nulls","select_order_by_expr$ebnf$2$subexpression$1$subexpression$1"],postprocess:l},{name:"select_order_by_expr$ebnf$2",symbols:["select_order_by_expr$ebnf$2$subexpression$1"],postprocess:n},{name:"select_order_by_expr$ebnf$2",symbols:[],postprocess:()=>null},{name:"select_order_by_expr",symbols:["expr","select_order_by_expr$ebnf$1","select_order_by_expr$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{by:Q[0],...Q[1]&&{order:u(Q[1]).toUpperCase()},...Q[2]&&{nulls:u(Q[2]).toUpperCase()}})},{name:"expr",symbols:["expr_nostar"],postprocess:r},{name:"expr",symbols:["expr_star"],postprocess:r},{name:"expr_nostar",symbols:["expr_paren"],postprocess:r},{name:"expr_nostar",symbols:["expr_or"],postprocess:r},{name:"expr_paren$subexpression$1",symbols:["expr_or_select"]},{name:"expr_paren$subexpression$1",symbols:["expr_list_many"]},{name:"expr_paren",symbols:["lparen","expr_paren$subexpression$1","rparen"],postprocess:C(1)},{name:"expr_or$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or]},{name:"expr_or$macrocall$2$macrocall$1",symbols:["expr_or$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_or$macrocall$2",symbols:["expr_or$macrocall$2$macrocall$1"]},{name:"expr_or$macrocall$3",symbols:["expr_or"]},{name:"expr_or$macrocall$4",symbols:["expr_and"]},{name:"expr_or$macrocall$1$subexpression$1",symbols:["expr_or$macrocall$3"]},{name:"expr_or$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_or$macrocall$1$subexpression$2",symbols:["expr_or$macrocall$4"]},{name:"expr_or$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_or$macrocall$1",symbols:["expr_or$macrocall$1$subexpression$1","expr_or$macrocall$2","expr_or$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_or$macrocall$1",symbols:["expr_or$macrocall$4"],postprocess:r},{name:"expr_or",symbols:["expr_or$macrocall$1"]},{name:"expr_and$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("kw_and")?{type:"kw_and"}:kw_and]},{name:"expr_and$macrocall$2$macrocall$1",symbols:["expr_and$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_and$macrocall$2",symbols:["expr_and$macrocall$2$macrocall$1"]},{name:"expr_and$macrocall$3",symbols:["expr_and"]},{name:"expr_and$macrocall$4",symbols:["expr_not"]},{name:"expr_and$macrocall$1$subexpression$1",symbols:["expr_and$macrocall$3"]},{name:"expr_and$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_and$macrocall$1$subexpression$2",symbols:["expr_and$macrocall$4"]},{name:"expr_and$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_and$macrocall$1",symbols:["expr_and$macrocall$1$subexpression$1","expr_and$macrocall$2","expr_and$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_and$macrocall$1",symbols:["expr_and$macrocall$4"],postprocess:r},{name:"expr_and",symbols:["expr_and$macrocall$1"]},{name:"expr_not$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not]},{name:"expr_not$macrocall$2$macrocall$1",symbols:["expr_not$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_not$macrocall$2",symbols:["expr_not$macrocall$2$macrocall$1"]},{name:"expr_not$macrocall$3",symbols:["expr_not"]},{name:"expr_not$macrocall$4",symbols:["expr_eq"]},{name:"expr_not$macrocall$1$subexpression$1",symbols:["expr_not$macrocall$3"]},{name:"expr_not$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_not$macrocall$1",symbols:["expr_not$macrocall$2","expr_not$macrocall$1$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"unary",...r(Q[0]),operand:r(Q[1])})},{name:"expr_not$macrocall$1",symbols:["expr_not$macrocall$4"],postprocess:r},{name:"expr_not",symbols:["expr_not$macrocall$1"]},{name:"expr_eq$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq]},{name:"expr_eq$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_neq")?{type:"op_neq"}:op_neq]},{name:"expr_eq$macrocall$2$macrocall$2",symbols:["expr_eq$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_eq$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_eq$macrocall$2$macrocall$2"]},{name:"expr_eq$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_eq$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_eq$macrocall$2$macrocall$1",symbols:["expr_eq$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_eq$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_eq$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_eq$macrocall$2",symbols:["expr_eq$macrocall$2$macrocall$1"]},{name:"expr_eq$macrocall$3",symbols:["expr_eq"]},{name:"expr_eq$macrocall$4",symbols:["expr_is"]},{name:"expr_eq$macrocall$1$subexpression$1",symbols:["expr_eq$macrocall$3"]},{name:"expr_eq$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_eq$macrocall$1$subexpression$2",symbols:["expr_eq$macrocall$4"]},{name:"expr_eq$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_eq$macrocall$1",symbols:["expr_eq$macrocall$1$subexpression$1","expr_eq$macrocall$2","expr_eq$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_eq$macrocall$1",symbols:["expr_eq$macrocall$4"],postprocess:r},{name:"expr_eq",symbols:["expr_eq$macrocall$1"]},{name:"expr_star",symbols:["star"],postprocess:Q=>(0,g.track)(Q,{type:"ref",name:"*"})},{name:"expr_is$subexpression$1",symbols:["expr_is"]},{name:"expr_is$subexpression$1",symbols:["expr_paren"]},{name:"expr_is$subexpression$2",symbols:[o.lexerAny.has("kw_isnull")?{type:"kw_isnull"}:kw_isnull]},{name:"expr_is$subexpression$2",symbols:[o.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"expr_is",symbols:["expr_is$subexpression$1","expr_is$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"unary",op:"IS NULL",operand:r(Q[0])})},{name:"expr_is$subexpression$3",symbols:["expr_is"]},{name:"expr_is$subexpression$3",symbols:["expr_paren"]},{name:"expr_is$subexpression$4",symbols:[o.lexerAny.has("kw_notnull")?{type:"kw_notnull"}:kw_notnull]},{name:"expr_is$subexpression$4",symbols:[o.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,"kw_not_null"]},{name:"expr_is",symbols:["expr_is$subexpression$3","expr_is$subexpression$4"],postprocess:Q=>(0,g.track)(Q,{type:"unary",op:"IS NOT NULL",operand:r(Q[0])})},{name:"expr_is$subexpression$5",symbols:["expr_is"]},{name:"expr_is$subexpression$5",symbols:["expr_paren"]},{name:"expr_is$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"expr_is$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_is$subexpression$6",symbols:[o.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true]},{name:"expr_is$subexpression$6",symbols:[o.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false]},{name:"expr_is",symbols:["expr_is$subexpression$5",o.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,"expr_is$ebnf$1","expr_is$subexpression$6"],postprocess:Q=>(0,g.track)(Q,{type:"unary",op:"IS "+E([Q[2],Q[3]]).join(" ").toUpperCase(),operand:r(Q[0])})},{name:"expr_is",symbols:["expr_compare"],postprocess:r},{name:"expr_compare$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("op_compare")?{type:"op_compare"}:op_compare]},{name:"expr_compare$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_compare$macrocall$2$macrocall$2"]},{name:"expr_compare$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_compare$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_compare$macrocall$2$macrocall$1",symbols:["expr_compare$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_compare$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_compare$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_compare$macrocall$2",symbols:["expr_compare$macrocall$2$macrocall$1"]},{name:"expr_compare$macrocall$3",symbols:["expr_compare"]},{name:"expr_compare$macrocall$4",symbols:["expr_range"]},{name:"expr_compare$macrocall$1$subexpression$1",symbols:["expr_compare$macrocall$3"]},{name:"expr_compare$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_compare$macrocall$1$subexpression$2",symbols:["expr_compare$macrocall$4"]},{name:"expr_compare$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_compare$macrocall$1",symbols:["expr_compare$macrocall$1$subexpression$1","expr_compare$macrocall$2","expr_compare$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_compare$macrocall$1",symbols:["expr_compare$macrocall$4"],postprocess:r},{name:"expr_compare",symbols:["expr_compare$macrocall$1"]},{name:"expr_range$macrocall$2",symbols:["ops_between"]},{name:"expr_range$macrocall$3",symbols:[o.lexerAny.has("kw_and")?{type:"kw_and"}:kw_and]},{name:"expr_range$macrocall$4",symbols:["expr_range"]},{name:"expr_range$macrocall$5",symbols:["expr_others"]},{name:"expr_range$macrocall$1$subexpression$1",symbols:["expr_range$macrocall$4"]},{name:"expr_range$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_range$macrocall$1$subexpression$2",symbols:["expr_range$macrocall$4"]},{name:"expr_range$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_range$macrocall$1$subexpression$3",symbols:["expr_range$macrocall$5"]},{name:"expr_range$macrocall$1$subexpression$3",symbols:["expr_paren"]},{name:"expr_range$macrocall$1",symbols:["expr_range$macrocall$1$subexpression$1","expr_range$macrocall$2","expr_range$macrocall$1$subexpression$2","expr_range$macrocall$3","expr_range$macrocall$1$subexpression$3"],postprocess:Q=>(0,g.track)(Q,{type:"ternary",value:r(Q[0]),lo:r(Q[2]),hi:r(Q[4]),op:(E(Q[1]).join(" ")||"<error>").toUpperCase()})},{name:"expr_range$macrocall$1",symbols:["expr_range$macrocall$5"],postprocess:r},{name:"expr_range",symbols:["expr_range$macrocall$1"]},{name:"expr_others$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("ops_others")?{type:"ops_others"}:ops_others]},{name:"expr_others$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_others$macrocall$2$macrocall$2"]},{name:"expr_others$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_others$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_others$macrocall$2$macrocall$1",symbols:["expr_others$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_others$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_others$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_others$macrocall$2",symbols:["expr_others$macrocall$2$macrocall$1"]},{name:"expr_others$macrocall$3",symbols:["expr_others"]},{name:"expr_others$macrocall$4",symbols:["expr_like"]},{name:"expr_others$macrocall$1$subexpression$1",symbols:["expr_others$macrocall$3"]},{name:"expr_others$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_others$macrocall$1$subexpression$2",symbols:["expr_others$macrocall$4"]},{name:"expr_others$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_others$macrocall$1",symbols:["expr_others$macrocall$1$subexpression$1","expr_others$macrocall$2","expr_others$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_others$macrocall$1",symbols:["expr_others$macrocall$4"],postprocess:r},{name:"expr_others",symbols:["expr_others$macrocall$1"]},{name:"expr_like$macrocall$2$macrocall$2",symbols:["ops_like"]},{name:"expr_like$macrocall$2$macrocall$1",symbols:["expr_like$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_like$macrocall$2",symbols:["expr_like$macrocall$2$macrocall$1"]},{name:"expr_like$macrocall$3",symbols:["expr_like"]},{name:"expr_like$macrocall$4",symbols:["expr_in"]},{name:"expr_like$macrocall$1$subexpression$1",symbols:["expr_like$macrocall$3"]},{name:"expr_like$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_like$macrocall$1$subexpression$2",symbols:["expr_like$macrocall$4"]},{name:"expr_like$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_like$macrocall$1",symbols:["expr_like$macrocall$1$subexpression$1","expr_like$macrocall$2","expr_like$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_like$macrocall$1",symbols:["expr_like$macrocall$4"],postprocess:r},{name:"expr_like",symbols:["expr_like$macrocall$1"]},{name:"expr_in$macrocall$2$macrocall$2",symbols:["ops_in"]},{name:"expr_in$macrocall$2$macrocall$1",symbols:["expr_in$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_in$macrocall$2",symbols:["expr_in$macrocall$2$macrocall$1"]},{name:"expr_in$macrocall$3",symbols:["expr_in"]},{name:"expr_in$macrocall$4",symbols:["expr_add"]},{name:"expr_in$macrocall$1$subexpression$1",symbols:["expr_in$macrocall$3"]},{name:"expr_in$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_in$macrocall$1$subexpression$2",symbols:["expr_in$macrocall$4"]},{name:"expr_in$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_in$macrocall$1",symbols:["expr_in$macrocall$1$subexpression$1","expr_in$macrocall$2","expr_in$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_in$macrocall$1",symbols:["expr_in$macrocall$4"],postprocess:r},{name:"expr_in",symbols:["expr_in$macrocall$1"]},{name:"expr_add$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_plus")?{type:"op_plus"}:op_plus]},{name:"expr_add$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_minus")?{type:"op_minus"}:op_minus]},{name:"expr_add$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_additive")?{type:"op_additive"}:op_additive]},{name:"expr_add$macrocall$2$macrocall$2",symbols:["expr_add$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_add$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_add$macrocall$2$macrocall$2"]},{name:"expr_add$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_add$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_add$macrocall$2$macrocall$1",symbols:["expr_add$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_add$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_add$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_add$macrocall$2",symbols:["expr_add$macrocall$2$macrocall$1"]},{name:"expr_add$macrocall$3",symbols:["expr_add"]},{name:"expr_add$macrocall$4",symbols:["expr_mult"]},{name:"expr_add$macrocall$1$subexpression$1",symbols:["expr_add$macrocall$3"]},{name:"expr_add$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_add$macrocall$1$subexpression$2",symbols:["expr_add$macrocall$4"]},{name:"expr_add$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_add$macrocall$1",symbols:["expr_add$macrocall$1$subexpression$1","expr_add$macrocall$2","expr_add$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_add$macrocall$1",symbols:["expr_add$macrocall$4"],postprocess:r},{name:"expr_add",symbols:["expr_add$macrocall$1"]},{name:"expr_mult$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("star")?{type:"star"}:star]},{name:"expr_mult$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_div")?{type:"op_div"}:op_div]},{name:"expr_mult$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_mod")?{type:"op_mod"}:op_mod]},{name:"expr_mult$macrocall$2$macrocall$2",symbols:["expr_mult$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_mult$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_mult$macrocall$2$macrocall$2"]},{name:"expr_mult$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_mult$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_mult$macrocall$2$macrocall$1",symbols:["expr_mult$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_mult$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_mult$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_mult$macrocall$2",symbols:["expr_mult$macrocall$2$macrocall$1"]},{name:"expr_mult$macrocall$3",symbols:["expr_mult"]},{name:"expr_mult$macrocall$4",symbols:["expr_exp"]},{name:"expr_mult$macrocall$1$subexpression$1",symbols:["expr_mult$macrocall$3"]},{name:"expr_mult$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_mult$macrocall$1$subexpression$2",symbols:["expr_mult$macrocall$4"]},{name:"expr_mult$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_mult$macrocall$1",symbols:["expr_mult$macrocall$1$subexpression$1","expr_mult$macrocall$2","expr_mult$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_mult$macrocall$1",symbols:["expr_mult$macrocall$4"],postprocess:r},{name:"expr_mult",symbols:["expr_mult$macrocall$1"]},{name:"expr_exp$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("op_exp")?{type:"op_exp"}:op_exp]},{name:"expr_exp$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_exp$macrocall$2$macrocall$2"]},{name:"expr_exp$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_exp$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_exp$macrocall$2$macrocall$1",symbols:["expr_exp$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_exp$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_exp$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_exp$macrocall$2",symbols:["expr_exp$macrocall$2$macrocall$1"]},{name:"expr_exp$macrocall$3",symbols:["expr_exp"]},{name:"expr_exp$macrocall$4",symbols:["expr_unary_add"]},{name:"expr_exp$macrocall$1$subexpression$1",symbols:["expr_exp$macrocall$3"]},{name:"expr_exp$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_exp$macrocall$1$subexpression$2",symbols:["expr_exp$macrocall$4"]},{name:"expr_exp$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_exp$macrocall$1",symbols:["expr_exp$macrocall$1$subexpression$1","expr_exp$macrocall$2","expr_exp$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_exp$macrocall$1",symbols:["expr_exp$macrocall$4"],postprocess:r},{name:"expr_exp",symbols:["expr_exp$macrocall$1"]},{name:"expr_unary_add$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_plus")?{type:"op_plus"}:op_plus]},{name:"expr_unary_add$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_minus")?{type:"op_minus"}:op_minus]},{name:"expr_unary_add$macrocall$2$macrocall$2",symbols:["expr_unary_add$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_unary_add$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_unary_add$macrocall$2$macrocall$2"]},{name:"expr_unary_add$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_unary_add$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_unary_add$macrocall$2$macrocall$1",symbols:["expr_unary_add$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_unary_add$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_unary_add$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_unary_add$macrocall$2",symbols:["expr_unary_add$macrocall$2$macrocall$1"]},{name:"expr_unary_add$macrocall$3",symbols:["expr_unary_add"]},{name:"expr_unary_add$macrocall$4",symbols:["expr_various_constructs"]},{name:"expr_unary_add$macrocall$1$subexpression$1",symbols:["expr_unary_add$macrocall$3"]},{name:"expr_unary_add$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_unary_add$macrocall$1",symbols:["expr_unary_add$macrocall$2","expr_unary_add$macrocall$1$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"unary",...r(Q[0]),operand:r(Q[1])})},{name:"expr_unary_add$macrocall$1",symbols:["expr_unary_add$macrocall$4"],postprocess:r},{name:"expr_unary_add",symbols:["expr_unary_add$macrocall$1"]},{name:"expr_various_constructs$macrocall$2$macrocall$2",symbols:["various_binaries"]},{name:"expr_various_constructs$macrocall$2$macrocall$1",symbols:["expr_various_constructs$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_various_constructs$macrocall$2",symbols:["expr_various_constructs$macrocall$2$macrocall$1"]},{name:"expr_various_constructs$macrocall$3",symbols:["expr_various_constructs"]},{name:"expr_various_constructs$macrocall$4",symbols:["expr_array_index"]},{name:"expr_various_constructs$macrocall$1$subexpression$1",symbols:["expr_various_constructs$macrocall$3"]},{name:"expr_various_constructs$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_various_constructs$macrocall$1$subexpression$2",symbols:["expr_various_constructs$macrocall$4"]},{name:"expr_various_constructs$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_various_constructs$macrocall$1",symbols:["expr_various_constructs$macrocall$1$subexpression$1","expr_various_constructs$macrocall$2","expr_various_constructs$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_various_constructs$macrocall$1",symbols:["expr_various_constructs$macrocall$4"],postprocess:r},{name:"expr_various_constructs",symbols:["expr_various_constructs$macrocall$1"]},{name:"expr_array_index$subexpression$1",symbols:["expr_array_index"]},{name:"expr_array_index$subexpression$1",symbols:["expr_paren"]},{name:"expr_array_index",symbols:["expr_array_index$subexpression$1",o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,"expr_nostar",o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket],postprocess:Q=>(0,g.track)(Q,{type:"arrayIndex",array:r(Q[0]),index:r(Q[2])})},{name:"expr_array_index",symbols:["expr_member"],postprocess:r},{name:"expr_member$subexpression$1",symbols:["expr_member"]},{name:"expr_member$subexpression$1",symbols:["expr_paren"]},{name:"expr_member$subexpression$2",symbols:["string"]},{name:"expr_member$subexpression$2",symbols:["int"]},{name:"expr_member",symbols:["expr_member$subexpression$1","ops_member","expr_member$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"member",operand:r(Q[0]),op:Q[1],member:r(Q[2])})},{name:"expr_member$subexpression$3",symbols:["expr_member"]},{name:"expr_member$subexpression$3",symbols:["expr_paren"]},{name:"expr_member",symbols:["expr_member$subexpression$3",o.lexerAny.has("op_cast")?{type:"op_cast"}:op_cast,"data_type"],postprocess:Q=>(0,g.track)(Q,{type:"cast",operand:r(Q[0]),to:Q[2]})},{name:"expr_member",symbols:[o.lexerAny.has("kw_cast")?{type:"kw_cast"}:kw_cast,"lparen","expr_nostar",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"data_type","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"cast",operand:r(Q[2]),to:Q[4]})},{name:"expr_member",symbols:["data_type","string"],postprocess:Q=>(0,g.track)(Q,{type:"cast",operand:(0,g.track)(Q[1],{type:"string",value:(0,g.unbox)(Q[1])}),to:(0,g.unbox)(Q[0])})},{name:"expr_member",symbols:["expr_dot"],postprocess:r},{name:"expr_dot$subexpression$1",symbols:["word"]},{name:"expr_dot$subexpression$1",symbols:["star"]},{name:"expr_dot",symbols:["qname",o.lexerAny.has("dot")?{type:"dot"}:dot,"expr_dot$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"ref",table:r(Q[0]),name:u(Q[2])})},{name:"expr_dot",symbols:["expr_final"],postprocess:r},{name:"expr_final",symbols:["expr_basic"]},{name:"expr_final",symbols:["expr_primary"]},{name:"expr_basic",symbols:["expr_special_calls"]},{name:"expr_basic",symbols:["expr_call"]},{name:"expr_basic",symbols:["expr_array"]},{name:"expr_basic",symbols:["expr_case"]},{name:"expr_basic",symbols:["expr_extract"]},{name:"expr_basic",symbols:["word"],postprocess:Q=>(0,g.track)(Q,{type:"ref",name:r(Q[0])})},{name:"expr_array$ebnf$1",symbols:["expr_subarray_items"],postprocess:n},{name:"expr_array$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_array",symbols:[o.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array,o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,"expr_array$ebnf$1",o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket],postprocess:Q=>(0,g.track)(Q,{type:"array",expressions:Q[2]||[]})},{name:"expr_array",symbols:[o.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array,"lparen","selection","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"array select",select:r(Q[2])})},{name:"expr_subarray$ebnf$1",symbols:["expr_subarray_items"],postprocess:n},{name:"expr_subarray$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_subarray",symbols:[o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,"expr_subarray$ebnf$1",o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket],postprocess:C(1)},{name:"expr_subarray_items$macrocall$2",symbols:["expr_list_item"]},{name:"expr_subarray_items$macrocall$1$ebnf$1",symbols:[]},{name:"expr_subarray_items$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"expr_subarray_items$macrocall$2"],postprocess:l},{name:"expr_subarray_items$macrocall$1$ebnf$1",symbols:["expr_subarray_items$macrocall$1$ebnf$1","expr_subarray_items$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"expr_subarray_items$macrocall$1",symbols:["expr_subarray_items$macrocall$2","expr_subarray_items$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"expr_subarray_items",symbols:["expr_subarray_items$macrocall$1"],postprocess:Q=>Q[0].map(r)},{name:"expr_subarray_items$macrocall$4",symbols:["expr_subarray"]},{name:"expr_subarray_items$macrocall$3$ebnf$1",symbols:[]},{name:"expr_subarray_items$macrocall$3$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"expr_subarray_items$macrocall$4"],postprocess:l},{name:"expr_subarray_items$macrocall$3$ebnf$1",symbols:["expr_subarray_items$macrocall$3$ebnf$1","expr_subarray_items$macrocall$3$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"expr_subarray_items$macrocall$3",symbols:["expr_subarray_items$macrocall$4","expr_subarray_items$macrocall$3$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"expr_subarray_items",symbols:["expr_subarray_items$macrocall$3"],postprocess:Q=>Q[0].map(k=>(0,g.track)(k,{type:"array",expressions:k[0].map(r)}))},{name:"expr_function_call$ebnf$1",symbols:["expr_list_raw"],postprocess:n},{name:"expr_function_call$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_function_call",symbols:["expr_fn_name","lparen","expr_function_call$ebnf$1","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"call",function:r(Q[0]),args:Q[2]||[]})},{name:"expr_call$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"expr_call$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_distinct")?{type:"kw_distinct"}:kw_distinct]},{name:"expr_call$ebnf$1",symbols:["expr_call$ebnf$1$subexpression$1"],postprocess:n},{name:"expr_call$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$2",symbols:["expr_list_raw"],postprocess:n},{name:"expr_call$ebnf$2",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$3",symbols:["select_order_by"],postprocess:n},{name:"expr_call$ebnf$3",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$4$subexpression$1",symbols:["kw_filter","lparen",o.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr","rparen"],postprocess:C(3)},{name:"expr_call$ebnf$4",symbols:["expr_call$ebnf$4$subexpression$1"],postprocess:n},{name:"expr_call$ebnf$4",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$5",symbols:["expr_call_over"],postprocess:n},{name:"expr_call$ebnf$5",symbols:[],postprocess:()=>null},{name:"expr_call",symbols:["expr_fn_name","lparen","expr_call$ebnf$1","expr_call$ebnf$2","expr_call$ebnf$3","rparen","expr_call$ebnf$4","expr_call$ebnf$5"],postprocess:Q=>(0,g.track)(Q,{type:"call",function:r(Q[0]),...Q[2]&&{distinct:u(Q[2])},args:Q[3]||[],...Q[4]&&{orderBy:Q[4]},...Q[6]&&{filter:r(Q[6])},...Q[7]&&{over:r(Q[7])}})},{name:"expr_call_over$ebnf$1$subexpression$1",symbols:["kw_partition","kw_by","expr_list_raw"],postprocess:l},{name:"expr_call_over$ebnf$1",symbols:["expr_call_over$ebnf$1$subexpression$1"],postprocess:n},{name:"expr_call_over$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_call_over$ebnf$2",symbols:["select_order_by"],postprocess:n},{name:"expr_call_over$ebnf$2",symbols:[],postprocess:()=>null},{name:"expr_call_over",symbols:["kw_over","lparen","expr_call_over$ebnf$1","expr_call_over$ebnf$2","rparen"],postprocess:Q=>(0,g.track)(Q,{...Q[2]&&{partitionBy:Q[2]},...Q[3]&&{orderBy:Q[3]}})},{name:"expr_extract$subexpression$1",symbols:["word"],postprocess:G("extract")},{name:"expr_extract",symbols:["expr_extract$subexpression$1","lparen","word",o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"expr","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"extract",field:a(Q[2]),from:Q[4]})},{name:"expr_primary",symbols:["float"],postprocess:Q=>(0,g.track)(Q,{type:"numeric",value:(0,g.unbox)(Q[0])})},{name:"expr_primary",symbols:["int"],postprocess:Q=>(0,g.track)(Q,{type:"integer",value:(0,g.unbox)(Q[0])})},{name:"expr_primary",symbols:["string"],postprocess:Q=>(0,g.track)(Q,{type:"string",value:(0,g.unbox)(Q[0])})},{name:"expr_primary",symbols:[o.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true],postprocess:Q=>(0,g.track)(Q,{type:"boolean",value:!0})},{name:"expr_primary",symbols:[o.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false],postprocess:Q=>(0,g.track)(Q,{type:"boolean",value:!1})},{name:"expr_primary",symbols:[o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null],postprocess:Q=>(0,g.track)(Q,{type:"null"})},{name:"expr_primary",symbols:["value_keyword"],postprocess:Q=>(0,g.track)(Q,{type:"keyword",keyword:u(Q)})},{name:"expr_primary",symbols:[o.lexerAny.has("qparam")?{type:"qparam"}:qparam],postprocess:Q=>(0,g.track)(Q,{type:"parameter",name:u(Q[0])})},{name:"expr_primary",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:Q=>(0,g.track)(Q,{type:"default"})},{name:"ops_like",symbols:["ops_like_keywors"]},{name:"ops_like",symbols:["ops_like_operators"]},{name:"ops_like_keywors$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"ops_like_keywors$ebnf$1",symbols:[],postprocess:()=>null},{name:"ops_like_keywors$subexpression$1",symbols:[o.lexerAny.has("kw_like")?{type:"kw_like"}:kw_like]},{name:"ops_like_keywors$subexpression$1",symbols:[o.lexerAny.has("kw_ilike")?{type:"kw_ilike"}:kw_ilike]},{name:"ops_like_keywors",symbols:["ops_like_keywors$ebnf$1","ops_like_keywors$subexpression$1"]},{name:"ops_like_operators$subexpression$1",symbols:[o.lexerAny.has("op_like")?{type:"op_like"}:op_like],postprocess:()=>"LIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$1"]},{name:"ops_like_operators$subexpression$2",symbols:[o.lexerAny.has("op_ilike")?{type:"op_ilike"}:op_ilike],postprocess:()=>"ILIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$2"]},{name:"ops_like_operators$subexpression$3",symbols:[o.lexerAny.has("op_not_like")?{type:"op_not_like"}:op_not_like],postprocess:()=>"NOT LIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$3"]},{name:"ops_like_operators$subexpression$4",symbols:[o.lexerAny.has("op_not_ilike")?{type:"op_not_ilike"}:op_not_ilike],postprocess:()=>"NOT ILIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$4"]},{name:"ops_in$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"ops_in$ebnf$1",symbols:[],postprocess:()=>null},{name:"ops_in",symbols:["ops_in$ebnf$1",o.lexerAny.has("kw_in")?{type:"kw_in"}:kw_in]},{name:"ops_between$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"ops_between$ebnf$1",symbols:[],postprocess:()=>null},{name:"ops_between",symbols:["ops_between$ebnf$1","kw_between"]},{name:"ops_member$subexpression$1",symbols:[o.lexerAny.has("op_member")?{type:"op_member"}:op_member]},{name:"ops_member$subexpression$1",symbols:[o.lexerAny.has("op_membertext")?{type:"op_membertext"}:op_membertext]},{name:"ops_member",symbols:["ops_member$subexpression$1"],postprocess:Q=>{var k;return(k=r(Q))===null||k===void 0?void 0:k.value}},{name:"expr_list_item",symbols:["expr_or_select"],postprocess:r},{name:"expr_list_item",symbols:["expr_star"],postprocess:r},{name:"expr_list_raw$macrocall$2",symbols:["expr_list_item"]},{name:"expr_list_raw$macrocall$1$ebnf$1",symbols:[]},{name:"expr_list_raw$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"expr_list_raw$macrocall$2"],postprocess:l},{name:"expr_list_raw$macrocall$1$ebnf$1",symbols:["expr_list_raw$macrocall$1$ebnf$1","expr_list_raw$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"expr_list_raw$macrocall$1",symbols:["expr_list_raw$macrocall$2","expr_list_raw$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"expr_list_raw",symbols:["expr_list_raw$macrocall$1"],postprocess:([Q])=>Q.map(r)},{name:"expr_list_raw_many$macrocall$2",symbols:["expr_list_item"]},{name:"expr_list_raw_many$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"expr_list_raw_many$macrocall$2"],postprocess:l},{name:"expr_list_raw_many$macrocall$1$ebnf$1",symbols:["expr_list_raw_many$macrocall$1$ebnf$1$subexpression$1"]},{name:"expr_list_raw_many$macrocall$1$ebnf$1$subexpression$2",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"expr_list_raw_many$macrocall$2"],postprocess:l},{name:"expr_list_raw_many$macrocall$1$ebnf$1",symbols:["expr_list_raw_many$macrocall$1$ebnf$1","expr_list_raw_many$macrocall$1$ebnf$1$subexpression$2"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"expr_list_raw_many$macrocall$1",symbols:["expr_list_raw_many$macrocall$2","expr_list_raw_many$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"expr_list_raw_many",symbols:["expr_list_raw_many$macrocall$1"],postprocess:([Q])=>Q.map(r)},{name:"expr_or_select",symbols:["expr_nostar"],postprocess:r},{name:"expr_or_select",symbols:["selection"],postprocess:r},{name:"expr_list_many",symbols:["expr_list_raw_many"],postprocess:Q=>(0,g.track)(Q,{type:"list",expressions:Q[0]})},{name:"expr_case$ebnf$1",symbols:["expr_nostar"],postprocess:n},{name:"expr_case$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_case$ebnf$2",symbols:[]},{name:"expr_case$ebnf$2",symbols:["expr_case$ebnf$2","expr_case_whens"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"expr_case$ebnf$3",symbols:["expr_case_else"],postprocess:n},{name:"expr_case$ebnf$3",symbols:[],postprocess:()=>null},{name:"expr_case",symbols:[o.lexerAny.has("kw_case")?{type:"kw_case"}:kw_case,"expr_case$ebnf$1","expr_case$ebnf$2","expr_case$ebnf$3",o.lexerAny.has("kw_end")?{type:"kw_end"}:kw_end],postprocess:Q=>(0,g.track)(Q,{type:"case",value:Q[1],whens:Q[2],else:Q[3]})},{name:"expr_case_whens",symbols:[o.lexerAny.has("kw_when")?{type:"kw_when"}:kw_when,"expr_nostar",o.lexerAny.has("kw_then")?{type:"kw_then"}:kw_then,"expr_nostar"],postprocess:Q=>(0,g.track)(Q,{when:Q[1],value:Q[3]})},{name:"expr_case_else",symbols:[o.lexerAny.has("kw_else")?{type:"kw_else"}:kw_else,"expr_nostar"],postprocess:l},{name:"expr_fn_name$subexpression$1$ebnf$1$subexpression$1",symbols:["word",o.lexerAny.has("dot")?{type:"dot"}:dot]},{name:"expr_fn_name$subexpression$1$ebnf$1",symbols:["expr_fn_name$subexpression$1$ebnf$1$subexpression$1"],postprocess:n},{name:"expr_fn_name$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_fn_name$subexpression$1",symbols:["expr_fn_name$subexpression$1$ebnf$1","word_or_keyword"],postprocess:Q=>(0,g.track)(Q,{name:(0,g.unbox)(r(Q[1])),...Q[0]&&{schema:u(Q[0][0])}})},{name:"expr_fn_name",symbols:["expr_fn_name$subexpression$1"]},{name:"expr_fn_name$subexpression$2$subexpression$1",symbols:[o.lexerAny.has("kw_any")?{type:"kw_any"}:kw_any]},{name:"expr_fn_name$subexpression$2$subexpression$1",symbols:[o.lexerAny.has("kw_some")?{type:"kw_some"}:kw_some]},{name:"expr_fn_name$subexpression$2$subexpression$1",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"expr_fn_name$subexpression$2",symbols:["expr_fn_name$subexpression$2$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{name:u(r(Q))})},{name:"expr_fn_name",symbols:["expr_fn_name$subexpression$2"]},{name:"word_or_keyword",symbols:["word"]},{name:"word_or_keyword",symbols:["value_keyword"],postprocess:Q=>(0,g.box)(Q,u(Q))},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_catalog")?{type:"kw_current_catalog"}:kw_current_catalog]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_date")?{type:"kw_current_date"}:kw_current_date]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_role")?{type:"kw_current_role"}:kw_current_role]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_timestamp")?{type:"kw_current_timestamp"}:kw_current_timestamp]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_time")?{type:"kw_current_time"}:kw_current_time]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_localtimestamp")?{type:"kw_localtimestamp"}:kw_localtimestamp]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_localtime")?{type:"kw_localtime"}:kw_localtime]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_session_user")?{type:"kw_session_user"}:kw_session_user]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_user")?{type:"kw_user"}:kw_user]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_user")?{type:"kw_current_user"}:kw_current_user]},{name:"expr_special_calls",symbols:["spe_overlay"]},{name:"expr_special_calls",symbols:["spe_substring"]},{name:"spe_overlay$subexpression$1",symbols:["word"],postprocess:G("overlay")},{name:"spe_overlay$subexpression$2",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen,"expr_nostar"]},{name:"spe_overlay$subexpression$3",symbols:[o.lexerAny.has("kw_placing")?{type:"kw_placing"}:kw_placing,"expr_nostar"]},{name:"spe_overlay$subexpression$4",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"expr_nostar"]},{name:"spe_overlay$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for,"expr_nostar"]},{name:"spe_overlay$ebnf$1",symbols:["spe_overlay$ebnf$1$subexpression$1"],postprocess:n},{name:"spe_overlay$ebnf$1",symbols:[],postprocess:()=>null},{name:"spe_overlay",symbols:["spe_overlay$subexpression$1","spe_overlay$subexpression$2","spe_overlay$subexpression$3","spe_overlay$subexpression$4","spe_overlay$ebnf$1",o.lexerAny.has("rparen")?{type:"rparen"}:rparen],postprocess:Q=>(0,g.track)(Q,{type:"overlay",value:Q[1][1],placing:Q[2][1],from:Q[3][1],...Q[4]&&{for:Q[4][1]}})},{name:"spe_substring$subexpression$1",symbols:["word"],postprocess:G("substring")},{name:"spe_substring$subexpression$2",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen,"expr_nostar"]},{name:"spe_substring$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"expr_nostar"]},{name:"spe_substring$ebnf$1",symbols:["spe_substring$ebnf$1$subexpression$1"],postprocess:n},{name:"spe_substring$ebnf$1",symbols:[],postprocess:()=>null},{name:"spe_substring$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for,"expr_nostar"]},{name:"spe_substring$ebnf$2",symbols:["spe_substring$ebnf$2$subexpression$1"],postprocess:n},{name:"spe_substring$ebnf$2",symbols:[],postprocess:()=>null},{name:"spe_substring",symbols:["spe_substring$subexpression$1","spe_substring$subexpression$2","spe_substring$ebnf$1","spe_substring$ebnf$2",o.lexerAny.has("rparen")?{type:"rparen"}:rparen],postprocess:Q=>(0,g.track)(Q,{type:"substring",value:Q[1][1],...Q[2]&&{from:Q[2][1]},...Q[3]&&{for:Q[3][1]}})},{name:"various_binaries",symbols:["kw_at","kw_time","kw_zone"],postprocess:()=>"AT TIME ZONE"},{name:"createtable_statement$ebnf$1",symbols:["createtable_modifiers"],postprocess:n},{name:"createtable_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_statement$ebnf$2",symbols:["kw_ifnotexists"],postprocess:n},{name:"createtable_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"createtable_statement$ebnf$3",symbols:["createtable_opts"],postprocess:n},{name:"createtable_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"createtable_statement",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"createtable_statement$ebnf$1",o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table,"createtable_statement$ebnf$2","qname","lparen","createtable_declarationlist","rparen","createtable_statement$ebnf$3"],postprocess:Q=>{const k=Q[6].filter(N=>"kind"in N),h=Q[6].filter(N=>!("kind"in N));return(0,g.track)(Q,{type:"create table",...Q[3]?{ifNotExists:!0}:{},name:Q[4],columns:k,...r(Q[1]),...h.length?{constraints:h}:{},...l(Q)})}},{name:"createtable_modifiers",symbols:["kw_unlogged"],postprocess:Q=>Q[0]?{unlogged:!0}:{}},{name:"createtable_modifiers",symbols:["m_locglob"]},{name:"createtable_modifiers",symbols:["m_tmp"]},{name:"createtable_modifiers",symbols:["m_locglob","m_tmp"],postprocess:([Q,k])=>({...Q,...k})},{name:"m_locglob$subexpression$1",symbols:["kw_local"]},{name:"m_locglob$subexpression$1",symbols:["kw_global"]},{name:"m_locglob",symbols:["m_locglob$subexpression$1"],postprocess:Q=>({locality:u(Q)})},{name:"m_tmp$subexpression$1",symbols:["kw_temp"]},{name:"m_tmp$subexpression$1",symbols:["kw_temporary"]},{name:"m_tmp",symbols:["m_tmp$subexpression$1"],postprocess:Q=>({temporary:!0})},{name:"createtable_declarationlist$ebnf$1",symbols:[]},{name:"createtable_declarationlist$ebnf$1$subexpression$1",symbols:["comma","createtable_declaration"],postprocess:l},{name:"createtable_declarationlist$ebnf$1",symbols:["createtable_declarationlist$ebnf$1","createtable_declarationlist$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_declarationlist",symbols:["createtable_declaration","createtable_declarationlist$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"createtable_declaration$subexpression$1",symbols:["createtable_constraint"]},{name:"createtable_declaration$subexpression$1",symbols:["createtable_column"]},{name:"createtable_declaration$subexpression$1",symbols:["createtable_like"]},{name:"createtable_declaration",symbols:["createtable_declaration$subexpression$1"],postprocess:r},{name:"createtable_constraint$macrocall$2",symbols:["createtable_constraint_def"]},{name:"createtable_constraint$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"word"]},{name:"createtable_constraint$macrocall$1$ebnf$1",symbols:["createtable_constraint$macrocall$1$ebnf$1$subexpression$1"],postprocess:n},{name:"createtable_constraint$macrocall$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_constraint$macrocall$1",symbols:["createtable_constraint$macrocall$1$ebnf$1","createtable_constraint$macrocall$2"],postprocess:Q=>{const k=Q[0]&&a(Q[0][1]);return k?(0,g.track)(Q,{constraintName:k,...r(Q[1])}):(0,g.track)(Q,r(Q[1]))}},{name:"createtable_constraint",symbols:["createtable_constraint$macrocall$1"],postprocess:r},{name:"createtable_constraint_def",symbols:["createtable_constraint_def_unique"]},{name:"createtable_constraint_def",symbols:["createtable_constraint_def_check"]},{name:"createtable_constraint_def",symbols:["createtable_constraint_foreignkey"]},{name:"createtable_constraint_def_unique$subexpression$1",symbols:[o.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique]},{name:"createtable_constraint_def_unique$subexpression$1",symbols:["kw_primary_key"]},{name:"createtable_constraint_def_unique",symbols:["createtable_constraint_def_unique$subexpression$1","lparen","createtable_collist","rparen"],postprocess:Q=>(0,g.track)(Q,{type:u(Q[0]," "),columns:Q[2].map(a)})},{name:"createtable_constraint_def_check",symbols:[o.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check,"expr_paren"],postprocess:Q=>(0,g.track)(Q,{type:"check",expr:r(Q[1])})},{name:"createtable_constraint_foreignkey",symbols:[o.lexerAny.has("kw_foreign")?{type:"kw_foreign"}:kw_foreign,"kw_key","collist_paren","createtable_references"],postprocess:Q=>(0,g.track)(Q,{type:"foreign key",localColumns:Q[2].map(a),...Q[3]})},{name:"createtable_references$ebnf$1",symbols:[]},{name:"createtable_references$ebnf$1",symbols:["createtable_references$ebnf$1","createtable_constraint_foreignkey_onsometing"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_references",symbols:[o.lexerAny.has("kw_references")?{type:"kw_references"}:kw_references,"table_ref","collist_paren","createtable_references$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{foreignTable:r(Q[1]),foreignColumns:Q[2].map(a),...Q[3].reduce((k,h)=>({...k,...h}),{})})},{name:"createtable_constraint_foreignkey_onsometing",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"kw_delete","createtable_constraint_on_action"],postprocess:Q=>(0,g.track)(Q,{onDelete:l(Q)})},{name:"createtable_constraint_foreignkey_onsometing",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"kw_update","createtable_constraint_on_action"],postprocess:Q=>(0,g.track)(Q,{onUpdate:l(Q)})},{name:"createtable_constraint_foreignkey_onsometing$subexpression$1",symbols:[o.lexerAny.has("kw_full")?{type:"kw_full"}:kw_full]},{name:"createtable_constraint_foreignkey_onsometing$subexpression$1",symbols:["kw_partial"]},{name:"createtable_constraint_foreignkey_onsometing$subexpression$1",symbols:["kw_simple"]},{name:"createtable_constraint_foreignkey_onsometing",symbols:["kw_match","createtable_constraint_foreignkey_onsometing$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{match:u(l(Q))})},{name:"createtable_constraint_on_action$subexpression$1",symbols:["kw_cascade"]},{name:"createtable_constraint_on_action$subexpression$1$subexpression$1",symbols:["kw_no","kw_action"]},{name:"createtable_constraint_on_action$subexpression$1",symbols:["createtable_constraint_on_action$subexpression$1$subexpression$1"]},{name:"createtable_constraint_on_action$subexpression$1",symbols:["kw_restrict"]},{name:"createtable_constraint_on_action$subexpression$1$subexpression$2",symbols:[o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"createtable_constraint_on_action$subexpression$1$subexpression$2",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default]},{name:"createtable_constraint_on_action$subexpression$1",symbols:["kw_set","createtable_constraint_on_action$subexpression$1$subexpression$2"]},{name:"createtable_constraint_on_action",symbols:["createtable_constraint_on_action$subexpression$1"],postprocess:Q=>u(Q," ")},{name:"createtable_collist$ebnf$1",symbols:[]},{name:"createtable_collist$ebnf$1$subexpression$1",symbols:["comma","ident"],postprocess:l},{name:"createtable_collist$ebnf$1",symbols:["createtable_collist$ebnf$1","createtable_collist$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_collist",symbols:["ident","createtable_collist$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"createtable_column$ebnf$1",symbols:["createtable_collate"],postprocess:n},{name:"createtable_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_column$ebnf$2",symbols:[]},{name:"createtable_column$ebnf$2",symbols:["createtable_column$ebnf$2","createtable_column_constraint"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_column",symbols:["word","data_type","createtable_column$ebnf$1","createtable_column$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{kind:"column",name:a(Q[0]),dataType:Q[1],...Q[2]?{collate:Q[2][1]}:{},...Q[3]&&Q[3].length?{constraints:Q[3]}:{}})},{name:"createtable_like$ebnf$1",symbols:[]},{name:"createtable_like$ebnf$1",symbols:["createtable_like$ebnf$1","createtable_like_opt"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_like",symbols:[o.lexerAny.has("kw_like")?{type:"kw_like"}:kw_like,"qname","createtable_like$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{kind:"like table",like:Q[1],options:Q[2]})},{name:"createtable_like_opt$subexpression$1",symbols:["kw_including"]},{name:"createtable_like_opt$subexpression$1",symbols:["kw_excluding"]},{name:"createtable_like_opt",symbols:["createtable_like_opt$subexpression$1","createtable_like_opt_val"],postprocess:Q=>(0,g.track)(Q,{verb:u(Q[0]),option:u(Q[1])})},{name:"createtable_like_opt_val",symbols:["word"],postprocess:R("defaults","constraints","indexes","storage","comments")},{name:"createtable_like_opt_val",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"createtable_column_constraint$macrocall$2",symbols:["createtable_column_constraint_def"]},{name:"createtable_column_constraint$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"word"]},{name:"createtable_column_constraint$macrocall$1$ebnf$1",symbols:["createtable_column_constraint$macrocall$1$ebnf$1$subexpression$1"],postprocess:n},{name:"createtable_column_constraint$macrocall$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_column_constraint$macrocall$1",symbols:["createtable_column_constraint$macrocall$1$ebnf$1","createtable_column_constraint$macrocall$2"],postprocess:Q=>{const k=Q[0]&&a(Q[0][1]);return k?(0,g.track)(Q,{constraintName:k,...r(Q[1])}):(0,g.track)(Q,r(Q[1]))}},{name:"createtable_column_constraint",symbols:["createtable_column_constraint$macrocall$1"],postprocess:r},{name:"createtable_column_constraint_def",symbols:[o.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique],postprocess:Q=>(0,g.track)(Q,{type:"unique"})},{name:"createtable_column_constraint_def",symbols:["kw_primary_key"],postprocess:Q=>(0,g.track)(Q,{type:"primary key"})},{name:"createtable_column_constraint_def",symbols:["kw_not_null"],postprocess:Q=>(0,g.track)(Q,{type:"not null"})},{name:"createtable_column_constraint_def",symbols:[o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null],postprocess:Q=>(0,g.track)(Q,{type:"null"})},{name:"createtable_column_constraint_def",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default,"expr"],postprocess:Q=>(0,g.track)(Q,{type:"default",default:r(Q[1])})},{name:"createtable_column_constraint_def",symbols:[o.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check,"expr_paren"],postprocess:Q=>(0,g.track)(Q,{type:"check",expr:r(Q[1])})},{name:"createtable_column_constraint_def",symbols:["createtable_references"],postprocess:Q=>(0,g.track)(Q,{type:"reference",...r(Q)})},{name:"createtable_column_constraint_def",symbols:["altercol_generated"]},{name:"createtable_collate",symbols:[o.lexerAny.has("kw_collate")?{type:"kw_collate"}:kw_collate,"qualified_name"]},{name:"createtable_opts$subexpression$1",symbols:["word"],postprocess:G("inherits")},{name:"createtable_opts$macrocall$2",symbols:["qname"]},{name:"createtable_opts$macrocall$1$ebnf$1",symbols:[]},{name:"createtable_opts$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"createtable_opts$macrocall$2"],postprocess:l},{name:"createtable_opts$macrocall$1$ebnf$1",symbols:["createtable_opts$macrocall$1$ebnf$1","createtable_opts$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_opts$macrocall$1",symbols:["createtable_opts$macrocall$2","createtable_opts$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"createtable_opts",symbols:["createtable_opts$subexpression$1","lparen","createtable_opts$macrocall$1","rparen"],postprocess:Q=>(0,g.track)(Q,{inherits:Q[2]})},{name:"createindex_statement$ebnf$1",symbols:[o.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique],postprocess:n},{name:"createindex_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$2",symbols:["kw_ifnotexists"],postprocess:n},{name:"createindex_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$3",symbols:["word"],postprocess:n},{name:"createindex_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$4$subexpression$1",symbols:[o.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using,"ident"],postprocess:l},{name:"createindex_statement$ebnf$4",symbols:["createindex_statement$ebnf$4$subexpression$1"],postprocess:n},{name:"createindex_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$5",symbols:["createindex_with"],postprocess:n},{name:"createindex_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$6",symbols:["createindex_tblspace"],postprocess:n},{name:"createindex_statement$ebnf$6",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$7",symbols:["createindex_predicate"],postprocess:n},{name:"createindex_statement$ebnf$7",symbols:[],postprocess:()=>null},{name:"createindex_statement",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"createindex_statement$ebnf$1","kw_index","createindex_statement$ebnf$2","createindex_statement$ebnf$3",o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"table_ref","createindex_statement$ebnf$4","lparen","createindex_expressions","rparen","createindex_statement$ebnf$5","createindex_statement$ebnf$6","createindex_statement$ebnf$7"],postprocess:Q=>(0,g.track)(Q,{type:"create index",...Q[1]&&{unique:!0},...Q[3]&&{ifNotExists:!0},...Q[4]&&{indexName:a(Q[4])},table:Q[6],...Q[7]&&{using:a(Q[7])},expressions:Q[9],...Q[11]&&{with:Q[11]},...Q[12]&&{tablespace:r(Q[12])},...Q[13]&&{where:r(Q[13])}})},{name:"createindex_expressions$ebnf$1",symbols:[]},{name:"createindex_expressions$ebnf$1$subexpression$1",symbols:["comma","createindex_expression"],postprocess:l},{name:"createindex_expressions$ebnf$1",symbols:["createindex_expressions$ebnf$1","createindex_expressions$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createindex_expressions",symbols:["createindex_expression","createindex_expressions$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"createindex_expression$subexpression$1",symbols:["expr_basic"]},{name:"createindex_expression$subexpression$1",symbols:["expr_paren"]},{name:"createindex_expression$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_collate")?{type:"kw_collate"}:kw_collate,"qualified_name"],postprocess:l},{name:"createindex_expression$ebnf$1",symbols:["createindex_expression$ebnf$1$subexpression$1"],postprocess:n},{name:"createindex_expression$ebnf$1",symbols:[],postprocess:()=>null},{name:"createindex_expression$ebnf$2",symbols:["qualified_name"],postprocess:n},{name:"createindex_expression$ebnf$2",symbols:[],postprocess:()=>null},{name:"createindex_expression$ebnf$3$subexpression$1",symbols:[o.lexerAny.has("kw_asc")?{type:"kw_asc"}:kw_asc]},{name:"createindex_expression$ebnf$3$subexpression$1",symbols:[o.lexerAny.has("kw_desc")?{type:"kw_desc"}:kw_desc]},{name:"createindex_expression$ebnf$3",symbols:["createindex_expression$ebnf$3$subexpression$1"],postprocess:n},{name:"createindex_expression$ebnf$3",symbols:[],postprocess:()=>null},{name:"createindex_expression$ebnf$4$subexpression$1$subexpression$1",symbols:["kw_first"]},{name:"createindex_expression$ebnf$4$subexpression$1$subexpression$1",symbols:["kw_last"]},{name:"createindex_expression$ebnf$4$subexpression$1",symbols:["kw_nulls","createindex_expression$ebnf$4$subexpression$1$subexpression$1"],postprocess:l},{name:"createindex_expression$ebnf$4",symbols:["createindex_expression$ebnf$4$subexpression$1"],postprocess:n},{name:"createindex_expression$ebnf$4",symbols:[],postprocess:()=>null},{name:"createindex_expression",symbols:["createindex_expression$subexpression$1","createindex_expression$ebnf$1","createindex_expression$ebnf$2","createindex_expression$ebnf$3","createindex_expression$ebnf$4"],postprocess:Q=>(0,g.track)(Q,{expression:r(Q[0]),...Q[1]&&{collate:r(Q[1])},...Q[2]&&{opclass:r(Q[2])},...Q[3]&&{order:r(Q[3]).value},...Q[4]&&{nulls:r(Q[4])}})},{name:"createindex_predicate",symbols:[o.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr"],postprocess:l},{name:"createindex_with$macrocall$2",symbols:["createindex_with_item"]},{name:"createindex_with$macrocall$1$ebnf$1",symbols:[]},{name:"createindex_with$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"createindex_with$macrocall$2"],postprocess:l},{name:"createindex_with$macrocall$1$ebnf$1",symbols:["createindex_with$macrocall$1$ebnf$1","createindex_with$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createindex_with$macrocall$1",symbols:["createindex_with$macrocall$2","createindex_with$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"createindex_with",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"lparen","createindex_with$macrocall$1","rparen"],postprocess:C(2)},{name:"createindex_with_item$subexpression$1",symbols:["string"]},{name:"createindex_with_item$subexpression$1",symbols:["int"]},{name:"createindex_with_item",symbols:["ident",o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"createindex_with_item$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{parameter:u(Q[0]),value:r(Q[2]).toString()})},{name:"createindex_tblspace",symbols:["kw_tablespace","ident"],postprocess:l},{name:"createextension_statement$ebnf$1",symbols:["kw_ifnotexists"],postprocess:n},{name:"createextension_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$2",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with],postprocess:n},{name:"createextension_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$3$subexpression$1",symbols:["kw_schema","word"],postprocess:l},{name:"createextension_statement$ebnf$3",symbols:["createextension_statement$ebnf$3$subexpression$1"],postprocess:n},{name:"createextension_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$4$subexpression$1",symbols:["kw_version","string"],postprocess:l},{name:"createextension_statement$ebnf$4",symbols:["createextension_statement$ebnf$4$subexpression$1"],postprocess:n},{name:"createextension_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$5$subexpression$1",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"string"],postprocess:l},{name:"createextension_statement$ebnf$5",symbols:["createextension_statement$ebnf$5$subexpression$1"],postprocess:n},{name:"createextension_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"createextension_statement",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_extension","createextension_statement$ebnf$1","word","createextension_statement$ebnf$2","createextension_statement$ebnf$3","createextension_statement$ebnf$4","createextension_statement$ebnf$5"],postprocess:Q=>(0,g.track)(Q,{type:"create extension",...Q[2]?{ifNotExists:!0}:{},extension:a(Q[3]),...Q[5]?{schema:a(Q[5])}:{},...Q[6]?{version:I(Q[6])}:{},...Q[7]?{from:I(Q[7])}:{}})},{name:"simplestatements_all",symbols:["simplestatements_start_transaction"]},{name:"simplestatements_all",symbols:["simplestatements_commit"]},{name:"simplestatements_all",symbols:["simplestatements_rollback"]},{name:"simplestatements_all",symbols:["simplestatements_tablespace"]},{name:"simplestatements_all",symbols:["simplestatements_set"]},{name:"simplestatements_all",symbols:["simplestatements_show"]},{name:"simplestatements_all",symbols:["simplestatements_begin"]},{name:"simplestatements_start_transaction$subexpression$1",symbols:["kw_start","kw_transaction"]},{name:"simplestatements_start_transaction",symbols:["simplestatements_start_transaction$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"start transaction"})},{name:"simplestatements_commit",symbols:["kw_commit"],postprocess:Q=>(0,g.track)(Q,{type:"commit"})},{name:"simplestatements_rollback",symbols:["kw_rollback"],postprocess:Q=>(0,g.track)(Q,{type:"rollback"})},{name:"simplestatements_tablespace",symbols:["kw_tablespace","word"],postprocess:Q=>(0,g.track)(Q,{type:"tablespace",tablespace:a(Q[1])})},{name:"simplestatements_set$subexpression$1",symbols:["simplestatements_set_simple"]},{name:"simplestatements_set$subexpression$1",symbols:["simplestatements_set_timezone"]},{name:"simplestatements_set",symbols:["kw_set","simplestatements_set$subexpression$1"],postprocess:l},{name:"simplestatements_set_timezone",symbols:["kw_time","kw_zone","simplestatements_set_timezone_val"],postprocess:Q=>(0,g.track)(Q,{type:"set timezone",to:Q[2]})},{name:"simplestatements_set_timezone_val$subexpression$1",symbols:["string"]},{name:"simplestatements_set_timezone_val$subexpression$1",symbols:["int"]},{name:"simplestatements_set_timezone_val",symbols:["simplestatements_set_timezone_val$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"value",value:r(Q[0])})},{name:"simplestatements_set_timezone_val",symbols:["kw_local"],postprocess:Q=>(0,g.track)(Q,{type:"local"})},{name:"simplestatements_set_timezone_val",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:Q=>(0,g.track)(Q,{type:"default"})},{name:"simplestatements_set_timezone_val",symbols:["kw_interval","string","kw_hour",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"kw_minute"],postprocess:Q=>(0,g.track)(Q,{type:"interval",value:(0,g.unbox)(Q[1])})},{name:"simplestatements_set_simple$subexpression$1",symbols:[o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq]},{name:"simplestatements_set_simple$subexpression$1",symbols:[o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to]},{name:"simplestatements_set_simple",symbols:["ident","simplestatements_set_simple$subexpression$1","simplestatements_set_val"],postprocess:Q=>(0,g.track)(Q,{type:"set",variable:a(Q[0]),set:(0,g.unbox)(Q[2])})},{name:"simplestatements_set_val",symbols:["simplestatements_set_val_raw"],postprocess:r},{name:"simplestatements_set_val",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:Q=>(0,g.track)(Q,{type:"default"})},{name:"simplestatements_set_val$ebnf$1$subexpression$1",symbols:["comma","simplestatements_set_val_raw"]},{name:"simplestatements_set_val$ebnf$1",symbols:["simplestatements_set_val$ebnf$1$subexpression$1"]},{name:"simplestatements_set_val$ebnf$1$subexpression$2",symbols:["comma","simplestatements_set_val_raw"]},{name:"simplestatements_set_val$ebnf$1",symbols:["simplestatements_set_val$ebnf$1","simplestatements_set_val$ebnf$1$subexpression$2"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"simplestatements_set_val",symbols:["simplestatements_set_val_raw","simplestatements_set_val$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{type:"list",values:[Q[0],...Q[1]||[]]})},{name:"simplestatements_set_val_raw$subexpression$1",symbols:["string"]},{name:"simplestatements_set_val_raw$subexpression$1",symbols:["int"]},{name:"simplestatements_set_val_raw",symbols:["simplestatements_set_val_raw$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"value",value:r(Q)})},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[o.lexerAny.has("word")?{type:"word"}:word]},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on]},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[o.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true]},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[o.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false]},{name:"simplestatements_set_val_raw",symbols:["simplestatements_set_val_raw$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"identifier",name:r(Q).value})},{name:"simplestatements_set_val_raw",symbols:[o.lexerAny.has("quoted_word")?{type:"quoted_word"}:quoted_word],postprocess:Q=>(0,g.track)(Q,{type:"identifier",doubleQuoted:!0,name:r(Q).value})},{name:"simplestatements_show",symbols:["kw_show","ident"],postprocess:Q=>(0,g.track)(Q,{type:"show",variable:a(Q[1])})},{name:"create_schema$subexpression$1",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_schema"]},{name:"create_schema$ebnf$1",symbols:["kw_ifnotexists"],postprocess:n},{name:"create_schema$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_schema",symbols:["create_schema$subexpression$1","create_schema$ebnf$1","ident"],postprocess:Q=>(0,g.track)(Q,{type:"create schema",name:a(Q[2]),...Q[1]?{ifNotExists:!0}:{}})},{name:"raise_statement$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("debug","log","info","notice","warning","exception")},{name:"raise_statement$ebnf$1",symbols:["raise_statement$ebnf$1$subexpression$1"],postprocess:n},{name:"raise_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"raise_statement$ebnf$2$subexpression$1",symbols:["comma","expr_list_raw"],postprocess:l},{name:"raise_statement$ebnf$2",symbols:["raise_statement$ebnf$2$subexpression$1"],postprocess:n},{name:"raise_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"raise_statement$ebnf$3",symbols:["raise_using"],postprocess:n},{name:"raise_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"raise_statement",symbols:["kw_raise","raise_statement$ebnf$1","string","raise_statement$ebnf$2","raise_statement$ebnf$3"],postprocess:Q=>(0,g.track)(Q,{type:"raise",format:u(Q[2]),...Q[1]&&{level:u(Q[1])},...Q[3]&&Q[3].length&&{formatExprs:Q[3]},...Q[4]&&Q[4].length&&{using:Q[4]}})},{name:"raise_using$macrocall$2",symbols:["raise_using_one"]},{name:"raise_using$macrocall$1$ebnf$1",symbols:[]},{name:"raise_using$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"raise_using$macrocall$2"],postprocess:l},{name:"raise_using$macrocall$1$ebnf$1",symbols:["raise_using$macrocall$1$ebnf$1","raise_using$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"raise_using$macrocall$1",symbols:["raise_using$macrocall$2","raise_using$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"raise_using",symbols:[o.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using,"raise_using$macrocall$1"],postprocess:l},{name:"raise_using_one",symbols:["raise_using_what",o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"expr"],postprocess:Q=>(0,g.track)(Q,{type:u(Q[0]),value:Q[2]})},{name:"raise_using_what",symbols:[o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table]},{name:"raise_using_what",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("message","detail","hint","errcode","column","constraint","datatype","schema")},{name:"comment_statement",symbols:["kw_comment",o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"comment_what",o.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,"string"],postprocess:Q=>(0,g.track)(Q,{type:"comment",comment:(0,g.unbox)(l(Q)),on:r(Q[2])})},{name:"comment_what",symbols:["comment_what_col"]},{name:"comment_what",symbols:["comment_what_nm"]},{name:"comment_what_nm$subexpression$1",symbols:[o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table]},{name:"comment_what_nm$subexpression$1",symbols:["kw_materialized","kw_view"]},{name:"comment_what_nm$subexpression$1",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("database","index","trigger","type","view")},{name:"comment_what_nm",symbols:["comment_what_nm$subexpression$1","qualified_name"],postprocess:Q=>(0,g.track)(Q,{type:u(Q[0]),name:Q[1]})},{name:"comment_what_col",symbols:["kw_column","qcolumn"],postprocess:Q=>(0,g.track)(Q,{type:"column",column:l(Q)})},{name:"simplestatements_begin$ebnf$1$subexpression$1",symbols:["kw_transaction"]},{name:"simplestatements_begin$ebnf$1$subexpression$1",symbols:["kw_work"]},{name:"simplestatements_begin$ebnf$1",symbols:["simplestatements_begin$ebnf$1$subexpression$1"],postprocess:n},{name:"simplestatements_begin$ebnf$1",symbols:[],postprocess:()=>null},{name:"simplestatements_begin$ebnf$2",symbols:[]},{name:"simplestatements_begin$ebnf$2$subexpression$1",symbols:["simplestatements_begin_isol"]},{name:"simplestatements_begin$ebnf$2$subexpression$1",symbols:["simplestatements_begin_writ"]},{name:"simplestatements_begin$ebnf$2$subexpression$1",symbols:["simplestatements_begin_def"]},{name:"simplestatements_begin$ebnf$2",symbols:["simplestatements_begin$ebnf$2","simplestatements_begin$ebnf$2$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"simplestatements_begin",symbols:["kw_begin","simplestatements_begin$ebnf$1","simplestatements_begin$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"begin",...Q[2].reduce((k,h)=>({...r(k),...r(h)}),{})})},{name:"simplestatements_begin_isol$subexpression$1",symbols:["kw_isolation","kw_level"]},{name:"simplestatements_begin_isol$subexpression$2",symbols:["kw_serializable"]},{name:"simplestatements_begin_isol$subexpression$2$subexpression$1",symbols:["word"],postprocess:G("repeatable")},{name:"simplestatements_begin_isol$subexpression$2",symbols:["simplestatements_begin_isol$subexpression$2$subexpression$1","kw_read"]},{name:"simplestatements_begin_isol$subexpression$2$subexpression$2",symbols:["word"],postprocess:G("committed")},{name:"simplestatements_begin_isol$subexpression$2",symbols:["kw_read","simplestatements_begin_isol$subexpression$2$subexpression$2"]},{name:"simplestatements_begin_isol$subexpression$2$subexpression$3",symbols:["word"],postprocess:G("uncommitted")},{name:"simplestatements_begin_isol$subexpression$2",symbols:["kw_read","simplestatements_begin_isol$subexpression$2$subexpression$3"]},{name:"simplestatements_begin_isol",symbols:["simplestatements_begin_isol$subexpression$1","simplestatements_begin_isol$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{isolationLevel:u(Q[1]," ")})},{name:"simplestatements_begin_writ$subexpression$1",symbols:["kw_read","kw_write"]},{name:"simplestatements_begin_writ$subexpression$1",symbols:["kw_read",o.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only]},{name:"simplestatements_begin_writ",symbols:["simplestatements_begin_writ$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{writeable:u(Q," ")})},{name:"simplestatements_begin_def$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"simplestatements_begin_def$ebnf$1",symbols:[],postprocess:()=>null},{name:"simplestatements_begin_def",symbols:["simplestatements_begin_def$ebnf$1",o.lexerAny.has("kw_deferrable")?{type:"kw_deferrable"}:kw_deferrable],postprocess:Q=>(0,g.track)(Q,{deferrable:!Q[0]})},{name:"insert_statement$subexpression$1",symbols:["kw_insert",o.lexerAny.has("kw_into")?{type:"kw_into"}:kw_into]},{name:"insert_statement$ebnf$1",symbols:["collist_paren"],postprocess:n},{name:"insert_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$2$subexpression$1$subexpression$1",symbols:["kw_system"]},{name:"insert_statement$ebnf$2$subexpression$1$subexpression$1",symbols:[o.lexerAny.has("kw_user")?{type:"kw_user"}:kw_user]},{name:"insert_statement$ebnf$2$subexpression$1",symbols:["kw_overriding","insert_statement$ebnf$2$subexpression$1$subexpression$1","kw_value"],postprocess:C(1)},{name:"insert_statement$ebnf$2",symbols:["insert_statement$ebnf$2$subexpression$1"],postprocess:n},{name:"insert_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$3$subexpression$1",symbols:["selection"]},{name:"insert_statement$ebnf$3$subexpression$1",symbols:["selection_paren"]},{name:"insert_statement$ebnf$3",symbols:["insert_statement$ebnf$3$subexpression$1"],postprocess:n},{name:"insert_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$4$subexpression$1",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"kw_conflict","insert_on_conflict"],postprocess:l},{name:"insert_statement$ebnf$4",symbols:["insert_statement$ebnf$4$subexpression$1"],postprocess:n},{name:"insert_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$5$subexpression$1",symbols:[o.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning,"select_expr_list_aliased"],postprocess:l},{name:"insert_statement$ebnf$5",symbols:["insert_statement$ebnf$5$subexpression$1"],postprocess:n},{name:"insert_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"insert_statement",symbols:["insert_statement$subexpression$1","table_ref_aliased","insert_statement$ebnf$1","insert_statement$ebnf$2","insert_statement$ebnf$3","insert_statement$ebnf$4","insert_statement$ebnf$5"],postprocess:Q=>{const k=Q[2]&&Q[2].map(a),h=u(Q[3]),N=r(Q[4]),v=Q[5],K=Q[6];return(0,g.track)(Q,{type:"insert",into:r(Q[1]),insert:N,...h&&{overriding:h},...k&&{columns:k},...K&&{returning:K},...v&&{onConflict:v}})}},{name:"insert_values$ebnf$1",symbols:[]},{name:"insert_values$ebnf$1$subexpression$1",symbols:["comma","insert_value"],postprocess:l},{name:"insert_values$ebnf$1",symbols:["insert_values$ebnf$1","insert_values$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"insert_values",symbols:["insert_value","insert_values$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"insert_value",symbols:["lparen","insert_expr_list_raw","rparen"],postprocess:C(1)},{name:"insert_expr_list_raw$ebnf$1",symbols:[]},{name:"insert_expr_list_raw$ebnf$1$subexpression$1",symbols:["comma","expr_or_select"],postprocess:l},{name:"insert_expr_list_raw$ebnf$1",symbols:["insert_expr_list_raw$ebnf$1","insert_expr_list_raw$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"insert_expr_list_raw",symbols:["expr_or_select","insert_expr_list_raw$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"insert_on_conflict$ebnf$1",symbols:["insert_on_conflict_what"],postprocess:n},{name:"insert_on_conflict$ebnf$1",symbols:[],postprocess:()=>null},{name:"insert_on_conflict",symbols:["insert_on_conflict$ebnf$1","insert_on_conflict_do"],postprocess:Q=>(0,g.track)(Q,{...Q[0]?{on:r(Q[0])}:{},...Q[1]})},{name:"insert_on_conflict_what",symbols:["lparen","expr_list_raw","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"on expr",exprs:Q[1]})},{name:"insert_on_conflict_what",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"qname"],postprocess:Q=>(0,g.track)(Q,{type:"on constraint",constraint:l(Q)})},{name:"insert_on_conflict_do",symbols:[o.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do,"kw_nothing"],postprocess:Q=>({do:"do nothing"})},{name:"insert_on_conflict_do$subexpression$1",symbols:[o.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do,"kw_update","kw_set"]},{name:"insert_on_conflict_do$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr"],postprocess:l},{name:"insert_on_conflict_do$ebnf$1",symbols:["insert_on_conflict_do$ebnf$1$subexpression$1"],postprocess:n},{name:"insert_on_conflict_do$ebnf$1",symbols:[],postprocess:()=>null},{name:"insert_on_conflict_do",symbols:["insert_on_conflict_do$subexpression$1","update_set_list","insert_on_conflict_do$ebnf$1"],postprocess:Q=>({do:{sets:Q[1]},...Q[2]&&{where:Q[2]}})},{name:"update_statement$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"select_from_subject"],postprocess:l},{name:"update_statement$ebnf$1",symbols:["update_statement$ebnf$1$subexpression$1"],postprocess:n},{name:"update_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"update_statement$ebnf$2",symbols:["select_where"],postprocess:n},{name:"update_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"update_statement$ebnf$3$subexpression$1",symbols:[o.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning,"select_expr_list_aliased"],postprocess:l},{name:"update_statement$ebnf$3",symbols:["update_statement$ebnf$3$subexpression$1"],postprocess:n},{name:"update_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"update_statement",symbols:["kw_update","table_ref_aliased","kw_set","update_set_list","update_statement$ebnf$1","update_statement$ebnf$2","update_statement$ebnf$3"],postprocess:Q=>{const k=r(Q[4]),h=r(Q[5]),N=Q[6];return(0,g.track)(Q,{type:"update",table:r(Q[1]),sets:Q[3],...h?{where:h}:{},...k?{from:k}:{},...N?{returning:N}:{}})}},{name:"update_set_list$ebnf$1",symbols:[]},{name:"update_set_list$ebnf$1$subexpression$1",symbols:["comma","update_set"],postprocess:l},{name:"update_set_list$ebnf$1",symbols:["update_set_list$ebnf$1","update_set_list$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"update_set_list",symbols:["update_set","update_set_list$ebnf$1"],postprocess:([Q,k])=>{const h=[];for(const N of[Q,...k||[]]){const v=r(N);Array.isArray(v)?h.push(...v):h.push(v)}return h}},{name:"update_set",symbols:["update_set_one"]},{name:"update_set",symbols:["update_set_multiple"]},{name:"update_set_one",symbols:["ident",o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"expr"],postprocess:Q=>(0,g.box)(Q,{column:a(Q[0]),value:r(Q[2])})},{name:"update_set_multiple$subexpression$1",symbols:["lparen","expr_list_raw","rparen"],postprocess:C(1)},{name:"update_set_multiple",symbols:["collist_paren",o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"update_set_multiple$subexpression$1"],postprocess:Q=>{const k=Q[0],h=Q[2];if(k.length!==h.length)throw new Error("number of columns does not match number of values");return(0,g.box)(Q,k.map((N,v)=>({column:a(N),value:r(h[v])})))}},{name:"altertable_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:n},{name:"altertable_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_statement$ebnf$2",symbols:[o.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only],postprocess:n},{name:"altertable_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_statement",symbols:["kw_alter",o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table,"altertable_statement$ebnf$1","altertable_statement$ebnf$2","table_ref","altertable_actions"],postprocess:Q=>(0,g.track)(Q,{type:"alter table",...Q[2]?{ifExists:!0}:{},...Q[3]?{only:!0}:{},table:r(Q[4]),changes:(0,g.unbox)(Q[5]).map(r)})},{name:"altertable_actions$ebnf$1",symbols:[]},{name:"altertable_actions$ebnf$1$subexpression$1",symbols:["comma","altertable_action"],postprocess:l},{name:"altertable_actions$ebnf$1",symbols:["altertable_actions$ebnf$1","altertable_actions$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"altertable_actions",symbols:["altertable_action","altertable_actions$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"altertable_action",symbols:["altertable_rename_table"]},{name:"altertable_action",symbols:["altertable_rename_column"]},{name:"altertable_action",symbols:["altertable_rename_constraint"]},{name:"altertable_action",symbols:["altertable_add_column"]},{name:"altertable_action",symbols:["altertable_drop_column"]},{name:"altertable_action",symbols:["altertable_alter_column"]},{name:"altertable_action",symbols:["altertable_add_constraint"]},{name:"altertable_action",symbols:["altertable_drop_constraint"]},{name:"altertable_action",symbols:["altertable_owner"]},{name:"altertable_rename_table",symbols:["kw_rename",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"word"],postprocess:Q=>(0,g.track)(Q,{type:"rename",to:a(l(Q))})},{name:"altertable_rename_column$ebnf$1",symbols:["kw_column"],postprocess:n},{name:"altertable_rename_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_rename_column",symbols:["kw_rename","altertable_rename_column$ebnf$1","ident",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:Q=>(0,g.track)(Q,{type:"rename column",column:a(Q[2]),to:a(l(Q))})},{name:"altertable_rename_constraint",symbols:["kw_rename",o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"ident",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:Q=>(0,g.track)(Q,{type:"rename constraint",constraint:a(Q[2]),to:a(l(Q))})},{name:"altertable_add_column$ebnf$1",symbols:["kw_column"],postprocess:n},{name:"altertable_add_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_add_column$ebnf$2",symbols:["kw_ifnotexists"],postprocess:n},{name:"altertable_add_column$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_add_column",symbols:["kw_add","altertable_add_column$ebnf$1","altertable_add_column$ebnf$2","createtable_column"],postprocess:Q=>(0,g.track)(Q,{type:"add column",...Q[2]?{ifNotExists:!0}:{},column:r(Q[3])})},{name:"altertable_drop_column$ebnf$1",symbols:["kw_column"],postprocess:n},{name:"altertable_drop_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_drop_column$ebnf$2",symbols:["kw_ifexists"],postprocess:n},{name:"altertable_drop_column$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_drop_column$ebnf$3$subexpression$1",symbols:["kw_restrict"]},{name:"altertable_drop_column$ebnf$3$subexpression$1",symbols:["kw_cascade"]},{name:"altertable_drop_column$ebnf$3",symbols:["altertable_drop_column$ebnf$3$subexpression$1"],postprocess:n},{name:"altertable_drop_column$ebnf$3",symbols:[],postprocess:()=>null},{name:"altertable_drop_column",symbols:["kw_drop","altertable_drop_column$ebnf$1","altertable_drop_column$ebnf$2","ident","altertable_drop_column$ebnf$3"],postprocess:Q=>(0,g.track)(Q,{type:"drop column",...Q[2]?{ifExists:!0}:{},column:a(Q[3]),...Q[4]?{behaviour:u(Q[4]," ")}:{}})},{name:"altertable_alter_column$ebnf$1",symbols:["kw_column"],postprocess:n},{name:"altertable_alter_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_alter_column",symbols:["kw_alter","altertable_alter_column$ebnf$1","ident","altercol"],postprocess:Q=>(0,g.track)(Q,{type:"alter column",column:a(Q[2]),alter:r(Q[3])})},{name:"altercol$ebnf$1$subexpression$1",symbols:["kw_set","kw_data"]},{name:"altercol$ebnf$1",symbols:["altercol$ebnf$1$subexpression$1"],postprocess:n},{name:"altercol$ebnf$1",symbols:[],postprocess:()=>null},{name:"altercol",symbols:["altercol$ebnf$1","kw_type","data_type"],postprocess:Q=>(0,g.track)(Q,{type:"set type",dataType:r(l(Q))})},{name:"altercol",symbols:["kw_set",o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default,"expr"],postprocess:Q=>(0,g.track)(Q,{type:"set default",default:r(l(Q))})},{name:"altercol",symbols:["kw_drop",o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:Q=>(0,g.track)(Q,{type:"drop default"})},{name:"altercol$subexpression$1",symbols:["kw_set"]},{name:"altercol$subexpression$1",symbols:["kw_drop"]},{name:"altercol",symbols:["altercol$subexpression$1","kw_not_null"],postprocess:Q=>(0,g.track)(Q,{type:u(Q," ")})},{name:"altercol",symbols:["altercol_generated_add"],postprocess:r},{name:"altertable_add_constraint",symbols:["kw_add","createtable_constraint"],postprocess:Q=>(0,g.track)(Q,{type:"add constraint",constraint:r(l(Q))})},{name:"altertable_drop_constraint$ebnf$1",symbols:["kw_ifexists"],postprocess:n},{name:"altertable_drop_constraint$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_drop_constraint$ebnf$2$subexpression$1",symbols:["kw_restrict"]},{name:"altertable_drop_constraint$ebnf$2$subexpression$1",symbols:["kw_cascade"]},{name:"altertable_drop_constraint$ebnf$2",symbols:["altertable_drop_constraint$ebnf$2$subexpression$1"],postprocess:n},{name:"altertable_drop_constraint$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_drop_constraint",symbols:["kw_drop",o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"altertable_drop_constraint$ebnf$1","ident","altertable_drop_constraint$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"drop constraint",...Q[2]?{ifExists:!0}:{},constraint:a(Q[3]),...Q[4]?{behaviour:u(Q[4]," ")}:{}})},{name:"altertable_owner",symbols:["kw_owner",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:Q=>(0,g.track)(Q,{type:"owner",to:a(l(Q))})},{name:"altercol_generated_add",symbols:["kw_add","altercol_generated"],postprocess:l},{name:"altercol_generated$ebnf$1$subexpression$1",symbols:["kw_always"]},{name:"altercol_generated$ebnf$1$subexpression$1",symbols:["kw_by",o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default]},{name:"altercol_generated$ebnf$1",symbols:["altercol_generated$ebnf$1$subexpression$1"],postprocess:n},{name:"altercol_generated$ebnf$1",symbols:[],postprocess:()=>null},{name:"altercol_generated$subexpression$1",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"kw_identity"]},{name:"altercol_generated$ebnf$2$subexpression$1",symbols:["lparen","altercol_generated_seq","rparen"],postprocess:C(1)},{name:"altercol_generated$ebnf$2",symbols:["altercol_generated$ebnf$2$subexpression$1"],postprocess:n},{name:"altercol_generated$ebnf$2",symbols:[],postprocess:()=>null},{name:"altercol_generated",symbols:["kw_generated","altercol_generated$ebnf$1","altercol_generated$subexpression$1","altercol_generated$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"add generated",...Q[1]&&{always:u(Q[1]," ")},...Q[3]&&{sequence:r(Q[3])}})},{name:"altercol_generated_seq$ebnf$1$subexpression$1",symbols:["kw_sequence","kw_name","qualified_name"]},{name:"altercol_generated_seq$ebnf$1",symbols:["altercol_generated_seq$ebnf$1$subexpression$1"],postprocess:n},{name:"altercol_generated_seq$ebnf$1",symbols:[],postprocess:()=>null},{name:"altercol_generated_seq$ebnf$2",symbols:[]},{name:"altercol_generated_seq$ebnf$2",symbols:["altercol_generated_seq$ebnf$2","create_sequence_option"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"altercol_generated_seq",symbols:["altercol_generated_seq$ebnf$1","altercol_generated_seq$ebnf$2"],postprocess:Q=>{const k={...Q[0]&&{name:r(l(Q[0]))}};return x(k,Q[1]),(0,g.track)(Q,k)}},{name:"alterindex_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:n},{name:"alterindex_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"alterindex_statement",symbols:["kw_alter","kw_index","alterindex_statement$ebnf$1","table_ref","alterindex_action"],postprocess:Q=>(0,g.track)(Q,{type:"alter index",...Q[2]?{ifExists:!0}:{},index:r(Q[3]),change:r(Q[4])})},{name:"alterindex_action",symbols:["alterindex_rename"]},{name:"alterindex_action",symbols:["alterindex_set_tablespace"]},{name:"alterindex_rename",symbols:["kw_rename",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"word"],postprocess:Q=>(0,g.track)(Q,{type:"rename",to:a(l(Q))})},{name:"alterindex_set_tablespace",symbols:["kw_set","kw_tablespace","word"],postprocess:Q=>(0,g.track)(Q,{type:"set tablespace",tablespace:a(l(Q))})},{name:"delete_statement",symbols:["delete_delete"]},{name:"delete_statement",symbols:["delete_truncate"]},{name:"delete_delete$subexpression$1",symbols:["kw_delete",o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from]},{name:"delete_delete$ebnf$1",symbols:["select_where"],postprocess:n},{name:"delete_delete$ebnf$1",symbols:[],postprocess:()=>null},{name:"delete_delete$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning,"select_expr_list_aliased"],postprocess:l},{name:"delete_delete$ebnf$2",symbols:["delete_delete$ebnf$2$subexpression$1"],postprocess:n},{name:"delete_delete$ebnf$2",symbols:[],postprocess:()=>null},{name:"delete_delete",symbols:["delete_delete$subexpression$1","table_ref_aliased","delete_delete$ebnf$1","delete_delete$ebnf$2"],postprocess:Q=>{const k=Q[2],h=Q[3];return(0,g.track)(Q,{type:"delete",from:r(Q[1]),...k?{where:k}:{},...h?{returning:h}:{}})}},{name:"delete_truncate$subexpression$1$ebnf$1",symbols:[o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table],postprocess:n},{name:"delete_truncate$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"delete_truncate$subexpression$1",symbols:["kw_truncate","delete_truncate$subexpression$1$ebnf$1"]},{name:"delete_truncate$macrocall$2",symbols:["table_ref"]},{name:"delete_truncate$macrocall$1$ebnf$1",symbols:[]},{name:"delete_truncate$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"delete_truncate$macrocall$2"],postprocess:l},{name:"delete_truncate$macrocall$1$ebnf$1",symbols:["delete_truncate$macrocall$1$ebnf$1","delete_truncate$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"delete_truncate$macrocall$1",symbols:["delete_truncate$macrocall$2","delete_truncate$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"delete_truncate$ebnf$1$subexpression$1$subexpression$1",symbols:["kw_restart"]},{name:"delete_truncate$ebnf$1$subexpression$1$subexpression$1",symbols:["kw_continue"]},{name:"delete_truncate$ebnf$1$subexpression$1",symbols:["delete_truncate$ebnf$1$subexpression$1$subexpression$1","kw_identity"]},{name:"delete_truncate$ebnf$1",symbols:["delete_truncate$ebnf$1$subexpression$1"],postprocess:n},{name:"delete_truncate$ebnf$1",symbols:[],postprocess:()=>null},{name:"delete_truncate$ebnf$2$subexpression$1",symbols:["kw_restrict"]},{name:"delete_truncate$ebnf$2$subexpression$1",symbols:["kw_cascade"]},{name:"delete_truncate$ebnf$2",symbols:["delete_truncate$ebnf$2$subexpression$1"],postprocess:n},{name:"delete_truncate$ebnf$2",symbols:[],postprocess:()=>null},{name:"delete_truncate",symbols:["delete_truncate$subexpression$1","delete_truncate$macrocall$1","delete_truncate$ebnf$1","delete_truncate$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"truncate table",tables:Q[1],...Q[2]&&{identity:u(Q[2][0])},...Q[3]&&{cascade:u(Q[3])}})},{name:"create_sequence_statement$ebnf$1$subexpression$1",symbols:["kw_temp"]},{name:"create_sequence_statement$ebnf$1$subexpression$1",symbols:["kw_temporary"]},{name:"create_sequence_statement$ebnf$1",symbols:["create_sequence_statement$ebnf$1$subexpression$1"],postprocess:n},{name:"create_sequence_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_sequence_statement$ebnf$2",symbols:["kw_ifnotexists"],postprocess:n},{name:"create_sequence_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_sequence_statement$ebnf$3",symbols:[]},{name:"create_sequence_statement$ebnf$3",symbols:["create_sequence_statement$ebnf$3","create_sequence_option"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_sequence_statement",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"create_sequence_statement$ebnf$1","kw_sequence","create_sequence_statement$ebnf$2","qualified_name","create_sequence_statement$ebnf$3"],postprocess:Q=>{const k={type:"create sequence",...Q[1]&&{temp:!0},...Q[3]&&{ifNotExists:!0},name:r(Q[4]),options:{}};return x(k.options,Q[5]),(0,g.track)(Q,k)}},{name:"create_sequence_option",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"data_type"],postprocess:Q=>(0,g.box)(Q,["as",Q[1]])},{name:"create_sequence_option$ebnf$1",symbols:["kw_by"],postprocess:n},{name:"create_sequence_option$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_sequence_option",symbols:["kw_increment","create_sequence_option$ebnf$1","int"],postprocess:Q=>(0,g.box)(Q,["incrementBy",Q[2]])},{name:"create_sequence_option",symbols:["create_sequence_minvalue"],postprocess:Q=>(0,g.box)(Q,["minValue",Q[0]])},{name:"create_sequence_option",symbols:["create_sequence_maxvalue"],postprocess:Q=>(0,g.box)(Q,["maxValue",Q[0]])},{name:"create_sequence_option$ebnf$2",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with],postprocess:n},{name:"create_sequence_option$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_sequence_option",symbols:["kw_start","create_sequence_option$ebnf$2","int"],postprocess:Q=>(0,g.box)(Q,["startWith",Q[2]])},{name:"create_sequence_option",symbols:["kw_cache","int"],postprocess:Q=>(0,g.box)(Q,["cache",Q[1]])},{name:"create_sequence_option$ebnf$3",symbols:["kw_no"],postprocess:n},{name:"create_sequence_option$ebnf$3",symbols:[],postprocess:()=>null},{name:"create_sequence_option",symbols:["create_sequence_option$ebnf$3","kw_cycle"],postprocess:Q=>(0,g.box)(Q,["cycle",u(Q," ")])},{name:"create_sequence_option",symbols:["create_sequence_owned_by"],postprocess:Q=>(0,g.box)(Q,["ownedBy",r(Q)])},{name:"create_sequence_minvalue",symbols:["kw_minvalue","int"],postprocess:l},{name:"create_sequence_minvalue",symbols:["kw_no","kw_minvalue"],postprocess:Q=>(0,g.box)(Q,"no minvalue")},{name:"create_sequence_maxvalue",symbols:["kw_maxvalue","int"],postprocess:l},{name:"create_sequence_maxvalue",symbols:["kw_no","kw_maxvalue"],postprocess:Q=>(0,g.box)(Q,"no maxvalue")},{name:"create_sequence_owned_by$subexpression$1",symbols:["kw_none"]},{name:"create_sequence_owned_by$subexpression$1",symbols:["qcolumn"]},{name:"create_sequence_owned_by",symbols:["kw_owned","kw_by","create_sequence_owned_by$subexpression$1"],postprocess:Q=>(0,g.box)(Q,r(l(Q)))},{name:"alter_sequence_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:n},{name:"alter_sequence_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"alter_sequence_statement",symbols:["kw_alter","kw_sequence","alter_sequence_statement$ebnf$1","qualified_name","alter_sequence_statement_body"],postprocess:Q=>{const k={type:"alter sequence",...Q[2]&&{ifExists:!0},name:r(Q[3]),change:Q[4]};return(0,g.track)(Q,k)}},{name:"alter_sequence_statement_body$ebnf$1",symbols:["alter_sequence_option"]},{name:"alter_sequence_statement_body$ebnf$1",symbols:["alter_sequence_statement_body$ebnf$1","alter_sequence_option"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"alter_sequence_statement_body",symbols:["alter_sequence_statement_body$ebnf$1"],postprocess:Q=>{const k={type:"set options"};return x(k,Q[0]),(0,g.track)(Q,k)}},{name:"alter_sequence_statement_body$subexpression$1",symbols:["ident"]},{name:"alter_sequence_statement_body$subexpression$1",symbols:[o.lexerAny.has("kw_session_user")?{type:"kw_session_user"}:kw_session_user]},{name:"alter_sequence_statement_body$subexpression$1",symbols:[o.lexerAny.has("kw_current_user")?{type:"kw_current_user"}:kw_current_user]},{name:"alter_sequence_statement_body",symbols:["kw_owner",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"alter_sequence_statement_body$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"owner to",owner:a(l(Q))})},{name:"alter_sequence_statement_body",symbols:["kw_rename",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:Q=>(0,g.track)(Q,{type:"rename",newName:a(l(Q))})},{name:"alter_sequence_statement_body",symbols:["kw_set","kw_schema","ident"],postprocess:Q=>(0,g.track)(Q,{type:"set schema",newSchema:a(l(Q))})},{name:"alter_sequence_option",symbols:["create_sequence_option"],postprocess:r},{name:"alter_sequence_option$ebnf$1$subexpression$1$ebnf$1",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with],postprocess:n},{name:"alter_sequence_option$ebnf$1$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"alter_sequence_option$ebnf$1$subexpression$1",symbols:["alter_sequence_option$ebnf$1$subexpression$1$ebnf$1","int"],postprocess:l},{name:"alter_sequence_option$ebnf$1",symbols:["alter_sequence_option$ebnf$1$subexpression$1"],postprocess:n},{name:"alter_sequence_option$ebnf$1",symbols:[],postprocess:()=>null},{name:"alter_sequence_option",symbols:["kw_restart","alter_sequence_option$ebnf$1"],postprocess:Q=>(0,g.box)(Q,["restart",typeof(0,g.unbox)(Q[1])=="number"?(0,g.unbox)(Q[1]):!0])},{name:"drop_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:n},{name:"drop_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_statement$macrocall$2",symbols:["qualified_name"]},{name:"drop_statement$macrocall$1$ebnf$1",symbols:[]},{name:"drop_statement$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"drop_statement$macrocall$2"],postprocess:l},{name:"drop_statement$macrocall$1$ebnf$1",symbols:["drop_statement$macrocall$1$ebnf$1","drop_statement$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"drop_statement$macrocall$1",symbols:["drop_statement$macrocall$2","drop_statement$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"drop_statement$ebnf$2$subexpression$1",symbols:["kw_cascade"]},{name:"drop_statement$ebnf$2$subexpression$1",symbols:["kw_restrict"]},{name:"drop_statement$ebnf$2",symbols:["drop_statement$ebnf$2$subexpression$1"],postprocess:n},{name:"drop_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"drop_statement",symbols:["kw_drop","drop_what","drop_statement$ebnf$1","drop_statement$macrocall$1","drop_statement$ebnf$2"],postprocess:(Q,k)=>{const h=r(Q[1]);return(0,g.track)(Q,{...h,...Q[2]&&{ifExists:!0},names:Q[3],...Q[4]&&{cascade:u(Q[4])}})}},{name:"drop_what",symbols:[o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table],postprocess:Q=>(0,g.track)(Q,{type:"drop table"})},{name:"drop_what",symbols:["kw_sequence"],postprocess:Q=>(0,g.track)(Q,{type:"drop sequence"})},{name:"drop_what",symbols:["kw_type"],postprocess:Q=>(0,g.track)(Q,{type:"drop type"})},{name:"drop_what",symbols:["kw_trigger"],postprocess:Q=>(0,g.track)(Q,{type:"drop trigger"})},{name:"drop_what$ebnf$1",symbols:[o.lexerAny.has("kw_concurrently")?{type:"kw_concurrently"}:kw_concurrently],postprocess:n},{name:"drop_what$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_what",symbols:["kw_index","drop_what$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{type:"drop index",...Q[1]&&{concurrently:!0}})},{name:"with_statement",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"with_statement_bindings","with_statement_statement"],postprocess:Q=>(0,g.track)(Q,{type:"with",bind:Q[1],in:r(Q[2])})},{name:"with_recursive_statement$subexpression$1",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"kw_recursive"]},{name:"with_recursive_statement",symbols:["with_recursive_statement$subexpression$1","ident","collist_paren",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"lparen","union_statement","rparen","with_statement_statement"],postprocess:Q=>(0,g.track)(Q,{type:"with recursive",alias:a(Q[1]),columnNames:Q[2].map(a),bind:Q[5],in:r(Q[7])})},{name:"with_statement_bindings$ebnf$1",symbols:[]},{name:"with_statement_bindings$ebnf$1$subexpression$1",symbols:["comma","with_statement_binding"],postprocess:l},{name:"with_statement_bindings$ebnf$1",symbols:["with_statement_bindings$ebnf$1","with_statement_bindings$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"with_statement_bindings",symbols:["with_statement_binding","with_statement_bindings$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"with_statement_binding",symbols:["word",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"lparen","with_statement_statement","rparen"],postprocess:Q=>(0,g.track)(Q,{alias:a(Q[0]),statement:r(Q[3])})},{name:"with_statement_statement",symbols:["selection"]},{name:"with_statement_statement",symbols:["insert_statement"]},{name:"with_statement_statement",symbols:["update_statement"]},{name:"with_statement_statement",symbols:["delete_statement"]},{name:"createtype_statement$subexpression$1",symbols:["createtype_enum"]},{name:"createtype_statement$subexpression$1",symbols:["createtype_composite"]},{name:"createtype_statement",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_type","qualified_name","createtype_statement$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{name:Q[2],...r(Q[3])})},{name:"createtype_enum$macrocall$2",symbols:["enum_value"]},{name:"createtype_enum$macrocall$1$ebnf$1",symbols:[]},{name:"createtype_enum$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"createtype_enum$macrocall$2"],postprocess:l},{name:"createtype_enum$macrocall$1$ebnf$1",symbols:["createtype_enum$macrocall$1$ebnf$1","createtype_enum$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtype_enum$macrocall$1",symbols:["createtype_enum$macrocall$2","createtype_enum$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"createtype_enum",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"kw_enum","lparen","createtype_enum$macrocall$1","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"create enum",values:Q[3]})},{name:"enum_value",symbols:["string"],postprocess:Q=>(0,g.track)(Q,{value:u(Q)})},{name:"createtype_composite$macrocall$2",symbols:["createtype_composite_attr"]},{name:"createtype_composite$macrocall$1$ebnf$1",symbols:[]},{name:"createtype_composite$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"createtype_composite$macrocall$2"],postprocess:l},{name:"createtype_composite$macrocall$1$ebnf$1",symbols:["createtype_composite$macrocall$1$ebnf$1","createtype_composite$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtype_composite$macrocall$1",symbols:["createtype_composite$macrocall$2","createtype_composite$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"createtype_composite",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"lparen","createtype_composite$macrocall$1","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"create composite type",attributes:Q[2]})},{name:"createtype_composite_attr$ebnf$1",symbols:["createtable_collate"],postprocess:n},{name:"createtype_composite_attr$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtype_composite_attr",symbols:["word","data_type","createtype_composite_attr$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{name:a(Q[0]),dataType:Q[1],...Q[2]?{collate:Q[2][1]}:{}})},{name:"union_left",symbols:["select_statement"]},{name:"union_left",symbols:["select_values"]},{name:"union_left",symbols:["selection_paren"]},{name:"union_right",symbols:["selection"]},{name:"union_right",symbols:["selection_paren"]},{name:"union_statement$subexpression$1$ebnf$1",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all],postprocess:n},{name:"union_statement$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"union_statement$subexpression$1",symbols:[o.lexerAny.has("kw_union")?{type:"kw_union"}:kw_union,"union_statement$subexpression$1$ebnf$1"]},{name:"union_statement",symbols:["union_left","union_statement$subexpression$1","union_right"],postprocess:Q=>(0,g.track)(Q,{type:u(Q[1]," "),left:r(Q[0]),right:r(Q[2])})},{name:"prepare$ebnf$1$subexpression$1",symbols:["lparen","data_type_list","rparen"],postprocess:C(1)},{name:"prepare$ebnf$1",symbols:["prepare$ebnf$1$subexpression$1"],postprocess:n},{name:"prepare$ebnf$1",symbols:[],postprocess:()=>null},{name:"prepare",symbols:["kw_prepare","ident","prepare$ebnf$1",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"statement_noprep"],postprocess:Q=>(0,g.track)(Q,{type:"prepare",name:a(Q[1]),...Q[2]&&{args:Q[2]},statement:r(l(Q))})},{name:"deallocate$ebnf$1",symbols:["kw_prepare"],postprocess:n},{name:"deallocate$ebnf$1",symbols:[],postprocess:()=>null},{name:"deallocate",symbols:["kw_deallocate","deallocate$ebnf$1","deallocate_target"],postprocess:Q=>(0,g.track)(Q,{type:"deallocate",target:Q[2]})},{name:"deallocate_target",symbols:["deallocate_all"],postprocess:r},{name:"deallocate_target",symbols:["deallocate_name"],postprocess:r},{name:"deallocate_name",symbols:["ident"],postprocess:Q=>(0,g.track)(Q,a(Q[0]))},{name:"deallocate_all",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all],postprocess:Q=>(0,g.track)(Q,{option:"all"})},{name:"create_view_statements",symbols:["create_view"]},{name:"create_view_statements",symbols:["create_materialized_view"]},{name:"create_view$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or,"kw_replace"]},{name:"create_view$ebnf$1",symbols:["create_view$ebnf$1$subexpression$1"],postprocess:n},{name:"create_view$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$2$subexpression$1",symbols:["kw_temp"]},{name:"create_view$ebnf$2$subexpression$1",symbols:["kw_temporary"]},{name:"create_view$ebnf$2",symbols:["create_view$ebnf$2$subexpression$1"],postprocess:n},{name:"create_view$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$3",symbols:["kw_recursive"],postprocess:n},{name:"create_view$ebnf$3",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$4$subexpression$1$macrocall$2",symbols:["ident"]},{name:"create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1",symbols:[]},{name:"create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"create_view$ebnf$4$subexpression$1$macrocall$2"],postprocess:l},{name:"create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1",symbols:["create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1","create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_view$ebnf$4$subexpression$1$macrocall$1",symbols:["create_view$ebnf$4$subexpression$1$macrocall$2","create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"create_view$ebnf$4$subexpression$1",symbols:["lparen","create_view$ebnf$4$subexpression$1$macrocall$1","rparen"],postprocess:C(1)},{name:"create_view$ebnf$4",symbols:["create_view$ebnf$4$subexpression$1"],postprocess:n},{name:"create_view$ebnf$4",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$5",symbols:["create_view_opts"],postprocess:n},{name:"create_view$ebnf$5",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$6$subexpression$1$subexpression$1",symbols:["kw_local"]},{name:"create_view$ebnf$6$subexpression$1$subexpression$1",symbols:["kw_cascaded"]},{name:"create_view$ebnf$6$subexpression$1",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"create_view$ebnf$6$subexpression$1$subexpression$1",o.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check,"kw_option"],postprocess:C(1)},{name:"create_view$ebnf$6",symbols:["create_view$ebnf$6$subexpression$1"],postprocess:n},{name:"create_view$ebnf$6",symbols:[],postprocess:()=>null},{name:"create_view",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"create_view$ebnf$1","create_view$ebnf$2","create_view$ebnf$3","kw_view","qualified_name","create_view$ebnf$4","create_view$ebnf$5",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"selection","create_view$ebnf$6"],postprocess:Q=>(0,g.track)(Q,{type:"create view",...Q[1]&&{orReplace:!0},...Q[2]&&{temp:!0},...Q[3]&&{recursive:!0},name:Q[5],...Q[6]&&{columnNames:Q[6].map(a)},...Q[7]&&{parameters:d(Q[7])},query:Q[9],...Q[10]&&{checkOption:u(Q[10])}})},{name:"create_view_opt",symbols:["ident",o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"ident"],postprocess:([Q,k,h])=>[u(Q),u(h)]},{name:"create_view_opts$macrocall$2",symbols:["create_view_opt"]},{name:"create_view_opts$macrocall$1$ebnf$1",symbols:[]},{name:"create_view_opts$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"create_view_opts$macrocall$2"],postprocess:l},{name:"create_view_opts$macrocall$1$ebnf$1",symbols:["create_view_opts$macrocall$1$ebnf$1","create_view_opts$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_view_opts$macrocall$1",symbols:["create_view_opts$macrocall$2","create_view_opts$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"create_view_opts",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"create_view_opts$macrocall$1"],postprocess:l},{name:"create_materialized_view$ebnf$1",symbols:["kw_ifnotexists"],postprocess:n},{name:"create_materialized_view$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$2",symbols:["ident"]},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1",symbols:[]},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"create_materialized_view$ebnf$2$subexpression$1$macrocall$2"],postprocess:l},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1",symbols:["create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1","create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1",symbols:["create_materialized_view$ebnf$2$subexpression$1$macrocall$2","create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"create_materialized_view$ebnf$2$subexpression$1",symbols:["lparen","create_materialized_view$ebnf$2$subexpression$1$macrocall$1","rparen"],postprocess:C(1)},{name:"create_materialized_view$ebnf$2",symbols:["create_materialized_view$ebnf$2$subexpression$1"],postprocess:n},{name:"create_materialized_view$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$3",symbols:["create_view_opts"],postprocess:n},{name:"create_materialized_view$ebnf$3",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$4$subexpression$1",symbols:["kw_tablespace","ident"],postprocess:l},{name:"create_materialized_view$ebnf$4",symbols:["create_materialized_view$ebnf$4$subexpression$1"],postprocess:n},{name:"create_materialized_view$ebnf$4",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$5$subexpression$1$ebnf$1",symbols:["kw_no"],postprocess:n},{name:"create_materialized_view$ebnf$5$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$5$subexpression$1",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"create_materialized_view$ebnf$5$subexpression$1$ebnf$1","kw_data"]},{name:"create_materialized_view$ebnf$5",symbols:["create_materialized_view$ebnf$5$subexpression$1"],postprocess:n},{name:"create_materialized_view$ebnf$5",symbols:[],postprocess:()=>null},{name:"create_materialized_view",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_materialized","kw_view","create_materialized_view$ebnf$1","qualified_name","create_materialized_view$ebnf$2","create_materialized_view$ebnf$3","create_materialized_view$ebnf$4",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"selection","create_materialized_view$ebnf$5"],postprocess:Q=>(0,g.track)(Q,{type:"create materialized view",...Q[3]&&{ifNotExists:!0},name:Q[4],...Q[5]&&{columnNames:Q[6].map(a)},...Q[6]&&{parameters:d(Q[6])},...Q[7]&&{tablespace:a(Q[7])},query:Q[9],...Q[10]&&{withData:u(Q[10][1])!=="no"}})},{name:"refresh_view_statements$ebnf$1",symbols:[o.lexerAny.has("kw_concurrently")?{type:"kw_concurrently"}:kw_concurrently],postprocess:n},{name:"refresh_view_statements$ebnf$1",symbols:[],postprocess:()=>null},{name:"refresh_view_statements$ebnf$2$subexpression$1$ebnf$1",symbols:["kw_no"],postprocess:n},{name:"refresh_view_statements$ebnf$2$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"refresh_view_statements$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"refresh_view_statements$ebnf$2$subexpression$1$ebnf$1","kw_data"]},{name:"refresh_view_statements$ebnf$2",symbols:["refresh_view_statements$ebnf$2$subexpression$1"],postprocess:n},{name:"refresh_view_statements$ebnf$2",symbols:[],postprocess:()=>null},{name:"refresh_view_statements",symbols:["kw_refresh","kw_materialized","kw_view","refresh_view_statements$ebnf$1","qname","refresh_view_statements$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"refresh materialized view",...Q[3]?{concurrently:!0}:{},name:Q[4],...Q[5]?{withData:u(Q[5][1])!=="no"}:{}})},{name:"functions_statements",symbols:["create_func"]},{name:"functions_statements",symbols:["do_stm"]},{name:"functions_statements",symbols:["drop_func"]},{name:"create_func$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or,"kw_replace"]},{name:"create_func$ebnf$1",symbols:["create_func$ebnf$1$subexpression$1"],postprocess:n},{name:"create_func$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_func$subexpression$1$ebnf$1$macrocall$2",symbols:["func_argdef"]},{name:"create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1",symbols:[]},{name:"create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"create_func$subexpression$1$ebnf$1$macrocall$2"],postprocess:l},{name:"create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1",symbols:["create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1","create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_func$subexpression$1$ebnf$1$macrocall$1",symbols:["create_func$subexpression$1$ebnf$1$macrocall$2","create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"create_func$subexpression$1$ebnf$1",symbols:["create_func$subexpression$1$ebnf$1$macrocall$1"],postprocess:n},{name:"create_func$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_func$subexpression$1",symbols:["lparen","create_func$subexpression$1$ebnf$1","rparen"],postprocess:C(1)},{name:"create_func$ebnf$2",symbols:["func_spec"]},{name:"create_func$ebnf$2",symbols:["create_func$ebnf$2","func_spec"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_func",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"create_func$ebnf$1","kw_function","qname","create_func$subexpression$1","create_func$ebnf$2"],postprocess:(Q,k)=>{var h;const N={};for(const v of Q[5]){for(const K in v)if(K[0]!=="_"&&K in N)throw new Error("conflicting or redundant options "+K);Object.assign(N,v)}return(0,g.track)(Q,{type:"create function",...Q[1]&&{orReplace:!0},name:Q[3],arguments:(h=Q[4])!==null&&h!==void 0?h:[],...N})}},{name:"func_argdef$ebnf$1",symbols:["func_argopts"],postprocess:n},{name:"func_argdef$ebnf$1",symbols:[],postprocess:()=>null},{name:"func_argdef$ebnf$2",symbols:["func_argdefault"],postprocess:n},{name:"func_argdef$ebnf$2",symbols:[],postprocess:()=>null},{name:"func_argdef",symbols:["func_argdef$ebnf$1","data_type","func_argdef$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{default:Q[2],type:Q[1],...Q[0]})},{name:"func_argdefault",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default,"expr"],postprocess:Q=>Q[1]},{name:"func_argdefault",symbols:[o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"expr"],postprocess:Q=>Q[1]},{name:"func_argopts$ebnf$1",symbols:["word"],postprocess:n},{name:"func_argopts$ebnf$1",symbols:[],postprocess:()=>null},{name:"func_argopts",symbols:["func_argmod","func_argopts$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{mode:u(Q[0]),...Q[1]&&{name:a(Q[1])}})},{name:"func_argopts",symbols:["word"],postprocess:(Q,k)=>{const h=a(Q);return h==="out"||h==="inout"||h==="variadic"?k:(0,g.track)(Q,{name:h})}},{name:"func_argmod",symbols:[o.lexerAny.has("kw_in")?{type:"kw_in"}:kw_in]},{name:"func_argmod",symbols:["kw_out"]},{name:"func_argmod",symbols:["kw_inout"]},{name:"func_argmod",symbols:["kw_variadic"]},{name:"func_spec",symbols:["kw_language","word"],postprocess:Q=>(0,g.track)(Q,{language:a(l(Q))})},{name:"func_spec",symbols:["func_purity"],postprocess:Q=>(0,g.track)(Q,{purity:u(Q)})},{name:"func_spec$subexpression$1",symbols:[o.lexerAny.has("codeblock")?{type:"codeblock"}:codeblock]},{name:"func_spec$subexpression$1",symbols:["string"]},{name:"func_spec",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"func_spec$subexpression$1"],postprocess:Q=>({code:u(l(Q))})},{name:"func_spec$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"func_spec$ebnf$1",symbols:[],postprocess:()=>null},{name:"func_spec$subexpression$2",symbols:["word"],postprocess:G("leakproof")},{name:"func_spec",symbols:["func_spec$ebnf$1","func_spec$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{leakproof:!Q[0]})},{name:"func_spec",symbols:["func_returns"],postprocess:Q=>(0,g.track)(Q,{returns:r(Q)})},{name:"func_spec$subexpression$3",symbols:["word"],postprocess:G("called")},{name:"func_spec",symbols:["func_spec$subexpression$3","oninp"],postprocess:()=>({onNullInput:"call"})},{name:"func_spec$subexpression$4",symbols:["word"],postprocess:G("returns")},{name:"func_spec",symbols:["func_spec$subexpression$4",o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null,"oninp"],postprocess:()=>({onNullInput:"null"})},{name:"func_spec$subexpression$5",symbols:["word"],postprocess:G("strict")},{name:"func_spec",symbols:["func_spec$subexpression$5"],postprocess:()=>({onNullInput:"strict"})},{name:"func_purity",symbols:["word"],postprocess:G("immutable")},{name:"func_purity",symbols:["word"],postprocess:G("stable")},{name:"func_purity",symbols:["word"],postprocess:G("volatile")},{name:"oninp$subexpression$1",symbols:["word"],postprocess:G("input")},{name:"oninp",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null,"oninp$subexpression$1"]},{name:"func_returns",symbols:["kw_returns","data_type"],postprocess:l},{name:"func_returns$macrocall$2",symbols:["func_ret_table_col"]},{name:"func_returns$macrocall$1$ebnf$1",symbols:[]},{name:"func_returns$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"func_returns$macrocall$2"],postprocess:l},{name:"func_returns$macrocall$1$ebnf$1",symbols:["func_returns$macrocall$1$ebnf$1","func_returns$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"func_returns$macrocall$1",symbols:["func_returns$macrocall$2","func_returns$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"func_returns",symbols:["kw_returns",o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table,"lparen","func_returns$macrocall$1","rparen"],postprocess:Q=>(0,g.track)(Q,{kind:"table",columns:Q[3]})},{name:"func_ret_table_col",symbols:["word","data_type"],postprocess:Q=>(0,g.track)(Q,{name:a(Q[0]),type:Q[1]})},{name:"do_stm$ebnf$1$subexpression$1",symbols:["kw_language","word"],postprocess:l},{name:"do_stm$ebnf$1",symbols:["do_stm$ebnf$1$subexpression$1"],postprocess:n},{name:"do_stm$ebnf$1",symbols:[],postprocess:()=>null},{name:"do_stm",symbols:[o.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do,"do_stm$ebnf$1",o.lexerAny.has("codeblock")?{type:"codeblock"}:codeblock],postprocess:Q=>(0,g.track)(Q,{type:"do",...Q[1]&&{language:a(Q[1])},code:Q[2].value})},{name:"drop_func$ebnf$1$subexpression$1",symbols:["kw_if","kw_exists"]},{name:"drop_func$ebnf$1",symbols:["drop_func$ebnf$1$subexpression$1"],postprocess:n},{name:"drop_func$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_func$ebnf$2",symbols:["drop_func_overload"],postprocess:n},{name:"drop_func$ebnf$2",symbols:[],postprocess:()=>null},{name:"drop_func",symbols:["kw_drop","kw_function","drop_func$ebnf$1","qname","drop_func$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"drop function",...Q[2]&&{ifExists:!0},name:Q[3],...Q[4]&&{arguments:Q[4]}})},{name:"drop_func_overload$macrocall$2",symbols:["drop_func_overload_col"]},{name:"drop_func_overload$macrocall$1$ebnf$1",symbols:[]},{name:"drop_func_overload$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"drop_func_overload$macrocall$2"],postprocess:l},{name:"drop_func_overload$macrocall$1$ebnf$1",symbols:["drop_func_overload$macrocall$1$ebnf$1","drop_func_overload$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"drop_func_overload$macrocall$1",symbols:["drop_func_overload$macrocall$2","drop_func_overload$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"drop_func_overload",symbols:["lparen","drop_func_overload$macrocall$1","rparen"],postprocess:C(1)},{name:"drop_func_overload_col$ebnf$1",symbols:["word"],postprocess:n},{name:"drop_func_overload_col$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_func_overload_col",symbols:["drop_func_overload_col$ebnf$1","qname"],postprocess:Q=>(0,g.track)(Q,{type:Q[1],...Q[0]&&{name:a(Q[0])}})},{name:"main$ebnf$1",symbols:[]},{name:"main$ebnf$1",symbols:["main$ebnf$1","statement_separator"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"main$ebnf$2",symbols:[]},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["statement_separator"]},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["main$ebnf$2$subexpression$1$ebnf$1","statement_separator"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"main$ebnf$2$subexpression$1",symbols:["main$ebnf$2$subexpression$1$ebnf$1","statement"]},{name:"main$ebnf$2",symbols:["main$ebnf$2","main$ebnf$2$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"main$ebnf$3",symbols:[]},{name:"main$ebnf$3",symbols:["main$ebnf$3","statement_separator"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"main",symbols:["main$ebnf$1","statement","main$ebnf$2","main$ebnf$3"],postprocess:([Q,k,h])=>{const N=h,v=[r(k),...N.map(K=>r(K[1]))];return v.length===1?v[0]:v}},{name:"statement_separator",symbols:[o.lexerAny.has("semicolon")?{type:"semicolon"}:semicolon]},{name:"statement",symbols:["statement_noprep"]},{name:"statement",symbols:["prepare"]},{name:"statement",symbols:["deallocate"]},{name:"statement_noprep",symbols:["selection"]},{name:"statement_noprep",symbols:["createtable_statement"]},{name:"statement_noprep",symbols:["createextension_statement"]},{name:"statement_noprep",symbols:["createindex_statement"]},{name:"statement_noprep",symbols:["simplestatements_all"]},{name:"statement_noprep",symbols:["insert_statement"]},{name:"statement_noprep",symbols:["update_statement"]},{name:"statement_noprep",symbols:["altertable_statement"]},{name:"statement_noprep",symbols:["alterindex_statement"]},{name:"statement_noprep",symbols:["delete_statement"]},{name:"statement_noprep",symbols:["create_sequence_statement"]},{name:"statement_noprep",symbols:["alter_sequence_statement"]},{name:"statement_noprep",symbols:["drop_statement"]},{name:"statement_noprep",symbols:["createtype_statement"]},{name:"statement_noprep",symbols:["create_view_statements"]},{name:"statement_noprep",symbols:["refresh_view_statements"]},{name:"statement_noprep",symbols:["create_schema"]},{name:"statement_noprep",symbols:["raise_statement"]},{name:"statement_noprep",symbols:["comment_statement"]},{name:"statement_noprep",symbols:["functions_statements"]},{name:"selection",symbols:["select_statement"],postprocess:r},{name:"selection",symbols:["select_values"],postprocess:r},{name:"selection",symbols:["with_statement"],postprocess:r},{name:"selection",symbols:["with_recursive_statement"],postprocess:r},{name:"selection",symbols:["union_statement"],postprocess:r},{name:"selection_paren",symbols:["lparen","selection","rparen"],postprocess:C(1)}],ParserStart:"main"};t.default=F},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});function n(s){return s[0]}const o=i(12),g=s=>s&&s[s.length-1],a={Lexer:o.lexerAny,ParserRules:[{name:"main$ebnf$1",symbols:["elements"],postprocess:n},{name:"main$ebnf$1",symbols:[],postprocess:()=>null},{name:"main",symbols:[o.lexerAny.has("start_list")?{type:"start_list"}:start_list,"main$ebnf$1",o.lexerAny.has("end_list")?{type:"end_list"}:end_list],postprocess:s=>s[1]||[]},{name:"elements$ebnf$1",symbols:[]},{name:"elements$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"elt"],postprocess:g},{name:"elements$ebnf$1",symbols:["elements$ebnf$1","elements$ebnf$1$subexpression$1"],postprocess:s=>s[0].concat([s[1]])},{name:"elements",symbols:["elt","elements$ebnf$1"],postprocess:([s,I])=>[s,...I||[]]},{name:"elt",symbols:[o.lexerAny.has("value")?{type:"value"}:value],postprocess:s=>s[0].value},{name:"elt",symbols:["main"],postprocess:s=>s[0]}],ParserStart:"main"};t.default=a},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.lexerAny=t.lexer=void 0;const n=i(0);t.lexer=(0,n.compile)({valueString:{match:/"(?:\\["\\]|[^\n"\\])*"/,value:o=>JSON.parse(o),type:o=>"value"},valueRaw:{match:/[^\s,\{\}"](?:[^,\{\}"]*[^\s,\{\}"])?/,type:()=>"value"},comma:",",space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},start_list:"{",end_list:"}"}),t.lexer.next=(o=>()=>{let g;for(;(g=o.call(t.lexer))&&g.type==="space";);return g})(t.lexer.next),t.lexerAny=t.lexer},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});function n(r){return r[0]}const o=i(14),g=r=>C=>C[r],a=r=>r&&r[r.length-1];function s(r){return Array.isArray(r)&&r.length===1&&(r=s(r[0])),Array.isArray(r)&&!r.length?null:r}const I={Lexer:o.lexerAny,ParserRules:[{name:"number$subexpression$1",symbols:["float"]},{name:"number$subexpression$1",symbols:["int"]},{name:"number",symbols:["number$subexpression$1"],postprocess:s},{name:"float",symbols:[o.lexerAny.has("float")?{type:"float"}:float],postprocess:r=>parseFloat(s(r))},{name:"int",symbols:[o.lexerAny.has("int")?{type:"int"}:int],postprocess:r=>parseInt(s(r),10)},{name:"comma",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma],postprocess:n},{name:"point$macrocall$2",symbols:["point_content"]},{name:"point$macrocall$1$subexpression$1",symbols:["point$macrocall$2"]},{name:"point$macrocall$1$subexpression$1",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen,"point$macrocall$2",o.lexerAny.has("rparen")?{type:"rparen"}:rparen],postprocess:g(1)},{name:"point$macrocall$1",symbols:["point$macrocall$1$subexpression$1"],postprocess:s},{name:"point",symbols:["point$macrocall$1"],postprocess:s},{name:"point_content",symbols:["number","comma","number"],postprocess:r=>({x:r[0],y:r[2]})},{name:"line",symbols:[o.lexerAny.has("lcurl")?{type:"lcurl"}:lcurl,"number","comma","number","comma","number",o.lexerAny.has("rcurl")?{type:"rcurl"}:rcurl],postprocess:r=>({a:r[1],b:r[3],c:r[5]})},{name:"box",symbols:["closed_path"],postprocess:([r],C)=>r.length!==2?C:r},{name:"lseg",symbols:["path"],postprocess:([r],C)=>r.path.length!==2?C:r.path},{name:"path",symbols:["open_path"],postprocess:([r])=>({closed:!1,path:r})},{name:"path",symbols:["closed_path"],postprocess:([r])=>({closed:!0,path:r})},{name:"open_path$macrocall$2",symbols:[o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket]},{name:"open_path$macrocall$3",symbols:[o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket]},{name:"open_path$macrocall$1$macrocall$2",symbols:["point"]},{name:"open_path$macrocall$1$macrocall$1$ebnf$1",symbols:[]},{name:"open_path$macrocall$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"open_path$macrocall$1$macrocall$2"],postprocess:a},{name:"open_path$macrocall$1$macrocall$1$ebnf$1",symbols:["open_path$macrocall$1$macrocall$1$ebnf$1","open_path$macrocall$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:r=>r[0].concat([r[1]])},{name:"open_path$macrocall$1$macrocall$1",symbols:["open_path$macrocall$1$macrocall$2","open_path$macrocall$1$macrocall$1$ebnf$1"],postprocess:([r,C])=>[s(r),...C.map(s)||[]]},{name:"open_path$macrocall$1",symbols:["open_path$macrocall$2","open_path$macrocall$1$macrocall$1","open_path$macrocall$3"],postprocess:g(1)},{name:"open_path",symbols:["open_path$macrocall$1"],postprocess:a},{name:"closed_path$subexpression$1$macrocall$2",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen]},{name:"closed_path$subexpression$1$macrocall$3",symbols:[o.lexerAny.has("rparen")?{type:"rparen"}:rparen]},{name:"closed_path$subexpression$1$macrocall$1$macrocall$2",symbols:["point"]},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1",symbols:[]},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"closed_path$subexpression$1$macrocall$1$macrocall$2"],postprocess:a},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1",symbols:["closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1","closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:r=>r[0].concat([r[1]])},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1",symbols:["closed_path$subexpression$1$macrocall$1$macrocall$2","closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1"],postprocess:([r,C])=>[s(r),...C.map(s)||[]]},{name:"closed_path$subexpression$1$macrocall$1",symbols:["closed_path$subexpression$1$macrocall$2","closed_path$subexpression$1$macrocall$1$macrocall$1","closed_path$subexpression$1$macrocall$3"],postprocess:g(1)},{name:"closed_path$subexpression$1",symbols:["closed_path$subexpression$1$macrocall$1"],postprocess:a},{name:"closed_path$subexpression$1$macrocall$5",symbols:["point"]},{name:"closed_path$subexpression$1$macrocall$4$ebnf$1",symbols:[]},{name:"closed_path$subexpression$1$macrocall$4$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"closed_path$subexpression$1$macrocall$5"],postprocess:a},{name:"closed_path$subexpression$1$macrocall$4$ebnf$1",symbols:["closed_path$subexpression$1$macrocall$4$ebnf$1","closed_path$subexpression$1$macrocall$4$ebnf$1$subexpression$1"],postprocess:r=>r[0].concat([r[1]])},{name:"closed_path$subexpression$1$macrocall$4",symbols:["closed_path$subexpression$1$macrocall$5","closed_path$subexpression$1$macrocall$4$ebnf$1"],postprocess:([r,C])=>[s(r),...C.map(s)||[]]},{name:"closed_path$subexpression$1",symbols:["closed_path$subexpression$1$macrocall$4"],postprocess:a},{name:"closed_path",symbols:["closed_path$subexpression$1"],postprocess:g(0)},{name:"polygon",symbols:["closed_path"],postprocess:g(0)},{name:"circle_body",symbols:["point","comma","number"],postprocess:r=>({c:r[0],r:r[2]})},{name:"circle$subexpression$1$macrocall$2",symbols:[o.lexerAny.has("lcomp")?{type:"lcomp"}:lcomp]},{name:"circle$subexpression$1$macrocall$3",symbols:[o.lexerAny.has("rcomp")?{type:"rcomp"}:rcomp]},{name:"circle$subexpression$1$macrocall$1",symbols:["circle$subexpression$1$macrocall$2","circle_body","circle$subexpression$1$macrocall$3"],postprocess:g(1)},{name:"circle$subexpression$1",symbols:["circle$subexpression$1$macrocall$1"]},{name:"circle$subexpression$1$macrocall$5",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen]},{name:"circle$subexpression$1$macrocall$6",symbols:[o.lexerAny.has("rparen")?{type:"rparen"}:rparen]},{name:"circle$subexpression$1$macrocall$4",symbols:["circle$subexpression$1$macrocall$5","circle_body","circle$subexpression$1$macrocall$6"],postprocess:g(1)},{name:"circle$subexpression$1",symbols:["circle$subexpression$1$macrocall$4"]},{name:"circle$subexpression$1",symbols:["circle_body"]},{name:"circle",symbols:["circle$subexpression$1"],postprocess:s}],ParserStart:"number"};t.default=I},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.lexerAny=t.lexer=void 0;const n=i(0);t.lexer=(0,n.compile)({comma:",",space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},int:/\-?\d+(?![\.\d])/,float:/\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,lcurl:"{",rcurl:"}",lparen:"(",rparen:")",lbracket:"[",rbracket:"]",lcomp:"<",rcomp:">"}),t.lexer.next=(o=>()=>{let g;for(;(g=o.call(t.lexer))&&g.type==="space";);return g})(t.lexer.next),t.lexerAny=t.lexer},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});function n(a){return a[0]}const o=i(16),g={Lexer:o.lexerAny,ParserRules:[{name:"main$ebnf$1",symbols:["elt"]},{name:"main$ebnf$1",symbols:["main$ebnf$1","elt"],postprocess:a=>a[0].concat([a[1]])},{name:"main",symbols:["main$ebnf$1"],postprocess:([a])=>{const s=new Set;for(const I of a){const r=typeof I[1]=="number"?I[0]:"time";if(s.has(r))return"invalid";s.add(r)}return a}},{name:"elt",symbols:["time"]},{name:"elt",symbols:["num","unit"],postprocess:([[a],s])=>(s=s[0].type,[s,a])},{name:"unit",symbols:[o.lexerAny.has("years")?{type:"years"}:years]},{name:"unit",symbols:[o.lexerAny.has("months")?{type:"months"}:months]},{name:"unit",symbols:[o.lexerAny.has("days")?{type:"days"}:days]},{name:"unit",symbols:[o.lexerAny.has("hours")?{type:"hours"}:hours]},{name:"unit",symbols:[o.lexerAny.has("minutes")?{type:"minutes"}:minutes]},{name:"unit",symbols:[o.lexerAny.has("seconds")?{type:"seconds"}:seconds]},{name:"unit",symbols:[o.lexerAny.has("milliseconds")?{type:"milliseconds"}:milliseconds]},{name:"num",symbols:["int"]},{name:"num",symbols:["float"]},{name:"uint",symbols:[o.lexerAny.has("int")?{type:"int"}:int],postprocess:([a])=>parseInt(a,10)},{name:"int$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("neg")?{type:"neg"}:neg]},{name:"int$ebnf$1",symbols:["int$ebnf$1$subexpression$1"],postprocess:n},{name:"int$ebnf$1",symbols:[],postprocess:()=>null},{name:"int",symbols:["int$ebnf$1",o.lexerAny.has("int")?{type:"int"}:int],postprocess:([a,s])=>parseInt(s,10)*(a?-1:1)},{name:"float$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("neg")?{type:"neg"}:neg]},{name:"float$ebnf$1",symbols:["float$ebnf$1$subexpression$1"],postprocess:n},{name:"float$ebnf$1",symbols:[],postprocess:()=>null},{name:"float$ebnf$2",symbols:[o.lexerAny.has("int")?{type:"int"}:int],postprocess:n},{name:"float$ebnf$2",symbols:[],postprocess:()=>null},{name:"float",symbols:["float$ebnf$1","float$ebnf$2",o.lexerAny.has("dot")?{type:"dot"}:dot,o.lexerAny.has("int")?{type:"int"}:int],postprocess:([a,...s])=>parseFloat(s.map(I=>I?I.text:"0").join(""))*(a?-1:1)},{name:"time$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("colon")?{type:"colon"}:colon,"uint"]},{name:"time$ebnf$1",symbols:["time$ebnf$1$subexpression$1"],postprocess:n},{name:"time$ebnf$1",symbols:[],postprocess:()=>null},{name:"time$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("dot")?{type:"dot"}:dot,o.lexerAny.has("int")?{type:"int"}:int]},{name:"time$ebnf$2",symbols:["time$ebnf$2$subexpression$1"],postprocess:n},{name:"time$ebnf$2",symbols:[],postprocess:()=>null},{name:"time",symbols:["uint",o.lexerAny.has("colon")?{type:"colon"}:colon,"uint","time$ebnf$1","time$ebnf$2"],postprocess:([a,s,I,r,C])=>{r=r&&r[1],C=C&&C[1];const l=typeof r=="number"?[["hours",a],["minutes",I],["seconds",r]]:[["minutes",a],["seconds",I]];return C&&l.push(["milliseconds",parseFloat("0."+C)*1e3]),l}}],ParserStart:"main"};t.default=g},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.lexerAny=t.lexer=void 0;const n=i(0);t.lexer=(0,n.compile)({int:/\d+/,neg:"-",dot:".",years:/(?:y|yrs?|years?)\b/,months:/(?:mon(?:th)?s?)\b/,days:/(?:d|days?)\b/,hours:/(?:h|hrs?|hours?)\b/,minutes:/(?:m|mins?|minutes?)\b/,seconds:/(?:s|secs?|seconds?)\b/,milliseconds:/(?:ms|milliseconds?)\b/,space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},colon:":"}),t.lexer.next=(o=>()=>{let g;for(;(g=o.call(t.lexer))&&g.type==="space";);return g})(t.lexer.next),t.lexerAny=t.lexer},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});function n(a){return a[0]}const o=i(18),g={Lexer:o.lexerAny,ParserRules:[{name:"num",symbols:[o.lexerAny.has("int")?{type:"int"}:int]},{name:"num",symbols:[o.lexerAny.has("float")?{type:"float"}:float]},{name:"main$ebnf$1",symbols:[]},{name:"main$ebnf$1",symbols:["main$ebnf$1","long"],postprocess:a=>a[0].concat([a[1]])},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["short"]},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["main$ebnf$2$subexpression$1$ebnf$1","short"],postprocess:a=>a[0].concat([a[1]])},{name:"main$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("T")?{type:"T"}:T,"main$ebnf$2$subexpression$1$ebnf$1"]},{name:"main$ebnf$2",symbols:["main$ebnf$2$subexpression$1"],postprocess:n},{name:"main$ebnf$2",symbols:[],postprocess:()=>null},{name:"main",symbols:[o.lexerAny.has("P")?{type:"P"}:P,"main$ebnf$1","main$ebnf$2"],postprocess:([a,s,I],r)=>(I=I?I[1]:[],!s.length&&!I.length?r:s.length?I.length?[...s,...I]:s:I)},{name:"long$subexpression$1",symbols:[o.lexerAny.has("Y")?{type:"Y"}:Y]},{name:"long$subexpression$1",symbols:[o.lexerAny.has("M")?{type:"M"}:M]},{name:"long$subexpression$1",symbols:[o.lexerAny.has("W")?{type:"W"}:W]},{name:"long$subexpression$1",symbols:[o.lexerAny.has("D")?{type:"D"}:D]},{name:"long",symbols:["num","long$subexpression$1"],postprocess:([a,s])=>{switch(a=parseFloat(a[0].value),s=s[0].type,s){case"Y":return["years",a];case"M":return["months",a];case"W":return["days",a*7];case"D":return["days",a];default:throw new Error("Unexpected unit "+s)}}},{name:"short$ebnf$1",symbols:[o.lexerAny.has("T")?{type:"T"}:T],postprocess:n},{name:"short$ebnf$1",symbols:[],postprocess:()=>null},{name:"short$subexpression$1",symbols:[o.lexerAny.has("H")?{type:"H"}:H]},{name:"short$subexpression$1",symbols:[o.lexerAny.has("M")?{type:"M"}:M]},{name:"short$subexpression$1",symbols:[o.lexerAny.has("S")?{type:"S"}:S]},{name:"short",symbols:["short$ebnf$1","num","short$subexpression$1"],postprocess:([a,s,I])=>{switch(s=parseFloat(s[0].value),I=I[0].type,I){case"H":return["hours",s];case"M":return["minutes",s];case"S":return["seconds",s];default:throw new Error("Unexpected unit "+I)}}}],ParserStart:"num"};t.default=g},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.lexerAny=t.lexer=void 0;const n=i(0);t.lexer=(0,n.compile)({int:/\-?\d+(?![\.\d])/,float:/\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,P:"P",Y:"Y",M:"M",W:"W",D:"D",H:"H",S:"S",T:"T"}),t.lexerAny=t.lexer},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.toSql=void 0;const n=i(2),o=i(5),g=i(6),a=i(20),s=i(3),I=new Set(s.sqlKeywords.map(k=>k.toLowerCase()));let r=[];function C(k){return l(k.name)}function l(k,h){if(!h){const N=k.toLowerCase();if(N===k&&!I.has(N)&&/^[a-z][a-z0-9_]*$/.test(N))return k}return'"'+k+'"'}function c(k,h,N){N&&r.push("(");let v=!0;for(const K of k)v||r.push(", "),v=!1,h(K);N&&r.push(")")}function B(k,h){switch(k.type){case"foreign key":r.push(" foreign key (",...k.localColumns.map(C).join(", "),")");case"reference":r.push(" REFERENCES "),h.tableRef(k.foreignTable),r.push("(",...k.foreignColumns.map(C).join(", "),") "),k.match&&r.push(" MATCH ",k.match.toUpperCase()),k.onDelete&&r.push(" ON DELETE ",k.onDelete),k.onUpdate&&r.push(" ON UPDATE ",k.onUpdate);break;case"primary key":case"unique":r.push(" ",k.type," "),"columns"in k&&r.push("(",...k.columns.map(C).join(", "),") ");break;case"check":r.push(" check "),h.expr(k.expr);break;case"not null":case"null":r.push(" ",k.type," ");break;case"default":r.push(" default "),h.expr(k.default);break;case"add generated":r.push(" GENERATED "),w(h,k);break;default:throw g.NotSupported.never(k)}r.push(" ")}function E(k,h){k.schema&&r.push(l(k.schema),"."),r.push(l(k.name,h)," ")}function u(k){E(k),k.alias&&r.push(" AS ",l(k.alias)," ")}function d(k,h){r.push(" ORDER BY "),c(h,N=>{k.expr(N.by),N.order&&r.push(" ",N.order," "),N.nulls&&r.push(" NULLS ",N.nulls," ")},!1)}function f(k){switch(k.type){case"default":r.push("DEFAULT ");break;case"identifier":r.push(k.name);break;case"list":let h=!0;for(const N of k.values)h||r.push(", "),h=!1,f(N);break;case"value":r.push(typeof k.value=="number"?k.value.toString():(0,a.literal)(k.value));break;default:throw g.NotSupported.never(k)}}function w(k,h){h.always&&r.push(h.always.toUpperCase()," "),r.push("AS IDENTITY "),h.sequence&&(r.push("("),h.sequence.name&&(r.push("SEQUENCE NAME "),E(h.sequence.name),r.push(" ")),y(k,h.sequence),r.push(") "))}function y(k,h){h.as&&(r.push("AS "),k.dataType(h.as),r.push(" ")),typeof h.incrementBy=="number"&&r.push("INCREMENT BY ",h.incrementBy.toString()," "),h.minValue==="no minvalue"&&r.push("NO MINVALUE "),typeof h.minValue=="number"&&r.push("MINVALUE ",h.minValue.toString()," "),h.maxValue==="no maxvalue"&&r.push("NO MAXVALUE "),typeof h.maxValue=="number"&&r.push("MAXVALUE ",h.maxValue.toString()," "),typeof h.startWith=="number"&&r.push("START WITH ",h.startWith.toString()," "),typeof h.cache=="number"&&r.push("CACHE ",h.cache.toString()," "),h.cycle&&r.push(h.cycle," "),h.ownedBy==="none"?r.push("OWNED BY NONE "):h.ownedBy&&(r.push("OWNED BY "),G(h.ownedBy)),"restart"in h&&(h.restart===!0?r.push("RESTART "):h.restart&&r.push("RESTART WITH ",h.restart.toString()," "))}function G(k){k.schema&&r.push(l(k.schema),"."),r.push(l(k.table),".",l(k.column)," ")}function R(k,h,N){if(!h){N();return}r.push(h.type," "),N(),h.on&&(r.push("ON "),k.expr(h.on)),h.using&&(r.push("USING ("),c(h.using,v=>r.push(C(v)),!1),r.push(") ")),r.push(" ")}function x(k){k.opSchema?r.push(" operator(",l(k.opSchema),".",k.op,") "):r.push(" ",k.op," ")}const F=(0,o.astVisitor)(k=>({addColumn:(...h)=>{r.push(" ADD COLUMN "),h[0].ifNotExists&&r.push("IF NOT EXISTS "),k.super().addColumn(...h)},createExtension:h=>{r.push("CREATE EXTENSION "),h.ifNotExists&&r.push(" IF NOT EXISTS "),r.push(C(h.extension)),!(!h.from&&!h.version&&!h.schema)&&(r.push(" WITH"),h.schema&&r.push(" SCHEMA ",C(h.schema)),h.version&&r.push(" VERSION ",(0,a.literal)(h.version.value)),h.from&&r.push(" FROM ",(0,a.literal)(h.from.value)))},tablespace:h=>{r.push("TABLESPACE ",C(h.tablespace))},addConstraint:h=>{r.push(" ADD ");const N=h.constraint.constraintName;N&&r.push(" CONSTRAINT ",C(N)," "),B(h.constraint,k)},alterColumn:(h,N)=>{r.push(" ALTER COLUMN ",C(h.column)," "),k.super().alterColumn(h,N)},setColumnDefault:(h,N,v)=>{if(r.push(" SET DEFAULT "),k.expr(h.default),h.updateExisting)throw new Error("Not implemented: updateExisting on set column default")},createEnum:h=>{r.push("CREATE TYPE "),E(h.name),r.push(" AS ENUM "),c(h.values,N=>r.push((0,a.literal)(N.value)),!0),r.push(" ")},createCompositeType:h=>{r.push("CREATE TYPE "),E(h.name),r.push(" AS "),c(h.attributes,N=>{r.push(C(N.name)," "),k.dataType(N.dataType),N.collate&&(r.push("COLLATE "),E(N.collate))},!0),r.push(" ")},setTableOwner:h=>{r.push(" OWNER TO ",C(h.to))},alterColumnSimple:h=>r.push(h.type),alterColumnAddGenerated:h=>{r.push(" ADD GENERATED "),w(k,h)},setColumnType:h=>{r.push(" SET DATA TYPE "),k.dataType(h.dataType),r.push(" ")},alterTable:h=>{r.push("ALTER TABLE "),h.ifExists&&r.push(" IF EXISTS "),h.only&&r.push(" ONLY "),u(h.table),c(h.changes,N=>k.tableAlteration(N,h.table),!1)},alterIndex:h=>{switch(r.push("ALTER INDEX "),h.ifExists&&r.push(" IF EXISTS "),u(h.index),h.change.type){case"rename":r.push(" RENAME TO "),E(h.change.to),r.push(" ");break;case"set tablespace":r.push(" SET TABLESPACE "),E(h.change.tablespace),r.push(" ");break;default:throw g.NotSupported.never(h.change,"Alter index type not supported: ")}},tableAlteration:(h,N)=>{switch(h.type){case"add column":return k.addColumn(h,N);case"add constraint":return k.addConstraint(h,N);case"alter column":return k.alterColumn(h,N);case"rename":return k.renameTable(h,N);case"rename column":return k.renameColumn(h,N);case"rename constraint":return k.renameConstraint(h,N);case"drop column":return k.dropColumn(h,N);case"drop constraint":return k.dropConstraint(h,N);case"owner":return k.setTableOwner(h,N);default:throw g.NotSupported.never(h)}},array:h=>{r.push(h.type==="array"?"ARRAY[":"("),c(h.expressions,N=>k.expr(N),!1),r.push(h.type==="array"?"]":")")},arrayIndex:h=>{k.expr(h.array),r.push("["),k.expr(h.index),r.push("] ")},expr:h=>{if(h.type==="ref"){k.ref(h);return}if(h.type==="list"){k.super().expr(h);return}r.push("("),k.super().expr(h),r.push(")")},callOverlay:h=>{r.push("OVERLAY("),k.expr(h.value),r.push(" PLACING "),k.expr(h.placing),r.push(" FROM "),k.expr(h.from),h.for&&(r.push(" FOR "),k.expr(h.for)),r.push(")")},callSubstring:h=>{r.push("SUBSTRING("),k.expr(h.value),h.from&&(r.push(" FROM "),k.expr(h.from)),h.for&&(r.push(" FOR "),k.expr(h.for)),r.push(")")},binary:h=>{k.expr(h.left),x(h),k.expr(h.right)},call:h=>{E(h.function),r.push("("),h.distinct&&r.push(h.distinct," "),c(h.args,N=>k.expr(N),!1),h.orderBy&&d(k,h.orderBy),r.push(") "),h.filter&&(r.push("filter (where "),k.expr(h.filter),r.push(") ")),h.over&&(r.push("over ("),h.over.partitionBy&&(r.push("PARTITION BY "),c(h.over.partitionBy,N=>k.expr(N),!1),r.push(" ")),h.over.orderBy&&(d(k,h.over.orderBy),r.push(" ")),r.push(") "))},case:h=>{r.push("CASE "),h.value&&k.expr(h.value);for(const N of h.whens)r.push(" WHEN "),k.expr(N.when),r.push(" THEN "),k.expr(N.value);h.else&&(r.push(" ELSE "),k.expr(h.else)),r.push(" END ")},cast:h=>{k.expr(h.operand),r.push("::"),k.dataType(h.to)},constant:h=>{switch(h.type){case"boolean":r.push(h.value?"true":"false");break;case"integer":r.push(h.value.toString(10));break;case"numeric":r.push(h.value.toString()),Number.isInteger(h.value)&&r.push(".");break;case"null":r.push("null");break;case"constant":break;case"string":r.push((0,a.literal)(h.value));break;default:throw g.NotSupported.never(h)}},valueKeyword:h=>{r.push(h.keyword," ")},comment:h=>{switch(r.push("COMMENT ON ",h.on.type.toUpperCase()," "),h.on.type){case"column":G(h.on.column);break;default:E(h.on.name);break}r.push(" IS ",(0,a.literal)(h.comment)," ")},extract:h=>{r.push("EXTRACT (",h.field.name.toUpperCase()," FROM "),k.expr(h.from),r.push(") ")},createColumn:h=>{var N;r.push(C(h.name)," "),k.dataType(h.dataType),r.push(" "),h.collate&&(r.push("COLLATE "),E(h.collate));for(const v of(N=h.constraints)!==null&&N!==void 0?N:[])k.constraint(v)},begin:h=>{r.push("BEGIN "),h.isolationLevel&&r.push("ISOLATION LEVEL ",h.isolationLevel.toUpperCase()," "),h.writeable&&r.push(h.writeable.toUpperCase()," "),typeof h.deferrable=="boolean"&&(h.deferrable||r.push("NOT "),r.push("DEFERRABLE "))},alterSequence:h=>{switch(r.push("ALTER SEQUENCE "),h.ifExists&&r.push("IF EXISTS "),E(h.name),h.change.type){case"set options":y(k,h.change);break;case"rename":r.push("RENAME TO ",C(h.change.newName)," ");break;case"set schema":r.push("SET SCHEMA ",C(h.change.newSchema)," ");break;case"owner to":h.change.owner,r.push("OWNER TO ",C(h.change.owner)," ");break;default:throw g.NotSupported.never(h.change)}},createSequence:h=>{r.push("CREATE "),h.temp&&r.push("TEMPORARY "),r.push("SEQUENCE "),h.ifNotExists&&r.push("IF NOT EXISTS "),E(h.name),y(k,h.options)},drop:h=>{r.push(h.type.toUpperCase()," "),h.concurrently&&r.push("CONCURRENTLY "),h.ifExists&&r.push("IF EXISTS "),c(h.names,N=>k.tableRef(N),!1),h.cascade&&r.push(h.cascade.toUpperCase()," ")},constraint:h=>{h.constraintName&&r.push(" CONSTRAINT ",C(h.constraintName)," "),B(h,k)},do:h=>{r.push("DO"),h.language&&r.push(" LANGUAGE ",h.language.name),r.push(" $$",h.code,"$$")},createFunction:h=>{var N;if(r.push(h.orReplace?"CREATE OR REPLACE FUNCTION ":"CREATE FUNCTION "),E(h.name),c(h.arguments,v=>{v.mode&&r.push(v.mode," "),v.name&&r.push(C(v.name)," "),k.dataType(v.type),v.default&&(r.push(" = "),k.expr(v.default))},!0),h.returns)switch(h.returns.kind){case"table":r.push(" RETURNS TABLE "),c(h.returns.columns,v=>{r.push(C(v.name)," "),k.dataType(v.type)},!0);break;case void 0:case null:case"array":r.push(" RETURNS "),k.dataType(h.returns);break;default:throw g.NotSupported.never(h.returns)}switch(r.push(" AS $$",(N=h.code)!==null&&N!==void 0?N:"","$$"),h.language&&r.push("LANGUAGE ",h.language.name," "),h.purity&&r.push(h.purity.toUpperCase()," "),typeof h.leakproof=="boolean"&&r.push(h.leakproof?"LEAKPROOF ":"NOT LEAKPROOF "),h.onNullInput){case"call":r.push("CALLED ON NULL INPUT ");break;case"null":r.push("RETURNS NULL ON NULL INPUT ");break;case"strict":r.push("STRICT ");break;case null:case void 0:break;default:throw g.NotSupported.never(h.onNullInput)}},dropFunction:h=>{r.push("DROP FUNCTION "),h.ifExists&&r.push("IF EXISTS "),E(h.name),h.arguments&&c(h.arguments,N=>{N.name&&(E(N.name),r.push(" ")),k.dataType(N.type)},!0),r.push(" ")},with:h=>{r.push("WITH "),c(h.bind,N=>{r.push(C(N.alias)," AS ("),k.statement(N.statement),r.push(") ")},!1),k.statement(h.in)},withRecursive:h=>{r.push("WITH RECURSIVE ",C(h.alias),"(",...h.columnNames.map(C).join(", "),") AS ("),k.union(h.bind),r.push(") "),k.statement(h.in)},setGlobal:h=>{r.push("SET ",C(h.variable)," = "),f(h.set)},setTimezone:h=>{switch(r.push("SET TIME ZONE "),h.to.type){case"default":case"local":r.push(h.to.type.toUpperCase()," ");break;case"value":r.push(typeof h.to.value=="string"?(0,a.literal)(h.to.value):h.to.value.toString(10));break;case"interval":r.push("INTERVAL ",(0,a.literal)(h.to.value)," HOUR TO MINUTE");break;default:throw g.NotSupported.never(h.to)}},dataType:h=>{var N,v;if((h==null?void 0:h.kind)==="array"){k.dataType(h.arrayOf),r.push("[]");return}if(!(h!=null&&h.name)){r.push("unkown");return}let K=!0;if(h.schema)E(h,h.doubleQuoted);else if(h.doubleQuoted)E(h,!0);else switch(h.name){case"double precision":case"character varying":case"bit varying":r.push(h.name," ");break;case"time without time zone":case"timestamp without time zone":case"time with time zone":case"timestamp with time zone":const U=h.name.split(" ");r.push(U.shift()),!((N=h.config)===null||N===void 0)&&N.length&&c(h.config,V=>r.push(V.toString(10)),!0),r.push(" "),r.push(U.join(" ")," "),K=!1;break;default:E(h);break}K&&!((v=h.config)===null||v===void 0)&&v.length&&c(h.config,U=>r.push(U.toString(10)),!0)},createIndex:h=>{r.push(h.unique?"CREATE UNIQUE INDEX ":"CREATE INDEX "),h.ifNotExists&&r.push(" IF NOT EXISTS "),h.indexName&&r.push(C(h.indexName)," "),r.push("ON "),k.tableRef(h.table),h.using&&r.push("USING ",C(h.using)," "),c(h.expressions,N=>{k.expr(N.expression),r.push(" "),N.collate&&(r.push("COLLATE "),E(N.collate)),N.opclass&&E(N.opclass),N.order&&r.push(N.order," "),N.nulls&&r.push("nulls ",N.nulls," ")},!0),h.with&&(r.push("WITH "),c(h.with,N=>{r.push(N.parameter," = ",(0,a.literal)(N.value))},!0)),h.tablespace&&r.push("TABLESPACE ",l(h.tablespace)),h.where&&(r.push(" WHERE "),k.expr(h.where)),r.push(" ")},createTable:h=>{var N;r.push("CREATE "),h.locality&&r.push(h.locality.toUpperCase()," "),h.temporary&&r.push("TEMPORARY "),h.unlogged&&r.push("UNLOGGED "),r.push(h.ifNotExists?"TABLE IF NOT EXISTS ":"TABLE "),k.tableRef(h.name),r.push("("),c(h.columns,v=>{switch(v.kind){case"column":return k.createColumn(v);case"like table":return k.likeTable(v);default:throw g.NotSupported.never(v)}},!1),h.constraints&&(r.push(", "),c(h.constraints,v=>{const K=v.constraintName;K&&r.push("CONSTRAINT ",C(K)," "),B(v,k)},!1)),r.push(") "),!((N=h.inherits)===null||N===void 0)&&N.length&&(r.push(" INHERITS "),c(h.inherits,v=>E(v),!0))},likeTable:h=>{r.push(" LIKE "),k.tableRef(h.like),r.push(" ");for(const{verb:N,option:v}of h.options)r.push(N.toUpperCase()," ",v.toUpperCase()," ")},createSchema:h=>{r.push(h.ifNotExists?"CREATE SCHEMA IF NOT EXISTS ":"CREATE SCHEMA "),r.push(C(h.name))},truncateTable:h=>{r.push("TRUNCATE TABLE ");let N=!0;for(const v of h.tables)N||r.push(", "),N=!1,k.tableRef(v);if(h.identity)switch(h.identity){case"restart":r.push(" RESTART IDENTITY ");break;case"continue":r.push(" CONTINUE IDENTITY ");break}h.cascade&&r.push(" ",h.cascade," ")},delete:h=>{r.push("DELETE FROM "),k.tableRef(h.from),h.where&&(r.push(" WHERE "),k.expr(h.where)),h.returning&&(r.push(" RETURNING "),c(h.returning,N=>k.selectionColumn(N),!1)),r.push(" ")},dropColumn:h=>{r.push(" DROP COLUMN "),h.ifExists&&r.push(" IF EXISTS "),r.push(C(h.column)),h.behaviour&&r.push(" ",h.behaviour),r.push(" ")},dropConstraint:h=>{r.push(" DROP CONSTRAINT "),h.ifExists&&r.push(" IF EXISTS "),r.push(C(h.constraint)),h.behaviour&&r.push(" ",h.behaviour.toUpperCase()," ")},from:h=>k.super().from(h),fromCall:h=>{R(k,h.join,()=>{var N,v;if(k.call(h),h.withOrdinality&&r.push(" WITH ORDINALITY"),h.alias){r.push(" AS ",C(h.alias)," ");const K=(v=(N=h.alias.columns)===null||N===void 0?void 0:N.length)!==null&&v!==void 0?v:0;if(K>0){r.push("(");for(let U=0;U<K;++U)U!==0&&r.push(", "),r.push(C(h.alias.columns[U]));r.push(")")}}}),r.push(" ")},fromStatement:h=>{R(k,h.join,()=>{r.push("("),k.select(h.statement),r.push(") "),h.alias&&(r.push(" AS ",l(h.alias)),h.columnNames&&c(h.columnNames,N=>r.push(C(N)),!0),r.push(" "))}),r.push(" ")},values:h=>{r.push("VALUES "),c(h.values,N=>{c(N,v=>{k.expr(v)},!0)},!1)},fromTable:h=>{R(k,h.join,()=>{if(k.tableRef(h.name),h.name.columnNames){if(!h.name.alias)throw new Error("Cannot specify aliased column names without an alias");c(h.name.columnNames,N=>r.push(C(N)),!0)}})},join:h=>{throw new Error("Should not happen 💀")},insert:h=>{if(r.push("INSERT INTO "),k.tableRef(h.into),h.columns&&r.push("(",h.columns.map(C).join(", "),")"),r.push(" "),h.overriding&&r.push("OVERRIDING ",h.overriding.toUpperCase()," VALUE "),k.select(h.insert),r.push(" "),h.onConflict){r.push("ON CONFLICT ");const N=h.onConflict.on;switch(N==null?void 0:N.type){case"on expr":c(N.exprs,v=>k.expr(v),!0);break;case"on constraint":r.push("ON CONSTRAINT "),E(N.constraint);case null:case void 0:break;default:throw g.NotSupported.never(N)}h.onConflict.do==="do nothing"?r.push(" DO NOTHING"):(r.push(" DO UPDATE SET "),c(h.onConflict.do.sets,v=>k.set(v),!1),h.onConflict.where&&(r.push(" WHERE "),k.expr(h.onConflict.where))),r.push(" ")}h.returning&&(r.push(" RETURNING "),c(h.returning,N=>k.selectionColumn(N),!1))},raise:h=>{var N,v;r.push("RAISE "),h.level&&r.push(h.level.toUpperCase()," "),r.push((0,a.literal)(h.format)," "),!((N=h.formatExprs)===null||N===void 0)&&N.length&&(r.push(", "),c(h.formatExprs,K=>k.expr(K),!1)),!((v=h.using)===null||v===void 0)&&v.length&&(r.push(" USING "),c(h.using,({type:K,value:U})=>{r.push(K.toUpperCase(),"="),k.expr(U)},!1)),r.push(" ")},default:()=>{r.push(" DEFAULT ")},member:h=>{k.expr(h.operand),r.push(h.op),r.push(typeof h.member=="number"?h.member.toString(10):(0,a.literal)(h.member))},ref:h=>{h.table&&(E(h.table),r.push(".")),r.push(h.name==="*"?"*":l(h.name))},parameter:h=>{r.push(h.name)},renameColumn:h=>{r.push(" RENAME COLUMN ",C(h.column)," TO ",C(h.to))},renameConstraint:h=>{r.push(" RENAME CONSTRAINT ",C(h.constraint)," TO ",C(h.to))},renameTable:h=>{r.push(" RENAME TO ",C(h.to))},createView:h=>{r.push("CREATE "),h.orReplace&&r.push("OR REPLACE "),h.temp&&r.push("TEMP "),h.recursive&&r.push("RECURSIVE "),r.push("VIEW "),k.tableRef(h.name),h.columnNames&&c(h.columnNames,v=>r.push(C(v)),!0);const N=h.parameters&&Object.entries(h.parameters);N!=null&&N.length&&(r.push(" WITH "),c(N,([v,K])=>r.push(v,"=",K),!1)),r.push(" AS "),k.select(h.query),h.checkOption&&r.push(" WITH ",h.checkOption.toUpperCase()," CHECK OPTION")},createMaterializedView:h=>{r.push("CREATE MATERIALIZED VIEW "),h.ifNotExists&&r.push("IF NOT EXISTS "),k.tableRef(h.name),h.columnNames&&c(h.columnNames,v=>r.push(C(v)),!0);const N=h.parameters&&Object.entries(h.parameters);N!=null&&N.length&&(r.push(" WITH "),c(N,([v,K])=>r.push(v,"=",K),!1)),h.tablespace&&r.push(" TABLESPACE ",C(h.tablespace)),r.push(" AS "),k.select(h.query),typeof h.withData=="boolean"&&r.push(h.withData?" WITH DATA":" WITH NO DATA")},refreshMaterializedView:h=>{r.push("REFRESH MATERIALIZED VIEW "),h.concurrently&&r.push("CONCURRENTLY "),k.tableRef(h.name),typeof h.withData=="boolean"&&r.push(h.withData?" WITH DATA":" WITH NO DATA")},select:h=>k.super().select(h),selection:h=>{if(r.push("SELECT "),h.distinct&&(typeof h.distinct=="string"?r.push(h.distinct.toUpperCase()):(r.push(" DISTINCT ON "),c(h.distinct,N=>k.expr(N),!0)),r.push(" ")),h.columns&&c(h.columns,N=>k.selectionColumn(N),!1),r.push(" "),h.from){r.push("FROM ");const N=h.from.length;for(let v=0;v<N;v++){const K=h.from[v];v>0&&!K.join&&r.push(","),k.from(K)}r.push(" ")}h.where&&(r.push("WHERE "),k.expr(h.where),r.push(" ")),h.groupBy&&(r.push("GROUP BY "),c(h.groupBy,N=>k.expr(N),!1),r.push(" "),h.having&&(r.push(" HAVING "),k.expr(h.having),r.push(" "))),h.orderBy&&(d(k,h.orderBy),r.push(" ")),h.limit&&(h.limit.offset&&(r.push("OFFSET "),k.expr(h.limit.offset)),h.limit.limit&&(r.push("LIMIT "),k.expr(h.limit.limit))),h.for&&(r.push("FOR ",h.for.type.toUpperCase()),h.skip&&r.push(" ",h.skip.type.toUpperCase()))},show:h=>{r.push("SHOW ",C(h.variable))},prepare:h=>{var N;r.push("PREPARE ",C(h.name)),!((N=h.args)===null||N===void 0)&&N.length&&c(h.args,v=>k.dataType(v),!0),r.push(" AS "),k.statement(h.statement)},deallocate:h=>{if(r.push("DEALLOCATE "),"name"in h.target){r.push(h.target.name);return}r.push("ALL")},arraySelect:h=>{r.push("array("),k.select(h.select),r.push(")")},union:h=>{r.push("("),k.statement(h.left),r.push(") ",h.type.toUpperCase()," "),h.right.type==="union"||h.right.type==="union all"?k.union(h.right):(r.push("("),k.statement(h.right),r.push(")"))},selectionColumn:h=>{k.expr(h.expr),h.alias&&r.push(" AS ",C(h.alias)),r.push(" ")},set:h=>{r.push(C(h.column)," = "),k.expr(h.value),r.push(" ")},statement:h=>k.super().statement(h),tableRef:h=>{E(h),h.alias&&r.push(" AS ",l(h.alias)),r.push(" ")},ternary:h=>{k.expr(h.value),r.push(" ",h.op," "),k.expr(h.lo),r.push(" AND "),k.expr(h.hi),r.push(" ")},transaction:h=>{r.push(h.type)},unary:h=>{switch(h.op){case"+":case"-":x(h),k.expr(h.operand);break;case"NOT":r.push(h.op),r.push(" "),k.expr(h.operand);break;default:k.expr(h.operand),r.push(" "),r.push(h.op)}},update:h=>{r.push("UPDATE "),k.tableRef(h.table),r.push(" SET "),c(h.sets,N=>k.set(N),!1),r.push(" "),h.from&&(r.push("FROM "),k.from(h.from),r.push(" ")),h.where&&(r.push("WHERE "),k.expr(h.where),r.push(" ")),h.returning&&(r.push(" RETURNING "),c(h.returning,N=>k.selectionColumn(N),!1),r.push(" "))}}));t.toSql={};const Q=n.AstDefaultMapper.prototype;for(const k of Object.getOwnPropertyNames(Q)){const h=Q[k];k==="constructor"||k==="super"||typeof h!="function"||(t.toSql[k]=function(...N){try{return F[k].apply(F,N),r.join("").trim()}finally{r=[]}})}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.literal=void 0;function n(o){if(o==null)return"NULL";if(Array.isArray(o)){var g=o.map(n);return"("+g.join(", ")+")"}var a=~o.indexOf("\\"),s=a?"E":"";return o=o.replace(/'/g,"''"),o=o.replace(/\\/g,"\\\\"),s+"'"+o+"'"}t.literal=n},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.locationOf=void 0;function n(o){const g=o._location;if(!g)throw new Error("This statement has not been parsed using location tracking (which has a small performance hit). ");return g}t.locationOf=n}]))})(hF);function Gy(A,e){return new Proxy(new Date(A.getTime()-e*6e4),{get(t,i){if(typeof i=="string"){if(i==="getTime")return()=>t.getTime()+e*6e4;if(i.startsWith("get")&&!i.includes("UTC"))return t[i.replace("get","getUTC")].bind(t);if(i.startsWith("set")&&!i.includes("UTC"))return(...n)=>t[i.replace("set","setUTC")].call(t,...n)+e*6e4}return t[i].bind(t)}})}const H3e=[/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/,/^\d{4}-(0[1-9]|1[0-2])$/,/^\d{4}$/],$MA=["%Y","%Y-%m","%Y-%m-%d"];function mF(A=new Date().getTimezoneOffset()){function e(...t){if(t.length>1){const i=A*6e4+Date.UTC(...t);return Gy(new Date(i),A)}if(t.length>0){const i=t[0];if(i instanceof Date)return Gy(i,A);if(typeof i=="string"){if(H3e.find(g=>g.test(i))){const g=new Date(i).getTime();return Gy(new Date(g+A*6e4),A)}if(/(Z|[\+\-][0-2][0-9])$/.test(i))return Gy(new Date(i),A);const n=new Date(i),o=n.getTime()-n.getTimezoneOffset()*6e4;return Gy(new Date(o+A*6e4),A)}return i==null?null:Gy(new Date(i),A)}return Gy(new Date,A)}return e}function Sm(A,e){const t=mF(A??new Date().getTimezoneOffset()),i=mF(e??new Date().getTimezoneOffset());function n(...o){return t(i(...o))}return n}const _iA=new Map,AvA=A=>{if(_iA.has(A))return _iA.get(A);const e=[];for(let t=0;t<A;t++)for(let i=0;i<A;i++)((t-(A-1)/2)**2+(i-(A-1)/2)**2)*4<A**2&&e.push([t,i]);return _iA.set(A,e),e};function Z3e([A,e],t,i){const n=(t-t%2)/2;return AvA(t).map(([o,g])=>[o+A-n,g+e-n]).filter(([o,g])=>o>=0&&o<i&&g>=0&&g<i)}function W3e(A,e,t){const[i,n]=t,o=evA(t);if(i.domain.type==="quantitative"&&n.domain.type==="quantitative"){const a=i.domain.width;return Z3e(A,e,a).map(([s,I])=>o([I,s]))}const g=(a,s)=>{if(s.domain.type==="nominal")return[a];const I=(e-e%2)/2;return new Array(e).fill(0).map((r,C)=>C+a-I).filter(r=>r>=0&&r<s.domain.width)};return g(A[0],n).flatMap(a=>g(A[1],i).map(s=>[a,s])).map(([a,s])=>o([s,a]))}async function K3e(A){return await new Promise(e=>{const t=new FileReader;t.onload=()=>e(t.result.substring(37)),t.readAsDataURL(new Blob([A]))})}async function U3e(A){const e=new Response(A.buffer).body.pipeThrough(new CompressionStream("deflate-raw")),t=await new Response(e).arrayBuffer();return K3e(t)}async function OiA(A){const e=await fetch("data:application/octet-stream;base64,"+A).then(i=>i.body.pipeThrough(new DecompressionStream("deflate-raw"))),t=await new Response(e).arrayBuffer();return new Uint8Array(t)}function SV(A){return new Uint8Array(A.reduce((e,t)=>e*t.domain.width,1))}function V3e(A,e,t){return e>=A[1]?t-1:e<=A[0]?0:Math.floor(t*(e-A[0])/(A[1]-A[0]))}function evA(A){const e=A.map(t=>t.domain.width).reduceRight(([t,...i],n)=>[n*t,t,...i],[1]).slice(1);return t=>t.map((i,n)=>i*e[n]).reduce((i,n)=>i+n)}function qiA(A){const e=A.map(({domain:i,fid:n})=>{if(i.type==="nominal"){const g=new Map(i.value.map((a,s)=>[`${a}`,s]));return a=>g.get(`${a[n]}`)??0}if(i.type==="quantitative")return g=>V3e(i.value,g[n],i.width);const o=i;throw new Error(`unsupported domain type ${o.type}`)}),t=evA(A);return i=>t(e.map(n=>n(i)))}function X3e(A){return{dict:A.dict,usedColor:A.usedColor,facets:[{map:A.map,usedColor:A.usedColor,dimensions:[{fid:A.y,domain:{type:"quantitative",value:A.domainY,width:A.mapwidth}},{fid:A.x,domain:{type:"quantitative",value:A.domainX,width:A.mapwidth}}]}]}}async function tvA(A,e){const{dict:t,facets:i}=e;let n=A.map(()=>t[1].name);for(const{map:o,dimensions:g}of i){const a=await OiA(o),s=qiA(g);n=A.map(s).map((I,r)=>{var C;return a[I]!==0?(C=t[a[I]])==null?void 0:C.name:n[r]})}return n}function HV(A){return hF.parse(A,"expr")}const z3e=new Set(["ALL","ANALYSE","ANALYZE","AND","ANY","ARRAY","AS","ASC","ASYMMETRIC","BINARY","BOTH","CASE","CAST","CHECK","COLLATE","COLUMN","CONCURRENTLY","CONSTRAINT","CREATE","CROSS","CURRENT_DATE","CURRENT_ROLE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","DEFAULT","DEFERRABLE","DESC","DISTINCT","DO","ELSE","END","EXCEPT","FALSE","FETCH","FOR","FOREIGN","FREEZE","FROM","FULL","GRANT","GROUP","HAVING","ILIKE","IN","INITIALLY","INNER","INTERSECT","INTO","IS","ISNULL","JOIN","LATERAL","LEADING","LEFT","LIKE","LIMIT","LOCALTIME","LOCALTIMESTAMP","NATURAL","NOT","NOTNULL","NULL","OFFSET","ON","ONLY","OR","ORDER","OUTER","OVERLAPS","PLACING","PRIMARY","REFERENCES","RETURNING","RIGHT","SELECT","SESSION_USER","SIMILAR","SOME","SYMMETRIC","TABLE","THEN","TO","TRAILING","TRUE","UNION","UNIQUE","USER","USING","VARIADIC","VERBOSE","WHEN","WHERE","WINDOW","WITH"]),T3e=new Set(["abs","atan2","add","currval","octet_length","array_length","md5_number_lower","upper","make_timestamp","array_resize","ascii","list_contains","day","get_bit","substring","subtract","array_cat","string_to_array","error","in_search_path","list_concat","lower","base64","editdist3","regexp_matches","nextval","date_part","typeof","regexp_extract_all","last_day","millisecond","month","to_base64","prefix","divide","ucase","from_hex","concat","not_ilike_escape","range","substr","unbin","len","split","list_value","list_position","list_indexof","enum_last","not_like_escape","even","set_bit","time_bucket","regexp_replace","struct_extract","gcd","constant_or_null","apply","vector_type","list_filter","chr","array_contains","ceiling","radians","nfc_normalize","log10","regexp_full_match","alias","length_grapheme","suffix","list_aggr","ilike_escape","multiply","array_concat","regexp_extract","like_escape","current_database","hex","isoyear","transaction_timestamp","array_indexof","list_element","jaccard","yearweek","to_months","year","xor","weekofyear","weekday","lpad","bit_length","dayofyear","union_tag","uuid","list_distance","dayname","unhex","txid_current","trunc","encode","to_minutes","to_milliseconds","to_binary","to_base","array_distinct","timezone_hour","tan","struct_pack","strptime","strpos","strlen","atan","str_split_regex","str_split","date_sub","map_values","least_common_multiple","stats","datediff","starts_with","!__postfix","factorial","sqrt","element_at","printf","signbit","sha256","list_extract","setseed","enum_range","second","reverse","replace","damerau_levenshtein","to_hours","substring_grapheme","repeat","length","to_microseconds","century","list_has","current_date","combine","epoch_ns","isinf","rpad","ceil","format","regexp_split_to_array","today","random","quarter","array_aggr","position","isnan","age","pi","aggregate","array_reverse_sort","nextafter","monthname","array_position","unicode","concat_ws","mismatches","epoch","minute","mod","millennium","string_split_regex","microsecond","bit_position","right_grapheme","list_reverse_sort","md5","rtrim","sign","string_split","list_resize","map_keys","map_entries","exp","map_concat","map","make_time","week","make_date","power","__internal_decompress_integral_usmallint","ltrim","log2","pow","log","greatest","list_cat","list_unique","contains","list_transform","timezone_minute","list_sort","list_pack","list_dot_product","list_apply","array_slice","lgamma","map_extract","left_grapheme","least","julian","jaro_winkler_similarity","isodow","union_extract","list_distinct","isfinite","to_years","instr","date_trunc","sin","translate","array_filter","strip_accents","to_timestamp","list_inner_product","array_apply","hash","to_seconds","decade","hamming","greatest_common_divisor","ends_with","get_current_timestamp","try_strptime","to_hex","get_current_time","timezone","md5_number_upper","generate_series","strftime","datepart","levenshtein","__internal_compress_integral_usmallint","union_value","gen_random_uuid","array_extract","from_binary","list_slice","from_base64","row","format_bytes","flatten","filter","datetrunc","cos","era","lcm","decode","hour","finalize","epoch_ms","right","enum_range_boundary","degrees","dayofweek","array_sort","datesub","formatReadableDecimalSize","date_diff","array_has","current_setting","current_schemas","map_from_entries","array_transform","current_query","md5_number","round","list_cosine_similarity","dayofmonth","asin","jaro_similarity","enum_code","cot","list_aggregate","ord","cbrt","array_unique","struct_insert","cardinality","to_days","acos","version","gamma","trim","floor","left","bit_count","current_schema","bin","now","bar","epoch_us","ln","array_aggregate","enum_first","bitstring","lcase"]),ivA=new Set(["any_value","arg_max","max_by","arg_min","argMin","min_by","avg","mean","bit_and","bit_or","bit_xor","bitstring_agg","bool_and","bool_or","count","favg","first","arbitrary","fsum","kahan_sum","geomean","geometric_mean","histogram","last","list","array_agg","max","min","product","string_agg","group_concat","listagg","sum","approx_count_distinct","approx_quantile","reservoir_quantile","corr","covar_pop","covar_samp","entropy","kurtosis","mad","median","mode","quantile_cont","quantile_disc","quantile","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","skewness","stddev_pop","stddev_samp","stddev","var_pop","var_samp","variance"]);function nvA(A,e){const t=new Map;e.forEach(n=>{t.set(n.name??n.fid,n)});const i=n=>{switch(n.type){case"integer":case"numeric":return["quantitative",!1];case"null":case"string":case"boolean":return["nominal",!1];case"unary":const[o,g]=i(n.operand);switch(n.op){case"+":case"-":return["quantitative",g];default:return["nominal",g]}case"ref":{const a=t.get(n.name);return a?[a.semanticType,!1]:["nominal",!1]}case"case":return n.else?i(n.else):i(n.whens[0].value);case"array":case"list":return n.expressions.length?i(n.expressions[0]):["nominal",!1];case"binary":return i(n.left);case"call":{if(n.function.name==="count")return["quantitative",!0];const[a]=i(n.args[0]);return[a,ivA.has(n.function.name.toLowerCase())]}case"cast":{const[a,s]=i(n.operand);if("name"in n.to)switch(n.to.name.toLowerCase()){case"date":case"timestamp":case"timestamp with time zone":case"time":case"time with time zone":case"interval":return["temporal",s];case"smallint":case"integer":case"bigint":case"decimal":case"numeric":case"real":case"double precision":case"smallserial":case"serial":case"bigserial":return["quantitative",s]}return["nominal",s]}default:return["nominal",!1]}};return i(A)}function _3e(A){const e=new Set,t=i=>{i.type==="ref"?e.add(i.name):Object.values(i).forEach(n=>{n!==null&&typeof n=="object"&&"type"in n&&t(n)})};return t(HV(A)),Array.from(e)}function ovA(A,e){const t=new Map;e.forEach(o=>{t.set((o.name??o.fid).toLowerCase(),o)});const i=HV(A),n=hF.astMapper(()=>({ref:o=>{var g;return hF.assignChanged(o,{name:((g=t.get(o.name.toLowerCase()))==null?void 0:g.fid)||o.name})}}));return hF.toSql.expr(n.expr(i))}function cc(A){for(var e=arguments.length,t=Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];throw Error("[Immer] minified error nr: "+A+(t.length?" "+t.map(function(n){return"'"+n+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function hk(A){return!!A&&!!A[uI]}function ky(A){var e;return!!A&&(function(t){if(!t||typeof t!="object")return!1;var i=Object.getPrototypeOf(t);if(i===null)return!0;var n=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return n===Object||typeof n=="function"&&Function.toString.call(n)===tKe}(A)||Array.isArray(A)||!!A[QvA]||!!(!((e=A.constructor)===null||e===void 0)&&e[QvA])||PiA(A)||$iA(A))}function pF(A,e,t){t===void 0&&(t=!1),mk(A)===0?(t?Object.keys:CnA)(A).forEach(function(i){t&&typeof i=="symbol"||e(i,A[i],A)}):A.forEach(function(i,n){return e(n,i,A)})}function mk(A){var e=A[uI];return e?e.i>3?e.i-4:e.i:Array.isArray(A)?1:PiA(A)?2:$iA(A)?3:0}function jiA(A,e){return mk(A)===2?A.has(e):Object.prototype.hasOwnProperty.call(A,e)}function O3e(A,e){return mk(A)===2?A.get(e):A[e]}function gvA(A,e,t){var i=mk(A);i===2?A.set(e,t):i===3?A.add(t):A[e]=t}function q3e(A,e){return A===e?A!==0||1/A==1/e:A!=A&&e!=e}function PiA(A){return AKe&&A instanceof Map}function $iA(A){return eKe&&A instanceof Set}function Jy(A){return A.o||A.t}function AnA(A){if(Array.isArray(A))return Array.prototype.slice.call(A);var e=iKe(A);delete e[uI];for(var t=CnA(e),i=0;i<t.length;i++){var n=t[i],o=e[n];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[n]={configurable:!0,writable:!0,enumerable:o.enumerable,value:A[n]})}return Object.create(Object.getPrototypeOf(A),e)}function enA(A,e){return e===void 0&&(e=!1),tnA(A)||hk(A)||!ky(A)||(mk(A)>1&&(A.set=A.add=A.clear=A.delete=j3e),Object.freeze(A),e&&pF(A,function(t,i){return enA(i,!0)},!0)),A}function j3e(){cc(2)}function tnA(A){return A==null||typeof A!="object"||Object.isFrozen(A)}function nQ(A){var e=nKe[A];return e||cc(18,A),e}function avA(){return fF}function inA(A,e){e&&(nQ("Patches"),A.u=[],A.s=[],A.v=e)}function ZV(A){nnA(A),A.p.forEach(P3e),A.p=null}function nnA(A){A===fF&&(fF=A.l)}function svA(A){return fF={p:[],l:fF,h:A,m:!0,_:0}}function P3e(A){var e=A[uI];e.i===0||e.i===1?e.j():e.g=!0}function onA(A,e){e._=e.p.length;var t=e.p[0],i=A!==void 0&&A!==t;return e.h.O||nQ("ES5").S(e,A,i),i?(t[uI].P&&(ZV(e),cc(4)),ky(A)&&(A=WV(e,A),e.l||KV(e,A)),e.u&&nQ("Patches").M(t[uI].t,A,e.u,e.s)):A=WV(e,t,[]),ZV(e),e.u&&e.v(e.u,e.s),A!==BvA?A:void 0}function WV(A,e,t){if(tnA(e))return e;var i=e[uI];if(!i)return pF(e,function(a,s){return rvA(A,i,e,a,s,t)},!0),e;if(i.A!==A)return e;if(!i.P)return KV(A,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var n=i.i===4||i.i===5?i.o=AnA(i.k):i.o,o=n,g=!1;i.i===3&&(o=new Set(n),n.clear(),g=!0),pF(o,function(a,s){return rvA(A,i,n,a,s,t,g)}),KV(A,n,!1),t&&A.u&&nQ("Patches").N(i,t,A.u,A.s)}return i.o}function rvA(A,e,t,i,n,o,g){if(hk(n)){var a=WV(A,n,o&&e&&e.i!==3&&!jiA(e.R,i)?o.concat(i):void 0);if(gvA(t,i,a),!hk(a))return;A.m=!1}else g&&t.add(n);if(ky(n)&&!tnA(n)){if(!A.h.D&&A._<1)return;WV(A,n),e&&e.A.l||KV(A,n)}}function KV(A,e,t){t===void 0&&(t=!1),!A.l&&A.h.D&&A.m&&enA(e,t)}function gnA(A,e){var t=A[uI];return(t?Jy(t):A)[e]}function IvA(A,e){if(e in A)for(var t=Object.getPrototypeOf(A);t;){var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}}function anA(A){A.P||(A.P=!0,A.l&&anA(A.l))}function snA(A){A.o||(A.o=AnA(A.t))}function rnA(A,e,t){var i=PiA(e)?nQ("MapSet").F(e,t):$iA(e)?nQ("MapSet").T(e,t):A.O?function(n,o){var g=Array.isArray(n),a={i:g?1:0,A:o?o.A:avA(),P:!1,I:!1,R:{},l:o,t:n,k:null,o:null,j:null,C:!1},s=a,I=lnA;g&&(s=[a],I=yF);var r=Proxy.revocable(s,I),C=r.revoke,l=r.proxy;return a.k=l,a.j=C,l}(e,t):nQ("ES5").J(e,t);return(t?t.A:avA()).p.push(i),i}function $3e(A){return hk(A)||cc(22,A),function e(t){if(!ky(t))return t;var i,n=t[uI],o=mk(t);if(n){if(!n.P&&(n.i<4||!nQ("ES5").K(n)))return n.t;n.I=!0,i=CvA(t,o),n.I=!1}else i=CvA(t,o);return pF(i,function(g,a){n&&O3e(n.t,g)===a||gvA(i,g,e(a))}),o===3?new Set(i):i}(A)}function CvA(A,e){switch(e){case 2:return new Map(A);case 3:return Array.from(A)}return AnA(A)}var lvA,fF,InA=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",AKe=typeof Map<"u",eKe=typeof Set<"u",cvA=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",BvA=InA?Symbol.for("immer-nothing"):((lvA={})["immer-nothing"]=!0,lvA),QvA=InA?Symbol.for("immer-draftable"):"__$immer_draftable",uI=InA?Symbol.for("immer-state"):"__$immer_state",tKe=""+Object.prototype.constructor,CnA=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:Object.getOwnPropertyNames,iKe=Object.getOwnPropertyDescriptors||function(A){var e={};return CnA(A).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(A,t)}),e},nKe={},lnA={get:function(A,e){if(e===uI)return A;var t=Jy(A);if(!jiA(t,e))return function(n,o,g){var a,s=IvA(o,g);return s?"value"in s?s.value:(a=s.get)===null||a===void 0?void 0:a.call(n.k):void 0}(A,t,e);var i=t[e];return A.I||!ky(i)?i:i===gnA(A.t,e)?(snA(A),A.o[e]=rnA(A.A.h,i,A)):i},has:function(A,e){return e in Jy(A)},ownKeys:function(A){return Reflect.ownKeys(Jy(A))},set:function(A,e,t){var i=IvA(Jy(A),e);if(i!=null&&i.set)return i.set.call(A.k,t),!0;if(!A.P){var n=gnA(Jy(A),e),o=n==null?void 0:n[uI];if(o&&o.t===t)return A.o[e]=t,A.R[e]=!1,!0;if(q3e(t,n)&&(t!==void 0||jiA(A.t,e)))return!0;snA(A),anA(A)}return A.o[e]===t&&(t!==void 0||e in A.o)||Number.isNaN(t)&&Number.isNaN(A.o[e])||(A.o[e]=t,A.R[e]=!0),!0},deleteProperty:function(A,e){return gnA(A.t,e)!==void 0||e in A.t?(A.R[e]=!1,snA(A),anA(A)):delete A.R[e],A.o&&delete A.o[e],!0},getOwnPropertyDescriptor:function(A,e){var t=Jy(A),i=Reflect.getOwnPropertyDescriptor(t,e);return i&&{writable:!0,configurable:A.i!==1||e!=="length",enumerable:i.enumerable,value:t[e]}},defineProperty:function(){cc(11)},getPrototypeOf:function(A){return Object.getPrototypeOf(A.t)},setPrototypeOf:function(){cc(12)}},yF={};pF(lnA,function(A,e){yF[A]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),yF.deleteProperty=function(A,e){return yF.set.call(this,A,e,void 0)},yF.set=function(A,e,t){return lnA.set.call(this,A[0],e,t,A[0])};var oKe=function(){function A(t){var i=this;this.O=cvA,this.D=!0,this.produce=function(n,o,g){if(typeof n=="function"&&typeof o!="function"){var a=o;o=n;var s=i;return function(E){var u=this;E===void 0&&(E=a);for(var d=arguments.length,f=Array(d>1?d-1:0),w=1;w<d;w++)f[w-1]=arguments[w];return s.produce(E,function(y){var G;return(G=o).call.apply(G,[u,y].concat(f))})}}var I;if(typeof o!="function"&&cc(6),g!==void 0&&typeof g!="function"&&cc(7),ky(n)){var r=svA(i),C=rnA(i,n,void 0),l=!0;try{I=o(C),l=!1}finally{l?ZV(r):nnA(r)}return typeof Promise<"u"&&I instanceof Promise?I.then(function(E){return inA(r,g),onA(E,r)},function(E){throw ZV(r),E}):(inA(r,g),onA(I,r))}if(!n||typeof n!="object"){if((I=o(n))===void 0&&(I=n),I===BvA&&(I=void 0),i.D&&enA(I,!0),g){var c=[],B=[];nQ("Patches").M(n,I,c,B),g(c,B)}return I}cc(21,n)},this.produceWithPatches=function(n,o){if(typeof n=="function")return function(I){for(var r=arguments.length,C=Array(r>1?r-1:0),l=1;l<r;l++)C[l-1]=arguments[l];return i.produceWithPatches(I,function(c){return n.apply(void 0,[c].concat(C))})};var g,a,s=i.produce(n,o,function(I,r){g=I,a=r});return typeof Promise<"u"&&s instanceof Promise?s.then(function(I){return[I,g,a]}):[s,g,a]},typeof(t==null?void 0:t.useProxies)=="boolean"&&this.setUseProxies(t.useProxies),typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze)}var e=A.prototype;return e.createDraft=function(t){ky(t)||cc(8),hk(t)&&(t=$3e(t));var i=svA(this),n=rnA(this,t,void 0);return n[uI].C=!0,nnA(i),n},e.finishDraft=function(t,i){var n=t&&t[uI],o=n.A;return inA(o,i),onA(void 0,o)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!cvA&&cc(20),this.O=t},e.applyPatches=function(t,i){var n;for(n=i.length-1;n>=0;n--){var o=i[n];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}n>-1&&(i=i.slice(n+1));var g=nQ("Patches").$;return hk(t)?g(t,i):this.produce(t,function(a){return g(a,i)})},A}(),dI=new oKe,cnA=dI.produce;dI.produceWithPatches.bind(dI),dI.setAutoFreeze.bind(dI),dI.setUseProxies.bind(dI),dI.applyPatches.bind(dI),dI.createDraft.bind(dI),dI.finishDraft.bind(dI);const gKe=cnA;var pe;(function(A){A[A.setConfig=0]="setConfig",A[A.removeField=1]="removeField",A[A.reorderField=2]="reorderField",A[A.moveField=3]="moveField",A[A.cloneField=4]="cloneField",A[A.createBinlogField=5]="createBinlogField",A[A.appendFilter=6]="appendFilter",A[A.modFilter=7]="modFilter",A[A.writeFilter=8]="writeFilter",A[A.setName=9]="setName",A[A.applySort=10]="applySort",A[A.transpose=11]="transpose",A[A.setLayout=12]="setLayout",A[A.setFieldAggregator=13]="setFieldAggregator",A[A.setGeoData=14]="setGeoData",A[A.setCoordSystem=15]="setCoordSystem",A[A.createDateDrillField=16]="createDateDrillField",A[A.createDateFeatureField=17]="createDateFeatureField",A[A.changeSemanticType=18]="changeSemanticType",A[A.setFilterAggregator=19]="setFilterAggregator",A[A.addFoldField=20]="addFoldField",A[A.upsertPaintField=21]="upsertPaintField",A[A.addSQLComputedField=22]="addSQLComputedField",A[A.removeAllField=23]="removeAllField",A[A.editAllField=24]="editAllField",A[A.replaceWithNLPQuery=25]="replaceWithNLPQuery"})(pe||(pe={}));const UV={[pe.setConfig]:(A,e,t)=>jt(A,"config",i=>({...i,[e]:t})),[pe.removeField]:(A,e,t)=>jt(A,`encodings.${e}`,i=>zMA(i,t)),[pe.reorderField]:(A,e,t,i)=>jt(A,`encodings.${e}`,n=>n.map((o,g,a)=>g===t?a[i]:g===i?a[t]:o)),[pe.moveField]:(A,e,t,i,n,o)=>{const g=A.encodings[e][t],a=i==="dimensions"?jt(g,"analyticType",()=>"dimension"):i==="measures"?jt(g,"analyticType",()=>"measure"):g;return jt(A,"encodings",s=>({...s,[e]:zMA(A.encodings[e],t),[i]:vV(A.encodings[i],a,n).slice(0,o??1/0)}))},[pe.cloneField]:(A,e,t,i,n,o,g)=>{const a={...A.encodings[e][t]};return jt(A,"encodings",s=>({...s,[i]:vV(A.encodings[i],a,n).slice(0,g??1/0)}))},[pe.createBinlogField]:(A,e,t,i,n,o)=>{const g=A.encodings[e][t],a=i.startsWith("bin"),s=a?"dimensions":e,I=a?`${i}${o}`:`log${o}`,r={fid:n,name:`${I}(${g.name})`,semanticType:a?"ordinal":"quantitative",analyticType:a?"dimension":g.analyticType,computed:!0,expression:{op:i,as:n,params:[{type:"field",value:g.fid}],num:o}};return a||(r.aggName="sum"),jt(A,`encodings.${s}`,C=>C.concat(r))},[pe.appendFilter]:(A,e,t,i,n)=>{const o=A.encodings[t][i];return jt(A,"encodings.filters",g=>vV(g,{...o,rule:null},e))},[pe.modFilter]:(A,e,t,i)=>jt(A,"encodings.filters",n=>{const o=A.encodings[t][i];return Lm(n,e,g=>({...o,rule:null}))}),[pe.writeFilter]:(A,e,t)=>jt(A,"encodings.filters",i=>Lm(i,e,n=>({...n,rule:t}))),[pe.setName]:(A,e)=>({...A,name:e}),[pe.applySort]:(A,e)=>{const{rows:t,columns:i}=A.encodings,n=t.length>0?t[t.length-1]:null,o=i.length>0?i[i.length-1]:null;return o!==null&&o.analyticType==="dimension"&&n!==null&&n.analyticType==="measure"?jt(A,"encodings.columns",g=>Lm(g,g.length-1,a=>({...a,sort:e}))):o!==null&&o.analyticType==="measure"&&n!==null&&n.analyticType==="dimension"?jt(A,"encodings.rows",g=>Lm(g,g.length-1,a=>({...a,sort:e}))):A},[pe.transpose]:A=>jt(A,"encodings",e=>({...e,columns:e.rows,rows:e.columns})),[pe.setLayout]:(A,e)=>jt(A,"layout",t=>Object.assign({},t,Object.fromEntries(e))),[pe.setFieldAggregator]:(A,e,t,i)=>jt(A,`encodings.${e}`,n=>Lm(n,t,o=>({...o,aggName:i}))),[pe.setGeoData]:(A,e,t,i)=>jt(A,"layout",n=>({...n,geojson:e,geoKey:t,geoUrl:i})),[pe.setCoordSystem]:(A,e)=>jt(A,"config",t=>({...t,coordSystem:e,geoms:[ke.GEOM_TYPES[e][0]]})),[pe.createDateDrillField]:(A,e,t,i,n,o,g,a)=>{const s=A.encodings[e][t],I={fid:n,name:o,semanticType:"temporal",analyticType:s.analyticType,aggName:"sum",computed:!0,timeUnit:i,expression:{op:"dateTimeDrill",as:n,params:[{type:"field",value:s.fid},{type:"value",value:i},...g?[{type:"format",value:g}]:[],...xi(a)?[{type:"offset",value:a}]:[]]}};return jt(A,`encodings.${e}`,r=>r.concat(I))},[pe.createDateFeatureField]:(A,e,t,i,n,o,g,a)=>{const s=A.encodings[e][t],I={fid:n,name:o,semanticType:"ordinal",analyticType:s.analyticType,aggName:"sum",computed:!0,expression:{op:"dateTimeFeature",as:n,params:[{type:"field",value:s.fid},{type:"value",value:i},...g?[{type:"format",value:g}]:[],...xi(a)?[{type:"offset",value:a}]:[]]}};return jt(A,`encodings.${e}`,r=>r.concat(I))},[pe.changeSemanticType]:(A,e,t,i)=>jt(A,`encodings.${e}`,n=>Lm(n,t,o=>({...o,semanticType:i}))),[pe.setFilterAggregator]:(A,e,t)=>jt(A,"encodings.filters",i=>Lm(i,e,n=>({...n,aggName:t||"sum",enableAgg:!!t,rule:null}))),[pe.addFoldField]:(A,e,t,i,n,o,g)=>{let a=A;const s=a.encodings[e][t];if(!a.config.folds){const I=[...a.encodings.measures,...a.encodings.details].filter(r=>r.analyticType==="measure"&&r.fid!==yi);a=UV[pe.setConfig](a,"folds",I.filter((r,C)=>C===0).map(r=>r.fid))}if(s.fid===yi){const I=Object.keys(a.encodings).filter(r=>r!=="filters").map(r=>[r,a.encodings[r].findIndex(C=>C.fid===fi)]).filter(([r,C])=>C>=0);if(I.length===1){const[r,C]=I[0];a=UV[pe.cloneField](a,r,C,"details",0,`${o}_auto`,1/0)}}return UV[pe.cloneField](a,e,t,i,n,o,g)},[pe.upsertPaintField]:(A,e,t)=>{if(!e)return jt(A,"encodings",o=>Object.fromEntries(Object.entries(o).map(([g,a])=>[g,a.filter(s=>s.fid!==In)])));const i="facets"in e?{op:"paint",as:In,params:[{type:"newmap",value:e}]}:{op:"paint",as:In,params:[{type:"map",value:e}]},n=e.usedColor.includes(255);return jt(A,"encodings",o=>{let g=!1,a=!1;const s=Object.entries(o).map(([l,c])=>{const B=c.findIndex(E=>E.fid===In);return B>-1?(g=!0,l==="filters"&&(a=!0),[l,Lm(c,B,E=>({...E,expression:i}))]):[l,c]}),I={fid:In,analyticType:"dimension",name:t,semanticType:"nominal",computed:!0,expression:i,rule:{type:"not in",value:[""]}};if(g)return!a&&n?jt(Object.fromEntries(s),"filters",l=>l.concat(I)):Object.fromEntries(s);const r={fid:In,analyticType:"dimension",name:t,semanticType:"nominal",computed:!0,expression:i},C=jt(jt(o,"dimensions",l=>vV(l,r,l.length)),"color",()=>[{...r}]);return n?jt(C,"filters",l=>l.concat(I)):C})},[pe.addSQLComputedField]:(A,e,t,i)=>{const[n,o]=nvA(HV(i),A.encodings.dimensions.concat(A.encodings.measures)),g=n==="quantitative"?"measure":"dimension";return jt(A,`encodings.${g}s`,a=>a.concat({analyticType:g,fid:e,name:t,semanticType:n,computed:!0,aggName:o?"expr":g==="dimension"?void 0:"sum",expression:{op:"expr",as:e,params:[{type:"sql",value:i}]}}))},[pe.removeAllField]:(A,e)=>jt(A,"encodings",t=>Object.fromEntries(Object.entries(t).map(([i,n])=>{const o=n.filter(g=>g.fid!==e);return n.length===o.length?[i,n]:[i,o]}))),[pe.editAllField]:(A,e,t)=>{if(Object.keys(t).includes("name")){const i=A.encodings.dimensions.concat(A.encodings.measures).find(n=>n.fid===e);return gKe(A,n=>{i&&Object.values(n.encodings).forEach(o=>o.forEach((g,a)=>{var s;if(g.fid===e)o[a]={...g,...t};else if(((s=g.expression)==null?void 0:s.op)==="expr"){const I=g.expression.params.find(r=>r.type==="sql");if(I){const r=ovA(I.value,[{...i,fid:t.name,name:i.name??i.fid}]);r!==I.value&&(I.value=r)}}}))})}return jt(A,"encodings",i=>Object.fromEntries(Object.entries(i).map(([n,o])=>o.find(g=>g.fid===e)?[n,o.map(g=>g.fid===e?{...g,...t}:g)]:[n,o])))},[pe.replaceWithNLPQuery]:(A,e,t)=>({...JSON.parse(t),visId:A.visId,name:A.name})},aKe=(A,e)=>{const t={};return Object.keys(e.encodings).forEach(i=>{e.encodings[i]!==A.encodings[i]&&(t[i]=e.encodings[i])}),t};function EvA(A,e){const t=[],i=new Array(e.length).fill(null).map(()=>[]);return A.forEach(n=>{const o=e.findIndex(g=>g(n));o>=0?i[o].push(n):t.push(n)}),t.concat(i.flat())}function uvA(A){const e={};return A.dimensions&&A.dimensions.length>0&&(e.dimensions=EvA(A.dimensions,[t=>t.fid===In,t=>t.fid===fi])),A.measures&&A.measures.length>0&&(e.measures=EvA(A.measures,[t=>t.fid===no,t=>t.fid===yi])),e}const sKe=(A,e)=>{const t=aKe(e,A),i=A.config.geoms[0];return Object.keys(t).length===0&&WMA(A.config.geoms,e.config.geoms)?A:WMA(A.config.geoms,e.config.geoms)?jt(A,"encodings",n=>({...n,..._MA(i,t),...uvA(t)})):jt(A,"encodings",n=>({...n,..._MA(i,n),...uvA(n)}))},rKe=[sKe];function bF(A,e){const[t,...i]=e,n=UV[t](A,...i);return rKe.reduce((o,g)=>g(o,A),n)}const IKe=bF,dvA=x3e(bF),CKe=F3e(bF),lKe=M3e(bF),cKe=v3e(bF),ri=Object.fromEntries(Object.keys(pe).map(A=>[A,(e,...t)=>dvA(e,[pe[A],...t])]));function VV(A,e,t){return{config:t!=null&&t.config?{...XiA,...t.config}:XiA,encodings:ziA,layout:t!=null&&t.layout?{...KMA,...t.layout}:KMA,visId:A,name:e}}function XV(A,e,t,i){if(A.length===0)return VV(t||VC(),e,i);const n=[c3e(),...B3e()],o=n.filter(a=>a.analyticType==="dimension"),g=n.filter(a=>a.analyticType==="measure");return jt(VV(t||VC(),e,i),"encodings",a=>({...a,dimensions:A.filter(s=>s.analyticType==="dimension").map(s=>({fid:s.fid,name:s.name||s.fid,basename:s.basename||s.name||s.fid,semanticType:s.semanticType,analyticType:s.analyticType,offset:s.offset})).concat(o),measures:A.filter(s=>s.analyticType==="measure").map(s=>({fid:s.fid,name:s.name||s.fid,basename:s.basename||s.name||s.fid,analyticType:s.analyticType,semanticType:s.semanticType,aggName:"sum",offset:s.offset})).concat(g)}))}function hvA(A){var e;const t=VV(A.visId||VC(),A.name||"Chart");return t.config={...t.config,...A.config},t.encodings={...t.encodings,...A.encodings},t.layout={...t.layout,...A.layout,size:{...t.layout.size,...(e=A.layout)==null?void 0:e.size}},t}function pk(A){return TMA(hvA(A))}function BnA(A,e,t){return TMA(XV(A,e,void 0,t))}function mvA(A,e=30){const t={base:A.cursor>e?cKe(A,A.cursor-e):A.base,timeline:A.timeline.slice(Math.max(0,A.cursor-e))};return JSON.stringify(t)}function BKe(A){return A.now}function QKe(A){return pk(A)}function pvA(A){const e=JSON.parse(A),t=pk(e.base);return e.timeline.reduce(dvA,t)}function fvA(A){var e,t,i,n,o,g,a,s,I,r,C,l,c,B,E,u,d;const f=VV(A.visId,A.name||"Chart");return f.config={...f.config,defaultAggregated:A.config.defaultAggregated,geoms:((e=A.config.geoms)==null?void 0:e.slice())??[],limit:A.config.limit,coordSystem:A.config.coordSystem,folds:A.config.folds},f.encodings={...f.encodings,dimensions:((t=A.encodings.dimensions)==null?void 0:t.slice())??[],measures:((i=A.encodings.measures)==null?void 0:i.slice())??[],rows:((n=A.encodings.rows)==null?void 0:n.slice())??[],columns:((o=A.encodings.columns)==null?void 0:o.slice())??[],color:((g=A.encodings.color)==null?void 0:g.slice())??[],opacity:((a=A.encodings.opacity)==null?void 0:a.slice())??[],size:((s=A.encodings.size)==null?void 0:s.slice())??[],shape:((I=A.encodings.shape)==null?void 0:I.slice())??[],theta:((r=A.encodings.theta)==null?void 0:r.slice())??[],radius:((C=A.encodings.radius)==null?void 0:C.slice())??[],longitude:((l=A.encodings.longitude)==null?void 0:l.slice())??[],latitude:((c=A.encodings.latitude)==null?void 0:c.slice())??[],geoId:((B=A.encodings.geoId)==null?void 0:B.slice())??[],details:((E=A.encodings.details)==null?void 0:E.slice())??[],filters:((u=A.encodings.filters)==null?void 0:u.slice())??[],text:((d=A.encodings.text)==null?void 0:d.slice())??[]},f.layout={...f.layout,background:A.config.background,format:A.config.format,interactiveScale:A.config.interactiveScale,resolve:A.config.resolve,showActions:A.config.showActions,stack:A.config.stack,zeroScale:A.config.zeroScale,size:{...f.layout.size,...A.config.size},colorPalette:A.config.colorPalette,geojson:A.config.geojson,geoKey:A.config.geoKey,geoUrl:A.config.geoUrl,primaryColor:A.config.primaryColor,scale:A.config.scale,scaleIncludeUnmatchedChoropleth:A.config.scaleIncludeUnmatchedChoropleth,showTableSummary:A.config.showTableSummary,useSvg:A.config.useSvg},f}function yvA(A){return"layout"in A?A:fvA(UMA(VMA(A)))}function EKe(A){return A}function uKe(A){if(A==null)return EKe;var e,t,i=A.scale[0],n=A.scale[1],o=A.translate[0],g=A.translate[1];return function(a,s){s||(e=t=0);var I=2,r=a.length,C=new Array(r);for(C[0]=(e+=a[0])*i+o,C[1]=(t+=a[1])*n+g;I<r;)C[I]=a[I],++I;return C}}function dKe(A,e){for(var t,i=A.length,n=i-e;n<--i;)t=A[n],A[n++]=A[i],A[i]=t}function zV(A,e){return typeof e=="string"&&(e=A.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(t){return bvA(A,t)})}:bvA(A,e)}function bvA(A,e){var t=e.id,i=e.bbox,n=e.properties==null?{}:e.properties,o=wvA(A,e);return t==null&&i==null?{type:"Feature",properties:n,geometry:o}:i==null?{type:"Feature",id:t,properties:n,geometry:o}:{type:"Feature",id:t,bbox:i,properties:n,geometry:o}}function wvA(A,e){var t=uKe(A.transform),i=A.arcs;function n(r,C){C.length&&C.pop();for(var l=i[r<0?~r:r],c=0,B=l.length;c<B;++c)C.push(t(l[c],c));r<0&&dKe(C,B)}function o(r){return t(r)}function g(r){for(var C=[],l=0,c=r.length;l<c;++l)n(r[l],C);return C.length<2&&C.push(C[0]),C}function a(r){for(var C=g(r);C.length<4;)C.push(C[0]);return C}function s(r){return r.map(a)}function I(r){var C=r.type,l;switch(C){case"GeometryCollection":return{type:C,geometries:r.geometries.map(I)};case"Point":l=o(r.coordinates);break;case"MultiPoint":l=r.coordinates.map(o);break;case"LineString":l=g(r.arcs);break;case"MultiLineString":l=r.arcs.map(g);break;case"Polygon":l=s(r.arcs);break;case"MultiPolygon":l=r.arcs.map(s);break;default:return null}return{type:C,coordinates:l}}return I(e)}function hKe(A,e){var t={},i={},n={},o=[],g=-1;e.forEach(function(I,r){var C=A.arcs[I<0?~I:I],l;C.length<3&&!C[1][0]&&!C[1][1]&&(l=e[++g],e[g]=I,e[r]=l)}),e.forEach(function(I){var r=a(I),C=r[0],l=r[1],c,B;if(c=n[C])if(delete n[c.end],c.push(I),c.end=l,B=i[l]){delete i[B.start];var E=B===c?c:c.concat(B);i[E.start=c.start]=n[E.end=B.end]=E}else i[c.start]=n[c.end]=c;else if(c=i[l])if(delete i[c.start],c.unshift(I),c.start=C,B=n[C]){delete n[B.end];var u=B===c?c:B.concat(c);i[u.start=B.start]=n[u.end=c.end]=u}else i[c.start]=n[c.end]=c;else c=[I],i[c.start=C]=n[c.end=l]=c});function a(I){var r=A.arcs[I<0?~I:I],C=r[0],l;return A.transform?(l=[0,0],r.forEach(function(c){l[0]+=c[0],l[1]+=c[1]})):l=r[r.length-1],I<0?[l,C]:[C,l]}function s(I,r){for(var C in I){var l=I[C];delete r[l.start],delete l.start,delete l.end,l.forEach(function(c){t[c<0?~c:c]=1}),o.push(l)}}return s(n,i),s(i,n),e.forEach(function(I){t[I<0?~I:I]||o.push([I])}),o}function mKe(A){return wvA(A,pKe.apply(this,arguments))}function pKe(A,e,t){var i,n,o;if(arguments.length>1)i=fKe(A,e,t);else for(n=0,i=new Array(o=A.arcs.length);n<o;++n)i[n]=n;return{type:"MultiLineString",arcs:hKe(A,i)}}function fKe(A,e,t){var i=[],n=[],o;function g(C){var l=C<0?~C:C;(n[l]||(n[l]=[])).push({i:C,g:o})}function a(C){C.forEach(g)}function s(C){C.forEach(a)}function I(C){C.forEach(s)}function r(C){switch(o=C,C.type){case"GeometryCollection":C.geometries.forEach(r);break;case"LineString":a(C.arcs);break;case"MultiLineString":case"Polygon":s(C.arcs);break;case"MultiPolygon":I(C.arcs);break}}return r(e),n.forEach(t==null?function(C){i.push(C[0].i)}:function(C){t(C[0].g,C[C.length-1].g)&&i.push(C[0].i)}),i}function DvA(A,e){return A.aggName==="expr"?A:{...A,aggName:e}}function GvA(A,e,t,i,n,o){const g=i.find(a=>a.fid===yi);if(n.find(a=>a.fid===fi)&&g){if(!(o!=null&&o.length))return[];const a=(o??[]).map(I=>t.find(r=>r.fid===I)).filter(Boolean).filter(I=>e||I.aggName!=="expr").map(I=>{if(e){const r=DvA(I,g.aggName);return{name:wy(r.name,r.aggName),fid:Fo(r.fid,r.aggName)}}return{name:I.name,fid:I.fid}}),s=new Set(a.map(I=>I.fid));return A.flatMap(I=>{const r=Object.fromEntries(Object.entries(I).filter(C=>!s.has(C[0])));return a.map(C=>({...r,[fi]:C.name,[e?Fo(yi,g.aggName):yi]:I[C.fid]}))})}return A}const fk=A=>{switch(A){case"choropleth":return["geoId","color","opacity","text","details"];case"poi":return["longitude","latitude","color","opacity","size","details"];case"arc":return["radius","theta","color","opacity","size","details","text"];case"bar":case"tick":case"line":case"area":case"boxplot":return["columns","rows","color","opacity","size","details","text"];case"text":return["columns","rows","color","opacity","size","text"];case"table":return["columns","rows"];default:return["columns","rows","color","opacity","size","details","shape"]}},kvA=(A,e)=>{for(const t of A.params)t.type==="field"?e(t.value):t.type==="expression"?kvA(t.value,e):t.type==="sql"?_3e(t.value).forEach(e):t.type==="map"?(e(t.value.x),e(t.value.y)):t.type==="newmap"&&t.value.facets.flatMap(i=>i.dimensions).forEach(i=>e(i.fid))},JvA=(A,e)=>{const t=new Map;return A.forEach(i=>t.set(e(i),i)),[...t.values()]},NvA=(A,e)=>{const t=new Set(e);let i=A.filter(g=>t.has(g.key)),n=i.slice(),o=A.filter(g=>!t.has(g.key));for(;n.length&&o.length;){const g=new Set;for(const s of n)kvA(s.expression,I=>g.add(I));const a=o.filter(s=>g.has(s.key));i=A.filter(s=>g.has(s.key)).concat(i.filter(s=>!g.has(s.key))),n=a,o=o.filter(s=>!g.has(s.key))}return i},YvA=A=>{const e=Dy(A),t=A.rule;return t.type==="one of"?{fid:e,rule:{type:"one of",value:[...t.value]}}:t.type==="temporal range"?{fid:e,rule:{type:"temporal range",value:t.value,offset:t.offset,format:t.format}}:t.type==="not in"?{fid:e,rule:{type:"not in",value:[...t.value]}}:t.type==="range"?{fid:e,rule:{type:"range",value:[t.value[0]?Number(t.value[0]):t.value[0],t.value[1]?Number(t.value[1]):t.value[1]]}}:t.type==="regexp"?{fid:e,rule:{type:"regexp",value:t.value,caseSensitive:t.caseSensitive}}:(console.error("unknown rule",t),{fid:e,rule:t})},Hm=(A,e,t,i,n,o,g=[],a,s)=>{const I=t.find(h=>h.fid===fi)&&i.find(h=>h.fid===yi),r=t.filter(h=>h.fid!==fi),C=i.filter(h=>h.fid!==yi);if(I){const h=i.find(v=>v.fid===yi).aggName,N=g.map(v=>e.find(K=>K.fid===v)).filter(Boolean).map(v=>DvA(v,h));r.push(...N.filter(v=>(v==null?void 0:v.analyticType)==="dimension")),C.push(...N.filter(v=>(v==null?void 0:v.analyticType)==="measure"))}const l=new Set([...r,...C,...A].map(h=>h.fid));let c=null,B=null,E=null,u=null,d=null,f=null;const w=h=>{const N=YvA(h);return l.add(N.fid),N},y=A.filter(h=>!h.computed&&h.rule&&!h.enableAgg).map(w);y.length&&(c={type:"filter",filters:y});const G=NvA(e.filter(h=>h.computed&&h.expression&&!(h.expression.op==="expr"&&h.aggName==="expr")).map(h=>({key:h.fid,expression:wF(h.expression,e,{timezoneDisplayOffset:s})})),[...l]);G.length&&(B={type:"transform",transform:G});const R=A.filter(h=>h.computed&&h.rule&&!h.enableAgg).map(w);R.length&&(E={type:"filter",filters:R});const x=A.filter(h=>h.enableAgg&&h.aggName&&h.rule),F=NvA(e.filter(h=>h.computed&&h.expression&&h.expression.op==="expr"&&h.aggName==="expr").map(h=>({key:h.fid,expression:wF(h.expression,e,{timezoneDisplayOffset:s})})),[...l]),Q=C.filter(h=>h.aggName).map(h=>[h.fid,h.aggName]).concat(x.map(h=>[h.fid,h.aggName])).concat(F.map(h=>[h.expression.params[0].value,"expr"])),k=n&&(Q.length||C.length===0&&r.length>0);return k?u={type:"view",query:[{op:"aggregate",groupBy:JvA(r.map(h=>h.fid),h=>h),measures:JvA(C.concat(x).map(h=>({field:h.fid,agg:h.aggName,asFieldKey:Fo(h.fid,h.aggName)})).concat(F.map(h=>({field:h.expression.params[0].value,agg:"expr",asFieldKey:h.key}))),h=>h.asFieldKey)}]}:u={type:"view",query:[{op:"raw",fields:[...new Set([...r,...C])].filter(h=>h.aggName!=="expr").map(h=>h.fid)}]},k&&r.length>0&&x.length>0&&(f={type:"filter",filters:x.map(w)}),o!=="none"&&a&&a!==-1&&(d={type:"sort",by:C.map(h=>k?Fo(h.fid,h.aggName):h.fid),sort:o}),[c,B,E,u,f,d].filter(Boolean)},yKe=(A,e)=>e.length===0?A:A.workflow[0].type==="transform"?{...A,workflow:A.workflow.map((t,i)=>{if(t.type==="transform"&&i===0){const n=new Set(t.transform.map(o=>o.key));return{type:"transform",transform:t.transform.concat(e.filter(o=>!n.has(o.key)))}}return t})}:{...A,workflow:[{type:"transform",transform:e},...A.workflow]},RvA=(A,e)=>{if(e.length===0)return A;const t=A.workflow.findIndex(i=>i.type==="filter");return t>-1?{...A,workflow:A.workflow.map((i,n)=>i.type==="filter"&&n===t?{type:"filter",filters:e.concat(i.filters)}:i)}:{...A,workflow:[{type:"filter",filters:e},...A.workflow]}},QnA=bKe;function bKe(A){var e,t,i,n,o,g,a,s,I,r,C;const l=yvA(A),c=fk(((t=(e=l.config)==null?void 0:e.geoms)==null?void 0:t[0])??"auto").flatMap(d=>{var f;return((f=l.encodings)==null?void 0:f[d])??[]}),B=((i=l.encodings)==null?void 0:i.rows)??[],E=((n=l.encodings)==null?void 0:n.columns)??[],u=((o=l.config)==null?void 0:o.limit)??-1;return{workflow:Hm(((g=l.encodings)==null?void 0:g.filters)??[],[...((a=l.encodings)==null?void 0:a.dimensions)??[],...((s=l.encodings)==null?void 0:s.measures)??[]],c.filter(d=>d.analyticType==="dimension"),c.filter(d=>d.analyticType==="measure"),((I=l.config)==null?void 0:I.defaultAggregated)??!0,uk({rows:B,columns:E}),((r=l.config)==null?void 0:r.folds)??[],u,(C=l.config)==null?void 0:C.timezoneDisplayOffset),limit:u>0?u:void 0}}const wF=(A,e,t)=>(A==null?void 0:A.op)==="expr"?{...A,params:[{type:"sql",value:ovA(A.params.find(i=>i.type==="sql").value,e).trim()}]}:A.op==="dateTimeDrill"||A.op==="dateTimeFeature"?{...A,params:[...A.params,{type:"displayOffset",value:t.timezoneDisplayOffset??new Date().getTimezoneOffset()}]}:A.op==="paint"?{...A,params:A.params.map(i=>{if(i.type==="map"){const n={...i.value.dict,255:{name:""}};return{type:"map",value:{x:i.value.x,y:i.value.y,domainX:i.value.domainX,domainY:i.value.domainY,map:i.value.map,dict:Object.fromEntries(i.value.usedColor.map(o=>[o,{name:n[o].name}])),mapwidth:i.value.mapwidth}}}else if(i.type==="newmap"){const n={...i.value.dict,255:{name:""}},o=Array.from(new Set(i.value.usedColor.concat(1)));return{type:"newmap",value:{facets:i.value.facets.map(({dimensions:g,map:a})=>({dimensions:g,map:a})),dict:Object.fromEntries(o.map(g=>[g,{name:n[g].name}]))}}}else return i})}:A,Ti={fid:"",name:"",semanticType:"quantitative",analyticType:"measure",aggName:"sum"};function wKe(A){return A==="text"?new Set(["text","color","size","x","y","xOffset","yOffset","opacity"]):A==="arc"?new Set(["opacity","color","size","theta","radius"]):new Set(["column","opacity","color","row","size","x","y","xOffset","yOffset","shape"])}function DKe(A){switch(A){case"iso_year":case"year":return"utcyear";case"quarter":return"utcyearquarter";case"month":return"utcyearmonth";case"iso_week":case"week":return"utcyearweek";case"day":return"utcyearmonthdate";case"hour":return"utcyearmonthdatehours";case"minute":return"utcyearmonthdatehoursminutes";case"second":return"utcyearmonthdatehoursminutesseconds"}return A}function GKe(A){switch(A){case"iso_year":return"%G";case"iso_week":return"%G W%V"}}function yk(A){return A.replace(/([\"\'\.\[\]\/\\])/g,"\\$1").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")}function kKe(A){const e=wKe(A.geomType),t={};return Object.keys(A).filter(i=>e.has(i)).forEach(i=>{var n,o,g,a;const s=A[i];if(s!==Ti){if(t[i]={field:yk(s.fid),title:s.name,type:s.semanticType},s.computed&&((n=s.expression)==null?void 0:n.op)==="bin"){const I=t[i].field;t[i].field=`${I}[0]`,delete t[i].type,t[i].bin={binned:!0},t[i].formatType="formatBin",t[i].format=(o=A.vegaConfig)==null?void 0:o.numberFormat,(i==="x"||i==="y")&&(t[`${i}2`]={field:`${I}[1]`,formatType:"formatBin",format:(g=A.vegaConfig)==null?void 0:g.numberFormat})}if(s.analyticType!=="measure"&&(t[i].aggregate=null),s.analyticType==="measure"&&(t[i].type="quantitative"),s.semanticType==="temporal"&&(t[i].scale={type:"utc"}),s.semanticType==="temporal"&&s.timeUnit&&(s.timeUnit.startsWith("iso")&&(t[i].format=GKe(s.timeUnit)),t[i].timeUnit=DKe(s.timeUnit)),i==="color"&&((a=s.expression)==null?void 0:a.op)==="paint"){const I=s.expression.params.find(C=>C.type==="map"||C.type==="newmap").value,r=I.usedColor.map(C=>I.dict[C]).filter(Boolean);t[i].scale={domain:r.map(C=>C.name),range:r.map(C=>C.color)}}}}),t.x&&(t.x.axis={labelOverlap:!0}),t&&t.y&&(t.y.axis={labelOverlap:!0}),t.x&&t.y&&(A.x.sort&&A.x.sort||A.y&&A.y.sort)&&(A.x.sort!=="none"&&(A.y.sort==="none"||!A.y.sort)?t.x.sort={encoding:"y",order:A.x.sort}:A.y.sort&&A.y.sort!=="none"&&(A.x.sort==="none"||!A.x.sort)&&(t.y.sort={encoding:"x",order:A.y.sort})),t}function TV(A,e){if(A.length<2)return A[0]==="temporal"||A[0]==="quantitative"||e===!1?"tick":"bar";const t=new Map;["nominal","ordinal","quantitative","temporal"].forEach(i=>{t.set(i,0)});for(let i of A)t.set(i,t.get(i)+1);return t.get("nominal")===1?e===!1?"tick":"bar":t.get("ordinal")===1?"bar":t.get("temporal")===1&&t.get("quantitative")===1?"line":(t.get("quantitative"),"point")}function JKe(A,e){Object.values(A).forEach(t=>{if(t.aggregate===null)return;const i=e.find(n=>yk(n.fid)===t.field&&(n.analyticType==="measure"||n.fid===no));i&&i.fid===no?(t.title="Count",t.field=yk(Fo(i.fid,i.aggName))):i&&(t.title=wy(i.name,i.aggName),t.field=yk(Fo(i.fid,i.aggName)))})}function NKe(A,e){if(e==="stack"||e==="zero")return;let t=e==="none"?null:e;const i=["x","y","theta","radius"];for(let n of i)A[n]&&A[n].type==="quantitative"&&(A[n].stack=t)}function YKe(A,e=[],t=!1){const i=Object.keys(A).filter(n=>n!=="tooltip"&&n!=="x2"&&n!=="y2").map(n=>cnA({field:A[n].field.replace("[0]",""),type:A[n].type,title:A[n].title},o=>{A[n].timeUnit&&!A[n].format&&(o.timeUnit=A[n].timeUnit),A[n].scale&&(o.scale=A[n].scale),A[n].formatType&&(o.formatType=A[n].formatType),A[n].format&&(o.format=A[n].format)})).concat(e.map(n=>({field:t&&n.analyticType==="measure"?Fo(n.fid,n.aggName):n.fid,title:t&&n.analyticType==="measure"?wy(n.name,n.aggName):n.name,type:n.semanticType})));A.tooltip=i}function RKe(A,e){return A.map(t=>{const i={};for(let n in e){const{from:o,to:g}=e[n];i[g]=FKe(t,o)}return i})}function xKe(A){return A.map((e,t)=>{const i=`gwc_${t}`;return{...e,key:i,fid:i}})}function EnA(A,e){const t=xKe(e),i=t.map((n,o)=>({from:e[o].path??[e[o].fid],to:n.fid}));return{safeData:RKe(A,i),safeMetas:t}}function FKe(A,e){let t=A;for(let i of e)t=t[i];return t}const MKe=[/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/,/^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/,/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/\d{4}$/,/^\d{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/,/^\d{4}\.(0[1-9]|1[0-2])\.(0[1-9]|[12][0-9]|3[01])$/,/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])\s\d{2}:\d{2}:\d{2}$/,/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T\d{2}:\d{2}:\d{2}$/,/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T\d{2}:\d{2}:\d{2}.\d{3}Z$/,/^([1-9]|1[0-2])\/([1-9]|[12][0-9]|3[01])\/\d{4}$/,/^([1-9]|[12][0-9]|3[01])\/([1-9]|1[0-2])\/\d{4}$/],vKe=["%Y-%m-%d","%m/%d/%Y","%d/%m/%Y","%Y/%m/%d","%Y.%m.%d","%Y-%m-%d %H:%M:%S","%Y-%m-%dT%H:%M:%S","%Y-%m-%dT%H:%M:%S.%gZ","%f/%e/%Y","%e/%f/%Y"];function DF(A){if(typeof A=="number")return"timestamp";const e=MKe.findIndex(t=>t.test(A));return e>=0?vKe[e]:""}function LKe(A,e){return Object.keys(A).forEach(t=>{var i;if(A[t].bin&&(i=e[0])!=null&&i[A[t].field.replace("[0]","")]){const n=e[0][A[t].field.replace("[0]","")];A[t].bin.step=n[1]-n[0]}}),A}function xvA(A){return A===0?"":`${A>0?"+":"-"}${Math.abs(A)}`}function FvA(A){const{x:e,y:t,color:i,opacity:n,size:o,shape:g,theta:a,radius:s,text:I,row:r,column:C,xOffset:l,yOffset:c,details:B,defaultAggregated:E,stack:u,geomType:d,hasLegend:f=!0,hideLegend:w=!1,displayOffset:y,dataSource:G,vegaConfig:R}=A,x=[e,t,i,n,o,g,r,C,l,c,a,s,I];let F=d,Q={};if(f?w&&(Q.legend={gradientOpacity:0,labelColor:"transparent",symbolOpacity:0,symbolStrokeColor:"transparent",titleColor:"transparent",titleOpacity:0}):Q.legend={disable:!0},d==="auto"){const N=[];e!==Ti&&N.push(e.semanticType),t!==Ti&&N.push(t.semanticType),F=TV(N,E)}const k=x.filter(N=>N.semanticType==="temporal").map(N=>{var v;let K=(y??new Date().getTimezoneOffset())*-6e4;const U=yk(N.fid),V=(v=G[0])==null?void 0:v[N.fid];if(V){const X=DF(V);if(X!=="timestamp")return K+=(N.offset??new Date().getTimezoneOffset())*6e4,$MA.includes(X)||(K-=new Date().getTimezoneOffset()*6e4),K===0?null:{calculate:`datum[${JSON.stringify(U)}]!==null?(toDate(datum[${JSON.stringify(U)}])${xvA(K)}):null`,as:U}}return K===0?null:{calculate:`datum[${JSON.stringify(U)}]!==null?(datum[${JSON.stringify(U)}]${xvA(K)}):null`,as:U}}).filter(Boolean);let h=kKe({geomType:F,x:e,y:t,color:i,opacity:n,size:o,shape:g,row:r,column:C,xOffset:l,yOffset:c,theta:a,radius:s,details:B,text:I,displayOffset:y,vegaConfig:R});return E&&JKe(h,x),LKe(h,G),YKe(h,B,E),NKe(h,u),{config:Q,transform:k,mark:{type:F,opacity:.96,tooltip:{content:"data"}},encoding:h}}function MvA(A,e,t,i){if(typeof A=="function"){if(!e)return;const n=t.map(o=>o[e.fid]);return A({semanticType:e.semanticType,theme:i,values:n})}return A}function vvA(A,e,t,i){const n={...e.encoding};function o(g,a){if(a=a??g,A[g]&&n[a])if(typeof A[g]=="function"){const s=n[a].field,I=t.map(r=>r[s]);n[a].scale=A[g]({semanticType:n[a].type,theme:i,values:I})}else n[a].scale=A[g]}return o("row","y"),o("column","x"),o("color"),o("opacity"),o("size"),o("radius"),o("theta"),{...e,encoding:n}}const LvA=A=>Math.max(A,1);function unA({rows:A,columns:e,color:t,opacity:i,size:n,details:o=[],radius:g,shape:a,text:s,theta:I,interactiveScale:r,dataSource:C,layoutMode:l,width:c,height:B,defaultAggregated:E,geomType:u,stack:d,scales:f,mediaTheme:w,vegaConfig:y,displayOffset:G}){const R=E?O=>O??Ti:O=>O?O.aggName==="expr"?Ti:O:Ti,x=A.map(R).filter(O=>O!==Ti),F=e.map(R).filter(O=>O!==Ti),Q=R(x.length>0?x[x.length-1]:Ti),k=R(F.length>0?F[F.length-1]:Ti),h=x.filter(O=>O.analyticType==="dimension"),N=F.filter(O=>O.analyticType==="dimension"),v=x.filter(O=>O.analyticType==="measure"),K=F.filter(O=>O.analyticType==="measure"),U=v.length===0?h.slice(-1):v,V=K.length===0?N.slice(-1):K,X=x.slice(0,-1).filter(O=>O.analyticType==="dimension"),_=F.slice(0,-1).filter(O=>O.analyticType==="dimension"),q=X.length>0?X[X.length-1]:Ti,$=_.length>0?_[_.length-1]:Ti,nA=[...x,...F,t,i,n,...o].filter(O=>!!O).filter(O=>O.aggName!=="expr").map(O=>O.fid),j={data:{values:C},params:u==="boxplot"?void 0:[{name:"geom",select:{type:"point",fields:nA.map(yk)}}]};if(r&&j.params&&j.params.push({name:"grid",select:"interval",bind:"scales"}),U.length<=1&&V.length<=1){if(l!=="auto")if(q===Ti&&$===Ti)j.autosize="fit",j.width=c-5,j.height=B-5;else{const tA=q!==Ti?new Set(C.map(gA=>gA[q.fid])).size:1,sA=$!==Ti?new Set(C.map(gA=>gA[$.fid])).size:1;j.width=Math.floor(c/sA),j.height=Math.floor(B/tA)}const O=FvA({x:k,y:Q,color:R(t),opacity:R(i),size:R(n),shape:R(a),theta:R(I),radius:R(g),text:R(s),row:q,column:$,xOffset:Ti,yOffset:Ti,details:o.map(R).filter(tA=>tA!==Ti),defaultAggregated:E,stack:d,geomType:u,displayOffset:G,dataSource:C,vegaConfig:y}),eA=f?vvA(f,O,C,w):O;j.mark=eA.mark,"encoding"in eA&&(j.encoding=eA.encoding),"transform"in eA&&eA.transform.length>0&&(j.transform=eA.transform),j.resolve||(j.resolve={});let oA=y.resolve;for(let tA in oA){let sA=oA[tA]?"independent":"shared";j.resolve.scale={...j.resolve.scale,[tA]:sA},ke.POSITION_CHANNEL_CONFIG_LIST.includes(tA)?j.resolve.axis={...j.resolve.axis,[tA]:sA}:ke.NON_POSITION_CHANNEL_CONFIG_LIST.includes(tA)&&(j.resolve.legend={...j.resolve.legend,[tA]:sA})}return[j]}else{if(l!=="auto")if(q===Ti&&$===Ti)j.width=Math.floor(c/V.length)-5,j.height=Math.floor(B/U.length)-5;else{const oA=q!==Ti?new Set(C.map(sA=>sA[q.fid])).size:1,tA=$!==Ti?new Set(C.map(sA=>sA[$.fid])).size:1;j.width=Math.floor(c/V.length/tA),j.height=Math.floor(B/U.length/oA)}let O=0,eA=new Array(U.length*V.length);for(let oA=0;oA<LvA(U.length);oA++)for(let tA=0;tA<LvA(V.length);tA++,O++){const sA=tA===V.length-1,gA=oA==0,iA=FvA({x:V[tA]||Ti,y:U[oA]||Ti,color:R(t),opacity:R(i),size:R(n),shape:R(a),theta:R(I),radius:R(g),text:R(s),row:q,column:$,xOffset:Ti,yOffset:Ti,details:o,defaultAggregated:E,stack:d,geomType:u,hasLegend:sA,hideLegend:!gA,displayOffset:G,dataSource:C}),aA=f?vvA(f,iA,C,w):iA;let lA={...j};const CA={...lA,...aA};"params"in lA&&(CA.params=lA.params),eA[O]=CA}return eA}}function SKe(A){if(!A.rule)return null;switch(A.rule.type){case"range":case"temporal range":{const e=[];return A.rule.value[0]!==void 0&&A.rule.value[0]!==null&&e.push(`datum['${A.name}'] >= ${JSON.stringify(A.rule.value[0])}`),A.rule.value[1]!==void 0&&A.rule.value[1]!==null&&e.push(`datum['${A.name}'] <= ${JSON.stringify(A.rule.value[1])}`),e.join("&&")}case"one of":return A.rule.value.map(e=>`datum['${A.name}'] == ${JSON.stringify(e)}`).join("||");case"not in":return A.rule.value.map(e=>`datum['${A.name}'] != ${JSON.stringify(e)}`).join("&&")}}function HKe(A){const{defaultAggregated:e,geoms:t,folds:i}=A.config,{stack:n}=A.layout,{rows:o,columns:g,color:a,details:s,opacity:I,radius:r,shape:C,size:l,text:c,theta:B,filters:E,dimensions:u,measures:d}=A.encodings,f=new Map(u.concat(d).map(h=>[h.fid,h.name])),w=fk(t[0]??"auto").flatMap(h=>{var N;return((N=A.encodings)==null?void 0:N[h])??[]}),y=w.filter(h=>h.analyticType==="dimension"),G=w.filter(h=>h.analyticType==="measure"),R=y.find(h=>h.fid===fi)&&G.find(h=>h.fid===yi),x=o.filter(h=>e||h.aggName!=="expr"),F=g.filter(h=>e||h.aggName!=="expr"),Q=unA({rows:x,columns:F,defaultAggregated:e,layoutMode:"auto",dataSource:[],geomType:t[0],height:0,width:0,interactiveScale:!1,mediaTheme:"light",stack:n,vegaConfig:{},color:a[0],details:s,opacity:I[0],radius:r[0],shape:C[0],size:l[0],text:c[0],theta:B[0]}).map(h=>{var N;const v={...h};return v.data&&delete v.data,v.resolve&&delete v.resolve,v.params&&delete v.params,(N=v.encoding)!=null&&N.tooltip&&delete v.encoding.tooltip,v.encoding&&(v.encoding=Object.fromEntries(Object.entries(v.encoding).map(([K,U])=>[K,{field:U.title,type:U.type}]))),v.mark&&(v.mark=v.mark.type),R&&i&&(v.transform||(v.transform=[]),v.transform.push({fold:i.map(K=>f.get(K)??K)})),E.length>0&&(v.transform||(v.transform=[]),v.transform.push(...E.map(SKe).map(K=>({filter:K})))),v});if(Q.length===1)return Q[0];const k=Q.map(h=>{const{transform:N,config:v,...K}=h;return K});return{...Q[0].transform?{transform:Q[0].transform}:{},concat:k}}const ZKe={count:"count",sum:"sum",max:"max",min:"min",mean:"mean",median:"median",variance:"variance",stdev:"stdev",distinctCount:"distinct",expr:""};function WKe(A){const e=HKe(A),t=!!A.config.defaultAggregated,i="gw_count_fid",n=new Map,o=I=>{const r=I.name??I.fid;return I.fid===i?"Count":I.analyticType==="measure"&&I.aggName&&I.aggName!=="expr"?`${I.aggName}(${r})`:r},g=I=>{if(!I)return;const r=o(I);if(!r)return;const C=t?I.aggName:void 0,l=C?ZKe[C]:void 0,c=l&&l.length>0?l:void 0,B={title:r,field:I.basename??I.name??I.fid,aggregate:c},E=n.get(r);(!E||!E.aggregate&&c)&&n.set(r,B)};Object.values(A.encodings).forEach(I=>{Array.isArray(I)&&I.forEach(r=>g(r))});const a=I=>{if(!I||typeof I!="object")return I;const r=typeof I.field=="string"?I.field:void 0;if(!r)return I;const C=n.get(r);if(!C)return I;const l={...I,field:C.field,title:C.title};return C.aggregate?l.aggregate=C.aggregate:"aggregate"in l&&delete l.aggregate,l},s=I=>{!I||typeof I!="object"||(I.encoding&&(I.encoding=Object.fromEntries(Object.entries(I.encoding).map(([r,C])=>Array.isArray(C)?[r,C.map(l=>a(l))]:[r,a(C)]))),["layer","concat","hconcat","vconcat"].forEach(r=>{Array.isArray(I[r])&&I[r].forEach(s)}),I.spec&&s(I.spec))};return s(e),e}const KKe={[pe.setConfig]:(A,e,t)=>`Set the ${e} config to ${JSON.stringify(t)}.`,[pe.removeField]:(A,e,t)=>`Remove the ${A.encodings[e][t].name} field in ${e}.`,[pe.reorderField]:()=>"",[pe.moveField]:(A,e,t,i)=>`Move the ${A.encodings[e][t].name} field from ${e} to ${i}`,[pe.cloneField]:(A,e,t,i)=>`Use the ${A.encodings[e][t].name} field for ${i} encoding.`,[pe.createBinlogField]:(A,e,t,i,n,o)=>{const g=A.encodings[e][t];return`Create a ${i.startsWith("bin")?`${i}${o}`:`log${o}`} field for ${g.name} field in ${e}.`},[pe.appendFilter]:(A,e,t,i,n)=>`Create a empty filter for ${A.encodings[t][i].name} field in ${t}.`,[pe.modFilter]:(A,e,t,i)=>{const n=A.encodings[t][i];return`Change the filter of ${A.encodings.filters[e].name} for ${n.name}.`},[pe.writeFilter]:(A,e,t)=>`Change the rule of ${A.encodings.filters[e].name} field to ${JSON.stringify(t)}.`,[pe.setName]:(A,e)=>`Change the chart name to ${e}.`,[pe.applySort]:(A,e)=>`Change sorting to ${e}.`,[pe.transpose]:()=>"Transpose the chart.",[pe.setLayout]:(A,e)=>{const t=e.find(i=>i[0]==="stack"&&i[1]);return t?`Change the stack to ${t[1]}.`:""},[pe.setFieldAggregator]:(A,e,t,i)=>`Change the aggregator of ${A.encodings[e][t].name} field to ${i}.`,[pe.setGeoData]:()=>"",[pe.setCoordSystem]:(A,e)=>`Change the mark to ${ke.GEOM_TYPES[e][0]}.`,[pe.createDateDrillField]:()=>"",[pe.createDateFeatureField]:()=>"",[pe.changeSemanticType]:()=>"",[pe.setFilterAggregator]:()=>"",[pe.addFoldField]:()=>"",[pe.upsertPaintField]:()=>"",[pe.addSQLComputedField]:()=>"",[pe.removeAllField]:()=>"",[pe.editAllField]:()=>"",[pe.replaceWithNLPQuery]:()=>""};function UKe(A,e){const[t,...i]=e;return KKe[t](A,...i)}function VKe(A){const e=[];let t=A.base,i="";const n=()=>{i&&(t.config.geoms[0]==="auto"&&(i+=`
Change the geom type to ${TV(t.encodings.rows.concat(t.encodings.columns).map(o=>o.semanticType))}.`),fk(t.config.geoms[0]??"auto").flatMap(o=>{var g;return((g=t.encodings)==null?void 0:g[o])??[]}).length===0||(e.push({role:"user",content:i,type:"generated"}),e.push({role:"assistant",chart:t,type:"generated"})),i="")};for(let o=0;o<A.cursor;o++){const g=A.timeline[o];if(g[0]===pe.replaceWithNLPQuery){const[a,s,I]=g;n(),e.push({role:"user",content:s,type:"normal"}),e.push({role:"assistant",chart:JSON.parse(I),type:"normal"})}else{const a=UKe(t,g);a&&(i?i+=`
${a}`:i=a)}t=IKe(t,g)}return n(),e}function SvA(A){return[...A.dimensions,...A.measures]}function HvA(A,e){return fk(e).flatMap(t=>A[t]??[])}const XKe=Object.keys(ziA).filter(A=>!ke.META_FIELD_KEYS.includes(A)),ZvA=typeof FinalizationRegistry>"u"?null:new FinalizationRegistry(A=>A());class zKe{constructor(e,t){ai(this,"instanceID",VC()),ai(this,"visList"),ai(this,"visIndex",0),ai(this,"createdVis",0),ai(this,"editingFilterIdx",null),ai(this,"meta"),ai(this,"segmentKey",Zu.vis),ai(this,"showInsightBoard",!1),ai(this,"showDataBoard",!1),ai(this,"vizEmbededMenu",{show:!1,position:[0,0]}),ai(this,"showDataConfig",!1),ai(this,"showCodeExportPanel",!1),ai(this,"showVisualConfigPanel",!1),ai(this,"showGeoJSONConfigPanel",!1),ai(this,"removeConfirmIdx",null),ai(this,"filters",{}),ai(this,"tableCollapsedHeaderMap",new Map),ai(this,"selectedMarkObject",{}),ai(this,"showLogSettingPanel",!1),ai(this,"showBinSettingPanel",!1),ai(this,"showRenamePanel",!1),ai(this,"createField"),ai(this,"localGeoJSON"),ai(this,"showErrorResolutionPanel",0),ai(this,"showPainterPanel",!1),ai(this,"lastErrorMessage",""),ai(this,"showAskvizFeedbackIndex",0),ai(this,"lastSpec",""),ai(this,"editingComputedFieldFid"),ai(this,"defaultConfig"),ai(this,"onMetaChange"),this.meta=e,this.visList=t!=null&&t.empty?[]:[BnA(e,"Chart 1",t==null?void 0:t.defaultConfig)],this.createdVis=this.visList.length,this.defaultConfig=t==null?void 0:t.defaultConfig,this.onMetaChange=t==null?void 0:t.onMetaChange,Tve(this,{visList:xo.shallow,allEncodings:jx.struct,filters:xo.ref,tableCollapsedHeaderMap:xo.ref});const i=Nve(()=>this.currentVis,()=>{document.dispatchEvent(new CustomEvent("edit-graphic-walker",{detail:{spec:this.currentVis,instanceID:this.instanceID}}))});ZvA==null||ZvA.register(this,i)}get visLength(){return this.visList.length}get vizList(){return this.visList.map(e=>e.now)}get currentVis(){return this.visList[this.visIndex].now}get currentEncodings(){return this.currentVis.encodings}get viewFilters(){return this.currentEncodings.filters}get dimensions(){return this.currentEncodings.dimensions}get measures(){return this.currentEncodings.measures}get rows(){return this.currentEncodings.rows}get columns(){return this.currentEncodings.columns}get sort(){return uk({columns:this.columns,rows:this.rows})}get sortedEncoding(){return ZMA({columns:this.columns,rows:this.rows})}get allFields(){return SvA(this)}get config(){return this.currentVis.config}get layout(){return{...this.currentVis.layout,...this.localGeoJSON?{geoJson:this.localGeoJSON}:{}}}get allEncodings(){const e={};return XKe.forEach(t=>{e[t]=this.currentEncodings[t]}),e}get viewEncodings(){const e={};return fk(this.config.geoms[0]).forEach(t=>{e[t]=this.currentEncodings[t]}),e}get viewEncodingFields(){return HvA(this.viewEncodings,this.config.geoms[0])}get viewDimensions(){return this.viewEncodingFields.filter(e=>e.analyticType==="dimension")}get viewMeasures(){return this.viewEncodingFields.filter(e=>e.analyticType==="measure")}get workflow(){return Hm(this.viewFilters,this.allFields,this.viewDimensions,this.viewMeasures,this.config.defaultAggregated,this.sort,this.config.folds,this.config.limit,this.config.timezoneDisplayOffset)}get limit(){return this.config.limit}get canUndo(){return this.visList[this.visIndex].cursor>0}get canRedo(){const e=this.visList[this.visIndex];return e.cursor!==e.timeline.length}get chatMessages(){return VKe(this.visList[this.visIndex])}get paintFields(){if(this.currentVis.config.defaultAggregated){const{columns:e,rows:t,color:i,shape:n,size:o,opacity:g}=this.currentEncodings;if(e.length!==1||t.length!==1)return{type:"error",key:"count"};const a=e[0],s=t[0];if(a.aggName==="expr"||s.aggName==="expr"||a.fid===fi||a.fid===yi||s.fid===fi||s.fid===yi||a.fid===In||s.fid===In)return{type:"error",key:"count"};const I=r=>(r==null?void 0:r.fid)===In?void 0:r;return a.analyticType==="dimension"&&s.analyticType==="dimension"?{type:"new",x:a,y:s}:{type:"agg",x:a,y:s,color:I(i[0]),shape:I(n[0]),size:I(o[0]),opacity:I(g[0])}}else{const{columns:e,rows:t}=this.currentEncodings;if(e.length!==1||t.length!==1)return{type:"error",key:"count"};const i=e[0],n=t[0];return i.semanticType==="temporal"||n.semanticType==="temporal"?{type:"error",key:"temporal"}:i.aggName==="expr"||n.aggName==="expr"||i.fid===fi||i.fid===yi||n.fid===fi||n.fid===yi||i.fid===In||n.fid===In?{type:"error",key:"count"}:{type:"new",x:i,y:n}}}get paintInfo(){var e,t,i,n;const o=this.currentEncodings.dimensions.find(r=>r.fid===In),{columns:g,rows:a}=this.currentEncodings;if(g.length!==1||a.length!==1)return{type:"error",key:"count"};const s=g[0],I=a[0];if(s.semanticType==="temporal"||I.semanticType==="temporal")return{type:"error",key:"temporal"};if(s.aggName==="expr"||I.aggName==="expr"||s.fid===fi||s.fid===yi||I.fid===fi||I.fid===yi||s.fid===In||I.fid===In)return{type:"error",key:"count"};if(o){const r=(t=(e=o.expression)==null?void 0:e.params.find(l=>l.type==="map"))==null?void 0:t.value;if(r)return{type:"exist",item:X3e(r),new:this.paintFields};const C=(n=(i=o.expression)==null?void 0:i.params.find(l=>l.type==="newmap"))==null?void 0:n.value;if(C)return{type:"exist",item:C,new:this.paintFields}}return this.paintFields}appendFilter(e,t,i){const n=this.currentEncodings[t][i];n.fid===fi||n.fid===yi||n.fid===no||n.aggName==="expr"||(this.visList[this.visIndex]=ri.appendFilter(this.visList[this.visIndex],e,t,i,null),this.editingFilterIdx=e)}undo(){this.visList[this.visIndex]=CKe(this.visList[this.visIndex])}redo(){this.visList[this.visIndex]=lKe(this.visList[this.visIndex])}setVisName(e,t){this.visList[e]=ri.setName(this.visList[e],t)}setMeta(e){this.meta=e}setOnMetaChange(e){this.onMetaChange=e}setDefaultConfig(e){this.defaultConfig=e}resetVisualization(e="Chart 1"){this.visList=[BnA(this.meta,e,this.defaultConfig)],this.createdVis=1}addVisualization(e){const t=e?typeof e=="function"?e(this.createdVis+1):e:"Chart "+(this.createdVis+1);this.visList.push(BnA(this.meta,t,this.defaultConfig)),this.createdVis+=1,this.visIndex=this.visList.length-1}removeVisualization(e){this.visLength!==1&&(this.visIndex>=e&&this.visIndex>0&&(this.visIndex-=1),this.visList.splice(e,1))}duplicateVisualization(e){this.visList.push(pk({...this.visList[e].now,name:this.visList[e].now.name+" Copy",visId:VC()})),this.createdVis+=1,this.visIndex=this.visList.length-1}setFilterEditing(e){this.editingFilterIdx=e}closeFilterEditing(){this.editingFilterIdx=null}setSegmentKey(e){this.segmentKey=e}setVisualConfig(...e){this.visList[this.visIndex]=ri.setConfig(this.visList[this.visIndex],...e)}setCoordSystem(e){this.visList[this.visIndex]=ri.setCoordSystem(this.visList[this.visIndex],e)}setVisualLayout(...e){typeof e[0]=="string"?this.visList[this.visIndex]=ri.setLayout(this.visList[this.visIndex],[e]):this.visList[this.visIndex]=ri.setLayout(this.visList[this.visIndex],e)}reorderField(e,t,i){ke.META_FIELD_KEYS.includes(e)||t!==i&&(this.visList[this.visIndex]=ri.reorderField(this.visList[this.visIndex],e,t,i))}moveField(e,t,i,n){if(e==="filters")return this.removeField(e,t);if(i==="filters")return this.appendFilter(n,e,t);const o=this.currentEncodings[e][t],g=ke.META_FIELD_KEYS.includes(e),a=ke.META_FIELD_KEYS.includes(i);if(g&&a&&(o.fid===fi||o.fid===yi||o.fid===no||o.fid===In))return;const s=ke.CHANNEL_LIMIT[i]??1/0;if(a===g)this.visList[this.visIndex]=ri.moveField(this.visList[this.visIndex],e,t,i,n,s);else if(a)this.visList[this.visIndex]=ri.removeField(this.visList[this.visIndex],e,t);else{if(o.fid===fi||o.fid===yi){this.visList[this.visIndex]=ri.addFoldField(this.visList[this.visIndex],e,t,i,n,VC(),s);return}this.visList[this.visIndex]=ri.cloneField(this.visList[this.visIndex],e,t,i,n,VC(),s)}}modFilter(e,t,i){this.visList[this.visIndex]=ri.modFilter(this.visList[this.visIndex],e,t,i)}removeField(e,t){ke.META_FIELD_KEYS.includes(e)||(this.visList[this.visIndex]=ri.removeField(this.visList[this.visIndex],e,t))}writeFilter(e,t){this.visList[this.visIndex]=ri.writeFilter(this.visList[this.visIndex],e,t)}transpose(){this.visList[this.visIndex]=ri.transpose(this.visList[this.visIndex])}createBinField(e,t,i,n=10){const o=VC(),g=this.currentEncodings,a=g.dimensions.find(s=>s.computed&&s.expression&&s.expression.op===i&&s.expression.params[0].value===g[e][t].fid&&s.expression.num===n);return a?a.fid:(this.visList[this.visIndex]=ri.createBinlogField(this.visList[this.visIndex],e,t,i,o,n),o)}createLogField(e,t,i,n=10){this.visList[this.visIndex]=ri.createBinlogField(this.visList[this.visIndex],e,t,i,VC(),n)}renameFieldInChart(e,t,i){const n=this.currentEncodings[e][t];n&&(this.visList[this.visIndex]=ri.editAllField(this.visList[this.visIndex],n.fid,{name:i}))}createDateTimeDrilledField(e,t,i,n,o,g){this.visList[this.visIndex]=ri.createDateDrillField(this.visList[this.visIndex],e,t,i,VC(),n,o,g??new Date().getTimezoneOffset())}createDateFeatureField(e,t,i,n,o,g){this.visList[this.visIndex]=ri.createDateFeatureField(this.visList[this.visIndex],e,t,i,VC(),n,o,g??new Date().getTimezoneOffset())}setFieldAggregator(e,t,i){this.visList[this.visIndex]=ri.setFieldAggregator(this.visList[this.visIndex],e,t,i)}setFilterAggregator(e,t){this.visList[this.visIndex]=ri.setFilterAggregator(this.visList[this.visIndex],e,t)}applyDefaultSort(e="ascending"){this.visList[this.visIndex]=ri.applySort(this.visList[this.visIndex],e)}exportCurrentChart(){return mvA(this.visList[this.visIndex])}exportAllCharts(){return this.visList.map(e=>mvA(e))}exportCode(){return this.visList.map(e=>BKe(e))}importCode(e){this.visList=e.map(t=>"layout"in t?QKe(t):pk(fvA(UMA(VMA(t))))),this.createdVis=this.visList.length,this.visIndex=0}appendRaw(e){const t=pvA(e);this.visList.push(t),this.createdVis+=1,this.visIndex=this.visList.length-1}importRaw(e){this.visList=e.map(pvA),this.createdVis=this.visList.length,this.visIndex=0}appendFromCode(e){const t=pk(yvA(e));this.visList.push(t),this.createdVis+=1,this.visIndex=this.visList.length-1}setAskvizFeedback(e){this.showAskvizFeedbackIndex=e?this.visIndex:void 0}replaceNow(e){this.visList[this.visIndex]=pk(e)}selectVisualization(e){this.visIndex=e}setShowDataConfig(e){this.showDataConfig=e}setShowInsightBoard(e){this.showInsightBoard=e}setShowDataBoard(e){this.showDataBoard=e}showEmbededMenu(e){this.vizEmbededMenu.show=!0,this.vizEmbededMenu.position=e}setShowCodeExportPanel(e){this.showCodeExportPanel=e}setShowVisualConfigPanel(e){this.showVisualConfigPanel=e}closeEmbededMenu(){this.vizEmbededMenu.show=!1}setFilters(e){this.filters=e}updateCurrentDatasetMetas(e,t){var i;const n=this.meta.find(o=>o.fid===e);if(n)for(let o in t)n[o]=t[o];(i=this.onMetaChange)==null||i.call(this,e,t)}openRemoveConfirmModal(e){this.removeConfirmIdx=e}closeRemoveConfirmModal(){this.removeConfirmIdx=null}setGeographicData(e,t,i){const n=e.type==="GeoJSON"?e.data:zV(e.data,e.objectKey||Object.keys(e.data.objects)[0]);if(!("features"in n)){console.error("Invalid GeoJSON: GeoJSON must be a FeatureCollection, but got",n);return}this.localGeoJSON=n,i?this.visList[this.visIndex]=ri.setGeoData(this.visList[this.visIndex],void 0,t,i):this.visList[this.visIndex]=ri.setGeoData(this.visList[this.visIndex],n,t,void 0)}clearGeographicData(){this.visList[this.visIndex]=ri.setGeoData(this.visList[this.visIndex],void 0,void 0,void 0)}changeSemanticType(e,t,i){this.visList[this.visIndex]=ri.changeSemanticType(this.visList[this.visIndex],e,t,i)}updatePaint(e,t){this.visList[this.visIndex]=ri.upsertPaintField(this.visList[this.visIndex],e,t)}updateGeoKey(e){this.setVisualLayout("geoKey",e)}updateTableCollapsedHeader(e){const{uniqueKey:t,height:i}=e;if(i<1)return;const n=new Map(this.tableCollapsedHeaderMap);n.forEach((o,g)=>{g.startsWith(t)&&g.length>t.length&&n.delete(g)}),n.has(t)?n.delete(t):n.set(t,e.path),this.tableCollapsedHeaderMap=n}resetTableCollapsedHeader(){const e=new Map;this.tableCollapsedHeaderMap=e}setShowGeoJSONConfigPanel(e){this.showGeoJSONConfigPanel=e}setShowBinSettingPanel(e){this.showBinSettingPanel=e}setShowLogSettingPanel(e){this.showLogSettingPanel=e}setShowRenamePanel(e){this.showRenamePanel=e}setCreateField(e){this.createField=e}updateSelectedMarkObject(e){this.selectedMarkObject=e}updateShowErrorResolutionPanel(e,t=""){this.showErrorResolutionPanel=e,this.lastErrorMessage=t}setShowPainter(e){this.showPainterPanel=e}updateLastSpec(e){this.lastSpec=e}setComputedFieldFid(e){this.editingComputedFieldFid=e}upsertComputedField(e,t,i){if(e==="")this.visList[this.visIndex]=ri.addSQLComputedField(this.visList[this.visIndex],VC(),t,i);else{const n=this.allFields.find(r=>r.fid===e);if(!n)return;const[o,g]=nvA(HV(i),this.allFields),a=o==="quantitative"?"measure":"dimension",s=g?"expr":a==="dimension"?void 0:"sum",I=n.aggName==="expr"?"expr":n.aggName===void 0?void 0:"sum";this.visList[this.visIndex]=ri.editAllField(this.visList[this.visIndex],e,{name:t,analyticType:a,semanticType:o,...I!==s?{aggName:s}:{},expression:{as:e,op:"expr",params:[{type:"sql",value:i}]}})}}removeComputedField(e,t){const i=this.currentEncodings[e][t];i.computed&&(this.visList[this.visIndex]=ri.removeAllField(this.visList[this.visIndex],i.fid))}replaceWithNLPQuery(e,t){this.visList[this.visIndex]=ri.replaceWithNLPQuery(this.visList[this.visIndex],e,t)}}function WvA(A,e,t,i){var n,o,g;const a=XV(e,t,i),s=a.encodings.dimensions.concat(a.encodings.measures);if(a.config.defaultAggregated=!!A.aggregate,(((n=A.geomType)==null?void 0:n.length)??0)>0&&(a.config.geoms=((o=A.geomType)==null?void 0:o.map(I=>TKe(I)))??["tick"]),(((g=A.facets)==null?void 0:g.length)??0)>0){const I=(A.facets||[]).concat(A.highFacets||[]);for(let r of I){const C=s.find(l=>l.fid===r);C&&(a.encodings.rows=a.encodings.rows.concat([C]))}}if(A.position){const[I,r]=A.position;if(I){const C=s.find(l=>l.fid===I);C&&(a.encodings.columns=a.encodings.columns.concat([C]))}if(r){const C=s.find(l=>l.fid===r);C&&(a.encodings.rows=a.encodings.rows.concat([C]))}}if(A.color&&A.color.length>0){const I=A.color[0],r=s.find(C=>C.fid===I);r&&(a.encodings.color=a.encodings.color.concat([r]))}if(A.size&&A.size.length>0){const I=A.size[0],r=s.find(C=>C.fid===I);r&&(a.encodings.size=a.encodings.size.concat([r]))}if(A.opacity&&A.opacity.length>0){const I=A.opacity[0],r=s.find(C=>C.fid===I);r&&(a.encodings.opacity=a.encodings.opacity.concat([r]))}return a}function TKe(A){switch(A){case"interval":case"bar":return"bar";case"line":return"line";case"boxplot":return"boxplot";case"area":return"area";case"point":return"point";case"arc":return"arc";case"circle":return"circle";case"heatmap":return"circle";case"rect":return"rect";case"tick":default:return"tick"}}function _Ke(A){const e={};return(t,...i)=>t?(e[t]||(e[t]=A(...i)),e[t]):A(...i)}const OKe=_Ke((A,e)=>new zKe(A,e)),KvA=b.createContext(null),qKe=()=>{},dnA=A=>{const e=A.keepAlive?`${A.keepAlive}`:"",t=p.useMemo(()=>{var a;const s=A.defaultRenderer?{...A.defaultConfig,layout:{renderer:A.defaultRenderer,...((a=A.defaultConfig)==null?void 0:a.layout)??{}}}:A.defaultConfig;return OKe(e,A.meta,{onMetaChange:A.onMetaChange,defaultConfig:s})},[e]),i=p.useRef(A.meta);p.useEffect(()=>{i.current!==A.meta&&(t.setMeta(A.meta),i.current=A.meta)},[A.meta,t]);const n=p.useRef(A.onMetaChange);p.useEffect(()=>{n.current!==A.onMetaChange&&(t.setOnMetaChange(A.onMetaChange),n.current=A.onMetaChange)},[A.meta,t]);const o=p.useRef(A.defaultConfig),g=p.useRef(A.defaultRenderer);return p.useEffect(()=>{var a;if(o.current!==A.defaultConfig||g.current!==A.defaultRenderer){const s=A.defaultRenderer?{...A.defaultConfig,layout:{renderer:A.defaultRenderer,...((a=A.defaultConfig)==null?void 0:a.layout)??{}}}:A.defaultConfig;t.setDefaultConfig(s),o.current=A.defaultConfig,g.current=A.defaultRenderer}},[A.defaultConfig,A.defaultRenderer,t]),p.useEffect(()=>{if(A.storeRef){const a=A.storeRef;return a.current=t,()=>{a.current=null}}return qKe},[A.storeRef,t]),b.createElement(KvA.Provider,{value:t},A.children)};function xt(){return p.useContext(KvA)}const GF=p.createContext(async()=>[]);function Og(){return p.useContext(GF)}function hnA(A,e){return(...t)=>Promise.race([A(...t),new Promise((i,n)=>{setTimeout(()=>n(new Error("timeout")),e)})])}function mnA(A,e){return(...t)=>A(...t).catch(i=>{throw e(i),i})}function UvA(A){var e,t,i="";if(typeof A=="string"||typeof A=="number")i+=A;else if(typeof A=="object")if(Array.isArray(A))for(e=0;e<A.length;e++)A[e]&&(t=UvA(A[e]))&&(i&&(i+=" "),i+=t);else for(e in A)A[e]&&(i&&(i+=" "),i+=e);return i}function jKe(){for(var A,e,t=0,i="";t<arguments.length;)(A=arguments[t++])&&(e=UvA(A))&&(i&&(i+=" "),i+=e);return i}const VvA=A=>typeof A=="boolean"?"".concat(A):A===0?"0":A,XvA=jKe,_V=(A,e)=>t=>{var i;if((e==null?void 0:e.variants)==null)return XvA(A,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:n,defaultVariants:o}=e,g=Object.keys(n).map(I=>{const r=t==null?void 0:t[I],C=o==null?void 0:o[I];if(r===null)return null;const l=VvA(r)||VvA(C);return n[I][l]}),a=t&&Object.entries(t).reduce((I,r)=>{let[C,l]=r;return l===void 0||(I[C]=l),I},{}),s=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((I,r)=>{let{class:C,className:l,...c}=r;return Object.entries(c).every(B=>{let[E,u]=B;return Array.isArray(u)?u.includes({...o,...a}[E]):{...o,...a}[E]===u})?[...I,C,l]:I},[]);return XvA(A,g,s,t==null?void 0:t.class,t==null?void 0:t.className)},OV=_V("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",toggle:"hover:bg-muted hover:text-muted-foreground",none:""},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9","icon-sm":"h-6 w-6 p-1","icon-xs":"h-4 w-4",none:"",toolbar:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),fe=p.forwardRef(({className:A,variant:e,size:t,asChild:i=!1,...n},o)=>{const g=i?YZe:"button";return p.createElement(g,{className:Ce(OV({variant:e,size:t,className:A})),ref:o,...n})});fe.displayName="Button";function oQ(A){const e=p.useRef(A);return p.useEffect(()=>{e.current=A}),p.useMemo(()=>(...t)=>{var i;return(i=e.current)==null?void 0:i.call(e,...t)},[])}function PKe(A,e=globalThis==null?void 0:globalThis.document){const t=oQ(A);p.useEffect(()=>{const i=n=>{n.key==="Escape"&&t(n)};return e.addEventListener("keydown",i,{capture:!0}),()=>e.removeEventListener("keydown",i,{capture:!0})},[t,e])}var $Ke="DismissableLayer",pnA="dismissableLayer.update",AUe="dismissableLayer.pointerDownOutside",eUe="dismissableLayer.focusOutside",zvA,TvA=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ny=p.forwardRef((A,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:i,onPointerDownOutside:n,onFocusOutside:o,onInteractOutside:g,onDismiss:a,...s}=A,I=p.useContext(TvA),[r,C]=p.useState(null),l=(r==null?void 0:r.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,c]=p.useState({}),B=Te(e,x=>C(x)),E=Array.from(I.layers),[u]=[...I.layersWithOutsidePointerEventsDisabled].slice(-1),d=E.indexOf(u),f=r?E.indexOf(r):-1,w=I.layersWithOutsidePointerEventsDisabled.size>0,y=f>=d,G=nUe(x=>{const F=x.target,Q=[...I.branches].some(k=>k.contains(F));!y||Q||(n==null||n(x),g==null||g(x),x.defaultPrevented||a==null||a())},l),R=oUe(x=>{const F=x.target;[...I.branches].some(Q=>Q.contains(F))||(o==null||o(x),g==null||g(x),x.defaultPrevented||a==null||a())},l);return PKe(x=>{f===I.layers.size-1&&(i==null||i(x),!x.defaultPrevented&&a&&(x.preventDefault(),a()))},l),p.useEffect(()=>{if(r)return t&&(I.layersWithOutsidePointerEventsDisabled.size===0&&(zvA=l.body.style.pointerEvents,l.body.style.pointerEvents="none"),I.layersWithOutsidePointerEventsDisabled.add(r)),I.layers.add(r),_vA(),()=>{t&&I.layersWithOutsidePointerEventsDisabled.size===1&&(l.body.style.pointerEvents=zvA)}},[r,l,t,I]),p.useEffect(()=>()=>{r&&(I.layers.delete(r),I.layersWithOutsidePointerEventsDisabled.delete(r),_vA())},[r,I]),p.useEffect(()=>{const x=()=>c({});return document.addEventListener(pnA,x),()=>document.removeEventListener(pnA,x)},[]),cA(re.div,{...s,ref:B,style:{pointerEvents:w?y?"auto":"none":void 0,...A.style},onFocusCapture:TA(A.onFocusCapture,R.onFocusCapture),onBlurCapture:TA(A.onBlurCapture,R.onBlurCapture),onPointerDownCapture:TA(A.onPointerDownCapture,G.onPointerDownCapture)})});Ny.displayName=$Ke;var tUe="DismissableLayerBranch",iUe=p.forwardRef((A,e)=>{const t=p.useContext(TvA),i=p.useRef(null),n=Te(e,i);return p.useEffect(()=>{const o=i.current;if(o)return t.branches.add(o),()=>{t.branches.delete(o)}},[t.branches]),cA(re.div,{...A,ref:n})});iUe.displayName=tUe;function nUe(A,e=globalThis==null?void 0:globalThis.document){const t=oQ(A),i=p.useRef(!1),n=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!i.current){let s=function(){OvA(AUe,t,I,{discrete:!0})};const I={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",n.current),n.current=s,e.addEventListener("click",n.current,{once:!0})):s()}else e.removeEventListener("click",n.current);i.current=!1},g=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(g),e.removeEventListener("pointerdown",o),e.removeEventListener("click",n.current)}},[e,t]),{onPointerDownCapture:()=>i.current=!0}}function oUe(A,e=globalThis==null?void 0:globalThis.document){const t=oQ(A),i=p.useRef(!1);return p.useEffect(()=>{const n=o=>{o.target&&!i.current&&OvA(eUe,t,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",n),()=>e.removeEventListener("focusin",n)},[e,t]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function _vA(){const A=new CustomEvent(pnA);document.dispatchEvent(A)}function OvA(A,e,t,{discrete:i}){const n=t.originalEvent.target,o=new CustomEvent(A,{bubbles:!1,cancelable:!0,detail:t});e&&n.addEventListener(A,e,{once:!0}),i?qFA(n,o):n.dispatchEvent(o)}var fnA=0;function qV(){p.useEffect(()=>{const A=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",A[0]??qvA()),document.body.insertAdjacentElement("beforeend",A[1]??qvA()),fnA++,()=>{fnA===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),fnA--}},[])}function qvA(){const A=document.createElement("span");return A.setAttribute("data-radix-focus-guard",""),A.tabIndex=0,A.style.outline="none",A.style.opacity="0",A.style.position="fixed",A.style.pointerEvents="none",A}var ynA="focusScope.autoFocusOnMount",bnA="focusScope.autoFocusOnUnmount",jvA={bubbles:!1,cancelable:!0},gUe="FocusScope",kF=p.forwardRef((A,e)=>{const{loop:t=!1,trapped:i=!1,onMountAutoFocus:n,onUnmountAutoFocus:o,...g}=A,[a,s]=p.useState(null),I=oQ(n),r=oQ(o),C=p.useRef(null),l=Te(e,E=>s(E)),c=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(i){let E=function(w){if(c.paused||!a)return;const y=w.target;a.contains(y)?C.current=y:Zm(C.current,{select:!0})},u=function(w){if(c.paused||!a)return;const y=w.relatedTarget;y!==null&&(a.contains(y)||Zm(C.current,{select:!0}))},d=function(w){if(document.activeElement===document.body)for(const y of w)y.removedNodes.length>0&&Zm(a)};document.addEventListener("focusin",E),document.addEventListener("focusout",u);const f=new MutationObserver(d);return a&&f.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",u),f.disconnect()}}},[i,a,c.paused]),p.useEffect(()=>{if(a){ALA.add(c);const E=document.activeElement;if(!a.contains(E)){const u=new CustomEvent(ynA,jvA);a.addEventListener(ynA,I),a.dispatchEvent(u),u.defaultPrevented||(aUe(lUe(PvA(a)),{select:!0}),document.activeElement===E&&Zm(a))}return()=>{a.removeEventListener(ynA,I),setTimeout(()=>{const u=new CustomEvent(bnA,jvA);a.addEventListener(bnA,r),a.dispatchEvent(u),u.defaultPrevented||Zm(E??document.body,{select:!0}),a.removeEventListener(bnA,r),ALA.remove(c)},0)}}},[a,I,r,c]);const B=p.useCallback(E=>{if(!t&&!i||c.paused)return;const u=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,d=document.activeElement;if(u&&d){const f=E.currentTarget,[w,y]=sUe(f);w&&y?!E.shiftKey&&d===y?(E.preventDefault(),t&&Zm(w,{select:!0})):E.shiftKey&&d===w&&(E.preventDefault(),t&&Zm(y,{select:!0})):d===f&&E.preventDefault()}},[t,i,c.paused]);return cA(re.div,{tabIndex:-1,...g,ref:l,onKeyDown:B})});kF.displayName=gUe;function aUe(A,{select:e=!1}={}){const t=document.activeElement;for(const i of A)if(Zm(i,{select:e}),document.activeElement!==t)return}function sUe(A){const e=PvA(A),t=$vA(e,A),i=$vA(e.reverse(),A);return[t,i]}function PvA(A){const e=[],t=document.createTreeWalker(A,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const n=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||n?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function $vA(A,e){for(const t of A)if(!rUe(t,{upTo:e}))return t}function rUe(A,{upTo:e}){if(getComputedStyle(A).visibility==="hidden")return!0;for(;A;){if(e!==void 0&&A===e)return!1;if(getComputedStyle(A).display==="none")return!0;A=A.parentElement}return!1}function IUe(A){return A instanceof HTMLInputElement&&"select"in A}function Zm(A,{select:e=!1}={}){if(A&&A.focus){const t=document.activeElement;A.focus({preventScroll:!0}),A!==t&&IUe(A)&&e&&A.select()}}var ALA=CUe();function CUe(){let A=[];return{add(e){const t=A[0];e!==t&&(t==null||t.pause()),A=eLA(A,e),A.unshift(e)},remove(e){var t;A=eLA(A,e),(t=A[0])==null||t.resume()}}}function eLA(A,e){const t=[...A],i=t.indexOf(e);return i!==-1&&t.splice(i,1),t}function lUe(A){return A.filter(e=>e.tagName!=="A")}var cUe=bf[" useId ".trim().toString()]||(()=>{}),BUe=0;function _o(A){const[e,t]=p.useState(cUe());return _g(()=>{A||t(i=>i??String(BUe++))},[A]),A||(e?`radix-${e}`:"")}const QUe=["top","right","bottom","left"],Wm=Math.min,hI=Math.max,jV=Math.round,PV=Math.floor,Km=A=>({x:A,y:A}),EUe={left:"right",right:"left",bottom:"top",top:"bottom"},uUe={start:"end",end:"start"};function wnA(A,e,t){return hI(A,Wm(e,t))}function Vu(A,e){return typeof A=="function"?A(e):A}function Xu(A){return A.split("-")[0]}function bk(A){return A.split("-")[1]}function DnA(A){return A==="x"?"y":"x"}function GnA(A){return A==="y"?"height":"width"}function wk(A){return["top","bottom"].includes(Xu(A))?"y":"x"}function knA(A){return DnA(wk(A))}function dUe(A,e,t){t===void 0&&(t=!1);const i=bk(A),n=knA(A),o=GnA(n);let g=n==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(g=$V(g)),[g,$V(g)]}function hUe(A){const e=$V(A);return[JnA(A),e,JnA(e)]}function JnA(A){return A.replace(/start|end/g,e=>uUe[e])}function mUe(A,e,t){const i=["left","right"],n=["right","left"],o=["top","bottom"],g=["bottom","top"];switch(A){case"top":case"bottom":return t?e?n:i:e?i:n;case"left":case"right":return e?o:g;default:return[]}}function pUe(A,e,t,i){const n=bk(A);let o=mUe(Xu(A),t==="start",i);return n&&(o=o.map(g=>g+"-"+n),e&&(o=o.concat(o.map(JnA)))),o}function $V(A){return A.replace(/left|right|bottom|top/g,e=>EUe[e])}function fUe(A){return{top:0,right:0,bottom:0,left:0,...A}}function tLA(A){return typeof A!="number"?fUe(A):{top:A,right:A,bottom:A,left:A}}function AX(A){return{...A,top:A.y,left:A.x,right:A.x+A.width,bottom:A.y+A.height}}function iLA(A,e,t){let{reference:i,floating:n}=A;const o=wk(e),g=knA(e),a=GnA(g),s=Xu(e),I=o==="y",r=i.x+i.width/2-n.width/2,C=i.y+i.height/2-n.height/2,l=i[a]/2-n[a]/2;let c;switch(s){case"top":c={x:r,y:i.y-n.height};break;case"bottom":c={x:r,y:i.y+i.height};break;case"right":c={x:i.x+i.width,y:C};break;case"left":c={x:i.x-n.width,y:C};break;default:c={x:i.x,y:i.y}}switch(bk(e)){case"start":c[g]-=l*(t&&I?-1:1);break;case"end":c[g]+=l*(t&&I?-1:1);break}return c}const yUe=async(A,e,t)=>{const{placement:i="bottom",strategy:n="absolute",middleware:o=[],platform:g}=t,a=o.filter(Boolean),s=await(g.isRTL==null?void 0:g.isRTL(e));let I=await g.getElementRects({reference:A,floating:e,strategy:n}),{x:r,y:C}=iLA(I,i,s),l=i,c={},B=0;for(let E=0;E<a.length;E++){const{name:u,fn:d}=a[E],{x:f,y:w,data:y,reset:G}=await d({x:r,y:C,initialPlacement:i,placement:l,strategy:n,middlewareData:c,rects:I,platform:g,elements:{reference:A,floating:e}});r=f??r,C=w??C,c={...c,[u]:{...c[u],...y}},G&&B<=50&&(B++,typeof G=="object"&&(G.placement&&(l=G.placement),G.rects&&(I=G.rects===!0?await g.getElementRects({reference:A,floating:e,strategy:n}):G.rects),{x:r,y:C}=iLA(I,l,s)),E=-1)}return{x:r,y:C,placement:l,strategy:n,middlewareData:c}};async function JF(A,e){var t;e===void 0&&(e={});const{x:i,y:n,platform:o,rects:g,elements:a,strategy:s}=A,{boundary:I="clippingAncestors",rootBoundary:r="viewport",elementContext:C="floating",altBoundary:l=!1,padding:c=0}=Vu(e,A),B=tLA(c),E=a[l?C==="floating"?"reference":"floating":C],u=AX(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(E)))==null||t?E:E.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:I,rootBoundary:r,strategy:s})),d=C==="floating"?{...g.floating,x:i,y:n}:g.reference,f=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),w=await(o.isElement==null?void 0:o.isElement(f))?await(o.getScale==null?void 0:o.getScale(f))||{x:1,y:1}:{x:1,y:1},y=AX(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:d,offsetParent:f,strategy:s}):d);return{top:(u.top-y.top+B.top)/w.y,bottom:(y.bottom-u.bottom+B.bottom)/w.y,left:(u.left-y.left+B.left)/w.x,right:(y.right-u.right+B.right)/w.x}}const bUe=A=>({name:"arrow",options:A,async fn(e){const{x:t,y:i,placement:n,rects:o,platform:g,elements:a,middlewareData:s}=e,{element:I,padding:r=0}=Vu(A,e)||{};if(I==null)return{};const C=tLA(r),l={x:t,y:i},c=knA(n),B=GnA(c),E=await g.getDimensions(I),u=c==="y",d=u?"top":"left",f=u?"bottom":"right",w=u?"clientHeight":"clientWidth",y=o.reference[B]+o.reference[c]-l[c]-o.floating[B],G=l[c]-o.reference[c],R=await(g.getOffsetParent==null?void 0:g.getOffsetParent(I));let x=R?R[w]:0;(!x||!await(g.isElement==null?void 0:g.isElement(R)))&&(x=a.floating[w]||o.floating[B]);const F=y/2-G/2,Q=x/2-E[B]/2-1,k=Wm(C[d],Q),h=Wm(C[f],Q),N=k,v=x-E[B]-h,K=x/2-E[B]/2+F,U=wnA(N,K,v),V=!s.arrow&&bk(n)!=null&&K!==U&&o.reference[B]/2-(K<N?k:h)-E[B]/2<0,X=V?K<N?K-N:K-v:0;return{[c]:l[c]+X,data:{[c]:U,centerOffset:K-U-X,...V&&{alignmentOffset:X}},reset:V}}}),wUe=function(A){return A===void 0&&(A={}),{name:"flip",options:A,async fn(e){var t,i;const{placement:n,middlewareData:o,rects:g,initialPlacement:a,platform:s,elements:I}=e,{mainAxis:r=!0,crossAxis:C=!0,fallbackPlacements:l,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:B="none",flipAlignment:E=!0,...u}=Vu(A,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const d=Xu(n),f=Xu(a)===a,w=await(s.isRTL==null?void 0:s.isRTL(I.floating)),y=l||(f||!E?[$V(a)]:hUe(a));!l&&B!=="none"&&y.push(...pUe(a,E,B,w));const G=[a,...y],R=await JF(e,u),x=[];let F=((i=o.flip)==null?void 0:i.overflows)||[];if(r&&x.push(R[d]),C){const N=dUe(n,g,w);x.push(R[N[0]],R[N[1]])}if(F=[...F,{placement:n,overflows:x}],!x.every(N=>N<=0)){var Q,k;const N=(((Q=o.flip)==null?void 0:Q.index)||0)+1,v=G[N];if(v)return{data:{index:N,overflows:F},reset:{placement:v}};let K=(k=F.filter(U=>U.overflows[0]<=0).sort((U,V)=>U.overflows[1]-V.overflows[1])[0])==null?void 0:k.placement;if(!K)switch(c){case"bestFit":{var h;const U=(h=F.map(V=>[V.placement,V.overflows.filter(X=>X>0).reduce((X,_)=>X+_,0)]).sort((V,X)=>V[1]-X[1])[0])==null?void 0:h[0];U&&(K=U);break}case"initialPlacement":K=a;break}if(n!==K)return{reset:{placement:K}}}return{}}}};function nLA(A,e){return{top:A.top-e.height,right:A.right-e.width,bottom:A.bottom-e.height,left:A.left-e.width}}function oLA(A){return QUe.some(e=>A[e]>=0)}const DUe=function(A){return A===void 0&&(A={}),{name:"hide",options:A,async fn(e){const{rects:t}=e,{strategy:i="referenceHidden",...n}=Vu(A,e);switch(i){case"referenceHidden":{const o=await JF(e,{...n,elementContext:"reference"}),g=nLA(o,t.reference);return{data:{referenceHiddenOffsets:g,referenceHidden:oLA(g)}}}case"escaped":{const o=await JF(e,{...n,altBoundary:!0}),g=nLA(o,t.floating);return{data:{escapedOffsets:g,escaped:oLA(g)}}}default:return{}}}}};async function GUe(A,e){const{placement:t,platform:i,elements:n}=A,o=await(i.isRTL==null?void 0:i.isRTL(n.floating)),g=Xu(t),a=bk(t),s=wk(t)==="y",I=["left","top"].includes(g)?-1:1,r=o&&s?-1:1,C=Vu(e,A);let{mainAxis:l,crossAxis:c,alignmentAxis:B}=typeof C=="number"?{mainAxis:C,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...C};return a&&typeof B=="number"&&(c=a==="end"?B*-1:B),s?{x:c*r,y:l*I}:{x:l*I,y:c*r}}const kUe=function(A){return A===void 0&&(A=0),{name:"offset",options:A,async fn(e){var t,i;const{x:n,y:o,placement:g,middlewareData:a}=e,s=await GUe(e,A);return g===((t=a.offset)==null?void 0:t.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:n+s.x,y:o+s.y,data:{...s,placement:g}}}}},JUe=function(A){return A===void 0&&(A={}),{name:"shift",options:A,async fn(e){const{x:t,y:i,placement:n}=e,{mainAxis:o=!0,crossAxis:g=!1,limiter:a={fn:u=>{let{x:d,y:f}=u;return{x:d,y:f}}},...s}=Vu(A,e),I={x:t,y:i},r=await JF(e,s),C=wk(Xu(n)),l=DnA(C);let c=I[l],B=I[C];if(o){const u=l==="y"?"top":"left",d=l==="y"?"bottom":"right",f=c+r[u],w=c-r[d];c=wnA(f,c,w)}if(g){const u=C==="y"?"top":"left",d=C==="y"?"bottom":"right",f=B+r[u],w=B-r[d];B=wnA(f,B,w)}const E=a.fn({...e,[l]:c,[C]:B});return{...E,data:{x:E.x-t,y:E.y-i}}}}},NUe=function(A){return A===void 0&&(A={}),{options:A,fn(e){const{x:t,y:i,placement:n,rects:o,middlewareData:g}=e,{offset:a=0,mainAxis:s=!0,crossAxis:I=!0}=Vu(A,e),r={x:t,y:i},C=wk(n),l=DnA(C);let c=r[l],B=r[C];const E=Vu(a,e),u=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(s){const w=l==="y"?"height":"width",y=o.reference[l]-o.floating[w]+u.mainAxis,G=o.reference[l]+o.reference[w]-u.mainAxis;c<y?c=y:c>G&&(c=G)}if(I){var d,f;const w=l==="y"?"width":"height",y=["top","left"].includes(Xu(n)),G=o.reference[C]-o.floating[w]+(y&&((d=g.offset)==null?void 0:d[C])||0)+(y?0:u.crossAxis),R=o.reference[C]+o.reference[w]+(y?0:((f=g.offset)==null?void 0:f[C])||0)-(y?u.crossAxis:0);B<G?B=G:B>R&&(B=R)}return{[l]:c,[C]:B}}}},YUe=function(A){return A===void 0&&(A={}),{name:"size",options:A,async fn(e){const{placement:t,rects:i,platform:n,elements:o}=e,{apply:g=()=>{},...a}=Vu(A,e),s=await JF(e,a),I=Xu(t),r=bk(t),C=wk(t)==="y",{width:l,height:c}=i.floating;let B,E;I==="top"||I==="bottom"?(B=I,E=r===(await(n.isRTL==null?void 0:n.isRTL(o.floating))?"start":"end")?"left":"right"):(E=I,B=r==="end"?"top":"bottom");const u=c-s[B],d=l-s[E],f=!e.middlewareData.shift;let w=u,y=d;if(C){const R=l-s.left-s.right;y=r||f?Wm(d,R):R}else{const R=c-s.top-s.bottom;w=r||f?Wm(u,R):R}if(f&&!r){const R=hI(s.left,0),x=hI(s.right,0),F=hI(s.top,0),Q=hI(s.bottom,0);C?y=l-2*(R!==0||x!==0?R+x:hI(s.left,s.right)):w=c-2*(F!==0||Q!==0?F+Q:hI(s.top,s.bottom))}await g({...e,availableWidth:y,availableHeight:w});const G=await n.getDimensions(o.floating);return l!==G.width||c!==G.height?{reset:{rects:!0}}:{}}}};function Um(A){return gLA(A)?(A.nodeName||"").toLowerCase():"#document"}function mI(A){var e;return(A==null||(e=A.ownerDocument)==null?void 0:e.defaultView)||window}function zu(A){var e;return(e=(gLA(A)?A.ownerDocument:A.document)||window.document)==null?void 0:e.documentElement}function gLA(A){return A instanceof Node||A instanceof mI(A).Node}function Tu(A){return A instanceof Element||A instanceof mI(A).Element}function gQ(A){return A instanceof HTMLElement||A instanceof mI(A).HTMLElement}function aLA(A){return typeof ShadowRoot>"u"?!1:A instanceof ShadowRoot||A instanceof mI(A).ShadowRoot}function NF(A){const{overflow:e,overflowX:t,overflowY:i,display:n}=XC(A);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(n)}function RUe(A){return["table","td","th"].includes(Um(A))}function NnA(A){const e=YnA(),t=XC(A);return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(t.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(t.contain||"").includes(i))}function sLA(A){let e=Dk(A);for(;gQ(e)&&!eX(e);){if(NnA(e))return e;e=Dk(e)}return null}function YnA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function eX(A){return["html","body","#document"].includes(Um(A))}function XC(A){return mI(A).getComputedStyle(A)}function tX(A){return Tu(A)?{scrollLeft:A.scrollLeft,scrollTop:A.scrollTop}:{scrollLeft:A.pageXOffset,scrollTop:A.pageYOffset}}function Dk(A){if(Um(A)==="html")return A;const e=A.assignedSlot||A.parentNode||aLA(A)&&A.host||zu(A);return aLA(e)?e.host:e}function rLA(A){const e=Dk(A);return eX(e)?A.ownerDocument?A.ownerDocument.body:A.body:gQ(e)&&NF(e)?e:rLA(e)}function YF(A,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const n=rLA(A),o=n===((i=A.ownerDocument)==null?void 0:i.body),g=mI(n);return o?e.concat(g,g.visualViewport||[],NF(n)?n:[],g.frameElement&&t?YF(g.frameElement):[]):e.concat(n,YF(n,[],t))}function ILA(A){const e=XC(A);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const n=gQ(A),o=n?A.offsetWidth:t,g=n?A.offsetHeight:i,a=jV(t)!==o||jV(i)!==g;return a&&(t=o,i=g),{width:t,height:i,$:a}}function RnA(A){return Tu(A)?A:A.contextElement}function Gk(A){const e=RnA(A);if(!gQ(e))return Km(1);const t=e.getBoundingClientRect(),{width:i,height:n,$:o}=ILA(e);let g=(o?jV(t.width):t.width)/i,a=(o?jV(t.height):t.height)/n;return(!g||!Number.isFinite(g))&&(g=1),(!a||!Number.isFinite(a))&&(a=1),{x:g,y:a}}const xUe=Km(0);function CLA(A){const e=mI(A);return!YnA()||!e.visualViewport?xUe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function FUe(A,e,t){return e===void 0&&(e=!1),!t||e&&t!==mI(A)?!1:e}function Yy(A,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const n=A.getBoundingClientRect(),o=RnA(A);let g=Km(1);e&&(i?Tu(i)&&(g=Gk(i)):g=Gk(A));const a=FUe(o,t,i)?CLA(o):Km(0);let s=(n.left+a.x)/g.x,I=(n.top+a.y)/g.y,r=n.width/g.x,C=n.height/g.y;if(o){const l=mI(o),c=i&&Tu(i)?mI(i):i;let B=l.frameElement;for(;B&&i&&c!==l;){const E=Gk(B),u=B.getBoundingClientRect(),d=XC(B),f=u.left+(B.clientLeft+parseFloat(d.paddingLeft))*E.x,w=u.top+(B.clientTop+parseFloat(d.paddingTop))*E.y;s*=E.x,I*=E.y,r*=E.x,C*=E.y,s+=f,I+=w,B=mI(B).frameElement}}return AX({width:r,height:C,x:s,y:I})}const MUe=[":popover-open",":modal"];function lLA(A){let e=!1,t=0,i=0;function n(o){try{e=e||A.matches(o)}catch{}}if(MUe.forEach(o=>{n(o)}),e){const o=sLA(A);if(o){const g=o.getBoundingClientRect();t=g.x,i=g.y}}return[e,t,i]}function vUe(A){let{elements:e,rect:t,offsetParent:i,strategy:n}=A;const o=zu(i),[g]=e?lLA(e.floating):[!1];if(i===o||g)return t;let a={scrollLeft:0,scrollTop:0},s=Km(1);const I=Km(0),r=gQ(i);if((r||!r&&n!=="fixed")&&((Um(i)!=="body"||NF(o))&&(a=tX(i)),gQ(i))){const C=Yy(i);s=Gk(i),I.x=C.x+i.clientLeft,I.y=C.y+i.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+I.x,y:t.y*s.y-a.scrollTop*s.y+I.y}}function LUe(A){return Array.from(A.getClientRects())}function cLA(A){return Yy(zu(A)).left+tX(A).scrollLeft}function SUe(A){const e=zu(A),t=tX(A),i=A.ownerDocument.body,n=hI(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=hI(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let g=-t.scrollLeft+cLA(A);const a=-t.scrollTop;return XC(i).direction==="rtl"&&(g+=hI(e.clientWidth,i.clientWidth)-n),{width:n,height:o,x:g,y:a}}function HUe(A,e){const t=mI(A),i=zu(A),n=t.visualViewport;let o=i.clientWidth,g=i.clientHeight,a=0,s=0;if(n){o=n.width,g=n.height;const I=YnA();(!I||I&&e==="fixed")&&(a=n.offsetLeft,s=n.offsetTop)}return{width:o,height:g,x:a,y:s}}function ZUe(A,e){const t=Yy(A,!0,e==="fixed"),i=t.top+A.clientTop,n=t.left+A.clientLeft,o=gQ(A)?Gk(A):Km(1),g=A.clientWidth*o.x,a=A.clientHeight*o.y,s=n*o.x,I=i*o.y;return{width:g,height:a,x:s,y:I}}function BLA(A,e,t){let i;if(e==="viewport")i=HUe(A,t);else if(e==="document")i=SUe(zu(A));else if(Tu(e))i=ZUe(e,t);else{const n=CLA(A);i={...e,x:e.x-n.x,y:e.y-n.y}}return AX(i)}function QLA(A,e){const t=Dk(A);return t===e||!Tu(t)||eX(t)?!1:XC(t).position==="fixed"||QLA(t,e)}function WUe(A,e){const t=e.get(A);if(t)return t;let i=YF(A,[],!1).filter(a=>Tu(a)&&Um(a)!=="body"),n=null;const o=XC(A).position==="fixed";let g=o?Dk(A):A;for(;Tu(g)&&!eX(g);){const a=XC(g),s=NnA(g);!s&&a.position==="fixed"&&(n=null),(o?!s&&!n:!s&&a.position==="static"&&n&&["absolute","fixed"].includes(n.position)||NF(g)&&!s&&QLA(A,g))?i=i.filter(I=>I!==g):n=a,g=Dk(g)}return e.set(A,i),i}function KUe(A){let{element:e,boundary:t,rootBoundary:i,strategy:n}=A;const o=[...t==="clippingAncestors"?WUe(e,this._c):[].concat(t),i],g=o[0],a=o.reduce((s,I)=>{const r=BLA(e,I,n);return s.top=hI(r.top,s.top),s.right=Wm(r.right,s.right),s.bottom=Wm(r.bottom,s.bottom),s.left=hI(r.left,s.left),s},BLA(e,g,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function UUe(A){const{width:e,height:t}=ILA(A);return{width:e,height:t}}function VUe(A,e,t,i){const n=gQ(e),o=zu(e),g=t==="fixed",a=Yy(A,!0,g,e);let s={scrollLeft:0,scrollTop:0};const I=Km(0);if(n||!n&&!g)if((Um(e)!=="body"||NF(o))&&(s=tX(e)),n){const E=Yy(e,!0,g,e);I.x=E.x+e.clientLeft,I.y=E.y+e.clientTop}else o&&(I.x=cLA(o));let r=a.left+s.scrollLeft-I.x,C=a.top+s.scrollTop-I.y;const[l,c,B]=lLA(i);return l&&(r+=c,C+=B,n&&(r+=e.clientLeft,C+=e.clientTop)),{x:r,y:C,width:a.width,height:a.height}}function ELA(A,e){return!gQ(A)||XC(A).position==="fixed"?null:e?e(A):A.offsetParent}function uLA(A,e){const t=mI(A);if(!gQ(A))return t;let i=ELA(A,e);for(;i&&RUe(i)&&XC(i).position==="static";)i=ELA(i,e);return i&&(Um(i)==="html"||Um(i)==="body"&&XC(i).position==="static"&&!NnA(i))?t:i||sLA(A)||t}const XUe=async function(A){const e=this.getOffsetParent||uLA,t=this.getDimensions;return{reference:VUe(A.reference,await e(A.floating),A.strategy,A.floating),floating:{x:0,y:0,...await t(A.floating)}}};function zUe(A){return XC(A).direction==="rtl"}const TUe={convertOffsetParentRelativeRectToViewportRelativeRect:vUe,getDocumentElement:zu,getClippingRect:KUe,getOffsetParent:uLA,getElementRects:XUe,getClientRects:LUe,getDimensions:UUe,getScale:Gk,isElement:Tu,isRTL:zUe};function _Ue(A,e){let t=null,i;const n=zu(A);function o(){var a;clearTimeout(i),(a=t)==null||a.disconnect(),t=null}function g(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),o();const{left:I,top:r,width:C,height:l}=A.getBoundingClientRect();if(a||e(),!C||!l)return;const c=PV(r),B=PV(n.clientWidth-(I+C)),E=PV(n.clientHeight-(r+l)),u=PV(I),d={rootMargin:-c+"px "+-B+"px "+-E+"px "+-u+"px",threshold:hI(0,Wm(1,s))||1};let f=!0;function w(y){const G=y[0].intersectionRatio;if(G!==s){if(!f)return g();G?g(!1,G):i=setTimeout(()=>{g(!1,1e-7)},100)}f=!1}try{t=new IntersectionObserver(w,{...d,root:n.ownerDocument})}catch{t=new IntersectionObserver(w,d)}t.observe(A)}return g(!0),o}function OUe(A,e,t,i){i===void 0&&(i={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:g=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=i,I=RnA(A),r=n||o?[...I?YF(I):[],...YF(e)]:[];r.forEach(d=>{n&&d.addEventListener("scroll",t,{passive:!0}),o&&d.addEventListener("resize",t)});const C=I&&a?_Ue(I,t):null;let l=-1,c=null;g&&(c=new ResizeObserver(d=>{let[f]=d;f&&f.target===I&&c&&(c.unobserve(e),cancelAnimationFrame(l),l=requestAnimationFrame(()=>{var w;(w=c)==null||w.observe(e)})),t()}),I&&!s&&c.observe(I),c.observe(e));let B,E=s?Yy(A):null;s&&u();function u(){const d=Yy(A);E&&(d.x!==E.x||d.y!==E.y||d.width!==E.width||d.height!==E.height)&&t(),E=d,B=requestAnimationFrame(u)}return t(),()=>{var d;r.forEach(f=>{n&&f.removeEventListener("scroll",t),o&&f.removeEventListener("resize",t)}),C==null||C(),(d=c)==null||d.disconnect(),c=null,s&&cancelAnimationFrame(B)}}const qUe=JUe,jUe=wUe,PUe=YUe,$Ue=DUe,dLA=bUe,AVe=NUe,eVe=(A,e,t)=>{const i=new Map,n={platform:TUe,...t},o={...n.platform,_c:i};return yUe(A,e,{...n,platform:o})},tVe=A=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:A,fn(t){const{element:i,padding:n}=typeof A=="function"?A(t):A;return i&&e(i)?i.current!=null?dLA({element:i.current,padding:n}).fn(t):{}:i?dLA({element:i,padding:n}).fn(t):{}}}};var iX=typeof document<"u"?p.useLayoutEffect:p.useEffect;function nX(A,e){if(A===e)return!0;if(typeof A!=typeof e)return!1;if(typeof A=="function"&&A.toString()===e.toString())return!0;let t,i,n;if(A&&e&&typeof A=="object"){if(Array.isArray(A)){if(t=A.length,t!==e.length)return!1;for(i=t;i--!==0;)if(!nX(A[i],e[i]))return!1;return!0}if(n=Object.keys(A),t=n.length,t!==Object.keys(e).length)return!1;for(i=t;i--!==0;)if(!{}.hasOwnProperty.call(e,n[i]))return!1;for(i=t;i--!==0;){const o=n[i];if(!(o==="_owner"&&A.$$typeof)&&!nX(A[o],e[o]))return!1}return!0}return A!==A&&e!==e}function hLA(A){return typeof window>"u"?1:(A.ownerDocument.defaultView||window).devicePixelRatio||1}function mLA(A,e){const t=hLA(A);return Math.round(e*t)/t}function pLA(A){const e=p.useRef(A);return iX(()=>{e.current=A}),e}function iVe(A){A===void 0&&(A={});const{placement:e="bottom",strategy:t="absolute",middleware:i=[],platform:n,elements:{reference:o,floating:g}={},transform:a=!0,whileElementsMounted:s,open:I}=A,[r,C]=p.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[l,c]=p.useState(i);nX(l,i)||c(i);const[B,E]=p.useState(null),[u,d]=p.useState(null),f=p.useCallback(X=>{X!==R.current&&(R.current=X,E(X))},[]),w=p.useCallback(X=>{X!==x.current&&(x.current=X,d(X))},[]),y=o||B,G=g||u,R=p.useRef(null),x=p.useRef(null),F=p.useRef(r),Q=s!=null,k=pLA(s),h=pLA(n),N=p.useCallback(()=>{if(!R.current||!x.current)return;const X={placement:e,strategy:t,middleware:l};h.current&&(X.platform=h.current),eVe(R.current,x.current,X).then(_=>{const q={..._,isPositioned:!0};v.current&&!nX(F.current,q)&&(F.current=q,bt.flushSync(()=>{C(q)}))})},[l,e,t,h]);iX(()=>{I===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,C(X=>({...X,isPositioned:!1})))},[I]);const v=p.useRef(!1);iX(()=>(v.current=!0,()=>{v.current=!1}),[]),iX(()=>{if(y&&(R.current=y),G&&(x.current=G),y&&G){if(k.current)return k.current(y,G,N);N()}},[y,G,N,k,Q]);const K=p.useMemo(()=>({reference:R,floating:x,setReference:f,setFloating:w}),[f,w]),U=p.useMemo(()=>({reference:y,floating:G}),[y,G]),V=p.useMemo(()=>{const X={position:t,left:0,top:0};if(!U.floating)return X;const _=mLA(U.floating,r.x),q=mLA(U.floating,r.y);return a?{...X,transform:"translate("+_+"px, "+q+"px)",...hLA(U.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:_,top:q}},[t,a,U.floating,r.x,r.y]);return p.useMemo(()=>({...r,update:N,refs:K,elements:U,floatingStyles:V}),[r,N,K,U,V])}var nVe="Arrow",fLA=p.forwardRef((A,e)=>{const{children:t,width:i=10,height:n=5,...o}=A;return cA(re.svg,{...o,ref:e,width:i,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:A.asChild?t:cA("polygon",{points:"0,0 30,0 15,10"})})});fLA.displayName=nVe;var oVe=fLA,xnA="Popper",[yLA,aQ]=Tg(xnA),[gVe,bLA]=yLA(xnA),wLA=A=>{const{__scopePopper:e,children:t}=A,[i,n]=p.useState(null);return cA(gVe,{scope:e,anchor:i,onAnchorChange:n,children:t})};wLA.displayName=xnA;var DLA="PopperAnchor",GLA=p.forwardRef((A,e)=>{const{__scopePopper:t,virtualRef:i,...n}=A,o=bLA(DLA,t),g=p.useRef(null),a=Te(e,g),s=p.useRef(null);return p.useEffect(()=>{const I=s.current;s.current=(i==null?void 0:i.current)||g.current,I!==s.current&&o.onAnchorChange(s.current)}),i?null:cA(re.div,{...n,ref:a})});GLA.displayName=DLA;var FnA="PopperContent",[aVe,sVe]=yLA(FnA),kLA=p.forwardRef((A,e)=>{var t,i,n,o,g,a;const{__scopePopper:s,side:I="bottom",sideOffset:r=0,align:C="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:B=!0,collisionBoundary:E=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:w="optimized",onPlaced:y,...G}=A,R=bLA(FnA,s),[x,F]=p.useState(null),Q=Te(e,QA=>F(QA)),[k,h]=p.useState(null),N=cF(k),v=(N==null?void 0:N.width)??0,K=(N==null?void 0:N.height)??0,U=I+(C!=="center"?"-"+C:""),V=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},X=Array.isArray(E)?E:[E],_=X.length>0,q={padding:V,boundary:X.filter(IVe),altBoundary:_},{refs:$,floatingStyles:nA,placement:j,isPositioned:O,middlewareData:eA}=iVe({strategy:"fixed",placement:U,whileElementsMounted:(...QA)=>OUe(...QA,{animationFrame:w==="always"}),elements:{reference:R.anchor},middleware:[kUe({mainAxis:r+K,alignmentAxis:l}),B&&qUe({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?AVe():void 0,...q}),B&&jUe({...q}),PUe({...q,apply:({elements:QA,rects:uA,availableWidth:fA,availableHeight:hA})=>{const{width:yA,height:mA}=uA.reference,LA=QA.floating.style;LA.setProperty("--radix-popper-available-width",`${fA}px`),LA.setProperty("--radix-popper-available-height",`${hA}px`),LA.setProperty("--radix-popper-anchor-width",`${yA}px`),LA.setProperty("--radix-popper-anchor-height",`${mA}px`)}}),k&&tVe({element:k,padding:c}),CVe({arrowWidth:v,arrowHeight:K}),f&&$Ue({strategy:"referenceHidden",...q})]}),[oA,tA]=YLA(j),sA=oQ(y);_g(()=>{O&&(sA==null||sA())},[O,sA]);const gA=(t=eA.arrow)==null?void 0:t.x,iA=(i=eA.arrow)==null?void 0:i.y,aA=((n=eA.arrow)==null?void 0:n.centerOffset)!==0,[lA,CA]=p.useState();return _g(()=>{x&&CA(window.getComputedStyle(x).zIndex)},[x]),cA("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...nA,transform:O?nA.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:lA,"--radix-popper-transform-origin":[(o=eA.transformOrigin)==null?void 0:o.x,(g=eA.transformOrigin)==null?void 0:g.y].join(" "),...((a=eA.hide)==null?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:A.dir,children:cA(aVe,{scope:s,placedSide:oA,onArrowChange:h,arrowX:gA,arrowY:iA,shouldHideArrow:aA,children:cA(re.div,{"data-side":oA,"data-align":tA,...G,ref:Q,style:{...G.style,animation:O?void 0:"none"}})})})});kLA.displayName=FnA;var JLA="PopperArrow",rVe={top:"bottom",right:"left",bottom:"top",left:"right"},NLA=p.forwardRef(function(A,e){const{__scopePopper:t,...i}=A,n=sVe(JLA,t),o=rVe[n.placedSide];return cA("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0},children:cA(oVe,{...i,ref:e,style:{...i.style,display:"block"}})})});NLA.displayName=JLA;function IVe(A){return A!==null}var CVe=A=>({name:"transformOrigin",options:A,fn(e){var t,i,n;const{placement:o,rects:g,middlewareData:a}=e,s=((t=a.arrow)==null?void 0:t.centerOffset)!==0,I=s?0:A.arrowWidth,r=s?0:A.arrowHeight,[C,l]=YLA(o),c={start:"0%",center:"50%",end:"100%"}[l],B=(((i=a.arrow)==null?void 0:i.x)??0)+I/2,E=(((n=a.arrow)==null?void 0:n.y)??0)+r/2;let u="",d="";return C==="bottom"?(u=s?c:`${B}px`,d=`${-r}px`):C==="top"?(u=s?c:`${B}px`,d=`${g.floating.height+r}px`):C==="right"?(u=`${-r}px`,d=s?c:`${E}px`):C==="left"&&(u=`${g.floating.width+r}px`,d=s?c:`${E}px`),{data:{x:u,y:d}}}});function YLA(A){const[e,t="center"]=A.split("-");return[e,t]}var RF=wLA,kk=GLA,xF=kLA,FF=NLA,lVe="Portal",Jk=p.forwardRef((A,e)=>{var t;const{container:i,...n}=A,[o,g]=p.useState(!1);_g(()=>g(!0),[]);const a=i||o&&((t=globalThis==null?void 0:globalThis.document)==null?void 0:t.body);return a?bP.createPortal(cA(re.div,{...n,ref:e}),a):null});Jk.displayName=lVe;function cVe(A,e){return p.useReducer((t,i)=>e[t][i]??t,A)}var qg=A=>{const{present:e,children:t}=A,i=BVe(e),n=typeof t=="function"?t({present:i.isPresent}):p.Children.only(t),o=Te(i.ref,QVe(n));return typeof t=="function"||i.isPresent?p.cloneElement(n,{ref:o}):null};qg.displayName="Presence";function BVe(A){const[e,t]=p.useState(),i=p.useRef(null),n=p.useRef(A),o=p.useRef("none"),g=A?"mounted":"unmounted",[a,s]=cVe(g,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const I=oX(i.current);o.current=a==="mounted"?I:"none"},[a]),_g(()=>{const I=i.current,r=n.current;if(r!==A){const C=o.current,l=oX(I);A?s("MOUNT"):l==="none"||(I==null?void 0:I.display)==="none"?s("UNMOUNT"):s(r&&C!==l?"ANIMATION_OUT":"UNMOUNT"),n.current=A}},[A,s]),_g(()=>{if(e){let I;const r=e.ownerDocument.defaultView??window,C=c=>{const B=oX(i.current).includes(CSS.escape(c.animationName));if(c.target===e&&B&&(s("ANIMATION_END"),!n.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",I=r.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},l=c=>{c.target===e&&(o.current=oX(i.current))};return e.addEventListener("animationstart",l),e.addEventListener("animationcancel",C),e.addEventListener("animationend",C),()=>{r.clearTimeout(I),e.removeEventListener("animationstart",l),e.removeEventListener("animationcancel",C),e.removeEventListener("animationend",C)}}else s("ANIMATION_END")},[e,s]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(I=>{i.current=I?getComputedStyle(I):null,t(I)},[])}}function oX(A){return(A==null?void 0:A.animationName)||"none"}function QVe(A){var e,t;let i=(e=Object.getOwnPropertyDescriptor(A.props,"ref"))==null?void 0:e.get,n=i&&"isReactWarning"in i&&i.isReactWarning;return n?A.ref:(i=(t=Object.getOwnPropertyDescriptor(A,"ref"))==null?void 0:t.get,n=i&&"isReactWarning"in i&&i.isReactWarning,n?A.props.ref:A.props.ref||A.ref)}var EVe=function(A){if(typeof document>"u")return null;var e=Array.isArray(A)?A[0]:A;return e.ownerDocument.body},Nk=new WeakMap,gX=new WeakMap,aX={},MnA=0,RLA=function(A){return A&&(A.host||RLA(A.parentNode))},uVe=function(A,e){return e.map(function(t){if(A.contains(t))return t;var i=RLA(t);return i&&A.contains(i)?i:(console.error("aria-hidden",t,"in not contained inside",A,". Doing nothing"),null)}).filter(function(t){return!!t})},dVe=function(A,e,t,i){var n=uVe(e,Array.isArray(A)?A:[A]);aX[t]||(aX[t]=new WeakMap);var o=aX[t],g=[],a=new Set,s=new Set(n),I=function(C){!C||a.has(C)||(a.add(C),I(C.parentNode))};n.forEach(I);var r=function(C){!C||s.has(C)||Array.prototype.forEach.call(C.children,function(l){if(a.has(l))r(l);else try{var c=l.getAttribute(i),B=c!==null&&c!=="false",E=(Nk.get(l)||0)+1,u=(o.get(l)||0)+1;Nk.set(l,E),o.set(l,u),g.push(l),E===1&&B&&gX.set(l,!0),u===1&&l.setAttribute(t,"true"),B||l.setAttribute(i,"true")}catch(d){console.error("aria-hidden: cannot operate on ",l,d)}})};return r(e),a.clear(),MnA++,function(){g.forEach(function(C){var l=Nk.get(C)-1,c=o.get(C)-1;Nk.set(C,l),o.set(C,c),l||(gX.has(C)||C.removeAttribute(i),gX.delete(C)),c||C.removeAttribute(t)}),MnA--,MnA||(Nk=new WeakMap,Nk=new WeakMap,gX=new WeakMap,aX={})}},sX=function(A,e,t){t===void 0&&(t="data-aria-hidden");var i=Array.from(Array.isArray(A)?A:[A]),n=e||EVe(A);return n?(i.push.apply(i,Array.from(n.querySelectorAll("[aria-live], script"))),dVe(i,n,t,"aria-hidden")):function(){return null}},Vm=function(){return Vm=Object.assign||function(A){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(A[n]=e[n])}return A},Vm.apply(this,arguments)};function hVe(A,e){var t={};for(var i in A)Object.prototype.hasOwnProperty.call(A,i)&&e.indexOf(i)<0&&(t[i]=A[i]);if(A!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(A);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(A,i[n])&&(t[i[n]]=A[i[n]]);return t}function mVe(A,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,o;i<n;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return A.concat(o||Array.prototype.slice.call(e))}var rX="right-scroll-bar-position",IX="width-before-scroll-bar",pVe="with-scroll-bars-hidden",fVe="--removed-body-scroll-bar-size";function vnA(A,e){return typeof A=="function"?A(e):A&&(A.current=e),A}function yVe(A,e){var t=p.useState(function(){return{value:A,callback:e,facade:{get current(){return t.value},set current(i){var n=t.value;n!==i&&(t.value=i,t.callback(i,n))}}}})[0];return t.callback=e,t.facade}var bVe=typeof window<"u"?p.useLayoutEffect:p.useEffect,xLA=new WeakMap;function wVe(A,e){var t=yVe(e||null,function(i){return A.forEach(function(n){return vnA(n,i)})});return bVe(function(){var i=xLA.get(t);if(i){var n=new Set(i),o=new Set(A),g=t.current;n.forEach(function(a){o.has(a)||vnA(a,null)}),o.forEach(function(a){n.has(a)||vnA(a,g)})}xLA.set(t,A)},[A]),t}var CX=function(){return CX=Object.assign||function(A){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(A[n]=e[n])}return A},CX.apply(this,arguments)};function DVe(A,e){var t={};for(var i in A)Object.prototype.hasOwnProperty.call(A,i)&&e.indexOf(i)<0&&(t[i]=A[i]);if(A!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(A);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(A,i[n])&&(t[i[n]]=A[i[n]]);return t}function Yk(A,e,t,i){function n(o){return o instanceof t?o:new t(function(g){g(o)})}return new(t||(t=Promise))(function(o,g){function a(r){try{I(i.next(r))}catch(C){g(C)}}function s(r){try{I(i.throw(r))}catch(C){g(C)}}function I(r){r.done?o(r.value):n(r.value).then(a,s)}I((i=i.apply(A,e||[])).next())})}function Rk(A,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,g;return g={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function a(I){return function(r){return s([I,r])}}function s(I){if(i)throw new TypeError("Generator is already executing.");for(;g&&(g=0,I[0]&&(t=0)),t;)try{if(i=1,n&&(o=I[0]&2?n.return:I[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,I[1])).done)return o;switch(n=0,o&&(I=[I[0]&2,o.value]),I[0]){case 0:case 1:o=I;break;case 4:return t.label++,{value:I[1],done:!1};case 5:t.label++,n=I[1],I=[0];continue;case 7:I=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(I[0]===6||I[0]===2)){t=0;continue}if(I[0]===3&&(!o||I[1]>o[0]&&I[1]<o[3])){t.label=I[1];break}if(I[0]===6&&t.label<o[1]){t.label=o[1],o=I;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(I);break}o[2]&&t.ops.pop(),t.trys.pop();continue}I=e.call(A,t)}catch(r){I=[6,r],n=0}finally{i=o=0}if(I[0]&5)throw I[1];return{value:I[0]?I[1]:void 0,done:!0}}}function FLA(A,e){var t=typeof Symbol=="function"&&A[Symbol.iterator];if(!t)return A;var i=t.call(A),n,o=[],g;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(a){g={error:a}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(g)throw g.error}}return o}function MLA(A,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,o;i<n;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return A.concat(o||Array.prototype.slice.call(e))}function GVe(A){return A}function kVe(A,e){e===void 0&&(e=GVe);var t=[],i=!1,n={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:A},useMedium:function(o){var g=e(o,i);return t.push(g),function(){t=t.filter(function(a){return a!==g})}},assignSyncMedium:function(o){for(i=!0;t.length;){var g=t;t=[],g.forEach(o)}t={push:function(a){return o(a)},filter:function(){return t}}},assignMedium:function(o){i=!0;var g=[];if(t.length){var a=t;t=[],a.forEach(o),g=t}var s=function(){var r=g;g=[],r.forEach(o)},I=function(){return Promise.resolve().then(s)};I(),t={push:function(r){g.push(r),I()},filter:function(r){return g=g.filter(r),t}}}};return n}function JVe(A){A===void 0&&(A={});var e=kVe(null);return e.options=CX({async:!0,ssr:!1},A),e}var vLA=function(A){var e=A.sideCar,t=DVe(A,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return p.createElement(i,CX({},t))};vLA.isSideCarExport=!0;function NVe(A,e){return A.useMedium(e),vLA}var LLA=JVe(),LnA=function(){},lX=p.forwardRef(function(A,e){var t=p.useRef(null),i=p.useState({onScrollCapture:LnA,onWheelCapture:LnA,onTouchMoveCapture:LnA}),n=i[0],o=i[1],g=A.forwardProps,a=A.children,s=A.className,I=A.removeScrollBar,r=A.enabled,C=A.shards,l=A.sideCar,c=A.noRelative,B=A.noIsolation,E=A.inert,u=A.allowPinchZoom,d=A.as,f=d===void 0?"div":d,w=A.gapMode,y=hVe(A,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),G=l,R=wVe([t,e]),x=Vm(Vm({},y),n);return p.createElement(p.Fragment,null,r&&p.createElement(G,{sideCar:LLA,removeScrollBar:I,shards:C,noRelative:c,noIsolation:B,inert:E,setCallbacks:o,allowPinchZoom:!!u,lockRef:t,gapMode:w}),g?p.cloneElement(p.Children.only(a),Vm(Vm({},x),{ref:R})):p.createElement(f,Vm({},x,{className:s,ref:R}),a))});lX.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lX.classNames={fullWidth:IX,zeroRight:rX};var YVe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function RVe(){if(!document)return null;var A=document.createElement("style");A.type="text/css";var e=YVe();return e&&A.setAttribute("nonce",e),A}function xVe(A,e){A.styleSheet?A.styleSheet.cssText=e:A.appendChild(document.createTextNode(e))}function FVe(A){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(A)}var MVe=function(){var A=0,e=null;return{add:function(t){A==0&&(e=RVe())&&(xVe(e,t),FVe(e)),A++},remove:function(){A--,!A&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},vVe=function(){var A=MVe();return function(e,t){p.useEffect(function(){return A.add(e),function(){A.remove()}},[e&&t])}},SLA=function(){var A=vVe(),e=function(t){var i=t.styles,n=t.dynamic;return A(i,n),null};return e},LVe={left:0,top:0,right:0,gap:0},SnA=function(A){return parseInt(A||"",10)||0},SVe=function(A){var e=window.getComputedStyle(document.body),t=e[A==="padding"?"paddingLeft":"marginLeft"],i=e[A==="padding"?"paddingTop":"marginTop"],n=e[A==="padding"?"paddingRight":"marginRight"];return[SnA(t),SnA(i),SnA(n)]},HVe=function(A){if(A===void 0&&(A="margin"),typeof window>"u")return LVe;var e=SVe(A),t=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-t+e[2]-e[0])}},ZVe=SLA(),xk="data-scroll-locked",WVe=function(A,e,t,i){var n=A.left,o=A.top,g=A.right,a=A.gap;return t===void 0&&(t="margin"),`
  .`.concat(pVe,` {
   overflow: hidden `).concat(i,`;
   padding-right: `).concat(a,"px ").concat(i,`;
  }
  body[`).concat(xk,`] {
    overflow: hidden `).concat(i,`;
    overscroll-behavior: contain;
    `).concat([e&&"position: relative ".concat(i,";"),t==="margin"&&`
    padding-left: `.concat(n,`px;
    padding-top: `).concat(o,`px;
    padding-right: `).concat(g,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(a,"px ").concat(i,`;
    `),t==="padding"&&"padding-right: ".concat(a,"px ").concat(i,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(rX,` {
    right: `).concat(a,"px ").concat(i,`;
  }
  
  .`).concat(IX,` {
    margin-right: `).concat(a,"px ").concat(i,`;
  }
  
  .`).concat(rX," .").concat(rX,` {
    right: 0 `).concat(i,`;
  }
  
  .`).concat(IX," .").concat(IX,` {
    margin-right: 0 `).concat(i,`;
  }
  
  body[`).concat(xk,`] {
    `).concat(fVe,": ").concat(a,`px;
  }
`)},HLA=function(){var A=parseInt(document.body.getAttribute(xk)||"0",10);return isFinite(A)?A:0},KVe=function(){p.useEffect(function(){return document.body.setAttribute(xk,(HLA()+1).toString()),function(){var A=HLA()-1;A<=0?document.body.removeAttribute(xk):document.body.setAttribute(xk,A.toString())}},[])},UVe=function(A){var e=A.noRelative,t=A.noImportant,i=A.gapMode,n=i===void 0?"margin":i;KVe();var o=p.useMemo(function(){return HVe(n)},[n]);return p.createElement(ZVe,{styles:WVe(o,!e,n,t?"":"!important")})},HnA=!1;if(typeof window<"u")try{var cX=Object.defineProperty({},"passive",{get:function(){return HnA=!0,!0}});window.addEventListener("test",cX,cX),window.removeEventListener("test",cX,cX)}catch{HnA=!1}var Fk=HnA?{passive:!1}:!1,VVe=function(A){return A.tagName==="TEXTAREA"},ZLA=function(A,e){if(!(A instanceof Element))return!1;var t=window.getComputedStyle(A);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!VVe(A)&&t[e]==="visible")},XVe=function(A){return ZLA(A,"overflowY")},zVe=function(A){return ZLA(A,"overflowX")},WLA=function(A,e){var t=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var n=KLA(A,i);if(n){var o=ULA(A,i),g=o[1],a=o[2];if(g>a)return!0}i=i.parentNode}while(i&&i!==t.body);return!1},TVe=function(A){var e=A.scrollTop,t=A.scrollHeight,i=A.clientHeight;return[e,t,i]},_Ve=function(A){var e=A.scrollLeft,t=A.scrollWidth,i=A.clientWidth;return[e,t,i]},KLA=function(A,e){return A==="v"?XVe(e):zVe(e)},ULA=function(A,e){return A==="v"?TVe(e):_Ve(e)},OVe=function(A,e){return A==="h"&&e==="rtl"?-1:1},qVe=function(A,e,t,i,n){var o=OVe(A,window.getComputedStyle(e).direction),g=o*i,a=t.target,s=e.contains(a),I=!1,r=g>0,C=0,l=0;do{if(!a)break;var c=ULA(A,a),B=c[0],E=c[1],u=c[2],d=E-u-o*B;(B||d)&&KLA(A,a)&&(C+=d,l+=B);var f=a.parentNode;a=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!s&&a!==document.body||s&&(e.contains(a)||e===a));return(r&&(n&&Math.abs(C)<1||!n&&g>C)||!r&&(n&&Math.abs(l)<1||!n&&-g>l))&&(I=!0),I},BX=function(A){return"changedTouches"in A?[A.changedTouches[0].clientX,A.changedTouches[0].clientY]:[0,0]},VLA=function(A){return[A.deltaX,A.deltaY]},XLA=function(A){return A&&"current"in A?A.current:A},jVe=function(A,e){return A[0]===e[0]&&A[1]===e[1]},PVe=function(A){return`
  .block-interactivity-`.concat(A,` {pointer-events: none;}
  .allow-interactivity-`).concat(A,` {pointer-events: all;}
`)},$Ve=0,Mk=[];function AXe(A){var e=p.useRef([]),t=p.useRef([0,0]),i=p.useRef(),n=p.useState($Ve++)[0],o=p.useState(SLA)[0],g=p.useRef(A);p.useEffect(function(){g.current=A},[A]),p.useEffect(function(){if(A.inert){document.body.classList.add("block-interactivity-".concat(n));var E=mVe([A.lockRef.current],(A.shards||[]).map(XLA),!0).filter(Boolean);return E.forEach(function(u){return u.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),E.forEach(function(u){return u.classList.remove("allow-interactivity-".concat(n))})}}},[A.inert,A.lockRef.current,A.shards]);var a=p.useCallback(function(E,u){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!g.current.allowPinchZoom;var d=BX(E),f=t.current,w="deltaX"in E?E.deltaX:f[0]-d[0],y="deltaY"in E?E.deltaY:f[1]-d[1],G,R=E.target,x=Math.abs(w)>Math.abs(y)?"h":"v";if("touches"in E&&x==="h"&&R.type==="range")return!1;var F=WLA(x,R);if(!F)return!0;if(F?G=x:(G=x==="v"?"h":"v",F=WLA(x,R)),!F)return!1;if(!i.current&&"changedTouches"in E&&(w||y)&&(i.current=G),!G)return!0;var Q=i.current||G;return qVe(Q,u,E,Q==="h"?w:y,!0)},[]),s=p.useCallback(function(E){var u=E;if(!(!Mk.length||Mk[Mk.length-1]!==o)){var d="deltaY"in u?VLA(u):BX(u),f=e.current.filter(function(G){return G.name===u.type&&(G.target===u.target||u.target===G.shadowParent)&&jVe(G.delta,d)})[0];if(f&&f.should){u.cancelable&&u.preventDefault();return}if(!f){var w=(g.current.shards||[]).map(XLA).filter(Boolean).filter(function(G){return G.contains(u.target)}),y=w.length>0?a(u,w[0]):!g.current.noIsolation;y&&u.cancelable&&u.preventDefault()}}},[]),I=p.useCallback(function(E,u,d,f){var w={name:E,delta:u,target:d,should:f,shadowParent:eXe(d)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(y){return y!==w})},1)},[]),r=p.useCallback(function(E){t.current=BX(E),i.current=void 0},[]),C=p.useCallback(function(E){I(E.type,VLA(E),E.target,a(E,A.lockRef.current))},[]),l=p.useCallback(function(E){I(E.type,BX(E),E.target,a(E,A.lockRef.current))},[]);p.useEffect(function(){return Mk.push(o),A.setCallbacks({onScrollCapture:C,onWheelCapture:C,onTouchMoveCapture:l}),document.addEventListener("wheel",s,Fk),document.addEventListener("touchmove",s,Fk),document.addEventListener("touchstart",r,Fk),function(){Mk=Mk.filter(function(E){return E!==o}),document.removeEventListener("wheel",s,Fk),document.removeEventListener("touchmove",s,Fk),document.removeEventListener("touchstart",r,Fk)}},[]);var c=A.removeScrollBar,B=A.inert;return p.createElement(p.Fragment,null,B?p.createElement(o,{styles:PVe(n)}):null,c?p.createElement(UVe,{noRelative:A.noRelative,gapMode:A.gapMode}):null)}function eXe(A){for(var e=null;A!==null;)A instanceof ShadowRoot&&(e=A.host,A=A.host),A=A.parentNode;return e}const tXe=NVe(LLA,AXe);var zLA=p.forwardRef(function(A,e){return p.createElement(lX,Vm({},A,{ref:e,sideCar:tXe}))});zLA.classNames=lX.classNames;const QX=zLA;var EX="Popover",[TLA,Zpi]=Tg(EX,[aQ]),MF=aQ(),[iXe,Xm]=TLA(EX),_LA=A=>{const{__scopePopover:e,children:t,open:i,defaultOpen:n,onOpenChange:o,modal:g=!1}=A,a=MF(e),s=p.useRef(null),[I,r]=p.useState(!1),[C,l]=is({prop:i,defaultProp:n??!1,onChange:o,caller:EX});return cA(RF,{...a,children:cA(iXe,{scope:e,contentId:_o(),triggerRef:s,open:C,onOpenChange:l,onOpenToggle:p.useCallback(()=>l(c=>!c),[l]),hasCustomAnchor:I,onCustomAnchorAdd:p.useCallback(()=>r(!0),[]),onCustomAnchorRemove:p.useCallback(()=>r(!1),[]),modal:g,children:t})})};_LA.displayName=EX;var OLA="PopoverAnchor",nXe=p.forwardRef((A,e)=>{const{__scopePopover:t,...i}=A,n=Xm(OLA,t),o=MF(t),{onCustomAnchorAdd:g,onCustomAnchorRemove:a}=n;return p.useEffect(()=>(g(),()=>a()),[g,a]),cA(kk,{...o,...i,ref:e})});nXe.displayName=OLA;var qLA="PopoverTrigger",jLA=p.forwardRef((A,e)=>{const{__scopePopover:t,...i}=A,n=Xm(qLA,t),o=MF(t),g=Te(e,n.triggerRef),a=cA(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":tSA(n.open),...i,ref:g,onClick:TA(A.onClick,n.onOpenToggle)});return n.hasCustomAnchor?a:cA(kk,{asChild:!0,...o,children:a})});jLA.displayName=qLA;var ZnA="PopoverPortal",[oXe,gXe]=TLA(ZnA,{forceMount:void 0}),PLA=A=>{const{__scopePopover:e,forceMount:t,children:i,container:n}=A,o=Xm(ZnA,e);return cA(oXe,{scope:e,forceMount:t,children:cA(qg,{present:t||o.open,children:cA(Jk,{asChild:!0,container:n,children:i})})})};PLA.displayName=ZnA;var vk="PopoverContent",$LA=p.forwardRef((A,e)=>{const t=gXe(vk,A.__scopePopover),{forceMount:i=t.forceMount,...n}=A,o=Xm(vk,A.__scopePopover);return cA(qg,{present:i||o.open,children:o.modal?cA(sXe,{...n,ref:e}):cA(rXe,{...n,ref:e})})});$LA.displayName=vk;var aXe=Ym("PopoverContent.RemoveScroll"),sXe=p.forwardRef((A,e)=>{const t=Xm(vk,A.__scopePopover),i=p.useRef(null),n=Te(e,i),o=p.useRef(!1);return p.useEffect(()=>{const g=i.current;if(g)return sX(g)},[]),cA(QX,{as:aXe,allowPinchZoom:!0,children:cA(ASA,{...A,ref:n,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:TA(A.onCloseAutoFocus,g=>{var a;g.preventDefault(),o.current||(a=t.triggerRef.current)==null||a.focus()}),onPointerDownOutside:TA(A.onPointerDownOutside,g=>{const a=g.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0,I=a.button===2||s;o.current=I},{checkForDefaultPrevented:!1}),onFocusOutside:TA(A.onFocusOutside,g=>g.preventDefault(),{checkForDefaultPrevented:!1})})})}),rXe=p.forwardRef((A,e)=>{const t=Xm(vk,A.__scopePopover),i=p.useRef(!1),n=p.useRef(!1);return cA(ASA,{...A,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var g,a;(g=A.onCloseAutoFocus)==null||g.call(A,o),o.defaultPrevented||(i.current||(a=t.triggerRef.current)==null||a.focus(),o.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:o=>{var g,a;(g=A.onInteractOutside)==null||g.call(A,o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=o.target;(a=t.triggerRef.current)!=null&&a.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&n.current&&o.preventDefault()}})}),ASA=p.forwardRef((A,e)=>{const{__scopePopover:t,trapFocus:i,onOpenAutoFocus:n,onCloseAutoFocus:o,disableOutsidePointerEvents:g,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:I,onInteractOutside:r,...C}=A,l=Xm(vk,t),c=MF(t);return qV(),cA(kF,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:n,onUnmountAutoFocus:o,children:cA(Ny,{asChild:!0,disableOutsidePointerEvents:g,onInteractOutside:r,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:I,onDismiss:()=>l.onOpenChange(!1),children:cA(xF,{"data-state":tSA(l.open),role:"dialog",id:l.contentId,...c,...C,ref:e,style:{...C.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)"}})})})}),eSA="PopoverClose",IXe=p.forwardRef((A,e)=>{const{__scopePopover:t,...i}=A,n=Xm(eSA,t);return cA(re.button,{type:"button",...i,ref:e,onClick:TA(A.onClick,()=>n.onOpenChange(!1))})});IXe.displayName=eSA;var CXe="PopoverArrow",lXe=p.forwardRef((A,e)=>{const{__scopePopover:t,...i}=A,n=MF(t);return cA(FF,{...n,...i,ref:e})});lXe.displayName=CXe;function tSA(A){return A?"open":"closed"}var cXe=_LA,BXe=jLA,QXe=PLA,iSA=$LA,nSA={exports:{}},EXe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},oSA={exports:{}},uXe=function(A){return!A||typeof A=="string"?!1:A instanceof Array||Array.isArray(A)||A.length>=0&&(A.splice instanceof Function||Object.getOwnPropertyDescriptor(A,A.length-1)&&A.constructor.name!=="String")},dXe=uXe,hXe=Array.prototype.concat,mXe=Array.prototype.slice,gSA=oSA.exports=function(A){for(var e=[],t=0,i=A.length;t<i;t++){var n=A[t];dXe(n)?e=hXe.call(e,mXe.call(n)):e.push(n)}return e};gSA.wrap=function(A){return function(){return A(gSA(arguments))}};var pXe=oSA.exports,vF=EXe,LF=pXe,aSA=Object.hasOwnProperty,sSA=Object.create(null);for(var WnA in vF)aSA.call(vF,WnA)&&(sSA[vF[WnA]]=WnA);var pI=nSA.exports={to:{},get:{}};pI.get=function(A){var e=A.substring(0,3).toLowerCase(),t,i;switch(e){case"hsl":t=pI.get.hsl(A),i="hsl";break;case"hwb":t=pI.get.hwb(A),i="hwb";break;default:t=pI.get.rgb(A),i="rgb";break}return t?{model:i,value:t}:null},pI.get.rgb=function(A){if(!A)return null;var e=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,i=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,n=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,g=[0,0,0,1],a,s,I;if(a=A.match(t)){for(I=a[2],a=a[1],s=0;s<3;s++){var r=s*2;g[s]=parseInt(a.slice(r,r+2),16)}I&&(g[3]=parseInt(I,16)/255)}else if(a=A.match(e)){for(a=a[1],I=a[3],s=0;s<3;s++)g[s]=parseInt(a[s]+a[s],16);I&&(g[3]=parseInt(I+I,16)/255)}else if(a=A.match(i)){for(s=0;s<3;s++)g[s]=parseInt(a[s+1],0);a[4]&&(a[5]?g[3]=parseFloat(a[4])*.01:g[3]=parseFloat(a[4]))}else if(a=A.match(n)){for(s=0;s<3;s++)g[s]=Math.round(parseFloat(a[s+1])*2.55);a[4]&&(a[5]?g[3]=parseFloat(a[4])*.01:g[3]=parseFloat(a[4]))}else return(a=A.match(o))?a[1]==="transparent"?[0,0,0,0]:aSA.call(vF,a[1])?(g=vF[a[1]],g[3]=1,g):null:null;for(s=0;s<3;s++)g[s]=zm(g[s],0,255);return g[3]=zm(g[3],0,1),g},pI.get.hsl=function(A){if(!A)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=A.match(e);if(t){var i=parseFloat(t[4]),n=(parseFloat(t[1])%360+360)%360,o=zm(parseFloat(t[2]),0,100),g=zm(parseFloat(t[3]),0,100),a=zm(isNaN(i)?1:i,0,1);return[n,o,g,a]}return null},pI.get.hwb=function(A){if(!A)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=A.match(e);if(t){var i=parseFloat(t[4]),n=(parseFloat(t[1])%360+360)%360,o=zm(parseFloat(t[2]),0,100),g=zm(parseFloat(t[3]),0,100),a=zm(isNaN(i)?1:i,0,1);return[n,o,g,a]}return null},pI.to.hex=function(){var A=LF(arguments);return"#"+uX(A[0])+uX(A[1])+uX(A[2])+(A[3]<1?uX(Math.round(A[3]*255)):"")},pI.to.rgb=function(){var A=LF(arguments);return A.length<4||A[3]===1?"rgb("+Math.round(A[0])+", "+Math.round(A[1])+", "+Math.round(A[2])+")":"rgba("+Math.round(A[0])+", "+Math.round(A[1])+", "+Math.round(A[2])+", "+A[3]+")"},pI.to.rgb.percent=function(){var A=LF(arguments),e=Math.round(A[0]/255*100),t=Math.round(A[1]/255*100),i=Math.round(A[2]/255*100);return A.length<4||A[3]===1?"rgb("+e+"%, "+t+"%, "+i+"%)":"rgba("+e+"%, "+t+"%, "+i+"%, "+A[3]+")"},pI.to.hsl=function(){var A=LF(arguments);return A.length<4||A[3]===1?"hsl("+A[0]+", "+A[1]+"%, "+A[2]+"%)":"hsla("+A[0]+", "+A[1]+"%, "+A[2]+"%, "+A[3]+")"},pI.to.hwb=function(){var A=LF(arguments),e="";return A.length>=4&&A[3]!==1&&(e=", "+A[3]),"hwb("+A[0]+", "+A[1]+"%, "+A[2]+"%"+e+")"},pI.to.keyword=function(A){return sSA[A.slice(0,3)]};function zm(A,e,t){return Math.min(Math.max(e,A),t)}function uX(A){var e=Math.round(A).toString(16).toUpperCase();return e.length<2?"0"+e:e}var fXe=nSA.exports;const KnA=xC(fXe),SF={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},dX={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(A){var e=A[0]/360,t=A[1]/100,i=A[2]/100,n,o,g,a,s,I=0;if(t===0)return s=i*255,[s,s,s];for(o=i<.5?i*(1+t):i+t-i*t,n=2*i-o,a=[0,0,0];I<3;)g=e+1/3*-(I-1),g<0?g++:g>1&&g--,s=6*g<1?n+(o-n)*6*g:2*g<1?o:3*g<2?n+(o-n)*(2/3-g)*6:n,a[I++]=s*255;return a}};SF.hsl=function(A){var e=A[0]/255,t=A[1]/255,i=A[2]/255,n=Math.min(e,t,i),o=Math.max(e,t,i),g=o-n,a,s,I;return o===n?a=0:e===o?a=(t-i)/g:t===o?a=2+(i-e)/g:i===o&&(a=4+(e-t)/g),a=Math.min(a*60,360),a<0&&(a+=360),I=(n+o)/2,o===n?s=0:I<=.5?s=g/(o+n):s=g/(2-o-n),[a,s*100,I*100]};const UnA={name:"hsv",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","value"],alias:["HSV","HSB"],rgb:function(A){var e=A[0]/60,t=A[1]/100,i=A[2]/100,n=Math.floor(e)%6,o=e-Math.floor(e),g=255*i*(1-t),a=255*i*(1-t*o),s=255*i*(1-t*(1-o));switch(i*=255,n){case 0:return[i,s,g];case 1:return[a,i,g];case 2:return[g,i,s];case 3:return[g,a,i];case 4:return[s,g,i];case 5:return[i,g,a]}},hsl:function(A){var e=A[0],t=A[1]/100,i=A[2]/100,n,o;return o=(2-t)*i,n=t*i,n/=o<=1?o:2-o,n=n||0,o/=2,[e,n*100,o*100]}};SF.hsv=function(A){var e=A[0],t=A[1],i=A[2],n=Math.min(e,t,i),o=Math.max(e,t,i),g=o-n,a,s,I;return o===0?s=0:s=g/o*100,o===n?a=0:e===o?a=(t-i)/g:t===o?a=2+(i-e)/g:i===o&&(a=4+(e-t)/g),a=Math.min(a*60,360),a<0&&(a+=360),I=o/255*1e3/10,[a,s,I]},dX.hsv=function(A){var e=A[0],t=A[1]/100,i=A[2]/100,n,o;return i*=2,t*=i<=1?i:2-i,o=(i+t)/2,n=2*t/(i+t)||0,[e,n*100,o*100]};var rSA={name:"hwb",min:[0,0,0],max:[360,100,100],channel:["hue","whiteness","blackness"],alias:["HWB"],rgb:function(A){var e=A[0]/360,t=A[1]/100,i=A[2]/100,n=t+i,o,g,a,s,I,r,C;switch(n>1&&(t/=n,i/=n),o=Math.floor(6*e),g=1-i,a=6*e-o,o&1&&(a=1-a),s=t+a*(g-t),o){default:case 6:case 0:I=g,r=s,C=t;break;case 1:I=s,r=g,C=t;break;case 2:I=t,r=g,C=s;break;case 3:I=t,r=s,C=g;break;case 4:I=s,r=t,C=g;break;case 5:I=g,r=t,C=s;break}return[I*255,r*255,C*255]},hsv:function(A){var e=A[0],t=A[1],i=A[2],n,o;return t+i>=100?(n=0,o=100*t/(t+i)):(n=100-t/(1-i/100),o=100-i),[e,n,o]},hsl:function(A){return UnA.hsl(rSA.hsv(A))}};SF.hwb=function(A){var e=A[0],t=A[1],i=A[2],n=SF.hsl(A)[0],o=1/255*Math.min(e,Math.min(t,i));return i=1-.00392156862745098*Math.max(e,Math.max(t,i)),[n,o*100,i*100]},UnA.hwb=function(A){var e=A[0],t=A[1],i=A[2];return[e,i===0?0:i*(1-t/100),100-i]},dX.hwb=function(A){return UnA.hwb(dX.hsv(A))};var ISA={},CSA={},VnA={exports:{}},fn=String,lSA=function(){return{isColorSupported:!1,reset:fn,bold:fn,dim:fn,italic:fn,underline:fn,inverse:fn,hidden:fn,strikethrough:fn,black:fn,red:fn,green:fn,yellow:fn,blue:fn,magenta:fn,cyan:fn,white:fn,gray:fn,bgBlack:fn,bgRed:fn,bgGreen:fn,bgYellow:fn,bgBlue:fn,bgMagenta:fn,bgCyan:fn,bgWhite:fn}};VnA.exports=lSA(),VnA.exports.createColors=lSA;var yXe=VnA.exports;(function(A){Object.defineProperty(A,"__esModule",{value:!0});function e(s,I){for(var r in I)Object.defineProperty(s,r,{enumerable:!0,get:I[r]})}e(A,{dim:function(){return g},default:function(){return a}});const t=i(yXe);function i(s){return s&&s.__esModule?s:{default:s}}let n=new Set;function o(s,I,r){typeof process<"u"&&process.env.JEST_WORKER_ID||r&&n.has(r)||(r&&n.add(r),console.warn(""),I.forEach(C=>console.warn(s,"-",C)))}function g(s){return t.default.dim(s)}const a={info(s,I){o(t.default.bold(t.default.cyan("info")),...Array.isArray(s)?[s]:[I,s])},warn(s,I){o(t.default.bold(t.default.yellow("warn")),...Array.isArray(s)?[s]:[I,s])},risk(s,I){o(t.default.bold(t.default.magenta("risk")),...Array.isArray(s)?[s]:[I,s])}}})(CSA),function(A){Object.defineProperty(A,"__esModule",{value:!0}),Object.defineProperty(A,"default",{enumerable:!0,get:function(){return n}});const e=t(CSA);function t(o){return o&&o.__esModule?o:{default:o}}function i({version:o,from:g,to:a}){e.default.warn(`${g}-color-renamed`,[`As of Tailwind CSS ${o}, \`${g}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const n={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return i({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return i({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return i({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return i({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return i({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(ISA);let XnA=ISA;var bXe=(XnA.__esModule?XnA:{default:XnA}).default;const Tm=xC(bXe);function wXe(A){const e=A.split("-");if(e.length===2){const[t,i]=e;if(Tm[t]&&Tm[t][i])return KnA.get(Tm[t][i])}return KnA.get(A)}function cSA(A){const e=wXe(A);if(e){if(e.model==="hsl")return e.value;if(e.model==="rgb")return SF.hsl(e.value);if(e.model==="hwb")return rSA.hsl(e.value)}throw new Error(`cannot parse color ${A}`)}function DXe(A){const[e,t,i]=cSA(A);return`${e} ${t}% ${i}%`}function BSA(A){return KnA.to.hex(dX.rgb(cSA(A)))}function QSA(A){return Object.entries(A).map(([e,t])=>`--${e}:${DXe(t)};`).join("")}const ESA={light:{destructive:"hsl(0 84.2% 60.2%)","destructive-foreground":"hsl(0 0% 98%)",dimension:"hsl(217.2 91.2% 59.8%)",measure:"hsl(270.7 91% 65.1%)"},dark:{destructive:"hsl(0 62.8% 30.6%)","destructive-foreground":"hsl(0 0% 98%)",dimension:"hsl(213.1 93.9% 67.8%)",measure:"hsl(270 95.2% 75.3%)"}};function uSA(A,e){return{...e,card:A.background,"card-foreground":A.foreground,popover:A.background,"popover-foreground":A.foreground,secondary:A.muted,"secondary-foreground":A.primary,accent:A.muted,"accent-foreground":A.primary,input:A.border,...A}}function GXe(A){return`:host{${QSA(uSA(A.light,ESA.light))}}
.dark{${QSA(uSA(A.dark,ESA.dark))}}`}function HF(A){return{light:{background:"white",foreground:A[950],primary:A[900],"primary-foreground":A[50],muted:A[100],"muted-foreground":A[500],border:A[200],ring:A[950]},dark:{background:A[950],foreground:A[50],primary:A[50],"primary-foreground":A[900],muted:A[800],"muted-foreground":A[400],border:A[800],ring:A[300]}}}const dSA=HF(Tm.zinc);HF(Tm.slate),HF(Tm.gray),HF(Tm.neutral),HF(Tm.stone);const sQ=p.createContext("light"),hX=p.createContext({}),Ry=p.createContext(null),znA=p.createContext(dSA),TnA=cXe,_nA=BXe,mX=p.forwardRef(({className:A,align:e="center",sideOffset:t=4,...i},n)=>p.createElement(QXe,{container:p.useContext(Ry)},p.createElement(iSA,{ref:n,align:e,sideOffset:t,className:Ce("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",A),...i})));mX.displayName=iSA.displayName;function kXe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const JXe=p.forwardRef(kXe),NXe=JXe;function YXe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{fillRule:"evenodd",d:"M11.078 2.25c-.917 0-1.699.663-1.85 1.567L9.05 4.889c-.02.12-.115.26-.297.348a7.493 7.493 0 0 0-.986.57c-.166.115-.334.126-.45.083L6.3 5.508a1.875 1.875 0 0 0-2.282.819l-.922 1.597a1.875 1.875 0 0 0 .432 2.385l.84.692c.095.078.17.229.154.43a7.598 7.598 0 0 0 0 1.139c.015.2-.059.352-.153.43l-.841.692a1.875 1.875 0 0 0-.432 2.385l.922 1.597a1.875 1.875 0 0 0 2.282.818l1.019-.382c.115-.043.283-.031.45.082.312.214.641.405.985.57.182.088.277.228.297.35l.178 1.071c.151.904.933 1.567 1.85 1.567h1.844c.916 0 1.699-.663 1.85-1.567l.178-1.072c.02-.12.114-.26.297-.349.344-.165.673-.356.985-.57.167-.114.335-.125.45-.082l1.02.382a1.875 1.875 0 0 0 2.28-.819l.923-1.597a1.875 1.875 0 0 0-.432-2.385l-.84-.692c-.095-.078-.17-.229-.154-.43a7.614 7.614 0 0 0 0-1.139c-.016-.2.059-.352.153-.43l.84-.692c.708-.582.891-1.59.433-2.385l-.922-1.597a1.875 1.875 0 0 0-2.282-.818l-1.02.382c-.114.043-.282.031-.449-.083a7.49 7.49 0 0 0-.985-.57c-.183-.087-.277-.227-.297-.348l-.179-1.072a1.875 1.875 0 0 0-1.85-1.567h-1.843ZM12 15.75a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5Z",clipRule:"evenodd"}))}const RXe=p.forwardRef(YXe),xXe=RXe;function FXe({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{d:"M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"}),p.createElement("path",{d:"M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"}))}const MXe=p.forwardRef(FXe),vXe=MXe;var hSA=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"}),LXe="VisuallyHidden",mSA=p.forwardRef((A,e)=>cA(re.span,{...A,ref:e,style:{...hSA,...A.style}}));mSA.displayName=LXe;var SXe=mSA,[pX,Wpi]=Tg("Tooltip",[aQ]),fX=aQ(),pSA="TooltipProvider",HXe=700,OnA="tooltip.open",[ZXe,qnA]=pX(pSA),fSA=A=>{const{__scopeTooltip:e,delayDuration:t=HXe,skipDelayDuration:i=300,disableHoverableContent:n=!1,children:o}=A,g=p.useRef(!0),a=p.useRef(!1),s=p.useRef(0);return p.useEffect(()=>{const I=s.current;return()=>window.clearTimeout(I)},[]),cA(ZXe,{scope:e,isOpenDelayedRef:g,delayDuration:t,onOpen:p.useCallback(()=>{window.clearTimeout(s.current),g.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(()=>g.current=!0,i)},[i]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(I=>{a.current=I},[]),disableHoverableContent:n,children:o})};fSA.displayName=pSA;var ZF="Tooltip",[WXe,yX]=pX(ZF),ySA=A=>{const{__scopeTooltip:e,children:t,open:i,defaultOpen:n,onOpenChange:o,disableHoverableContent:g,delayDuration:a}=A,s=qnA(ZF,A.__scopeTooltip),I=fX(e),[r,C]=p.useState(null),l=_o(),c=p.useRef(0),B=g??s.disableHoverableContent,E=a??s.delayDuration,u=p.useRef(!1),[d,f]=is({prop:i,defaultProp:n??!1,onChange:x=>{x?(s.onOpen(),document.dispatchEvent(new CustomEvent(OnA))):s.onClose(),o==null||o(x)},caller:ZF}),w=p.useMemo(()=>d?u.current?"delayed-open":"instant-open":"closed",[d]),y=p.useCallback(()=>{window.clearTimeout(c.current),c.current=0,u.current=!1,f(!0)},[f]),G=p.useCallback(()=>{window.clearTimeout(c.current),c.current=0,f(!1)},[f]),R=p.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>{u.current=!0,f(!0),c.current=0},E)},[E,f]);return p.useEffect(()=>()=>{c.current&&(window.clearTimeout(c.current),c.current=0)},[]),cA(RF,{...I,children:cA(WXe,{scope:e,contentId:l,open:d,stateAttribute:w,trigger:r,onTriggerChange:C,onTriggerEnter:p.useCallback(()=>{s.isOpenDelayedRef.current?R():y()},[s.isOpenDelayedRef,R,y]),onTriggerLeave:p.useCallback(()=>{B?G():(window.clearTimeout(c.current),c.current=0)},[G,B]),onOpen:y,onClose:G,disableHoverableContent:B,children:t})})};ySA.displayName=ZF;var jnA="TooltipTrigger",bSA=p.forwardRef((A,e)=>{const{__scopeTooltip:t,...i}=A,n=yX(jnA,t),o=qnA(jnA,t),g=fX(t),a=p.useRef(null),s=Te(e,a,n.onTriggerChange),I=p.useRef(!1),r=p.useRef(!1),C=p.useCallback(()=>I.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",C),[C]),cA(kk,{asChild:!0,...g,children:cA(re.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...i,ref:s,onPointerMove:TA(A.onPointerMove,l=>{l.pointerType!=="touch"&&!r.current&&!o.isPointerInTransitRef.current&&(n.onTriggerEnter(),r.current=!0)}),onPointerLeave:TA(A.onPointerLeave,()=>{n.onTriggerLeave(),r.current=!1}),onPointerDown:TA(A.onPointerDown,()=>{n.open&&n.onClose(),I.current=!0,document.addEventListener("pointerup",C,{once:!0})}),onFocus:TA(A.onFocus,()=>{I.current||n.onOpen()}),onBlur:TA(A.onBlur,n.onClose),onClick:TA(A.onClick,n.onClose)})})});bSA.displayName=jnA;var KXe="TooltipPortal",[Kpi,UXe]=pX(KXe,{forceMount:void 0}),Lk="TooltipContent",wSA=p.forwardRef((A,e)=>{const t=UXe(Lk,A.__scopeTooltip),{forceMount:i=t.forceMount,side:n="top",...o}=A,g=yX(Lk,A.__scopeTooltip);return cA(qg,{present:i||g.open,children:g.disableHoverableContent?cA(DSA,{side:n,...o,ref:e}):cA(VXe,{side:n,...o,ref:e})})}),VXe=p.forwardRef((A,e)=>{const t=yX(Lk,A.__scopeTooltip),i=qnA(Lk,A.__scopeTooltip),n=p.useRef(null),o=Te(e,n),[g,a]=p.useState(null),{trigger:s,onClose:I}=t,r=n.current,{onPointerInTransitChange:C}=i,l=p.useCallback(()=>{a(null),C(!1)},[C]),c=p.useCallback((B,E)=>{const u=B.currentTarget,d={x:B.clientX,y:B.clientY},f=OXe(d,u.getBoundingClientRect()),w=qXe(d,f),y=jXe(E.getBoundingClientRect()),G=$Xe([...w,...y]);a(G),C(!0)},[C]);return p.useEffect(()=>()=>l(),[l]),p.useEffect(()=>{if(s&&r){const B=u=>c(u,r),E=u=>c(u,s);return s.addEventListener("pointerleave",B),r.addEventListener("pointerleave",E),()=>{s.removeEventListener("pointerleave",B),r.removeEventListener("pointerleave",E)}}},[s,r,c,l]),p.useEffect(()=>{if(g){const B=E=>{const u=E.target,d={x:E.clientX,y:E.clientY},f=(s==null?void 0:s.contains(u))||(r==null?void 0:r.contains(u)),w=!PXe(d,g);f?l():w&&(l(),I())};return document.addEventListener("pointermove",B),()=>document.removeEventListener("pointermove",B)}},[s,r,g,I,l]),cA(DSA,{...A,ref:o})}),[XXe,zXe]=pX(ZF,{isInside:!1}),TXe=xZe("TooltipContent"),DSA=p.forwardRef((A,e)=>{const{__scopeTooltip:t,children:i,"aria-label":n,onEscapeKeyDown:o,onPointerDownOutside:g,...a}=A,s=yX(Lk,t),I=fX(t),{onClose:r}=s;return p.useEffect(()=>(document.addEventListener(OnA,r),()=>document.removeEventListener(OnA,r)),[r]),p.useEffect(()=>{if(s.trigger){const C=l=>{const c=l.target;c!=null&&c.contains(s.trigger)&&r()};return window.addEventListener("scroll",C,{capture:!0}),()=>window.removeEventListener("scroll",C,{capture:!0})}},[s.trigger,r]),cA(Ny,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:g,onFocusOutside:C=>C.preventDefault(),onDismiss:r,children:Ic(xF,{"data-state":s.stateAttribute,...I,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[cA(TXe,{children:i}),cA(XXe,{scope:t,isInside:!0,children:cA(SXe,{id:s.contentId,role:"tooltip",children:n||i})})]})})});wSA.displayName=Lk;var GSA="TooltipArrow",_Xe=p.forwardRef((A,e)=>{const{__scopeTooltip:t,...i}=A,n=fX(t);return zXe(GSA,t).isInside?null:cA(FF,{...n,...i,ref:e})});_Xe.displayName=GSA;function OXe(A,e){const t=Math.abs(e.top-A.y),i=Math.abs(e.bottom-A.y),n=Math.abs(e.right-A.x),o=Math.abs(e.left-A.x);switch(Math.min(t,i,n,o)){case o:return"left";case n:return"right";case t:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function qXe(A,e,t=5){const i=[];switch(e){case"top":i.push({x:A.x-t,y:A.y+t},{x:A.x+t,y:A.y+t});break;case"bottom":i.push({x:A.x-t,y:A.y-t},{x:A.x+t,y:A.y-t});break;case"left":i.push({x:A.x+t,y:A.y-t},{x:A.x+t,y:A.y+t});break;case"right":i.push({x:A.x-t,y:A.y-t},{x:A.x-t,y:A.y+t});break}return i}function jXe(A){const{top:e,right:t,bottom:i,left:n}=A;return[{x:n,y:e},{x:t,y:e},{x:t,y:i},{x:n,y:i}]}function PXe(A,e){const{x:t,y:i}=A;let n=!1;for(let o=0,g=e.length-1;o<e.length;g=o++){const a=e[o],s=e[g],I=a.x,r=a.y,C=s.x,l=s.y;r>i!=l>i&&t<(C-I)*(i-r)/(l-r)+I&&(n=!n)}return n}function $Xe(A){const e=A.slice();return e.sort((t,i)=>t.x<i.x?-1:t.x>i.x?1:t.y<i.y?-1:t.y>i.y?1:0),A9e(e)}function A9e(A){if(A.length<=1)return A.slice();const e=[];for(let i=0;i<A.length;i++){const n=A[i];for(;e.length>=2;){const o=e[e.length-1],g=e[e.length-2];if((o.x-g.x)*(n.y-g.y)>=(o.y-g.y)*(n.x-g.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let i=A.length-1;i>=0;i--){const n=A[i];for(;t.length>=2;){const o=t[t.length-1],g=t[t.length-2];if((o.x-g.x)*(n.y-g.y)>=(o.y-g.y)*(n.x-g.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var e9e=fSA,t9e=ySA,i9e=bSA,kSA=wSA;const JSA=e9e,NSA=t9e,YSA=i9e,PnA=p.forwardRef(({className:A,sideOffset:e=4,...t},i)=>p.createElement(kSA,{ref:i,sideOffset:e,className:Ce("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",A),...t}));PnA.displayName=kSA.displayName;function $nA(A){const{openedKey:e,setOpenedKey:t,children:i,item:n}=A,{key:o,disabled:g,form:a,label:s,styles:I}=n,r=`${o}::form`,C=a&&r===e&&!g,l=a&&A.splitOnly;return b.createElement(TnA,{open:!!C,onOpenChange:c=>t(c?r:null)},b.createElement(JSA,null,b.createElement(NSA,null,b.createElement(YSA,{asChild:!0},b.createElement(_nA,{asChild:!0},b.createElement("div",{className:"m-0.5 rounded-md flex transition-colors hover:bg-muted hover:text-muted-foreground",style:I==null?void 0:I.item},b.createElement("div",{onClick:l?void 0:c=>c.stopPropagation()},i),a&&b.createElement(fe,{variant:"none",size:"none",className:"cursor-pointer group flex items-center h-8 mr-1"},b.createElement(xXe,{style:I==null?void 0:I.splitIcon,className:"group-hover:translate-y-[40%] transition-transform w-2.5 h-2.5"}))))),a&&b.createElement(mX,{className:"p-0 w-fit"},a),b.createElement(PnA,{hideWhenDetached:!0},s))))}const n9e=p.memo(function(A){const{item:e}=A,{icon:t,styles:i,disabled:n,onClick:o,href:g}=e;return b.createElement($nA,{...A,splitOnly:!o},g&&b.createElement("a",{href:g,target:"_blank",className:OV({variant:"none",size:"toolbar"}),"aria-disabled":n},b.createElement(t,{className:"w-[18px] h-[18px]",style:i==null?void 0:i.icon})),!g&&b.createElement(fe,{variant:"none",size:"toolbar",onClick:o,disabled:n},b.createElement(t,{className:"w-[18px] h-[18px]",style:i==null?void 0:i.icon})))}),o9e=n9e;var RSA="Toggle",xSA=p.forwardRef((A,e)=>{const{pressed:t,defaultPressed:i,onPressedChange:n,...o}=A,[g,a]=is({prop:t,onChange:n,defaultProp:i??!1,caller:RSA});return cA(re.button,{type:"button","aria-pressed":g,"data-state":g?"on":"off","data-disabled":A.disabled?"":void 0,...o,ref:e,onClick:TA(A.onClick,()=>{A.disabled||a(!g)})})});xSA.displayName=RSA;var FSA=xSA;const g9e=_V("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",{variants:{variant:{none:"",default:"hover:bg-muted hover:text-muted-foreground bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-3",toolbar:"h-8 w-8",sm:"h-8 px-2",lg:"h-10 px-3"}},defaultVariants:{variant:"default",size:"default"}}),MSA=p.forwardRef(({className:A,variant:e,size:t,...i},n)=>p.createElement(FSA,{ref:n,className:Ce(g9e({variant:e,size:t,className:A})),...i}));MSA.displayName=FSA.displayName;const a9e=p.memo(function(A){const{item:e}=A,{icon:t,disabled:i,checked:n,onChange:o,styles:g}=e;return b.createElement($nA,{...A},b.createElement(MSA,{variant:"none",disabled:i,size:"toolbar",pressed:n,onPressedChange:o},b.createElement(t,{className:"w-[18px] h-[18px]",style:g==null?void 0:g.icon})))}),s9e=a9e;var AoA="rovingFocusGroup.onEntryFocus",r9e={bubbles:!1,cancelable:!0},WF="RovingFocusGroup",[eoA,vSA,I9e]=DV(WF),[C9e,Sk]=Tg(WF,[I9e]),[l9e,c9e]=C9e(WF),LSA=p.forwardRef((A,e)=>cA(eoA.Provider,{scope:A.__scopeRovingFocusGroup,children:cA(eoA.Slot,{scope:A.__scopeRovingFocusGroup,children:cA(B9e,{...A,ref:e})})}));LSA.displayName=WF;var B9e=p.forwardRef((A,e)=>{const{__scopeRovingFocusGroup:t,orientation:i,loop:n=!1,dir:o,currentTabStopId:g,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:s,onEntryFocus:I,preventScrollOnEntryFocus:r=!1,...C}=A,l=p.useRef(null),c=Te(e,l),B=Ck(o),[E,u]=is({prop:g,defaultProp:a??null,onChange:s,caller:WF}),[d,f]=p.useState(!1),w=oQ(I),y=vSA(t),G=p.useRef(!1),[R,x]=p.useState(0);return p.useEffect(()=>{const F=l.current;if(F)return F.addEventListener(AoA,w),()=>F.removeEventListener(AoA,w)},[w]),cA(l9e,{scope:t,orientation:i,dir:B,loop:n,currentTabStopId:E,onItemFocus:p.useCallback(F=>u(F),[u]),onItemShiftTab:p.useCallback(()=>f(!0),[]),onFocusableItemAdd:p.useCallback(()=>x(F=>F+1),[]),onFocusableItemRemove:p.useCallback(()=>x(F=>F-1),[]),children:cA(re.div,{tabIndex:d||R===0?-1:0,"data-orientation":i,...C,ref:c,style:{outline:"none",...A.style},onMouseDown:TA(A.onMouseDown,()=>{G.current=!0}),onFocus:TA(A.onFocus,F=>{const Q=!G.current;if(F.target===F.currentTarget&&Q&&!d){const k=new CustomEvent(AoA,r9e);if(F.currentTarget.dispatchEvent(k),!k.defaultPrevented){const h=y().filter(U=>U.focusable),N=h.find(U=>U.active),v=h.find(U=>U.id===E),K=[N,v,...h].filter(Boolean).map(U=>U.ref.current);ZSA(K,r)}}G.current=!1}),onBlur:TA(A.onBlur,()=>f(!1))})})}),SSA="RovingFocusGroupItem",HSA=p.forwardRef((A,e)=>{const{__scopeRovingFocusGroup:t,focusable:i=!0,active:n=!1,tabStopId:o,children:g,...a}=A,s=_o(),I=o||s,r=c9e(SSA,t),C=r.currentTabStopId===I,l=vSA(t),{onFocusableItemAdd:c,onFocusableItemRemove:B,currentTabStopId:E}=r;return p.useEffect(()=>{if(i)return c(),()=>B()},[i,c,B]),cA(eoA.ItemSlot,{scope:t,id:I,focusable:i,active:n,children:cA(re.span,{tabIndex:C?0:-1,"data-orientation":r.orientation,...a,ref:e,onMouseDown:TA(A.onMouseDown,u=>{i?r.onItemFocus(I):u.preventDefault()}),onFocus:TA(A.onFocus,()=>r.onItemFocus(I)),onKeyDown:TA(A.onKeyDown,u=>{if(u.key==="Tab"&&u.shiftKey){r.onItemShiftTab();return}if(u.target!==u.currentTarget)return;const d=u9e(u,r.orientation,r.dir);if(d!==void 0){if(u.metaKey||u.ctrlKey||u.altKey||u.shiftKey)return;u.preventDefault();let f=l().filter(w=>w.focusable).map(w=>w.ref.current);if(d==="last")f.reverse();else if(d==="prev"||d==="next"){d==="prev"&&f.reverse();const w=f.indexOf(u.currentTarget);f=r.loop?d9e(f,w+1):f.slice(w+1)}setTimeout(()=>ZSA(f))}}),children:typeof g=="function"?g({isCurrentTabStop:C,hasTabStop:E!=null}):g})})});HSA.displayName=SSA;var Q9e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function E9e(A,e){return e!=="rtl"?A:A==="ArrowLeft"?"ArrowRight":A==="ArrowRight"?"ArrowLeft":A}function u9e(A,e,t){const i=E9e(A.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Q9e[i]}function ZSA(A,e=!1){const t=document.activeElement;for(const i of A)if(i===t||(i.focus({preventScroll:e}),document.activeElement!==t))return}function d9e(A,e){return A.map((t,i)=>A[(e+i)%A.length])}var toA=LSA,ioA=HSA,noA=["Enter"," "],h9e=["ArrowDown","PageUp","Home"],WSA=["ArrowUp","PageDown","End"],m9e=[...h9e,...WSA],p9e={ltr:[...noA,"ArrowRight"],rtl:[...noA,"ArrowLeft"]},f9e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},KF="Menu",[UF,y9e,b9e]=DV(KF),[xy,KSA]=Tg(KF,[b9e,aQ,Sk]),bX=aQ(),USA=Sk(),[w9e,Fy]=xy(KF),[D9e,VF]=xy(KF),VSA=A=>{const{__scopeMenu:e,open:t=!1,children:i,dir:n,onOpenChange:o,modal:g=!0}=A,a=bX(e),[s,I]=p.useState(null),r=p.useRef(!1),C=oQ(o),l=Ck(n);return p.useEffect(()=>{const c=()=>{r.current=!0,document.addEventListener("pointerdown",B,{capture:!0,once:!0}),document.addEventListener("pointermove",B,{capture:!0,once:!0})},B=()=>r.current=!1;return document.addEventListener("keydown",c,{capture:!0}),()=>{document.removeEventListener("keydown",c,{capture:!0}),document.removeEventListener("pointerdown",B,{capture:!0}),document.removeEventListener("pointermove",B,{capture:!0})}},[]),cA(RF,{...a,children:cA(w9e,{scope:e,open:t,onOpenChange:C,content:s,onContentChange:I,children:cA(D9e,{scope:e,onClose:p.useCallback(()=>C(!1),[C]),isUsingKeyboardRef:r,dir:l,modal:g,children:i})})})};VSA.displayName=KF;var G9e="MenuAnchor",ooA=p.forwardRef((A,e)=>{const{__scopeMenu:t,...i}=A,n=bX(t);return cA(kk,{...n,...i,ref:e})});ooA.displayName=G9e;var goA="MenuPortal",[k9e,XSA]=xy(goA,{forceMount:void 0}),zSA=A=>{const{__scopeMenu:e,forceMount:t,children:i,container:n}=A,o=Fy(goA,e);return cA(k9e,{scope:e,forceMount:t,children:cA(qg,{present:t||o.open,children:cA(Jk,{asChild:!0,container:n,children:i})})})};zSA.displayName=goA;var zC="MenuContent",[J9e,aoA]=xy(zC),TSA=p.forwardRef((A,e)=>{const t=XSA(zC,A.__scopeMenu),{forceMount:i=t.forceMount,...n}=A,o=Fy(zC,A.__scopeMenu),g=VF(zC,A.__scopeMenu);return cA(UF.Provider,{scope:A.__scopeMenu,children:cA(qg,{present:i||o.open,children:cA(UF.Slot,{scope:A.__scopeMenu,children:g.modal?cA(N9e,{...n,ref:e}):cA(Y9e,{...n,ref:e})})})})}),N9e=p.forwardRef((A,e)=>{const t=Fy(zC,A.__scopeMenu),i=p.useRef(null),n=Te(e,i);return p.useEffect(()=>{const o=i.current;if(o)return sX(o)},[]),cA(soA,{...A,ref:n,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:TA(A.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),Y9e=p.forwardRef((A,e)=>{const t=Fy(zC,A.__scopeMenu);return cA(soA,{...A,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),R9e=Ym("MenuContent.ScrollLock"),soA=p.forwardRef((A,e)=>{const{__scopeMenu:t,loop:i=!1,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:g,disableOutsidePointerEvents:a,onEntryFocus:s,onEscapeKeyDown:I,onPointerDownOutside:r,onFocusOutside:C,onInteractOutside:l,onDismiss:c,disableOutsideScroll:B,...E}=A,u=Fy(zC,t),d=VF(zC,t),f=bX(t),w=USA(t),y=y9e(t),[G,R]=p.useState(null),x=p.useRef(null),F=Te(e,x,u.onContentChange),Q=p.useRef(0),k=p.useRef(""),h=p.useRef(0),N=p.useRef(null),v=p.useRef("right"),K=p.useRef(0),U=B?QX:p.Fragment,V=B?{as:R9e,allowPinchZoom:!0}:void 0,X=q=>{var $,nA;const j=k.current+q,O=y().filter(iA=>!iA.disabled),eA=document.activeElement,oA=($=O.find(iA=>iA.ref.current===eA))==null?void 0:$.textValue,tA=O.map(iA=>iA.textValue),sA=V9e(tA,j,oA),gA=(nA=O.find(iA=>iA.textValue===sA))==null?void 0:nA.ref.current;(function iA(aA){k.current=aA,window.clearTimeout(Q.current),aA!==""&&(Q.current=window.setTimeout(()=>iA(""),1e3))})(j),gA&&setTimeout(()=>gA.focus())};p.useEffect(()=>()=>window.clearTimeout(Q.current),[]),qV();const _=p.useCallback(q=>{var $,nA;return v.current===(($=N.current)==null?void 0:$.side)&&z9e(q,(nA=N.current)==null?void 0:nA.area)},[]);return cA(J9e,{scope:t,searchRef:k,onItemEnter:p.useCallback(q=>{_(q)&&q.preventDefault()},[_]),onItemLeave:p.useCallback(q=>{var $;_(q)||(($=x.current)==null||$.focus(),R(null))},[_]),onTriggerLeave:p.useCallback(q=>{_(q)&&q.preventDefault()},[_]),pointerGraceTimerRef:h,onPointerGraceIntentChange:p.useCallback(q=>{N.current=q},[]),children:cA(U,{...V,children:cA(kF,{asChild:!0,trapped:n,onMountAutoFocus:TA(o,q=>{var $;q.preventDefault(),($=x.current)==null||$.focus({preventScroll:!0})}),onUnmountAutoFocus:g,children:cA(Ny,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:I,onPointerDownOutside:r,onFocusOutside:C,onInteractOutside:l,onDismiss:c,children:cA(toA,{asChild:!0,...w,dir:d.dir,orientation:"vertical",loop:i,currentTabStopId:G,onCurrentTabStopIdChange:R,onEntryFocus:TA(s,q=>{d.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:cA(xF,{role:"menu","aria-orientation":"vertical","data-state":IHA(u.open),"data-radix-menu-content":"",dir:d.dir,...f,...E,ref:F,style:{outline:"none",...E.style},onKeyDown:TA(E.onKeyDown,q=>{const $=q.target.closest("[data-radix-menu-content]")===q.currentTarget,nA=q.ctrlKey||q.altKey||q.metaKey,j=q.key.length===1;$&&(q.key==="Tab"&&q.preventDefault(),!nA&&j&&X(q.key));const O=x.current;if(q.target!==O||!m9e.includes(q.key))return;q.preventDefault();const eA=y().filter(oA=>!oA.disabled).map(oA=>oA.ref.current);WSA.includes(q.key)&&eA.reverse(),K9e(eA)}),onBlur:TA(A.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(Q.current),k.current="")}),onPointerMove:TA(A.onPointerMove,zF(q=>{const $=q.target,nA=K.current!==q.clientX;if(q.currentTarget.contains($)&&nA){const j=q.clientX>K.current?"right":"left";v.current=j,K.current=q.clientX}}))})})})})})})});TSA.displayName=zC;var x9e="MenuGroup",roA=p.forwardRef((A,e)=>{const{__scopeMenu:t,...i}=A;return cA(re.div,{role:"group",...i,ref:e})});roA.displayName=x9e;var F9e="MenuLabel",_SA=p.forwardRef((A,e)=>{const{__scopeMenu:t,...i}=A;return cA(re.div,{...i,ref:e})});_SA.displayName=F9e;var wX="MenuItem",OSA="menu.itemSelect",DX=p.forwardRef((A,e)=>{const{disabled:t=!1,onSelect:i,...n}=A,o=p.useRef(null),g=VF(wX,A.__scopeMenu),a=aoA(wX,A.__scopeMenu),s=Te(e,o),I=p.useRef(!1),r=()=>{const C=o.current;if(!t&&C){const l=new CustomEvent(OSA,{bubbles:!0,cancelable:!0});C.addEventListener(OSA,c=>i==null?void 0:i(c),{once:!0}),qFA(C,l),l.defaultPrevented?I.current=!1:g.onClose()}};return cA(qSA,{...n,ref:s,disabled:t,onClick:TA(A.onClick,r),onPointerDown:C=>{var l;(l=A.onPointerDown)==null||l.call(A,C),I.current=!0},onPointerUp:TA(A.onPointerUp,C=>{var l;I.current||(l=C.currentTarget)==null||l.click()}),onKeyDown:TA(A.onKeyDown,C=>{const l=a.searchRef.current!=="";t||l&&C.key===" "||noA.includes(C.key)&&(C.currentTarget.click(),C.preventDefault())})})});DX.displayName=wX;var qSA=p.forwardRef((A,e)=>{const{__scopeMenu:t,disabled:i=!1,textValue:n,...o}=A,g=aoA(wX,t),a=USA(t),s=p.useRef(null),I=Te(e,s),[r,C]=p.useState(!1),[l,c]=p.useState("");return p.useEffect(()=>{const B=s.current;B&&c((B.textContent??"").trim())},[o.children]),cA(UF.ItemSlot,{scope:t,disabled:i,textValue:n??l,children:cA(ioA,{asChild:!0,...a,focusable:!i,children:cA(re.div,{role:"menuitem","data-highlighted":r?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...o,ref:I,onPointerMove:TA(A.onPointerMove,zF(B=>{i?g.onItemLeave(B):(g.onItemEnter(B),B.defaultPrevented||B.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:TA(A.onPointerLeave,zF(B=>g.onItemLeave(B))),onFocus:TA(A.onFocus,()=>C(!0)),onBlur:TA(A.onBlur,()=>C(!1))})})})}),M9e="MenuCheckboxItem",jSA=p.forwardRef((A,e)=>{const{checked:t=!1,onCheckedChange:i,...n}=A;return cA(tHA,{scope:A.__scopeMenu,checked:t,children:cA(DX,{role:"menuitemcheckbox","aria-checked":GX(t)?"mixed":t,...n,ref:e,"data-state":CoA(t),onSelect:TA(n.onSelect,()=>i==null?void 0:i(GX(t)?!0:!t),{checkForDefaultPrevented:!1})})})});jSA.displayName=M9e;var PSA="MenuRadioGroup",[v9e,L9e]=xy(PSA,{value:void 0,onValueChange:()=>{}}),$SA=p.forwardRef((A,e)=>{const{value:t,onValueChange:i,...n}=A,o=oQ(i);return cA(v9e,{scope:A.__scopeMenu,value:t,onValueChange:o,children:cA(roA,{...n,ref:e})})});$SA.displayName=PSA;var AHA="MenuRadioItem",eHA=p.forwardRef((A,e)=>{const{value:t,...i}=A,n=L9e(AHA,A.__scopeMenu),o=t===n.value;return cA(tHA,{scope:A.__scopeMenu,checked:o,children:cA(DX,{role:"menuitemradio","aria-checked":o,...i,ref:e,"data-state":CoA(o),onSelect:TA(i.onSelect,()=>{var g;return(g=n.onValueChange)==null?void 0:g.call(n,t)},{checkForDefaultPrevented:!1})})})});eHA.displayName=AHA;var IoA="MenuItemIndicator",[tHA,S9e]=xy(IoA,{checked:!1}),iHA=p.forwardRef((A,e)=>{const{__scopeMenu:t,forceMount:i,...n}=A,o=S9e(IoA,t);return cA(qg,{present:i||GX(o.checked)||o.checked===!0,children:cA(re.span,{...n,ref:e,"data-state":CoA(o.checked)})})});iHA.displayName=IoA;var H9e="MenuSeparator",nHA=p.forwardRef((A,e)=>{const{__scopeMenu:t,...i}=A;return cA(re.div,{role:"separator","aria-orientation":"horizontal",...i,ref:e})});nHA.displayName=H9e;var Z9e="MenuArrow",oHA=p.forwardRef((A,e)=>{const{__scopeMenu:t,...i}=A,n=bX(t);return cA(FF,{...n,...i,ref:e})});oHA.displayName=Z9e;var W9e="MenuSub",[Upi,gHA]=xy(W9e),XF="MenuSubTrigger",aHA=p.forwardRef((A,e)=>{const t=Fy(XF,A.__scopeMenu),i=VF(XF,A.__scopeMenu),n=gHA(XF,A.__scopeMenu),o=aoA(XF,A.__scopeMenu),g=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:s}=o,I={__scopeMenu:A.__scopeMenu},r=p.useCallback(()=>{g.current&&window.clearTimeout(g.current),g.current=null},[]);return p.useEffect(()=>r,[r]),p.useEffect(()=>{const C=a.current;return()=>{window.clearTimeout(C),s(null)}},[a,s]),cA(ooA,{asChild:!0,...I,children:cA(qSA,{id:n.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":n.contentId,"data-state":IHA(t.open),...A,ref:Wu(e,n.onTriggerChange),onClick:C=>{var l;(l=A.onClick)==null||l.call(A,C),!(A.disabled||C.defaultPrevented)&&(C.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:TA(A.onPointerMove,zF(C=>{o.onItemEnter(C),!C.defaultPrevented&&!A.disabled&&!t.open&&!g.current&&(o.onPointerGraceIntentChange(null),g.current=window.setTimeout(()=>{t.onOpenChange(!0),r()},100))})),onPointerLeave:TA(A.onPointerLeave,zF(C=>{var l,c;r();const B=(l=t.content)==null?void 0:l.getBoundingClientRect();if(B){const E=(c=t.content)==null?void 0:c.dataset.side,u=E==="right",d=u?-5:5,f=B[u?"left":"right"],w=B[u?"right":"left"];o.onPointerGraceIntentChange({area:[{x:C.clientX+d,y:C.clientY},{x:f,y:B.top},{x:w,y:B.top},{x:w,y:B.bottom},{x:f,y:B.bottom}],side:E}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(C),C.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:TA(A.onKeyDown,C=>{var l;const c=o.searchRef.current!=="";A.disabled||c&&C.key===" "||p9e[i.dir].includes(C.key)&&(t.onOpenChange(!0),(l=t.content)==null||l.focus(),C.preventDefault())})})})});aHA.displayName=XF;var sHA="MenuSubContent",rHA=p.forwardRef((A,e)=>{const t=XSA(zC,A.__scopeMenu),{forceMount:i=t.forceMount,...n}=A,o=Fy(zC,A.__scopeMenu),g=VF(zC,A.__scopeMenu),a=gHA(sHA,A.__scopeMenu),s=p.useRef(null),I=Te(e,s);return cA(UF.Provider,{scope:A.__scopeMenu,children:cA(qg,{present:i||o.open,children:cA(UF.Slot,{scope:A.__scopeMenu,children:cA(soA,{id:a.contentId,"aria-labelledby":a.triggerId,...n,ref:I,align:"start",side:g.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:r=>{var C;g.isUsingKeyboardRef.current&&((C=s.current)==null||C.focus()),r.preventDefault()},onCloseAutoFocus:r=>r.preventDefault(),onFocusOutside:TA(A.onFocusOutside,r=>{r.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:TA(A.onEscapeKeyDown,r=>{g.onClose(),r.preventDefault()}),onKeyDown:TA(A.onKeyDown,r=>{var C;const l=r.currentTarget.contains(r.target),c=f9e[g.dir].includes(r.key);l&&c&&(o.onOpenChange(!1),(C=a.trigger)==null||C.focus(),r.preventDefault())})})})})})});rHA.displayName=sHA;function IHA(A){return A?"open":"closed"}function GX(A){return A==="indeterminate"}function CoA(A){return GX(A)?"indeterminate":A?"checked":"unchecked"}function K9e(A){const e=document.activeElement;for(const t of A)if(t===e||(t.focus(),document.activeElement!==e))return}function U9e(A,e){return A.map((t,i)=>A[(e+i)%A.length])}function V9e(A,e,t){const i=e.length>1&&Array.from(e).every(a=>a===e[0])?e[0]:e,n=t?A.indexOf(t):-1;let o=U9e(A,Math.max(n,0));i.length===1&&(o=o.filter(a=>a!==t));const g=o.find(a=>a.toLowerCase().startsWith(i.toLowerCase()));return g!==t?g:void 0}function X9e(A,e){const{x:t,y:i}=A;let n=!1;for(let o=0,g=e.length-1;o<e.length;g=o++){const a=e[o],s=e[g],I=a.x,r=a.y,C=s.x,l=s.y;r>i!=l>i&&t<(C-I)*(i-r)/(l-r)+I&&(n=!n)}return n}function z9e(A,e){if(!e)return!1;const t={x:A.clientX,y:A.clientY};return X9e(t,e)}function zF(A){return e=>e.pointerType==="mouse"?A(e):void 0}var T9e=VSA,_9e=ooA,O9e=zSA,q9e=TSA,j9e=roA,P9e=_SA,$9e=DX,A5e=jSA,e5e=$SA,t5e=eHA,i5e=iHA,n5e=nHA,o5e=oHA,g5e=aHA,a5e=rHA,kX="DropdownMenu",[s5e,Vpi]=Tg(kX,[KSA]),gs=KSA(),[r5e,CHA]=s5e(kX),lHA=A=>{const{__scopeDropdownMenu:e,children:t,dir:i,open:n,defaultOpen:o,onOpenChange:g,modal:a=!0}=A,s=gs(e),I=p.useRef(null),[r,C]=is({prop:n,defaultProp:o??!1,onChange:g,caller:kX});return cA(r5e,{scope:e,triggerId:_o(),triggerRef:I,contentId:_o(),open:r,onOpenChange:C,onOpenToggle:p.useCallback(()=>C(l=>!l),[C]),modal:a,children:cA(T9e,{...s,open:r,onOpenChange:C,dir:i,modal:a,children:t})})};lHA.displayName=kX;var cHA="DropdownMenuTrigger",BHA=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,disabled:i=!1,...n}=A,o=CHA(cHA,t),g=gs(t);return cA(_9e,{asChild:!0,...g,children:cA(re.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...n,ref:Wu(e,o.triggerRef),onPointerDown:TA(A.onPointerDown,a=>{!i&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:TA(A.onKeyDown,a=>{i||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});BHA.displayName=cHA;var I5e="DropdownMenuPortal",QHA=A=>{const{__scopeDropdownMenu:e,...t}=A,i=gs(e);return cA(O9e,{...i,...t})};QHA.displayName=I5e;var EHA="DropdownMenuContent",uHA=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=CHA(EHA,t),o=gs(t),g=p.useRef(!1);return cA(q9e,{id:n.contentId,"aria-labelledby":n.triggerId,...o,...i,ref:e,onCloseAutoFocus:TA(A.onCloseAutoFocus,a=>{var s;g.current||(s=n.triggerRef.current)==null||s.focus(),g.current=!1,a.preventDefault()}),onInteractOutside:TA(A.onInteractOutside,a=>{const s=a.detail.originalEvent,I=s.button===0&&s.ctrlKey===!0,r=s.button===2||I;(!n.modal||r)&&(g.current=!0)}),style:{...A.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uHA.displayName=EHA;var C5e="DropdownMenuGroup",l5e=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=gs(t);return cA(j9e,{...n,...i,ref:e})});l5e.displayName=C5e;var c5e="DropdownMenuLabel",dHA=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=gs(t);return cA(P9e,{...n,...i,ref:e})});dHA.displayName=c5e;var B5e="DropdownMenuItem",hHA=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=gs(t);return cA($9e,{...n,...i,ref:e})});hHA.displayName=B5e;var Q5e="DropdownMenuCheckboxItem",mHA=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=gs(t);return cA(A5e,{...n,...i,ref:e})});mHA.displayName=Q5e;var E5e="DropdownMenuRadioGroup",pHA=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=gs(t);return cA(e5e,{...n,...i,ref:e})});pHA.displayName=E5e;var u5e="DropdownMenuRadioItem",fHA=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=gs(t);return cA(t5e,{...n,...i,ref:e})});fHA.displayName=u5e;var d5e="DropdownMenuItemIndicator",yHA=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=gs(t);return cA(i5e,{...n,...i,ref:e})});yHA.displayName=d5e;var h5e="DropdownMenuSeparator",bHA=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=gs(t);return cA(n5e,{...n,...i,ref:e})});bHA.displayName=h5e;var m5e="DropdownMenuArrow",p5e=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=gs(t);return cA(o5e,{...n,...i,ref:e})});p5e.displayName=m5e;var f5e="DropdownMenuSubTrigger",wHA=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=gs(t);return cA(g5e,{...n,...i,ref:e})});wHA.displayName=f5e;var y5e="DropdownMenuSubContent",DHA=p.forwardRef((A,e)=>{const{__scopeDropdownMenu:t,...i}=A,n=gs(t);return cA(a5e,{...n,...i,ref:e,style:{...A.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});DHA.displayName=y5e;var b5e=lHA,w5e=BHA,D5e=QHA,GHA=uHA,kHA=dHA,JHA=hHA,NHA=mHA,G5e=pHA,YHA=fHA,RHA=yHA,xHA=bHA,FHA=wHA,MHA=DHA;function rQ(A,e){if(A==null)return{};var t={},i=Object.keys(A),n,o;for(o=0;o<i.length;o++)n=i[o],!(e.indexOf(n)>=0)&&(t[n]=A[n]);return t}var k5e=["color"],vHA=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=rQ(A,k5e);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),J5e=["color"],TF=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=rQ(A,J5e);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),N5e=["color"],Y5e=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=rQ(A,N5e);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),R5e=["color"],x5e=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=rQ(A,R5e);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),F5e=["color"],LHA=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=rQ(A,F5e);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),M5e=["color"],v5e=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=rQ(A,M5e);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),L5e=["color"],SHA=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=rQ(A,L5e);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),S5e=["color"],H5e=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=rQ(A,S5e);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:i}))}),Z5e=["color"],W5e=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=rQ(A,Z5e);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),K5e=["color"],U5e=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=rQ(A,K5e);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))});const JX=b5e,NX=w5e,V5e=G5e,X5e=p.forwardRef(({className:A,inset:e,children:t,...i},n)=>p.createElement(FHA,{ref:n,className:Ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",A),...i},t,p.createElement(LHA,{className:"ml-auto h-4 w-4"})));X5e.displayName=FHA.displayName;const z5e=p.forwardRef(({className:A,...e},t)=>p.createElement(MHA,{ref:t,className:Ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",A),...e}));z5e.displayName=MHA.displayName;const _F=p.forwardRef(({className:A,sideOffset:e=4,...t},i)=>p.createElement(D5e,{container:p.useContext(Ry)},p.createElement(GHA,{ref:i,sideOffset:e,className:Ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",A),...t})));_F.displayName=GHA.displayName;const OF=p.forwardRef(({className:A,inset:e,...t},i)=>p.createElement(JHA,{ref:i,className:Ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",A),...t}));OF.displayName=JHA.displayName;const HHA=p.forwardRef(({className:A,children:e,checked:t,...i},n)=>p.createElement(NHA,{ref:n,className:Ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",A),checked:t,...i},p.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},p.createElement(RHA,null,p.createElement(TF,{className:"h-4 w-4"}))),e));HHA.displayName=NHA.displayName;const ZHA=p.forwardRef(({className:A,children:e,...t},i)=>p.createElement(YHA,{ref:i,className:Ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",A),...t},p.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},p.createElement(RHA,null,p.createElement(H5e,{className:"h-4 w-4 fill-current"}))),e));ZHA.displayName=YHA.displayName;const T5e=p.forwardRef(({className:A,inset:e,...t},i)=>p.createElement(kHA,{ref:i,className:Ce("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",A),...t}));T5e.displayName=kHA.displayName;const _5e=p.forwardRef(({className:A,...e},t)=>p.createElement(xHA,{ref:t,className:Ce("-mx-1 my-1 h-px bg-muted",A),...e}));_5e.displayName=xHA.displayName;const O5e=p.memo(function(A){const{item:e,openedKey:t,setOpenedKey:i}=A,{key:n,icon:o,disabled:g,options:a,value:s,onSelect:I,styles:r}=e,C=`${n}::button`,l=t===C,c=a.find(E=>E.key===s),B=c==null?void 0:c.icon;return b.createElement(JX,{modal:!1,open:l,onOpenChange:E=>i(E?C:"")},b.createElement($nA,{...A,item:cnA(A.item,E=>{c&&(E.label=`${E.label}: ${c.label}`)})},b.createElement(NX,{disabled:g,asChild:!0},b.createElement(fe,{className:"relative",disabled:g,variant:"none",size:"toolbar"},b.createElement(o,{className:"w-[18px] h-[18px]",style:r==null?void 0:r.icon}),B&&b.createElement(B,{style:r==null?void 0:r.icon,className:"absolute w-[11px] h-[11px] right-[7px] bottom-[5px]"})))),b.createElement(_F,{onCloseAutoFocus:E=>E.preventDefault()},b.createElement(V5e,{value:s,onValueChange:I},a.map(E=>{const u=E.icon;return b.createElement(ZHA,{key:E.key,value:E.key,className:"gap-2"},b.createElement(u,{className:"w-[18px] h-[18px]"}),E.label)}))))}),q5e=O5e,j5e="-",P5e=p.memo(function(A){return"checked"in A.item?b.createElement(s9e,{item:A.item,openedKey:A.openedKey,setOpenedKey:A.setOpenedKey}):"options"in A.item?b.createElement(q5e,{item:A.item,openedKey:A.openedKey,setOpenedKey:A.setOpenedKey}):b.createElement(o9e,{...A})}),$5e=P5e;var Aze="Separator",WHA="horizontal",eze=["horizontal","vertical"],KHA=p.forwardRef((A,e)=>{const{decorative:t,orientation:i=WHA,...n}=A,o=tze(i)?i:WHA,g=t?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return cA(re.div,{"data-orientation":o,...g,...n,ref:e})});KHA.displayName=Aze;function tze(A){return eze.includes(A)}var UHA=KHA;const loA=p.forwardRef(({className:A,orientation:e="horizontal",decorative:t=!0,...i},n)=>p.createElement(UHA,{ref:n,decorative:t,orientation:e,className:Ce("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",A),...i}));loA.displayName=UHA.displayName;const ize=p.memo(function({items:A}){const[e,t]=p.useState(null);return b.createElement("div",{className:"flex flex-wrap lg:flex-nowrap border my-1 w-full rounded overflow-hidden"},A.map((i,n)=>i===j5e?b.createElement(loA,{orientation:"vertical",className:"mx-1 my-1.5 h-6",key:n}):b.createElement($5e,{key:i.key,item:i,openedKey:e,setOpenedKey:t})))}),nze=ize,VHA=(A,e)=>{const t=b.useMemo(()=>{const i=A.split("+").map(n=>n.trim());return{key:i.filter(n=>/^[a-z]$/i.test(n))[0],ctrlKey:i.includes("Ctrl"),shiftKey:i.includes("Shift"),altKey:i.includes("Alt")}},[A]);b.useEffect(()=>{const i=n=>{n.ctrlKey===t.ctrlKey&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.key.toLowerCase()===t.key.toLowerCase()&&(e(),n.stopPropagation())};return document.body.addEventListener("keydown",i),()=>document.body.removeEventListener("keydown",i)},[t,e])},oze=(A,e,t)=>{const{leading:i=!0,trailing:n=!1}=t??{};let o=!1,g=!1;return()=>{if(o){g=!0;return}o=!0,i&&A(),setTimeout(()=>{g&&n&&A(),o=!1,g=!1},e)}},Hk=oze,gze="data:image/png;base64, ",aze=A=>{const{src:e,fallbackSrc:t,timeout:i,...n}=A,[o,g]=p.useState(!1),a=p.useRef(!1);return p.useEffect(()=>{const s=setTimeout(()=>{a.current||g(!0)},i);return()=>clearTimeout(s)},[]),b.createElement("img",{...n,src:o?t:e,onError:()=>{g(!0)},onLoad:()=>{a.current=!0}})};var YX="Checkbox",[sze,Xpi]=Tg(YX),[rze,coA]=sze(YX);function Ize(A){const{__scopeCheckbox:e,checked:t,children:i,defaultChecked:n,disabled:o,form:g,name:a,onCheckedChange:s,required:I,value:r="on",internal_do_not_use_render:C}=A,[l,c]=is({prop:t,defaultProp:n??!1,onChange:s,caller:YX}),[B,E]=p.useState(null),[u,d]=p.useState(null),f=p.useRef(!1),w=B?!!g||!!B.closest("form"):!0,y={checked:l,disabled:o,setChecked:c,control:B,setControl:E,name:a,form:g,value:r,hasConsumerStoppedPropagationRef:f,required:I,defaultChecked:_m(n)?!1:n,isFormControl:w,bubbleInput:u,setBubbleInput:d};return cA(rze,{scope:e,...y,children:Cze(C)?C(y):i})}var XHA="CheckboxTrigger",zHA=p.forwardRef(({__scopeCheckbox:A,onKeyDown:e,onClick:t,...i},n)=>{const{control:o,value:g,disabled:a,checked:s,required:I,setControl:r,setChecked:C,hasConsumerStoppedPropagationRef:l,isFormControl:c,bubbleInput:B}=coA(XHA,A),E=Te(n,r),u=p.useRef(s);return p.useEffect(()=>{const d=o==null?void 0:o.form;if(d){const f=()=>C(u.current);return d.addEventListener("reset",f),()=>d.removeEventListener("reset",f)}},[o,C]),cA(re.button,{type:"button",role:"checkbox","aria-checked":_m(s)?"mixed":s,"aria-required":I,"data-state":jHA(s),"data-disabled":a?"":void 0,disabled:a,value:g,...i,ref:E,onKeyDown:TA(e,d=>{d.key==="Enter"&&d.preventDefault()}),onClick:TA(t,d=>{C(f=>_m(f)?!0:!f),B&&c&&(l.current=d.isPropagationStopped(),l.current||d.stopPropagation())})})});zHA.displayName=XHA;var BoA=p.forwardRef((A,e)=>{const{__scopeCheckbox:t,name:i,checked:n,defaultChecked:o,required:g,disabled:a,value:s,onCheckedChange:I,form:r,...C}=A;return cA(Ize,{__scopeCheckbox:t,checked:n,defaultChecked:o,disabled:a,required:g,onCheckedChange:I,name:i,form:r,value:s,internal_do_not_use_render:({isFormControl:l})=>Ic(yy,{children:[cA(zHA,{...C,ref:e,__scopeCheckbox:t}),l&&cA(qHA,{__scopeCheckbox:t})]})})});BoA.displayName=YX;var THA="CheckboxIndicator",_HA=p.forwardRef((A,e)=>{const{__scopeCheckbox:t,forceMount:i,...n}=A,o=coA(THA,t);return cA(qg,{present:i||_m(o.checked)||o.checked===!0,children:cA(re.span,{"data-state":jHA(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:e,style:{pointerEvents:"none",...A.style}})})});_HA.displayName=THA;var OHA="CheckboxBubbleInput",qHA=p.forwardRef(({__scopeCheckbox:A,...e},t)=>{const{control:i,hasConsumerStoppedPropagationRef:n,checked:o,defaultChecked:g,required:a,disabled:s,name:I,value:r,form:C,bubbleInput:l,setBubbleInput:c}=coA(OHA,A),B=Te(t,c),E=lF(o),u=cF(i);p.useEffect(()=>{const f=l;if(!f)return;const w=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(w,"checked").set,G=!n.current;if(E!==o&&y){const R=new Event("click",{bubbles:G});f.indeterminate=_m(o),y.call(f,_m(o)?!1:o),f.dispatchEvent(R)}},[l,E,o,n]);const d=p.useRef(_m(o)?!1:o);return cA(re.input,{type:"checkbox","aria-hidden":!0,defaultChecked:g??d.current,required:a,disabled:s,name:I,value:r,form:C,...e,tabIndex:-1,ref:B,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});qHA.displayName=OHA;function Cze(A){return typeof A=="function"}function _m(A){return A==="indeterminate"}function jHA(A){return _m(A)?"indeterminate":A?"checked":"unchecked"}const Bc=p.forwardRef(({className:A,...e},t)=>p.createElement(BoA,{ref:t,className:Ce("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",A),...e},p.createElement(_HA,{className:Ce("flex items-center justify-center text-current")},p.createElement(TF,{className:"h-4 w-4"}))));Bc.displayName=BoA.displayName;const oo=p.forwardRef(({className:A,type:e,...t},i)=>p.createElement("input",{type:e,className:Ce("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",A),ref:i,...t}));oo.displayName="Input";const lze=VFA(A=>Ik(A,600)),cze=100;function Bze(A){const{t:e}=ve("translation",{keyPrefix:"main.tabpanel.settings"}),t=lze(0,a=>A.setValue(a))[1],[i,n]=b.useState(A.value>0?A.value:cze),[o,g]=b.useState(A.value>0);return b.createElement("div",{className:"w-60 mt-2 p-2"},b.createElement(oo,{className:"h-8",type:"number",min:0,step:10,value:i,disabled:!o,onChange:a=>{t(parseInt(a.target.value)),n(parseInt(a.target.value))}}),b.createElement("div",{className:"ml-1 mt-3 flex items-center"},b.createElement(Bc,{className:"mr-1",checked:o,onCheckedChange:a=>{g(!!a),a?A.setValue(i):A.setValue(0)}}),e("limit")))}function Qze(A){const e=A.filter((t,i)=>typeof t!="string"||t!=="-"||A[i+1]!=="-");return e.slice(e[0]==="-"?1:0,e[e.length-1]==="-"?-1:void 0)}const Eze=A=>b.createElement(aze,{id:"kanaries-logo",className:lc(A.className,"opacity-70 hover:opacity-100"),style:A.style,src:"https://imagedelivery.net/tSvh1MGEu9IgUanmf58srQ/b6bc899f-a129-4c3a-d08f-d406166d0c00/public",fallbackSrc:gze,timeout:1e3,alt:"kanaries documents"}),uze=({rendererHandler:A,csvHandler:e,extra:t=[],exclude:i=[],experimentalFeatures:n})=>{const o=xt(),{config:g,layout:a,canUndo:s,canRedo:I,limit:r,paintInfo:C}=o,{t:l}=ve(),{t:c}=ve("translation",{keyPrefix:"main.tabpanel.settings"}),{defaultAggregated:B,coordSystem:E="generic",geoms:[u]}=g,{showTableSummary:d,stack:f,interactiveScale:w,size:{mode:y,width:G,height:R},showActions:x}=a,F=p.useCallback(Hk(()=>{var v;(v=A==null?void 0:A.current)==null||v.downloadPNG()},200),[A]),Q=p.useCallback(Hk(()=>{var v;(v=A==null?void 0:A.current)==null||v.downloadSVG()},200),[A]),k=p.useCallback(Hk(()=>{var v;(v=A==null?void 0:A.current)==null||v.getCanvasData().then(K=>navigator.clipboard.writeText(K.join(",")))},200),[A]),h=p.useCallback(Hk(()=>{var v;(v=e==null?void 0:e.current)==null||v.download()},200),[]),N=p.useMemo(()=>{const v=[{key:"undo",label:"undo (Ctrl + Z)",icon:U=>(VHA("Ctrl+Z",o.undo.bind(o)),b.createElement(XLe,{...U})),onClick:()=>o.undo(),disabled:!s},{key:"redo",label:"redo (Ctrl+Shift+Z)",icon:U=>(VHA("Ctrl+Shift+Z",o.redo.bind(o)),b.createElement(_Le,{...U})),onClick:()=>o.redo(),disabled:!I},"-",{key:"aggregation",label:c("toggle.aggregation"),icon:LSe,checked:B,onChange:U=>{o.setVisualConfig("defaultAggregated",U)}},{key:"mark_type",label:l("constant.mark_type.__enum__"),icon:HHe,styles:{icon:{color:"rgb(294,115,22)"}},options:ke.GEOM_TYPES[E].map(U=>({key:U,label:l(`constant.mark_type.${U}`),icon:{auto:vFA,bar:V=>b.createElement("svg",{stroke:"currentColor",fill:"none",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9,4v16h6v-16Z"})),line:V=>b.createElement("svg",{stroke:"currentColor",fill:"none",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5,6L19,18"})),area:V=>b.createElement("svg",{stroke:"none",fill:"currentColor",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5,20v-17l14,4V20Z"})),trail:V=>b.createElement("svg",{stroke:"none",fill:"currentColor",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5,6l7,4l7-2v2l-7,4l-7,-4z"})),point:V=>b.createElement("svg",{stroke:"currentColor",fill:"none",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9,12 A3,3,0,0,1,16,12 A3,3,0,0,1,9,12"})),circle:V=>b.createElement("svg",{stroke:"none",fill:"currentColor",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6,12 A6,6,0,0,1,18,12 A6,6,0,0,1,6,12"})),tick:V=>b.createElement("svg",{stroke:"currentColor",fill:"none",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5,12h14"})),rect:V=>b.createElement("svg",{stroke:"none",fill:"currentColor",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5,5v14h14v-14z"})),text:V=>b.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 21l5.25-11.25L21 21m-9-3h7.5M3 5.621a48.474 48.474 0 016-.371m0 0c1.12 0 2.233.038 3.334.114M9 5.25V3m3.334 2.364C11.176 10.658 7.69 15.08 3 17.502m9.334-12.138c.896.061 1.785.147 2.666.257m-4.589 8.495a18.023 18.023 0 01-3.827-5.802"})),arc:V=>b.createElement("svg",{stroke:"none",fill:"currentColor",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12,21l-9,-15a12,12,0,0,1,18,0Z"})),boxplot:V=>b.createElement("svg",{stroke:"currentColor",fill:"none",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7,7v9h10v-9Zm0,4h8M12,7v-6m-3,0h6M12,16v7m-3,0h6"})),table:V=>b.createElement("svg",{stroke:"currentColor",fill:"none",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 01-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0112 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"})),poi:uHe,choropleth:xHe}[U]})),value:u,onSelect:U=>{o.setVisualConfig("geoms",[U])}},{key:"stack_mode",label:l("constant.stack_mode.__enum__"),icon:vHe,options:ke.STACK_MODE.map(U=>({key:U,label:l(`constant.stack_mode.${U}`),icon:{none:PHe,stack:QSe,normalize:jLe,center:sF}[U]})),value:f,onSelect:U=>{o.setVisualLayout("stack",U)}},"-",{key:"transpose",label:c("button.transpose"),icon:U=>b.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...U},b.createElement("path",{d:"M7.59664 2.93628C7.76085 3.06401 8.00012 2.94698 8.00012 2.73895V1.99998C9.98143 2 11.1848 2.3637 11.9105 3.08945C12.6363 3.81522 13 5.0186 13 6.99998C13 7.27613 13.2239 7.49998 13.5 7.49998C13.7761 7.49998 14 7.27613 14 6.99998C14 4.9438 13.6325 3.39719 12.6176 2.38234C11.6028 1.36752 10.0562 0.999999 8.00012 0.999984V0.261266C8.00012 0.0532293 7.76085 -0.0637944 7.59664 0.063928L6.00384 1.30277C5.87516 1.40286 5.87516 1.59735 6.00384 1.69744L7.59664 2.93628ZM9.5 5H2.5C2.22386 5 2 5.22386 2 5.5V12.5C2 12.7761 2.22386 13 2.5 13H9.5C9.77614 13 10 12.7761 10 12.5V5.5C10 5.22386 9.77614 5 9.5 5ZM2.5 4C1.67157 4 1 4.67157 1 5.5V12.5C1 13.3284 1.67157 14 2.5 14H9.5C10.3284 14 11 13.3284 11 12.5V5.5C11 4.67157 10.3284 4 9.5 4H2.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),onClick:()=>o.transpose()},{key:"sort:asc",label:c("button.ascending"),icon:JiA,onClick:()=>o.applyDefaultSort("ascending")},{key:"sort:dec",label:c("button.descending"),icon:kiA,onClick:()=>o.applyDefaultSort("descending")},{key:"table:summary",label:c("table.summary"),icon:HFA,checked:d,onChange:U=>{o.setVisualLayout("showTableSummary",U)}},...n!=null&&n.computedField?[{key:"field:add",label:"Add Computed Field",icon:ZSe,onClick:()=>o.setComputedFieldFid("")}]:[],"-",{key:"axes_resize",label:c("toggle.axes_resize"),icon:U=>b.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...U},b.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159ZM4.25 6.5C4.25 6.22386 4.47386 6 4.75 6H6V4.75C6 4.47386 6.22386 4.25 6.5 4.25C6.77614 4.25 7 4.47386 7 4.75V6H8.25C8.52614 6 8.75 6.22386 8.75 6.5C8.75 6.77614 8.52614 7 8.25 7H7V8.25C7 8.52614 6.77614 8.75 6.5 8.75C6.22386 8.75 6 8.52614 6 8.25V7H4.75C4.47386 7 4.25 6.77614 4.25 6.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),checked:w,onChange:U=>{o.setVisualLayout("interactiveScale",U)}},{key:"scale",icon:U=>b.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...U},b.createElement("path",{d:"M3.00014 2.73895C3.00014 2.94698 2.76087 3.06401 2.59666 2.93628L1.00386 1.69744C0.875177 1.59735 0.875177 1.40286 1.00386 1.30277L2.59666 0.063928C2.76087 -0.0637944 3.00014 0.0532293 3.00014 0.261266V1.00012H9.00009V0.261296C9.00009 0.0532591 9.23936 -0.0637646 9.40358 0.0639578L10.9964 1.3028C11.1251 1.40289 11.1251 1.59738 10.9964 1.69747L9.40358 2.93631C9.23936 3.06404 9.00009 2.94701 9.00009 2.73898V2.00012H3.00014V2.73895ZM9.50002 4.99998H2.50002C2.22388 4.99998 2.00002 5.22384 2.00002 5.49998V12.5C2.00002 12.7761 2.22388 13 2.50002 13H9.50002C9.77616 13 10 12.7761 10 12.5V5.49998C10 5.22384 9.77616 4.99998 9.50002 4.99998ZM2.50002 3.99998C1.67159 3.99998 1.00002 4.67156 1.00002 5.49998V12.5C1.00002 13.3284 1.67159 14 2.50002 14H9.50002C10.3284 14 11 13.3284 11 12.5V5.49998C11 4.67156 10.3284 3.99998 9.50002 3.99998H2.50002ZM14.7389 6.00001H14V12H14.7389C14.9469 12 15.064 12.2393 14.9362 12.4035L13.6974 13.9963C13.5973 14.125 13.4028 14.125 13.3027 13.9963L12.0639 12.4035C11.9362 12.2393 12.0532 12 12.2612 12H13V6.00001H12.2612C12.0532 6.00001 11.9361 5.76074 12.0639 5.59653L13.3027 4.00373C13.4028 3.87505 13.5973 3.87505 13.6974 4.00374L14.9362 5.59653C15.0639 5.76074 14.9469 6.00001 14.7389 6.00001Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),label:l("constant.layout_type.__enum__"),options:[{key:"fixed",label:l("constant.layout_type.fixed"),icon:U=>b.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...U},b.createElement("path",{d:"M1.44995 0.949951C1.31734 0.949951 1.19016 1.00263 1.0964 1.0964C1.00263 1.19017 0.949951 1.31735 0.949951 1.44995L0.949966 3.44995C0.949969 3.7261 1.17383 3.94995 1.44997 3.94995C1.72611 3.94995 1.94997 3.72609 1.94997 3.44995L1.94995 1.94995H3.44997C3.72611 1.94995 3.94997 1.72609 3.94997 1.44995C3.94997 1.17381 3.72611 0.949951 3.44997 0.949951H1.44995ZM5.94995 0.949951C5.67381 0.949951 5.44995 1.17381 5.44995 1.44995C5.44995 1.72609 5.67381 1.94995 5.94995 1.94995H8.94995C9.22609 1.94995 9.44995 1.72609 9.44995 1.44995C9.44995 1.17381 9.22609 0.949951 8.94995 0.949951H5.94995ZM5.44995 13.45C5.44995 13.1738 5.67381 12.95 5.94995 12.95H8.94995C9.22609 12.95 9.44995 13.1738 9.44995 13.45C9.44995 13.7261 9.22609 13.95 8.94995 13.95H5.94995C5.67381 13.95 5.44995 13.7261 5.44995 13.45ZM1.94995 5.94995C1.94995 5.67381 1.72609 5.44995 1.44995 5.44995C1.17381 5.44995 0.949951 5.67381 0.949951 5.94995V8.94995C0.949951 9.22609 1.17381 9.44995 1.44995 9.44995C1.72609 9.44995 1.94995 9.22609 1.94995 8.94995V5.94995ZM13.45 5.44995C13.7261 5.44995 13.95 5.67381 13.95 5.94995V8.94995C13.95 9.22609 13.7261 9.44995 13.45 9.44995C13.1738 9.44995 12.95 9.22609 12.95 8.94995V5.94995C12.95 5.67381 13.1738 5.44995 13.45 5.44995ZM11.45 0.949951C11.1738 0.949951 10.95 1.17381 10.95 1.44995C10.95 1.72609 11.1738 1.94995 11.45 1.94995H12.9499V3.44995C12.9499 3.72609 13.1738 3.94995 13.4499 3.94995C13.7261 3.94995 13.9499 3.72609 13.9499 3.44995V1.44995C13.9499 1.17381 13.7252 0.949951 13.449 0.949951H11.45ZM1.44995 10.95C1.72609 10.95 1.94995 11.1738 1.94995 11.45V12.95H3.44997C3.72611 12.95 3.94997 13.1738 3.94997 13.45C3.94997 13.7261 3.72611 13.95 3.44997 13.95H1.44995C1.17381 13.95 0.949951 13.7261 0.949951 13.45V11.45C0.949951 11.1738 1.17381 10.95 1.44995 10.95ZM13.95 11.45C13.95 11.1738 13.7261 10.95 13.45 10.95C13.1738 10.9499 12.95 11.1738 12.95 11.4499L12.9491 12.95H11.45C11.1738 12.95 10.95 13.1738 10.95 13.45C10.95 13.7261 11.1738 13.95 11.45 13.95H13.4499C13.7261 13.95 13.9499 13.7261 13.9499 13.45L13.95 11.45Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))},{key:"auto",label:l("constant.layout_type.auto"),icon:U=>b.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...U},b.createElement("path",{d:"M1.49988 2.00012C1.77602 2.00012 1.99988 1.77626 1.99988 1.50012C1.99988 1.22398 1.77602 1.00012 1.49988 1.00012C1.22374 1.00012 0.999878 1.22398 0.999878 1.50012C0.999878 1.77626 1.22374 2.00012 1.49988 2.00012ZM4.49988 2.00012C4.77602 2.00012 4.99988 1.77626 4.99988 1.50012C4.99988 1.22398 4.77602 1.00012 4.49988 1.00012C4.22374 1.00012 3.99988 1.22398 3.99988 1.50012C3.99988 1.77626 4.22374 2.00012 4.49988 2.00012ZM7.99988 1.50012C7.99988 1.77626 7.77602 2.00012 7.49988 2.00012C7.22374 2.00012 6.99988 1.77626 6.99988 1.50012C6.99988 1.22398 7.22374 1.00012 7.49988 1.00012C7.77602 1.00012 7.99988 1.22398 7.99988 1.50012ZM10.4999 2.00012C10.776 2.00012 10.9999 1.77626 10.9999 1.50012C10.9999 1.22398 10.776 1.00012 10.4999 1.00012C10.2237 1.00012 9.99988 1.22398 9.99988 1.50012C9.99988 1.77626 10.2237 2.00012 10.4999 2.00012ZM13.9999 1.50012C13.9999 1.77626 13.776 2.00012 13.4999 2.00012C13.2237 2.00012 12.9999 1.77626 12.9999 1.50012C12.9999 1.22398 13.2237 1.00012 13.4999 1.00012C13.776 1.00012 13.9999 1.22398 13.9999 1.50012ZM1.49988 14.0001C1.77602 14.0001 1.99988 13.7763 1.99988 13.5001C1.99988 13.224 1.77602 13.0001 1.49988 13.0001C1.22374 13.0001 0.999878 13.224 0.999878 13.5001C0.999878 13.7763 1.22374 14.0001 1.49988 14.0001ZM1.99988 10.5001C1.99988 10.7763 1.77602 11.0001 1.49988 11.0001C1.22374 11.0001 0.999878 10.7763 0.999878 10.5001C0.999878 10.224 1.22374 10.0001 1.49988 10.0001C1.77602 10.0001 1.99988 10.224 1.99988 10.5001ZM1.49988 8.00012C1.77602 8.00012 1.99988 7.77626 1.99988 7.50012C1.99988 7.22398 1.77602 7.00012 1.49988 7.00012C1.22374 7.00012 0.999878 7.22398 0.999878 7.50012C0.999878 7.77626 1.22374 8.00012 1.49988 8.00012ZM1.99988 4.50012C1.99988 4.77626 1.77602 5.00012 1.49988 5.00012C1.22374 5.00012 0.999878 4.77626 0.999878 4.50012C0.999878 4.22398 1.22374 4.00012 1.49988 4.00012C1.77602 4.00012 1.99988 4.22398 1.99988 4.50012ZM13.4999 11.0001C13.776 11.0001 13.9999 10.7763 13.9999 10.5001C13.9999 10.224 13.776 10.0001 13.4999 10.0001C13.2237 10.0001 12.9999 10.224 12.9999 10.5001C12.9999 10.7763 13.2237 11.0001 13.4999 11.0001ZM13.9999 7.50012C13.9999 7.77626 13.776 8.00012 13.4999 8.00012C13.2237 8.00012 12.9999 7.77626 12.9999 7.50012C12.9999 7.22398 13.2237 7.00012 13.4999 7.00012C13.776 7.00012 13.9999 7.22398 13.9999 7.50012ZM13.4999 5.00012C13.776 5.00012 13.9999 4.77626 13.9999 4.50012C13.9999 4.22398 13.776 4.00012 13.4999 4.00012C13.2237 4.00012 12.9999 4.22398 12.9999 4.50012C12.9999 4.77626 13.2237 5.00012 13.4999 5.00012ZM4.99988 13.5001C4.99988 13.7763 4.77602 14.0001 4.49988 14.0001C4.22374 14.0001 3.99988 13.7763 3.99988 13.5001C3.99988 13.224 4.22374 13.0001 4.49988 13.0001C4.77602 13.0001 4.99988 13.224 4.99988 13.5001ZM7.49988 14.0001C7.77602 14.0001 7.99988 13.7763 7.99988 13.5001C7.99988 13.224 7.77602 13.0001 7.49988 13.0001C7.22374 13.0001 6.99988 13.224 6.99988 13.5001C6.99988 13.7763 7.22374 14.0001 7.49988 14.0001ZM10.9999 13.5001C10.9999 13.7763 10.776 14.0001 10.4999 14.0001C10.2237 14.0001 9.99988 13.7763 9.99988 13.5001C9.99988 13.224 10.2237 13.0001 10.4999 13.0001C10.776 13.0001 10.9999 13.224 10.9999 13.5001ZM13.4999 14.0001C13.776 14.0001 13.9999 13.7763 13.9999 13.5001C13.9999 13.224 13.776 13.0001 13.4999 13.0001C13.2237 13.0001 12.9999 13.224 12.9999 13.5001C12.9999 13.7763 13.2237 14.0001 13.4999 14.0001ZM3.99988 5.00012C3.99988 4.44784 4.44759 4.00012 4.99988 4.00012H9.99988C10.5522 4.00012 10.9999 4.44784 10.9999 5.00012V10.0001C10.9999 10.5524 10.5522 11.0001 9.99988 11.0001H4.99988C4.44759 11.0001 3.99988 10.5524 3.99988 10.0001V5.00012ZM4.99988 5.00012H9.99988V10.0001H4.99988V5.00012Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))},{key:"full",label:l("constant.layout_type.full"),icon:U=>b.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...U},b.createElement("path",{d:"M1.99998 0.999976C1.44769 0.999976 0.999976 1.44769 0.999976 1.99998V13C0.999976 13.5523 1.44769 14 1.99998 14H13C13.5523 14 14 13.5523 14 13V1.99998C14 1.44769 13.5523 0.999976 13 0.999976H1.99998ZM1.99998 1.99998L13 1.99998V13H1.99998V1.99998ZM4.49996 3.99996C4.22382 3.99996 3.99996 4.22382 3.99996 4.49996V10.5C3.99996 10.7761 4.22382 11 4.49996 11H10.5C10.7761 11 11 10.7761 11 10.5V4.49996C11 4.22382 10.7761 3.99996 10.5 3.99996H4.49996ZM4.99996 9.99996V4.99996H9.99996V9.99996H4.99996Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}],value:y,onSelect:U=>{o.setVisualLayout("size",{...a.size,mode:U})},form:b.createElement(u3e,{width:G,height:R,onHeightChange:U=>{o.setVisualLayout("size",{mode:"fixed",height:U,width:a.size.width})},onWidthChange:U=>{o.setVisualLayout("size",{mode:"fixed",width:U,height:a.size.height})}})},"-",{key:"coord_system",label:l("constant.coord_system.__enum__"),icon:U=>b.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...U},b.createElement("path",{d:"M8.8914 2.1937C9.1158 2.35464 9.16725 2.66701 9.00631 2.89141L2.47388 12H13.5C13.7761 12 14 12.2239 14 12.5C14 12.7762 13.7761 13 13.5 13H1.5C1.31254 13 1.14082 12.8952 1.0552 12.7284C0.969578 12.5616 0.984438 12.361 1.09369 12.2086L8.19369 2.30862C8.35462 2.08422 8.667 2.03277 8.8914 2.1937ZM11.1 6.50001C11.1 6.22387 11.3238 6.00001 11.6 6.00001C11.8761 6.00001 12.1 6.22387 12.1 6.50001C12.1 6.77615 11.8761 7.00001 11.6 7.00001C11.3238 7.00001 11.1 6.77615 11.1 6.50001ZM10.4 4.00001C10.1239 4.00001 9.90003 4.22387 9.90003 4.50001C9.90003 4.77615 10.1239 5.00001 10.4 5.00001C10.6762 5.00001 10.9 4.77615 10.9 4.50001C10.9 4.22387 10.6762 4.00001 10.4 4.00001ZM12.1 8.50001C12.1 8.22387 12.3238 8.00001 12.6 8.00001C12.8761 8.00001 13.1 8.22387 13.1 8.50001C13.1 8.77615 12.8761 9.00001 12.6 9.00001C12.3238 9.00001 12.1 8.77615 12.1 8.50001ZM13.4 10C13.1239 10 12.9 10.2239 12.9 10.5C12.9 10.7761 13.1239 11 13.4 11C13.6762 11 13.9 10.7761 13.9 10.5C13.9 10.2239 13.6762 10 13.4 10Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),options:ke.COORD_TYPES.map(U=>({key:U,label:l(`constant.coord_system.${U}`),icon:{generic:V=>b.createElement("svg",{stroke:"currentColor",fill:"none",strokeWidth:"1.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":!0,...V},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2 12h20M12 2v20"}),b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 7h2M12 16h2M7 12v-2M16 12v-2"})),geographic:jSe}[U]})),value:E,onSelect:U=>{const V=U;o.setCoordSystem(V)}},E==="geographic"&&u==="choropleth"&&{key:"geojson",label:c("button.geojson"),icon:AHe,onClick:()=>{o.setShowGeoJSONConfigPanel(!0)}},"-",{key:"debug",label:c("toggle.debug"),icon:OHe,checked:x,onChange:U=>{o.setVisualLayout("showActions",U)}},...E==="generic"?[{key:"export_chart",label:c("button.export_chart"),icon:kHe,form:b.createElement("div",{className:"flex flex-col"},b.createElement(fe,{variant:"ghost","aria-label":c("button.export_chart_as",{type:"png"}),onClick:()=>F()},c("button.export_chart_as",{type:"png"})),b.createElement(fe,{variant:"ghost","aria-label":c("button.export_chart_as",{type:"svg"}),onClick:()=>Q()},c("button.export_chart_as",{type:"svg"})),b.createElement(fe,{variant:"ghost","aria-label":c("button.export_chart_as",{type:"base64"}),onClick:()=>k()},c("button.export_chart_as",{type:"base64"})))}]:[],{key:"csv",label:c("button.export_chart_as",{type:"csv"}),icon:HFA,onClick:h},{key:"config",label:c("button.config"),icon:MFA,onClick:()=>{o.setShowVisualConfigPanel(!0)}},{key:"export_code",label:c("button.export_code"),icon:U=>b.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...U},b.createElement("path",{d:"M9.96424 2.68571C10.0668 2.42931 9.94209 2.13833 9.6857 2.03577C9.4293 1.93322 9.13832 2.05792 9.03576 2.31432L5.03576 12.3143C4.9332 12.5707 5.05791 12.8617 5.3143 12.9642C5.5707 13.0668 5.86168 12.9421 5.96424 12.6857L9.96424 2.68571ZM3.85355 5.14646C4.04882 5.34172 4.04882 5.6583 3.85355 5.85356L2.20711 7.50001L3.85355 9.14646C4.04882 9.34172 4.04882 9.6583 3.85355 9.85356C3.65829 10.0488 3.34171 10.0488 3.14645 9.85356L1.14645 7.85356C0.951184 7.6583 0.951184 7.34172 1.14645 7.14646L3.14645 5.14646C3.34171 4.9512 3.65829 4.9512 3.85355 5.14646ZM11.1464 5.14646C11.3417 4.9512 11.6583 4.9512 11.8536 5.14646L13.8536 7.14646C14.0488 7.34172 14.0488 7.6583 13.8536 7.85356L11.8536 9.85356C11.6583 10.0488 11.3417 10.0488 11.1464 9.85356C10.9512 9.6583 10.9512 9.34172 11.1464 9.14646L12.7929 7.50001L11.1464 5.85356C10.9512 5.6583 10.9512 5.34172 11.1464 5.14646Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),onClick:()=>{o.setShowCodeExportPanel(!0)}},...t.length===0?[]:["-",...t],"-",{key:"limit_axis",label:c("limit"),icon:U=>b.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...U},b.createElement("path",{d:"M9.94969 7.49989C9.94969 8.85288 8.85288 9.94969 7.49989 9.94969C6.14691 9.94969 5.0501 8.85288 5.0501 7.49989C5.0501 6.14691 6.14691 5.0501 7.49989 5.0501C8.85288 5.0501 9.94969 6.14691 9.94969 7.49989ZM10.8632 8C10.6213 9.64055 9.20764 10.8997 7.49989 10.8997C5.79214 10.8997 4.37847 9.64055 4.13662 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H4.13659C4.37835 5.35935 5.79206 4.1001 7.49989 4.1001C9.20772 4.1001 10.6214 5.35935 10.8632 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H10.8632Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),form:b.createElement(Bze,{value:r,setValue:U=>{o.setVisualConfig("limit",U)}})},{key:"painter",label:C.type==="error"?c(`button.disabled_painter.${C.key}`):c("button.painter"),icon:fHe,disabled:C.type==="error",onClick:()=>{o.setShowPainter(!0)}},"-",{key:"kanaries",label:"kanaries docs",href:"https://docs.kanaries.net",icon:Eze,styles:{icon:{height:20,width:"auto"}}}].filter(Boolean),K=Qze(v.filter(U=>typeof U=="string"||!i.includes(U.key)));switch(o.config.geoms[0]){case"table":return K;default:return K.filter(U=>typeof U=="string"||U.key!=="table:summary")}},[o,s,I,B,u,E,f,w,y,G,R,x,F,Q,t,i,r,d,n,C]);return b.createElement(nze,{items:N})},dze=ze(uze),hze=A=>{const{t:e}=ve("translation",{keyPrefix:"constant.draggable_key"});return b.createElement(yze,{className:"sm:ml-0.5 my-0.5 border relative",style:A.style},b.createElement("div",{className:"fl-header border-r cursor-default select-none"},b.createElement("h4",{className:"font-normal"},e(A.name))),b.createElement("div",{className:"fl-container overflow-hidden"},A.children))},PHA=A=>{const{t:e}=ve("translation",{keyPrefix:"constant.draggable_key"});return b.createElement("div",{className:"my-0.5 sm:mx-0.5 text-xs border",style:A.style},b.createElement("div",{className:"border-b p-2 cursor-default select-none"},b.createElement("h4",{className:"font-normal"},e(A.name))),b.createElement("div",null,A.children))},mze=A=>{const{t:e}=ve("translation",{keyPrefix:"constant.draggable_key"});return b.createElement("div",{className:"my-0.5 sm:mx-0.5 text-xs border"},b.createElement("div",{className:"border-b p-2 cursor-default select-none"},b.createElement("h4",{className:"font-normal"},e("filters"))),b.createElement("div",null,A.children))},pze=an.div`
    display: flex;
    padding: 0.2em;
    min-height: 2.4em;
    flex-wrap: wrap;
    > div {
        margin: 1px;
    }
    touch-action: none;
`,fze=an.div({display:"flex",flexDirection:"column",paddingBlock:"0.5em 0.8em",paddingInline:"0.2em",minHeight:"4em","> div":{marginBlock:"0.3em",marginInline:"1px"}}),yze=an.div`
    display: flex;
    font-size: 12px;
    div.fl-header {
        /* flex-basis: 100px; */
        width: 100px;
        flex-shrink: 0;
        h4 {
            margin: 0.6em;
            font-weight: 400;
        }
    }
    div.fl-container {
        flex-grow: 10;
        position: relative;
    }
`;an.div`
    border: 1px solid #e5e7eb;
    @media (prefers-color-scheme: dark) {
        border: 1px solid #2d3748;
    }
    font-size: 12px;
    margin: 0.2em;

    .flt-header {
        border-bottom: 1px solid #e5e7eb;
        @media (prefers-color-scheme: dark) {
            border-bottom: 1px solid #2d3748;
        }
        padding: 0.6em;

        > h4 {
            font-weight: 400;
        }
    }

    .flt-container {
    }
`;const bze=an.div`
    background-color: ${A=>A.colType==="continuous"?"hsl(var(--background))":"hsl(var(--primary))"};
    border-color: ${A=>A.colType==="continuous"?"hsl(var(--muted-foreground))":"hsl(var(--background))"};
    color: ${A=>A.colType==="continuous"?"hsl(var(--foreground))":"hsl(var(--primary-foreground))"};
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-align-items: center;
    -webkit-user-select: none;
    align-items: center;
    border-radius: calc(var(--radius) - 2px);
    border-style: solid;
    border-width: 1px;
    box-sizing: border-box;
    cursor: default;
    display: -webkit-flex;
    display: flex;
    font-size: 12px;
    height: 20px;
    min-width: 150px;
    max-width: 300px;
    /* overflow-y: hidden; */
    padding: 0 10px;
    user-select: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* --tw-ring-offset-shadow: 0 0 #0000;
    --tw-ring-shadow: 0 0 #0000;
    --tw-shadow-color: rgb(6 182 212/0.5);
    --tw-shadow: var(--tw-shadow-colored);
    --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);
    box-shadow: var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow); */
`;function QoA(A,e){return new Proxy(A,{get(t,i){return e[i]?typeof t[i]=="function"?(...n)=>e[i](n,(...o)=>t[i].call(t,...o)):e[i]([],t[i]):t[i]}})}window["__react-beautiful-dnd-disable-dev-warnings"]=!0,window["__react-beautiful-dnd-disable-scroll-hack"]=!0;const RX=p.createContext({current:null});function TC(A){const e=p.useContext(RX);return p.useCallback(t=>{if(t===null)return A(null);const i=Object.defineProperty(t,"getBoundingClientRect",{get(){return()=>{var n;const o=(n=e.current)==null?void 0:n.getBoundingClientRect(),g=HTMLElement.prototype.getBoundingClientRect.call(t);return o?new DOMRect(g.x-o.x,g.y-o.y,g.width,g.height):g}},configurable:!0});A(i)},[A])}function wze(A){return e=>{const t=p.useContext(RX),i=QoA(e,{tryGetLock:(n,o)=>{const g=o(...n);return g===null?null:QoA(g,{fluidLift:([a],s)=>{var I;const r=(I=t.current)==null?void 0:I.getBoundingClientRect(),C=s(r?{x:a.x-r.x,y:a.y-r.y}:a);return QoA(C,{move:([l],c)=>{var B;const E=(B=t.current)==null?void 0:B.getBoundingClientRect();return c(E?{x:l.x-E.x,y:l.y-E.y}:l),C}})}})}});return A(i)}}const Dze=[z1A,_1A,T1A].map(wze),Gze=A=>{const e=xt(),t=p.useRef(null),i=p.useCallback((n,o)=>{if(!n.destination){e.removeField(n.source.droppableId,n.source.index);return}const g=n.destination;if(g.droppableId===n.source.droppableId){if(g.index===n.source.index)return;e.reorderField(g.droppableId,n.source.index,g.index)}else{let a=n.source.droppableId,s=g.droppableId;e.moveField(a,n.source.index,s,g.index)}},[e]);return b.createElement(RX.Provider,{value:t},b.createElement("div",{className:"scale-100 w-full h-full",ref:t},b.createElement(bFe,{enableDefaultSensors:!1,sensors:Dze,onDragEnd:i,onDragStart:()=>{},onDragUpdate:()=>{}},A.children)))},kze=Gze,qF=[{id:"columns",mode:0},{id:"rows",mode:0},{id:"color",mode:1},{id:"opacity",mode:1},{id:"size",mode:1},{id:"shape",mode:1},{id:"theta",mode:1},{id:"radius",mode:1},{id:"longitude",mode:1},{id:"latitude",mode:1},{id:"geoId",mode:1},{id:"filters",mode:1},{id:"details",mode:1},{id:"text",mode:1}],Jze=A=>{const{options:e=[],disable:t,position:i="start"}=A;return b.createElement(JX,null,b.createElement(NX,{disabled:t,asChild:!0},A.children),b.createElement(_F,{align:i},e.map((n,o)=>b.createElement(OF,{key:n.value,onClick:()=>{A.onSelect&&!A.disable&&A.onSelect(n.value,o)}},n.label))))},xX=Jze;var Nze=Object.defineProperty,Yze=(A,e,t)=>e in A?Nze(A,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):A[e]=t,EoA=(A,e,t)=>(Yze(A,typeof e!="symbol"?e+"":e,t),t);let Rze=class{constructor(){EoA(this,"current",this.detect()),EoA(this,"handoffState","pending"),EoA(this,"currentId",0)}set(A){this.current!==A&&(this.handoffState="pending",this.currentId=0,this.current=A)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Om=new Rze,fo=(A,e)=>{Om.isServer?p.useEffect(A,e):p.useLayoutEffect(A,e)};function tr(A){let e=p.useRef(A);return fo(()=>{e.current=A},[A]),e}function $HA(A,e){let[t,i]=p.useState(A),n=tr(A);return fo(()=>i(n.current),[n,i,...e]),t}function xze(A){typeof queueMicrotask=="function"?queueMicrotask(A):Promise.resolve().then(A).catch(e=>setTimeout(()=>{throw e}))}function Qc(){let A=[],e={addEventListener(t,i,n,o){return t.addEventListener(i,n,o),e.add(()=>t.removeEventListener(i,n,o))},requestAnimationFrame(...t){let i=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(i))},nextFrame(...t){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...t))},setTimeout(...t){let i=setTimeout(...t);return e.add(()=>clearTimeout(i))},microTask(...t){let i={current:!0};return xze(()=>{i.current&&t[0]()}),e.add(()=>{i.current=!1})},add(t){return A.push(t),()=>{let i=A.indexOf(t);if(i>=0){let[n]=A.splice(i,1);n()}}},dispose(){for(let t of A.splice(0))t()},style(t,i,n){let o=t.style.getPropertyValue(i);return Object.assign(t.style,{[i]:n}),this.add(()=>{Object.assign(t.style,{[i]:o})})}};return e}function _u(){let[A]=p.useState(Qc);return p.useEffect(()=>()=>A.dispose(),[A]),A}let Be=function(A){let e=tr(A);return b.useCallback((...t)=>e.current(...t),[e])};function uoA(){let[A,e]=p.useState(Om.isHandoffComplete);return A&&Om.isHandoffComplete===!1&&e(!1),p.useEffect(()=>{A!==!0&&e(!0)},[A]),p.useEffect(()=>Om.handoff(),[]),A}var AZA;let jg=(AZA=b.useId)!=null?AZA:function(){let A=uoA(),[e,t]=b.useState(A?()=>Om.nextId():null);return fo(()=>{e===null&&t(Om.nextId())},[e]),e!=null?""+e:void 0};function _i(A,e,...t){if(A in e){let n=e[A];return typeof n=="function"?n(...t):n}let i=new Error(`Tried to handle "${A}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(n=>`"${n}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,_i),i}function My(A){return Om.isServer?null:A instanceof Node?A.ownerDocument:A!=null&&A.hasOwnProperty("current")&&A.current instanceof Node?A.current.ownerDocument:document}let doA=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(A=>`${A}:not([tabindex='-1'])`).join(",");var as=(A=>(A[A.First=1]="First",A[A.Previous=2]="Previous",A[A.Next=4]="Next",A[A.Last=8]="Last",A[A.WrapAround=16]="WrapAround",A[A.NoScroll=32]="NoScroll",A))(as||{}),Zk=(A=>(A[A.Error=0]="Error",A[A.Overflow=1]="Overflow",A[A.Success=2]="Success",A[A.Underflow=3]="Underflow",A))(Zk||{}),Fze=(A=>(A[A.Previous=-1]="Previous",A[A.Next=1]="Next",A))(Fze||{});function jF(A=document.body){return A==null?[]:Array.from(A.querySelectorAll(doA)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var PF=(A=>(A[A.Strict=0]="Strict",A[A.Loose=1]="Loose",A))(PF||{});function $F(A,e=0){var t;return A===((t=My(A))==null?void 0:t.body)?!1:_i(e,{0(){return A.matches(doA)},1(){let i=A;for(;i!==null;){if(i.matches(doA))return!0;i=i.parentElement}return!1}})}function eZA(A){let e=My(A);Qc().nextFrame(()=>{e&&!$F(e.activeElement,0)&&Mze(A)})}function Mze(A){A==null||A.focus({preventScroll:!0})}let vze=["textarea","input"].join(",");function Lze(A){var e,t;return(t=(e=A==null?void 0:A.matches)==null?void 0:e.call(A,vze))!=null?t:!1}function FX(A,e=t=>t){return A.slice().sort((t,i)=>{let n=e(t),o=e(i);if(n===null||o===null)return 0;let g=n.compareDocumentPosition(o);return g&Node.DOCUMENT_POSITION_FOLLOWING?-1:g&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Sze(A,e){return IQ(jF(),e,{relativeTo:A})}function IQ(A,e,{sorted:t=!0,relativeTo:i=null,skipElements:n=[]}={}){let o=Array.isArray(A)?A.length>0?A[0].ownerDocument:document:A.ownerDocument,g=Array.isArray(A)?t?FX(A):A:jF(A);n.length>0&&g.length>1&&(g=g.filter(c=>!n.includes(c))),i=i??o.activeElement;let a=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,g.indexOf(i))-1;if(e&4)return Math.max(0,g.indexOf(i))+1;if(e&8)return g.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),I=e&32?{preventScroll:!0}:{},r=0,C=g.length,l;do{if(r>=C||r+C<=0)return 0;let c=s+r;if(e&16)c=(c+C)%C;else{if(c<0)return 3;if(c>=C)return 1}l=g[c],l==null||l.focus(I),r+=a}while(l!==o.activeElement);return e&6&&Lze(l)&&l.select(),l.hasAttribute("tabindex")||l.setAttribute("tabindex","0"),2}function hoA(A,e,t){let i=tr(e);p.useEffect(()=>{function n(o){i.current(o)}return document.addEventListener(A,n,t),()=>document.removeEventListener(A,n,t)},[A,t])}function moA(A,e,t=!0){let i=p.useRef(!1);p.useEffect(()=>{requestAnimationFrame(()=>{i.current=t})},[t]);function n(g,a){if(!i.current||g.defaultPrevented)return;let s=function r(C){return typeof C=="function"?r(C()):Array.isArray(C)||C instanceof Set?C:[C]}(A),I=a(g);if(I!==null&&I.getRootNode().contains(I)){for(let r of s){if(r===null)continue;let C=r instanceof HTMLElement?r:r.current;if(C!=null&&C.contains(I)||g.composed&&g.composedPath().includes(C))return}return!$F(I,PF.Loose)&&I.tabIndex!==-1&&g.preventDefault(),e(g,I)}}let o=p.useRef(null);hoA("mousedown",g=>{var a,s;i.current&&(o.current=((s=(a=g.composedPath)==null?void 0:a.call(g))==null?void 0:s[0])||g.target)},!0),hoA("click",g=>{o.current&&(n(g,()=>o.current),o.current=null)},!0),hoA("blur",g=>n(g,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function tZA(A){var e;if(A.type)return A.type;let t=(e=A.as)!=null?e:"button";if(typeof t=="string"&&t.toLowerCase()==="button")return"button"}function poA(A,e){let[t,i]=p.useState(()=>tZA(A));return fo(()=>{i(tZA(A))},[A.type,A.as]),fo(()=>{t||e.current&&e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&i("button")},[t,e]),t}let iZA=Symbol();function Hze(A,e=!0){return Object.assign(A,{[iZA]:e})}function yo(...A){let e=p.useRef(A);p.useEffect(()=>{e.current=A},[A]);let t=Be(i=>{for(let n of e.current)n!=null&&(typeof n=="function"?n(i):n.current=i)});return A.every(i=>i==null||(i==null?void 0:i[iZA]))?void 0:t}function nZA({container:A,accept:e,walk:t,enabled:i=!0}){let n=p.useRef(e),o=p.useRef(t);p.useEffect(()=>{n.current=e,o.current=t},[e,t]),fo(()=>{if(!A||!i)return;let g=My(A);if(!g)return;let a=n.current,s=o.current,I=Object.assign(C=>a(C),{acceptNode:a}),r=g.createTreeWalker(A,NodeFilter.SHOW_ELEMENT,I,!1);for(;r.nextNode();)s(r.currentNode)},[A,i,n,o])}function Zze(A){throw new Error("Unexpected object: "+A)}var vn=(A=>(A[A.First=0]="First",A[A.Previous=1]="Previous",A[A.Next=2]="Next",A[A.Last=3]="Last",A[A.Specific=4]="Specific",A[A.Nothing=5]="Nothing",A))(vn||{});function oZA(A,e){let t=e.resolveItems();if(t.length<=0)return null;let i=e.resolveActiveIndex(),n=i??-1,o=(()=>{switch(A.focus){case 0:return t.findIndex(g=>!e.resolveDisabled(g));case 1:{let g=t.slice().reverse().findIndex((a,s,I)=>n!==-1&&I.length-s-1>=n?!1:!e.resolveDisabled(a));return g===-1?g:t.length-1-g}case 2:return t.findIndex((g,a)=>a<=n?!1:!e.resolveDisabled(g));case 3:{let g=t.slice().reverse().findIndex(a=>!e.resolveDisabled(a));return g===-1?g:t.length-1-g}case 4:return t.findIndex(g=>e.resolveId(g)===A.id);case 5:return null;default:Zze(A)}})();return o===-1?i:o}function gZA(...A){return A.filter(Boolean).join(" ")}var CQ=(A=>(A[A.None=0]="None",A[A.RenderStrategy=1]="RenderStrategy",A[A.Static=2]="Static",A))(CQ||{}),Ou=(A=>(A[A.Unmount=0]="Unmount",A[A.Hidden=1]="Hidden",A))(Ou||{});function bo({ourProps:A,theirProps:e,slot:t,defaultTag:i,features:n,visible:o=!0,name:g}){let a=aZA(e,A);if(o)return MX(a,t,i,g);let s=n??0;if(s&2){let{static:I=!1,...r}=a;if(I)return MX(r,t,i,g)}if(s&1){let{unmount:I=!0,...r}=a;return _i(I?0:1,{0(){return null},1(){return MX({...r,hidden:!0,style:{display:"none"}},t,i,g)}})}return MX(a,t,i,g)}function MX(A,e={},t,i){var n;let{as:o=t,children:g,refName:a="ref",...s}=foA(A,["unmount","static"]),I=A.ref!==void 0?{[a]:A.ref}:{},r=typeof g=="function"?g(e):g;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(e));let C={};if(e){let l=!1,c=[];for(let[B,E]of Object.entries(e))typeof E=="boolean"&&(l=!0),E===!0&&c.push(B);l&&(C["data-headlessui-state"]=c.join(" "))}if(o===p.Fragment&&Object.keys(vX(s)).length>0){if(!p.isValidElement(r)||Array.isArray(r)&&r.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(B=>`  - ${B}`).join(`
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(B=>`  - ${B}`).join(`
`)].join(`
`));let l=gZA((n=r.props)==null?void 0:n.className,s.className),c=l?{className:l}:{};return p.cloneElement(r,Object.assign({},aZA(r.props,vX(foA(s,["ref"]))),C,I,Wze(r.ref,I.ref),c))}return p.createElement(o,Object.assign({},foA(s,["ref"]),o!==p.Fragment&&I,o!==p.Fragment&&C),r)}function Wze(...A){return{ref:A.every(e=>e==null)?void 0:e=>{for(let t of A)t!=null&&(typeof t=="function"?t(e):t.current=e)}}}function aZA(...A){if(A.length===0)return{};if(A.length===1)return A[0];let e={},t={};for(let i of A)for(let n in i)n.startsWith("on")&&typeof i[n]=="function"?(t[n]!=null||(t[n]=[]),t[n].push(i[n])):e[n]=i[n];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(t).map(i=>[i,void 0])));for(let i in t)Object.assign(e,{[i](n,...o){let g=t[i];for(let a of g){if((n instanceof Event||(n==null?void 0:n.nativeEvent)instanceof Event)&&n.defaultPrevented)return;a(n,...o)}}});return e}function go(A){var e;return Object.assign(p.forwardRef(A),{displayName:(e=A.displayName)!=null?e:A.name})}function vX(A){let e=Object.assign({},A);for(let t in e)e[t]===void 0&&delete e[t];return e}function foA(A,e=[]){let t=Object.assign({},A);for(let i of e)i in t&&delete t[i];return t}function Wk(A){let e=A.parentElement,t=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(t=e),e=e.parentElement;let i=(e==null?void 0:e.getAttribute("disabled"))==="";return i&&Kze(t)?!1:i}function Kze(A){if(!A)return!1;let e=A.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}function yoA(A={},e=null,t=[]){for(let[i,n]of Object.entries(A))rZA(t,sZA(e,i),n);return t}function sZA(A,e){return A?A+"["+e+"]":e}function rZA(A,e,t){if(Array.isArray(t))for(let[i,n]of t.entries())rZA(A,sZA(e,i.toString()),n);else t instanceof Date?A.push([e,t.toISOString()]):typeof t=="boolean"?A.push([e,t?"1":"0"]):typeof t=="string"?A.push([e,t]):typeof t=="number"?A.push([e,`${t}`]):t==null?A.push([e,""]):yoA(t,e,A)}function Uze(A){var e;let t=(e=A==null?void 0:A.form)!=null?e:A.closest("form");if(t){for(let i of t.elements)if(i.tagName==="INPUT"&&i.type==="submit"||i.tagName==="BUTTON"&&i.type==="submit"||i.nodeName==="INPUT"&&i.type==="image"){i.click();return}}}let Vze="div";var Kk=(A=>(A[A.None=1]="None",A[A.Focusable=2]="Focusable",A[A.Hidden=4]="Hidden",A))(Kk||{});function Xze(A,e){let{features:t=1,...i}=A,n={ref:e,"aria-hidden":(t&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(t&4)===4&&(t&2)!==2&&{display:"none"}}};return bo({ourProps:n,theirProps:i,slot:{},defaultTag:Vze,name:"Hidden"})}let AM=go(Xze),boA=p.createContext(null);boA.displayName="OpenClosedContext";var On=(A=>(A[A.Open=1]="Open",A[A.Closed=2]="Closed",A[A.Closing=4]="Closing",A[A.Opening=8]="Opening",A))(On||{});function Uk(){return p.useContext(boA)}function LX({value:A,children:e}){return b.createElement(boA.Provider,{value:A},e)}var Ve=(A=>(A.Space=" ",A.Enter="Enter",A.Escape="Escape",A.Backspace="Backspace",A.Delete="Delete",A.ArrowLeft="ArrowLeft",A.ArrowUp="ArrowUp",A.ArrowRight="ArrowRight",A.ArrowDown="ArrowDown",A.Home="Home",A.End="End",A.PageUp="PageUp",A.PageDown="PageDown",A.Tab="Tab",A))(Ve||{});function IZA(A,e,t){let[i,n]=p.useState(t),o=A!==void 0,g=p.useRef(o),a=p.useRef(!1),s=p.useRef(!1);return o&&!g.current&&!a.current?(a.current=!0,g.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&g.current&&!s.current&&(s.current=!0,g.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?A:i,Be(I=>(o||n(I),e==null?void 0:e(I)))]}function CZA(A){return[A.screenX,A.screenY]}function lZA(){let A=p.useRef([-1,-1]);return{wasMoved(e){let t=CZA(e);return A.current[0]===t[0]&&A.current[1]===t[1]?!1:(A.current=t,!0)},update(e){A.current=CZA(e)}}}function zze(A,e,t){let i=tr(e);p.useEffect(()=>{function n(o){i.current(o)}return window.addEventListener(A,n,t),()=>window.removeEventListener(A,n,t)},[A,t])}var qu=(A=>(A[A.Forwards=0]="Forwards",A[A.Backwards=1]="Backwards",A))(qu||{});function cZA(){let A=p.useRef(0);return zze("keydown",e=>{e.key==="Tab"&&(A.current=e.shiftKey?1:0)},!0),A}function BZA(){let A=p.useRef(!1);return fo(()=>(A.current=!0,()=>{A.current=!1}),[]),A}function SX(...A){return p.useMemo(()=>My(...A),[...A])}function Tze(A,e,t,i){let n=tr(t);p.useEffect(()=>{A=A??window;function o(g){n.current(g)}return A.addEventListener(e,o,i),()=>A.removeEventListener(e,o,i)},[A,e,i])}let QZA=p.createContext(null);function EZA(){let A=p.useContext(QZA);if(A===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,EZA),e}return A}function uZA(){let[A,e]=p.useState([]);return[A.length>0?A.join(" "):void 0,p.useMemo(()=>function(t){let i=Be(o=>(e(g=>[...g,o]),()=>e(g=>{let a=g.slice(),s=a.indexOf(o);return s!==-1&&a.splice(s,1),a}))),n=p.useMemo(()=>({register:i,slot:t.slot,name:t.name,props:t.props}),[i,t.slot,t.name,t.props]);return b.createElement(QZA.Provider,{value:n},t.children)},[e])]}let _ze="p";function Oze(A,e){let t=jg(),{id:i=`headlessui-description-${t}`,...n}=A,o=EZA(),g=yo(e);fo(()=>o.register(i),[i,o.register]);let a={ref:g,...o.props,id:i};return bo({ourProps:a,theirProps:n,slot:o.slot||{},defaultTag:_ze,name:o.name||"Description"})}let qze=go(Oze),jze=Object.assign(qze,{});var Pze=(A=>(A[A.Open=0]="Open",A[A.Closed=1]="Closed",A))(Pze||{}),$ze=(A=>(A[A.Single=0]="Single",A[A.Multi=1]="Multi",A))($ze||{}),ATe=(A=>(A[A.Pointer=0]="Pointer",A[A.Other=1]="Other",A))(ATe||{}),eTe=(A=>(A[A.OpenListbox=0]="OpenListbox",A[A.CloseListbox=1]="CloseListbox",A[A.GoToOption=2]="GoToOption",A[A.Search=3]="Search",A[A.ClearSearch=4]="ClearSearch",A[A.RegisterOption=5]="RegisterOption",A[A.UnregisterOption=6]="UnregisterOption",A[A.RegisterLabel=7]="RegisterLabel",A))(eTe||{});function woA(A,e=t=>t){let t=A.activeOptionIndex!==null?A.options[A.activeOptionIndex]:null,i=FX(e(A.options.slice()),o=>o.dataRef.current.domRef.current),n=t?i.indexOf(t):null;return n===-1&&(n=null),{options:i,activeOptionIndex:n}}let tTe={1(A){return A.dataRef.current.disabled||A.listboxState===1?A:{...A,activeOptionIndex:null,listboxState:1}},0(A){if(A.dataRef.current.disabled||A.listboxState===0)return A;let e=A.activeOptionIndex,{isSelected:t}=A.dataRef.current,i=A.options.findIndex(n=>t(n.dataRef.current.value));return i!==-1&&(e=i),{...A,listboxState:0,activeOptionIndex:e}},2(A,e){var t;if(A.dataRef.current.disabled||A.listboxState===1)return A;let i=woA(A),n=oZA(e,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...A,...i,searchQuery:"",activeOptionIndex:n,activationTrigger:(t=e.trigger)!=null?t:1}},3:(A,e)=>{if(A.dataRef.current.disabled||A.listboxState===1)return A;let t=A.searchQuery!==""?0:1,i=A.searchQuery+e.value.toLowerCase(),n=(A.activeOptionIndex!==null?A.options.slice(A.activeOptionIndex+t).concat(A.options.slice(0,A.activeOptionIndex+t)):A.options).find(g=>{var a;return!g.dataRef.current.disabled&&((a=g.dataRef.current.textValue)==null?void 0:a.startsWith(i))}),o=n?A.options.indexOf(n):-1;return o===-1||o===A.activeOptionIndex?{...A,searchQuery:i}:{...A,searchQuery:i,activeOptionIndex:o,activationTrigger:1}},4(A){return A.dataRef.current.disabled||A.listboxState===1||A.searchQuery===""?A:{...A,searchQuery:""}},5:(A,e)=>{let t={id:e.id,dataRef:e.dataRef},i=woA(A,n=>[...n,t]);return A.activeOptionIndex===null&&A.dataRef.current.isSelected(e.dataRef.current.value)&&(i.activeOptionIndex=i.options.indexOf(t)),{...A,...i}},6:(A,e)=>{let t=woA(A,i=>{let n=i.findIndex(o=>o.id===e.id);return n!==-1&&i.splice(n,1),i});return{...A,...t,activationTrigger:1}},7:(A,e)=>({...A,labelId:e.id})},DoA=p.createContext(null);DoA.displayName="ListboxActionsContext";function eM(A){let e=p.useContext(DoA);if(e===null){let t=new Error(`<${A} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,eM),t}return e}let GoA=p.createContext(null);GoA.displayName="ListboxDataContext";function tM(A){let e=p.useContext(GoA);if(e===null){let t=new Error(`<${A} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,tM),t}return e}function iTe(A,e){return _i(e.type,tTe,A,e)}let nTe=p.Fragment;function oTe(A,e){let{value:t,defaultValue:i,name:n,onChange:o,by:g=(O,eA)=>O===eA,disabled:a=!1,horizontal:s=!1,multiple:I=!1,...r}=A;const C=s?"horizontal":"vertical";let l=yo(e),[c=I?[]:void 0,B]=IZA(t,o,i),[E,u]=p.useReducer(iTe,{dataRef:p.createRef(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),d=p.useRef({static:!1,hold:!1}),f=p.useRef(null),w=p.useRef(null),y=p.useRef(null),G=Be(typeof g=="string"?(O,eA)=>{let oA=g;return(O==null?void 0:O[oA])===(eA==null?void 0:eA[oA])}:g),R=p.useCallback(O=>_i(x.mode,{1:()=>c.some(eA=>G(eA,O)),0:()=>G(c,O)}),[c]),x=p.useMemo(()=>({...E,value:c,disabled:a,mode:I?1:0,orientation:C,compare:G,isSelected:R,optionsPropsRef:d,labelRef:f,buttonRef:w,optionsRef:y}),[c,a,I,E]);fo(()=>{E.dataRef.current=x},[x]),moA([x.buttonRef,x.optionsRef],(O,eA)=>{var oA;u({type:1}),$F(eA,PF.Loose)||(O.preventDefault(),(oA=x.buttonRef.current)==null||oA.focus())},x.listboxState===0);let F=p.useMemo(()=>({open:x.listboxState===0,disabled:a,value:c}),[x,a,c]),Q=Be(O=>{let eA=x.options.find(oA=>oA.id===O);eA&&V(eA.dataRef.current.value)}),k=Be(()=>{if(x.activeOptionIndex!==null){let{dataRef:O,id:eA}=x.options[x.activeOptionIndex];V(O.current.value),u({type:2,focus:vn.Specific,id:eA})}}),h=Be(()=>u({type:0})),N=Be(()=>u({type:1})),v=Be((O,eA,oA)=>O===vn.Specific?u({type:2,focus:vn.Specific,id:eA,trigger:oA}):u({type:2,focus:O,trigger:oA})),K=Be((O,eA)=>(u({type:5,id:O,dataRef:eA}),()=>u({type:6,id:O}))),U=Be(O=>(u({type:7,id:O}),()=>u({type:7,id:null}))),V=Be(O=>_i(x.mode,{0(){return B==null?void 0:B(O)},1(){let eA=x.value.slice(),oA=eA.findIndex(tA=>G(tA,O));return oA===-1?eA.push(O):eA.splice(oA,1),B==null?void 0:B(eA)}})),X=Be(O=>u({type:3,value:O})),_=Be(()=>u({type:4})),q=p.useMemo(()=>({onChange:V,registerOption:K,registerLabel:U,goToOption:v,closeListbox:N,openListbox:h,selectActiveOption:k,selectOption:Q,search:X,clearSearch:_}),[]),$={ref:l},nA=p.useRef(null),j=_u();return p.useEffect(()=>{nA.current&&i!==void 0&&j.addEventListener(nA.current,"reset",()=>{V(i)})},[nA,V]),b.createElement(DoA.Provider,{value:q},b.createElement(GoA.Provider,{value:x},b.createElement(LX,{value:_i(x.listboxState,{0:On.Open,1:On.Closed})},n!=null&&c!=null&&yoA({[n]:c}).map(([O,eA],oA)=>b.createElement(AM,{features:Kk.Hidden,ref:oA===0?tA=>{var sA;nA.current=(sA=tA==null?void 0:tA.closest("form"))!=null?sA:null}:void 0,...vX({key:O,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:O,value:eA})})),bo({ourProps:$,theirProps:r,slot:F,defaultTag:nTe,name:"Listbox"}))))}let gTe="button";function aTe(A,e){var t;let i=jg(),{id:n=`headlessui-listbox-button-${i}`,...o}=A,g=tM("Listbox.Button"),a=eM("Listbox.Button"),s=yo(g.buttonRef,e),I=_u(),r=Be(u=>{switch(u.key){case Ve.Space:case Ve.Enter:case Ve.ArrowDown:u.preventDefault(),a.openListbox(),I.nextFrame(()=>{g.value||a.goToOption(vn.First)});break;case Ve.ArrowUp:u.preventDefault(),a.openListbox(),I.nextFrame(()=>{g.value||a.goToOption(vn.Last)});break}}),C=Be(u=>{switch(u.key){case Ve.Space:u.preventDefault();break}}),l=Be(u=>{if(Wk(u.currentTarget))return u.preventDefault();g.listboxState===0?(a.closeListbox(),I.nextFrame(()=>{var d;return(d=g.buttonRef.current)==null?void 0:d.focus({preventScroll:!0})})):(u.preventDefault(),a.openListbox())}),c=$HA(()=>{if(g.labelId)return[g.labelId,n].join(" ")},[g.labelId,n]),B=p.useMemo(()=>({open:g.listboxState===0,disabled:g.disabled,value:g.value}),[g]),E={ref:s,id:n,type:poA(A,g.buttonRef),"aria-haspopup":"listbox","aria-controls":(t=g.optionsRef.current)==null?void 0:t.id,"aria-expanded":g.disabled?void 0:g.listboxState===0,"aria-labelledby":c,disabled:g.disabled,onKeyDown:r,onKeyUp:C,onClick:l};return bo({ourProps:E,theirProps:o,slot:B,defaultTag:gTe,name:"Listbox.Button"})}let sTe="label";function rTe(A,e){let t=jg(),{id:i=`headlessui-listbox-label-${t}`,...n}=A,o=tM("Listbox.Label"),g=eM("Listbox.Label"),a=yo(o.labelRef,e);fo(()=>g.registerLabel(i),[i]);let s=Be(()=>{var r;return(r=o.buttonRef.current)==null?void 0:r.focus({preventScroll:!0})}),I=p.useMemo(()=>({open:o.listboxState===0,disabled:o.disabled}),[o]);return bo({ourProps:{ref:a,id:i,onClick:s},theirProps:n,slot:I,defaultTag:sTe,name:"Listbox.Label"})}let ITe="ul",CTe=CQ.RenderStrategy|CQ.Static;function lTe(A,e){var t;let i=jg(),{id:n=`headlessui-listbox-options-${i}`,...o}=A,g=tM("Listbox.Options"),a=eM("Listbox.Options"),s=yo(g.optionsRef,e),I=_u(),r=_u(),C=Uk(),l=(()=>C!==null?(C&On.Open)===On.Open:g.listboxState===0)();p.useEffect(()=>{var d;let f=g.optionsRef.current;f&&g.listboxState===0&&f!==((d=My(f))==null?void 0:d.activeElement)&&f.focus({preventScroll:!0})},[g.listboxState,g.optionsRef]);let c=Be(d=>{switch(r.dispose(),d.key){case Ve.Space:if(g.searchQuery!=="")return d.preventDefault(),d.stopPropagation(),a.search(d.key);case Ve.Enter:if(d.preventDefault(),d.stopPropagation(),g.activeOptionIndex!==null){let{dataRef:f}=g.options[g.activeOptionIndex];a.onChange(f.current.value)}g.mode===0&&(a.closeListbox(),Qc().nextFrame(()=>{var f;return(f=g.buttonRef.current)==null?void 0:f.focus({preventScroll:!0})}));break;case _i(g.orientation,{vertical:Ve.ArrowDown,horizontal:Ve.ArrowRight}):return d.preventDefault(),d.stopPropagation(),a.goToOption(vn.Next);case _i(g.orientation,{vertical:Ve.ArrowUp,horizontal:Ve.ArrowLeft}):return d.preventDefault(),d.stopPropagation(),a.goToOption(vn.Previous);case Ve.Home:case Ve.PageUp:return d.preventDefault(),d.stopPropagation(),a.goToOption(vn.First);case Ve.End:case Ve.PageDown:return d.preventDefault(),d.stopPropagation(),a.goToOption(vn.Last);case Ve.Escape:return d.preventDefault(),d.stopPropagation(),a.closeListbox(),I.nextFrame(()=>{var f;return(f=g.buttonRef.current)==null?void 0:f.focus({preventScroll:!0})});case Ve.Tab:d.preventDefault(),d.stopPropagation();break;default:d.key.length===1&&(a.search(d.key),r.setTimeout(()=>a.clearSearch(),350));break}}),B=$HA(()=>{var d,f,w;return(w=(d=g.labelRef.current)==null?void 0:d.id)!=null?w:(f=g.buttonRef.current)==null?void 0:f.id},[g.labelRef.current,g.buttonRef.current]),E=p.useMemo(()=>({open:g.listboxState===0}),[g]),u={"aria-activedescendant":g.activeOptionIndex===null||(t=g.options[g.activeOptionIndex])==null?void 0:t.id,"aria-multiselectable":g.mode===1?!0:void 0,"aria-labelledby":B,"aria-orientation":g.orientation,id:n,onKeyDown:c,role:"listbox",tabIndex:0,ref:s};return bo({ourProps:u,theirProps:o,slot:E,defaultTag:ITe,features:CTe,visible:l,name:"Listbox.Options"})}let cTe="li";function BTe(A,e){let t=jg(),{id:i=`headlessui-listbox-option-${t}`,disabled:n=!1,value:o,...g}=A,a=tM("Listbox.Option"),s=eM("Listbox.Option"),I=a.activeOptionIndex!==null?a.options[a.activeOptionIndex].id===i:!1,r=a.isSelected(o),C=p.useRef(null),l=tr({disabled:n,value:o,domRef:C,get textValue(){var G,R;return(R=(G=C.current)==null?void 0:G.textContent)==null?void 0:R.toLowerCase()}}),c=yo(e,C);fo(()=>{if(a.listboxState!==0||!I||a.activationTrigger===0)return;let G=Qc();return G.requestAnimationFrame(()=>{var R,x;(x=(R=C.current)==null?void 0:R.scrollIntoView)==null||x.call(R,{block:"nearest"})}),G.dispose},[C,I,a.listboxState,a.activationTrigger,a.activeOptionIndex]),fo(()=>s.registerOption(i,l),[l,i]);let B=Be(G=>{if(n)return G.preventDefault();s.onChange(o),a.mode===0&&(s.closeListbox(),Qc().nextFrame(()=>{var R;return(R=a.buttonRef.current)==null?void 0:R.focus({preventScroll:!0})}))}),E=Be(()=>{if(n)return s.goToOption(vn.Nothing);s.goToOption(vn.Specific,i)}),u=lZA(),d=Be(G=>u.update(G)),f=Be(G=>{u.wasMoved(G)&&(n||I||s.goToOption(vn.Specific,i,0))}),w=Be(G=>{u.wasMoved(G)&&(n||I&&s.goToOption(vn.Nothing))}),y=p.useMemo(()=>({active:I,selected:r,disabled:n}),[I,r,n]);return bo({ourProps:{id:i,ref:c,role:"option",tabIndex:n===!0?void 0:-1,"aria-disabled":n===!0?!0:void 0,"aria-selected":r,disabled:void 0,onClick:B,onFocus:E,onPointerEnter:d,onMouseEnter:d,onPointerMove:f,onMouseMove:f,onPointerLeave:w,onMouseLeave:w},theirProps:g,slot:y,defaultTag:cTe,name:"Listbox.Option"})}let QTe=go(oTe),ETe=go(aTe),uTe=go(rTe),dTe=go(lTe),hTe=go(BTe),koA=Object.assign(QTe,{Button:ETe,Label:uTe,Options:dTe,Option:hTe});var mTe=(A=>(A[A.Open=0]="Open",A[A.Closed=1]="Closed",A))(mTe||{}),pTe=(A=>(A[A.Pointer=0]="Pointer",A[A.Other=1]="Other",A))(pTe||{}),fTe=(A=>(A[A.OpenMenu=0]="OpenMenu",A[A.CloseMenu=1]="CloseMenu",A[A.GoToItem=2]="GoToItem",A[A.Search=3]="Search",A[A.ClearSearch=4]="ClearSearch",A[A.RegisterItem=5]="RegisterItem",A[A.UnregisterItem=6]="UnregisterItem",A))(fTe||{});function JoA(A,e=t=>t){let t=A.activeItemIndex!==null?A.items[A.activeItemIndex]:null,i=FX(e(A.items.slice()),o=>o.dataRef.current.domRef.current),n=t?i.indexOf(t):null;return n===-1&&(n=null),{items:i,activeItemIndex:n}}let yTe={1(A){return A.menuState===1?A:{...A,activeItemIndex:null,menuState:1}},0(A){return A.menuState===0?A:{...A,menuState:0}},2:(A,e)=>{var t;let i=JoA(A),n=oZA(e,{resolveItems:()=>i.items,resolveActiveIndex:()=>i.activeItemIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...A,...i,searchQuery:"",activeItemIndex:n,activationTrigger:(t=e.trigger)!=null?t:1}},3:(A,e)=>{let t=A.searchQuery!==""?0:1,i=A.searchQuery+e.value.toLowerCase(),n=(A.activeItemIndex!==null?A.items.slice(A.activeItemIndex+t).concat(A.items.slice(0,A.activeItemIndex+t)):A.items).find(g=>{var a;return((a=g.dataRef.current.textValue)==null?void 0:a.startsWith(i))&&!g.dataRef.current.disabled}),o=n?A.items.indexOf(n):-1;return o===-1||o===A.activeItemIndex?{...A,searchQuery:i}:{...A,searchQuery:i,activeItemIndex:o,activationTrigger:1}},4(A){return A.searchQuery===""?A:{...A,searchQuery:"",searchActiveItemIndex:null}},5:(A,e)=>{let t=JoA(A,i=>[...i,{id:e.id,dataRef:e.dataRef}]);return{...A,...t}},6:(A,e)=>{let t=JoA(A,i=>{let n=i.findIndex(o=>o.id===e.id);return n!==-1&&i.splice(n,1),i});return{...A,...t,activationTrigger:1}}},NoA=p.createContext(null);NoA.displayName="MenuContext";function HX(A){let e=p.useContext(NoA);if(e===null){let t=new Error(`<${A} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,HX),t}return e}function bTe(A,e){return _i(e.type,yTe,A,e)}let wTe=p.Fragment;function DTe(A,e){let t=p.useReducer(bTe,{menuState:1,buttonRef:p.createRef(),itemsRef:p.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:n,buttonRef:o},g]=t,a=yo(e);moA([o,n],(l,c)=>{var B;g({type:1}),$F(c,PF.Loose)||(l.preventDefault(),(B=o.current)==null||B.focus())},i===0);let s=Be(()=>{g({type:1})}),I=p.useMemo(()=>({open:i===0,close:s}),[i,s]),r=A,C={ref:a};return b.createElement(NoA.Provider,{value:t},b.createElement(LX,{value:_i(i,{0:On.Open,1:On.Closed})},bo({ourProps:C,theirProps:r,slot:I,defaultTag:wTe,name:"Menu"})))}let GTe="button";function kTe(A,e){var t;let i=jg(),{id:n=`headlessui-menu-button-${i}`,...o}=A,[g,a]=HX("Menu.Button"),s=yo(g.buttonRef,e),I=_u(),r=Be(E=>{switch(E.key){case Ve.Space:case Ve.Enter:case Ve.ArrowDown:E.preventDefault(),E.stopPropagation(),a({type:0}),I.nextFrame(()=>a({type:2,focus:vn.First}));break;case Ve.ArrowUp:E.preventDefault(),E.stopPropagation(),a({type:0}),I.nextFrame(()=>a({type:2,focus:vn.Last}));break}}),C=Be(E=>{switch(E.key){case Ve.Space:E.preventDefault();break}}),l=Be(E=>{if(Wk(E.currentTarget))return E.preventDefault();A.disabled||(g.menuState===0?(a({type:1}),I.nextFrame(()=>{var u;return(u=g.buttonRef.current)==null?void 0:u.focus({preventScroll:!0})})):(E.preventDefault(),a({type:0})))}),c=p.useMemo(()=>({open:g.menuState===0}),[g]),B={ref:s,id:n,type:poA(A,g.buttonRef),"aria-haspopup":"menu","aria-controls":(t=g.itemsRef.current)==null?void 0:t.id,"aria-expanded":A.disabled?void 0:g.menuState===0,onKeyDown:r,onKeyUp:C,onClick:l};return bo({ourProps:B,theirProps:o,slot:c,defaultTag:GTe,name:"Menu.Button"})}let JTe="div",NTe=CQ.RenderStrategy|CQ.Static;function YTe(A,e){var t,i;let n=jg(),{id:o=`headlessui-menu-items-${n}`,...g}=A,[a,s]=HX("Menu.Items"),I=yo(a.itemsRef,e),r=SX(a.itemsRef),C=_u(),l=Uk(),c=(()=>l!==null?(l&On.Open)===On.Open:a.menuState===0)();p.useEffect(()=>{let f=a.itemsRef.current;f&&a.menuState===0&&f!==(r==null?void 0:r.activeElement)&&f.focus({preventScroll:!0})},[a.menuState,a.itemsRef,r]),nZA({container:a.itemsRef.current,enabled:a.menuState===0,accept(f){return f.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:f.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(f){f.setAttribute("role","none")}});let B=Be(f=>{var w,y;switch(C.dispose(),f.key){case Ve.Space:if(a.searchQuery!=="")return f.preventDefault(),f.stopPropagation(),s({type:3,value:f.key});case Ve.Enter:if(f.preventDefault(),f.stopPropagation(),s({type:1}),a.activeItemIndex!==null){let{dataRef:G}=a.items[a.activeItemIndex];(y=(w=G.current)==null?void 0:w.domRef.current)==null||y.click()}eZA(a.buttonRef.current);break;case Ve.ArrowDown:return f.preventDefault(),f.stopPropagation(),s({type:2,focus:vn.Next});case Ve.ArrowUp:return f.preventDefault(),f.stopPropagation(),s({type:2,focus:vn.Previous});case Ve.Home:case Ve.PageUp:return f.preventDefault(),f.stopPropagation(),s({type:2,focus:vn.First});case Ve.End:case Ve.PageDown:return f.preventDefault(),f.stopPropagation(),s({type:2,focus:vn.Last});case Ve.Escape:f.preventDefault(),f.stopPropagation(),s({type:1}),Qc().nextFrame(()=>{var G;return(G=a.buttonRef.current)==null?void 0:G.focus({preventScroll:!0})});break;case Ve.Tab:f.preventDefault(),f.stopPropagation(),s({type:1}),Qc().nextFrame(()=>{Sze(a.buttonRef.current,f.shiftKey?as.Previous:as.Next)});break;default:f.key.length===1&&(s({type:3,value:f.key}),C.setTimeout(()=>s({type:4}),350));break}}),E=Be(f=>{switch(f.key){case Ve.Space:f.preventDefault();break}}),u=p.useMemo(()=>({open:a.menuState===0}),[a]),d={"aria-activedescendant":a.activeItemIndex===null||(t=a.items[a.activeItemIndex])==null?void 0:t.id,"aria-labelledby":(i=a.buttonRef.current)==null?void 0:i.id,id:o,onKeyDown:B,onKeyUp:E,role:"menu",tabIndex:0,ref:I};return bo({ourProps:d,theirProps:g,slot:u,defaultTag:JTe,features:NTe,visible:c,name:"Menu.Items"})}let RTe=p.Fragment;function xTe(A,e){let t=jg(),{id:i=`headlessui-menu-item-${t}`,disabled:n=!1,...o}=A,[g,a]=HX("Menu.Item"),s=g.activeItemIndex!==null?g.items[g.activeItemIndex].id===i:!1,I=p.useRef(null),r=yo(e,I);fo(()=>{if(g.menuState!==0||!s||g.activationTrigger===0)return;let y=Qc();return y.requestAnimationFrame(()=>{var G,R;(R=(G=I.current)==null?void 0:G.scrollIntoView)==null||R.call(G,{block:"nearest"})}),y.dispose},[I,s,g.menuState,g.activationTrigger,g.activeItemIndex]);let C=p.useRef({disabled:n,domRef:I});fo(()=>{C.current.disabled=n},[C,n]),fo(()=>{var y,G;C.current.textValue=(G=(y=I.current)==null?void 0:y.textContent)==null?void 0:G.toLowerCase()},[C,I]),fo(()=>(a({type:5,id:i,dataRef:C}),()=>a({type:6,id:i})),[C,i]);let l=Be(()=>{a({type:1})}),c=Be(y=>{if(n)return y.preventDefault();a({type:1}),eZA(g.buttonRef.current)}),B=Be(()=>{if(n)return a({type:2,focus:vn.Nothing});a({type:2,focus:vn.Specific,id:i})}),E=lZA(),u=Be(y=>E.update(y)),d=Be(y=>{E.wasMoved(y)&&(n||s||a({type:2,focus:vn.Specific,id:i,trigger:0}))}),f=Be(y=>{E.wasMoved(y)&&(n||s&&a({type:2,focus:vn.Nothing}))}),w=p.useMemo(()=>({active:s,disabled:n,close:l}),[s,n,l]);return bo({ourProps:{id:i,ref:r,role:"menuitem",tabIndex:n===!0?void 0:-1,"aria-disabled":n===!0?!0:void 0,disabled:void 0,onClick:c,onFocus:B,onPointerEnter:u,onMouseEnter:u,onPointerMove:d,onMouseMove:d,onPointerLeave:f,onMouseLeave:f},theirProps:o,slot:w,defaultTag:RTe,name:"Menu.Item"})}let FTe=go(DTe),MTe=go(kTe),vTe=go(YTe),LTe=go(xTe),YoA=Object.assign(FTe,{Button:MTe,Items:vTe,Item:LTe});var STe=(A=>(A[A.Open=0]="Open",A[A.Closed=1]="Closed",A))(STe||{}),HTe=(A=>(A[A.TogglePopover=0]="TogglePopover",A[A.ClosePopover=1]="ClosePopover",A[A.SetButton=2]="SetButton",A[A.SetButtonId=3]="SetButtonId",A[A.SetPanel=4]="SetPanel",A[A.SetPanelId=5]="SetPanelId",A))(HTe||{});let ZTe={0:A=>({...A,popoverState:_i(A.popoverState,{0:1,1:0})}),1(A){return A.popoverState===1?A:{...A,popoverState:1}},2(A,e){return A.button===e.button?A:{...A,button:e.button}},3(A,e){return A.buttonId===e.buttonId?A:{...A,buttonId:e.buttonId}},4(A,e){return A.panel===e.panel?A:{...A,panel:e.panel}},5(A,e){return A.panelId===e.panelId?A:{...A,panelId:e.panelId}}},RoA=p.createContext(null);RoA.displayName="PopoverContext";function ZX(A){let e=p.useContext(RoA);if(e===null){let t=new Error(`<${A} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ZX),t}return e}let xoA=p.createContext(null);xoA.displayName="PopoverAPIContext";function FoA(A){let e=p.useContext(xoA);if(e===null){let t=new Error(`<${A} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,FoA),t}return e}let MoA=p.createContext(null);MoA.displayName="PopoverGroupContext";function dZA(){return p.useContext(MoA)}let voA=p.createContext(null);voA.displayName="PopoverPanelContext";function WTe(){return p.useContext(voA)}function KTe(A,e){return _i(e.type,ZTe,A,e)}let UTe="div";function VTe(A,e){var t;let i=p.useRef(null),n=yo(e,Hze(N=>{i.current=N})),o=p.useRef([]),g=p.useReducer(KTe,{popoverState:1,buttons:o,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:p.createRef(),afterPanelSentinel:p.createRef()}),[{popoverState:a,button:s,buttonId:I,panel:r,panelId:C,beforePanelSentinel:l,afterPanelSentinel:c},B]=g,E=SX((t=i.current)!=null?t:s),u=p.useMemo(()=>{if(!s||!r)return!1;for(let _ of document.querySelectorAll("body > *"))if(Number(_==null?void 0:_.contains(s))^Number(_==null?void 0:_.contains(r)))return!0;let N=jF(),v=N.indexOf(s),K=(v+N.length-1)%N.length,U=(v+1)%N.length,V=N[K],X=N[U];return!r.contains(V)&&!r.contains(X)},[s,r]),d=tr(I),f=tr(C),w=p.useMemo(()=>({buttonId:d,panelId:f,close:()=>B({type:1})}),[d,f,B]),y=dZA(),G=y==null?void 0:y.registerPopover,R=Be(()=>{var N;return(N=y==null?void 0:y.isFocusWithinPopoverGroup())!=null?N:(E==null?void 0:E.activeElement)&&((s==null?void 0:s.contains(E.activeElement))||(r==null?void 0:r.contains(E.activeElement)))});p.useEffect(()=>G==null?void 0:G(w),[G,w]),Tze(E==null?void 0:E.defaultView,"focus",N=>{var v,K,U,V;a===0&&(R()||s&&r&&N.target!==window&&((K=(v=l.current)==null?void 0:v.contains)!=null&&K.call(v,N.target)||(V=(U=c.current)==null?void 0:U.contains)!=null&&V.call(U,N.target)||B({type:1})))},!0),moA([s,r],(N,v)=>{B({type:1}),$F(v,PF.Loose)||(N.preventDefault(),s==null||s.focus())},a===0);let x=Be(N=>{B({type:1});let v=(()=>N?N instanceof HTMLElement?N:"current"in N&&N.current instanceof HTMLElement?N.current:s:s)();v==null||v.focus()}),F=p.useMemo(()=>({close:x,isPortalled:u}),[x,u]),Q=p.useMemo(()=>({open:a===0,close:x}),[a,x]),k=A,h={ref:n};return b.createElement(RoA.Provider,{value:g},b.createElement(xoA.Provider,{value:F},b.createElement(LX,{value:_i(a,{0:On.Open,1:On.Closed})},bo({ourProps:h,theirProps:k,slot:Q,defaultTag:UTe,name:"Popover"}))))}let XTe="button";function zTe(A,e){let t=jg(),{id:i=`headlessui-popover-button-${t}`,...n}=A,[o,g]=ZX("Popover.Button"),{isPortalled:a}=FoA("Popover.Button"),s=p.useRef(null),I=`headlessui-focus-sentinel-${jg()}`,r=dZA(),C=r==null?void 0:r.closeOthers,l=WTe(),c=l===null?!1:l===o.panelId;p.useEffect(()=>{if(!c)return g({type:3,buttonId:i}),()=>{g({type:3,buttonId:null})}},[c,i,g]);let[B]=p.useState(()=>Symbol()),E=yo(s,e,c?null:N=>{if(N)o.buttons.current.push(B);else{let v=o.buttons.current.indexOf(B);v!==-1&&o.buttons.current.splice(v,1)}o.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),N&&g({type:2,button:N})}),u=yo(s,e),d=SX(s),f=Be(N=>{var v,K,U;if(c){if(o.popoverState===1)return;switch(N.key){case Ve.Space:case Ve.Enter:N.preventDefault(),(K=(v=N.target).click)==null||K.call(v),g({type:1}),(U=o.button)==null||U.focus();break}}else switch(N.key){case Ve.Space:case Ve.Enter:N.preventDefault(),N.stopPropagation(),o.popoverState===1&&(C==null||C(o.buttonId)),g({type:0});break;case Ve.Escape:if(o.popoverState!==0)return C==null?void 0:C(o.buttonId);if(!s.current||d!=null&&d.activeElement&&!s.current.contains(d.activeElement))return;N.preventDefault(),N.stopPropagation(),g({type:1});break}}),w=Be(N=>{c||N.key===Ve.Space&&N.preventDefault()}),y=Be(N=>{var v,K;Wk(N.currentTarget)||A.disabled||(c?(g({type:1}),(v=o.button)==null||v.focus()):(N.preventDefault(),N.stopPropagation(),o.popoverState===1&&(C==null||C(o.buttonId)),g({type:0}),(K=o.button)==null||K.focus()))}),G=Be(N=>{N.preventDefault(),N.stopPropagation()}),R=o.popoverState===0,x=p.useMemo(()=>({open:R}),[R]),F=poA(A,s),Q=c?{ref:u,type:F,onKeyDown:f,onClick:y}:{ref:E,id:o.buttonId,type:F,"aria-expanded":A.disabled?void 0:o.popoverState===0,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:f,onKeyUp:w,onClick:y,onMouseDown:G},k=cZA(),h=Be(()=>{let N=o.panel;if(!N)return;function v(){_i(k.current,{[qu.Forwards]:()=>IQ(N,as.First),[qu.Backwards]:()=>IQ(N,as.Last)})===Zk.Error&&IQ(jF().filter(K=>K.dataset.headlessuiFocusGuard!=="true"),_i(k.current,{[qu.Forwards]:as.Next,[qu.Backwards]:as.Previous}),{relativeTo:o.button})}v()});return b.createElement(b.Fragment,null,bo({ourProps:Q,theirProps:n,slot:x,defaultTag:XTe,name:"Popover.Button"}),R&&!c&&a&&b.createElement(AM,{id:I,features:Kk.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:h}))}let TTe="div",_Te=CQ.RenderStrategy|CQ.Static;function OTe(A,e){let t=jg(),{id:i=`headlessui-popover-overlay-${t}`,...n}=A,[{popoverState:o},g]=ZX("Popover.Overlay"),a=yo(e),s=Uk(),I=(()=>s!==null?(s&On.Open)===On.Open:o===0)(),r=Be(l=>{if(Wk(l.currentTarget))return l.preventDefault();g({type:1})}),C=p.useMemo(()=>({open:o===0}),[o]);return bo({ourProps:{ref:a,id:i,"aria-hidden":!0,onClick:r},theirProps:n,slot:C,defaultTag:TTe,features:_Te,visible:I,name:"Popover.Overlay"})}let qTe="div",jTe=CQ.RenderStrategy|CQ.Static;function PTe(A,e){let t=jg(),{id:i=`headlessui-popover-panel-${t}`,focus:n=!1,...o}=A,[g,a]=ZX("Popover.Panel"),{close:s,isPortalled:I}=FoA("Popover.Panel"),r=`headlessui-focus-sentinel-before-${jg()}`,C=`headlessui-focus-sentinel-after-${jg()}`,l=p.useRef(null),c=yo(l,e,x=>{a({type:4,panel:x})}),B=SX(l);fo(()=>(a({type:5,panelId:i}),()=>{a({type:5,panelId:null})}),[i,a]);let E=Uk(),u=(()=>E!==null?(E&On.Open)===On.Open:g.popoverState===0)(),d=Be(x=>{var F;switch(x.key){case Ve.Escape:if(g.popoverState!==0||!l.current||B!=null&&B.activeElement&&!l.current.contains(B.activeElement))return;x.preventDefault(),x.stopPropagation(),a({type:1}),(F=g.button)==null||F.focus();break}});p.useEffect(()=>{var x;A.static||g.popoverState===1&&((x=A.unmount)==null||x)&&a({type:4,panel:null})},[g.popoverState,A.unmount,A.static,a]),p.useEffect(()=>{if(!n||g.popoverState!==0||!l.current)return;let x=B==null?void 0:B.activeElement;l.current.contains(x)||IQ(l.current,as.First)},[n,l,g.popoverState]);let f=p.useMemo(()=>({open:g.popoverState===0,close:s}),[g,s]),w={ref:c,id:i,onKeyDown:d,onBlur:n&&g.popoverState===0?x=>{var F,Q,k,h,N;let v=x.relatedTarget;v&&l.current&&((F=l.current)!=null&&F.contains(v)||(a({type:1}),((k=(Q=g.beforePanelSentinel.current)==null?void 0:Q.contains)!=null&&k.call(Q,v)||(N=(h=g.afterPanelSentinel.current)==null?void 0:h.contains)!=null&&N.call(h,v))&&v.focus({preventScroll:!0})))}:void 0,tabIndex:-1},y=cZA(),G=Be(()=>{let x=l.current;if(!x)return;function F(){_i(y.current,{[qu.Forwards]:()=>{var Q;IQ(x,as.First)===Zk.Error&&((Q=g.afterPanelSentinel.current)==null||Q.focus())},[qu.Backwards]:()=>{var Q;(Q=g.button)==null||Q.focus({preventScroll:!0})}})}F()}),R=Be(()=>{let x=l.current;if(!x)return;function F(){_i(y.current,{[qu.Forwards]:()=>{var Q;if(!g.button)return;let k=jF(),h=k.indexOf(g.button),N=k.slice(0,h+1),v=[...k.slice(h+1),...N];for(let K of v.slice())if(K.dataset.headlessuiFocusGuard==="true"||(Q=g.panel)!=null&&Q.contains(K)){let U=v.indexOf(K);U!==-1&&v.splice(U,1)}IQ(v,as.First,{sorted:!1})},[qu.Backwards]:()=>{var Q;IQ(x,as.Previous)===Zk.Error&&((Q=g.button)==null||Q.focus())}})}F()});return b.createElement(voA.Provider,{value:i},u&&I&&b.createElement(AM,{id:r,ref:g.beforePanelSentinel,features:Kk.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:G}),bo({ourProps:w,theirProps:o,slot:f,defaultTag:qTe,features:jTe,visible:u,name:"Popover.Panel"}),u&&I&&b.createElement(AM,{id:C,ref:g.afterPanelSentinel,features:Kk.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:R}))}let $Te="div";function A_e(A,e){let t=p.useRef(null),i=yo(t,e),[n,o]=p.useState([]),g=Be(B=>{o(E=>{let u=E.indexOf(B);if(u!==-1){let d=E.slice();return d.splice(u,1),d}return E})}),a=Be(B=>(o(E=>[...E,B]),()=>g(B))),s=Be(()=>{var B;let E=My(t);if(!E)return!1;let u=E.activeElement;return(B=t.current)!=null&&B.contains(u)?!0:n.some(d=>{var f,w;return((f=E.getElementById(d.buttonId.current))==null?void 0:f.contains(u))||((w=E.getElementById(d.panelId.current))==null?void 0:w.contains(u))})}),I=Be(B=>{for(let E of n)E.buttonId.current!==B&&E.close()}),r=p.useMemo(()=>({registerPopover:a,unregisterPopover:g,isFocusWithinPopoverGroup:s,closeOthers:I}),[a,g,s,I]),C=p.useMemo(()=>({}),[]),l=A,c={ref:i};return b.createElement(MoA.Provider,{value:r},bo({ourProps:c,theirProps:l,slot:C,defaultTag:$Te,name:"Popover.Group"}))}let e_e=go(VTe),t_e=go(zTe),i_e=go(OTe),n_e=go(PTe),o_e=go(A_e),LoA=Object.assign(e_e,{Button:t_e,Overlay:i_e,Panel:n_e,Group:o_e});function hZA(A=0){let[e,t]=p.useState(A),i=p.useCallback(a=>t(s=>s|a),[e]),n=p.useCallback(a=>!!(e&a),[e]),o=p.useCallback(a=>t(s=>s&~a),[t]),g=p.useCallback(a=>t(s=>s^a),[t]);return{flags:e,addFlag:i,hasFlag:n,removeFlag:o,toggleFlag:g}}let mZA=p.createContext(null);function pZA(){let A=p.useContext(mZA);if(A===null){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,pZA),e}return A}function fZA(){let[A,e]=p.useState([]);return[A.length>0?A.join(" "):void 0,p.useMemo(()=>function(t){let i=Be(o=>(e(g=>[...g,o]),()=>e(g=>{let a=g.slice(),s=a.indexOf(o);return s!==-1&&a.splice(s,1),a}))),n=p.useMemo(()=>({register:i,slot:t.slot,name:t.name,props:t.props}),[i,t.slot,t.name,t.props]);return b.createElement(mZA.Provider,{value:n},t.children)},[e])]}let g_e="label";function a_e(A,e){let t=jg(),{id:i=`headlessui-label-${t}`,passive:n=!1,...o}=A,g=pZA(),a=yo(e);fo(()=>g.register(i),[i,g.register]);let s={ref:a,...g.props,id:i};return n&&("onClick"in s&&delete s.onClick,"onClick"in o&&delete o.onClick),bo({ourProps:s,theirProps:o,slot:g.slot||{},defaultTag:g_e,name:g.name||"Label"})}let s_e=go(a_e),r_e=Object.assign(s_e,{});var I_e=(A=>(A[A.RegisterOption=0]="RegisterOption",A[A.UnregisterOption=1]="UnregisterOption",A))(I_e||{});let C_e={0(A,e){let t=[...A.options,{id:e.id,element:e.element,propsRef:e.propsRef}];return{...A,options:FX(t,i=>i.element.current)}},1(A,e){let t=A.options.slice(),i=A.options.findIndex(n=>n.id===e.id);return i===-1?A:(t.splice(i,1),{...A,options:t})}},SoA=p.createContext(null);SoA.displayName="RadioGroupDataContext";function yZA(A){let e=p.useContext(SoA);if(e===null){let t=new Error(`<${A} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,yZA),t}return e}let HoA=p.createContext(null);HoA.displayName="RadioGroupActionsContext";function bZA(A){let e=p.useContext(HoA);if(e===null){let t=new Error(`<${A} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,bZA),t}return e}function l_e(A,e){return _i(e.type,C_e,A,e)}let c_e="div";function B_e(A,e){let t=jg(),{id:i=`headlessui-radiogroup-${t}`,value:n,defaultValue:o,name:g,onChange:a,by:s=(_,q)=>_===q,disabled:I=!1,...r}=A,C=Be(typeof s=="string"?(_,q)=>{let $=s;return(_==null?void 0:_[$])===(q==null?void 0:q[$])}:s),[l,c]=p.useReducer(l_e,{options:[]}),B=l.options,[E,u]=fZA(),[d,f]=uZA(),w=p.useRef(null),y=yo(w,e),[G,R]=IZA(n,a,o),x=p.useMemo(()=>B.find(_=>!_.propsRef.current.disabled),[B]),F=p.useMemo(()=>B.some(_=>C(_.propsRef.current.value,G)),[B,G]),Q=Be(_=>{var q;if(I||C(_,G))return!1;let $=(q=B.find(nA=>C(nA.propsRef.current.value,_)))==null?void 0:q.propsRef.current;return $!=null&&$.disabled?!1:(R==null||R(_),!0)});nZA({container:w.current,accept(_){return _.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:_.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(_){_.setAttribute("role","none")}});let k=Be(_=>{let q=w.current;if(!q)return;let $=My(q),nA=B.filter(j=>j.propsRef.current.disabled===!1).map(j=>j.element.current);switch(_.key){case Ve.Enter:Uze(_.currentTarget);break;case Ve.ArrowLeft:case Ve.ArrowUp:if(_.preventDefault(),_.stopPropagation(),IQ(nA,as.Previous|as.WrapAround)===Zk.Success){let j=B.find(O=>O.element.current===($==null?void 0:$.activeElement));j&&Q(j.propsRef.current.value)}break;case Ve.ArrowRight:case Ve.ArrowDown:if(_.preventDefault(),_.stopPropagation(),IQ(nA,as.Next|as.WrapAround)===Zk.Success){let j=B.find(O=>O.element.current===($==null?void 0:$.activeElement));j&&Q(j.propsRef.current.value)}break;case Ve.Space:{_.preventDefault(),_.stopPropagation();let j=B.find(O=>O.element.current===($==null?void 0:$.activeElement));j&&Q(j.propsRef.current.value)}break}}),h=Be(_=>(c({type:0,..._}),()=>c({type:1,id:_.id}))),N=p.useMemo(()=>({value:G,firstOption:x,containsCheckedOption:F,disabled:I,compare:C,...l}),[G,x,F,I,C,l]),v=p.useMemo(()=>({registerOption:h,change:Q}),[h,Q]),K={ref:y,id:i,role:"radiogroup","aria-labelledby":E,"aria-describedby":d,onKeyDown:k},U=p.useMemo(()=>({value:G}),[G]),V=p.useRef(null),X=_u();return p.useEffect(()=>{V.current&&o!==void 0&&X.addEventListener(V.current,"reset",()=>{Q(o)})},[V,Q]),b.createElement(f,{name:"RadioGroup.Description"},b.createElement(u,{name:"RadioGroup.Label"},b.createElement(HoA.Provider,{value:v},b.createElement(SoA.Provider,{value:N},g!=null&&G!=null&&yoA({[g]:G}).map(([_,q],$)=>b.createElement(AM,{features:Kk.Hidden,ref:$===0?nA=>{var j;V.current=(j=nA==null?void 0:nA.closest("form"))!=null?j:null}:void 0,...vX({key:_,as:"input",type:"radio",checked:q!=null,hidden:!0,readOnly:!0,name:_,value:q})})),bo({ourProps:K,theirProps:r,slot:U,defaultTag:c_e,name:"RadioGroup"})))))}var Q_e=(A=>(A[A.Empty=1]="Empty",A[A.Active=2]="Active",A))(Q_e||{});let E_e="div";function u_e(A,e){var t;let i=jg(),{id:n=`headlessui-radiogroup-option-${i}`,value:o,disabled:g=!1,...a}=A,s=p.useRef(null),I=yo(s,e),[r,C]=fZA(),[l,c]=uZA(),{addFlag:B,removeFlag:E,hasFlag:u}=hZA(1),d=tr({value:o,disabled:g}),f=yZA("RadioGroup.Option"),w=bZA("RadioGroup.Option");fo(()=>w.registerOption({id:n,element:s,propsRef:d}),[n,w,s,A]);let y=Be(N=>{var v;if(Wk(N.currentTarget))return N.preventDefault();w.change(o)&&(B(2),(v=s.current)==null||v.focus())}),G=Be(N=>{if(Wk(N.currentTarget))return N.preventDefault();B(2)}),R=Be(()=>E(2)),x=((t=f.firstOption)==null?void 0:t.id)===n,F=f.disabled||g,Q=f.compare(f.value,o),k={ref:I,id:n,role:"radio","aria-checked":Q?"true":"false","aria-labelledby":r,"aria-describedby":l,"aria-disabled":F?!0:void 0,tabIndex:(()=>F?-1:Q||!f.containsCheckedOption&&x?0:-1)(),onClick:F?void 0:y,onFocus:F?void 0:G,onBlur:F?void 0:R},h=p.useMemo(()=>({checked:Q,disabled:F,active:u(2)}),[Q,F,u]);return b.createElement(c,{name:"RadioGroup.Description"},b.createElement(C,{name:"RadioGroup.Label"},bo({ourProps:k,theirProps:a,slot:h,defaultTag:E_e,name:"RadioGroup.Option"})))}let d_e=go(B_e),h_e=go(u_e),ZoA=Object.assign(d_e,{Option:h_e,Label:r_e,Description:jze});function m_e(A){let e={called:!1};return(...t)=>{if(!e.called)return e.called=!0,A(...t)}}function WoA(A,...e){A&&e.length>0&&A.classList.add(...e)}function KoA(A,...e){A&&e.length>0&&A.classList.remove(...e)}function p_e(A,e){let t=Qc();if(!A)return t.dispose;let{transitionDuration:i,transitionDelay:n}=getComputedStyle(A),[o,g]=[i,n].map(a=>{let[s=0]=a.split(",").filter(Boolean).map(I=>I.includes("ms")?parseFloat(I):parseFloat(I)*1e3).sort((I,r)=>r-I);return s});if(o+g!==0){let a=t.addEventListener(A,"transitionend",s=>{s.target===s.currentTarget&&(e(),a())})}else e();return t.add(()=>e()),t.dispose}function f_e(A,e,t,i){let n=t?"enter":"leave",o=Qc(),g=i!==void 0?m_e(i):()=>{};n==="enter"&&(A.removeAttribute("hidden"),A.style.display="");let a=_i(n,{enter:()=>e.enter,leave:()=>e.leave}),s=_i(n,{enter:()=>e.enterTo,leave:()=>e.leaveTo}),I=_i(n,{enter:()=>e.enterFrom,leave:()=>e.leaveFrom});return KoA(A,...e.enter,...e.enterTo,...e.enterFrom,...e.leave,...e.leaveFrom,...e.leaveTo,...e.entered),WoA(A,...a,...I),o.nextFrame(()=>{KoA(A,...I),WoA(A,...s),p_e(A,()=>(KoA(A,...a),WoA(A,...e.entered),g()))}),o.dispose}function y_e({container:A,direction:e,classes:t,onStart:i,onStop:n}){let o=BZA(),g=_u(),a=tr(e);fo(()=>{let s=Qc();g.add(s.dispose);let I=A.current;if(I&&a.current!=="idle"&&o.current)return s.dispose(),i.current(a.current),s.add(f_e(I,t.current,a.current==="enter",()=>{s.dispose(),n.current(a.current)})),s.dispose},[e])}function vy(A=""){return A.split(" ").filter(e=>e.trim().length>1)}let WX=p.createContext(null);WX.displayName="TransitionContext";var b_e=(A=>(A.Visible="visible",A.Hidden="hidden",A))(b_e||{});function w_e(){let A=p.useContext(WX);if(A===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return A}function D_e(){let A=p.useContext(KX);if(A===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return A}let KX=p.createContext(null);KX.displayName="NestingContext";function UX(A){return"children"in A?UX(A.children):A.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function wZA(A,e){let t=tr(A),i=p.useRef([]),n=BZA(),o=_u(),g=Be((c,B=Ou.Hidden)=>{let E=i.current.findIndex(({el:u})=>u===c);E!==-1&&(_i(B,{[Ou.Unmount](){i.current.splice(E,1)},[Ou.Hidden](){i.current[E].state="hidden"}}),o.microTask(()=>{var u;!UX(i)&&n.current&&((u=t.current)==null||u.call(t))}))}),a=Be(c=>{let B=i.current.find(({el:E})=>E===c);return B?B.state!=="visible"&&(B.state="visible"):i.current.push({el:c,state:"visible"}),()=>g(c,Ou.Unmount)}),s=p.useRef([]),I=p.useRef(Promise.resolve()),r=p.useRef({enter:[],leave:[],idle:[]}),C=Be((c,B,E)=>{s.current.splice(0),e&&(e.chains.current[B]=e.chains.current[B].filter(([u])=>u!==c)),e==null||e.chains.current[B].push([c,new Promise(u=>{s.current.push(u)})]),e==null||e.chains.current[B].push([c,new Promise(u=>{Promise.all(r.current[B].map(([d,f])=>f)).then(()=>u())})]),B==="enter"?I.current=I.current.then(()=>e==null?void 0:e.wait.current).then(()=>E(B)):E(B)}),l=Be((c,B,E)=>{Promise.all(r.current[B].splice(0).map(([u,d])=>d)).then(()=>{var u;(u=s.current.shift())==null||u()}).then(()=>E(B))});return p.useMemo(()=>({children:i,register:a,unregister:g,onStart:C,onStop:l,wait:I,chains:r}),[a,g,i,C,l,r,I])}function G_e(){}let k_e=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function DZA(A){var e;let t={};for(let i of k_e)t[i]=(e=A[i])!=null?e:G_e;return t}function J_e(A){let e=p.useRef(DZA(A));return p.useEffect(()=>{e.current=DZA(A)},[A]),e}let N_e="div",GZA=CQ.RenderStrategy;function Y_e(A,e){let{beforeEnter:t,afterEnter:i,beforeLeave:n,afterLeave:o,enter:g,enterFrom:a,enterTo:s,entered:I,leave:r,leaveFrom:C,leaveTo:l,...c}=A,B=p.useRef(null),E=yo(B,e),u=c.unmount?Ou.Unmount:Ou.Hidden,{show:d,appear:f,initial:w}=w_e(),[y,G]=p.useState(d?"visible":"hidden"),R=D_e(),{register:x,unregister:F}=R,Q=p.useRef(null);p.useEffect(()=>x(B),[x,B]),p.useEffect(()=>{if(u===Ou.Hidden&&B.current){if(d&&y!=="visible"){G("visible");return}return _i(y,{hidden:()=>F(B),visible:()=>x(B)})}},[y,B,x,F,d,u]);let k=tr({enter:vy(g),enterFrom:vy(a),enterTo:vy(s),entered:vy(I),leave:vy(r),leaveFrom:vy(C),leaveTo:vy(l)}),h=J_e({beforeEnter:t,afterEnter:i,beforeLeave:n,afterLeave:o}),N=uoA();p.useEffect(()=>{if(N&&y==="visible"&&B.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[B,y,N]);let v=w&&!f,K=(()=>!N||v||Q.current===d?"idle":d?"enter":"leave")(),U=hZA(0),V=Be(nA=>_i(nA,{enter:()=>{U.addFlag(On.Opening),h.current.beforeEnter()},leave:()=>{U.addFlag(On.Closing),h.current.beforeLeave()},idle:()=>{}})),X=Be(nA=>_i(nA,{enter:()=>{U.removeFlag(On.Opening),h.current.afterEnter()},leave:()=>{U.removeFlag(On.Closing),h.current.afterLeave()},idle:()=>{}})),_=wZA(()=>{G("hidden"),F(B)},R);y_e({container:B,classes:k,direction:K,onStart:tr(nA=>{_.onStart(B,nA,V)}),onStop:tr(nA=>{_.onStop(B,nA,X),nA==="leave"&&!UX(_)&&(G("hidden"),F(B))})}),p.useEffect(()=>{v&&(u===Ou.Hidden?Q.current=null:Q.current=d)},[d,v,y]);let q=c,$={ref:E};return f&&d&&Om.isServer&&(q={...q,className:gZA(c.className,...k.current.enter,...k.current.enterFrom)}),b.createElement(KX.Provider,{value:_},b.createElement(LX,{value:_i(y,{visible:On.Open,hidden:On.Closed})|U.flags},bo({ourProps:$,theirProps:q,defaultTag:N_e,features:GZA,visible:y==="visible",name:"Transition.Child"})))}function R_e(A,e){let{show:t,appear:i=!1,unmount:n,...o}=A,g=p.useRef(null),a=yo(g,e);uoA();let s=Uk();if(t===void 0&&s!==null&&(t=(s&On.Open)===On.Open),![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[I,r]=p.useState(t?"visible":"hidden"),C=wZA(()=>{r("hidden")}),[l,c]=p.useState(!0),B=p.useRef([t]);fo(()=>{l!==!1&&B.current[B.current.length-1]!==t&&(B.current.push(t),c(!1))},[B,t]);let E=p.useMemo(()=>({show:t,appear:i,initial:l}),[t,i,l]);p.useEffect(()=>{if(t)r("visible");else if(!UX(C))r("hidden");else{let d=g.current;if(!d)return;let f=d.getBoundingClientRect();f.x===0&&f.y===0&&f.width===0&&f.height===0&&r("hidden")}},[t,C]);let u={unmount:n};return b.createElement(KX.Provider,{value:C},b.createElement(WX.Provider,{value:E},bo({ourProps:{...u,as:p.Fragment,children:b.createElement(kZA,{ref:a,...u,...o})},theirProps:{},defaultTag:p.Fragment,features:GZA,visible:I==="visible",name:"Transition"})))}function x_e(A,e){let t=p.useContext(WX)!==null,i=Uk()!==null;return b.createElement(b.Fragment,null,!t&&i?b.createElement(UoA,{ref:e,...A}):b.createElement(kZA,{ref:e,...A}))}let UoA=go(R_e),kZA=go(Y_e),F_e=go(x_e),VX=Object.assign(UoA,{Child:F_e,Root:UoA});const M_e=A=>{const{options:e=[],disable:t=!1,selectedKeys:i=[],onSelect:n,className:o="",required:g}=A,[a,s]=p.useState(e.filter(C=>i.includes(C.key)));p.useEffect(()=>{s(e.filter(C=>i.includes(C.key)))},[e,i]);const I=p.useRef(i);I.current=i;const r=p.useRef(n);return r.current=n,p.useEffect(()=>{var C;const l=a.map(c=>c.key);(l.length!==I.current.length||l.some(c=>!I.current.includes(c)))&&((C=r.current)==null||C.call(r,l))},[a]),t?b.createElement(p.Fragment,null,A.children):b.createElement(TnA,null,b.createElement("div",{className:"relative w-full flex items-center space-x-2"},b.createElement("span",{className:"flex-1 block truncate text-start"},A.children),b.createElement(_nA,{asChild:!0},b.createElement("div",{className:"grow-0 shrink-0 flex items-center relative"},b.createElement(MFA,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),a.length>0&&b.createElement("span",{className:"absolute top-0 right-0 h-4 px-1 translate-x-1/2 -translate-y-1/2 scale-[67%] flex items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-normal pointer-events-none"},a.length>10?"10+":a.length)))),b.createElement(mX,{className:"mt-1 max-h-60 w-fit overflow-auto rounded-md py-1 px-0 text-base sm:text-sm"},b.createElement(koA,{multiple:!0,value:a,onChange:s},b.createElement(koA.Options,{static:!0},e.map(C=>b.createElement(koA.Option,{key:C.key,className:"relative cursor-default rounded-md mx-1 select-none py-2 pl-10 pr-4 text-popover-foreground hover:bg-accent hover:text-accent-foreground",value:C},({selected:l})=>b.createElement(b.Fragment,null,b.createElement("span",{className:`block truncate ${l?"font-medium":"font-normal"}`},C.label),l&&b.createElement("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-accent-foreground"},b.createElement(FFA,{className:"h-5 w-5","aria-hidden":"true"})))))))))},VoA=M_e,v_e=A=>{const{provided:e,dkey:t,fIndex:i}=A,n=xt(),{config:o,allFields:g}=n,a=n.allEncodings[t.id][i],{t:s}=ve("translation",{keyPrefix:"constant.aggregator"}),I=p.useMemo(()=>ke.AGGREGATOR_LIST.map(l=>({value:l,label:s(l)})),[]),r=p.useMemo(()=>g.filter(l=>l.analyticType==="measure"&&l.fid!==yi).map(l=>({key:l.fid,label:l.name})),[g]),C=a.fid===fi?o.folds??[]:null;return b.createElement(bze,{ref:TC(e.innerRef),colType:a.analyticType==="dimension"?"discrete":"continuous",className:`${a.aggName==="expr"&&!o.defaultAggregated?"!opacity-50 touch-none":"touch-none"}`,...e.draggableProps,...e.dragHandleProps},C&&b.createElement(VoA,{options:r,selectedKeys:C,onSelect:l=>{n.setVisualConfig("folds",l)}},b.createElement("span",{className:"flex-1 truncate"},a.name)),!C&&b.createElement("span",{className:"flex-1 truncate"},a.name)," ",a.analyticType==="measure"&&a.fid!==no&&o.defaultAggregated&&a.aggName!=="expr"&&b.createElement(xX,{options:I,onSelect:l=>{n.setFieldAggregator(t.id,i,l)}},b.createElement("span",{className:"bg-transparent float-right focus:outline-none focus: dark:focus: flex items-center ml-2"},a.aggName||"",b.createElement(sF,{className:"w-3"}))),a.analyticType==="dimension"&&a.sort==="ascending"&&b.createElement(JiA,{className:"float-right w-3",role:"status","aria-label":"Sorted in ascending order"}),a.analyticType==="dimension"&&a.sort==="descending"&&b.createElement(kiA,{className:"float-right w-3",role:"status","aria-label":"Sorted in descending order"}))},L_e=ze(v_e),S_e=A=>{const{provided:e,dkey:t}=A,i=xt(),{allEncodings:n}=i;return b.createElement(pze,{...e.droppableProps,ref:TC(e.innerRef)},n[t.id].map((o,g)=>b.createElement(OG,{key:`encode_${t.id}_${g}_${EI(o)}`,draggableId:`encode_${t.id}_${g}_${EI(o)}`,index:g},(a,s)=>b.createElement(L_e,{dkey:t,fIndex:g,provided:a}))))},H_e=ze(S_e),Z_e=A=>{const e=xt(),{config:t}=e,{geoms:i,coordSystem:n="generic"}=t,o=p.useMemo(()=>n==="geographic"?i[0]==="choropleth"?qF.filter(g=>g.id==="geoId"):qF.filter(g=>g.id==="longitude"||g.id==="latitude"):i[0]==="arc"?qF.filter(g=>g.id==="radius"||g.id==="theta"):qF.filter(g=>g.id==="columns"||g.id==="rows"),[i[0],n]);return b.createElement("div",null,o.map((g,a)=>b.createElement(hze,{name:g.id,key:g.id},b.createElement(By,{droppableId:g.id,direction:"horizontal"},(s,I)=>b.createElement(H_e,{dkey:g,provided:s})))))},W_e=ze(Z_e),K_e=an.div`
    overflow: visible !important;
    width: calc(100% - 1.875rem);
`,U_e=A=>{const{dkey:e,provided:t,snapshot:i}=A,n=xt(),{allEncodings:o,config:g,allFields:a}=n,s=g.folds??[],I=o[e.id][0],{t:r}=ve(),C=p.useMemo(()=>ke.AGGREGATOR_LIST.map(c=>({value:c,label:r(`constant.aggregator.${c}`)})),[]),l=p.useMemo(()=>a.filter(c=>c.analyticType==="measure"&&c.fid!==yi).map(c=>({key:c.fid,label:c.name})),[a]);return b.createElement("div",{className:"p-1 select-none relative touch-none",...t.droppableProps,ref:TC(t.innerRef)},b.createElement("div",{className:`p-1.5 bg-muted text-muted-foreground border flex item-center justify-center grow ${i.draggingFromThisWith||i.isDraggingOver||!I?"opacity-100":"opacity-0"} relative z-0`},r("actions.drop_field")),I&&b.createElement(OG,{draggableId:`encode_${e.id}_${EI(I)}`,index:0},(c,B)=>{var E;return b.createElement("div",{ref:TC(c.innerRef),...c.draggableProps,...c.dragHandleProps,className:"flex items-stretch absolute top-0 left-0 right-0 bottom-0 m-1 touch-none"+((E=c.draggableProps.style)!=null&&E.transform?" z-10":"")+(I.aggName==="expr"&&!g.defaultAggregated?" !opacity-50":"")},b.createElement("div",{onClick:()=>{n.removeField(e.id,0)},className:"grow-0 shrink-0 px-1.5 flex items-center justify-center bg-destructive text-destructive-foreground cursor-pointer"},b.createElement(yV,{className:"w-4"})),b.createElement(K_e,{className:"flex-1 flex items-center border border-l-0 px-2 space-x-2 truncate"},I.fid===fi&&b.createElement(VoA,{options:l,selectedKeys:s,onSelect:u=>{n.setVisualConfig("folds",u)},className:"flex-1"},b.createElement("span",{className:"flex-1 truncate",title:I.name},I.name)),I.fid!==fi&&b.createElement("span",{className:"flex-1 truncate"},I.name)," ",I.analyticType==="measure"&&I.fid!==no&&g.defaultAggregated&&I.aggName!=="expr"&&b.createElement(xX,{options:C,onSelect:u=>{n.setFieldAggregator(e.id,0,u)}},b.createElement("span",{className:"bg-transparent text-muted-foreground float-right focus:outline-none focus: dark:focus: flex items-center ml-2"},I.aggName||"",b.createElement(sF,{className:"w-3"})))))}))},V_e=ze(U_e),X_e=an.div`
    overflow: visible !important;
    width: calc(100% - 1.875rem);
`,z_e=A=>{const{dkey:e,provided:t,snapshot:i}=A,n=xt(),{currentEncodings:o,config:g,allFields:a}=n,s=g.folds??[],I=o[e.id],{t:r}=ve(),C=p.useMemo(()=>ke.AGGREGATOR_LIST.map(c=>({value:c,label:r(`constant.aggregator.${c}`)})),[]),l=p.useMemo(()=>a.filter(c=>c.analyticType==="measure"&&c.fid!==yi).map(c=>({key:c.fid,label:c.name})),[a]);return b.createElement("div",{className:"relative select-none flex flex-col py-0.5 px-1 touch-none",...t.droppableProps,ref:TC(t.innerRef)},I.map((c,B)=>b.createElement(OG,{key:`encode_${e.id}_${B}_${EI(c)}`,draggableId:`encode_${e.id}_${B}_${EI(c)}`,index:B},(E,u)=>{var d;return b.createElement("div",{ref:TC(E.innerRef),...E.draggableProps,...E.dragHandleProps,className:"flex items-stretch h-[30px] my-0.5 relative touch-none"+((d=E.draggableProps.style)!=null&&d.transform?" z-10":"")+(c.aggName==="expr"&&!g.defaultAggregated?" !opacity-50":"")},b.createElement("div",{onClick:()=>{n.removeField(e.id,0)},className:"grow-0 shrink-0 px-1.5 flex items-center justify-center bg-destructive text-destructive-foreground cursor-pointer"},b.createElement(yV,{className:"w-4"})),b.createElement(X_e,{className:"flex-1 flex items-center border border-l-0 px-2 space-x-2 truncate"},c.fid===fi&&b.createElement(VoA,{options:l,selectedKeys:s,onSelect:f=>{n.setVisualConfig("folds",f)},className:"flex-1"},b.createElement("span",{className:"flex-1 truncate",title:c.name},c.name)),c.fid!==fi&&b.createElement("span",{className:"flex-1 truncate"},c.name)," ",c.analyticType==="measure"&&c.fid!==no&&g.defaultAggregated&&c.aggName!=="expr"&&b.createElement(xX,{options:C,onSelect:f=>{n.setFieldAggregator(e.id,0,f)}},b.createElement("span",{className:"bg-transparent text-muted-foreground float-right focus:outline-none focus: dark:focus: flex items-center ml-2"},c.aggName||"",b.createElement(sF,{className:"w-3"})))))})),I.length!==0&&t.placeholder,I.length===0&&b.createElement("div",{className:"h-[34px] w-full"}),b.createElement("div",{className:`p-1.5 m-1 bg-muted text-muted-foreground pointer-events-none border flex item-center justify-center grow ${i.draggingFromThisWith&&I.length===1||I.length===0?"opacity-100":"opacity-0"} absolute inset-0 z-0`},r("actions.drop_field")))},T_e=ze(z_e),iM=qF.filter(A=>["color","opacity","size","shape","details","text"].includes(A.id)),__e=A=>{const e=xt(),{config:t}=e,{geoms:i}=t,n=p.useMemo(()=>{switch(i[0]){case"bar":case"tick":case"arc":case"line":case"area":case"boxplot":return iM.filter(o=>o.id!=="shape");case"text":return iM.filter(o=>o.id==="text"||o.id==="color"||o.id==="size"||o.id==="opacity");case"table":return[];case"poi":return iM.filter(o=>o.id==="color"||o.id==="opacity"||o.id==="size"||o.id==="details");case"choropleth":return iM.filter(o=>o.id==="color"||o.id==="opacity"||o.id==="text"||o.id==="details");default:return iM.filter(o=>o.id!=="text")}},[i[0]]);return b.createElement("div",null,n.map((o,g,{length:a})=>ke.CHANNEL_LIMIT[o.id]===1?b.createElement(PHA,{name:o.id,key:o.id,style:{position:"relative"}},b.createElement(By,{droppableId:o.id,direction:"horizontal"},(s,I)=>b.createElement(V_e,{dkey:o,provided:s,snapshot:I}))):b.createElement(PHA,{name:o.id,key:o.id,style:{position:"relative"}},b.createElement(By,{droppableId:o.id,direction:"vertical"},(s,I)=>b.createElement(T_e,{dkey:o,provided:s,snapshot:I})))))},O_e=ze(__e),q_e=A=>{const{dataType:e,analyticType:t}=A,i=`w-3 inline-block ${t==="dimension"?"text-dimension":"text-measure"}`;switch(e){case"quantitative":case"ordinal":return b.createElement(rHe,{className:i});case"temporal":return b.createElement(nSe,{className:i});default:return b.createElement(USe,{className:i})}},Vk=q_e,j_e=A=>{const{["aria-expanded"]:e,onPress:t,disabled:i,className:n="",...o}=A,g=p.useCallback(s=>{s.preventDefault(),s.stopPropagation(),t==null||t()},[t]),a=p.useCallback(s=>{switch(s.key){case"Enter":case"Space":{t==null||t();break}default:return}s.preventDefault(),s.stopPropagation()},[t]);return p.useMemo(()=>({...o,className:lc(n,i?"cursor-default text-opacity-50":"cursor-pointer rounded-full focus:outline-none focus:ring-1 focus:ring-ring hover:bg-accent hover:text-accent-foreground","text-muted-foreground"),role:"button","aria-haspopup":"menu","aria-expanded":e,"aria-disabled":i,tabIndex:i?void 0:0,onClick:g,onKeyDown:a}),[g,a,e,i,n,o])};function P_e(...A){return A.filter(Boolean).join(" ")}const $_e=an.div`
    display: grid;
    grid-template-columns: max-content 1fr max-content;
    & > div {
        /* row */
        display: contents;
        > * {
            background: inherit;
            cursor: pointer;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            overflow: hidden;
            padding-block: 0.2rem;
            padding-inline: 0.2rem;
            &:first-child {
                padding-left: 0.4rem;
            }
        }
        > *:first-child {
            border-top-left-radius: calc(var(--radius) - 4px);
            border-bottom-left-radius: calc(var(--radius) - 4px);
        }
        > *:last-child {
            border-top-right-radius: calc(var(--radius) - 4px);
            border-bottom-right-radius: calc(var(--radius) - 4px);
        }
        &[aria-disabled='true'] > * {
            opacity: 0.5;
            cursor: default;
        }
    }
`,JZA=p.createContext(null),A4e=p.memo(function({item:A,path:e}){const{icon:t,label:i,disabled:n=!1,children:o=[],onPress:g}=A,[a,s]=p.useState(!1),[I,r]=p.useState(!1),C=p.useContext(JZA),l=o.length>0&&C.path.length>0&&e.length<=C.path.length&&e.every((E,u)=>E===C.path[u]),c=!n&&(a||I||l),B=p.useMemo(()=>{let E=C.path.findIndex((u,d)=>u!==e[d]);return E!==-1?C.path.slice(0,E):C.path},[C.path,e]);return p.useEffect(()=>{o.length===0&&(a||I)&&B.join(".")!==C.path.join(".")&&C.setPath(B)},[o.length,a,I,C,B]),b.createElement("div",{tabIndex:n?void 0:0,role:"button","aria-haspopup":o.length?"menu":void 0,"aria-disabled":n,className:P_e(c?"bg-accent text-accent-foreground":"text-foreground",n?"text-muted-foreground":"cursor-pointer","transition-colors text-xs"),onClick:E=>{if(n||o.length){E.stopPropagation(),E.preventDefault();return}n||(g==null||g(),C.onDismiss())},onFocus:()=>{n||r(!0),o.length&&!l&&C.setPath(e)},onBlur:()=>{r(!1)},onMouseEnter:()=>{s(!0),o.length&&!l&&!n&&C.setPath(e)},onMouseLeave:()=>{s(!1)},onKeyDown:E=>{n||o.length||(E.key==="Enter"||E.key==="Space")&&(g==null||g(),C.onDismiss())}},b.createElement("div",{"aria-hidden":"true"},t),b.createElement("div",null,b.createElement("span",{className:"truncate self-start"},i)),b.createElement("div",{"aria-hidden":"true",className:"relative"},o.length>0&&b.createElement(b.Fragment,null,b.createElement(pSe,{className:"w-4 h-4","aria-hidden":"true"}),b.createElement("div",{className:"absolute top-0 right-0"},b.createElement(VX,{appear:!0,as:p.Fragment,show:l,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95"},b.createElement("div",{className:"fixed rounded-md -translate-x-1 z-50 min-w-[8rem] max-w-[16rem] bg-popover shadow-lg border focus:outline-none"},b.createElement(NZA,{items:o,path:e})))))))}),NZA=p.memo(function({items:A,path:e,title:t}){return b.createElement("div",{className:"p-1 -mx-px"},t&&b.createElement("header",{className:"px-3 py-1 mb-1.5 text-xs font-medium truncate"},t),t&&b.createElement(loA,{orientation:"horizontal",className:"-mx-1 my-1"}),b.createElement($_e,null,A.map((i,n)=>b.createElement(A4e,{key:n,item:i,path:[...e,n]}))))}),e4e=p.memo(function({onDismiss:A,children:e}){const[t,i]=p.useState([]);return b.createElement(JZA.Provider,{value:{path:t,setPath:i,onDismiss:A}},e)}),t4e=p.memo(function({onDismiss:A,items:e,title:t}){return b.createElement(e4e,{onDismiss:A},b.createElement(NZA,{title:t,items:e,path:[]}))}),YZA=p.createContext(null),i4e=A=>{const{menu:e=[],disabled:t=!1,enableContextMenu:i=!1,title:n,...o}=A,[g,a]=p.useState([0,0]),s=p.useRef(null),I=t||e.length===0,r=p.useContext(RX);return b.createElement(YoA,{as:p.Fragment},({open:C,close:l})=>b.createElement(YZA.Provider,{value:{disabled:t,expanded:C,moveTo(c,B){var E;const u=(E=r.current)==null?void 0:E.getBoundingClientRect(),{x:d,y:f}=u??{x:0,y:0};a([c-d,B-f])},open(){var c;C||(c=s.current)==null||c.click()},close:l,_items:e}},b.createElement(YoA.Button,{ref:s,className:"sr-only","aria-hidden":!0}),b.createElement("div",{onContextMenu:c=>{var B,E;if(I)return;c.preventDefault(),c.stopPropagation();const u=(B=r.current)==null?void 0:B.getBoundingClientRect(),{x:d,y:f}=u??{x:0,y:0};a([c.clientX-d,c.clientY-f]),C||(E=s.current)==null||E.click()},...o},A.children),C&&b.createElement("div",{className:"fixed inset-0 z-50 bg-transparent","aria-hidden":"true"}),!I&&b.createElement(VX,{as:p.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95"},b.createElement(YoA.Items,{className:"fixed rounded-md z-50 mt-0.5 min-w-[8rem] max-w-[16rem] origin-top-left bg-popover text-popover-foreground shadow-lg border focus:outline-none",style:{left:g[0],top:g[1]}},b.createElement(t4e,{title:n,items:e,onDismiss:l})))))},n4e=function(A){const{as:e="button",onPress:t,children:i,...n}=A,o=e,g=p.useContext(YZA),a=p.useRef(null),s=p.useCallback(()=>{if(g!=null&&g.disabled)return;const r=a.current;if(r){const C=r.getBoundingClientRect();g==null||g.moveTo(C.x+C.width,C.y)}if(t)return t(g??void 0);g!=null&&g.expanded?g.close():g==null||g.open()},[g,t]),I=j_e({...n,"aria-expanded":(g==null?void 0:g.expanded)??!1,onPress:s});return g!=null&&g.disabled||!(g!=null&&g._items.length)?b.createElement("div",{"aria-hidden":!0}):b.createElement(o,{...I,ref:a},i)},Xk=Object.assign(i4e,{Button:p.memo(n4e)}),XX=an.div`
    transform: ${A=>!A.isDragging&&"translate(0px, 0px) !important"};
    user-select: none;
    align-items: center;
    overflow: hidden;
    > *:not(span) {
        flex: 0 0 unset;
    }
    > span {
        flex: 1;
        display: inline-block;
        padding-inline: 0.1em;
        /* truncate */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    :has([role="button"]:hover) {
        background-color: unset;
    }
`;function RZA(A,e){for(var t=-1,i=A==null?0:A.length,n=Array(i);++t<i;)n[t]=e(A[t],t,A);return n}var o4e=Array.isArray;const fI=o4e;var g4e=1/0,xZA=Jm?Jm.prototype:void 0,FZA=xZA?xZA.toString:void 0;function MZA(A){if(typeof A=="string")return A;if(fI(A))return RZA(A,MZA)+"";if(bV(A))return FZA?FZA.call(A):"";var e=A+"";return e=="0"&&1/A==-g4e?"-0":e}var vZA=1/0,a4e=17976931348623157e292;function XoA(A){if(!A)return A===0?A:0;if(A=YiA(A),A===vZA||A===-vZA){var e=A<0?-1:1;return e*a4e}return A===A?A:0}function zX(A){return A}var s4e="[object AsyncFunction]",r4e="[object Function]",I4e="[object GeneratorFunction]",C4e="[object Proxy]";function zoA(A){if(!UC(A))return!1;var e=fy(A);return e==r4e||e==I4e||e==s4e||e==C4e}var l4e=rc["__core-js_shared__"];const ToA=l4e;var LZA=function(){var A=/[^.]+$/.exec(ToA&&ToA.keys&&ToA.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}();function c4e(A){return!!LZA&&LZA in A}var B4e=Function.prototype,Q4e=B4e.toString;function Ly(A){if(A!=null){try{return Q4e.call(A)}catch{}try{return A+""}catch{}}return""}var E4e=/[\\^$.*+?()[\]{}|]/g,u4e=/^\[object .+?Constructor\]$/,d4e=Function.prototype,h4e=Object.prototype,m4e=d4e.toString,p4e=h4e.hasOwnProperty,f4e=RegExp("^"+m4e.call(p4e).replace(E4e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function y4e(A){if(!UC(A)||c4e(A))return!1;var e=zoA(A)?f4e:u4e;return e.test(Ly(A))}function b4e(A,e){return A==null?void 0:A[e]}function Sy(A,e){var t=b4e(A,e);return y4e(t)?t:void 0}var w4e=Sy(rc,"WeakMap");const _oA=w4e;var SZA=Object.create,D4e=function(){function A(){}return function(e){if(!UC(e))return{};if(SZA)return SZA(e);A.prototype=e;var t=new A;return A.prototype=void 0,t}}();const G4e=D4e;function k4e(A,e,t){switch(t.length){case 0:return A.call(e);case 1:return A.call(e,t[0]);case 2:return A.call(e,t[0],t[1]);case 3:return A.call(e,t[0],t[1],t[2])}return A.apply(e,t)}function J4e(A,e){var t=-1,i=A.length;for(e||(e=Array(i));++t<i;)e[t]=A[t];return e}var N4e=800,Y4e=16,R4e=Date.now;function x4e(A){var e=0,t=0;return function(){var i=R4e(),n=Y4e-(i-t);if(t=i,n>0){if(++e>=N4e)return arguments[0]}else e=0;return A.apply(void 0,arguments)}}function F4e(A){return function(){return A}}var M4e=function(){try{var A=Sy(Object,"defineProperty");return A({},"",{}),A}catch{}}();const TX=M4e;var v4e=TX?function(A,e){return TX(A,"toString",{configurable:!0,enumerable:!1,value:F4e(e),writable:!0})}:zX,L4e=x4e(v4e);const S4e=L4e;function H4e(A,e){for(var t=-1,i=A==null?0:A.length;++t<i&&e(A[t],t,A)!==!1;);return A}var Z4e=9007199254740991,W4e=/^(?:0|[1-9]\d*)$/;function OoA(A,e){var t=typeof A;return e=e??Z4e,!!e&&(t=="number"||t!="symbol"&&W4e.test(A))&&A>-1&&A%1==0&&A<e}function qoA(A,e,t){e=="__proto__"&&TX?TX(A,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):A[e]=t}function nM(A,e){return A===e||A!==A&&e!==e}var K4e=Object.prototype,U4e=K4e.hasOwnProperty;function V4e(A,e,t){var i=A[e];(!(U4e.call(A,e)&&nM(i,t))||t===void 0&&!(e in A))&&qoA(A,e,t)}function X4e(A,e,t,i){var n=!t;t||(t={});for(var o=-1,g=e.length;++o<g;){var a=e[o],s=i?i(t[a],A[a],a,t,A):void 0;s===void 0&&(s=A[a]),n?qoA(t,a,s):V4e(t,a,s)}return t}var HZA=Math.max;function z4e(A,e,t){return e=HZA(e===void 0?A.length-1:e,0),function(){for(var i=arguments,n=-1,o=HZA(i.length-e,0),g=Array(o);++n<o;)g[n]=i[e+n];n=-1;for(var a=Array(e+1);++n<e;)a[n]=i[n];return a[e]=t(g),k4e(A,this,a)}}function T4e(A,e){return S4e(z4e(A,e,zX),A+"")}var _4e=9007199254740991;function joA(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=_4e}function zk(A){return A!=null&&joA(A.length)&&!zoA(A)}function ZZA(A,e,t){if(!UC(t))return!1;var i=typeof e;return(i=="number"?zk(t)&&OoA(e,t.length):i=="string"&&e in t)?nM(t[e],A):!1}function O4e(A){return T4e(function(e,t){var i=-1,n=t.length,o=n>1?t[n-1]:void 0,g=n>2?t[2]:void 0;for(o=A.length>3&&typeof o=="function"?(n--,o):void 0,g&&ZZA(t[0],t[1],g)&&(o=n<3?void 0:o,n=1),e=Object(e);++i<n;){var a=t[i];a&&A(e,a,i,o)}return e})}var q4e=Object.prototype;function PoA(A){var e=A&&A.constructor,t=typeof e=="function"&&e.prototype||q4e;return A===t}function j4e(A,e){for(var t=-1,i=Array(A);++t<A;)i[t]=e(t);return i}var P4e="[object Arguments]";function WZA(A){return Nm(A)&&fy(A)==P4e}var KZA=Object.prototype,$4e=KZA.hasOwnProperty,AOe=KZA.propertyIsEnumerable,eOe=WZA(function(){return arguments}())?WZA:function(A){return Nm(A)&&$4e.call(A,"callee")&&!AOe.call(A,"callee")};const _X=eOe;function tOe(){return!1}var UZA=typeof exports=="object"&&exports&&!exports.nodeType&&exports,VZA=UZA&&typeof module=="object"&&module&&!module.nodeType&&module,iOe=VZA&&VZA.exports===UZA,XZA=iOe?rc.Buffer:void 0,nOe=XZA?XZA.isBuffer:void 0,oOe=nOe||tOe;const OX=oOe;var gOe="[object Arguments]",aOe="[object Array]",sOe="[object Boolean]",rOe="[object Date]",IOe="[object Error]",COe="[object Function]",lOe="[object Map]",cOe="[object Number]",BOe="[object Object]",QOe="[object RegExp]",EOe="[object Set]",uOe="[object String]",dOe="[object WeakMap]",hOe="[object ArrayBuffer]",mOe="[object DataView]",pOe="[object Float32Array]",fOe="[object Float64Array]",yOe="[object Int8Array]",bOe="[object Int16Array]",wOe="[object Int32Array]",DOe="[object Uint8Array]",GOe="[object Uint8ClampedArray]",kOe="[object Uint16Array]",JOe="[object Uint32Array]",yn={};yn[pOe]=yn[fOe]=yn[yOe]=yn[bOe]=yn[wOe]=yn[DOe]=yn[GOe]=yn[kOe]=yn[JOe]=!0,yn[gOe]=yn[aOe]=yn[hOe]=yn[sOe]=yn[mOe]=yn[rOe]=yn[IOe]=yn[COe]=yn[lOe]=yn[cOe]=yn[BOe]=yn[QOe]=yn[EOe]=yn[uOe]=yn[dOe]=!1;function NOe(A){return Nm(A)&&joA(A.length)&&!!yn[fy(A)]}function YOe(A){return function(e){return A(e)}}var zZA=typeof exports=="object"&&exports&&!exports.nodeType&&exports,oM=zZA&&typeof module=="object"&&module&&!module.nodeType&&module,ROe=oM&&oM.exports===zZA,$oA=ROe&&ZFA.process,xOe=function(){try{var A=oM&&oM.require&&oM.require("util").types;return A||$oA&&$oA.binding&&$oA.binding("util")}catch{}}();const TZA=xOe;var _ZA=TZA&&TZA.isTypedArray,FOe=_ZA?YOe(_ZA):NOe;const AgA=FOe;var MOe=Object.prototype,vOe=MOe.hasOwnProperty;function OZA(A,e){var t=fI(A),i=!t&&_X(A),n=!t&&!i&&OX(A),o=!t&&!i&&!n&&AgA(A),g=t||i||n||o,a=g?j4e(A.length,String):[],s=a.length;for(var I in A)(e||vOe.call(A,I))&&!(g&&(I=="length"||n&&(I=="offset"||I=="parent")||o&&(I=="buffer"||I=="byteLength"||I=="byteOffset")||OoA(I,s)))&&a.push(I);return a}function qZA(A,e){return function(t){return A(e(t))}}var LOe=qZA(Object.keys,Object);const SOe=LOe;var HOe=Object.prototype,ZOe=HOe.hasOwnProperty;function WOe(A){if(!PoA(A))return SOe(A);var e=[];for(var t in Object(A))ZOe.call(A,t)&&t!="constructor"&&e.push(t);return e}function egA(A){return zk(A)?OZA(A):WOe(A)}function KOe(A){var e=[];if(A!=null)for(var t in Object(A))e.push(t);return e}var UOe=Object.prototype,VOe=UOe.hasOwnProperty;function XOe(A){if(!UC(A))return KOe(A);var e=PoA(A),t=[];for(var i in A)i=="constructor"&&(e||!VOe.call(A,i))||t.push(i);return t}function jZA(A){return zk(A)?OZA(A,!0):XOe(A)}var zOe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TOe=/^\w*$/;function tgA(A,e){if(fI(A))return!1;var t=typeof A;return t=="number"||t=="symbol"||t=="boolean"||A==null||bV(A)?!0:TOe.test(A)||!zOe.test(A)||e!=null&&A in Object(e)}var _Oe=Sy(Object,"create");const gM=_Oe;function OOe(){this.__data__=gM?gM(null):{},this.size=0}function qOe(A){var e=this.has(A)&&delete this.__data__[A];return this.size-=e?1:0,e}var jOe="__lodash_hash_undefined__",POe=Object.prototype,$Oe=POe.hasOwnProperty;function Aqe(A){var e=this.__data__;if(gM){var t=e[A];return t===jOe?void 0:t}return $Oe.call(e,A)?e[A]:void 0}var eqe=Object.prototype,tqe=eqe.hasOwnProperty;function iqe(A){var e=this.__data__;return gM?e[A]!==void 0:tqe.call(e,A)}var nqe="__lodash_hash_undefined__";function oqe(A,e){var t=this.__data__;return this.size+=this.has(A)?0:1,t[A]=gM&&e===void 0?nqe:e,this}function Hy(A){var e=-1,t=A==null?0:A.length;for(this.clear();++e<t;){var i=A[e];this.set(i[0],i[1])}}Hy.prototype.clear=OOe,Hy.prototype.delete=qOe,Hy.prototype.get=Aqe,Hy.prototype.has=iqe,Hy.prototype.set=oqe;function gqe(){this.__data__=[],this.size=0}function qX(A,e){for(var t=A.length;t--;)if(nM(A[t][0],e))return t;return-1}var aqe=Array.prototype,sqe=aqe.splice;function rqe(A){var e=this.__data__,t=qX(e,A);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():sqe.call(e,t,1),--this.size,!0}function Iqe(A){var e=this.__data__,t=qX(e,A);return t<0?void 0:e[t][1]}function Cqe(A){return qX(this.__data__,A)>-1}function lqe(A,e){var t=this.__data__,i=qX(t,A);return i<0?(++this.size,t.push([A,e])):t[i][1]=e,this}function ju(A){var e=-1,t=A==null?0:A.length;for(this.clear();++e<t;){var i=A[e];this.set(i[0],i[1])}}ju.prototype.clear=gqe,ju.prototype.delete=rqe,ju.prototype.get=Iqe,ju.prototype.has=Cqe,ju.prototype.set=lqe;var cqe=Sy(rc,"Map");const aM=cqe;function Bqe(){this.size=0,this.__data__={hash:new Hy,map:new(aM||ju),string:new Hy}}function Qqe(A){var e=typeof A;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?A!=="__proto__":A===null}function jX(A,e){var t=A.__data__;return Qqe(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Eqe(A){var e=jX(this,A).delete(A);return this.size-=e?1:0,e}function uqe(A){return jX(this,A).get(A)}function dqe(A){return jX(this,A).has(A)}function hqe(A,e){var t=jX(this,A),i=t.size;return t.set(A,e),this.size+=t.size==i?0:1,this}function Pu(A){var e=-1,t=A==null?0:A.length;for(this.clear();++e<t;){var i=A[e];this.set(i[0],i[1])}}Pu.prototype.clear=Bqe,Pu.prototype.delete=Eqe,Pu.prototype.get=uqe,Pu.prototype.has=dqe,Pu.prototype.set=hqe;var mqe="Expected a function";function igA(A,e){if(typeof A!="function"||e!=null&&typeof e!="function")throw new TypeError(mqe);var t=function(){var i=arguments,n=e?e.apply(this,i):i[0],o=t.cache;if(o.has(n))return o.get(n);var g=A.apply(this,i);return t.cache=o.set(n,g)||o,g};return t.cache=new(igA.Cache||Pu),t}igA.Cache=Pu;var pqe=500;function fqe(A){var e=igA(A,function(i){return t.size===pqe&&t.clear(),i}),t=e.cache;return e}var yqe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bqe=/\\(\\)?/g,wqe=fqe(function(A){var e=[];return A.charCodeAt(0)===46&&e.push(""),A.replace(yqe,function(t,i,n,o){e.push(n?o.replace(bqe,"$1"):i||t)}),e});const Dqe=wqe;function Gqe(A){return A==null?"":MZA(A)}function PZA(A,e){return fI(A)?A:tgA(A,e)?[A]:Dqe(Gqe(A))}var kqe=1/0;function PX(A){if(typeof A=="string"||bV(A))return A;var e=A+"";return e=="0"&&1/A==-kqe?"-0":e}function $ZA(A,e){e=PZA(e,A);for(var t=0,i=e.length;A!=null&&t<i;)A=A[PX(e[t++])];return t&&t==i?A:void 0}function Jqe(A,e,t){var i=A==null?void 0:$ZA(A,e);return i===void 0?t:i}function Nqe(A,e){for(var t=-1,i=e.length,n=A.length;++t<i;)A[n+t]=e[t];return A}var Yqe=qZA(Object.getPrototypeOf,Object);const AWA=Yqe;var Rqe="[object Object]",xqe=Function.prototype,Fqe=Object.prototype,eWA=xqe.toString,Mqe=Fqe.hasOwnProperty,vqe=eWA.call(Object);function Lqe(A){if(!Nm(A)||fy(A)!=Rqe)return!1;var e=AWA(A);if(e===null)return!0;var t=Mqe.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&eWA.call(t)==vqe}function Sqe(){this.__data__=new ju,this.size=0}function Hqe(A){var e=this.__data__,t=e.delete(A);return this.size=e.size,t}function Zqe(A){return this.__data__.get(A)}function Wqe(A){return this.__data__.has(A)}var Kqe=200;function Uqe(A,e){var t=this.__data__;if(t instanceof ju){var i=t.__data__;if(!aM||i.length<Kqe-1)return i.push([A,e]),this.size=++t.size,this;t=this.__data__=new Pu(i)}return t.set(A,e),this.size=t.size,this}function lQ(A){var e=this.__data__=new ju(A);this.size=e.size}lQ.prototype.clear=Sqe,lQ.prototype.delete=Hqe,lQ.prototype.get=Zqe,lQ.prototype.has=Wqe,lQ.prototype.set=Uqe;var tWA=typeof exports=="object"&&exports&&!exports.nodeType&&exports,iWA=tWA&&typeof module=="object"&&module&&!module.nodeType&&module,Vqe=iWA&&iWA.exports===tWA,nWA=Vqe?rc.Buffer:void 0,oWA=nWA?nWA.allocUnsafe:void 0;function Xqe(A,e){if(e)return A.slice();var t=A.length,i=oWA?oWA(t):new A.constructor(t);return A.copy(i),i}function zqe(A,e){for(var t=-1,i=A==null?0:A.length,n=0,o=[];++t<i;){var g=A[t];e(g,t,A)&&(o[n++]=g)}return o}function Tqe(){return[]}var _qe=Object.prototype,Oqe=_qe.propertyIsEnumerable,gWA=Object.getOwnPropertySymbols,qqe=gWA?function(A){return A==null?[]:(A=Object(A),zqe(gWA(A),function(e){return Oqe.call(A,e)}))}:Tqe;const jqe=qqe;function Pqe(A,e,t){var i=e(A);return fI(A)?i:Nqe(i,t(A))}function aWA(A){return Pqe(A,egA,jqe)}var $qe=Sy(rc,"DataView");const ngA=$qe;var Aje=Sy(rc,"Promise");const ogA=Aje;var eje=Sy(rc,"Set");const ggA=eje;var sWA="[object Map]",tje="[object Object]",rWA="[object Promise]",IWA="[object Set]",CWA="[object WeakMap]",lWA="[object DataView]",ije=Ly(ngA),nje=Ly(aM),oje=Ly(ogA),gje=Ly(ggA),aje=Ly(_oA),Zy=fy;(ngA&&Zy(new ngA(new ArrayBuffer(1)))!=lWA||aM&&Zy(new aM)!=sWA||ogA&&Zy(ogA.resolve())!=rWA||ggA&&Zy(new ggA)!=IWA||_oA&&Zy(new _oA)!=CWA)&&(Zy=function(A){var e=fy(A),t=e==tje?A.constructor:void 0,i=t?Ly(t):"";if(i)switch(i){case ije:return lWA;case nje:return sWA;case oje:return rWA;case gje:return IWA;case aje:return CWA}return e});const cWA=Zy;var sje=rc.Uint8Array;const $X=sje;function rje(A){var e=new A.constructor(A.byteLength);return new $X(e).set(new $X(A)),e}function Ije(A,e){var t=e?rje(A.buffer):A.buffer;return new A.constructor(t,A.byteOffset,A.length)}function Cje(A){return typeof A.constructor=="function"&&!PoA(A)?G4e(AWA(A)):{}}var lje="__lodash_hash_undefined__";function cje(A){return this.__data__.set(A,lje),this}function Bje(A){return this.__data__.has(A)}function A9(A){var e=-1,t=A==null?0:A.length;for(this.__data__=new Pu;++e<t;)this.add(A[e])}A9.prototype.add=A9.prototype.push=cje,A9.prototype.has=Bje;function Qje(A,e){for(var t=-1,i=A==null?0:A.length;++t<i;)if(e(A[t],t,A))return!0;return!1}function Eje(A,e){return A.has(e)}var uje=1,dje=2;function BWA(A,e,t,i,n,o){var g=t&uje,a=A.length,s=e.length;if(a!=s&&!(g&&s>a))return!1;var I=o.get(A),r=o.get(e);if(I&&r)return I==e&&r==A;var C=-1,l=!0,c=t&dje?new A9:void 0;for(o.set(A,e),o.set(e,A);++C<a;){var B=A[C],E=e[C];if(i)var u=g?i(E,B,C,e,A,o):i(B,E,C,A,e,o);if(u!==void 0){if(u)continue;l=!1;break}if(c){if(!Qje(e,function(d,f){if(!Eje(c,f)&&(B===d||n(B,d,t,i,o)))return c.push(f)})){l=!1;break}}else if(!(B===E||n(B,E,t,i,o))){l=!1;break}}return o.delete(A),o.delete(e),l}function hje(A){var e=-1,t=Array(A.size);return A.forEach(function(i,n){t[++e]=[n,i]}),t}function mje(A){var e=-1,t=Array(A.size);return A.forEach(function(i){t[++e]=i}),t}var pje=1,fje=2,yje="[object Boolean]",bje="[object Date]",wje="[object Error]",Dje="[object Map]",Gje="[object Number]",kje="[object RegExp]",Jje="[object Set]",Nje="[object String]",Yje="[object Symbol]",Rje="[object ArrayBuffer]",xje="[object DataView]",QWA=Jm?Jm.prototype:void 0,agA=QWA?QWA.valueOf:void 0;function Fje(A,e,t,i,n,o,g){switch(t){case xje:if(A.byteLength!=e.byteLength||A.byteOffset!=e.byteOffset)return!1;A=A.buffer,e=e.buffer;case Rje:return!(A.byteLength!=e.byteLength||!o(new $X(A),new $X(e)));case yje:case bje:case Gje:return nM(+A,+e);case wje:return A.name==e.name&&A.message==e.message;case kje:case Nje:return A==e+"";case Dje:var a=hje;case Jje:var s=i&pje;if(a||(a=mje),A.size!=e.size&&!s)return!1;var I=g.get(A);if(I)return I==e;i|=fje,g.set(A,e);var r=BWA(a(A),a(e),i,n,o,g);return g.delete(A),r;case Yje:if(agA)return agA.call(A)==agA.call(e)}return!1}var Mje=1,vje=Object.prototype,Lje=vje.hasOwnProperty;function Sje(A,e,t,i,n,o){var g=t&Mje,a=aWA(A),s=a.length,I=aWA(e),r=I.length;if(s!=r&&!g)return!1;for(var C=s;C--;){var l=a[C];if(!(g?l in e:Lje.call(e,l)))return!1}var c=o.get(A),B=o.get(e);if(c&&B)return c==e&&B==A;var E=!0;o.set(A,e),o.set(e,A);for(var u=g;++C<s;){l=a[C];var d=A[l],f=e[l];if(i)var w=g?i(f,d,l,e,A,o):i(d,f,l,A,e,o);if(!(w===void 0?d===f||n(d,f,t,i,o):w)){E=!1;break}u||(u=l=="constructor")}if(E&&!u){var y=A.constructor,G=e.constructor;y!=G&&"constructor"in A&&"constructor"in e&&!(typeof y=="function"&&y instanceof y&&typeof G=="function"&&G instanceof G)&&(E=!1)}return o.delete(A),o.delete(e),E}var Hje=1,EWA="[object Arguments]",uWA="[object Array]",e9="[object Object]",Zje=Object.prototype,dWA=Zje.hasOwnProperty;function Wje(A,e,t,i,n,o){var g=fI(A),a=fI(e),s=g?uWA:cWA(A),I=a?uWA:cWA(e);s=s==EWA?e9:s,I=I==EWA?e9:I;var r=s==e9,C=I==e9,l=s==I;if(l&&OX(A)){if(!OX(e))return!1;g=!0,r=!1}if(l&&!r)return o||(o=new lQ),g||AgA(A)?BWA(A,e,t,i,n,o):Fje(A,e,s,t,i,n,o);if(!(t&Hje)){var c=r&&dWA.call(A,"__wrapped__"),B=C&&dWA.call(e,"__wrapped__");if(c||B){var E=c?A.value():A,u=B?e.value():e;return o||(o=new lQ),n(E,u,t,i,o)}}return l?(o||(o=new lQ),Sje(A,e,t,i,n,o)):!1}function sgA(A,e,t,i,n){return A===e?!0:A==null||e==null||!Nm(A)&&!Nm(e)?A!==A&&e!==e:Wje(A,e,t,i,sgA,n)}var Kje=1,Uje=2;function Vje(A,e,t,i){var n=t.length,o=n,g=!i;if(A==null)return!o;for(A=Object(A);n--;){var a=t[n];if(g&&a[2]?a[1]!==A[a[0]]:!(a[0]in A))return!1}for(;++n<o;){a=t[n];var s=a[0],I=A[s],r=a[1];if(g&&a[2]){if(I===void 0&&!(s in A))return!1}else{var C=new lQ;if(i)var l=i(I,r,s,A,e,C);if(!(l===void 0?sgA(r,I,Kje|Uje,i,C):l))return!1}}return!0}function hWA(A){return A===A&&!UC(A)}function Xje(A){for(var e=egA(A),t=e.length;t--;){var i=e[t],n=A[i];e[t]=[i,n,hWA(n)]}return e}function mWA(A,e){return function(t){return t==null?!1:t[A]===e&&(e!==void 0||A in Object(t))}}function zje(A){var e=Xje(A);return e.length==1&&e[0][2]?mWA(e[0][0],e[0][1]):function(t){return t===A||Vje(t,A,e)}}function Tje(A,e){return A!=null&&e in Object(A)}function _je(A,e,t){e=PZA(e,A);for(var i=-1,n=e.length,o=!1;++i<n;){var g=PX(e[i]);if(!(o=A!=null&&t(A,g)))break;A=A[g]}return o||++i!=n?o:(n=A==null?0:A.length,!!n&&joA(n)&&OoA(g,n)&&(fI(A)||_X(A)))}function Oje(A,e){return A!=null&&_je(A,e,Tje)}var qje=1,jje=2;function Pje(A,e){return tgA(A)&&hWA(e)?mWA(PX(A),e):function(t){var i=Jqe(t,A);return i===void 0&&i===e?Oje(t,A):sgA(e,i,qje|jje)}}function $je(A){return function(e){return e==null?void 0:e[A]}}function A6e(A){return function(e){return $ZA(e,A)}}function e6e(A){return tgA(A)?$je(PX(A)):A6e(A)}function t6e(A){return typeof A=="function"?A:A==null?zX:typeof A=="object"?fI(A)?Pje(A[0],A[1]):zje(A):e6e(A)}function i6e(A){return function(e,t,i){for(var n=-1,o=Object(e),g=i(e),a=g.length;a--;){var s=g[A?a:++n];if(t(o[s],s,o)===!1)break}return e}}var n6e=i6e();const pWA=n6e;function o6e(A,e){return A&&pWA(A,e,egA)}function g6e(A,e){return function(t,i){if(t==null)return t;if(!zk(t))return A(t,i);for(var n=t.length,o=e?n:-1,g=Object(t);(e?o--:++o<n)&&i(g[o],o,g)!==!1;);return t}}var a6e=g6e(o6e);const fWA=a6e;function rgA(A,e,t){(t!==void 0&&!nM(A[e],t)||t===void 0&&!(e in A))&&qoA(A,e,t)}function s6e(A){return Nm(A)&&zk(A)}function IgA(A,e){if(!(e==="constructor"&&typeof A[e]=="function")&&e!="__proto__")return A[e]}function r6e(A){return X4e(A,jZA(A))}function I6e(A,e,t,i,n,o,g){var a=IgA(A,t),s=IgA(e,t),I=g.get(s);if(I){rgA(A,t,I);return}var r=o?o(a,s,t+"",A,e,g):void 0,C=r===void 0;if(C){var l=fI(s),c=!l&&OX(s),B=!l&&!c&&AgA(s);r=s,l||c||B?fI(a)?r=a:s6e(a)?r=J4e(a):c?(C=!1,r=Xqe(s,!0)):B?(C=!1,r=Ije(s,!0)):r=[]:Lqe(s)||_X(s)?(r=a,_X(a)?r=r6e(a):(!UC(a)||zoA(a))&&(r=Cje(s))):C=!1}C&&(g.set(s,r),n(r,s,i,o,g),g.delete(s)),rgA(A,t,r)}function yWA(A,e,t,i,n){A!==e&&pWA(e,function(o,g){if(n||(n=new lQ),UC(o))I6e(A,e,g,t,yWA,i,n);else{var a=i?i(IgA(A,g),o,g+"",A,e,n):void 0;a===void 0&&(a=o),rgA(A,g,a)}},jZA)}function C6e(A){return typeof A=="function"?A:zX}function l6e(A,e){var t=fI(A)?H4e:fWA;return t(A,C6e(e))}function c6e(A,e){var t=-1,i=zk(A)?Array(A.length):[];return fWA(A,function(n,o,g){i[++t]=e(n,o,g)}),i}function Wy(A,e){var t=fI(A)?RZA:c6e;return t(A,t6e(e))}function bWA(A){return A===void 0}var B6e=O4e(function(A,e,t){yWA(A,e,t)});const ir=B6e;var Q6e=Math.ceil,E6e=Math.max;function u6e(A,e,t,i){for(var n=-1,o=E6e(Q6e((e-A)/(t||1)),0),g=Array(o);o--;)g[i?o:++n]=A,A+=t;return g}function d6e(A){return function(e,t,i){return i&&typeof i!="number"&&ZZA(e,t,i)&&(t=i=void 0),e=XoA(e),t===void 0?(t=e,e=0):t=XoA(t),i=i===void 0?e<t?1:-1:XoA(i),u6e(e,t,i,A)}}var h6e=d6e();const m6e=h6e;var p6e="Expected a function";function f6e(A,e,t){var i=!0,n=!0;if(typeof A!="function")throw new TypeError(p6e);return UC(t)&&(i="leading"in t?!!t.leading:i,n="trailing"in t?!!t.trailing:n),Ik(A,e,{leading:i,maxWait:e,trailing:n})}const y6e=async(A,e,t=0,i)=>await A({workflow:[...i!=null&&i.filters&&i.filters.length>0?[{type:"filter",filters:i.filters}]:[],{type:"view",query:[{op:"raw",fields:["*"]}]},...i!=null&&i.sorting?[{type:"sort",by:[i.sorting.fid],sort:i.sorting.sort}]:[]],limit:e,offset:t*e}),t9=async(A,e,t)=>{const i=e.find(n=>n.type==="view");return i&&i.query.length===1&&i.query[0].op==="raw"&&i.query[0].fields.length===0?[]:await A({workflow:e,limit:t})},sM=async(A,e,t,i)=>{var n;const{values:o=!0,range:g=!0,valuesMeta:a=!0,sortBy:s="none",timezoneDisplayOffset:I,keyword:r}=t,C=`count_${e.fid}`,l=`total_distinct_${e.fid}`,c=`min_${e.fid}`,B=`max_${e.fid}`,E=xi(r)?Q3e(r):void 0,u=E?[{type:"filter",filters:[{fid:e.fid,rule:{type:"regexp",value:E.source,caseSensitive:!E.ignoreCase}}]}]:[],d=e.computed?[{type:"transform",transform:[{expression:wF(e.expression,i,{timezoneDisplayOffset:I}),key:e.fid}]}]:[],f={workflow:[...d,...u,{type:"view",query:[{op:"aggregate",groupBy:[e.fid],measures:[{field:"*",agg:"count",asFieldKey:C}]}]},{type:"view",query:[{op:"aggregate",groupBy:[],measures:[{field:"*",agg:"count",asFieldKey:l},{field:C,agg:"sum",asFieldKey:"count"}]}]}]},w={workflow:[...d,...u,{type:"view",query:[{op:"aggregate",groupBy:[e.fid],measures:[{field:"*",agg:"count",asFieldKey:C}]}]},...s==="none"?[]:[{type:"sort",by:[s.startsWith("value")?e.fid:C],sort:s.endsWith("dsc")?"descending":"ascending"}]],limit:t.valuesLimit,offset:t.valuesOffset},[y={[l]:0,count:0}]=a?await A(f):[{[l]:0,count:0}],G=o?await A(w):[],R={workflow:[...d,...u,{type:"view",query:[{op:"aggregate",groupBy:[],measures:[{field:e.fid,agg:"min",asFieldKey:c},{field:e.fid,agg:"max",asFieldKey:B}]}]}]},[x={[c]:0,[B]:0}]=g?await A(R):[{[c]:0,[B]:0}],F=(n=t.selectedCount)!=null&&n.length?{workflow:[...d,...u,{type:"filter",filters:[{fid:e.fid,rule:{type:"one of",value:t.selectedCount}}]},{type:"view",query:[{op:"aggregate",groupBy:[],measures:[{field:"*",agg:"count",asFieldKey:"count"}]}]}]}:null,[Q={count:0}]=F?await A(F):[];return{values:G.map(k=>({value:k[e.fid],count:k[C]})),valuesMeta:{total:y.count,distinctTotal:y[l]},range:[x[c],x[B]],selectedCount:Q.count}};function wWA(A,e,t,i){return n=>{const o=A.computed?[{type:"transform",transform:[{expression:wF(A.expression,e,i),key:A.fid}]}]:[];return n(g=>{const a={...g,workflow:[...o,...g.workflow]};return t(a)})}}async function CgA(A,e){var t;const i=await A({workflow:[{type:"view",query:[{op:"raw",fields:[e]}]}],limit:1,offset:0});return(t=i==null?void 0:i[0])==null?void 0:t[e]}async function DWA(A,e,t){const i=await CgA(A,e),n=DF(i),o=t??new Date().getTimezoneOffset(),g=mF(o),a=`min_${e}`,s=`max_${e}`,I={workflow:[{type:"view",query:[{op:"aggregate",groupBy:[],measures:[{field:e,agg:"min",asFieldKey:a,format:n,offset:o},{field:e,agg:"max",asFieldKey:s,format:n,offset:o}]}]}]},[r={[a]:0,[s]:0}]=await A(I);return[g(r[a]).getTime(),g(r[s]).getTime(),n]}async function b6e(A,e){const t=`count_${e}`,i=`total_distinct_${e}`,n=[{type:"view",query:[{op:"aggregate",groupBy:[e],measures:[{field:"*",agg:"count",asFieldKey:t}]}]},{type:"view",query:[{op:"aggregate",groupBy:[],measures:[{field:"*",agg:"count",asFieldKey:i},{field:t,agg:"sum",asFieldKey:"count"}]}]}],[o={[i]:0,count:0}]=await A({workflow:n});return{total:o.count,distinctTotal:o[i]}}async function w6e(A,e,t={}){const{sortBy:i="none",valuesLimit:n,valuesOffset:o}=t,g=`count_${e}`,a={workflow:[{type:"view",query:[{op:"aggregate",groupBy:[e],measures:[{field:"*",agg:"count",asFieldKey:g}]}]},...i==="none"?[]:[{type:"sort",by:[i.startsWith("value")?e:g],sort:i.endsWith("dsc")?"descending":"ascending"}]],limit:n,offset:o};return(await A(a)).map(s=>({value:s[e],count:s[g]}))}async function D6e(A,e){const t=b6e(A,e),i=w6e(A,e,{sortBy:"count_dsc",valuesLimit:2});return Promise.all([t,i])}async function G6e(A,e){const t=`bin_${e}`,i=`${no}_sum`,n=10,o=(await A({workflow:[{type:"transform",transform:[{key:t,expression:{op:"bin",as:t,params:[{type:"field",value:e}],num:n}},{key:no,expression:{op:"one",params:[],as:no}}]},{type:"view",query:[{op:"aggregate",groupBy:[t],measures:[{field:no,agg:"sum",asFieldKey:i}]}]}]})).sort((r,C)=>r[t][0]-C[t][0]);if(o.length===0)return{max:0,min:0,binValues:[]};const g=o[0][t][0],a=o[o.length-1][t][1],s=(a-g)/n,I=m6e(0,n).map(r=>r*s+g).map(r=>{const C=E3e(o,r,c=>c[t][0]),l=C[t][0];if(Math.abs(l-r)*2<s){const c=C[i];return{from:r,to:r+s,count:c}}else return{from:r,to:r+s,count:0}});return{min:g,max:a,binValues:I}}function GWA(A,e){return t=>A({...t,tag:e})}const k6e=A=>A.filter(Boolean),kWA=A=>{const e=xt(),t=e.currentVis.encodings[A],{t:i}=ve("translation",{keyPrefix:"field_menu"}),n=Og();return p.useMemo(()=>t.map((o,g)=>{var a,s;const I=((a=o.expression)==null?void 0:a.op)==="dateTimeDrill",r=[no,fi,yi,In].includes(o.fid);return k6e([A==="dimensions"&&{label:i("to_mea"),disabled:r,onPress(){e.moveField("dimensions",g,"measures",e.viewMeasures.length)}},A==="measures"&&{label:i("to_dim"),disabled:r,onPress(){e.moveField("measures",g,"dimensions",e.viewDimensions.length)}},{label:i("new_calc"),disabled:o.semanticType==="nominal"||o.semanticType==="ordinal"||r,children:[{label:i("bin"),onPress(){e.createBinField(A,g,"bin")}},{label:i("binCount"),disabled:o.semanticType==="nominal"||o.semanticType==="ordinal",onPress(){e.createBinField(A,g,"binCount")}},{label:i("log",{base:10}),disabled:o.semanticType==="nominal"||o.semanticType==="ordinal",onPress(){e.createLogField(A,g,"log",10)}},{label:i("log",{base:2}),disabled:o.semanticType==="nominal"||o.semanticType==="ordinal",onPress(){e.createLogField(A,g,"log",2)}},{label:i("binCustom"),disabled:o.semanticType==="nominal"||o.semanticType==="ordinal",onPress(){e.setShowBinSettingPanel(!0),e.setCreateField({channel:A,index:g})}},{label:i("logCustom"),disabled:o.semanticType==="nominal"||o.semanticType==="ordinal",onPress(){e.setShowLogSettingPanel(!0),e.setCreateField({channel:A,index:g})}}]},{label:i("semantic_type.name"),disabled:r,children:["nominal","ordinal","quantitative","temporal"].map(C=>({label:i(`semantic_type.types.${C}`),disabled:o.semanticType===C,onPress(){const l=o.analyticType==="dimension"?"dimensions":"measures";e.changeSemanticType(l,g,C)}}))},(o.semanticType==="temporal"||I)&&{label:i("drill.name"),disabled:r,children:YWe.map(C=>{var l,c;return{label:i(`drill.levels.${C}`),disabled:I&&((c=(l=o.expression)==null?void 0:l.params.find(B=>B.type==="value"))==null?void 0:c.value)===C,onPress(){const B=(I?e.allFields.find(d=>{var f,w;return d.fid===((w=(f=o.expression)==null?void 0:f.params.find(y=>y.type==="field"))==null?void 0:w.value)}):null)??o,E=B.analyticType==="dimension"?"dimensions":"measures",u=e.allFields.findIndex(d=>d.fid===B.fid);CgA(n,B.fid).then(DF).then(d=>e.createDateTimeDrilledField(E,u,C,`${i(`drill.levels.${C}`)} (${B.name||B.fid})`,d,o.offset))}}})},(o.semanticType==="temporal"||I)&&{label:i("drill.feature_name"),disabled:r,children:RWe.map(C=>{var l,c;return{label:i(`drill.levels.${C}`),disabled:I&&((c=(l=o.expression)==null?void 0:l.params.find(B=>B.type==="value"))==null?void 0:c.value)===C,onPress(){const B=(I?e.allFields.find(d=>{var f,w;return d.fid===((w=(f=o.expression)==null?void 0:f.params.find(y=>y.type==="field"))==null?void 0:w.value)}):null)??o,E=B.analyticType==="dimension"?"dimensions":"measures",u=e.allFields.findIndex(d=>d.fid===B.fid);CgA(n,B.fid).then(DF).then(d=>e.createDateFeatureField(E,u,C,`${i(`drill.levels.${C}`)} [${B.name||B.fid}]`,d,o.offset))}}})},{label:"Rename Field",onPress(){e.setShowRenamePanel(!0),e.setCreateField({channel:A,index:g})}},o.computed&&!r&&((s=o.expression)==null?void 0:s.op)==="expr"&&{label:"Edit Computed Field",onPress(){e.setComputedFieldFid(o.fid)}},o.computed&&!r&&{label:"Remove Field",onPress(){const C=o.analyticType==="dimension"?"dimensions":"measures";e.removeComputedField(C,g)}}])}),[A,t,e,i,n])},J6e=A=>{const e=xt(),{dimensions:t}=e,i=kWA("dimensions");return b.createElement("div",{className:"relative touch-none"},t.map((n,o)=>b.createElement(OG,{key:EI(n),draggableId:`dimension_${EI(n)}`,index:o},(g,a)=>b.createElement(Xk,{title:n.name||n.fid,menu:i[o],enableContextMenu:!1,disabled:a.isDragging},b.createElement(XX,{className:`touch-none flex pt-0.5 pb-0.5 pl-2 pr-2 mx-0 m-1 text-xs hover:bg-dimension/20 transition-colors rounded-md truncate border border-transparent ${a.isDragging?"bg-dimension/20":""}`,ref:TC(g.innerRef),isDragging:a.isDragging,...g.draggableProps,...g.dragHandleProps},b.createElement(Vk,{dataType:n.semanticType,analyticType:n.analyticType}),b.createElement("span",{className:"ml-0.5",title:n.name},n.name),b.createElement(Xk.Button,{as:"div"},b.createElement(rF,{className:"w-4 h-4"}))),b.createElement(XX,{className:`pt-0.5 pb-0.5 pl-2 pr-2 mx-0 m-1 text-xs hover:bg-dimension/20 rounded-full border border-dimension truncate ${a.isDragging?"bg-dimension/20 flex":"hidden"}`,isDragging:a.isDragging},b.createElement(Vk,{dataType:n.semanticType,analyticType:n.analyticType}),b.createElement("span",{className:"ml-0.5",title:n.name},n.name),b.createElement(Xk.Button,{as:"div"},b.createElement(rF,{className:"w-4 h-4"})))))))},N6e=ze(J6e),Y6e=A=>{const e=xt(),{measures:t}=e,i=kWA("measures");return b.createElement("div",{className:"relative touch-none"},t.map((n,o)=>b.createElement(OG,{key:EI(n),draggableId:`measure_${EI(n)}`,index:o},(g,a)=>b.createElement("div",{className:"block"},b.createElement(Xk,{title:n.name||n.fid,menu:i[o],enableContextMenu:!0,disabled:a.isDragging||n.fid===fi},b.createElement(XX,{className:`touch-none flex pt-0.5 pb-0.5 pl-2 pr-2 mx-0 m-1 text-xs hover:bg-measure/20 rounded-md truncate border border-transparent ${a.isDragging?"bg-measure/20":""}`,isDragging:a.isDragging,ref:TC(g.innerRef),...g.draggableProps,...g.dragHandleProps},b.createElement(Vk,{dataType:n.semanticType,analyticType:n.analyticType}),b.createElement("span",{className:"ml-0.5",title:n.name},n.name),b.createElement(Xk.Button,{as:"div"},b.createElement(rF,{className:"w-4 h-4"}))),b.createElement(XX,{className:`pt-0.5 pb-0.5 pl-2 pr-2 mx-0 m-1 text-xs hover:bg-measure/20 rounded-md border-measure border truncate ${a.isDragging?"bg-measure/20 flex":"hidden"}`,isDragging:a.isDragging},b.createElement(Vk,{dataType:n.semanticType,analyticType:n.analyticType}),b.createElement("span",{className:"ml-0.5",title:n.name},n.name),b.createElement(Xk.Button,{as:"div"},b.createElement(rF,{className:"w-4 h-4"}))))))))},R6e=ze(Y6e),x6e=A=>{const{t:e}=ve("translation",{keyPrefix:"main.tabpanel.DatasetFields"});return b.createElement("div",{className:"p-1 sm:mr-0.5 my-0.5 border flex sm:flex-col sm:h-full",style:{paddingBlock:0,paddingInline:"0.6em"}},b.createElement("h4",{className:"text-xs mb-2 flex-grow-0 cursor-default select-none mt-2"},e("field_list")),b.createElement(By,{droppableId:"dimensions",direction:"vertical"},(t,i)=>b.createElement("div",{className:"flex-shrink min-w-[0px] min-h-[100px] sm:max-h-[380px] sm:overflow-y-auto",...t.droppableProps,ref:TC(t.innerRef)},b.createElement("div",{className:"pd-1"},b.createElement(N6e,null)))),b.createElement(By,{droppableId:"measures",direction:"vertical"},(t,i)=>b.createElement("div",{className:"flex-shrink flex-grow min-w-[0px] min-h-[200px] sm:overflow-y-auto flex-1",...t.droppableProps,ref:TC(t.innerRef)},b.createElement("div",{className:"border-t flex-grow pd-1 overflow-y-auto h-full"},b.createElement(R6e,null)))))},F6e=x6e;var M6e=globalThis&&globalThis.__extends||function(){var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(i[o]=n[o])},A(e,t)};return function(e,t){A(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Mo=globalThis&&globalThis.__assign||function(){return Mo=Object.assign||function(A){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(A[n]=e[n])}return A},Mo.apply(this,arguments)},JWA={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},NWA={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},i9={width:"20px",height:"20px",position:"absolute"},v6e={top:Mo(Mo({},JWA),{top:"-5px"}),right:Mo(Mo({},NWA),{left:void 0,right:"-5px"}),bottom:Mo(Mo({},JWA),{top:void 0,bottom:"-5px"}),left:Mo(Mo({},NWA),{left:"-5px"}),topRight:Mo(Mo({},i9),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Mo(Mo({},i9),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Mo(Mo({},i9),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Mo(Mo({},i9),{left:"-10px",top:"-10px",cursor:"nw-resize"})},L6e=function(A){M6e(e,A);function e(){var t=A!==null&&A.apply(this,arguments)||this;return t.onMouseDown=function(i){t.props.onResizeStart(i,t.props.direction)},t.onTouchStart=function(i){t.props.onResizeStart(i,t.props.direction)},t}return e.prototype.render=function(){return p.createElement("div",{className:this.props.className||"",style:Mo(Mo({position:"absolute",userSelect:"none"},v6e[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},e}(p.PureComponent),S6e=globalThis&&globalThis.__extends||function(){var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(i[o]=n[o])},A(e,t)};return function(e,t){A(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),cQ=globalThis&&globalThis.__assign||function(){return cQ=Object.assign||function(A){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(A[n]=e[n])}return A},cQ.apply(this,arguments)},H6e={width:"auto",height:"auto"},n9=function(A,e,t){return Math.max(Math.min(A,t),e)},YWA=function(A,e){return Math.round(A/e)*e},Tk=function(A,e){return new RegExp(A,"i").test(e)},o9=function(A){return!!(A.touches&&A.touches.length)},Z6e=function(A){return!!((A.clientX||A.clientX===0)&&(A.clientY||A.clientY===0))},RWA=function(A,e,t){t===void 0&&(t=0);var i=e.reduce(function(o,g,a){return Math.abs(g-A)<Math.abs(e[o]-A)?a:o},0),n=Math.abs(e[i]-A);return t===0||n<t?e[i]:A},lgA=function(A){return A=A.toString(),A==="auto"||A.endsWith("px")||A.endsWith("%")||A.endsWith("vh")||A.endsWith("vw")||A.endsWith("vmax")||A.endsWith("vmin")?A:A+"px"},g9=function(A,e,t,i){if(A&&typeof A=="string"){if(A.endsWith("px"))return Number(A.replace("px",""));if(A.endsWith("%")){var n=Number(A.replace("%",""))/100;return e*n}if(A.endsWith("vw")){var n=Number(A.replace("vw",""))/100;return t*n}if(A.endsWith("vh")){var n=Number(A.replace("vh",""))/100;return i*n}}return A},W6e=function(A,e,t,i,n,o,g){return i=g9(i,A.width,e,t),n=g9(n,A.height,e,t),o=g9(o,A.width,e,t),g=g9(g,A.height,e,t),{maxWidth:typeof i>"u"?void 0:Number(i),maxHeight:typeof n>"u"?void 0:Number(n),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof g>"u"?void 0:Number(g)}},K6e=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],xWA="__resizable_base__",U6e=function(A){S6e(e,A);function e(t){var i=A.call(this,t)||this;return i.ratio=1,i.resizable=null,i.parentLeft=0,i.parentTop=0,i.resizableLeft=0,i.resizableRight=0,i.resizableTop=0,i.resizableBottom=0,i.targetLeft=0,i.targetTop=0,i.appendBase=function(){if(!i.resizable||!i.window)return null;var n=i.parentNode;if(!n)return null;var o=i.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(xWA):o.className+=xWA,n.appendChild(o),o},i.removeBase=function(n){var o=i.parentNode;o&&o.removeChild(n)},i.ref=function(n){n&&(i.resizable=n)},i.state={isResizing:!1,width:typeof(i.propsSize&&i.propsSize.width)>"u"?"auto":i.propsSize&&i.propsSize.width,height:typeof(i.propsSize&&i.propsSize.height)>"u"?"auto":i.propsSize&&i.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},i.onResizeStart=i.onResizeStart.bind(i),i.onMouseMove=i.onMouseMove.bind(i),i.onMouseUp=i.onMouseUp.bind(i),i}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||H6e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){var t=0,i=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,o=this.resizable.offsetHeight,g=this.resizable.style.position;g!=="relative"&&(this.resizable.style.position="relative"),t=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:n,i=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=g}return{width:t,height:i}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sizeStyle",{get:function(){var t=this,i=this.props.size,n=function(a){if(typeof t.state[a]>"u"||t.state[a]==="auto")return"auto";if(t.propsSize&&t.propsSize[a]&&t.propsSize[a].toString().endsWith("%")){if(t.state[a].toString().endsWith("%"))return t.state[a].toString();var s=t.getParentSize(),I=Number(t.state[a].toString().replace("px","")),r=I/s[a]*100;return r+"%"}return lgA(t.state[a])},o=i&&typeof i.width<"u"&&!this.state.isResizing?lgA(i.width):n("width"),g=i&&typeof i.height<"u"&&!this.state.isResizing?lgA(i.height):n("height");return{width:o,height:g}},enumerable:!1,configurable:!0}),e.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var t=this.appendBase();if(!t)return{width:0,height:0};var i=!1,n=this.parentNode.style.flexWrap;n!=="wrap"&&(i=!0,this.parentNode.style.flexWrap="wrap"),t.style.position="relative",t.style.minWidth="100%",t.style.minHeight="100%";var o={width:t.offsetWidth,height:t.offsetHeight};return i&&(this.parentNode.style.flexWrap=n),this.removeBase(t),o},e.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},e.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},e.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var t=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:t.flexBasis!=="auto"?t.flexBasis:void 0})}},e.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},e.prototype.createSizeForCssProperty=function(t,i){var n=this.propsSize&&this.propsSize[i];return this.state[i]==="auto"&&this.state.original[i]===t&&(typeof n>"u"||n==="auto")?"auto":t},e.prototype.calculateNewMaxFromBoundary=function(t,i){var n=this.props.boundsByDirection,o=this.state.direction,g=n&&Tk("left",o),a=n&&Tk("top",o),s,I;if(this.props.bounds==="parent"){var r=this.parentNode;r&&(s=g?this.resizableRight-this.parentLeft:r.offsetWidth+(this.parentLeft-this.resizableLeft),I=a?this.resizableBottom-this.parentTop:r.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(s=g?this.resizableRight:this.window.innerWidth-this.resizableLeft,I=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(s=g?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),I=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return s&&Number.isFinite(s)&&(t=t&&t<s?t:s),I&&Number.isFinite(I)&&(i=i&&i<I?i:I),{maxWidth:t,maxHeight:i}},e.prototype.calculateNewSizeFromDirection=function(t,i){var n=this.props.scale||1,o=this.props.resizeRatio||1,g=this.state,a=g.direction,s=g.original,I=this.props,r=I.lockAspectRatio,C=I.lockAspectRatioExtraHeight,l=I.lockAspectRatioExtraWidth,c=s.width,B=s.height,E=C||0,u=l||0;return Tk("right",a)&&(c=s.width+(t-s.x)*o/n,r&&(B=(c-u)/this.ratio+E)),Tk("left",a)&&(c=s.width-(t-s.x)*o/n,r&&(B=(c-u)/this.ratio+E)),Tk("bottom",a)&&(B=s.height+(i-s.y)*o/n,r&&(c=(B-E)*this.ratio+u)),Tk("top",a)&&(B=s.height-(i-s.y)*o/n,r&&(c=(B-E)*this.ratio+u)),{newWidth:c,newHeight:B}},e.prototype.calculateNewSizeFromAspectRatio=function(t,i,n,o){var g=this.props,a=g.lockAspectRatio,s=g.lockAspectRatioExtraHeight,I=g.lockAspectRatioExtraWidth,r=typeof o.width>"u"?10:o.width,C=typeof n.width>"u"||n.width<0?t:n.width,l=typeof o.height>"u"?10:o.height,c=typeof n.height>"u"||n.height<0?i:n.height,B=s||0,E=I||0;if(a){var u=(l-B)*this.ratio+E,d=(c-B)*this.ratio+E,f=(r-E)/this.ratio+B,w=(C-E)/this.ratio+B,y=Math.max(r,u),G=Math.min(C,d),R=Math.max(l,f),x=Math.min(c,w);t=n9(t,y,G),i=n9(i,R,x)}else t=n9(t,r,C),i=n9(i,l,c);return{newWidth:t,newHeight:i}},e.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var t=this.parentNode;if(t){var i=t.getBoundingClientRect();this.parentLeft=i.left,this.parentTop=i.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left,this.targetTop=n.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),g=o.left,a=o.top,s=o.right,I=o.bottom;this.resizableLeft=g,this.resizableRight=s,this.resizableTop=a,this.resizableBottom=I}},e.prototype.onResizeStart=function(t,i){if(!(!this.resizable||!this.window)){var n=0,o=0;if(t.nativeEvent&&Z6e(t.nativeEvent)?(n=t.nativeEvent.clientX,o=t.nativeEvent.clientY):t.nativeEvent&&o9(t.nativeEvent)&&(n=t.nativeEvent.touches[0].clientX,o=t.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var g=this.props.onResizeStart(t,i,this.resizable);if(g===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var a,s=this.window.getComputedStyle(this.resizable);if(s.flexBasis!=="auto"){var I=this.parentNode;if(I){var r=this.window.getComputedStyle(I).flexDirection;this.flexDir=r.startsWith("row")?"row":"column",a=s.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var C={original:{x:n,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:cQ(cQ({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(t.target).cursor||"auto"}),direction:i,flexBasis:a};this.setState(C)}},e.prototype.onMouseMove=function(t){var i=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&o9(t))try{t.preventDefault(),t.stopPropagation()}catch{}var n=this.props,o=n.maxWidth,g=n.maxHeight,a=n.minWidth,s=n.minHeight,I=o9(t)?t.touches[0].clientX:t.clientX,r=o9(t)?t.touches[0].clientY:t.clientY,C=this.state,l=C.direction,c=C.original,B=C.width,E=C.height,u=this.getParentSize(),d=W6e(u,this.window.innerWidth,this.window.innerHeight,o,g,a,s);o=d.maxWidth,g=d.maxHeight,a=d.minWidth,s=d.minHeight;var f=this.calculateNewSizeFromDirection(I,r),w=f.newHeight,y=f.newWidth,G=this.calculateNewMaxFromBoundary(o,g);this.props.snap&&this.props.snap.x&&(y=RWA(y,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(w=RWA(w,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(y,w,{width:G.maxWidth,height:G.maxHeight},{width:a,height:s});if(y=R.newWidth,w=R.newHeight,this.props.grid){var x=YWA(y,this.props.grid[0]),F=YWA(w,this.props.grid[1]),Q=this.props.snapGap||0;y=Q===0||Math.abs(x-y)<=Q?x:y,w=Q===0||Math.abs(F-w)<=Q?F:w}var k={width:y-c.width,height:w-c.height};if(B&&typeof B=="string"){if(B.endsWith("%")){var h=y/u.width*100;y=h+"%"}else if(B.endsWith("vw")){var N=y/this.window.innerWidth*100;y=N+"vw"}else if(B.endsWith("vh")){var v=y/this.window.innerHeight*100;y=v+"vh"}}if(E&&typeof E=="string"){if(E.endsWith("%")){var h=w/u.height*100;w=h+"%"}else if(E.endsWith("vw")){var N=w/this.window.innerWidth*100;w=N+"vw"}else if(E.endsWith("vh")){var v=w/this.window.innerHeight*100;w=v+"vh"}}var K={width:this.createSizeForCssProperty(y,"width"),height:this.createSizeForCssProperty(w,"height")};this.flexDir==="row"?K.flexBasis=K.width:this.flexDir==="column"&&(K.flexBasis=K.height),bt.flushSync(function(){i.setState(K)}),this.props.onResize&&this.props.onResize(t,l,this.resizable,k)}},e.prototype.onMouseUp=function(t){var i=this.state,n=i.isResizing,o=i.direction,g=i.original;if(!(!n||!this.resizable)){var a={width:this.size.width-g.width,height:this.size.height-g.height};this.props.onResizeStop&&this.props.onResizeStop(t,o,this.resizable,a),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:cQ(cQ({},this.state.backgroundStyle),{cursor:"auto"})})}},e.prototype.updateSize=function(t){this.setState({width:t.width,height:t.height})},e.prototype.renderResizer=function(){var t=this,i=this.props,n=i.enable,o=i.handleStyles,g=i.handleClasses,a=i.handleWrapperStyle,s=i.handleWrapperClass,I=i.handleComponent;if(!n)return null;var r=Object.keys(n).map(function(C){return n[C]!==!1?p.createElement(L6e,{key:C,direction:C,onResizeStart:t.onResizeStart,replaceStyles:o&&o[C],className:g&&g[C]},I&&I[C]?I[C]:null):null});return p.createElement("div",{className:s,style:a},r)},e.prototype.render=function(){var t=this,i=Object.keys(this.props).reduce(function(g,a){return K6e.indexOf(a)!==-1||(g[a]=t.props[a]),g},{}),n=cQ(cQ(cQ({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(n.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return p.createElement(o,cQ({ref:this.ref,style:n,className:this.props.className},i),this.state.isResizing&&p.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},e.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},e}(p.PureComponent);const FWA=" ",MWA=typeof window<"u"&&window.Blob&&new Blob([atob(FWA)],{type:"text/javascript;charset=utf-8"});function V6e(){let A;try{if(A=MWA&&(window.URL||window.webkitURL).createObjectURL(MWA),!A)throw"";return new Worker(A)}catch{return new Worker("data:application/javascript;base64,"+FWA)}finally{A&&(window.URL||window.webkitURL).revokeObjectURL(A)}}const vWA=" ",LWA=typeof window<"u"&&window.Blob&&new Blob([atob(vWA)],{type:"text/javascript;charset=utf-8"});function X6e(){let A;try{if(A=LWA&&(window.URL||window.webkitURL).createObjectURL(LWA),!A)throw"";return new Worker(A)}catch{return new Worker("data:application/javascript;base64,"+vWA)}finally{A&&(window.URL||window.webkitURL).revokeObjectURL(A)}}const SWA=" ",HWA=typeof window<"u"&&window.Blob&&new Blob([atob(SWA)],{type:"text/javascript;charset=utf-8"});function z6e(){let A;try{if(A=HWA&&(window.URL||window.webkitURL).createObjectURL(HWA),!A)throw"";return new Worker(A)}catch{return new Worker("data:application/javascript;base64,"+SWA)}finally{A&&(window.URL||window.webkitURL).revokeObjectURL(A)}}const ZWA=" ",WWA=typeof window<"u"&&window.Blob&&new Blob([atob(ZWA)],{type:"text/javascript;charset=utf-8"});function T6e(){let A;try{if(A=WWA&&(window.URL||window.webkitURL).createObjectURL(WWA),!A)throw"";return new Worker(A)}catch{return new Worker("data:application/javascript;base64,"+ZWA)}finally{A&&(window.URL||window.webkitURL).revokeObjectURL(A)}}const KWA=" ",UWA=typeof window<"u"&&window.Blob&&new Blob([atob(KWA)],{type:"text/javascript;charset=utf-8"});function _6e(){let A;try{if(A=UWA&&(window.URL||window.webkitURL).createObjectURL(UWA),!A)throw"";return new Worker(A)}catch{return new Worker("data:application/javascript;base64,"+KWA)}finally{A&&(window.URL||window.webkitURL).revokeObjectURL(A)}}function rM(A,e){return new Promise((t,i)=>{A.postMessage(e),A.onmessage=n=>{typeof n.data=="string"&&i({success:!1,message:n.data}),t(n.data)},A.onerror=n=>{i({success:!1,message:n})}})}const O6e=async(A,e)=>{if(e.length===0)return A;const t=new V6e;try{return await rM(t,{dataSource:A,filters:e})}catch(i){throw new Error(i.message)}finally{t.terminate()}},q6e=async(A,e)=>{if(A.length===0)return A;const t=new X6e;try{return await rM(t,{dataSource:A,trans:e})}catch(i){throw new Error(i.message)}finally{t.terminate()}},j6e=async(A,e)=>{const t=new z6e;try{return await rM(t,{dataSource:A,query:e})}catch(i){throw new Error(i.message)}finally{t.terminate()}},P6e=async(A,e,t,i,n,o,g)=>{const a=new T6e;try{return await rM(a,{dimsInRow:A,dimsInColumn:e,allData:t,aggData:i,collapsedKeyList:n,showTableSummary:o,sort:g})}catch(s){throw new Error("Uncaught error in TableBuilderDataWorker",{cause:s})}finally{a.terminate()}},$6e=async(A,e,t)=>{const i=new _6e;try{return await rM(i,{data:A,viewMeasures:e,sort:t})}catch(n){throw new Error("Uncaught error in ViewQueryWorker",{cause:n})}finally{i.terminate()}},VWA=p.createContext(null),_k=()=>{const A=p.useContext(VWA);return A&&"current"in A?A:{current:null}},a9=p.forwardRef(({children:A},e)=>(p.useImperativeHandle(e,()=>{let t="idle",i=[];return{get renderStatus(){return t},onRenderStatusChange:n=>(i.push(n),()=>{i=i.filter(o=>o!==n)}),updateRenderStatus:n=>{t!==n&&(t=n,i.forEach(o=>o(t)))},chartCount:1,chartIndex:0,openChart(){},exportChart:async(n="svg")=>({mode:n,title:"",nCols:0,nRows:0,charts:[],container:()=>null}),exportChartList:async function*(n="svg"){yield{mode:n,total:1,completed:0,index:0,data:{mode:n,title:"",nCols:0,nRows:0,charts:[],container:()=>null},hasNext:!1}}}},[]),b.createElement(VWA.Provider,{value:e},A))),A8e=A=>e=>b.createElement(a9,null,b.createElement(A,{...e}));function XWA(A){return A.isCollapsed||A.children.length===0?1:A.children.map(XWA).reduce((e,t)=>e+t,0)}function zWA(A,e,t,i,n,o,g,a){const s=XWA(A),{isCollapsed:I}=A;if(t>e.length)return;const r=t>0?e[t-1]:void 0,C=(r==null?void 0:r.semanticType)==="temporal"?l=>Uu(Sm(a,r.offset)(l)):l=>`${l}`;if(i[i.length-1].push(b.createElement("td",{key:`${t}-${A.fieldKey}-${A.value}`,className:"bg-secondary text-secondary-foreground align-top whitespace-nowrap p-2 text-xs m-1 border",colSpan:I?A.height+1:1,rowSpan:I?Math.max(n,1):s*Math.max(n,1)},b.createElement("div",{className:"flex"},b.createElement("div",null,C(A.value)),A.height>0&&A.key!=="__total"&&g&&b.createElement(b.Fragment,null,I&&b.createElement(SFA,{className:"w-3 ml-1 self-center cursor-pointer",onClick:()=>o(A)}),!I&&b.createElement(LFA,{className:"w-3 ml-1 self-center cursor-pointer",onClick:()=>o(A)}))))),!I)for(let l=0;l<A.children.length;l++){const c=A.children[l];zWA(c,e,t+1,i,n,o,g),l<A.children.length-1&&i.push([])}}const e8e=A=>{const{data:e,dimsInRow:t,measInRow:i,onHeaderCollapse:n}=A,o=p.useMemo(()=>{const g=[[]];if(zWA(e,t,0,g,i.length,n,A.enableCollapse,A.displayOffset),g[0].shift(),i.length>0){const a=[];for(let s of g){a.push([...s,b.createElement("td",{key:`0-${i[0].fid}-${i[0].aggName}`,className:"bg-secondary text-secondary-foreground whitespace-nowrap p-2 text-xs m-1 border"},i[0].aggName,"(",i[0].name,")")]);for(let I=1;I<i.length;I++)a.push([b.createElement("td",{key:`${I}-${i[I].fid}-${i[I].aggName}`,className:"bg-secondary text-secondary-foreground whitespace-nowrap p-2 text-xs m-1 border"},i[I].aggName,"(",i[I].name,")")])}return a}return g},[e,t,i]);return b.createElement("thead",{className:"bg-secondary border"},o.map((g,a)=>b.createElement("tr",{className:"border",key:a},g)))},t8e=e8e;function cgA(A){return A.isCollapsed||A.children.length===0?1:A.children.map(cgA).reduce((e,t)=>e+t,0)}function TWA(A,e,t,i,n,o,g,a){const s=cgA(A),{isCollapsed:I}=A;if(t>e.length)return;const r=t>0?e[t-1]:void 0,C=(r==null?void 0:r.semanticType)==="temporal"?l=>Uu(Sm(a,r.offset)(l)):l=>`${l}`;if(i[t].push(b.createElement("td",{key:`${t}-${A.fieldKey}-${A.value}-${i[t].length}`,className:"bg-secondary text-secondary-foreground align-top whitespace-nowrap p-2 text-xs m-1 border",colSpan:I?Math.max(n,1):s*Math.max(n,1),rowSpan:I?A.height+1:1},b.createElement("div",{className:"flex"},b.createElement("div",null,C(A.value)),A.height>0&&A.key!=="__total"&&g&&b.createElement(b.Fragment,null,I&&b.createElement(SFA,{className:"w-3 ml-1 self-center cursor-pointer",onClick:()=>o(A)}),!I&&b.createElement(LFA,{className:"w-3 ml-1 self-center cursor-pointer",onClick:()=>o(A)}))))),!I)for(let l=0;l<A.children.length;l++){const c=A.children[l];TWA(c,e,t+1,i,n,o,g,a)}}const i8e=A=>{const{data:e,dimsInCol:t,measInCol:i,onHeaderCollapse:n,onTopTreeHeaderRowNumChange:o}=A,g=p.useMemo(()=>{const a=new Array(t.length+1).fill(0).map(()=>[]);TWA(e,t,0,a,i.length,n,A.enableCollapse,A.displayOffset);const s=cgA(e);return a.forEach((I,r)=>{const C=I.map(l=>b.isValidElement(l)?l.props.rowSpan:0);C.length>0&&C[0]>1&&C.every(l=>l===C[0])&&I.forEach((l,c)=>{if(b.isValidElement(l)){const B=b.cloneElement(l,{...l.props,rowSpan:1});a[r][c]=B}})}),a.push(new Array(s).fill(0).flatMap((I,r)=>i.map(C=>b.createElement("td",{key:`${a.length}-${C.fid}-${C.aggName}-${r}`,className:"bg-secondary text-secondary-foreground whitespace-nowrap p-2 text-xs m-1 border"},C.aggName,"(",C.name,")")))),a.shift(),a},[e,t,i]);return p.useEffect(()=>{o(g.filter(a=>a.length>0).length)},[g]),b.createElement("thead",{className:"border bg-secondary"},g.map((a,s)=>b.createElement("tr",{className:`${(a==null?void 0:a.length)>0?"":"hidden"} border`,key:s},a)))},n8e=i8e;function o8e(A){return Math.abs(A=Math.round(A))>=1e21?A.toLocaleString("en").replace(/,/g,""):A.toString(10)}function s9(A,e){if((t=(A=e?A.toExponential(e-1):A.toExponential()).indexOf("e"))<0)return null;var t,i=A.slice(0,t);return[i.length>1?i[0]+i.slice(2):i,+A.slice(t+1)]}function Ok(A){return A=s9(Math.abs(A)),A?A[1]:NaN}function g8e(A,e){return function(t,i){for(var n=t.length,o=[],g=0,a=A[0],s=0;n>0&&a>0&&(s+a+1>i&&(a=Math.max(1,i-s)),o.push(t.substring(n-=a,n+a)),!((s+=a+1)>i));)a=A[g=(g+1)%A.length];return o.reverse().join(e)}}function a8e(A){return function(e){return e.replace(/[0-9]/g,function(t){return A[+t]})}}var s8e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ky(A){if(!(e=s8e.exec(A)))throw new Error("invalid format: "+A);var e;return new BgA({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ky.prototype=BgA.prototype;function BgA(A){this.fill=A.fill===void 0?" ":A.fill+"",this.align=A.align===void 0?">":A.align+"",this.sign=A.sign===void 0?"-":A.sign+"",this.symbol=A.symbol===void 0?"":A.symbol+"",this.zero=!!A.zero,this.width=A.width===void 0?void 0:+A.width,this.comma=!!A.comma,this.precision=A.precision===void 0?void 0:+A.precision,this.trim=!!A.trim,this.type=A.type===void 0?"":A.type+""}BgA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function r8e(A){A:for(var e=A.length,t=1,i=-1,n;t<e;++t)switch(A[t]){case".":i=n=t;break;case"0":i===0&&(i=t),n=t;break;default:if(!+A[t])break A;i>0&&(i=0);break}return i>0?A.slice(0,i)+A.slice(n+1):A}var _WA;function I8e(A,e){var t=s9(A,e);if(!t)return A+"";var i=t[0],n=t[1],o=n-(_WA=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,g=i.length;return o===g?i:o>g?i+new Array(o-g+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+s9(A,Math.max(0,e+o-1))[0]}function OWA(A,e){var t=s9(A,e);if(!t)return A+"";var i=t[0],n=t[1];return n<0?"0."+new Array(-n).join("0")+i:i.length>n+1?i.slice(0,n+1)+"."+i.slice(n+1):i+new Array(n-i.length+2).join("0")}const qWA={"%":(A,e)=>(A*100).toFixed(e),b:A=>Math.round(A).toString(2),c:A=>A+"",d:o8e,e:(A,e)=>A.toExponential(e),f:(A,e)=>A.toFixed(e),g:(A,e)=>A.toPrecision(e),o:A=>Math.round(A).toString(8),p:(A,e)=>OWA(A*100,e),r:OWA,s:I8e,X:A=>Math.round(A).toString(16).toUpperCase(),x:A=>Math.round(A).toString(16)};function jWA(A){return A}var PWA=Array.prototype.map,$WA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function A3A(A){var e=A.grouping===void 0||A.thousands===void 0?jWA:g8e(PWA.call(A.grouping,Number),A.thousands+""),t=A.currency===void 0?"":A.currency[0]+"",i=A.currency===void 0?"":A.currency[1]+"",n=A.decimal===void 0?".":A.decimal+"",o=A.numerals===void 0?jWA:a8e(PWA.call(A.numerals,String)),g=A.percent===void 0?"%":A.percent+"",a=A.minus===void 0?"−":A.minus+"",s=A.nan===void 0?"NaN":A.nan+"";function I(C){C=Ky(C);var l=C.fill,c=C.align,B=C.sign,E=C.symbol,u=C.zero,d=C.width,f=C.comma,w=C.precision,y=C.trim,G=C.type;G==="n"?(f=!0,G="g"):qWA[G]||(w===void 0&&(w=12),y=!0,G="g"),(u||l==="0"&&c==="=")&&(u=!0,l="0",c="=");var R=E==="$"?t:E==="#"&&/[boxX]/.test(G)?"0"+G.toLowerCase():"",x=E==="$"?i:/[%p]/.test(G)?g:"",F=qWA[G],Q=/[defgprs%]/.test(G);w=w===void 0?6:/[gprs]/.test(G)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function k(h){var N=R,v=x,K,U,V;if(G==="c")v=F(h)+v,h="";else{h=+h;var X=h<0||1/h<0;if(h=isNaN(h)?s:F(Math.abs(h),w),y&&(h=r8e(h)),X&&+h==0&&B!=="+"&&(X=!1),N=(X?B==="("?B:a:B==="-"||B==="("?"":B)+N,v=(G==="s"?$WA[8+_WA/3]:"")+v+(X&&B==="("?")":""),Q){for(K=-1,U=h.length;++K<U;)if(V=h.charCodeAt(K),48>V||V>57){v=(V===46?n+h.slice(K+1):h.slice(K))+v,h=h.slice(0,K);break}}}f&&!u&&(h=e(h,1/0));var _=N.length+h.length+v.length,q=_<d?new Array(d-_+1).join(l):"";switch(f&&u&&(h=e(q+h,q.length?d-v.length:1/0),q=""),c){case"<":h=N+h+v+q;break;case"=":h=N+q+h+v;break;case"^":h=q.slice(0,_=q.length>>1)+N+h+v+q.slice(_);break;default:h=q+N+h+v;break}return o(h)}return k.toString=function(){return C+""},k}function r(C,l){var c=I((C=Ky(C),C.type="f",C)),B=Math.max(-8,Math.min(8,Math.floor(Ok(l)/3)))*3,E=Math.pow(10,-B),u=$WA[8+B/3];return function(d){return c(E*d)+u}}return{format:I,formatPrefix:r}}var r9,Ec,QgA;C8e({thousands:",",grouping:[3],currency:["$",""]});function C8e(A){return r9=A3A(A),Ec=r9.format,QgA=r9.formatPrefix,r9}function e3A(A){return Math.max(0,-Ok(Math.abs(A)))}function t3A(A,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ok(e)/3)))*3-Ok(Math.abs(A)))}function i3A(A,e){return A=Math.abs(A),e=Math.abs(e)-A,Math.max(0,Ok(e)-Ok(A))+1}function qk(A,e,t){const i=Fo(e.fid,e.aggName);return A[i]===void 0?"--":t(A[i])}const l8e=b.memo(A=>{const{matrix:e,meaInRows:t,meaInColumns:i,numberFormat:n}=A,o=p.useMemo(()=>{const g=n?Ec(n):a=>a.toLocaleString();return a=>typeof a!="number"?`${a}`:g(a)},[n]);return b.createElement("tbody",{className:"bg-background text-foreground border-r border-b"},e.map((g,a)=>t.length!==0?t.map((s,I)=>b.createElement("tr",{className:"divide-x divide-border",key:`${a}-${s.fid}-${s.aggName}`},g.flatMap((r,C)=>(r=r??{},i.length!==0?i.map((l,c)=>b.createElement("td",{className:"whitespace-nowrap p-2 text-xs",key:`${a}-${C}-${s.fid}-${s.aggName}-${l.fid}-${l.aggName}`},qk(r,s,o)," , ",qk(r,l,o))):b.createElement("td",{className:"whitespace-nowrap p-2 text-xs",key:`${a}-${C}-${s.fid}-${s.aggName}`},qk(r,s,o)))))):b.createElement("tr",{className:"divide-x divide-border",key:a},g.flatMap((s,I)=>(s=s??{},t.length===0&&i.length!==0?i.map((r,C)=>b.createElement("td",{className:"whitespace-nowrap p-2 text-xs",key:`${a}-${I}-${C}-${r.fid}-${r.aggName}`},qk(s,r,o))):t.length===0&&i.length===0?b.createElement("td",{className:"whitespace-nowrap p-2 text-xs",key:`${a}-${I}`},"True"):t.flatMap((r,C)=>b.createElement("td",{className:"whitespace-nowrap p-2 text-xs",key:`${a}-${I}-${C}-${r.fid}-${r.aggName}`},i.flatMap((l,c)=>b.createElement("td",{className:"whitespace-nowrap p-2 text-xs",key:`${a}-${I}-${C}-${c}-${l.fid}-${l.aggName}`},qk(s,r,o)," , ",qk(s,l,o))))))))))},function(A,e){return JSON.stringify(A.matrix)===JSON.stringify(e.matrix)&&A.numberFormat===e.numberFormat}),c8e=l8e;function I9(A){const e=A.className;return b.createElement("svg",{className:`animate-spin ${e}`,viewBox:"0 0 24 24"},b.createElement("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),b.createElement("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}))}function nr(){return b.createElement("div",{className:"bg-black/10 opacity-50 absolute top-0 left-0 right-0 bottom-0 z-50 flex items-center justify-center"},b.createElement(I9,{className:"text-primary w-4 h-4 mr-2"}),b.createElement("span",{className:"text-sm text-primary"},"Loading..."))}const B8e=function(A){const{data:e,visualConfig:t,layout:i,draggableFieldState:n}=A,o=Og(),g=_k(),[a,s]=p.useState(null),[I,r]=p.useState(null),[C,l]=p.useState([]),[c,B]=p.useState(!1),E=!A.disableCollapse,[u,d]=p.useState({}),f=p.useCallback(q=>{const{uniqueKey:$,height:nA}=q;nA<1||d(j=>{const O={...j};return Object.entries(O).forEach(([eA,oA])=>{eA.startsWith($)&&eA.length>$.length&&delete O[eA]}),O[$]?delete O[$]:O[$]=q.path,O})},[]),{rows:w,columns:y}=n,{defaultAggregated:G,folds:R}=t,{showTableSummary:x}=i,F=p.useRef([]),[Q,k]=p.useState(0),h=p.useMemo(()=>w.filter(q=>q.analyticType==="dimension"),[w]),N=p.useMemo(()=>y.filter(q=>q.analyticType==="dimension"),[y]),v=p.useMemo(()=>w.filter(q=>q.analyticType==="measure"),[w]),K=p.useMemo(()=>y.filter(q=>q.analyticType==="measure"),[y]);p.useEffect(()=>{if(!E){V();return}Object.keys(u).length>0?(d({}),x&&_()):U()},[e,E]),p.useEffect(()=>{!E||x?V():U()},[E,u]),p.useEffect(()=>{U()},[x]);const U=async()=>{await _(),V()},V=()=>{var q;(q=g.current)==null||q.updateRenderStatus("rendering"),B(!0);const $=uk(n),nA=ZMA(n);P6e(h,N,e,F.current,Object.keys(u),x,$!=="none"&&nA!=="none"?{fid:nA==="column"?`${v[0].fid}_${v[0].aggName}`:`${K[0].fid}_${K[0].aggName}`,mode:nA,type:$}:void 0).then(j=>{var O;const{lt:eA,tt:oA,metric:tA}=j;bt.unstable_batchedUpdates(()=>{s(eA),r(oA),l(tA)}),(O=g.current)==null||O.updateRenderStatus("idle"),B(!1)}).catch(j=>{var O;(O=g.current)==null||O.updateRenderStatus("error"),console.log(j),B(!1)})},X=p.useRef([]),_=()=>{var q;if(h.length===0&&N.length===0||e.length===0)return;let $=[],nA=[];if(x)$=h.map((eA,oA)=>h.slice(0,oA)),nA=N.map((eA,oA)=>N.slice(0,oA));else{const eA=Object.entries(u).map(([sA,gA])=>gA[gA.length-1].key),oA=h.filter(sA=>eA.includes(sA.fid)),tA=N.filter(sA=>eA.includes(sA.fid));$=oA.map(sA=>h.slice(0,h.indexOf(sA)+1)),nA=tA.map(sA=>N.slice(0,N.indexOf(sA)+1))}$.push(h),nA.push(N);const j=nA.flatMap(eA=>$.map(oA=>[...eA,...oA])).slice(0,-1);if(X.current.length===j.length&&X.current.every((eA,oA)=>eA.length===j[oA].length&&eA.every((tA,sA)=>EI(tA)===EI(j[oA][sA]))))return;X.current=j,B(!0),(q=g.current)==null||q.updateRenderStatus("computing");const O=j.map(eA=>{const oA=n.filters,tA=SvA(n),sA=HvA(n,"table").filter(CA=>CA.analyticType==="measure"),gA=uk(n),{limit:iA}=t,{timezoneDisplayOffset:aA}=t,lA=Hm(oA,tA,eA,sA,G,gA,R??[],iA>0?iA:void 0,aA);return t9(o,lA,iA>0?iA:void 0).then(CA=>GvA(CA,G,tA,sA,eA,R)).catch(CA=>{var QA;return(QA=g.current)==null||QA.updateRenderStatus("error"),[]})});return new Promise((eA,oA)=>{Promise.all(O).then(tA=>{B(!1);const sA=[...tA.flat()];F.current=sA,eA()}).catch(tA=>{console.error(tA),B(!1),oA()})})};return b.createElement("div",{className:"relative"},c&&b.createElement(nr,null),b.createElement("div",{className:"flex"},b.createElement("table",{className:"border border-collapse"},b.createElement("thead",{className:"border"},new Array(Math.max(Q-1,0)).fill(0).map((q,$)=>b.createElement("tr",{className:"",key:$},b.createElement("td",{className:"bg-secondary text-secondary-foreground p-2 m-1 text-xs border",colSpan:h.length+(v.length>0?1:0)},"_"))),Q>0&&b.createElement("tr",{className:""},h.map(q=>b.createElement("td",{className:"bg-secondary text-secondary-foreground p-2 m-1 text-xs border whitespace-nowrap",colSpan:1},q.name)),v.length>0&&b.createElement("td",{className:"bg-secondary text-secondary-foreground p-2 m-1 text-xs border",colSpan:1},"_"))),a&&b.createElement(t8e,{data:a,dimsInRow:h,measInRow:v,onHeaderCollapse:q=>f(q),enableCollapse:E,displayOffset:t.timezoneDisplayOffset})),b.createElement("table",{className:"border border-collapse"},I&&b.createElement(n8e,{data:I,dimsInCol:N,measInCol:K,onHeaderCollapse:q=>f(q),onTopTreeHeaderRowNumChange:q=>k(q),enableCollapse:E,displayOffset:t.timezoneDisplayOffset}),C&&b.createElement(c8e,{matrix:C,meaInColumns:K,meaInRows:v,numberFormat:i.format.numberFormat||""}))))},Q8e=B8e;function n3A(A,e){const t=p.useRef(e);p.useEffect(function(){e!==t.current&&A.attributionControl!=null&&(t.current!=null&&A.attributionControl.removeAttribution(t.current),e!=null&&A.attributionControl.addAttribution(e)),t.current=e},[A,e])}function E8e(A,e,t){e.center!==t.center&&A.setLatLng(e.center),e.radius!=null&&e.radius!==t.radius&&A.setRadius(e.radius)}const u8e=1;function d8e(A){return Object.freeze({__version:u8e,map:A})}function C9(A,e){return Object.freeze({...A,...e})}const o3A=p.createContext(null),g3A=o3A.Provider;function IM(){const A=p.useContext(o3A);if(A==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return A}function a3A(A){function e(t,i){const{instance:n,context:o}=A(t).current;return p.useImperativeHandle(i,()=>n),t.children==null?null:b.createElement(g3A,{value:o},t.children)}return p.forwardRef(e)}function h8e(A){function e(t,i){const[n,o]=p.useState(!1),{instance:g}=A(t,o).current;p.useImperativeHandle(i,()=>g),p.useEffect(function(){n&&g.update()},[g,n,t.children]);const a=g._contentNode;return a?bt.createPortal(t.children,a):null}return p.forwardRef(e)}function s3A(A){function e(t,i){const{instance:n}=A(t).current;return p.useImperativeHandle(i,()=>n),null}return p.forwardRef(e)}function m8e(A){return function(e){const t=IM(),i=A(e,t),{instance:n}=i.current,o=p.useRef(e.position),{position:g}=e;return p.useEffect(function(){return n.addTo(t.map),function(){n.remove()}},[t.map,n]),p.useEffect(function(){g!=null&&g!==o.current&&(n.setPosition(g),o.current=g)},[n,g]),i}}function EgA(A,e){const t=p.useRef();p.useEffect(function(){return e!=null&&A.instance.on(e),t.current=e,function(){t.current!=null&&A.instance.off(t.current),t.current=null}},[A,e])}function l9(A,e){const t=A.pane??e.pane;return t?{...A,pane:t}:A}function p8e(A,e){return function(t,i){const n=IM(),o=A(l9(t,n),n);return n3A(n.map,t.attribution),EgA(o.current,t.eventHandlers),e(o.current,n,t,i),o}}var ugA={exports:{}};/* @preserve
 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
 */(function(A,e){(function(t,i){i(e)})(um,function(t){var i="1.9.4";function n(m){var J,Z,z,AA;for(Z=1,z=arguments.length;Z<z;Z++){AA=arguments[Z];for(J in AA)m[J]=AA[J]}return m}var o=Object.create||function(){function m(){}return function(J){return m.prototype=J,new m}}();function g(m,J){var Z=Array.prototype.slice;if(m.bind)return m.bind.apply(m,Z.call(arguments,1));var z=Z.call(arguments,2);return function(){return m.apply(J,z.length?z.concat(Z.call(arguments)):arguments)}}var a=0;function s(m){return"_leaflet_id"in m||(m._leaflet_id=++a),m._leaflet_id}function I(m,J,Z){var z,AA,rA,BA;return BA=function(){z=!1,AA&&(rA.apply(Z,AA),AA=!1)},rA=function(){z?AA=arguments:(m.apply(Z,arguments),setTimeout(BA,J),z=!0)},rA}function r(m,J,Z){var z=J[1],AA=J[0],rA=z-AA;return m===z&&Z?m:((m-AA)%rA+rA)%rA+AA}function C(){return!1}function l(m,J){if(J===!1)return m;var Z=Math.pow(10,J===void 0?6:J);return Math.round(m*Z)/Z}function c(m){return m.trim?m.trim():m.replace(/^\s+|\s+$/g,"")}function B(m){return c(m).split(/\s+/)}function E(m,J){Object.prototype.hasOwnProperty.call(m,"options")||(m.options=m.options?o(m.options):{});for(var Z in J)m.options[Z]=J[Z];return m.options}function u(m,J,Z){var z=[];for(var AA in m)z.push(encodeURIComponent(Z?AA.toUpperCase():AA)+"="+encodeURIComponent(m[AA]));return(!J||J.indexOf("?")===-1?"?":"&")+z.join("&")}var d=/\{ *([\w_ -]+) *\}/g;function f(m,J){return m.replace(d,function(Z,z){var AA=J[z];if(AA===void 0)throw new Error("No value provided for variable "+Z);return typeof AA=="function"&&(AA=AA(J)),AA})}var w=Array.isArray||function(m){return Object.prototype.toString.call(m)==="[object Array]"};function y(m,J){for(var Z=0;Z<m.length;Z++)if(m[Z]===J)return Z;return-1}var G="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function R(m){return window["webkit"+m]||window["moz"+m]||window["ms"+m]}var x=0;function F(m){var J=+new Date,Z=Math.max(0,16-(J-x));return x=J+Z,window.setTimeout(m,Z)}var Q=window.requestAnimationFrame||R("RequestAnimationFrame")||F,k=window.cancelAnimationFrame||R("CancelAnimationFrame")||R("CancelRequestAnimationFrame")||function(m){window.clearTimeout(m)};function h(m,J,Z){if(Z&&Q===F)m.call(J);else return Q.call(window,g(m,J))}function N(m){m&&k.call(window,m)}var v={__proto__:null,extend:n,create:o,bind:g,get lastId(){return a},stamp:s,throttle:I,wrapNum:r,falseFn:C,formatNum:l,trim:c,splitWords:B,setOptions:E,getParamString:u,template:f,isArray:w,indexOf:y,emptyImageUrl:G,requestFn:Q,cancelFn:k,requestAnimFrame:h,cancelAnimFrame:N};function K(){}K.extend=function(m){var J=function(){E(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},Z=J.__super__=this.prototype,z=o(Z);z.constructor=J,J.prototype=z;for(var AA in this)Object.prototype.hasOwnProperty.call(this,AA)&&AA!=="prototype"&&AA!=="__super__"&&(J[AA]=this[AA]);return m.statics&&n(J,m.statics),m.includes&&(U(m.includes),n.apply(null,[z].concat(m.includes))),n(z,m),delete z.statics,delete z.includes,z.options&&(z.options=Z.options?o(Z.options):{},n(z.options,m.options)),z._initHooks=[],z.callInitHooks=function(){if(!this._initHooksCalled){Z.callInitHooks&&Z.callInitHooks.call(this),this._initHooksCalled=!0;for(var rA=0,BA=z._initHooks.length;rA<BA;rA++)z._initHooks[rA].call(this)}},J},K.include=function(m){var J=this.prototype.options;return n(this.prototype,m),m.options&&(this.prototype.options=J,this.mergeOptions(m.options)),this},K.mergeOptions=function(m){return n(this.prototype.options,m),this},K.addInitHook=function(m){var J=Array.prototype.slice.call(arguments,1),Z=typeof m=="function"?m:function(){this[m].apply(this,J)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(Z),this};function U(m){if(!(typeof L>"u"||!L||!L.Mixin)){m=w(m)?m:[m];for(var J=0;J<m.length;J++)m[J]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var V={on:function(m,J,Z){if(typeof m=="object")for(var z in m)this._on(z,m[z],J);else{m=B(m);for(var AA=0,rA=m.length;AA<rA;AA++)this._on(m[AA],J,Z)}return this},off:function(m,J,Z){if(!arguments.length)delete this._events;else if(typeof m=="object")for(var z in m)this._off(z,m[z],J);else{m=B(m);for(var AA=arguments.length===1,rA=0,BA=m.length;rA<BA;rA++)AA?this._off(m[rA]):this._off(m[rA],J,Z)}return this},_on:function(m,J,Z,z){if(typeof J!="function"){console.warn("wrong listener type: "+typeof J);return}if(this._listens(m,J,Z)===!1){Z===this&&(Z=void 0);var AA={fn:J,ctx:Z};z&&(AA.once=!0),this._events=this._events||{},this._events[m]=this._events[m]||[],this._events[m].push(AA)}},_off:function(m,J,Z){var z,AA,rA;if(this._events&&(z=this._events[m],!!z)){if(arguments.length===1){if(this._firingCount)for(AA=0,rA=z.length;AA<rA;AA++)z[AA].fn=C;delete this._events[m];return}if(typeof J!="function"){console.warn("wrong listener type: "+typeof J);return}var BA=this._listens(m,J,Z);if(BA!==!1){var pA=z[BA];this._firingCount&&(pA.fn=C,this._events[m]=z=z.slice()),z.splice(BA,1)}}},fire:function(m,J,Z){if(!this.listens(m,Z))return this;var z=n({},J,{type:m,target:this,sourceTarget:J&&J.sourceTarget||this});if(this._events){var AA=this._events[m];if(AA){this._firingCount=this._firingCount+1||1;for(var rA=0,BA=AA.length;rA<BA;rA++){var pA=AA[rA],bA=pA.fn;pA.once&&this.off(m,bA,pA.ctx),bA.call(pA.ctx||this,z)}this._firingCount--}}return Z&&this._propagateEvent(z),this},listens:function(m,J,Z,z){typeof m!="string"&&console.warn('"string" type argument expected');var AA=J;typeof J!="function"&&(z=!!J,AA=void 0,Z=void 0);var rA=this._events&&this._events[m];if(rA&&rA.length&&this._listens(m,AA,Z)!==!1)return!0;if(z){for(var BA in this._eventParents)if(this._eventParents[BA].listens(m,J,Z,z))return!0}return!1},_listens:function(m,J,Z){if(!this._events)return!1;var z=this._events[m]||[];if(!J)return!!z.length;Z===this&&(Z=void 0);for(var AA=0,rA=z.length;AA<rA;AA++)if(z[AA].fn===J&&z[AA].ctx===Z)return AA;return!1},once:function(m,J,Z){if(typeof m=="object")for(var z in m)this._on(z,m[z],J,!0);else{m=B(m);for(var AA=0,rA=m.length;AA<rA;AA++)this._on(m[AA],J,Z,!0)}return this},addEventParent:function(m){return this._eventParents=this._eventParents||{},this._eventParents[s(m)]=m,this},removeEventParent:function(m){return this._eventParents&&delete this._eventParents[s(m)],this},_propagateEvent:function(m){for(var J in this._eventParents)this._eventParents[J].fire(m.type,n({layer:m.target,propagatedFrom:m.target},m),!0)}};V.addEventListener=V.on,V.removeEventListener=V.clearAllEventListeners=V.off,V.addOneTimeEventListener=V.once,V.fireEvent=V.fire,V.hasEventListeners=V.listens;var X=K.extend(V);function _(m,J,Z){this.x=Z?Math.round(m):m,this.y=Z?Math.round(J):J}var q=Math.trunc||function(m){return m>0?Math.floor(m):Math.ceil(m)};_.prototype={clone:function(){return new _(this.x,this.y)},add:function(m){return this.clone()._add($(m))},_add:function(m){return this.x+=m.x,this.y+=m.y,this},subtract:function(m){return this.clone()._subtract($(m))},_subtract:function(m){return this.x-=m.x,this.y-=m.y,this},divideBy:function(m){return this.clone()._divideBy(m)},_divideBy:function(m){return this.x/=m,this.y/=m,this},multiplyBy:function(m){return this.clone()._multiplyBy(m)},_multiplyBy:function(m){return this.x*=m,this.y*=m,this},scaleBy:function(m){return new _(this.x*m.x,this.y*m.y)},unscaleBy:function(m){return new _(this.x/m.x,this.y/m.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=q(this.x),this.y=q(this.y),this},distanceTo:function(m){m=$(m);var J=m.x-this.x,Z=m.y-this.y;return Math.sqrt(J*J+Z*Z)},equals:function(m){return m=$(m),m.x===this.x&&m.y===this.y},contains:function(m){return m=$(m),Math.abs(m.x)<=Math.abs(this.x)&&Math.abs(m.y)<=Math.abs(this.y)},toString:function(){return"Point("+l(this.x)+", "+l(this.y)+")"}};function $(m,J,Z){return m instanceof _?m:w(m)?new _(m[0],m[1]):m==null?m:typeof m=="object"&&"x"in m&&"y"in m?new _(m.x,m.y):new _(m,J,Z)}function nA(m,J){if(m)for(var Z=J?[m,J]:m,z=0,AA=Z.length;z<AA;z++)this.extend(Z[z])}nA.prototype={extend:function(m){var J,Z;if(!m)return this;if(m instanceof _||typeof m[0]=="number"||"x"in m)J=Z=$(m);else if(m=j(m),J=m.min,Z=m.max,!J||!Z)return this;return!this.min&&!this.max?(this.min=J.clone(),this.max=Z.clone()):(this.min.x=Math.min(J.x,this.min.x),this.max.x=Math.max(Z.x,this.max.x),this.min.y=Math.min(J.y,this.min.y),this.max.y=Math.max(Z.y,this.max.y)),this},getCenter:function(m){return $((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,m)},getBottomLeft:function(){return $(this.min.x,this.max.y)},getTopRight:function(){return $(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(m){var J,Z;return typeof m[0]=="number"||m instanceof _?m=$(m):m=j(m),m instanceof nA?(J=m.min,Z=m.max):J=Z=m,J.x>=this.min.x&&Z.x<=this.max.x&&J.y>=this.min.y&&Z.y<=this.max.y},intersects:function(m){m=j(m);var J=this.min,Z=this.max,z=m.min,AA=m.max,rA=AA.x>=J.x&&z.x<=Z.x,BA=AA.y>=J.y&&z.y<=Z.y;return rA&&BA},overlaps:function(m){m=j(m);var J=this.min,Z=this.max,z=m.min,AA=m.max,rA=AA.x>J.x&&z.x<Z.x,BA=AA.y>J.y&&z.y<Z.y;return rA&&BA},isValid:function(){return!!(this.min&&this.max)},pad:function(m){var J=this.min,Z=this.max,z=Math.abs(J.x-Z.x)*m,AA=Math.abs(J.y-Z.y)*m;return j($(J.x-z,J.y-AA),$(Z.x+z,Z.y+AA))},equals:function(m){return m?(m=j(m),this.min.equals(m.getTopLeft())&&this.max.equals(m.getBottomRight())):!1}};function j(m,J){return!m||m instanceof nA?m:new nA(m,J)}function O(m,J){if(m)for(var Z=J?[m,J]:m,z=0,AA=Z.length;z<AA;z++)this.extend(Z[z])}O.prototype={extend:function(m){var J=this._southWest,Z=this._northEast,z,AA;if(m instanceof oA)z=m,AA=m;else if(m instanceof O){if(z=m._southWest,AA=m._northEast,!z||!AA)return this}else return m?this.extend(tA(m)||eA(m)):this;return!J&&!Z?(this._southWest=new oA(z.lat,z.lng),this._northEast=new oA(AA.lat,AA.lng)):(J.lat=Math.min(z.lat,J.lat),J.lng=Math.min(z.lng,J.lng),Z.lat=Math.max(AA.lat,Z.lat),Z.lng=Math.max(AA.lng,Z.lng)),this},pad:function(m){var J=this._southWest,Z=this._northEast,z=Math.abs(J.lat-Z.lat)*m,AA=Math.abs(J.lng-Z.lng)*m;return new O(new oA(J.lat-z,J.lng-AA),new oA(Z.lat+z,Z.lng+AA))},getCenter:function(){return new oA((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new oA(this.getNorth(),this.getWest())},getSouthEast:function(){return new oA(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(m){typeof m[0]=="number"||m instanceof oA||"lat"in m?m=tA(m):m=eA(m);var J=this._southWest,Z=this._northEast,z,AA;return m instanceof O?(z=m.getSouthWest(),AA=m.getNorthEast()):z=AA=m,z.lat>=J.lat&&AA.lat<=Z.lat&&z.lng>=J.lng&&AA.lng<=Z.lng},intersects:function(m){m=eA(m);var J=this._southWest,Z=this._northEast,z=m.getSouthWest(),AA=m.getNorthEast(),rA=AA.lat>=J.lat&&z.lat<=Z.lat,BA=AA.lng>=J.lng&&z.lng<=Z.lng;return rA&&BA},overlaps:function(m){m=eA(m);var J=this._southWest,Z=this._northEast,z=m.getSouthWest(),AA=m.getNorthEast(),rA=AA.lat>J.lat&&z.lat<Z.lat,BA=AA.lng>J.lng&&z.lng<Z.lng;return rA&&BA},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(m,J){return m?(m=eA(m),this._southWest.equals(m.getSouthWest(),J)&&this._northEast.equals(m.getNorthEast(),J)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function eA(m,J){return m instanceof O?m:new O(m,J)}function oA(m,J,Z){if(isNaN(m)||isNaN(J))throw new Error("Invalid LatLng object: ("+m+", "+J+")");this.lat=+m,this.lng=+J,Z!==void 0&&(this.alt=+Z)}oA.prototype={equals:function(m,J){if(!m)return!1;m=tA(m);var Z=Math.max(Math.abs(this.lat-m.lat),Math.abs(this.lng-m.lng));return Z<=(J===void 0?1e-9:J)},toString:function(m){return"LatLng("+l(this.lat,m)+", "+l(this.lng,m)+")"},distanceTo:function(m){return gA.distance(this,tA(m))},wrap:function(){return gA.wrapLatLng(this)},toBounds:function(m){var J=180*m/40075017,Z=J/Math.cos(Math.PI/180*this.lat);return eA([this.lat-J,this.lng-Z],[this.lat+J,this.lng+Z])},clone:function(){return new oA(this.lat,this.lng,this.alt)}};function tA(m,J,Z){return m instanceof oA?m:w(m)&&typeof m[0]!="object"?m.length===3?new oA(m[0],m[1],m[2]):m.length===2?new oA(m[0],m[1]):null:m==null?m:typeof m=="object"&&"lat"in m?new oA(m.lat,"lng"in m?m.lng:m.lon,m.alt):J===void 0?null:new oA(m,J,Z)}var sA={latLngToPoint:function(m,J){var Z=this.projection.project(m),z=this.scale(J);return this.transformation._transform(Z,z)},pointToLatLng:function(m,J){var Z=this.scale(J),z=this.transformation.untransform(m,Z);return this.projection.unproject(z)},project:function(m){return this.projection.project(m)},unproject:function(m){return this.projection.unproject(m)},scale:function(m){return 256*Math.pow(2,m)},zoom:function(m){return Math.log(m/256)/Math.LN2},getProjectedBounds:function(m){if(this.infinite)return null;var J=this.projection.bounds,Z=this.scale(m),z=this.transformation.transform(J.min,Z),AA=this.transformation.transform(J.max,Z);return new nA(z,AA)},infinite:!1,wrapLatLng:function(m){var J=this.wrapLng?r(m.lng,this.wrapLng,!0):m.lng,Z=this.wrapLat?r(m.lat,this.wrapLat,!0):m.lat,z=m.alt;return new oA(Z,J,z)},wrapLatLngBounds:function(m){var J=m.getCenter(),Z=this.wrapLatLng(J),z=J.lat-Z.lat,AA=J.lng-Z.lng;if(z===0&&AA===0)return m;var rA=m.getSouthWest(),BA=m.getNorthEast(),pA=new oA(rA.lat-z,rA.lng-AA),bA=new oA(BA.lat-z,BA.lng-AA);return new O(pA,bA)}},gA=n({},sA,{wrapLng:[-180,180],R:6371e3,distance:function(m,J){var Z=Math.PI/180,z=m.lat*Z,AA=J.lat*Z,rA=Math.sin((J.lat-m.lat)*Z/2),BA=Math.sin((J.lng-m.lng)*Z/2),pA=rA*rA+Math.cos(z)*Math.cos(AA)*BA*BA,bA=2*Math.atan2(Math.sqrt(pA),Math.sqrt(1-pA));return this.R*bA}}),iA=6378137,aA={R:iA,MAX_LATITUDE:85.0511287798,project:function(m){var J=Math.PI/180,Z=this.MAX_LATITUDE,z=Math.max(Math.min(Z,m.lat),-Z),AA=Math.sin(z*J);return new _(this.R*m.lng*J,this.R*Math.log((1+AA)/(1-AA))/2)},unproject:function(m){var J=180/Math.PI;return new oA((2*Math.atan(Math.exp(m.y/this.R))-Math.PI/2)*J,m.x*J/this.R)},bounds:function(){var m=iA*Math.PI;return new nA([-m,-m],[m,m])}()};function lA(m,J,Z,z){if(w(m)){this._a=m[0],this._b=m[1],this._c=m[2],this._d=m[3];return}this._a=m,this._b=J,this._c=Z,this._d=z}lA.prototype={transform:function(m,J){return this._transform(m.clone(),J)},_transform:function(m,J){return J=J||1,m.x=J*(this._a*m.x+this._b),m.y=J*(this._c*m.y+this._d),m},untransform:function(m,J){return J=J||1,new _((m.x/J-this._b)/this._a,(m.y/J-this._d)/this._c)}};function CA(m,J,Z,z){return new lA(m,J,Z,z)}var QA=n({},gA,{code:"EPSG:3857",projection:aA,transformation:function(){var m=.5/(Math.PI*aA.R);return CA(m,.5,-m,.5)}()}),uA=n({},QA,{code:"EPSG:900913"});function fA(m){return document.createElementNS("http://www.w3.org/2000/svg",m)}function hA(m,J){var Z="",z,AA,rA,BA,pA,bA;for(z=0,rA=m.length;z<rA;z++){for(pA=m[z],AA=0,BA=pA.length;AA<BA;AA++)bA=pA[AA],Z+=(AA?"L":"M")+bA.x+" "+bA.y;Z+=J?he.svg?"z":"x":""}return Z||"M0 0"}var yA=document.documentElement.style,mA="ActiveXObject"in window,LA=mA&&!document.addEventListener,UA="msLaunchUri"in navigator&&!("documentMode"in document),ne=Rg("webkit"),SA=Rg("android"),ae=Rg("android 2")||Rg("android 3"),EA=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),wA=SA&&Rg("Google")&&EA<537&&!("AudioNode"in window),se=!!window.opera,we=!UA&&Rg("chrome"),be=Rg("gecko")&&!ne&&!se&&!mA,Oe=!we&&Rg("safari"),VA=Rg("phantom"),ZA="OTransition"in yA,le=navigator.platform.indexOf("Win")===0,ce=mA&&"transition"in yA,de="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ae,rt="MozPerspective"in yA,en=!window.L_DISABLE_3D&&(ce||de||rt)&&!ZA&&!VA,Ot=typeof orientation<"u"||Rg("mobile"),og=Ot&&ne,Oa=Ot&&de,hh=!window.PointerEvent&&window.MSPointerEvent,Ss=!!(window.PointerEvent||hh),kR="ontouchstart"in window||!!window.TouchEvent,iW=!window.L_NO_TOUCH&&(kR||Ss),nW=Ot&&se,gg=Ot&&be,DB=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,sC=function(){var m=!1;try{var J=Object.defineProperty({},"passive",{get:function(){m=!0}});window.addEventListener("testPassiveEventSupport",C,J),window.removeEventListener("testPassiveEventSupport",C,J)}catch{}return m}(),Hs=function(){return!!document.createElement("canvas").getContext}(),rC=!!(document.createElementNS&&fA("svg").createSVGRect),GB=!!rC&&function(){var m=document.createElement("div");return m.innerHTML="<svg/>",(m.firstChild&&m.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),mh=!rC&&function(){try{var m=document.createElement("div");m.innerHTML='<v:shape adj="1"/>';var J=m.firstChild;return J.style.behavior="url(#default#VML)",J&&typeof J.adj=="object"}catch{return!1}}(),lD=navigator.platform.indexOf("Mac")===0,oW=navigator.platform.indexOf("Linux")===0;function Rg(m){return navigator.userAgent.toLowerCase().indexOf(m)>=0}var he={ie:mA,ielt9:LA,edge:UA,webkit:ne,android:SA,android23:ae,androidStock:wA,opera:se,chrome:we,gecko:be,safari:Oe,phantom:VA,opera12:ZA,win:le,ie3d:ce,webkit3d:de,gecko3d:rt,any3d:en,mobile:Ot,mobileWebkit:og,mobileWebkit3d:Oa,msPointer:hh,pointer:Ss,touch:iW,touchNative:kR,mobileOpera:nW,mobileGecko:gg,retina:DB,passiveEvents:sC,canvas:Hs,svg:rC,vml:mh,inlineSvg:GB,mac:lD,linux:oW},vl=he.msPointer?"MSPointerDown":"pointerdown",Ll=he.msPointer?"MSPointerMove":"pointermove",df=he.msPointer?"MSPointerUp":"pointerup",Sl=he.msPointer?"MSPointerCancel":"pointercancel",kB={touchstart:vl,touchmove:Ll,touchend:df,touchcancel:Sl},hf={touchstart:CC,touchmove:Xr,touchend:Xr,touchcancel:Xr},Hl={},JR=!1;function JB(m,J,Z){return J==="touchstart"&&IC(),hf[J]?(Z=hf[J].bind(this,Z),m.addEventListener(kB[J],Z,!1),Z):(console.warn("wrong event specified:",J),C)}function Zs(m,J,Z){if(!kB[J]){console.warn("wrong event specified:",J);return}m.removeEventListener(kB[J],Z,!1)}function gW(m){Hl[m.pointerId]=m}function Ws(m){Hl[m.pointerId]&&(Hl[m.pointerId]=m)}function mf(m){delete Hl[m.pointerId]}function IC(){JR||(document.addEventListener(vl,gW,!0),document.addEventListener(Ll,Ws,!0),document.addEventListener(df,mf,!0),document.addEventListener(Sl,mf,!0),JR=!0)}function Xr(m,J){if(J.pointerType!==(J.MSPOINTER_TYPE_MOUSE||"mouse")){J.touches=[];for(var Z in Hl)J.touches.push(Hl[Z]);J.changedTouches=[J],m(J)}}function CC(m,J){J.MSPOINTER_TYPE_TOUCH&&J.pointerType===J.MSPOINTER_TYPE_TOUCH&&Ea(J),Xr(m,J)}function cD(m){var J={},Z,z;for(z in m)Z=m[z],J[z]=Z&&Z.bind?Z.bind(m):Z;return m=J,J.type="dblclick",J.detail=2,J.isTrusted=!1,J._simulated=!0,J}var la=200;function BD(m,J){m.addEventListener("dblclick",J);var Z=0,z;function AA(rA){if(rA.detail!==1){z=rA.detail;return}if(!(rA.pointerType==="mouse"||rA.sourceCapabilities&&!rA.sourceCapabilities.firesTouchEvents)){var BA=R0e(rA);if(!(BA.some(function(bA){return bA instanceof HTMLLabelElement&&bA.attributes.for})&&!BA.some(function(bA){return bA instanceof HTMLInputElement||bA instanceof HTMLSelectElement}))){var pA=Date.now();pA-Z<=la?(z++,z===2&&J(cD(rA))):z=1,Z=pA}}}return m.addEventListener("click",AA),{dblclick:J,simDblclick:AA}}function QD(m,J){m.removeEventListener("dblclick",J.dblclick),m.removeEventListener("click",J.simDblclick)}var ca=Mg(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),NB=Mg(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Zl=NB==="webkitTransition"||NB==="OTransition"?NB+"End":"transitionend";function OE(m){return typeof m=="string"?document.getElementById(m):m}function Ba(m,J){var Z=m.style[J]||m.currentStyle&&m.currentStyle[J];if((!Z||Z==="auto")&&document.defaultView){var z=document.defaultView.getComputedStyle(m,null);Z=z?z[J]:null}return Z==="auto"?null:Z}function Zt(m,J,Z){var z=document.createElement(m);return z.className=J||"",Z&&Z.appendChild(z),z}function tn(m){var J=m.parentNode;J&&J.removeChild(m)}function qE(m){for(;m.firstChild;)m.removeChild(m.firstChild)}function xg(m){var J=m.parentNode;J&&J.lastChild!==m&&J.appendChild(m)}function Fg(m){var J=m.parentNode;J&&J.firstChild!==m&&J.insertBefore(m,J.firstChild)}function Ks(m,J){if(m.classList!==void 0)return m.classList.contains(J);var Z=kt(m);return Z.length>0&&new RegExp("(^|\\s)"+J+"(\\s|$)").test(Z)}function Se(m,J){if(m.classList!==void 0)for(var Z=B(J),z=0,AA=Z.length;z<AA;z++)m.classList.add(Z[z]);else if(!Ks(m,J)){var rA=kt(m);ED(m,(rA?rA+" ":"")+J)}}function Mt(m,J){m.classList!==void 0?m.classList.remove(J):ED(m,c((" "+kt(m)+" ").replace(" "+J+" "," ")))}function ED(m,J){m.className.baseVal===void 0?m.className=J:m.className.baseVal=J}function kt(m){return m.correspondingElement&&(m=m.correspondingElement),m.className.baseVal===void 0?m.className:m.className.baseVal}function We(m,J){"opacity"in m.style?m.style.opacity=J:"filter"in m.style&&uD(m,J)}function uD(m,J){var Z=!1,z="DXImageTransform.Microsoft.Alpha";try{Z=m.filters.item(z)}catch{if(J===1)return}J=Math.round(J*100),Z?(Z.Enabled=J!==100,Z.Opacity=J):m.style.filter+=" progid:"+z+"(opacity="+J+")"}function Mg(m){for(var J=document.documentElement.style,Z=0;Z<m.length;Z++)if(m[Z]in J)return m[Z];return!1}function Us(m,J,Z){var z=J||new _(0,0);m.style[ca]=(he.ie3d?"translate("+z.x+"px,"+z.y+"px)":"translate3d("+z.x+"px,"+z.y+"px,0)")+(Z?" scale("+Z+")":"")}function Wt(m,J){m._leaflet_pos=J,he.any3d?Us(m,J):(m.style.left=J.x+"px",m.style.top=J.y+"px")}function Vs(m){return m._leaflet_pos||new _(0,0)}var YB,ko,RB;if("onselectstart"in document)YB=function(){Ke(window,"selectstart",Ea)},ko=function(){En(window,"selectstart",Ea)};else{var lC=Mg(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);YB=function(){if(lC){var m=document.documentElement.style;RB=m[lC],m[lC]="none"}},ko=function(){lC&&(document.documentElement.style[lC]=RB,RB=void 0)}}function ph(){Ke(window,"dragstart",Ea)}function xB(){En(window,"dragstart",Ea)}var jE,FB;function fh(m){for(;m.tabIndex===-1;)m=m.parentNode;m.style&&(Wl(),jE=m,FB=m.style.outlineStyle,m.style.outlineStyle="none",Ke(window,"keydown",Wl))}function Wl(){jE&&(jE.style.outlineStyle=FB,jE=void 0,FB=void 0,En(window,"keydown",Wl))}function pf(m){do m=m.parentNode;while((!m.offsetWidth||!m.offsetHeight)&&m!==document.body);return m}function Qa(m){var J=m.getBoundingClientRect();return{x:J.width/m.offsetWidth||1,y:J.height/m.offsetHeight||1,boundingClientRect:J}}var Rn={__proto__:null,TRANSFORM:ca,TRANSITION:NB,TRANSITION_END:Zl,get:OE,getStyle:Ba,create:Zt,remove:tn,empty:qE,toFront:xg,toBack:Fg,hasClass:Ks,addClass:Se,removeClass:Mt,setClass:ED,getClass:kt,setOpacity:We,testProp:Mg,setTransform:Us,setPosition:Wt,getPosition:Vs,get disableTextSelection(){return YB},get enableTextSelection(){return ko},disableImageDrag:ph,enableImageDrag:xB,preventOutline:fh,restoreOutline:Wl,getSizedParentNode:pf,getScale:Qa};function Ke(m,J,Z,z){if(J&&typeof J=="object")for(var AA in J)XyA(m,AA,J[AA],Z);else{J=B(J);for(var rA=0,BA=J.length;rA<BA;rA++)XyA(m,J[rA],Z,z)}return this}var PE="_leaflet_events";function En(m,J,Z,z){if(arguments.length===1)Y0e(m),delete m[PE];else if(J&&typeof J=="object")for(var AA in J)zyA(m,AA,J[AA],Z);else if(J=B(J),arguments.length===2)Y0e(m,function(pA){return y(J,pA)!==-1});else for(var rA=0,BA=J.length;rA<BA;rA++)zyA(m,J[rA],Z,z);return this}function Y0e(m,J){for(var Z in m[PE]){var z=Z.split(/\d/)[0];(!J||J(z))&&zyA(m,z,null,null,Z)}}var VyA={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function XyA(m,J,Z,z){var AA=J+s(Z)+(z?"_"+s(z):"");if(m[PE]&&m[PE][AA])return this;var rA=function(pA){return Z.call(z||m,pA||window.event)},BA=rA;!he.touchNative&&he.pointer&&J.indexOf("touch")===0?rA=JB(m,J,rA):he.touch&&J==="dblclick"?rA=BD(m,rA):"addEventListener"in m?J==="touchstart"||J==="touchmove"||J==="wheel"||J==="mousewheel"?m.addEventListener(VyA[J]||J,rA,he.passiveEvents?{passive:!1}:!1):J==="mouseenter"||J==="mouseleave"?(rA=function(pA){pA=pA||window.event,_yA(m,pA)&&BA(pA)},m.addEventListener(VyA[J],rA,!1)):m.addEventListener(J,BA,!1):m.attachEvent("on"+J,rA),m[PE]=m[PE]||{},m[PE][AA]=rA}function zyA(m,J,Z,z,AA){AA=AA||J+s(Z)+(z?"_"+s(z):"");var rA=m[PE]&&m[PE][AA];if(!rA)return this;!he.touchNative&&he.pointer&&J.indexOf("touch")===0?Zs(m,J,rA):he.touch&&J==="dblclick"?QD(m,rA):"removeEventListener"in m?m.removeEventListener(VyA[J]||J,rA,!1):m.detachEvent("on"+J,rA),m[PE][AA]=null}function dD(m){return m.stopPropagation?m.stopPropagation():m.originalEvent?m.originalEvent._stopped=!0:m.cancelBubble=!0,this}function TyA(m){return XyA(m,"wheel",dD),this}function aW(m){return Ke(m,"mousedown touchstart dblclick contextmenu",dD),m._leaflet_disable_click=!0,this}function Ea(m){return m.preventDefault?m.preventDefault():m.returnValue=!1,this}function hD(m){return Ea(m),dD(m),this}function R0e(m){if(m.composedPath)return m.composedPath();for(var J=[],Z=m.target;Z;)J.push(Z),Z=Z.parentNode;return J}function x0e(m,J){if(!J)return new _(m.clientX,m.clientY);var Z=Qa(J),z=Z.boundingClientRect;return new _((m.clientX-z.left)/Z.x-J.clientLeft,(m.clientY-z.top)/Z.y-J.clientTop)}var Mmi=he.linux&&he.chrome?window.devicePixelRatio:he.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function F0e(m){return he.edge?m.wheelDeltaY/2:m.deltaY&&m.deltaMode===0?-m.deltaY/Mmi:m.deltaY&&m.deltaMode===1?-m.deltaY*20:m.deltaY&&m.deltaMode===2?-m.deltaY*60:m.deltaX||m.deltaZ?0:m.wheelDelta?(m.wheelDeltaY||m.wheelDelta)/2:m.detail&&Math.abs(m.detail)<32765?-m.detail*20:m.detail?m.detail/-32765*60:0}function _yA(m,J){var Z=J.relatedTarget;if(!Z)return!0;try{for(;Z&&Z!==m;)Z=Z.parentNode}catch{return!1}return Z!==m}var vmi={__proto__:null,on:Ke,off:En,stopPropagation:dD,disableScrollPropagation:TyA,disableClickPropagation:aW,preventDefault:Ea,stop:hD,getPropagationPath:R0e,getMousePosition:x0e,getWheelDelta:F0e,isExternalTarget:_yA,addListener:Ke,removeListener:En},M0e=X.extend({run:function(m,J,Z,z){this.stop(),this._el=m,this._inProgress=!0,this._duration=Z||.25,this._easeOutPower=1/Math.max(z||.5,.2),this._startPos=Vs(m),this._offset=J.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=h(this._animate,this),this._step()},_step:function(m){var J=+new Date-this._startTime,Z=this._duration*1e3;J<Z?this._runFrame(this._easeOut(J/Z),m):(this._runFrame(1),this._complete())},_runFrame:function(m,J){var Z=this._startPos.add(this._offset.multiplyBy(m));J&&Z._round(),Wt(this._el,Z),this.fire("step")},_complete:function(){N(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(m){return 1-Math.pow(1-m,this._easeOutPower)}}),$t=X.extend({options:{crs:QA,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(m,J){J=E(this,J),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(m),this._initLayout(),this._onResize=g(this._onResize,this),this._initEvents(),J.maxBounds&&this.setMaxBounds(J.maxBounds),J.zoom!==void 0&&(this._zoom=this._limitZoom(J.zoom)),J.center&&J.zoom!==void 0&&this.setView(tA(J.center),J.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=NB&&he.any3d&&!he.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ke(this._proxy,Zl,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(m,J,Z){if(J=J===void 0?this._zoom:this._limitZoom(J),m=this._limitCenter(tA(m),J,this.options.maxBounds),Z=Z||{},this._stop(),this._loaded&&!Z.reset&&Z!==!0){Z.animate!==void 0&&(Z.zoom=n({animate:Z.animate},Z.zoom),Z.pan=n({animate:Z.animate,duration:Z.duration},Z.pan));var z=this._zoom!==J?this._tryAnimatedZoom&&this._tryAnimatedZoom(m,J,Z.zoom):this._tryAnimatedPan(m,Z.pan);if(z)return clearTimeout(this._sizeTimer),this}return this._resetView(m,J,Z.pan&&Z.pan.noMoveStart),this},setZoom:function(m,J){return this._loaded?this.setView(this.getCenter(),m,{zoom:J}):(this._zoom=m,this)},zoomIn:function(m,J){return m=m||(he.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+m,J)},zoomOut:function(m,J){return m=m||(he.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-m,J)},setZoomAround:function(m,J,Z){var z=this.getZoomScale(J),AA=this.getSize().divideBy(2),rA=m instanceof _?m:this.latLngToContainerPoint(m),BA=rA.subtract(AA).multiplyBy(1-1/z),pA=this.containerPointToLatLng(AA.add(BA));return this.setView(pA,J,{zoom:Z})},_getBoundsCenterZoom:function(m,J){J=J||{},m=m.getBounds?m.getBounds():eA(m);var Z=$(J.paddingTopLeft||J.padding||[0,0]),z=$(J.paddingBottomRight||J.padding||[0,0]),AA=this.getBoundsZoom(m,!1,Z.add(z));if(AA=typeof J.maxZoom=="number"?Math.min(J.maxZoom,AA):AA,AA===1/0)return{center:m.getCenter(),zoom:AA};var rA=z.subtract(Z).divideBy(2),BA=this.project(m.getSouthWest(),AA),pA=this.project(m.getNorthEast(),AA),bA=this.unproject(BA.add(pA).divideBy(2).add(rA),AA);return{center:bA,zoom:AA}},fitBounds:function(m,J){if(m=eA(m),!m.isValid())throw new Error("Bounds are not valid.");var Z=this._getBoundsCenterZoom(m,J);return this.setView(Z.center,Z.zoom,J)},fitWorld:function(m){return this.fitBounds([[-90,-180],[90,180]],m)},panTo:function(m,J){return this.setView(m,this._zoom,{pan:J})},panBy:function(m,J){if(m=$(m).round(),J=J||{},!m.x&&!m.y)return this.fire("moveend");if(J.animate!==!0&&!this.getSize().contains(m))return this._resetView(this.unproject(this.project(this.getCenter()).add(m)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new M0e,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),J.noMoveStart||this.fire("movestart"),J.animate!==!1){Se(this._mapPane,"leaflet-pan-anim");var Z=this._getMapPanePos().subtract(m).round();this._panAnim.run(this._mapPane,Z,J.duration||.25,J.easeLinearity)}else this._rawPanBy(m),this.fire("move").fire("moveend");return this},flyTo:function(m,J,Z){if(Z=Z||{},Z.animate===!1||!he.any3d)return this.setView(m,J,Z);this._stop();var z=this.project(this.getCenter()),AA=this.project(m),rA=this.getSize(),BA=this._zoom;m=tA(m),J=J===void 0?BA:J;var pA=Math.max(rA.x,rA.y),bA=pA*this.getZoomScale(BA,J),HA=AA.distanceTo(z)||1,Ie=1.42,He=Ie*Ie;function Jt(Ko){var BP=Ko?-1:1,bpi=Ko?bA:pA,wpi=bA*bA-pA*pA+BP*He*He*HA*HA,Dpi=2*bpi*He*HA,obA=wpi/Dpi,Qfe=Math.sqrt(obA*obA+1)-obA,Gpi=Qfe<1e-9?-18:Math.log(Qfe);return Gpi}function Xs(Ko){return(Math.exp(Ko)-Math.exp(-Ko))/2}function vg(Ko){return(Math.exp(Ko)+Math.exp(-Ko))/2}function Ul(Ko){return Xs(Ko)/vg(Ko)}var zr=Jt(0);function MR(Ko){return pA*(vg(zr)/vg(zr+Ie*Ko))}function mpi(Ko){return pA*(vg(zr)*Ul(zr+Ie*Ko)-Xs(zr))/He}function ppi(Ko){return 1-Math.pow(1-Ko,1.5)}var fpi=Date.now(),cfe=(Jt(1)-zr)/Ie,ypi=Z.duration?1e3*Z.duration:1e3*cfe*.8;function Bfe(){var Ko=(Date.now()-fpi)/ypi,BP=ppi(Ko)*cfe;Ko<=1?(this._flyToFrame=h(Bfe,this),this._move(this.unproject(z.add(AA.subtract(z).multiplyBy(mpi(BP)/HA)),BA),this.getScaleZoom(pA/MR(BP),BA),{flyTo:!0})):this._move(m,J)._moveEnd(!0)}return this._moveStart(!0,Z.noMoveStart),Bfe.call(this),this},flyToBounds:function(m,J){var Z=this._getBoundsCenterZoom(m,J);return this.flyTo(Z.center,Z.zoom,J)},setMaxBounds:function(m){return m=eA(m),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),m.isValid()?(this.options.maxBounds=m,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(m){var J=this.options.minZoom;return this.options.minZoom=m,this._loaded&&J!==m&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(m):this},setMaxZoom:function(m){var J=this.options.maxZoom;return this.options.maxZoom=m,this._loaded&&J!==m&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(m):this},panInsideBounds:function(m,J){this._enforcingBounds=!0;var Z=this.getCenter(),z=this._limitCenter(Z,this._zoom,eA(m));return Z.equals(z)||this.panTo(z,J),this._enforcingBounds=!1,this},panInside:function(m,J){J=J||{};var Z=$(J.paddingTopLeft||J.padding||[0,0]),z=$(J.paddingBottomRight||J.padding||[0,0]),AA=this.project(this.getCenter()),rA=this.project(m),BA=this.getPixelBounds(),pA=j([BA.min.add(Z),BA.max.subtract(z)]),bA=pA.getSize();if(!pA.contains(rA)){this._enforcingBounds=!0;var HA=rA.subtract(pA.getCenter()),Ie=pA.extend(rA).getSize().subtract(bA);AA.x+=HA.x<0?-Ie.x:Ie.x,AA.y+=HA.y<0?-Ie.y:Ie.y,this.panTo(this.unproject(AA),J),this._enforcingBounds=!1}return this},invalidateSize:function(m){if(!this._loaded)return this;m=n({animate:!1,pan:!0},m===!0?{animate:!0}:m);var J=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var Z=this.getSize(),z=J.divideBy(2).round(),AA=Z.divideBy(2).round(),rA=z.subtract(AA);return!rA.x&&!rA.y?this:(m.animate&&m.pan?this.panBy(rA):(m.pan&&this._rawPanBy(rA),this.fire("move"),m.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(g(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:J,newSize:Z}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(m){if(m=this._locateOptions=n({timeout:1e4,watch:!1},m),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var J=g(this._handleGeolocationResponse,this),Z=g(this._handleGeolocationError,this);return m.watch?this._locationWatchId=navigator.geolocation.watchPosition(J,Z,m):navigator.geolocation.getCurrentPosition(J,Z,m),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(m){if(this._container._leaflet_id){var J=m.code,Z=m.message||(J===1?"permission denied":J===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:J,message:"Geolocation error: "+Z+"."})}},_handleGeolocationResponse:function(m){if(this._container._leaflet_id){var J=m.coords.latitude,Z=m.coords.longitude,z=new oA(J,Z),AA=z.toBounds(m.coords.accuracy*2),rA=this._locateOptions;if(rA.setView){var BA=this.getBoundsZoom(AA);this.setView(z,rA.maxZoom?Math.min(BA,rA.maxZoom):BA)}var pA={latlng:z,bounds:AA,timestamp:m.timestamp};for(var bA in m.coords)typeof m.coords[bA]=="number"&&(pA[bA]=m.coords[bA]);this.fire("locationfound",pA)}},addHandler:function(m,J){if(!J)return this;var Z=this[m]=new J(this);return this._handlers.push(Z),this.options[m]&&Z.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),tn(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(N(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var m;for(m in this._layers)this._layers[m].remove();for(m in this._panes)tn(this._panes[m]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(m,J){var Z="leaflet-pane"+(m?" leaflet-"+m.replace("Pane","")+"-pane":""),z=Zt("div",Z,J||this._mapPane);return m&&(this._panes[m]=z),z},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var m=this.getPixelBounds(),J=this.unproject(m.getBottomLeft()),Z=this.unproject(m.getTopRight());return new O(J,Z)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(m,J,Z){m=eA(m),Z=$(Z||[0,0]);var z=this.getZoom()||0,AA=this.getMinZoom(),rA=this.getMaxZoom(),BA=m.getNorthWest(),pA=m.getSouthEast(),bA=this.getSize().subtract(Z),HA=j(this.project(pA,z),this.project(BA,z)).getSize(),Ie=he.any3d?this.options.zoomSnap:1,He=bA.x/HA.x,Jt=bA.y/HA.y,Xs=J?Math.max(He,Jt):Math.min(He,Jt);return z=this.getScaleZoom(Xs,z),Ie&&(z=Math.round(z/(Ie/100))*(Ie/100),z=J?Math.ceil(z/Ie)*Ie:Math.floor(z/Ie)*Ie),Math.max(AA,Math.min(rA,z))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new _(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(m,J){var Z=this._getTopLeftPoint(m,J);return new nA(Z,Z.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(m){return this.options.crs.getProjectedBounds(m===void 0?this.getZoom():m)},getPane:function(m){return typeof m=="string"?this._panes[m]:m},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(m,J){var Z=this.options.crs;return J=J===void 0?this._zoom:J,Z.scale(m)/Z.scale(J)},getScaleZoom:function(m,J){var Z=this.options.crs;J=J===void 0?this._zoom:J;var z=Z.zoom(m*Z.scale(J));return isNaN(z)?1/0:z},project:function(m,J){return J=J===void 0?this._zoom:J,this.options.crs.latLngToPoint(tA(m),J)},unproject:function(m,J){return J=J===void 0?this._zoom:J,this.options.crs.pointToLatLng($(m),J)},layerPointToLatLng:function(m){var J=$(m).add(this.getPixelOrigin());return this.unproject(J)},latLngToLayerPoint:function(m){var J=this.project(tA(m))._round();return J._subtract(this.getPixelOrigin())},wrapLatLng:function(m){return this.options.crs.wrapLatLng(tA(m))},wrapLatLngBounds:function(m){return this.options.crs.wrapLatLngBounds(eA(m))},distance:function(m,J){return this.options.crs.distance(tA(m),tA(J))},containerPointToLayerPoint:function(m){return $(m).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(m){return $(m).add(this._getMapPanePos())},containerPointToLatLng:function(m){var J=this.containerPointToLayerPoint($(m));return this.layerPointToLatLng(J)},latLngToContainerPoint:function(m){return this.layerPointToContainerPoint(this.latLngToLayerPoint(tA(m)))},mouseEventToContainerPoint:function(m){return x0e(m,this._container)},mouseEventToLayerPoint:function(m){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(m))},mouseEventToLatLng:function(m){return this.layerPointToLatLng(this.mouseEventToLayerPoint(m))},_initContainer:function(m){var J=this._container=OE(m);if(J){if(J._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ke(J,"scroll",this._onScroll,this),this._containerId=s(J)},_initLayout:function(){var m=this._container;this._fadeAnimated=this.options.fadeAnimation&&he.any3d,Se(m,"leaflet-container"+(he.touch?" leaflet-touch":"")+(he.retina?" leaflet-retina":"")+(he.ielt9?" leaflet-oldie":"")+(he.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var J=Ba(m,"position");J!=="absolute"&&J!=="relative"&&J!=="fixed"&&J!=="sticky"&&(m.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var m=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Wt(this._mapPane,new _(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Se(m.markerPane,"leaflet-zoom-hide"),Se(m.shadowPane,"leaflet-zoom-hide"))},_resetView:function(m,J,Z){Wt(this._mapPane,new _(0,0));var z=!this._loaded;this._loaded=!0,J=this._limitZoom(J),this.fire("viewprereset");var AA=this._zoom!==J;this._moveStart(AA,Z)._move(m,J)._moveEnd(AA),this.fire("viewreset"),z&&this.fire("load")},_moveStart:function(m,J){return m&&this.fire("zoomstart"),J||this.fire("movestart"),this},_move:function(m,J,Z,z){J===void 0&&(J=this._zoom);var AA=this._zoom!==J;return this._zoom=J,this._lastCenter=m,this._pixelOrigin=this._getNewPixelOrigin(m),z?Z&&Z.pinch&&this.fire("zoom",Z):((AA||Z&&Z.pinch)&&this.fire("zoom",Z),this.fire("move",Z)),this},_moveEnd:function(m){return m&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return N(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(m){Wt(this._mapPane,this._getMapPanePos().subtract(m))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(m){this._targets={},this._targets[s(this._container)]=this;var J=m?En:Ke;J(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&J(window,"resize",this._onResize,this),he.any3d&&this.options.transform3DLimit&&(m?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){N(this._resizeRequest),this._resizeRequest=h(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var m=this._getMapPanePos();Math.max(Math.abs(m.x),Math.abs(m.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(m,J){for(var Z=[],z,AA=J==="mouseout"||J==="mouseover",rA=m.target||m.srcElement,BA=!1;rA;){if(z=this._targets[s(rA)],z&&(J==="click"||J==="preclick")&&this._draggableMoved(z)){BA=!0;break}if(z&&z.listens(J,!0)&&(AA&&!_yA(rA,m)||(Z.push(z),AA))||rA===this._container)break;rA=rA.parentNode}return!Z.length&&!BA&&!AA&&this.listens(J,!0)&&(Z=[this]),Z},_isClickDisabled:function(m){for(;m&&m!==this._container;){if(m._leaflet_disable_click)return!0;m=m.parentNode}},_handleDOMEvent:function(m){var J=m.target||m.srcElement;if(!(!this._loaded||J._leaflet_disable_events||m.type==="click"&&this._isClickDisabled(J))){var Z=m.type;Z==="mousedown"&&fh(J),this._fireDOMEvent(m,Z)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(m,J,Z){if(m.type==="click"){var z=n({},m);z.type="preclick",this._fireDOMEvent(z,z.type,Z)}var AA=this._findEventTargets(m,J);if(Z){for(var rA=[],BA=0;BA<Z.length;BA++)Z[BA].listens(J,!0)&&rA.push(Z[BA]);AA=rA.concat(AA)}if(AA.length){J==="contextmenu"&&Ea(m);var pA=AA[0],bA={originalEvent:m};if(m.type!=="keypress"&&m.type!=="keydown"&&m.type!=="keyup"){var HA=pA.getLatLng&&(!pA._radius||pA._radius<=10);bA.containerPoint=HA?this.latLngToContainerPoint(pA.getLatLng()):this.mouseEventToContainerPoint(m),bA.layerPoint=this.containerPointToLayerPoint(bA.containerPoint),bA.latlng=HA?pA.getLatLng():this.layerPointToLatLng(bA.layerPoint)}for(BA=0;BA<AA.length;BA++)if(AA[BA].fire(J,bA,!0),bA.originalEvent._stopped||AA[BA].options.bubblingMouseEvents===!1&&y(this._mouseEvents,J)!==-1)return}},_draggableMoved:function(m){return m=m.dragging&&m.dragging.enabled()?m:this,m.dragging&&m.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var m=0,J=this._handlers.length;m<J;m++)this._handlers[m].disable()},whenReady:function(m,J){return this._loaded?m.call(J||this,{target:this}):this.on("load",m,J),this},_getMapPanePos:function(){return Vs(this._mapPane)||new _(0,0)},_moved:function(){var m=this._getMapPanePos();return m&&!m.equals([0,0])},_getTopLeftPoint:function(m,J){var Z=m&&J!==void 0?this._getNewPixelOrigin(m,J):this.getPixelOrigin();return Z.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(m,J){var Z=this.getSize()._divideBy(2);return this.project(m,J)._subtract(Z)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(m,J,Z){var z=this._getNewPixelOrigin(Z,J);return this.project(m,J)._subtract(z)},_latLngBoundsToNewLayerBounds:function(m,J,Z){var z=this._getNewPixelOrigin(Z,J);return j([this.project(m.getSouthWest(),J)._subtract(z),this.project(m.getNorthWest(),J)._subtract(z),this.project(m.getSouthEast(),J)._subtract(z),this.project(m.getNorthEast(),J)._subtract(z)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(m){return this.latLngToLayerPoint(m).subtract(this._getCenterLayerPoint())},_limitCenter:function(m,J,Z){if(!Z)return m;var z=this.project(m,J),AA=this.getSize().divideBy(2),rA=new nA(z.subtract(AA),z.add(AA)),BA=this._getBoundsOffset(rA,Z,J);return Math.abs(BA.x)<=1&&Math.abs(BA.y)<=1?m:this.unproject(z.add(BA),J)},_limitOffset:function(m,J){if(!J)return m;var Z=this.getPixelBounds(),z=new nA(Z.min.add(m),Z.max.add(m));return m.add(this._getBoundsOffset(z,J))},_getBoundsOffset:function(m,J,Z){var z=j(this.project(J.getNorthEast(),Z),this.project(J.getSouthWest(),Z)),AA=z.min.subtract(m.min),rA=z.max.subtract(m.max),BA=this._rebound(AA.x,-rA.x),pA=this._rebound(AA.y,-rA.y);return new _(BA,pA)},_rebound:function(m,J){return m+J>0?Math.round(m-J)/2:Math.max(0,Math.ceil(m))-Math.max(0,Math.floor(J))},_limitZoom:function(m){var J=this.getMinZoom(),Z=this.getMaxZoom(),z=he.any3d?this.options.zoomSnap:1;return z&&(m=Math.round(m/z)*z),Math.max(J,Math.min(Z,m))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Mt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(m,J){var Z=this._getCenterOffset(m)._trunc();return(J&&J.animate)!==!0&&!this.getSize().contains(Z)?!1:(this.panBy(Z,J),!0)},_createAnimProxy:function(){var m=this._proxy=Zt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(m),this.on("zoomanim",function(J){var Z=ca,z=this._proxy.style[Z];Us(this._proxy,this.project(J.center,J.zoom),this.getZoomScale(J.zoom,1)),z===this._proxy.style[Z]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){tn(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var m=this.getCenter(),J=this.getZoom();Us(this._proxy,this.project(m,J),this.getZoomScale(J,1))},_catchTransitionEnd:function(m){this._animatingZoom&&m.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(m,J,Z){if(this._animatingZoom)return!0;if(Z=Z||{},!this._zoomAnimated||Z.animate===!1||this._nothingToAnimate()||Math.abs(J-this._zoom)>this.options.zoomAnimationThreshold)return!1;var z=this.getZoomScale(J),AA=this._getCenterOffset(m)._divideBy(1-1/z);return Z.animate!==!0&&!this.getSize().contains(AA)?!1:(h(function(){this._moveStart(!0,Z.noMoveStart||!1)._animateZoom(m,J,!0)},this),!0)},_animateZoom:function(m,J,Z,z){this._mapPane&&(Z&&(this._animatingZoom=!0,this._animateToCenter=m,this._animateToZoom=J,Se(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:m,zoom:J,noUpdate:z}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(g(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Mt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Lmi(m,J){return new $t(m,J)}var MB=K.extend({options:{position:"topright"},initialize:function(m){E(this,m)},getPosition:function(){return this.options.position},setPosition:function(m){var J=this._map;return J&&J.removeControl(this),this.options.position=m,J&&J.addControl(this),this},getContainer:function(){return this._container},addTo:function(m){this.remove(),this._map=m;var J=this._container=this.onAdd(m),Z=this.getPosition(),z=m._controlCorners[Z];return Se(J,"leaflet-control"),Z.indexOf("bottom")!==-1?z.insertBefore(J,z.firstChild):z.appendChild(J),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(tn(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(m){this._map&&m&&m.screenX>0&&m.screenY>0&&this._map.getContainer().focus()}}),sW=function(m){return new MB(m)};$t.include({addControl:function(m){return m.addTo(this),this},removeControl:function(m){return m.remove(),this},_initControlPos:function(){var m=this._controlCorners={},J="leaflet-",Z=this._controlContainer=Zt("div",J+"control-container",this._container);function z(AA,rA){var BA=J+AA+" "+J+rA;m[AA+rA]=Zt("div",BA,Z)}z("top","left"),z("top","right"),z("bottom","left"),z("bottom","right")},_clearControlPos:function(){for(var m in this._controlCorners)tn(this._controlCorners[m]);tn(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var v0e=MB.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(m,J,Z,z){return Z<z?-1:z<Z?1:0}},initialize:function(m,J,Z){E(this,Z),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var z in m)this._addLayer(m[z],z);for(z in J)this._addLayer(J[z],z,!0)},onAdd:function(m){this._initLayout(),this._update(),this._map=m,m.on("zoomend",this._checkDisabledLayers,this);for(var J=0;J<this._layers.length;J++)this._layers[J].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(m){return MB.prototype.addTo.call(this,m),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var m=0;m<this._layers.length;m++)this._layers[m].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(m,J){return this._addLayer(m,J),this._map?this._update():this},addOverlay:function(m,J){return this._addLayer(m,J,!0),this._map?this._update():this},removeLayer:function(m){m.off("add remove",this._onLayerChange,this);var J=this._getLayer(s(m));return J&&this._layers.splice(this._layers.indexOf(J),1),this._map?this._update():this},expand:function(){Se(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var m=this._map.getSize().y-(this._container.offsetTop+50);return m<this._section.clientHeight?(Se(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=m+"px"):Mt(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Mt(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var m="leaflet-control-layers",J=this._container=Zt("div",m),Z=this.options.collapsed;J.setAttribute("aria-haspopup",!0),aW(J),TyA(J);var z=this._section=Zt("section",m+"-list");Z&&(this._map.on("click",this.collapse,this),Ke(J,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var AA=this._layersLink=Zt("a",m+"-toggle",J);AA.href="#",AA.title="Layers",AA.setAttribute("role","button"),Ke(AA,{keydown:function(rA){rA.keyCode===13&&this._expandSafely()},click:function(rA){Ea(rA),this._expandSafely()}},this),Z||this.expand(),this._baseLayersList=Zt("div",m+"-base",z),this._separator=Zt("div",m+"-separator",z),this._overlaysList=Zt("div",m+"-overlays",z),J.appendChild(z)},_getLayer:function(m){for(var J=0;J<this._layers.length;J++)if(this._layers[J]&&s(this._layers[J].layer)===m)return this._layers[J]},_addLayer:function(m,J,Z){this._map&&m.on("add remove",this._onLayerChange,this),this._layers.push({layer:m,name:J,overlay:Z}),this.options.sortLayers&&this._layers.sort(g(function(z,AA){return this.options.sortFunction(z.layer,AA.layer,z.name,AA.name)},this)),this.options.autoZIndex&&m.setZIndex&&(this._lastZIndex++,m.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;qE(this._baseLayersList),qE(this._overlaysList),this._layerControlInputs=[];var m,J,Z,z,AA=0;for(Z=0;Z<this._layers.length;Z++)z=this._layers[Z],this._addItem(z),J=J||z.overlay,m=m||!z.overlay,AA+=z.overlay?0:1;return this.options.hideSingleBase&&(m=m&&AA>1,this._baseLayersList.style.display=m?"":"none"),this._separator.style.display=J&&m?"":"none",this},_onLayerChange:function(m){this._handlingClick||this._update();var J=this._getLayer(s(m.target)),Z=J.overlay?m.type==="add"?"overlayadd":"overlayremove":m.type==="add"?"baselayerchange":null;Z&&this._map.fire(Z,J)},_createRadioElement:function(m,J){var Z='<input type="radio" class="leaflet-control-layers-selector" name="'+m+'"'+(J?' checked="checked"':"")+"/>",z=document.createElement("div");return z.innerHTML=Z,z.firstChild},_addItem:function(m){var J=document.createElement("label"),Z=this._map.hasLayer(m.layer),z;m.overlay?(z=document.createElement("input"),z.type="checkbox",z.className="leaflet-control-layers-selector",z.defaultChecked=Z):z=this._createRadioElement("leaflet-base-layers_"+s(this),Z),this._layerControlInputs.push(z),z.layerId=s(m.layer),Ke(z,"click",this._onInputClick,this);var AA=document.createElement("span");AA.innerHTML=" "+m.name;var rA=document.createElement("span");J.appendChild(rA),rA.appendChild(z),rA.appendChild(AA);var BA=m.overlay?this._overlaysList:this._baseLayersList;return BA.appendChild(J),this._checkDisabledLayers(),J},_onInputClick:function(){if(!this._preventClick){var m=this._layerControlInputs,J,Z,z=[],AA=[];this._handlingClick=!0;for(var rA=m.length-1;rA>=0;rA--)J=m[rA],Z=this._getLayer(J.layerId).layer,J.checked?z.push(Z):J.checked||AA.push(Z);for(rA=0;rA<AA.length;rA++)this._map.hasLayer(AA[rA])&&this._map.removeLayer(AA[rA]);for(rA=0;rA<z.length;rA++)this._map.hasLayer(z[rA])||this._map.addLayer(z[rA]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var m=this._layerControlInputs,J,Z,z=this._map.getZoom(),AA=m.length-1;AA>=0;AA--)J=m[AA],Z=this._getLayer(J.layerId).layer,J.disabled=Z.options.minZoom!==void 0&&z<Z.options.minZoom||Z.options.maxZoom!==void 0&&z>Z.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var m=this._section;this._preventClick=!0,Ke(m,"click",Ea),this.expand();var J=this;setTimeout(function(){En(m,"click",Ea),J._preventClick=!1})}}),Smi=function(m,J,Z){return new v0e(m,J,Z)},OyA=MB.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(m){var J="leaflet-control-zoom",Z=Zt("div",J+" leaflet-bar"),z=this.options;return this._zoomInButton=this._createButton(z.zoomInText,z.zoomInTitle,J+"-in",Z,this._zoomIn),this._zoomOutButton=this._createButton(z.zoomOutText,z.zoomOutTitle,J+"-out",Z,this._zoomOut),this._updateDisabled(),m.on("zoomend zoomlevelschange",this._updateDisabled,this),Z},onRemove:function(m){m.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(m){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(m.shiftKey?3:1))},_zoomOut:function(m){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(m.shiftKey?3:1))},_createButton:function(m,J,Z,z,AA){var rA=Zt("a",Z,z);return rA.innerHTML=m,rA.href="#",rA.title=J,rA.setAttribute("role","button"),rA.setAttribute("aria-label",J),aW(rA),Ke(rA,"click",hD),Ke(rA,"click",AA,this),Ke(rA,"click",this._refocusOnMap,this),rA},_updateDisabled:function(){var m=this._map,J="leaflet-disabled";Mt(this._zoomInButton,J),Mt(this._zoomOutButton,J),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||m._zoom===m.getMinZoom())&&(Se(this._zoomOutButton,J),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||m._zoom===m.getMaxZoom())&&(Se(this._zoomInButton,J),this._zoomInButton.setAttribute("aria-disabled","true"))}});$t.mergeOptions({zoomControl:!0}),$t.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new OyA,this.addControl(this.zoomControl))});var Hmi=function(m){return new OyA(m)},L0e=MB.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(m){var J="leaflet-control-scale",Z=Zt("div",J),z=this.options;return this._addScales(z,J+"-line",Z),m.on(z.updateWhenIdle?"moveend":"move",this._update,this),m.whenReady(this._update,this),Z},onRemove:function(m){m.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(m,J,Z){m.metric&&(this._mScale=Zt("div",J,Z)),m.imperial&&(this._iScale=Zt("div",J,Z))},_update:function(){var m=this._map,J=m.getSize().y/2,Z=m.distance(m.containerPointToLatLng([0,J]),m.containerPointToLatLng([this.options.maxWidth,J]));this._updateScales(Z)},_updateScales:function(m){this.options.metric&&m&&this._updateMetric(m),this.options.imperial&&m&&this._updateImperial(m)},_updateMetric:function(m){var J=this._getRoundNum(m),Z=J<1e3?J+" m":J/1e3+" km";this._updateScale(this._mScale,Z,J/m)},_updateImperial:function(m){var J=m*3.2808399,Z,z,AA;J>5280?(Z=J/5280,z=this._getRoundNum(Z),this._updateScale(this._iScale,z+" mi",z/Z)):(AA=this._getRoundNum(J),this._updateScale(this._iScale,AA+" ft",AA/J))},_updateScale:function(m,J,Z){m.style.width=Math.round(this.options.maxWidth*Z)+"px",m.innerHTML=J},_getRoundNum:function(m){var J=Math.pow(10,(Math.floor(m)+"").length-1),Z=m/J;return Z=Z>=10?10:Z>=5?5:Z>=3?3:Z>=2?2:1,J*Z}}),Zmi=function(m){return new L0e(m)},Wmi='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',qyA=MB.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(he.inlineSvg?Wmi+" ":"")+"Leaflet</a>"},initialize:function(m){E(this,m),this._attributions={}},onAdd:function(m){m.attributionControl=this,this._container=Zt("div","leaflet-control-attribution"),aW(this._container);for(var J in m._layers)m._layers[J].getAttribution&&this.addAttribution(m._layers[J].getAttribution());return this._update(),m.on("layeradd",this._addAttribution,this),this._container},onRemove:function(m){m.off("layeradd",this._addAttribution,this)},_addAttribution:function(m){m.layer.getAttribution&&(this.addAttribution(m.layer.getAttribution()),m.layer.once("remove",function(){this.removeAttribution(m.layer.getAttribution())},this))},setPrefix:function(m){return this.options.prefix=m,this._update(),this},addAttribution:function(m){return m?(this._attributions[m]||(this._attributions[m]=0),this._attributions[m]++,this._update(),this):this},removeAttribution:function(m){return m?(this._attributions[m]&&(this._attributions[m]--,this._update()),this):this},_update:function(){if(this._map){var m=[];for(var J in this._attributions)this._attributions[J]&&m.push(J);var Z=[];this.options.prefix&&Z.push(this.options.prefix),m.length&&Z.push(m.join(", ")),this._container.innerHTML=Z.join(' <span aria-hidden="true">|</span> ')}}});$t.mergeOptions({attributionControl:!0}),$t.addInitHook(function(){this.options.attributionControl&&new qyA().addTo(this)});var Kmi=function(m){return new qyA(m)};MB.Layers=v0e,MB.Zoom=OyA,MB.Scale=L0e,MB.Attribution=qyA,sW.layers=Smi,sW.zoom=Hmi,sW.scale=Zmi,sW.attribution=Kmi;var $E=K.extend({initialize:function(m){this._map=m},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});$E.addTo=function(m,J){return m.addHandler(J,this),this};var Umi={Events:V},S0e=he.touch?"touchstart mousedown":"mousedown",ff=X.extend({options:{clickTolerance:3},initialize:function(m,J,Z,z){E(this,z),this._element=m,this._dragStartTarget=J||m,this._preventOutline=Z},enable:function(){this._enabled||(Ke(this._dragStartTarget,S0e,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ff._dragging===this&&this.finishDrag(!0),En(this._dragStartTarget,S0e,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(m){if(this._enabled&&(this._moved=!1,!Ks(this._element,"leaflet-zoom-anim"))){if(m.touches&&m.touches.length!==1){ff._dragging===this&&this.finishDrag();return}if(!(ff._dragging||m.shiftKey||m.which!==1&&m.button!==1&&!m.touches)&&(ff._dragging=this,this._preventOutline&&fh(this._element),ph(),YB(),!this._moving)){this.fire("down");var J=m.touches?m.touches[0]:m,Z=pf(this._element);this._startPoint=new _(J.clientX,J.clientY),this._startPos=Vs(this._element),this._parentScale=Qa(Z);var z=m.type==="mousedown";Ke(document,z?"mousemove":"touchmove",this._onMove,this),Ke(document,z?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(m){if(this._enabled){if(m.touches&&m.touches.length>1){this._moved=!0;return}var J=m.touches&&m.touches.length===1?m.touches[0]:m,Z=new _(J.clientX,J.clientY)._subtract(this._startPoint);!Z.x&&!Z.y||Math.abs(Z.x)+Math.abs(Z.y)<this.options.clickTolerance||(Z.x/=this._parentScale.x,Z.y/=this._parentScale.y,Ea(m),this._moved||(this.fire("dragstart"),this._moved=!0,Se(document.body,"leaflet-dragging"),this._lastTarget=m.target||m.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Se(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(Z),this._moving=!0,this._lastEvent=m,this._updatePosition())}},_updatePosition:function(){var m={originalEvent:this._lastEvent};this.fire("predrag",m),Wt(this._element,this._newPos),this.fire("drag",m)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(m){Mt(document.body,"leaflet-dragging"),this._lastTarget&&(Mt(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),En(document,"mousemove touchmove",this._onMove,this),En(document,"mouseup touchend touchcancel",this._onUp,this),xB(),ko();var J=this._moved&&this._moving;this._moving=!1,ff._dragging=!1,J&&this.fire("dragend",{noInertia:m,distance:this._newPos.distanceTo(this._startPos)})}});function H0e(m,J,Z){var z,AA=[1,4,2,8],rA,BA,pA,bA,HA,Ie,He,Jt;for(rA=0,Ie=m.length;rA<Ie;rA++)m[rA]._code=mD(m[rA],J);for(pA=0;pA<4;pA++){for(He=AA[pA],z=[],rA=0,Ie=m.length,BA=Ie-1;rA<Ie;BA=rA++)bA=m[rA],HA=m[BA],bA._code&He?HA._code&He||(Jt=iP(HA,bA,He,J,Z),Jt._code=mD(Jt,J),z.push(Jt)):(HA._code&He&&(Jt=iP(HA,bA,He,J,Z),Jt._code=mD(Jt,J),z.push(Jt)),z.push(bA));m=z}return m}function Z0e(m,J){var Z,z,AA,rA,BA,pA,bA,HA,Ie;if(!m||m.length===0)throw new Error("latlngs not passed");Kl(m)||(console.warn("latlngs are not flat! Only the first ring will be used"),m=m[0]);var He=tA([0,0]),Jt=eA(m),Xs=Jt.getNorthWest().distanceTo(Jt.getSouthWest())*Jt.getNorthEast().distanceTo(Jt.getNorthWest());Xs<1700&&(He=jyA(m));var vg=m.length,Ul=[];for(Z=0;Z<vg;Z++){var zr=tA(m[Z]);Ul.push(J.project(tA([zr.lat-He.lat,zr.lng-He.lng])))}for(pA=bA=HA=0,Z=0,z=vg-1;Z<vg;z=Z++)AA=Ul[Z],rA=Ul[z],BA=AA.y*rA.x-rA.y*AA.x,bA+=(AA.x+rA.x)*BA,HA+=(AA.y+rA.y)*BA,pA+=BA*3;pA===0?Ie=Ul[0]:Ie=[bA/pA,HA/pA];var MR=J.unproject($(Ie));return tA([MR.lat+He.lat,MR.lng+He.lng])}function jyA(m){for(var J=0,Z=0,z=0,AA=0;AA<m.length;AA++){var rA=tA(m[AA]);J+=rA.lat,Z+=rA.lng,z++}return tA([J/z,Z/z])}var Vmi={__proto__:null,clipPolygon:H0e,polygonCenter:Z0e,centroid:jyA};function W0e(m,J){if(!J||!m.length)return m.slice();var Z=J*J;return m=Tmi(m,Z),m=zmi(m,Z),m}function K0e(m,J,Z){return Math.sqrt(rW(m,J,Z,!0))}function Xmi(m,J,Z){return rW(m,J,Z)}function zmi(m,J){var Z=m.length,z=typeof Uint8Array!=void 0+""?Uint8Array:Array,AA=new z(Z);AA[0]=AA[Z-1]=1,PyA(m,AA,J,0,Z-1);var rA,BA=[];for(rA=0;rA<Z;rA++)AA[rA]&&BA.push(m[rA]);return BA}function PyA(m,J,Z,z,AA){var rA=0,BA,pA,bA;for(pA=z+1;pA<=AA-1;pA++)bA=rW(m[pA],m[z],m[AA],!0),bA>rA&&(BA=pA,rA=bA);rA>Z&&(J[BA]=1,PyA(m,J,Z,z,BA),PyA(m,J,Z,BA,AA))}function Tmi(m,J){for(var Z=[m[0]],z=1,AA=0,rA=m.length;z<rA;z++)_mi(m[z],m[AA])>J&&(Z.push(m[z]),AA=z);return AA<rA-1&&Z.push(m[rA-1]),Z}var U0e;function V0e(m,J,Z,z,AA){var rA=z?U0e:mD(m,Z),BA=mD(J,Z),pA,bA,HA;for(U0e=BA;;){if(!(rA|BA))return[m,J];if(rA&BA)return!1;pA=rA||BA,bA=iP(m,J,pA,Z,AA),HA=mD(bA,Z),pA===rA?(m=bA,rA=HA):(J=bA,BA=HA)}}function iP(m,J,Z,z,AA){var rA=J.x-m.x,BA=J.y-m.y,pA=z.min,bA=z.max,HA,Ie;return Z&8?(HA=m.x+rA*(bA.y-m.y)/BA,Ie=bA.y):Z&4?(HA=m.x+rA*(pA.y-m.y)/BA,Ie=pA.y):Z&2?(HA=bA.x,Ie=m.y+BA*(bA.x-m.x)/rA):Z&1&&(HA=pA.x,Ie=m.y+BA*(pA.x-m.x)/rA),new _(HA,Ie,AA)}function mD(m,J){var Z=0;return m.x<J.min.x?Z|=1:m.x>J.max.x&&(Z|=2),m.y<J.min.y?Z|=4:m.y>J.max.y&&(Z|=8),Z}function _mi(m,J){var Z=J.x-m.x,z=J.y-m.y;return Z*Z+z*z}function rW(m,J,Z,z){var AA=J.x,rA=J.y,BA=Z.x-AA,pA=Z.y-rA,bA=BA*BA+pA*pA,HA;return bA>0&&(HA=((m.x-AA)*BA+(m.y-rA)*pA)/bA,HA>1?(AA=Z.x,rA=Z.y):HA>0&&(AA+=BA*HA,rA+=pA*HA)),BA=m.x-AA,pA=m.y-rA,z?BA*BA+pA*pA:new _(AA,rA)}function Kl(m){return!w(m[0])||typeof m[0][0]!="object"&&typeof m[0][0]<"u"}function X0e(m){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Kl(m)}function z0e(m,J){var Z,z,AA,rA,BA,pA,bA,HA;if(!m||m.length===0)throw new Error("latlngs not passed");Kl(m)||(console.warn("latlngs are not flat! Only the first ring will be used"),m=m[0]);var Ie=tA([0,0]),He=eA(m),Jt=He.getNorthWest().distanceTo(He.getSouthWest())*He.getNorthEast().distanceTo(He.getNorthWest());Jt<1700&&(Ie=jyA(m));var Xs=m.length,vg=[];for(Z=0;Z<Xs;Z++){var Ul=tA(m[Z]);vg.push(J.project(tA([Ul.lat-Ie.lat,Ul.lng-Ie.lng])))}for(Z=0,z=0;Z<Xs-1;Z++)z+=vg[Z].distanceTo(vg[Z+1])/2;if(z===0)HA=vg[0];else for(Z=0,rA=0;Z<Xs-1;Z++)if(BA=vg[Z],pA=vg[Z+1],AA=BA.distanceTo(pA),rA+=AA,rA>z){bA=(rA-z)/AA,HA=[pA.x-bA*(pA.x-BA.x),pA.y-bA*(pA.y-BA.y)];break}var zr=J.unproject($(HA));return tA([zr.lat+Ie.lat,zr.lng+Ie.lng])}var Omi={__proto__:null,simplify:W0e,pointToSegmentDistance:K0e,closestPointOnSegment:Xmi,clipSegment:V0e,_getEdgeIntersection:iP,_getBitCode:mD,_sqClosestPointOnSegment:rW,isFlat:Kl,_flat:X0e,polylineCenter:z0e},$yA={project:function(m){return new _(m.lng,m.lat)},unproject:function(m){return new oA(m.y,m.x)},bounds:new nA([-180,-90],[180,90])},AbA={R:6378137,R_MINOR:6356752314245179e-9,bounds:new nA([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(m){var J=Math.PI/180,Z=this.R,z=m.lat*J,AA=this.R_MINOR/Z,rA=Math.sqrt(1-AA*AA),BA=rA*Math.sin(z),pA=Math.tan(Math.PI/4-z/2)/Math.pow((1-BA)/(1+BA),rA/2);return z=-Z*Math.log(Math.max(pA,1e-10)),new _(m.lng*J*Z,z)},unproject:function(m){for(var J=180/Math.PI,Z=this.R,z=this.R_MINOR/Z,AA=Math.sqrt(1-z*z),rA=Math.exp(-m.y/Z),BA=Math.PI/2-2*Math.atan(rA),pA=0,bA=.1,HA;pA<15&&Math.abs(bA)>1e-7;pA++)HA=AA*Math.sin(BA),HA=Math.pow((1-HA)/(1+HA),AA/2),bA=Math.PI/2-2*Math.atan(rA*HA)-BA,BA+=bA;return new oA(BA*J,m.x*J/Z)}},qmi={__proto__:null,LonLat:$yA,Mercator:AbA,SphericalMercator:aA},jmi=n({},gA,{code:"EPSG:3395",projection:AbA,transformation:function(){var m=.5/(Math.PI*AbA.R);return CA(m,.5,-m,.5)}()}),T0e=n({},gA,{code:"EPSG:4326",projection:$yA,transformation:CA(1/180,1,-1/180,.5)}),Pmi=n({},sA,{projection:$yA,transformation:CA(1,0,-1,0),scale:function(m){return Math.pow(2,m)},zoom:function(m){return Math.log(m)/Math.LN2},distance:function(m,J){var Z=J.lng-m.lng,z=J.lat-m.lat;return Math.sqrt(Z*Z+z*z)},infinite:!0});sA.Earth=gA,sA.EPSG3395=jmi,sA.EPSG3857=QA,sA.EPSG900913=uA,sA.EPSG4326=T0e,sA.Simple=Pmi;var vB=X.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(m){return m.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(m){return m&&m.removeLayer(this),this},getPane:function(m){return this._map.getPane(m?this.options[m]||m:this.options.pane)},addInteractiveTarget:function(m){return this._map._targets[s(m)]=this,this},removeInteractiveTarget:function(m){return delete this._map._targets[s(m)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(m){var J=m.target;if(J.hasLayer(this)){if(this._map=J,this._zoomAnimated=J._zoomAnimated,this.getEvents){var Z=this.getEvents();J.on(Z,this),this.once("remove",function(){J.off(Z,this)},this)}this.onAdd(J),this.fire("add"),J.fire("layeradd",{layer:this})}}});$t.include({addLayer:function(m){if(!m._layerAdd)throw new Error("The provided object is not a Layer.");var J=s(m);return this._layers[J]?this:(this._layers[J]=m,m._mapToAdd=this,m.beforeAdd&&m.beforeAdd(this),this.whenReady(m._layerAdd,m),this)},removeLayer:function(m){var J=s(m);return this._layers[J]?(this._loaded&&m.onRemove(this),delete this._layers[J],this._loaded&&(this.fire("layerremove",{layer:m}),m.fire("remove")),m._map=m._mapToAdd=null,this):this},hasLayer:function(m){return s(m)in this._layers},eachLayer:function(m,J){for(var Z in this._layers)m.call(J,this._layers[Z]);return this},_addLayers:function(m){m=m?w(m)?m:[m]:[];for(var J=0,Z=m.length;J<Z;J++)this.addLayer(m[J])},_addZoomLimit:function(m){(!isNaN(m.options.maxZoom)||!isNaN(m.options.minZoom))&&(this._zoomBoundLayers[s(m)]=m,this._updateZoomLevels())},_removeZoomLimit:function(m){var J=s(m);this._zoomBoundLayers[J]&&(delete this._zoomBoundLayers[J],this._updateZoomLevels())},_updateZoomLevels:function(){var m=1/0,J=-1/0,Z=this._getZoomSpan();for(var z in this._zoomBoundLayers){var AA=this._zoomBoundLayers[z].options;m=AA.minZoom===void 0?m:Math.min(m,AA.minZoom),J=AA.maxZoom===void 0?J:Math.max(J,AA.maxZoom)}this._layersMaxZoom=J===-1/0?void 0:J,this._layersMinZoom=m===1/0?void 0:m,Z!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var NR=vB.extend({initialize:function(m,J){E(this,J),this._layers={};var Z,z;if(m)for(Z=0,z=m.length;Z<z;Z++)this.addLayer(m[Z])},addLayer:function(m){var J=this.getLayerId(m);return this._layers[J]=m,this._map&&this._map.addLayer(m),this},removeLayer:function(m){var J=m in this._layers?m:this.getLayerId(m);return this._map&&this._layers[J]&&this._map.removeLayer(this._layers[J]),delete this._layers[J],this},hasLayer:function(m){var J=typeof m=="number"?m:this.getLayerId(m);return J in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(m){var J=Array.prototype.slice.call(arguments,1),Z,z;for(Z in this._layers)z=this._layers[Z],z[m]&&z[m].apply(z,J);return this},onAdd:function(m){this.eachLayer(m.addLayer,m)},onRemove:function(m){this.eachLayer(m.removeLayer,m)},eachLayer:function(m,J){for(var Z in this._layers)m.call(J,this._layers[Z]);return this},getLayer:function(m){return this._layers[m]},getLayers:function(){var m=[];return this.eachLayer(m.push,m),m},setZIndex:function(m){return this.invoke("setZIndex",m)},getLayerId:function(m){return s(m)}}),$mi=function(m,J){return new NR(m,J)},yh=NR.extend({addLayer:function(m){return this.hasLayer(m)?this:(m.addEventParent(this),NR.prototype.addLayer.call(this,m),this.fire("layeradd",{layer:m}))},removeLayer:function(m){return this.hasLayer(m)?(m in this._layers&&(m=this._layers[m]),m.removeEventParent(this),NR.prototype.removeLayer.call(this,m),this.fire("layerremove",{layer:m})):this},setStyle:function(m){return this.invoke("setStyle",m)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var m=new O;for(var J in this._layers){var Z=this._layers[J];m.extend(Z.getBounds?Z.getBounds():Z.getLatLng())}return m}}),Api=function(m,J){return new yh(m,J)},YR=K.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(m){E(this,m)},createIcon:function(m){return this._createIcon("icon",m)},createShadow:function(m){return this._createIcon("shadow",m)},_createIcon:function(m,J){var Z=this._getIconUrl(m);if(!Z){if(m==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var z=this._createImg(Z,J&&J.tagName==="IMG"?J:null);return this._setIconStyles(z,m),(this.options.crossOrigin||this.options.crossOrigin==="")&&(z.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),z},_setIconStyles:function(m,J){var Z=this.options,z=Z[J+"Size"];typeof z=="number"&&(z=[z,z]);var AA=$(z),rA=$(J==="shadow"&&Z.shadowAnchor||Z.iconAnchor||AA&&AA.divideBy(2,!0));m.className="leaflet-marker-"+J+" "+(Z.className||""),rA&&(m.style.marginLeft=-rA.x+"px",m.style.marginTop=-rA.y+"px"),AA&&(m.style.width=AA.x+"px",m.style.height=AA.y+"px")},_createImg:function(m,J){return J=J||document.createElement("img"),J.src=m,J},_getIconUrl:function(m){return he.retina&&this.options[m+"RetinaUrl"]||this.options[m+"Url"]}});function epi(m){return new YR(m)}var IW=YR.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(m){return typeof IW.imagePath!="string"&&(IW.imagePath=this._detectIconPath()),(this.options.imagePath||IW.imagePath)+YR.prototype._getIconUrl.call(this,m)},_stripUrl:function(m){var J=function(Z,z,AA){var rA=z.exec(Z);return rA&&rA[AA]};return m=J(m,/^url\((['"])?(.+)\1\)$/,2),m&&J(m,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var m=Zt("div","leaflet-default-icon-path",document.body),J=Ba(m,"background-image")||Ba(m,"backgroundImage");if(document.body.removeChild(m),J=this._stripUrl(J),J)return J;var Z=document.querySelector('link[href$="leaflet.css"]');return Z?Z.href.substring(0,Z.href.length-11-1):""}}),_0e=$E.extend({initialize:function(m){this._marker=m},addHooks:function(){var m=this._marker._icon;this._draggable||(this._draggable=new ff(m,m,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Se(m,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&Mt(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(m){var J=this._marker,Z=J._map,z=this._marker.options.autoPanSpeed,AA=this._marker.options.autoPanPadding,rA=Vs(J._icon),BA=Z.getPixelBounds(),pA=Z.getPixelOrigin(),bA=j(BA.min._subtract(pA).add(AA),BA.max._subtract(pA).subtract(AA));if(!bA.contains(rA)){var HA=$((Math.max(bA.max.x,rA.x)-bA.max.x)/(BA.max.x-bA.max.x)-(Math.min(bA.min.x,rA.x)-bA.min.x)/(BA.min.x-bA.min.x),(Math.max(bA.max.y,rA.y)-bA.max.y)/(BA.max.y-bA.max.y)-(Math.min(bA.min.y,rA.y)-bA.min.y)/(BA.min.y-bA.min.y)).multiplyBy(z);Z.panBy(HA,{animate:!1}),this._draggable._newPos._add(HA),this._draggable._startPos._add(HA),Wt(J._icon,this._draggable._newPos),this._onDrag(m),this._panRequest=h(this._adjustPan.bind(this,m))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(m){this._marker.options.autoPan&&(N(this._panRequest),this._panRequest=h(this._adjustPan.bind(this,m)))},_onDrag:function(m){var J=this._marker,Z=J._shadow,z=Vs(J._icon),AA=J._map.layerPointToLatLng(z);Z&&Wt(Z,z),J._latlng=AA,m.latlng=AA,m.oldLatLng=this._oldLatLng,J.fire("move",m).fire("drag",m)},_onDragEnd:function(m){N(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",m)}}),nP=vB.extend({options:{icon:new IW,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(m,J){E(this,J),this._latlng=tA(m)},onAdd:function(m){this._zoomAnimated=this._zoomAnimated&&m.options.markerZoomAnimation,this._zoomAnimated&&m.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(m){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&m.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(m){var J=this._latlng;return this._latlng=tA(m),this.update(),this.fire("move",{oldLatLng:J,latlng:this._latlng})},setZIndexOffset:function(m){return this.options.zIndexOffset=m,this.update()},getIcon:function(){return this.options.icon},setIcon:function(m){return this.options.icon=m,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var m=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(m)}return this},_initIcon:function(){var m=this.options,J="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),Z=m.icon.createIcon(this._icon),z=!1;Z!==this._icon&&(this._icon&&this._removeIcon(),z=!0,m.title&&(Z.title=m.title),Z.tagName==="IMG"&&(Z.alt=m.alt||"")),Se(Z,J),m.keyboard&&(Z.tabIndex="0",Z.setAttribute("role","button")),this._icon=Z,m.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ke(Z,"focus",this._panOnFocus,this);var AA=m.icon.createShadow(this._shadow),rA=!1;AA!==this._shadow&&(this._removeShadow(),rA=!0),AA&&(Se(AA,J),AA.alt=""),this._shadow=AA,m.opacity<1&&this._updateOpacity(),z&&this.getPane().appendChild(this._icon),this._initInteraction(),AA&&rA&&this.getPane(m.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&En(this._icon,"focus",this._panOnFocus,this),tn(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&tn(this._shadow),this._shadow=null},_setPos:function(m){this._icon&&Wt(this._icon,m),this._shadow&&Wt(this._shadow,m),this._zIndex=m.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(m){this._icon&&(this._icon.style.zIndex=this._zIndex+m)},_animateZoom:function(m){var J=this._map._latLngToNewLayerPoint(this._latlng,m.zoom,m.center).round();this._setPos(J)},_initInteraction:function(){if(this.options.interactive&&(Se(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),_0e)){var m=this.options.draggable;this.dragging&&(m=this.dragging.enabled(),this.dragging.disable()),this.dragging=new _0e(this),m&&this.dragging.enable()}},setOpacity:function(m){return this.options.opacity=m,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var m=this.options.opacity;this._icon&&We(this._icon,m),this._shadow&&We(this._shadow,m)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var m=this._map;if(m){var J=this.options.icon.options,Z=J.iconSize?$(J.iconSize):$(0,0),z=J.iconAnchor?$(J.iconAnchor):$(0,0);m.panInside(this._latlng,{paddingTopLeft:z,paddingBottomRight:Z.subtract(z)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function tpi(m,J){return new nP(m,J)}var yf=vB.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(m){this._renderer=m.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(m){return E(this,m),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&m&&Object.prototype.hasOwnProperty.call(m,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),oP=yf.extend({options:{fill:!0,radius:10},initialize:function(m,J){E(this,J),this._latlng=tA(m),this._radius=this.options.radius},setLatLng:function(m){var J=this._latlng;return this._latlng=tA(m),this.redraw(),this.fire("move",{oldLatLng:J,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(m){return this.options.radius=this._radius=m,this.redraw()},getRadius:function(){return this._radius},setStyle:function(m){var J=m&&m.radius||this._radius;return yf.prototype.setStyle.call(this,m),this.setRadius(J),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var m=this._radius,J=this._radiusY||m,Z=this._clickTolerance(),z=[m+Z,J+Z];this._pxBounds=new nA(this._point.subtract(z),this._point.add(z))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(m){return m.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ipi(m,J){return new oP(m,J)}var ebA=oP.extend({initialize:function(m,J,Z){if(typeof J=="number"&&(J=n({},Z,{radius:J})),E(this,J),this._latlng=tA(m),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(m){return this._mRadius=m,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var m=[this._radius,this._radiusY||this._radius];return new O(this._map.layerPointToLatLng(this._point.subtract(m)),this._map.layerPointToLatLng(this._point.add(m)))},setStyle:yf.prototype.setStyle,_project:function(){var m=this._latlng.lng,J=this._latlng.lat,Z=this._map,z=Z.options.crs;if(z.distance===gA.distance){var AA=Math.PI/180,rA=this._mRadius/gA.R/AA,BA=Z.project([J+rA,m]),pA=Z.project([J-rA,m]),bA=BA.add(pA).divideBy(2),HA=Z.unproject(bA).lat,Ie=Math.acos((Math.cos(rA*AA)-Math.sin(J*AA)*Math.sin(HA*AA))/(Math.cos(J*AA)*Math.cos(HA*AA)))/AA;(isNaN(Ie)||Ie===0)&&(Ie=rA/Math.cos(Math.PI/180*J)),this._point=bA.subtract(Z.getPixelOrigin()),this._radius=isNaN(Ie)?0:bA.x-Z.project([HA,m-Ie]).x,this._radiusY=bA.y-BA.y}else{var He=z.unproject(z.project(this._latlng).subtract([this._mRadius,0]));this._point=Z.latLngToLayerPoint(this._latlng),this._radius=this._point.x-Z.latLngToLayerPoint(He).x}this._updateBounds()}});function npi(m,J,Z){return new ebA(m,J,Z)}var bh=yf.extend({options:{smoothFactor:1,noClip:!1},initialize:function(m,J){E(this,J),this._setLatLngs(m)},getLatLngs:function(){return this._latlngs},setLatLngs:function(m){return this._setLatLngs(m),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(m){for(var J=1/0,Z=null,z=rW,AA,rA,BA=0,pA=this._parts.length;BA<pA;BA++)for(var bA=this._parts[BA],HA=1,Ie=bA.length;HA<Ie;HA++){AA=bA[HA-1],rA=bA[HA];var He=z(m,AA,rA,!0);He<J&&(J=He,Z=z(m,AA,rA))}return Z&&(Z.distance=Math.sqrt(J)),Z},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return z0e(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(m,J){return J=J||this._defaultShape(),m=tA(m),J.push(m),this._bounds.extend(m),this.redraw()},_setLatLngs:function(m){this._bounds=new O,this._latlngs=this._convertLatLngs(m)},_defaultShape:function(){return Kl(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(m){for(var J=[],Z=Kl(m),z=0,AA=m.length;z<AA;z++)Z?(J[z]=tA(m[z]),this._bounds.extend(J[z])):J[z]=this._convertLatLngs(m[z]);return J},_project:function(){var m=new nA;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,m),this._bounds.isValid()&&m.isValid()&&(this._rawPxBounds=m,this._updateBounds())},_updateBounds:function(){var m=this._clickTolerance(),J=new _(m,m);this._rawPxBounds&&(this._pxBounds=new nA([this._rawPxBounds.min.subtract(J),this._rawPxBounds.max.add(J)]))},_projectLatlngs:function(m,J,Z){var z=m[0]instanceof oA,AA=m.length,rA,BA;if(z){for(BA=[],rA=0;rA<AA;rA++)BA[rA]=this._map.latLngToLayerPoint(m[rA]),Z.extend(BA[rA]);J.push(BA)}else for(rA=0;rA<AA;rA++)this._projectLatlngs(m[rA],J,Z)},_clipPoints:function(){var m=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(m))){if(this.options.noClip){this._parts=this._rings;return}var J=this._parts,Z,z,AA,rA,BA,pA,bA;for(Z=0,AA=0,rA=this._rings.length;Z<rA;Z++)for(bA=this._rings[Z],z=0,BA=bA.length;z<BA-1;z++)pA=V0e(bA[z],bA[z+1],m,z,!0),pA&&(J[AA]=J[AA]||[],J[AA].push(pA[0]),(pA[1]!==bA[z+1]||z===BA-2)&&(J[AA].push(pA[1]),AA++))}},_simplifyPoints:function(){for(var m=this._parts,J=this.options.smoothFactor,Z=0,z=m.length;Z<z;Z++)m[Z]=W0e(m[Z],J)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(m,J){var Z,z,AA,rA,BA,pA,bA=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(m))return!1;for(Z=0,rA=this._parts.length;Z<rA;Z++)for(pA=this._parts[Z],z=0,BA=pA.length,AA=BA-1;z<BA;AA=z++)if(!(!J&&z===0)&&K0e(m,pA[AA],pA[z])<=bA)return!0;return!1}});function opi(m,J){return new bh(m,J)}bh._flat=X0e;var RR=bh.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Z0e(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(m){var J=bh.prototype._convertLatLngs.call(this,m),Z=J.length;return Z>=2&&J[0]instanceof oA&&J[0].equals(J[Z-1])&&J.pop(),J},_setLatLngs:function(m){bh.prototype._setLatLngs.call(this,m),Kl(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Kl(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var m=this._renderer._bounds,J=this.options.weight,Z=new _(J,J);if(m=new nA(m.min.subtract(Z),m.max.add(Z)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(m))){if(this.options.noClip){this._parts=this._rings;return}for(var z=0,AA=this._rings.length,rA;z<AA;z++)rA=H0e(this._rings[z],m,!0),rA.length&&this._parts.push(rA)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(m){var J=!1,Z,z,AA,rA,BA,pA,bA,HA;if(!this._pxBounds||!this._pxBounds.contains(m))return!1;for(rA=0,bA=this._parts.length;rA<bA;rA++)for(Z=this._parts[rA],BA=0,HA=Z.length,pA=HA-1;BA<HA;pA=BA++)z=Z[BA],AA=Z[pA],z.y>m.y!=AA.y>m.y&&m.x<(AA.x-z.x)*(m.y-z.y)/(AA.y-z.y)+z.x&&(J=!J);return J||bh.prototype._containsPoint.call(this,m,!0)}});function gpi(m,J){return new RR(m,J)}var wh=yh.extend({initialize:function(m,J){E(this,J),this._layers={},m&&this.addData(m)},addData:function(m){var J=w(m)?m:m.features,Z,z,AA;if(J){for(Z=0,z=J.length;Z<z;Z++)AA=J[Z],(AA.geometries||AA.geometry||AA.features||AA.coordinates)&&this.addData(AA);return this}var rA=this.options;if(rA.filter&&!rA.filter(m))return this;var BA=gP(m,rA);return BA?(BA.feature=rP(m),BA.defaultOptions=BA.options,this.resetStyle(BA),rA.onEachFeature&&rA.onEachFeature(m,BA),this.addLayer(BA)):this},resetStyle:function(m){return m===void 0?this.eachLayer(this.resetStyle,this):(m.options=n({},m.defaultOptions),this._setLayerStyle(m,this.options.style),this)},setStyle:function(m){return this.eachLayer(function(J){this._setLayerStyle(J,m)},this)},_setLayerStyle:function(m,J){m.setStyle&&(typeof J=="function"&&(J=J(m.feature)),m.setStyle(J))}});function gP(m,J){var Z=m.type==="Feature"?m.geometry:m,z=Z?Z.coordinates:null,AA=[],rA=J&&J.pointToLayer,BA=J&&J.coordsToLatLng||tbA,pA,bA,HA,Ie;if(!z&&!Z)return null;switch(Z.type){case"Point":return pA=BA(z),O0e(rA,m,pA,J);case"MultiPoint":for(HA=0,Ie=z.length;HA<Ie;HA++)pA=BA(z[HA]),AA.push(O0e(rA,m,pA,J));return new yh(AA);case"LineString":case"MultiLineString":return bA=aP(z,Z.type==="LineString"?0:1,BA),new bh(bA,J);case"Polygon":case"MultiPolygon":return bA=aP(z,Z.type==="Polygon"?1:2,BA),new RR(bA,J);case"GeometryCollection":for(HA=0,Ie=Z.geometries.length;HA<Ie;HA++){var He=gP({geometry:Z.geometries[HA],type:"Feature",properties:m.properties},J);He&&AA.push(He)}return new yh(AA);case"FeatureCollection":for(HA=0,Ie=Z.features.length;HA<Ie;HA++){var Jt=gP(Z.features[HA],J);Jt&&AA.push(Jt)}return new yh(AA);default:throw new Error("Invalid GeoJSON object.")}}function O0e(m,J,Z,z){return m?m(J,Z):new nP(Z,z&&z.markersInheritOptions&&z)}function tbA(m){return new oA(m[1],m[0],m[2])}function aP(m,J,Z){for(var z=[],AA=0,rA=m.length,BA;AA<rA;AA++)BA=J?aP(m[AA],J-1,Z):(Z||tbA)(m[AA]),z.push(BA);return z}function ibA(m,J){return m=tA(m),m.alt!==void 0?[l(m.lng,J),l(m.lat,J),l(m.alt,J)]:[l(m.lng,J),l(m.lat,J)]}function sP(m,J,Z,z){for(var AA=[],rA=0,BA=m.length;rA<BA;rA++)AA.push(J?sP(m[rA],Kl(m[rA])?0:J-1,Z,z):ibA(m[rA],z));return!J&&Z&&AA.length>0&&AA.push(AA[0].slice()),AA}function xR(m,J){return m.feature?n({},m.feature,{geometry:J}):rP(J)}function rP(m){return m.type==="Feature"||m.type==="FeatureCollection"?m:{type:"Feature",properties:{},geometry:m}}var nbA={toGeoJSON:function(m){return xR(this,{type:"Point",coordinates:ibA(this.getLatLng(),m)})}};nP.include(nbA),ebA.include(nbA),oP.include(nbA),bh.include({toGeoJSON:function(m){var J=!Kl(this._latlngs),Z=sP(this._latlngs,J?1:0,!1,m);return xR(this,{type:(J?"Multi":"")+"LineString",coordinates:Z})}}),RR.include({toGeoJSON:function(m){var J=!Kl(this._latlngs),Z=J&&!Kl(this._latlngs[0]),z=sP(this._latlngs,Z?2:J?1:0,!0,m);return J||(z=[z]),xR(this,{type:(Z?"Multi":"")+"Polygon",coordinates:z})}}),NR.include({toMultiPoint:function(m){var J=[];return this.eachLayer(function(Z){J.push(Z.toGeoJSON(m).geometry.coordinates)}),xR(this,{type:"MultiPoint",coordinates:J})},toGeoJSON:function(m){var J=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(J==="MultiPoint")return this.toMultiPoint(m);var Z=J==="GeometryCollection",z=[];return this.eachLayer(function(AA){if(AA.toGeoJSON){var rA=AA.toGeoJSON(m);if(Z)z.push(rA.geometry);else{var BA=rP(rA);BA.type==="FeatureCollection"?z.push.apply(z,BA.features):z.push(BA)}}}),Z?xR(this,{geometries:z,type:"GeometryCollection"}):{type:"FeatureCollection",features:z}}});function q0e(m,J){return new wh(m,J)}var api=q0e,IP=vB.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(m,J,Z){this._url=m,this._bounds=eA(J),E(this,Z)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Se(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){tn(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(m){return this.options.opacity=m,this._image&&this._updateOpacity(),this},setStyle:function(m){return m.opacity&&this.setOpacity(m.opacity),this},bringToFront:function(){return this._map&&xg(this._image),this},bringToBack:function(){return this._map&&Fg(this._image),this},setUrl:function(m){return this._url=m,this._image&&(this._image.src=m),this},setBounds:function(m){return this._bounds=eA(m),this._map&&this._reset(),this},getEvents:function(){var m={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(m.zoomanim=this._animateZoom),m},setZIndex:function(m){return this.options.zIndex=m,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var m=this._url.tagName==="IMG",J=this._image=m?this._url:Zt("img");if(Se(J,"leaflet-image-layer"),this._zoomAnimated&&Se(J,"leaflet-zoom-animated"),this.options.className&&Se(J,this.options.className),J.onselectstart=C,J.onmousemove=C,J.onload=g(this.fire,this,"load"),J.onerror=g(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(J.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),m){this._url=J.src;return}J.src=this._url,J.alt=this.options.alt},_animateZoom:function(m){var J=this._map.getZoomScale(m.zoom),Z=this._map._latLngBoundsToNewLayerBounds(this._bounds,m.zoom,m.center).min;Us(this._image,Z,J)},_reset:function(){var m=this._image,J=new nA(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),Z=J.getSize();Wt(m,J.min),m.style.width=Z.x+"px",m.style.height=Z.y+"px"},_updateOpacity:function(){We(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var m=this.options.errorOverlayUrl;m&&this._url!==m&&(this._url=m,this._image.src=m)},getCenter:function(){return this._bounds.getCenter()}}),spi=function(m,J,Z){return new IP(m,J,Z)},j0e=IP.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var m=this._url.tagName==="VIDEO",J=this._image=m?this._url:Zt("video");if(Se(J,"leaflet-image-layer"),this._zoomAnimated&&Se(J,"leaflet-zoom-animated"),this.options.className&&Se(J,this.options.className),J.onselectstart=C,J.onmousemove=C,J.onloadeddata=g(this.fire,this,"load"),m){for(var Z=J.getElementsByTagName("source"),z=[],AA=0;AA<Z.length;AA++)z.push(Z[AA].src);this._url=Z.length>0?z:[J.src];return}w(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(J.style,"objectFit")&&(J.style.objectFit="fill"),J.autoplay=!!this.options.autoplay,J.loop=!!this.options.loop,J.muted=!!this.options.muted,J.playsInline=!!this.options.playsInline;for(var rA=0;rA<this._url.length;rA++){var BA=Zt("source");BA.src=this._url[rA],J.appendChild(BA)}}});function rpi(m,J,Z){return new j0e(m,J,Z)}var P0e=IP.extend({_initImage:function(){var m=this._image=this._url;Se(m,"leaflet-image-layer"),this._zoomAnimated&&Se(m,"leaflet-zoom-animated"),this.options.className&&Se(m,this.options.className),m.onselectstart=C,m.onmousemove=C}});function Ipi(m,J,Z){return new P0e(m,J,Z)}var Au=vB.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(m,J){m&&(m instanceof oA||w(m))?(this._latlng=tA(m),E(this,J)):(E(this,m),this._source=J),this.options.content&&(this._content=this.options.content)},openOn:function(m){return m=arguments.length?m:this._source._map,m.hasLayer(this)||m.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(m){return this._map?this.close():(arguments.length?this._source=m:m=this._source,this._prepareOpen(),this.openOn(m._map)),this},onAdd:function(m){this._zoomAnimated=m._zoomAnimated,this._container||this._initLayout(),m._fadeAnimated&&We(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),m._fadeAnimated&&We(this._container,1),this.bringToFront(),this.options.interactive&&(Se(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(m){m._fadeAnimated?(We(this._container,0),this._removeTimeout=setTimeout(g(tn,void 0,this._container),200)):tn(this._container),this.options.interactive&&(Mt(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(m){return this._latlng=tA(m),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(m){return this._content=m,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var m={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(m.zoomanim=this._animateZoom),m},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&xg(this._container),this},bringToBack:function(){return this._map&&Fg(this._container),this},_prepareOpen:function(m){var J=this._source;if(!J._map)return!1;if(J instanceof yh){J=null;var Z=this._source._layers;for(var z in Z)if(Z[z]._map){J=Z[z];break}if(!J)return!1;this._source=J}if(!m)if(J.getCenter)m=J.getCenter();else if(J.getLatLng)m=J.getLatLng();else if(J.getBounds)m=J.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(m),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var m=this._contentNode,J=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof J=="string")m.innerHTML=J;else{for(;m.hasChildNodes();)m.removeChild(m.firstChild);m.appendChild(J)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var m=this._map.latLngToLayerPoint(this._latlng),J=$(this.options.offset),Z=this._getAnchor();this._zoomAnimated?Wt(this._container,m.add(Z)):J=J.add(m).add(Z);var z=this._containerBottom=-J.y,AA=this._containerLeft=-Math.round(this._containerWidth/2)+J.x;this._container.style.bottom=z+"px",this._container.style.left=AA+"px"}},_getAnchor:function(){return[0,0]}});$t.include({_initOverlay:function(m,J,Z,z){var AA=J;return AA instanceof m||(AA=new m(z).setContent(J)),Z&&AA.setLatLng(Z),AA}}),vB.include({_initOverlay:function(m,J,Z,z){var AA=Z;return AA instanceof m?(E(AA,z),AA._source=this):(AA=J&&!z?J:new m(z,this),AA.setContent(Z)),AA}});var CP=Au.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(m){return m=arguments.length?m:this._source._map,!m.hasLayer(this)&&m._popup&&m._popup.options.autoClose&&m.removeLayer(m._popup),m._popup=this,Au.prototype.openOn.call(this,m)},onAdd:function(m){Au.prototype.onAdd.call(this,m),m.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof yf||this._source.on("preclick",dD))},onRemove:function(m){Au.prototype.onRemove.call(this,m),m.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof yf||this._source.off("preclick",dD))},getEvents:function(){var m=Au.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(m.preclick=this.close),this.options.keepInView&&(m.moveend=this._adjustPan),m},_initLayout:function(){var m="leaflet-popup",J=this._container=Zt("div",m+" "+(this.options.className||"")+" leaflet-zoom-animated"),Z=this._wrapper=Zt("div",m+"-content-wrapper",J);if(this._contentNode=Zt("div",m+"-content",Z),aW(J),TyA(this._contentNode),Ke(J,"contextmenu",dD),this._tipContainer=Zt("div",m+"-tip-container",J),this._tip=Zt("div",m+"-tip",this._tipContainer),this.options.closeButton){var z=this._closeButton=Zt("a",m+"-close-button",J);z.setAttribute("role","button"),z.setAttribute("aria-label","Close popup"),z.href="#close",z.innerHTML='<span aria-hidden="true">&#215;</span>',Ke(z,"click",function(AA){Ea(AA),this.close()},this)}},_updateLayout:function(){var m=this._contentNode,J=m.style;J.width="",J.whiteSpace="nowrap";var Z=m.offsetWidth;Z=Math.min(Z,this.options.maxWidth),Z=Math.max(Z,this.options.minWidth),J.width=Z+1+"px",J.whiteSpace="",J.height="";var z=m.offsetHeight,AA=this.options.maxHeight,rA="leaflet-popup-scrolled";AA&&z>AA?(J.height=AA+"px",Se(m,rA)):Mt(m,rA),this._containerWidth=this._container.offsetWidth},_animateZoom:function(m){var J=this._map._latLngToNewLayerPoint(this._latlng,m.zoom,m.center),Z=this._getAnchor();Wt(this._container,J.add(Z))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var m=this._map,J=parseInt(Ba(this._container,"marginBottom"),10)||0,Z=this._container.offsetHeight+J,z=this._containerWidth,AA=new _(this._containerLeft,-Z-this._containerBottom);AA._add(Vs(this._container));var rA=m.layerPointToContainerPoint(AA),BA=$(this.options.autoPanPadding),pA=$(this.options.autoPanPaddingTopLeft||BA),bA=$(this.options.autoPanPaddingBottomRight||BA),HA=m.getSize(),Ie=0,He=0;rA.x+z+bA.x>HA.x&&(Ie=rA.x+z-HA.x+bA.x),rA.x-Ie-pA.x<0&&(Ie=rA.x-pA.x),rA.y+Z+bA.y>HA.y&&(He=rA.y+Z-HA.y+bA.y),rA.y-He-pA.y<0&&(He=rA.y-pA.y),(Ie||He)&&(this.options.keepInView&&(this._autopanning=!0),m.fire("autopanstart").panBy([Ie,He]))}},_getAnchor:function(){return $(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Cpi=function(m,J){return new CP(m,J)};$t.mergeOptions({closePopupOnClick:!0}),$t.include({openPopup:function(m,J,Z){return this._initOverlay(CP,m,J,Z).openOn(this),this},closePopup:function(m){return m=arguments.length?m:this._popup,m&&m.close(),this}}),vB.include({bindPopup:function(m,J){return this._popup=this._initOverlay(CP,this._popup,m,J),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(m){return this._popup&&(this instanceof yh||(this._popup._source=this),this._popup._prepareOpen(m||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(m){return this._popup&&this._popup.setContent(m),this},getPopup:function(){return this._popup},_openPopup:function(m){if(!(!this._popup||!this._map)){hD(m);var J=m.layer||m.target;if(this._popup._source===J&&!(J instanceof yf)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(m.latlng);return}this._popup._source=J,this.openPopup(m.latlng)}},_movePopup:function(m){this._popup.setLatLng(m.latlng)},_onKeyPress:function(m){m.originalEvent.keyCode===13&&this._openPopup(m)}});var lP=Au.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(m){Au.prototype.onAdd.call(this,m),this.setOpacity(this.options.opacity),m.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(m){Au.prototype.onRemove.call(this,m),m.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var m=Au.prototype.getEvents.call(this);return this.options.permanent||(m.preclick=this.close),m},_initLayout:function(){var m="leaflet-tooltip",J=m+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Zt("div",J),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(m){var J,Z,z=this._map,AA=this._container,rA=z.latLngToContainerPoint(z.getCenter()),BA=z.layerPointToContainerPoint(m),pA=this.options.direction,bA=AA.offsetWidth,HA=AA.offsetHeight,Ie=$(this.options.offset),He=this._getAnchor();pA==="top"?(J=bA/2,Z=HA):pA==="bottom"?(J=bA/2,Z=0):pA==="center"?(J=bA/2,Z=HA/2):pA==="right"?(J=0,Z=HA/2):pA==="left"?(J=bA,Z=HA/2):BA.x<rA.x?(pA="right",J=0,Z=HA/2):(pA="left",J=bA+(Ie.x+He.x)*2,Z=HA/2),m=m.subtract($(J,Z,!0)).add(Ie).add(He),Mt(AA,"leaflet-tooltip-right"),Mt(AA,"leaflet-tooltip-left"),Mt(AA,"leaflet-tooltip-top"),Mt(AA,"leaflet-tooltip-bottom"),Se(AA,"leaflet-tooltip-"+pA),Wt(AA,m)},_updatePosition:function(){var m=this._map.latLngToLayerPoint(this._latlng);this._setPosition(m)},setOpacity:function(m){this.options.opacity=m,this._container&&We(this._container,m)},_animateZoom:function(m){var J=this._map._latLngToNewLayerPoint(this._latlng,m.zoom,m.center);this._setPosition(J)},_getAnchor:function(){return $(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),lpi=function(m,J){return new lP(m,J)};$t.include({openTooltip:function(m,J,Z){return this._initOverlay(lP,m,J,Z).openOn(this),this},closeTooltip:function(m){return m.close(),this}}),vB.include({bindTooltip:function(m,J){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(lP,this._tooltip,m,J),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(m){if(!(!m&&this._tooltipHandlersAdded)){var J=m?"off":"on",Z={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?Z.add=this._openTooltip:(Z.mouseover=this._openTooltip,Z.mouseout=this.closeTooltip,Z.click=this._openTooltip,this._map?this._addFocusListeners():Z.add=this._addFocusListeners),this._tooltip.options.sticky&&(Z.mousemove=this._moveTooltip),this[J](Z),this._tooltipHandlersAdded=!m}},openTooltip:function(m){return this._tooltip&&(this instanceof yh||(this._tooltip._source=this),this._tooltip._prepareOpen(m)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(m){return this._tooltip&&this._tooltip.setContent(m),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(m){var J=typeof m.getElement=="function"&&m.getElement();J&&(Ke(J,"focus",function(){this._tooltip._source=m,this.openTooltip()},this),Ke(J,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(m){var J=typeof m.getElement=="function"&&m.getElement();J&&J.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(m){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var J=this;this._map.once("moveend",function(){J._openOnceFlag=!1,J._openTooltip(m)});return}this._tooltip._source=m.layer||m.target,this.openTooltip(this._tooltip.options.sticky?m.latlng:void 0)}},_moveTooltip:function(m){var J=m.latlng,Z,z;this._tooltip.options.sticky&&m.originalEvent&&(Z=this._map.mouseEventToContainerPoint(m.originalEvent),z=this._map.containerPointToLayerPoint(Z),J=this._map.layerPointToLatLng(z)),this._tooltip.setLatLng(J)}});var $0e=YR.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(m){var J=m&&m.tagName==="DIV"?m:document.createElement("div"),Z=this.options;if(Z.html instanceof Element?(qE(J),J.appendChild(Z.html)):J.innerHTML=Z.html!==!1?Z.html:"",Z.bgPos){var z=$(Z.bgPos);J.style.backgroundPosition=-z.x+"px "+-z.y+"px"}return this._setIconStyles(J,"icon"),J},createShadow:function(){return null}});function cpi(m){return new $0e(m)}YR.Default=IW;var CW=vB.extend({options:{tileSize:256,opacity:1,updateWhenIdle:he.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(m){E(this,m)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(m){m._addZoomLimit(this)},onRemove:function(m){this._removeAllTiles(),tn(this._container),m._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(xg(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Fg(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(m){return this.options.opacity=m,this._updateOpacity(),this},setZIndex:function(m){return this.options.zIndex=m,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var m=this._clampZoom(this._map.getZoom());m!==this._tileZoom&&(this._tileZoom=m,this._updateLevels()),this._update()}return this},getEvents:function(){var m={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=I(this._onMoveEnd,this.options.updateInterval,this)),m.move=this._onMove),this._zoomAnimated&&(m.zoomanim=this._animateZoom),m},createTile:function(){return document.createElement("div")},getTileSize:function(){var m=this.options.tileSize;return m instanceof _?m:new _(m,m)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(m){for(var J=this.getPane().children,Z=-m(-1/0,1/0),z=0,AA=J.length,rA;z<AA;z++)rA=J[z].style.zIndex,J[z]!==this._container&&rA&&(Z=m(Z,+rA));isFinite(Z)&&(this.options.zIndex=Z+m(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!he.ielt9){We(this._container,this.options.opacity);var m=+new Date,J=!1,Z=!1;for(var z in this._tiles){var AA=this._tiles[z];if(!(!AA.current||!AA.loaded)){var rA=Math.min(1,(m-AA.loaded)/200);We(AA.el,rA),rA<1?J=!0:(AA.active?Z=!0:this._onOpaqueTile(AA),AA.active=!0)}}Z&&!this._noPrune&&this._pruneTiles(),J&&(N(this._fadeFrame),this._fadeFrame=h(this._updateOpacity,this))}},_onOpaqueTile:C,_initContainer:function(){this._container||(this._container=Zt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var m=this._tileZoom,J=this.options.maxZoom;if(m!==void 0){for(var Z in this._levels)Z=Number(Z),this._levels[Z].el.children.length||Z===m?(this._levels[Z].el.style.zIndex=J-Math.abs(m-Z),this._onUpdateLevel(Z)):(tn(this._levels[Z].el),this._removeTilesAtZoom(Z),this._onRemoveLevel(Z),delete this._levels[Z]);var z=this._levels[m],AA=this._map;return z||(z=this._levels[m]={},z.el=Zt("div","leaflet-tile-container leaflet-zoom-animated",this._container),z.el.style.zIndex=J,z.origin=AA.project(AA.unproject(AA.getPixelOrigin()),m).round(),z.zoom=m,this._setZoomTransform(z,AA.getCenter(),AA.getZoom()),C(z.el.offsetWidth),this._onCreateLevel(z)),this._level=z,z}},_onUpdateLevel:C,_onRemoveLevel:C,_onCreateLevel:C,_pruneTiles:function(){if(this._map){var m,J,Z=this._map.getZoom();if(Z>this.options.maxZoom||Z<this.options.minZoom){this._removeAllTiles();return}for(m in this._tiles)J=this._tiles[m],J.retain=J.current;for(m in this._tiles)if(J=this._tiles[m],J.current&&!J.active){var z=J.coords;this._retainParent(z.x,z.y,z.z,z.z-5)||this._retainChildren(z.x,z.y,z.z,z.z+2)}for(m in this._tiles)this._tiles[m].retain||this._removeTile(m)}},_removeTilesAtZoom:function(m){for(var J in this._tiles)this._tiles[J].coords.z===m&&this._removeTile(J)},_removeAllTiles:function(){for(var m in this._tiles)this._removeTile(m)},_invalidateAll:function(){for(var m in this._levels)tn(this._levels[m].el),this._onRemoveLevel(Number(m)),delete this._levels[m];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(m,J,Z,z){var AA=Math.floor(m/2),rA=Math.floor(J/2),BA=Z-1,pA=new _(+AA,+rA);pA.z=+BA;var bA=this._tileCoordsToKey(pA),HA=this._tiles[bA];return HA&&HA.active?(HA.retain=!0,!0):(HA&&HA.loaded&&(HA.retain=!0),BA>z?this._retainParent(AA,rA,BA,z):!1)},_retainChildren:function(m,J,Z,z){for(var AA=2*m;AA<2*m+2;AA++)for(var rA=2*J;rA<2*J+2;rA++){var BA=new _(AA,rA);BA.z=Z+1;var pA=this._tileCoordsToKey(BA),bA=this._tiles[pA];if(bA&&bA.active){bA.retain=!0;continue}else bA&&bA.loaded&&(bA.retain=!0);Z+1<z&&this._retainChildren(AA,rA,Z+1,z)}},_resetView:function(m){var J=m&&(m.pinch||m.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),J,J)},_animateZoom:function(m){this._setView(m.center,m.zoom,!0,m.noUpdate)},_clampZoom:function(m){var J=this.options;return J.minNativeZoom!==void 0&&m<J.minNativeZoom?J.minNativeZoom:J.maxNativeZoom!==void 0&&J.maxNativeZoom<m?J.maxNativeZoom:m},_setView:function(m,J,Z,z){var AA=Math.round(J);this.options.maxZoom!==void 0&&AA>this.options.maxZoom||this.options.minZoom!==void 0&&AA<this.options.minZoom?AA=void 0:AA=this._clampZoom(AA);var rA=this.options.updateWhenZooming&&AA!==this._tileZoom;(!z||rA)&&(this._tileZoom=AA,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),AA!==void 0&&this._update(m),Z||this._pruneTiles(),this._noPrune=!!Z),this._setZoomTransforms(m,J)},_setZoomTransforms:function(m,J){for(var Z in this._levels)this._setZoomTransform(this._levels[Z],m,J)},_setZoomTransform:function(m,J,Z){var z=this._map.getZoomScale(Z,m.zoom),AA=m.origin.multiplyBy(z).subtract(this._map._getNewPixelOrigin(J,Z)).round();he.any3d?Us(m.el,AA,z):Wt(m.el,AA)},_resetGrid:function(){var m=this._map,J=m.options.crs,Z=this._tileSize=this.getTileSize(),z=this._tileZoom,AA=this._map.getPixelWorldBounds(this._tileZoom);AA&&(this._globalTileRange=this._pxBoundsToTileRange(AA)),this._wrapX=J.wrapLng&&!this.options.noWrap&&[Math.floor(m.project([0,J.wrapLng[0]],z).x/Z.x),Math.ceil(m.project([0,J.wrapLng[1]],z).x/Z.y)],this._wrapY=J.wrapLat&&!this.options.noWrap&&[Math.floor(m.project([J.wrapLat[0],0],z).y/Z.x),Math.ceil(m.project([J.wrapLat[1],0],z).y/Z.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(m){var J=this._map,Z=J._animatingZoom?Math.max(J._animateToZoom,J.getZoom()):J.getZoom(),z=J.getZoomScale(Z,this._tileZoom),AA=J.project(m,this._tileZoom).floor(),rA=J.getSize().divideBy(z*2);return new nA(AA.subtract(rA),AA.add(rA))},_update:function(m){var J=this._map;if(J){var Z=this._clampZoom(J.getZoom());if(m===void 0&&(m=J.getCenter()),this._tileZoom!==void 0){var z=this._getTiledPixelBounds(m),AA=this._pxBoundsToTileRange(z),rA=AA.getCenter(),BA=[],pA=this.options.keepBuffer,bA=new nA(AA.getBottomLeft().subtract([pA,-pA]),AA.getTopRight().add([pA,-pA]));if(!(isFinite(AA.min.x)&&isFinite(AA.min.y)&&isFinite(AA.max.x)&&isFinite(AA.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var HA in this._tiles){var Ie=this._tiles[HA].coords;(Ie.z!==this._tileZoom||!bA.contains(new _(Ie.x,Ie.y)))&&(this._tiles[HA].current=!1)}if(Math.abs(Z-this._tileZoom)>1){this._setView(m,Z);return}for(var He=AA.min.y;He<=AA.max.y;He++)for(var Jt=AA.min.x;Jt<=AA.max.x;Jt++){var Xs=new _(Jt,He);if(Xs.z=this._tileZoom,!!this._isValidTile(Xs)){var vg=this._tiles[this._tileCoordsToKey(Xs)];vg?vg.current=!0:BA.push(Xs)}}if(BA.sort(function(zr,MR){return zr.distanceTo(rA)-MR.distanceTo(rA)}),BA.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Ul=document.createDocumentFragment();for(Jt=0;Jt<BA.length;Jt++)this._addTile(BA[Jt],Ul);this._level.el.appendChild(Ul)}}}},_isValidTile:function(m){var J=this._map.options.crs;if(!J.infinite){var Z=this._globalTileRange;if(!J.wrapLng&&(m.x<Z.min.x||m.x>Z.max.x)||!J.wrapLat&&(m.y<Z.min.y||m.y>Z.max.y))return!1}if(!this.options.bounds)return!0;var z=this._tileCoordsToBounds(m);return eA(this.options.bounds).overlaps(z)},_keyToBounds:function(m){return this._tileCoordsToBounds(this._keyToTileCoords(m))},_tileCoordsToNwSe:function(m){var J=this._map,Z=this.getTileSize(),z=m.scaleBy(Z),AA=z.add(Z),rA=J.unproject(z,m.z),BA=J.unproject(AA,m.z);return[rA,BA]},_tileCoordsToBounds:function(m){var J=this._tileCoordsToNwSe(m),Z=new O(J[0],J[1]);return this.options.noWrap||(Z=this._map.wrapLatLngBounds(Z)),Z},_tileCoordsToKey:function(m){return m.x+":"+m.y+":"+m.z},_keyToTileCoords:function(m){var J=m.split(":"),Z=new _(+J[0],+J[1]);return Z.z=+J[2],Z},_removeTile:function(m){var J=this._tiles[m];J&&(tn(J.el),delete this._tiles[m],this.fire("tileunload",{tile:J.el,coords:this._keyToTileCoords(m)}))},_initTile:function(m){Se(m,"leaflet-tile");var J=this.getTileSize();m.style.width=J.x+"px",m.style.height=J.y+"px",m.onselectstart=C,m.onmousemove=C,he.ielt9&&this.options.opacity<1&&We(m,this.options.opacity)},_addTile:function(m,J){var Z=this._getTilePos(m),z=this._tileCoordsToKey(m),AA=this.createTile(this._wrapCoords(m),g(this._tileReady,this,m));this._initTile(AA),this.createTile.length<2&&h(g(this._tileReady,this,m,null,AA)),Wt(AA,Z),this._tiles[z]={el:AA,coords:m,current:!0},J.appendChild(AA),this.fire("tileloadstart",{tile:AA,coords:m})},_tileReady:function(m,J,Z){J&&this.fire("tileerror",{error:J,tile:Z,coords:m});var z=this._tileCoordsToKey(m);Z=this._tiles[z],Z&&(Z.loaded=+new Date,this._map._fadeAnimated?(We(Z.el,0),N(this._fadeFrame),this._fadeFrame=h(this._updateOpacity,this)):(Z.active=!0,this._pruneTiles()),J||(Se(Z.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:Z.el,coords:m})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),he.ielt9||!this._map._fadeAnimated?h(this._pruneTiles,this):setTimeout(g(this._pruneTiles,this),250)))},_getTilePos:function(m){return m.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(m){var J=new _(this._wrapX?r(m.x,this._wrapX):m.x,this._wrapY?r(m.y,this._wrapY):m.y);return J.z=m.z,J},_pxBoundsToTileRange:function(m){var J=this.getTileSize();return new nA(m.min.unscaleBy(J).floor(),m.max.unscaleBy(J).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var m in this._tiles)if(!this._tiles[m].loaded)return!1;return!0}});function Bpi(m){return new CW(m)}var FR=CW.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(m,J){this._url=m,J=E(this,J),J.detectRetina&&he.retina&&J.maxZoom>0?(J.tileSize=Math.floor(J.tileSize/2),J.zoomReverse?(J.zoomOffset--,J.minZoom=Math.min(J.maxZoom,J.minZoom+1)):(J.zoomOffset++,J.maxZoom=Math.max(J.minZoom,J.maxZoom-1)),J.minZoom=Math.max(0,J.minZoom)):J.zoomReverse?J.minZoom=Math.min(J.maxZoom,J.minZoom):J.maxZoom=Math.max(J.minZoom,J.maxZoom),typeof J.subdomains=="string"&&(J.subdomains=J.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(m,J){return this._url===m&&J===void 0&&(J=!0),this._url=m,J||this.redraw(),this},createTile:function(m,J){var Z=document.createElement("img");return Ke(Z,"load",g(this._tileOnLoad,this,J,Z)),Ke(Z,"error",g(this._tileOnError,this,J,Z)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(Z.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(Z.referrerPolicy=this.options.referrerPolicy),Z.alt="",Z.src=this.getTileUrl(m),Z},getTileUrl:function(m){var J={r:he.retina?"@2x":"",s:this._getSubdomain(m),x:m.x,y:m.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var Z=this._globalTileRange.max.y-m.y;this.options.tms&&(J.y=Z),J["-y"]=Z}return f(this._url,n(J,this.options))},_tileOnLoad:function(m,J){he.ielt9?setTimeout(g(m,this,null,J),0):m(null,J)},_tileOnError:function(m,J,Z){var z=this.options.errorTileUrl;z&&J.getAttribute("src")!==z&&(J.src=z),m(Z,J)},_onTileRemove:function(m){m.tile.onload=null},_getZoomForUrl:function(){var m=this._tileZoom,J=this.options.maxZoom,Z=this.options.zoomReverse,z=this.options.zoomOffset;return Z&&(m=J-m),m+z},_getSubdomain:function(m){var J=Math.abs(m.x+m.y)%this.options.subdomains.length;return this.options.subdomains[J]},_abortLoading:function(){var m,J;for(m in this._tiles)if(this._tiles[m].coords.z!==this._tileZoom&&(J=this._tiles[m].el,J.onload=C,J.onerror=C,!J.complete)){J.src=G;var Z=this._tiles[m].coords;tn(J),delete this._tiles[m],this.fire("tileabort",{tile:J,coords:Z})}},_removeTile:function(m){var J=this._tiles[m];if(J)return J.el.setAttribute("src",G),CW.prototype._removeTile.call(this,m)},_tileReady:function(m,J,Z){if(!(!this._map||Z&&Z.getAttribute("src")===G))return CW.prototype._tileReady.call(this,m,J,Z)}});function Afe(m,J){return new FR(m,J)}var efe=FR.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(m,J){this._url=m;var Z=n({},this.defaultWmsParams);for(var z in J)z in this.options||(Z[z]=J[z]);J=E(this,J);var AA=J.detectRetina&&he.retina?2:1,rA=this.getTileSize();Z.width=rA.x*AA,Z.height=rA.y*AA,this.wmsParams=Z},onAdd:function(m){this._crs=this.options.crs||m.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var J=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[J]=this._crs.code,FR.prototype.onAdd.call(this,m)},getTileUrl:function(m){var J=this._tileCoordsToNwSe(m),Z=this._crs,z=j(Z.project(J[0]),Z.project(J[1])),AA=z.min,rA=z.max,BA=(this._wmsVersion>=1.3&&this._crs===T0e?[AA.y,AA.x,rA.y,rA.x]:[AA.x,AA.y,rA.x,rA.y]).join(","),pA=FR.prototype.getTileUrl.call(this,m);return pA+u(this.wmsParams,pA,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+BA},setParams:function(m,J){return n(this.wmsParams,m),J||this.redraw(),this}});function Qpi(m,J){return new efe(m,J)}FR.WMS=efe,Afe.wms=Qpi;var Dh=vB.extend({options:{padding:.1},initialize:function(m){E(this,m),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Se(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var m={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(m.zoomanim=this._onAnimZoom),m},_onAnimZoom:function(m){this._updateTransform(m.center,m.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(m,J){var Z=this._map.getZoomScale(J,this._zoom),z=this._map.getSize().multiplyBy(.5+this.options.padding),AA=this._map.project(this._center,J),rA=z.multiplyBy(-Z).add(AA).subtract(this._map._getNewPixelOrigin(m,J));he.any3d?Us(this._container,rA,Z):Wt(this._container,rA)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var m in this._layers)this._layers[m]._reset()},_onZoomEnd:function(){for(var m in this._layers)this._layers[m]._project()},_updatePaths:function(){for(var m in this._layers)this._layers[m]._update()},_update:function(){var m=this.options.padding,J=this._map.getSize(),Z=this._map.containerPointToLayerPoint(J.multiplyBy(-m)).round();this._bounds=new nA(Z,Z.add(J.multiplyBy(1+m*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),tfe=Dh.extend({options:{tolerance:0},getEvents:function(){var m=Dh.prototype.getEvents.call(this);return m.viewprereset=this._onViewPreReset,m},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Dh.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var m=this._container=document.createElement("canvas");Ke(m,"mousemove",this._onMouseMove,this),Ke(m,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ke(m,"mouseout",this._handleMouseOut,this),m._leaflet_disable_events=!0,this._ctx=m.getContext("2d")},_destroyContainer:function(){N(this._redrawRequest),delete this._ctx,tn(this._container),En(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var m;this._redrawBounds=null;for(var J in this._layers)m=this._layers[J],m._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Dh.prototype._update.call(this);var m=this._bounds,J=this._container,Z=m.getSize(),z=he.retina?2:1;Wt(J,m.min),J.width=z*Z.x,J.height=z*Z.y,J.style.width=Z.x+"px",J.style.height=Z.y+"px",he.retina&&this._ctx.scale(2,2),this._ctx.translate(-m.min.x,-m.min.y),this.fire("update")}},_reset:function(){Dh.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(m){this._updateDashArray(m),this._layers[s(m)]=m;var J=m._order={layer:m,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=J),this._drawLast=J,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(m){this._requestRedraw(m)},_removePath:function(m){var J=m._order,Z=J.next,z=J.prev;Z?Z.prev=z:this._drawLast=z,z?z.next=Z:this._drawFirst=Z,delete m._order,delete this._layers[s(m)],this._requestRedraw(m)},_updatePath:function(m){this._extendRedrawBounds(m),m._project(),m._update(),this._requestRedraw(m)},_updateStyle:function(m){this._updateDashArray(m),this._requestRedraw(m)},_updateDashArray:function(m){if(typeof m.options.dashArray=="string"){var J=m.options.dashArray.split(/[, ]+/),Z=[],z,AA;for(AA=0;AA<J.length;AA++){if(z=Number(J[AA]),isNaN(z))return;Z.push(z)}m.options._dashArray=Z}else m.options._dashArray=m.options.dashArray},_requestRedraw:function(m){this._map&&(this._extendRedrawBounds(m),this._redrawRequest=this._redrawRequest||h(this._redraw,this))},_extendRedrawBounds:function(m){if(m._pxBounds){var J=(m.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new nA,this._redrawBounds.extend(m._pxBounds.min.subtract([J,J])),this._redrawBounds.extend(m._pxBounds.max.add([J,J]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var m=this._redrawBounds;if(m){var J=m.getSize();this._ctx.clearRect(m.min.x,m.min.y,J.x,J.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var m,J=this._redrawBounds;if(this._ctx.save(),J){var Z=J.getSize();this._ctx.beginPath(),this._ctx.rect(J.min.x,J.min.y,Z.x,Z.y),this._ctx.clip()}this._drawing=!0;for(var z=this._drawFirst;z;z=z.next)m=z.layer,(!J||m._pxBounds&&m._pxBounds.intersects(J))&&m._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(m,J){if(this._drawing){var Z,z,AA,rA,BA=m._parts,pA=BA.length,bA=this._ctx;if(pA){for(bA.beginPath(),Z=0;Z<pA;Z++){for(z=0,AA=BA[Z].length;z<AA;z++)rA=BA[Z][z],bA[z?"lineTo":"moveTo"](rA.x,rA.y);J&&bA.closePath()}this._fillStroke(bA,m)}}},_updateCircle:function(m){if(!(!this._drawing||m._empty())){var J=m._point,Z=this._ctx,z=Math.max(Math.round(m._radius),1),AA=(Math.max(Math.round(m._radiusY),1)||z)/z;AA!==1&&(Z.save(),Z.scale(1,AA)),Z.beginPath(),Z.arc(J.x,J.y/AA,z,0,Math.PI*2,!1),AA!==1&&Z.restore(),this._fillStroke(Z,m)}},_fillStroke:function(m,J){var Z=J.options;Z.fill&&(m.globalAlpha=Z.fillOpacity,m.fillStyle=Z.fillColor||Z.color,m.fill(Z.fillRule||"evenodd")),Z.stroke&&Z.weight!==0&&(m.setLineDash&&m.setLineDash(J.options&&J.options._dashArray||[]),m.globalAlpha=Z.opacity,m.lineWidth=Z.weight,m.strokeStyle=Z.color,m.lineCap=Z.lineCap,m.lineJoin=Z.lineJoin,m.stroke())},_onClick:function(m){for(var J=this._map.mouseEventToLayerPoint(m),Z,z,AA=this._drawFirst;AA;AA=AA.next)Z=AA.layer,Z.options.interactive&&Z._containsPoint(J)&&(!(m.type==="click"||m.type==="preclick")||!this._map._draggableMoved(Z))&&(z=Z);this._fireEvent(z?[z]:!1,m)},_onMouseMove:function(m){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var J=this._map.mouseEventToLayerPoint(m);this._handleMouseHover(m,J)}},_handleMouseOut:function(m){var J=this._hoveredLayer;J&&(Mt(this._container,"leaflet-interactive"),this._fireEvent([J],m,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(m,J){if(!this._mouseHoverThrottled){for(var Z,z,AA=this._drawFirst;AA;AA=AA.next)Z=AA.layer,Z.options.interactive&&Z._containsPoint(J)&&(z=Z);z!==this._hoveredLayer&&(this._handleMouseOut(m),z&&(Se(this._container,"leaflet-interactive"),this._fireEvent([z],m,"mouseover"),this._hoveredLayer=z)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,m),this._mouseHoverThrottled=!0,setTimeout(g(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(m,J,Z){this._map._fireDOMEvent(J,Z||J.type,m)},_bringToFront:function(m){var J=m._order;if(J){var Z=J.next,z=J.prev;if(Z)Z.prev=z;else return;z?z.next=Z:Z&&(this._drawFirst=Z),J.prev=this._drawLast,this._drawLast.next=J,J.next=null,this._drawLast=J,this._requestRedraw(m)}},_bringToBack:function(m){var J=m._order;if(J){var Z=J.next,z=J.prev;if(z)z.next=Z;else return;Z?Z.prev=z:z&&(this._drawLast=z),J.prev=null,J.next=this._drawFirst,this._drawFirst.prev=J,this._drawFirst=J,this._requestRedraw(m)}}});function ife(m){return he.canvas?new tfe(m):null}var lW=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(m){return document.createElement("<lvml:"+m+' class="lvml">')}}catch{}return function(m){return document.createElement("<"+m+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Epi={_initContainer:function(){this._container=Zt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Dh.prototype._update.call(this),this.fire("update"))},_initPath:function(m){var J=m._container=lW("shape");Se(J,"leaflet-vml-shape "+(this.options.className||"")),J.coordsize="1 1",m._path=lW("path"),J.appendChild(m._path),this._updateStyle(m),this._layers[s(m)]=m},_addPath:function(m){var J=m._container;this._container.appendChild(J),m.options.interactive&&m.addInteractiveTarget(J)},_removePath:function(m){var J=m._container;tn(J),m.removeInteractiveTarget(J),delete this._layers[s(m)]},_updateStyle:function(m){var J=m._stroke,Z=m._fill,z=m.options,AA=m._container;AA.stroked=!!z.stroke,AA.filled=!!z.fill,z.stroke?(J||(J=m._stroke=lW("stroke")),AA.appendChild(J),J.weight=z.weight+"px",J.color=z.color,J.opacity=z.opacity,z.dashArray?J.dashStyle=w(z.dashArray)?z.dashArray.join(" "):z.dashArray.replace(/( *, *)/g," "):J.dashStyle="",J.endcap=z.lineCap.replace("butt","flat"),J.joinstyle=z.lineJoin):J&&(AA.removeChild(J),m._stroke=null),z.fill?(Z||(Z=m._fill=lW("fill")),AA.appendChild(Z),Z.color=z.fillColor||z.color,Z.opacity=z.fillOpacity):Z&&(AA.removeChild(Z),m._fill=null)},_updateCircle:function(m){var J=m._point.round(),Z=Math.round(m._radius),z=Math.round(m._radiusY||Z);this._setPath(m,m._empty()?"M0 0":"AL "+J.x+","+J.y+" "+Z+","+z+" 0,"+65535*360)},_setPath:function(m,J){m._path.v=J},_bringToFront:function(m){xg(m._container)},_bringToBack:function(m){Fg(m._container)}},cP=he.vml?lW:fA,cW=Dh.extend({_initContainer:function(){this._container=cP("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=cP("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){tn(this._container),En(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Dh.prototype._update.call(this);var m=this._bounds,J=m.getSize(),Z=this._container;(!this._svgSize||!this._svgSize.equals(J))&&(this._svgSize=J,Z.setAttribute("width",J.x),Z.setAttribute("height",J.y)),Wt(Z,m.min),Z.setAttribute("viewBox",[m.min.x,m.min.y,J.x,J.y].join(" ")),this.fire("update")}},_initPath:function(m){var J=m._path=cP("path");m.options.className&&Se(J,m.options.className),m.options.interactive&&Se(J,"leaflet-interactive"),this._updateStyle(m),this._layers[s(m)]=m},_addPath:function(m){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(m._path),m.addInteractiveTarget(m._path)},_removePath:function(m){tn(m._path),m.removeInteractiveTarget(m._path),delete this._layers[s(m)]},_updatePath:function(m){m._project(),m._update()},_updateStyle:function(m){var J=m._path,Z=m.options;J&&(Z.stroke?(J.setAttribute("stroke",Z.color),J.setAttribute("stroke-opacity",Z.opacity),J.setAttribute("stroke-width",Z.weight),J.setAttribute("stroke-linecap",Z.lineCap),J.setAttribute("stroke-linejoin",Z.lineJoin),Z.dashArray?J.setAttribute("stroke-dasharray",Z.dashArray):J.removeAttribute("stroke-dasharray"),Z.dashOffset?J.setAttribute("stroke-dashoffset",Z.dashOffset):J.removeAttribute("stroke-dashoffset")):J.setAttribute("stroke","none"),Z.fill?(J.setAttribute("fill",Z.fillColor||Z.color),J.setAttribute("fill-opacity",Z.fillOpacity),J.setAttribute("fill-rule",Z.fillRule||"evenodd")):J.setAttribute("fill","none"))},_updatePoly:function(m,J){this._setPath(m,hA(m._parts,J))},_updateCircle:function(m){var J=m._point,Z=Math.max(Math.round(m._radius),1),z=Math.max(Math.round(m._radiusY),1)||Z,AA="a"+Z+","+z+" 0 1,0 ",rA=m._empty()?"M0 0":"M"+(J.x-Z)+","+J.y+AA+Z*2+",0 "+AA+-Z*2+",0 ";this._setPath(m,rA)},_setPath:function(m,J){m._path.setAttribute("d",J)},_bringToFront:function(m){xg(m._path)},_bringToBack:function(m){Fg(m._path)}});he.vml&&cW.include(Epi);function nfe(m){return he.svg||he.vml?new cW(m):null}$t.include({getRenderer:function(m){var J=m.options.renderer||this._getPaneRenderer(m.options.pane)||this.options.renderer||this._renderer;return J||(J=this._renderer=this._createRenderer()),this.hasLayer(J)||this.addLayer(J),J},_getPaneRenderer:function(m){if(m==="overlayPane"||m===void 0)return!1;var J=this._paneRenderers[m];return J===void 0&&(J=this._createRenderer({pane:m}),this._paneRenderers[m]=J),J},_createRenderer:function(m){return this.options.preferCanvas&&ife(m)||nfe(m)}});var ofe=RR.extend({initialize:function(m,J){RR.prototype.initialize.call(this,this._boundsToLatLngs(m),J)},setBounds:function(m){return this.setLatLngs(this._boundsToLatLngs(m))},_boundsToLatLngs:function(m){return m=eA(m),[m.getSouthWest(),m.getNorthWest(),m.getNorthEast(),m.getSouthEast()]}});function upi(m,J){return new ofe(m,J)}cW.create=cP,cW.pointsToPath=hA,wh.geometryToLayer=gP,wh.coordsToLatLng=tbA,wh.coordsToLatLngs=aP,wh.latLngToCoords=ibA,wh.latLngsToCoords=sP,wh.getFeature=xR,wh.asFeature=rP,$t.mergeOptions({boxZoom:!0});var gfe=$E.extend({initialize:function(m){this._map=m,this._container=m._container,this._pane=m._panes.overlayPane,this._resetStateTimeout=0,m.on("unload",this._destroy,this)},addHooks:function(){Ke(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){En(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){tn(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(m){if(!m.shiftKey||m.which!==1&&m.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),YB(),ph(),this._startPoint=this._map.mouseEventToContainerPoint(m),Ke(document,{contextmenu:hD,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(m){this._moved||(this._moved=!0,this._box=Zt("div","leaflet-zoom-box",this._container),Se(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(m);var J=new nA(this._point,this._startPoint),Z=J.getSize();Wt(this._box,J.min),this._box.style.width=Z.x+"px",this._box.style.height=Z.y+"px"},_finish:function(){this._moved&&(tn(this._box),Mt(this._container,"leaflet-crosshair")),ko(),xB(),En(document,{contextmenu:hD,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(m){if(!(m.which!==1&&m.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(g(this._resetState,this),0);var J=new O(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(J).fire("boxzoomend",{boxZoomBounds:J})}},_onKeyDown:function(m){m.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});$t.addInitHook("addHandler","boxZoom",gfe),$t.mergeOptions({doubleClickZoom:!0});var afe=$E.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(m){var J=this._map,Z=J.getZoom(),z=J.options.zoomDelta,AA=m.originalEvent.shiftKey?Z-z:Z+z;J.options.doubleClickZoom==="center"?J.setZoom(AA):J.setZoomAround(m.containerPoint,AA)}});$t.addInitHook("addHandler","doubleClickZoom",afe),$t.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var sfe=$E.extend({addHooks:function(){if(!this._draggable){var m=this._map;this._draggable=new ff(m._mapPane,m._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),m.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),m.on("zoomend",this._onZoomEnd,this),m.whenReady(this._onZoomEnd,this))}Se(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Mt(this._map._container,"leaflet-grab"),Mt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var m=this._map;if(m._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var J=eA(this._map.options.maxBounds);this._offsetLimit=j(this._map.latLngToContainerPoint(J.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(J.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;m.fire("movestart").fire("dragstart"),m.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(m){if(this._map.options.inertia){var J=this._lastTime=+new Date,Z=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(Z),this._times.push(J),this._prunePositions(J)}this._map.fire("move",m).fire("drag",m)},_prunePositions:function(m){for(;this._positions.length>1&&m-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var m=this._map.getSize().divideBy(2),J=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=J.subtract(m).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(m,J){return m-(m-J)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var m=this._draggable._newPos.subtract(this._draggable._startPos),J=this._offsetLimit;m.x<J.min.x&&(m.x=this._viscousLimit(m.x,J.min.x)),m.y<J.min.y&&(m.y=this._viscousLimit(m.y,J.min.y)),m.x>J.max.x&&(m.x=this._viscousLimit(m.x,J.max.x)),m.y>J.max.y&&(m.y=this._viscousLimit(m.y,J.max.y)),this._draggable._newPos=this._draggable._startPos.add(m)}},_onPreDragWrap:function(){var m=this._worldWidth,J=Math.round(m/2),Z=this._initialWorldOffset,z=this._draggable._newPos.x,AA=(z-J+Z)%m+J-Z,rA=(z+J+Z)%m-J-Z,BA=Math.abs(AA+Z)<Math.abs(rA+Z)?AA:rA;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=BA},_onDragEnd:function(m){var J=this._map,Z=J.options,z=!Z.inertia||m.noInertia||this._times.length<2;if(J.fire("dragend",m),z)J.fire("moveend");else{this._prunePositions(+new Date);var AA=this._lastPos.subtract(this._positions[0]),rA=(this._lastTime-this._times[0])/1e3,BA=Z.easeLinearity,pA=AA.multiplyBy(BA/rA),bA=pA.distanceTo([0,0]),HA=Math.min(Z.inertiaMaxSpeed,bA),Ie=pA.multiplyBy(HA/bA),He=HA/(Z.inertiaDeceleration*BA),Jt=Ie.multiplyBy(-He/2).round();!Jt.x&&!Jt.y?J.fire("moveend"):(Jt=J._limitOffset(Jt,J.options.maxBounds),h(function(){J.panBy(Jt,{duration:He,easeLinearity:BA,noMoveStart:!0,animate:!0})}))}}});$t.addInitHook("addHandler","dragging",sfe),$t.mergeOptions({keyboard:!0,keyboardPanDelta:80});var rfe=$E.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(m){this._map=m,this._setPanDelta(m.options.keyboardPanDelta),this._setZoomDelta(m.options.zoomDelta)},addHooks:function(){var m=this._map._container;m.tabIndex<=0&&(m.tabIndex="0"),Ke(m,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),En(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var m=document.body,J=document.documentElement,Z=m.scrollTop||J.scrollTop,z=m.scrollLeft||J.scrollLeft;this._map._container.focus(),window.scrollTo(z,Z)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(m){var J=this._panKeys={},Z=this.keyCodes,z,AA;for(z=0,AA=Z.left.length;z<AA;z++)J[Z.left[z]]=[-1*m,0];for(z=0,AA=Z.right.length;z<AA;z++)J[Z.right[z]]=[m,0];for(z=0,AA=Z.down.length;z<AA;z++)J[Z.down[z]]=[0,m];for(z=0,AA=Z.up.length;z<AA;z++)J[Z.up[z]]=[0,-1*m]},_setZoomDelta:function(m){var J=this._zoomKeys={},Z=this.keyCodes,z,AA;for(z=0,AA=Z.zoomIn.length;z<AA;z++)J[Z.zoomIn[z]]=m;for(z=0,AA=Z.zoomOut.length;z<AA;z++)J[Z.zoomOut[z]]=-m},_addHooks:function(){Ke(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){En(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(m){if(!(m.altKey||m.ctrlKey||m.metaKey)){var J=m.keyCode,Z=this._map,z;if(J in this._panKeys){if(!Z._panAnim||!Z._panAnim._inProgress)if(z=this._panKeys[J],m.shiftKey&&(z=$(z).multiplyBy(3)),Z.options.maxBounds&&(z=Z._limitOffset($(z),Z.options.maxBounds)),Z.options.worldCopyJump){var AA=Z.wrapLatLng(Z.unproject(Z.project(Z.getCenter()).add(z)));Z.panTo(AA)}else Z.panBy(z)}else if(J in this._zoomKeys)Z.setZoom(Z.getZoom()+(m.shiftKey?3:1)*this._zoomKeys[J]);else if(J===27&&Z._popup&&Z._popup.options.closeOnEscapeKey)Z.closePopup();else return;hD(m)}}});$t.addInitHook("addHandler","keyboard",rfe),$t.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Ife=$E.extend({addHooks:function(){Ke(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){En(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(m){var J=F0e(m),Z=this._map.options.wheelDebounceTime;this._delta+=J,this._lastMousePos=this._map.mouseEventToContainerPoint(m),this._startTime||(this._startTime=+new Date);var z=Math.max(Z-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(g(this._performZoom,this),z),hD(m)},_performZoom:function(){var m=this._map,J=m.getZoom(),Z=this._map.options.zoomSnap||0;m._stop();var z=this._delta/(this._map.options.wheelPxPerZoomLevel*4),AA=4*Math.log(2/(1+Math.exp(-Math.abs(z))))/Math.LN2,rA=Z?Math.ceil(AA/Z)*Z:AA,BA=m._limitZoom(J+(this._delta>0?rA:-rA))-J;this._delta=0,this._startTime=null,BA&&(m.options.scrollWheelZoom==="center"?m.setZoom(J+BA):m.setZoomAround(this._lastMousePos,J+BA))}});$t.addInitHook("addHandler","scrollWheelZoom",Ife);var dpi=600;$t.mergeOptions({tapHold:he.touchNative&&he.safari&&he.mobile,tapTolerance:15});var Cfe=$E.extend({addHooks:function(){Ke(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){En(this._map._container,"touchstart",this._onDown,this)},_onDown:function(m){if(clearTimeout(this._holdTimeout),m.touches.length===1){var J=m.touches[0];this._startPos=this._newPos=new _(J.clientX,J.clientY),this._holdTimeout=setTimeout(g(function(){this._cancel(),this._isTapValid()&&(Ke(document,"touchend",Ea),Ke(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",J))},this),dpi),Ke(document,"touchend touchcancel contextmenu",this._cancel,this),Ke(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function m(){En(document,"touchend",Ea),En(document,"touchend touchcancel",m)},_cancel:function(){clearTimeout(this._holdTimeout),En(document,"touchend touchcancel contextmenu",this._cancel,this),En(document,"touchmove",this._onMove,this)},_onMove:function(m){var J=m.touches[0];this._newPos=new _(J.clientX,J.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(m,J){var Z=new MouseEvent(m,{bubbles:!0,cancelable:!0,view:window,screenX:J.screenX,screenY:J.screenY,clientX:J.clientX,clientY:J.clientY});Z._simulated=!0,J.target.dispatchEvent(Z)}});$t.addInitHook("addHandler","tapHold",Cfe),$t.mergeOptions({touchZoom:he.touch,bounceAtZoomLimits:!0});var lfe=$E.extend({addHooks:function(){Se(this._map._container,"leaflet-touch-zoom"),Ke(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Mt(this._map._container,"leaflet-touch-zoom"),En(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(m){var J=this._map;if(!(!m.touches||m.touches.length!==2||J._animatingZoom||this._zooming)){var Z=J.mouseEventToContainerPoint(m.touches[0]),z=J.mouseEventToContainerPoint(m.touches[1]);this._centerPoint=J.getSize()._divideBy(2),this._startLatLng=J.containerPointToLatLng(this._centerPoint),J.options.touchZoom!=="center"&&(this._pinchStartLatLng=J.containerPointToLatLng(Z.add(z)._divideBy(2))),this._startDist=Z.distanceTo(z),this._startZoom=J.getZoom(),this._moved=!1,this._zooming=!0,J._stop(),Ke(document,"touchmove",this._onTouchMove,this),Ke(document,"touchend touchcancel",this._onTouchEnd,this),Ea(m)}},_onTouchMove:function(m){if(!(!m.touches||m.touches.length!==2||!this._zooming)){var J=this._map,Z=J.mouseEventToContainerPoint(m.touches[0]),z=J.mouseEventToContainerPoint(m.touches[1]),AA=Z.distanceTo(z)/this._startDist;if(this._zoom=J.getScaleZoom(AA,this._startZoom),!J.options.bounceAtZoomLimits&&(this._zoom<J.getMinZoom()&&AA<1||this._zoom>J.getMaxZoom()&&AA>1)&&(this._zoom=J._limitZoom(this._zoom)),J.options.touchZoom==="center"){if(this._center=this._startLatLng,AA===1)return}else{var rA=Z._add(z)._divideBy(2)._subtract(this._centerPoint);if(AA===1&&rA.x===0&&rA.y===0)return;this._center=J.unproject(J.project(this._pinchStartLatLng,this._zoom).subtract(rA),this._zoom)}this._moved||(J._moveStart(!0,!1),this._moved=!0),N(this._animRequest);var BA=g(J._move,J,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=h(BA,this,!0),Ea(m)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,N(this._animRequest),En(document,"touchmove",this._onTouchMove,this),En(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});$t.addInitHook("addHandler","touchZoom",lfe),$t.BoxZoom=gfe,$t.DoubleClickZoom=afe,$t.Drag=sfe,$t.Keyboard=rfe,$t.ScrollWheelZoom=Ife,$t.TapHold=Cfe,$t.TouchZoom=lfe,t.Bounds=nA,t.Browser=he,t.CRS=sA,t.Canvas=tfe,t.Circle=ebA,t.CircleMarker=oP,t.Class=K,t.Control=MB,t.DivIcon=$0e,t.DivOverlay=Au,t.DomEvent=vmi,t.DomUtil=Rn,t.Draggable=ff,t.Evented=X,t.FeatureGroup=yh,t.GeoJSON=wh,t.GridLayer=CW,t.Handler=$E,t.Icon=YR,t.ImageOverlay=IP,t.LatLng=oA,t.LatLngBounds=O,t.Layer=vB,t.LayerGroup=NR,t.LineUtil=Omi,t.Map=$t,t.Marker=nP,t.Mixin=Umi,t.Path=yf,t.Point=_,t.PolyUtil=Vmi,t.Polygon=RR,t.Polyline=bh,t.Popup=CP,t.PosAnimation=M0e,t.Projection=qmi,t.Rectangle=ofe,t.Renderer=Dh,t.SVG=cW,t.SVGOverlay=P0e,t.TileLayer=FR,t.Tooltip=lP,t.Transformation=lA,t.Util=v,t.VideoOverlay=j0e,t.bind=g,t.bounds=j,t.canvas=ife,t.circle=npi,t.circleMarker=ipi,t.control=sW,t.divIcon=cpi,t.extend=n,t.featureGroup=Api,t.geoJSON=q0e,t.geoJson=api,t.gridLayer=Bpi,t.icon=epi,t.imageOverlay=spi,t.latLng=tA,t.latLngBounds=eA,t.layerGroup=$mi,t.map=Lmi,t.marker=tpi,t.point=$,t.polygon=gpi,t.polyline=opi,t.popup=Cpi,t.rectangle=upi,t.setOptions=E,t.stamp=s,t.svg=nfe,t.svgOverlay=Ipi,t.tileLayer=Afe,t.tooltip=lpi,t.transformation=CA,t.version=i,t.videoOverlay=rpi;var hpi=window.L;t.noConflict=function(){return window.L=hpi,this},window.L=t})})(ugA,ugA.exports);var uc=ugA.exports;function Uy(A,e,t){return Object.freeze({instance:A,context:e,container:t})}function CM(A,e){return e==null?function(t,i){const n=p.useRef();return n.current||(n.current=A(t,i)),n}:function(t,i){const n=p.useRef();n.current||(n.current=A(t,i));const o=p.useRef(t),{instance:g}=n.current;return p.useEffect(function(){o.current!==t&&(e(g,t,o.current),o.current=t)},[g,t,i]),n}}function r3A(A,e){p.useEffect(function(){return(e.layerContainer??e.map).addLayer(A.instance),function(){var t;(t=e.layerContainer)==null||t.removeLayer(A.instance),e.map.removeLayer(A.instance)}},[e,A])}function I3A(A){return function(e){const t=IM(),i=A(l9(e,t),t);return n3A(t.map,e.attribution),EgA(i.current,e.eventHandlers),r3A(i.current,t),i}}function f8e(A,e){const t=p.useRef();p.useEffect(function(){if(e.pathOptions!==t.current){const i=e.pathOptions??{};A.instance.setStyle(i),t.current=i}},[A,e])}function y8e(A){return function(e){const t=IM(),i=A(l9(e,t),t);return EgA(i.current,e.eventHandlers),r3A(i.current,t),f8e(i.current,e),i}}function b8e(A){function e(n,o){return Uy(A(n),o)}const t=CM(e),i=m8e(t);return s3A(i)}function w8e(A,e){const t=CM(A,e),i=I3A(t);return a3A(i)}function D8e(A,e){const t=CM(A),i=p8e(t,e);return h8e(i)}function dgA(A,e){const t=CM(A,e),i=y8e(t);return a3A(i)}function G8e(A,e){const t=CM(A,e),i=I3A(t);return s3A(i)}function k8e(A,e,t){const{opacity:i,zIndex:n}=e;i!=null&&i!==t.opacity&&A.setOpacity(i),n!=null&&n!==t.zIndex&&A.setZIndex(n)}function J8e(){return IM().map}const hgA=b8e(function(A){return new uc.Control.Attribution(A)}),mgA=dgA(function({center:A,children:e,...t},i){const n=new uc.CircleMarker(A,t);return Uy(n,C9(i,{overlayContainer:n}))},E8e),N8e=dgA(function({data:A,...e},t){const i=new uc.GeoJSON(A,e);return Uy(i,C9(t,{overlayContainer:i}))},function(A,e,t){e.style!==t.style&&(e.style==null?A.resetStyle():A.setStyle(e.style))});function pgA(){return pgA=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},pgA.apply(this,arguments)}function Y8e({bounds:A,boundsOptions:e,center:t,children:i,className:n,id:o,placeholder:g,style:a,whenReady:s,zoom:I,...r},C){const[l]=p.useState({className:n,id:o,style:a}),[c,B]=p.useState(null);p.useImperativeHandle(C,()=>(c==null?void 0:c.map)??null,[c]);const E=p.useCallback(d=>{if(d!==null&&c===null){const f=new uc.Map(d,r);t!=null&&I!=null?f.setView(t,I):A!=null&&f.fitBounds(A,e),s!=null&&f.whenReady(s),B(d8e(f))}},[]);p.useEffect(()=>()=>{c==null||c.map.remove()},[c]);const u=c?b.createElement(g3A,{value:c},i):g??null;return b.createElement("div",pgA({},l,{ref:E}),u)}const fgA=p.forwardRef(Y8e),C3A=w8e(function({position:A,...e},t){const i=new uc.Marker(A,e);return Uy(i,C9(t,{overlayContainer:i}))},function(A,e,t){e.position!==t.position&&A.setLatLng(e.position),e.icon!=null&&e.icon!==t.icon&&A.setIcon(e.icon),e.zIndexOffset!=null&&e.zIndexOffset!==t.zIndexOffset&&A.setZIndexOffset(e.zIndexOffset),e.opacity!=null&&e.opacity!==t.opacity&&A.setOpacity(e.opacity),A.dragging!=null&&e.draggable!==t.draggable&&(e.draggable===!0?A.dragging.enable():A.dragging.disable())}),l3A=dgA(function({positions:A,...e},t){const i=new uc.Polygon(A,e);return Uy(i,C9(t,{overlayContainer:i}))},function(A,e,t){e.positions!==t.positions&&A.setLatLngs(e.positions)}),lM=G8e(function({url:A,...e},t){const i=new uc.TileLayer(A,l9(e,t));return Uy(i,t)},function(A,e,t){k8e(A,e,t);const{url:i}=e;i!=null&&i!==t.url&&A.setUrl(i)}),cM=D8e(function(A,e){const t=new uc.Tooltip(A,e.overlayContainer);return Uy(t,e)},function(A,e,{position:t},i){p.useEffect(function(){const n=e.overlayContainer;if(n==null)return;const{instance:o}=A,g=s=>{s.tooltip===o&&(t!=null&&o.setLatLng(t),o.update(),i(!0))},a=s=>{s.tooltip===o&&i(!1)};return n.on({tooltipopen:g,tooltipclose:a}),n.bindTooltip(o),function(){n.off({tooltipopen:g,tooltipclose:a}),n._map!=null&&n.unbindTooltip()}},[A,e,i,t])});function Oo(A,e){return A==null||e==null?NaN:A<e?-1:A>e?1:A>=e?0:NaN}function BM(A,e){return A==null||e==null?NaN:e<A?-1:e>A?1:e>=A?0:NaN}function Vy(A){let e,t,i;A.length!==2?(e=Oo,t=(a,s)=>Oo(A(a),s),i=(a,s)=>A(a)-s):(e=A===Oo||A===BM?A:R8e,t=A,i=A);function n(a,s,I=0,r=a.length){if(I<r){if(e(s,s)!==0)return r;do{const C=I+r>>>1;t(a[C],s)<0?I=C+1:r=C}while(I<r)}return I}function o(a,s,I=0,r=a.length){if(I<r){if(e(s,s)!==0)return r;do{const C=I+r>>>1;t(a[C],s)<=0?I=C+1:r=C}while(I<r)}return I}function g(a,s,I=0,r=a.length){const C=n(a,s,I,r-1);return C>I&&i(a[C-1],s)>-i(a[C],s)?C-1:C}return{left:n,center:g,right:o}}function R8e(){return 0}function c3A(A){return A===null?NaN:+A}function*x8e(A,e){if(e===void 0)for(let t of A)t!=null&&(t=+t)>=t&&(yield t);else{let t=-1;for(let i of A)(i=e(i,++t,A))!=null&&(i=+i)>=i&&(yield i)}}const B3A=Vy(Oo),c9=B3A.right,F8e=B3A.left;Vy(c3A).center;const jk=c9;function B9(A,e){let t=0;if(e===void 0)for(let i of A)i!=null&&(i=+i)>=i&&++t;else{let i=-1;for(let n of A)(n=e(n,++i,A))!=null&&(n=+n)>=n&&++t}return t}function M8e(A){return A.length|0}function v8e(A){return!(A>0)}function L8e(A){return typeof A!="object"||"length"in A?A:Array.from(A)}function S8e(A){return e=>A(...e)}function H8e(...A){const e=typeof A[A.length-1]=="function"&&S8e(A.pop());A=A.map(L8e);const t=A.map(M8e),i=A.length-1,n=new Array(i+1).fill(0),o=[];if(i<0||t.some(v8e))return o;for(;;){o.push(n.map((a,s)=>A[s][a]));let g=i;for(;++n[g]===t[g];){if(g===0)return e?o.map(e):o;n[g--]=0}}}function Z8e(A,e){var t=0,i=0;return Float64Array.from(A,e===void 0?n=>t+=+n||0:n=>t+=+e(n,i++,A)||0)}function Q3A(A,e){let t=0,i,n=0,o=0;if(e===void 0)for(let g of A)g!=null&&(g=+g)>=g&&(i=g-n,n+=i/++t,o+=i*(g-n));else{let g=-1;for(let a of A)(a=e(a,++g,A))!=null&&(a=+a)>=a&&(i=a-n,n+=i/++t,o+=i*(a-n))}if(t>1)return o/(t-1)}function ygA(A,e){const t=Q3A(A,e);return t&&Math.sqrt(t)}function _C(A,e){let t,i;if(e===void 0)for(const n of A)n!=null&&(t===void 0?n>=n&&(t=i=n):(t>n&&(t=n),i<n&&(i=n)));else{let n=-1;for(let o of A)(o=e(o,++n,A))!=null&&(t===void 0?o>=o&&(t=i=o):(t>o&&(t=o),i<o&&(i=o)))}return[t,i]}class ao{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let i=0;for(let n=0;n<this._n&&n<32;n++){const o=t[n],g=e+o,a=Math.abs(e)<Math.abs(o)?e-(g-o):o-(g-e);a&&(t[i++]=a),e=g}return t[i]=e,this._n=i+1,this}valueOf(){const e=this._partials;let t=this._n,i,n,o,g=0;if(t>0){for(g=e[--t];t>0&&(i=g,n=e[--t],g=i+n,o=n-(g-i),!o););t>0&&(o<0&&e[t-1]<0||o>0&&e[t-1]>0)&&(n=o*2,i=g+n,n==i-g&&(g=i))}return g}}class Xy extends Map{constructor(e,t=d3A){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(const[i,n]of e)this.set(i,n)}get(e){return super.get(bgA(this,e))}has(e){return super.has(bgA(this,e))}set(e,t){return super.set(E3A(this,e),t)}delete(e){return super.delete(u3A(this,e))}}class qm extends Set{constructor(e,t=d3A){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(const i of e)this.add(i)}has(e){return super.has(bgA(this,e))}add(e){return super.add(E3A(this,e))}delete(e){return super.delete(u3A(this,e))}}function bgA({_intern:A,_key:e},t){const i=e(t);return A.has(i)?A.get(i):t}function E3A({_intern:A,_key:e},t){const i=e(t);return A.has(i)?A.get(i):(A.set(i,t),t)}function u3A({_intern:A,_key:e},t){const i=e(t);return A.has(i)&&(t=A.get(i),A.delete(i)),t}function d3A(A){return A!==null&&typeof A=="object"?A.valueOf():A}function wgA(A){return A}function QM(A,...e){return DgA(A,wgA,wgA,e)}function Pk(A,e,...t){return DgA(A,wgA,e,t)}function W8e(A,e,...t){return DgA(A,Array.from,e,t)}function DgA(A,e,t,i){return function n(o,g){if(g>=i.length)return t(o);const a=new Xy,s=i[g++];let I=-1;for(const r of o){const C=s(r,++I,o),l=a.get(C);l?l.push(r):a.set(C,[r])}for(const[r,C]of a)a.set(r,n(C,g));return e(a)}(A,0)}function h3A(A,e){return Array.from(e,t=>A[t])}function Q9(A,...e){if(typeof A[Symbol.iterator]!="function")throw new TypeError("values is not iterable");A=Array.from(A);let[t]=e;if(t&&t.length!==2||e.length>1){const i=Uint32Array.from(A,(n,o)=>o);return e.length>1?(e=e.map(n=>A.map(n)),i.sort((n,o)=>{for(const g of e){const a=EM(g[n],g[o]);if(a)return a}})):(t=A.map(t),i.sort((n,o)=>EM(t[n],t[o]))),h3A(A,i)}return A.sort(GgA(t))}function GgA(A=Oo){if(A===Oo)return EM;if(typeof A!="function")throw new TypeError("compare is not a function");return(e,t)=>{const i=A(e,t);return i||i===0?i:(A(t,t)===0)-(A(e,e)===0)}}function EM(A,e){return(A==null||!(A>=A))-(e==null||!(e>=e))||(A<e?-1:A>e?1:0)}function kgA(A,e,t){return(e.length!==2?Q9(Pk(A,e,t),([i,n],[o,g])=>Oo(n,g)||Oo(i,o)):Q9(QM(A,t),([i,n],[o,g])=>e(n,g)||Oo(i,o))).map(([i])=>i)}const K8e=Math.sqrt(50),U8e=Math.sqrt(10),V8e=Math.sqrt(2);function E9(A,e,t){const i=(e-A)/Math.max(0,t),n=Math.floor(Math.log10(i)),o=i/Math.pow(10,n),g=o>=K8e?10:o>=U8e?5:o>=V8e?2:1;let a,s,I;return n<0?(I=Math.pow(10,-n)/g,a=Math.round(A*I),s=Math.round(e*I),a/I<A&&++a,s/I>e&&--s,I=-I):(I=Math.pow(10,n)*g,a=Math.round(A/I),s=Math.round(e/I),a*I<A&&++a,s*I>e&&--s),s<a&&.5<=t&&t<2?E9(A,e,t*2):[a,s,I]}function uM(A,e,t){if(e=+e,A=+A,t=+t,!(t>0))return[];if(A===e)return[A];const i=e<A,[n,o,g]=i?E9(e,A,t):E9(A,e,t);if(!(o>=n))return[];const a=o-n+1,s=new Array(a);if(i)if(g<0)for(let I=0;I<a;++I)s[I]=(o-I)/-g;else for(let I=0;I<a;++I)s[I]=(o-I)*g;else if(g<0)for(let I=0;I<a;++I)s[I]=(n+I)/-g;else for(let I=0;I<a;++I)s[I]=(n+I)*g;return s}function u9(A,e,t){return e=+e,A=+A,t=+t,E9(A,e,t)[2]}function jm(A,e,t){e=+e,A=+A,t=+t;const i=e<A,n=i?u9(e,A,t):u9(A,e,t);return(i?-1:1)*(n<0?1/-n:n)}function X8e(A){return Math.max(1,Math.ceil(Math.log(B9(A))/Math.LN2)+1)}function Pg(A,e){let t;if(e===void 0)for(const i of A)i!=null&&(t<i||t===void 0&&i>=i)&&(t=i);else{let i=-1;for(let n of A)(n=e(n,++i,A))!=null&&(t<n||t===void 0&&n>=n)&&(t=n)}return t}function z8e(A,e){let t,i=-1,n=-1;if(e===void 0)for(const o of A)++n,o!=null&&(t<o||t===void 0&&o>=o)&&(t=o,i=n);else for(let o of A)(o=e(o,++n,A))!=null&&(t<o||t===void 0&&o>=o)&&(t=o,i=n);return i}function dc(A,e){let t;if(e===void 0)for(const i of A)i!=null&&(t>i||t===void 0&&i>=i)&&(t=i);else{let i=-1;for(let n of A)(n=e(n,++i,A))!=null&&(t>n||t===void 0&&n>=n)&&(t=n)}return t}function T8e(A,e){let t,i=-1,n=-1;if(e===void 0)for(const o of A)++n,o!=null&&(t>o||t===void 0&&o>=o)&&(t=o,i=n);else for(let o of A)(o=e(o,++n,A))!=null&&(t>o||t===void 0&&o>=o)&&(t=o,i=n);return i}function m3A(A,e,t=0,i=1/0,n){if(e=Math.floor(e),t=Math.floor(Math.max(0,t)),i=Math.floor(Math.min(A.length-1,i)),!(t<=e&&e<=i))return A;for(n=n===void 0?EM:GgA(n);i>t;){if(i-t>600){const s=i-t+1,I=e-t+1,r=Math.log(s),C=.5*Math.exp(2*r/3),l=.5*Math.sqrt(r*C*(s-C)/s)*(I-s/2<0?-1:1),c=Math.max(t,Math.floor(e-I*C/s+l)),B=Math.min(i,Math.floor(e+(s-I)*C/s+l));m3A(A,e,c,B,n)}const o=A[e];let g=t,a=i;for(dM(A,t,e),n(A[i],o)>0&&dM(A,t,i);g<a;){for(dM(A,g,a),++g,--a;n(A[g],o)<0;)++g;for(;n(A[a],o)>0;)--a}n(A[t],o)===0?dM(A,t,a):(++a,dM(A,a,i)),a<=e&&(t=a+1),e<=a&&(i=a-1)}return A}function dM(A,e,t){const i=A[e];A[e]=A[t],A[t]=i}function p3A(A,e=Oo){let t,i=!1;if(e.length===1){let n;for(const o of A){const g=e(o);(i?Oo(g,n)>0:Oo(g,g)===0)&&(t=o,n=g,i=!0)}}else for(const n of A)(i?e(n,t)>0:e(n,n)===0)&&(t=n,i=!0);return t}function BQ(A,e,t){if(A=Float64Array.from(x8e(A,t)),!(!(i=A.length)||isNaN(e=+e))){if(e<=0||i<2)return dc(A);if(e>=1)return Pg(A);var i,n=(i-1)*e,o=Math.floor(n),g=Pg(m3A(A,o).subarray(0,o+1)),a=dc(A.subarray(o+1));return g+(a-g)*(n-o)}}function f3A(A,e,t=c3A){if(!(!(i=A.length)||isNaN(e=+e))){if(e<=0||i<2)return+t(A[0],0,A);if(e>=1)return+t(A[i-1],i-1,A);var i,n=(i-1)*e,o=Math.floor(n),g=+t(A[o],o,A),a=+t(A[o+1],o+1,A);return g+(a-g)*(n-o)}}function _8e(A,e,t){const i=B9(A),n=BQ(A,.75)-BQ(A,.25);return i&&n?Math.ceil((t-e)/(2*n*Math.pow(i,-.3333333333333333))):1}function y3A(A,e,t){const i=B9(A),n=ygA(A);return i&&n?Math.ceil((t-e)*Math.cbrt(i)/(3.49*n)):1}function b3A(A,e){let t=0,i=0;if(e===void 0)for(let n of A)n!=null&&(n=+n)>=n&&(++t,i+=n);else{let n=-1;for(let o of A)(o=e(o,++n,A))!=null&&(o=+o)>=o&&(++t,i+=o)}if(t)return i/t}function hM(A,e){return BQ(A,.5,e)}function*O8e(A){for(const e of A)yield*e}function d9(A){return Array.from(O8e(A))}function q8e(A,e){const t=new Xy;if(e===void 0)for(let o of A)o!=null&&o>=o&&t.set(o,(t.get(o)||0)+1);else{let o=-1;for(let g of A)(g=e(g,++o,A))!=null&&g>=g&&t.set(g,(t.get(g)||0)+1)}let i,n=0;for(const[o,g]of t)g>n&&(n=g,i=o);return i}function j8e(A,e=P8e){const t=[];let i,n=!1;for(const o of A)n&&t.push(e(i,o)),i=o,n=!0;return t}function P8e(A,e){return[A,e]}function Ga(A,e,t){A=+A,e=+e,t=(n=arguments.length)<2?(e=A,A=0,1):n<3?1:+t;for(var i=-1,n=Math.max(0,Math.ceil((e-A)/t))|0,o=new Array(n);++i<n;)o[i]=A+i*t;return o}function w3A(A,e=Oo){if(typeof A[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let t=Array.from(A);const i=new Float64Array(t.length);e.length!==2&&(t=t.map(e),e=Oo);const n=(a,s)=>e(t[a],t[s]);let o,g;return A=Uint32Array.from(t,(a,s)=>s),A.sort(e===Oo?(a,s)=>EM(t[a],t[s]):GgA(n)),A.forEach((a,s)=>{const I=n(a,o===void 0?a:o);I>=0?((o===void 0||I>0)&&(o=a,g=s),i[a]=g):i[a]=NaN}),i}function QQ(A,e){let t=0;if(e===void 0)for(let i of A)(i=+i)&&(t+=i);else{let i=-1;for(let n of A)(n=+e(n,++i,A))&&(t+=n)}return t}function h9(A){if(typeof A[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(A).reverse()}function $8e(A,...e){A=new qm(A),e=e.map(APe);A:for(const t of A)for(const i of e)if(!i.has(t)){A.delete(t);continue A}return A}function APe(A){return A instanceof qm?A:new qm(A)}function ePe(...A){const e=new qm;for(const t of A)for(const i of t)e.add(i);return e}function hc(A,e){switch(arguments.length){case 0:break;case 1:this.range(A);break;default:this.range(e).domain(A);break}return this}function Pm(A,e){switch(arguments.length){case 0:break;case 1:{typeof A=="function"?this.interpolator(A):this.range(A);break}default:{this.domain(A),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const m9=Symbol("implicit");function $k(){var A=new Xy,e=[],t=[],i=m9;function n(o){let g=A.get(o);if(g===void 0){if(i!==m9)return i;A.set(o,g=e.push(o)-1)}return t[g%t.length]}return n.domain=function(o){if(!arguments.length)return e.slice();e=[],A=new Xy;for(const g of o)A.has(g)||A.set(g,e.push(g)-1);return n},n.range=function(o){return arguments.length?(t=Array.from(o),n):t.slice()},n.unknown=function(o){return arguments.length?(i=o,n):i},n.copy=function(){return $k(e,t).unknown(i)},hc.apply(n,arguments),n}function p9(){var A=$k().unknown(void 0),e=A.domain,t=A.range,i=0,n=1,o,g,a=!1,s=0,I=0,r=.5;delete A.unknown;function C(){var l=e().length,c=n<i,B=c?n:i,E=c?i:n;o=(E-B)/Math.max(1,l-s+I*2),a&&(o=Math.floor(o)),B+=(E-B-o*(l-s))*r,g=o*(1-s),a&&(B=Math.round(B),g=Math.round(g));var u=Ga(l).map(function(d){return B+o*d});return t(c?u.reverse():u)}return A.domain=function(l){return arguments.length?(e(l),C()):e()},A.range=function(l){return arguments.length?([i,n]=l,i=+i,n=+n,C()):[i,n]},A.rangeRound=function(l){return[i,n]=l,i=+i,n=+n,a=!0,C()},A.bandwidth=function(){return g},A.step=function(){return o},A.round=function(l){return arguments.length?(a=!!l,C()):a},A.padding=function(l){return arguments.length?(s=Math.min(1,I=+l),C()):s},A.paddingInner=function(l){return arguments.length?(s=Math.min(1,l),C()):s},A.paddingOuter=function(l){return arguments.length?(I=+l,C()):I},A.align=function(l){return arguments.length?(r=Math.max(0,Math.min(1,l)),C()):r},A.copy=function(){return p9(e(),[i,n]).round(a).paddingInner(s).paddingOuter(I).align(r)},hc.apply(C(),arguments)}function D3A(A){var e=A.copy;return A.padding=A.paddingOuter,delete A.paddingInner,delete A.paddingOuter,A.copy=function(){return D3A(e())},A}function tPe(){return D3A(p9.apply(null,arguments).paddingInner(1))}function AJ(A,e,t){A.prototype=e.prototype=t,t.constructor=A}function mM(A,e){var t=Object.create(A.prototype);for(var i in e)t[i]=e[i];return t}function $m(){}var zy=.7,eJ=1/zy,tJ="\\s*([+-]?\\d+)\\s*",pM="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",EQ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iPe=/^#([0-9a-f]{3,8})$/,nPe=new RegExp(`^rgb\\(${tJ},${tJ},${tJ}\\)$`),oPe=new RegExp(`^rgb\\(${EQ},${EQ},${EQ}\\)$`),gPe=new RegExp(`^rgba\\(${tJ},${tJ},${tJ},${pM}\\)$`),aPe=new RegExp(`^rgba\\(${EQ},${EQ},${EQ},${pM}\\)$`),sPe=new RegExp(`^hsl\\(${pM},${EQ},${EQ}\\)$`),rPe=new RegExp(`^hsla\\(${pM},${EQ},${EQ},${pM}\\)$`),G3A={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};AJ($m,Ty,{copy(A){return Object.assign(new this.constructor,this,A)},displayable(){return this.rgb().displayable()},hex:k3A,formatHex:k3A,formatHex8:IPe,formatHsl:CPe,formatRgb:J3A,toString:J3A});function k3A(){return this.rgb().formatHex()}function IPe(){return this.rgb().formatHex8()}function CPe(){return F3A(this).formatHsl()}function J3A(){return this.rgb().formatRgb()}function Ty(A){var e,t;return A=(A+"").trim().toLowerCase(),(e=iPe.exec(A))?(t=e[1].length,e=parseInt(e[1],16),t===6?N3A(e):t===3?new Qg(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?f9(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?f9(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=nPe.exec(A))?new Qg(e[1],e[2],e[3],1):(e=oPe.exec(A))?new Qg(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=gPe.exec(A))?f9(e[1],e[2],e[3],e[4]):(e=aPe.exec(A))?f9(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=sPe.exec(A))?x3A(e[1],e[2]/100,e[3]/100,1):(e=rPe.exec(A))?x3A(e[1],e[2]/100,e[3]/100,e[4]):G3A.hasOwnProperty(A)?N3A(G3A[A]):A==="transparent"?new Qg(NaN,NaN,NaN,0):null}function N3A(A){return new Qg(A>>16&255,A>>8&255,A&255,1)}function f9(A,e,t,i){return i<=0&&(A=e=t=NaN),new Qg(A,e,t,i)}function JgA(A){return A instanceof $m||(A=Ty(A)),A?(A=A.rgb(),new Qg(A.r,A.g,A.b,A.opacity)):new Qg}function OC(A,e,t,i){return arguments.length===1?JgA(A):new Qg(A,e,t,i??1)}function Qg(A,e,t,i){this.r=+A,this.g=+e,this.b=+t,this.opacity=+i}AJ(Qg,OC,mM($m,{brighter(A){return A=A==null?eJ:Math.pow(eJ,A),new Qg(this.r*A,this.g*A,this.b*A,this.opacity)},darker(A){return A=A==null?zy:Math.pow(zy,A),new Qg(this.r*A,this.g*A,this.b*A,this.opacity)},rgb(){return this},clamp(){return new Qg(_y(this.r),_y(this.g),_y(this.b),y9(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Y3A,formatHex:Y3A,formatHex8:lPe,formatRgb:R3A,toString:R3A}));function Y3A(){return`#${Oy(this.r)}${Oy(this.g)}${Oy(this.b)}`}function lPe(){return`#${Oy(this.r)}${Oy(this.g)}${Oy(this.b)}${Oy((isNaN(this.opacity)?1:this.opacity)*255)}`}function R3A(){const A=y9(this.opacity);return`${A===1?"rgb(":"rgba("}${_y(this.r)}, ${_y(this.g)}, ${_y(this.b)}${A===1?")":`, ${A})`}`}function y9(A){return isNaN(A)?1:Math.max(0,Math.min(1,A))}function _y(A){return Math.max(0,Math.min(255,Math.round(A)||0))}function Oy(A){return A=_y(A),(A<16?"0":"")+A.toString(16)}function x3A(A,e,t,i){return i<=0?A=e=t=NaN:t<=0||t>=1?A=e=NaN:e<=0&&(A=NaN),new mc(A,e,t,i)}function F3A(A){if(A instanceof mc)return new mc(A.h,A.s,A.l,A.opacity);if(A instanceof $m||(A=Ty(A)),!A)return new mc;if(A instanceof mc)return A;A=A.rgb();var e=A.r/255,t=A.g/255,i=A.b/255,n=Math.min(e,t,i),o=Math.max(e,t,i),g=NaN,a=o-n,s=(o+n)/2;return a?(e===o?g=(t-i)/a+(t<i)*6:t===o?g=(i-e)/a+2:g=(e-t)/a+4,a/=s<.5?o+n:2-o-n,g*=60):a=s>0&&s<1?0:g,new mc(g,a,s,A.opacity)}function b9(A,e,t,i){return arguments.length===1?F3A(A):new mc(A,e,t,i??1)}function mc(A,e,t,i){this.h=+A,this.s=+e,this.l=+t,this.opacity=+i}AJ(mc,b9,mM($m,{brighter(A){return A=A==null?eJ:Math.pow(eJ,A),new mc(this.h,this.s,this.l*A,this.opacity)},darker(A){return A=A==null?zy:Math.pow(zy,A),new mc(this.h,this.s,this.l*A,this.opacity)},rgb(){var A=this.h%360+(this.h<0)*360,e=isNaN(A)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,n=2*t-i;return new Qg(NgA(A>=240?A-240:A+120,n,i),NgA(A,n,i),NgA(A<120?A+240:A-120,n,i),this.opacity)},clamp(){return new mc(M3A(this.h),w9(this.s),w9(this.l),y9(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const A=y9(this.opacity);return`${A===1?"hsl(":"hsla("}${M3A(this.h)}, ${w9(this.s)*100}%, ${w9(this.l)*100}%${A===1?")":`, ${A})`}`}}));function M3A(A){return A=(A||0)%360,A<0?A+360:A}function w9(A){return Math.max(0,Math.min(1,A||0))}function NgA(A,e,t){return(A<60?e+(t-e)*A/60:A<180?t:A<240?e+(t-e)*(240-A)/60:e)*255}const v3A=Math.PI/180,L3A=180/Math.PI,D9=18,S3A=.96422,H3A=1,Z3A=.82521,W3A=4/29,iJ=6/29,K3A=3*iJ*iJ,cPe=iJ*iJ*iJ;function U3A(A){if(A instanceof uQ)return new uQ(A.l,A.a,A.b,A.opacity);if(A instanceof $u)return V3A(A);A instanceof Qg||(A=JgA(A));var e=FgA(A.r),t=FgA(A.g),i=FgA(A.b),n=YgA((.2225045*e+.7168786*t+.0606169*i)/H3A),o,g;return e===t&&t===i?o=g=n:(o=YgA((.4360747*e+.3850649*t+.1430804*i)/S3A),g=YgA((.0139322*e+.0971045*t+.7141733*i)/Z3A)),new uQ(116*n-16,500*(o-n),200*(n-g),A.opacity)}function G9(A,e,t,i){return arguments.length===1?U3A(A):new uQ(A,e,t,i??1)}function uQ(A,e,t,i){this.l=+A,this.a=+e,this.b=+t,this.opacity=+i}AJ(uQ,G9,mM($m,{brighter(A){return new uQ(this.l+D9*(A??1),this.a,this.b,this.opacity)},darker(A){return new uQ(this.l-D9*(A??1),this.a,this.b,this.opacity)},rgb(){var A=(this.l+16)/116,e=isNaN(this.a)?A:A+this.a/500,t=isNaN(this.b)?A:A-this.b/200;return e=S3A*RgA(e),A=H3A*RgA(A),t=Z3A*RgA(t),new Qg(xgA(3.1338561*e-1.6168667*A-.4906146*t),xgA(-.9787684*e+1.9161415*A+.033454*t),xgA(.0719453*e-.2289914*A+1.4052427*t),this.opacity)}}));function YgA(A){return A>cPe?Math.pow(A,.3333333333333333):A/K3A+W3A}function RgA(A){return A>iJ?A*A*A:K3A*(A-W3A)}function xgA(A){return 255*(A<=.0031308?12.92*A:1.055*Math.pow(A,.4166666666666667)-.055)}function FgA(A){return(A/=255)<=.04045?A/12.92:Math.pow((A+.055)/1.055,2.4)}function BPe(A){if(A instanceof $u)return new $u(A.h,A.c,A.l,A.opacity);if(A instanceof uQ||(A=U3A(A)),A.a===0&&A.b===0)return new $u(NaN,0<A.l&&A.l<100?0:NaN,A.l,A.opacity);var e=Math.atan2(A.b,A.a)*L3A;return new $u(e<0?e+360:e,Math.sqrt(A.a*A.a+A.b*A.b),A.l,A.opacity)}function k9(A,e,t,i){return arguments.length===1?BPe(A):new $u(A,e,t,i??1)}function $u(A,e,t,i){this.h=+A,this.c=+e,this.l=+t,this.opacity=+i}function V3A(A){if(isNaN(A.h))return new uQ(A.l,0,0,A.opacity);var e=A.h*v3A;return new uQ(A.l,Math.cos(e)*A.c,Math.sin(e)*A.c,A.opacity)}AJ($u,k9,mM($m,{brighter(A){return new $u(this.h,this.c,this.l+D9*(A??1),this.opacity)},darker(A){return new $u(this.h,this.c,this.l-D9*(A??1),this.opacity)},rgb(){return V3A(this).rgb()}}));var X3A=-.14861,MgA=1.78277,vgA=-.29227,J9=-.90649,fM=1.97294,z3A=fM*J9,T3A=fM*MgA,_3A=MgA*vgA-J9*X3A;function QPe(A){if(A instanceof qy)return new qy(A.h,A.s,A.l,A.opacity);A instanceof Qg||(A=JgA(A));var e=A.r/255,t=A.g/255,i=A.b/255,n=(_3A*i+z3A*e-T3A*t)/(_3A+z3A-T3A),o=i-n,g=(fM*(t-n)-vgA*o)/J9,a=Math.sqrt(g*g+o*o)/(fM*n*(1-n)),s=a?Math.atan2(g,o)*L3A-120:NaN;return new qy(s<0?s+360:s,a,n,A.opacity)}function dQ(A,e,t,i){return arguments.length===1?QPe(A):new qy(A,e,t,i??1)}function qy(A,e,t,i){this.h=+A,this.s=+e,this.l=+t,this.opacity=+i}AJ(qy,dQ,mM($m,{brighter(A){return A=A==null?eJ:Math.pow(eJ,A),new qy(this.h,this.s,this.l*A,this.opacity)},darker(A){return A=A==null?zy:Math.pow(zy,A),new qy(this.h,this.s,this.l*A,this.opacity)},rgb(){var A=isNaN(this.h)?0:(this.h+120)*v3A,e=+this.l,t=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(A),n=Math.sin(A);return new Qg(255*(e+t*(X3A*i+MgA*n)),255*(e+t*(vgA*i+J9*n)),255*(e+t*(fM*i)),this.opacity)}}));function O3A(A,e,t,i,n){var o=A*A,g=o*A;return((1-3*A+3*o-g)*e+(4-6*o+3*g)*t+(1+3*A+3*o-3*g)*i+g*n)/6}function q3A(A){var e=A.length-1;return function(t){var i=t<=0?t=0:t>=1?(t=1,e-1):Math.floor(t*e),n=A[i],o=A[i+1],g=i>0?A[i-1]:2*n-o,a=i<e-1?A[i+2]:2*o-n;return O3A((t-i/e)*e,g,n,o,a)}}function j3A(A){var e=A.length;return function(t){var i=Math.floor(((t%=1)<0?++t:t)*e),n=A[(i+e-1)%e],o=A[i%e],g=A[(i+1)%e],a=A[(i+2)%e];return O3A((t-i/e)*e,n,o,g,a)}}const N9=A=>()=>A;function P3A(A,e){return function(t){return A+t*e}}function EPe(A,e,t){return A=Math.pow(A,t),e=Math.pow(e,t)-A,t=1/t,function(i){return Math.pow(A+i*e,t)}}function Y9(A,e){var t=e-A;return t?P3A(A,t>180||t<-180?t-360*Math.round(t/360):t):N9(isNaN(A)?e:A)}function uPe(A){return(A=+A)==1?Eg:function(e,t){return t-e?EPe(e,t,A):N9(isNaN(e)?t:e)}}function Eg(A,e){var t=e-A;return t?P3A(A,t):N9(isNaN(A)?e:A)}const Ap=function A(e){var t=uPe(e);function i(n,o){var g=t((n=OC(n)).r,(o=OC(o)).r),a=t(n.g,o.g),s=t(n.b,o.b),I=Eg(n.opacity,o.opacity);return function(r){return n.r=g(r),n.g=a(r),n.b=s(r),n.opacity=I(r),n+""}}return i.gamma=A,i}(1);function $3A(A){return function(e){var t=e.length,i=new Array(t),n=new Array(t),o=new Array(t),g,a;for(g=0;g<t;++g)a=OC(e[g]),i[g]=a.r||0,n[g]=a.g||0,o[g]=a.b||0;return i=A(i),n=A(n),o=A(o),a.opacity=1,function(s){return a.r=i(s),a.g=n(s),a.b=o(s),a+""}}}var AKA=$3A(q3A),dPe=$3A(j3A);function LgA(A,e){e||(e=[]);var t=A?Math.min(e.length,A.length):0,i=e.slice(),n;return function(o){for(n=0;n<t;++n)i[n]=A[n]*(1-o)+e[n]*o;return i}}function eKA(A){return ArrayBuffer.isView(A)&&!(A instanceof DataView)}function hPe(A,e){return(eKA(e)?LgA:tKA)(A,e)}function tKA(A,e){var t=e?e.length:0,i=A?Math.min(t,A.length):0,n=new Array(i),o=new Array(t),g;for(g=0;g<i;++g)n[g]=ep(A[g],e[g]);for(;g<t;++g)o[g]=e[g];return function(a){for(g=0;g<i;++g)o[g]=n[g](a);return o}}function iKA(A,e){var t=new Date;return A=+A,e=+e,function(i){return t.setTime(A*(1-i)+e*i),t}}function $g(A,e){return A=+A,e=+e,function(t){return A*(1-t)+e*t}}function nKA(A,e){var t={},i={},n;(A===null||typeof A!="object")&&(A={}),(e===null||typeof e!="object")&&(e={});for(n in e)n in A?t[n]=ep(A[n],e[n]):i[n]=e[n];return function(o){for(n in t)i[n]=t[n](o);return i}}var SgA=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,HgA=new RegExp(SgA.source,"g");function mPe(A){return function(){return A}}function pPe(A){return function(e){return A(e)+""}}function ZgA(A,e){var t=SgA.lastIndex=HgA.lastIndex=0,i,n,o,g=-1,a=[],s=[];for(A=A+"",e=e+"";(i=SgA.exec(A))&&(n=HgA.exec(e));)(o=n.index)>t&&(o=e.slice(t,o),a[g]?a[g]+=o:a[++g]=o),(i=i[0])===(n=n[0])?a[g]?a[g]+=n:a[++g]=n:(a[++g]=null,s.push({i:g,x:$g(i,n)})),t=HgA.lastIndex;return t<e.length&&(o=e.slice(t),a[g]?a[g]+=o:a[++g]=o),a.length<2?s[0]?pPe(s[0].x):mPe(e):(e=s.length,function(I){for(var r=0,C;r<e;++r)a[(C=s[r]).i]=C.x(I);return a.join("")})}function ep(A,e){var t=typeof e,i;return e==null||t==="boolean"?N9(e):(t==="number"?$g:t==="string"?(i=Ty(e))?(e=i,Ap):ZgA:e instanceof Ty?Ap:e instanceof Date?iKA:eKA(e)?LgA:Array.isArray(e)?tKA:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?nKA:$g)(A,e)}function fPe(A){var e=A.length;return function(t){return A[Math.max(0,Math.min(e-1,Math.floor(t*e)))]}}function yPe(A,e){var t=Y9(+A,+e);return function(i){var n=t(i);return n-360*Math.floor(n/360)}}function nJ(A,e){return A=+A,e=+e,function(t){return Math.round(A*(1-t)+e*t)}}var oKA=180/Math.PI,gKA={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function aKA(A,e,t,i,n,o){var g,a,s;return(g=Math.sqrt(A*A+e*e))&&(A/=g,e/=g),(s=A*t+e*i)&&(t-=A*s,i-=e*s),(a=Math.sqrt(t*t+i*i))&&(t/=a,i/=a,s/=a),A*i<e*t&&(A=-A,e=-e,s=-s,g=-g),{translateX:n,translateY:o,rotate:Math.atan2(e,A)*oKA,skewX:Math.atan(s)*oKA,scaleX:g,scaleY:a}}var R9;function bPe(A){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(A+"");return e.isIdentity?gKA:aKA(e.a,e.b,e.c,e.d,e.e,e.f)}function wPe(A){return A==null||(R9||(R9=document.createElementNS("http://www.w3.org/2000/svg","g")),R9.setAttribute("transform",A),!(A=R9.transform.baseVal.consolidate()))?gKA:(A=A.matrix,aKA(A.a,A.b,A.c,A.d,A.e,A.f))}function sKA(A,e,t,i){function n(I){return I.length?I.pop()+" ":""}function o(I,r,C,l,c,B){if(I!==C||r!==l){var E=c.push("translate(",null,e,null,t);B.push({i:E-4,x:$g(I,C)},{i:E-2,x:$g(r,l)})}else(C||l)&&c.push("translate("+C+e+l+t)}function g(I,r,C,l){I!==r?(I-r>180?r+=360:r-I>180&&(I+=360),l.push({i:C.push(n(C)+"rotate(",null,i)-2,x:$g(I,r)})):r&&C.push(n(C)+"rotate("+r+i)}function a(I,r,C,l){I!==r?l.push({i:C.push(n(C)+"skewX(",null,i)-2,x:$g(I,r)}):r&&C.push(n(C)+"skewX("+r+i)}function s(I,r,C,l,c,B){if(I!==C||r!==l){var E=c.push(n(c)+"scale(",null,",",null,")");B.push({i:E-4,x:$g(I,C)},{i:E-2,x:$g(r,l)})}else(C!==1||l!==1)&&c.push(n(c)+"scale("+C+","+l+")")}return function(I,r){var C=[],l=[];return I=A(I),r=A(r),o(I.translateX,I.translateY,r.translateX,r.translateY,C,l),g(I.rotate,r.rotate,C,l),a(I.skewX,r.skewX,C,l),s(I.scaleX,I.scaleY,r.scaleX,r.scaleY,C,l),I=r=null,function(c){for(var B=-1,E=l.length,u;++B<E;)C[(u=l[B]).i]=u.x(c);return C.join("")}}}var rKA=sKA(bPe,"px, ","px)","deg)"),IKA=sKA(wPe,", ",")",")"),DPe=1e-12;function CKA(A){return((A=Math.exp(A))+1/A)/2}function GPe(A){return((A=Math.exp(A))-1/A)/2}function kPe(A){return((A=Math.exp(2*A))-1)/(A+1)}const JPe=function A(e,t,i){function n(o,g){var a=o[0],s=o[1],I=o[2],r=g[0],C=g[1],l=g[2],c=r-a,B=C-s,E=c*c+B*B,u,d;if(E<DPe)d=Math.log(l/I)/e,u=function(x){return[a+x*c,s+x*B,I*Math.exp(e*x*d)]};else{var f=Math.sqrt(E),w=(l*l-I*I+i*E)/(2*I*t*f),y=(l*l-I*I-i*E)/(2*l*t*f),G=Math.log(Math.sqrt(w*w+1)-w),R=Math.log(Math.sqrt(y*y+1)-y);d=(R-G)/e,u=function(x){var F=x*d,Q=CKA(G),k=I/(t*f)*(Q*kPe(e*F+G)-GPe(G));return[a+k*c,s+k*B,I*Q/CKA(e*F+G)]}}return u.duration=d*1e3*e/Math.SQRT2,u}return n.rho=function(o){var g=Math.max(.001,+o),a=g*g,s=a*a;return A(g,a,s)},n}(Math.SQRT2,2,4);function lKA(A){return function(e,t){var i=A((e=b9(e)).h,(t=b9(t)).h),n=Eg(e.s,t.s),o=Eg(e.l,t.l),g=Eg(e.opacity,t.opacity);return function(a){return e.h=i(a),e.s=n(a),e.l=o(a),e.opacity=g(a),e+""}}}const cKA=lKA(Y9);var NPe=lKA(Eg);function BKA(A,e){var t=Eg((A=G9(A)).l,(e=G9(e)).l),i=Eg(A.a,e.a),n=Eg(A.b,e.b),o=Eg(A.opacity,e.opacity);return function(g){return A.l=t(g),A.a=i(g),A.b=n(g),A.opacity=o(g),A+""}}function QKA(A){return function(e,t){var i=A((e=k9(e)).h,(t=k9(t)).h),n=Eg(e.c,t.c),o=Eg(e.l,t.l),g=Eg(e.opacity,t.opacity);return function(a){return e.h=i(a),e.c=n(a),e.l=o(a),e.opacity=g(a),e+""}}}const EKA=QKA(Y9);var YPe=QKA(Eg);function uKA(A){return function e(t){t=+t;function i(n,o){var g=A((n=dQ(n)).h,(o=dQ(o)).h),a=Eg(n.s,o.s),s=Eg(n.l,o.l),I=Eg(n.opacity,o.opacity);return function(r){return n.h=g(r),n.s=a(r),n.l=s(Math.pow(r,t)),n.opacity=I(r),n+""}}return i.gamma=e,i}(1)}const RPe=uKA(Y9);var x9=uKA(Eg);function oJ(A,e){e===void 0&&(e=A,A=ep);for(var t=0,i=e.length-1,n=e[0],o=new Array(i<0?0:i);t<i;)o[t]=A(n,n=e[++t]);return function(g){var a=Math.max(0,Math.min(i-1,Math.floor(g*=i)));return o[a](g-a)}}function qC(A,e){for(var t=new Array(e),i=0;i<e;++i)t[i]=A(i/(e-1));return t}const xPe=Object.freeze(Object.defineProperty({__proto__:null,interpolate:ep,interpolateArray:hPe,interpolateBasis:q3A,interpolateBasisClosed:j3A,interpolateCubehelix:RPe,interpolateCubehelixLong:x9,interpolateDate:iKA,interpolateDiscrete:fPe,interpolateHcl:EKA,interpolateHclLong:YPe,interpolateHsl:cKA,interpolateHslLong:NPe,interpolateHue:yPe,interpolateLab:BKA,interpolateNumber:$g,interpolateNumberArray:LgA,interpolateObject:nKA,interpolateRgb:Ap,interpolateRgbBasis:AKA,interpolateRgbBasisClosed:dPe,interpolateRound:nJ,interpolateString:ZgA,interpolateTransformCss:rKA,interpolateTransformSvg:IKA,interpolateZoom:JPe,piecewise:oJ,quantize:qC},Symbol.toStringTag,{value:"Module"}));function FPe(A){return function(){return A}}function WgA(A){return+A}var dKA=[0,1];function or(A){return A}function KgA(A,e){return(e-=A=+A)?function(t){return(t-A)/e}:FPe(isNaN(e)?NaN:.5)}function MPe(A,e){var t;return A>e&&(t=A,A=e,e=t),function(i){return Math.max(A,Math.min(e,i))}}function vPe(A,e,t){var i=A[0],n=A[1],o=e[0],g=e[1];return n<i?(i=KgA(n,i),o=t(g,o)):(i=KgA(i,n),o=t(o,g)),function(a){return o(i(a))}}function LPe(A,e,t){var i=Math.min(A.length,e.length)-1,n=new Array(i),o=new Array(i),g=-1;for(A[i]<A[0]&&(A=A.slice().reverse(),e=e.slice().reverse());++g<i;)n[g]=KgA(A[g],A[g+1]),o[g]=t(e[g],e[g+1]);return function(a){var s=jk(A,a,1,i)-1;return o[s](n[s](a))}}function yM(A,e){return e.domain(A.domain()).range(A.range()).interpolate(A.interpolate()).clamp(A.clamp()).unknown(A.unknown())}function F9(){var A=dKA,e=dKA,t=ep,i,n,o,g=or,a,s,I;function r(){var l=Math.min(A.length,e.length);return g!==or&&(g=MPe(A[0],A[l-1])),a=l>2?LPe:vPe,s=I=null,C}function C(l){return l==null||isNaN(l=+l)?o:(s||(s=a(A.map(i),e,t)))(i(g(l)))}return C.invert=function(l){return g(n((I||(I=a(e,A.map(i),$g)))(l)))},C.domain=function(l){return arguments.length?(A=Array.from(l,WgA),r()):A.slice()},C.range=function(l){return arguments.length?(e=Array.from(l),r()):e.slice()},C.rangeRound=function(l){return e=Array.from(l),t=nJ,r()},C.clamp=function(l){return arguments.length?(g=l?!0:or,r()):g!==or},C.interpolate=function(l){return arguments.length?(t=l,r()):t},C.unknown=function(l){return arguments.length?(o=l,C):o},function(l,c){return i=l,n=c,r()}}function hKA(){return F9()(or,or)}function mKA(A,e,t,i){var n=jm(A,e,t),o;switch(i=Ky(i??",f"),i.type){case"s":{var g=Math.max(Math.abs(A),Math.abs(e));return i.precision==null&&!isNaN(o=t3A(n,g))&&(i.precision=o),QgA(i,g)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=i3A(n,Math.max(Math.abs(A),Math.abs(e))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=e3A(n))&&(i.precision=o-(i.type==="%")*2);break}}return Ec(i)}function jy(A){var e=A.domain;return A.ticks=function(t){var i=e();return uM(i[0],i[i.length-1],t??10)},A.tickFormat=function(t,i){var n=e();return mKA(n[0],n[n.length-1],t??10,i)},A.nice=function(t){t==null&&(t=10);var i=e(),n=0,o=i.length-1,g=i[n],a=i[o],s,I,r=10;for(a<g&&(I=g,g=a,a=I,I=n,n=o,o=I);r-- >0;){if(I=u9(g,a,t),I===s)return i[n]=g,i[o]=a,e(i);if(I>0)g=Math.floor(g/I)*I,a=Math.ceil(a/I)*I;else if(I<0)g=Math.ceil(g*I)/I,a=Math.floor(a*I)/I;else break;s=I}return A},A}function bM(){var A=hKA();return A.copy=function(){return yM(A,bM())},hc.apply(A,arguments),jy(A)}function UgA(A){var e;function t(i){return i==null||isNaN(i=+i)?e:i}return t.invert=t,t.domain=t.range=function(i){return arguments.length?(A=Array.from(i,WgA),t):A.slice()},t.unknown=function(i){return arguments.length?(e=i,t):e},t.copy=function(){return UgA(A).unknown(e)},A=arguments.length?Array.from(A,WgA):[0,1],jy(t)}function pKA(A,e){A=A.slice();var t=0,i=A.length-1,n=A[t],o=A[i],g;return o<n&&(g=t,t=i,i=g,g=n,n=o,o=g),A[t]=e.floor(n),A[i]=e.ceil(o),A}function fKA(A){return Math.log(A)}function yKA(A){return Math.exp(A)}function SPe(A){return-Math.log(-A)}function HPe(A){return-Math.exp(-A)}function ZPe(A){return isFinite(A)?+("1e"+A):A<0?0:A}function WPe(A){return A===10?ZPe:A===Math.E?Math.exp:e=>Math.pow(A,e)}function KPe(A){return A===Math.E?Math.log:A===10&&Math.log10||A===2&&Math.log2||(A=Math.log(A),e=>Math.log(e)/A)}function bKA(A){return(e,t)=>-A(-e,t)}function VgA(A){const e=A(fKA,yKA),t=e.domain;let i=10,n,o;function g(){return n=KPe(i),o=WPe(i),t()[0]<0?(n=bKA(n),o=bKA(o),A(SPe,HPe)):A(fKA,yKA),e}return e.base=function(a){return arguments.length?(i=+a,g()):i},e.domain=function(a){return arguments.length?(t(a),g()):t()},e.ticks=a=>{const s=t();let I=s[0],r=s[s.length-1];const C=r<I;C&&([I,r]=[r,I]);let l=n(I),c=n(r),B,E;const u=a==null?10:+a;let d=[];if(!(i%1)&&c-l<u){if(l=Math.floor(l),c=Math.ceil(c),I>0){for(;l<=c;++l)for(B=1;B<i;++B)if(E=l<0?B/o(-l):B*o(l),!(E<I)){if(E>r)break;d.push(E)}}else for(;l<=c;++l)for(B=i-1;B>=1;--B)if(E=l>0?B/o(-l):B*o(l),!(E<I)){if(E>r)break;d.push(E)}d.length*2<u&&(d=uM(I,r,u))}else d=uM(l,c,Math.min(c-l,u)).map(o);return C?d.reverse():d},e.tickFormat=(a,s)=>{if(a==null&&(a=10),s==null&&(s=i===10?"s":","),typeof s!="function"&&(!(i%1)&&(s=Ky(s)).precision==null&&(s.trim=!0),s=Ec(s)),a===1/0)return s;const I=Math.max(1,i*a/e.ticks().length);return r=>{let C=r/o(Math.round(n(r)));return C*i<i-.5&&(C*=i),C<=I?s(r):""}},e.nice=()=>t(pKA(t(),{floor:a=>o(Math.floor(n(a))),ceil:a=>o(Math.ceil(n(a)))})),e}function XgA(){const A=VgA(F9()).domain([1,10]);return A.copy=()=>yM(A,XgA()).base(A.base()),hc.apply(A,arguments),A}function wKA(A){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/A))}}function DKA(A){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*A}}function zgA(A){var e=1,t=A(wKA(e),DKA(e));return t.constant=function(i){return arguments.length?A(wKA(e=+i),DKA(e)):e},jy(t)}function TgA(){var A=zgA(F9());return A.copy=function(){return yM(A,TgA()).constant(A.constant())},hc.apply(A,arguments)}function GKA(A){return function(e){return e<0?-Math.pow(-e,A):Math.pow(e,A)}}function UPe(A){return A<0?-Math.sqrt(-A):Math.sqrt(A)}function VPe(A){return A<0?-A*A:A*A}function _gA(A){var e=A(or,or),t=1;function i(){return t===1?A(or,or):t===.5?A(UPe,VPe):A(GKA(t),GKA(1/t))}return e.exponent=function(n){return arguments.length?(t=+n,i()):t},jy(e)}function M9(){var A=_gA(F9());return A.copy=function(){return yM(A,M9()).exponent(A.exponent())},hc.apply(A,arguments),A}function XPe(){return M9.apply(null,arguments).exponent(.5)}function OgA(){var A=[],e=[],t=[],i;function n(){var g=0,a=Math.max(1,e.length);for(t=new Array(a-1);++g<a;)t[g-1]=f3A(A,g/a);return o}function o(g){return g==null||isNaN(g=+g)?i:e[jk(t,g)]}return o.invertExtent=function(g){var a=e.indexOf(g);return a<0?[NaN,NaN]:[a>0?t[a-1]:A[0],a<t.length?t[a]:A[A.length-1]]},o.domain=function(g){if(!arguments.length)return A.slice();A=[];for(let a of g)a!=null&&!isNaN(a=+a)&&A.push(a);return A.sort(Oo),n()},o.range=function(g){return arguments.length?(e=Array.from(g),n()):e.slice()},o.unknown=function(g){return arguments.length?(i=g,o):i},o.quantiles=function(){return t.slice()},o.copy=function(){return OgA().domain(A).range(e).unknown(i)},hc.apply(o,arguments)}function kKA(){var A=0,e=1,t=1,i=[.5],n=[0,1],o;function g(s){return s!=null&&s<=s?n[jk(i,s,0,t)]:o}function a(){var s=-1;for(i=new Array(t);++s<t;)i[s]=((s+1)*e-(s-t)*A)/(t+1);return g}return g.domain=function(s){return arguments.length?([A,e]=s,A=+A,e=+e,a()):[A,e]},g.range=function(s){return arguments.length?(t=(n=Array.from(s)).length-1,a()):n.slice()},g.invertExtent=function(s){var I=n.indexOf(s);return I<0?[NaN,NaN]:I<1?[A,i[0]]:I>=t?[i[t-1],e]:[i[I-1],i[I]]},g.unknown=function(s){return arguments.length&&(o=s),g},g.thresholds=function(){return i.slice()},g.copy=function(){return kKA().domain([A,e]).range(n).unknown(o)},hc.apply(jy(g),arguments)}function qgA(){var A=[.5],e=[0,1],t,i=1;function n(o){return o!=null&&o<=o?e[jk(A,o,0,i)]:t}return n.domain=function(o){return arguments.length?(A=Array.from(o),i=Math.min(A.length,e.length-1),n):A.slice()},n.range=function(o){return arguments.length?(e=Array.from(o),i=Math.min(A.length,e.length-1),n):e.slice()},n.invertExtent=function(o){var g=e.indexOf(o);return[A[g-1],A[g]]},n.unknown=function(o){return arguments.length?(t=o,n):t},n.copy=function(){return qgA().domain(A).range(e).unknown(t)},hc.apply(n,arguments)}const jgA=new Date,PgA=new Date;function qo(A,e,t,i){function n(o){return A(o=arguments.length===0?new Date:new Date(+o)),o}return n.floor=o=>(A(o=new Date(+o)),o),n.ceil=o=>(A(o=new Date(o-1)),e(o,1),A(o),o),n.round=o=>{const g=n(o),a=n.ceil(o);return o-g<a-o?g:a},n.offset=(o,g)=>(e(o=new Date(+o),g==null?1:Math.floor(g)),o),n.range=(o,g,a)=>{const s=[];if(o=n.ceil(o),a=a==null?1:Math.floor(a),!(o<g)||!(a>0))return s;let I;do s.push(I=new Date(+o)),e(o,a),A(o);while(I<o&&o<g);return s},n.filter=o=>qo(g=>{if(g>=g)for(;A(g),!o(g);)g.setTime(g-1)},(g,a)=>{if(g>=g)if(a<0)for(;++a<=0;)for(;e(g,-1),!o(g););else for(;--a>=0;)for(;e(g,1),!o(g););}),t&&(n.count=(o,g)=>(jgA.setTime(+o),PgA.setTime(+g),A(jgA),A(PgA),Math.floor(t(jgA,PgA))),n.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?n.filter(i?g=>i(g)%o===0:g=>n.count(0,g)%o===0):n)),n}const gJ=qo(()=>{},(A,e)=>{A.setTime(+A+e)},(A,e)=>e-A);gJ.every=A=>(A=Math.floor(A),!isFinite(A)||!(A>0)?null:A>1?qo(e=>{e.setTime(Math.floor(e/A)*A)},(e,t)=>{e.setTime(+e+t*A)},(e,t)=>(t-e)/A):gJ),gJ.range;const Ad=1e3,jC=Ad*60,ed=jC*60,td=ed*24,$gA=td*7,JKA=td*30,AaA=td*365,yI=qo(A=>{A.setTime(A-A.getMilliseconds())},(A,e)=>{A.setTime(+A+e*Ad)},(A,e)=>(e-A)/Ad,A=>A.getUTCSeconds());yI.range;const aJ=qo(A=>{A.setTime(A-A.getMilliseconds()-A.getSeconds()*Ad)},(A,e)=>{A.setTime(+A+e*jC)},(A,e)=>(e-A)/jC,A=>A.getMinutes());aJ.range;const sJ=qo(A=>{A.setUTCSeconds(0,0)},(A,e)=>{A.setTime(+A+e*jC)},(A,e)=>(e-A)/jC,A=>A.getUTCMinutes());sJ.range;const rJ=qo(A=>{A.setTime(A-A.getMilliseconds()-A.getSeconds()*Ad-A.getMinutes()*jC)},(A,e)=>{A.setTime(+A+e*ed)},(A,e)=>(e-A)/ed,A=>A.getHours());rJ.range;const IJ=qo(A=>{A.setUTCMinutes(0,0,0)},(A,e)=>{A.setTime(+A+e*ed)},(A,e)=>(e-A)/ed,A=>A.getUTCHours());IJ.range;const pc=qo(A=>A.setHours(0,0,0,0),(A,e)=>A.setDate(A.getDate()+e),(A,e)=>(e-A-(e.getTimezoneOffset()-A.getTimezoneOffset())*jC)/td,A=>A.getDate()-1);pc.range;const tp=qo(A=>{A.setUTCHours(0,0,0,0)},(A,e)=>{A.setUTCDate(A.getUTCDate()+e)},(A,e)=>(e-A)/td,A=>A.getUTCDate()-1);tp.range;const v9=qo(A=>{A.setUTCHours(0,0,0,0)},(A,e)=>{A.setUTCDate(A.getUTCDate()+e)},(A,e)=>(e-A)/td,A=>Math.floor(A/td));v9.range;function Py(A){return qo(e=>{e.setDate(e.getDate()-(e.getDay()+7-A)%7),e.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jC)/$gA)}const ip=Py(0),wM=Py(1),NKA=Py(2),YKA=Py(3),$y=Py(4),RKA=Py(5),xKA=Py(6);ip.range,wM.range,NKA.range,YKA.range,$y.range,RKA.range,xKA.range;function Ab(A){return qo(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-A)%7),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/$gA)}const np=Ab(0),DM=Ab(1),FKA=Ab(2),MKA=Ab(3),eb=Ab(4),vKA=Ab(5),LKA=Ab(6);np.range,DM.range,FKA.range,MKA.range,eb.range,vKA.range,LKA.range;const tb=qo(A=>{A.setDate(1),A.setHours(0,0,0,0)},(A,e)=>{A.setMonth(A.getMonth()+e)},(A,e)=>e.getMonth()-A.getMonth()+(e.getFullYear()-A.getFullYear())*12,A=>A.getMonth());tb.range;const ib=qo(A=>{A.setUTCDate(1),A.setUTCHours(0,0,0,0)},(A,e)=>{A.setUTCMonth(A.getUTCMonth()+e)},(A,e)=>e.getUTCMonth()-A.getUTCMonth()+(e.getUTCFullYear()-A.getUTCFullYear())*12,A=>A.getUTCMonth());ib.range;const PC=qo(A=>{A.setMonth(0,1),A.setHours(0,0,0,0)},(A,e)=>{A.setFullYear(A.getFullYear()+e)},(A,e)=>e.getFullYear()-A.getFullYear(),A=>A.getFullYear());PC.every=A=>!isFinite(A=Math.floor(A))||!(A>0)?null:qo(e=>{e.setFullYear(Math.floor(e.getFullYear()/A)*A),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t*A)}),PC.range;const $C=qo(A=>{A.setUTCMonth(0,1),A.setUTCHours(0,0,0,0)},(A,e)=>{A.setUTCFullYear(A.getUTCFullYear()+e)},(A,e)=>e.getUTCFullYear()-A.getUTCFullYear(),A=>A.getUTCFullYear());$C.every=A=>!isFinite(A=Math.floor(A))||!(A>0)?null:qo(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/A)*A),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t*A)}),$C.range;function SKA(A,e,t,i,n,o){const g=[[yI,1,Ad],[yI,5,5*Ad],[yI,15,15*Ad],[yI,30,30*Ad],[o,1,jC],[o,5,5*jC],[o,15,15*jC],[o,30,30*jC],[n,1,ed],[n,3,3*ed],[n,6,6*ed],[n,12,12*ed],[i,1,td],[i,2,2*td],[t,1,$gA],[e,1,JKA],[e,3,3*JKA],[A,1,AaA]];function a(I,r,C){const l=r<I;l&&([I,r]=[r,I]);const c=C&&typeof C.range=="function"?C:s(I,r,C),B=c?c.range(I,+r+1):[];return l?B.reverse():B}function s(I,r,C){const l=Math.abs(r-I)/C,c=Vy(([,,u])=>u).right(g,l);if(c===g.length)return A.every(jm(I/AaA,r/AaA,C));if(c===0)return gJ.every(Math.max(jm(I,r,C),1));const[B,E]=g[l/g[c-1][2]<g[c][2]/l?c-1:c];return B.every(E)}return[a,s]}const[zPe,HKA]=SKA($C,ib,np,v9,IJ,sJ),[TPe,_Pe]=SKA(PC,tb,ip,pc,rJ,aJ);function eaA(A){if(0<=A.y&&A.y<100){var e=new Date(-1,A.m,A.d,A.H,A.M,A.S,A.L);return e.setFullYear(A.y),e}return new Date(A.y,A.m,A.d,A.H,A.M,A.S,A.L)}function taA(A){if(0<=A.y&&A.y<100){var e=new Date(Date.UTC(-1,A.m,A.d,A.H,A.M,A.S,A.L));return e.setUTCFullYear(A.y),e}return new Date(Date.UTC(A.y,A.m,A.d,A.H,A.M,A.S,A.L))}function GM(A,e,t){return{y:A,m:e,d:t,H:0,M:0,S:0,L:0}}function ZKA(A){var e=A.dateTime,t=A.date,i=A.time,n=A.periods,o=A.days,g=A.shortDays,a=A.months,s=A.shortMonths,I=kM(n),r=JM(n),C=kM(o),l=JM(o),c=kM(g),B=JM(g),E=kM(a),u=JM(a),d=kM(s),f=JM(s),w={a:X,A:_,b:q,B:$,c:null,d:zKA,e:zKA,f:u7e,g:G7e,G:J7e,H:B7e,I:Q7e,j:E7e,L:TKA,m:d7e,M:h7e,p:nA,q:j,Q:$KA,s:AUA,S:m7e,u:p7e,U:f7e,V:y7e,w:b7e,W:w7e,x:null,X:null,y:D7e,Y:k7e,Z:N7e,"%":PKA},y={a:O,A:eA,b:oA,B:tA,c:null,d:OKA,e:OKA,f:F7e,g:V7e,G:z7e,H:Y7e,I:R7e,j:x7e,L:qKA,m:M7e,M:v7e,p:sA,q:gA,Q:$KA,s:AUA,S:L7e,u:S7e,U:H7e,V:Z7e,w:W7e,W:K7e,x:null,X:null,y:U7e,Y:X7e,Z:T7e,"%":PKA},G={a:k,A:h,b:N,B:v,c:K,d:VKA,e:VKA,f:I7e,g:UKA,G:KKA,H:XKA,I:XKA,j:g7e,L:r7e,m:o7e,M:a7e,p:Q,q:n7e,Q:l7e,s:c7e,S:s7e,u:$Pe,U:A7e,V:e7e,w:PPe,W:t7e,x:U,X:V,y:UKA,Y:KKA,Z:i7e,"%":C7e};w.x=R(t,w),w.X=R(i,w),w.c=R(e,w),y.x=R(t,y),y.X=R(i,y),y.c=R(e,y);function R(iA,aA){return function(lA){var CA=[],QA=-1,uA=0,fA=iA.length,hA,yA,mA;for(lA instanceof Date||(lA=new Date(+lA));++QA<fA;)iA.charCodeAt(QA)===37&&(CA.push(iA.slice(uA,QA)),(yA=WKA[hA=iA.charAt(++QA)])!=null?hA=iA.charAt(++QA):yA=hA==="e"?" ":"0",(mA=aA[hA])&&(hA=mA(lA,yA)),CA.push(hA),uA=QA+1);return CA.push(iA.slice(uA,QA)),CA.join("")}}function x(iA,aA){return function(lA){var CA=GM(1900,void 0,1),QA=F(CA,iA,lA+="",0),uA,fA;if(QA!=lA.length)return null;if("Q"in CA)return new Date(CA.Q);if("s"in CA)return new Date(CA.s*1e3+("L"in CA?CA.L:0));if(aA&&!("Z"in CA)&&(CA.Z=0),"p"in CA&&(CA.H=CA.H%12+CA.p*12),CA.m===void 0&&(CA.m="q"in CA?CA.q:0),"V"in CA){if(CA.V<1||CA.V>53)return null;"w"in CA||(CA.w=1),"Z"in CA?(uA=taA(GM(CA.y,0,1)),fA=uA.getUTCDay(),uA=fA>4||fA===0?DM.ceil(uA):DM(uA),uA=tp.offset(uA,(CA.V-1)*7),CA.y=uA.getUTCFullYear(),CA.m=uA.getUTCMonth(),CA.d=uA.getUTCDate()+(CA.w+6)%7):(uA=eaA(GM(CA.y,0,1)),fA=uA.getDay(),uA=fA>4||fA===0?wM.ceil(uA):wM(uA),uA=pc.offset(uA,(CA.V-1)*7),CA.y=uA.getFullYear(),CA.m=uA.getMonth(),CA.d=uA.getDate()+(CA.w+6)%7)}else("W"in CA||"U"in CA)&&("w"in CA||(CA.w="u"in CA?CA.u%7:"W"in CA?1:0),fA="Z"in CA?taA(GM(CA.y,0,1)).getUTCDay():eaA(GM(CA.y,0,1)).getDay(),CA.m=0,CA.d="W"in CA?(CA.w+6)%7+CA.W*7-(fA+5)%7:CA.w+CA.U*7-(fA+6)%7);return"Z"in CA?(CA.H+=CA.Z/100|0,CA.M+=CA.Z%100,taA(CA)):eaA(CA)}}function F(iA,aA,lA,CA){for(var QA=0,uA=aA.length,fA=lA.length,hA,yA;QA<uA;){if(CA>=fA)return-1;if(hA=aA.charCodeAt(QA++),hA===37){if(hA=aA.charAt(QA++),yA=G[hA in WKA?aA.charAt(QA++):hA],!yA||(CA=yA(iA,lA,CA))<0)return-1}else if(hA!=lA.charCodeAt(CA++))return-1}return CA}function Q(iA,aA,lA){var CA=I.exec(aA.slice(lA));return CA?(iA.p=r.get(CA[0].toLowerCase()),lA+CA[0].length):-1}function k(iA,aA,lA){var CA=c.exec(aA.slice(lA));return CA?(iA.w=B.get(CA[0].toLowerCase()),lA+CA[0].length):-1}function h(iA,aA,lA){var CA=C.exec(aA.slice(lA));return CA?(iA.w=l.get(CA[0].toLowerCase()),lA+CA[0].length):-1}function N(iA,aA,lA){var CA=d.exec(aA.slice(lA));return CA?(iA.m=f.get(CA[0].toLowerCase()),lA+CA[0].length):-1}function v(iA,aA,lA){var CA=E.exec(aA.slice(lA));return CA?(iA.m=u.get(CA[0].toLowerCase()),lA+CA[0].length):-1}function K(iA,aA,lA){return F(iA,e,aA,lA)}function U(iA,aA,lA){return F(iA,t,aA,lA)}function V(iA,aA,lA){return F(iA,i,aA,lA)}function X(iA){return g[iA.getDay()]}function _(iA){return o[iA.getDay()]}function q(iA){return s[iA.getMonth()]}function $(iA){return a[iA.getMonth()]}function nA(iA){return n[+(iA.getHours()>=12)]}function j(iA){return 1+~~(iA.getMonth()/3)}function O(iA){return g[iA.getUTCDay()]}function eA(iA){return o[iA.getUTCDay()]}function oA(iA){return s[iA.getUTCMonth()]}function tA(iA){return a[iA.getUTCMonth()]}function sA(iA){return n[+(iA.getUTCHours()>=12)]}function gA(iA){return 1+~~(iA.getUTCMonth()/3)}return{format:function(iA){var aA=R(iA+="",w);return aA.toString=function(){return iA},aA},parse:function(iA){var aA=x(iA+="",!1);return aA.toString=function(){return iA},aA},utcFormat:function(iA){var aA=R(iA+="",y);return aA.toString=function(){return iA},aA},utcParse:function(iA){var aA=x(iA+="",!0);return aA.toString=function(){return iA},aA}}}var WKA={"-":"",_:" ",0:"0"},ug=/^\s*\d+/,OPe=/^%/,qPe=/[\\^$*+?|[\]().{}]/g;function Ii(A,e,t){var i=A<0?"-":"",n=(i?-A:A)+"",o=n.length;return i+(o<t?new Array(t-o+1).join(e)+n:n)}function jPe(A){return A.replace(qPe,"\\$&")}function kM(A){return new RegExp("^(?:"+A.map(jPe).join("|")+")","i")}function JM(A){return new Map(A.map((e,t)=>[e.toLowerCase(),t]))}function PPe(A,e,t){var i=ug.exec(e.slice(t,t+1));return i?(A.w=+i[0],t+i[0].length):-1}function $Pe(A,e,t){var i=ug.exec(e.slice(t,t+1));return i?(A.u=+i[0],t+i[0].length):-1}function A7e(A,e,t){var i=ug.exec(e.slice(t,t+2));return i?(A.U=+i[0],t+i[0].length):-1}function e7e(A,e,t){var i=ug.exec(e.slice(t,t+2));return i?(A.V=+i[0],t+i[0].length):-1}function t7e(A,e,t){var i=ug.exec(e.slice(t,t+2));return i?(A.W=+i[0],t+i[0].length):-1}function KKA(A,e,t){var i=ug.exec(e.slice(t,t+4));return i?(A.y=+i[0],t+i[0].length):-1}function UKA(A,e,t){var i=ug.exec(e.slice(t,t+2));return i?(A.y=+i[0]+(+i[0]>68?1900:2e3),t+i[0].length):-1}function i7e(A,e,t){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(t,t+6));return i?(A.Z=i[1]?0:-(i[2]+(i[3]||"00")),t+i[0].length):-1}function n7e(A,e,t){var i=ug.exec(e.slice(t,t+1));return i?(A.q=i[0]*3-3,t+i[0].length):-1}function o7e(A,e,t){var i=ug.exec(e.slice(t,t+2));return i?(A.m=i[0]-1,t+i[0].length):-1}function VKA(A,e,t){var i=ug.exec(e.slice(t,t+2));return i?(A.d=+i[0],t+i[0].length):-1}function g7e(A,e,t){var i=ug.exec(e.slice(t,t+3));return i?(A.m=0,A.d=+i[0],t+i[0].length):-1}function XKA(A,e,t){var i=ug.exec(e.slice(t,t+2));return i?(A.H=+i[0],t+i[0].length):-1}function a7e(A,e,t){var i=ug.exec(e.slice(t,t+2));return i?(A.M=+i[0],t+i[0].length):-1}function s7e(A,e,t){var i=ug.exec(e.slice(t,t+2));return i?(A.S=+i[0],t+i[0].length):-1}function r7e(A,e,t){var i=ug.exec(e.slice(t,t+3));return i?(A.L=+i[0],t+i[0].length):-1}function I7e(A,e,t){var i=ug.exec(e.slice(t,t+6));return i?(A.L=Math.floor(i[0]/1e3),t+i[0].length):-1}function C7e(A,e,t){var i=OPe.exec(e.slice(t,t+1));return i?t+i[0].length:-1}function l7e(A,e,t){var i=ug.exec(e.slice(t));return i?(A.Q=+i[0],t+i[0].length):-1}function c7e(A,e,t){var i=ug.exec(e.slice(t));return i?(A.s=+i[0],t+i[0].length):-1}function zKA(A,e){return Ii(A.getDate(),e,2)}function B7e(A,e){return Ii(A.getHours(),e,2)}function Q7e(A,e){return Ii(A.getHours()%12||12,e,2)}function E7e(A,e){return Ii(1+pc.count(PC(A),A),e,3)}function TKA(A,e){return Ii(A.getMilliseconds(),e,3)}function u7e(A,e){return TKA(A,e)+"000"}function d7e(A,e){return Ii(A.getMonth()+1,e,2)}function h7e(A,e){return Ii(A.getMinutes(),e,2)}function m7e(A,e){return Ii(A.getSeconds(),e,2)}function p7e(A){var e=A.getDay();return e===0?7:e}function f7e(A,e){return Ii(ip.count(PC(A)-1,A),e,2)}function _KA(A){var e=A.getDay();return e>=4||e===0?$y(A):$y.ceil(A)}function y7e(A,e){return A=_KA(A),Ii($y.count(PC(A),A)+(PC(A).getDay()===4),e,2)}function b7e(A){return A.getDay()}function w7e(A,e){return Ii(wM.count(PC(A)-1,A),e,2)}function D7e(A,e){return Ii(A.getFullYear()%100,e,2)}function G7e(A,e){return A=_KA(A),Ii(A.getFullYear()%100,e,2)}function k7e(A,e){return Ii(A.getFullYear()%1e4,e,4)}function J7e(A,e){var t=A.getDay();return A=t>=4||t===0?$y(A):$y.ceil(A),Ii(A.getFullYear()%1e4,e,4)}function N7e(A){var e=A.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ii(e/60|0,"0",2)+Ii(e%60,"0",2)}function OKA(A,e){return Ii(A.getUTCDate(),e,2)}function Y7e(A,e){return Ii(A.getUTCHours(),e,2)}function R7e(A,e){return Ii(A.getUTCHours()%12||12,e,2)}function x7e(A,e){return Ii(1+tp.count($C(A),A),e,3)}function qKA(A,e){return Ii(A.getUTCMilliseconds(),e,3)}function F7e(A,e){return qKA(A,e)+"000"}function M7e(A,e){return Ii(A.getUTCMonth()+1,e,2)}function v7e(A,e){return Ii(A.getUTCMinutes(),e,2)}function L7e(A,e){return Ii(A.getUTCSeconds(),e,2)}function S7e(A){var e=A.getUTCDay();return e===0?7:e}function H7e(A,e){return Ii(np.count($C(A)-1,A),e,2)}function jKA(A){var e=A.getUTCDay();return e>=4||e===0?eb(A):eb.ceil(A)}function Z7e(A,e){return A=jKA(A),Ii(eb.count($C(A),A)+($C(A).getUTCDay()===4),e,2)}function W7e(A){return A.getUTCDay()}function K7e(A,e){return Ii(DM.count($C(A)-1,A),e,2)}function U7e(A,e){return Ii(A.getUTCFullYear()%100,e,2)}function V7e(A,e){return A=jKA(A),Ii(A.getUTCFullYear()%100,e,2)}function X7e(A,e){return Ii(A.getUTCFullYear()%1e4,e,4)}function z7e(A,e){var t=A.getUTCDay();return A=t>=4||t===0?eb(A):eb.ceil(A),Ii(A.getUTCFullYear()%1e4,e,4)}function T7e(){return"+0000"}function PKA(){return"%"}function $KA(A){return+A}function AUA(A){return Math.floor(+A/1e3)}var CJ,NM,eUA,lJ,tUA;_7e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function _7e(A){return CJ=ZKA(A),NM=CJ.format,eUA=CJ.parse,lJ=CJ.utcFormat,tUA=CJ.utcParse,CJ}function O7e(A){return new Date(A)}function q7e(A){return A instanceof Date?+A:+new Date(+A)}function iaA(A,e,t,i,n,o,g,a,s,I){var r=hKA(),C=r.invert,l=r.domain,c=I(".%L"),B=I(":%S"),E=I("%I:%M"),u=I("%I %p"),d=I("%a %d"),f=I("%b %d"),w=I("%B"),y=I("%Y");function G(R){return(s(R)<R?c:a(R)<R?B:g(R)<R?E:o(R)<R?u:i(R)<R?n(R)<R?d:f:t(R)<R?w:y)(R)}return r.invert=function(R){return new Date(C(R))},r.domain=function(R){return arguments.length?l(Array.from(R,q7e)):l().map(O7e)},r.ticks=function(R){var x=l();return A(x[0],x[x.length-1],R??10)},r.tickFormat=function(R,x){return x==null?G:I(x)},r.nice=function(R){var x=l();return(!R||typeof R.range!="function")&&(R=e(x[0],x[x.length-1],R??10)),R?l(pKA(x,R)):r},r.copy=function(){return yM(r,iaA(A,e,t,i,n,o,g,a,s,I))},r}function iUA(){return hc.apply(iaA(TPe,_Pe,PC,tb,ip,pc,rJ,aJ,yI,NM).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function nUA(){return hc.apply(iaA(zPe,HKA,$C,ib,np,tp,IJ,sJ,yI,lJ).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function L9(){var A=0,e=1,t,i,n,o,g=or,a=!1,s;function I(C){return C==null||isNaN(C=+C)?s:g(n===0?.5:(C=(o(C)-t)*n,a?Math.max(0,Math.min(1,C)):C))}I.domain=function(C){return arguments.length?([A,e]=C,t=o(A=+A),i=o(e=+e),n=t===i?0:1/(i-t),I):[A,e]},I.clamp=function(C){return arguments.length?(a=!!C,I):a},I.interpolator=function(C){return arguments.length?(g=C,I):g};function r(C){return function(l){var c,B;return arguments.length?([c,B]=l,g=C(c,B),I):[g(0),g(1)]}}return I.range=r(ep),I.rangeRound=r(nJ),I.unknown=function(C){return arguments.length?(s=C,I):s},function(C){return o=C,t=C(A),i=C(e),n=t===i?0:1/(i-t),I}}function op(A,e){return e.domain(A.domain()).interpolator(A.interpolator()).clamp(A.clamp()).unknown(A.unknown())}function naA(){var A=jy(L9()(or));return A.copy=function(){return op(A,naA())},Pm.apply(A,arguments)}function oUA(){var A=VgA(L9()).domain([1,10]);return A.copy=function(){return op(A,oUA()).base(A.base())},Pm.apply(A,arguments)}function gUA(){var A=zgA(L9());return A.copy=function(){return op(A,gUA()).constant(A.constant())},Pm.apply(A,arguments)}function oaA(){var A=_gA(L9());return A.copy=function(){return op(A,oaA()).exponent(A.exponent())},Pm.apply(A,arguments)}function j7e(){return oaA.apply(null,arguments).exponent(.5)}function S9(){var A=0,e=.5,t=1,i=1,n,o,g,a,s,I=or,r,C=!1,l;function c(E){return isNaN(E=+E)?l:(E=.5+((E=+r(E))-o)*(i*E<i*o?a:s),I(C?Math.max(0,Math.min(1,E)):E))}c.domain=function(E){return arguments.length?([A,e,t]=E,n=r(A=+A),o=r(e=+e),g=r(t=+t),a=n===o?0:.5/(o-n),s=o===g?0:.5/(g-o),i=o<n?-1:1,c):[A,e,t]},c.clamp=function(E){return arguments.length?(C=!!E,c):C},c.interpolator=function(E){return arguments.length?(I=E,c):I};function B(E){return function(u){var d,f,w;return arguments.length?([d,f,w]=u,I=oJ(E,[d,f,w]),c):[I(0),I(.5),I(1)]}}return c.range=B(ep),c.rangeRound=B(nJ),c.unknown=function(E){return arguments.length?(l=E,c):l},function(E){return r=E,n=E(A),o=E(e),g=E(t),a=n===o?0:.5/(o-n),s=o===g?0:.5/(g-o),i=o<n?-1:1,c}}function gaA(){var A=jy(S9()(or));return A.copy=function(){return op(A,gaA())},Pm.apply(A,arguments)}function aaA(){var A=VgA(S9()).domain([.1,1,10]);return A.copy=function(){return op(A,aaA()).base(A.base())},Pm.apply(A,arguments)}function saA(){var A=zgA(S9());return A.copy=function(){return op(A,saA()).constant(A.constant())},Pm.apply(A,arguments)}function H9(){var A=_gA(S9());return A.copy=function(){return op(A,H9()).exponent(A.exponent())},Pm.apply(A,arguments)}function P7e(){return H9.apply(null,arguments).exponent(.5)}const dg="#5B8FF9",raA={background:"transparent",boxplot:{ticks:{fill:"#d1d5db"},rule:{color:"#d1d5db"}},header:{titleColor:"#d1d5db",labelColor:"#d1d5db"},axis:{gridColor:"#666",domainColor:"#d1d5db",tickColor:"#d1d5db",labelColor:"#d1d5db",titleColor:"#d1d5db"},legend:{labelColor:"#d1d5db",titleColor:"#d1d5db"},text:{color:"#d1d5db"},view:{stroke:"#666"}},$7e={light:{background:"transparent",boxplot:{ticks:!0}},dark:raA},A$e={light:{font:"sans-serif",background:"transparent",fieldTitle:"verbal",title:{align:"left",anchor:"start",color:"#31333F",titleFontStyle:"normal",fontWeight:600,fontSize:16,orient:"top",offset:26},header:{titleFontWeight:400,titleFontSize:16,titleColor:"#808495",titleFontStyle:"normal",labelFontSize:12,labelFontWeight:400,labelColor:"#808495",labelFontStyle:"normal"},axis:{labelFontSize:12,labelFontWeight:400,labelColor:"#808495",labelFontStyle:"normal",titleFontWeight:400,titleFontSize:14,titleColor:"#808495",titleFontStyle:"normal",ticks:!1,gridColor:"#e6eaf1",domain:!1,domainWidth:1,domainColor:"#e6eaf1",labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:16,labelPadding:16,labelSeparation:4,labelOverlap:!0},legend:{labelFontSize:14,labelFontWeight:400,labelColor:"#808495",titleFontSize:14,titleFontWeight:400,titleFontStyle:"normal",titleColor:"#808495",titlePadding:5,labelPadding:16,columnPadding:8,rowPadding:4,padding:7,symbolStrokeWidth:4},range:{category:["#0068c9","#83c9ff","#ff2b2b","#ffabab","#29b09d","#7defa1","#ff8700","#ffd16a","#6d3fc0","#d5dae5"],diverging:["#7d353b","#bd4043","#ff4b4b","#ff8c8c","#ffc7c7","#a6dcff","#60b4ff","#1c83e1","#0054a3","#004280"],ramp:["#e4f5ff","#c7ebff","#a6dcff","#83c9ff","#60b4ff","#3d9df3","#1c83e1","#0068c9","#0054a3","#004280"],heatmap:["#e4f5ff","#c7ebff","#a6dcff","#83c9ff","#60b4ff","#3d9df3","#1c83e1","#0068c9","#0054a3","#004280"]},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,color:"#0068C9"},bar:{binSpacing:4,discreteBandSize:{band:.85}},boxplot:{ticks:!0},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}},dark:{font:"sans-serif",background:"transparent",fieldTitle:"verbal",title:{align:"left",anchor:"start",color:"#fafafa",titleFontStyle:"normal",fontWeight:600,fontSize:16,orient:"top",offset:26},header:{titleFontWeight:400,titleFontSize:16,titleColor:"#e6eaf1",titleFontStyle:"normal",labelFontSize:12,labelFontWeight:400,labelColor:"#e6eaf1",labelFontStyle:"normal"},axis:{labelFontSize:12,labelFontWeight:400,labelColor:"#e6eaf1",labelFontStyle:"normal",titleFontWeight:400,titleFontSize:14,titleColor:"#e6eaf1",titleFontStyle:"normal",ticks:!1,gridColor:"#31333F",domain:!1,domainWidth:1,domainColor:"#31333F",labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:16,labelPadding:16,labelSeparation:4,labelOverlap:!0},legend:{labelFontSize:14,labelFontWeight:400,labelColor:"#e6eaf1",titleFontSize:14,titleFontWeight:400,titleFontStyle:"normal",titleColor:"#e6eaf1",titlePadding:5,labelPadding:16,columnPadding:8,rowPadding:4,padding:7,symbolStrokeWidth:4},range:{category:["#83c9ff","#0068c9","#ffabab","#ff2b2b","#7defa1","#29b09d","#ffd16a","#ff8700","#6d3fc0","#d5dae5"],diverging:["#7d353b","#bd4043","#ff4b4b","#ff8c8c","#ffc7c7","#a6dcff","#60b4ff","#1c83e1","#0054a3","#004280"],ramp:["#004280","#0054a3","#0068c9","#1c83e1","#3d9df3","#60b4ff","#83c9ff","#a6dcff","#c7ebff","#e4f5ff"],heatmap:["#004280","#0054a3","#0068c9","#1c83e1","#3d9df3","#60b4ff","#83c9ff","#a6dcff","#c7ebff","#e4f5ff"]},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400},boxplot:{ticks:{fill:"#e6eaf1"},rule:{color:"#e6eaf1"}},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,color:"#83C9FF"},bar:{binSpacing:4,discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}}},e$e={light:{area:{fill:dg},bar:{fill:dg},circle:{fill:dg},line:{stroke:dg},point:{stroke:dg},rect:{fill:dg},tick:{fill:dg},arc:{fill:dg},boxplot:{ticks:!0},background:"transparent",range:{category:["#5B8FF9","#61DDAA","#65789B","#F6BD16","#7262FD","#78D3F8","#9661BC","#F6903D","#008685","#F08BB4"],diverging:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],heatmap:["#0d0887","#46039f","#7201a8","#9c179e","#bd3786","#d8576b","#ed7953","#fb9f3a","#fdca26","#f0f921"],ramp:["#EBCCFF","#CCB0FF","#AE95FF","#907BFF","#7262FD","#5349E0","#2F32C3","#001BA7","#00068C"]},scale:{continuous:{range:["#d4d4e8","#3b196f"]}}},dark:{...raA,area:{fill:dg},bar:{fill:dg},circle:{fill:dg},line:{stroke:dg},point:{stroke:dg},rect:{fill:dg},tick:{fill:dg},arc:{fill:dg},range:{category:["#5B8FF9","#61DDAA","#65789B","#F6BD16","#7262FD","#78D3F8","#9661BC","#F6903D","#008685","#F08BB4"],diverging:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],heatmap:["#0d0887","#46039f","#7201a8","#9c179e","#bd3786","#d8576b","#ed7953","#fb9f3a","#fdca26","#f0f921"],ramp:["#EBCCFF","#CCB0FF","#AE95FF","#907BFF","#7262FD","#5349E0","#2F32C3","#001BA7","#00068C"]},scale:{continuous:{range:["#d4d4e8","#3b196f"]}}}},Z9={vega:$7e,g2:e$e,streamlit:A$e},t$e=A=>({light:{area:{fill:A},bar:{fill:A},circle:{fill:A},line:{stroke:A},point:{stroke:A},rect:{fill:A},tick:{fill:A},boxplot:{fill:A},errorbar:{stroke:A},errorband:{fill:A},arc:{fill:A},background:"transparent"},dark:{...raA,area:{fill:A},bar:{fill:A},circle:{fill:A},line:{stroke:A},point:{stroke:A},rect:{fill:A},tick:{fill:A},boxplot:{fill:A},errorbar:{stroke:A},errorband:{fill:A},arc:{fill:A}}}),i$e=A=>({light:{range:{category:{scheme:A},diverging:{scheme:A},heatmap:{scheme:A},ordinal:{scheme:A},ramp:{scheme:A}}},dark:{range:{category:{scheme:A},diverging:{scheme:A},heatmap:{scheme:A},ordinal:{scheme:A},ramp:{scheme:A}}}}),IaA={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f",blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"};function aUA(A){const e=A.length/6|0,t=new Array(e);for(let i=0;i<e;)t[i]="#"+A.slice(i*6,++i*6);return t}const n$e=Object.entries(IaA).map(([A,e])=>({name:A,value:aUA(e)})),CaA=A=>aUA(IaA[A]??IaA.tableau10),sUA=(A,e)=>{if(!e)return A;const t=e.match(/\d+/g)||[],[i=0,n=0,o=0,g=0]=t.map(Number);return{r:i,g:n,b:o,a:g}},laA=A=>A&&typeof A=="object"&&A.constructor===Object,rUA=(A,e)=>{if(laA(A)&&laA(e)){const t={...A};return Object.keys(e).forEach(i=>{t[i]=laA(t[i])?rUA(t[i],e[i]):e[i]}),t}return e},o$e=(...A)=>A.reduce((e,t)=>rUA(e,t),{});function IUA(A){var e;const{vizThemeConfig:t,mediaTheme:i,colorPalette:n,primaryColor:o}=A,g=(typeof t=="string"?Z9[t]:t)??Z9.vega,a=o?t$e(o):{},s=n?i$e(n):{};return(e=o$e(g,a,s))==null?void 0:e[i]}function CUA(A){if(A){if(A instanceof Array)return A;if(typeof A=="object"&&"scheme"in A)return A.scheme instanceof Array?A.scheme:CaA(A.scheme)}}function g$e(A){var e,t,i;const n=((e=A.point)==null?void 0:e.stroke)??dg,o=typeof n=="string"?n:dg,g=CUA((t=A.range)==null?void 0:t.category)??CaA("tableau10"),a=CUA((i=A.range)==null?void 0:i.ramp)??CaA("blues");return{primaryColor:o,nominalPalette:g,quantitativePalette:a}}const lUA=(A,e,t,i)=>{const{nominalPalette:n,primaryColor:o,quantitativePalette:g}=p.useMemo(()=>g$e(i),[i]),a=p.useMemo(()=>()=>o,[o]),s=p.useMemo(()=>e?t&&e.aggName&&e.analyticType==="measure"?Fo(e.fid,e.aggName):e.fid:"",[e,t]),I=p.useMemo(()=>!e||e.semanticType==="nominal"?[0,0]:A.reduce((B,{[s]:E})=>(E<B[0]&&(B[0]=E),E>B[1]&&(B[1]=E),B),[1/0,-1/0]),[A,e,s]),r=p.useMemo(()=>!e||e.semanticType!=="nominal"?[]:[...A.reduce((B,E)=>(B.add(E[s]),B),new Set)],[A,e,s]),C=p.useMemo(()=>{const[B,E]=I,u=g.map((f,w)=>B+(E-B)*w/(g.length-1)),d=bM().domain(u).range(g);return function(f){return d(Number(f[s]))}},[I,s,g]),l=p.useMemo(()=>{const B=$k().domain(r).range(n);return function(E){return B(E[s])}},[r,n]),c=p.useMemo(()=>r.map(B=>({name:B,color:l({[s]:B})})),[r,l]);return e?e.semanticType==="quantitative"||e.semanticType==="temporal"?{mapper:C,display:{type:e.semanticType,color:g,domain:I}}:{mapper:l,display:{type:"nominal",colors:c}}:{mapper:a}},cUA=(A,e,t)=>p.useMemo(()=>{let i,n;if(t&&(t.domain&&(i=Number(t.domain[0]),n=Number(t.domain[1])),xi(t.domainMin)&&(i=t.domainMin),xi(t.domainMax)&&(n=t.domainMax)),xi(i)&&xi(n))return[i,n];if(!A)return[i??0,n??0];const o=e.map(s=>Number(s[A])).filter(s=>!isNaN(s));if(o.length===0)return[i??0,n??0];const[g,a]=o.slice(1).reduce((s,I)=>(I<s[0]&&(s[0]=I),I>s[1]&&(s[1]=I),s),[o[0],o[0]]);return[i??g,n??a]},[A,e,t]),BUA=(A,e,t)=>p.useMemo(()=>{let i,n;return t&&(t.range&&(i=Number(t.range[0]),n=Number(t.range[1])),xi(t.rangeMin)&&(i=t.rangeMin),xi(t.rangeMax)&&(n=t.rangeMax)),[i??A,n??e]},[t,e,A]),a$e=2,s$e=10,r$e=3,I$e=(A,e,t,i)=>{const n=p.useMemo(()=>e?t&&e.aggName&&e.analyticType==="measure"?Fo(e.fid,e.aggName):e.fid:"",[e,t]),o=p.useMemo(()=>{if(i.size)return MvA(i.size,e,A,"light")},[i,A,e]),[g,a]=cUA(n,A,o),[s,I]=BUA(a$e,s$e,o);return p.useCallback(function(r){const C=Math.max(s,Math.min(r$e,I));if(!n)return C;const l=Number(r[n]);if(isNaN(l))return C;const c=Math.max(Math.min((l-g)/(a-g),1),0);return s+Math.sqrt(c)*(I-s)},[n,g,a,s,I,t])},C$e=.3,l$e=.8,c$e=1,QUA=(A,e,t,i)=>{const n=p.useMemo(()=>e?t&&e.aggName&&e.analyticType==="measure"?Fo(e.fid,e.aggName):e.fid:"",[e,t]),o=p.useMemo(()=>{if(i.opacity)return MvA(i.opacity,e,A,"light")},[i,A,e]),[g,a]=cUA(n,A,o),[s,I]=BUA(C$e,l$e,o);return p.useCallback(function(r){if(!n)return c$e;const C=Number(r[n]);if(isNaN(C))return 0;const l=Math.max(Math.min((C-g)/(a-g),1),0);return s+l*(I-s)},[n,g,a,s,I,t])},B$e=A=>`${A}`,Q$e=(A,e)=>{const{timeFormat:t="%b %d, %Y",numberFormat:i}=e,n=p.useMemo(()=>{const g=NM(t);return a=>{if(typeof a!="number"&&typeof a!="string")return"";const s=new Date(a);return isNaN(s.getTime())?"Invalid Date":g(s)}},[t]),o=p.useMemo(()=>{if(!i)return a=>typeof a!="number"?"":a.toLocaleString();const g=Ec(i);return a=>typeof a!="number"?"":g(a)},[i]);return p.useMemo(()=>A==="quantitative"?o:A==="temporal"?n:B$e,[A,o,n])};function EUA({bounds:A}){return J8e().flyToBounds(A),null}const caA=p.memo(function({allFields:A,vegaConfig:e,field:t,value:i}){const{fid:n,analyticType:o,aggName:g}=t,a=p.useMemo(()=>{var I;const r=((I=A.find(C=>C.fid===n))==null?void 0:I.name)??n;return o==="measure"&&g?`${g}(${r})`:r},[A,n,o,g]),s=Q$e(t.semanticType,e);return b.createElement("p",null,a,": ",s(i))}),W9=15;function uUA(A){const{display:e,field:t,aggerated:i}=A,n=i&&t.analyticType==="measure"&&t.aggName?`${t.aggName}(${t.name})`:t.name;return b.createElement("div",{className:"absolute right-5 top-5 bg-popover/30 rounded p-2",style:{zIndex:999}},e.type==="nominal"&&b.createElement("div",{className:"font-xs flex flex-col space-y-1"},b.createElement("div",{className:"font-medium max-w-[160px] overflow-hidden text-ellipsis whitespace-nowrap"},n),e.colors.slice(0,W9).map(({name:o,color:g})=>b.createElement("div",{className:"flex space-x-1 items-center",key:o},b.createElement("div",{className:"w-3 h-3",style:{backgroundColor:g}}),b.createElement("div",null,o))),e.colors.length>W9&&b.createElement("div",{className:"flex space-x-1 items-center"},b.createElement("div",{className:"w-3 h-3",style:{backgroundColor:e.colors[W9].color}}),b.createElement("div",null,"...",e.colors.length-W9," entries"))),e.type==="quantitative"&&b.createElement("div",{className:"font-xs flex flex-col space-y-1"},b.createElement("div",{className:"font-medium max-w-[160px] overflow-hidden text-ellipsis whitespace-nowrap"},n),b.createElement("div",{className:"flex space-x-1"},b.createElement("div",{className:"w-4 h-48",style:{background:`linear-gradient(${[...e.color].reverse().join(",")})`}}),b.createElement("div",{className:"font-xs flex flex-col justify-between"},b.createElement("div",null,Math.floor(e.domain[1])),b.createElement("div",null,Math.floor(e.domain[1]*.75+e.domain[0]*.25)),b.createElement("div",null,Math.floor(e.domain[1]*.5+e.domain[0]*.5)),b.createElement("div",null,Math.floor(e.domain[1]*.25+e.domain[0]*.75)),b.createElement("div",null,Math.floor(e.domain[0]))))))}const K9=(A,e)=>{const t=Number(A),i=Number(e);return t>=-90&&t<=90&&i>=-180&&i<=180},E$e=(A,e)=>`${typeof A=="number"?A:JSON.stringify(A)}, ${typeof e=="number"?e:JSON.stringify(e)}`,BaA=20,u$e=p.forwardRef(function(A,e){const{name:t,data:i,allFields:n,latitude:o,longitude:g,color:a,opacity:s,size:I,details:r,defaultAggregated:C,vegaConfig:l,scales:c,tileUrl:B}=A,E=p.useMemo(()=>g&&o?i.map(k=>[Number(k[o.fid]),Number(k[g.fid])]).filter(k=>K9(k[0],k[1])):[],[g,o,i]),[u,d]=p.useMemo(()=>{if(E.length>0){const[k,h]=E.reduce(([N,v],[K,U])=>(K<N[0][0]&&(N[0][0]=K),K>N[1][0]&&(N[1][0]=K),U<N[0][1]&&(N[0][1]=U),U>N[1][1]&&(N[1][1]=U),[N,[v[0]+U,v[1]+K]]),[[[...E[0]],[...E[0]]],[0,0]]);return[k,[h[0]/E.length,h[1]/E.length]]}return[[[-180,-90],[180,90]],[0,0]]},[E]),f=p.useRef(null);p.useEffect(()=>{var k;const h=(k=f.current)==null?void 0:k.getContainer();if(h){const N=new ResizeObserver(()=>{var v;(v=f.current)==null||v.invalidateSize()});return N.observe(h),()=>{N.unobserve(h)}}});const w=_k();p.useEffect(()=>{const k=w.current;k&&(k.exportChart=async h=>({mode:h,title:t||"untitled",nCols:0,nRows:0,charts:[],container:()=>{var N;return((N=f.current)==null?void 0:N.getContainer())??null},chartType:"map"}))},[]);const y=I$e(i,I,C,c),G=QUA(i,s,C,c),{mapper:R,display:x}=lUA(i,a,C,l),F=p.useMemo(()=>r.concat([I,a,s].filter(Boolean)).map(k=>({...k,key:C&&k.analyticType==="measure"&&k.aggName?Fo(k.fid,k.aggName):k.fid})),[C,r,I,a,s]),Q=p.useMemo(()=>{if(o&&g){const k=[],h=i.flatMap((N,v)=>{const K=N[o.fid],U=N[g.fid];if(!K9(K,U))return k.push([v,K,U]),[];const V=y(N),X=G(N),_=R(N);return[{key:`${v}-${V}-${X}-${_}`,center:[Number(K),Number(U)],radius:V,opacity:X,color:_,row:N}]});return k.length>0&&console.warn(`Failed to render ${k.length.toLocaleString()} markers of ${i.length.toLocaleString()} rows due to invalid lat/lng.
--------
${`${k.slice(0,BaA).map(([N,v,K])=>`[${N+1}] ${E$e(v,K)}`).join(`
`)}`+(k.length>BaA?`
	... and ${(k.length-BaA).toLocaleString()} more`:"")}
`),h}else return[]},[o,g,i,y,G,R]);return b.createElement(fgA,{attributionControl:!1,center:d,ref:f,zoom:5,bounds:u,preferCanvas:!0,style:{width:"100%",height:"100%",zIndex:1}},b.createElement(EUA,{bounds:u}),B===void 0&&b.createElement(lM,{className:"map-tile",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),B&&b.createElement(lM,{className:"map-tile",url:B}),b.createElement(hgA,{prefix:"Leaflet"}),Q.map(({key:k,center:h,radius:N,opacity:v,color:K,row:U})=>b.createElement(mgA,{key:k,center:h,radius:N,opacity:.8,fillOpacity:v,fillColor:K,color:"#00000022",stroke:!0,weight:1,fill:!0},F.length>0&&b.createElement(cM,null,F.map((V,X)=>b.createElement(caA,{key:X,allFields:n,vegaConfig:l,field:V,value:U[V.key]}))))),x&&b.createElement(uUA,{display:x,field:a}))}),d$e=u$e,QaA={};function dUA(A,e){const t=e?`${e.type}(${e.url})`:"",i=A||QaA[t]||e,[n,o]=p.useState(0),g=p.useRef(0);return p.useEffect(()=>{if(i===e&&e){const a=Date.now();g.current=a,fetch(e.url).then(s=>s.json()).then(s=>{if(a===g.current){if(e.type==="GeoJSON")if("features"in s)QaA[t]=s;else throw"invalid geojson";else QaA[t]=zV(s,Object.keys(s.objects)[0]);o(a)}}).catch(s=>console.error(s))}},[i]),i===e?void 0:i}const EaA=A=>{switch(A.type){case"Polygon":return[A.coordinates[0].map(e=>[e[1],e[0]])];case"Point":{const e=A.coordinates;return[[[e[1],e[0]]]]}case"GeometryCollection":return A.geometries.map(EaA).flat();case"LineString":return[A.coordinates.map(e=>[e[1],e[0]])];case"MultiLineString":return A.coordinates.map(e=>e.map(t=>[t[1],t[0]]));case"MultiPoint":return[A.coordinates.map(e=>[e[1],e[0]])];case"MultiPolygon":return A.coordinates.map(e=>e[0].map(t=>[t[1],t[0]]));default:return[]}},hUA=A=>{let e=0,t=[0,0];for(let i=0;i<A.length-1;i++){let[n,o]=A[i],[g,a]=A[i+1],s=n*a-g*o;e+=s,t[0]+=(n+g)*s,t[1]+=(o+a)*s}return e/=2,t[0]/=6*e,t[1]/=6*e,t},h$e=p.forwardRef(function(A,e){const{name:t,data:i,allFields:n,features:o,featuresUrl:g,geoKey:a,defaultAggregated:s,geoId:I,color:r,opacity:C,text:l,details:c,vegaConfig:B,scaleIncludeUnmatchedChoropleth:E,showAllGeoshapeInChoropleth:u,scales:d,tileUrl:f}=A,w=p.useContext(sQ);p.useImperativeHandle(e,()=>({}));const y=dUA(o,g),{t:G}=ve("translation"),R=p.useMemo(()=>I?i.map(nA=>nA[I.fid]):[],[I,i]),[x,F]=p.useMemo(()=>{if(R.length&&a&&y){const nA=[],j=R.map((O,eA)=>{const oA=O?y.features.find(tA=>tA.properties&&tA.properties[a]===O):void 0;return oA&&nA.push(eA),oA});return[nA,j]}return[[],[]]},[R,y,a]),Q=p.useMemo(()=>{if(u&&y){const nA=new Set(R);return y.features.filter(j=>j.properties).filter(j=>!nA.has(j.properties[a])).map(j=>({coords:EaA(j.geometry),name:j.properties[a]}))}return[]},[R,y,u,a]);p.useEffect(()=>{if(F.length>0){const nA=F.filter(j=>!j);nA.length&&console.warn(`Failed to render ${nA.length.toLocaleString()} items of ${i.length.toLocaleString()} rows due to missing geojson feature.`)}},[F]);const k=p.useMemo(()=>F.length>0?F.map(nA=>nA?EaA(nA.geometry):[],[]):[],[F]),[h,N]=p.useMemo(()=>{const nA=k.flat(2);if(nA.length>0){const[j,O]=nA.reduce(([eA,oA],[tA,sA])=>(tA<eA[0][0]&&(eA[0][0]=tA),tA>eA[1][0]&&(eA[1][0]=tA),sA<eA[0][1]&&(eA[0][1]=sA),sA>eA[1][1]&&(eA[1][1]=sA),[eA,[oA[0]+sA,oA[1]+tA]]),[[[...nA[0]],[...nA[0]]],[0,0]]);return[j,[O[0]/k.length,O[1]/k.length]]}return[[[-180,-90],[180,90]],[0,0]]},[k]),v=p.useMemo(()=>E?i:x.map(nA=>i[nA]),[i,x,E]),K=QUA(v,C,s,d),{mapper:U,display:V}=lUA(v,r,s,B),X=p.useMemo(()=>c.concat([r,C].filter(Boolean)).map(nA=>({...nA,key:s&&nA.analyticType==="measure"&&nA.aggName?Fo(nA.fid,nA.aggName):nA.fid})),[s,c,r,C]),_=p.useRef(null);p.useEffect(()=>{var nA;const j=(nA=_.current)==null?void 0:nA.getContainer();if(j){const O=new ResizeObserver(()=>{var eA;(eA=_.current)==null||eA.invalidateSize()});return O.observe(j),()=>{O.unobserve(j)}}});const q=_k();if(p.useEffect(()=>{const nA=q.current;nA&&(nA.exportChart=async j=>({mode:j,title:t||"untitled",nCols:0,nRows:0,charts:[],container:()=>{var O;return((O=_.current)==null?void 0:O.getContainer())??null},chartType:"map"}))},[]),!y&&(o||g))return b.createElement("div",{className:"flex items-center justify-center w-full h-full"},G("main.tabpanel.settings.geography_settings.loading"));const $=w==="dark"?"#fff4":"#0004";return b.createElement(fgA,{preferCanvas:!0,attributionControl:!1,center:N,ref:_,zoom:5,bounds:h,style:{width:"100%",height:"100%",zIndex:1}},b.createElement(EUA,{bounds:h}),f===void 0&&b.createElement(lM,{className:"map-tile",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),f&&b.createElement(lM,{className:"map-tile",url:f}),b.createElement(hgA,{prefix:"Leaflet"}),k.length>0&&i.flatMap((nA,j)=>{const O=k[j],eA=K(nA),oA=U(nA);return O.map((tA,sA)=>{if(tA.length===0)return null;if(tA.length===1)return b.createElement(mgA,{key:`${j}-${eA}-${oA}-${sA}`,center:tA[0],radius:3,opacity:.8,fillOpacity:eA,fillColor:oA,color:$,weight:1,stroke:!0,fill:!0},X.length>0&&b.createElement(cM,null,b.createElement("header",null,i[j][I.fid]),X.map((iA,aA)=>b.createElement(caA,{key:aA,allFields:n,vegaConfig:B,field:iA,value:nA[iA.key]}))));const gA=l&&tA.length>=3?hUA(tA):[NaN,NaN];return b.createElement(p.Fragment,{key:`${j}-${eA}-${oA}-${sA}`},b.createElement(l3A,{positions:tA,pathOptions:{fillOpacity:eA*.8,fillColor:oA,color:$,weight:1,stroke:!0,fill:!0}},b.createElement(cM,null,b.createElement("header",null,i[j][I.fid]),X.map((iA,aA)=>b.createElement(caA,{key:aA,allFields:n,vegaConfig:B,field:iA,value:nA[iA.key]})))),l&&i[j][l.fid]&&K9(gA[0],gA[1])&&b.createElement(C3A,{position:gA,interactive:!1,icon:uc.divIcon({className:"!bg-transparent !border-none",html:`<div style="font-size: 11px; transform: translate(-50%, -50%); opacity: 0.8;">${i[j][l.fid]}</div>`})}))})}),Q.flatMap(({coords:nA,name:j},O)=>{const eA="#808080";return nA.map((oA,tA)=>{if(oA.length===0)return null;if(oA.length===1)return b.createElement(mgA,{key:`missing-${O}-${tA}`,center:oA[0],radius:3,opacity:.8,fillOpacity:.3,fillColor:eA,color:$,weight:1,stroke:!0,fill:!0},X.length>0&&b.createElement(cM,null,b.createElement("header",null,j),X.map((gA,iA)=>b.createElement("p",{key:iA},gA.analyticType==="measure"&&gA.aggName?wy(gA.name,gA.aggName):gA.name,": Null"))));const sA=l&&oA.length>=3?hUA(oA):[NaN,NaN];return b.createElement(p.Fragment,{key:`missing-${O}-${tA}`},b.createElement(l3A,{positions:oA,pathOptions:{fillOpacity:.3*.8,fillColor:eA,color:$,weight:1,stroke:!0,fill:!0}},b.createElement(cM,null,b.createElement("header",null,j),X.map((gA,iA)=>b.createElement("p",{key:iA},gA.analyticType==="measure"&&gA.aggName?wy(gA.name,gA.aggName):gA.name,": Null")))),l&&i[O][l.fid]&&K9(sA[0],sA[1])&&b.createElement(C3A,{position:sA,interactive:!1,icon:uc.divIcon({className:"!bg-transparent !border-none",html:`<div style="font-size: 11px; transform: translate(-50%, -50%); opacity: 0.8;">${i[O][l.fid]}</div>`})}))})}),V&&b.createElement(uUA,{display:V,field:r}))}),m$e=h$e,uaA=800,U9=600,p$e=p.forwardRef(function(A,e){const{name:t,draggableFieldState:i,data:n,visualConfig:o,visualLayout:g,vegaConfig:a={},scales:s,scale:I}=A,{latitude:[r],longitude:[C],geoId:[l],dimensions:c,measures:B,size:[E],color:[u],opacity:[d],text:[f],details:w}=i,{defaultAggregated:y,geoms:[G]}=o,{geojson:R,geoKey:x="",geoUrl:F,scaleIncludeUnmatchedChoropleth:Q=!1,showAllGeoshapeInChoropleth:k=!1,geoMapTileUrl:h}=g,N=p.useMemo(()=>[...c,...B],[c,B]),v=p.useMemo(()=>N.find(q=>q.geoRole==="latitude"),[N]),K=p.useMemo(()=>N.find(q=>q.geoRole==="longitude"),[N]),U=p.useMemo(()=>r??v,[r,v]),V=p.useMemo(()=>C??K,[C,K]),X=p.useMemo(()=>{const q=s??{};if(I)for(const $ of Object.keys(I))q[$]={...q[$]??{},...I[$]};return q},[s,I]),_=h??a.leafletGeoTileUrl;return G==="poi"?b.createElement(d$e,{tileUrl:_,name:t,data:n,allFields:N,defaultAggregated:y,latitude:U,longitude:V,color:u,opacity:d,size:E,details:w,vegaConfig:a,scales:X}):G==="choropleth"?b.createElement(m$e,{tileUrl:_,name:t,data:n,allFields:N,features:R,featuresUrl:F,geoKey:x,defaultAggregated:y,geoId:l,color:u,opacity:d,text:f,details:w,vegaConfig:a,scaleIncludeUnmatchedChoropleth:Q,showAllGeoshapeInChoropleth:k,scales:X}):null}),mUA=p$e;/*!
 * https://github.com/Starcounter-Jack/JSON-Patch
 * (c) 2017-2022 Joachim Wester
 * MIT licensed
 */var f$e=globalThis&&globalThis.__extends||function(){var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},A(e,t)};return function(e,t){A(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),y$e=Object.prototype.hasOwnProperty;function daA(A,e){return y$e.call(A,e)}function haA(A){if(Array.isArray(A)){for(var e=new Array(A.length),t=0;t<e.length;t++)e[t]=""+t;return e}if(Object.keys)return Object.keys(A);var i=[];for(var n in A)daA(A,n)&&i.push(n);return i}function bI(A){switch(typeof A){case"object":return JSON.parse(JSON.stringify(A));case"undefined":return null;default:return A}}function maA(A){for(var e=0,t=A.length,i;e<t;){if(i=A.charCodeAt(e),i>=48&&i<=57){e++;continue}return!1}return!0}function nb(A){return A.indexOf("/")===-1&&A.indexOf("~")===-1?A:A.replace(/~/g,"~0").replace(/\//g,"~1")}function pUA(A){return A.replace(/~1/g,"/").replace(/~0/g,"~")}function paA(A){if(A===void 0)return!0;if(A){if(Array.isArray(A)){for(var e=0,t=A.length;e<t;e++)if(paA(A[e]))return!0}else if(typeof A=="object"){for(var i=haA(A),n=i.length,o=0;o<n;o++)if(paA(A[i[o]]))return!0}}return!1}function fUA(A,e){var t=[A];for(var i in e){var n=typeof e[i]=="object"?JSON.stringify(e[i],null,2):e[i];typeof n<"u"&&t.push(i+": "+n)}return t.join(`
`)}var yUA=function(A){f$e(e,A);function e(t,i,n,o,g){var a=this.constructor,s=A.call(this,fUA(t,{name:i,index:n,operation:o,tree:g}))||this;return s.name=i,s.index=n,s.operation=o,s.tree=g,Object.setPrototypeOf(s,a.prototype),s.message=fUA(t,{name:i,index:n,operation:o,tree:g}),s}return e}(Error),so=yUA,b$e=bI,cJ={add:function(A,e,t){return A[e]=this.value,{newDocument:t}},remove:function(A,e,t){var i=A[e];return delete A[e],{newDocument:t,removed:i}},replace:function(A,e,t){var i=A[e];return A[e]=this.value,{newDocument:t,removed:i}},move:function(A,e,t){var i=V9(t,this.path);i&&(i=bI(i));var n=ob(t,{op:"remove",path:this.from}).removed;return ob(t,{op:"add",path:this.path,value:n}),{newDocument:t,removed:i}},copy:function(A,e,t){var i=V9(t,this.from);return ob(t,{op:"add",path:this.path,value:bI(i)}),{newDocument:t}},test:function(A,e,t){return{newDocument:t,test:YM(A[e],this.value)}},_get:function(A,e,t){return this.value=A[e],{newDocument:t}}},w$e={add:function(A,e,t){return maA(e)?A.splice(e,0,this.value):A[e]=this.value,{newDocument:t,index:e}},remove:function(A,e,t){var i=A.splice(e,1);return{newDocument:t,removed:i[0]}},replace:function(A,e,t){var i=A[e];return A[e]=this.value,{newDocument:t,removed:i}},move:cJ.move,copy:cJ.copy,test:cJ.test,_get:cJ._get};function V9(A,e){if(e=="")return A;var t={op:"_get",path:e};return ob(A,t),t.value}function ob(A,e,t,i,n,o){if(t===void 0&&(t=!1),i===void 0&&(i=!0),n===void 0&&(n=!0),o===void 0&&(o=0),t&&(typeof t=="function"?t(e,0,A,e.path):z9(e,0)),e.path===""){var g={newDocument:A};if(e.op==="add")return g.newDocument=e.value,g;if(e.op==="replace")return g.newDocument=e.value,g.removed=A,g;if(e.op==="move"||e.op==="copy")return g.newDocument=V9(A,e.from),e.op==="move"&&(g.removed=A),g;if(e.op==="test"){if(g.test=YM(A,e.value),g.test===!1)throw new so("Test operation failed","TEST_OPERATION_FAILED",o,e,A);return g.newDocument=A,g}else{if(e.op==="remove")return g.removed=A,g.newDocument=null,g;if(e.op==="_get")return e.value=A,g;if(t)throw new so("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,e,A);return g}}else{i||(A=bI(A));var a=e.path||"",s=a.split("/"),I=A,r=1,C=s.length,l=void 0,c=void 0,B=void 0;for(typeof t=="function"?B=t:B=z9;;){if(c=s[r],c&&c.indexOf("~")!=-1&&(c=pUA(c)),n&&(c=="__proto__"||c=="prototype"&&r>0&&s[r-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(t&&l===void 0&&(I[c]===void 0?l=s.slice(0,r).join("/"):r==C-1&&(l=e.path),l!==void 0&&B(e,0,A,l)),r++,Array.isArray(I)){if(c==="-")c=I.length;else{if(t&&!maA(c))throw new so("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,A);maA(c)&&(c=~~c)}if(r>=C){if(t&&e.op==="add"&&c>I.length)throw new so("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,A);var g=w$e[e.op].call(e,I,c,A);if(g.test===!1)throw new so("Test operation failed","TEST_OPERATION_FAILED",o,e,A);return g}}else if(r>=C){var g=cJ[e.op].call(e,I,c,A);if(g.test===!1)throw new so("Test operation failed","TEST_OPERATION_FAILED",o,e,A);return g}if(I=I[c],t&&r<C&&(!I||typeof I!="object"))throw new so("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,e,A)}}}function X9(A,e,t,i,n){if(i===void 0&&(i=!0),n===void 0&&(n=!0),t&&!Array.isArray(e))throw new so("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(A=bI(A));for(var o=new Array(e.length),g=0,a=e.length;g<a;g++)o[g]=ob(A,e[g],t,!0,n,g),A=o[g].newDocument;return o.newDocument=A,o}function D$e(A,e,t){var i=ob(A,e);if(i.test===!1)throw new so("Test operation failed","TEST_OPERATION_FAILED",t,e,A);return i.newDocument}function z9(A,e,t,i){if(typeof A!="object"||A===null||Array.isArray(A))throw new so("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,A,t);if(cJ[A.op]){if(typeof A.path!="string")throw new so("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,A,t);if(A.path.indexOf("/")!==0&&A.path.length>0)throw new so('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,A,t);if((A.op==="move"||A.op==="copy")&&typeof A.from!="string")throw new so("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,A,t);if((A.op==="add"||A.op==="replace"||A.op==="test")&&A.value===void 0)throw new so("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,A,t);if((A.op==="add"||A.op==="replace"||A.op==="test")&&paA(A.value))throw new so("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,A,t);if(t){if(A.op=="add"){var n=A.path.split("/").length,o=i.split("/").length;if(n!==o+1&&n!==o)throw new so("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,A,t)}else if(A.op==="replace"||A.op==="remove"||A.op==="_get"){if(A.path!==i)throw new so("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,A,t)}else if(A.op==="move"||A.op==="copy"){var g={op:"_get",path:A.from,value:void 0},a=bUA([g],t);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new so("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,A,t)}}}else throw new so("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,A,t)}function bUA(A,e,t){try{if(!Array.isArray(A))throw new so("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)X9(bI(e),bI(A),t||!0);else{t=t||z9;for(var i=0;i<A.length;i++)t(A[i],i,e,void 0)}}catch(n){if(n instanceof so)return n;throw n}}function YM(A,e){if(A===e)return!0;if(A&&e&&typeof A=="object"&&typeof e=="object"){var t=Array.isArray(A),i=Array.isArray(e),n,o,g;if(t&&i){if(o=A.length,o!=e.length)return!1;for(n=o;n--!==0;)if(!YM(A[n],e[n]))return!1;return!0}if(t!=i)return!1;var a=Object.keys(A);if(o=a.length,o!==Object.keys(e).length)return!1;for(n=o;n--!==0;)if(!e.hasOwnProperty(a[n]))return!1;for(n=o;n--!==0;)if(g=a[n],!YM(A[g],e[g]))return!1;return!0}return A!==A&&e!==e}const G$e=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:so,_areEquals:YM,applyOperation:ob,applyPatch:X9,applyReducer:D$e,deepClone:b$e,getValueByPointer:V9,validate:bUA,validator:z9},Symbol.toStringTag,{value:"Module"}));/*!
 * https://github.com/Starcounter-Jack/JSON-Patch
 * (c) 2017-2021 Joachim Wester
 * MIT license
 */var faA=new WeakMap,k$e=function(){function A(e){this.observers=new Map,this.obj=e}return A}(),J$e=function(){function A(e,t){this.callback=e,this.observer=t}return A}();function N$e(A){return faA.get(A)}function Y$e(A,e){return A.observers.get(e)}function R$e(A,e){A.observers.delete(e.callback)}function x$e(A,e){e.unobserve()}function F$e(A,e){var t=[],i,n=N$e(A);if(!n)n=new k$e(A),faA.set(A,n);else{var o=Y$e(n,e);i=o&&o.observer}if(i)return i;if(i={},n.value=bI(A),e){i.callback=e,i.next=null;var g=function(){yaA(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(g)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=t,i.object=A,i.unobserve=function(){yaA(i),clearTimeout(i.next),R$e(n,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},n.observers.set(e,new J$e(e,i)),i}function yaA(A,e){e===void 0&&(e=!1);var t=faA.get(A.object);baA(t.value,A.object,A.patches,"",e),A.patches.length&&X9(t.value,A.patches);var i=A.patches;return i.length>0&&(A.patches=[],A.callback&&A.callback(i)),i}function baA(A,e,t,i,n){if(e!==A){typeof e.toJSON=="function"&&(e=e.toJSON());for(var o=haA(e),g=haA(A),a=!1,s=g.length-1;s>=0;s--){var I=g[s],r=A[I];if(daA(e,I)&&!(e[I]===void 0&&r!==void 0&&Array.isArray(e)===!1)){var C=e[I];typeof r=="object"&&r!=null&&typeof C=="object"&&C!=null&&Array.isArray(r)===Array.isArray(C)?baA(r,C,t,i+"/"+nb(I),n):r!==C&&(n&&t.push({op:"test",path:i+"/"+nb(I),value:bI(r)}),t.push({op:"replace",path:i+"/"+nb(I),value:bI(C)}))}else Array.isArray(A)===Array.isArray(e)?(n&&t.push({op:"test",path:i+"/"+nb(I),value:bI(r)}),t.push({op:"remove",path:i+"/"+nb(I)}),a=!0):(n&&t.push({op:"test",path:i,value:A}),t.push({op:"replace",path:i,value:e}))}if(!(!a&&o.length==g.length))for(var s=0;s<o.length;s++){var I=o[s];!daA(A,I)&&e[I]!==void 0&&t.push({op:"add",path:i+"/"+nb(I),value:bI(e[I])})}}}function M$e(A,e,t){t===void 0&&(t=!1);var i=[];return baA(A,e,i,"",t),i}Object.assign({},G$e,Object.freeze(Object.defineProperty({__proto__:null,compare:M$e,generate:yaA,observe:F$e,unobserve:x$e},Symbol.toStringTag,{value:"Module"})),{JsonPatchError:yUA,deepClone:bI,escapePathComponent:nb,unescapePathComponent:pUA});var v$e=/("(?:[^\\"]|\\.)*")|[:,]/g,L$e=function(A,e){var t,i,n;return e=e||{},t=JSON.stringify([1],void 0,e.indent===void 0?2:e.indent).slice(2,-3),i=t===""?1/0:e.maxLength===void 0?80:e.maxLength,n=e.replacer,function o(g,a,s){var I,r,C,l,c,B,E,u,d,f,w,y;if(g&&typeof g.toJSON=="function"&&(g=g.toJSON()),w=JSON.stringify(g,n),w===void 0)return w;if(E=i-a.length-s,w.length<=E&&(d=w.replace(v$e,function(G,R){return R||G+" "}),d.length<=E))return d;if(n!=null&&(g=JSON.parse(w),n=void 0),typeof g=="object"&&g!==null){if(u=a+t,C=[],r=0,Array.isArray(g))for(f="[",I="]",E=g.length;r<E;r++)C.push(o(g[r],u,r===E-1?0:1)||"null");else for(f="{",I="}",B=Object.keys(g),E=B.length;r<E;r++)l=B[r],c=JSON.stringify(l)+": ",y=o(g[l],u,c.length+(r===E-1?0:1)),y!==void 0&&C.push(c+y);if(C.length>0)return[f,t+C.join(`,
`+u),I].join(`
`+a)}return w}(A,"",0)};const waA=xC(L$e);function gr(A,e,t){return A.fields=e||[],A.fname=t,A}function ro(A){return A==null?null:A.fname}function ka(A){return A==null?null:A.fields}function wUA(A){return A.length===1?S$e(A[0]):H$e(A)}const S$e=A=>function(e){return e[A]},H$e=A=>{const e=A.length;return function(t){for(let i=0;i<e;++i)t=t[A[i]];return t}};function YA(A){throw Error(A)}function hQ(A){const e=[],t=A.length;let i=null,n=0,o="",g,a,s;A=A+"";function I(){e.push(o+A.substring(g,a)),o="",g=a+1}for(g=a=0;a<t;++a)if(s=A[a],s==="\\")o+=A.substring(g,a++),g=a;else if(s===i)I(),i=null,n=-1;else{if(i)continue;g===n&&s==='"'||g===n&&s==="'"?(g=a+1,i=s):s==="."&&!n?a>g?I():g=a+1:s==="["?(a>g&&I(),n=g=a+1):s==="]"&&(n||YA("Access path missing open bracket: "+A),n>0&&I(),n=0,g=a+1)}return n&&YA("Access path missing closing bracket: "+A),i&&YA("Access path missing closing quote: "+A),a>g&&(a++,I()),e}function Al(A,e,t){const i=hQ(A);return A=i.length===1?i[0]:A,gr((t&&t.get||wUA)(i),[A],e||A)}const RM=Al("id"),Ja=gr(A=>A,[],"identity"),gp=gr(()=>0,[],"zero"),BJ=gr(()=>1,[],"one"),el=gr(()=>!0,[],"true"),ap=gr(()=>!1,[],"false");function Z$e(A,e,t){const i=[e].concat([].slice.call(t));console[A].apply(console,i)}const DUA=0,DaA=1,GaA=2,GUA=3,kUA=4;function kaA(A,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Z$e,i=A||DUA;return{level(n){return arguments.length?(i=+n,this):i},error(){return i>=DaA&&t(e||"error","ERROR",arguments),this},warn(){return i>=GaA&&t(e||"warn","WARN",arguments),this},info(){return i>=GUA&&t(e||"log","INFO",arguments),this},debug(){return i>=kUA&&t(e||"log","DEBUG",arguments),this}}}var RA=Array.isArray;function oe(A){return A===Object(A)}const JUA=A=>A!=="__proto__";function QJ(){for(var A=arguments.length,e=new Array(A),t=0;t<A;t++)e[t]=arguments[t];return e.reduce((i,n)=>{for(const o in n)if(o==="signals")i.signals=W$e(i.signals,n.signals);else{const g=o==="legend"?{layout:1}:o==="style"?!0:null;EJ(i,o,n[o],g)}return i},{})}function EJ(A,e,t,i){if(!JUA(e))return;let n,o;if(oe(t)&&!RA(t)){o=oe(A[e])?A[e]:A[e]={};for(n in t)i&&(i===!0||i[n])?EJ(o,n,t[n]):JUA(n)&&(o[n]=t[n])}else A[e]=t}function W$e(A,e){if(A==null)return e;const t={},i=[];function n(o){t[o.name]||(t[o.name]=1,i.push(o))}return e.forEach(n),A.forEach(n),i}function Ut(A){return A[A.length-1]}function Na(A){return A==null||A===""?null:+A}const NUA=A=>e=>A*Math.exp(e),YUA=A=>e=>Math.log(A*e),RUA=A=>e=>Math.sign(e)*Math.log1p(Math.abs(e/A)),xUA=A=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*A,T9=A=>e=>e<0?-Math.pow(-e,A):Math.pow(e,A);function _9(A,e,t,i){const n=t(A[0]),o=t(Ut(A)),g=(o-n)*e;return[i(n-g),i(o-g)]}function FUA(A,e){return _9(A,e,Na,Ja)}function MUA(A,e){var t=Math.sign(A[0]);return _9(A,e,YUA(t),NUA(t))}function vUA(A,e,t){return _9(A,e,T9(t),T9(1/t))}function LUA(A,e,t){return _9(A,e,RUA(t),xUA(t))}function O9(A,e,t,i,n){const o=i(A[0]),g=i(Ut(A)),a=e!=null?i(e):(o+g)/2;return[n(a+(o-a)*t),n(a+(g-a)*t)]}function JaA(A,e,t){return O9(A,e,t,Na,Ja)}function NaA(A,e,t){const i=Math.sign(A[0]);return O9(A,e,t,YUA(i),NUA(i))}function q9(A,e,t,i){return O9(A,e,t,T9(i),T9(1/i))}function YaA(A,e,t,i){return O9(A,e,t,RUA(i),xUA(i))}function SUA(A){return 1+~~(new Date(A).getMonth()/3)}function HUA(A){return 1+~~(new Date(A).getUTCMonth()/3)}function te(A){return A!=null?RA(A)?A:[A]:[]}function ZUA(A,e,t){let i=A[0],n=A[1],o;return n<i&&(o=n,n=i,i=o),o=n-i,o>=t-e?[e,t]:[i=Math.min(Math.max(i,e),t-o),i+o]}function Ct(A){return typeof A=="function"}const K$e="descending";function RaA(A,e,t){t=t||{},e=te(e)||[];const i=[],n=[],o={},g=t.comparator||U$e;return te(A).forEach((a,s)=>{a!=null&&(i.push(e[s]===K$e?-1:1),n.push(a=Ct(a)?a:Al(a,null,t)),(ka(a)||[]).forEach(I=>o[I]=1))}),n.length===0?null:gr(g(n,i),Object.keys(o))}const j9=(A,e)=>(A<e||A==null)&&e!=null?-1:(A>e||e==null)&&A!=null?1:(e=e instanceof Date?+e:e,(A=A instanceof Date?+A:A)!==A&&e===e?-1:e!==e&&A===A?1:0),U$e=(A,e)=>A.length===1?V$e(A[0],e[0]):X$e(A,e,A.length),V$e=(A,e)=>function(t,i){return j9(A(t),A(i))*e},X$e=(A,e,t)=>(e.push(0),function(i,n){let o,g=0,a=-1;for(;g===0&&++a<t;)o=A[a],g=j9(o(i),o(n));return g*e[a]});function Ya(A){return Ct(A)?A:()=>A}function xaA(A,e){let t;return i=>{t&&clearTimeout(t),t=setTimeout(()=>(e(i),t=null),A)}}function lt(A){for(let e,t,i=1,n=arguments.length;i<n;++i){e=arguments[i];for(t in e)A[t]=e[t]}return A}function mQ(A,e){let t=0,i,n,o,g;if(A&&(i=A.length))if(e==null){for(n=A[t];t<i&&(n==null||n!==n);n=A[++t]);for(o=g=n;t<i;++t)n=A[t],n!=null&&(n<o&&(o=n),n>g&&(g=n))}else{for(n=e(A[t]);t<i&&(n==null||n!==n);n=e(A[++t]));for(o=g=n;t<i;++t)n=e(A[t]),n!=null&&(n<o&&(o=n),n>g&&(g=n))}return[o,g]}function WUA(A,e){const t=A.length;let i=-1,n,o,g,a,s;if(e==null){for(;++i<t;)if(o=A[i],o!=null&&o>=o){n=g=o;break}if(i===t)return[-1,-1];for(a=s=i;++i<t;)o=A[i],o!=null&&(n>o&&(n=o,a=i),g<o&&(g=o,s=i))}else{for(;++i<t;)if(o=e(A[i],i,A),o!=null&&o>=o){n=g=o;break}if(i===t)return[-1,-1];for(a=s=i;++i<t;)o=e(A[i],i,A),o!=null&&(n>o&&(n=o,a=i),g<o&&(g=o,s=i))}return[a,s]}const z$e=Object.prototype.hasOwnProperty;function Je(A,e){return z$e.call(A,e)}const P9={};function uJ(A){let e={},t;function i(o){return Je(e,o)&&e[o]!==P9}const n={size:0,empty:0,object:e,has:i,get(o){return i(o)?e[o]:void 0},set(o,g){return i(o)||(++n.size,e[o]===P9&&--n.empty),e[o]=g,this},delete(o){return i(o)&&(--n.size,++n.empty,e[o]=P9),this},clear(){n.size=n.empty=0,n.object=e={}},test(o){return arguments.length?(t=o,n):t},clean(){const o={};let g=0;for(const a in e){const s=e[a];s!==P9&&(!t||!t(s))&&(o[a]=s,++g)}n.size=g,n.empty=0,n.object=e=o}};return A&&Object.keys(A).forEach(o=>{n.set(o,A[o])}),n}function KUA(A,e,t,i,n,o){if(!t&&t!==0)return o;const g=+t;let a=A[0],s=Ut(A),I;s<a&&(I=a,a=s,s=I),I=Math.abs(e-a);const r=Math.abs(s-e);return I<r&&I<=g?i:r<=g?n:o}function _A(A,e,t){const i=A.prototype=Object.create(e.prototype);return Object.defineProperty(i,"constructor",{value:A,writable:!0,enumerable:!0,configurable:!0}),lt(i,t)}function dJ(A,e,t,i){let n=e[0],o=e[e.length-1],g;return n>o&&(g=n,n=o,o=g),t=t===void 0||t,i=i===void 0||i,(t?n<=A:n<A)&&(i?A<=o:A<o)}function sp(A){return typeof A=="boolean"}function rp(A){return Object.prototype.toString.call(A)==="[object Date]"}function UUA(A){return A&&Ct(A[Symbol.iterator])}function ti(A){return typeof A=="number"}function VUA(A){return Object.prototype.toString.call(A)==="[object RegExp]"}function ie(A){return typeof A=="string"}function FaA(A,e,t){A&&(A=e?te(A).map(a=>a.replace(/\\(.)/g,"$1")):te(A));const i=A&&A.length,n=t&&t.get||wUA,o=a=>n(e?[a]:hQ(a));let g;if(!i)g=function(){return""};else if(i===1){const a=o(A[0]);g=function(s){return""+a(s)}}else{const a=A.map(o);g=function(s){let I=""+a[0](s),r=0;for(;++r<i;)I+="|"+a[r](s);return I}}return gr(g,A,"key")}function XUA(A,e){const t=A[0],i=Ut(A),n=+e;return n?n===1?i:t+n*(i-t):t}const T$e=1e4;function zUA(A){A=+A||T$e;let e,t,i;const n=()=>{e={},t={},i=0},o=(g,a)=>(++i>A&&(t=e,e={},i=1),e[g]=a);return n(),{clear:n,has:g=>Je(e,g)||Je(t,g),get:g=>Je(e,g)?e[g]:Je(t,g)?o(g,t[g]):void 0,set:(g,a)=>Je(e,g)?e[g]=a:o(g,a)}}function TUA(A,e,t,i){const n=e.length,o=t.length;if(!o)return e;if(!n)return t;const g=i||new e.constructor(n+o);let a=0,s=0,I=0;for(;a<n&&s<o;++I)g[I]=A(e[a],t[s])>0?t[s++]:e[a++];for(;a<n;++a,++I)g[I]=e[a];for(;s<o;++s,++I)g[I]=t[s];return g}function xM(A,e){let t="";for(;--e>=0;)t+=A;return t}function _UA(A,e,t,i){const n=t||" ",o=A+"",g=e-o.length;return g<=0?o:i==="left"?xM(n,g)+o:i==="center"?xM(n,~~(g/2))+o+xM(n,Math.ceil(g/2)):o+xM(n,g)}function FM(A){return A&&Ut(A)-A[0]||0}function OA(A){return RA(A)?"["+A.map(OA)+"]":oe(A)||ie(A)?JSON.stringify(A).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):A}function MaA(A){return A==null||A===""?null:!A||A==="false"||A==="0"?!1:!!A}const _$e=A=>ti(A)||rp(A)?A:Date.parse(A);function vaA(A,e){return e=e||_$e,A==null||A===""?null:e(A)}function LaA(A){return A==null||A===""?null:A+""}function fc(A){const e={},t=A.length;for(let i=0;i<t;++i)e[A[i]]=!0;return e}function OUA(A,e,t,i){const n=i??"…",o=A+"",g=o.length,a=Math.max(0,e-n.length);return g<=e?o:t==="left"?n+o.slice(g-a):t==="center"?o.slice(0,Math.ceil(a/2))+n+o.slice(g-~~(a/2)):o.slice(0,a)+n}function Ip(A,e,t){if(A)if(e){const i=A.length;for(let n=0;n<i;++n){const o=e(A[n]);o&&t(o,n,A)}}else A.forEach(t)}var qUA={},SaA={},HaA=34,MM=10,ZaA=13;function jUA(A){return new Function("d","return {"+A.map(function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'}).join(",")+"}")}function O$e(A,e){var t=jUA(A);return function(i,n){return e(t(i),n,A)}}function PUA(A){var e=Object.create(null),t=[];return A.forEach(function(i){for(var n in i)n in e||t.push(e[n]=n)}),t}function ar(A,e){var t=A+"",i=t.length;return i<e?new Array(e-i+1).join(0)+t:t}function q$e(A){return A<0?"-"+ar(-A,6):A>9999?"+"+ar(A,6):ar(A,4)}function j$e(A){var e=A.getUTCHours(),t=A.getUTCMinutes(),i=A.getUTCSeconds(),n=A.getUTCMilliseconds();return isNaN(A)?"Invalid Date":q$e(A.getUTCFullYear())+"-"+ar(A.getUTCMonth()+1,2)+"-"+ar(A.getUTCDate(),2)+(n?"T"+ar(e,2)+":"+ar(t,2)+":"+ar(i,2)+"."+ar(n,3)+"Z":i?"T"+ar(e,2)+":"+ar(t,2)+":"+ar(i,2)+"Z":t||e?"T"+ar(e,2)+":"+ar(t,2)+"Z":"")}function P$e(A){var e=new RegExp('["'+A+`
\r]`),t=A.charCodeAt(0);function i(C,l){var c,B,E=n(C,function(u,d){if(c)return c(u,d-1);B=u,c=l?O$e(u,l):jUA(u)});return E.columns=B||[],E}function n(C,l){var c=[],B=C.length,E=0,u=0,d,f=B<=0,w=!1;C.charCodeAt(B-1)===MM&&--B,C.charCodeAt(B-1)===ZaA&&--B;function y(){if(f)return SaA;if(w)return w=!1,qUA;var R,x=E,F;if(C.charCodeAt(x)===HaA){for(;E++<B&&C.charCodeAt(E)!==HaA||C.charCodeAt(++E)===HaA;);return(R=E)>=B?f=!0:(F=C.charCodeAt(E++))===MM?w=!0:F===ZaA&&(w=!0,C.charCodeAt(E)===MM&&++E),C.slice(x+1,R-1).replace(/""/g,'"')}for(;E<B;){if((F=C.charCodeAt(R=E++))===MM)w=!0;else if(F===ZaA)w=!0,C.charCodeAt(E)===MM&&++E;else if(F!==t)continue;return C.slice(x,R)}return f=!0,C.slice(x,B)}for(;(d=y())!==SaA;){for(var G=[];d!==qUA&&d!==SaA;)G.push(d),d=y();l&&(G=l(G,u++))==null||c.push(G)}return c}function o(C,l){return C.map(function(c){return l.map(function(B){return r(c[B])}).join(A)})}function g(C,l){return l==null&&(l=PUA(C)),[l.map(r).join(A)].concat(o(C,l)).join(`
`)}function a(C,l){return l==null&&(l=PUA(C)),o(C,l).join(`
`)}function s(C){return C.map(I).join(`
`)}function I(C){return C.map(r).join(A)}function r(C){return C==null?"":C instanceof Date?j$e(C):e.test(C+="")?'"'+C.replace(/"/g,'""')+'"':C}return{parse:i,parseRows:n,format:g,formatBody:a,formatRows:s,formatRow:I,formatValue:r}}const Aa="year",sr="quarter",Ra="month",jo="week",rr="date",xa="day",pQ="dayofyear",wI="hours",DI="minutes",tl="seconds",yc="milliseconds",WaA=[Aa,sr,Ra,jo,rr,xa,pQ,wI,DI,tl,yc],KaA=WaA.reduce((A,e,t)=>(A[e]=1+t,A),{});function UaA(A){const e=te(A).slice(),t={};return e.length||YA("Missing time unit."),e.forEach(i=>{Je(KaA,i)?t[i]=1:YA(`Invalid time unit: ${i}.`)}),(t[jo]||t[xa]?1:0)+(t[sr]||t[Ra]||t[rr]?1:0)+(t[pQ]?1:0)>1&&YA(`Incompatible time units: ${A}`),e.sort((i,n)=>KaA[i]-KaA[n]),e}const $$e={[Aa]:"%Y ",[sr]:"Q%q ",[Ra]:"%b ",[rr]:"%d ",[jo]:"W%U ",[xa]:"%a ",[pQ]:"%j ",[wI]:"%H:00",[DI]:"00:%M",[tl]:":%S",[yc]:".%L",[`${Aa}-${Ra}`]:"%Y-%m ",[`${Aa}-${Ra}-${rr}`]:"%Y-%m-%d ",[`${wI}-${DI}`]:"%H:%M"};function $UA(A,e){const t=lt({},$$e,e),i=UaA(A),n=i.length;let o="",g=0,a,s;for(g=0;g<n;)for(a=i.length;a>g;--a)if(s=i.slice(g,a).join("-"),t[s]!=null){o+=t[s],g=a;break}return o.trim()}const gb=new Date;function VaA(A){return gb.setFullYear(A),gb.setMonth(0),gb.setDate(1),gb.setHours(0,0,0,0),gb}function AVA(A){return tVA(new Date(A))}function eVA(A){return XaA(new Date(A))}function tVA(A){return pc.count(VaA(A.getFullYear())-1,A)}function XaA(A){return ip.count(VaA(A.getFullYear())-1,A)}function zaA(A){return VaA(A).getDay()}function AAt(A,e,t,i,n,o,g){if(0<=A&&A<100){const a=new Date(-1,e,t,i,n,o,g);return a.setFullYear(A),a}return new Date(A,e,t,i,n,o,g)}function iVA(A){return oVA(new Date(A))}function nVA(A){return TaA(new Date(A))}function oVA(A){const e=Date.UTC(A.getUTCFullYear(),0,1);return tp.count(e-1,A)}function TaA(A){const e=Date.UTC(A.getUTCFullYear(),0,1);return np.count(e-1,A)}function _aA(A){return gb.setTime(Date.UTC(A,0,1)),gb.getUTCDay()}function eAt(A,e,t,i,n,o,g){if(0<=A&&A<100){const a=new Date(Date.UTC(-1,e,t,i,n,o,g));return a.setUTCFullYear(t.y),a}return new Date(Date.UTC(A,e,t,i,n,o,g))}function gVA(A,e,t,i,n){const o=e||1,g=Ut(A),a=(d,f,w)=>(w=w||d,tAt(t[w],i[w],d===g&&o,f)),s=new Date,I=fc(A),r=I[Aa]?a(Aa):Ya(2012),C=I[Ra]?a(Ra):I[sr]?a(sr):gp,l=I[jo]&&I[xa]?a(xa,1,jo+xa):I[jo]?a(jo,1):I[xa]?a(xa,1):I[rr]?a(rr,1):I[pQ]?a(pQ,1):BJ,c=I[wI]?a(wI):gp,B=I[DI]?a(DI):gp,E=I[tl]?a(tl):gp,u=I[yc]?a(yc):gp;return function(d){s.setTime(+d);const f=r(s);return n(f,C(s),l(s,f),c(s),B(s),E(s),u(s))}}function tAt(A,e,t,i){const n=t<=1?A:i?(o,g)=>i+t*Math.floor((A(o,g)-i)/t):(o,g)=>t*Math.floor(A(o,g)/t);return e?(o,g)=>e(n(o,g),g):n}function hJ(A,e,t){return e+A*7-(t+6)%7}const iAt={[Aa]:A=>A.getFullYear(),[sr]:A=>Math.floor(A.getMonth()/3),[Ra]:A=>A.getMonth(),[rr]:A=>A.getDate(),[wI]:A=>A.getHours(),[DI]:A=>A.getMinutes(),[tl]:A=>A.getSeconds(),[yc]:A=>A.getMilliseconds(),[pQ]:A=>tVA(A),[jo]:A=>XaA(A),[jo+xa]:(A,e)=>hJ(XaA(A),A.getDay(),zaA(e)),[xa]:(A,e)=>hJ(1,A.getDay(),zaA(e))},nAt={[sr]:A=>3*A,[jo]:(A,e)=>hJ(A,0,zaA(e))};function aVA(A,e){return gVA(A,e||1,iAt,nAt,AAt)}const oAt={[Aa]:A=>A.getUTCFullYear(),[sr]:A=>Math.floor(A.getUTCMonth()/3),[Ra]:A=>A.getUTCMonth(),[rr]:A=>A.getUTCDate(),[wI]:A=>A.getUTCHours(),[DI]:A=>A.getUTCMinutes(),[tl]:A=>A.getUTCSeconds(),[yc]:A=>A.getUTCMilliseconds(),[pQ]:A=>oVA(A),[jo]:A=>TaA(A),[xa]:(A,e)=>hJ(1,A.getUTCDay(),_aA(e)),[jo+xa]:(A,e)=>hJ(TaA(A),A.getUTCDay(),_aA(e))},gAt={[sr]:A=>3*A,[jo]:(A,e)=>hJ(A,0,_aA(e))};function sVA(A,e){return gVA(A,e||1,oAt,gAt,eAt)}const aAt={[Aa]:PC,[sr]:tb.every(3),[Ra]:tb,[jo]:ip,[rr]:pc,[xa]:pc,[pQ]:pc,[wI]:rJ,[DI]:aJ,[tl]:yI,[yc]:gJ},sAt={[Aa]:$C,[sr]:ib.every(3),[Ra]:ib,[jo]:np,[rr]:tp,[xa]:tp,[pQ]:tp,[wI]:IJ,[DI]:sJ,[tl]:yI,[yc]:gJ};function mJ(A){return aAt[A]}function pJ(A){return sAt[A]}function rVA(A,e,t){return A?A.offset(e,t):void 0}function IVA(A,e,t){return rVA(mJ(A),e,t)}function CVA(A,e,t){return rVA(pJ(A),e,t)}function lVA(A,e,t,i){return A?A.range(e,t,i):void 0}function cVA(A,e,t,i){return lVA(mJ(A),e,t,i)}function BVA(A,e,t,i){return lVA(pJ(A),e,t,i)}const vM=1e3,LM=vM*60,SM=LM*60,$9=SM*24,rAt=$9*7,QVA=$9*30,OaA=$9*365,EVA=[Aa,Ra,rr,wI,DI,tl,yc],HM=EVA.slice(0,-1),ZM=HM.slice(0,-1),WM=ZM.slice(0,-1),IAt=WM.slice(0,-1),CAt=[Aa,jo],uVA=[Aa,Ra],dVA=[Aa],KM=[[HM,1,vM],[HM,5,5*vM],[HM,15,15*vM],[HM,30,30*vM],[ZM,1,LM],[ZM,5,5*LM],[ZM,15,15*LM],[ZM,30,30*LM],[WM,1,SM],[WM,3,3*SM],[WM,6,6*SM],[WM,12,12*SM],[IAt,1,$9],[CAt,1,rAt],[uVA,1,QVA],[uVA,3,3*QVA],[dVA,1,OaA]];function hVA(A){const e=A.extent,t=A.maxbins||40,i=Math.abs(FM(e))/t;let n=Vy(a=>a[2]).right(KM,i),o,g;return n===KM.length?(o=dVA,g=jm(e[0]/OaA,e[1]/OaA,t)):n?(n=KM[i/KM[n-1][2]<KM[n][2]/i?n-1:n],o=n[0],g=n[1]):(o=EVA,g=Math.max(jm(e[0],e[1],t),1)),{units:o,step:g}}function UM(A){const e={};return t=>e[t]||(e[t]=A(t))}function lAt(A,e){return t=>{const i=A(t),n=i.indexOf(e);if(n<0)return i;let o=cAt(i,n);const g=o<i.length?i.slice(o):"";for(;--o>n;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+g}}function cAt(A,e){let t=A.lastIndexOf("e"),i;if(t>0)return t;for(t=A.length;--t>e;)if(i=A.charCodeAt(t),i>=48&&i<=57)return t+1}function mVA(A){const e=UM(A.format),t=A.formatPrefix;return{format:e,formatPrefix:t,formatFloat(i){const n=Ky(i||",");if(n.precision==null){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1;break}return lAt(e(n),e(".1f")(1)[1])}else return e(n)},formatSpan(i,n,o,g){g=Ky(g??",f");const a=jm(i,n,o),s=Math.max(Math.abs(i),Math.abs(n));let I;if(g.precision==null)switch(g.type){case"s":return isNaN(I=t3A(a,s))||(g.precision=I),t(g,s);case"":case"e":case"g":case"p":case"r":{isNaN(I=i3A(a,s))||(g.precision=I-(g.type==="e"));break}case"f":case"%":{isNaN(I=e3A(a))||(g.precision=I-(g.type==="%")*2);break}}return e(g)}}}let qaA;pVA();function pVA(){return qaA=mVA({format:Ec,formatPrefix:QgA})}function fVA(A){return mVA(A3A(A))}function A5(A){return arguments.length?qaA=fVA(A):qaA}function yVA(A,e,t){t=t||{},oe(t)||YA(`Invalid time multi-format specifier: ${t}`);const i=e(tl),n=e(DI),o=e(wI),g=e(rr),a=e(jo),s=e(Ra),I=e(sr),r=e(Aa),C=A(t[yc]||".%L"),l=A(t[tl]||":%S"),c=A(t[DI]||"%I:%M"),B=A(t[wI]||"%I %p"),E=A(t[rr]||t[xa]||"%a %d"),u=A(t[jo]||"%b %d"),d=A(t[Ra]||"%B"),f=A(t[sr]||"%B"),w=A(t[Aa]||"%Y");return y=>(i(y)<y?C:n(y)<y?l:o(y)<y?c:g(y)<y?B:s(y)<y?a(y)<y?E:u:r(y)<y?I(y)<y?d:f:w)(y)}function bVA(A){const e=UM(A.format),t=UM(A.utcFormat);return{timeFormat:i=>ie(i)?e(i):yVA(e,mJ,i),utcFormat:i=>ie(i)?t(i):yVA(t,pJ,i),timeParse:UM(A.parse),utcParse:UM(A.utcParse)}}let jaA;wVA();function wVA(){return jaA=bVA({format:NM,parse:eUA,utcFormat:lJ,utcParse:tUA})}function DVA(A){return bVA(ZKA(A))}function VM(A){return arguments.length?jaA=DVA(A):jaA}const PaA=(A,e)=>lt({},A,e);function GVA(A,e){const t=A?fVA(A):A5(),i=e?DVA(e):VM();return PaA(t,i)}function $aA(A,e){const t=arguments.length;return t&&t!==2&&YA("defaultLocale expects either zero or two arguments."),t?PaA(A5(A),VM(e)):PaA(A5(),VM())}function BAt(){return pVA(),wVA(),$aA()}const QAt=/^(data:|([A-Za-z]+:)?\/\/)/,EAt=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,uAt=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,kVA="file://";function dAt(A,e){return t=>({options:t||{},sanitize:mAt,load:hAt,fileAccess:!!e,file:pAt(e),http:yAt(A)})}async function hAt(A,e){const t=await this.sanitize(A,e),i=t.href;return t.localFile?this.file(i):this.http(i,e)}async function mAt(A,e){e=lt({},this.options,e);const t=this.fileAccess,i={href:null};let n,o,g;const a=EAt.test(A.replace(uAt,""));(A==null||typeof A!="string"||!a)&&YA("Sanitize failure, invalid URI: "+OA(A));const s=QAt.test(A);return(g=e.baseURL)&&!s&&(!A.startsWith("/")&&!g.endsWith("/")&&(A="/"+A),A=g+A),o=(n=A.startsWith(kVA))||e.mode==="file"||e.mode!=="http"&&!s&&t,n?A=A.slice(kVA.length):A.startsWith("//")&&(e.defaultProtocol==="file"?(A=A.slice(2),o=!0):A=(e.defaultProtocol||"http")+":"+A),Object.defineProperty(i,"localFile",{value:!!o}),i.href=A,e.target&&(i.target=e.target+""),e.rel&&(i.rel=e.rel+""),e.context==="image"&&e.crossOrigin&&(i.crossOrigin=e.crossOrigin+""),i}function pAt(A){return A?e=>new Promise((t,i)=>{A.readFile(e,(n,o)=>{n?i(n):t(o)})}):fAt}async function fAt(){YA("No file system access.")}function yAt(A){return A?async function(e,t){const i=lt({},this.options.http,t),n=t&&t.response,o=await A(e,i);return o.ok?Ct(o[n])?o[n]():o.text():YA(o.status+""+o.statusText)}:bAt}async function bAt(){YA("No HTTP fetch method available.")}const wAt=A=>A!=null&&A===A,DAt=A=>A==="true"||A==="false"||A===!0||A===!1,GAt=A=>!Number.isNaN(Date.parse(A)),JVA=A=>!Number.isNaN(+A)&&!(A instanceof Date),kAt=A=>JVA(A)&&Number.isInteger(+A),AsA={boolean:MaA,integer:Na,number:Na,date:vaA,string:LaA,unknown:Ja},e5=[DAt,kAt,JVA,GAt],JAt=["boolean","integer","number","date"];function NVA(A,e){if(!A||!A.length)return"unknown";const t=A.length,i=e5.length,n=e5.map((o,g)=>g+1);for(let o=0,g=0,a,s;o<t;++o)for(s=e?A[o][e]:A[o],a=0;a<i;++a)if(n[a]&&wAt(s)&&!e5[a](s)&&(n[a]=0,++g,g===e5.length))return"string";return JAt[n.reduce((o,g)=>o===0?g:o,0)-1]}function YVA(A,e){return e.reduce((t,i)=>(t[i]=NVA(A,i),t),{})}function RVA(A){const e=function(t,i){const n={delimiter:A};return esA(t,i?lt(i,n):n)};return e.responseType="text",e}function esA(A,e){return e.header&&(A=e.header.map(OA).join(e.delimiter)+`
`+A),P$e(e.delimiter).parse(A+"")}esA.responseType="text";function NAt(A){return typeof Buffer=="function"&&Ct(Buffer.isBuffer)?Buffer.isBuffer(A):!1}function tsA(A,e){const t=e&&e.property?Al(e.property):Ja;return oe(A)&&!NAt(A)?YAt(t(A),e):t(JSON.parse(A))}tsA.responseType="json";function YAt(A,e){return!RA(A)&&UUA(A)&&(A=[...A]),e&&e.copy?JSON.parse(JSON.stringify(A)):A}const RAt={interior:(A,e)=>A!==e,exterior:(A,e)=>A===e};function xVA(A,e){let t,i,n,o;return A=tsA(A,e),e&&e.feature?(t=zV,n=e.feature):e&&e.mesh?(t=mKe,n=e.mesh,o=RAt[e.filter]):YA("Missing TopoJSON feature or mesh parameter."),i=(i=A.objects[n])?t(A,i,o):YA("Invalid TopoJSON object: "+n),i&&i.features||[i]}xVA.responseType="json";const t5={dsv:esA,csv:RVA(","),tsv:RVA("	"),json:tsA,topojson:xVA};function isA(A,e){return arguments.length>1?(t5[A]=e,this):Je(t5,A)?t5[A]:null}function FVA(A){const e=isA(A);return e&&e.responseType||"text"}function MVA(A,e,t,i){e=e||{};const n=isA(e.type||"json");return n||YA("Unknown data format type: "+e.type),A=n(A,e),e.parse&&xAt(A,e.parse,t,i),Je(A,"columns")&&delete A.columns,A}function xAt(A,e,t,i){if(!A.length)return;const n=VM();t=t||n.timeParse,i=i||n.utcParse;let o=A.columns||Object.keys(A[0]),g,a,s,I,r,C;e==="auto"&&(e=YVA(A,o)),o=Object.keys(e);const l=o.map(c=>{const B=e[c];let E,u;if(B&&(B.startsWith("date:")||B.startsWith("utc:")))return E=B.split(/:(.+)?/,2),u=E[1],(u[0]==="'"&&u[u.length-1]==="'"||u[0]==='"'&&u[u.length-1]==='"')&&(u=u.slice(1,-1)),(E[0]==="utc"?i:t)(u);if(!AsA[B])throw Error("Illegal format pattern: "+c+":"+B);return AsA[B]});for(s=0,r=A.length,C=o.length;s<r;++s)for(g=A[s],I=0;I<C;++I)a=o[I],g[a]=l[I](g[a])}const i5=dAt(typeof fetch<"u"&&fetch,null);function n5(A){const e=A||Ja,t=[],i={};return t.add=n=>{const o=e(n);return i[o]||(i[o]=1,t.push(n)),t},t.remove=n=>{const o=e(n);if(i[o]){i[o]=0;const g=t.indexOf(n);g>=0&&t.splice(g,1)}return t},t}async function o5(A,e){try{await e(A)}catch(t){A.error(t)}}const vVA=Symbol("vega_id");let FAt=1;function g5(A){return!!(A&&Ne(A))}function Ne(A){return A[vVA]}function LVA(A,e){return A[vVA]=e,A}function Ei(A){const e=A===Object(A)?A:{data:A};return Ne(e)?e:LVA(e,FAt++)}function nsA(A){return a5(A,Ei({}))}function a5(A,e){for(const t in A)e[t]=A[t];return e}function SVA(A,e){return LVA(e,Ne(A))}function ab(A,e){return A?e?(t,i)=>A(t,i)||Ne(e(t))-Ne(e(i)):(t,i)=>A(t,i)||Ne(t)-Ne(i):null}function HVA(A){return A&&A.constructor===sb}function sb(){const A=[],e=[],t=[],i=[],n=[];let o=null,g=!1;return{constructor:sb,insert(a){const s=te(a),I=s.length;for(let r=0;r<I;++r)A.push(s[r]);return this},remove(a){const s=Ct(a)?i:e,I=te(a),r=I.length;for(let C=0;C<r;++C)s.push(I[C]);return this},modify(a,s,I){const r={field:s,value:Ya(I)};return Ct(a)?(r.filter=a,n.push(r)):(r.tuple=a,t.push(r)),this},encode(a,s){return Ct(a)?n.push({filter:a,field:s}):t.push({tuple:a,field:s}),this},clean(a){return o=a,this},reflow(){return g=!0,this},pulse(a,s){const I={},r={};let C,l,c,B,E,u;for(C=0,l=s.length;C<l;++C)I[Ne(s[C])]=1;for(C=0,l=e.length;C<l;++C)E=e[C],I[Ne(E)]=-1;for(C=0,l=i.length;C<l;++C)B=i[C],s.forEach(f=>{B(f)&&(I[Ne(f)]=-1)});for(C=0,l=A.length;C<l;++C)E=A[C],u=Ne(E),I[u]?I[u]=1:a.add.push(Ei(A[C]));for(C=0,l=s.length;C<l;++C)E=s[C],I[Ne(E)]<0&&a.rem.push(E);function d(f,w,y){y?f[w]=y(f):a.encode=w,g||(r[Ne(f)]=f)}for(C=0,l=t.length;C<l;++C)c=t[C],E=c.tuple,B=c.field,u=I[Ne(E)],u>0&&(d(E,B,c.value),a.modifies(B));for(C=0,l=n.length;C<l;++C)c=n[C],B=c.filter,s.forEach(f=>{B(f)&&I[Ne(f)]>0&&d(f,c.field,c.value)}),a.modifies(c.field);if(g)a.mod=e.length||i.length?s.filter(f=>I[Ne(f)]>0):s.slice();else for(u in r)a.mod.push(r[u]);return(o||o==null&&(e.length||i.length))&&a.clean(!0),a}}}const s5="_:mod:_";function r5(){Object.defineProperty(this,s5,{writable:!0,value:{}})}r5.prototype={set(A,e,t,i){const n=this,o=n[A],g=n[s5];return e!=null&&e>=0?(o[e]!==t||i)&&(o[e]=t,g[e+":"+A]=-1,g[A]=-1):(o!==t||i)&&(n[A]=t,g[A]=RA(t)?1+t.length:-1),n},modified(A,e){const t=this[s5];if(arguments.length){if(RA(A)){for(let i=0;i<A.length;++i)if(t[A[i]])return!0;return!1}}else{for(const i in t)if(t[i])return!0;return!1}return e!=null&&e>=0?e+1<t[A]||!!t[e+":"+A]:!!t[A]},clear(){return this[s5]={},this}};let MAt=0;const vAt="pulse",LAt=new r5,SAt=1,HAt=2;function Oi(A,e,t,i){this.id=++MAt,this.value=A,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),t&&this.parameters(t,i)}function ZVA(A){return function(e){const t=this.flags;return arguments.length===0?!!(t&A):(this.flags=e?t|A:t&~A,this)}}Oi.prototype={targets(){return this._targets||(this._targets=n5(RM))},set(A){return this.value!==A?(this.value=A,1):0},skip:ZVA(SAt),modified:ZVA(HAt),parameters(A,e,t){e=e!==!1;const i=this._argval=this._argval||new r5,n=this._argops=this._argops||[],o=[];let g,a,s,I;const r=(C,l,c)=>{c instanceof Oi?(c!==this&&(e&&c.targets().add(this),o.push(c)),n.push({op:c,name:C,index:l})):i.set(C,l,c)};for(g in A)if(a=A[g],g===vAt)te(a).forEach(C=>{C instanceof Oi?C!==this&&(C.targets().add(this),o.push(C)):YA("Pulse parameters must be operator instances.")}),this.source=a;else if(RA(a))for(i.set(g,-1,Array(s=a.length)),I=0;I<s;++I)r(g,I,a[I]);else r(g,-1,a);return this.marshall().clear(),t&&(n.initonly=!0),o},marshall(A){const e=this._argval||LAt,t=this._argops;let i,n,o,g;if(t){const a=t.length;for(n=0;n<a;++n)i=t[n],o=i.op,g=o.modified()&&o.stamp===A,e.set(i.name,i.index,o.value,g);if(t.initonly){for(n=0;n<a;++n)i=t[n],i.op.targets().remove(this);this._argops=null,this._update=null}}return e},detach(){const A=this._argops;let e,t,i,n;if(A)for(e=0,t=A.length;e<t;++e)i=A[e],n=i.op,n._targets&&n._targets.remove(this);this.pulse=null,this.source=null},evaluate(A){const e=this._update;if(e){const t=this.marshall(A.stamp),i=e.call(this,t,A);if(t.clear(),i!==this.value)this.value=i;else if(!this.modified())return A.StopPropagation}},run(A){if(A.stamp<this.stamp)return A.StopPropagation;let e;return this.skip()?(this.skip(!1),e=0):e=this.evaluate(A),this.pulse=e||A}};function ZAt(A,e,t,i){let n=1,o;return A instanceof Oi?o=A:A&&A.prototype instanceof Oi?o=new A:Ct(A)?o=new Oi(null,A):(n=0,o=new Oi(A,e)),this.rank(o),n&&(i=t,t=e),t&&this.connect(o,o.parameters(t,i)),this.touch(o),o}function WAt(A,e){const t=A.rank,i=e.length;for(let n=0;n<i;++n)if(t<e[n].rank){this.rerank(A);return}}let KAt=0;function I5(A,e,t){this.id=++KAt,this.value=null,t&&(this.receive=t),A&&(this._filter=A),e&&(this._apply=e)}function Cp(A,e,t){return new I5(A,e,t)}I5.prototype={_filter:el,_apply:Ja,targets(){return this._targets||(this._targets=n5(RM))},consume(A){return arguments.length?(this._consume=!!A,this):!!this._consume},receive(A){if(this._filter(A)){const e=this.value=this._apply(A),t=this._targets,i=t?t.length:0;for(let n=0;n<i;++n)t[n].receive(e);this._consume&&(A.preventDefault(),A.stopPropagation())}},filter(A){const e=Cp(A);return this.targets().add(e),e},apply(A){const e=Cp(null,A);return this.targets().add(e),e},merge(){const A=Cp();this.targets().add(A);for(let e=0,t=arguments.length;e<t;++e)arguments[e].targets().add(A);return A},throttle(A){let e=-1;return this.filter(()=>{const t=Date.now();return t-e>A?(e=t,1):0})},debounce(A){const e=Cp();return this.targets().add(Cp(null,null,xaA(A,t=>{const i=t.dataflow;e.receive(t),i&&i.run&&i.run()}))),e},between(A,e){let t=!1;return A.targets().add(Cp(null,null,()=>t=!0)),e.targets().add(Cp(null,null,()=>t=!1)),this.filter(()=>t)},detach(){this._filter=el,this._targets=null}};function UAt(A,e,t,i){const n=this,o=Cp(t,i),g=function(I){I.dataflow=n;try{o.receive(I)}catch(r){n.error(r)}finally{n.run()}};let a;typeof A=="string"&&typeof document<"u"?a=document.querySelectorAll(A):a=te(A);const s=a.length;for(let I=0;I<s;++I)a[I].addEventListener(e,g);return o}function VAt(A,e){const t=this.locale();return MVA(A,e,t.timeParse,t.utcParse)}function XAt(A,e,t){return e=this.parse(e,t),this.pulse(A,this.changeset().insert(e))}async function zAt(A,e){const t=this;let i=0,n;try{n=await t.loader().load(A,{context:"dataflow",response:FVA(e&&e.type)});try{n=t.parse(n,e)}catch(o){i=-2,t.warn("Data ingestion failed",A,o)}}catch(o){i=-1,t.warn("Loading failed",A,o)}return{data:n,status:i}}async function TAt(A,e,t){const i=this,n=i._pending||_At(i);n.requests+=1;const o=await i.request(e,t);return i.pulse(A,i.changeset().remove(el).insert(o.data||[])),n.done(),o}function _At(A){let e;const t=new Promise(i=>e=i);return t.requests=0,t.done=()=>{--t.requests===0&&(A._pending=null,e(A))},A._pending=t}const OAt={skip:!0};function qAt(A,e,t,i,n){return(A instanceof Oi?PAt:jAt)(this,A,e,t,i,n),this}function jAt(A,e,t,i,n,o){const g=lt({},o,OAt);let a,s;Ct(t)||(t=Ya(t)),i===void 0?a=I=>A.touch(t(I)):Ct(i)?(s=new Oi(null,i,n,!1),a=I=>{s.evaluate(I);const r=t(I),C=s.value;HVA(C)?A.pulse(r,C,o):A.update(r,C,g)}):a=I=>A.update(t(I),i,g),e.apply(a)}function PAt(A,e,t,i,n,o){if(i===void 0)e.targets().add(t);else{const g=o||{},a=new Oi(null,$At(t,i),n,!1);a.modified(g.force),a.rank=e.rank,e.targets().add(a),t&&(a.skip(!0),a.value=t.value,a.targets().add(t),A.connect(t,[a]))}}function $At(A,e){return e=Ct(e)?e:Ya(e),A?function(t,i){const n=e(t,i);return A.skip()||(A.skip(n!==this.value).value=n),n}:e}function Aet(A){A.rank=++this._rank}function eet(A){const e=[A];let t,i,n;for(;e.length;)if(this.rank(t=e.pop()),i=t._targets)for(n=i.length;--n>=0;)e.push(t=i[n]),t===A&&YA("Cycle detected in dataflow graph.")}const C5={},fQ=1,lp=2,id=4,tet=fQ|lp,WVA=fQ|id,fJ=fQ|lp|id,KVA=8,XM=16,UVA=32,VVA=64;function cp(A,e,t){this.dataflow=A,this.stamp=e??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=t||null}function osA(A,e){const t=[];return Ip(A,e,i=>t.push(i)),t}function XVA(A,e){const t={};return A.visit(e,i=>{t[Ne(i)]=1}),i=>t[Ne(i)]?null:i}function l5(A,e){return A?(t,i)=>A(t,i)&&e(t,i):e}cp.prototype={StopPropagation:C5,ADD:fQ,REM:lp,MOD:id,ADD_REM:tet,ADD_MOD:WVA,ALL:fJ,REFLOW:KVA,SOURCE:XM,NO_SOURCE:UVA,NO_FIELDS:VVA,fork(A){return new cp(this.dataflow).init(this,A)},clone(){const A=this.fork(fJ);return A.add=A.add.slice(),A.rem=A.rem.slice(),A.mod=A.mod.slice(),A.source&&(A.source=A.source.slice()),A.materialize(fJ|XM)},addAll(){let A=this;return!A.source||A.add===A.rem||!A.rem.length&&A.source.length===A.add.length||(A=new cp(this.dataflow).init(this),A.add=A.source,A.rem=[]),A},init(A,e){const t=this;return t.stamp=A.stamp,t.encode=A.encode,A.fields&&!(e&VVA)&&(t.fields=A.fields),e&fQ?(t.addF=A.addF,t.add=A.add):(t.addF=null,t.add=[]),e&lp?(t.remF=A.remF,t.rem=A.rem):(t.remF=null,t.rem=[]),e&id?(t.modF=A.modF,t.mod=A.mod):(t.modF=null,t.mod=[]),e&UVA?(t.srcF=null,t.source=null):(t.srcF=A.srcF,t.source=A.source,A.cleans&&(t.cleans=A.cleans)),t},runAfter(A){this.dataflow.runAfter(A)},changed(A){const e=A||fJ;return e&fQ&&this.add.length||e&lp&&this.rem.length||e&id&&this.mod.length},reflow(A){if(A)return this.fork(fJ).reflow();const e=this.add.length,t=this.source&&this.source.length;return t&&t!==e&&(this.mod=this.source,e&&this.filter(id,XVA(this,fQ))),this},clean(A){return arguments.length?(this.cleans=!!A,this):this.cleans},modifies(A){const e=this.fields||(this.fields={});return RA(A)?A.forEach(t=>e[t]=!0):e[A]=!0,this},modified(A,e){const t=this.fields;return(e||this.mod.length)&&t?arguments.length?RA(A)?A.some(i=>t[i]):t[A]:!!t:!1},filter(A,e){const t=this;return A&fQ&&(t.addF=l5(t.addF,e)),A&lp&&(t.remF=l5(t.remF,e)),A&id&&(t.modF=l5(t.modF,e)),A&XM&&(t.srcF=l5(t.srcF,e)),t},materialize(A){A=A||fJ;const e=this;return A&fQ&&e.addF&&(e.add=osA(e.add,e.addF),e.addF=null),A&lp&&e.remF&&(e.rem=osA(e.rem,e.remF),e.remF=null),A&id&&e.modF&&(e.mod=osA(e.mod,e.modF),e.modF=null),A&XM&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(A,e){const t=this,i=e;if(A&XM)return Ip(t.source,t.srcF,i),t;A&fQ&&Ip(t.add,t.addF,i),A&lp&&Ip(t.rem,t.remF,i),A&id&&Ip(t.mod,t.modF,i);const n=t.source;if(A&KVA&&n){const o=t.add.length+t.mod.length;o===n.length||(o?Ip(n,XVA(t,WVA),i):Ip(n,t.srcF,i))}return t}};function gsA(A,e,t,i){const n=this;let o=0;this.dataflow=A,this.stamp=e,this.fields=null,this.encode=i||null,this.pulses=t;for(const g of t)if(g.stamp===e){if(g.fields){const a=n.fields||(n.fields={});for(const s in g.fields)a[s]=1}g.changed(n.ADD)&&(o|=n.ADD),g.changed(n.REM)&&(o|=n.REM),g.changed(n.MOD)&&(o|=n.MOD)}this.changes=o}_A(gsA,cp,{fork(A){const e=new cp(this.dataflow).init(this,A&this.NO_FIELDS);return A!==void 0&&(A&e.ADD&&this.visit(e.ADD,t=>e.add.push(t)),A&e.REM&&this.visit(e.REM,t=>e.rem.push(t)),A&e.MOD&&this.visit(e.MOD,t=>e.mod.push(t))),e},changed(A){return this.changes&A},modified(A){const e=this,t=e.fields;return t&&e.changes&e.MOD?RA(A)?A.some(i=>t[i]):t[A]:0},filter(){YA("MultiPulse does not support filtering.")},materialize(){YA("MultiPulse does not support materialization.")},visit(A,e){const t=this,i=t.pulses,n=i.length;let o=0;if(A&t.SOURCE)for(;o<n;++o)i[o].visit(A,e);else for(;o<n;++o)i[o].stamp===t.stamp&&i[o].visit(A,e);return t}});async function iet(A,e,t){const i=this,n=[];if(i._pulse)return zVA(i);if(i._pending&&await i._pending,e&&await o5(i,e),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new cp(i,o,A),i._touched.forEach(r=>i._enqueue(r,!0)),i._touched=n5(RM);let g=0,a,s,I;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}s=a.run(i._getPulse(a,A)),s.then?s=await s:s.async&&(n.push(s.async),s=C5),s!==C5&&a._targets&&a._targets.forEach(r=>i._enqueue(r)),++g}}catch(r){i._heap.clear(),I=r}if(i._input={},i._pulse=null,i.debug(`Pulse ${o}: ${g} operators`),I&&(i._postrun=[],i.error(I)),i._postrun.length){const r=i._postrun.sort((C,l)=>l.priority-C.priority);i._postrun=[];for(let C=0;C<r.length;++C)await o5(i,r[C].callback)}return t&&await o5(i,t),n.length&&Promise.all(n).then(r=>i.runAsync(null,()=>{r.forEach(C=>{try{C(i)}catch(l){i.error(l)}})})),i}async function net(A,e,t){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(A,e,t)).then(i,i),this._running}function oet(A,e,t){return this._pulse?zVA(this):(this.evaluate(A,e,t),this)}function get(A,e,t){if(this._pulse||e)this._postrun.push({priority:t||0,callback:A});else try{A(this)}catch(i){this.error(i)}}function zVA(A){return A.error("Dataflow already running. Use runAsync() to chain invocations."),A}function aet(A,e){const t=A.stamp<this._clock;t&&(A.stamp=this._clock),(t||e)&&(A.qrank=A.rank,this._heap.push(A))}function set(A,e){const t=A.source,i=this._clock;return t&&RA(t)?new gsA(this,i,t.map(n=>n.pulse),e):this._input[A.id]||ret(this._pulse,t&&t.pulse)}function ret(A,e){return e&&e.stamp===A.stamp?e:(A=A.fork(),e&&e!==C5&&(A.source=e.source),A)}const asA={skip:!1,force:!1};function Iet(A,e){const t=e||asA;return this._pulse?this._enqueue(A):this._touched.add(A),t.skip&&A.skip(!0),this}function Cet(A,e,t){const i=t||asA;return(A.set(e)||i.force)&&this.touch(A,i),this}function cet(A,e,t){this.touch(A,t||asA);const i=new cp(this,this._clock+(this._pulse?0:1)),n=A.pulse&&A.pulse.source||[];return i.target=A,this._input[A.id]=e.pulse(i,n),this}function Bet(A){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:t=>(e.push(t),TVA(e,0,e.length-1,A)),pop:()=>{const t=e.pop();let i;return e.length?(i=e[0],e[0]=t,Qet(e,0,A)):i=t,i}}}function TVA(A,e,t,i){let n,o;const g=A[t];for(;t>e;){if(o=t-1>>1,n=A[o],i(g,n)<0){A[t]=n,t=o;continue}break}return A[t]=g}function Qet(A,e,t){const i=e,n=A.length,o=A[e];let g=(e<<1)+1,a;for(;g<n;)a=g+1,a<n&&t(A[g],A[a])>=0&&(g=a),A[e]=A[g],e=g,g=(e<<1)+1;return A[e]=o,TVA(A,i,e,t)}function yJ(){this.logger(kaA()),this.logLevel(DaA),this._clock=0,this._rank=0,this._locale=$aA();try{this._loader=i5()}catch{}this._touched=n5(RM),this._input={},this._pulse=null,this._heap=Bet((A,e)=>A.qrank-e.qrank),this._postrun=[]}function zM(A){return function(){return this._log[A].apply(this,arguments)}}yJ.prototype={stamp(){return this._clock},loader(A){return arguments.length?(this._loader=A,this):this._loader},locale(A){return arguments.length?(this._locale=A,this):this._locale},logger(A){return arguments.length?(this._log=A,this):this._log},error:zM("error"),warn:zM("warn"),info:zM("info"),debug:zM("debug"),logLevel:zM("level"),cleanThreshold:1e4,add:ZAt,connect:WAt,rank:Aet,rerank:eet,pulse:cet,touch:Iet,update:Cet,changeset:sb,ingest:XAt,parse:VAt,preload:TAt,request:zAt,events:UAt,on:qAt,evaluate:iet,run:oet,runAsync:net,runAfter:get,_enqueue:aet,_getPulse:set};function DA(A,e){Oi.call(this,A,null,e)}_A(DA,Oi,{run(A){if(A.stamp<this.stamp)return A.StopPropagation;let e;return this.skip()?this.skip(!1):e=this.evaluate(A),e=e||A,e.then?e=e.then(t=>this.pulse=t):e!==A.StopPropagation&&(this.pulse=e),e},evaluate(A){const e=this.marshall(A.stamp),t=this.transform(e,A);return e.clear(),t},transform(){}});const bJ={};function _VA(A){const e=OVA(A);return e&&e.Definition||null}function OVA(A){return A=A&&A.toLowerCase(),Je(bJ,A)?bJ[A]:null}function*qVA(A,e){if(e==null)for(let t of A)t!=null&&t!==""&&(t=+t)>=t&&(yield t);else{let t=-1;for(let i of A)i=e(i,++t,A),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function ssA(A,e,t){const i=Float64Array.from(qVA(A,t));return i.sort(Oo),e.map(n=>f3A(i,n))}function rsA(A,e){return ssA(A,[.25,.5,.75],e)}function IsA(A,e){const t=A.length,i=ygA(A,e),n=rsA(A,e),o=(n[2]-n[0])/1.34;return 1.06*(Math.min(i,o)||i||Math.abs(n[0])||1)*Math.pow(t,-.2)}function jVA(A){const e=A.maxbins||20,t=A.base||10,i=Math.log(t),n=A.divide||[5,2];let o=A.extent[0],g=A.extent[1],a,s,I,r,C,l;const c=A.span||g-o||Math.abs(o)||1;if(A.step)a=A.step;else if(A.steps){for(r=c/e,C=0,l=A.steps.length;C<l&&A.steps[C]<r;++C);a=A.steps[Math.max(0,C-1)]}else{for(s=Math.ceil(Math.log(e)/i),I=A.minstep||0,a=Math.max(I,Math.pow(t,Math.round(Math.log(c)/i)-s));Math.ceil(c/a)>e;)a*=t;for(C=0,l=n.length;C<l;++C)r=a/n[C],r>=I&&c/r<=e&&(a=r)}r=Math.log(a);const B=r>=0?0:~~(-r/i)+1,E=Math.pow(t,-B-1);return(A.nice||A.nice===void 0)&&(r=Math.floor(o/a+E)*a,o=o<r?r-a:r,g=Math.ceil(g/a)*a),{start:o,stop:g===o?o+a:g,step:a}}var il=Math.random;function Eet(A){il=A}function PVA(A,e,t,i){if(!A.length)return[void 0,void 0];const n=Float64Array.from(qVA(A,i)),o=n.length,g=e;let a,s,I,r;for(I=0,r=Array(g);I<g;++I){for(a=0,s=0;s<o;++s)a+=n[~~(il()*o)];r[I]=a/o}return r.sort(Oo),[BQ(r,t/2),BQ(r,1-t/2)]}function $VA(A,e,t,i){i=i||(l=>l);const n=A.length,o=new Float64Array(n);let g=0,a=1,s=i(A[0]),I=s,r=s+e,C;for(;a<n;++a){if(C=i(A[a]),C>=r){for(I=(s+I)/2;g<a;++g)o[g]=I;r=C+e,s=C}I=C}for(I=(s+I)/2;g<a;++g)o[g]=I;return t?uet(o,e+e/4):o}function uet(A,e){const t=A.length;let i=0,n=1,o,g;for(;A[i]===A[n];)++n;for(;n<t;){for(o=n+1;A[n]===A[o];)++o;if(A[n]-A[n-1]<e){for(g=n+(i+o-n-n>>1);g<n;)A[g++]=A[n];for(;g>n;)A[g--]=A[i]}i=n,n=o}return A}function det(A){return function(){return A=(1103515245*A+12345)%2147483647,A/2147483647}}function het(A,e){e==null&&(e=A,A=0);let t,i,n;const o={min(g){return arguments.length?(t=g||0,n=i-t,o):t},max(g){return arguments.length?(i=g||0,n=i-t,o):i},sample(){return t+Math.floor(n*il())},pdf(g){return g===Math.floor(g)&&g>=t&&g<i?1/n:0},cdf(g){const a=Math.floor(g);return a<t?0:a>=i?1:(a-t+1)/n},icdf(g){return g>=0&&g<=1?t-1+Math.floor(g*n):NaN}};return o.min(A).max(e)}const AXA=Math.sqrt(2*Math.PI),met=Math.SQRT2;let TM=NaN;function c5(A,e){A=A||0,e=e??1;let t=0,i=0,n,o;if(TM===TM)t=TM,TM=NaN;else{do t=il()*2-1,i=il()*2-1,n=t*t+i*i;while(n===0||n>1);o=Math.sqrt(-2*Math.log(n)/n),t*=o,TM=i*o}return A+t*e}function CsA(A,e,t){t=t??1;const i=(A-(e||0))/t;return Math.exp(-.5*i*i)/(t*AXA)}function B5(A,e,t){e=e||0,t=t??1;const i=(A-e)/t,n=Math.abs(i);let o;if(n>37)o=0;else{const g=Math.exp(-n*n/2);let a;n<7.07106781186547?(a=.0352624965998911*n+.700383064443688,a=a*n+6.37396220353165,a=a*n+33.912866078383,a=a*n+112.079291497871,a=a*n+221.213596169931,a=a*n+220.206867912376,o=g*a,a=.0883883476483184*n+1.75566716318264,a=a*n+16.064177579207,a=a*n+86.7807322029461,a=a*n+296.564248779674,a=a*n+637.333633378831,a=a*n+793.826512519948,a=a*n+440.413735824752,o=o/a):(a=n+.65,a=n+4/a,a=n+3/a,a=n+2/a,a=n+1/a,o=g/a/2.506628274631)}return i>0?1-o:o}function Q5(A,e,t){return A<0||A>1?NaN:(e||0)+(t??1)*met*pet(2*A-1)}function pet(A){let e=-Math.log((1-A)*(1+A)),t;return e<6.25?(e-=3.125,t=-364441206401782e-35,t=-16850591381820166e-35+t*e,t=128584807152564e-32+t*e,t=11157877678025181e-33+t*e,t=-1333171662854621e-31+t*e,t=20972767875968562e-33+t*e,t=6637638134358324e-30+t*e,t=-4054566272975207e-29+t*e,t=-8151934197605472e-29+t*e,t=26335093153082323e-28+t*e,t=-12975133253453532e-27+t*e,t=-5415412054294628e-26+t*e,t=10512122733215323e-25+t*e,t=-4112633980346984e-24+t*e,t=-29070369957882005e-24+t*e,t=42347877827932404e-23+t*e,t=-13654692000834679e-22+t*e,t=-13882523362786469e-21+t*e,t=.00018673420803405714+t*e,t=-.000740702534166267+t*e,t=-.006033670871430149+t*e,t=.24015818242558962+t*e,t=1.6536545626831027+t*e):e<16?(e=Math.sqrt(e)-3.25,t=22137376921775787e-25,t=9075656193888539e-23+t*e,t=-27517406297064545e-23+t*e,t=18239629214389228e-24+t*e,t=15027403968909828e-22+t*e,t=-4013867526981546e-21+t*e,t=29234449089955446e-22+t*e,t=12475304481671779e-21+t*e,t=-47318229009055734e-21+t*e,t=6828485145957318e-20+t*e,t=24031110387097894e-21+t*e,t=-.0003550375203628475+t*e,t=.0009532893797373805+t*e,t=-.0016882755560235047+t*e,t=.002491442096107851+t*e,t=-.003751208507569241+t*e,t=.005370914553590064+t*e,t=1.0052589676941592+t*e,t=3.0838856104922208+t*e):Number.isFinite(e)?(e=Math.sqrt(e)-5,t=-27109920616438573e-27,t=-2555641816996525e-25+t*e,t=15076572693500548e-25+t*e,t=-3789465440126737e-24+t*e,t=761570120807834e-23+t*e,t=-1496002662714924e-23+t*e,t=2914795345090108e-23+t*e,t=-6771199775845234e-23+t*e,t=22900482228026655e-23+t*e,t=-99298272942317e-20+t*e,t=4526062597223154e-21+t*e,t=-1968177810553167e-20+t*e,t=7599527703001776e-20+t*e,t=-.00021503011930044477+t*e,t=-.00013871931833623122+t*e,t=1.0103004648645344+t*e,t=4.849906401408584+t*e):t=1/0,t*A}function lsA(A,e){let t,i;const n={mean(o){return arguments.length?(t=o||0,n):t},stdev(o){return arguments.length?(i=o??1,n):i},sample:()=>c5(t,i),pdf:o=>CsA(o,t,i),cdf:o=>B5(o,t,i),icdf:o=>Q5(o,t,i)};return n.mean(A).stdev(e)}function csA(A,e){const t=lsA();let i=0;const n={data(o){return arguments.length?(A=o,i=o?o.length:0,n.bandwidth(e)):A},bandwidth(o){return arguments.length?(e=o,!e&&A&&(e=IsA(A)),n):e},sample(){return A[~~(il()*i)]+e*t.sample()},pdf(o){let g=0,a=0;for(;a<i;++a)g+=t.pdf((o-A[a])/e);return g/e/i},cdf(o){let g=0,a=0;for(;a<i;++a)g+=t.cdf((o-A[a])/e);return g/i},icdf(){throw Error("KDE icdf not supported.")}};return n.data(A)}function BsA(A,e){return A=A||0,e=e??1,Math.exp(A+c5()*e)}function QsA(A,e,t){if(A<=0)return 0;e=e||0,t=t??1;const i=(Math.log(A)-e)/t;return Math.exp(-.5*i*i)/(t*AXA*A)}function EsA(A,e,t){return B5(Math.log(A),e,t)}function usA(A,e,t){return Math.exp(Q5(A,e,t))}function eXA(A,e){let t,i;const n={mean(o){return arguments.length?(t=o||0,n):t},stdev(o){return arguments.length?(i=o??1,n):i},sample:()=>BsA(t,i),pdf:o=>QsA(o,t,i),cdf:o=>EsA(o,t,i),icdf:o=>usA(o,t,i)};return n.mean(A).stdev(e)}function tXA(A,e){let t=0,i;function n(g){const a=[];let s=0,I;for(I=0;I<t;++I)s+=a[I]=g[I]==null?1:+g[I];for(I=0;I<t;++I)a[I]/=s;return a}const o={weights(g){return arguments.length?(i=n(e=g||[]),o):e},distributions(g){return arguments.length?(g?(t=g.length,A=g):(t=0,A=[]),o.weights(e)):A},sample(){const g=il();let a=A[t-1],s=i[0],I=0;for(;I<t-1;s+=i[++I])if(g<s){a=A[I];break}return a.sample()},pdf(g){let a=0,s=0;for(;s<t;++s)a+=i[s]*A[s].pdf(g);return a},cdf(g){let a=0,s=0;for(;s<t;++s)a+=i[s]*A[s].cdf(g);return a},icdf(){throw Error("Mixture icdf not supported.")}};return o.distributions(A).weights(e)}function dsA(A,e){return e==null&&(e=A??1,A=0),A+(e-A)*il()}function hsA(A,e,t){return t==null&&(t=e??1,e=0),A>=e&&A<=t?1/(t-e):0}function msA(A,e,t){return t==null&&(t=e??1,e=0),A<e?0:A>t?1:(A-e)/(t-e)}function psA(A,e,t){return t==null&&(t=e??1,e=0),A>=0&&A<=1?e+A*(t-e):NaN}function iXA(A,e){let t,i;const n={min(o){return arguments.length?(t=o||0,n):t},max(o){return arguments.length?(i=o??1,n):i},sample:()=>dsA(t,i),pdf:o=>hsA(o,t,i),cdf:o=>msA(o,t,i),icdf:o=>psA(o,t,i)};return e==null&&(e=A??1,A=0),n.min(A).max(e)}function fsA(A,e,t){let i=0,n=0;for(const o of A){const g=t(o);e(o)==null||g==null||isNaN(g)||(i+=(g-i)/++n)}return{coef:[i],predict:()=>i,rSquared:0}}function _M(A,e,t,i){const n=i-A*A,o=Math.abs(n)<1e-24?0:(t-A*e)/n;return[e-o*A,o]}function E5(A,e,t,i){A=A.filter(c=>{let B=e(c),E=t(c);return B!=null&&(B=+B)>=B&&E!=null&&(E=+E)>=E}),i&&A.sort((c,B)=>e(c)-e(B));const n=A.length,o=new Float64Array(n),g=new Float64Array(n);let a=0,s=0,I=0,r,C,l;for(l of A)o[a]=r=+e(l),g[a]=C=+t(l),++a,s+=(r-s)/a,I+=(C-I)/a;for(a=0;a<n;++a)o[a]-=s,g[a]-=I;return[o,g,s,I]}function OM(A,e,t,i){let n=-1,o,g;for(const a of A)o=e(a),g=t(a),o!=null&&(o=+o)>=o&&g!=null&&(g=+g)>=g&&i(o,g,++n)}function wJ(A,e,t,i,n){let o=0,g=0;return OM(A,e,t,(a,s)=>{const I=s-n(a),r=s-i;o+=I*I,g+=r*r}),1-o/g}function ysA(A,e,t){let i=0,n=0,o=0,g=0,a=0;OM(A,e,t,(r,C)=>{++a,i+=(r-i)/a,n+=(C-n)/a,o+=(r*C-o)/a,g+=(r*r-g)/a});const s=_M(i,n,o,g),I=r=>s[0]+s[1]*r;return{coef:s,predict:I,rSquared:wJ(A,e,t,n,I)}}function nXA(A,e,t){let i=0,n=0,o=0,g=0,a=0;OM(A,e,t,(r,C)=>{++a,r=Math.log(r),i+=(r-i)/a,n+=(C-n)/a,o+=(r*C-o)/a,g+=(r*r-g)/a});const s=_M(i,n,o,g),I=r=>s[0]+s[1]*Math.log(r);return{coef:s,predict:I,rSquared:wJ(A,e,t,n,I)}}function oXA(A,e,t){const[i,n,o,g]=E5(A,e,t);let a=0,s=0,I=0,r=0,C=0,l,c,B;OM(A,e,t,(f,w)=>{l=i[C++],c=Math.log(w),B=l*w,a+=(w*c-a)/C,s+=(B-s)/C,I+=(B*c-I)/C,r+=(l*B-r)/C});const[E,u]=_M(s/g,a/g,I/g,r/g),d=f=>Math.exp(E+u*(f-o));return{coef:[Math.exp(E-u*o),u],predict:d,rSquared:wJ(A,e,t,g,d)}}function gXA(A,e,t){let i=0,n=0,o=0,g=0,a=0,s=0;OM(A,e,t,(C,l)=>{const c=Math.log(C),B=Math.log(l);++s,i+=(c-i)/s,n+=(B-n)/s,o+=(c*B-o)/s,g+=(c*c-g)/s,a+=(l-a)/s});const I=_M(i,n,o,g),r=C=>I[0]*Math.pow(C,I[1]);return I[0]=Math.exp(I[0]),{coef:I,predict:r,rSquared:wJ(A,e,t,a,r)}}function bsA(A,e,t){const[i,n,o,g]=E5(A,e,t),a=i.length;let s=0,I=0,r=0,C=0,l=0,c,B,E,u;for(c=0;c<a;)B=i[c],E=n[c++],u=B*B,s+=(u-s)/c,I+=(u*B-I)/c,r+=(u*u-r)/c,C+=(B*E-C)/c,l+=(u*E-l)/c;const d=r-s*s,f=s*d-I*I,w=(l*s-C*I)/f,y=(C*d-l*I)/f,G=-w*s,R=x=>(x=x-o,w*x*x+y*x+G+g);return{coef:[G-y*o+w*o*o+g,y-2*w*o,w],predict:R,rSquared:wJ(A,e,t,g,R)}}function aXA(A,e,t,i){if(i===0)return fsA(A,e,t);if(i===1)return ysA(A,e,t);if(i===2)return bsA(A,e,t);const[n,o,g,a]=E5(A,e,t),s=n.length,I=[],r=[],C=i+1;let l,c,B,E,u;for(l=0;l<C;++l){for(B=0,E=0;B<s;++B)E+=Math.pow(n[B],l)*o[B];for(I.push(E),u=new Float64Array(C),c=0;c<C;++c){for(B=0,E=0;B<s;++B)E+=Math.pow(n[B],l+c);u[c]=E}r.push(u)}r.push(I);const d=yet(r),f=w=>{w-=g;let y=a+d[0]+d[1]*w+d[2]*w*w;for(l=3;l<C;++l)y+=d[l]*Math.pow(w,l);return y};return{coef:fet(C,d,-g,a),predict:f,rSquared:wJ(A,e,t,a,f)}}function fet(A,e,t,i){const n=Array(A);let o,g,a,s;for(o=0;o<A;++o)n[o]=0;for(o=A-1;o>=0;--o)for(a=e[o],s=1,n[o]+=a,g=1;g<=o;++g)s*=(o+1-g)/g,n[o-g]+=a*Math.pow(t,g)*s;return n[0]+=i,n}function yet(A){const e=A.length-1,t=[];let i,n,o,g,a;for(i=0;i<e;++i){for(g=i,n=i+1;n<e;++n)Math.abs(A[i][n])>Math.abs(A[i][g])&&(g=n);for(o=i;o<e+1;++o)a=A[o][i],A[o][i]=A[o][g],A[o][g]=a;for(n=i+1;n<e;++n)for(o=e;o>=i;o--)A[o][n]-=A[o][i]*A[i][n]/A[i][i]}for(n=e-1;n>=0;--n){for(a=0,o=n+1;o<e;++o)a+=A[o][n]*t[o];t[n]=(A[e][n]-a)/A[n][n]}return t}const sXA=2,rXA=1e-12;function IXA(A,e,t,i){const[n,o,g,a]=E5(A,e,t,!0),s=n.length,I=Math.max(2,~~(i*s)),r=new Float64Array(s),C=new Float64Array(s),l=new Float64Array(s).fill(1);for(let c=-1;++c<=sXA;){const B=[0,I-1];for(let u=0;u<s;++u){const d=n[u],f=B[0],w=B[1],y=d-n[f]>n[w]-d?f:w;let G=0,R=0,x=0,F=0,Q=0;const k=1/Math.abs(n[y]-d||1);for(let v=f;v<=w;++v){const K=n[v],U=o[v],V=bet(Math.abs(d-K)*k)*l[v],X=K*V;G+=V,R+=X,x+=U*V,F+=U*X,Q+=K*X}const[h,N]=_M(R/G,x/G,F/G,Q/G);r[u]=h+N*d,C[u]=Math.abs(o[u]-r[u]),wet(n,u+1,B)}if(c===sXA)break;const E=hM(C);if(Math.abs(E)<rXA)break;for(let u=0,d,f;u<s;++u)d=C[u]/(6*E),l[u]=d>=1?rXA:(f=1-d*d)*f}return Det(n,r,g,a)}function bet(A){return(A=1-A*A*A)*A*A}function wet(A,e,t){const i=A[e];let n=t[0],o=t[1]+1;if(!(o>=A.length))for(;e>n&&A[o]-i<=i-A[n];)t[0]=++n,t[1]=o,++o}function Det(A,e,t,i){const n=A.length,o=[];let g=0,a=0,s=[],I;for(;g<n;++g)I=A[g]+t,s[0]===I?s[1]+=(e[g]-s[1])/++a:(a=0,s[1]+=i,s=[I,e[g]],o.push(s));return s[1]+=i,o}const Get=.5*Math.PI/180;function u5(A,e,t,i){t=t||25,i=Math.max(t,i||200);const n=E=>[E,A(E)],o=e[0],g=e[1],a=g-o,s=a/i,I=[n(o)],r=[];if(t===i){for(let E=1;E<i;++E)I.push(n(o+E/t*a));return I.push(n(g)),I}else{r.push(n(g));for(let E=t;--E>0;)r.push(n(o+E/t*a))}let C=I[0],l=r[r.length-1];const c=1/a,B=ket(C[1],r);for(;l;){const E=n((C[0]+l[0])/2);E[0]-C[0]>=s&&Jet(C,E,l,c,B)>Get?r.push(E):(C=l,I.push(l),r.pop()),l=r[r.length-1]}return I}function ket(A,e){let t=A,i=A;const n=e.length;for(let o=0;o<n;++o){const g=e[o][1];g<t&&(t=g),g>i&&(i=g)}return 1/(i-t)}function Jet(A,e,t,i,n){const o=Math.atan2(n*(t[1]-A[1]),i*(t[0]-A[0])),g=Math.atan2(n*(e[1]-A[1]),i*(e[0]-A[0]));return Math.abs(o-g)}function Net(A){return e=>{const t=A.length;let i=1,n=String(A[0](e));for(;i<t;++i)n+="|"+A[i](e);return n}}function wsA(A){return!A||!A.length?function(){return""}:A.length===1?A[0]:Net(A)}function CXA(A,e,t){return t||A+(e?"_"+e:"")}const DsA=()=>{},Yet={init:DsA,add:DsA,rem:DsA,idx:0},qM={values:{init:A=>A.cell.store=!0,value:A=>A.cell.data.values(),idx:-1},count:{value:A=>A.cell.num},__count__:{value:A=>A.missing+A.valid},missing:{value:A=>A.missing},valid:{value:A=>A.valid},sum:{init:A=>A.sum=0,value:A=>A.sum,add:(A,e)=>A.sum+=+e,rem:(A,e)=>A.sum-=e},product:{init:A=>A.product=1,value:A=>A.valid?A.product:void 0,add:(A,e)=>A.product*=e,rem:(A,e)=>A.product/=e},mean:{init:A=>A.mean=0,value:A=>A.valid?A.mean:void 0,add:(A,e)=>(A.mean_d=e-A.mean,A.mean+=A.mean_d/A.valid),rem:(A,e)=>(A.mean_d=e-A.mean,A.mean-=A.valid?A.mean_d/A.valid:A.mean)},average:{value:A=>A.valid?A.mean:void 0,req:["mean"],idx:1},variance:{init:A=>A.dev=0,value:A=>A.valid>1?A.dev/(A.valid-1):void 0,add:(A,e)=>A.dev+=A.mean_d*(e-A.mean),rem:(A,e)=>A.dev-=A.mean_d*(e-A.mean),req:["mean"],idx:1},variancep:{value:A=>A.valid>1?A.dev/A.valid:void 0,req:["variance"],idx:2},stdev:{value:A=>A.valid>1?Math.sqrt(A.dev/(A.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:A=>A.valid>1?Math.sqrt(A.dev/A.valid):void 0,req:["variance"],idx:2},stderr:{value:A=>A.valid>1?Math.sqrt(A.dev/(A.valid*(A.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:A=>A.cell.data.distinct(A.get),req:["values"],idx:3},ci0:{value:A=>A.cell.data.ci0(A.get),req:["values"],idx:3},ci1:{value:A=>A.cell.data.ci1(A.get),req:["values"],idx:3},median:{value:A=>A.cell.data.q2(A.get),req:["values"],idx:3},q1:{value:A=>A.cell.data.q1(A.get),req:["values"],idx:3},q3:{value:A=>A.cell.data.q3(A.get),req:["values"],idx:3},min:{init:A=>A.min=void 0,value:A=>A.min=Number.isNaN(A.min)?A.cell.data.min(A.get):A.min,add:(A,e)=>{(e<A.min||A.min===void 0)&&(A.min=e)},rem:(A,e)=>{e<=A.min&&(A.min=NaN)},req:["values"],idx:4},max:{init:A=>A.max=void 0,value:A=>A.max=Number.isNaN(A.max)?A.cell.data.max(A.get):A.max,add:(A,e)=>{(e>A.max||A.max===void 0)&&(A.max=e)},rem:(A,e)=>{e>=A.max&&(A.max=NaN)},req:["values"],idx:4},argmin:{init:A=>A.argmin=void 0,value:A=>A.argmin||A.cell.data.argmin(A.get),add:(A,e,t)=>{e<A.min&&(A.argmin=t)},rem:(A,e)=>{e<=A.min&&(A.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:A=>A.argmax=void 0,value:A=>A.argmax||A.cell.data.argmax(A.get),add:(A,e,t)=>{e>A.max&&(A.argmax=t)},rem:(A,e)=>{e>=A.max&&(A.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(A,e)=>{A.exp=0,A.exp_r=e},value:A=>A.valid?A.exp*(1-A.exp_r)/(1-A.exp_r**A.valid):void 0,add:(A,e)=>A.exp=A.exp_r*A.exp+e,rem:(A,e)=>A.exp=(A.exp-e/A.exp_r**(A.valid-1))/A.exp_r},exponentialb:{value:A=>A.valid?A.exp*(1-A.exp_r):void 0,req:["exponential"],idx:1}},jM=Object.keys(qM).filter(A=>A!=="__count__");function Ret(A,e){return(t,i)=>lt({name:A,aggregate_param:i,out:t||A},Yet,e)}[...jM,"__count__"].forEach(A=>{qM[A]=Ret(A,qM[A])});function lXA(A,e,t){return qM[A](t,e)}function cXA(A,e){return A.idx-e.idx}function xet(A){const e={};A.forEach(i=>e[i.name]=i);const t=i=>{i.req&&i.req.forEach(n=>{e[n]||t(e[n]=qM[n]())})};return A.forEach(t),Object.values(e).sort(cXA)}function Fet(){this.valid=0,this.missing=0,this._ops.forEach(A=>A.aggregate_param==null?A.init(this):A.init(this,A.aggregate_param))}function Met(A,e){if(A==null||A===""){++this.missing;return}A===A&&(++this.valid,this._ops.forEach(t=>t.add(this,A,e)))}function vet(A,e){if(A==null||A===""){--this.missing;return}A===A&&(--this.valid,this._ops.forEach(t=>t.rem(this,A,e)))}function Let(A){return this._out.forEach(e=>A[e.out]=e.value(this)),A}function BXA(A,e){const t=e||Ja,i=xet(A),n=A.slice().sort(cXA);function o(g){this._ops=i,this._out=n,this.cell=g,this.init()}return o.prototype.init=Fet,o.prototype.add=Met,o.prototype.rem=vet,o.prototype.set=Let,o.prototype.get=t,o.fields=A.map(g=>g.out),o}function GsA(A){this._key=A?Al(A):Ne,this.reset()}const ea=GsA.prototype;ea.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},ea.add=function(A){this._add.push(A)},ea.rem=function(A){this._rem.push(A)},ea.values=function(){if(this._get=null,this._rem.length===0)return this._add;const A=this._add,e=this._rem,t=this._key,i=A.length,n=e.length,o=Array(i-n),g={};let a,s,I;for(a=0;a<n;++a)g[t(e[a])]=1;for(a=0,s=0;a<i;++a)g[t(I=A[a])]?g[t(I)]=0:o[s++]=I;return this._rem=[],this._add=o},ea.distinct=function(A){const e=this.values(),t={};let i=e.length,n=0,o;for(;--i>=0;)o=A(e[i])+"",Je(t,o)||(t[o]=1,++n);return n},ea.extent=function(A){if(this._get!==A||!this._ext){const e=this.values(),t=WUA(e,A);this._ext=[e[t[0]],e[t[1]]],this._get=A}return this._ext},ea.argmin=function(A){return this.extent(A)[0]||{}},ea.argmax=function(A){return this.extent(A)[1]||{}},ea.min=function(A){const e=this.extent(A)[0];return e!=null?A(e):void 0},ea.max=function(A){const e=this.extent(A)[1];return e!=null?A(e):void 0},ea.quartile=function(A){return(this._get!==A||!this._q)&&(this._q=rsA(this.values(),A),this._get=A),this._q},ea.q1=function(A){return this.quartile(A)[0]},ea.q2=function(A){return this.quartile(A)[1]},ea.q3=function(A){return this.quartile(A)[2]},ea.ci=function(A){return(this._get!==A||!this._ci)&&(this._ci=PVA(this.values(),1e3,.05,A),this._get=A),this._ci},ea.ci0=function(A){return this.ci(A)[0]},ea.ci1=function(A){return this.ci(A)[1]};function Bp(A){DA.call(this,null,A),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Bp.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:jM},{name:"aggregate_params",type:"field",null:!0,array:!0,default:[null]},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},_A(Bp,DA,{transform(A,e){const t=this,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),n=A.modified();return t.stamp=i.stamp,t.value&&(n||e.modified(t._inputs,!0))?(t._prev=t.value,t.value=n?t.init(A):Object.create(null),e.visit(e.SOURCE,o=>t.add(o))):(t.value=t.value||t.init(A),e.visit(e.REM,o=>t.rem(o)),e.visit(e.ADD,o=>t.add(o))),i.modifies(t._outputs),t._drop=A.drop!==!1,A.cross&&t._dims.length>1&&(t._drop=!1,t.cross()),e.clean()&&t._drop&&i.clean(!0).runAfter(()=>this.clean()),t.changes(i)},cross(){const A=this,e=A.value,t=A._dnames,i=t.map(()=>({})),n=t.length;function o(a){let s,I,r,C;for(s in a)for(r=a[s].tuple,I=0;I<n;++I)i[I][C=r[t[I]]]=C}o(A._prev),o(e);function g(a,s,I){const r=t[I],C=i[I++];for(const l in C){const c=a?a+"|"+l:l;s[r]=C[l],I<n?g(c,s,I):e[c]||A.cell(c,s)}}g("",{},0)},init(A){const e=this._inputs=[],t=this._outputs=[],i={};function n(f){const w=te(ka(f)),y=w.length;let G=0,R;for(;G<y;++G)i[R=w[G]]||(i[R]=1,e.push(R))}this._dims=te(A.groupby),this._dnames=this._dims.map(f=>{const w=ro(f);return n(f),t.push(w),w}),this.cellkey=A.key?A.key:wsA(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=A.fields||[null],g=A.ops||["count"],a=A.aggregate_params||[null],s=A.as||[],I=o.length,r={};let C,l,c,B,E,u,d;for(I!==g.length&&YA("Unmatched number of fields and aggregate ops."),d=0;d<I;++d){if(C=o[d],l=g[d],c=a[d]||null,C==null&&l!=="count"&&YA("Null aggregate field specified."),E=ro(C),u=CXA(l,E,s[d]),t.push(u),l==="count"){this._counts.push(u);continue}B=r[E],B||(n(C),B=r[E]=[],B.field=C,this._measures.push(B)),l!=="count"&&(this._countOnly=!1),B.push(lXA(l,c,u))}return this._measures=this._measures.map(f=>BXA(f,f.field)),Object.create(null)},cellkey:wsA(),cell(A,e){let t=this.value[A];return t?t.num===0&&this._drop&&t.stamp<this.stamp?(t.stamp=this.stamp,this._adds[this._alen++]=t):t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t):(t=this.value[A]=this.newcell(A,e),this._adds[this._alen++]=t),t},newcell(A,e){const t={key:A,num:0,agg:null,tuple:this.newtuple(e,this._prev&&this._prev[A]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,n=i.length;t.agg=Array(n);for(let o=0;o<n;++o)t.agg[o]=new i[o](t)}return t.store&&(t.data=new GsA),t},newtuple(A,e){const t=this._dnames,i=this._dims,n=i.length,o={};for(let g=0;g<n;++g)o[t[g]]=i[g](A);return e?SVA(e.tuple,o):Ei(o)},clean(){const A=this.value;for(const e in A)A[e].num===0&&delete A[e]},add(A){const e=this.cellkey(A),t=this.cell(e,A);if(t.num+=1,this._countOnly)return;t.store&&t.data.add(A);const i=t.agg;for(let n=0,o=i.length;n<o;++n)i[n].add(i[n].get(A),A)},rem(A){const e=this.cellkey(A),t=this.cell(e,A);if(t.num-=1,this._countOnly)return;t.store&&t.data.rem(A);const i=t.agg;for(let n=0,o=i.length;n<o;++n)i[n].rem(i[n].get(A),A)},celltuple(A){const e=A.tuple,t=this._counts;A.store&&A.data.values();for(let i=0,n=t.length;i<n;++i)e[t[i]]=A.num;if(!this._countOnly){const i=A.agg;for(let n=0,o=i.length;n<o;++n)i[n].set(e)}return e},changes(A){const e=this._adds,t=this._mods,i=this._prev,n=this._drop,o=A.add,g=A.rem,a=A.mod;let s,I,r,C;if(i)for(I in i)s=i[I],(!n||s.num)&&g.push(s.tuple);for(r=0,C=this._alen;r<C;++r)o.push(this.celltuple(e[r])),e[r]=null;for(r=0,C=this._mlen;r<C;++r)s=t[r],(s.num===0&&n?g:a).push(this.celltuple(s)),t[r]=null;return this._alen=this._mlen=0,this._prev=null,A}});const Het=1e-14;function ksA(A){DA.call(this,null,A)}ksA.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},_A(ksA,DA,{transform(A,e){const t=A.interval!==!1,i=this._bins(A),n=i.start,o=i.step,g=A.as||["bin0","bin1"],a=g[0],s=g[1];let I;return A.modified()?(e=e.reflow(!0),I=e.SOURCE):I=e.modified(ka(A.field))?e.ADD_MOD:e.ADD,e.visit(I,t?r=>{const C=i(r);r[a]=C,r[s]=C==null?null:n+o*(1+(C-n)/o)}:r=>r[a]=i(r)),e.modifies(t?g:a)},_bins(A){if(this.value&&!A.modified())return this.value;const e=A.field,t=jVA(A),i=t.step;let n=t.start,o=n+Math.ceil((t.stop-n)/i)*i,g,a;(g=A.anchor)!=null&&(a=g-(n+i*Math.floor((g-n)/i)),n+=a,o+=a);const s=function(I){let r=Na(e(I));return r==null?null:r<n?-1/0:r>o?1/0:(r=Math.max(n,Math.min(r,o-i)),n+i*Math.floor(Het+(r-n)/i))};return s.start=n,s.stop=t.stop,s.step=i,this.value=gr(s,ka(e),A.name||"bin_"+ro(e))}});function QXA(A,e,t){const i=A;let n=e||[],o=t||[],g={},a=0;return{add:s=>o.push(s),remove:s=>g[i(s)]=++a,size:()=>n.length,data:(s,I)=>(a&&(n=n.filter(r=>!g[i(r)]),g={},a=0),I&&s&&n.sort(s),o.length&&(n=s?TUA(s,n,o.sort(s)):n.concat(o),o=[]),n)}}function JsA(A){DA.call(this,[],A)}JsA.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},_A(JsA,DA,{transform(A,e){const t=e.fork(e.ALL),i=QXA(Ne,this.value,t.materialize(t.ADD).add),n=A.sort,o=e.changed()||n&&(A.modified("sort")||e.modified(n.fields));return t.visit(t.REM,i.remove),this.modified(o),this.value=t.source=i.data(ab(n),o),e.source&&e.source.root&&(this.value.root=e.source.root),t}});function EXA(A){Oi.call(this,null,Zet,A)}_A(EXA,Oi);function Zet(A){return this.value&&!A.modified()?this.value:RaA(A.fields,A.orders)}function NsA(A){DA.call(this,null,A)}NsA.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function Wet(A,e,t){switch(e){case"upper":A=A.toUpperCase();break;case"lower":A=A.toLowerCase();break}return A.match(t)}_A(NsA,DA,{transform(A,e){const t=C=>l=>{for(var c=Wet(a(l),A.case,o)||[],B,E=0,u=c.length;E<u;++E)g.test(B=c[E])||C(B)},i=this._parameterCheck(A,e),n=this._counts,o=this._match,g=this._stop,a=A.field,s=A.as||["text","count"],I=t(C=>n[C]=1+(n[C]||0)),r=t(C=>n[C]-=1);return i?e.visit(e.SOURCE,I):(e.visit(e.ADD,I),e.visit(e.REM,r)),this._finish(e,s)},_parameterCheck(A,e){let t=!1;return(A.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(A.stopwords||"")+"$","i"),t=!0),(A.modified("pattern")||!this._match)&&(this._match=new RegExp(A.pattern||"[\\w']+","g"),t=!0),(A.modified("field")||e.modified(A.field.fields))&&(t=!0),t&&(this._counts={}),t},_finish(A,e){const t=this._counts,i=this._tuples||(this._tuples={}),n=e[0],o=e[1],g=A.fork(A.NO_SOURCE|A.NO_FIELDS);let a,s,I;for(a in t)s=i[a],I=t[a]||0,!s&&I?(i[a]=s=Ei({}),s[n]=a,s[o]=I,g.add.push(s)):I===0?(s&&g.rem.push(s),t[a]=null,i[a]=null):s[o]!==I&&(s[o]=I,g.mod.push(s));return g.modifies(e)}});function YsA(A){DA.call(this,null,A)}YsA.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},_A(YsA,DA,{transform(A,e){const t=e.fork(e.NO_SOURCE),i=A.as||["a","b"],n=i[0],o=i[1],g=!this.value||e.changed(e.ADD_REM)||A.modified("as")||A.modified("filter");let a=this.value;return g?(a&&(t.rem=a),a=e.materialize(e.SOURCE).source,t.add=this.value=Ket(a,n,o,A.filter||el)):t.mod=a,t.source=this.value,t.modifies(i)}});function Ket(A,e,t,i){for(var n=[],o={},g=A.length,a=0,s,I;a<g;++a)for(o[e]=I=A[a],s=0;s<g;++s)o[t]=A[s],i(o)&&(n.push(Ei(o)),o={},o[e]=I);return n}const uXA={kde:csA,mixture:tXA,normal:lsA,lognormal:eXA,uniform:iXA},Uet="distributions",dXA="function",Vet="field";function hXA(A,e){const t=A[dXA];Je(uXA,t)||YA("Unknown distribution function: "+t);const i=uXA[t]();for(const n in A)n===Vet?i.data((A.from||e()).map(A[n])):n===Uet?i[n](A[n].map(o=>hXA(o,e))):typeof i[n]===dXA&&i[n](A[n]);return i}function RsA(A){DA.call(this,null,A)}const mXA=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],Xet={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:mXA},{name:"weights",type:"number",array:!0}]};RsA.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:mXA.concat(Xet)},{name:"as",type:"string",array:!0,default:["value","density"]}]},_A(RsA,DA,{transform(A,e){const t=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||A.modified()){const i=hXA(A.distribution,zet(e)),n=A.steps||A.minsteps||25,o=A.steps||A.maxsteps||200;let g=A.method||"pdf";g!=="pdf"&&g!=="cdf"&&YA("Invalid density method: "+g),!A.extent&&!i.data&&YA("Missing density extent parameter."),g=i[g];const a=A.as||["value","density"],s=A.extent||mQ(i.data()),I=u5(g,s,n,o).map(r=>{const C={};return C[a[0]]=r[0],C[a[1]]=r[1],Ei(C)});this.value&&(t.rem=this.value),this.value=t.add=t.source=I}return t}});function zet(A){return()=>A.materialize(A.SOURCE).source}function pXA(A,e){return A?A.map((t,i)=>e[i]||ro(t)):null}function xsA(A,e,t){const i=[],n=C=>C(s);let o,g,a,s,I,r;if(e==null)i.push(A.map(t));else for(o={},g=0,a=A.length;g<a;++g)s=A[g],I=e.map(n),r=o[I],r||(o[I]=r=[],r.dims=I,i.push(r)),r.push(t(s));return i}const fXA="bin";function FsA(A){DA.call(this,null,A)}FsA.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:fXA}]};const Tet=(A,e)=>FM(mQ(A,e))/30;_A(FsA,DA,{transform(A,e){if(this.value&&!(A.modified()||e.changed()))return e;const t=e.materialize(e.SOURCE).source,i=xsA(e.source,A.groupby,Ja),n=A.smooth||!1,o=A.field,g=A.step||Tet(t,o),a=ab((B,E)=>o(B)-o(E)),s=A.as||fXA,I=i.length;let r=1/0,C=-1/0,l=0,c;for(;l<I;++l){const B=i[l].sort(a);c=-1;for(const E of $VA(B,g,n,o))E<r&&(r=E),E>C&&(C=E),B[++c][s]=E}return this.value={start:r,stop:C,step:g},e.reflow(!0).modifies(s)}});function yXA(A){Oi.call(this,null,_et,A),this.modified(!0)}_A(yXA,Oi);function _et(A){const e=A.expr;return this.value&&!A.modified("expr")?this.value:gr(t=>e(t,A),ka(e),ro(e))}function MsA(A){DA.call(this,[void 0,void 0],A)}MsA.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},_A(MsA,DA,{transform(A,e){const t=this.value,i=A.field,n=e.changed()||e.modified(i.fields)||A.modified("field");let o=t[0],g=t[1];if((n||o==null)&&(o=1/0,g=-1/0),e.visit(n?e.SOURCE:e.ADD,a=>{const s=Na(i(a));s!=null&&(s<o&&(o=s),s>g&&(g=s))}),!Number.isFinite(o)||!Number.isFinite(g)){let a=ro(i);a&&(a=` for field "${a}"`),e.dataflow.warn(`Infinite extent${a}: [${o}, ${g}]`),o=g=void 0}this.value=[o,g]}});function vsA(A,e){Oi.call(this,A),this.parent=e,this.count=0}_A(vsA,Oi,{connect(A){return this.detachSubflow=A.detachSubflow,this.targets().add(A),A.source=this},add(A){this.count+=1,this.value.add.push(A)},rem(A){this.count-=1,this.value.rem.push(A)},mod(A){this.value.mod.push(A)},init(A){this.value.init(A,A.NO_SOURCE)},evaluate(){return this.value}});function d5(A){DA.call(this,{},A),this._keys=uJ();const e=this._targets=[];e.active=0,e.forEach=t=>{for(let i=0,n=e.active;i<n;++i)t(e[i],i,e)}}_A(d5,DA,{activate(A){this._targets[this._targets.active++]=A},subflow(A,e,t,i){const n=this.value;let o=Je(n,A)&&n[A],g,a;return o?o.value.stamp<t.stamp&&(o.init(t),this.activate(o)):(a=i||(a=this._group[A])&&a.tuple,g=t.dataflow,o=new vsA(t.fork(t.NO_SOURCE),this),g.add(o).connect(e(g,A,a)),n[A]=o,this.activate(o)),o},clean(){const A=this.value;let e=0;for(const t in A)if(A[t].count===0){const i=A[t].detachSubflow;i&&i(),delete A[t],++e}if(e){const t=this._targets.filter(i=>i&&i.count>0);this.initTargets(t)}},initTargets(A){const e=this._targets,t=e.length,i=A?A.length:0;let n=0;for(;n<i;++n)e[n]=A[n];for(;n<t&&e[n]!=null;++n)e[n]=null;e.active=i},transform(A,e){const t=e.dataflow,i=A.key,n=A.subflow,o=this._keys,g=A.modified("key"),a=s=>this.subflow(s,n,e);return this._group=A.group||{},this.initTargets(),e.visit(e.REM,s=>{const I=Ne(s),r=o.get(I);r!==void 0&&(o.delete(I),a(r).rem(s))}),e.visit(e.ADD,s=>{const I=i(s);o.set(Ne(s),I),a(I).add(s)}),g||e.modified(i.fields)?e.visit(e.MOD,s=>{const I=Ne(s),r=o.get(I),C=i(s);r===C?a(C).mod(s):(o.set(I,C),a(r).rem(s),a(C).add(s))}):e.changed(e.MOD)&&e.visit(e.MOD,s=>{a(o.get(Ne(s))).mod(s)}),g&&e.visit(e.REFLOW,s=>{const I=Ne(s),r=o.get(I),C=i(s);r!==C&&(o.set(I,C),a(r).rem(s),a(C).add(s))}),e.clean()?t.runAfter(()=>{this.clean(),o.clean()}):o.empty>t.cleanThreshold&&t.runAfter(o.clean),e}});function bXA(A){Oi.call(this,null,Oet,A)}_A(bXA,Oi);function Oet(A){return this.value&&!A.modified()?this.value:RA(A.name)?te(A.name).map(e=>Al(e)):Al(A.name,A.as)}function LsA(A){DA.call(this,uJ(),A)}LsA.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},_A(LsA,DA,{transform(A,e){const t=e.dataflow,i=this.value,n=e.fork(),o=n.add,g=n.rem,a=n.mod,s=A.expr;let I=!0;e.visit(e.REM,C=>{const l=Ne(C);i.has(l)?i.delete(l):g.push(C)}),e.visit(e.ADD,C=>{s(C,A)?o.push(C):i.set(Ne(C),1)});function r(C){const l=Ne(C),c=s(C,A),B=i.get(l);c&&B?(i.delete(l),o.push(C)):!c&&!B?(i.set(l,1),g.push(C)):I&&c&&!B&&a.push(C)}return e.visit(e.MOD,r),A.modified()&&(I=!1,e.visit(e.REFLOW,r)),i.empty>t.cleanThreshold&&t.runAfter(i.clean),n}});function SsA(A){DA.call(this,[],A)}SsA.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},_A(SsA,DA,{transform(A,e){const t=e.fork(e.NO_SOURCE),i=A.fields,n=pXA(i,A.as||[]),o=A.index||null,g=n.length;return t.rem=this.value,e.visit(e.SOURCE,a=>{const s=i.map(B=>B(a)),I=s.reduce((B,E)=>Math.max(B,E.length),0);let r=0,C,l,c;for(;r<I;++r){for(l=nsA(a),C=0;C<g;++C)l[n[C]]=(c=s[C][r])==null?null:c;o&&(l[o]=r),t.add.push(l)}}),this.value=t.source=t.add,o&&t.modifies(o),t.modifies(n)}});function HsA(A){DA.call(this,[],A)}HsA.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},_A(HsA,DA,{transform(A,e){const t=e.fork(e.NO_SOURCE),i=A.fields,n=i.map(ro),o=A.as||["key","value"],g=o[0],a=o[1],s=i.length;return t.rem=this.value,e.visit(e.SOURCE,I=>{for(let r=0,C;r<s;++r)C=nsA(I),C[g]=n[r],C[a]=i[r](I),t.add.push(C)}),this.value=t.source=t.add,t.modifies(o)}});function ZsA(A){DA.call(this,null,A)}ZsA.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},_A(ZsA,DA,{transform(A,e){const t=A.expr,i=A.as,n=A.modified(),o=A.initonly?e.ADD:n?e.SOURCE:e.modified(t.fields)||e.modified(i)?e.ADD_MOD:e.ADD;return n&&(e=e.materialize().reflow(!0)),A.initonly||e.modifies(i),e.visit(o,g=>g[i]=t(g,A))}});function wXA(A){DA.call(this,[],A)}_A(wXA,DA,{transform(A,e){const t=e.fork(e.ALL),i=A.generator;let n=this.value,o=A.size-n.length,g,a,s;if(o>0){for(g=[];--o>=0;)g.push(s=Ei(i(A))),n.push(s);t.add=t.add.length?t.materialize(t.ADD).add.concat(g):g}else a=n.slice(0,-o),t.rem=t.rem.length?t.materialize(t.REM).rem.concat(a):a,n=n.slice(-o);return t.source=this.value=n,t}});const h5={value:"value",median:hM,mean:b3A,min:dc,max:Pg},qet=[];function WsA(A){DA.call(this,[],A)}WsA.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function jet(A){var e=A.method||h5.value,t;if(h5[e]==null)YA("Unrecognized imputation method: "+e);else return e===h5.value?(t=A.value!==void 0?A.value:0,()=>t):h5[e]}function Pet(A){const e=A.field;return t=>t?e(t):NaN}_A(WsA,DA,{transform(A,e){var t=e.fork(e.ALL),i=jet(A),n=Pet(A),o=ro(A.field),g=ro(A.key),a=(A.groupby||[]).map(ro),s=$et(e.source,A.groupby,A.key,A.keyvals),I=[],r=this.value,C=s.domain.length,l,c,B,E,u,d,f,w,y,G;for(u=0,w=s.length;u<w;++u)for(l=s[u],B=l.values,c=NaN,f=0;f<C;++f)if(l[f]==null){for(E=s.domain[f],G={_impute:!0},d=0,y=B.length;d<y;++d)G[a[d]]=B[d];G[g]=E,G[o]=Number.isNaN(c)?c=i(l,n):c,I.push(Ei(G))}return I.length&&(t.add=t.materialize(t.ADD).add.concat(I)),r.length&&(t.rem=t.materialize(t.REM).rem.concat(r)),this.value=I,t}});function $et(A,e,t,i){var n=d=>d(u),o=[],g=i?i.slice():[],a={},s={},I,r,C,l,c,B,E,u;for(g.forEach((d,f)=>a[d]=f+1),l=0,E=A.length;l<E;++l)u=A[l],B=t(u),c=a[B]||(a[B]=g.push(B)),r=(I=e?e.map(n):qet)+"",(C=s[r])||(C=s[r]=[],o.push(C),C.values=I),C[c-1]=u;return o.domain=g,o}function KsA(A){Bp.call(this,A)}KsA.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:jM},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},_A(KsA,Bp,{transform(A,e){const t=this,i=A.modified();let n;return t.value&&(i||e.modified(t._inputs,!0))?(n=t.value=i?t.init(A):{},e.visit(e.SOURCE,o=>t.add(o))):(n=t.value=t.value||this.init(A),e.visit(e.REM,o=>t.rem(o)),e.visit(e.ADD,o=>t.add(o))),t.changes(),e.visit(e.SOURCE,o=>{lt(o,n[t.cellkey(o)].tuple)}),e.reflow(i).modifies(this._outputs)},changes(){const A=this._adds,e=this._mods;let t,i;for(t=0,i=this._alen;t<i;++t)this.celltuple(A[t]),A[t]=null;for(t=0,i=this._mlen;t<i;++t)this.celltuple(e[t]),e[t]=null;this._alen=this._mlen=0}});function UsA(A){DA.call(this,null,A)}UsA.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},_A(UsA,DA,{transform(A,e){const t=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||A.modified()){const i=e.materialize(e.SOURCE).source,n=xsA(i,A.groupby,A.field),o=(A.groupby||[]).map(ro),g=A.bandwidth,a=A.cumulative?"cdf":"pdf",s=A.as||["value","density"],I=[];let r=A.extent,C=A.steps||A.minsteps||25,l=A.steps||A.maxsteps||200;a!=="pdf"&&a!=="cdf"&&YA("Invalid density method: "+a),A.resolve==="shared"&&(r||(r=mQ(i,A.field)),C=l=A.steps||l),n.forEach(c=>{const B=csA(c,g)[a],E=A.counts?c.length:1,u=r||mQ(c);u5(B,u,C,l).forEach(d=>{const f={};for(let w=0;w<o.length;++w)f[o[w]]=c.dims[w];f[s[0]]=d[0],f[s[1]]=d[1]*E,I.push(Ei(f))})}),this.value&&(t.rem=this.value),this.value=t.add=t.source=I}return t}});function DXA(A){Oi.call(this,null,Att,A)}_A(DXA,Oi);function Att(A){return this.value&&!A.modified()?this.value:FaA(A.fields,A.flat)}function GXA(A){DA.call(this,[],A),this._pending=null}_A(GXA,DA,{transform(A,e){const t=e.dataflow;return this._pending?VsA(this,e,this._pending):ett(A)?e.StopPropagation:A.values?VsA(this,e,t.parse(A.values,A.format)):A.async?{async:t.request(A.url,A.format).then(i=>(this._pending=te(i.data),n=>n.touch(this)))}:t.request(A.url,A.format).then(i=>VsA(this,e,te(i.data)))}});function ett(A){return A.modified("async")&&!(A.modified("values")||A.modified("url")||A.modified("format"))}function VsA(A,e,t){t.forEach(Ei);const i=e.fork(e.NO_FIELDS&e.NO_SOURCE);return i.rem=A.value,A.value=i.source=i.add=t,A._pending=null,i.rem.length&&i.clean(!0),i}function XsA(A){DA.call(this,{},A)}XsA.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},_A(XsA,DA,{transform(A,e){const t=A.fields,i=A.index,n=A.values,o=A.default==null?null:A.default,g=A.modified(),a=t.length;let s=g?e.SOURCE:e.ADD,I=e,r=A.as,C,l,c;return n?(l=n.length,a>1&&!r&&YA('Multi-field lookup requires explicit "as" parameter.'),r&&r.length!==a*l&&YA('The "as" parameter has too few output field names.'),r=r||n.map(ro),C=function(B){for(var E=0,u=0,d,f;E<a;++E)if(f=i.get(t[E](B)),f==null)for(d=0;d<l;++d,++u)B[r[u]]=o;else for(d=0;d<l;++d,++u)B[r[u]]=n[d](f)}):(r||YA("Missing output field names."),C=function(B){for(var E=0,u;E<a;++E)u=i.get(t[E](B)),B[r[E]]=u??o}),g?I=e.reflow(!0):(c=t.some(B=>e.modified(B.fields)),s|=c?e.MOD:0),e.visit(s,C),I.modifies(r)}});function kXA(A){Oi.call(this,null,ttt,A)}_A(kXA,Oi);function ttt(A){if(this.value&&!A.modified())return this.value;const e=A.extents,t=e.length;let i=1/0,n=-1/0,o,g;for(o=0;o<t;++o)g=e[o],g[0]<i&&(i=g[0]),g[1]>n&&(n=g[1]);return[i,n]}function JXA(A){Oi.call(this,null,itt,A)}_A(JXA,Oi);function itt(A){return this.value&&!A.modified()?this.value:A.values.reduce((e,t)=>e.concat(t),[])}function NXA(A){DA.call(this,null,A)}_A(NXA,DA,{transform(A,e){return this.modified(A.modified()),this.value=A,e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function zsA(A){Bp.call(this,A)}zsA.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:jM,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},_A(zsA,Bp,{_transform:Bp.prototype.transform,transform(A,e){return this._transform(ntt(A,e),e)}});function ntt(A,e){const t=A.field,i=A.value,n=(A.op==="count"?"__count__":A.op)||"sum",o=ka(t).concat(ka(i)),g=gtt(t,A.limit||0,e);return e.changed()&&A.set("__pivot__",null,null,!0),{key:A.key,groupby:A.groupby,ops:g.map(()=>n),fields:g.map(a=>ott(a,t,i,o)),as:g.map(a=>a+""),modified:A.modified.bind(A)}}function ott(A,e,t,i){return gr(n=>e(n)===A?t(n):NaN,i,A+"")}function gtt(A,e,t){const i={},n=[];return t.visit(t.SOURCE,o=>{const g=A(o);i[g]||(i[g]=1,n.push(g))}),n.sort(j9),e?n.slice(0,e):n}function YXA(A){d5.call(this,A)}_A(YXA,d5,{transform(A,e){const t=A.subflow,i=A.field,n=o=>this.subflow(Ne(o),t,e,o);return(A.modified("field")||i&&e.modified(ka(i)))&&YA("PreFacet does not support field modification."),this.initTargets(),i?(e.visit(e.MOD,o=>{const g=n(o);i(o).forEach(a=>g.mod(a))}),e.visit(e.ADD,o=>{const g=n(o);i(o).forEach(a=>g.add(Ei(a)))}),e.visit(e.REM,o=>{const g=n(o);i(o).forEach(a=>g.rem(a))})):(e.visit(e.MOD,o=>n(o).mod(o)),e.visit(e.ADD,o=>n(o).add(o)),e.visit(e.REM,o=>n(o).rem(o))),e.clean()&&e.runAfter(()=>this.clean()),e}});function TsA(A){DA.call(this,null,A)}TsA.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},_A(TsA,DA,{transform(A,e){const t=e.fork(e.NO_SOURCE),i=A.fields,n=pXA(A.fields,A.as||[]),o=i?(a,s)=>att(a,s,i,n):a5;let g;return this.value?g=this.value:(e=e.addAll(),g=this.value={}),e.visit(e.REM,a=>{const s=Ne(a);t.rem.push(g[s]),g[s]=null}),e.visit(e.ADD,a=>{const s=o(a,Ei({}));g[Ne(a)]=s,t.add.push(s)}),e.visit(e.MOD,a=>{t.mod.push(o(a,g[Ne(a)]))}),t}});function att(A,e,t,i){for(let n=0,o=t.length;n<o;++n)e[i[n]]=t[n](A);return e}function RXA(A){DA.call(this,null,A)}_A(RXA,DA,{transform(A,e){return this.value=A.value,A.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});function _sA(A){DA.call(this,null,A)}_sA.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};const stt=1e-14;_A(_sA,DA,{transform(A,e){const t=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=A.as||["prob","value"];if(this.value&&!A.modified()&&!e.changed())return t.source=this.value,t;const n=e.materialize(e.SOURCE).source,o=xsA(n,A.groupby,A.field),g=(A.groupby||[]).map(ro),a=[],s=A.step||.01,I=A.probs||Ga(s/2,1-stt,s),r=I.length;return o.forEach(C=>{const l=ssA(C,I);for(let c=0;c<r;++c){const B={};for(let E=0;E<g.length;++E)B[g[E]]=C.dims[E];B[i[0]]=I[c],B[i[1]]=l[c],a.push(Ei(B))}}),this.value&&(t.rem=this.value),this.value=t.add=t.source=a,t}});function xXA(A){DA.call(this,null,A)}_A(xXA,DA,{transform(A,e){let t,i;return this.value?i=this.value:(t=e=e.addAll(),i=this.value={}),A.derive&&(t=e.fork(e.NO_SOURCE),e.visit(e.REM,n=>{const o=Ne(n);t.rem.push(i[o]),i[o]=null}),e.visit(e.ADD,n=>{const o=nsA(n);i[Ne(n)]=o,t.add.push(o)}),e.visit(e.MOD,n=>{const o=i[Ne(n)];for(const g in n)o[g]=n[g],t.modifies(g);t.mod.push(o)})),t}});function OsA(A){DA.call(this,[],A),this.count=0}OsA.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},_A(OsA,DA,{transform(A,e){const t=e.fork(e.NO_SOURCE),i=A.modified("size"),n=A.size,o=this.value.reduce((r,C)=>(r[Ne(C)]=1,r),{});let g=this.value,a=this.count,s=0;function I(r){let C,l;g.length<n?g.push(r):(l=~~((a+1)*il()),l<g.length&&l>=s&&(C=g[l],o[Ne(C)]&&t.rem.push(C),g[l]=r)),++a}if(e.rem.length&&(e.visit(e.REM,r=>{const C=Ne(r);o[C]&&(o[C]=-1,t.rem.push(r)),--a}),g=g.filter(r=>o[Ne(r)]!==-1)),(e.rem.length||i)&&g.length<n&&e.source&&(s=a=g.length,e.visit(e.SOURCE,r=>{o[Ne(r)]||I(r)}),s=-1),i&&g.length>n){const r=g.length-n;for(let C=0;C<r;++C)o[Ne(g[C])]=-1,t.rem.push(g[C]);g=g.slice(r)}return e.mod.length&&e.visit(e.MOD,r=>{o[Ne(r)]&&t.mod.push(r)}),e.add.length&&e.visit(e.ADD,I),(e.add.length||s<0)&&(t.add=g.filter(r=>!o[Ne(r)])),this.count=a,this.value=t.source=g,t}});function qsA(A){DA.call(this,null,A)}qsA.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},_A(qsA,DA,{transform(A,e){if(this.value&&!A.modified())return;const t=e.materialize().fork(e.MOD),i=A.as||"data";return t.rem=this.value?e.rem.concat(this.value):e.rem,this.value=Ga(A.start,A.stop,A.step||1).map(n=>{const o={};return o[i]=n,Ei(o)}),t.add=e.add.concat(this.value),t}});function FXA(A){DA.call(this,null,A),this.modified(!0)}_A(FXA,DA,{transform(A,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});function jsA(A){DA.call(this,null,A)}const MXA=["unit0","unit1"];jsA.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:WaA,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:MXA}]},_A(jsA,DA,{transform(A,e){const t=A.field,i=A.interval!==!1,n=A.timezone==="utc",o=this._floor(A,e),g=(n?pJ:mJ)(o.unit).offset,a=A.as||MXA,s=a[0],I=a[1],r=o.step;let C=o.start||1/0,l=o.stop||-1/0,c=e.ADD;return(A.modified()||e.changed(e.REM)||e.modified(ka(t)))&&(e=e.reflow(!0),c=e.SOURCE,C=1/0,l=-1/0),e.visit(c,B=>{const E=t(B);let u,d;E==null?(B[s]=null,i&&(B[I]=null)):(B[s]=u=d=o(E),i&&(B[I]=d=g(u,r)),u<C&&(C=u),d>l&&(l=d))}),o.start=C,o.stop=l,e.modifies(i?a:s)},_floor(A,e){const t=A.timezone==="utc",{units:i,step:n}=A.units?{units:A.units,step:A.step||1}:hVA({extent:A.extent||mQ(e.materialize(e.SOURCE).source,A.field),maxbins:A.maxbins}),o=UaA(i),g=this.value||{},a=(t?sVA:aVA)(o,n);return a.unit=Ut(o),a.units=o,a.step=n,a.start=g.start,a.stop=g.stop,this.value=a}});function vXA(A){DA.call(this,uJ(),A)}_A(vXA,DA,{transform(A,e){const t=e.dataflow,i=A.field,n=this.value,o=a=>n.set(i(a),a);let g=!0;return A.modified("field")||e.modified(i.fields)?(n.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,a=>n.delete(i(a))),e.visit(e.ADD,o)):g=!1,this.modified(g),n.empty>t.cleanThreshold&&t.runAfter(n.clean),e.fork()}});function LXA(A){DA.call(this,null,A)}_A(LXA,DA,{transform(A,e){(!this.value||A.modified("field")||A.modified("sort")||e.changed()||A.sort&&e.modified(A.sort.fields))&&(this.value=(A.sort?e.source.slice().sort(ab(A.sort)):e.source).map(A.field))}});function rtt(A,e,t,i){const n=PM[A](e,t);return{init:n.init||gp,update:function(o,g){g[i]=n.next(o)}}}const PM={row_number:function(){return{next:A=>A.index+1}},rank:function(){let A;return{init:()=>A=1,next:e=>{const t=e.index,i=e.data;return t&&e.compare(i[t-1],i[t])?A=t+1:A}}},dense_rank:function(){let A;return{init:()=>A=1,next:e=>{const t=e.index,i=e.data;return t&&e.compare(i[t-1],i[t])?++A:A}}},percent_rank:function(){const A=PM.rank(),e=A.next;return{init:A.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let A;return{init:()=>A=0,next:e=>{const t=e.data,i=e.compare;let n=e.index;if(A<n){for(;n+1<t.length&&!i(t[n],t[n+1]);)++n;A=n}return(1+A)/t.length}}},ntile:function(A,e){e=+e,e>0||YA("ntile num must be greater than zero.");const t=PM.cume_dist(),i=t.next;return{init:t.init,next:n=>Math.ceil(e*i(n))}},lag:function(A,e){return e=+e||1,{next:t=>{const i=t.index-e;return i>=0?A(t.data[i]):null}}},lead:function(A,e){return e=+e||1,{next:t=>{const i=t.index+e,n=t.data;return i<n.length?A(n[i]):null}}},first_value:function(A){return{next:e=>A(e.data[e.i0])}},last_value:function(A){return{next:e=>A(e.data[e.i1-1])}},nth_value:function(A,e){return e=+e,e>0||YA("nth_value nth must be greater than zero."),{next:t=>{const i=t.i0+(e-1);return i<t.i1?A(t.data[i]):null}}},prev_value:function(A){let e;return{init:()=>e=null,next:t=>{const i=A(t.data[t.index]);return i!=null?e=i:e}}},next_value:function(A){let e,t;return{init:()=>(e=null,t=-1),next:i=>{const n=i.data;return i.index<=t?e:(t=Itt(A,n,i.index))<0?(t=n.length,e=null):e=A(n[t])}}}};function Itt(A,e,t){for(let i=e.length;t<i;++t)if(A(e[t])!=null)return t;return-1}const Ctt=Object.keys(PM);function SXA(A){const e=te(A.ops),t=te(A.fields),i=te(A.params),n=te(A.aggregate_params),o=te(A.as),g=this.outputs=[],a=this.windows=[],s={},I={},r=[],C=[];let l=!0;function c(B){te(ka(B)).forEach(E=>s[E]=1)}c(A.sort),e.forEach((B,E)=>{const u=t[E],d=i[E],f=n[E]||null,w=ro(u),y=CXA(B,w,o[E]);if(c(u),g.push(y),Je(PM,B))a.push(rtt(B,u,d,y));else{if(u==null&&B!=="count"&&YA("Null aggregate field specified."),B==="count"){r.push(y);return}l=!1;let G=I[w];G||(G=I[w]=[],G.field=u,C.push(G)),G.push(lXA(B,f,y))}}),(r.length||C.length)&&(this.cell=ltt(C,r,l)),this.inputs=Object.keys(s)}const HXA=SXA.prototype;HXA.init=function(){this.windows.forEach(A=>A.init()),this.cell&&this.cell.init()},HXA.update=function(A,e){const t=this.cell,i=this.windows,n=A.data,o=i&&i.length;let g;if(t){for(g=A.p0;g<A.i0;++g)t.rem(n[g]);for(g=A.p1;g<A.i1;++g)t.add(n[g]);t.set(e)}for(g=0;g<o;++g)i[g].update(A,e)};function ltt(A,e,t){A=A.map(s=>BXA(s,s.field));const i={num:0,agg:null,store:!1,count:e};if(!t)for(var n=A.length,o=i.agg=Array(n),g=0;g<n;++g)o[g]=new A[g](i);if(i.store)var a=i.data=new GsA;return i.add=function(s){if(i.num+=1,!t){a&&a.add(s);for(let I=0;I<n;++I)o[I].add(o[I].get(s),s)}},i.rem=function(s){if(i.num-=1,!t){a&&a.rem(s);for(let I=0;I<n;++I)o[I].rem(o[I].get(s),s)}},i.set=function(s){let I,r;for(a&&a.values(),I=0,r=e.length;I<r;++I)s[e[I]]=i.num;if(!t)for(I=0,r=o.length;I<r;++I)o[I].set(s)},i.init=function(){i.num=0,a&&a.reset();for(let s=0;s<n;++s)o[s].init()},i}function PsA(A){DA.call(this,{},A),this._mlen=0,this._mods=[]}PsA.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Ctt.concat(jM)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"field",null:!0,array:!0,default:[null]},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]},_A(PsA,DA,{transform(A,e){this.stamp=e.stamp;const t=A.modified(),i=ab(A.sort),n=wsA(A.groupby),o=a=>this.group(n(a));let g=this.state;(!g||t)&&(g=this.state=new SXA(A)),t||e.modified(g.inputs)?(this.value={},e.visit(e.SOURCE,a=>o(a).add(a))):(e.visit(e.REM,a=>o(a).remove(a)),e.visit(e.ADD,a=>o(a).add(a)));for(let a=0,s=this._mlen;a<s;++a)ctt(this._mods[a],g,i,A);return this._mlen=0,this._mods=[],e.reflow(t).modifies(g.outputs)},group(A){let e=this.value[A];return e||(e=this.value[A]=QXA(Ne),e.stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e}});function ctt(A,e,t,i){const n=i.sort,o=n&&!i.ignorePeers,g=i.frame||[null,0],a=A.data(t),s=a.length,I=o?Vy(n):null,r={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:n||Ya(-1)};e.init();for(let C=0;C<s;++C)Btt(r,g,C,s),o&&Qtt(r,I),e.update(r,a[C])}function Btt(A,e,t,i){A.p0=A.i0,A.p1=A.i1,A.i0=e[0]==null?0:Math.max(0,t-Math.abs(e[0])),A.i1=e[1]==null?i:Math.min(i,t+Math.abs(e[1])+1),A.index=t}function Qtt(A,e){const t=A.i0,i=A.i1-1,n=A.compare,o=A.data,g=o.length-1;t>0&&!n(o[t],o[t-1])&&(A.i0=e.left(o,o[t])),i<g&&!n(o[i],o[i+1])&&(A.i1=e.right(o,o[i]))}const Ett=Object.freeze(Object.defineProperty({__proto__:null,aggregate:Bp,bin:ksA,collect:JsA,compare:EXA,countpattern:NsA,cross:YsA,density:RsA,dotbin:FsA,expression:yXA,extent:MsA,facet:d5,field:bXA,filter:LsA,flatten:SsA,fold:HsA,formula:ZsA,generate:wXA,impute:WsA,joinaggregate:KsA,kde:UsA,key:DXA,load:GXA,lookup:XsA,multiextent:kXA,multivalues:JXA,params:NXA,pivot:zsA,prefacet:YXA,project:TsA,proxy:RXA,quantile:_sA,relay:xXA,sample:OsA,sequence:qsA,sieve:FXA,subflow:vsA,timeunit:jsA,tupleindex:vXA,values:LXA,window:PsA},Symbol.toStringTag,{value:"Module"}));function Fi(A){return function(){return A}}const ZXA=Math.abs,Fa=Math.atan2,nd=Math.cos,utt=Math.max,DJ=Math.min,Ir=Math.sin,bn=Math.sqrt,Ma=1e-12,Qp=Math.PI,m5=Qp/2,$M=2*Qp;function dtt(A){return A>1?0:A<-1?Qp:Math.acos(A)}function WXA(A){return A>=1?m5:A<=-1?-m5:Math.asin(A)}const $sA=Math.PI,ArA=2*$sA,rb=1e-6,htt=ArA-rb;function KXA(A){this._+=A[0];for(let e=1,t=A.length;e<t;++e)this._+=arguments[e]+A[e]}function mtt(A){let e=Math.floor(A);if(!(e>=0))throw new Error(`invalid digits: ${A}`);if(e>15)return KXA;const t=10**e;return function(i){this._+=i[0];for(let n=1,o=i.length;n<o;++n)this._+=Math.round(arguments[n]*t)/t+i[n]}}let p5=class{constructor(A){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=A==null?KXA:mtt(A)}moveTo(A,e){this._append`M${this._x0=this._x1=+A},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(A,e){this._append`L${this._x1=+A},${this._y1=+e}`}quadraticCurveTo(A,e,t,i){this._append`Q${+A},${+e},${this._x1=+t},${this._y1=+i}`}bezierCurveTo(A,e,t,i,n,o){this._append`C${+A},${+e},${+t},${+i},${this._x1=+n},${this._y1=+o}`}arcTo(A,e,t,i,n){if(A=+A,e=+e,t=+t,i=+i,n=+n,n<0)throw new Error(`negative radius: ${n}`);let o=this._x1,g=this._y1,a=t-A,s=i-e,I=o-A,r=g-e,C=I*I+r*r;if(this._x1===null)this._append`M${this._x1=A},${this._y1=e}`;else if(C>rb)if(!(Math.abs(r*a-s*I)>rb)||!n)this._append`L${this._x1=A},${this._y1=e}`;else{let l=t-o,c=i-g,B=a*a+s*s,E=l*l+c*c,u=Math.sqrt(B),d=Math.sqrt(C),f=n*Math.tan(($sA-Math.acos((B+C-E)/(2*u*d)))/2),w=f/d,y=f/u;Math.abs(w-1)>rb&&this._append`L${A+w*I},${e+w*r}`,this._append`A${n},${n},0,0,${+(r*l>I*c)},${this._x1=A+y*a},${this._y1=e+y*s}`}}arc(A,e,t,i,n,o){if(A=+A,e=+e,t=+t,o=!!o,t<0)throw new Error(`negative radius: ${t}`);let g=t*Math.cos(i),a=t*Math.sin(i),s=A+g,I=e+a,r=1^o,C=o?i-n:n-i;this._x1===null?this._append`M${s},${I}`:(Math.abs(this._x1-s)>rb||Math.abs(this._y1-I)>rb)&&this._append`L${s},${I}`,t&&(C<0&&(C=C%ArA+ArA),C>htt?this._append`A${t},${t},0,1,${r},${A-g},${e-a}A${t},${t},0,1,${r},${this._x1=s},${this._y1=I}`:C>rb&&this._append`A${t},${t},0,${+(C>=$sA)},${r},${this._x1=A+t*Math.cos(n)},${this._y1=e+t*Math.sin(n)}`)}rect(A,e,t,i){this._append`M${this._x0=this._x1=+A},${this._y0=this._y1=+e}h${t=+t}v${+i}h${-t}Z`}toString(){return this._}};function f5(){return new p5}f5.prototype=p5.prototype;function Ib(A=3){return new p5(+A)}function y5(A){let e=3;return A.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const i=Math.floor(t);if(!(i>=0))throw new RangeError(`invalid digits: ${t}`);e=i}return A},()=>new p5(e)}function ptt(A){return A.innerRadius}function ftt(A){return A.outerRadius}function ytt(A){return A.startAngle}function btt(A){return A.endAngle}function wtt(A){return A&&A.padAngle}function Dtt(A,e,t,i,n,o,g,a){var s=t-A,I=i-e,r=g-n,C=a-o,l=C*s-r*I;if(!(l*l<Ma))return l=(r*(e-o)-C*(A-n))/l,[A+l*s,e+l*I]}function b5(A,e,t,i,n,o,g){var a=A-t,s=e-i,I=(g?o:-o)/bn(a*a+s*s),r=I*s,C=-I*a,l=A+r,c=e+C,B=t+r,E=i+C,u=(l+B)/2,d=(c+E)/2,f=B-l,w=E-c,y=f*f+w*w,G=n-o,R=l*E-B*c,x=(w<0?-1:1)*bn(utt(0,G*G*y-R*R)),F=(R*w-f*x)/y,Q=(-R*f-w*x)/y,k=(R*w+f*x)/y,h=(-R*f+w*x)/y,N=F-u,v=Q-d,K=k-u,U=h-d;return N*N+v*v>K*K+U*U&&(F=k,Q=h),{cx:F,cy:Q,x01:-r,y01:-C,x11:F*(n/G-1),y11:Q*(n/G-1)}}function UXA(){var A=ptt,e=ftt,t=Fi(0),i=null,n=ytt,o=btt,g=wtt,a=null,s=y5(I);function I(){var r,C,l=+A.apply(this,arguments),c=+e.apply(this,arguments),B=n.apply(this,arguments)-m5,E=o.apply(this,arguments)-m5,u=ZXA(E-B),d=E>B;if(a||(a=r=s()),c<l&&(C=c,c=l,l=C),!(c>Ma))a.moveTo(0,0);else if(u>$M-Ma)a.moveTo(c*nd(B),c*Ir(B)),a.arc(0,0,c,B,E,!d),l>Ma&&(a.moveTo(l*nd(E),l*Ir(E)),a.arc(0,0,l,E,B,d));else{var f=B,w=E,y=B,G=E,R=u,x=u,F=g.apply(this,arguments)/2,Q=F>Ma&&(i?+i.apply(this,arguments):bn(l*l+c*c)),k=DJ(ZXA(c-l)/2,+t.apply(this,arguments)),h=k,N=k,v,K;if(Q>Ma){var U=WXA(Q/l*Ir(F)),V=WXA(Q/c*Ir(F));(R-=U*2)>Ma?(U*=d?1:-1,y+=U,G-=U):(R=0,y=G=(B+E)/2),(x-=V*2)>Ma?(V*=d?1:-1,f+=V,w-=V):(x=0,f=w=(B+E)/2)}var X=c*nd(f),_=c*Ir(f),q=l*nd(G),$=l*Ir(G);if(k>Ma){var nA=c*nd(w),j=c*Ir(w),O=l*nd(y),eA=l*Ir(y),oA;if(u<Qp)if(oA=Dtt(X,_,O,eA,nA,j,q,$)){var tA=X-oA[0],sA=_-oA[1],gA=nA-oA[0],iA=j-oA[1],aA=1/Ir(dtt((tA*gA+sA*iA)/(bn(tA*tA+sA*sA)*bn(gA*gA+iA*iA)))/2),lA=bn(oA[0]*oA[0]+oA[1]*oA[1]);h=DJ(k,(l-lA)/(aA-1)),N=DJ(k,(c-lA)/(aA+1))}else h=N=0}x>Ma?N>Ma?(v=b5(O,eA,X,_,c,N,d),K=b5(nA,j,q,$,c,N,d),a.moveTo(v.cx+v.x01,v.cy+v.y01),N<k?a.arc(v.cx,v.cy,N,Fa(v.y01,v.x01),Fa(K.y01,K.x01),!d):(a.arc(v.cx,v.cy,N,Fa(v.y01,v.x01),Fa(v.y11,v.x11),!d),a.arc(0,0,c,Fa(v.cy+v.y11,v.cx+v.x11),Fa(K.cy+K.y11,K.cx+K.x11),!d),a.arc(K.cx,K.cy,N,Fa(K.y11,K.x11),Fa(K.y01,K.x01),!d))):(a.moveTo(X,_),a.arc(0,0,c,f,w,!d)):a.moveTo(X,_),!(l>Ma)||!(R>Ma)?a.lineTo(q,$):h>Ma?(v=b5(q,$,nA,j,l,-h,d),K=b5(X,_,O,eA,l,-h,d),a.lineTo(v.cx+v.x01,v.cy+v.y01),h<k?a.arc(v.cx,v.cy,h,Fa(v.y01,v.x01),Fa(K.y01,K.x01),!d):(a.arc(v.cx,v.cy,h,Fa(v.y01,v.x01),Fa(v.y11,v.x11),!d),a.arc(0,0,l,Fa(v.cy+v.y11,v.cx+v.x11),Fa(K.cy+K.y11,K.cx+K.x11),d),a.arc(K.cx,K.cy,h,Fa(K.y11,K.x11),Fa(K.y01,K.x01),!d))):a.arc(0,0,l,G,y,d)}if(a.closePath(),r)return a=null,r+""||null}return I.centroid=function(){var r=(+A.apply(this,arguments)+ +e.apply(this,arguments))/2,C=(+n.apply(this,arguments)+ +o.apply(this,arguments))/2-Qp/2;return[nd(C)*r,Ir(C)*r]},I.innerRadius=function(r){return arguments.length?(A=typeof r=="function"?r:Fi(+r),I):A},I.outerRadius=function(r){return arguments.length?(e=typeof r=="function"?r:Fi(+r),I):e},I.cornerRadius=function(r){return arguments.length?(t=typeof r=="function"?r:Fi(+r),I):t},I.padRadius=function(r){return arguments.length?(i=r==null?null:typeof r=="function"?r:Fi(+r),I):i},I.startAngle=function(r){return arguments.length?(n=typeof r=="function"?r:Fi(+r),I):n},I.endAngle=function(r){return arguments.length?(o=typeof r=="function"?r:Fi(+r),I):o},I.padAngle=function(r){return arguments.length?(g=typeof r=="function"?r:Fi(+r),I):g},I.context=function(r){return arguments.length?(a=r??null,I):a},I}function VXA(A){return typeof A=="object"&&"length"in A?A:Array.from(A)}function XXA(A){this._context=A}XXA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(A,e){switch(A=+A,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(A,e):this._context.moveTo(A,e);break;case 1:this._point=2;default:this._context.lineTo(A,e);break}}};function GJ(A){return new XXA(A)}function zXA(A){return A[0]}function TXA(A){return A[1]}function w5(A,e){var t=Fi(!0),i=null,n=GJ,o=null,g=y5(a);A=typeof A=="function"?A:A===void 0?zXA:Fi(A),e=typeof e=="function"?e:e===void 0?TXA:Fi(e);function a(s){var I,r=(s=VXA(s)).length,C,l=!1,c;for(i==null&&(o=n(c=g())),I=0;I<=r;++I)!(I<r&&t(C=s[I],I,s))===l&&((l=!l)?o.lineStart():o.lineEnd()),l&&o.point(+A(C,I,s),+e(C,I,s));if(c)return o=null,c+""||null}return a.x=function(s){return arguments.length?(A=typeof s=="function"?s:Fi(+s),a):A},a.y=function(s){return arguments.length?(e=typeof s=="function"?s:Fi(+s),a):e},a.defined=function(s){return arguments.length?(t=typeof s=="function"?s:Fi(!!s),a):t},a.curve=function(s){return arguments.length?(n=s,i!=null&&(o=n(i)),a):n},a.context=function(s){return arguments.length?(s==null?i=o=null:o=n(i=s),a):i},a}function Av(A,e,t){var i=null,n=Fi(!0),o=null,g=GJ,a=null,s=y5(I);A=typeof A=="function"?A:A===void 0?zXA:Fi(+A),e=typeof e=="function"?e:Fi(e===void 0?0:+e),t=typeof t=="function"?t:t===void 0?TXA:Fi(+t);function I(C){var l,c,B,E=(C=VXA(C)).length,u,d=!1,f,w=new Array(E),y=new Array(E);for(o==null&&(a=g(f=s())),l=0;l<=E;++l){if(!(l<E&&n(u=C[l],l,C))===d)if(d=!d)c=l,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),B=l-1;B>=c;--B)a.point(w[B],y[B]);a.lineEnd(),a.areaEnd()}d&&(w[l]=+A(u,l,C),y[l]=+e(u,l,C),a.point(i?+i(u,l,C):w[l],t?+t(u,l,C):y[l]))}if(f)return a=null,f+""||null}function r(){return w5().defined(n).curve(g).context(o)}return I.x=function(C){return arguments.length?(A=typeof C=="function"?C:Fi(+C),i=null,I):A},I.x0=function(C){return arguments.length?(A=typeof C=="function"?C:Fi(+C),I):A},I.x1=function(C){return arguments.length?(i=C==null?null:typeof C=="function"?C:Fi(+C),I):i},I.y=function(C){return arguments.length?(e=typeof C=="function"?C:Fi(+C),t=null,I):e},I.y0=function(C){return arguments.length?(e=typeof C=="function"?C:Fi(+C),I):e},I.y1=function(C){return arguments.length?(t=C==null?null:typeof C=="function"?C:Fi(+C),I):t},I.lineX0=I.lineY0=function(){return r().x(A).y(e)},I.lineY1=function(){return r().x(A).y(t)},I.lineX1=function(){return r().x(i).y(e)},I.defined=function(C){return arguments.length?(n=typeof C=="function"?C:Fi(!!C),I):n},I.curve=function(C){return arguments.length?(g=C,o!=null&&(a=g(o)),I):g},I.context=function(C){return arguments.length?(C==null?o=a=null:a=g(o=C),I):o},I}class _XA{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}}this._x0=e,this._y0=t}}function Gtt(A){return new _XA(A,!0)}function ktt(A){return new _XA(A,!1)}const Jtt=bn(3),OXA={draw(A,e){const t=bn(e+DJ(e/28,.75))*.59436,i=t/2,n=i*Jtt;A.moveTo(0,t),A.lineTo(0,-t),A.moveTo(-n,-i),A.lineTo(n,i),A.moveTo(-n,i),A.lineTo(n,-i)}},kJ={draw(A,e){const t=bn(e/Qp);A.moveTo(t,0),A.arc(0,0,t,0,$M)}},qXA={draw(A,e){const t=bn(e/5)/2;A.moveTo(-3*t,-t),A.lineTo(-t,-t),A.lineTo(-t,-3*t),A.lineTo(t,-3*t),A.lineTo(t,-t),A.lineTo(3*t,-t),A.lineTo(3*t,t),A.lineTo(t,t),A.lineTo(t,3*t),A.lineTo(-t,3*t),A.lineTo(-t,t),A.lineTo(-3*t,t),A.closePath()}},jXA=bn(1/3),Ntt=jXA*2,PXA={draw(A,e){const t=bn(e/Ntt),i=t*jXA;A.moveTo(0,-t),A.lineTo(i,0),A.lineTo(0,t),A.lineTo(-i,0),A.closePath()}},$XA={draw(A,e){const t=bn(e)*.62625;A.moveTo(0,-t),A.lineTo(t,0),A.lineTo(0,t),A.lineTo(-t,0),A.closePath()}},A9A={draw(A,e){const t=bn(e-DJ(e/7,2))*.87559;A.moveTo(-t,0),A.lineTo(t,0),A.moveTo(0,t),A.lineTo(0,-t)}},e9A={draw(A,e){const t=bn(e),i=-t/2;A.rect(i,i,t,t)}},t9A={draw(A,e){const t=bn(e)*.4431;A.moveTo(t,t),A.lineTo(t,-t),A.lineTo(-t,-t),A.lineTo(-t,t),A.closePath()}},Ytt=.8908130915292852,i9A=Ir(Qp/10)/Ir(7*Qp/10),Rtt=Ir($M/10)*i9A,xtt=-nd($M/10)*i9A,n9A={draw(A,e){const t=bn(e*Ytt),i=Rtt*t,n=xtt*t;A.moveTo(0,-t),A.lineTo(i,n);for(let o=1;o<5;++o){const g=$M*o/5,a=nd(g),s=Ir(g);A.lineTo(s*t,-a*t),A.lineTo(a*i-s*n,s*i+a*n)}A.closePath()}},erA=bn(3),o9A={draw(A,e){const t=-bn(e/(erA*3));A.moveTo(0,t*2),A.lineTo(-erA*t,-t),A.lineTo(erA*t,-t),A.closePath()}},Ftt=bn(3),g9A={draw(A,e){const t=bn(e)*.6824,i=t/2,n=t*Ftt/2;A.moveTo(0,-t),A.lineTo(n,i),A.lineTo(-n,i),A.closePath()}},nl=-.5,ol=bn(3)/2,trA=1/bn(12),Mtt=(trA/2+1)*3,a9A={draw(A,e){const t=bn(e/Mtt),i=t/2,n=t*trA,o=i,g=t*trA+t,a=-o,s=g;A.moveTo(i,n),A.lineTo(o,g),A.lineTo(a,s),A.lineTo(nl*i-ol*n,ol*i+nl*n),A.lineTo(nl*o-ol*g,ol*o+nl*g),A.lineTo(nl*a-ol*s,ol*a+nl*s),A.lineTo(nl*i+ol*n,nl*n-ol*i),A.lineTo(nl*o+ol*g,nl*g-ol*o),A.lineTo(nl*a+ol*s,nl*s-ol*a),A.closePath()}},s9A={draw(A,e){const t=bn(e-DJ(e/6,1.7))*.6189;A.moveTo(-t,-t),A.lineTo(t,t),A.moveTo(-t,t),A.lineTo(t,-t)}},vtt=[kJ,qXA,PXA,e9A,n9A,o9A,a9A],Ltt=[kJ,A9A,s9A,g9A,OXA,t9A,$XA];function r9A(A,e){let t=null,i=y5(n);A=typeof A=="function"?A:Fi(A||kJ),e=typeof e=="function"?e:Fi(e===void 0?64:+e);function n(){let o;if(t||(t=o=i()),A.apply(this,arguments).draw(t,+e.apply(this,arguments)),o)return t=null,o+""||null}return n.type=function(o){return arguments.length?(A=typeof o=="function"?o:Fi(o),n):A},n.size=function(o){return arguments.length?(e=typeof o=="function"?o:Fi(+o),n):e},n.context=function(o){return arguments.length?(t=o??null,n):t},n}function Ep(){}function D5(A,e,t){A._context.bezierCurveTo((2*A._x0+A._x1)/3,(2*A._y0+A._y1)/3,(A._x0+2*A._x1)/3,(A._y0+2*A._y1)/3,(A._x0+4*A._x1+e)/6,(A._y0+4*A._y1+t)/6)}function G5(A){this._context=A}G5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:D5(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(A,e){switch(A=+A,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(A,e):this._context.moveTo(A,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:D5(this,A,e);break}this._x0=this._x1,this._x1=A,this._y0=this._y1,this._y1=e}};function I9A(A){return new G5(A)}function C9A(A){this._context=A}C9A.prototype={areaStart:Ep,areaEnd:Ep,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(A,e){switch(A=+A,e=+e,this._point){case 0:this._point=1,this._x2=A,this._y2=e;break;case 1:this._point=2,this._x3=A,this._y3=e;break;case 2:this._point=3,this._x4=A,this._y4=e,this._context.moveTo((this._x0+4*this._x1+A)/6,(this._y0+4*this._y1+e)/6);break;default:D5(this,A,e);break}this._x0=this._x1,this._x1=A,this._y0=this._y1,this._y1=e}};function l9A(A){return new C9A(A)}function c9A(A){this._context=A}c9A.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(A,e){switch(A=+A,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var t=(this._x0+4*this._x1+A)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 3:this._point=4;default:D5(this,A,e);break}this._x0=this._x1,this._x1=A,this._y0=this._y1,this._y1=e}};function B9A(A){return new c9A(A)}function Q9A(A,e){this._basis=new G5(A),this._beta=e}Q9A.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var A=this._x,e=this._y,t=A.length-1;if(t>0)for(var i=A[0],n=e[0],o=A[t]-i,g=e[t]-n,a=-1,s;++a<=t;)s=a/t,this._basis.point(this._beta*A[a]+(1-this._beta)*(i+s*o),this._beta*e[a]+(1-this._beta)*(n+s*g));this._x=this._y=null,this._basis.lineEnd()},point:function(A,e){this._x.push(+A),this._y.push(+e)}};const E9A=function A(e){function t(i){return e===1?new G5(i):new Q9A(i,e)}return t.beta=function(i){return A(+i)},t}(.85);function k5(A,e,t){A._context.bezierCurveTo(A._x1+A._k*(A._x2-A._x0),A._y1+A._k*(A._y2-A._y0),A._x2+A._k*(A._x1-e),A._y2+A._k*(A._y1-t),A._x2,A._y2)}function irA(A,e){this._context=A,this._k=(1-e)/6}irA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:k5(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(A,e){switch(A=+A,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(A,e):this._context.moveTo(A,e);break;case 1:this._point=2,this._x1=A,this._y1=e;break;case 2:this._point=3;default:k5(this,A,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=A,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const u9A=function A(e){function t(i){return new irA(i,e)}return t.tension=function(i){return A(+i)},t}(0);function nrA(A,e){this._context=A,this._k=(1-e)/6}nrA.prototype={areaStart:Ep,areaEnd:Ep,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(A,e){switch(A=+A,e=+e,this._point){case 0:this._point=1,this._x3=A,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=A,this._y4=e);break;case 2:this._point=3,this._x5=A,this._y5=e;break;default:k5(this,A,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=A,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const d9A=function A(e){function t(i){return new nrA(i,e)}return t.tension=function(i){return A(+i)},t}(0);function orA(A,e){this._context=A,this._k=(1-e)/6}orA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(A,e){switch(A=+A,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:k5(this,A,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=A,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const h9A=function A(e){function t(i){return new orA(i,e)}return t.tension=function(i){return A(+i)},t}(0);function grA(A,e,t){var i=A._x1,n=A._y1,o=A._x2,g=A._y2;if(A._l01_a>Ma){var a=2*A._l01_2a+3*A._l01_a*A._l12_a+A._l12_2a,s=3*A._l01_a*(A._l01_a+A._l12_a);i=(i*a-A._x0*A._l12_2a+A._x2*A._l01_2a)/s,n=(n*a-A._y0*A._l12_2a+A._y2*A._l01_2a)/s}if(A._l23_a>Ma){var I=2*A._l23_2a+3*A._l23_a*A._l12_a+A._l12_2a,r=3*A._l23_a*(A._l23_a+A._l12_a);o=(o*I+A._x1*A._l23_2a-e*A._l12_2a)/r,g=(g*I+A._y1*A._l23_2a-t*A._l12_2a)/r}A._context.bezierCurveTo(i,n,o,g,A._x2,A._y2)}function m9A(A,e){this._context=A,this._alpha=e}m9A.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(A,e){if(A=+A,e=+e,this._point){var t=this._x2-A,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(A,e):this._context.moveTo(A,e);break;case 1:this._point=2;break;case 2:this._point=3;default:grA(this,A,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=A,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const p9A=function A(e){function t(i){return e?new m9A(i,e):new irA(i,0)}return t.alpha=function(i){return A(+i)},t}(.5);function f9A(A,e){this._context=A,this._alpha=e}f9A.prototype={areaStart:Ep,areaEnd:Ep,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(A,e){if(A=+A,e=+e,this._point){var t=this._x2-A,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=A,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=A,this._y4=e);break;case 2:this._point=3,this._x5=A,this._y5=e;break;default:grA(this,A,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=A,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const y9A=function A(e){function t(i){return e?new f9A(i,e):new nrA(i,0)}return t.alpha=function(i){return A(+i)},t}(.5);function b9A(A,e){this._context=A,this._alpha=e}b9A.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(A,e){if(A=+A,e=+e,this._point){var t=this._x2-A,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:grA(this,A,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=A,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const w9A=function A(e){function t(i){return e?new b9A(i,e):new orA(i,0)}return t.alpha=function(i){return A(+i)},t}(.5);function D9A(A){this._context=A}D9A.prototype={areaStart:Ep,areaEnd:Ep,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(A,e){A=+A,e=+e,this._point?this._context.lineTo(A,e):(this._point=1,this._context.moveTo(A,e))}};function G9A(A){return new D9A(A)}function k9A(A){return A<0?-1:1}function J9A(A,e,t){var i=A._x1-A._x0,n=e-A._x1,o=(A._y1-A._y0)/(i||n<0&&-0),g=(t-A._y1)/(n||i<0&&-0),a=(o*n+g*i)/(i+n);return(k9A(o)+k9A(g))*Math.min(Math.abs(o),Math.abs(g),.5*Math.abs(a))||0}function N9A(A,e){var t=A._x1-A._x0;return t?(3*(A._y1-A._y0)/t-e)/2:e}function arA(A,e,t){var i=A._x0,n=A._y0,o=A._x1,g=A._y1,a=(o-i)/3;A._context.bezierCurveTo(i+a,n+a*e,o-a,g-a*t,o,g)}function J5(A){this._context=A}J5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:arA(this,this._t0,N9A(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(A,e){var t=NaN;if(A=+A,e=+e,!(A===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(A,e):this._context.moveTo(A,e);break;case 1:this._point=2;break;case 2:this._point=3,arA(this,N9A(this,t=J9A(this,A,e)),t);break;default:arA(this,this._t0,t=J9A(this,A,e));break}this._x0=this._x1,this._x1=A,this._y0=this._y1,this._y1=e,this._t0=t}}};function Y9A(A){this._context=new R9A(A)}(Y9A.prototype=Object.create(J5.prototype)).point=function(A,e){J5.prototype.point.call(this,e,A)};function R9A(A){this._context=A}R9A.prototype={moveTo:function(A,e){this._context.moveTo(e,A)},closePath:function(){this._context.closePath()},lineTo:function(A,e){this._context.lineTo(e,A)},bezierCurveTo:function(A,e,t,i,n,o){this._context.bezierCurveTo(e,A,i,t,o,n)}};function x9A(A){return new J5(A)}function F9A(A){return new Y9A(A)}function M9A(A){this._context=A}M9A.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var A=this._x,e=this._y,t=A.length;if(t)if(this._line?this._context.lineTo(A[0],e[0]):this._context.moveTo(A[0],e[0]),t===2)this._context.lineTo(A[1],e[1]);else for(var i=v9A(A),n=v9A(e),o=0,g=1;g<t;++o,++g)this._context.bezierCurveTo(i[0][o],n[0][o],i[1][o],n[1][o],A[g],e[g]);(this._line||this._line!==0&&t===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(A,e){this._x.push(+A),this._y.push(+e)}};function v9A(A){var e,t=A.length-1,i,n=new Array(t),o=new Array(t),g=new Array(t);for(n[0]=0,o[0]=2,g[0]=A[0]+2*A[1],e=1;e<t-1;++e)n[e]=1,o[e]=4,g[e]=4*A[e]+2*A[e+1];for(n[t-1]=2,o[t-1]=7,g[t-1]=8*A[t-1]+A[t],e=1;e<t;++e)i=n[e]/o[e-1],o[e]-=i,g[e]-=i*g[e-1];for(n[t-1]=g[t-1]/o[t-1],e=t-2;e>=0;--e)n[e]=(g[e]-n[e+1])/o[e];for(o[t-1]=(A[t]+n[t-1])/2,e=0;e<t-1;++e)o[e]=2*A[e+1]-n[e+1];return[n,o]}function L9A(A){return new M9A(A)}function N5(A,e){this._context=A,this._t=e}N5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(A,e){switch(A=+A,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(A,e):this._context.moveTo(A,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(A,e);else{var t=this._x*(1-this._t)+A*this._t;this._context.lineTo(t,this._y),this._context.lineTo(t,e)}break}}this._x=A,this._y=e}};function S9A(A){return new N5(A,.5)}function H9A(A){return new N5(A,0)}function Z9A(A){return new N5(A,1)}function up(A,e){if(typeof document<"u"&&document.createElement){const t=document.createElement("canvas");if(t&&t.getContext)return t.width=A,t.height=e,t}return null}const Stt=()=>typeof Image<"u"?Image:null;function srA(A,e,t){const i=A-e+t*2;return A?i>0?i:1:0}const Htt="identity",JJ="linear",od="log",ev="pow",tv="sqrt",Y5="symlog",Cb="time",lb="utc",yQ="sequential",NJ="diverging",YJ="quantile",R5="quantize",x5="threshold",rrA="ordinal",IrA="point",W9A="band",CrA="bin-ordinal",Po="continuous",iv="discrete",nv="discretizing",gl="interpolating",lrA="temporal";function Ztt(A){return function(e){let t=e[0],i=e[1],n;return i<t&&(n=t,t=i,i=n),[A.invert(t),A.invert(i)]}}function Wtt(A){return function(e){const t=A.range();let i=e[0],n=e[1],o=-1,g,a,s,I;for(n<i&&(a=i,i=n,n=a),s=0,I=t.length;s<I;++s)t[s]>=i&&t[s]<=n&&(o<0&&(o=s),g=s);if(!(o<0))return i=A.invertExtent(t[o]),n=A.invertExtent(t[g]),[i[0]===void 0?i[1]:i[0],n[1]===void 0?n[0]:n[1]]}}function crA(){const A=$k().unknown(void 0),e=A.domain,t=A.range;let i=[0,1],n,o,g=!1,a=0,s=0,I=.5;delete A.unknown;function r(){const C=e().length,l=i[1]<i[0],c=i[1-l],B=srA(C,a,s);let E=i[l-0];n=(c-E)/(B||1),g&&(n=Math.floor(n)),E+=(c-E-n*(C-a))*I,o=n*(1-a),g&&(E=Math.round(E),o=Math.round(o));const u=Ga(C).map(d=>E+n*d);return t(l?u.reverse():u)}return A.domain=function(C){return arguments.length?(e(C),r()):e()},A.range=function(C){return arguments.length?(i=[+C[0],+C[1]],r()):i.slice()},A.rangeRound=function(C){return i=[+C[0],+C[1]],g=!0,r()},A.bandwidth=function(){return o},A.step=function(){return n},A.round=function(C){return arguments.length?(g=!!C,r()):g},A.padding=function(C){return arguments.length?(s=Math.max(0,Math.min(1,C)),a=s,r()):a},A.paddingInner=function(C){return arguments.length?(a=Math.max(0,Math.min(1,C)),r()):a},A.paddingOuter=function(C){return arguments.length?(s=Math.max(0,Math.min(1,C)),r()):s},A.align=function(C){return arguments.length?(I=Math.max(0,Math.min(1,C)),r()):I},A.invertRange=function(C){if(C[0]==null||C[1]==null)return;const l=i[1]<i[0],c=l?t().reverse():t(),B=c.length-1;let E=+C[0],u=+C[1],d,f,w;if(!(E!==E||u!==u)&&(u<E&&(w=E,E=u,u=w),!(u<c[0]||E>i[1-l])))return d=Math.max(0,c9(c,E)-1),f=E===u?d:c9(c,u)-1,E-c[d]>o+1e-10&&++d,l&&(w=d,d=B-f,f=B-w),d>f?void 0:e().slice(d,f+1)},A.invert=function(C){const l=A.invertRange([C,C]);return l&&l[0]},A.copy=function(){return crA().domain(e()).range(i).round(g).paddingInner(a).paddingOuter(s).align(I)},r()}function K9A(A){const e=A.copy;return A.padding=A.paddingOuter,delete A.paddingInner,A.copy=function(){return K9A(e())},A}function Ktt(){return K9A(crA().paddingInner(1))}var Utt=Array.prototype.map;function Vtt(A){return Utt.call(A,Na)}const Xtt=Array.prototype.slice;function U9A(){let A=[],e=[];function t(i){return i==null||i!==i?void 0:e[(jk(A,i)-1)%e.length]}return t.domain=function(i){return arguments.length?(A=Vtt(i),t):A.slice()},t.range=function(i){return arguments.length?(e=Xtt.call(i),t):e.slice()},t.tickFormat=function(i,n){return mKA(A[0],Ut(A),i??10,n)},t.copy=function(){return U9A().domain(t.domain()).range(t.range())},t}const F5=new Map,V9A=Symbol("vega_scale");function X9A(A){return A[V9A]=!0,A}function ztt(A){return A&&A[V9A]===!0}function Ttt(A,e,t){const i=function(){const n=e();return n.invertRange||(n.invertRange=n.invert?Ztt(n):n.invertExtent?Wtt(n):void 0),n.type=A,X9A(n)};return i.metadata=fc(te(t)),i}function Ci(A,e,t){return arguments.length>1?(F5.set(A,Ttt(A,e,t)),this):z9A(A)?F5.get(A):void 0}Ci(Htt,UgA),Ci(JJ,bM,Po),Ci(od,XgA,[Po,od]),Ci(ev,M9,Po),Ci(tv,XPe,Po),Ci(Y5,TgA,Po),Ci(Cb,iUA,[Po,lrA]),Ci(lb,nUA,[Po,lrA]),Ci(yQ,naA,[Po,gl]),Ci(`${yQ}-${JJ}`,naA,[Po,gl]),Ci(`${yQ}-${od}`,oUA,[Po,gl,od]),Ci(`${yQ}-${ev}`,oaA,[Po,gl]),Ci(`${yQ}-${tv}`,j7e,[Po,gl]),Ci(`${yQ}-${Y5}`,gUA,[Po,gl]),Ci(`${NJ}-${JJ}`,gaA,[Po,gl]),Ci(`${NJ}-${od}`,aaA,[Po,gl,od]),Ci(`${NJ}-${ev}`,H9,[Po,gl]),Ci(`${NJ}-${tv}`,P7e,[Po,gl]),Ci(`${NJ}-${Y5}`,saA,[Po,gl]),Ci(YJ,OgA,[nv,YJ]),Ci(R5,kKA,nv),Ci(x5,qgA,nv),Ci(CrA,U9A,[iv,nv]),Ci(rrA,$k,iv),Ci(W9A,crA,iv),Ci(IrA,Ktt,iv);function z9A(A){return F5.has(A)}function cb(A,e){const t=F5.get(A);return t&&t.metadata[e]}function BrA(A){return cb(A,Po)}function RJ(A){return cb(A,iv)}function QrA(A){return cb(A,nv)}function T9A(A){return cb(A,od)}function _tt(A){return cb(A,lrA)}function _9A(A){return cb(A,gl)}function O9A(A){return cb(A,YJ)}const Ott=["clamp","base","constant","exponent"];function q9A(A,e){const t=e[0],i=Ut(e)-t;return function(n){return A(t+n*i)}}function M5(A,e,t){return oJ(ErA(e||"rgb",t),A)}function j9A(A,e){const t=new Array(e),i=e+1;for(let n=0;n<e;)t[n]=A(++n/i);return t}function P9A(A,e,t){const i=t-e;let n,o,g;return!i||!Number.isFinite(i)?Ya(.5):(n=(o=A.type).indexOf("-"),o=n<0?o:o.slice(n+1),g=Ci(o)().domain([e,t]).range([0,1]),Ott.forEach(a=>A[a]?g[a](A[a]()):0),g)}function ErA(A,e){const t=xPe[qtt(A)];return e!=null&&t&&t.gamma?t.gamma(e):t}function qtt(A){return"interpolate"+A.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}const jtt={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},Ptt={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function $9A(A){const e=A.length/6|0,t=new Array(e);for(let i=0;i<e;)t[i]="#"+A.slice(i*6,++i*6);return t}function A5A(A,e){for(const t in A)urA(t,e(A[t]))}const e5A={};A5A(Ptt,$9A),A5A(jtt,A=>M5($9A(A)));function urA(A,e){return A=A&&A.toLowerCase(),arguments.length>1?(e5A[A]=e,this):e5A[A]}const v5="symbol",$tt="discrete",Ait="gradient",eit=A=>RA(A)?A.map(e=>String(e)):String(A),tit=(A,e)=>A[1]-e[1],iit=(A,e)=>e[1]-A[1];function drA(A,e,t){let i;return ti(e)&&(A.bins&&(e=Math.max(e,A.bins.length)),t!=null&&(e=Math.min(e,Math.floor(FM(A.domain())/t||1)+1))),oe(e)&&(i=e.step,e=e.interval),ie(e)&&(e=A.type===Cb?mJ(e):A.type==lb?pJ(e):YA("Only time and utc scales accept interval strings."),i&&(e=e.every(i))),e}function t5A(A,e,t){let i=A.range(),n=i[0],o=Ut(i),g=tit;if(n>o&&(i=o,o=n,n=i,g=iit),n=Math.floor(n),o=Math.ceil(o),e=e.map(a=>[a,A(a)]).filter(a=>n<=a[1]&&a[1]<=o).sort(g).map(a=>a[0]),t>0&&e.length>1){const a=[e[0],Ut(e)];for(;e.length>t&&e.length>=3;)e=e.filter((s,I)=>!(I%2));e.length<3&&(e=a)}return e}function hrA(A,e){return A.bins?t5A(A,A.bins):A.ticks?A.ticks(e):A.domain()}function i5A(A,e,t,i,n,o){const g=e.type;let a=eit;if(g===Cb||n===Cb)a=A.timeFormat(i);else if(g===lb||n===lb)a=A.utcFormat(i);else if(T9A(g)){const s=A.formatFloat(i);if(o||e.bins)a=s;else{const I=n5A(e,t,!1);a=r=>I(r)?s(r):""}}else if(e.tickFormat){const s=e.domain();a=A.formatSpan(s[0],s[s.length-1],t,i)}else i&&(a=A.format(i));return a}function n5A(A,e,t){const i=hrA(A,e),n=A.base(),o=Math.log(n),g=Math.max(1,n*e/i.length),a=s=>{let I=s/Math.pow(n,Math.round(Math.log(s)/o));return I*n<n-.5&&(I*=n),I<=g};return t?i.filter(a):a}const mrA={[YJ]:"quantiles",[R5]:"thresholds",[x5]:"domain"},o5A={[YJ]:"quantiles",[R5]:"domain"};function g5A(A,e){return A.bins?git(A.bins):A.type===od?n5A(A,e,!0):mrA[A.type]?oit(A[mrA[A.type]]()):hrA(A,e)}function nit(A,e,t){const i=e[o5A[e.type]](),n=i.length;let o=n>1?i[1]-i[0]:i[0],g;for(g=1;g<n;++g)o=Math.min(o,i[g]-i[g-1]);return A.formatSpan(0,o,30,t)}function oit(A){const e=[-1/0].concat(A);return e.max=1/0,e}function git(A){const e=A.slice(0,-1);return e.max=Ut(A),e}const ait=A=>mrA[A.type]||A.bins;function a5A(A,e,t,i,n,o,g){const a=o5A[e.type]&&o!==Cb&&o!==lb?nit(A,e,n):i5A(A,e,t,n,o,g);return i===v5&&ait(e)?sit(a):i===$tt?rit(a):Iit(a)}const sit=A=>(e,t,i)=>{const n=s5A(i[t+1],s5A(i.max,1/0)),o=r5A(e,A),g=r5A(n,A);return o&&g?o+" – "+g:g?"< "+g:"≥ "+o},s5A=(A,e)=>A??e,rit=A=>(e,t)=>t?A(e):null,Iit=A=>e=>A(e),r5A=(A,e)=>Number.isFinite(A)?e(A):null;function Cit(A){const e=A.domain(),t=e.length-1;let i=+e[0],n=+Ut(e),o=n-i;if(A.type===x5){const g=t?o/t:.1;i-=g,n+=g,o=n-i}return g=>(g-i)/o}function lit(A,e,t,i){const n=i||e.type;return ie(t)&&_tt(n)&&(t=t.replace(/%a/g,"%A").replace(/%b/g,"%B")),!t&&n===Cb?A.timeFormat("%A, %d %B %Y, %X"):!t&&n===lb?A.utcFormat("%A, %d %B %Y, %X UTC"):a5A(A,e,5,null,t,i,!0)}function I5A(A,e,t){t=t||{};const i=Math.max(3,t.maxlen||7),n=lit(A,e,t.format,t.formatType);if(QrA(e.type)){const o=g5A(e).slice(1).map(n),g=o.length;return`${g} boundar${g===1?"y":"ies"}: ${o.join(", ")}`}else if(RJ(e.type)){const o=e.domain(),g=o.length,a=g>i?o.slice(0,i-2).map(n).join(", ")+", ending with "+o.slice(-1).map(n):o.map(n).join(", ");return`${g} value${g===1?"":"s"}: ${a}`}else{const o=e.domain();return`values from ${n(o[0])} to ${n(Ut(o))}`}}let C5A=0;function cit(){C5A=0}const L5="p_";function prA(A){return A&&A.gradient}function l5A(A,e,t){const i=A.gradient;let n=A.id,o=i==="radial"?L5:"";return n||(n=A.id="gradient_"+C5A++,i==="radial"?(A.x1=bQ(A.x1,.5),A.y1=bQ(A.y1,.5),A.r1=bQ(A.r1,0),A.x2=bQ(A.x2,.5),A.y2=bQ(A.y2,.5),A.r2=bQ(A.r2,.5),o=L5):(A.x1=bQ(A.x1,0),A.y1=bQ(A.y1,0),A.x2=bQ(A.x2,1),A.y2=bQ(A.y2,0))),e[n]=A,"url("+(t||"")+"#"+o+n+")"}function bQ(A,e){return A??e}function c5A(A,e){var t=[],i;return i={gradient:"linear",x1:A?A[0]:0,y1:A?A[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:t,stop:function(n,o){return t.push({offset:n,color:o}),i}}}const B5A={basis:{curve:I9A},"basis-closed":{curve:l9A},"basis-open":{curve:B9A},bundle:{curve:E9A,tension:"beta",value:.85},cardinal:{curve:u9A,tension:"tension",value:0},"cardinal-open":{curve:h9A,tension:"tension",value:0},"cardinal-closed":{curve:d9A,tension:"tension",value:0},"catmull-rom":{curve:p9A,tension:"alpha",value:.5},"catmull-rom-closed":{curve:y9A,tension:"alpha",value:.5},"catmull-rom-open":{curve:w9A,tension:"alpha",value:.5},linear:{curve:GJ},"linear-closed":{curve:G9A},monotone:{horizontal:F9A,vertical:x9A},natural:{curve:L9A},step:{curve:S9A},"step-after":{curve:Z9A},"step-before":{curve:H9A}};function ov(A,e,t){var i=Je(B5A,A)&&B5A[A],n=null;return i&&(n=i.curve||i[e||"vertical"],i.tension&&t!=null&&(n=n[i.tension](t))),n}const Bit={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Qit=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Eit=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,uit=/^((\s+,?\s*)|(,\s*))/,dit=/^[01]/;function xJ(A){const e=[];return(A.match(Qit)||[]).forEach(t=>{let i=t[0];const n=i.toLowerCase(),o=Bit[n],g=hit(n,o,t.slice(1).trim()),a=g.length;if(a<o||a&&a%o!==0)throw Error("Invalid SVG path, incorrect parameter count");if(e.push([i,...g.slice(0,o)]),a!==o){n==="m"&&(i=i==="M"?"L":"l");for(let s=o;s<a;s+=o)e.push([i,...g.slice(s,s+o)])}}),e}function hit(A,e,t){const i=[];for(let n=0;e&&n<t.length;)for(let o=0;o<e;++o){const g=A==="a"&&(o===3||o===4)?dit:Eit,a=t.slice(n).match(g);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");n+=a[0].length,i.push(+a[0]);const s=t.slice(n).match(uit);s!==null&&(n+=s[0].length)}return i}const dp=Math.PI/180,mit=1e-14,Bb=Math.PI/2,wQ=Math.PI*2,FJ=Math.sqrt(3)/2;var frA={},yrA={},Q5A=[].join;function pit(A,e,t,i,n,o,g,a,s){const I=Q5A.call(arguments);if(frA[I])return frA[I];const r=g*dp,C=Math.sin(r),l=Math.cos(r);t=Math.abs(t),i=Math.abs(i);const c=l*(a-A)*.5+C*(s-e)*.5,B=l*(s-e)*.5-C*(a-A)*.5;let E=c*c/(t*t)+B*B/(i*i);E>1&&(E=Math.sqrt(E),t*=E,i*=E);const u=l/t,d=C/t,f=-C/i,w=l/i,y=u*a+d*s,G=f*a+w*s,R=u*A+d*e,x=f*A+w*e;let F=1/((R-y)*(R-y)+(x-G)*(x-G))-.25;F<0&&(F=0);let Q=Math.sqrt(F);o==n&&(Q=-Q);const k=.5*(y+R)-Q*(x-G),h=.5*(G+x)+Q*(R-y),N=Math.atan2(G-h,y-k);let v=Math.atan2(x-h,R-k)-N;v<0&&o===1?v+=wQ:v>0&&o===0&&(v-=wQ);const K=Math.ceil(Math.abs(v/(Bb+.001))),U=[];for(let V=0;V<K;++V){const X=N+V*v/K,_=N+(V+1)*v/K;U[V]=[k,h,X,_,t,i,C,l]}return frA[I]=U}function fit(A){const e=Q5A.call(A);if(yrA[e])return yrA[e];var t=A[0],i=A[1],n=A[2],o=A[3],g=A[4],a=A[5],s=A[6],I=A[7];const r=I*g,C=-s*a,l=s*g,c=I*a,B=Math.cos(n),E=Math.sin(n),u=Math.cos(o),d=Math.sin(o),f=.5*(o-n),w=Math.sin(f*.5),y=8/3*w*w/Math.sin(f),G=t+B-y*E,R=i+E+y*B,x=t+u,F=i+d,Q=x+y*d,k=F-y*u;return yrA[e]=[r*G+C*R,l*G+c*R,r*Q+C*k,l*Q+c*k,r*x+C*F,l*x+c*F]}const al=["l",0,0,0,0,0,0,0];function yit(A,e,t){const i=al[0]=A[0];if(i==="a"||i==="A")al[1]=e*A[1],al[2]=t*A[2],al[3]=A[3],al[4]=A[4],al[5]=A[5],al[6]=e*A[6],al[7]=t*A[7];else if(i==="h"||i==="H")al[1]=e*A[1];else if(i==="v"||i==="V")al[1]=t*A[1];else for(var n=1,o=A.length;n<o;++n)al[n]=(n%2==1?e:t)*A[n];return al}function gv(A,e,t,i,n,o){var g,a=null,s=0,I=0,r=0,C=0,l,c,B,E,u=0,d=0;t==null&&(t=0),i==null&&(i=0),n==null&&(n=1),o==null&&(o=n),A.beginPath&&A.beginPath();for(var f=0,w=e.length;f<w;++f){switch(g=e[f],(n!==1||o!==1)&&(g=yit(g,n,o)),g[0]){case"l":s+=g[1],I+=g[2],A.lineTo(s+t,I+i);break;case"L":s=g[1],I=g[2],A.lineTo(s+t,I+i);break;case"h":s+=g[1],A.lineTo(s+t,I+i);break;case"H":s=g[1],A.lineTo(s+t,I+i);break;case"v":I+=g[1],A.lineTo(s+t,I+i);break;case"V":I=g[1],A.lineTo(s+t,I+i);break;case"m":s+=g[1],I+=g[2],u=s,d=I,A.moveTo(s+t,I+i);break;case"M":s=g[1],I=g[2],u=s,d=I,A.moveTo(s+t,I+i);break;case"c":l=s+g[5],c=I+g[6],r=s+g[3],C=I+g[4],A.bezierCurveTo(s+g[1]+t,I+g[2]+i,r+t,C+i,l+t,c+i),s=l,I=c;break;case"C":s=g[5],I=g[6],r=g[3],C=g[4],A.bezierCurveTo(g[1]+t,g[2]+i,r+t,C+i,s+t,I+i);break;case"s":l=s+g[3],c=I+g[4],r=2*s-r,C=2*I-C,A.bezierCurveTo(r+t,C+i,s+g[1]+t,I+g[2]+i,l+t,c+i),r=s+g[1],C=I+g[2],s=l,I=c;break;case"S":l=g[3],c=g[4],r=2*s-r,C=2*I-C,A.bezierCurveTo(r+t,C+i,g[1]+t,g[2]+i,l+t,c+i),s=l,I=c,r=g[1],C=g[2];break;case"q":l=s+g[3],c=I+g[4],r=s+g[1],C=I+g[2],A.quadraticCurveTo(r+t,C+i,l+t,c+i),s=l,I=c;break;case"Q":l=g[3],c=g[4],A.quadraticCurveTo(g[1]+t,g[2]+i,l+t,c+i),s=l,I=c,r=g[1],C=g[2];break;case"t":l=s+g[1],c=I+g[2],a[0].match(/[QqTt]/)===null?(r=s,C=I):a[0]==="t"?(r=2*s-B,C=2*I-E):a[0]==="q"&&(r=2*s-r,C=2*I-C),B=r,E=C,A.quadraticCurveTo(r+t,C+i,l+t,c+i),s=l,I=c,r=s+g[1],C=I+g[2];break;case"T":l=g[1],c=g[2],r=2*s-r,C=2*I-C,A.quadraticCurveTo(r+t,C+i,l+t,c+i),s=l,I=c;break;case"a":E5A(A,s+t,I+i,[g[1],g[2],g[3],g[4],g[5],g[6]+s+t,g[7]+I+i]),s+=g[6],I+=g[7];break;case"A":E5A(A,s+t,I+i,[g[1],g[2],g[3],g[4],g[5],g[6]+t,g[7]+i]),s=g[6],I=g[7];break;case"z":case"Z":s=u,I=d,A.closePath();break}a=g}}function E5A(A,e,t,i){const n=pit(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,t);for(let o=0;o<n.length;++o){const g=fit(n[o]);A.bezierCurveTo(g[0],g[1],g[2],g[3],g[4],g[5])}}const u5A=.5773502691896257,d5A={circle:{draw:function(A,e){const t=Math.sqrt(e)/2;A.moveTo(t,0),A.arc(0,0,t,0,wQ)}},cross:{draw:function(A,e){var t=Math.sqrt(e)/2,i=t/2.5;A.moveTo(-t,-i),A.lineTo(-t,i),A.lineTo(-i,i),A.lineTo(-i,t),A.lineTo(i,t),A.lineTo(i,i),A.lineTo(t,i),A.lineTo(t,-i),A.lineTo(i,-i),A.lineTo(i,-t),A.lineTo(-i,-t),A.lineTo(-i,-i),A.closePath()}},diamond:{draw:function(A,e){const t=Math.sqrt(e)/2;A.moveTo(-t,0),A.lineTo(0,-t),A.lineTo(t,0),A.lineTo(0,t),A.closePath()}},square:{draw:function(A,e){var t=Math.sqrt(e),i=-t/2;A.rect(i,i,t,t)}},arrow:{draw:function(A,e){var t=Math.sqrt(e)/2,i=t/7,n=t/2.5,o=t/8;A.moveTo(-i,t),A.lineTo(i,t),A.lineTo(i,-o),A.lineTo(n,-o),A.lineTo(0,-t),A.lineTo(-n,-o),A.lineTo(-i,-o),A.closePath()}},wedge:{draw:function(A,e){var t=Math.sqrt(e)/2,i=FJ*t,n=i-t*u5A,o=t/4;A.moveTo(0,-i-n),A.lineTo(-o,i-n),A.lineTo(o,i-n),A.closePath()}},triangle:{draw:function(A,e){var t=Math.sqrt(e)/2,i=FJ*t,n=i-t*u5A;A.moveTo(0,-i-n),A.lineTo(-t,i-n),A.lineTo(t,i-n),A.closePath()}},"triangle-up":{draw:function(A,e){var t=Math.sqrt(e)/2,i=FJ*t;A.moveTo(0,-i),A.lineTo(-t,i),A.lineTo(t,i),A.closePath()}},"triangle-down":{draw:function(A,e){var t=Math.sqrt(e)/2,i=FJ*t;A.moveTo(0,i),A.lineTo(-t,-i),A.lineTo(t,-i),A.closePath()}},"triangle-right":{draw:function(A,e){var t=Math.sqrt(e)/2,i=FJ*t;A.moveTo(i,0),A.lineTo(-i,-t),A.lineTo(-i,t),A.closePath()}},"triangle-left":{draw:function(A,e){var t=Math.sqrt(e)/2,i=FJ*t;A.moveTo(-i,0),A.lineTo(i,-t),A.lineTo(i,t),A.closePath()}},stroke:{draw:function(A,e){const t=Math.sqrt(e)/2;A.moveTo(-t,0),A.lineTo(t,0)}}};function brA(A){return Je(d5A,A)?d5A[A]:bit(A)}var wrA={};function bit(A){if(!Je(wrA,A)){const e=xJ(A);wrA[A]={draw:function(t,i){gv(t,e,0,0,Math.sqrt(i)/2)}}}return wrA[A]}const hp=.448084975506;function wit(A){return A.x}function Dit(A){return A.y}function Git(A){return A.width}function kit(A){return A.height}function gd(A){return typeof A=="function"?A:()=>+A}function S5(A,e,t){return Math.max(e,Math.min(A,t))}function H5(){var A=wit,e=Dit,t=Git,i=kit,n=gd(0),o=n,g=n,a=n,s=null;function I(r,C,l){var c,B=C??+A.call(this,r),E=l??+e.call(this,r),u=+t.call(this,r),d=+i.call(this,r),f=Math.min(u,d)/2,w=S5(+n.call(this,r),0,f),y=S5(+o.call(this,r),0,f),G=S5(+g.call(this,r),0,f),R=S5(+a.call(this,r),0,f);if(s||(s=c=f5()),w<=0&&y<=0&&G<=0&&R<=0)s.rect(B,E,u,d);else{var x=B+u,F=E+d;s.moveTo(B+w,E),s.lineTo(x-y,E),s.bezierCurveTo(x-hp*y,E,x,E+hp*y,x,E+y),s.lineTo(x,F-R),s.bezierCurveTo(x,F-hp*R,x-hp*R,F,x-R,F),s.lineTo(B+G,F),s.bezierCurveTo(B+hp*G,F,B,F-hp*G,B,F-G),s.lineTo(B,E+w),s.bezierCurveTo(B,E+hp*w,B+hp*w,E,B+w,E),s.closePath()}if(c)return s=null,c+""||null}return I.x=function(r){return arguments.length?(A=gd(r),I):A},I.y=function(r){return arguments.length?(e=gd(r),I):e},I.width=function(r){return arguments.length?(t=gd(r),I):t},I.height=function(r){return arguments.length?(i=gd(r),I):i},I.cornerRadius=function(r,C,l,c){return arguments.length?(n=gd(r),o=C!=null?gd(C):n,a=l!=null?gd(l):n,g=c!=null?gd(c):o,I):n},I.context=function(r){return arguments.length?(s=r??null,I):s},I}function DrA(){var A,e,t,i,n=null,o,g,a,s;function I(C,l,c){const B=c/2;if(o){var E=a-l,u=C-g;if(E||u){var d=Math.hypot(E,u),f=(E/=d)*s,w=(u/=d)*s,y=Math.atan2(u,E);n.moveTo(g-f,a-w),n.lineTo(C-E*B,l-u*B),n.arc(C,l,B,y-Math.PI,y),n.lineTo(g+f,a+w),n.arc(g,a,s,y,y+Math.PI)}else n.arc(C,l,B,0,wQ);n.closePath()}else o=1;g=C,a=l,s=B}function r(C){var l,c=C.length,B,E=!1,u;for(n==null&&(n=u=f5()),l=0;l<=c;++l)!(l<c&&i(B=C[l],l,C))===E&&(E=!E)&&(o=0),E&&I(+A(B,l,C),+e(B,l,C),+t(B,l,C));if(u)return n=null,u+""||null}return r.x=function(C){return arguments.length?(A=C,r):A},r.y=function(C){return arguments.length?(e=C,r):e},r.size=function(C){return arguments.length?(t=C,r):t},r.defined=function(C){return arguments.length?(i=C,r):i},r.context=function(C){return arguments.length?(C==null?n=null:n=C,r):n},r}function av(A,e){return A??e}const sv=A=>A.x||0,rv=A=>A.y||0,Jit=A=>A.width||0,Nit=A=>A.height||0,Yit=A=>(A.x||0)+(A.width||0),Rit=A=>(A.y||0)+(A.height||0),xit=A=>A.startAngle||0,Fit=A=>A.endAngle||0,Mit=A=>A.padAngle||0,vit=A=>A.innerRadius||0,Lit=A=>A.outerRadius||0,Sit=A=>A.cornerRadius||0,Hit=A=>av(A.cornerRadiusTopLeft,A.cornerRadius)||0,Zit=A=>av(A.cornerRadiusTopRight,A.cornerRadius)||0,Wit=A=>av(A.cornerRadiusBottomRight,A.cornerRadius)||0,Kit=A=>av(A.cornerRadiusBottomLeft,A.cornerRadius)||0,Uit=A=>av(A.size,64),Vit=A=>A.size||1,Z5=A=>A.defined!==!1,Xit=A=>brA(A.shape||"circle"),zit=UXA().startAngle(xit).endAngle(Fit).padAngle(Mit).innerRadius(vit).outerRadius(Lit).cornerRadius(Sit),Tit=Av().x(sv).y1(rv).y0(Rit).defined(Z5),_it=Av().y(rv).x1(sv).x0(Yit).defined(Z5),Oit=w5().x(sv).y(rv).defined(Z5),qit=H5().x(sv).y(rv).width(Jit).height(Nit).cornerRadius(Hit,Zit,Wit,Kit),jit=r9A().type(Xit).size(Uit),Pit=DrA().x(sv).y(rv).defined(Z5).size(Vit);function GrA(A){return A.cornerRadius||A.cornerRadiusTopLeft||A.cornerRadiusTopRight||A.cornerRadiusBottomRight||A.cornerRadiusBottomLeft}function $it(A,e){return zit.context(A)(e)}function Ant(A,e){const t=e[0],i=t.interpolate||"linear";return(t.orient==="horizontal"?_it:Tit).curve(ov(i,t.orient,t.tension)).context(A)(e)}function ent(A,e){const t=e[0],i=t.interpolate||"linear";return Oit.curve(ov(i,t.orient,t.tension)).context(A)(e)}function MJ(A,e,t,i){return qit.context(A)(e,t,i)}function tnt(A,e){return(e.mark.shape||e.shape).context(A)(e)}function nnt(A,e){return jit.context(A)(e)}function ont(A,e){return Pit.context(A)(e)}var h5A=1;function m5A(){h5A=1}function krA(A,e,t){var i=e.clip,n=A._defs,o=e.clip_id||(e.clip_id="clip"+h5A++),g=n.clipping[o]||(n.clipping[o]={id:o});return Ct(i)?g.path=i(null):GrA(t)?g.path=MJ(null,t,0,0):(g.width=t.width||0,g.height=t.height||0),"url(#"+o+")"}function vo(A){this.clear(),A&&this.union(A)}vo.prototype={clone(){return new vo(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(A){return this.x1===A.x1&&this.y1===A.y1&&this.x2===A.x2&&this.y2===A.y2},set(A,e,t,i){return t<A?(this.x2=A,this.x1=t):(this.x1=A,this.x2=t),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},add(A,e){return A<this.x1&&(this.x1=A),e<this.y1&&(this.y1=e),A>this.x2&&(this.x2=A),e>this.y2&&(this.y2=e),this},expand(A){return this.x1-=A,this.y1-=A,this.x2+=A,this.y2+=A,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(A){return this.x1*=A,this.y1*=A,this.x2*=A,this.y2*=A,this},translate(A,e){return this.x1+=A,this.x2+=A,this.y1+=e,this.y2+=e,this},rotate(A,e,t){const i=this.rotatedPoints(A,e,t);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(A,e,t){var{x1:i,y1:n,x2:o,y2:g}=this,a=Math.cos(A),s=Math.sin(A),I=e-e*a+t*s,r=t-e*s-t*a;return[a*i-s*n+I,s*i+a*n+r,a*i-s*g+I,s*i+a*g+r,a*o-s*n+I,s*o+a*n+r,a*o-s*g+I,s*o+a*g+r]},union(A){return A.x1<this.x1&&(this.x1=A.x1),A.y1<this.y1&&(this.y1=A.y1),A.x2>this.x2&&(this.x2=A.x2),A.y2>this.y2&&(this.y2=A.y2),this},intersect(A){return A.x1>this.x1&&(this.x1=A.x1),A.y1>this.y1&&(this.y1=A.y1),A.x2<this.x2&&(this.x2=A.x2),A.y2<this.y2&&(this.y2=A.y2),this},encloses(A){return A&&this.x1<=A.x1&&this.x2>=A.x2&&this.y1<=A.y1&&this.y2>=A.y2},alignsWith(A){return A&&(this.x1==A.x1||this.x2==A.x2||this.y1==A.y1||this.y2==A.y2)},intersects(A){return A&&!(this.x2<A.x1||this.x1>A.x2||this.y2<A.y1||this.y1>A.y2)},contains(A,e){return!(A<this.x1||A>this.x2||e<this.y1||e>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function W5(A){this.mark=A,this.bounds=this.bounds||new vo}function K5(A){W5.call(this,A),this.items=this.items||[]}_A(K5,W5);function JrA(A){this._pending=0,this._loader=A||i5()}function p5A(A){A._pending+=1}function Iv(A){A._pending-=1}JrA.prototype={pending(){return this._pending},sanitizeURL(A){const e=this;return p5A(e),e._loader.sanitize(A,{context:"href"}).then(t=>(Iv(e),t)).catch(()=>(Iv(e),null))},loadImage(A){const e=this,t=Stt();return p5A(e),e._loader.sanitize(A,{context:"image"}).then(i=>{const n=i.href;if(!n||!t)throw{url:n};const o=new t,g=Je(i,"crossOrigin")?i.crossOrigin:"anonymous";return g!=null&&(o.crossOrigin=g),o.onload=()=>Iv(e),o.onerror=()=>Iv(e),o.src=n,o}).catch(i=>(Iv(e),{complete:!1,width:0,height:0,src:i&&i.url||""}))},ready(){const A=this;return new Promise(e=>{function t(i){A.pending()?setTimeout(()=>{t(!0)},10):e(i)}t(!1)})}};function ad(A,e,t){if(e.stroke&&e.opacity!==0&&e.strokeOpacity!==0){const i=e.strokeWidth!=null?+e.strokeWidth:1;A.expand(i+(t?gnt(e,i):0))}return A}function gnt(A,e){return A.strokeJoin&&A.strokeJoin!=="miter"?0:e}const ant=wQ-1e-8;let U5,V5,X5,Qb,NrA,z5,YrA,RrA;const mp=(A,e)=>U5.add(A,e),T5=(A,e)=>mp(V5=A,X5=e),f5A=A=>mp(A,U5.y1),y5A=A=>mp(U5.x1,A),Eb=(A,e)=>NrA*A+YrA*e,ub=(A,e)=>z5*A+RrA*e,xrA=(A,e)=>mp(Eb(A,e),ub(A,e)),FrA=(A,e)=>T5(Eb(A,e),ub(A,e));function Cv(A,e){return U5=A,e?(Qb=e*dp,NrA=RrA=Math.cos(Qb),z5=Math.sin(Qb),YrA=-z5):(NrA=RrA=1,Qb=z5=YrA=0),snt}const snt={beginPath(){},closePath(){},moveTo:FrA,lineTo:FrA,rect(A,e,t,i){Qb?(xrA(A+t,e),xrA(A+t,e+i),xrA(A,e+i),FrA(A,e)):(mp(A+t,e+i),T5(A,e))},quadraticCurveTo(A,e,t,i){const n=Eb(A,e),o=ub(A,e),g=Eb(t,i),a=ub(t,i);b5A(V5,n,g,f5A),b5A(X5,o,a,y5A),T5(g,a)},bezierCurveTo(A,e,t,i,n,o){const g=Eb(A,e),a=ub(A,e),s=Eb(t,i),I=ub(t,i),r=Eb(n,o),C=ub(n,o);w5A(V5,g,s,r,f5A),w5A(X5,a,I,C,y5A),T5(r,C)},arc(A,e,t,i,n,o){if(i+=Qb,n+=Qb,V5=t*Math.cos(n)+A,X5=t*Math.sin(n)+e,Math.abs(n-i)>ant)mp(A-t,e-t),mp(A+t,e+t);else{const g=I=>mp(t*Math.cos(I)+A,t*Math.sin(I)+e);let a,s;if(g(i),g(n),n!==i)if(i=i%wQ,i<0&&(i+=wQ),n=n%wQ,n<0&&(n+=wQ),n<i&&(o=!o,a=i,i=n,n=a),o)for(n-=wQ,a=i-i%Bb,s=0;s<4&&a>n;++s,a-=Bb)g(a);else for(a=i-i%Bb+Bb,s=0;s<4&&a<n;++s,a=a+Bb)g(a)}}};function b5A(A,e,t,i){const n=(A-e)/(A+t-2*e);0<n&&n<1&&i(A+(e-A)*n)}function w5A(A,e,t,i,n){const o=i-A+3*e-3*t,g=A+t-2*e,a=A-e;let s=0,I=0,r;Math.abs(o)>mit?(r=g*g+a*o,r>=0&&(r=Math.sqrt(r),s=(-g+r)/o,I=(-g-r)/o)):s=.5*a/g,0<s&&s<1&&n(D5A(s,A,e,t,i)),0<I&&I<1&&n(D5A(I,A,e,t,i))}function D5A(A,e,t,i,n){const o=1-A,g=o*o,a=A*A;return g*o*e+3*g*A*t+3*o*a*i+a*A*n}var pp=(pp=up(1,1))?pp.getContext("2d"):null;const MrA=new vo;function vrA(A){return function(e,t){if(!pp)return!0;A(pp,e),MrA.clear().union(e.bounds).intersect(t).round();const{x1:i,y1:n,x2:o,y2:g}=MrA;for(let a=n;a<=g;++a)for(let s=i;s<=o;++s)if(pp.isPointInPath(s,a))return!0;return!1}}function LrA(A,e){return e.contains(A.x||0,A.y||0)}function G5A(A,e){const t=A.x||0,i=A.y||0,n=A.width||0,o=A.height||0;return e.intersects(MrA.set(t,i,t+n,i+o))}function k5A(A,e){const t=A.x||0,i=A.y||0,n=A.x2!=null?A.x2:t,o=A.y2!=null?A.y2:i;return vJ(e,t,i,n,o)}function vJ(A,e,t,i,n){const{x1:o,y1:g,x2:a,y2:s}=A,I=i-e,r=n-t;let C=0,l=1,c,B,E,u;for(u=0;u<4;++u){if(u===0&&(c=-I,B=-(o-e)),u===1&&(c=I,B=a-e),u===2&&(c=-r,B=-(g-t)),u===3&&(c=r,B=s-t),Math.abs(c)<1e-10&&B<0)return!1;if(E=B/c,c<0){if(E>l)return!1;E>C&&(C=E)}else if(c>0){if(E<C)return!1;E<l&&(l=E)}}return!0}function LJ(A,e){A.globalCompositeOperation=e.blend||"source-over"}function bc(A,e){return A??e}function J5A(A,e){const t=e.length;for(let i=0;i<t;++i)A.addColorStop(e[i].offset,e[i].color);return A}function rnt(A,e,t){const i=t.width(),n=t.height();let o;if(e.gradient==="radial")o=A.createRadialGradient(t.x1+bc(e.x1,.5)*i,t.y1+bc(e.y1,.5)*n,Math.max(i,n)*bc(e.r1,0),t.x1+bc(e.x2,.5)*i,t.y1+bc(e.y2,.5)*n,Math.max(i,n)*bc(e.r2,.5));else{const g=bc(e.x1,0),a=bc(e.y1,0),s=bc(e.x2,1),I=bc(e.y2,0);if(g===s||a===I||i===n)o=A.createLinearGradient(t.x1+g*i,t.y1+a*n,t.x1+s*i,t.y1+I*n);else{const r=up(Math.ceil(i),Math.ceil(n)),C=r.getContext("2d");return C.scale(i,n),C.fillStyle=J5A(C.createLinearGradient(g,a,s,I),e.stops),C.fillRect(0,0,i,n),A.createPattern(r,"no-repeat")}}return J5A(o,e.stops)}function N5A(A,e,t){return prA(t)?rnt(A,t,e.bounds):t}function _5(A,e,t){return t*=e.fillOpacity==null?1:e.fillOpacity,t>0?(A.globalAlpha=t,A.fillStyle=N5A(A,e,e.fill),!0):!1}var Int=[];function SJ(A,e,t){var i=(i=e.strokeWidth)!=null?i:1;return i<=0?!1:(t*=e.strokeOpacity==null?1:e.strokeOpacity,t>0?(A.globalAlpha=t,A.strokeStyle=N5A(A,e,e.stroke),A.lineWidth=i,A.lineCap=e.strokeCap||"butt",A.lineJoin=e.strokeJoin||"miter",A.miterLimit=e.strokeMiterLimit||10,A.setLineDash&&(A.setLineDash(e.strokeDash||Int),A.lineDashOffset=e.strokeDashOffset||0),!0):!1)}function Cnt(A,e){return A.zindex-e.zindex||A.index-e.index}function SrA(A){if(!A.zdirty)return A.zitems;var e=A.items,t=[],i,n,o;for(n=0,o=e.length;n<o;++n)i=e[n],i.index=n,i.zindex&&t.push(i);return A.zdirty=!1,A.zitems=t.sort(Cnt)}function qn(A,e){var t=A.items,i,n;if(!t||!t.length)return;const o=SrA(A);if(o&&o.length){for(i=0,n=t.length;i<n;++i)t[i].zindex||e(t[i]);t=o}for(i=0,n=t.length;i<n;++i)e(t[i])}function O5(A,e){var t=A.items,i,n;if(!t||!t.length)return null;const o=SrA(A);for(o&&o.length&&(t=o),n=t.length;--n>=0;)if(i=e(t[n]))return i;if(t===o){for(t=A.items,n=t.length;--n>=0;)if(!t[n].zindex&&(i=e(t[n])))return i}return null}function HrA(A){return function(e,t,i){qn(t,n=>{(!i||i.intersects(n.bounds))&&Y5A(A,e,n,n)})}}function lnt(A){return function(e,t,i){t.items.length&&(!i||i.intersects(t.bounds))&&Y5A(A,e,t.items[0],t.items)}}function Y5A(A,e,t,i){var n=t.opacity==null?1:t.opacity;n!==0&&(A(e,i)||(LJ(e,t),t.fill&&_5(e,t,n)&&e.fill(),t.stroke&&SJ(e,t,n)&&e.stroke()))}function q5(A){return A=A||el,function(e,t,i,n,o,g){return i*=e.pixelRatio,n*=e.pixelRatio,O5(t,a=>{const s=a.bounds;if(!(s&&!s.contains(o,g)||!s)&&A(e,a,i,n,o,g))return a})}}function lv(A,e){return function(t,i,n,o){var g=Array.isArray(i)?i[0]:i,a=e??g.fill,s=g.stroke&&t.isPointInStroke,I,r;return s&&(I=g.strokeWidth,r=g.strokeCap,t.lineWidth=I??1,t.lineCap=r??"butt"),A(t,i)?!1:a&&t.isPointInPath(n,o)||s&&t.isPointInStroke(n,o)}}function ZrA(A){return q5(lv(A))}function db(A,e){return"translate("+A+","+e+")"}function WrA(A){return"rotate("+A+")"}function cnt(A,e){return"scale("+A+","+e+")"}function R5A(A){return db(A.x||0,A.y||0)}function Bnt(A){return db(A.x||0,A.y||0)+(A.angle?" "+WrA(A.angle):"")}function Qnt(A){return db(A.x||0,A.y||0)+(A.angle?" "+WrA(A.angle):"")+(A.scaleX||A.scaleY?" "+cnt(A.scaleX||1,A.scaleY||1):"")}function KrA(A,e,t){function i(g,a){g("transform",Bnt(a)),g("d",e(null,a))}function n(g,a){return e(Cv(g,a.angle),a),ad(g,a).translate(a.x||0,a.y||0)}function o(g,a){var s=a.x||0,I=a.y||0,r=a.angle||0;g.translate(s,I),r&&g.rotate(r*=dp),g.beginPath(),e(g,a),r&&g.rotate(-r),g.translate(-s,-I)}return{type:A,tag:"path",nested:!1,attr:i,bound:n,draw:HrA(o),pick:ZrA(o),isect:t||vrA(o)}}var Ent=KrA("arc",$it);function unt(A,e){for(var t=A[0].orient==="horizontal"?e[1]:e[0],i=A[0].orient==="horizontal"?"y":"x",n=A.length,o=1/0,g,a;--n>=0;)A[n].defined!==!1&&(a=Math.abs(A[n][i]-t),a<o&&(o=a,g=A[n]));return g}function dnt(A,e){for(var t=Math.pow(A[0].strokeWidth||1,2),i=A.length,n,o,g;--i>=0;)if(A[i].defined!==!1&&(n=A[i].x-e[0],o=A[i].y-e[1],g=n*n+o*o,g<t))return A[i];return null}function hnt(A,e){for(var t=A.length,i,n,o;--t>=0;)if(A[t].defined!==!1&&(i=A[t].x-e[0],n=A[t].y-e[1],o=i*i+n*n,i=A[t].size||1,o<i*i))return A[t];return null}function UrA(A,e,t){function i(s,I){var r=I.mark.items;r.length&&s("d",e(null,r))}function n(s,I){var r=I.items;return r.length===0?s:(e(Cv(s),r),ad(s,r[0]))}function o(s,I){s.beginPath(),e(s,I)}const g=lv(o);function a(s,I,r,C,l,c){var B=I.items,E=I.bounds;return!B||!B.length||E&&!E.contains(l,c)?null:(r*=s.pixelRatio,C*=s.pixelRatio,g(s,B,r,C)?B[0]:null)}return{type:A,tag:"path",nested:!0,attr:i,bound:n,draw:lnt(o),pick:a,isect:LrA,tip:t}}var mnt=UrA("area",Ant,unt);function pnt(A,e){var t=e.clip;A.save(),Ct(t)?(A.beginPath(),t(A),A.clip()):x5A(A,e.group)}function x5A(A,e){A.beginPath(),GrA(e)?MJ(A,e,0,0):A.rect(0,0,e.width||0,e.height||0),A.clip()}function F5A(A){const e=bc(A.strokeWidth,1);return A.strokeOffset!=null?A.strokeOffset:A.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function fnt(A,e){A("transform",R5A(e))}function M5A(A,e){const t=F5A(e);A("d",MJ(null,e,t,t))}function ynt(A,e){A("class","background"),A("aria-hidden",!0),M5A(A,e)}function bnt(A,e){A("class","foreground"),A("aria-hidden",!0),e.strokeForeground?M5A(A,e):A("d","")}function wnt(A,e,t){const i=e.clip?krA(t,e,e):null;A("clip-path",i)}function Dnt(A,e){if(!e.clip&&e.items){const t=e.items,i=t.length;for(let n=0;n<i;++n)A.union(t[n].bounds)}return(e.clip||e.width||e.height)&&!e.noBound&&A.add(0,0).add(e.width||0,e.height||0),ad(A,e),A.translate(e.x||0,e.y||0)}function cv(A,e,t,i){const n=F5A(e);A.beginPath(),MJ(A,e,(t||0)+n,(i||0)+n)}const Gnt=lv(cv),knt=lv(cv,!1),Jnt=lv(cv,!0);function Nnt(A,e,t,i){qn(e,n=>{const o=n.x||0,g=n.y||0,a=n.strokeForeground,s=n.opacity==null?1:n.opacity;(n.stroke||n.fill)&&s&&(cv(A,n,o,g),LJ(A,n),n.fill&&_5(A,n,s)&&A.fill(),n.stroke&&!a&&SJ(A,n,s)&&A.stroke()),A.save(),A.translate(o,g),n.clip&&x5A(A,n),t&&t.translate(-o,-g),qn(n,I=>{(I.marktype==="group"||i==null||i.includes(I.marktype))&&this.draw(A,I,t,i)}),t&&t.translate(o,g),A.restore(),a&&n.stroke&&s&&(cv(A,n,o,g),LJ(A,n),SJ(A,n,s)&&A.stroke())})}function Ynt(A,e,t,i,n,o){if(e.bounds&&!e.bounds.contains(n,o)||!e.items)return null;const g=t*A.pixelRatio,a=i*A.pixelRatio;return O5(e,s=>{let I,r,C;const l=s.bounds;if(l&&!l.contains(n,o))return;r=s.x||0,C=s.y||0;const c=r+(s.width||0),B=C+(s.height||0),E=s.clip;if(E&&(n<r||n>c||o<C||o>B))return;if(A.save(),A.translate(r,C),r=n-r,C=o-C,E&&GrA(s)&&!Jnt(A,s,g,a))return A.restore(),null;const u=s.strokeForeground,d=e.interactive!==!1;return d&&u&&s.stroke&&knt(A,s,g,a)?(A.restore(),s):(I=O5(s,f=>Rnt(f,r,C)?this.pick(f,t,i,r,C):null),!I&&d&&(s.fill||!u&&s.stroke)&&Gnt(A,s,g,a)&&(I=s),A.restore(),I||null)})}function Rnt(A,e,t){return(A.interactive!==!1||A.marktype==="group")&&A.bounds&&A.bounds.contains(e,t)}var xnt={type:"group",tag:"g",nested:!1,attr:fnt,bound:Dnt,draw:Nnt,pick:Ynt,isect:G5A,content:wnt,background:ynt,foreground:bnt},Bv={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function VrA(A,e){var t=A.image;return(!t||A.url&&A.url!==t.url)&&(t={complete:!1,width:0,height:0},e.loadImage(A.url).then(i=>{A.image=i,A.image.url=A.url})),t}function XrA(A,e){return A.width!=null?A.width:!e||!e.width?0:A.aspect!==!1&&A.height?A.height*e.width/e.height:e.width}function zrA(A,e){return A.height!=null?A.height:!e||!e.height?0:A.aspect!==!1&&A.width?A.width*e.height/e.width:e.height}function j5(A,e){return A==="center"?e/2:A==="right"?e:0}function P5(A,e){return A==="middle"?e/2:A==="bottom"?e:0}function Fnt(A,e,t){const i=VrA(e,t),n=XrA(e,i),o=zrA(e,i),g=(e.x||0)-j5(e.align,n),a=(e.y||0)-P5(e.baseline,o),s=!i.src&&i.toDataURL?i.toDataURL():i.src||"";A("href",s,Bv["xmlns:xlink"],"xlink:href"),A("transform",db(g,a)),A("width",n),A("height",o),A("preserveAspectRatio",e.aspect===!1?"none":"xMidYMid")}function Mnt(A,e){const t=e.image,i=XrA(e,t),n=zrA(e,t),o=(e.x||0)-j5(e.align,i),g=(e.y||0)-P5(e.baseline,n);return A.set(o,g,o+i,g+n)}function vnt(A,e,t){qn(e,i=>{if(t&&!t.intersects(i.bounds))return;const n=VrA(i,this);let o=XrA(i,n),g=zrA(i,n);if(o===0||g===0)return;let a=(i.x||0)-j5(i.align,o),s=(i.y||0)-P5(i.baseline,g),I,r,C,l;i.aspect!==!1&&(r=n.width/n.height,C=i.width/i.height,r===r&&C===C&&r!==C&&(C<r?(l=o/r,s+=(g-l)/2,g=l):(l=g*r,a+=(o-l)/2,o=l))),(n.complete||n.toDataURL)&&(LJ(A,i),A.globalAlpha=(I=i.opacity)!=null?I:1,A.imageSmoothingEnabled=i.smooth!==!1,A.drawImage(n,a,s,o,g))})}var Lnt={type:"image",tag:"image",nested:!1,attr:Fnt,bound:Mnt,draw:vnt,pick:q5(),isect:el,get:VrA,xOffset:j5,yOffset:P5},Snt=UrA("line",ent,dnt);function Hnt(A,e){var t=e.scaleX||1,i=e.scaleY||1;(t!==1||i!==1)&&A("vector-effect","non-scaling-stroke"),A("transform",Qnt(e)),A("d",e.path)}function $5(A,e){var t=e.path;if(t==null)return!0;var i=e.x||0,n=e.y||0,o=e.scaleX||1,g=e.scaleY||1,a=(e.angle||0)*dp,s=e.pathCache;(!s||s.path!==t)&&((e.pathCache=s=xJ(t)).path=t),a&&A.rotate&&A.translate?(A.translate(i,n),A.rotate(a),gv(A,s,0,0,o,g),A.rotate(-a),A.translate(-i,-n)):gv(A,s,i,n,o,g)}function Znt(A,e){return $5(Cv(A,e.angle),e)?A.set(0,0,0,0):ad(A,e,!0)}var Wnt={type:"path",tag:"path",nested:!1,attr:Hnt,bound:Znt,draw:HrA($5),pick:ZrA($5),isect:vrA($5)};function Knt(A,e){A("d",MJ(null,e))}function Unt(A,e){var t,i;return ad(A.set(t=e.x||0,i=e.y||0,t+e.width||0,i+e.height||0),e)}function v5A(A,e){A.beginPath(),MJ(A,e)}var Vnt={type:"rect",tag:"path",nested:!1,attr:Knt,bound:Unt,draw:HrA(v5A),pick:ZrA(v5A),isect:G5A};function Xnt(A,e){A("transform",R5A(e)),A("x2",e.x2!=null?e.x2-(e.x||0):0),A("y2",e.y2!=null?e.y2-(e.y||0):0)}function znt(A,e){var t,i;return ad(A.set(t=e.x||0,i=e.y||0,e.x2!=null?e.x2:t,e.y2!=null?e.y2:i),e)}function L5A(A,e,t){var i,n,o,g;return e.stroke&&SJ(A,e,t)?(i=e.x||0,n=e.y||0,o=e.x2!=null?e.x2:i,g=e.y2!=null?e.y2:n,A.beginPath(),A.moveTo(i,n),A.lineTo(o,g),!0):!1}function Tnt(A,e,t){qn(e,i=>{if(!(t&&!t.intersects(i.bounds))){var n=i.opacity==null?1:i.opacity;n&&L5A(A,i,n)&&(LJ(A,i),A.stroke())}})}function _nt(A,e,t,i){return A.isPointInStroke?L5A(A,e,1)&&A.isPointInStroke(t,i):!1}var Ont={type:"rule",tag:"line",nested:!1,attr:Xnt,bound:znt,draw:Tnt,pick:q5(_nt),isect:k5A},qnt=KrA("shape",tnt),jnt=KrA("symbol",nnt,LrA);const S5A=zUA();var GI={height:DQ,measureWidth:TrA,estimateWidth:Az,width:Az,canvas:H5A};H5A(!0);function H5A(A){GI.width=A&&pp?TrA:Az}function Az(A,e){return Z5A(yp(A,e),DQ(A))}function Z5A(A,e){return~~(.8*A.length*e)}function TrA(A,e){return DQ(A)<=0||!(e=yp(A,e))?0:W5A(e,ez(A))}function W5A(A,e){const t=`(${e}) ${A}`;let i=S5A.get(t);return i===void 0&&(pp.font=e,i=pp.measureText(A).width,S5A.set(t,i)),i}function DQ(A){return A.fontSize!=null?+A.fontSize||0:11}function fp(A){return A.lineHeight!=null?A.lineHeight:DQ(A)+2}function Pnt(A){return RA(A)?A.length>1?A:A[0]:A}function Qv(A){return Pnt(A.lineBreak&&A.text&&!RA(A.text)?A.text.split(A.lineBreak):A.text)}function _rA(A){const e=Qv(A);return(RA(e)?e.length-1:0)*fp(A)}function yp(A,e){const t=e==null?"":(e+"").trim();return A.limit>0&&t.length?Aot(A,t):t}function $nt(A){if(GI.width===TrA){const e=ez(A);return t=>W5A(t,e)}else if(GI.width===Az){const e=DQ(A);return t=>Z5A(t,e)}else return e=>GI.width(A,e)}function Aot(A,e){var t=+A.limit,i=$nt(A);if(i(e)<t)return e;var n=A.ellipsis||"…",o=A.dir==="rtl",g=0,a=e.length,s;if(t-=i(n),o){for(;g<a;)s=g+a>>>1,i(e.slice(s))>t?g=s+1:a=s;return n+e.slice(g)}else{for(;g<a;)s=1+(g+a>>>1),i(e.slice(0,s))<t?g=s:a=s-1;return e.slice(0,g)+n}}function Ev(A,e){var t=A.font;return(e&&t?String(t).replace(/"/g,"'"):t)||"sans-serif"}function ez(A,e){return(A.fontStyle?A.fontStyle+" ":"")+(A.fontVariant?A.fontVariant+" ":"")+(A.fontWeight?A.fontWeight+" ":"")+DQ(A)+"px "+Ev(A,e)}function OrA(A){var e=A.baseline,t=DQ(A);return Math.round(e==="top"?.79*t:e==="middle"?.3*t:e==="bottom"?-.21*t:e==="line-top"?.29*t+.5*fp(A):e==="line-bottom"?.29*t-.5*fp(A):0)}const eot={left:"start",center:"middle",right:"end"},uv=new vo;function tz(A){var e=A.x||0,t=A.y||0,i=A.radius||0,n;return i&&(n=(A.theta||0)-Bb,e+=i*Math.cos(n),t+=i*Math.sin(n)),uv.x1=e,uv.y1=t,uv}function tot(A,e){var t=e.dx||0,i=(e.dy||0)+OrA(e),n=tz(e),o=n.x1,g=n.y1,a=e.angle||0,s;A("text-anchor",eot[e.align]||"start"),a?(s=db(o,g)+" "+WrA(a),(t||i)&&(s+=" "+db(t,i))):s=db(o+t,g+i),A("transform",s)}function qrA(A,e,t){var i=GI.height(e),n=e.align,o=tz(e),g=o.x1,a=o.y1,s=e.dx||0,I=(e.dy||0)+OrA(e)-Math.round(.8*i),r=Qv(e),C;if(RA(r)?(i+=fp(e)*(r.length-1),C=r.reduce((l,c)=>Math.max(l,GI.width(e,c)),0)):C=GI.width(e,r),n==="center"?s-=C/2:n==="right"&&(s-=C),A.set(s+=g,I+=a,s+C,I+i),e.angle&&!t)A.rotate(e.angle*dp,g,a);else if(t===2)return A.rotatedPoints(e.angle*dp,g,a);return A}function iot(A,e,t){qn(e,i=>{var n=i.opacity==null?1:i.opacity,o,g,a,s,I,r,C;if(!(t&&!t.intersects(i.bounds)||n===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(A.font=ez(i),A.textAlign=i.align||"left",o=tz(i),g=o.x1,a=o.y1,i.angle&&(A.save(),A.translate(g,a),A.rotate(i.angle*dp),g=a=0),g+=i.dx||0,a+=(i.dy||0)+OrA(i),r=Qv(i),LJ(A,i),RA(r))for(I=fp(i),s=0;s<r.length;++s)C=yp(i,r[s]),i.fill&&_5(A,i,n)&&A.fillText(C,g,a),i.stroke&&SJ(A,i,n)&&A.strokeText(C,g,a),a+=I;else C=yp(i,r),i.fill&&_5(A,i,n)&&A.fillText(C,g,a),i.stroke&&SJ(A,i,n)&&A.strokeText(C,g,a);i.angle&&A.restore()}})}function not(A,e,t,i,n,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var g=tz(e),a=g.x1,s=g.y1,I=qrA(uv,e,1),r=-e.angle*dp,C=Math.cos(r),l=Math.sin(r),c=C*n-l*o+(a-C*a+l*s),B=l*n+C*o+(s-l*a-C*s);return I.contains(c,B)}function oot(A,e){const t=qrA(uv,A,2);return vJ(e,t[0],t[1],t[2],t[3])||vJ(e,t[0],t[1],t[4],t[5])||vJ(e,t[4],t[5],t[6],t[7])||vJ(e,t[2],t[3],t[6],t[7])}var got={type:"text",tag:"text",nested:!1,attr:tot,bound:qrA,draw:iot,pick:q5(not),isect:oot},aot=UrA("trail",ont,hnt),va={arc:Ent,area:mnt,group:xnt,image:Lnt,line:Snt,path:Wnt,rect:Vnt,rule:Ont,shape:qnt,symbol:jnt,text:got,trail:aot};function jrA(A,e,t){var i=va[A.mark.marktype],n=e||i.bound;return i.nested&&(A=A.mark),n(A.bounds||(A.bounds=new vo),A,t)}var K5A={mark:null};function U5A(A,e,t){var i=va[A.marktype],n=i.bound,o=A.items,g=o&&o.length,a,s,I,r;if(i.nested)return g?I=o[0]:(K5A.mark=A,I=K5A),r=jrA(I,n,t),e=e&&e.union(r)||r,e;if(e=e||A.bounds&&A.bounds.clear()||new vo,g)for(a=0,s=o.length;a<s;++a)e.union(jrA(o[a],n,t));return A.bounds=e}const sot=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function V5A(A,e){return JSON.stringify(A,sot,e)}function X5A(A){const e=typeof A=="string"?JSON.parse(A):A;return z5A(e)}function z5A(A){var e=A.marktype,t=A.items,i,n,o;if(t)for(n=0,o=t.length;n<o;++n)i=e?"mark":"group",t[n][i]=A,t[n].zindex&&(t[n][i].zdirty=!0),(e||i)==="group"&&z5A(t[n]);return e&&U5A(A),A}function PrA(A){arguments.length?this.root=X5A(A):(this.root=T5A({marktype:"group",name:"root",role:"frame"}),this.root.items=[new K5(this.root)])}PrA.prototype={toJSON(A){return V5A(this.root,A||0)},mark(A,e,t){e=e||this.root.items[0];const i=T5A(A,e);return e.items[t]=i,i.zindex&&(i.group.zdirty=!0),i}};function T5A(A,e){const t={bounds:new vo,clip:!!A.clip,group:e,interactive:A.interactive!==!1,items:[],marktype:A.marktype,name:A.name||void 0,role:A.role||void 0,zindex:A.zindex||0};return A.aria!=null&&(t.aria=A.aria),A.description&&(t.description=A.description),t}function bp(A,e,t){return!A&&typeof document<"u"&&document.createElement&&(A=document),A?t?A.createElementNS(t,e):A.createElement(e):null}function $rA(A,e){e=e.toLowerCase();for(var t=A.childNodes,i=0,n=t.length;i<n;++i)if(t[i].tagName.toLowerCase()===e)return t[i]}function $o(A,e,t,i){var n=A.childNodes[e],o;return(!n||n.tagName.toLowerCase()!==t.toLowerCase())&&(o=n||null,n=bp(A.ownerDocument,t,i),A.insertBefore(n,o)),n}function kI(A,e){for(var t=A.childNodes,i=t.length;i>e;)A.removeChild(t[--i]);return A}function _5A(A){return"mark-"+A.marktype+(A.role?" role-"+A.role:"")+(A.name?" "+A.name:"")}function iz(A,e){const t=e.getBoundingClientRect();return[A.clientX-t.left-(e.clientLeft||0),A.clientY-t.top-(e.clientTop||0)]}function rot(A,e,t,i){var n=A&&A.mark,o,g;if(n&&(o=va[n.marktype]).tip){for(g=iz(e,t),g[0]-=i[0],g[1]-=i[1];A=A.mark.group;)g[0]-=A.x||0,g[1]-=A.y||0;A=o.tip(n.items,g)}return A}function wp(A,e){this._active=null,this._handlers={},this._loader=A||i5(),this._tooltip=e||Iot}function Iot(A,e,t,i){A.element().setAttribute("title",i||"")}wp.prototype={initialize(A,e,t){return this._el=A,this._obj=t||null,this.origin(e)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(A){return arguments.length?(this._origin=A||[0,0],this):this._origin.slice()},scene(A){return arguments.length?(this._scene=A,this):this._scene},on(){},off(){},_handlerIndex(A,e,t){for(let i=A?A.length:0;--i>=0;)if(A[i].type===e&&(!t||A[i].handler===t))return i;return-1},handlers(A){const e=this._handlers,t=[];if(A)t.push(...e[this.eventName(A)]);else for(const i in e)t.push(...e[i]);return t},eventName(A){const e=A.indexOf(".");return e<0?A:A.slice(0,e)},handleHref(A,e,t){this._loader.sanitize(t,{context:"href"}).then(i=>{const n=new MouseEvent(A.type,A),o=bp(null,"a");for(const g in i)o.setAttribute(g,i[g]);o.dispatchEvent(n)}).catch(()=>{})},handleTooltip(A,e,t){if(e&&e.tooltip!=null){e=rot(e,A,this.canvas(),this._origin);const i=t&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,A,e,i)}},getItemBoundingClientRect(A){const e=this.canvas();if(!e)return;const t=e.getBoundingClientRect(),i=this._origin,n=A.bounds,o=n.width(),g=n.height();let a=n.x1+i[0]+t.left,s=n.y1+i[1]+t.top;for(;A.mark&&(A=A.mark.group);)a+=A.x||0,s+=A.y||0;return{x:a,y:s,width:o,height:g,left:a,top:s,right:a+o,bottom:s+g}}};function La(A){this._el=null,this._bgcolor=null,this._loader=new JrA(A)}La.prototype={initialize(A,e,t,i,n){return this._el=A,this.resize(e,t,i,n)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(A){return arguments.length===0?this._bgcolor:(this._bgcolor=A,this)},resize(A,e,t,i){return this._width=A,this._height=e,this._origin=t||[0,0],this._scale=i||1,this},dirty(){},render(A,e){const t=this;return t._call=function(){t._render(A,e)},t._call(),t._call=null,t},_render(){},renderAsync(A,e){const t=this.render(A,e);return this._ready?this._ready.then(()=>t):Promise.resolve(t)},_load(A,e){var t=this,i=t._loader[A](e);if(!t._ready){const n=t._call;t._ready=t._loader.ready().then(o=>{o&&n(),t._ready=null})}return i},sanitizeURL(A){return this._load("sanitizeURL",A)},loadImage(A){return this._load("loadImage",A)}};const Cot="keydown",lot="keypress",cot="keyup",O5A="dragenter",nz="dragleave",q5A="dragover",AIA="pointerdown",Bot="pointerup",oz="pointermove",dv="pointerout",j5A="pointerover",eIA="mousedown",Qot="mouseup",P5A="mousemove",tIA="mouseout",$5A="mouseover",gz="click",Eot="dblclick",uot="wheel",AzA="mousewheel",az="touchstart",sz="touchmove",rz="touchend",hot=[Cot,lot,cot,O5A,nz,q5A,AIA,Bot,oz,dv,j5A,eIA,Qot,P5A,tIA,$5A,gz,Eot,uot,AzA,az,sz,rz],iIA=oz,hv=dv,nIA=gz;function sl(A,e){wp.call(this,A,e),this._down=null,this._touch=null,this._first=!0,this._events={}}const mot=A=>A===az||A===sz||A===rz?[az,sz,rz]:[A];function ezA(A,e){mot(e).forEach(t=>pot(A,t))}function pot(A,e){const t=A.canvas();t&&!A._events[e]&&(A._events[e]=1,t.addEventListener(e,A[e]?i=>A[e](i):i=>A.fire(e,i)))}function mv(A,e,t){e.forEach(i=>A.fire(i,t))}function tzA(A,e,t){return function(i){const n=this._active,o=this.pickEvent(i);o===n?mv(this,A,i):((!n||!n.exit)&&mv(this,t,i),this._active=o,mv(this,e,i),mv(this,A,i))}}function izA(A){return function(e){mv(this,A,e),this._active=null}}_A(sl,wp,{initialize(A,e,t){return this._canvas=A&&$rA(A,"canvas"),[gz,eIA,AIA,oz,dv,nz].forEach(i=>ezA(this,i)),wp.prototype.initialize.call(this,A,e,t)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:hot,DOMMouseScroll(A){this.fire(AzA,A)},pointermove:tzA([oz,P5A],[j5A,$5A],[dv,tIA]),dragover:tzA([q5A],[O5A],[nz]),pointerout:izA([dv,tIA]),dragleave:izA([nz]),pointerdown(A){this._down=this._active,this.fire(AIA,A)},mousedown(A){this._down=this._active,this.fire(eIA,A)},click(A){this._down===this._active&&(this.fire(gz,A),this._down=null)},touchstart(A){this._touch=this.pickEvent(A.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(az,A,!0)},touchmove(A){this.fire(sz,A,!0)},touchend(A){this.fire(rz,A,!0),this._touch=null},fire(A,e,t){const i=t?this._touch:this._active,n=this._handlers[A];if(e.vegaType=A,A===nIA&&i&&i.href?this.handleHref(e,i,i.href):(A===iIA||A===hv)&&this.handleTooltip(e,i,A!==hv),n)for(let o=0,g=n.length;o<g;++o)n[o].handler.call(this._obj,e,i)},on(A,e){const t=this.eventName(A),i=this._handlers;return this._handlerIndex(i[t],A,e)<0&&(ezA(this,A),(i[t]||(i[t]=[])).push({type:A,handler:e})),this},off(A,e){const t=this.eventName(A),i=this._handlers[t],n=this._handlerIndex(i,A,e);return n>=0&&i.splice(n,1),this},pickEvent(A){const e=iz(A,this._canvas),t=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-t[0],e[1]-t[1])},pick(A,e,t,i,n){const o=this.context();return va[A.marktype].pick.call(this,o,A,e,t,i,n)}});function fot(){return typeof window<"u"&&window.devicePixelRatio||1}var yot=fot();function bot(A,e,t,i,n,o){const g=typeof HTMLElement<"u"&&A instanceof HTMLElement&&A.parentNode!=null,a=A.getContext("2d"),s=g?yot:n;A.width=e*s,A.height=t*s;for(const I in o)a[I]=o[I];return g&&s!==1&&(A.style.width=e+"px",A.style.height=t+"px"),a.pixelRatio=s,a.setTransform(s,0,0,s,s*i[0],s*i[1]),A}function pv(A){La.call(this,A),this._options={},this._redraw=!1,this._dirty=new vo,this._tempb=new vo}const nzA=La.prototype,wot=(A,e,t)=>new vo().set(0,0,e,t).translate(-A[0],-A[1]);function Dot(A,e,t){return e.expand(1).round(),A.pixelRatio%1&&e.scale(A.pixelRatio).round().scale(1/A.pixelRatio),e.translate(-(t[0]%1),-(t[1]%1)),A.beginPath(),A.rect(e.x1,e.y1,e.width(),e.height()),A.clip(),e}_A(pv,La,{initialize(A,e,t,i,n,o){return this._options=o||{},this._canvas=this._options.externalContext?null:up(1,1,this._options.type),A&&this._canvas&&(kI(A,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),nzA.initialize.call(this,A,e,t,i,n)},resize(A,e,t,i){if(nzA.resize.call(this,A,e,t,i),this._canvas)bot(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const n=this._options.externalContext;n||YA("CanvasRenderer is missing a valid canvas or context"),n.scale(this._scale,this._scale),n.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(A){const e=this._tempb.clear().union(A.bounds);let t=A.mark.group;for(;t;)e.translate(t.x||0,t.y||0),t=t.mark.group;this._dirty.union(e)},_render(A,e){const t=this.context(),i=this._origin,n=this._width,o=this._height,g=this._dirty,a=wot(i,n,o);t.save();const s=this._redraw||g.empty()?(this._redraw=!1,a.expand(1)):Dot(t,a.intersect(g),i);return this.clear(-i[0],-i[1],n,o),this.draw(t,A,s,e),t.restore(),g.clear(),this},draw(A,e,t,i){if(e.marktype!=="group"&&i!=null&&!i.includes(e.marktype))return;const n=va[e.marktype];e.clip&&pnt(A,e),n.draw.call(this,A,e,t,i),e.clip&&A.restore()},clear(A,e,t,i){const n=this._options,o=this.context();n.type!=="pdf"&&!n.externalContext&&o.clearRect(A,e,t,i),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(A,e,t,i))}});function oIA(A,e){wp.call(this,A,e);const t=this;t._hrefHandler=gIA(t,(i,n)=>{n&&n.href&&t.handleHref(i,n,n.href)}),t._tooltipHandler=gIA(t,(i,n)=>{t.handleTooltip(i,n,i.type!==hv)})}const gIA=(A,e)=>t=>{let i=t.target.__data__;i=Array.isArray(i)?i[0]:i,t.vegaType=t.type,e.call(A._obj,t,i)};_A(oIA,wp,{initialize(A,e,t){let i=this._svg;return i&&(i.removeEventListener(nIA,this._hrefHandler),i.removeEventListener(iIA,this._tooltipHandler),i.removeEventListener(hv,this._tooltipHandler)),this._svg=i=A&&$rA(A,"svg"),i&&(i.addEventListener(nIA,this._hrefHandler),i.addEventListener(iIA,this._tooltipHandler),i.addEventListener(hv,this._tooltipHandler)),wp.prototype.initialize.call(this,A,e,t)},canvas(){return this._svg},on(A,e){const t=this.eventName(A),i=this._handlers;if(this._handlerIndex(i[t],A,e)<0){const n={type:A,handler:e,listener:gIA(this,e)};(i[t]||(i[t]=[])).push(n),this._svg&&this._svg.addEventListener(t,n.listener)}return this},off(A,e){const t=this.eventName(A),i=this._handlers[t],n=this._handlerIndex(i,A,e);return n>=0&&(this._svg&&this._svg.removeEventListener(t,i[n].listener),i.splice(n,1)),this}});const ozA="aria-hidden",aIA="aria-label",sIA="role",rIA="aria-roledescription",gzA="graphics-object",IIA="graphics-symbol",azA=(A,e,t)=>({[sIA]:A,[rIA]:e,[aIA]:t||void 0}),Got=fc(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),szA={axis:{desc:"axis",caption:Not},legend:{desc:"legend",caption:Yot},"title-text":{desc:"title",caption:A=>`Title text '${lzA(A)}'`},"title-subtitle":{desc:"subtitle",caption:A=>`Subtitle text '${lzA(A)}'`}},rzA={ariaRole:sIA,ariaRoleDescription:rIA,description:aIA};function IzA(A,e){const t=e.aria===!1;if(A(ozA,t||void 0),t||e.description==null)for(const i in rzA)A(rzA[i],void 0);else{const i=e.mark.marktype;A(aIA,e.description),A(sIA,e.ariaRole||(i==="group"?gzA:IIA)),A(rIA,e.ariaRoleDescription||`${i} mark`)}}function CzA(A){return A.aria===!1?{[ozA]:!0}:Got[A.role]?null:szA[A.role]?Jot(A,szA[A.role]):kot(A)}function kot(A){const e=A.marktype,t=e==="group"||e==="text"||A.items.some(i=>i.description!=null&&i.aria!==!1);return azA(t?gzA:IIA,`${e} mark container`,A.description)}function Jot(A,e){try{const t=A.items[0],i=e.caption||(()=>"");return azA(e.role||IIA,e.desc,t.description||i(t))}catch{return null}}function lzA(A){return te(A.text).join(" ")}function Not(A){const e=A.datum,t=A.orient,i=e.title?czA(A):null,n=A.context,o=n.scales[e.scale].value,g=n.dataflow.locale(),a=o.type;return`${t==="left"||t==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${RJ(a)?"discrete":a} scale with ${I5A(g,o,A)}`}function Yot(A){const e=A.datum,t=e.title?czA(A):null,i=`${e.type||""} legend`.trim(),n=e.scales,o=Object.keys(n),g=A.context,a=g.scales[n[o[0]]].value,s=g.dataflow.locale();return xot(i)+(t?` titled '${t}'`:"")+` for ${Rot(o)} with ${I5A(s,a,A)}`}function czA(A){try{return te(Ut(A.items).items[0].text).join(" ")}catch{return null}}function Rot(A){return A=A.map(e=>e+(e==="fill"||e==="stroke"?" color":"")),A.length<2?A[0]:A.slice(0,-1).join(", ")+" and "+Ut(A)}function xot(A){return A.length?A[0].toUpperCase()+A.slice(1):A}const BzA=A=>(A+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Fot=A=>BzA(A).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function CIA(){let A="",e="",t="";const i=[],n=()=>e=t="",o=s=>{e&&(A+=`${e}>${t}`,n()),i.push(s)},g=(s,I)=>(I!=null&&(e+=` ${s}="${Fot(I)}"`),a),a={open(s){o(s),e="<"+s;for(var I=arguments.length,r=new Array(I>1?I-1:0),C=1;C<I;C++)r[C-1]=arguments[C];for(const l of r)for(const c in l)g(c,l[c]);return a},close(){const s=i.pop();return e?A+=e+(t?`>${t}</${s}>`:"/>"):A+=`</${s}>`,n(),a},attr:g,text:s=>(t+=BzA(s),a),toString:()=>A};return a}const QzA=A=>EzA(CIA(),A)+"";function EzA(A,e){if(A.open(e.tagName),e.hasAttributes()){const t=e.attributes,i=t.length;for(let n=0;n<i;++n)A.attr(t[n].name,t[n].value)}if(e.hasChildNodes()){const t=e.childNodes;for(const i of t)i.nodeType===3?A.text(i.nodeValue):EzA(A,i)}return A.close()}const Iz={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},Cz={blend:"mix-blend-mode"},uzA={fill:"none","stroke-miterlimit":10},fv=0,dzA="http://www.w3.org/2000/xmlns/",Ag=Bv.xmlns;function lz(A){La.call(this,A),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const lIA=La.prototype;_A(lz,La,{initialize(A,e,t,i,n){return this._defs={},this._clearDefs(),A&&(this._svg=$o(A,0,"svg",Ag),this._svg.setAttributeNS(dzA,"xmlns",Ag),this._svg.setAttributeNS(dzA,"xmlns:xlink",Bv["xmlns:xlink"]),this._svg.setAttribute("version",Bv.version),this._svg.setAttribute("class","marks"),kI(A,1),this._root=$o(this._svg,fv,"g",Ag),Dp(this._root,uzA),kI(this._svg,fv+1)),this.background(this._bgcolor),lIA.initialize.call(this,A,e,t,i,n)},background(A){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",A),lIA.background.apply(this,arguments)},resize(A,e,t,i){return lIA.resize.call(this,A,e,t,i),this._svg&&(Dp(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this},canvas(){return this._svg},svg(){const A=this._svg,e=this._bgcolor;if(!A)return null;let t;e&&(A.removeAttribute("style"),t=$o(A,fv,"rect",Ag),Dp(t,{width:this._width,height:this._height,fill:e}));const i=QzA(A);return e&&(A.removeChild(t),this._svg.style.setProperty("background-color",e)),i},_render(A,e){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,A,void 0,e),kI(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(A){A.dirty!==this._dirtyID&&(A.dirty=this._dirtyID,this._dirty.push(A))},isDirty(A){return this._dirtyAll||!A._svg||!A._svg.ownerSVGElement||A.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const A=this._dirty;if(!A.length||!this._dirtyID)return!0;const e=++this._dirtyID;let t,i,n,o,g,a,s;for(g=0,a=A.length;g<a;++g)if(t=A[g],i=t.mark,i.marktype!==n&&(n=i.marktype,o=va[n]),i.zdirty&&i.dirty!==e&&(this._dirtyAll=!1,hzA(t,e),i.items.forEach(I=>{I.dirty=e})),!i.zdirty){if(t.exit){o.nested&&i.items.length?(s=i.items[0],s._svg&&this._update(o,s._svg,s)):t._svg&&(s=t._svg.parentNode,s&&s.removeChild(t._svg)),t._svg=null;continue}t=o.nested?i.items[0]:t,t._update!==e&&(!t._svg||!t._svg.ownerSVGElement?(this._dirtyAll=!1,hzA(t,e)):this._update(o,t._svg,t),t._update=e)}return!this._dirtyAll},mark(A,e,t,i){if(!this.isDirty(e))return e._svg;const n=this._svg,o=e.marktype,g=va[o],a=e.interactive===!1?"none":null,s=g.tag==="g",I=mzA(e,A,t,"g",n);if(o!=="group"&&i!=null&&!i.includes(o))return kI(I,0),e._svg;I.setAttribute("class",_5A(e));const r=CzA(e);for(const B in r)ss(I,B,r[B]);s||ss(I,"pointer-events",a),ss(I,"clip-path",e.clip?krA(this,e,e.group):null);let C=null,l=0;const c=B=>{const E=this.isDirty(B),u=mzA(B,I,C,g.tag,n);E&&(this._update(g,u,B),s&&Lot(this,u,B,i)),C=u,++l};return g.nested?e.items.length&&c(e.items[0]):qn(e,c),kI(I,l),I},_update(A,e,t){sd=e,Sa=e.__values__,IzA(yv,t),A.attr(yv,t,this);const i=Hot[A.type];i&&i.call(this,A,e,t),sd&&this.style(sd,t)},style(A,e){if(e!=null){for(const t in Iz){let i=t==="font"?Ev(e):e[t];if(i===Sa[t])continue;const n=Iz[t];i==null?A.removeAttribute(n):(prA(i)&&(i=l5A(i,this._defs.gradient,pzA())),A.setAttribute(n,i+"")),Sa[t]=i}for(const t in Cz)cz(A,Cz[t],e[t])}},defs(){const A=this._svg,e=this._defs;let t=e.el,i=0;for(const n in e.gradient)t||(e.el=t=$o(A,fv+1,"defs",Ag)),i=Mot(t,e.gradient[n],i);for(const n in e.clipping)t||(e.el=t=$o(A,fv+1,"defs",Ag)),i=vot(t,e.clipping[n],i);t&&(i===0?(A.removeChild(t),e.el=null):kI(t,i))},_clearDefs(){const A=this._defs;A.gradient={},A.clipping={}}});function hzA(A,e){for(;A&&A.dirty!==e;A=A.mark.group)if(A.dirty=e,A.mark&&A.mark.dirty!==e)A.mark.dirty=e;else return}function Mot(A,e,t){let i,n,o;if(e.gradient==="radial"){let g=$o(A,t++,"pattern",Ag);Dp(g,{id:L5+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),g=$o(g,0,"rect",Ag),Dp(g,{width:1,height:1,fill:`url(${pzA()}#${e.id})`}),A=$o(A,t++,"radialGradient",Ag),Dp(A,{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else A=$o(A,t++,"linearGradient",Ag),Dp(A,{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(i=0,n=e.stops.length;i<n;++i)o=$o(A,i,"stop",Ag),o.setAttribute("offset",e.stops[i].offset),o.setAttribute("stop-color",e.stops[i].color);return kI(A,i),t}function vot(A,e,t){let i;return A=$o(A,t,"clipPath",Ag),A.setAttribute("id",e.id),e.path?(i=$o(A,0,"path",Ag),i.setAttribute("d",e.path)):(i=$o(A,0,"rect",Ag),Dp(i,{x:0,y:0,width:e.width,height:e.height})),kI(A,1),t+1}function Lot(A,e,t,i){e=e.lastChild.previousSibling;let n,o=0;qn(t,g=>{n=A.mark(e,g,n,i),++o}),kI(e,1+o)}function mzA(A,e,t,i,n){let o=A._svg,g;if(!o&&(g=e.ownerDocument,o=bp(g,i,Ag),A._svg=o,A.mark&&(o.__data__=A,o.__values__={fill:"default"},i==="g"))){const a=bp(g,"path",Ag);o.appendChild(a),a.__data__=A;const s=bp(g,"g",Ag);o.appendChild(s),s.__data__=A;const I=bp(g,"path",Ag);o.appendChild(I),I.__data__=A,I.__values__={fill:"default"}}return(o.ownerSVGElement!==n||Sot(o,t))&&e.insertBefore(o,t?t.nextSibling:e.firstChild),o}function Sot(A,e){return A.parentNode&&A.parentNode.childNodes.length>1&&A.previousSibling!=e}let sd=null,Sa=null;const Hot={group(A,e,t){const i=sd=e.childNodes[2];Sa=i.__values__,A.foreground(yv,t,this),Sa=e.__values__,sd=e.childNodes[1],A.content(yv,t,this);const n=sd=e.childNodes[0];A.background(yv,t,this);const o=t.mark.interactive===!1?"none":null;if(o!==Sa.events&&(ss(i,"pointer-events",o),ss(n,"pointer-events",o),Sa.events=o),t.strokeForeground&&t.stroke){const g=t.fill;ss(i,"display",null),this.style(n,t),ss(n,"stroke",null),g&&(t.fill=null),Sa=i.__values__,this.style(i,t),g&&(t.fill=g),sd=null}else ss(i,"display","none")},image(A,e,t){t.smooth===!1?(cz(e,"image-rendering","optimizeSpeed"),cz(e,"image-rendering","pixelated")):cz(e,"image-rendering",null)},text(A,e,t){const i=Qv(t);let n,o,g,a;RA(i)?(o=i.map(s=>yp(t,s)),n=o.join(`
`),n!==Sa.text&&(kI(e,0),g=e.ownerDocument,a=fp(t),o.forEach((s,I)=>{const r=bp(g,"tspan",Ag);r.__data__=t,r.textContent=s,I&&(r.setAttribute("x",0),r.setAttribute("dy",a)),e.appendChild(r)}),Sa.text=n)):(o=yp(t,i),o!==Sa.text&&(e.textContent=o,Sa.text=o)),ss(e,"font-family",Ev(t)),ss(e,"font-size",DQ(t)+"px"),ss(e,"font-style",t.fontStyle),ss(e,"font-variant",t.fontVariant),ss(e,"font-weight",t.fontWeight)}};function yv(A,e,t){e!==Sa[A]&&(t?Zot(sd,A,e,t):ss(sd,A,e),Sa[A]=e)}function cz(A,e,t){t!==Sa[e]&&(t==null?A.style.removeProperty(e):A.style.setProperty(e,t+""),Sa[e]=t)}function Dp(A,e){for(const t in e)ss(A,t,e[t])}function ss(A,e,t){t!=null?A.setAttribute(e,t):A.removeAttribute(e)}function Zot(A,e,t,i){t!=null?A.setAttributeNS(i,e,t):A.removeAttributeNS(i,e)}function pzA(){let A;return typeof window>"u"?"":(A=window.location).hash?A.href.slice(0,-A.hash.length):A.href}function cIA(A){La.call(this,A),this._text=null,this._defs={gradient:{},clipping:{}}}_A(cIA,La,{svg(){return this._text},_render(A){const e=CIA();e.open("svg",lt({},Bv,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const t=this._bgcolor;return t&&t!=="transparent"&&t!=="none"&&e.open("rect",{width:this._width,height:this._height,fill:t}).close(),e.open("g",uzA,{transform:"translate("+this._origin+")"}),this.mark(e,A),e.close(),this.defs(e),this._text=e.close()+"",this},mark(A,e){const t=va[e.marktype],i=t.tag,n=[IzA,t.attr];A.open("g",{class:_5A(e),"clip-path":e.clip?krA(this,e,e.group):null},CzA(e),{"pointer-events":i!=="g"&&e.interactive===!1?"none":null});const o=g=>{const a=this.href(g);if(a&&A.open("a",a),A.open(i,this.attr(e,g,n,i!=="g"?i:null)),i==="text"){const s=Qv(g);if(RA(s)){const I={x:0,dy:fp(g)};for(let r=0;r<s.length;++r)A.open("tspan",r?I:null).text(yp(g,s[r])).close()}else A.text(yp(g,s))}else if(i==="g"){const s=g.strokeForeground,I=g.fill,r=g.stroke;s&&r&&(g.stroke=null),A.open("path",this.attr(e,g,t.background,"bgrect")).close(),A.open("g",this.attr(e,g,t.content)),qn(g,C=>this.mark(A,C)),A.close(),s&&r?(I&&(g.fill=null),g.stroke=r,A.open("path",this.attr(e,g,t.foreground,"bgrect")).close(),I&&(g.fill=I)):A.open("path",this.attr(e,g,t.foreground,"bgfore")).close()}A.close(),a&&A.close()};return t.nested?e.items&&e.items.length&&o(e.items[0]):qn(e,o),A.close()},href(A){const e=A.href;let t;if(e){if(t=this._hrefs&&this._hrefs[e])return t;this.sanitizeURL(e).then(i=>{i["xlink:href"]=i.href,i.href=null,(this._hrefs||(this._hrefs={}))[e]=i})}return null},attr(A,e,t,i){const n={},o=(g,a,s,I)=>{n[I||g]=a};return Array.isArray(t)?t.forEach(g=>g(o,e,this)):t(o,e,this),i&&Wot(n,e,A,i,this._defs),n},defs(A){const e=this._defs.gradient,t=this._defs.clipping;if(Object.keys(e).length+Object.keys(t).length!==0){A.open("defs");for(const i in e){const n=e[i],o=n.stops;n.gradient==="radial"?(A.open("pattern",{id:L5+i,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),A.open("rect",{width:"1",height:"1",fill:"url(#"+i+")"}).close(),A.close(),A.open("radialGradient",{id:i,fx:n.x1,fy:n.y1,fr:n.r1,cx:n.x2,cy:n.y2,r:n.r2})):A.open("linearGradient",{id:i,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2});for(let g=0;g<o.length;++g)A.open("stop",{offset:o[g].offset,"stop-color":o[g].color}).close();A.close()}for(const i in t){const n=t[i];A.open("clipPath",{id:i}),n.path?A.open("path",{d:n.path}).close():A.open("rect",{x:0,y:0,width:n.width,height:n.height}).close(),A.close()}A.close()}}});function Wot(A,e,t,i,n){let o;if(e==null||(i==="bgrect"&&t.interactive===!1&&(A["pointer-events"]="none"),i==="bgfore"&&(t.interactive===!1&&(A["pointer-events"]="none"),A.display="none",e.fill!==null)))return A;i==="image"&&e.smooth===!1&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(A["font-family"]=Ev(e),A["font-size"]=DQ(e)+"px",A["font-style"]=e.fontStyle,A["font-variant"]=e.fontVariant,A["font-weight"]=e.fontWeight);for(const g in Iz){let a=e[g];const s=Iz[g];a==="transparent"&&(s==="fill"||s==="stroke")||a!=null&&(prA(a)&&(a=l5A(a,n.gradient,"")),A[s]=a)}for(const g in Cz){const a=e[g];a!=null&&(o=o||[],o.push(`${Cz[g]}: ${a};`))}return o&&(A.style=o.join(" ")),A}const wc={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function Kot(A){wc.svgMarkTypes=A.svgMarkTypes??["text"],wc.svgOnTop=A.svgOnTop??!0,wc.debug=A.debug??!1}function Bz(A){La.call(this,A),this._svgRenderer=new lz(A),this._canvasRenderer=new pv(A)}const fzA=La.prototype;_A(Bz,La,{initialize(A,e,t,i,n){this._root_el=$o(A,0,"div");const o=$o(this._root_el,0,"div"),g=$o(this._root_el,1,"div");return this._root_el.style.position="relative",wc.debug||(o.style.height="100%",g.style.position="absolute",g.style.top="0",g.style.left="0",g.style.height="100%",g.style.width="100%"),this._svgEl=wc.svgOnTop?g:o,this._canvasEl=wc.svgOnTop?o:g,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,e,t,i,n),this._svgRenderer.initialize(this._svgEl,e,t,i,n),fzA.initialize.call(this,A,e,t,i,n)},dirty(A){return wc.svgMarkTypes.includes(A.mark.marktype)?this._svgRenderer.dirty(A):this._canvasRenderer.dirty(A),this},_render(A,e){const t=(e??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(i=>!wc.svgMarkTypes.includes(i));this._svgRenderer.render(A,wc.svgMarkTypes),this._canvasRenderer.render(A,t)},resize(A,e,t,i){return fzA.resize.call(this,A,e,t,i),this._svgRenderer.resize(A,e,t,i),this._canvasRenderer.resize(A,e,t,i),this},background(A){return wc.svgOnTop?this._canvasRenderer.background(A):this._svgRenderer.background(A),this}});function BIA(A,e){sl.call(this,A,e)}_A(BIA,sl,{initialize(A,e,t){const i=$o($o(A,0,"div"),wc.svgOnTop?0:1,"div");return sl.prototype.initialize.call(this,i,e,t)}});const yzA="canvas",bzA="hybrid",wzA="png",DzA="svg",GzA="none",Gp={Canvas:yzA,PNG:wzA,SVG:DzA,Hybrid:bzA,None:GzA},hb={};hb[yzA]=hb[wzA]={renderer:pv,headless:pv,handler:sl},hb[DzA]={renderer:lz,headless:cIA,handler:oIA},hb[bzA]={renderer:Bz,headless:Bz,handler:BIA},hb[GzA]={};function HJ(A,e){return A=String(A||"").toLowerCase(),arguments.length>1?(hb[A]=e,this):hb[A]}function kzA(A,e,t){const i=[],n=new vo().union(e),o=A.marktype;return o?JzA(A,n,t,i):o==="group"?NzA(A,n,t,i):YA("Intersect scene must be mark node or group item.")}function JzA(A,e,t,i){if(Uot(A,e,t)){const n=A.items,o=A.marktype,g=n.length;let a=0;if(o==="group")for(;a<g;++a)NzA(n[a],e,t,i);else for(const s=va[o].isect;a<g;++a){const I=n[a];YzA(I,e,s)&&i.push(I)}}return i}function Uot(A,e,t){return A.bounds&&e.intersects(A.bounds)&&(A.marktype==="group"||A.interactive!==!1&&(!t||t(A)))}function NzA(A,e,t,i){t&&t(A.mark)&&YzA(A,e,va.group.isect)&&i.push(A);const n=A.items,o=n&&n.length;if(o){const g=A.x||0,a=A.y||0;e.translate(-g,-a);for(let s=0;s<o;++s)JzA(n[s],e,t,i);e.translate(g,a)}return i}function YzA(A,e,t){const i=A.bounds;return e.encloses(i)||e.intersects(i)&&t(A,e)}const QIA=new vo;function RzA(A){const e=A.clip;if(Ct(e))e(Cv(QIA.clear()));else if(e)QIA.set(0,0,A.group.width,A.group.height);else return;A.bounds.intersect(QIA)}const Vot=1e-9;function EIA(A,e,t){return A===e?!0:t==="path"?xzA(A,e):A instanceof Date&&e instanceof Date?+A==+e:ti(A)&&ti(e)?Math.abs(A-e)<=Vot:!A||!e||!oe(A)&&!oe(e)?A==e:Xot(A,e)}function xzA(A,e){return EIA(xJ(A),xJ(e))}function Xot(A,e){var t=Object.keys(A),i=Object.keys(e),n,o;if(t.length!==i.length)return!1;for(t.sort(),i.sort(),o=t.length-1;o>=0;o--)if(t[o]!=i[o])return!1;for(o=t.length-1;o>=0;o--)if(n=t[o],!EIA(A[n],e[n],n))return!1;return typeof A==typeof e}function zot(){m5A(),cit()}const ZJ="top",Dc="left",Gc="right",kp="bottom",Tot="top-left",_ot="top-right",Oot="bottom-left",qot="bottom-right",uIA="start",dIA="middle",rs="end",jot="x",Pot="y",Qz="group",hIA="axis",mIA="title",$ot="frame",Agt="scope",pIA="legend",FzA="row-header",MzA="row-footer",vzA="row-title",LzA="column-header",SzA="column-footer",HzA="column-title",egt="padding",tgt="symbol",ZzA="fit",WzA="fit-x",KzA="fit-y",igt="pad",fIA="none",Ez="all",yIA="each",bIA="flush",Jp="column",Np="row";function UzA(A){DA.call(this,null,A)}_A(UzA,DA,{transform(A,e){const t=e.dataflow,i=A.mark,n=i.marktype,o=va[n],g=o.bound;let a=i.bounds,s;if(o.nested)i.items.length&&t.dirty(i.items[0]),a=uz(i,g),i.items.forEach(I=>{I.bounds.clear().union(a)});else if(n===Qz||A.modified())switch(e.visit(e.MOD,I=>t.dirty(I)),a.clear(),i.items.forEach(I=>a.union(uz(I,g))),i.role){case hIA:case pIA:case mIA:e.reflow()}else s=e.changed(e.REM),e.visit(e.ADD,I=>{a.union(uz(I,g))}),e.visit(e.MOD,I=>{s=s||a.alignsWith(I.bounds),t.dirty(I),a.union(uz(I,g))}),s&&(a.clear(),i.items.forEach(I=>a.union(I.bounds)));return RzA(i),e.modifies("bounds")}});function uz(A,e,t){return e(A.bounds.clear(),A,t)}const VzA=":vega_identifier:";function wIA(A){DA.call(this,0,A)}wIA.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},_A(wIA,DA,{transform(A,e){const t=ngt(e.dataflow),i=A.as;let n=t.value;return e.visit(e.ADD,o=>o[i]=o[i]||++n),t.set(this.value=n),e}});function ngt(A){return A._signals[VzA]||(A._signals[VzA]=A.add(0))}function XzA(A){DA.call(this,null,A)}_A(XzA,DA,{transform(A,e){let t=this.value;t||(t=e.dataflow.scenegraph().mark(A.markdef,ogt(A),A.index),t.group.context=A.context,A.context.group||(A.context.group=t.group),t.source=this.source,t.clip=A.clip,t.interactive=A.interactive,this.value=t);const i=t.marktype===Qz?K5:W5;return e.visit(e.ADD,n=>i.call(n,t)),(A.modified("clip")||A.modified("interactive"))&&(t.clip=A.clip,t.interactive=!!A.interactive,t.zdirty=!0,e.reflow()),t.items=e.source,e}});function ogt(A){const e=A.groups,t=A.parent;return e&&e.size===1?e.get(Object.keys(e.object)[0]):e&&t?e.lookup(t):null}function zzA(A){DA.call(this,null,A)}const TzA={parity:A=>A.filter((e,t)=>t%2?e.opacity=0:1),greedy:(A,e)=>{let t;return A.filter((i,n)=>!n||!_zA(t.bounds,i.bounds,e)?(t=i,1):i.opacity=0)}},_zA=(A,e,t)=>t>Math.max(e.x1-A.x2,A.x1-e.x2,e.y1-A.y2,A.y1-e.y2),OzA=(A,e)=>{for(var t=1,i=A.length,n=A[0].bounds,o;t<i;n=o,++t)if(_zA(n,o=A[t].bounds,e))return!0},ggt=A=>{const e=A.bounds;return e.width()>1&&e.height()>1},agt=(A,e,t)=>{var i=A.range(),n=new vo;return e===ZJ||e===kp?n.set(i[0],-1/0,i[1],1/0):n.set(-1/0,i[0],1/0,i[1]),n.expand(t||1),o=>n.encloses(o.bounds)},qzA=A=>(A.forEach(e=>e.opacity=1),A),jzA=(A,e)=>A.reflow(e.modified()).modifies("opacity");_A(zzA,DA,{transform(A,e){const t=TzA[A.method]||TzA.parity,i=A.separation||0;let n=e.materialize(e.SOURCE).source,o,g;if(!n||!n.length)return;if(!A.method)return A.modified("method")&&(qzA(n),e=jzA(e,A)),e;if(n=n.filter(ggt),!n.length)return;if(A.sort&&(n=n.slice().sort(A.sort)),o=qzA(n),e=jzA(e,A),o.length>=3&&OzA(o,i)){do o=t(o,i);while(o.length>=3&&OzA(o,i));o.length<3&&!Ut(n).opacity&&(o.length>1&&(Ut(o).opacity=0),Ut(n).opacity=1)}A.boundScale&&A.boundTolerance>=0&&(g=agt(A.boundScale,A.boundOrient,+A.boundTolerance),n.forEach(s=>{g(s)||(s.opacity=0)}));const a=o[0].mark.bounds.clear();return n.forEach(s=>{s.opacity&&a.union(s.bounds)}),e}});function PzA(A){DA.call(this,null,A)}_A(PzA,DA,{transform(A,e){const t=e.dataflow;if(e.visit(e.ALL,i=>t.dirty(i)),e.fields&&e.fields.zindex){const i=e.source&&e.source[0];i&&(i.mark.zdirty=!0)}}});const Ha=new vo;function WJ(A,e,t){return A[e]===t?0:(A[e]=t,1)}function sgt(A){var e=A.items[0].orient;return e===Dc||e===Gc}function rgt(A){let e=+A.grid;return[A.ticks?e++:-1,A.labels?e++:-1,e+ +A.domain]}function Igt(A,e,t,i){var n=e.items[0],o=n.datum,g=n.translate!=null?n.translate:.5,a=n.orient,s=rgt(o),I=n.range,r=n.offset,C=n.position,l=n.minExtent,c=n.maxExtent,B=o.title&&n.items[s[2]].items[0],E=n.titlePadding,u=n.bounds,d=B&&_rA(B),f=0,w=0,y,G;switch(Ha.clear().union(u),u.clear(),(y=s[0])>-1&&u.union(n.items[y].bounds),(y=s[1])>-1&&u.union(n.items[y].bounds),a){case ZJ:f=C||0,w=-r,G=Math.max(l,Math.min(c,-u.y1)),u.add(0,-G).add(I,0),B&&dz(A,B,G,E,d,0,-1,u);break;case Dc:f=-r,w=C||0,G=Math.max(l,Math.min(c,-u.x1)),u.add(-G,0).add(0,I),B&&dz(A,B,G,E,d,1,-1,u);break;case Gc:f=t+r,w=C||0,G=Math.max(l,Math.min(c,u.x2)),u.add(0,0).add(G,I),B&&dz(A,B,G,E,d,1,1,u);break;case kp:f=C||0,w=i+r,G=Math.max(l,Math.min(c,u.y2)),u.add(0,0).add(I,G),B&&dz(A,B,G,E,0,0,1,u);break;default:f=n.x,w=n.y}return ad(u.translate(f,w),n),WJ(n,"x",f+g)|WJ(n,"y",w+g)&&(n.bounds=Ha,A.dirty(n),n.bounds=u,A.dirty(n)),n.mark.bounds.clear().union(u)}function dz(A,e,t,i,n,o,g,a){const s=e.bounds;if(e.auto){const I=g*(t+n+i);let r=0,C=0;A.dirty(e),o?r=(e.x||0)-(e.x=I):C=(e.y||0)-(e.y=I),e.mark.bounds.clear().union(s.translate(-r,-C)),A.dirty(e)}a.union(s)}const $zA=(A,e)=>Math.floor(Math.min(A,e)),ATA=(A,e)=>Math.ceil(Math.max(A,e));function Cgt(A){var e=A.items,t=e.length,i=0,n,o;const g={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<t;++i)if(n=e[i],o=n.items,n.marktype===Qz)switch(n.role){case hIA:case pIA:case mIA:break;case FzA:g.rowheaders.push(...o);break;case MzA:g.rowfooters.push(...o);break;case LzA:g.colheaders.push(...o);break;case SzA:g.colfooters.push(...o);break;case vzA:g.rowtitle=o[0];break;case HzA:g.coltitle=o[0];break;default:g.marks.push(...o)}return g}function lgt(A){return new vo().set(0,0,A.width||0,A.height||0)}function cgt(A){const e=A.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(A.x||0),-(A.y||0))}function Ln(A,e,t){return(oe(A)?A[e]:A)??(t!==void 0?t:0)}function eTA(A){return A<0?Math.ceil(-A):0}function tTA(A,e,t){var i=!t.nodirty,n=t.bounds===bIA?lgt:cgt,o=Ha.set(0,0,0,0),g=Ln(t.align,Jp),a=Ln(t.align,Np),s=Ln(t.padding,Jp),I=Ln(t.padding,Np),r=t.columns||e.length,C=r<=0?1:Math.ceil(e.length/r),l=e.length,c=Array(l),B=Array(r),E=0,u=Array(l),d=Array(C),f=0,w=Array(l),y=Array(l),G=Array(l),R,x,F,Q,k,h,N,v,K,U,V;for(x=0;x<r;++x)B[x]=0;for(x=0;x<C;++x)d[x]=0;for(x=0;x<l;++x)h=e[x],k=G[x]=n(h),h.x=h.x||0,w[x]=0,h.y=h.y||0,y[x]=0,F=x%r,Q=~~(x/r),E=Math.max(E,N=Math.ceil(k.x2)),f=Math.max(f,v=Math.ceil(k.y2)),B[F]=Math.max(B[F],N),d[Q]=Math.max(d[Q],v),c[x]=s+eTA(k.x1),u[x]=I+eTA(k.y1),i&&A.dirty(e[x]);for(x=0;x<l;++x)x%r===0&&(c[x]=0),x<r&&(u[x]=0);if(g===yIA)for(F=1;F<r;++F){for(V=0,x=F;x<l;x+=r)V<c[x]&&(V=c[x]);for(x=F;x<l;x+=r)c[x]=V+B[F-1]}else if(g===Ez){for(V=0,x=0;x<l;++x)x%r&&V<c[x]&&(V=c[x]);for(x=0;x<l;++x)x%r&&(c[x]=V+E)}else for(g=!1,F=1;F<r;++F)for(x=F;x<l;x+=r)c[x]+=B[F-1];if(a===yIA)for(Q=1;Q<C;++Q){for(V=0,x=Q*r,R=x+r;x<R;++x)V<u[x]&&(V=u[x]);for(x=Q*r;x<R;++x)u[x]=V+d[Q-1]}else if(a===Ez){for(V=0,x=r;x<l;++x)V<u[x]&&(V=u[x]);for(x=r;x<l;++x)u[x]=V+f}else for(a=!1,Q=1;Q<C;++Q)for(x=Q*r,R=x+r;x<R;++x)u[x]+=d[Q-1];for(K=0,x=0;x<l;++x)K=c[x]+(x%r?K:0),w[x]+=K-e[x].x;for(F=0;F<r;++F)for(U=0,x=F;x<l;x+=r)U+=u[x],y[x]+=U-e[x].y;if(g&&Ln(t.center,Jp)&&C>1)for(x=0;x<l;++x)k=g===Ez?E:B[x%r],K=k-G[x].x2-e[x].x-w[x],K>0&&(w[x]+=K/2);if(a&&Ln(t.center,Np)&&r!==1)for(x=0;x<l;++x)k=a===Ez?f:d[~~(x/r)],U=k-G[x].y2-e[x].y-y[x],U>0&&(y[x]+=U/2);for(x=0;x<l;++x)o.union(G[x].translate(w[x],y[x]));switch(K=Ln(t.anchor,jot),U=Ln(t.anchor,Pot),Ln(t.anchor,Jp)){case rs:K-=o.width();break;case dIA:K-=o.width()/2}switch(Ln(t.anchor,Np)){case rs:U-=o.height();break;case dIA:U-=o.height()/2}for(K=Math.round(K),U=Math.round(U),o.clear(),x=0;x<l;++x)e[x].mark.bounds.clear();for(x=0;x<l;++x)h=e[x],h.x+=w[x]+=K,h.y+=y[x]+=U,o.union(h.mark.bounds.union(h.bounds.translate(w[x],y[x]))),i&&A.dirty(h);return o}function Bgt(A,e,t){var i=Cgt(e),n=i.marks,o=t.bounds===bIA?Qgt:Egt,g=t.offset,a=t.columns||n.length,s=a<=0?1:Math.ceil(n.length/a),I=s*a,r,C,l,c,B,E,u;const d=tTA(A,n,t);d.empty()&&d.set(0,0,0,0),i.rowheaders&&(E=Ln(t.headerBand,Np,null),r=hz(A,i.rowheaders,n,a,s,-Ln(g,"rowHeader"),$zA,0,o,"x1",0,a,1,E)),i.colheaders&&(E=Ln(t.headerBand,Jp,null),C=hz(A,i.colheaders,n,a,a,-Ln(g,"columnHeader"),$zA,1,o,"y1",0,1,a,E)),i.rowfooters&&(E=Ln(t.footerBand,Np,null),l=hz(A,i.rowfooters,n,a,s,Ln(g,"rowFooter"),ATA,0,o,"x2",a-1,a,1,E)),i.colfooters&&(E=Ln(t.footerBand,Jp,null),c=hz(A,i.colfooters,n,a,a,Ln(g,"columnFooter"),ATA,1,o,"y2",I-a,1,a,E)),i.rowtitle&&(B=Ln(t.titleAnchor,Np),u=Ln(g,"rowTitle"),u=B===rs?l+u:r-u,E=Ln(t.titleBand,Np,.5),iTA(A,i.rowtitle,u,0,d,E)),i.coltitle&&(B=Ln(t.titleAnchor,Jp),u=Ln(g,"columnTitle"),u=B===rs?c+u:C-u,E=Ln(t.titleBand,Jp,.5),iTA(A,i.coltitle,u,1,d,E))}function Qgt(A,e){return e==="x1"?A.x||0:e==="y1"?A.y||0:e==="x2"?(A.x||0)+(A.width||0):e==="y2"?(A.y||0)+(A.height||0):void 0}function Egt(A,e){return A.bounds[e]}function hz(A,e,t,i,n,o,g,a,s,I,r,C,l,c){var B=t.length,E=0,u=0,d,f,w,y,G,R,x,F,Q;if(!B)return E;for(d=r;d<B;d+=C)t[d]&&(E=g(E,s(t[d],I)));if(!e.length)return E;for(e.length>n&&(A.warn("Grid headers exceed limit: "+n),e=e.slice(0,n)),E+=o,f=0,y=e.length;f<y;++f)A.dirty(e[f]),e[f].mark.bounds.clear();for(d=r,f=0,y=e.length;f<y;++f,d+=C){for(R=e[f],G=R.mark.bounds,w=d;w>=0&&(x=t[w])==null;w-=l);a?(F=c==null?x.x:Math.round(x.bounds.x1+c*x.bounds.width()),Q=E):(F=E,Q=c==null?x.y:Math.round(x.bounds.y1+c*x.bounds.height())),G.union(R.bounds.translate(F-(R.x||0),Q-(R.y||0))),R.x=F,R.y=Q,A.dirty(R),u=g(u,G[I])}return u}function iTA(A,e,t,i,n,o){if(e){A.dirty(e);var g=t,a=t;i?g=Math.round(n.x1+o*n.width()):a=Math.round(n.y1+o*n.height()),e.bounds.translate(g-(e.x||0),a-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=g,e.y=a,A.dirty(e)}}function ugt(A,e){const t=A[e]||{};return(i,n)=>t[i]!=null?t[i]:A[i]!=null?A[i]:n}function dgt(A,e){let t=-1/0;return A.forEach(i=>{i.offset!=null&&(t=Math.max(t,i.offset))}),t>-1/0?t:e}function hgt(A,e,t,i,n,o,g){const a=ugt(t,e),s=dgt(A,a("offset",0)),I=a("anchor",uIA),r=I===rs?1:I===dIA?.5:0,C={align:yIA,bounds:a("bounds",bIA),columns:a("direction")==="vertical"?1:A.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(e){case Dc:C.anchor={x:Math.floor(i.x1)-s,column:rs,y:r*(g||i.height()+2*i.y1),row:I};break;case Gc:C.anchor={x:Math.ceil(i.x2)+s,y:r*(g||i.height()+2*i.y1),row:I};break;case ZJ:C.anchor={y:Math.floor(n.y1)-s,row:rs,x:r*(o||n.width()+2*n.x1),column:I};break;case kp:C.anchor={y:Math.ceil(n.y2)+s,x:r*(o||n.width()+2*n.x1),column:I};break;case Tot:C.anchor={x:s,y:s};break;case _ot:C.anchor={x:o-s,y:s,column:rs};break;case Oot:C.anchor={x:s,y:g-s,row:rs};break;case qot:C.anchor={x:o-s,y:g-s,column:rs,row:rs};break}return C}function mgt(A,e){var t=e.items[0],i=t.datum,n=t.orient,o=t.bounds,g=t.x,a=t.y,s,I;return t._bounds?t._bounds.clear().union(o):t._bounds=o.clone(),o.clear(),fgt(A,t,t.items[0].items[0]),o=pgt(t,o),s=2*t.padding,I=2*t.padding,o.empty()||(s=Math.ceil(o.width()+s),I=Math.ceil(o.height()+I)),i.type===tgt&&ygt(t.items[0].items[0].items[0].items),n!==fIA&&(t.x=g=0,t.y=a=0),t.width=s,t.height=I,ad(o.set(g,a,g+s,a+I),t),t.mark.bounds.clear().union(o),t}function pgt(A,e){return A.items.forEach(t=>e.union(t.bounds)),e.x1=A.padding,e.y1=A.padding,e}function fgt(A,e,t){var i=e.padding,n=i-t.x,o=i-t.y;if(!e.datum.title)(n||o)&&bv(A,t,n,o);else{var g=e.items[1].items[0],a=g.anchor,s=e.titlePadding||0,I=i-g.x,r=i-g.y;switch(g.orient){case Dc:n+=Math.ceil(g.bounds.width())+s;break;case Gc:case kp:break;default:o+=g.bounds.height()+s}switch((n||o)&&bv(A,t,n,o),g.orient){case Dc:r+=KJ(e,t,g,a,1,1);break;case Gc:I+=KJ(e,t,g,rs,0,0)+s,r+=KJ(e,t,g,a,1,1);break;case kp:I+=KJ(e,t,g,a,0,0),r+=KJ(e,t,g,rs,-1,0,1)+s;break;default:I+=KJ(e,t,g,a,0,0)}(I||r)&&bv(A,g,I,r),(I=Math.round(g.bounds.x1-i))<0&&(bv(A,t,-I,0),bv(A,g,-I,0))}}function KJ(A,e,t,i,n,o,g){const a=A.datum.type!=="symbol",s=t.datum.vgrad,I=a&&(o||!s)&&!g?e.items[0]:e,r=I.bounds[n?"y2":"x2"]-A.padding,C=s&&o?r:0,l=s&&o?0:r,c=n<=0?0:_rA(t);return Math.round(i===uIA?C:i===rs?l-c:.5*(r-c))}function bv(A,e,t,i){e.x+=t,e.y+=i,e.bounds.translate(t,i),e.mark.bounds.translate(t,i),A.dirty(e)}function ygt(A){const e=A.reduce((t,i)=>(t[i.column]=Math.max(i.bounds.x2-i.x,t[i.column]||0),t),{});A.forEach(t=>{t.width=e[t.column],t.height=t.bounds.y2-t.y})}function bgt(A,e,t,i,n){var o=e.items[0],g=o.frame,a=o.orient,s=o.anchor,I=o.offset,r=o.padding,C=o.items[0].items[0],l=o.items[1]&&o.items[1].items[0],c=a===Dc||a===Gc?i:t,B=0,E=0,u=0,d=0,f=0,w;if(g!==Qz?a===Dc?(B=n.y2,c=n.y1):a===Gc?(B=n.y1,c=n.y2):(B=n.x1,c=n.x2):a===Dc&&(B=i,c=0),w=s===uIA?B:s===rs?c:(B+c)/2,l&&l.text){switch(a){case ZJ:case kp:f=C.bounds.height()+r;break;case Dc:d=C.bounds.width()+r;break;case Gc:d=-C.bounds.width()-r;break}Ha.clear().union(l.bounds),Ha.translate(d-(l.x||0),f-(l.y||0)),WJ(l,"x",d)|WJ(l,"y",f)&&(A.dirty(l),l.bounds.clear().union(Ha),l.mark.bounds.clear().union(Ha),A.dirty(l)),Ha.clear().union(l.bounds)}else Ha.clear();switch(Ha.union(C.bounds),a){case ZJ:E=w,u=n.y1-Ha.height()-I;break;case Dc:E=n.x1-Ha.width()-I,u=w;break;case Gc:E=n.x2+Ha.width()+I,u=w;break;case kp:E=w,u=n.y2+I;break;default:E=o.x,u=o.y}return WJ(o,"x",E)|WJ(o,"y",u)&&(Ha.translate(E,u),A.dirty(o),o.bounds.clear().union(Ha),e.bounds.clear().union(Ha),A.dirty(o)),o.bounds}function nTA(A){DA.call(this,null,A)}_A(nTA,DA,{transform(A,e){const t=e.dataflow;return A.mark.items.forEach(i=>{A.layout&&Bgt(t,i,A.layout),Dgt(t,i,A)}),wgt(A.mark.group)?e.reflow():e}});function wgt(A){return A&&A.mark.role!=="legend-entry"}function Dgt(A,e,t){var i=e.items,n=Math.max(0,e.width||0),o=Math.max(0,e.height||0),g=new vo().set(0,0,n,o),a=g.clone(),s=g.clone(),I=[],r,C,l,c,B,E;for(B=0,E=i.length;B<E;++B)switch(C=i[B],C.role){case hIA:c=sgt(C)?a:s,c.union(Igt(A,C,n,o));break;case mIA:r=C;break;case pIA:I.push(mgt(A,C));break;case $ot:case Agt:case FzA:case MzA:case vzA:case LzA:case SzA:case HzA:a.union(C.bounds),s.union(C.bounds);break;default:g.union(C.bounds)}if(I.length){const u={};I.forEach(d=>{l=d.orient||Gc,l!==fIA&&(u[l]||(u[l]=[])).push(d)});for(const d in u){const f=u[d];tTA(A,f,hgt(f,d,t.legends,a,s,n,o))}I.forEach(d=>{const f=d.bounds;if(f.equals(d._bounds)||(d.bounds=d._bounds,A.dirty(d),d.bounds=f,A.dirty(d)),t.autosize&&(t.autosize.type===ZzA||t.autosize.type===WzA||t.autosize.type===KzA))switch(d.orient){case Dc:case Gc:g.add(f.x1,0).add(f.x2,0);break;case ZJ:case kp:g.add(0,f.y1).add(0,f.y2)}else g.union(f)})}g.union(a).union(s),r&&g.union(bgt(A,r,n,o,g)),e.clip&&g.set(0,0,e.width||0,e.height||0),Ggt(A,e,g,t)}function Ggt(A,e,t,i){const n=i.autosize||{},o=n.type;if(A._autosize<1||!o)return;let g=A._width,a=A._height,s=Math.max(0,e.width||0),I=Math.max(0,Math.ceil(-t.x1)),r=Math.max(0,e.height||0),C=Math.max(0,Math.ceil(-t.y1));const l=Math.max(0,Math.ceil(t.x2-s)),c=Math.max(0,Math.ceil(t.y2-r));if(n.contains===egt){const B=A.padding();g-=B.left+B.right,a-=B.top+B.bottom}o===fIA?(I=0,C=0,s=g,r=a):o===ZzA?(s=Math.max(0,g-I-l),r=Math.max(0,a-C-c)):o===WzA?(s=Math.max(0,g-I-l),a=r+C+c):o===KzA?(g=s+I+l,r=Math.max(0,a-C-c)):o===igt&&(g=s+I+l,a=r+C+c),A._resizeView(g,a,s,r,[I,C],n.resize)}const kgt=Object.freeze(Object.defineProperty({__proto__:null,bound:UzA,identifier:wIA,mark:XzA,overlap:zzA,render:PzA,viewlayout:nTA},Symbol.toStringTag,{value:"Module"}));function oTA(A){DA.call(this,null,A)}_A(oTA,DA,{transform(A,e){if(this.value&&!A.modified())return e.StopPropagation;var t=e.dataflow.locale(),i=e.fork(e.NO_SOURCE|e.NO_FIELDS),n=this.value,o=A.scale,g=A.count==null?A.values?A.values.length:10:A.count,a=drA(o,g,A.minstep),s=A.format||i5A(t,o,a,A.formatSpecifier,A.formatType,!!A.values),I=A.values?t5A(o,A.values,a):hrA(o,a);return n&&(i.rem=n),n=I.map((r,C)=>Ei({index:C/(I.length-1||1),value:r,label:s(r)})),A.extra&&n.length&&n.push(Ei({index:-1,extra:{value:n[0].value},label:""})),i.source=n,i.add=n,this.value=n,i}});function gTA(A){DA.call(this,null,A)}function Jgt(){return Ei({})}function Ngt(A){const e=uJ().test(t=>t.exit);return e.lookup=t=>e.get(A(t)),e}_A(gTA,DA,{transform(A,e){var t=e.dataflow,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),n=A.item||Jgt,o=A.key||Ne,g=this.value;return RA(i.encode)&&(i.encode=null),g&&(A.modified("key")||e.modified(o))&&YA("DataJoin does not support modified key function or fields."),g||(e=e.addAll(),this.value=g=Ngt(o)),e.visit(e.ADD,a=>{const s=o(a);let I=g.get(s);I?I.exit?(g.empty--,i.add.push(I)):i.mod.push(I):(I=n(a),g.set(s,I),i.add.push(I)),I.datum=a,I.exit=!1}),e.visit(e.MOD,a=>{const s=o(a),I=g.get(s);I&&(I.datum=a,i.mod.push(I))}),e.visit(e.REM,a=>{const s=o(a),I=g.get(s);a===I.datum&&!I.exit&&(i.rem.push(I),I.exit=!0,++g.empty)}),e.changed(e.ADD_MOD)&&i.modifies("datum"),(e.clean()||A.clean&&g.empty>t.cleanThreshold)&&t.runAfter(g.clean),i}});function aTA(A){DA.call(this,null,A)}_A(aTA,DA,{transform(A,e){var t=e.fork(e.ADD_REM),i=A.mod||!1,n=A.encoders,o=e.encode;if(RA(o))if(t.changed()||o.every(C=>n[C]))o=o[0],t.encode=null;else return e.StopPropagation;var g=o==="enter",a=n.update||ap,s=n.enter||ap,I=n.exit||ap,r=(o&&!g?n[o]:a)||ap;if(e.changed(e.ADD)&&(e.visit(e.ADD,C=>{s(C,A),a(C,A)}),t.modifies(s.output),t.modifies(a.output),r!==ap&&r!==a&&(e.visit(e.ADD,C=>{r(C,A)}),t.modifies(r.output))),e.changed(e.REM)&&I!==ap&&(e.visit(e.REM,C=>{I(C,A)}),t.modifies(I.output)),g||r!==ap){const C=e.MOD|(A.modified()?e.REFLOW:0);g?(e.visit(C,l=>{const c=s(l,A)||i;(r(l,A)||c)&&t.mod.push(l)}),t.mod.length&&t.modifies(s.output)):e.visit(C,l=>{(r(l,A)||i)&&t.mod.push(l)}),t.mod.length&&t.modifies(r.output)}return t.changed()?t:e.StopPropagation}});function sTA(A){DA.call(this,[],A)}_A(sTA,DA,{transform(A,e){if(this.value!=null&&!A.modified())return e.StopPropagation;var t=e.dataflow.locale(),i=e.fork(e.NO_SOURCE|e.NO_FIELDS),n=this.value,o=A.type||v5,g=A.scale,a=+A.limit,s=drA(g,A.count==null?5:A.count,A.minstep),I=!!A.values||o===v5,r=A.format||a5A(t,g,s,o,A.formatSpecifier,A.formatType,I),C=A.values||g5A(g,s),l,c,B,E,u;return n&&(i.rem=n),o===v5?(a&&C.length>a?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),n=C.slice(0,a-1),u=!0):n=C,Ct(B=A.size)?(!A.values&&g(n[0])===0&&(n=n.slice(1)),E=n.reduce((d,f)=>Math.max(d,B(f,A)),0)):B=Ya(E=B||8),n=n.map((d,f)=>Ei({index:f,label:r(d,f,n),value:d,offset:E,size:B(d,A)})),u&&(u=C[n.length],n.push(Ei({index:n.length,label:`…${C.length-n.length} entries`,value:u,offset:E,size:B(u,A)})))):o===Ait?(l=g.domain(),c=P9A(g,l[0],Ut(l)),C.length<3&&!A.values&&l[0]!==Ut(l)&&(C=[l[0],Ut(l)]),n=C.map((d,f)=>Ei({index:f,label:r(d,f,C),value:d,perc:c(d)}))):(B=C.length-1,c=Cit(g),n=C.map((d,f)=>Ei({index:f,label:r(d,f,C),value:d,perc:f?c(d):0,perc2:f===B?1:c(C[f+1])}))),i.source=n,i.add=n,this.value=n,i}});const Ygt=A=>A.source.x,Rgt=A=>A.source.y,xgt=A=>A.target.x,Fgt=A=>A.target.y;function DIA(A){DA.call(this,{},A)}DIA.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},_A(DIA,DA,{transform(A,e){var t=A.sourceX||Ygt,i=A.sourceY||Rgt,n=A.targetX||xgt,o=A.targetY||Fgt,g=A.as||"path",a=A.orient||"vertical",s=A.shape||"line",I=lTA.get(s+"-"+a)||lTA.get(s);return I||YA("LinkPath unsupported type: "+A.shape+(A.orient?"-"+A.orient:"")),e.visit(e.SOURCE,r=>{r[g]=I(t(r),i(r),n(r),o(r))}),e.reflow(A.modified()).modifies(g)}});const rTA=(A,e,t,i)=>"M"+A+","+e+"L"+t+","+i,Mgt=(A,e,t,i)=>rTA(e*Math.cos(A),e*Math.sin(A),i*Math.cos(t),i*Math.sin(t)),ITA=(A,e,t,i)=>{var n=t-A,o=i-e,g=Math.hypot(n,o)/2,a=180*Math.atan2(o,n)/Math.PI;return"M"+A+","+e+"A"+g+","+g+" "+a+" 0 1 "+t+","+i},vgt=(A,e,t,i)=>ITA(e*Math.cos(A),e*Math.sin(A),i*Math.cos(t),i*Math.sin(t)),CTA=(A,e,t,i)=>{const n=t-A,o=i-e,g=.2*(n+o),a=.2*(o-n);return"M"+A+","+e+"C"+(A+g)+","+(e+a)+" "+(t+a)+","+(i-g)+" "+t+","+i},Lgt=(A,e,t,i)=>CTA(e*Math.cos(A),e*Math.sin(A),i*Math.cos(t),i*Math.sin(t)),Sgt=(A,e,t,i)=>"M"+A+","+e+"V"+i+"H"+t,Hgt=(A,e,t,i)=>"M"+A+","+e+"H"+t+"V"+i,Zgt=(A,e,t,i)=>{const n=Math.cos(A),o=Math.sin(A),g=Math.cos(t),a=Math.sin(t),s=Math.abs(t-A)>Math.PI?t<=A:t>A;return"M"+e*n+","+e*o+"A"+e+","+e+" 0 0,"+(s?1:0)+" "+e*g+","+e*a+"L"+i*g+","+i*a},Wgt=(A,e,t,i)=>{const n=(A+t)/2;return"M"+A+","+e+"C"+n+","+e+" "+n+","+i+" "+t+","+i},Kgt=(A,e,t,i)=>{const n=(e+i)/2;return"M"+A+","+e+"C"+A+","+n+" "+t+","+n+" "+t+","+i},Ugt=(A,e,t,i)=>{const n=Math.cos(A),o=Math.sin(A),g=Math.cos(t),a=Math.sin(t),s=(e+i)/2;return"M"+e*n+","+e*o+"C"+s*n+","+s*o+" "+s*g+","+s*a+" "+i*g+","+i*a},lTA=uJ({line:rTA,"line-radial":Mgt,arc:ITA,"arc-radial":vgt,curve:CTA,"curve-radial":Lgt,"orthogonal-horizontal":Sgt,"orthogonal-vertical":Hgt,"orthogonal-radial":Zgt,"diagonal-horizontal":Wgt,"diagonal-vertical":Kgt,"diagonal-radial":Ugt});function GIA(A){DA.call(this,null,A)}GIA.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},_A(GIA,DA,{transform(A,e){var t=A.as||["startAngle","endAngle"],i=t[0],n=t[1],o=A.field||BJ,g=A.startAngle||0,a=A.endAngle!=null?A.endAngle:2*Math.PI,s=e.source,I=s.map(o),r=I.length,C=g,l=(a-g)/QQ(I),c=Ga(r),B,E,u;for(A.sort&&c.sort((d,f)=>I[d]-I[f]),B=0;B<r;++B)u=I[c[B]],E=s[c[B]],E[i]=C,E[n]=C+=u*l;return this.value=I,e.reflow(A.modified()).modifies(t)}});const Vgt=5;function Xgt(A){const e=A.type;return!A.bins&&(e===JJ||e===ev||e===tv)}function cTA(A){return BrA(A)&&A!==yQ}const zgt=fc(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function BTA(A){DA.call(this,null,A),this.modified(!0)}_A(BTA,DA,{transform(A,e){var t=e.dataflow,i=this.value,n=Tgt(A);(!i||n!==i.type)&&(this.value=i=Ci(n)());for(n in A)if(!zgt[n]){if(n==="padding"&&cTA(i.type))continue;Ct(i[n])?i[n](A[n]):t.warn("Unsupported scale property: "+n)}return $gt(i,A,Pgt(i,A,Ogt(i,A,t))),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function Tgt(A){var e=A.type,t="",i;return e===yQ?yQ+"-"+JJ:(_gt(A)&&(i=A.rawDomain?A.rawDomain.length:A.domain?A.domain.length+ +(A.domainMid!=null):0,t=i===2?yQ+"-":i===3?NJ+"-":""),(t+e||JJ).toLowerCase())}function _gt(A){const e=A.type;return BrA(e)&&e!==Cb&&e!==lb&&(A.scheme||A.range&&A.range.length&&A.range.every(ie))}function Ogt(A,e,t){const i=qgt(A,e.domainRaw,t);if(i>-1)return i;var n=e.domain,o=A.type,g=e.zero||e.zero===void 0&&Xgt(A),a,s;if(!n)return 0;if(cTA(o)&&e.padding&&n[0]!==Ut(n)&&(n=jgt(o,n,e.range,e.padding,e.exponent,e.constant)),(g||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null)&&(a=(n=n.slice()).length-1||1,g&&(n[0]>0&&(n[0]=0),n[a]<0&&(n[a]=0)),e.domainMin!=null&&(n[0]=e.domainMin),e.domainMax!=null&&(n[a]=e.domainMax),e.domainMid!=null)){s=e.domainMid;const I=s>n[a]?a+1:s<n[0]?0:a;I!==a&&t.warn("Scale domainMid exceeds domain min or max.",s),n.splice(I,0,s)}return A.domain(QTA(o,n,t)),o===rrA&&A.unknown(e.domainImplicit?m9:void 0),e.nice&&A.nice&&A.nice(e.nice!==!0&&drA(A,e.nice)||null),n.length}function qgt(A,e,t){return e?(A.domain(QTA(A.type,e,t)),e.length):-1}function jgt(A,e,t,i,n,o){var g=Math.abs(Ut(t)-t[0]),a=g/(g-2*i),s=A===od?NaA(e,null,a):A===tv?q9(e,null,a,.5):A===ev?q9(e,null,a,n||1):A===Y5?YaA(e,null,a,o||1):JaA(e,null,a);return e=e.slice(),e[0]=s[0],e[e.length-1]=s[1],e}function QTA(A,e,t){if(T9A(A)){var i=Math.abs(e.reduce((n,o)=>n+(o<0?-1:o>0?1:0),0));i!==e.length&&t.warn("Log scale domain includes zero: "+OA(e))}return e}function Pgt(A,e,t){let i=e.bins;if(i&&!RA(i)){const n=A.domain(),o=n[0],g=Ut(n),a=i.step;let s=i.start==null?o:i.start,I=i.stop==null?g:i.stop;a||YA("Scale bins parameter missing step property."),s<o&&(s=a*Math.ceil(o/a)),I>g&&(I=a*Math.floor(g/a)),i=Ga(s,I+a/2,a)}return i?A.bins=i:A.bins&&delete A.bins,A.type===CrA&&(i?!e.domain&&!e.domainRaw&&(A.domain(i),t=i.length):A.bins=A.domain()),t}function $gt(A,e,t){var i=A.type,n=e.round||!1,o=e.range;if(e.rangeStep!=null)o=Aat(i,e,t);else if(e.scheme&&(o=eat(i,e,t),Ct(o))){if(A.interpolator)return A.interpolator(o);YA(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&_9A(i))return A.interpolator(M5(kIA(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&A.interpolate?A.interpolate(ErA(e.interpolate,e.interpolateGamma)):Ct(A.round)?A.round(n):Ct(A.rangeRound)&&A.interpolate(n?nJ:ep),o&&A.range(kIA(o,e.reverse))}function Aat(A,e,t){A!==W9A&&A!==IrA&&YA("Only band and point scales support rangeStep.");var i=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,n=A===IrA?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*srA(t,n,i)]}function eat(A,e,t){var i=e.schemeExtent,n,o;return RA(e.scheme)?o=M5(e.scheme,e.interpolate,e.interpolateGamma):(n=e.scheme.toLowerCase(),o=urA(n),o||YA(`Unrecognized scheme name: ${e.scheme}`)),t=A===x5?t+1:A===CrA?t-1:A===YJ||A===R5?+e.schemeCount||Vgt:t,_9A(A)?ETA(o,i,e.reverse):Ct(o)?j9A(ETA(o,i),t):A===rrA?o:o.slice(0,t)}function ETA(A,e,t){return Ct(A)&&(e||t)?q9A(A,kIA(e||[0,1],t)):A}function kIA(A,e){return e?A.slice().reverse():A}function uTA(A){DA.call(this,null,A)}_A(uTA,DA,{transform(A,e){const t=A.modified("sort")||e.changed(e.ADD)||e.modified(A.sort.fields)||e.modified("datum");return t&&e.source.sort(ab(A.sort)),this.modified(t),e}});const dTA="zero",hTA="center",mTA="normalize",pTA=["y0","y1"];function JIA(A){DA.call(this,null,A)}JIA.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:dTA,values:[dTA,hTA,mTA]},{name:"as",type:"string",array:!0,length:2,default:pTA}]},_A(JIA,DA,{transform(A,e){var t=A.as||pTA,i=t[0],n=t[1],o=ab(A.sort),g=A.field||BJ,a=A.offset===hTA?tat:A.offset===mTA?iat:nat,s,I,r,C;for(s=oat(e.source,A.groupby,o,g),I=0,r=s.length,C=s.max;I<r;++I)a(s[I],C,g,i,n);return e.reflow(A.modified()).modifies(t)}});function tat(A,e,t,i,n){for(var o=(e-A.sum)/2,g=A.length,a=0,s;a<g;++a)s=A[a],s[i]=o,s[n]=o+=Math.abs(t(s))}function iat(A,e,t,i,n){for(var o=1/A.sum,g=0,a=A.length,s=0,I=0,r;s<a;++s)r=A[s],r[i]=g,r[n]=g=o*(I+=Math.abs(t(r)))}function nat(A,e,t,i,n){for(var o=0,g=0,a=A.length,s=0,I,r;s<a;++s)r=A[s],I=+t(r),I<0?(r[i]=g,r[n]=g+=I):(r[i]=o,r[n]=o+=I)}function oat(A,e,t,i){var n=[],o=E=>E(r),g,a,s,I,r,C,l,c,B;if(e==null)n.push(A.slice());else for(g={},a=0,s=A.length;a<s;++a)r=A[a],C=e.map(o),l=g[C],l||(g[C]=l=[],n.push(l)),l.push(r);for(C=0,B=0,I=n.length;C<I;++C){for(l=n[C],a=0,c=0,s=l.length;a<s;++a)c+=Math.abs(i(l[a]));l.sum=c,c>B&&(B=c),t&&l.sort(t)}return n.max=B,n}const gat=Object.freeze(Object.defineProperty({__proto__:null,axisticks:oTA,datajoin:gTA,encode:aTA,legendentries:sTA,linkpath:DIA,pie:GIA,scale:BTA,sortitems:uTA,stack:JIA},Symbol.toStringTag,{value:"Module"}));var xe=1e-6,mz=1e-12,wt=Math.PI,Io=wt/2,pz=wt/4,Is=wt*2,wo=180/wt,ft=wt/180,Vt=Math.abs,UJ=Math.atan,rl=Math.atan2,Fe=Math.cos,fz=Math.ceil,fTA=Math.exp,NIA=Math.hypot,yz=Math.log,YIA=Math.pow,Ye=Math.sin,Il=Math.sign||function(A){return A>0?1:A<0?-1:0},Cs=Math.sqrt,RIA=Math.tan;function yTA(A){return A>1?0:A<-1?wt:Math.acos(A)}function Cr(A){return A>1?Io:A<-1?-Io:Math.asin(A)}function ta(){}function bz(A,e){A&&wTA.hasOwnProperty(A.type)&&wTA[A.type](A,e)}var bTA={Feature:function(A,e){bz(A.geometry,e)},FeatureCollection:function(A,e){for(var t=A.features,i=-1,n=t.length;++i<n;)bz(t[i].geometry,e)}},wTA={Sphere:function(A,e){e.sphere()},Point:function(A,e){A=A.coordinates,e.point(A[0],A[1],A[2])},MultiPoint:function(A,e){for(var t=A.coordinates,i=-1,n=t.length;++i<n;)A=t[i],e.point(A[0],A[1],A[2])},LineString:function(A,e){xIA(A.coordinates,e,0)},MultiLineString:function(A,e){for(var t=A.coordinates,i=-1,n=t.length;++i<n;)xIA(t[i],e,0)},Polygon:function(A,e){DTA(A.coordinates,e)},MultiPolygon:function(A,e){for(var t=A.coordinates,i=-1,n=t.length;++i<n;)DTA(t[i],e)},GeometryCollection:function(A,e){for(var t=A.geometries,i=-1,n=t.length;++i<n;)bz(t[i],e)}};function xIA(A,e,t){var i=-1,n=A.length-t,o;for(e.lineStart();++i<n;)o=A[i],e.point(o[0],o[1],o[2]);e.lineEnd()}function DTA(A,e){var t=-1,i=A.length;for(e.polygonStart();++t<i;)xIA(A[t],e,1);e.polygonEnd()}function rd(A,e){A&&bTA.hasOwnProperty(A.type)?bTA[A.type](A,e):bz(A,e)}var wz=new ao,Dz=new ao,GTA,kTA,FIA,MIA,vIA,GQ={point:ta,lineStart:ta,lineEnd:ta,polygonStart:function(){wz=new ao,GQ.lineStart=aat,GQ.lineEnd=sat},polygonEnd:function(){var A=+wz;Dz.add(A<0?Is+A:A),this.lineStart=this.lineEnd=this.point=ta},sphere:function(){Dz.add(Is)}};function aat(){GQ.point=rat}function sat(){JTA(GTA,kTA)}function rat(A,e){GQ.point=JTA,GTA=A,kTA=e,A*=ft,e*=ft,FIA=A,MIA=Fe(e=e/2+pz),vIA=Ye(e)}function JTA(A,e){A*=ft,e*=ft,e=e/2+pz;var t=A-FIA,i=t>=0?1:-1,n=i*t,o=Fe(e),g=Ye(e),a=vIA*g,s=MIA*o+a*Fe(n),I=a*i*Ye(n);wz.add(rl(I,s)),FIA=A,MIA=o,vIA=g}function Iat(A){return Dz=new ao,rd(A,GQ),Dz*2}function Gz(A){return[rl(A[1],A[0]),Cr(A[2])]}function mb(A){var e=A[0],t=A[1],i=Fe(t);return[i*Fe(e),i*Ye(e),Ye(t)]}function kz(A,e){return A[0]*e[0]+A[1]*e[1]+A[2]*e[2]}function VJ(A,e){return[A[1]*e[2]-A[2]*e[1],A[2]*e[0]-A[0]*e[2],A[0]*e[1]-A[1]*e[0]]}function LIA(A,e){A[0]+=e[0],A[1]+=e[1],A[2]+=e[2]}function Jz(A,e){return[A[0]*e,A[1]*e,A[2]*e]}function Nz(A){var e=Cs(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);A[0]/=e,A[1]/=e,A[2]/=e}var jn,lr,Co,JI,pb,NTA,YTA,XJ,wv,Yp,Id,Cd={point:SIA,lineStart:xTA,lineEnd:FTA,polygonStart:function(){Cd.point=MTA,Cd.lineStart=Cat,Cd.lineEnd=lat,wv=new ao,GQ.polygonStart()},polygonEnd:function(){GQ.polygonEnd(),Cd.point=SIA,Cd.lineStart=xTA,Cd.lineEnd=FTA,wz<0?(jn=-(Co=180),lr=-(JI=90)):wv>xe?JI=90:wv<-xe&&(lr=-90),Id[0]=jn,Id[1]=Co},sphere:function(){jn=-(Co=180),lr=-(JI=90)}};function SIA(A,e){Yp.push(Id=[jn=A,Co=A]),e<lr&&(lr=e),e>JI&&(JI=e)}function RTA(A,e){var t=mb([A*ft,e*ft]);if(XJ){var i=VJ(XJ,t),n=[i[1],-i[0],0],o=VJ(n,i);Nz(o),o=Gz(o);var g=A-pb,a=g>0?1:-1,s=o[0]*wo*a,I,r=Vt(g)>180;r^(a*pb<s&&s<a*A)?(I=o[1]*wo,I>JI&&(JI=I)):(s=(s+360)%360-180,r^(a*pb<s&&s<a*A)?(I=-o[1]*wo,I<lr&&(lr=I)):(e<lr&&(lr=e),e>JI&&(JI=e))),r?A<pb?NI(jn,A)>NI(jn,Co)&&(Co=A):NI(A,Co)>NI(jn,Co)&&(jn=A):Co>=jn?(A<jn&&(jn=A),A>Co&&(Co=A)):A>pb?NI(jn,A)>NI(jn,Co)&&(Co=A):NI(A,Co)>NI(jn,Co)&&(jn=A)}else Yp.push(Id=[jn=A,Co=A]);e<lr&&(lr=e),e>JI&&(JI=e),XJ=t,pb=A}function xTA(){Cd.point=RTA}function FTA(){Id[0]=jn,Id[1]=Co,Cd.point=SIA,XJ=null}function MTA(A,e){if(XJ){var t=A-pb;wv.add(Vt(t)>180?t+(t>0?360:-360):t)}else NTA=A,YTA=e;GQ.point(A,e),RTA(A,e)}function Cat(){GQ.lineStart()}function lat(){MTA(NTA,YTA),GQ.lineEnd(),Vt(wv)>xe&&(jn=-(Co=180)),Id[0]=jn,Id[1]=Co,XJ=null}function NI(A,e){return(e-=A)<0?e+360:e}function cat(A,e){return A[0]-e[0]}function vTA(A,e){return A[0]<=A[1]?A[0]<=e&&e<=A[1]:e<A[0]||A[1]<e}function Bat(A){var e,t,i,n,o,g,a;if(JI=Co=-(jn=lr=1/0),Yp=[],rd(A,Cd),t=Yp.length){for(Yp.sort(cat),e=1,i=Yp[0],o=[i];e<t;++e)n=Yp[e],vTA(i,n[0])||vTA(i,n[1])?(NI(i[0],n[1])>NI(i[0],i[1])&&(i[1]=n[1]),NI(n[0],i[1])>NI(i[0],i[1])&&(i[0]=n[0])):o.push(i=n);for(g=-1/0,t=o.length-1,e=0,i=o[t];e<=t;i=n,++e)n=o[e],(a=NI(i[1],n[0]))>g&&(g=a,jn=n[0],Co=i[1])}return Yp=Id=null,jn===1/0||lr===1/0?[[NaN,NaN],[NaN,NaN]]:[[jn,lr],[Co,JI]]}var Dv,Yz,Rz,xz,Fz,Mz,vz,Lz,HIA,ZIA,WIA,LTA,STA,ls,cs,Bs,kc={sphere:ta,point:KIA,lineStart:HTA,lineEnd:ZTA,polygonStart:function(){kc.lineStart=uat,kc.lineEnd=dat},polygonEnd:function(){kc.lineStart=HTA,kc.lineEnd=ZTA}};function KIA(A,e){A*=ft,e*=ft;var t=Fe(e);Gv(t*Fe(A),t*Ye(A),Ye(e))}function Gv(A,e,t){++Dv,Rz+=(A-Rz)/Dv,xz+=(e-xz)/Dv,Fz+=(t-Fz)/Dv}function HTA(){kc.point=Qat}function Qat(A,e){A*=ft,e*=ft;var t=Fe(e);ls=t*Fe(A),cs=t*Ye(A),Bs=Ye(e),kc.point=Eat,Gv(ls,cs,Bs)}function Eat(A,e){A*=ft,e*=ft;var t=Fe(e),i=t*Fe(A),n=t*Ye(A),o=Ye(e),g=rl(Cs((g=cs*o-Bs*n)*g+(g=Bs*i-ls*o)*g+(g=ls*n-cs*i)*g),ls*i+cs*n+Bs*o);Yz+=g,Mz+=g*(ls+(ls=i)),vz+=g*(cs+(cs=n)),Lz+=g*(Bs+(Bs=o)),Gv(ls,cs,Bs)}function ZTA(){kc.point=KIA}function uat(){kc.point=hat}function dat(){WTA(LTA,STA),kc.point=KIA}function hat(A,e){LTA=A,STA=e,A*=ft,e*=ft,kc.point=WTA;var t=Fe(e);ls=t*Fe(A),cs=t*Ye(A),Bs=Ye(e),Gv(ls,cs,Bs)}function WTA(A,e){A*=ft,e*=ft;var t=Fe(e),i=t*Fe(A),n=t*Ye(A),o=Ye(e),g=cs*o-Bs*n,a=Bs*i-ls*o,s=ls*n-cs*i,I=NIA(g,a,s),r=Cr(I),C=I&&-r/I;HIA.add(C*g),ZIA.add(C*a),WIA.add(C*s),Yz+=r,Mz+=r*(ls+(ls=i)),vz+=r*(cs+(cs=n)),Lz+=r*(Bs+(Bs=o)),Gv(ls,cs,Bs)}function mat(A){Dv=Yz=Rz=xz=Fz=Mz=vz=Lz=0,HIA=new ao,ZIA=new ao,WIA=new ao,rd(A,kc);var e=+HIA,t=+ZIA,i=+WIA,n=NIA(e,t,i);return n<mz&&(e=Mz,t=vz,i=Lz,Yz<xe&&(e=Rz,t=xz,i=Fz),n=NIA(e,t,i),n<mz)?[NaN,NaN]:[rl(t,e)*wo,Cr(i/n)*wo]}function UIA(A,e){function t(i,n){return i=A(i,n),e(i[0],i[1])}return A.invert&&e.invert&&(t.invert=function(i,n){return i=e.invert(i,n),i&&A.invert(i[0],i[1])}),t}function VIA(A,e){return Vt(A)>wt&&(A-=Math.round(A/Is)*Is),[A,e]}VIA.invert=VIA;function KTA(A,e,t){return(A%=Is)?e||t?UIA(VTA(A),XTA(e,t)):VTA(A):e||t?XTA(e,t):VIA}function UTA(A){return function(e,t){return e+=A,Vt(e)>wt&&(e-=Math.round(e/Is)*Is),[e,t]}}function VTA(A){var e=UTA(A);return e.invert=UTA(-A),e}function XTA(A,e){var t=Fe(A),i=Ye(A),n=Fe(e),o=Ye(e);function g(a,s){var I=Fe(s),r=Fe(a)*I,C=Ye(a)*I,l=Ye(s),c=l*t+r*i;return[rl(C*n-c*o,r*t-l*i),Cr(c*n+C*o)]}return g.invert=function(a,s){var I=Fe(s),r=Fe(a)*I,C=Ye(a)*I,l=Ye(s),c=l*n-C*o;return[rl(C*n+l*o,r*t+c*i),Cr(c*t-r*i)]},g}function pat(A){A=KTA(A[0]*ft,A[1]*ft,A.length>2?A[2]*ft:0);function e(t){return t=A(t[0]*ft,t[1]*ft),t[0]*=wo,t[1]*=wo,t}return e.invert=function(t){return t=A.invert(t[0]*ft,t[1]*ft),t[0]*=wo,t[1]*=wo,t},e}function fat(A,e,t,i,n,o){if(t){var g=Fe(e),a=Ye(e),s=i*t;n==null?(n=e+i*Is,o=e-s/2):(n=zTA(g,n),o=zTA(g,o),(i>0?n<o:n>o)&&(n+=i*Is));for(var I,r=n;i>0?r>o:r<o;r-=s)I=Gz([g,-a*Fe(r),-a*Ye(r)]),A.point(I[0],I[1])}}function zTA(A,e){e=mb(e),e[0]-=A,Nz(e);var t=yTA(-e[1]);return((-e[2]<0?-t:t)+Is-xe)%Is}function TTA(){var A=[],e;return{point:function(t,i,n){e.push([t,i,n])},lineStart:function(){A.push(e=[])},lineEnd:ta,rejoin:function(){A.length>1&&A.push(A.pop().concat(A.shift()))},result:function(){var t=A;return A=[],e=null,t}}}function Sz(A,e){return Vt(A[0]-e[0])<xe&&Vt(A[1]-e[1])<xe}function Hz(A,e,t,i){this.x=A,this.z=e,this.o=t,this.e=i,this.v=!1,this.n=this.p=null}function _TA(A,e,t,i,n){var o=[],g=[],a,s;if(A.forEach(function(B){if(!((E=B.length-1)<=0)){var E,u=B[0],d=B[E],f;if(Sz(u,d)){if(!u[2]&&!d[2]){for(n.lineStart(),a=0;a<E;++a)n.point((u=B[a])[0],u[1]);n.lineEnd();return}d[0]+=2*xe}o.push(f=new Hz(u,B,null,!0)),g.push(f.o=new Hz(u,null,f,!1)),o.push(f=new Hz(d,B,null,!1)),g.push(f.o=new Hz(d,null,f,!0))}}),!!o.length){for(g.sort(e),OTA(o),OTA(g),a=0,s=g.length;a<s;++a)g[a].e=t=!t;for(var I=o[0],r,C;;){for(var l=I,c=!0;l.v;)if((l=l.n)===I)return;r=l.z,n.lineStart();do{if(l.v=l.o.v=!0,l.e){if(c)for(a=0,s=r.length;a<s;++a)n.point((C=r[a])[0],C[1]);else i(l.x,l.n.x,1,n);l=l.n}else{if(c)for(r=l.p.z,a=r.length-1;a>=0;--a)n.point((C=r[a])[0],C[1]);else i(l.x,l.p.x,-1,n);l=l.p}l=l.o,r=l.z,c=!c}while(!l.v);n.lineEnd()}}}function OTA(A){if(e=A.length){for(var e,t=0,i=A[0],n;++t<e;)i.n=n=A[t],n.p=i,i=n;i.n=n=A[0],n.p=i}}function XIA(A){return Vt(A[0])<=wt?A[0]:Il(A[0])*((Vt(A[0])+wt)%Is-wt)}function yat(A,e){var t=XIA(e),i=e[1],n=Ye(i),o=[Ye(t),-Fe(t),0],g=0,a=0,s=new ao;n===1?i=Io+xe:n===-1&&(i=-Io-xe);for(var I=0,r=A.length;I<r;++I)if(l=(C=A[I]).length)for(var C,l,c=C[l-1],B=XIA(c),E=c[1]/2+pz,u=Ye(E),d=Fe(E),f=0;f<l;++f,B=y,u=R,d=x,c=w){var w=C[f],y=XIA(w),G=w[1]/2+pz,R=Ye(G),x=Fe(G),F=y-B,Q=F>=0?1:-1,k=Q*F,h=k>wt,N=u*R;if(s.add(rl(N*Q*Ye(k),d*x+N*Fe(k))),g+=h?F+Q*Is:F,h^B>=t^y>=t){var v=VJ(mb(c),mb(w));Nz(v);var K=VJ(o,v);Nz(K);var U=(h^F>=0?-1:1)*Cr(K[2]);(i>U||i===U&&(v[0]||v[1]))&&(a+=h^F>=0?1:-1)}}return(g<-xe||g<xe&&s<-mz)^a&1}function qTA(A,e,t,i){return function(n){var o=e(n),g=TTA(),a=e(g),s=!1,I,r,C,l={point:c,lineStart:E,lineEnd:u,polygonStart:function(){l.point=d,l.lineStart=f,l.lineEnd=w,r=[],I=[]},polygonEnd:function(){l.point=c,l.lineStart=E,l.lineEnd=u,r=d9(r);var y=yat(I,i);r.length?(s||(n.polygonStart(),s=!0),_TA(r,wat,y,t,n)):y&&(s||(n.polygonStart(),s=!0),n.lineStart(),t(null,null,1,n),n.lineEnd()),s&&(n.polygonEnd(),s=!1),r=I=null},sphere:function(){n.polygonStart(),n.lineStart(),t(null,null,1,n),n.lineEnd(),n.polygonEnd()}};function c(y,G){A(y,G)&&n.point(y,G)}function B(y,G){o.point(y,G)}function E(){l.point=B,o.lineStart()}function u(){l.point=c,o.lineEnd()}function d(y,G){C.push([y,G]),a.point(y,G)}function f(){a.lineStart(),C=[]}function w(){d(C[0][0],C[0][1]),a.lineEnd();var y=a.clean(),G=g.result(),R,x=G.length,F,Q,k;if(C.pop(),I.push(C),C=null,!!x){if(y&1){if(Q=G[0],(F=Q.length-1)>0){for(s||(n.polygonStart(),s=!0),n.lineStart(),R=0;R<F;++R)n.point((k=Q[R])[0],k[1]);n.lineEnd()}return}x>1&&y&2&&G.push(G.pop().concat(G.shift())),r.push(G.filter(bat))}}return l}}function bat(A){return A.length>1}function wat(A,e){return((A=A.x)[0]<0?A[1]-Io-xe:Io-A[1])-((e=e.x)[0]<0?e[1]-Io-xe:Io-e[1])}const jTA=qTA(function(){return!0},Dat,kat,[-wt,-Io]);function Dat(A){var e=NaN,t=NaN,i=NaN,n;return{lineStart:function(){A.lineStart(),n=1},point:function(o,g){var a=o>0?wt:-wt,s=Vt(o-e);Vt(s-wt)<xe?(A.point(e,t=(t+g)/2>0?Io:-Io),A.point(i,t),A.lineEnd(),A.lineStart(),A.point(a,t),A.point(o,t),n=0):i!==a&&s>=wt&&(Vt(e-i)<xe&&(e-=i*xe),Vt(o-a)<xe&&(o-=a*xe),t=Gat(e,t,o,g),A.point(i,t),A.lineEnd(),A.lineStart(),A.point(a,t),n=0),A.point(e=o,t=g),i=a},lineEnd:function(){A.lineEnd(),e=t=NaN},clean:function(){return 2-n}}}function Gat(A,e,t,i){var n,o,g=Ye(A-t);return Vt(g)>xe?UJ((Ye(e)*(o=Fe(i))*Ye(t)-Ye(i)*(n=Fe(e))*Ye(A))/(n*o*g)):(e+i)/2}function kat(A,e,t,i){var n;if(A==null)n=t*Io,i.point(-wt,n),i.point(0,n),i.point(wt,n),i.point(wt,0),i.point(wt,-n),i.point(0,-n),i.point(-wt,-n),i.point(-wt,0),i.point(-wt,n);else if(Vt(A[0]-e[0])>xe){var o=A[0]<e[0]?wt:-wt;n=t*o/2,i.point(-o,n),i.point(0,n),i.point(o,n)}else i.point(e[0],e[1])}function Jat(A){var e=Fe(A),t=6*ft,i=e>0,n=Vt(e)>xe;function o(r,C,l,c){fat(c,A,t,l,r,C)}function g(r,C){return Fe(r)*Fe(C)>e}function a(r){var C,l,c,B,E;return{lineStart:function(){B=c=!1,E=1},point:function(u,d){var f=[u,d],w,y=g(u,d),G=i?y?0:I(u,d):y?I(u+(u<0?wt:-wt),d):0;if(!C&&(B=c=y)&&r.lineStart(),y!==c&&(w=s(C,f),(!w||Sz(C,w)||Sz(f,w))&&(f[2]=1)),y!==c)E=0,y?(r.lineStart(),w=s(f,C),r.point(w[0],w[1])):(w=s(C,f),r.point(w[0],w[1],2),r.lineEnd()),C=w;else if(n&&C&&i^y){var R;!(G&l)&&(R=s(f,C,!0))&&(E=0,i?(r.lineStart(),r.point(R[0][0],R[0][1]),r.point(R[1][0],R[1][1]),r.lineEnd()):(r.point(R[1][0],R[1][1]),r.lineEnd(),r.lineStart(),r.point(R[0][0],R[0][1],3)))}y&&(!C||!Sz(C,f))&&r.point(f[0],f[1]),C=f,c=y,l=G},lineEnd:function(){c&&r.lineEnd(),C=null},clean:function(){return E|(B&&c)<<1}}}function s(r,C,l){var c=mb(r),B=mb(C),E=[1,0,0],u=VJ(c,B),d=kz(u,u),f=u[0],w=d-f*f;if(!w)return!l&&r;var y=e*d/w,G=-e*f/w,R=VJ(E,u),x=Jz(E,y),F=Jz(u,G);LIA(x,F);var Q=R,k=kz(x,Q),h=kz(Q,Q),N=k*k-h*(kz(x,x)-1);if(!(N<0)){var v=Cs(N),K=Jz(Q,(-k-v)/h);if(LIA(K,x),K=Gz(K),!l)return K;var U=r[0],V=C[0],X=r[1],_=C[1],q;V<U&&(q=U,U=V,V=q);var $=V-U,nA=Vt($-wt)<xe,j=nA||$<xe;if(!nA&&_<X&&(q=X,X=_,_=q),j?nA?X+_>0^K[1]<(Vt(K[0]-U)<xe?X:_):X<=K[1]&&K[1]<=_:$>wt^(U<=K[0]&&K[0]<=V)){var O=Jz(Q,(-k+v)/h);return LIA(O,x),[K,Gz(O)]}}}function I(r,C){var l=i?A:wt-A,c=0;return r<-l?c|=1:r>l&&(c|=2),C<-l?c|=4:C>l&&(c|=8),c}return qTA(g,a,o,i?[0,-A]:[-wt,A-wt])}function Nat(A,e,t,i,n,o){var g=A[0],a=A[1],s=e[0],I=e[1],r=0,C=1,l=s-g,c=I-a,B;if(B=t-g,!(!l&&B>0)){if(B/=l,l<0){if(B<r)return;B<C&&(C=B)}else if(l>0){if(B>C)return;B>r&&(r=B)}if(B=n-g,!(!l&&B<0)){if(B/=l,l<0){if(B>C)return;B>r&&(r=B)}else if(l>0){if(B<r)return;B<C&&(C=B)}if(B=i-a,!(!c&&B>0)){if(B/=c,c<0){if(B<r)return;B<C&&(C=B)}else if(c>0){if(B>C)return;B>r&&(r=B)}if(B=o-a,!(!c&&B<0)){if(B/=c,c<0){if(B>C)return;B>r&&(r=B)}else if(c>0){if(B<r)return;B<C&&(C=B)}return r>0&&(A[0]=g+r*l,A[1]=a+r*c),C<1&&(e[0]=g+C*l,e[1]=a+C*c),!0}}}}}var kv=1e9,Zz=-kv;function PTA(A,e,t,i){function n(I,r){return A<=I&&I<=t&&e<=r&&r<=i}function o(I,r,C,l){var c=0,B=0;if(I==null||(c=g(I,C))!==(B=g(r,C))||s(I,r)<0^C>0)do l.point(c===0||c===3?A:t,c>1?i:e);while((c=(c+C+4)%4)!==B);else l.point(r[0],r[1])}function g(I,r){return Vt(I[0]-A)<xe?r>0?0:3:Vt(I[0]-t)<xe?r>0?2:1:Vt(I[1]-e)<xe?r>0?1:0:r>0?3:2}function a(I,r){return s(I.x,r.x)}function s(I,r){var C=g(I,1),l=g(r,1);return C!==l?C-l:C===0?r[1]-I[1]:C===1?I[0]-r[0]:C===2?I[1]-r[1]:r[0]-I[0]}return function(I){var r=I,C=TTA(),l,c,B,E,u,d,f,w,y,G,R,x={point:F,lineStart:N,lineEnd:v,polygonStart:k,polygonEnd:h};function F(U,V){n(U,V)&&r.point(U,V)}function Q(){for(var U=0,V=0,X=c.length;V<X;++V)for(var _=c[V],q=1,$=_.length,nA=_[0],j,O,eA=nA[0],oA=nA[1];q<$;++q)j=eA,O=oA,nA=_[q],eA=nA[0],oA=nA[1],O<=i?oA>i&&(eA-j)*(i-O)>(oA-O)*(A-j)&&++U:oA<=i&&(eA-j)*(i-O)<(oA-O)*(A-j)&&--U;return U}function k(){r=C,l=[],c=[],R=!0}function h(){var U=Q(),V=R&&U,X=(l=d9(l)).length;(V||X)&&(I.polygonStart(),V&&(I.lineStart(),o(null,null,1,I),I.lineEnd()),X&&_TA(l,a,U,o,I),I.polygonEnd()),r=I,l=c=B=null}function N(){x.point=K,c&&c.push(B=[]),G=!0,y=!1,f=w=NaN}function v(){l&&(K(E,u),d&&y&&C.rejoin(),l.push(C.result())),x.point=F,y&&r.lineEnd()}function K(U,V){var X=n(U,V);if(c&&B.push([U,V]),G)E=U,u=V,d=X,G=!1,X&&(r.lineStart(),r.point(U,V));else if(X&&y)r.point(U,V);else{var _=[f=Math.max(Zz,Math.min(kv,f)),w=Math.max(Zz,Math.min(kv,w))],q=[U=Math.max(Zz,Math.min(kv,U)),V=Math.max(Zz,Math.min(kv,V))];Nat(_,q,A,e,t,i)?(y||(r.lineStart(),r.point(_[0],_[1])),r.point(q[0],q[1]),X||r.lineEnd(),R=!1):X&&(r.lineStart(),r.point(U,V),R=!1)}f=U,w=V,y=X}return x}}function $TA(A,e,t){var i=Ga(A,e-xe,t).concat(e);return function(n){return i.map(function(o){return[n,o]})}}function A_A(A,e,t){var i=Ga(A,e-xe,t).concat(e);return function(n){return i.map(function(o){return[o,n]})}}function Yat(){var A,e,t,i,n,o,g,a,s=10,I=s,r=90,C=360,l,c,B,E,u=2.5;function d(){return{type:"MultiLineString",coordinates:f()}}function f(){return Ga(fz(i/r)*r,t,r).map(B).concat(Ga(fz(a/C)*C,g,C).map(E)).concat(Ga(fz(e/s)*s,A,s).filter(function(w){return Vt(w%r)>xe}).map(l)).concat(Ga(fz(o/I)*I,n,I).filter(function(w){return Vt(w%C)>xe}).map(c))}return d.lines=function(){return f().map(function(w){return{type:"LineString",coordinates:w}})},d.outline=function(){return{type:"Polygon",coordinates:[B(i).concat(E(g).slice(1),B(t).reverse().slice(1),E(a).reverse().slice(1))]}},d.extent=function(w){return arguments.length?d.extentMajor(w).extentMinor(w):d.extentMinor()},d.extentMajor=function(w){return arguments.length?(i=+w[0][0],t=+w[1][0],a=+w[0][1],g=+w[1][1],i>t&&(w=i,i=t,t=w),a>g&&(w=a,a=g,g=w),d.precision(u)):[[i,a],[t,g]]},d.extentMinor=function(w){return arguments.length?(e=+w[0][0],A=+w[1][0],o=+w[0][1],n=+w[1][1],e>A&&(w=e,e=A,A=w),o>n&&(w=o,o=n,n=w),d.precision(u)):[[e,o],[A,n]]},d.step=function(w){return arguments.length?d.stepMajor(w).stepMinor(w):d.stepMinor()},d.stepMajor=function(w){return arguments.length?(r=+w[0],C=+w[1],d):[r,C]},d.stepMinor=function(w){return arguments.length?(s=+w[0],I=+w[1],d):[s,I]},d.precision=function(w){return arguments.length?(u=+w,l=$TA(o,n,90),c=A_A(e,A,u),B=$TA(a,g,90),E=A_A(i,t,u),d):u},d.extentMajor([[-180,-90+xe],[180,90-xe]]).extentMinor([[-180,-80-xe],[180,80+xe]])}const Jv=A=>A;var zIA=new ao,TIA=new ao,e_A,t_A,_IA,OIA,Rp={point:ta,lineStart:ta,lineEnd:ta,polygonStart:function(){Rp.lineStart=Rat,Rp.lineEnd=Fat},polygonEnd:function(){Rp.lineStart=Rp.lineEnd=Rp.point=ta,zIA.add(Vt(TIA)),TIA=new ao},result:function(){var A=zIA/2;return zIA=new ao,A}};function Rat(){Rp.point=xat}function xat(A,e){Rp.point=i_A,e_A=_IA=A,t_A=OIA=e}function i_A(A,e){TIA.add(OIA*A-_IA*e),_IA=A,OIA=e}function Fat(){i_A(e_A,t_A)}const n_A=Rp;var zJ=1/0,Wz=zJ,Nv=-zJ,Kz=Nv,Mat={point:vat,lineStart:ta,lineEnd:ta,polygonStart:ta,polygonEnd:ta,result:function(){var A=[[zJ,Wz],[Nv,Kz]];return Nv=Kz=-(Wz=zJ=1/0),A}};function vat(A,e){A<zJ&&(zJ=A),A>Nv&&(Nv=A),e<Wz&&(Wz=e),e>Kz&&(Kz=e)}const Uz=Mat;var qIA=0,jIA=0,Yv=0,Vz=0,Xz=0,TJ=0,PIA=0,$IA=0,Rv=0,o_A,g_A,kQ,JQ,Jc={point:fb,lineStart:a_A,lineEnd:s_A,polygonStart:function(){Jc.lineStart=Hat,Jc.lineEnd=Zat},polygonEnd:function(){Jc.point=fb,Jc.lineStart=a_A,Jc.lineEnd=s_A},result:function(){var A=Rv?[PIA/Rv,$IA/Rv]:TJ?[Vz/TJ,Xz/TJ]:Yv?[qIA/Yv,jIA/Yv]:[NaN,NaN];return qIA=jIA=Yv=Vz=Xz=TJ=PIA=$IA=Rv=0,A}};function fb(A,e){qIA+=A,jIA+=e,++Yv}function a_A(){Jc.point=Lat}function Lat(A,e){Jc.point=Sat,fb(kQ=A,JQ=e)}function Sat(A,e){var t=A-kQ,i=e-JQ,n=Cs(t*t+i*i);Vz+=n*(kQ+A)/2,Xz+=n*(JQ+e)/2,TJ+=n,fb(kQ=A,JQ=e)}function s_A(){Jc.point=fb}function Hat(){Jc.point=Wat}function Zat(){r_A(o_A,g_A)}function Wat(A,e){Jc.point=r_A,fb(o_A=kQ=A,g_A=JQ=e)}function r_A(A,e){var t=A-kQ,i=e-JQ,n=Cs(t*t+i*i);Vz+=n*(kQ+A)/2,Xz+=n*(JQ+e)/2,TJ+=n,n=JQ*A-kQ*e,PIA+=n*(kQ+A),$IA+=n*(JQ+e),Rv+=n*3,fb(kQ=A,JQ=e)}const I_A=Jc;function C_A(A){this._context=A}C_A.prototype={_radius:4.5,pointRadius:function(A){return this._radius=A,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(A,e){switch(this._point){case 0:{this._context.moveTo(A,e),this._point=1;break}case 1:{this._context.lineTo(A,e);break}default:{this._context.moveTo(A+this._radius,e),this._context.arc(A,e,this._radius,0,Is);break}}},result:ta};var ACA=new ao,eCA,l_A,c_A,xv,Fv,zz={point:ta,lineStart:function(){zz.point=Kat},lineEnd:function(){eCA&&B_A(l_A,c_A),zz.point=ta},polygonStart:function(){eCA=!0},polygonEnd:function(){eCA=null},result:function(){var A=+ACA;return ACA=new ao,A}};function Kat(A,e){zz.point=B_A,l_A=xv=A,c_A=Fv=e}function B_A(A,e){xv-=A,Fv-=e,ACA.add(Cs(xv*xv+Fv*Fv)),xv=A,Fv=e}const Q_A=zz;let E_A,Tz,u_A,d_A,h_A=class{constructor(A){this._append=A==null?m_A:Uat(A),this._radius=4.5,this._=""}pointRadius(A){return this._radius=+A,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(A,e){switch(this._point){case 0:{this._append`M${A},${e}`,this._point=1;break}case 1:{this._append`L${A},${e}`;break}default:{if(this._append`M${A},${e}`,this._radius!==u_A||this._append!==Tz){const t=this._radius,i=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,u_A=t,Tz=this._append,d_A=this._,this._=i}this._+=d_A;break}}}result(){const A=this._;return this._="",A.length?A:null}};function m_A(A){let e=1;this._+=A[0];for(const t=A.length;e<t;++e)this._+=arguments[e]+A[e]}function Uat(A){const e=Math.floor(A);if(!(e>=0))throw new RangeError(`invalid digits: ${A}`);if(e>15)return m_A;if(e!==E_A){const t=10**e;E_A=e,Tz=function(i){let n=1;this._+=i[0];for(const o=i.length;n<o;++n)this._+=Math.round(arguments[n]*t)/t+i[n]}}return Tz}function p_A(A,e){let t=3,i=4.5,n,o;function g(a){return a&&(typeof i=="function"&&o.pointRadius(+i.apply(this,arguments)),rd(a,n(o))),o.result()}return g.area=function(a){return rd(a,n(n_A)),n_A.result()},g.measure=function(a){return rd(a,n(Q_A)),Q_A.result()},g.bounds=function(a){return rd(a,n(Uz)),Uz.result()},g.centroid=function(a){return rd(a,n(I_A)),I_A.result()},g.projection=function(a){return arguments.length?(n=a==null?(A=null,Jv):(A=a).stream,g):A},g.context=function(a){return arguments.length?(o=a==null?(e=null,new h_A(t)):new C_A(e=a),typeof i!="function"&&o.pointRadius(i),g):e},g.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(o.pointRadius(+a),+a),g):i},g.digits=function(a){if(!arguments.length)return t;if(a==null)t=null;else{const s=Math.floor(a);if(!(s>=0))throw new RangeError(`invalid digits: ${a}`);t=s}return e===null&&(o=new h_A(t)),g},g.projection(A).digits(t).context(e)}function _z(A){return function(e){var t=new tCA;for(var i in A)t[i]=A[i];return t.stream=e,t}}function tCA(){}tCA.prototype={constructor:tCA,point:function(A,e){this.stream.point(A,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function iCA(A,e,t){var i=A.clipExtent&&A.clipExtent();return A.scale(150).translate([0,0]),i!=null&&A.clipExtent(null),rd(t,A.stream(Uz)),e(Uz.result()),i!=null&&A.clipExtent(i),A}function Oz(A,e,t){return iCA(A,function(i){var n=e[1][0]-e[0][0],o=e[1][1]-e[0][1],g=Math.min(n/(i[1][0]-i[0][0]),o/(i[1][1]-i[0][1])),a=+e[0][0]+(n-g*(i[1][0]+i[0][0]))/2,s=+e[0][1]+(o-g*(i[1][1]+i[0][1]))/2;A.scale(150*g).translate([a,s])},t)}function nCA(A,e,t){return Oz(A,[[0,0],e],t)}function oCA(A,e,t){return iCA(A,function(i){var n=+e,o=n/(i[1][0]-i[0][0]),g=(n-o*(i[1][0]+i[0][0]))/2,a=-o*i[0][1];A.scale(150*o).translate([g,a])},t)}function gCA(A,e,t){return iCA(A,function(i){var n=+e,o=n/(i[1][1]-i[0][1]),g=-o*i[0][0],a=(n-o*(i[1][1]+i[0][1]))/2;A.scale(150*o).translate([g,a])},t)}var f_A=16,Vat=Fe(30*ft);function y_A(A,e){return+e?zat(A,e):Xat(A)}function Xat(A){return _z({point:function(e,t){e=A(e,t),this.stream.point(e[0],e[1])}})}function zat(A,e){function t(i,n,o,g,a,s,I,r,C,l,c,B,E,u){var d=I-i,f=r-n,w=d*d+f*f;if(w>4*e&&E--){var y=g+l,G=a+c,R=s+B,x=Cs(y*y+G*G+R*R),F=Cr(R/=x),Q=Vt(Vt(R)-1)<xe||Vt(o-C)<xe?(o+C)/2:rl(G,y),k=A(Q,F),h=k[0],N=k[1],v=h-i,K=N-n,U=f*v-d*K;(U*U/w>e||Vt((d*v+f*K)/w-.5)>.3||g*l+a*c+s*B<Vat)&&(t(i,n,o,g,a,s,h,N,Q,y/=x,G/=x,R,E,u),u.point(h,N),t(h,N,Q,y,G,R,I,r,C,l,c,B,E,u))}}return function(i){var n,o,g,a,s,I,r,C,l,c,B,E,u={point:d,lineStart:f,lineEnd:y,polygonStart:function(){i.polygonStart(),u.lineStart=G},polygonEnd:function(){i.polygonEnd(),u.lineStart=f}};function d(F,Q){F=A(F,Q),i.point(F[0],F[1])}function f(){C=NaN,u.point=w,i.lineStart()}function w(F,Q){var k=mb([F,Q]),h=A(F,Q);t(C,l,r,c,B,E,C=h[0],l=h[1],r=F,c=k[0],B=k[1],E=k[2],f_A,i),i.point(C,l)}function y(){u.point=d,i.lineEnd()}function G(){f(),u.point=R,u.lineEnd=x}function R(F,Q){w(n=F,Q),o=C,g=l,a=c,s=B,I=E,u.point=w}function x(){t(C,l,r,c,B,E,o,g,n,a,s,I,f_A,i),u.lineEnd=y,y()}return u}}var Tat=_z({point:function(A,e){this.stream.point(A*ft,e*ft)}});function _at(A){return _z({point:function(e,t){var i=A(e,t);return this.stream.point(i[0],i[1])}})}function Oat(A,e,t,i,n){function o(g,a){return g*=i,a*=n,[e+A*g,t-A*a]}return o.invert=function(g,a){return[(g-e)/A*i,(t-a)/A*n]},o}function b_A(A,e,t,i,n,o){if(!o)return Oat(A,e,t,i,n);var g=Fe(o),a=Ye(o),s=g*A,I=a*A,r=g/A,C=a/A,l=(a*t-g*e)/A,c=(a*e+g*t)/A;function B(E,u){return E*=i,u*=n,[s*E-I*u+e,t-I*E-s*u]}return B.invert=function(E,u){return[i*(r*E-C*u+l),n*(c-C*E-r*u)]},B}function NQ(A){return w_A(function(){return A})()}function w_A(A){var e,t=150,i=480,n=250,o=0,g=0,a=0,s=0,I=0,r,C=0,l=1,c=1,B=null,E=jTA,u=null,d,f,w,y=Jv,G=.5,R,x,F,Q,k;function h(U){return F(U[0]*ft,U[1]*ft)}function N(U){return U=F.invert(U[0],U[1]),U&&[U[0]*wo,U[1]*wo]}h.stream=function(U){return Q&&k===U?Q:Q=Tat(_at(r)(E(R(y(k=U)))))},h.preclip=function(U){return arguments.length?(E=U,B=void 0,K()):E},h.postclip=function(U){return arguments.length?(y=U,u=d=f=w=null,K()):y},h.clipAngle=function(U){return arguments.length?(E=+U?Jat(B=U*ft):(B=null,jTA),K()):B*wo},h.clipExtent=function(U){return arguments.length?(y=U==null?(u=d=f=w=null,Jv):PTA(u=+U[0][0],d=+U[0][1],f=+U[1][0],w=+U[1][1]),K()):u==null?null:[[u,d],[f,w]]},h.scale=function(U){return arguments.length?(t=+U,v()):t},h.translate=function(U){return arguments.length?(i=+U[0],n=+U[1],v()):[i,n]},h.center=function(U){return arguments.length?(o=U[0]%360*ft,g=U[1]%360*ft,v()):[o*wo,g*wo]},h.rotate=function(U){return arguments.length?(a=U[0]%360*ft,s=U[1]%360*ft,I=U.length>2?U[2]%360*ft:0,v()):[a*wo,s*wo,I*wo]},h.angle=function(U){return arguments.length?(C=U%360*ft,v()):C*wo},h.reflectX=function(U){return arguments.length?(l=U?-1:1,v()):l<0},h.reflectY=function(U){return arguments.length?(c=U?-1:1,v()):c<0},h.precision=function(U){return arguments.length?(R=y_A(x,G=U*U),K()):Cs(G)},h.fitExtent=function(U,V){return Oz(h,U,V)},h.fitSize=function(U,V){return nCA(h,U,V)},h.fitWidth=function(U,V){return oCA(h,U,V)},h.fitHeight=function(U,V){return gCA(h,U,V)};function v(){var U=b_A(t,0,0,l,c,C).apply(null,e(o,g)),V=b_A(t,i-U[0],n-U[1],l,c,C);return r=KTA(a,s,I),x=UIA(e,V),F=UIA(r,x),R=y_A(x,G),K()}function K(){return Q=k=null,h}return function(){return e=A.apply(this,arguments),h.invert=e.invert&&N,v()}}function aCA(A){var e=0,t=wt/3,i=w_A(A),n=i(e,t);return n.parallels=function(o){return arguments.length?i(e=o[0]*ft,t=o[1]*ft):[e*wo,t*wo]},n}function qat(A){var e=Fe(A);function t(i,n){return[i*e,Ye(n)/e]}return t.invert=function(i,n){return[i/e,Cr(n*e)]},t}function jat(A,e){var t=Ye(A),i=(t+Ye(e))/2;if(Vt(i)<xe)return qat(A);var n=1+t*(2*i-t),o=Cs(n)/i;function g(a,s){var I=Cs(n-2*i*Ye(s))/i;return[I*Ye(a*=i),o-I*Fe(a)]}return g.invert=function(a,s){var I=o-s,r=rl(a,Vt(I))*Il(I);return I*i<0&&(r-=wt*Il(a)*Il(I)),[r/i,Cr((n-(a*a+I*I)*i*i)/(2*i))]},g}function qz(){return aCA(jat).scale(155.424).center([0,33.6442])}function D_A(){return qz().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Pat(A){var e=A.length;return{point:function(t,i){for(var n=-1;++n<e;)A[n].point(t,i)},sphere:function(){for(var t=-1;++t<e;)A[t].sphere()},lineStart:function(){for(var t=-1;++t<e;)A[t].lineStart()},lineEnd:function(){for(var t=-1;++t<e;)A[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<e;)A[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<e;)A[t].polygonEnd()}}}function $at(){var A,e,t=D_A(),i,n=qz().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,g=qz().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,s,I={point:function(l,c){s=[l,c]}};function r(l){var c=l[0],B=l[1];return s=null,i.point(c,B),s||(o.point(c,B),s)||(a.point(c,B),s)}r.invert=function(l){var c=t.scale(),B=t.translate(),E=(l[0]-B[0])/c,u=(l[1]-B[1])/c;return(u>=.12&&u<.234&&E>=-.425&&E<-.214?n:u>=.166&&u<.234&&E>=-.214&&E<-.115?g:t).invert(l)},r.stream=function(l){return A&&e===l?A:A=Pat([t.stream(e=l),n.stream(l),g.stream(l)])},r.precision=function(l){return arguments.length?(t.precision(l),n.precision(l),g.precision(l),C()):t.precision()},r.scale=function(l){return arguments.length?(t.scale(l),n.scale(l*.35),g.scale(l),r.translate(t.translate())):t.scale()},r.translate=function(l){if(!arguments.length)return t.translate();var c=t.scale(),B=+l[0],E=+l[1];return i=t.translate(l).clipExtent([[B-.455*c,E-.238*c],[B+.455*c,E+.238*c]]).stream(I),o=n.translate([B-.307*c,E+.201*c]).clipExtent([[B-.425*c+xe,E+.12*c+xe],[B-.214*c-xe,E+.234*c-xe]]).stream(I),a=g.translate([B-.205*c,E+.212*c]).clipExtent([[B-.214*c+xe,E+.166*c+xe],[B-.115*c-xe,E+.234*c-xe]]).stream(I),C()},r.fitExtent=function(l,c){return Oz(r,l,c)},r.fitSize=function(l,c){return nCA(r,l,c)},r.fitWidth=function(l,c){return oCA(r,l,c)},r.fitHeight=function(l,c){return gCA(r,l,c)};function C(){return A=e=null,r}return r.scale(1070)}function G_A(A){return function(e,t){var i=Fe(e),n=Fe(t),o=A(i*n);return o===1/0?[2,0]:[o*n*Ye(e),o*Ye(t)]}}function Mv(A){return function(e,t){var i=Cs(e*e+t*t),n=A(i),o=Ye(n),g=Fe(n);return[rl(e*o,i*g),Cr(i&&t*o/i)]}}var k_A=G_A(function(A){return Cs(2/(1+A))});k_A.invert=Mv(function(A){return 2*Cr(A/2)});function Ast(){return NQ(k_A).scale(124.75).clipAngle(179.999)}var J_A=G_A(function(A){return(A=yTA(A))&&A/Ye(A)});J_A.invert=Mv(function(A){return A});function est(){return NQ(J_A).scale(79.4188).clipAngle(179.999)}function jz(A,e){return[A,yz(RIA((Io+e)/2))]}jz.invert=function(A,e){return[A,2*UJ(fTA(e))-Io]};function tst(){return N_A(jz).scale(961/Is)}function N_A(A){var e=NQ(A),t=e.center,i=e.scale,n=e.translate,o=e.clipExtent,g=null,a,s,I;e.scale=function(C){return arguments.length?(i(C),r()):i()},e.translate=function(C){return arguments.length?(n(C),r()):n()},e.center=function(C){return arguments.length?(t(C),r()):t()},e.clipExtent=function(C){return arguments.length?(C==null?g=a=s=I=null:(g=+C[0][0],a=+C[0][1],s=+C[1][0],I=+C[1][1]),r()):g==null?null:[[g,a],[s,I]]};function r(){var C=wt*i(),l=e(pat(e.rotate()).invert([0,0]));return o(g==null?[[l[0]-C,l[1]-C],[l[0]+C,l[1]+C]]:A===jz?[[Math.max(l[0]-C,g),a],[Math.min(l[0]+C,s),I]]:[[g,Math.max(l[1]-C,a)],[s,Math.min(l[1]+C,I)]])}return r()}function Pz(A){return RIA((Io+A)/2)}function ist(A,e){var t=Fe(A),i=A===e?Ye(A):yz(t/Fe(e))/yz(Pz(e)/Pz(A)),n=t*YIA(Pz(A),i)/i;if(!i)return jz;function o(g,a){n>0?a<-Io+xe&&(a=-Io+xe):a>Io-xe&&(a=Io-xe);var s=n/YIA(Pz(a),i);return[s*Ye(i*g),n-s*Fe(i*g)]}return o.invert=function(g,a){var s=n-a,I=Il(i)*Cs(g*g+s*s),r=rl(g,Vt(s))*Il(s);return s*i<0&&(r-=wt*Il(g)*Il(s)),[r/i,2*UJ(YIA(n/I,1/i))-Io]},o}function nst(){return aCA(ist).scale(109.5).parallels([30,30])}function $z(A,e){return[A,e]}$z.invert=$z;function ost(){return NQ($z).scale(152.63)}function gst(A,e){var t=Fe(A),i=A===e?Ye(A):(t-Fe(e))/(e-A),n=t/i+A;if(Vt(i)<xe)return $z;function o(g,a){var s=n-a,I=i*g;return[s*Ye(I),n-s*Fe(I)]}return o.invert=function(g,a){var s=n-a,I=rl(g,Vt(s))*Il(s);return s*i<0&&(I-=wt*Il(g)*Il(s)),[I/i,n-Il(i)*Cs(g*g+s*s)]},o}function ast(){return aCA(gst).scale(131.154).center([0,13.9389])}var vv=1.340264,Lv=-.081106,Sv=893e-6,Hv=.003796,AT=Cs(3)/2,sst=12;function Y_A(A,e){var t=Cr(AT*Ye(e)),i=t*t,n=i*i*i;return[A*Fe(t)/(AT*(vv+3*Lv*i+n*(7*Sv+9*Hv*i))),t*(vv+Lv*i+n*(Sv+Hv*i))]}Y_A.invert=function(A,e){for(var t=e,i=t*t,n=i*i*i,o=0,g,a,s;o<sst&&(a=t*(vv+Lv*i+n*(Sv+Hv*i))-e,s=vv+3*Lv*i+n*(7*Sv+9*Hv*i),t-=g=a/s,i=t*t,n=i*i*i,!(Vt(g)<mz));++o);return[AT*A*(vv+3*Lv*i+n*(7*Sv+9*Hv*i))/Fe(t),Cr(Ye(t)/AT)]};function rst(){return NQ(Y_A).scale(177.158)}function R_A(A,e){var t=Fe(e),i=Fe(A)*t;return[t*Ye(A)/i,Ye(e)/i]}R_A.invert=Mv(UJ);function Ist(){return NQ(R_A).scale(144.049).clipAngle(60)}function Cst(){var A=1,e=0,t=0,i=1,n=1,o=0,g,a,s=null,I,r,C,l=1,c=1,B=_z({point:function(y,G){var R=w([y,G]);this.stream.point(R[0],R[1])}}),E=Jv,u,d;function f(){return l=A*i,c=A*n,u=d=null,w}function w(y){var G=y[0]*l,R=y[1]*c;if(o){var x=R*g-G*a;G=G*g+R*a,R=x}return[G+e,R+t]}return w.invert=function(y){var G=y[0]-e,R=y[1]-t;if(o){var x=R*g+G*a;G=G*g-R*a,R=x}return[G/l,R/c]},w.stream=function(y){return u&&d===y?u:u=B(E(d=y))},w.postclip=function(y){return arguments.length?(E=y,s=I=r=C=null,f()):E},w.clipExtent=function(y){return arguments.length?(E=y==null?(s=I=r=C=null,Jv):PTA(s=+y[0][0],I=+y[0][1],r=+y[1][0],C=+y[1][1]),f()):s==null?null:[[s,I],[r,C]]},w.scale=function(y){return arguments.length?(A=+y,f()):A},w.translate=function(y){return arguments.length?(e=+y[0],t=+y[1],f()):[e,t]},w.angle=function(y){return arguments.length?(o=y%360*ft,a=Ye(o),g=Fe(o),f()):o*wo},w.reflectX=function(y){return arguments.length?(i=y?-1:1,f()):i<0},w.reflectY=function(y){return arguments.length?(n=y?-1:1,f()):n<0},w.fitExtent=function(y,G){return Oz(w,y,G)},w.fitSize=function(y,G){return nCA(w,y,G)},w.fitWidth=function(y,G){return oCA(w,y,G)},w.fitHeight=function(y,G){return gCA(w,y,G)},w}function x_A(A,e){var t=e*e,i=t*t;return[A*(.8707-.131979*t+i*(-.013791+i*(.003971*t-.001529*i))),e*(1.007226+t*(.015085+i*(-.044475+.028874*t-.005916*i)))]}x_A.invert=function(A,e){var t=e,i=25,n;do{var o=t*t,g=o*o;t-=n=(t*(1.007226+o*(.015085+g*(-.044475+.028874*o-.005916*g)))-e)/(1.007226+o*(.045255+g*(-.311325+.259866*o-.06507600000000001*g)))}while(Vt(n)>xe&&--i>0);return[A/(.8707+(o=t*t)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),t]};function lst(){return NQ(x_A).scale(175.295)}function F_A(A,e){return[Fe(e)*Ye(A),Ye(e)]}F_A.invert=Mv(Cr);function cst(){return NQ(F_A).scale(249.5).clipAngle(90+xe)}function M_A(A,e){var t=Fe(e),i=1+Fe(A)*t;return[t*Ye(A)/i,Ye(e)/i]}M_A.invert=Mv(function(A){return 2*UJ(A)});function Bst(){return NQ(M_A).scale(250).clipAngle(142)}function v_A(A,e){return[yz(RIA((Io+e)/2)),-A]}v_A.invert=function(A,e){return[-e,2*UJ(fTA(A))-Io]};function Qst(){var A=N_A(v_A),e=A.center,t=A.rotate;return A.center=function(i){return arguments.length?e([-i[1],i[0]]):(i=e(),[i[1],-i[0]])},A.rotate=function(i){return arguments.length?t([i[0],i[1],i.length>2?i[2]+90:90]):(i=t(),[i[0],i[1],i[2]-90])},t([0,0,90]).scale(159.155)}var Est=Math.abs,sCA=Math.cos,eT=Math.sin,ust=1e-6,L_A=Math.PI,rCA=L_A/2,S_A=dst(2);function H_A(A){return A>1?rCA:A<-1?-rCA:Math.asin(A)}function dst(A){return A>0?Math.sqrt(A):0}function hst(A,e){var t=A*eT(e),i=30,n;do e-=n=(e+eT(e)-t)/(1+sCA(e));while(Est(n)>ust&&--i>0);return e/2}function mst(A,e,t){function i(n,o){return[A*n*sCA(o=hst(t,o)),e*eT(o)]}return i.invert=function(n,o){return o=H_A(o/e),[n/(A*sCA(o)),H_A((2*o+eT(2*o))/t)]},i}var pst=mst(S_A/rCA,S_A,L_A);function fst(){return NQ(pst).scale(169.529)}const yst=p_A(),ICA=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function bst(A,e){return function t(){const i=e();return i.type=A,i.path=p_A().projection(i),i.copy=i.copy||function(){const n=t();return ICA.forEach(o=>{i[o]&&n[o](i[o]())}),n.path.pointRadius(i.path.pointRadius()),n},X9A(i)}}function CCA(A,e){if(!A||typeof A!="string")throw new Error("Projection type must be a name string.");return A=A.toLowerCase(),arguments.length>1?(tT[A]=bst(A,e),this):tT[A]||null}function Z_A(A){return A&&A.path||yst}const tT={albers:D_A,albersusa:$at,azimuthalequalarea:Ast,azimuthalequidistant:est,conicconformal:nst,conicequalarea:qz,conicequidistant:ast,equalEarth:rst,equirectangular:ost,gnomonic:Ist,identity:Cst,mercator:tst,mollweide:fst,naturalEarth1:lst,orthographic:cst,stereographic:Bst,transversemercator:Qst};for(const A in tT)CCA(A,tT[A]);function wst(){}const ld=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function W_A(){var A=1,e=1,t=a;function i(s,I){return I.map(r=>n(s,r))}function n(s,I){var r=[],C=[];return o(s,I,l=>{t(l,s,I),Dst(l)>0?r.push([l]):C.push(l)}),C.forEach(l=>{for(var c=0,B=r.length,E;c<B;++c)if(Gst((E=r[c])[0],l)!==-1){E.push(l);return}}),{type:"MultiPolygon",value:I,coordinates:r}}function o(s,I,r){var C=new Array,l=new Array,c,B,E,u,d,f;for(c=B=-1,u=s[0]>=I,ld[u<<1].forEach(w);++c<A-1;)E=u,u=s[c+1]>=I,ld[E|u<<1].forEach(w);for(ld[u<<0].forEach(w);++B<e-1;){for(c=-1,u=s[B*A+A]>=I,d=s[B*A]>=I,ld[u<<1|d<<2].forEach(w);++c<A-1;)E=u,u=s[B*A+A+c+1]>=I,f=d,d=s[B*A+c+1]>=I,ld[E|u<<1|d<<2|f<<3].forEach(w);ld[u|d<<3].forEach(w)}for(c=-1,d=s[B*A]>=I,ld[d<<2].forEach(w);++c<A-1;)f=d,d=s[B*A+c+1]>=I,ld[d<<2|f<<3].forEach(w);ld[d<<3].forEach(w);function w(y){var G=[y[0][0]+c,y[0][1]+B],R=[y[1][0]+c,y[1][1]+B],x=g(G),F=g(R),Q,k;(Q=l[x])?(k=C[F])?(delete l[Q.end],delete C[k.start],Q===k?(Q.ring.push(R),r(Q.ring)):C[Q.start]=l[k.end]={start:Q.start,end:k.end,ring:Q.ring.concat(k.ring)}):(delete l[Q.end],Q.ring.push(R),l[Q.end=F]=Q):(Q=C[F])?(k=l[x])?(delete C[Q.start],delete l[k.end],Q===k?(Q.ring.push(R),r(Q.ring)):C[k.start]=l[Q.end]={start:k.start,end:Q.end,ring:k.ring.concat(Q.ring)}):(delete C[Q.start],Q.ring.unshift(G),C[Q.start=x]=Q):C[x]=l[F]={start:x,end:F,ring:[G,R]}}}function g(s){return s[0]*2+s[1]*(A+1)*4}function a(s,I,r){s.forEach(C=>{var l=C[0],c=C[1],B=l|0,E=c|0,u,d=I[E*A+B];l>0&&l<A&&B===l&&(u=I[E*A+B-1],C[0]=l+(r-u)/(d-u)-.5),c>0&&c<e&&E===c&&(u=I[(E-1)*A+B],C[1]=c+(r-u)/(d-u)-.5)})}return i.contour=n,i.size=function(s){if(!arguments.length)return[A,e];var I=Math.floor(s[0]),r=Math.floor(s[1]);return I>=0&&r>=0||YA("invalid size"),A=I,e=r,i},i.smooth=function(s){return arguments.length?(t=s?a:wst,i):t===a},i}function Dst(A){for(var e=0,t=A.length,i=A[t-1][1]*A[0][0]-A[t-1][0]*A[0][1];++e<t;)i+=A[e-1][1]*A[e][0]-A[e-1][0]*A[e][1];return i}function Gst(A,e){for(var t=-1,i=e.length,n;++t<i;)if(n=kst(A,e[t]))return n;return 0}function kst(A,e){for(var t=e[0],i=e[1],n=-1,o=0,g=A.length,a=g-1;o<g;a=o++){var s=A[o],I=s[0],r=s[1],C=A[a],l=C[0],c=C[1];if(Jst(s,C,e))return 0;r>i!=c>i&&t<(l-I)*(i-r)/(c-r)+I&&(n=-n)}return n}function Jst(A,e,t){var i;return Nst(A,e,t)&&Yst(A[i=+(A[0]===e[0])],t[i],e[i])}function Nst(A,e,t){return(e[0]-A[0])*(t[1]-A[1])===(t[0]-A[0])*(e[1]-A[1])}function Yst(A,e,t){return A<=e&&e<=t||t<=e&&e<=A}function K_A(A,e,t){return function(i){var n=mQ(i),o=t?Math.min(n[0],0):n[0],g=n[1],a=g-o,s=e?jm(o,g,A):a/(A+1);return Ga(o+s,g,s)}}function lCA(A){DA.call(this,null,A)}lCA.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},_A(lCA,DA,{transform(A,e){if(this.value&&!e.changed()&&!A.modified())return e.StopPropagation;var t=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=e.materialize(e.SOURCE).source,n=A.field||Ja,o=W_A().smooth(A.smooth!==!1),g=A.thresholds||Rst(i,n,A),a=A.as===null?null:A.as||"contour",s=[];return i.forEach(I=>{const r=n(I),C=o.size([r.width,r.height])(r.values,RA(g)?g:g(r.values));xst(C,r,I,A),C.forEach(l=>{s.push(a5(I,Ei(a!=null?{[a]:l}:l)))})}),this.value&&(t.rem=this.value),this.value=t.source=t.add=s,t}});function Rst(A,e,t){const i=K_A(t.levels||10,t.nice,t.zero!==!1);return t.resolve!=="shared"?i:i(A.map(n=>Pg(e(n).values)))}function xst(A,e,t,i){let n=i.scale||e.scale,o=i.translate||e.translate;if(Ct(n)&&(n=n(t,i)),Ct(o)&&(o=o(t,i)),(n===1||n==null)&&!o)return;const g=(ti(n)?n:n[0])||1,a=(ti(n)?n:n[1])||1,s=o&&o[0]||0,I=o&&o[1]||0;A.forEach(U_A(e,g,a,s,I))}function U_A(A,e,t,i,n){const o=A.x1||0,g=A.y1||0,a=e*t<0;function s(C){C.forEach(I)}function I(C){a&&C.reverse(),C.forEach(r)}function r(C){C[0]=(C[0]-o)*e+i,C[1]=(C[1]-g)*t+n}return function(C){return C.coordinates.forEach(s),C}}function V_A(A,e,t){const i=A>=0?A:IsA(e,t);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function cCA(A){return Ct(A)?A:Ya(+A)}function X_A(){var A=s=>s[0],e=s=>s[1],t=BJ,i=[-1,-1],n=960,o=500,g=2;function a(s,I){const r=V_A(i[0],s,A)>>g,C=V_A(i[1],s,e)>>g,l=r?r+2:0,c=C?C+2:0,B=2*l+(n>>g),E=2*c+(o>>g),u=new Float32Array(B*E),d=new Float32Array(B*E);let f=u;s.forEach(y=>{const G=l+(+A(y)>>g),R=c+(+e(y)>>g);G>=0&&G<B&&R>=0&&R<E&&(u[G+R*B]+=+t(y))}),r>0&&C>0?(_J(B,E,u,d,r),OJ(B,E,d,u,C),_J(B,E,u,d,r),OJ(B,E,d,u,C),_J(B,E,u,d,r),OJ(B,E,d,u,C)):r>0?(_J(B,E,u,d,r),_J(B,E,d,u,r),_J(B,E,u,d,r),f=d):C>0&&(OJ(B,E,u,d,C),OJ(B,E,d,u,C),OJ(B,E,u,d,C),f=d);const w=I?Math.pow(2,-2*g):1/QQ(f);for(let y=0,G=B*E;y<G;++y)f[y]*=w;return{values:f,scale:1<<g,width:B,height:E,x1:l,y1:c,x2:l+(n>>g),y2:c+(o>>g)}}return a.x=function(s){return arguments.length?(A=cCA(s),a):A},a.y=function(s){return arguments.length?(e=cCA(s),a):e},a.weight=function(s){return arguments.length?(t=cCA(s),a):t},a.size=function(s){if(!arguments.length)return[n,o];var I=+s[0],r=+s[1];return I>=0&&r>=0||YA("invalid size"),n=I,o=r,a},a.cellSize=function(s){return arguments.length?((s=+s)>=1||YA("invalid cell size"),g=Math.floor(Math.log(s)/Math.LN2),a):1<<g},a.bandwidth=function(s){return arguments.length?(s=te(s),s.length===1&&(s=[+s[0],+s[0]]),s.length!==2&&YA("invalid bandwidth"),i=s,a):i},a}function _J(A,e,t,i,n){const o=(n<<1)+1;for(let g=0;g<e;++g)for(let a=0,s=0;a<A+n;++a)a<A&&(s+=t[a+g*A]),a>=n&&(a>=o&&(s-=t[a-o+g*A]),i[a-n+g*A]=s/Math.min(a+1,A-1+o-a,o))}function OJ(A,e,t,i,n){const o=(n<<1)+1;for(let g=0;g<A;++g)for(let a=0,s=0;a<e+n;++a)a<e&&(s+=t[g+a*A]),a>=n&&(a>=o&&(s-=t[g+(a-o)*A]),i[g+(a-n)*A]=s/Math.min(a+1,e-1+o-a,o))}function BCA(A){DA.call(this,null,A)}BCA.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const Fst=["x","y","weight","size","cellSize","bandwidth"];function z_A(A,e){return Fst.forEach(t=>e[t]!=null?A[t](e[t]):0),A}_A(BCA,DA,{transform(A,e){if(this.value&&!e.changed()&&!A.modified())return e.StopPropagation;var t=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=e.materialize(e.SOURCE).source,n=Mst(i,A.groupby),o=(A.groupby||[]).map(ro),g=z_A(X_A(),A),a=A.as||"grid",s=[];function I(r,C){for(let l=0;l<o.length;++l)r[o[l]]=C[l];return r}return s=n.map(r=>Ei(I({[a]:g(r,A.counts)},r.dims))),this.value&&(t.rem=this.value),this.value=t.source=t.add=s,t}});function Mst(A,e){var t=[],i=r=>r(a),n,o,g,a,s,I;if(e==null)t.push(A);else for(n={},o=0,g=A.length;o<g;++o)a=A[o],s=e.map(i),I=n[s],I||(n[s]=I=[],I.dims=s,t.push(I)),I.push(a);return t}function QCA(A){DA.call(this,null,A)}QCA.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},_A(QCA,DA,{transform(A,e){if(this.value&&!e.changed()&&!A.modified())return e.StopPropagation;var t=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=W_A().smooth(A.smooth!==!1),n=A.values,o=A.thresholds||K_A(A.count||10,A.nice,!!n),g=A.size,a,s;return n||(n=e.materialize(e.SOURCE).source,a=z_A(X_A(),A)(n,!0),s=U_A(a,a.scale||1,a.scale||1,0,0),g=[a.width,a.height],n=a.values),o=RA(o)?o:o(n),n=i.size(g)(n,o),s&&n.forEach(s),this.value&&(t.rem=this.value),this.value=t.source=t.add=(n||[]).map(Ei),t}});const ECA="Feature",uCA="FeatureCollection",vst="MultiPoint";function dCA(A){DA.call(this,null,A)}dCA.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},_A(dCA,DA,{transform(A,e){var t=this._features,i=this._points,n=A.fields,o=n&&n[0],g=n&&n[1],a=A.geojson||!n&&Ja,s=e.ADD,I;I=A.modified()||e.changed(e.REM)||e.modified(ka(a))||o&&e.modified(ka(o))||g&&e.modified(ka(g)),(!this.value||I)&&(s=e.SOURCE,this._features=t=[],this._points=i=[]),a&&e.visit(s,r=>t.push(a(r))),o&&g&&(e.visit(s,r=>{var C=o(r),l=g(r);C!=null&&l!=null&&(C=+C)===C&&(l=+l)===l&&i.push([C,l])}),t=t.concat({type:ECA,geometry:{type:vst,coordinates:i}})),this.value={type:uCA,features:t}}});function hCA(A){DA.call(this,null,A)}hCA.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},_A(hCA,DA,{transform(A,e){var t=e.fork(e.ALL),i=this.value,n=A.field||Ja,o=A.as||"path",g=t.SOURCE;!i||A.modified()?(this.value=i=Z_A(A.projection),t.materialize().reflow()):g=n===Ja||e.modified(n.fields)?t.ADD_MOD:t.ADD;const a=Lst(i,A.pointRadius);return t.visit(g,s=>s[o]=i(n(s))),i.pointRadius(a),t.modifies(o)}});function Lst(A,e){const t=A.pointRadius();return A.context(null),e!=null&&A.pointRadius(e),t}function mCA(A){DA.call(this,null,A)}mCA.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},_A(mCA,DA,{transform(A,e){var t=A.projection,i=A.fields[0],n=A.fields[1],o=A.as||["x","y"],g=o[0],a=o[1],s;function I(r){const C=t([i(r),n(r)]);C?(r[g]=C[0],r[a]=C[1]):(r[g]=void 0,r[a]=void 0)}return A.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,I):(s=e.modified(i.fields)||e.modified(n.fields),e.visit(s?e.ADD_MOD:e.ADD,I)),e.modifies(o)}});function pCA(A){DA.call(this,null,A)}pCA.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},_A(pCA,DA,{transform(A,e){var t=e.fork(e.ALL),i=this.value,n=A.as||"shape",o=t.ADD;return(!i||A.modified())&&(this.value=i=Sst(Z_A(A.projection),A.field||Al("datum"),A.pointRadius),t.materialize().reflow(),o=t.SOURCE),t.visit(o,g=>g[n]=i),t.modifies(n)}});function Sst(A,e,t){const i=t==null?n=>A(e(n)):n=>{var o=A.pointRadius(),g=A.pointRadius(t)(e(n));return A.pointRadius(o),g};return i.context=n=>(A.context(n),i),i}function fCA(A){DA.call(this,[],A),this.generator=Yat()}fCA.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},_A(fCA,DA,{transform(A,e){var t=this.value,i=this.generator,n;if(!t.length||A.modified())for(const o in A)Ct(i[o])&&i[o](A[o]);return n=i(),t.length?e.mod.push(SVA(t[0],n)):e.add.push(Ei(n)),t[0]=n,e}});function yCA(A){DA.call(this,null,A)}yCA.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},_A(yCA,DA,{transform(A,e){if(!e.changed()&&!A.modified())return e.StopPropagation;var t=e.materialize(e.SOURCE).source,i=A.resolve==="shared",n=A.field||Ja,o=Zst(A.opacity,A),g=Hst(A.color,A),a=A.as||"image",s={$x:0,$y:0,$value:0,$max:i?Pg(t.map(I=>Pg(n(I).values))):0};return t.forEach(I=>{const r=n(I),C=lt({},I,s);i||(C.$max=Pg(r.values||[])),I[a]=Wst(r,C,g.dep?g:Ya(g(C)),o.dep?o:Ya(o(C)))}),e.reflow(!0).modifies(a)}});function Hst(A,e){let t;return Ct(A)?(t=i=>OC(A(i,e)),t.dep=T_A(A)):t=Ya(OC(A||"#888")),t}function Zst(A,e){let t;return Ct(A)?(t=i=>A(i,e),t.dep=T_A(A)):A?t=Ya(A):(t=i=>i.$value/i.$max||0,t.dep=!0),t}function T_A(A){if(!Ct(A))return!1;const e=fc(ka(A));return e.$x||e.$y||e.$value||e.$max}function Wst(A,e,t,i){const n=A.width,o=A.height,g=A.x1||0,a=A.y1||0,s=A.x2||n,I=A.y2||o,r=A.values,C=r?u=>r[u]:gp,l=up(s-g,I-a),c=l.getContext("2d"),B=c.getImageData(0,0,s-g,I-a),E=B.data;for(let u=a,d=0;u<I;++u){e.$y=u-a;for(let f=g,w=u*n;f<s;++f,d+=4){e.$x=f-g,e.$value=C(f+w);const y=t(e);E[d+0]=y.r,E[d+1]=y.g,E[d+2]=y.b,E[d+3]=~~(255*i(e))}}return c.putImageData(B,0,0),l}function __A(A){DA.call(this,null,A),this.modified(!0)}_A(__A,DA,{transform(A,e){let t=this.value;return!t||A.modified("type")?(this.value=t=Ust(A.type),ICA.forEach(i=>{A[i]!=null&&O_A(t,i,A[i])})):ICA.forEach(i=>{A.modified(i)&&O_A(t,i,A[i])}),A.pointRadius!=null&&t.path.pointRadius(A.pointRadius),A.fit&&Kst(t,A),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function Kst(A,e){const t=Vst(e.fit);e.extent?A.fitExtent(e.extent,t):e.size&&A.fitSize(e.size,t)}function Ust(A){const e=CCA((A||"mercator").toLowerCase());return e||YA("Unrecognized projection type: "+A),e()}function O_A(A,e,t){Ct(A[e])&&A[e](t)}function Vst(A){return A=te(A),A.length===1?A[0]:{type:uCA,features:A.reduce((e,t)=>e.concat(Xst(t)),[])}}function Xst(A){return A.type===uCA?A.features:te(A).filter(e=>e!=null).map(e=>e.type===ECA?e:{type:ECA,geometry:e})}const zst=Object.freeze(Object.defineProperty({__proto__:null,contour:QCA,geojson:dCA,geopath:hCA,geopoint:mCA,geoshape:pCA,graticule:fCA,heatmap:yCA,isocontour:lCA,kde2d:BCA,projection:__A},Symbol.toStringTag,{value:"Module"}));function Tst(A,e){var t,i=1;A==null&&(A=0),e==null&&(e=0);function n(){var o,g=t.length,a,s=0,I=0;for(o=0;o<g;++o)a=t[o],s+=a.x,I+=a.y;for(s=(s/g-A)*i,I=(I/g-e)*i,o=0;o<g;++o)a=t[o],a.x-=s,a.y-=I}return n.initialize=function(o){t=o},n.x=function(o){return arguments.length?(A=+o,n):A},n.y=function(o){return arguments.length?(e=+o,n):e},n.strength=function(o){return arguments.length?(i=+o,n):i},n}function _st(A){const e=+this._x.call(null,A),t=+this._y.call(null,A);return q_A(this.cover(e,t),e,t,A)}function q_A(A,e,t,i){if(isNaN(e)||isNaN(t))return A;var n,o=A._root,g={data:i},a=A._x0,s=A._y0,I=A._x1,r=A._y1,C,l,c,B,E,u,d,f;if(!o)return A._root=g,A;for(;o.length;)if((E=e>=(C=(a+I)/2))?a=C:I=C,(u=t>=(l=(s+r)/2))?s=l:r=l,n=o,!(o=o[d=u<<1|E]))return n[d]=g,A;if(c=+A._x.call(null,o.data),B=+A._y.call(null,o.data),e===c&&t===B)return g.next=o,n?n[d]=g:A._root=g,A;do n=n?n[d]=new Array(4):A._root=new Array(4),(E=e>=(C=(a+I)/2))?a=C:I=C,(u=t>=(l=(s+r)/2))?s=l:r=l;while((d=u<<1|E)===(f=(B>=l)<<1|c>=C));return n[f]=o,n[d]=g,A}function Ost(A){var e,t,i=A.length,n,o,g=new Array(i),a=new Array(i),s=1/0,I=1/0,r=-1/0,C=-1/0;for(t=0;t<i;++t)isNaN(n=+this._x.call(null,e=A[t]))||isNaN(o=+this._y.call(null,e))||(g[t]=n,a[t]=o,n<s&&(s=n),n>r&&(r=n),o<I&&(I=o),o>C&&(C=o));if(s>r||I>C)return this;for(this.cover(s,I).cover(r,C),t=0;t<i;++t)q_A(this,g[t],a[t],A[t]);return this}function qst(A,e){if(isNaN(A=+A)||isNaN(e=+e))return this;var t=this._x0,i=this._y0,n=this._x1,o=this._y1;if(isNaN(t))n=(t=Math.floor(A))+1,o=(i=Math.floor(e))+1;else{for(var g=n-t||1,a=this._root,s,I;t>A||A>=n||i>e||e>=o;)switch(I=(e<i)<<1|A<t,s=new Array(4),s[I]=a,a=s,g*=2,I){case 0:n=t+g,o=i+g;break;case 1:t=n-g,o=i+g;break;case 2:n=t+g,i=o-g;break;case 3:t=n-g,i=o-g;break}this._root&&this._root.length&&(this._root=a)}return this._x0=t,this._y0=i,this._x1=n,this._y1=o,this}function jst(){var A=[];return this.visit(function(e){if(!e.length)do A.push(e.data);while(e=e.next)}),A}function Pst(A){return arguments.length?this.cover(+A[0][0],+A[0][1]).cover(+A[1][0],+A[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Qs(A,e,t,i,n){this.node=A,this.x0=e,this.y0=t,this.x1=i,this.y1=n}function $st(A,e,t){var i,n=this._x0,o=this._y0,g,a,s,I,r=this._x1,C=this._y1,l=[],c=this._root,B,E;for(c&&l.push(new Qs(c,n,o,r,C)),t==null?t=1/0:(n=A-t,o=e-t,r=A+t,C=e+t,t*=t);B=l.pop();)if(!(!(c=B.node)||(g=B.x0)>r||(a=B.y0)>C||(s=B.x1)<n||(I=B.y1)<o))if(c.length){var u=(g+s)/2,d=(a+I)/2;l.push(new Qs(c[3],u,d,s,I),new Qs(c[2],g,d,u,I),new Qs(c[1],u,a,s,d),new Qs(c[0],g,a,u,d)),(E=(e>=d)<<1|A>=u)&&(B=l[l.length-1],l[l.length-1]=l[l.length-1-E],l[l.length-1-E]=B)}else{var f=A-+this._x.call(null,c.data),w=e-+this._y.call(null,c.data),y=f*f+w*w;if(y<t){var G=Math.sqrt(t=y);n=A-G,o=e-G,r=A+G,C=e+G,i=c.data}}return i}function Art(A){if(isNaN(r=+this._x.call(null,A))||isNaN(C=+this._y.call(null,A)))return this;var e,t=this._root,i,n,o,g=this._x0,a=this._y0,s=this._x1,I=this._y1,r,C,l,c,B,E,u,d;if(!t)return this;if(t.length)for(;;){if((B=r>=(l=(g+s)/2))?g=l:s=l,(E=C>=(c=(a+I)/2))?a=c:I=c,e=t,!(t=t[u=E<<1|B]))return this;if(!t.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(i=e,d=u)}for(;t.data!==A;)if(n=t,!(t=t.next))return this;return(o=t.next)&&delete t.next,n?(o?n.next=o:delete n.next,this):e?(o?e[u]=o:delete e[u],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(i?i[d]=t:this._root=t),this):(this._root=o,this)}function ert(A){for(var e=0,t=A.length;e<t;++e)this.remove(A[e]);return this}function trt(){return this._root}function irt(){var A=0;return this.visit(function(e){if(!e.length)do++A;while(e=e.next)}),A}function nrt(A){var e=[],t,i=this._root,n,o,g,a,s;for(i&&e.push(new Qs(i,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!A(i=t.node,o=t.x0,g=t.y0,a=t.x1,s=t.y1)&&i.length){var I=(o+a)/2,r=(g+s)/2;(n=i[3])&&e.push(new Qs(n,I,r,a,s)),(n=i[2])&&e.push(new Qs(n,o,r,I,s)),(n=i[1])&&e.push(new Qs(n,I,g,a,r)),(n=i[0])&&e.push(new Qs(n,o,g,I,r))}return this}function ort(A){var e=[],t=[],i;for(this._root&&e.push(new Qs(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var n=i.node;if(n.length){var o,g=i.x0,a=i.y0,s=i.x1,I=i.y1,r=(g+s)/2,C=(a+I)/2;(o=n[0])&&e.push(new Qs(o,g,a,r,C)),(o=n[1])&&e.push(new Qs(o,r,a,s,C)),(o=n[2])&&e.push(new Qs(o,g,C,r,I)),(o=n[3])&&e.push(new Qs(o,r,C,s,I))}t.push(i)}for(;i=t.pop();)A(i.node,i.x0,i.y0,i.x1,i.y1);return this}function grt(A){return A[0]}function art(A){return arguments.length?(this._x=A,this):this._x}function srt(A){return A[1]}function rrt(A){return arguments.length?(this._y=A,this):this._y}function bCA(A,e,t){var i=new wCA(e??grt,t??srt,NaN,NaN,NaN,NaN);return A==null?i:i.addAll(A)}function wCA(A,e,t,i,n,o){this._x=A,this._y=e,this._x0=t,this._y0=i,this._x1=n,this._y1=o,this._root=void 0}function j_A(A){for(var e={data:A.data},t=e;A=A.next;)t=t.next={data:A.data};return e}var Es=bCA.prototype=wCA.prototype;Es.copy=function(){var A=new wCA(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,i;if(!e)return A;if(!e.length)return A._root=j_A(e),A;for(t=[{source:e,target:A._root=new Array(4)}];e=t.pop();)for(var n=0;n<4;++n)(i=e.source[n])&&(i.length?t.push({source:i,target:e.target[n]=new Array(4)}):e.target[n]=j_A(i));return A},Es.add=_st,Es.addAll=Ost,Es.cover=qst,Es.data=jst,Es.extent=Pst,Es.find=$st,Es.remove=Art,Es.removeAll=ert,Es.root=trt,Es.size=irt,Es.visit=nrt,Es.visitAfter=ort,Es.x=art,Es.y=rrt;function us(A){return function(){return A}}function xp(A){return(A()-.5)*1e-6}function Irt(A){return A.x+A.vx}function Crt(A){return A.y+A.vy}function lrt(A){var e,t,i,n=1,o=1;typeof A!="function"&&(A=us(A==null?1:+A));function g(){for(var I,r=e.length,C,l,c,B,E,u,d=0;d<o;++d)for(C=bCA(e,Irt,Crt).visitAfter(a),I=0;I<r;++I)l=e[I],E=t[l.index],u=E*E,c=l.x+l.vx,B=l.y+l.vy,C.visit(f);function f(w,y,G,R,x){var F=w.data,Q=w.r,k=E+Q;if(F){if(F.index>l.index){var h=c-F.x-F.vx,N=B-F.y-F.vy,v=h*h+N*N;v<k*k&&(h===0&&(h=xp(i),v+=h*h),N===0&&(N=xp(i),v+=N*N),v=(k-(v=Math.sqrt(v)))/v*n,l.vx+=(h*=v)*(k=(Q*=Q)/(u+Q)),l.vy+=(N*=v)*k,F.vx-=h*(k=1-k),F.vy-=N*k)}return}return y>c+k||R<c-k||G>B+k||x<B-k}}function a(I){if(I.data)return I.r=t[I.data.index];for(var r=I.r=0;r<4;++r)I[r]&&I[r].r>I.r&&(I.r=I[r].r)}function s(){if(e){var I,r=e.length,C;for(t=new Array(r),I=0;I<r;++I)C=e[I],t[C.index]=+A(C,I,e)}}return g.initialize=function(I,r){e=I,i=r,s()},g.iterations=function(I){return arguments.length?(o=+I,g):o},g.strength=function(I){return arguments.length?(n=+I,g):n},g.radius=function(I){return arguments.length?(A=typeof I=="function"?I:us(+I),s(),g):A},g}function crt(A){return A.index}function P_A(A,e){var t=A.get(e);if(!t)throw new Error("node not found: "+e);return t}function Brt(A){var e=crt,t=C,i,n=us(30),o,g,a,s,I,r=1;A==null&&(A=[]);function C(u){return 1/Math.min(a[u.source.index],a[u.target.index])}function l(u){for(var d=0,f=A.length;d<r;++d)for(var w=0,y,G,R,x,F,Q,k;w<f;++w)y=A[w],G=y.source,R=y.target,x=R.x+R.vx-G.x-G.vx||xp(I),F=R.y+R.vy-G.y-G.vy||xp(I),Q=Math.sqrt(x*x+F*F),Q=(Q-o[w])/Q*u*i[w],x*=Q,F*=Q,R.vx-=x*(k=s[w]),R.vy-=F*k,G.vx+=x*(k=1-k),G.vy+=F*k}function c(){if(g){var u,d=g.length,f=A.length,w=new Map(g.map((G,R)=>[e(G,R,g),G])),y;for(u=0,a=new Array(d);u<f;++u)y=A[u],y.index=u,typeof y.source!="object"&&(y.source=P_A(w,y.source)),typeof y.target!="object"&&(y.target=P_A(w,y.target)),a[y.source.index]=(a[y.source.index]||0)+1,a[y.target.index]=(a[y.target.index]||0)+1;for(u=0,s=new Array(f);u<f;++u)y=A[u],s[u]=a[y.source.index]/(a[y.source.index]+a[y.target.index]);i=new Array(f),B(),o=new Array(f),E()}}function B(){if(g)for(var u=0,d=A.length;u<d;++u)i[u]=+t(A[u],u,A)}function E(){if(g)for(var u=0,d=A.length;u<d;++u)o[u]=+n(A[u],u,A)}return l.initialize=function(u,d){g=u,I=d,c()},l.links=function(u){return arguments.length?(A=u,c(),l):A},l.id=function(u){return arguments.length?(e=u,l):e},l.iterations=function(u){return arguments.length?(r=+u,l):r},l.strength=function(u){return arguments.length?(t=typeof u=="function"?u:us(+u),B(),l):t},l.distance=function(u){return arguments.length?(n=typeof u=="function"?u:us(+u),E(),l):n},l}var Qrt={value:()=>{}};function DCA(){for(var A=0,e=arguments.length,t={},i;A<e;++A){if(!(i=arguments[A]+"")||i in t||/[\s.]/.test(i))throw new Error("illegal type: "+i);t[i]=[]}return new iT(t)}function iT(A){this._=A}function Ert(A,e){return A.trim().split(/^|\s+/).map(function(t){var i="",n=t.indexOf(".");if(n>=0&&(i=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:i}})}iT.prototype=DCA.prototype={constructor:iT,on:function(A,e){var t=this._,i=Ert(A+"",t),n,o=-1,g=i.length;if(arguments.length<2){for(;++o<g;)if((n=(A=i[o]).type)&&(n=urt(t[n],A.name)))return n;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<g;)if(n=(A=i[o]).type)t[n]=$_A(t[n],A.name,e);else if(e==null)for(n in t)t[n]=$_A(t[n],A.name,null);return this},copy:function(){var A={},e=this._;for(var t in e)A[t]=e[t].slice();return new iT(A)},call:function(A,e){if((n=arguments.length-2)>0)for(var t=new Array(n),i=0,n,o;i<n;++i)t[i]=arguments[i+2];if(!this._.hasOwnProperty(A))throw new Error("unknown type: "+A);for(o=this._[A],i=0,n=o.length;i<n;++i)o[i].value.apply(e,t)},apply:function(A,e,t){if(!this._.hasOwnProperty(A))throw new Error("unknown type: "+A);for(var i=this._[A],n=0,o=i.length;n<o;++n)i[n].value.apply(e,t)}};function urt(A,e){for(var t=0,i=A.length,n;t<i;++t)if((n=A[t]).name===e)return n.value}function $_A(A,e,t){for(var i=0,n=A.length;i<n;++i)if(A[i].name===e){A[i]=Qrt,A=A.slice(0,i).concat(A.slice(i+1));break}return t!=null&&A.push({name:e,value:t}),A}var qJ=0,Zv=0,Wv=0,A4A=1e3,nT,Kv,oT=0,yb=0,gT=0,Uv=typeof performance=="object"&&performance.now?performance:Date,e4A=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(A){setTimeout(A,17)};function aT(){return yb||(e4A(drt),yb=Uv.now()+gT)}function drt(){yb=0}function Vv(){this._call=this._time=this._next=null}Vv.prototype=GCA.prototype={constructor:Vv,restart:function(A,e,t){if(typeof A!="function")throw new TypeError("callback is not a function");t=(t==null?aT():+t)+(e==null?0:+e),!this._next&&Kv!==this&&(Kv?Kv._next=this:nT=this,Kv=this),this._call=A,this._time=t,kCA()},stop:function(){this._call&&(this._call=null,this._time=1/0,kCA())}};function GCA(A,e,t){var i=new Vv;return i.restart(A,e,t),i}function hrt(){aT(),++qJ;for(var A=nT,e;A;)(e=yb-A._time)>=0&&A._call.call(void 0,e),A=A._next;--qJ}function t4A(){yb=(oT=Uv.now())+gT,qJ=Zv=0;try{hrt()}finally{qJ=0,prt(),yb=0}}function mrt(){var A=Uv.now(),e=A-oT;e>A4A&&(gT-=e,oT=A)}function prt(){for(var A,e=nT,t,i=1/0;e;)e._call?(i>e._time&&(i=e._time),A=e,e=e._next):(t=e._next,e._next=null,e=A?A._next=t:nT=t);Kv=A,kCA(i)}function kCA(A){if(!qJ){Zv&&(Zv=clearTimeout(Zv));var e=A-yb;e>24?(A<1/0&&(Zv=setTimeout(t4A,A-Uv.now()-gT)),Wv&&(Wv=clearInterval(Wv))):(Wv||(oT=Uv.now(),Wv=setInterval(mrt,A4A)),qJ=1,e4A(t4A))}}function i4A(A,e,t){var i=new Vv;return e=e==null?0:+e,i.restart(n=>{i.stop(),A(n+e)},e,t),i}function frt(A,e,t){var i=new Vv,n=e;return e==null?(i.restart(A,e,t),i):(i._restart=i.restart,i.restart=function(o,g,a){g=+g,a=a==null?aT():+a,i._restart(function s(I){I+=n,i._restart(s,n+=g,a),o(I)},g,a)},i.restart(A,e,t),i)}const yrt=1664525,brt=1013904223,n4A=4294967296;function wrt(){let A=1;return()=>(A=(yrt*A+brt)%n4A)/n4A}function Drt(A){return A.x}function Grt(A){return A.y}var krt=10,Jrt=Math.PI*(3-Math.sqrt(5));function Nrt(A){var e,t=1,i=.001,n=1-Math.pow(i,1/300),o=0,g=.6,a=new Map,s=GCA(C),I=DCA("tick","end"),r=wrt();A==null&&(A=[]);function C(){l(),I.call("tick",e),t<i&&(s.stop(),I.call("end",e))}function l(E){var u,d=A.length,f;E===void 0&&(E=1);for(var w=0;w<E;++w)for(t+=(o-t)*n,a.forEach(function(y){y(t)}),u=0;u<d;++u)f=A[u],f.fx==null?f.x+=f.vx*=g:(f.x=f.fx,f.vx=0),f.fy==null?f.y+=f.vy*=g:(f.y=f.fy,f.vy=0);return e}function c(){for(var E=0,u=A.length,d;E<u;++E){if(d=A[E],d.index=E,d.fx!=null&&(d.x=d.fx),d.fy!=null&&(d.y=d.fy),isNaN(d.x)||isNaN(d.y)){var f=krt*Math.sqrt(.5+E),w=E*Jrt;d.x=f*Math.cos(w),d.y=f*Math.sin(w)}(isNaN(d.vx)||isNaN(d.vy))&&(d.vx=d.vy=0)}}function B(E){return E.initialize&&E.initialize(A,r),E}return c(),e={tick:l,restart:function(){return s.restart(C),e},stop:function(){return s.stop(),e},nodes:function(E){return arguments.length?(A=E,c(),a.forEach(B),e):A},alpha:function(E){return arguments.length?(t=+E,e):t},alphaMin:function(E){return arguments.length?(i=+E,e):i},alphaDecay:function(E){return arguments.length?(n=+E,e):+n},alphaTarget:function(E){return arguments.length?(o=+E,e):o},velocityDecay:function(E){return arguments.length?(g=1-E,e):1-g},randomSource:function(E){return arguments.length?(r=E,a.forEach(B),e):r},force:function(E,u){return arguments.length>1?(u==null?a.delete(E):a.set(E,B(u)),e):a.get(E)},find:function(E,u,d){var f=0,w=A.length,y,G,R,x,F;for(d==null?d=1/0:d*=d,f=0;f<w;++f)x=A[f],y=E-x.x,G=u-x.y,R=y*y+G*G,R<d&&(F=x,d=R);return F},on:function(E,u){return arguments.length>1?(I.on(E,u),e):I.on(E)}}}function Yrt(){var A,e,t,i,n=us(-30),o,g=1,a=1/0,s=.81;function I(c){var B,E=A.length,u=bCA(A,Drt,Grt).visitAfter(C);for(i=c,B=0;B<E;++B)e=A[B],u.visit(l)}function r(){if(A){var c,B=A.length,E;for(o=new Array(B),c=0;c<B;++c)E=A[c],o[E.index]=+n(E,c,A)}}function C(c){var B=0,E,u,d=0,f,w,y;if(c.length){for(f=w=y=0;y<4;++y)(E=c[y])&&(u=Math.abs(E.value))&&(B+=E.value,d+=u,f+=u*E.x,w+=u*E.y);c.x=f/d,c.y=w/d}else{E=c,E.x=E.data.x,E.y=E.data.y;do B+=o[E.data.index];while(E=E.next)}c.value=B}function l(c,B,E,u){if(!c.value)return!0;var d=c.x-e.x,f=c.y-e.y,w=u-B,y=d*d+f*f;if(w*w/s<y)return y<a&&(d===0&&(d=xp(t),y+=d*d),f===0&&(f=xp(t),y+=f*f),y<g&&(y=Math.sqrt(g*y)),e.vx+=d*c.value*i/y,e.vy+=f*c.value*i/y),!0;if(!(c.length||y>=a)){(c.data!==e||c.next)&&(d===0&&(d=xp(t),y+=d*d),f===0&&(f=xp(t),y+=f*f),y<g&&(y=Math.sqrt(g*y)));do c.data!==e&&(w=o[c.data.index]*i/y,e.vx+=d*w,e.vy+=f*w);while(c=c.next)}}return I.initialize=function(c,B){A=c,t=B,r()},I.strength=function(c){return arguments.length?(n=typeof c=="function"?c:us(+c),r(),I):n},I.distanceMin=function(c){return arguments.length?(g=c*c,I):Math.sqrt(g)},I.distanceMax=function(c){return arguments.length?(a=c*c,I):Math.sqrt(a)},I.theta=function(c){return arguments.length?(s=c*c,I):Math.sqrt(s)},I}function Rrt(A){var e=us(.1),t,i,n;typeof A!="function"&&(A=us(A==null?0:+A));function o(a){for(var s=0,I=t.length,r;s<I;++s)r=t[s],r.vx+=(n[s]-r.x)*i[s]*a}function g(){if(t){var a,s=t.length;for(i=new Array(s),n=new Array(s),a=0;a<s;++a)i[a]=isNaN(n[a]=+A(t[a],a,t))?0:+e(t[a],a,t)}}return o.initialize=function(a){t=a,g()},o.strength=function(a){return arguments.length?(e=typeof a=="function"?a:us(+a),g(),o):e},o.x=function(a){return arguments.length?(A=typeof a=="function"?a:us(+a),g(),o):A},o}function xrt(A){var e=us(.1),t,i,n;typeof A!="function"&&(A=us(A==null?0:+A));function o(a){for(var s=0,I=t.length,r;s<I;++s)r=t[s],r.vy+=(n[s]-r.y)*i[s]*a}function g(){if(t){var a,s=t.length;for(i=new Array(s),n=new Array(s),a=0;a<s;++a)i[a]=isNaN(n[a]=+A(t[a],a,t))?0:+e(t[a],a,t)}}return o.initialize=function(a){t=a,g()},o.strength=function(a){return arguments.length?(e=typeof a=="function"?a:us(+a),g(),o):e},o.y=function(a){return arguments.length?(A=typeof a=="function"?a:us(+a),g(),o):A},o}const o4A={center:Tst,collide:lrt,nbody:Yrt,link:Brt,x:Rrt,y:xrt},Xv="forces",JCA=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],Frt=["static","iterations"],g4A=["x","y","vx","vy"];function NCA(A){DA.call(this,null,A)}NCA.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:g4A}]},_A(NCA,DA,{transform(A,e){var t=this.value,i=e.changed(e.ADD_REM),n=A.modified(JCA),o=A.iterations||300;if(t?(i&&(e.modifies("index"),t.nodes(e.source)),(n||e.changed(e.MOD))&&a4A(t,A,0,e)):(this.value=t=vrt(e.source,A),t.on("tick",Mrt(e.dataflow,this)),A.static||(i=!0,t.tick()),e.modifies("index")),n||i||A.modified(Frt)||e.changed()&&A.restart){if(t.alpha(Math.max(t.alpha(),A.alpha||1)).alphaDecay(1-Math.pow(t.alphaMin(),1/o)),A.static)for(t.stop();--o>=0;)t.tick();else if(t.stopped()&&t.restart(),!i)return e.StopPropagation}return this.finish(A,e)},finish(A,e){const t=e.dataflow;for(let a=this._argops,s=0,I=a.length,r;s<I;++s)if(r=a[s],!(r.name!==Xv||r.op._argval.force!=="link")){for(var i=r.op._argops,n=0,o=i.length,g;n<o;++n)if(i[n].name==="links"&&(g=i[n].op.source)){t.pulse(g,t.changeset().reflow());break}}return e.reflow(A.modified()).modifies(g4A)}});function Mrt(A,e){return()=>A.touch(e).run()}function vrt(A,e){const t=Nrt(A),i=t.stop,n=t.restart;let o=!1;return t.stopped=()=>o,t.restart=()=>(o=!1,n()),t.stop=()=>(o=!0,i()),a4A(t,e,!0).on("end",()=>o=!0)}function a4A(A,e,t,i){var n=te(e.forces),o,g,a,s;for(o=0,g=JCA.length;o<g;++o)a=JCA[o],a!==Xv&&e.modified(a)&&A[a](e[a]);for(o=0,g=n.length;o<g;++o)s=Xv+o,a=t||e.modified(Xv,o)?Srt(n[o]):i&&Lrt(n[o],i)?A.force(s):null,a&&A.force(s,a);for(g=A.numForces||0;o<g;++o)A.force(Xv+o,null);return A.numForces=n.length,A}function Lrt(A,e){var t,i;for(t in A)if(Ct(i=A[t])&&e.modified(ka(i)))return 1;return 0}function Srt(A){var e,t;Je(o4A,A.force)||YA("Unrecognized force: "+A.force),e=o4A[A.force]();for(t in A)Ct(e[t])&&Hrt(e[t],A[t],A);return e}function Hrt(A,e,t){A(Ct(e)?i=>e(i,t):e)}const Zrt=Object.freeze(Object.defineProperty({__proto__:null,force:NCA},Symbol.toStringTag,{value:"Module"}));function Wrt(A,e){return A.parent===e.parent?1:2}function Krt(A){return A.reduce(Urt,0)/A.length}function Urt(A,e){return A+e.x}function Vrt(A){return 1+A.reduce(Xrt,0)}function Xrt(A,e){return Math.max(A,e.y)}function zrt(A){for(var e;e=A.children;)A=e[0];return A}function Trt(A){for(var e;e=A.children;)A=e[e.length-1];return A}function _rt(){var A=Wrt,e=1,t=1,i=!1;function n(o){var g,a=0;o.eachAfter(function(l){var c=l.children;c?(l.x=Krt(c),l.y=Vrt(c)):(l.x=g?a+=A(l,g):0,l.y=0,g=l)});var s=zrt(o),I=Trt(o),r=s.x-A(s,I)/2,C=I.x+A(I,s)/2;return o.eachAfter(i?function(l){l.x=(l.x-o.x)*e,l.y=(o.y-l.y)*t}:function(l){l.x=(l.x-r)/(C-r)*e,l.y=(1-(o.y?l.y/o.y:1))*t})}return n.separation=function(o){return arguments.length?(A=o,n):A},n.size=function(o){return arguments.length?(i=!1,e=+o[0],t=+o[1],n):i?null:[e,t]},n.nodeSize=function(o){return arguments.length?(i=!0,e=+o[0],t=+o[1],n):i?[e,t]:null},n}function Ort(A){var e=0,t=A.children,i=t&&t.length;if(!i)e=1;else for(;--i>=0;)e+=t[i].value;A.value=e}function qrt(){return this.eachAfter(Ort)}function jrt(A,e){let t=-1;for(const i of this)A.call(e,i,++t,this);return this}function Prt(A,e){for(var t=this,i=[t],n,o,g=-1;t=i.pop();)if(A.call(e,t,++g,this),n=t.children)for(o=n.length-1;o>=0;--o)i.push(n[o]);return this}function $rt(A,e){for(var t=this,i=[t],n=[],o,g,a,s=-1;t=i.pop();)if(n.push(t),o=t.children)for(g=0,a=o.length;g<a;++g)i.push(o[g]);for(;t=n.pop();)A.call(e,t,++s,this);return this}function AIt(A,e){let t=-1;for(const i of this)if(A.call(e,i,++t,this))return i}function eIt(A){return this.eachAfter(function(e){for(var t=+A(e.data)||0,i=e.children,n=i&&i.length;--n>=0;)t+=i[n].value;e.value=t})}function tIt(A){return this.eachBefore(function(e){e.children&&e.children.sort(A)})}function iIt(A){for(var e=this,t=nIt(e,A),i=[e];e!==t;)e=e.parent,i.push(e);for(var n=i.length;A!==t;)i.splice(n,0,A),A=A.parent;return i}function nIt(A,e){if(A===e)return A;var t=A.ancestors(),i=e.ancestors(),n=null;for(A=t.pop(),e=i.pop();A===e;)n=A,A=t.pop(),e=i.pop();return n}function oIt(){for(var A=this,e=[A];A=A.parent;)e.push(A);return e}function gIt(){return Array.from(this)}function aIt(){var A=[];return this.eachBefore(function(e){e.children||A.push(e)}),A}function sIt(){var A=this,e=[];return A.each(function(t){t!==A&&e.push({source:t.parent,target:t})}),e}function*rIt(){var A=this,e,t=[A],i,n,o;do for(e=t.reverse(),t=[];A=e.pop();)if(yield A,i=A.children)for(n=0,o=i.length;n<o;++n)t.push(i[n]);while(t.length)}function YCA(A,e){A instanceof Map?(A=[void 0,A],e===void 0&&(e=lIt)):e===void 0&&(e=CIt);for(var t=new jJ(A),i,n=[t],o,g,a,s;i=n.pop();)if((g=e(i.data))&&(s=(g=Array.from(g)).length))for(i.children=g,a=s-1;a>=0;--a)n.push(o=g[a]=new jJ(g[a])),o.parent=i,o.depth=i.depth+1;return t.eachBefore(s4A)}function IIt(){return YCA(this).eachBefore(cIt)}function CIt(A){return A.children}function lIt(A){return Array.isArray(A)?A[1]:null}function cIt(A){A.data.value!==void 0&&(A.value=A.data.value),A.data=A.data.data}function s4A(A){var e=0;do A.height=e;while((A=A.parent)&&A.height<++e)}function jJ(A){this.data=A,this.depth=this.height=0,this.parent=null}jJ.prototype=YCA.prototype={constructor:jJ,count:qrt,each:jrt,eachAfter:$rt,eachBefore:Prt,find:AIt,sum:eIt,sort:tIt,path:iIt,ancestors:oIt,descendants:gIt,leaves:aIt,links:sIt,copy:IIt,[Symbol.iterator]:rIt};function sT(A){return A==null?null:r4A(A)}function r4A(A){if(typeof A!="function")throw new Error;return A}function bb(){return 0}function PJ(A){return function(){return A}}const BIt=1664525,QIt=1013904223,I4A=4294967296;function EIt(){let A=1;return()=>(A=(BIt*A+QIt)%I4A)/I4A}function uIt(A){return typeof A=="object"&&"length"in A?A:Array.from(A)}function dIt(A,e){let t=A.length,i,n;for(;t;)n=e()*t--|0,i=A[t],A[t]=A[n],A[n]=i;return A}function hIt(A,e){for(var t=0,i=(A=dIt(Array.from(A),e)).length,n=[],o,g;t<i;)o=A[t],g&&C4A(g,o)?++t:(g=pIt(n=mIt(n,o)),t=0);return g}function mIt(A,e){var t,i;if(RCA(e,A))return[e];for(t=0;t<A.length;++t)if(rT(e,A[t])&&RCA(zv(A[t],e),A))return[A[t],e];for(t=0;t<A.length-1;++t)for(i=t+1;i<A.length;++i)if(rT(zv(A[t],A[i]),e)&&rT(zv(A[t],e),A[i])&&rT(zv(A[i],e),A[t])&&RCA(l4A(A[t],A[i],e),A))return[A[t],A[i],e];throw new Error}function rT(A,e){var t=A.r-e.r,i=e.x-A.x,n=e.y-A.y;return t<0||t*t<i*i+n*n}function C4A(A,e){var t=A.r-e.r+Math.max(A.r,e.r,1)*1e-9,i=e.x-A.x,n=e.y-A.y;return t>0&&t*t>i*i+n*n}function RCA(A,e){for(var t=0;t<e.length;++t)if(!C4A(A,e[t]))return!1;return!0}function pIt(A){switch(A.length){case 1:return fIt(A[0]);case 2:return zv(A[0],A[1]);case 3:return l4A(A[0],A[1],A[2])}}function fIt(A){return{x:A.x,y:A.y,r:A.r}}function zv(A,e){var t=A.x,i=A.y,n=A.r,o=e.x,g=e.y,a=e.r,s=o-t,I=g-i,r=a-n,C=Math.sqrt(s*s+I*I);return{x:(t+o+s/C*r)/2,y:(i+g+I/C*r)/2,r:(C+n+a)/2}}function l4A(A,e,t){var i=A.x,n=A.y,o=A.r,g=e.x,a=e.y,s=e.r,I=t.x,r=t.y,C=t.r,l=i-g,c=i-I,B=n-a,E=n-r,u=s-o,d=C-o,f=i*i+n*n-o*o,w=f-g*g-a*a+s*s,y=f-I*I-r*r+C*C,G=c*B-l*E,R=(B*y-E*w)/(G*2)-i,x=(E*u-B*d)/G,F=(c*w-l*y)/(G*2)-n,Q=(l*d-c*u)/G,k=x*x+Q*Q-1,h=2*(o+R*x+F*Q),N=R*R+F*F-o*o,v=-(Math.abs(k)>1e-6?(h+Math.sqrt(h*h-4*k*N))/(2*k):N/h);return{x:i+R+x*v,y:n+F+Q*v,r:v}}function c4A(A,e,t){var i=A.x-e.x,n,o,g=A.y-e.y,a,s,I=i*i+g*g;I?(o=e.r+t.r,o*=o,s=A.r+t.r,s*=s,o>s?(n=(I+s-o)/(2*I),a=Math.sqrt(Math.max(0,s/I-n*n)),t.x=A.x-n*i-a*g,t.y=A.y-n*g+a*i):(n=(I+o-s)/(2*I),a=Math.sqrt(Math.max(0,o/I-n*n)),t.x=e.x+n*i-a*g,t.y=e.y+n*g+a*i)):(t.x=e.x+t.r,t.y=e.y)}function B4A(A,e){var t=A.r+e.r-1e-6,i=e.x-A.x,n=e.y-A.y;return t>0&&t*t>i*i+n*n}function Q4A(A){var e=A._,t=A.next._,i=e.r+t.r,n=(e.x*t.r+t.x*e.r)/i,o=(e.y*t.r+t.y*e.r)/i;return n*n+o*o}function IT(A){this._=A,this.next=null,this.previous=null}function yIt(A,e){if(!(o=(A=uIt(A)).length))return 0;var t,i,n,o,g,a,s,I,r,C,l;if(t=A[0],t.x=0,t.y=0,!(o>1))return t.r;if(i=A[1],t.x=-i.r,i.x=t.r,i.y=0,!(o>2))return t.r+i.r;c4A(i,t,n=A[2]),t=new IT(t),i=new IT(i),n=new IT(n),t.next=n.previous=i,i.next=t.previous=n,n.next=i.previous=t;A:for(s=3;s<o;++s){c4A(t._,i._,n=A[s]),n=new IT(n),I=i.next,r=t.previous,C=i._.r,l=t._.r;do if(C<=l){if(B4A(I._,n._)){i=I,t.next=i,i.previous=t,--s;continue A}C+=I._.r,I=I.next}else{if(B4A(r._,n._)){t=r,t.next=i,i.previous=t,--s;continue A}l+=r._.r,r=r.previous}while(I!==r.next);for(n.previous=t,n.next=i,t.next=i.previous=i=n,g=Q4A(t);(n=n.next)!==i;)(a=Q4A(n))<g&&(t=n,g=a);i=t.next}for(t=[i._],n=i;(n=n.next)!==i;)t.push(n._);for(n=hIt(t,e),s=0;s<o;++s)t=A[s],t.x-=n.x,t.y-=n.y;return n.r}function bIt(A){return Math.sqrt(A.value)}function wIt(){var A=null,e=1,t=1,i=bb;function n(o){const g=EIt();return o.x=e/2,o.y=t/2,A?o.eachBefore(E4A(A)).eachAfter(xCA(i,.5,g)).eachBefore(u4A(1)):o.eachBefore(E4A(bIt)).eachAfter(xCA(bb,1,g)).eachAfter(xCA(i,o.r/Math.min(e,t),g)).eachBefore(u4A(Math.min(e,t)/(2*o.r))),o}return n.radius=function(o){return arguments.length?(A=sT(o),n):A},n.size=function(o){return arguments.length?(e=+o[0],t=+o[1],n):[e,t]},n.padding=function(o){return arguments.length?(i=typeof o=="function"?o:PJ(+o),n):i},n}function E4A(A){return function(e){e.children||(e.r=Math.max(0,+A(e)||0))}}function xCA(A,e,t){return function(i){if(n=i.children){var n,o,g=n.length,a=A(i)*e||0,s;if(a)for(o=0;o<g;++o)n[o].r+=a;if(s=yIt(n,t),a)for(o=0;o<g;++o)n[o].r-=a;i.r=s+a}}}function u4A(A){return function(e){var t=e.parent;e.r*=A,t&&(e.x=t.x+A*e.x,e.y=t.y+A*e.y)}}function d4A(A){A.x0=Math.round(A.x0),A.y0=Math.round(A.y0),A.x1=Math.round(A.x1),A.y1=Math.round(A.y1)}function Tv(A,e,t,i,n){for(var o=A.children,g,a=-1,s=o.length,I=A.value&&(i-e)/A.value;++a<s;)g=o[a],g.y0=t,g.y1=n,g.x0=e,g.x1=e+=g.value*I}function DIt(){var A=1,e=1,t=0,i=!1;function n(g){var a=g.height+1;return g.x0=g.y0=t,g.x1=A,g.y1=e/a,g.eachBefore(o(e,a)),i&&g.eachBefore(d4A),g}function o(g,a){return function(s){s.children&&Tv(s,s.x0,g*(s.depth+1)/a,s.x1,g*(s.depth+2)/a);var I=s.x0,r=s.y0,C=s.x1-t,l=s.y1-t;C<I&&(I=C=(I+C)/2),l<r&&(r=l=(r+l)/2),s.x0=I,s.y0=r,s.x1=C,s.y1=l}}return n.round=function(g){return arguments.length?(i=!!g,n):i},n.size=function(g){return arguments.length?(A=+g[0],e=+g[1],n):[A,e]},n.padding=function(g){return arguments.length?(t=+g,n):t},n}var GIt={depth:-1},h4A={},FCA={};function kIt(A){return A.id}function JIt(A){return A.parentId}function m4A(){var A=kIt,e=JIt,t;function i(n){var o=Array.from(n),g=A,a=e,s,I,r,C,l,c,B,E,u=new Map;if(t!=null){const d=o.map((y,G)=>NIt(t(y,G,n))),f=d.map(p4A),w=new Set(d).add("");for(const y of f)w.has(y)||(w.add(y),d.push(y),f.push(p4A(y)),o.push(FCA));g=(y,G)=>d[G],a=(y,G)=>f[G]}for(r=0,s=o.length;r<s;++r)I=o[r],c=o[r]=new jJ(I),(B=g(I,r,n))!=null&&(B+="")&&(E=c.id=B,u.set(E,u.has(E)?h4A:c)),(B=a(I,r,n))!=null&&(B+="")&&(c.parent=B);for(r=0;r<s;++r)if(c=o[r],B=c.parent){if(l=u.get(B),!l)throw new Error("missing: "+B);if(l===h4A)throw new Error("ambiguous: "+B);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(C)throw new Error("multiple roots");C=c}if(!C)throw new Error("no root");if(t!=null){for(;C.data===FCA&&C.children.length===1;)C=C.children[0],--s;for(let d=o.length-1;d>=0&&(c=o[d],c.data===FCA);--d)c.data=null}if(C.parent=GIt,C.eachBefore(function(d){d.depth=d.parent.depth+1,--s}).eachBefore(s4A),C.parent=null,s>0)throw new Error("cycle");return C}return i.id=function(n){return arguments.length?(A=sT(n),i):A},i.parentId=function(n){return arguments.length?(e=sT(n),i):e},i.path=function(n){return arguments.length?(t=sT(n),i):t},i}function NIt(A){A=`${A}`;let e=A.length;return MCA(A,e-1)&&!MCA(A,e-2)&&(A=A.slice(0,-1)),A[0]==="/"?A:`/${A}`}function p4A(A){let e=A.length;if(e<2)return"";for(;--e>1&&!MCA(A,e););return A.slice(0,e)}function MCA(A,e){if(A[e]==="/"){let t=0;for(;e>0&&A[--e]==="\\";)++t;if(!(t&1))return!0}return!1}function YIt(A,e){return A.parent===e.parent?1:2}function vCA(A){var e=A.children;return e?e[0]:A.t}function LCA(A){var e=A.children;return e?e[e.length-1]:A.t}function RIt(A,e,t){var i=t/(e.i-A.i);e.c-=i,e.s+=t,A.c+=i,e.z+=t,e.m+=t}function xIt(A){for(var e=0,t=0,i=A.children,n=i.length,o;--n>=0;)o=i[n],o.z+=e,o.m+=e,e+=o.s+(t+=o.c)}function FIt(A,e,t){return A.a.parent===e.parent?A.a:t}function CT(A,e){this._=A,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}CT.prototype=Object.create(jJ.prototype);function MIt(A){for(var e=new CT(A,0),t,i=[e],n,o,g,a;t=i.pop();)if(o=t._.children)for(t.children=new Array(a=o.length),g=a-1;g>=0;--g)i.push(n=t.children[g]=new CT(o[g],g)),n.parent=t;return(e.parent=new CT(null,0)).children=[e],e}function vIt(){var A=YIt,e=1,t=1,i=null;function n(I){var r=MIt(I);if(r.eachAfter(o),r.parent.m=-r.z,r.eachBefore(g),i)I.eachBefore(s);else{var C=I,l=I,c=I;I.eachBefore(function(f){f.x<C.x&&(C=f),f.x>l.x&&(l=f),f.depth>c.depth&&(c=f)});var B=C===l?1:A(C,l)/2,E=B-C.x,u=e/(l.x+B+E),d=t/(c.depth||1);I.eachBefore(function(f){f.x=(f.x+E)*u,f.y=f.depth*d})}return I}function o(I){var r=I.children,C=I.parent.children,l=I.i?C[I.i-1]:null;if(r){xIt(I);var c=(r[0].z+r[r.length-1].z)/2;l?(I.z=l.z+A(I._,l._),I.m=I.z-c):I.z=c}else l&&(I.z=l.z+A(I._,l._));I.parent.A=a(I,l,I.parent.A||C[0])}function g(I){I._.x=I.z+I.parent.m,I.m+=I.parent.m}function a(I,r,C){if(r){for(var l=I,c=I,B=r,E=l.parent.children[0],u=l.m,d=c.m,f=B.m,w=E.m,y;B=LCA(B),l=vCA(l),B&&l;)E=vCA(E),c=LCA(c),c.a=I,y=B.z+f-l.z-u+A(B._,l._),y>0&&(RIt(FIt(B,I,C),I,y),u+=y,d+=y),f+=B.m,u+=l.m,w+=E.m,d+=c.m;B&&!LCA(c)&&(c.t=B,c.m+=f-d),l&&!vCA(E)&&(E.t=l,E.m+=u-w,C=I)}return C}function s(I){I.x*=e,I.y=I.depth*t}return n.separation=function(I){return arguments.length?(A=I,n):A},n.size=function(I){return arguments.length?(i=!1,e=+I[0],t=+I[1],n):i?null:[e,t]},n.nodeSize=function(I){return arguments.length?(i=!0,e=+I[0],t=+I[1],n):i?[e,t]:null},n}function lT(A,e,t,i,n){for(var o=A.children,g,a=-1,s=o.length,I=A.value&&(n-t)/A.value;++a<s;)g=o[a],g.x0=e,g.x1=i,g.y0=t,g.y1=t+=g.value*I}var f4A=(1+Math.sqrt(5))/2;function y4A(A,e,t,i,n,o){for(var g=[],a=e.children,s,I,r=0,C=0,l=a.length,c,B,E=e.value,u,d,f,w,y,G,R;r<l;){c=n-t,B=o-i;do u=a[C++].value;while(!u&&C<l);for(d=f=u,G=Math.max(B/c,c/B)/(E*A),R=u*u*G,y=Math.max(f/R,R/d);C<l;++C){if(u+=I=a[C].value,I<d&&(d=I),I>f&&(f=I),R=u*u*G,w=Math.max(f/R,R/d),w>y){u-=I;break}y=w}g.push(s={value:u,dice:c<B,children:a.slice(r,C)}),s.dice?Tv(s,t,i,n,E?i+=B*u/E:o):lT(s,t,i,E?t+=c*u/E:n,o),E-=u,r=C}return g}const b4A=function A(e){function t(i,n,o,g,a){y4A(e,i,n,o,g,a)}return t.ratio=function(i){return A((i=+i)>1?i:1)},t}(f4A);function LIt(){var A=b4A,e=!1,t=1,i=1,n=[0],o=bb,g=bb,a=bb,s=bb,I=bb;function r(l){return l.x0=l.y0=0,l.x1=t,l.y1=i,l.eachBefore(C),n=[0],e&&l.eachBefore(d4A),l}function C(l){var c=n[l.depth],B=l.x0+c,E=l.y0+c,u=l.x1-c,d=l.y1-c;u<B&&(B=u=(B+u)/2),d<E&&(E=d=(E+d)/2),l.x0=B,l.y0=E,l.x1=u,l.y1=d,l.children&&(c=n[l.depth+1]=o(l)/2,B+=I(l)-c,E+=g(l)-c,u-=a(l)-c,d-=s(l)-c,u<B&&(B=u=(B+u)/2),d<E&&(E=d=(E+d)/2),A(l,B,E,u,d))}return r.round=function(l){return arguments.length?(e=!!l,r):e},r.size=function(l){return arguments.length?(t=+l[0],i=+l[1],r):[t,i]},r.tile=function(l){return arguments.length?(A=r4A(l),r):A},r.padding=function(l){return arguments.length?r.paddingInner(l).paddingOuter(l):r.paddingInner()},r.paddingInner=function(l){return arguments.length?(o=typeof l=="function"?l:PJ(+l),r):o},r.paddingOuter=function(l){return arguments.length?r.paddingTop(l).paddingRight(l).paddingBottom(l).paddingLeft(l):r.paddingTop()},r.paddingTop=function(l){return arguments.length?(g=typeof l=="function"?l:PJ(+l),r):g},r.paddingRight=function(l){return arguments.length?(a=typeof l=="function"?l:PJ(+l),r):a},r.paddingBottom=function(l){return arguments.length?(s=typeof l=="function"?l:PJ(+l),r):s},r.paddingLeft=function(l){return arguments.length?(I=typeof l=="function"?l:PJ(+l),r):I},r}function SIt(A,e,t,i,n){var o=A.children,g,a=o.length,s,I=new Array(a+1);for(I[0]=s=g=0;g<a;++g)I[g+1]=s+=o[g].value;r(0,a,A.value,e,t,i,n);function r(C,l,c,B,E,u,d){if(C>=l-1){var f=o[C];f.x0=B,f.y0=E,f.x1=u,f.y1=d;return}for(var w=I[C],y=c/2+w,G=C+1,R=l-1;G<R;){var x=G+R>>>1;I[x]<y?G=x+1:R=x}y-I[G-1]<I[G]-y&&C+1<G&&--G;var F=I[G]-w,Q=c-F;if(u-B>d-E){var k=c?(B*Q+u*F)/c:u;r(C,G,F,B,E,k,d),r(G,l,Q,k,E,u,d)}else{var h=c?(E*Q+d*F)/c:d;r(C,G,F,B,E,u,h),r(G,l,Q,B,h,u,d)}}}function HIt(A,e,t,i,n){(A.depth&1?lT:Tv)(A,e,t,i,n)}const ZIt=function A(e){function t(i,n,o,g,a){if((s=i._squarify)&&s.ratio===e)for(var s,I,r,C,l=-1,c,B=s.length,E=i.value;++l<B;){for(I=s[l],r=I.children,C=I.value=0,c=r.length;C<c;++C)I.value+=r[C].value;I.dice?Tv(I,n,o,g,E?o+=(a-o)*I.value/E:a):lT(I,n,o,E?n+=(g-n)*I.value/E:g,a),E-=I.value}else i._squarify=s=y4A(e,i,n,o,g,a),s.ratio=e}return t.ratio=function(i){return A((i=+i)>1?i:1)},t}(f4A);function SCA(A,e,t){const i={};return A.each(n=>{const o=n.data;t(o)&&(i[e(o)]=n)}),A.lookup=i,A}function HCA(A){DA.call(this,null,A)}HCA.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const WIt=A=>A.values;_A(HCA,DA,{transform(A,e){e.source||YA("Nest transform requires an upstream data source.");var t=A.generate,i=A.modified(),n=e.clone(),o=this.value;return(!o||i||e.changed())&&(o&&o.each(g=>{g.children&&g5(g.data)&&n.rem.push(g.data)}),this.value=o=YCA({values:te(A.keys).reduce((g,a)=>(g.key(a),g),KIt()).entries(n.source)},WIt),t&&o.each(g=>{g.children&&(g=Ei(g.data),n.add.push(g),n.source.push(g))}),SCA(o,Ne,Ne)),n.source.root=o,n}});function KIt(){const A=[],e={entries:n=>i(t(n,0),0),key:n=>(A.push(n),e)};function t(n,o){if(o>=A.length)return n;const g=n.length,a=A[o++],s={},I={};let r=-1,C,l,c;for(;++r<g;)C=a(l=n[r])+"",(c=s[C])?c.push(l):s[C]=[l];for(C in s)I[C]=t(s[C],o);return I}function i(n,o){if(++o>A.length)return n;const g=[];for(const a in n)g.push({key:a,values:i(n[a],o)});return g}return e}function cd(A){DA.call(this,null,A)}const UIt=(A,e)=>A.parent===e.parent?1:2;_A(cd,DA,{transform(A,e){(!e.source||!e.source.root)&&YA(this.constructor.name+" transform requires a backing tree data source.");const t=this.layout(A.method),i=this.fields,n=e.source.root,o=A.as||i;A.field?n.sum(A.field):n.count(),A.sort&&n.sort(ab(A.sort,g=>g.data)),VIt(t,this.params,A),t.separation&&t.separation(A.separation!==!1?UIt:BJ);try{this.value=t(n)}catch(g){YA(g)}return n.each(g=>XIt(g,i,o)),e.reflow(A.modified()).modifies(o).modifies("leaf")}});function VIt(A,e,t){for(let i,n=0,o=e.length;n<o;++n)i=e[n],i in t&&A[i](t[i])}function XIt(A,e,t){const i=A.data,n=e.length-1;for(let o=0;o<n;++o)i[t[o]]=A[e[o]];i[t[n]]=A.children?A.children.length:0}const ZCA=["x","y","r","depth","children"];function WCA(A){cd.call(this,A)}WCA.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ZCA.length,default:ZCA}]},_A(WCA,cd,{layout:wIt,params:["radius","size","padding"],fields:ZCA});const KCA=["x0","y0","x1","y1","depth","children"];function UCA(A){cd.call(this,A)}UCA.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:KCA.length,default:KCA}]},_A(UCA,cd,{layout:DIt,params:["size","round","padding"],fields:KCA});function VCA(A){DA.call(this,null,A)}VCA.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},_A(VCA,DA,{transform(A,e){e.source||YA("Stratify transform requires an upstream data source.");let t=this.value;const i=A.modified(),n=e.fork(e.ALL).materialize(e.SOURCE),o=!t||i||e.changed(e.ADD_REM)||e.modified(A.key.fields)||e.modified(A.parentKey.fields);return n.source=n.source.slice(),o&&(t=n.source.length?SCA(m4A().id(A.key).parentId(A.parentKey)(n.source),A.key,el):SCA(m4A()([{}]),A.key,A.key)),n.source.root=this.value=t,n}});const w4A={tidy:vIt,cluster:_rt},XCA=["x","y","depth","children"];function zCA(A){cd.call(this,A)}zCA.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:XCA.length,default:XCA}]},_A(zCA,cd,{layout(A){const e=A||"tidy";if(Je(w4A,e))return w4A[e]();YA("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:XCA});function TCA(A){DA.call(this,[],A)}TCA.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},_A(TCA,DA,{transform(A,e){const t=this.value,i=e.source&&e.source.root,n=e.fork(e.NO_SOURCE),o={};return i||YA("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(n.rem=t,e.visit(e.SOURCE,g=>o[Ne(g)]=1),i.each(g=>{const a=g.data,s=g.parent&&g.parent.data;s&&o[Ne(a)]&&o[Ne(s)]&&n.add.push(Ei({source:s,target:a}))}),this.value=n.add):e.changed(e.MOD)&&(e.visit(e.MOD,g=>o[Ne(g)]=1),t.forEach(g=>{(o[Ne(g.source)]||o[Ne(g.target)])&&n.mod.push(g)})),n}});const D4A={binary:SIt,dice:Tv,slice:lT,slicedice:HIt,squarify:b4A,resquarify:ZIt},_CA=["x0","y0","x1","y1","depth","children"];function OCA(A){cd.call(this,A)}OCA.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:_CA.length,default:_CA}]},_A(OCA,cd,{layout(){const A=LIt();return A.ratio=e=>{const t=A.tile();t.ratio&&A.tile(t.ratio(e))},A.method=e=>{Je(D4A,e)?A.tile(D4A[e]):YA("Unrecognized Treemap layout method: "+e)},A},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:_CA});const zIt=Object.freeze(Object.defineProperty({__proto__:null,nest:HCA,pack:WCA,partition:UCA,stratify:VCA,tree:zCA,treelinks:TCA,treemap:OCA},Symbol.toStringTag,{value:"Module"})),qCA=4278190080;function TIt(A,e){const t=A.bitmap();return(e||[]).forEach(i=>t.set(A(i.boundary[0]),A(i.boundary[3]))),[t,void 0]}function _It(A,e,t,i,n){const o=A.width,g=A.height,a=i||n,s=up(o,g).getContext("2d"),I=up(o,g).getContext("2d"),r=a&&up(o,g).getContext("2d");t.forEach(F=>cT(s,F,!1)),cT(I,e,!1),a&&cT(r,e,!0);const C=jCA(s,o,g),l=jCA(I,o,g),c=a&&jCA(r,o,g),B=A.bitmap(),E=a&&A.bitmap();let u,d,f,w,y,G,R,x;for(d=0;d<g;++d)for(u=0;u<o;++u)y=d*o+u,G=C[y]&qCA,x=l[y]&qCA,R=a&&c[y]&qCA,(G||R||x)&&(f=A(u),w=A(d),!n&&(G||x)&&B.set(f,w),a&&(G||R)&&E.set(f,w));return[B,E]}function jCA(A,e,t){return new Uint32Array(A.getImageData(0,0,e,t).data.buffer)}function cT(A,e,t){if(!e.length)return;const i=e[0].mark.marktype;i==="group"?e.forEach(n=>{n.items.forEach(o=>cT(A,o.items,t))}):va[i].draw(A,{items:t?e.map(OIt):e})}function OIt(A){const e=a5(A,{});return e.stroke&&e.strokeOpacity!==0||e.fill&&e.fillOpacity!==0?{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}:e}const Bd=5,ds=31,_v=32,Fp=new Uint32Array(_v+1),Nc=new Uint32Array(_v+1);Nc[0]=0,Fp[0]=~Nc[0];for(let A=1;A<=_v;++A)Nc[A]=Nc[A-1]<<1|1,Fp[A]=~Nc[A];function qIt(A,e){const t=new Uint32Array(~~((A*e+_v)/_v));function i(o,g){t[o]|=g}function n(o,g){t[o]&=g}return{array:t,get:(o,g)=>{const a=g*A+o;return t[a>>>Bd]&1<<(a&ds)},set:(o,g)=>{const a=g*A+o;i(a>>>Bd,1<<(a&ds))},clear:(o,g)=>{const a=g*A+o;n(a>>>Bd,~(1<<(a&ds)))},getRange:(o,g,a,s)=>{let I=s,r,C,l,c;for(;I>=g;--I)if(r=I*A+o,C=I*A+a,l=r>>>Bd,c=C>>>Bd,l===c){if(t[l]&Fp[r&ds]&Nc[(C&ds)+1])return!0}else{if(t[l]&Fp[r&ds]||t[c]&Nc[(C&ds)+1])return!0;for(let B=l+1;B<c;++B)if(t[B])return!0}return!1},setRange:(o,g,a,s)=>{let I,r,C,l,c;for(;g<=s;++g)if(I=g*A+o,r=g*A+a,C=I>>>Bd,l=r>>>Bd,C===l)i(C,Fp[I&ds]&Nc[(r&ds)+1]);else for(i(C,Fp[I&ds]),i(l,Nc[(r&ds)+1]),c=C+1;c<l;++c)i(c,4294967295)},clearRange:(o,g,a,s)=>{let I,r,C,l,c;for(;g<=s;++g)if(I=g*A+o,r=g*A+a,C=I>>>Bd,l=r>>>Bd,C===l)n(C,Nc[I&ds]|Fp[(r&ds)+1]);else for(n(C,Nc[I&ds]),n(l,Fp[(r&ds)+1]),c=C+1;c<l;++c)n(c,0)},outOfBounds:(o,g,a,s)=>o<0||g<0||s>=e||a>=A}}function jIt(A,e,t){const i=Math.max(1,Math.sqrt(A*e/1e6)),n=~~((A+2*t+i)/i),o=~~((e+2*t+i)/i),g=a=>~~((a+t)/i);return g.invert=a=>a*i-t,g.bitmap=()=>qIt(n,o),g.ratio=i,g.padding=t,g.width=A,g.height=e,g}function PIt(A,e,t,i){const n=A.width,o=A.height;return function(g){const a=g.datum.datum.items[i].items,s=a.length,I=g.datum.fontSize,r=GI.width(g.datum,g.datum.text);let C=0,l,c,B,E,u,d,f;for(let w=0;w<s;++w)l=a[w].x,B=a[w].y,c=a[w].x2===void 0?l:a[w].x2,E=a[w].y2===void 0?B:a[w].y2,u=(l+c)/2,d=(B+E)/2,f=Math.abs(c-l+E-B),f>=C&&(C=f,g.x=u,g.y=d);return u=r/2,d=I/2,l=g.x-u,c=g.x+u,B=g.y-d,E=g.y+d,g.align="center",l<0&&c<=n?g.align="left":0<=l&&n<c&&(g.align="right"),g.baseline="middle",B<0&&E<=o?g.baseline="top":0<=B&&o<E&&(g.baseline="bottom"),!0}}function BT(A,e,t,i,n,o){let g=t/2;return A-g<0||A+g>n||e-(g=i/2)<0||e+g>o}function Mp(A,e,t,i,n,o,g,a){const s=n*o/(i*2),I=A(e-s),r=A(e+s),C=A(t-(o=o/2)),l=A(t+o);return g.outOfBounds(I,C,r,l)||g.getRange(I,C,r,l)||a&&a.getRange(I,C,r,l)}function $It(A,e,t,i){const n=A.width,o=A.height,g=e[0],a=e[1];function s(I,r,C,l,c){const B=A.invert(I),E=A.invert(r);let u=C,d=o,f;if(!BT(B,E,l,c,n,o)&&!Mp(A,B,E,c,l,u,g,a)&&!Mp(A,B,E,c,l,c,g,null)){for(;d-u>=1;)f=(u+d)/2,Mp(A,B,E,c,l,f,g,a)?d=f:u=f;if(u>C)return[B,E,u,!0]}}return function(I){const r=I.datum.datum.items[i].items,C=r.length,l=I.datum.fontSize,c=GI.width(I.datum,I.datum.text);let B=t?l:0,E=!1,u=!1,d=0,f,w,y,G,R,x,F,Q,k,h,N,v,K,U,V,X,_;for(let q=0;q<C;++q){for(f=r[q].x,y=r[q].y,w=r[q].x2===void 0?f:r[q].x2,G=r[q].y2===void 0?y:r[q].y2,f>w&&(_=f,f=w,w=_),y>G&&(_=y,y=G,G=_),k=A(f),N=A(w),h=~~((k+N)/2),v=A(y),U=A(G),K=~~((v+U)/2),F=h;F>=k;--F)for(Q=K;Q>=v;--Q)X=s(F,Q,B,c,l),X&&([I.x,I.y,B,E]=X);for(F=h;F<=N;++F)for(Q=K;Q<=U;++Q)X=s(F,Q,B,c,l),X&&([I.x,I.y,B,E]=X);!E&&!t&&(V=Math.abs(w-f+G-y),R=(f+w)/2,x=(y+G)/2,V>=d&&!BT(R,x,c,l,n,o)&&!Mp(A,R,x,l,c,l,g,null)&&(d=V,I.x=R,I.y=x,u=!0))}return E||u?(R=c/2,x=l/2,g.setRange(A(I.x-R),A(I.y-x),A(I.x+R),A(I.y+x)),I.align="center",I.baseline="middle",!0):!1}}const ACt=[-1,-1,1,1],eCt=[-1,1,-1,1];function tCt(A,e,t,i){const n=A.width,o=A.height,g=e[0],a=e[1],s=A.bitmap();return function(I){const r=I.datum.datum.items[i].items,C=r.length,l=I.datum.fontSize,c=GI.width(I.datum,I.datum.text),B=[];let E=t?l:0,u=!1,d=!1,f=0,w,y,G,R,x,F,Q,k,h,N,v,K;for(let U=0;U<C;++U){for(w=r[U].x,G=r[U].y,y=r[U].x2===void 0?w:r[U].x2,R=r[U].y2===void 0?G:r[U].y2,B.push([A((w+y)/2),A((G+R)/2)]);B.length;)if([Q,k]=B.pop(),!(g.get(Q,k)||a.get(Q,k)||s.get(Q,k))){s.set(Q,k);for(let V=0;V<4;++V)x=Q+ACt[V],F=k+eCt[V],s.outOfBounds(x,F,x,F)||B.push([x,F]);if(x=A.invert(Q),F=A.invert(k),h=E,N=o,!BT(x,F,c,l,n,o)&&!Mp(A,x,F,l,c,h,g,a)&&!Mp(A,x,F,l,c,l,g,null)){for(;N-h>=1;)v=(h+N)/2,Mp(A,x,F,l,c,v,g,a)?N=v:h=v;h>E&&(I.x=x,I.y=F,E=h,u=!0)}}!u&&!t&&(K=Math.abs(y-w+R-G),x=(w+y)/2,F=(G+R)/2,K>=f&&!BT(x,F,c,l,n,o)&&!Mp(A,x,F,l,c,l,g,null)&&(f=K,I.x=x,I.y=F,d=!0))}return u||d?(x=c/2,F=l/2,g.setRange(A(I.x-x),A(I.y-F),A(I.x+x),A(I.y+F)),I.align="center",I.baseline="middle",!0):!1}}const iCt=["right","center","left"],nCt=["bottom","middle","top"];function oCt(A,e,t,i){const n=A.width,o=A.height,g=e[0],a=e[1],s=i.length;return function(I){const r=I.boundary,C=I.datum.fontSize;if(r[2]<0||r[5]<0||r[0]>n||r[3]>o)return!1;let l=I.textWidth??0,c,B,E,u,d,f,w,y,G,R,x,F,Q,k,h;for(let N=0;N<s;++N){if(c=(t[N]&3)-1,B=(t[N]>>>2&3)-1,E=c===0&&B===0||i[N]<0,u=c&&B?Math.SQRT1_2:1,d=i[N]<0?-1:1,f=r[1+c]+i[N]*c*u,x=r[4+B]+d*C*B/2+i[N]*B*u,y=x-C/2,G=x+C/2,F=A(f),k=A(y),h=A(G),!l)if(G4A(F,F,k,h,g,a,f,f,y,G,r,E))l=GI.width(I.datum,I.datum.text);else continue;if(R=f+d*l*c/2,f=R-l/2,w=R+l/2,F=A(f),Q=A(w),G4A(F,Q,k,h,g,a,f,w,y,G,r,E))return I.x=c?c*d<0?w:f:R,I.y=B?B*d<0?G:y:x,I.align=iCt[c*d+1],I.baseline=nCt[B*d+1],g.setRange(F,k,Q,h),!0}return!1}}function G4A(A,e,t,i,n,o,g,a,s,I,r,C){return!(n.outOfBounds(A,t,e,i)||(C&&o||n).getRange(A,t,e,i))}const PCA=0,$CA=4,AlA=8,elA=0,tlA=1,ilA=2,gCt={"top-left":PCA+elA,top:PCA+tlA,"top-right":PCA+ilA,left:$CA+elA,middle:$CA+tlA,right:$CA+ilA,"bottom-left":AlA+elA,bottom:AlA+tlA,"bottom-right":AlA+ilA},aCt={naive:PIt,"reduced-search":$It,floodfill:tCt};function sCt(A,e,t,i,n,o,g,a,s,I,r){if(!A.length)return A;const C=Math.max(i.length,n.length),l=rCt(i,C),c=ICt(n,C),B=CCt(A[0].datum),E=B==="group"&&A[0].datum.items[s].marktype,u=E==="area",d=lCt(B,E,a,s),f=I===null||I===1/0,w=u&&r==="naive";let y=-1,G=-1;const R=A.map(k=>{const h=f?GI.width(k,k.text):void 0;return y=Math.max(y,h),G=Math.max(G,k.fontSize),{datum:k,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:d(k),textWidth:h}});I=I===null||I===1/0?Math.max(y,G)+Math.max(...i):I;const x=jIt(e[0],e[1],I);let F;if(!w){t&&R.sort((N,v)=>t(N.datum,v.datum));let k=!1;for(let N=0;N<c.length&&!k;++N)k=c[N]===5||l[N]<0;const h=(B&&g||u)&&A.map(N=>N.datum);F=o.length||h?_It(x,h||[],o,k,u):TIt(x,g&&R)}const Q=u?aCt[r](x,F,g,s):oCt(x,F,c,l);return R.forEach(k=>k.opacity=+Q(k)),R}function rCt(A,e){const t=new Float64Array(e),i=A.length;for(let n=0;n<i;++n)t[n]=A[n]||0;for(let n=i;n<e;++n)t[n]=t[i-1];return t}function ICt(A,e){const t=new Int8Array(e),i=A.length;for(let n=0;n<i;++n)t[n]|=gCt[A[n]];for(let n=i;n<e;++n)t[n]=t[i-1];return t}function CCt(A){return A&&A.mark&&A.mark.marktype}function lCt(A,e,t,i){const n=o=>[o.x,o.x,o.x,o.y,o.y,o.y];return A?A==="line"||A==="area"?o=>n(o.datum):e==="line"?o=>{const g=o.datum.items[i].items;return n(g.length?g[t==="start"?0:g.length-1]:{x:NaN,y:NaN})}:o=>{const g=o.datum.bounds;return[g.x1,(g.x1+g.x2)/2,g.x2,g.y1,(g.y1+g.y2)/2,g.y2]}:n}const nlA=["x","y","opacity","align","baseline"],k4A=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function olA(A){DA.call(this,null,A)}olA.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:k4A},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:nlA.length,default:nlA}]},_A(olA,DA,{transform(A,e){function t(o){const g=A[o];return Ct(g)&&e.modified(g.fields)}const i=A.modified();if(!(i||e.changed(e.ADD_REM)||t("sort")))return;(!A.size||A.size.length!==2)&&YA("Size parameter should be specified as a [width, height] array.");const n=A.as||nlA;return sCt(e.materialize(e.SOURCE).source||[],A.size,A.sort,te(A.offset==null?1:A.offset),te(A.anchor||k4A),A.avoidMarks||[],A.avoidBaseMark!==!1,A.lineAnchor||"end",A.markIndex||0,A.padding===void 0?0:A.padding,A.method||"naive").forEach(o=>{const g=o.datum;g[n[0]]=o.x,g[n[1]]=o.y,g[n[2]]=o.opacity,g[n[3]]=o.align,g[n[4]]=o.baseline}),e.reflow(i).modifies(n)}});const cCt=Object.freeze(Object.defineProperty({__proto__:null,label:olA},Symbol.toStringTag,{value:"Module"}));function J4A(A,e){var t=[],i=function(r){return r(a)},n,o,g,a,s,I;if(e==null)t.push(A);else for(n={},o=0,g=A.length;o<g;++o)a=A[o],s=e.map(i),I=n[s],I||(n[s]=I=[],I.dims=s,t.push(I)),I.push(a);return t}function glA(A){DA.call(this,null,A)}glA.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},_A(glA,DA,{transform(A,e){const t=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||A.modified()){const i=e.materialize(e.SOURCE).source,n=J4A(i,A.groupby),o=(A.groupby||[]).map(ro),g=o.length,a=A.as||[ro(A.x),ro(A.y)],s=[];n.forEach(I=>{IXA(I,A.x,A.y,A.bandwidth||.3).forEach(r=>{const C={};for(let l=0;l<g;++l)C[o[l]]=I.dims[l];C[a[0]]=r[0],C[a[1]]=r[1],s.push(Ei(C))})}),this.value&&(t.rem=this.value),this.value=t.add=t.source=s}return t}});const alA={constant:fsA,linear:ysA,log:nXA,exp:oXA,pow:gXA,quad:bsA,poly:aXA},BCt=(A,e)=>A==="poly"?e:A==="quad"?2:1;function slA(A){DA.call(this,null,A)}slA.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(alA)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},_A(slA,DA,{transform(A,e){const t=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||A.modified()){const i=e.materialize(e.SOURCE).source,n=J4A(i,A.groupby),o=(A.groupby||[]).map(ro),g=A.method||"linear",a=A.order==null?3:A.order,s=BCt(g,a),I=A.as||[ro(A.x),ro(A.y)],r=alA[g],C=[];let l=A.extent;Je(alA,g)||YA("Invalid regression method: "+g),l!=null&&g==="log"&&l[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),l=null),n.forEach(c=>{if(c.length<=s){e.dataflow.warn("Skipping regression with more parameters than data points.");return}const B=r(c,A.x,A.y,a);if(A.params){C.push(Ei({keys:c.dims,coef:B.coef,rSquared:B.rSquared}));return}const E=l||mQ(c,A.x),u=d=>{const f={};for(let w=0;w<o.length;++w)f[o[w]]=c.dims[w];f[I[0]]=d[0],f[I[1]]=d[1],C.push(Ei(f))};g==="linear"||g==="constant"?E.forEach(d=>u([d,B.predict(d)])):u5(B.predict,E,25,200).forEach(u)}),this.value&&(t.rem=this.value),this.value=t.add=t.source=C}return t}});const QCt=Object.freeze(Object.defineProperty({__proto__:null,loess:glA,regression:slA},Symbol.toStringTag,{value:"Module"})),Qd=11102230246251565e-32,Za=134217729,ECt=(3+8*Qd)*Qd;function rlA(A,e,t,i,n){let o,g,a,s,I=e[0],r=i[0],C=0,l=0;r>I==r>-I?(o=I,I=e[++C]):(o=r,r=i[++l]);let c=0;if(C<A&&l<t)for(r>I==r>-I?(g=I+o,a=o-(g-I),I=e[++C]):(g=r+o,a=o-(g-r),r=i[++l]),o=g,a!==0&&(n[c++]=a);C<A&&l<t;)r>I==r>-I?(g=o+I,s=g-o,a=o-(g-s)+(I-s),I=e[++C]):(g=o+r,s=g-o,a=o-(g-s)+(r-s),r=i[++l]),o=g,a!==0&&(n[c++]=a);for(;C<A;)g=o+I,s=g-o,a=o-(g-s)+(I-s),I=e[++C],o=g,a!==0&&(n[c++]=a);for(;l<t;)g=o+r,s=g-o,a=o-(g-s)+(r-s),r=i[++l],o=g,a!==0&&(n[c++]=a);return(o!==0||c===0)&&(n[c++]=o),c}function uCt(A,e){let t=e[0];for(let i=1;i<A;i++)t+=e[i];return t}function Ov(A){return new Float64Array(A)}const dCt=(3+16*Qd)*Qd,hCt=(2+12*Qd)*Qd,mCt=(9+64*Qd)*Qd*Qd,$J=Ov(4),N4A=Ov(8),Y4A=Ov(12),R4A=Ov(16),hs=Ov(4);function pCt(A,e,t,i,n,o,g){let a,s,I,r,C,l,c,B,E,u,d,f,w,y,G,R,x,F;const Q=A-n,k=t-n,h=e-o,N=i-o;y=Q*N,l=Za*Q,c=l-(l-Q),B=Q-c,l=Za*N,E=l-(l-N),u=N-E,G=B*u-(y-c*E-B*E-c*u),R=h*k,l=Za*h,c=l-(l-h),B=h-c,l=Za*k,E=l-(l-k),u=k-E,x=B*u-(R-c*E-B*E-c*u),d=G-x,C=G-d,$J[0]=G-(d+C)+(C-x),f=y+d,C=f-y,w=y-(f-C)+(d-C),d=w-R,C=w-d,$J[1]=w-(d+C)+(C-R),F=f+d,C=F-f,$J[2]=f-(F-C)+(d-C),$J[3]=F;let v=uCt(4,$J),K=hCt*g;if(v>=K||-v>=K||(C=A-Q,a=A-(Q+C)+(C-n),C=t-k,I=t-(k+C)+(C-n),C=e-h,s=e-(h+C)+(C-o),C=i-N,r=i-(N+C)+(C-o),a===0&&s===0&&I===0&&r===0)||(K=mCt*g+ECt*Math.abs(v),v+=Q*r+N*a-(h*I+k*s),v>=K||-v>=K))return v;y=a*N,l=Za*a,c=l-(l-a),B=a-c,l=Za*N,E=l-(l-N),u=N-E,G=B*u-(y-c*E-B*E-c*u),R=s*k,l=Za*s,c=l-(l-s),B=s-c,l=Za*k,E=l-(l-k),u=k-E,x=B*u-(R-c*E-B*E-c*u),d=G-x,C=G-d,hs[0]=G-(d+C)+(C-x),f=y+d,C=f-y,w=y-(f-C)+(d-C),d=w-R,C=w-d,hs[1]=w-(d+C)+(C-R),F=f+d,C=F-f,hs[2]=f-(F-C)+(d-C),hs[3]=F;const U=rlA(4,$J,4,hs,N4A);y=Q*r,l=Za*Q,c=l-(l-Q),B=Q-c,l=Za*r,E=l-(l-r),u=r-E,G=B*u-(y-c*E-B*E-c*u),R=h*I,l=Za*h,c=l-(l-h),B=h-c,l=Za*I,E=l-(l-I),u=I-E,x=B*u-(R-c*E-B*E-c*u),d=G-x,C=G-d,hs[0]=G-(d+C)+(C-x),f=y+d,C=f-y,w=y-(f-C)+(d-C),d=w-R,C=w-d,hs[1]=w-(d+C)+(C-R),F=f+d,C=F-f,hs[2]=f-(F-C)+(d-C),hs[3]=F;const V=rlA(U,N4A,4,hs,Y4A);y=a*r,l=Za*a,c=l-(l-a),B=a-c,l=Za*r,E=l-(l-r),u=r-E,G=B*u-(y-c*E-B*E-c*u),R=s*I,l=Za*s,c=l-(l-s),B=s-c,l=Za*I,E=l-(l-I),u=I-E,x=B*u-(R-c*E-B*E-c*u),d=G-x,C=G-d,hs[0]=G-(d+C)+(C-x),f=y+d,C=f-y,w=y-(f-C)+(d-C),d=w-R,C=w-d,hs[1]=w-(d+C)+(C-R),F=f+d,C=F-f,hs[2]=f-(F-C)+(d-C),hs[3]=F;const X=rlA(V,Y4A,4,hs,R4A);return R4A[X-1]}function QT(A,e,t,i,n,o){const g=(e-o)*(t-n),a=(A-n)*(i-o),s=g-a,I=Math.abs(g+a);return Math.abs(s)>=dCt*I?s:-pCt(A,e,t,i,n,o,I)}const x4A=Math.pow(2,-52),ET=new Uint32Array(512);class uT{static from(e,t=DCt,i=GCt){const n=e.length,o=new Float64Array(n*2);for(let g=0;g<n;g++){const a=e[g];o[2*g]=t(a),o[2*g+1]=i(a)}return new uT(o)}constructor(e){const t=e.length>>1;if(t>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const i=Math.max(2*t-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:i,_hullTri:n,_hullHash:o}=this,g=e.length>>1;let a=1/0,s=1/0,I=-1/0,r=-1/0;for(let k=0;k<g;k++){const h=e[2*k],N=e[2*k+1];h<a&&(a=h),N<s&&(s=N),h>I&&(I=h),N>r&&(r=N),this._ids[k]=k}const C=(a+I)/2,l=(s+r)/2;let c=1/0,B,E,u;for(let k=0;k<g;k++){const h=IlA(C,l,e[2*k],e[2*k+1]);h<c&&(B=k,c=h)}const d=e[2*B],f=e[2*B+1];c=1/0;for(let k=0;k<g;k++){if(k===B)continue;const h=IlA(d,f,e[2*k],e[2*k+1]);h<c&&h>0&&(E=k,c=h)}let w=e[2*E],y=e[2*E+1],G=1/0;for(let k=0;k<g;k++){if(k===B||k===E)continue;const h=bCt(d,f,w,y,e[2*k],e[2*k+1]);h<G&&(u=k,G=h)}let R=e[2*u],x=e[2*u+1];if(G===1/0){for(let N=0;N<g;N++)this._dists[N]=e[2*N]-e[0]||e[2*N+1]-e[1];A2(this._ids,this._dists,0,g-1);const k=new Uint32Array(g);let h=0;for(let N=0,v=-1/0;N<g;N++){const K=this._ids[N];this._dists[K]>v&&(k[h++]=K,v=this._dists[K])}this.hull=k.subarray(0,h),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(QT(d,f,w,y,R,x)<0){const k=E,h=w,N=y;E=u,w=R,y=x,u=k,R=h,x=N}const F=wCt(d,f,w,y,R,x);this._cx=F.x,this._cy=F.y;for(let k=0;k<g;k++)this._dists[k]=IlA(e[2*k],e[2*k+1],F.x,F.y);A2(this._ids,this._dists,0,g-1),this._hullStart=B;let Q=3;i[B]=t[u]=E,i[E]=t[B]=u,i[u]=t[E]=B,n[B]=0,n[E]=1,n[u]=2,o.fill(-1),o[this._hashKey(d,f)]=B,o[this._hashKey(w,y)]=E,o[this._hashKey(R,x)]=u,this.trianglesLen=0,this._addTriangle(B,E,u,-1,-1,-1);for(let k=0,h,N;k<this._ids.length;k++){const v=this._ids[k],K=e[2*v],U=e[2*v+1];if(k>0&&Math.abs(K-h)<=x4A&&Math.abs(U-N)<=x4A||(h=K,N=U,v===B||v===E||v===u))continue;let V=0;for(let nA=0,j=this._hashKey(K,U);nA<this._hashSize&&(V=o[(j+nA)%this._hashSize],!(V!==-1&&V!==i[V]));nA++);V=t[V];let X=V,_;for(;_=i[X],QT(K,U,e[2*X],e[2*X+1],e[2*_],e[2*_+1])>=0;)if(X=_,X===V){X=-1;break}if(X===-1)continue;let q=this._addTriangle(X,v,i[X],-1,-1,n[X]);n[v]=this._legalize(q+2),n[X]=q,Q++;let $=i[X];for(;_=i[$],QT(K,U,e[2*$],e[2*$+1],e[2*_],e[2*_+1])<0;)q=this._addTriangle($,v,_,n[v],-1,n[$]),n[v]=this._legalize(q+2),i[$]=$,Q--,$=_;if(X===V)for(;_=t[X],QT(K,U,e[2*_],e[2*_+1],e[2*X],e[2*X+1])<0;)q=this._addTriangle(_,v,X,-1,n[X],n[_]),this._legalize(q+2),n[_]=q,i[X]=X,Q--,X=_;this._hullStart=t[v]=X,i[X]=t[$]=v,i[v]=$,o[this._hashKey(K,U)]=v,o[this._hashKey(e[2*X],e[2*X+1])]=X}this.hull=new Uint32Array(Q);for(let k=0,h=this._hullStart;k<Q;k++)this.hull[k]=h,h=i[h];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(fCt(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:i,coords:n}=this;let o=0,g=0;for(;;){const a=i[e],s=e-e%3;if(g=s+(e+2)%3,a===-1){if(o===0)break;e=ET[--o];continue}const I=a-a%3,r=s+(e+1)%3,C=I+(a+2)%3,l=t[g],c=t[e],B=t[r],E=t[C];if(yCt(n[2*l],n[2*l+1],n[2*c],n[2*c+1],n[2*B],n[2*B+1],n[2*E],n[2*E+1])){t[e]=E,t[a]=l;const u=i[C];if(u===-1){let f=this._hullStart;do{if(this._hullTri[f]===C){this._hullTri[f]=e;break}f=this._hullPrev[f]}while(f!==this._hullStart)}this._link(e,u),this._link(a,i[g]),this._link(g,C);const d=I+(a+1)%3;o<ET.length&&(ET[o++]=d)}else{if(o===0)break;e=ET[--o]}}return g}_link(e,t){this._halfedges[e]=t,t!==-1&&(this._halfedges[t]=e)}_addTriangle(e,t,i,n,o,g){const a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=t,this._triangles[a+2]=i,this._link(a,n),this._link(a+1,o),this._link(a+2,g),this.trianglesLen+=3,a}}function fCt(A,e){const t=A/(Math.abs(A)+Math.abs(e));return(e>0?3-t:1+t)/4}function IlA(A,e,t,i){const n=A-t,o=e-i;return n*n+o*o}function yCt(A,e,t,i,n,o,g,a){const s=A-g,I=e-a,r=t-g,C=i-a,l=n-g,c=o-a,B=s*s+I*I,E=r*r+C*C,u=l*l+c*c;return s*(C*u-E*c)-I*(r*u-E*l)+B*(r*c-C*l)<0}function bCt(A,e,t,i,n,o){const g=t-A,a=i-e,s=n-A,I=o-e,r=g*g+a*a,C=s*s+I*I,l=.5/(g*I-a*s),c=(I*r-a*C)*l,B=(g*C-s*r)*l;return c*c+B*B}function wCt(A,e,t,i,n,o){const g=t-A,a=i-e,s=n-A,I=o-e,r=g*g+a*a,C=s*s+I*I,l=.5/(g*I-a*s),c=A+(I*r-a*C)*l,B=e+(g*C-s*r)*l;return{x:c,y:B}}function A2(A,e,t,i){if(i-t<=20)for(let n=t+1;n<=i;n++){const o=A[n],g=e[o];let a=n-1;for(;a>=t&&e[A[a]]>g;)A[a+1]=A[a--];A[a+1]=o}else{const n=t+i>>1;let o=t+1,g=i;qv(A,n,o),e[A[t]]>e[A[i]]&&qv(A,t,i),e[A[o]]>e[A[i]]&&qv(A,o,i),e[A[t]]>e[A[o]]&&qv(A,t,o);const a=A[o],s=e[a];for(;;){do o++;while(e[A[o]]<s);do g--;while(e[A[g]]>s);if(g<o)break;qv(A,o,g)}A[t+1]=A[g],A[g]=a,i-o+1>=g-t?(A2(A,e,o,i),A2(A,e,t,g-1)):(A2(A,e,t,g-1),A2(A,e,o,i))}}function qv(A,e,t){const i=A[e];A[e]=A[t],A[t]=i}function DCt(A){return A[0]}function GCt(A){return A[1]}const F4A=1e-6;class wb{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,i){e=+e,t=+t,i=+i;const n=e+i,o=t;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${n},${o}`:(Math.abs(this._x1-n)>F4A||Math.abs(this._y1-o)>F4A)&&(this._+="L"+n+","+o),i&&(this._+=`A${i},${i},0,1,1,${e-i},${t}A${i},${i},0,1,1,${this._x1=n},${this._y1=o}`)}rect(e,t,i,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+i}v${+n}h${-i}Z`}value(){return this._||null}}class ClA{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}let kCt=class{constructor(A,[e,t,i,n]=[0,0,960,500]){if(!((i=+i)>=(e=+e))||!((n=+n)>=(t=+t)))throw new Error("invalid bounds");this.delaunay=A,this._circumcenters=new Float64Array(A.points.length*2),this.vectors=new Float64Array(A.points.length*2),this.xmax=i,this.xmin=e,this.ymax=n,this.ymin=t,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:A,hull:e,triangles:t},vectors:i}=this;let n,o;const g=this.circumcenters=this._circumcenters.subarray(0,t.length/3*2);for(let B=0,E=0,u=t.length,d,f;B<u;B+=3,E+=2){const w=t[B]*2,y=t[B+1]*2,G=t[B+2]*2,R=A[w],x=A[w+1],F=A[y],Q=A[y+1],k=A[G],h=A[G+1],N=F-R,v=Q-x,K=k-R,U=h-x,V=(N*U-v*K)*2;if(Math.abs(V)<1e-9){if(n===void 0){n=o=0;for(const _ of e)n+=A[_*2],o+=A[_*2+1];n/=e.length,o/=e.length}const X=1e9*Math.sign((n-R)*U-(o-x)*K);d=(R+k)/2-X*U,f=(x+h)/2+X*K}else{const X=1/V,_=N*N+v*v,q=K*K+U*U;d=R+(U*_-v*q)*X,f=x+(N*q-K*_)*X}g[E]=d,g[E+1]=f}let a=e[e.length-1],s,I=a*4,r,C=A[2*a],l,c=A[2*a+1];i.fill(0);for(let B=0;B<e.length;++B)a=e[B],s=I,r=C,l=c,I=a*4,C=A[2*a],c=A[2*a+1],i[s+2]=i[I]=l-c,i[s+3]=i[I+1]=C-r}render(A){const e=A==null?A=new wb:void 0,{delaunay:{halfedges:t,inedges:i,hull:n},circumcenters:o,vectors:g}=this;if(n.length<=1)return null;for(let I=0,r=t.length;I<r;++I){const C=t[I];if(C<I)continue;const l=Math.floor(I/3)*2,c=Math.floor(C/3)*2,B=o[l],E=o[l+1],u=o[c],d=o[c+1];this._renderSegment(B,E,u,d,A)}let a,s=n[n.length-1];for(let I=0;I<n.length;++I){a=s,s=n[I];const r=Math.floor(i[s]/3)*2,C=o[r],l=o[r+1],c=a*4,B=this._project(C,l,g[c+2],g[c+3]);B&&this._renderSegment(C,l,B[0],B[1],A)}return e&&e.value()}renderBounds(A){const e=A==null?A=new wb:void 0;return A.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(A,e){const t=e==null?e=new wb:void 0,i=this._clip(A);if(i===null||!i.length)return;e.moveTo(i[0],i[1]);let n=i.length;for(;i[0]===i[n-2]&&i[1]===i[n-1]&&n>1;)n-=2;for(let o=2;o<n;o+=2)(i[o]!==i[o-2]||i[o+1]!==i[o-1])&&e.lineTo(i[o],i[o+1]);return e.closePath(),t&&t.value()}*cellPolygons(){const{delaunay:{points:A}}=this;for(let e=0,t=A.length/2;e<t;++e){const i=this.cellPolygon(e);i&&(i.index=e,yield i)}}cellPolygon(A){const e=new ClA;return this.renderCell(A,e),e.value()}_renderSegment(A,e,t,i,n){let o;const g=this._regioncode(A,e),a=this._regioncode(t,i);g===0&&a===0?(n.moveTo(A,e),n.lineTo(t,i)):(o=this._clipSegment(A,e,t,i,g,a))&&(n.moveTo(o[0],o[1]),n.lineTo(o[2],o[3]))}contains(A,e,t){return e=+e,e!==e||(t=+t,t!==t)?!1:this.delaunay._step(A,e,t)===A}*neighbors(A){const e=this._clip(A);if(e)for(const t of this.delaunay.neighbors(A)){const i=this._clip(t);if(i){A:for(let n=0,o=e.length;n<o;n+=2)for(let g=0,a=i.length;g<a;g+=2)if(e[n]===i[g]&&e[n+1]===i[g+1]&&e[(n+2)%o]===i[(g+a-2)%a]&&e[(n+3)%o]===i[(g+a-1)%a]){yield t;break A}}}}_cell(A){const{circumcenters:e,delaunay:{inedges:t,halfedges:i,triangles:n}}=this,o=t[A];if(o===-1)return null;const g=[];let a=o;do{const s=Math.floor(a/3);if(g.push(e[s*2],e[s*2+1]),a=a%3===2?a-2:a+1,n[a]!==A)break;a=i[a]}while(a!==o&&a!==-1);return g}_clip(A){if(A===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(A);if(e===null)return null;const{vectors:t}=this,i=A*4;return this._simplify(t[i]||t[i+1]?this._clipInfinite(A,e,t[i],t[i+1],t[i+2],t[i+3]):this._clipFinite(A,e))}_clipFinite(A,e){const t=e.length;let i=null,n,o,g=e[t-2],a=e[t-1],s,I=this._regioncode(g,a),r,C=0;for(let l=0;l<t;l+=2)if(n=g,o=a,g=e[l],a=e[l+1],s=I,I=this._regioncode(g,a),s===0&&I===0)r=C,C=0,i?i.push(g,a):i=[g,a];else{let c,B,E,u,d;if(s===0){if((c=this._clipSegment(n,o,g,a,s,I))===null)continue;[B,E,u,d]=c}else{if((c=this._clipSegment(g,a,n,o,I,s))===null)continue;[u,d,B,E]=c,r=C,C=this._edgecode(B,E),r&&C&&this._edge(A,r,C,i,i.length),i?i.push(B,E):i=[B,E]}r=C,C=this._edgecode(u,d),r&&C&&this._edge(A,r,C,i,i.length),i?i.push(u,d):i=[u,d]}if(i)r=C,C=this._edgecode(i[0],i[1]),r&&C&&this._edge(A,r,C,i,i.length);else if(this.contains(A,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(A,e,t,i,n,o){const g=n<o;for(g&&([A,e,t,i,n,o]=[t,i,A,e,o,n]);;){if(n===0&&o===0)return g?[t,i,A,e]:[A,e,t,i];if(n&o)return null;let a,s,I=n||o;I&8?(a=A+(t-A)*(this.ymax-e)/(i-e),s=this.ymax):I&4?(a=A+(t-A)*(this.ymin-e)/(i-e),s=this.ymin):I&2?(s=e+(i-e)*(this.xmax-A)/(t-A),a=this.xmax):(s=e+(i-e)*(this.xmin-A)/(t-A),a=this.xmin),n?(A=a,e=s,n=this._regioncode(A,e)):(t=a,i=s,o=this._regioncode(t,i))}}_clipInfinite(A,e,t,i,n,o){let g=Array.from(e),a;if((a=this._project(g[0],g[1],t,i))&&g.unshift(a[0],a[1]),(a=this._project(g[g.length-2],g[g.length-1],n,o))&&g.push(a[0],a[1]),g=this._clipFinite(A,g))for(let s=0,I=g.length,r,C=this._edgecode(g[I-2],g[I-1]);s<I;s+=2)r=C,C=this._edgecode(g[s],g[s+1]),r&&C&&(s=this._edge(A,r,C,g,s),I=g.length);else this.contains(A,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(g=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return g}_edge(A,e,t,i,n){for(;e!==t;){let o,g;switch(e){case 5:e=4;continue;case 4:e=6,o=this.xmax,g=this.ymin;break;case 6:e=2;continue;case 2:e=10,o=this.xmax,g=this.ymax;break;case 10:e=8;continue;case 8:e=9,o=this.xmin,g=this.ymax;break;case 9:e=1;continue;case 1:e=5,o=this.xmin,g=this.ymin;break}(i[n]!==o||i[n+1]!==g)&&this.contains(A,o,g)&&(i.splice(n,0,o,g),n+=2)}return n}_project(A,e,t,i){let n=1/0,o,g,a;if(i<0){if(e<=this.ymin)return null;(o=(this.ymin-e)/i)<n&&(a=this.ymin,g=A+(n=o)*t)}else if(i>0){if(e>=this.ymax)return null;(o=(this.ymax-e)/i)<n&&(a=this.ymax,g=A+(n=o)*t)}if(t>0){if(A>=this.xmax)return null;(o=(this.xmax-A)/t)<n&&(g=this.xmax,a=e+(n=o)*i)}else if(t<0){if(A<=this.xmin)return null;(o=(this.xmin-A)/t)<n&&(g=this.xmin,a=e+(n=o)*i)}return[g,a]}_edgecode(A,e){return(A===this.xmin?1:A===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(A,e){return(A<this.xmin?1:A>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}_simplify(A){if(A&&A.length>4){for(let e=0;e<A.length;e+=2){const t=(e+2)%A.length,i=(e+4)%A.length;(A[e]===A[t]&&A[t]===A[i]||A[e+1]===A[t+1]&&A[t+1]===A[i+1])&&(A.splice(t,2),e-=2)}A.length||(A=null)}return A}};const JCt=2*Math.PI,e2=Math.pow;function NCt(A){return A[0]}function YCt(A){return A[1]}function RCt(A){const{triangles:e,coords:t}=A;for(let i=0;i<e.length;i+=3){const n=2*e[i],o=2*e[i+1],g=2*e[i+2];if((t[g]-t[n])*(t[o+1]-t[n+1])-(t[o]-t[n])*(t[g+1]-t[n+1])>1e-10)return!1}return!0}function xCt(A,e,t){return[A+Math.sin(A+e)*t,e+Math.cos(A-e)*t]}class llA{static from(e,t=NCt,i=YCt,n){return new llA("length"in e?FCt(e,t,i,n):Float64Array.from(MCt(e,t,i,n)))}constructor(e){this._delaunator=new uT(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&RCt(e)){this.collinear=Int32Array.from({length:t.length/2},(l,c)=>c).sort((l,c)=>t[2*l]-t[2*c]||t[2*l+1]-t[2*c+1]);const s=this.collinear[0],I=this.collinear[this.collinear.length-1],r=[t[2*s],t[2*s+1],t[2*I],t[2*I+1]],C=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let l=0,c=t.length/2;l<c;++l){const B=xCt(t[2*l],t[2*l+1],C);t[2*l]=B[0],t[2*l+1]=B[1]}this._delaunator=new uT(t)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,n=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,g=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let s=0,I=i.length;s<I;++s){const r=o[s%3===2?s-2:s+1];(i[s]===-1||g[r]===-1)&&(g[r]=s)}for(let s=0,I=n.length;s<I;++s)a[n[s]]=s;n.length<=2&&n.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=n[0],g[n[0]]=1,n.length===2&&(g[n[1]]=0,this.triangles[1]=n[1],this.triangles[2]=n[1]))}voronoi(e){return new kCt(this,e)}*neighbors(e){const{inedges:t,hull:i,_hullIndex:n,halfedges:o,triangles:g,collinear:a}=this;if(a){const C=a.indexOf(e);C>0&&(yield a[C-1]),C<a.length-1&&(yield a[C+1]);return}const s=t[e];if(s===-1)return;let I=s,r=-1;do{if(yield r=g[I],I=I%3===2?I-2:I+1,g[I]!==e)return;if(I=o[I],I===-1){const C=i[(n[e]+1)%i.length];C!==r&&(yield C);return}}while(I!==s)}find(e,t,i=0){if(e=+e,e!==e||(t=+t,t!==t))return-1;const n=i;let o;for(;(o=this._step(i,e,t))>=0&&o!==i&&o!==n;)i=o;return o}_step(e,t,i){const{inedges:n,hull:o,_hullIndex:g,halfedges:a,triangles:s,points:I}=this;if(n[e]===-1||!I.length)return(e+1)%(I.length>>1);let r=e,C=e2(t-I[e*2],2)+e2(i-I[e*2+1],2);const l=n[e];let c=l;do{let B=s[c];const E=e2(t-I[B*2],2)+e2(i-I[B*2+1],2);if(E<C&&(C=E,r=B),c=c%3===2?c-2:c+1,s[c]!==e)break;if(c=a[c],c===-1){if(c=o[(g[e]+1)%o.length],c!==B&&e2(t-I[c*2],2)+e2(i-I[c*2+1],2)<C)return c;break}}while(c!==l);return r}render(e){const t=e==null?e=new wb:void 0,{points:i,halfedges:n,triangles:o}=this;for(let g=0,a=n.length;g<a;++g){const s=n[g];if(s<g)continue;const I=o[g]*2,r=o[s]*2;e.moveTo(i[I],i[I+1]),e.lineTo(i[r],i[r+1])}return this.renderHull(e),t&&t.value()}renderPoints(e,t){t===void 0&&(!e||typeof e.moveTo!="function")&&(t=e,e=null),t=t==null?2:+t;const i=e==null?e=new wb:void 0,{points:n}=this;for(let o=0,g=n.length;o<g;o+=2){const a=n[o],s=n[o+1];e.moveTo(a+t,s),e.arc(a,s,t,0,JCt)}return i&&i.value()}renderHull(e){const t=e==null?e=new wb:void 0,{hull:i,points:n}=this,o=i[0]*2,g=i.length;e.moveTo(n[o],n[o+1]);for(let a=1;a<g;++a){const s=2*i[a];e.lineTo(n[s],n[s+1])}return e.closePath(),t&&t.value()}hullPolygon(){const e=new ClA;return this.renderHull(e),e.value()}renderTriangle(e,t){const i=t==null?t=new wb:void 0,{points:n,triangles:o}=this,g=o[e*=3]*2,a=o[e+1]*2,s=o[e+2]*2;return t.moveTo(n[g],n[g+1]),t.lineTo(n[a],n[a+1]),t.lineTo(n[s],n[s+1]),t.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:e}=this;for(let t=0,i=e.length/3;t<i;++t)yield this.trianglePolygon(t)}trianglePolygon(e){const t=new ClA;return this.renderTriangle(e,t),t.value()}}function FCt(A,e,t,i){const n=A.length,o=new Float64Array(n*2);for(let g=0;g<n;++g){const a=A[g];o[g*2]=e.call(i,a,g,A),o[g*2+1]=t.call(i,a,g,A)}return o}function*MCt(A,e,t,i){let n=0;for(const o of A)yield e.call(i,o,n,A),yield t.call(i,o,n,A),++n}function clA(A){DA.call(this,null,A)}clA.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const vCt=[-1e5,-1e5,1e5,1e5];_A(clA,DA,{transform(A,e){const t=A.as||"path",i=e.source;if(!i||!i.length)return e;let n=A.size;n=n?[0,0,n[0],n[1]]:(n=A.extent)?[n[0][0],n[0][1],n[1][0],n[1][1]]:vCt;const o=this.value=llA.from(i,A.x,A.y).voronoi(n);for(let g=0,a=i.length;g<a;++g){const s=o.cellPolygon(g);i[g][t]=s&&!SCt(s)?LCt(s):null}return e.reflow(A.modified()).modifies(t)}});function LCt(A){const e=A[0][0],t=A[0][1];let i=A.length-1;for(;A[i][0]===e&&A[i][1]===t;--i);return"M"+A.slice(0,i+1).join("L")+"Z"}function SCt(A){return A.length===2&&A[0][0]===A[1][0]&&A[0][1]===A[1][1]}const HCt=Object.freeze(Object.defineProperty({__proto__:null,voronoi:clA},Symbol.toStringTag,{value:"Module"}));var BlA=Math.PI/180,jv=64,dT=2048;function ZCt(){var A=[256,256],e,t,i,n,o,g,a,s=M4A,I=[],r=Math.random,C={};C.layout=function(){for(var B=l(up()),E=zCt((A[0]>>5)*A[1]),u=null,d=I.length,f=-1,w=[],y=I.map(R=>({text:e(R),font:t(R),style:n(R),weight:o(R),rotate:g(R),size:~~(i(R)+1e-14),padding:a(R),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:R})).sort((R,x)=>x.size-R.size);++f<d;){var G=y[f];G.x=A[0]*(r()+.5)>>1,G.y=A[1]*(r()+.5)>>1,WCt(B,G,y,f),G.hasText&&c(E,G,u)&&(w.push(G),u?UCt(u,G):u=[{x:G.x+G.x0,y:G.y+G.y0},{x:G.x+G.x1,y:G.y+G.y1}],G.x-=A[0]>>1,G.y-=A[1]>>1)}return w};function l(B){B.width=B.height=1;var E=Math.sqrt(B.getContext("2d").getImageData(0,0,1,1).data.length>>2);B.width=(jv<<5)/E,B.height=dT/E;var u=B.getContext("2d");return u.fillStyle=u.strokeStyle="red",u.textAlign="center",{context:u,ratio:E}}function c(B,E,u){for(var d=E.x,f=E.y,w=Math.sqrt(A[0]*A[0]+A[1]*A[1]),y=s(A),G=r()<.5?1:-1,R=-G,x,F,Q;(x=y(R+=G))&&(F=~~x[0],Q=~~x[1],!(Math.min(Math.abs(F),Math.abs(Q))>=w));)if(E.x=d+F,E.y=f+Q,!(E.x+E.x0<0||E.y+E.y0<0||E.x+E.x1>A[0]||E.y+E.y1>A[1])&&(!u||!KCt(E,B,A[0]))&&(!u||VCt(E,u))){for(var k=E.sprite,h=E.width>>5,N=A[0]>>5,v=E.x-(h<<4),K=v&127,U=32-K,V=E.y1-E.y0,X=(E.y+E.y0)*N+(v>>5),_,q=0;q<V;q++){_=0;for(var $=0;$<=h;$++)B[X+$]|=_<<U|($<h?(_=k[q*h+$])>>>K:0);X+=N}return E.sprite=null,!0}return!1}return C.words=function(B){return arguments.length?(I=B,C):I},C.size=function(B){return arguments.length?(A=[+B[0],+B[1]],C):A},C.font=function(B){return arguments.length?(t=Db(B),C):t},C.fontStyle=function(B){return arguments.length?(n=Db(B),C):n},C.fontWeight=function(B){return arguments.length?(o=Db(B),C):o},C.rotate=function(B){return arguments.length?(g=Db(B),C):g},C.text=function(B){return arguments.length?(e=Db(B),C):e},C.spiral=function(B){return arguments.length?(s=TCt[B]||B,C):s},C.fontSize=function(B){return arguments.length?(i=Db(B),C):i},C.padding=function(B){return arguments.length?(a=Db(B),C):a},C.random=function(B){return arguments.length?(r=B,C):r},C}function WCt(A,e,t,i){if(!e.sprite){var n=A.context,o=A.ratio;n.clearRect(0,0,(jv<<5)/o,dT/o);var g=0,a=0,s=0,I=t.length,r,C,l,c,B;for(--i;++i<I;){if(e=t[i],n.save(),n.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font,r=n.measureText(e.text+"m").width*o,l=e.size<<1,e.rotate){var E=Math.sin(e.rotate*BlA),u=Math.cos(e.rotate*BlA),d=r*u,f=r*E,w=l*u,y=l*E;r=Math.max(Math.abs(d+y),Math.abs(d-y))+31>>5<<5,l=~~Math.max(Math.abs(f+w),Math.abs(f-w))}else r=r+31>>5<<5;if(l>s&&(s=l),g+r>=jv<<5&&(g=0,a+=s,s=0),a+l>=dT)break;n.translate((g+(r>>1))/o,(a+(l>>1))/o),e.rotate&&n.rotate(e.rotate*BlA),n.fillText(e.text,0,0),e.padding&&(n.lineWidth=2*e.padding,n.strokeText(e.text,0,0)),n.restore(),e.width=r,e.height=l,e.xoff=g,e.yoff=a,e.x1=r>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,g+=r}for(var G=n.getImageData(0,0,(jv<<5)/o,dT/o).data,R=[];--i>=0;)if(e=t[i],!!e.hasText){for(r=e.width,C=r>>5,l=e.y1-e.y0,c=0;c<l*C;c++)R[c]=0;if(g=e.xoff,g==null)return;a=e.yoff;var x=0,F=-1;for(B=0;B<l;B++){for(c=0;c<r;c++){var Q=C*B+(c>>5),k=G[(a+B)*(jv<<5)+(g+c)<<2]?1<<31-c%32:0;R[Q]|=k,x|=k}x?F=B:(e.y0++,l--,B--,a++)}e.y1=e.y0+F,e.sprite=R.slice(0,(e.y1-e.y0)*C)}}}function KCt(A,e,t){t>>=5;for(var i=A.sprite,n=A.width>>5,o=A.x-(n<<4),g=o&127,a=32-g,s=A.y1-A.y0,I=(A.y+A.y0)*t+(o>>5),r,C=0;C<s;C++){r=0;for(var l=0;l<=n;l++)if((r<<a|(l<n?(r=i[C*n+l])>>>g:0))&e[I+l])return!0;I+=t}return!1}function UCt(A,e){var t=A[0],i=A[1];e.x+e.x0<t.x&&(t.x=e.x+e.x0),e.y+e.y0<t.y&&(t.y=e.y+e.y0),e.x+e.x1>i.x&&(i.x=e.x+e.x1),e.y+e.y1>i.y&&(i.y=e.y+e.y1)}function VCt(A,e){return A.x+A.x1>e[0].x&&A.x+A.x0<e[1].x&&A.y+A.y1>e[0].y&&A.y+A.y0<e[1].y}function M4A(A){var e=A[0]/A[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function XCt(A){var e=4,t=e*A[0]/A[1],i=0,n=0;return function(o){var g=o<0?-1:1;switch(Math.sqrt(1+4*g*o)-g&3){case 0:i+=t;break;case 1:n+=e;break;case 2:i-=t;break;default:n-=e;break}return[i,n]}}function zCt(A){for(var e=[],t=-1;++t<A;)e[t]=0;return e}function Db(A){return typeof A=="function"?A:function(){return A}}var TCt={archimedean:M4A,rectangular:XCt};const v4A=["x","y","font","fontSize","fontStyle","fontWeight","angle"],_Ct=["text","font","rotate","fontSize","fontStyle","fontWeight"];function QlA(A){DA.call(this,ZCt(),A)}QlA.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:v4A}]},_A(QlA,DA,{transform(A,e){A.size&&!(A.size[0]&&A.size[1])&&YA("Wordcloud size dimensions must be non-zero.");function t(B){const E=A[B];return Ct(E)&&e.modified(E.fields)}const i=A.modified();if(!(i||e.changed(e.ADD_REM)||_Ct.some(t)))return;const n=e.materialize(e.SOURCE).source,o=this.value,g=A.as||v4A;let a=A.fontSize||14,s;if(Ct(a)?s=A.fontSizeRange:a=Ya(a),s){const B=a,E=Ci("sqrt")().domain(mQ(n,B)).range(s);a=u=>E(B(u))}n.forEach(B=>{B[g[0]]=NaN,B[g[1]]=NaN,B[g[3]]=0});const I=o.words(n).text(A.text).size(A.size||[500,500]).padding(A.padding||1).spiral(A.spiral||"archimedean").rotate(A.rotate||0).font(A.font||"sans-serif").fontStyle(A.fontStyle||"normal").fontWeight(A.fontWeight||"normal").fontSize(a).random(il).layout(),r=o.size(),C=r[0]>>1,l=r[1]>>1,c=I.length;for(let B=0,E,u;B<c;++B)E=I[B],u=E.datum,u[g[0]]=E.x+C,u[g[1]]=E.y+l,u[g[2]]=E.font,u[g[3]]=E.size,u[g[4]]=E.style,u[g[5]]=E.weight,u[g[6]]=E.rotate;return e.reflow(i).modifies(g)}});const OCt=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:QlA},Symbol.toStringTag,{value:"Module"})),qCt=A=>new Uint8Array(A),jCt=A=>new Uint16Array(A),Pv=A=>new Uint32Array(A);function PCt(){let A=8,e=[],t=Pv(0),i=hT(0,A),n=hT(0,A);return{data:()=>e,seen:()=>t=$Ct(t,e.length),add(o){for(let g=0,a=e.length,s=o.length,I;g<s;++g)I=o[g],I._index=a++,e.push(I)},remove(o,g){const a=e.length,s=Array(a-o),I=e;let r,C,l;for(C=0;!g[C]&&C<a;++C)s[C]=e[C],I[C]=C;for(l=C;C<a;++C)r=e[C],g[C]?I[C]=-1:(I[C]=l,i[l]=i[C],n[l]=n[C],s[l]=r,r._index=l++),i[C]=0;return e=s,I},size:()=>e.length,curr:()=>i,prev:()=>n,reset:o=>n[o]=i[o],all:()=>A<257?255:A<65537?65535:4294967295,set(o,g){i[o]|=g},clear(o,g){i[o]&=~g},resize(o,g){const a=i.length;(o>a||g>A)&&(A=Math.max(g,A),i=hT(o,A,i),n=hT(o,A))}}}function $Ct(A,e,t){return A.length>=e?A:(t=t||new A.constructor(e),t.set(A),t)}function hT(A,e,t){const i=(e<257?qCt:e<65537?jCt:Pv)(A);return t&&i.set(t),i}function L4A(A,e,t){const i=1<<e;return{one:i,zero:~i,range:t.slice(),bisect:A.bisect,index:A.index,size:A.size,onAdd(n,o){const g=this,a=g.bisect(g.range,n.value),s=n.index,I=a[0],r=a[1],C=s.length;let l;for(l=0;l<I;++l)o[s[l]]|=i;for(l=r;l<C;++l)o[s[l]]|=i;return g}}}function S4A(){let A=Pv(0),e=[],t=0;function i(a,s,I){if(!s.length)return[];const r=t,C=s.length,l=Pv(C);let c=Array(C),B,E,u;for(u=0;u<C;++u)c[u]=a(s[u]),l[u]=u;if(c=Alt(c,l),r)B=e,E=A,e=Array(r+C),A=Pv(r+C),elt(I,B,E,r,c,l,C,e,A);else{if(I>0)for(u=0;u<C;++u)l[u]+=I;e=c,A=l}return t=r+C,{index:l,value:c}}function n(a,s){const I=t;let r,C,l;for(C=0;!s[A[C]]&&C<I;++C);for(l=C;C<I;++C)s[r=A[C]]||(A[l]=r,e[l]=e[C],++l);t=I-a}function o(a){for(let s=0,I=t;s<I;++s)A[s]=a[A[s]]}function g(a,s){let I;return s?I=s.length:(s=e,I=t),[F8e(s,a[0],0,I),c9(s,a[1],0,I)]}return{insert:i,remove:n,bisect:g,reindex:o,index:()=>A,size:()=>t}}function Alt(A,e){return A.sort.call(e,(t,i)=>{const n=A[t],o=A[i];return n<o?-1:n>o?1:0}),h3A(A,e)}function elt(A,e,t,i,n,o,g,a,s){let I=0,r=0,C;for(C=0;I<i&&r<g;++C)e[I]<n[r]?(a[C]=e[I],s[C]=t[I++]):(a[C]=n[r],s[C]=o[r++]+A);for(;I<i;++I,++C)a[C]=e[I],s[C]=t[I];for(;r<g;++r,++C)a[C]=n[r],s[C]=o[r]+A}function ElA(A){DA.call(this,PCt(),A),this._indices=null,this._dims=null}ElA.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},_A(ElA,DA,{transform(A,e){if(this._dims){var t=A.modified("fields")||A.fields.some(i=>e.modified(i.fields));return t?this.reinit(A,e):this.eval(A,e)}else return this.init(A,e)},init(A,e){const t=A.fields,i=A.query,n=this._indices={},o=this._dims=[],g=i.length;let a=0,s,I;for(;a<g;++a)s=t[a].fname,I=n[s]||(n[s]=S4A()),o.push(L4A(I,a,i[a]));return this.eval(A,e)},reinit(A,e){const t=e.materialize().fork(),i=A.fields,n=A.query,o=this._indices,g=this._dims,a=this.value,s=a.curr(),I=a.prev(),r=a.all(),C=t.rem=t.add,l=t.mod,c=n.length,B={};let E,u,d,f,w,y,G,R,x;if(I.set(s),e.rem.length&&(w=this.remove(A,e,t)),e.add.length&&a.add(e.add),e.mod.length)for(y={},f=e.mod,G=0,R=f.length;G<R;++G)y[f[G]._index]=1;for(G=0;G<c;++G)x=i[G],(!g[G]||A.modified("fields",G)||e.modified(x.fields))&&(d=x.fname,(E=B[d])||(o[d]=u=S4A(),B[d]=E=u.insert(x,e.source,0)),g[G]=L4A(u,G,n[G]).onAdd(E,s));for(G=0,R=a.data().length;G<R;++G)w[G]||(I[G]!==s[G]?C.push(G):y[G]&&s[G]!==r&&l.push(G));return a.mask=(1<<c)-1,t},eval(A,e){const t=e.materialize().fork(),i=this._dims.length;let n=0;return e.rem.length&&(this.remove(A,e,t),n|=(1<<i)-1),A.modified("query")&&!A.modified("fields")&&(n|=this.update(A,e,t)),e.add.length&&(this.insert(A,e,t),n|=(1<<i)-1),e.mod.length&&(this.modify(e,t),n|=(1<<i)-1),this.value.mask=n,t},insert(A,e,t){const i=e.add,n=this.value,o=this._dims,g=this._indices,a=A.fields,s={},I=t.add,r=n.size()+i.length,C=o.length;let l=n.size(),c,B,E;n.resize(r,C),n.add(i);const u=n.curr(),d=n.prev(),f=n.all();for(c=0;c<C;++c)B=a[c].fname,E=s[B]||(s[B]=g[B].insert(a[c],i,l)),o[c].onAdd(E,u);for(;l<r;++l)d[l]=f,u[l]!==f&&I.push(l)},modify(A,e){const t=e.mod,i=this.value,n=i.curr(),o=i.all(),g=A.mod;let a,s,I;for(a=0,s=g.length;a<s;++a)I=g[a]._index,n[I]!==o&&t.push(I)},remove(A,e,t){const i=this._indices,n=this.value,o=n.curr(),g=n.prev(),a=n.all(),s={},I=t.rem,r=e.rem;let C,l,c,B;for(C=0,l=r.length;C<l;++C)c=r[C]._index,s[c]=1,g[c]=B=o[c],o[c]=a,B!==a&&I.push(c);for(c in i)i[c].remove(l,s);return this.reindex(e,l,s),s},reindex(A,e,t){const i=this._indices,n=this.value;A.runAfter(()=>{const o=n.remove(e,t);for(const g in i)i[g].reindex(o)})},update(A,e,t){const i=this._dims,n=A.query,o=e.stamp,g=i.length;let a=0,s,I;for(t.filters=0,I=0;I<g;++I)A.modified("query",I)&&(s=I,++a);if(a===1)a=i[s].one,this.incrementOne(i[s],n[s],t.add,t.rem);else for(I=0,a=0;I<g;++I)A.modified("query",I)&&(a|=i[I].one,this.incrementAll(i[I],n[I],o,t.add),t.rem=t.add);return a},incrementAll(A,e,t,i){const n=this.value,o=n.seen(),g=n.curr(),a=n.prev(),s=A.index(),I=A.bisect(A.range),r=A.bisect(e),C=r[0],l=r[1],c=I[0],B=I[1],E=A.one;let u,d,f;if(C<c)for(u=C,d=Math.min(c,l);u<d;++u)f=s[u],o[f]!==t&&(a[f]=g[f],o[f]=t,i.push(f)),g[f]^=E;else if(C>c)for(u=c,d=Math.min(C,B);u<d;++u)f=s[u],o[f]!==t&&(a[f]=g[f],o[f]=t,i.push(f)),g[f]^=E;if(l>B)for(u=Math.max(C,B),d=l;u<d;++u)f=s[u],o[f]!==t&&(a[f]=g[f],o[f]=t,i.push(f)),g[f]^=E;else if(l<B)for(u=Math.max(c,l),d=B;u<d;++u)f=s[u],o[f]!==t&&(a[f]=g[f],o[f]=t,i.push(f)),g[f]^=E;A.range=e.slice()},incrementOne(A,e,t,i){const n=this.value,o=n.curr(),g=A.index(),a=A.bisect(A.range),s=A.bisect(e),I=s[0],r=s[1],C=a[0],l=a[1],c=A.one;let B,E,u;if(I<C)for(B=I,E=Math.min(C,r);B<E;++B)u=g[B],o[u]^=c,t.push(u);else if(I>C)for(B=C,E=Math.min(I,l);B<E;++B)u=g[B],o[u]^=c,i.push(u);if(r>l)for(B=Math.max(I,l),E=r;B<E;++B)u=g[B],o[u]^=c,t.push(u);else if(r<l)for(B=Math.max(C,r),E=l;B<E;++B)u=g[B],o[u]^=c,i.push(u);A.range=e.slice()}});function ulA(A){DA.call(this,null,A)}ulA.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},_A(ulA,DA,{transform(A,e){const t=~(A.ignore||0),i=A.filter,n=i.mask;if(!(n&t))return e.StopPropagation;const o=e.fork(e.ALL),g=i.data(),a=i.curr(),s=i.prev(),I=r=>a[r]&t?null:g[r];return o.filter(o.MOD,I),n&n-1?(o.filter(o.ADD,r=>{const C=a[r]&t;return!C&&C^s[r]&t?g[r]:null}),o.filter(o.REM,r=>{const C=a[r]&t;return C&&!(C^(C^s[r]&t))?g[r]:null})):(o.filter(o.ADD,I),o.filter(o.REM,r=>(a[r]&t)===n?g[r]:null)),o.filter(o.SOURCE,r=>I(r._index))}});const tlt=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:ElA,resolvefilter:ulA},Symbol.toStringTag,{value:"Module"})),ilt="RawCode",Gb="Literal",nlt="Property",olt="Identifier",glt="ArrayExpression",alt="BinaryExpression",H4A="CallExpression",slt="ConditionalExpression",rlt="LogicalExpression",Ilt="MemberExpression",Clt="ObjectExpression",llt="UnaryExpression";function Yc(A){this.type=A}Yc.prototype.visit=function(A){let e,t,i;if(A(this))return 1;for(e=clt(this),t=0,i=e.length;t<i;++t)if(e[t].visit(A))return 1};function clt(A){switch(A.type){case glt:return A.elements;case alt:case rlt:return[A.left,A.right];case H4A:return[A.callee].concat(A.arguments);case slt:return[A.test,A.consequent,A.alternate];case Ilt:return[A.object,A.property];case Clt:return A.properties;case nlt:return[A.key,A.value];case llt:return[A.argument];case olt:case Gb:case ilt:default:return[]}}var YQ,ue,kA,Wa,Mi,mT=1,$v=2,kb=3,vp=4,pT=5,Jb=6,cr=7,AL=8,Blt=9;YQ={},YQ[mT]="Boolean",YQ[$v]="<end>",YQ[kb]="Identifier",YQ[vp]="Keyword",YQ[pT]="Null",YQ[Jb]="Numeric",YQ[cr]="Punctuator",YQ[AL]="String",YQ[Blt]="RegularExpression";var Qlt="ArrayExpression",Elt="BinaryExpression",ult="CallExpression",dlt="ConditionalExpression",Z4A="Identifier",hlt="Literal",mlt="LogicalExpression",plt="MemberExpression",flt="ObjectExpression",ylt="Property",blt="UnaryExpression",hg="Unexpected token %0",wlt="Unexpected number",Dlt="Unexpected string",Glt="Unexpected identifier",klt="Unexpected reserved word",Jlt="Unexpected end of input",dlA="Invalid regular expression",hlA="Invalid regular expression: missing /",W4A="Octal literals are not allowed in strict mode.",Nlt="Duplicate data property in object literal not allowed in strict mode",ia="ILLEGAL",eL="Disabled.",Ylt=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Rlt=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function fT(A,e){if(!A)throw new Error("ASSERT: "+e)}function Ed(A){return A>=48&&A<=57}function mlA(A){return"0123456789abcdefABCDEF".indexOf(A)>=0}function tL(A){return"01234567".indexOf(A)>=0}function xlt(A){return A===32||A===9||A===11||A===12||A===160||A>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(A)>=0}function iL(A){return A===10||A===13||A===8232||A===8233}function nL(A){return A===36||A===95||A>=65&&A<=90||A>=97&&A<=122||A===92||A>=128&&Ylt.test(String.fromCharCode(A))}function yT(A){return A===36||A===95||A>=65&&A<=90||A>=97&&A<=122||A>=48&&A<=57||A===92||A>=128&&Rlt.test(String.fromCharCode(A))}const Flt={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function K4A(){for(;kA<Wa;){const A=ue.charCodeAt(kA);if(xlt(A)||iL(A))++kA;else break}}function plA(A){var e,t,i,n=0;for(t=A==="u"?4:2,e=0;e<t;++e)kA<Wa&&mlA(ue[kA])?(i=ue[kA++],n=n*16+"0123456789abcdef".indexOf(i.toLowerCase())):li({},hg,ia);return String.fromCharCode(n)}function Mlt(){var A,e,t,i;for(A=ue[kA],e=0,A==="}"&&li({},hg,ia);kA<Wa&&(A=ue[kA++],!!mlA(A));)e=e*16+"0123456789abcdef".indexOf(A.toLowerCase());return(e>1114111||A!=="}")&&li({},hg,ia),e<=65535?String.fromCharCode(e):(t=(e-65536>>10)+55296,i=(e-65536&1023)+56320,String.fromCharCode(t,i))}function U4A(){var A,e;for(A=ue.charCodeAt(kA++),e=String.fromCharCode(A),A===92&&(ue.charCodeAt(kA)!==117&&li({},hg,ia),++kA,A=plA("u"),(!A||A==="\\"||!nL(A.charCodeAt(0)))&&li({},hg,ia),e=A);kA<Wa&&(A=ue.charCodeAt(kA),!!yT(A));)++kA,e+=String.fromCharCode(A),A===92&&(e=e.substr(0,e.length-1),ue.charCodeAt(kA)!==117&&li({},hg,ia),++kA,A=plA("u"),(!A||A==="\\"||!yT(A.charCodeAt(0)))&&li({},hg,ia),e+=A);return e}function vlt(){var A,e;for(A=kA++;kA<Wa;){if(e=ue.charCodeAt(kA),e===92)return kA=A,U4A();if(yT(e))++kA;else break}return ue.slice(A,kA)}function Llt(){var A,e,t;return A=kA,e=ue.charCodeAt(kA)===92?U4A():vlt(),e.length===1?t=kb:Flt.hasOwnProperty(e)?t=vp:e==="null"?t=pT:e==="true"||e==="false"?t=mT:t=kb,{type:t,value:e,start:A,end:kA}}function flA(){var A=kA,e=ue.charCodeAt(kA),t,i=ue[kA],n,o,g;switch(e){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++kA,{type:cr,value:String.fromCharCode(e),start:A,end:kA};default:if(t=ue.charCodeAt(kA+1),t===61)switch(e){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return kA+=2,{type:cr,value:String.fromCharCode(e)+String.fromCharCode(t),start:A,end:kA};case 33:case 61:return kA+=2,ue.charCodeAt(kA)===61&&++kA,{type:cr,value:ue.slice(A,kA),start:A,end:kA}}}if(g=ue.substr(kA,4),g===">>>=")return kA+=4,{type:cr,value:g,start:A,end:kA};if(o=g.substr(0,3),o===">>>"||o==="<<="||o===">>=")return kA+=3,{type:cr,value:o,start:A,end:kA};if(n=o.substr(0,2),i===n[1]&&"+-<>&|".indexOf(i)>=0||n==="=>")return kA+=2,{type:cr,value:n,start:A,end:kA};if(n==="//"&&li({},hg,ia),"<>=!+-*%&|^/".indexOf(i)>=0)return++kA,{type:cr,value:i,start:A,end:kA};li({},hg,ia)}function Slt(A){let e="";for(;kA<Wa&&mlA(ue[kA]);)e+=ue[kA++];return e.length===0&&li({},hg,ia),nL(ue.charCodeAt(kA))&&li({},hg,ia),{type:Jb,value:parseInt("0x"+e,16),start:A,end:kA}}function Hlt(A){let e="0"+ue[kA++];for(;kA<Wa&&tL(ue[kA]);)e+=ue[kA++];return(nL(ue.charCodeAt(kA))||Ed(ue.charCodeAt(kA)))&&li({},hg,ia),{type:Jb,value:parseInt(e,8),octal:!0,start:A,end:kA}}function V4A(){var A,e,t;if(t=ue[kA],fT(Ed(t.charCodeAt(0))||t===".","Numeric literal must start with a decimal digit or a decimal point"),e=kA,A="",t!=="."){if(A=ue[kA++],t=ue[kA],A==="0"){if(t==="x"||t==="X")return++kA,Slt(e);if(tL(t))return Hlt(e);t&&Ed(t.charCodeAt(0))&&li({},hg,ia)}for(;Ed(ue.charCodeAt(kA));)A+=ue[kA++];t=ue[kA]}if(t==="."){for(A+=ue[kA++];Ed(ue.charCodeAt(kA));)A+=ue[kA++];t=ue[kA]}if(t==="e"||t==="E")if(A+=ue[kA++],t=ue[kA],(t==="+"||t==="-")&&(A+=ue[kA++]),Ed(ue.charCodeAt(kA)))for(;Ed(ue.charCodeAt(kA));)A+=ue[kA++];else li({},hg,ia);return nL(ue.charCodeAt(kA))&&li({},hg,ia),{type:Jb,value:parseFloat(A),start:e,end:kA}}function Zlt(){var A="",e,t,i,n,o=!1;for(e=ue[kA],fT(e==="'"||e==='"',"String literal must starts with a quote"),t=kA,++kA;kA<Wa;)if(i=ue[kA++],i===e){e="";break}else if(i==="\\")if(i=ue[kA++],!i||!iL(i.charCodeAt(0)))switch(i){case"u":case"x":ue[kA]==="{"?(++kA,A+=Mlt()):A+=plA(i);break;case"n":A+=`
`;break;case"r":A+="\r";break;case"t":A+="	";break;case"b":A+="\b";break;case"f":A+="\f";break;case"v":A+="\v";break;default:tL(i)?(n="01234567".indexOf(i),n!==0&&(o=!0),kA<Wa&&tL(ue[kA])&&(o=!0,n=n*8+"01234567".indexOf(ue[kA++]),"0123".indexOf(i)>=0&&kA<Wa&&tL(ue[kA])&&(n=n*8+"01234567".indexOf(ue[kA++]))),A+=String.fromCharCode(n)):A+=i;break}else i==="\r"&&ue[kA]===`
`&&++kA;else{if(iL(i.charCodeAt(0)))break;A+=i}return e!==""&&li({},hg,ia),{type:AL,value:A,octal:o,start:t,end:kA}}function Wlt(A,e){let t=A;e.indexOf("u")>=0&&(t=t.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,n)=>{if(parseInt(n,16)<=1114111)return"x";li({},dlA)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(t)}catch{li({},dlA)}try{return new RegExp(A,e)}catch{return null}}function Klt(){var A,e,t,i,n;for(A=ue[kA],fT(A==="/","Regular expression literal must start with a slash"),e=ue[kA++],t=!1,i=!1;kA<Wa;)if(A=ue[kA++],e+=A,A==="\\")A=ue[kA++],iL(A.charCodeAt(0))&&li({},hlA),e+=A;else if(iL(A.charCodeAt(0)))li({},hlA);else if(t)A==="]"&&(t=!1);else if(A==="/"){i=!0;break}else A==="["&&(t=!0);return i||li({},hlA),n=e.substr(1,e.length-2),{value:n,literal:e}}function Ult(){var A,e,t;for(e="",t="";kA<Wa&&(A=ue[kA],!!yT(A.charCodeAt(0)));)++kA,A==="\\"&&kA<Wa?li({},hg,ia):(t+=A,e+=A);return t.search(/[^gimuy]/g)>=0&&li({},dlA,t),{value:t,literal:e}}function Vlt(){var A,e,t,i;return Mi=null,K4A(),A=kA,e=Klt(),t=Ult(),i=Wlt(e.value,t.value),{literal:e.literal+t.literal,value:i,regex:{pattern:e.value,flags:t.value},start:A,end:kA}}function Xlt(A){return A.type===kb||A.type===vp||A.type===mT||A.type===pT}function X4A(){if(K4A(),kA>=Wa)return{type:$v,start:kA,end:kA};const A=ue.charCodeAt(kA);return nL(A)?Llt():A===40||A===41||A===59?flA():A===39||A===34?Zlt():A===46?Ed(ue.charCodeAt(kA+1))?V4A():flA():Ed(A)?V4A():flA()}function Br(){const A=Mi;return kA=A.end,Mi=X4A(),kA=A.end,A}function z4A(){const A=kA;Mi=X4A(),kA=A}function zlt(A){const e=new Yc(Qlt);return e.elements=A,e}function T4A(A,e,t){const i=new Yc(A==="||"||A==="&&"?mlt:Elt);return i.operator=A,i.left=e,i.right=t,i}function Tlt(A,e){const t=new Yc(ult);return t.callee=A,t.arguments=e,t}function _lt(A,e,t){const i=new Yc(dlt);return i.test=A,i.consequent=e,i.alternate=t,i}function ylA(A){const e=new Yc(Z4A);return e.name=A,e}function oL(A){const e=new Yc(hlt);return e.value=A.value,e.raw=ue.slice(A.start,A.end),A.regex&&(e.raw==="//"&&(e.raw="/(?:)/"),e.regex=A.regex),e}function _4A(A,e,t){const i=new Yc(plt);return i.computed=A==="[",i.object=e,i.property=t,i.computed||(t.member=!0),i}function Olt(A){const e=new Yc(flt);return e.properties=A,e}function O4A(A,e,t){const i=new Yc(ylt);return i.key=e,i.value=t,i.kind=A,i}function qlt(A,e){const t=new Yc(blt);return t.operator=A,t.argument=e,t.prefix=!0,t}function li(A,e){var t,i=Array.prototype.slice.call(arguments,2),n=e.replace(/%(\d)/g,(o,g)=>(fT(g<i.length,"Message reference must be in range"),i[g]));throw t=new Error(n),t.index=kA,t.description=n,t}function bT(A){A.type===$v&&li(A,Jlt),A.type===Jb&&li(A,wlt),A.type===AL&&li(A,Dlt),A.type===kb&&li(A,Glt),A.type===vp&&li(A,klt),li(A,hg,A.value)}function Ka(A){const e=Br();(e.type!==cr||e.value!==A)&&bT(e)}function wn(A){return Mi.type===cr&&Mi.value===A}function blA(A){return Mi.type===vp&&Mi.value===A}function jlt(){const A=[];for(kA=Mi.start,Ka("[");!wn("]");)wn(",")?(Br(),A.push(null)):(A.push(Nb()),wn("]")||Ka(","));return Br(),zlt(A)}function q4A(){kA=Mi.start;const A=Br();return A.type===AL||A.type===Jb?(A.octal&&li(A,W4A),oL(A)):ylA(A.value)}function Plt(){var A,e,t,i;if(kA=Mi.start,A=Mi,A.type===kb)return t=q4A(),Ka(":"),i=Nb(),O4A("init",t,i);if(A.type===$v||A.type===cr)bT(A);else return e=q4A(),Ka(":"),i=Nb(),O4A("init",e,i)}function $lt(){var A=[],e,t,i,n={},o=String;for(kA=Mi.start,Ka("{");!wn("}");)e=Plt(),e.key.type===Z4A?t=e.key.name:t=o(e.key.value),i="$"+t,Object.prototype.hasOwnProperty.call(n,i)?li({},Nlt):n[i]=!0,A.push(e),wn("}")||Ka(",");return Ka("}"),Olt(A)}function Act(){Ka("(");const A=wlA();return Ka(")"),A}const ect={if:1};function tct(){var A,e,t;if(wn("("))return Act();if(wn("["))return jlt();if(wn("{"))return $lt();if(A=Mi.type,kA=Mi.start,A===kb||ect[Mi.value])t=ylA(Br().value);else if(A===AL||A===Jb)Mi.octal&&li(Mi,W4A),t=oL(Br());else{if(A===vp)throw new Error(eL);A===mT?(e=Br(),e.value=e.value==="true",t=oL(e)):A===pT?(e=Br(),e.value=null,t=oL(e)):wn("/")||wn("/=")?(t=oL(Vlt()),z4A()):bT(Br())}return t}function ict(){const A=[];if(Ka("("),!wn(")"))for(;kA<Wa&&(A.push(Nb()),!wn(")"));)Ka(",");return Ka(")"),A}function nct(){kA=Mi.start;const A=Br();return Xlt(A)||bT(A),ylA(A.value)}function oct(){return Ka("."),nct()}function gct(){Ka("[");const A=wlA();return Ka("]"),A}function act(){var A,e,t;for(A=tct();;)if(wn("."))t=oct(),A=_4A(".",A,t);else if(wn("("))e=ict(),A=Tlt(A,e);else if(wn("["))t=gct(),A=_4A("[",A,t);else break;return A}function j4A(){const A=act();if(Mi.type===cr&&(wn("++")||wn("--")))throw new Error(eL);return A}function wT(){var A,e;if(Mi.type!==cr&&Mi.type!==vp)e=j4A();else{if(wn("++")||wn("--"))throw new Error(eL);if(wn("+")||wn("-")||wn("~")||wn("!"))A=Br(),e=wT(),e=qlt(A.value,e);else{if(blA("delete")||blA("void")||blA("typeof"))throw new Error(eL);e=j4A()}}return e}function P4A(A){let e=0;if(A.type!==cr&&A.type!==vp)return 0;switch(A.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break}return e}function sct(){var A,e,t,i,n,o,g,a,s,I;if(A=Mi,s=wT(),i=Mi,n=P4A(i),n===0)return s;for(i.prec=n,Br(),e=[A,Mi],g=wT(),o=[s,i,g];(n=P4A(Mi))>0;){for(;o.length>2&&n<=o[o.length-2].prec;)g=o.pop(),a=o.pop().value,s=o.pop(),e.pop(),t=T4A(a,s,g),o.push(t);i=Br(),i.prec=n,o.push(i),e.push(Mi),t=wT(),o.push(t)}for(I=o.length-1,t=o[I],e.pop();I>1;)e.pop(),t=T4A(o[I-1].value,o[I-2],t),I-=2;return t}function Nb(){var A,e,t;return A=sct(),wn("?")&&(Br(),e=Nb(),Ka(":"),t=Nb(),A=_lt(A,e,t)),A}function wlA(){const A=Nb();if(wn(","))throw new Error(eL);return A}function DlA(A){ue=A,kA=0,Wa=ue.length,Mi=null,z4A();const e=wlA();if(Mi.type!==$v)throw new Error("Unexpect token after expression.");return e}var $4A={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function AOA(A){function e(g,a,s,I){let r=A(a[0]);return s&&(r=s+"("+r+")",s.lastIndexOf("new ",0)===0&&(r="("+r+")")),r+"."+g+(I<0?"":I===0?"()":"("+a.slice(1).map(A).join(",")+")")}function t(g,a,s){return I=>e(g,I,a,s)}const i="new Date",n="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(g){g.length<3&&YA("Missing arguments to clamp function."),g.length>3&&YA("Too many arguments to clamp function.");const a=g.map(A);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:t("getDate",i,0),day:t("getDay",i,0),year:t("getFullYear",i,0),month:t("getMonth",i,0),hours:t("getHours",i,0),minutes:t("getMinutes",i,0),seconds:t("getSeconds",i,0),milliseconds:t("getMilliseconds",i,0),time:t("getTime",i,0),timezoneoffset:t("getTimezoneOffset",i,0),utcdate:t("getUTCDate",i,0),utcday:t("getUTCDay",i,0),utcyear:t("getUTCFullYear",i,0),utcmonth:t("getUTCMonth",i,0),utchours:t("getUTCHours",i,0),utcminutes:t("getUTCMinutes",i,0),utcseconds:t("getUTCSeconds",i,0),utcmilliseconds:t("getUTCMilliseconds",i,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",n,0),lower:t("toLowerCase",n,0),substring:t("substring",n),split:t("split",n),trim:t("trim",n,0),regexp:o,test:t("test",o),if:function(g){g.length<3&&YA("Missing arguments to if function."),g.length>3&&YA("Too many arguments to if function.");const a=g.map(A);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function rct(A){const e=A&&A.length-1;return e&&(A[0]==='"'&&A[e]==='"'||A[0]==="'"&&A[e]==="'")?A.slice(1,-1):A}function eOA(A){A=A||{};const e=A.allowed?fc(A.allowed):{},t=A.forbidden?fc(A.forbidden):{},i=A.constants||$4A,n=(A.functions||AOA)(C),o=A.globalvar,g=A.fieldvar,a=Ct(o)?o:B=>`${o}["${B}"]`;let s={},I={},r=0;function C(B){if(ie(B))return B;const E=l[B.type];return E==null&&YA("Unsupported type: "+B.type),E(B)}const l={Literal:B=>B.raw,Identifier:B=>{const E=B.name;return r>0?E:Je(t,E)?YA("Illegal identifier: "+E):Je(i,E)?i[E]:Je(e,E)?E:(s[E]=1,a(E))},MemberExpression:B=>{const E=!B.computed,u=C(B.object);E&&(r+=1);const d=C(B.property);return u===g&&(I[rct(d)]=1),E&&(r-=1),u+(E?"."+d:"["+d+"]")},CallExpression:B=>{B.callee.type!=="Identifier"&&YA("Illegal callee type: "+B.callee.type);const E=B.callee.name,u=B.arguments,d=Je(n,E)&&n[E];return d||YA("Unrecognized function: "+E),Ct(d)?d(u):d+"("+u.map(C).join(",")+")"},ArrayExpression:B=>"["+B.elements.map(C).join(",")+"]",BinaryExpression:B=>"("+C(B.left)+" "+B.operator+" "+C(B.right)+")",UnaryExpression:B=>"("+B.operator+C(B.argument)+")",ConditionalExpression:B=>"("+C(B.test)+"?"+C(B.consequent)+":"+C(B.alternate)+")",LogicalExpression:B=>"("+C(B.left)+B.operator+C(B.right)+")",ObjectExpression:B=>"{"+B.properties.map(C).join(",")+"}",Property:B=>{r+=1;const E=C(B.key);return r-=1,E+":"+C(B.value)}};function c(B){const E={code:C(B),globals:Object.keys(s),fields:Object.keys(I)};return s={},I={},E}return c.functions=n,c.constants=i,c}const tOA=Symbol("vega_selection_getter");function iOA(A){return(!A.getter||!A.getter[tOA])&&(A.getter=Al(A.field),A.getter[tOA]=!0),A.getter}const GlA="intersect",nOA="union",Ict="vlMulti",Cct="vlPoint",oOA="or",lct="and",RQ="_vgsid_",gL=Al(RQ),cct="E",Bct="R",Qct="R-E",Ect="R-LE",uct="R-RE",DT="index:unit";function gOA(A,e){for(var t=e.fields,i=e.values,n=t.length,o=0,g,a;o<n;++o)if(a=t[o],g=iOA(a)(A),rp(g)&&(g=Na(g)),rp(i[o])&&(i[o]=Na(i[o])),RA(i[o])&&rp(i[o][0])&&(i[o]=i[o].map(Na)),a.type===cct){if(RA(i[o])?i[o].indexOf(g)<0:g!==i[o])return!1}else if(a.type===Bct){if(!dJ(g,i[o]))return!1}else if(a.type===uct){if(!dJ(g,i[o],!0,!1))return!1}else if(a.type===Qct){if(!dJ(g,i[o],!1,!1))return!1}else if(a.type===Ect&&!dJ(g,i[o],!1,!0))return!1;return!0}function dct(A,e,t){for(var i=this.context.data[A],n=i?i.values.value:[],o=i?i[DT]&&i[DT].value:void 0,g=t===GlA,a=n.length,s=0,I,r,C,l,c;s<a;++s)if(I=n[s],o&&g){if(r=r||{},C=r[l=I.unit]||0,C===-1)continue;if(c=gOA(e,I),r[l]=c?-1:++C,c&&o.size===1)return!0;if(!c&&C===o.get(l).count)return!1}else if(c=gOA(e,I),g^c)return c;return a&&g}const aOA=Vy(gL),hct=aOA.left,mct=aOA.right;function pct(A,e,t){const i=this.context.data[A],n=i?i.values.value:[],o=i?i[DT]&&i[DT].value:void 0,g=t===GlA,a=gL(e),s=hct(n,a);if(s===n.length||gL(n[s])!==a)return!1;if(o&&g){if(o.size===1)return!0;if(mct(n,a)-s<o.size)return!1}return!0}function fct(A,e){return A.map(t=>lt(e.fields?{values:e.fields.map(i=>iOA(i)(t.datum))}:{[RQ]:gL(t.datum)},e))}function yct(A,e,t,i){for(var n=this.context.data[A],o=n?n.values.value:[],g={},a={},s={},I,r,C,l,c,B,E,u,d,f,w=o.length,y=0,G,R;y<w;++y)if(I=o[y],l=I.unit,r=I.fields,C=I.values,r&&C){for(G=0,R=r.length;G<R;++G)c=r[G],E=g[c.field]||(g[c.field]={}),u=E[l]||(E[l]=[]),s[c.field]=d=c.type.charAt(0),f=klA[`${d}_union`],E[l]=f(u,te(C[G]));t&&(u=a[l]||(a[l]=[]),u.push(te(C).reduce((x,F,Q)=>(x[r[Q].field]=F,x),{})))}else c=RQ,B=gL(I),E=g[c]||(g[c]={}),u=E[l]||(E[l]=[]),u.push(B),t&&(u=a[l]||(a[l]=[]),u.push({[RQ]:B}));if(e=e||nOA,g[RQ]?g[RQ]=klA[`${RQ}_${e}`](...Object.values(g[RQ])):Object.keys(g).forEach(x=>{g[x]=Object.keys(g[x]).map(F=>g[x][F]).reduce((F,Q)=>F===void 0?Q:klA[`${s[x]}_${e}`](F,Q))}),o=Object.keys(a),t&&o.length){const x=i?Cct:Ict;g[x]=e===nOA?{[oOA]:o.reduce((F,Q)=>(F.push(...a[Q]),F),[])}:{[lct]:o.map(F=>({[oOA]:a[F]}))}}return g}var klA={[`${RQ}_union`]:ePe,[`${RQ}_intersect`]:$8e,E_union:function(A,e){if(!A.length)return e;for(var t=0,i=e.length;t<i;++t)A.indexOf(e[t])<0&&A.push(e[t]);return A},E_intersect:function(A,e){return A.length?A.filter(t=>e.indexOf(t)>=0):e},R_union:function(A,e){var t=Na(e[0]),i=Na(e[1]);return t>i&&(t=e[1],i=e[0]),A.length?(A[0]>t&&(A[0]=t),A[1]<i&&(A[1]=i),A):[t,i]},R_intersect:function(A,e){var t=Na(e[0]),i=Na(e[1]);return t>i&&(t=e[1],i=e[0]),A.length?i<A[0]||A[1]<t?[]:(A[0]<t&&(A[0]=t),A[1]>i&&(A[1]=i),A):[t,i]}};const bct=":",wct="@";function JlA(A,e,t,i){e[0].type!==Gb&&YA("First argument to selection functions must be a string literal.");const n=e[0].value,o=e.length>=2&&Ut(e).value,g="unit",a=wct+g,s=bct+n;o===GlA&&!Je(i,a)&&(i[a]=t.getData(n).indataRef(t,g)),Je(i,s)||(i[s]=t.getData(n).tuplesRef())}function sOA(A){const e=this.context.data[A];return e?e.values.value:[]}function Dct(A,e,t){const i=this.context.data[A]["index:"+e],n=i?i.value.get(t):void 0;return n&&n.count}function Gct(A,e){const t=this.context.dataflow,i=this.context.data[A],n=i.input;return t.pulse(n,t.changeset().remove(el).insert(e)),1}function kct(A,e,t){if(A){const i=this.context.dataflow,n=A.mark.source;i.pulse(n,i.changeset().encode(A,e))}return t!==void 0?t:A}const aL=A=>function(e,t){return this.context.dataflow.locale()[A](t)(e)},Jct=aL("format"),rOA=aL("timeFormat"),Nct=aL("utcFormat"),Yct=aL("timeParse"),Rct=aL("utcParse"),GT=new Date(2e3,0,1);function kT(A,e,t){return!Number.isInteger(A)||!Number.isInteger(e)?"":(GT.setYear(2e3),GT.setMonth(A),GT.setDate(e),rOA.call(this,GT,t))}function xct(A){return kT.call(this,A,1,"%B")}function Fct(A){return kT.call(this,A,1,"%b")}function Mct(A){return kT.call(this,0,2+A,"%A")}function vct(A){return kT.call(this,0,2+A,"%a")}const Lct=":",Sct="@",NlA="%",IOA="$";function YlA(A,e,t,i){e[0].type!==Gb&&YA("First argument to data functions must be a string literal.");const n=e[0].value,o=Lct+n;if(!Je(o,i))try{i[o]=t.getData(n).tuplesRef()}catch{}}function Hct(A,e,t,i){e[0].type!==Gb&&YA("First argument to indata must be a string literal."),e[1].type!==Gb&&YA("Second argument to indata must be a string literal.");const n=e[0].value,o=e[1].value,g=Sct+o;Je(g,i)||(i[g]=t.getData(n).indataRef(t,o))}function ms(A,e,t,i){if(e[0].type===Gb)COA(t,i,e[0].value);else for(A in t.scales)COA(t,i,A)}function COA(A,e,t){const i=NlA+t;if(!Je(e,i))try{e[i]=A.scaleRef(t)}catch{}}function xQ(A,e){if(Ct(A))return A;if(ie(A)){const t=e.scales[A];return t&&ztt(t.value)?t.value:void 0}}function Zct(A,e,t){e.__bandwidth=n=>n&&n.bandwidth?n.bandwidth():0,t._bandwidth=ms,t._range=ms,t._scale=ms;const i=n=>"_["+(n.type===Gb?OA(NlA+n.value):OA(NlA)+"+"+A(n))+"]";return{_bandwidth:n=>`this.__bandwidth(${i(n[0])})`,_range:n=>`${i(n[0])}.range()`,_scale:n=>`${i(n[0])}(${A(n[1])})`}}function RlA(A,e){return function(t,i,n){if(t){const o=xQ(t,(n||this).context);return o&&o.path[A](i)}else return e(i)}}const Wct=RlA("area",Iat),Kct=RlA("bounds",Bat),Uct=RlA("centroid",mat);function Vct(A,e){const t=xQ(A,(e||this).context);return t&&t.scale()}function Xct(A){const e=this.context.group;let t=!1;if(e)for(;A;){if(A===e){t=!0;break}A=A.mark.group}return t}function xlA(A,e,t){try{A[e].apply(A,["EXPRESSION"].concat([].slice.call(t)))}catch(i){A.warn(i)}return t[t.length-1]}function zct(){return xlA(this.context.dataflow,"warn",arguments)}function Tct(){return xlA(this.context.dataflow,"info",arguments)}function _ct(){return xlA(this.context.dataflow,"debug",arguments)}function FlA(A){const e=A/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function MlA(A){const e=OC(A),t=FlA(e.r),i=FlA(e.g),n=FlA(e.b);return .2126*t+.7152*i+.0722*n}function Oct(A,e){const t=MlA(A),i=MlA(e),n=Math.max(t,i),o=Math.min(t,i);return(n+.05)/(o+.05)}function qct(){const A=[].slice.call(arguments);return A.unshift({}),lt(...A)}function lOA(A,e){return A===e||A!==A&&e!==e?!0:RA(A)?RA(e)&&A.length===e.length?jct(A,e):!1:oe(A)&&oe(e)?cOA(A,e):!1}function jct(A,e){for(let t=0,i=A.length;t<i;++t)if(!lOA(A[t],e[t]))return!1;return!0}function cOA(A,e){for(const t in A)if(!lOA(A[t],e[t]))return!1;return!0}function BOA(A){return e=>cOA(A,e)}function Pct(A,e,t,i,n,o){const g=this.context.dataflow,a=this.context.data[A],s=a.input,I=g.stamp();let r=a.changes,C,l;if(g._trigger===!1||!(s.value.length||e||i))return 0;if((!r||r.stamp<I)&&(a.changes=r=g.changeset(),r.stamp=I,g.runAfter(()=>{a.modified=!0,g.pulse(s,r).run()},!0,1)),t&&(C=t===!0?el:RA(t)||g5(t)?t:BOA(t),r.remove(C)),e&&r.insert(e),i&&(C=BOA(i),s.value.some(C)?r.remove(C):r.insert(i)),n)for(l in o)r.modify(n,l,o[l]);return 1}function $ct(A){const e=A.touches,t=e[0].clientX-e[1].clientX,i=e[0].clientY-e[1].clientY;return Math.hypot(t,i)}function ABt(A){const e=A.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)}const QOA={};function eBt(A,e){const t=QOA[e]||(QOA[e]=Al(e));return RA(A)?A.map(t):t(A)}function vlA(A){return RA(A)||ArrayBuffer.isView(A)?A:null}function LlA(A){return vlA(A)||(ie(A)?A:null)}function tBt(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return vlA(A).join(...t)}function iBt(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return LlA(A).indexOf(...t)}function nBt(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return LlA(A).lastIndexOf(...t)}function oBt(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return LlA(A).slice(...t)}function gBt(A,e,t){return Ct(t)&&YA("Function argument passed to replace."),String(A).replace(e,t)}function aBt(A){return vlA(A).slice().reverse()}function sBt(A,e,t){return srA(A||0,e||0,t||0)}function rBt(A,e){const t=xQ(A,(e||this).context);return t&&t.bandwidth?t.bandwidth():0}function IBt(A,e){const t=xQ(A,(e||this).context);return t?t.copy():void 0}function CBt(A,e){const t=xQ(A,(e||this).context);return t?t.domain():[]}function lBt(A,e,t){const i=xQ(A,(t||this).context);return i?RA(e)?(i.invertRange||i.invert)(e):(i.invert||i.invertExtent)(e):void 0}function cBt(A,e){const t=xQ(A,(e||this).context);return t&&t.range?t.range():[]}function BBt(A,e,t){const i=xQ(A,(t||this).context);return i?i(e):void 0}function QBt(A,e,t,i,n){A=xQ(A,(n||this).context);const o=c5A(e,t);let g=A.domain(),a=g[0],s=Ut(g),I=Ja;return s-a?I=P9A(A,a,s):A=(A.interpolator?Ci("sequential")().interpolator(A.interpolator()):Ci("linear")().interpolate(A.interpolate()).range(A.range())).domain([a=0,s=1]),A.ticks&&(g=A.ticks(+i||15),a!==g[0]&&g.unshift(a),s!==Ut(g)&&g.push(s)),g.forEach(r=>o.stop(I(r),A(r))),o}function EBt(A,e,t){const i=xQ(A,(t||this).context);return function(n){return i?i.path.context(n)(e):""}}function uBt(A){let e=null;return function(t){return t?gv(t,e=e||xJ(A)):A}}const EOA=A=>A.data;function uOA(A,e){const t=sOA.call(e,A);return t.root&&t.root.lookup||{}}function dBt(A,e,t){const i=uOA(A,this),n=i[e],o=i[t];return n&&o?n.path(o).map(EOA):void 0}function hBt(A,e){const t=uOA(A,this)[e];return t?t.ancestors().map(EOA):void 0}const dOA=()=>typeof window<"u"&&window||null;function mBt(){const A=dOA();return A?A.screen:{}}function pBt(){const A=dOA();return A?[A.innerWidth,A.innerHeight]:[void 0,void 0]}function fBt(){const A=this.context.dataflow,e=A.container&&A.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]}function hOA(A,e,t){if(!A)return[];const[i,n]=A,o=new vo().set(i[0],i[1],n[0],n[1]),g=t||this.context.dataflow.scenegraph().root;return kzA(g,o,yBt(e))}function yBt(A){let e=null;if(A){const t=te(A.marktype),i=te(A.markname);e=n=>(!t.length||t.some(o=>n.marktype===o))&&(!i.length||i.some(o=>n.name===o))}return e}function bBt(A,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;A=te(A);const n=A[A.length-1];return n===void 0||Math.hypot(n[0]-e,n[1]-t)>i?[...A,[e,t]]:A}function wBt(A){return te(A).reduce((e,t,i)=>{let[n,o]=t;return e+=i==0?`M ${n},${o} `:i===A.length-1?" Z":`L ${n},${o} `},"")}function DBt(A,e,t){const{x:i,y:n,mark:o}=t,g=new vo().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[a,s]of e)a<g.x1&&(g.x1=a),a>g.x2&&(g.x2=a),s<g.y1&&(g.y1=s),s>g.y2&&(g.y2=s);return g.translate(i,n),hOA([[g.x1,g.y1],[g.x2,g.y2]],A,o).filter(a=>GBt(a.x,a.y,e))}function GBt(A,e,t){let i=0;for(let n=0,o=t.length-1;n<t.length;o=n++){const[g,a]=t[o],[s,I]=t[n];I>e!=a>e&&A<(g-s)*(e-I)/(a-I)+s&&i++}return i&1}const sL={random(){return il()},cumulativeNormal:B5,cumulativeLogNormal:EsA,cumulativeUniform:msA,densityNormal:CsA,densityLogNormal:QsA,densityUniform:hsA,quantileNormal:Q5,quantileLogNormal:usA,quantileUniform:psA,sampleNormal:c5,sampleLogNormal:BsA,sampleUniform:dsA,isArray:RA,isBoolean:sp,isDate:rp,isDefined(A){return A!==void 0},isNumber:ti,isObject:oe,isRegExp:VUA,isString:ie,isTuple:g5,isValid(A){return A!=null&&A===A},toBoolean:MaA,toDate(A){return vaA(A)},toNumber:Na,toString:LaA,indexof:iBt,join:tBt,lastindexof:nBt,replace:gBt,reverse:aBt,slice:oBt,flush:KUA,lerp:XUA,merge:qct,pad:_UA,peek:Ut,pluck:eBt,span:FM,inrange:dJ,truncate:OUA,rgb:OC,lab:G9,hcl:k9,hsl:b9,luminance:MlA,contrast:Oct,sequence:Ga,format:Jct,utcFormat:Nct,utcParse:Rct,utcOffset:CVA,utcSequence:BVA,timeFormat:rOA,timeParse:Yct,timeOffset:IVA,timeSequence:cVA,timeUnitSpecifier:$UA,monthFormat:xct,monthAbbrevFormat:Fct,dayFormat:Mct,dayAbbrevFormat:vct,quarter:SUA,utcquarter:HUA,week:eVA,utcweek:nVA,dayofyear:AVA,utcdayofyear:iVA,warn:zct,info:Tct,debug:_ct,extent(A){return mQ(A)},inScope:Xct,intersect:hOA,clampRange:ZUA,pinchDistance:$ct,pinchAngle:ABt,screen:mBt,containerSize:fBt,windowSize:pBt,bandspace:sBt,setdata:Gct,pathShape:uBt,panLinear:FUA,panLog:MUA,panPow:vUA,panSymlog:LUA,zoomLinear:JaA,zoomLog:NaA,zoomPow:q9,zoomSymlog:YaA,encode:kct,modify:Pct,lassoAppend:bBt,lassoPath:wBt,intersectLasso:DBt},kBt=["view","item","group","xy","x","y"],JBt="event.vega.",mOA="this.",SlA={},pOA={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:A=>`_[${OA(IOA+A)}]`,functions:NBt,constants:$4A,visitors:SlA},HlA=eOA(pOA);function NBt(A){const e=AOA(A);kBt.forEach(t=>e[t]=JBt+t);for(const t in sL)e[t]=mOA+t;return lt(e,Zct(A,sL,SlA)),e}function lo(A,e,t){return arguments.length===1?sL[A]:(sL[A]=e,t&&(SlA[A]=t),HlA&&(HlA.functions[A]=mOA+A),this)}lo("bandwidth",rBt,ms),lo("copy",IBt,ms),lo("domain",CBt,ms),lo("range",cBt,ms),lo("invert",lBt,ms),lo("scale",BBt,ms),lo("gradient",QBt,ms),lo("geoArea",Wct,ms),lo("geoBounds",Kct,ms),lo("geoCentroid",Uct,ms),lo("geoShape",EBt,ms),lo("geoScale",Vct,ms),lo("indata",Dct,Hct),lo("data",sOA,YlA),lo("treePath",dBt,YlA),lo("treeAncestors",hBt,YlA),lo("vlSelectionTest",dct,JlA),lo("vlSelectionIdTest",pct,JlA),lo("vlSelectionResolve",yct,JlA),lo("vlSelectionTuples",fct);function FQ(A,e){const t={};let i;try{A=ie(A)?A:OA(A)+"",i=DlA(A)}catch{YA("Expression parse error: "+A)}i.visit(o=>{if(o.type!==H4A)return;const g=o.callee.name,a=pOA.visitors[g];a&&a(g,o.arguments,e,t)});const n=HlA(i);return n.globals.forEach(o=>{const g=IOA+o;!Je(t,g)&&e.getSignal(o)&&(t[g]=e.signalRef(o))}),{$expr:lt({code:n.code},e.options.ast?{ast:i}:null),$fields:n.fields,$params:t}}function YBt(A){const e=this,t=A.operators||[];return A.background&&(e.background=A.background),A.eventConfig&&(e.eventConfig=A.eventConfig),A.locale&&(e.locale=A.locale),t.forEach(i=>e.parseOperator(i)),t.forEach(i=>e.parseOperatorParameters(i)),(A.streams||[]).forEach(i=>e.parseStream(i)),(A.updates||[]).forEach(i=>e.parseUpdate(i)),e.resolve()}const RBt=fc(["rule"]),fOA=fc(["group","image","rect"]);function xBt(A,e){let t="";return RBt[e]||(A.x2&&(A.x?(fOA[e]&&(t+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),t+="o.width=o.x2-o.x;"):t+="o.x=o.x2-(o.width||0);"),A.xc&&(t+="o.x=o.xc-(o.width||0)/2;"),A.y2&&(A.y?(fOA[e]&&(t+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),t+="o.height=o.y2-o.y;"):t+="o.y=o.y2-(o.height||0);"),A.yc&&(t+="o.y=o.yc-(o.height||0)/2;")),t}function ZlA(A){return(A+"").toLowerCase()}function FBt(A){return ZlA(A)==="operator"}function MBt(A){return ZlA(A)==="collect"}function rL(A,e,t){t.endsWith(";")||(t="return("+t+");");const i=Function(...e.concat(t));return A&&A.functions?i.bind(A.functions):i}function vBt(A,e,t,i){return`((u = ${A}) < (v = ${e}) || u == null) && v != null ? ${t}
  : (u > v || v == null) && u != null ? ${i}
  : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${t}
  : v !== v && u === u ? ${i} : `}var LBt={operator:(A,e)=>rL(A,["_"],e.code),parameter:(A,e)=>rL(A,["datum","_"],e.code),event:(A,e)=>rL(A,["event"],e.code),handler:(A,e)=>{const t=`var datum=event.item&&event.item.datum;return ${e.code};`;return rL(A,["_","event"],t)},encode:(A,e)=>{const{marktype:t,channels:i}=e;let n="var o=item,datum=o.datum,m=0,$;";for(const o in i){const g="o["+OA(o)+"]";n+=`$=${i[o].code};if(${g}!==$)${g}=$,m=1;`}return n+=xBt(i,t),n+="return m;",rL(A,["item","_"],n)},codegen:{get(A){const e=`[${A.map(OA).join("][")}]`,t=Function("_",`return _${e};`);return t.path=e,t},comparator(A,e){let t;const i=(o,g)=>{const a=e[g];let s,I;return o.path?(s=`a${o.path}`,I=`b${o.path}`):((t=t||{})["f"+g]=o,s=`this.f${g}(a)`,I=`this.f${g}(b)`),vBt(s,I,-a,a)},n=Function("a","b","var u, v; return "+A.map(i).join("")+"0;");return t?n.bind(t):n}}};function SBt(A){const e=this;FBt(A.type)||!A.type?e.operator(A,A.update?e.operatorExpression(A.update):null):e.transform(A,A.type)}function HBt(A){const e=this;if(A.params){const t=e.get(A.id);t||YA("Invalid operator id: "+A.id),e.dataflow.connect(t,t.parameters(e.parseParameters(A.params),A.react,A.initonly))}}function ZBt(A,e){e=e||{};const t=this;for(const i in A){const n=A[i];e[i]=RA(n)?n.map(o=>yOA(o,t,e)):yOA(n,t,e)}return e}function yOA(A,e,t){if(!A||!oe(A))return A;for(let i=0,n=bOA.length,o;i<n;++i)if(o=bOA[i],Je(A,o.key))return o.parse(A,e,t);return A}var bOA=[{key:"$ref",parse:WBt},{key:"$key",parse:UBt},{key:"$expr",parse:KBt},{key:"$field",parse:VBt},{key:"$encode",parse:zBt},{key:"$compare",parse:XBt},{key:"$context",parse:TBt},{key:"$subflow",parse:_Bt},{key:"$tupleid",parse:OBt}];function WBt(A,e){return e.get(A.$ref)||YA("Operator not defined: "+A.$ref)}function KBt(A,e,t){A.$params&&e.parseParameters(A.$params,t);const i="e:"+A.$expr.code;return e.fn[i]||(e.fn[i]=gr(e.parameterExpression(A.$expr),A.$fields))}function UBt(A,e){const t="k:"+A.$key+"_"+!!A.$flat;return e.fn[t]||(e.fn[t]=FaA(A.$key,A.$flat,e.expr.codegen))}function VBt(A,e){if(!A.$field)return null;const t="f:"+A.$field+"_"+A.$name;return e.fn[t]||(e.fn[t]=Al(A.$field,A.$name,e.expr.codegen))}function XBt(A,e){const t="c:"+A.$compare+"_"+A.$order,i=te(A.$compare).map(n=>n&&n.$tupleid?Ne:n);return e.fn[t]||(e.fn[t]=RaA(i,A.$order,e.expr.codegen))}function zBt(A,e){const t=A.$encode,i={};for(const n in t){const o=t[n];i[n]=gr(e.encodeExpression(o.$expr),o.$fields),i[n].output=o.$output}return i}function TBt(A,e){return e}function _Bt(A,e){const t=A.$subflow;return function(i,n,o){const g=e.fork().parse(t),a=g.get(t.operators[0].id),s=g.signals.parent;return s&&s.set(o),a.detachSubflow=()=>e.detach(g),a}}function OBt(){return Ne}function qBt(A){var e=this,t=A.filter!=null?e.eventExpression(A.filter):void 0,i=A.stream!=null?e.get(A.stream):void 0,n;A.source?i=e.events(A.source,A.type,t):A.merge&&(n=A.merge.map(o=>e.get(o)),i=n[0].merge.apply(n[0],n.slice(1))),A.between&&(n=A.between.map(o=>e.get(o)),i=i.between(n[0],n[1])),A.filter&&(i=i.filter(t)),A.throttle!=null&&(i=i.throttle(+A.throttle)),A.debounce!=null&&(i=i.debounce(+A.debounce)),i==null&&YA("Invalid stream definition: "+JSON.stringify(A)),A.consume&&i.consume(!0),e.stream(A,i)}function jBt(A){var e=this,t=oe(t=A.source)?t.$ref:t,i=e.get(t),n=null,o=A.update,g=void 0;i||YA("Source not defined: "+A.source),n=A.target&&A.target.$expr?e.eventExpression(A.target.$expr):e.get(A.target),o&&o.$expr&&(o.$params&&(g=e.parseParameters(o.$params)),o=e.handlerExpression(o.$expr)),e.update(A,i,n,o,g)}const PBt={skip:!0};function $Bt(A){var e=this,t={};if(A.signals){var i=t.signals={};Object.keys(e.signals).forEach(o=>{const g=e.signals[o];A.signals(o,g)&&(i[o]=g.value)})}if(A.data){var n=t.data={};Object.keys(e.data).forEach(o=>{const g=e.data[o];A.data(o,g)&&(n[o]=g.input.value)})}return e.subcontext&&A.recurse!==!1&&(t.subcontext=e.subcontext.map(o=>o.getState(A))),t}function AQt(A){var e=this,t=e.dataflow,i=A.data,n=A.signals;Object.keys(n||{}).forEach(o=>{t.update(e.signals[o],n[o],PBt)}),Object.keys(i||{}).forEach(o=>{t.pulse(e.data[o].input,t.changeset().remove(el).insert(i[o]))}),(A.subcontext||[]).forEach((o,g)=>{const a=e.subcontext[g];a&&a.setState(o)})}function wOA(A,e,t,i){return new DOA(A,e,t,i)}function DOA(A,e,t,i){this.dataflow=A,this.transforms=e,this.events=A.events.bind(A),this.expr=i||LBt,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},t&&(this.functions=Object.create(t),this.functions.context=this)}function GOA(A){this.dataflow=A.dataflow,this.transforms=A.transforms,this.events=A.events,this.expr=A.expr,this.signals=Object.create(A.signals),this.scales=Object.create(A.scales),this.nodes=Object.create(A.nodes),this.data=Object.create(A.data),this.fn=Object.create(A.fn),A.functions&&(this.functions=Object.create(A.functions),this.functions.context=this)}DOA.prototype=GOA.prototype={fork(){const A=new GOA(this);return(this.subcontext||(this.subcontext=[])).push(A),A},detach(A){this.subcontext=this.subcontext.filter(t=>t!==A);const e=Object.keys(A.nodes);for(const t of e)A.nodes[t]._targets=null;for(const t of e)A.nodes[t].detach();A.nodes=null},get(A){return this.nodes[A]},set(A,e){return this.nodes[A]=e},add(A,e){const t=this,i=t.dataflow,n=A.value;if(t.set(A.id,e),MBt(A.type)&&n&&(n.$ingest?i.ingest(e,n.$ingest,n.$format):n.$request?i.preload(e,n.$request,n.$format):i.pulse(e,i.changeset().insert(n))),A.root&&(t.root=e),A.parent){let o=t.get(A.parent.$ref);o?(i.connect(o,[e]),e.targets().add(o)):(t.unresolved=t.unresolved||[]).push(()=>{o=t.get(A.parent.$ref),i.connect(o,[e]),e.targets().add(o)})}if(A.signal&&(t.signals[A.signal]=e),A.scale&&(t.scales[A.scale]=e),A.data)for(const o in A.data){const g=t.data[o]||(t.data[o]={});A.data[o].forEach(a=>g[a]=e)}},resolve(){return(this.unresolved||[]).forEach(A=>A()),delete this.unresolved,this},operator(A,e){this.add(A,this.dataflow.add(A.value,e))},transform(A,e){this.add(A,this.dataflow.add(this.transforms[ZlA(e)]))},stream(A,e){this.set(A.id,e)},update(A,e,t,i,n){this.dataflow.on(e,t,i,n,A.options)},operatorExpression(A){return this.expr.operator(this,A)},parameterExpression(A){return this.expr.parameter(this,A)},eventExpression(A){return this.expr.event(this,A)},handlerExpression(A){return this.expr.handler(this,A)},encodeExpression(A){return this.expr.encode(this,A)},parse:YBt,parseOperator:SBt,parseOperatorParameters:HBt,parseParameters:ZBt,parseStream:qBt,parseUpdate:jBt,getState:$Bt,setState:AQt};function eQt(A){const e=A.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),kOA(e,A.description()))}function kOA(A,e){A&&(e==null?A.removeAttribute("aria-label"):A.setAttribute("aria-label",e))}function tQt(A){A.add(null,e=>(A._background=e.bg,A._resize=1,e.bg),{bg:A._signals.background})}const WlA="default";function iQt(A){const e=A._signals.cursor||(A._signals.cursor=A.add({user:WlA,item:null}));A.on(A.events("view","mousemove"),e,(t,i)=>{const n=e.value,o=n?ie(n)?n:n.user:WlA,g=i.item&&i.item.cursor||null;return n&&o===n.user&&g==n.item?n:{user:o,item:g}}),A.add(null,function(t){let i=t.cursor,n=this.value;return ie(i)||(n=i.item,i=i.user),KlA(A,i&&i!==WlA?i:n||i),n},{cursor:e})}function KlA(A,e){const t=A.globalCursor()?typeof document<"u"&&document.body:A.container();if(t)return e==null?t.style.removeProperty("cursor"):t.style.cursor=e}function JT(A,e){var t=A._runtime.data;return Je(t,e)||YA("Unrecognized data set: "+e),t[e]}function nQt(A,e){return arguments.length<2?JT(this,A).values.value:NT.call(this,A,sb().remove(el).insert(e))}function NT(A,e){HVA(e)||YA("Second argument to changes must be a changeset.");const t=JT(this,A);return t.modified=!0,this.pulse(t.input,e)}function oQt(A,e){return NT.call(this,A,sb().insert(e))}function gQt(A,e){return NT.call(this,A,sb().remove(e))}function JOA(A){var e=A.padding();return Math.max(0,A._viewWidth+e.left+e.right)}function NOA(A){var e=A.padding();return Math.max(0,A._viewHeight+e.top+e.bottom)}function RT(A){var e=A.padding(),t=A._origin;return[e.left+t[0],e.top+t[1]]}function aQt(A){var e=RT(A),t=JOA(A),i=NOA(A);A._renderer.background(A.background()),A._renderer.resize(t,i,e),A._handler.origin(e),A._resizeListeners.forEach(n=>{try{n(t,i)}catch(o){A.error(o)}})}function sQt(A,e,t){var i=A._renderer,n=i&&i.canvas(),o,g,a;return n&&(a=RT(A),g=e.changedTouches?e.changedTouches[0]:e,o=iz(g,n),o[0]-=a[0],o[1]-=a[1]),e.dataflow=A,e.item=t,e.vega=rQt(A,t,o),e}function rQt(A,e,t){const i=e?e.mark.marktype==="group"?e:e.mark.group:null;function n(g){var a=i,s;if(g){for(s=e;s;s=s.mark.group)if(s.mark.name===g){a=s;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(g){if(!g)return t;ie(g)&&(g=n(g));const a=t.slice();for(;g;)a[0]-=g.x||0,a[1]-=g.y||0,g=g.mark&&g.mark.group;return a}return{view:Ya(A),item:Ya(e||{}),group:n,xy:o,x:g=>o(g)[0],y:g=>o(g)[1]}}const YOA="view",IQt="timer",CQt="window",lQt={trap:!1};function cQt(A){const e=lt({defaults:{}},A),t=(i,n)=>{n.forEach(o=>{RA(i[o])&&(i[o]=fc(i[o]))})};return t(e.defaults,["prevent","allow"]),t(e,["view","window","selector"]),e}function ROA(A,e,t,i){A._eventListeners.push({type:t,sources:te(e),handler:i})}function BQt(A,e){var t=A._eventConfig.defaults,i=t.prevent,n=t.allow;return i===!1||n===!0?!1:i===!0||n===!1?!0:i?i[e]:n?!n[e]:A.preventDefault()}function xT(A,e,t){const i=A._eventConfig&&A._eventConfig[e];return i===!1||oe(i)&&!i[t]?(A.warn(`Blocked ${e} ${t} event listener.`),!1):!0}function QQt(A,e,t){var i=this,n=new I5(t),o=function(I,r){i.runAsync(null,()=>{A===YOA&&BQt(i,e)&&I.preventDefault(),n.receive(sQt(i,I,r))})},g;if(A===IQt)xT(i,"timer",e)&&i.timer(o,e);else if(A===YOA)xT(i,"view",e)&&i.addEventListener(e,o,lQt);else if(A===CQt?xT(i,"window",e)&&typeof window<"u"&&(g=[window]):typeof document<"u"&&xT(i,"selector",e)&&(g=Array.from(document.querySelectorAll(A))),!g)i.warn("Can not resolve event source: "+A);else{for(var a=0,s=g.length;a<s;++a)g[a].addEventListener(e,o);ROA(i,g,e,o)}return n}function xOA(A){return A.item}function FOA(A){return A.item.mark.source}function MOA(A){return function(e,t){return t.vega.view().changeset().encode(t.item,A)}}function EQt(A,e){return A=[A||"hover"],e=[e||"update",A[0]],this.on(this.events("view","mouseover",xOA),FOA,MOA(A)),this.on(this.events("view","mouseout",xOA),FOA,MOA(e)),this}function uQt(){var A=this._tooltip,e=this._timers,t=this._eventListeners,i,n,o;for(i=e.length;--i>=0;)e[i].stop();for(i=t.length;--i>=0;)for(o=t[i],n=o.sources.length;--n>=0;)o.sources[n].removeEventListener(o.type,o.handler);return A&&A.call(this,this._handler,null,null,null),this}function YI(A,e,t){const i=document.createElement(A);for(const n in e)i.setAttribute(n,e[n]);return t!=null&&(i.textContent=t),i}const dQt="vega-bind",hQt="vega-bind-name",mQt="vega-bind-radio";function pQt(A,e,t){if(!e)return;const i=t.param;let n=t.state;return n||(n=t.state={elements:null,active:!1,set:null,update:o=>{o!=A.signal(i.signal)&&A.runAsync(null,()=>{n.source=!0,A.signal(i.signal,o)})}},i.debounce&&(n.update=xaA(i.debounce,n.update))),(i.input==null&&i.element?fQt:bQt)(n,e,i,A),n.active||(A.on(A._signals[i.signal],null,()=>{n.source?n.source=!1:n.set(A.signal(i.signal))}),n.active=!0),n}function fQt(A,e,t,i){const n=t.event||"input",o=()=>A.update(e.value);i.signal(t.signal,e.value),e.addEventListener(n,o),ROA(i,e,n,o),A.set=g=>{e.value=g,e.dispatchEvent(yQt(n))}}function yQt(A){return typeof Event<"u"?new Event(A):{type:A}}function bQt(A,e,t,i){const n=i.signal(t.signal),o=YI("div",{class:dQt}),g=t.input==="radio"?o:o.appendChild(YI("label"));g.appendChild(YI("span",{class:hQt},t.name||t.signal)),e.appendChild(o);let a=wQt;switch(t.input){case"checkbox":a=DQt;break;case"select":a=GQt;break;case"radio":a=kQt;break;case"range":a=JQt;break}a(A,g,t,n)}function wQt(A,e,t,i){const n=YI("input");for(const o in t)o!=="signal"&&o!=="element"&&n.setAttribute(o==="input"?"type":o,t[o]);n.setAttribute("name",t.signal),n.value=i,e.appendChild(n),n.addEventListener("input",()=>A.update(n.value)),A.elements=[n],A.set=o=>n.value=o}function DQt(A,e,t,i){const n={type:"checkbox",name:t.signal};i&&(n.checked=!0);const o=YI("input",n);e.appendChild(o),o.addEventListener("change",()=>A.update(o.checked)),A.elements=[o],A.set=g=>o.checked=!!g||null}function GQt(A,e,t,i){const n=YI("select",{name:t.signal}),o=t.labels||[];t.options.forEach((g,a)=>{const s={value:g};FT(g,i)&&(s.selected=!0),n.appendChild(YI("option",s,(o[a]||g)+""))}),e.appendChild(n),n.addEventListener("change",()=>{A.update(t.options[n.selectedIndex])}),A.elements=[n],A.set=g=>{for(let a=0,s=t.options.length;a<s;++a)if(FT(t.options[a],g)){n.selectedIndex=a;return}}}function kQt(A,e,t,i){const n=YI("span",{class:mQt}),o=t.labels||[];e.appendChild(n),A.elements=t.options.map((g,a)=>{const s={type:"radio",name:t.signal,value:g};FT(g,i)&&(s.checked=!0);const I=YI("input",s);I.addEventListener("change",()=>A.update(g));const r=YI("label",{},(o[a]||g)+"");return r.prepend(I),n.appendChild(r),I}),A.set=g=>{const a=A.elements,s=a.length;for(let I=0;I<s;++I)FT(a[I].value,g)&&(a[I].checked=!0)}}function JQt(A,e,t,i){i=i!==void 0?i:(+t.max+ +t.min)/2;const n=t.max!=null?t.max:Math.max(100,+i)||100,o=t.min||Math.min(0,n,+i)||0,g=t.step||jm(o,n,100),a=YI("input",{type:"range",name:t.signal,min:o,max:n,step:g});a.value=i;const s=YI("span",{},+i);e.appendChild(a),e.appendChild(s);const I=()=>{s.textContent=a.value,A.update(+a.value)};a.addEventListener("input",I),a.addEventListener("change",I),A.elements=[a],A.set=r=>{a.value=r,s.textContent=r}}function FT(A,e){return A===e||A+""==e+""}function vOA(A,e,t,i,n,o){return e=e||new i(A.loader()),e.initialize(t,JOA(A),NOA(A),RT(A),n,o).background(A.background())}function UlA(A,e){return e?function(){try{e.apply(this,arguments)}catch(t){A.error(t)}}:null}function NQt(A,e,t,i){const n=new i(A.loader(),UlA(A,A.tooltip())).scene(A.scenegraph().root).initialize(t,RT(A),A);return e&&e.handlers().forEach(o=>{n.on(o.type,o.handler)}),n}function YQt(A,e){const t=this,i=t._renderType,n=t._eventConfig.bind,o=HJ(i);A=t._el=A?VlA(t,A,!0):null,eQt(t),o||t.error("Unrecognized renderer type: "+i);const g=o.handler||sl,a=A?o.renderer:o.headless;return t._renderer=a?vOA(t,t._renderer,A,a):null,t._handler=NQt(t,t._handler,A,g),t._redraw=!0,A&&n!=="none"&&(e=e?t._elBind=VlA(t,e,!0):A.appendChild(YI("form",{class:"vega-bindings"})),t._bind.forEach(s=>{s.param.element&&n!=="container"&&(s.element=VlA(t,s.param.element,!!s.param.input))}),t._bind.forEach(s=>{pQt(t,s.element||e,s)})),t}function VlA(A,e,t){if(typeof e=="string")if(typeof document<"u"){if(e=document.querySelector(e),!e)return A.error("Signal bind element not found: "+e),null}else return A.error("DOM document instance not found."),null;if(e&&t)try{e.textContent=""}catch(i){e=null,A.error(i)}return e}const IL=A=>+A||0,RQt=A=>({top:A,bottom:A,left:A,right:A});function LOA(A){return oe(A)?{top:IL(A.top),bottom:IL(A.bottom),left:IL(A.left),right:IL(A.right)}:RQt(IL(A))}async function XlA(A,e,t,i){const n=HJ(e),o=n&&n.headless;return o||YA("Unrecognized renderer type: "+e),await A.runAsync(),vOA(A,null,null,o,t,i).renderAsync(A._scenegraph.root)}async function xQt(A,e){A!==Gp.Canvas&&A!==Gp.SVG&&A!==Gp.PNG&&YA("Unrecognized image type: "+A);const t=await XlA(this,A,e);return A===Gp.SVG?FQt(t.svg(),"image/svg+xml"):t.canvas().toDataURL("image/png")}function FQt(A,e){const t=new Blob([A],{type:e});return window.URL.createObjectURL(t)}async function MQt(A,e){return(await XlA(this,Gp.Canvas,A,e)).canvas()}async function vQt(A){return(await XlA(this,Gp.SVG,A)).svg()}function LQt(A,e,t){return wOA(A,bJ,sL,t).parse(e)}function SQt(A){var e=this._runtime.scales;return Je(e,A)||YA("Unrecognized scale or projection: "+A),e[A].value}var SOA="width",HOA="height",zlA="padding",ZOA={skip:!0};function WOA(A,e){var t=A.autosize(),i=A.padding();return e-(t&&t.contains===zlA?i.left+i.right:0)}function KOA(A,e){var t=A.autosize(),i=A.padding();return e-(t&&t.contains===zlA?i.top+i.bottom:0)}function HQt(A){var e=A._signals,t=e[SOA],i=e[HOA],n=e[zlA];function o(){A._autosize=A._resize=1}A._resizeWidth=A.add(null,a=>{A._width=a.size,A._viewWidth=WOA(A,a.size),o()},{size:t}),A._resizeHeight=A.add(null,a=>{A._height=a.size,A._viewHeight=KOA(A,a.size),o()},{size:i});const g=A.add(null,o,{pad:n});A._resizeWidth.rank=t.rank+1,A._resizeHeight.rank=i.rank+1,g.rank=n.rank+1}function ZQt(A,e,t,i,n,o){this.runAfter(g=>{let a=0;g._autosize=0,g.width()!==t&&(a=1,g.signal(SOA,t,ZOA),g._resizeWidth.skip(!0)),g.height()!==i&&(a=1,g.signal(HOA,i,ZOA),g._resizeHeight.skip(!0)),g._viewWidth!==A&&(g._resize=1,g._viewWidth=A),g._viewHeight!==e&&(g._resize=1,g._viewHeight=e),(g._origin[0]!==n[0]||g._origin[1]!==n[1])&&(g._resize=1,g._origin=n),a&&g.run("enter"),o&&g.runAfter(s=>s.resize())},!1,1)}function WQt(A){return this._runtime.getState(A||{data:KQt,signals:UQt,recurse:!0})}function KQt(A,e){return e.modified&&RA(e.input.value)&&A.indexOf("_:vega:_")}function UQt(A,e){return!(A==="parent"||e instanceof bJ.proxy)}function VQt(A){return this.runAsync(null,e=>{e._trigger=!1,e._runtime.setState(A)},e=>{e._trigger=!0}),this}function XQt(A,e){function t(i){A({timestamp:Date.now(),elapsed:i})}this._timers.push(frt(t,e))}function zQt(A,e,t,i){const n=A.element();n&&n.setAttribute("title",TQt(i))}function TQt(A){return A==null?"":RA(A)?UOA(A):oe(A)&&!rp(A)?_Qt(A):A+""}function _Qt(A){return Object.keys(A).map(e=>{const t=A[e];return e+": "+(RA(t)?UOA(t):VOA(t))}).join(`
`)}function UOA(A){return"["+A.map(VOA).join(", ")+"]"}function VOA(A){return RA(A)?"[…]":oe(A)&&!rp(A)?"{…}":A}function XOA(A,e){const t=this;if(e=e||{},yJ.call(t),e.loader&&t.loader(e.loader),e.logger&&t.logger(e.logger),e.logLevel!=null&&t.logLevel(e.logLevel),e.locale||A.locale){const o=lt({},A.locale,e.locale);t.locale(GVA(o.number,o.time))}t._el=null,t._elBind=null,t._renderType=e.renderer||Gp.Canvas,t._scenegraph=new PrA;const i=t._scenegraph.root;t._renderer=null,t._tooltip=e.tooltip||zQt,t._redraw=!0,t._handler=new sl().scene(i),t._globalCursor=!1,t._preventDefault=!1,t._timers=[],t._eventListeners=[],t._resizeListeners=[],t._eventConfig=cQt(A.eventConfig),t.globalCursor(t._eventConfig.globalCursor);const n=LQt(t,A,e.expr);t._runtime=n,t._signals=n.signals,t._bind=(A.bindings||[]).map(o=>({state:null,param:lt({},o)})),n.root&&n.root.set(i),i.source=n.data.root.input,t.pulse(n.data.root.input,t.changeset().insert(i.items)),t._width=t.width(),t._height=t.height(),t._viewWidth=WOA(t,t._width),t._viewHeight=KOA(t,t._height),t._origin=[0,0],t._resize=0,t._autosize=1,HQt(t),tQt(t),iQt(t),t.description(A.description),e.hover&&t.hover(),e.container&&t.initialize(e.container,e.bind)}function MT(A,e){return Je(A._signals,e)?A._signals[e]:YA("Unrecognized signal name: "+OA(e))}function zOA(A,e){const t=(A._targets||[]).filter(i=>i._update&&i._update.handler===e);return t.length?t[0]:null}function TOA(A,e,t,i){let n=zOA(t,i);return n||(n=UlA(A,()=>i(e,t.value)),n.handler=i,A.on(t,null,n)),A}function _OA(A,e,t){const i=zOA(e,t);return i&&e._targets.remove(i),A}_A(XOA,yJ,{async evaluate(A,e,t){if(await yJ.prototype.evaluate.call(this,A,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,aQt(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return t&&o5(this,t),this},dirty(A){this._redraw=!0,this._renderer&&this._renderer.dirty(A)},description(A){if(arguments.length){const e=A!=null?A+"":null;return e!==this._desc&&kOA(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(A,e,t){const i=MT(this,A);return arguments.length===1?i.value:this.update(i,e,t)},width(A){return arguments.length?this.signal("width",A):this.signal("width")},height(A){return arguments.length?this.signal("height",A):this.signal("height")},padding(A){return arguments.length?this.signal("padding",LOA(A)):LOA(this.signal("padding"))},autosize(A){return arguments.length?this.signal("autosize",A):this.signal("autosize")},background(A){return arguments.length?this.signal("background",A):this.signal("background")},renderer(A){return arguments.length?(HJ(A)||YA("Unrecognized renderer type: "+A),A!==this._renderType&&(this._renderType=A,this._resetRenderer()),this):this._renderType},tooltip(A){return arguments.length?(A!==this._tooltip&&(this._tooltip=A,this._resetRenderer()),this):this._tooltip},loader(A){return arguments.length?(A!==this._loader&&(yJ.prototype.loader.call(this,A),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(MT(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:ZQt,addEventListener(A,e,t){let i=e;return t&&t.trap===!1||(i=UlA(this,e),i.raw=e),this._handler.on(A,i),this},removeEventListener(A,e){for(var t=this._handler.handlers(A),i=t.length,n,o;--i>=0;)if(o=t[i].type,n=t[i].handler,A===o&&(e===n||e===n.raw)){this._handler.off(o,n);break}return this},addResizeListener(A){const e=this._resizeListeners;return e.indexOf(A)<0&&e.push(A),this},removeResizeListener(A){var e=this._resizeListeners,t=e.indexOf(A);return t>=0&&e.splice(t,1),this},addSignalListener(A,e){return TOA(this,A,MT(this,A),e)},removeSignalListener(A,e){return _OA(this,MT(this,A),e)},addDataListener(A,e){return TOA(this,A,JT(this,A).values,e)},removeDataListener(A,e){return _OA(this,JT(this,A).values,e)},globalCursor(A){if(arguments.length){if(this._globalCursor!==!!A){const e=KlA(this,null);this._globalCursor=!!A,e&&KlA(this,e)}return this}else return this._globalCursor},preventDefault(A){return arguments.length?(this._preventDefault=A,this):this._preventDefault},timer:XQt,events:QQt,finalize:uQt,hover:EQt,data:nQt,change:NT,insert:oQt,remove:gQt,scale:SQt,initialize:YQt,toImageURL:xQt,toCanvas:MQt,toSVG:vQt,getState:WQt,setState:VQt});const OQt="view",vT="[",LT="]",OOA="{",qOA="}",qQt=":",jOA=",",jQt="@",PQt=">",$Qt=/[[\]{}]/,AEt={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let POA,$OA;function Lp(A,e,t){return POA=e||OQt,$OA=t||AEt,AqA(A.trim()).map(TlA)}function eEt(A){return $OA[A]}function CL(A,e,t,i,n){const o=A.length;let g=0,a;for(;e<o;++e){if(a=A[e],!g&&a===t)return e;n&&n.indexOf(a)>=0?--g:i&&i.indexOf(a)>=0&&++g}return e}function AqA(A){const e=[],t=A.length;let i=0,n=0;for(;n<t;)n=CL(A,n,jOA,vT+OOA,LT+qOA),e.push(A.substring(i,n).trim()),i=++n;if(e.length===0)throw"Empty event selector: "+A;return e}function TlA(A){return A[0]==="["?tEt(A):iEt(A)}function tEt(A){const e=A.length;let t=1,i;if(t=CL(A,t,LT,vT,LT),t===e)throw"Empty between selector: "+A;if(i=AqA(A.substring(1,t)),i.length!==2)throw"Between selector must have two elements: "+A;if(A=A.slice(t+1).trim(),A[0]!==PQt)throw"Expected '>' after between selector: "+A;i=i.map(TlA);const n=TlA(A.slice(1).trim());return n.between?{between:i,stream:n}:(n.between=i,n)}function iEt(A){const e={source:POA},t=[];let i=[0,0],n=0,o=0,g=A.length,a=0,s,I;if(A[g-1]===qOA){if(a=A.lastIndexOf(OOA),a>=0){try{i=nEt(A.substring(a+1,g-1))}catch{throw"Invalid throttle specification: "+A}A=A.slice(0,a).trim(),g=A.length}else throw"Unmatched right brace: "+A;a=0}if(!g)throw A;if(A[0]===jQt&&(n=++a),s=CL(A,a,qQt),s<g&&(t.push(A.substring(o,s).trim()),o=a=++s),a=CL(A,a,vT),a===g)t.push(A.substring(o,g).trim());else if(t.push(A.substring(o,a).trim()),I=[],o=++a,o===g)throw"Unmatched left bracket: "+A;for(;a<g;){if(a=CL(A,a,LT),a===g)throw"Unmatched left bracket: "+A;if(I.push(A.substring(o,a).trim()),a<g-1&&A[++a]!==vT)throw"Expected left bracket: "+A;o=++a}if(!(g=t.length)||$Qt.test(t[g-1]))throw"Invalid event selector: "+A;return g>1?(e.type=t[1],n?e.markname=t[0].slice(1):eEt(t[0])?e.marktype=t[0]:e.source=t[0]):e.type=t[0],e.type.slice(-1)==="!"&&(e.consume=!0,e.type=e.type.slice(0,-1)),I!=null&&(e.filter=I),i[0]&&(e.throttle=i[0]),i[1]&&(e.debounce=i[1]),e}function nEt(A){const e=A.split(jOA);if(!A.length||e.length>2)throw A;return e.map(t=>{const i=+t;if(i!==i)throw A;return i})}function oEt(A){return oe(A)?A:{type:A||"pad"}}const lL=A=>+A||0,gEt=A=>({top:A,bottom:A,left:A,right:A});function aEt(A){return oe(A)?A.signal?A:{top:lL(A.top),bottom:lL(A.bottom),left:lL(A.left),right:lL(A.right)}:gEt(lL(A))}const mg=A=>oe(A)&&!RA(A)?lt({},A):{value:A};function eqA(A,e,t,i){return t!=null?(oe(t)&&!RA(t)||RA(t)&&t.length&&oe(t[0])?A.update[e]=t:A[i||"enter"][e]={value:t},1):0}function na(A,e,t){for(const i in e)eqA(A,i,e[i]);for(const i in t)eqA(A,i,t[i],"update")}function t2(A,e,t){for(const i in e)t&&Je(t,i)||(A[i]=lt(A[i]||{},e[i]));return A}function i2(A,e){return e&&(e.enter&&e.enter[A]||e.update&&e.update[A])}const _lA="mark",OlA="frame",qlA="scope",sEt="axis",rEt="axis-domain",IEt="axis-grid",CEt="axis-label",lEt="axis-tick",cEt="axis-title",BEt="legend",QEt="legend-band",EEt="legend-entry",uEt="legend-gradient",tqA="legend-label",dEt="legend-symbol",hEt="legend-title",mEt="title",pEt="title-text",fEt="title-subtitle";function yEt(A,e,t,i,n){const o={},g={};let a,s,I,r;s="lineBreak",e==="text"&&n[s]!=null&&!i2(s,A)&&jlA(o,s,n[s]),(t=="legend"||String(t).startsWith("axis"))&&(t=null),r=t===OlA?n.group:t===_lA?lt({},n.mark,n[e]):null;for(s in r)I=i2(s,A)||(s==="fill"||s==="stroke")&&(i2("fill",A)||i2("stroke",A)),I||jlA(o,s,r[s]);te(i).forEach(C=>{const l=n.style&&n.style[C];for(const c in l)i2(c,A)||jlA(o,c,l[c])}),A=lt({},A);for(s in o)r=o[s],r.signal?(a=a||{})[s]=r:g[s]=r;return A.enter=lt(g,A.enter),a&&(A.update=lt(a,A.update)),A}function jlA(A,e,t){A[e]=t&&t.signal?{signal:t.signal}:{value:t}}const iqA=A=>ie(A)?OA(A):A.signal?`(${A.signal})`:nqA(A);function ST(A){if(A.gradient!=null)return wEt(A);let e=A.signal?`(${A.signal})`:A.color?bEt(A.color):A.field!=null?nqA(A.field):A.value!==void 0?OA(A.value):void 0;return A.scale!=null&&(e=DEt(A,e)),e===void 0&&(e=null),A.exponent!=null&&(e=`pow(${e},${ZT(A.exponent)})`),A.mult!=null&&(e+=`*${ZT(A.mult)}`),A.offset!=null&&(e+=`+${ZT(A.offset)}`),A.round&&(e=`round(${e})`),e}const HT=(A,e,t,i)=>`(${A}(${[e,t,i].map(ST).join(",")})+'')`;function bEt(A){return A.c?HT("hcl",A.h,A.c,A.l):A.h||A.s?HT("hsl",A.h,A.s,A.l):A.l||A.a?HT("lab",A.l,A.a,A.b):A.r||A.g||A.b?HT("rgb",A.r,A.g,A.b):null}function wEt(A){const e=[A.start,A.stop,A.count].map(t=>t==null?null:OA(t));for(;e.length&&Ut(e)==null;)e.pop();return e.unshift(iqA(A.gradient)),`gradient(${e.join(",")})`}function ZT(A){return oe(A)?"("+ST(A)+")":A}function nqA(A){return oqA(oe(A)?A:{datum:A})}function oqA(A){let e,t,i;if(A.signal)e="datum",i=A.signal;else if(A.group||A.parent){for(t=Math.max(1,A.level||1),e="item";t-- >0;)e+=".mark.group";A.parent?(i=A.parent,e+=".datum"):i=A.group}else A.datum?(e="datum",i=A.datum):YA("Invalid field reference: "+OA(A));return A.signal||(i=ie(i)?hQ(i).map(OA).join("]["):oqA(i)),e+"["+i+"]"}function DEt(A,e){const t=iqA(A.scale);return A.range!=null?e=`lerp(_range(${t}), ${+A.range})`:(e!==void 0&&(e=`_scale(${t}, ${e})`),A.band&&(e=(e?e+"+":"")+`_bandwidth(${t})`+(+A.band==1?"":"*"+ZT(A.band)),A.extra&&(e=`(datum.extra ? _scale(${t}, datum.extra.value) : ${e})`)),e==null&&(e="0")),e}function GEt(A){let e="";return A.forEach(t=>{const i=ST(t);e+=t.test?`(${t.test})?${i}:`:i}),Ut(e)===":"&&(e+="null"),e}function gqA(A,e,t,i,n,o){const g={};o=o||{},o.encoders={$encode:g},A=yEt(A,e,t,i,n.config);for(const a in A)g[a]=kEt(A[a],e,o,n);return o}function kEt(A,e,t,i){const n={},o={};for(const g in A)A[g]!=null&&(n[g]=NEt(JEt(A[g]),i,t,o));return{$expr:{marktype:e,channels:n},$fields:Object.keys(o),$output:Object.keys(A)}}function JEt(A){return RA(A)?GEt(A):ST(A)}function NEt(A,e,t,i){const n=FQ(A,e);return n.$fields.forEach(o=>i[o]=1),lt(t,n.$params),n.$expr}const YEt="outer",REt=["value","update","init","react","bind"];function aqA(A,e){YA(A+' for "outer" push: '+OA(e))}function sqA(A,e){const t=A.name;if(A.push===YEt)e.signals[t]||aqA("No prior signal definition",t),REt.forEach(i=>{A[i]!==void 0&&aqA("Invalid property ",i)});else{const i=e.addSignal(t,A.value);A.react===!1&&(i.react=!1),A.bind&&e.addBinding(t,A.bind)}}function PlA(A,e,t,i){this.id=-1,this.type=A,this.value=e,this.params=t,i&&(this.parent=i)}function WT(A,e,t,i){return new PlA(A,e,t,i)}function KT(A,e){return WT("operator",A,e)}function Re(A){const e={$ref:A.id};return A.id<0&&(A.refs=A.refs||[]).push(e),e}function cL(A,e){return e?{$field:A,$name:e}:{$field:A}}const $lA=cL("key");function rqA(A,e){return{$compare:A,$order:e}}function xEt(A,e){const t={$key:A};return e&&(t.$flat=!0),t}const FEt="ascending",MEt="descending";function vEt(A){return oe(A)?(A.order===MEt?"-":"+")+UT(A.op,A.field):""}function UT(A,e){return(A&&A.signal?"$"+A.signal:A||"")+(A&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const AcA="scope",ecA="view";function eg(A){return A&&A.signal}function LEt(A){return A&&A.expr}function VT(A){if(eg(A))return!0;if(oe(A)){for(const e in A)if(VT(A[e]))return!0}return!1}function Rc(A,e){return A??e}function Yb(A){return A&&A.signal||A}const IqA="timer";function BL(A,e){return(A.merge?HEt:A.stream?ZEt:A.type?WEt:YA("Invalid stream specification: "+OA(A)))(A,e)}function SEt(A){return A===AcA?ecA:A||ecA}function HEt(A,e){const t=A.merge.map(n=>BL(n,e)),i=tcA({merge:t},A,e);return e.addStream(i).id}function ZEt(A,e){const t=BL(A.stream,e),i=tcA({stream:t},A,e);return e.addStream(i).id}function WEt(A,e){let t;A.type===IqA?(t=e.event(IqA,A.throttle),A={between:A.between,filter:A.filter}):t=e.event(SEt(A.source),A.type);const i=tcA({stream:t},A,e);return Object.keys(i).length===1?t:e.addStream(i).id}function tcA(A,e,t){let i=e.between;return i&&(i.length!==2&&YA('Stream "between" parameter must have 2 entries: '+OA(e)),A.between=[BL(i[0],t),BL(i[1],t)]),i=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&i.push(KEt(e.marktype,e.markname,e.markrole)),e.source===AcA&&i.push("inScope(event.item)"),i.length&&(A.filter=FQ("("+i.join(")&&(")+")",t).$expr),(i=e.throttle)!=null&&(A.throttle=+i),(i=e.debounce)!=null&&(A.debounce=+i),e.consume&&(A.consume=!0),A}function KEt(A,e,t){const i="event.item";return i+(A&&A!=="*"?"&&"+i+".mark.marktype==='"+A+"'":"")+(t?"&&"+i+".mark.role==='"+t+"'":"")+(e?"&&"+i+".mark.name==='"+e+"'":"")}const UEt={code:"_.$value",ast:{type:"Identifier",value:"value"}};function VEt(A,e,t){const i=A.encode,n={target:t};let o=A.events,g=A.update,a=[];o||YA("Signal update missing events specification."),ie(o)&&(o=Lp(o,e.isSubscope()?AcA:ecA)),o=te(o).filter(s=>s.signal||s.scale?(a.push(s),0):1),a.length>1&&(a=[zEt(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),i!=null&&(g&&YA("Signal encode and update are mutually exclusive."),g="encode(item(),"+OA(i)+")"),n.update=ie(g)?FQ(g,e):g.expr!=null?FQ(g.expr,e):g.value!=null?g.value:g.signal!=null?{$expr:UEt,$params:{$value:e.signalRef(g.signal)}}:YA("Invalid signal update specification."),A.force&&(n.options={force:!0}),a.forEach(s=>e.addUpdate(lt(XEt(s,e),n)))}function XEt(A,e){return{source:A.signal?e.signalRef(A.signal):A.scale?e.scaleRef(A.scale):BL(A,e)}}function zEt(A){return{signal:"["+A.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}function TEt(A,e){const t=e.getSignal(A.name);let i=A.update;A.init&&(i?YA("Signals can not include both init and update expressions."):(i=A.init,t.initonly=!0)),i&&(i=FQ(i,e),t.update=i.$expr,t.params=i.$params),A.on&&A.on.forEach(n=>VEt(n,e,t.id))}const Wi=A=>(e,t,i)=>WT(A,t,e||void 0,i),CqA=Wi("aggregate"),_Et=Wi("axisticks"),lqA=Wi("bound"),xc=Wi("collect"),cqA=Wi("compare"),OEt=Wi("datajoin"),BqA=Wi("encode"),qEt=Wi("expression"),jEt=Wi("facet"),PEt=Wi("field"),$Et=Wi("key"),Aut=Wi("legendentries"),eut=Wi("load"),tut=Wi("mark"),iut=Wi("multiextent"),nut=Wi("multivalues"),out=Wi("overlap"),gut=Wi("params"),QqA=Wi("prefacet"),aut=Wi("projection"),sut=Wi("proxy"),rut=Wi("relay"),EqA=Wi("render"),Iut=Wi("scale"),Rb=Wi("sieve"),Cut=Wi("sortitems"),uqA=Wi("viewlayout"),lut=Wi("values");let cut=0;const dqA={min:"min",max:"max",count:"sum"};function But(A,e){const t=A.type||"linear";z9A(t)||YA("Unrecognized scale type: "+OA(t)),e.addScale(A.name,{type:t,domain:void 0})}function Qut(A,e){const t=e.getScale(A.name).params;let i;t.domain=hqA(A.domain,A,e),A.range!=null&&(t.range=pqA(A,e,t)),A.interpolate!=null&&wut(A.interpolate,t),A.nice!=null&&(t.nice=but(A.nice)),A.bins!=null&&(t.bins=yut(A.bins,e));for(i in A)Je(t,i)||i==="name"||(t[i]=Cl(A[i],e))}function Cl(A,e){return oe(A)?A.signal?e.signalRef(A.signal):YA("Unsupported object: "+OA(A)):A}function XT(A,e){return A.signal?e.signalRef(A.signal):A.map(t=>Cl(t,e))}function zT(A){YA("Can not find data set: "+OA(A))}function hqA(A,e,t){if(!A){(e.domainMin!=null||e.domainMax!=null)&&YA("No scale domain defined for domainMin/domainMax to override.");return}return A.signal?t.signalRef(A.signal):(RA(A)?Eut:A.fields?dut:uut)(A,e,t)}function Eut(A,e,t){return A.map(i=>Cl(i,t))}function uut(A,e,t){const i=t.getData(A.data);return i||zT(A.data),RJ(e.type)?i.valuesRef(t,A.field,mqA(A.sort,!1)):O9A(e.type)?i.domainRef(t,A.field):i.extentRef(t,A.field)}function dut(A,e,t){const i=A.data,n=A.fields.reduce((o,g)=>(g=ie(g)?{data:i,field:g}:RA(g)||g.signal?hut(g,t):g,o.push(g),o),[]);return(RJ(e.type)?mut:O9A(e.type)?put:fut)(A,t,n)}function hut(A,e){const t="_:vega:_"+cut++,i=xc({});if(RA(A))i.value={$ingest:A};else if(A.signal){const n="setdata("+OA(t)+","+A.signal+")";i.params.input=e.signalRef(n)}return e.addDataPipeline(t,[i,Rb({})]),{data:t,field:"data"}}function mut(A,e,t){const i=mqA(A.sort,!0);let n,o;const g=t.map(I=>{const r=e.getData(I.data);return r||zT(I.data),r.countsRef(e,I.field,i)}),a={groupby:$lA,pulse:g};i&&(n=i.op||"count",o=i.field?UT(n,i.field):"count",a.ops=[dqA[n]],a.fields=[e.fieldRef(o)],a.as=[o]),n=e.add(CqA(a));const s=e.add(xc({pulse:Re(n)}));return o=e.add(lut({field:$lA,sort:e.sortRef(i),pulse:Re(s)})),Re(o)}function mqA(A,e){return A&&(!A.field&&!A.op?oe(A)?A.field="key":A={field:"key"}:!A.field&&A.op!=="count"?YA("No field provided for sort aggregate op: "+A.op):e&&A.field&&A.op&&!dqA[A.op]&&YA("Multiple domain scales can not be sorted using "+A.op)),A}function put(A,e,t){const i=t.map(n=>{const o=e.getData(n.data);return o||zT(n.data),o.domainRef(e,n.field)});return Re(e.add(nut({values:i})))}function fut(A,e,t){const i=t.map(n=>{const o=e.getData(n.data);return o||zT(n.data),o.extentRef(e,n.field)});return Re(e.add(iut({extents:i})))}function yut(A,e){return A.signal||RA(A)?XT(A,e):e.objectProperty(A)}function but(A){return oe(A)?{interval:Cl(A.interval),step:Cl(A.step)}:Cl(A)}function wut(A,e){e.interpolate=Cl(A.type||A),A.gamma!=null&&(e.interpolateGamma=Cl(A.gamma))}function pqA(A,e,t){const i=e.config.range;let n=A.range;if(n.signal)return e.signalRef(n.signal);if(ie(n)){if(i&&Je(i,n))return A=lt({},A,{range:i[n]}),pqA(A,e,t);n==="width"?n=[0,{signal:"width"}]:n==="height"?n=RJ(A.type)?[0,{signal:"height"}]:[{signal:"height"},0]:YA("Unrecognized scale range value: "+OA(n))}else if(n.scheme){t.scheme=RA(n.scheme)?XT(n.scheme,e):Cl(n.scheme,e),n.extent&&(t.schemeExtent=XT(n.extent,e)),n.count&&(t.schemeCount=Cl(n.count,e));return}else if(n.step){t.rangeStep=Cl(n.step,e);return}else{if(RJ(A.type)&&!RA(n))return hqA(n,A,e);RA(n)||YA("Unsupported range type: "+OA(n))}return n.map(o=>(RA(o)?XT:Cl)(o,e))}function Dut(A,e){const t=e.config.projection||{},i={};for(const n in A)n!=="name"&&(i[n]=icA(A[n],n,e));for(const n in t)i[n]==null&&(i[n]=icA(t[n],n,e));e.addProjection(A.name,i)}function icA(A,e,t){return RA(A)?A.map(i=>icA(i,e,t)):oe(A)?A.signal?t.signalRef(A.signal):e==="fit"?A:YA("Unsupported parameter object: "+OA(A)):A}const Fc="top",n2="left",o2="right",Sp="bottom",fqA="center",Gut="vertical",kut="start",Jut="middle",Nut="end",ncA="index",ocA="label",Yut="offset",g2="perc",Rut="perc2",ll="value",QL="guide-label",gcA="guide-title",xut="group-title",Fut="group-subtitle",yqA="symbol",TT="gradient",acA="discrete",scA="size",Mut="shape",vut="fill",Lut="stroke",Sut="strokeWidth",Hut="strokeDash",Zut="opacity",rcA=[scA,Mut,vut,Lut,Sut,Hut,Zut],EL={name:1,style:1,interactive:1},Pt={value:0},cl={value:1},_T="group",bqA="rect",IcA="rule",Wut="symbol",xb="text";function uL(A){return A.type=_T,A.interactive=A.interactive||!1,A}function Qr(A,e){const t=(i,n)=>Rc(A[i],Rc(e[i],n));return t.isVertical=i=>Gut===Rc(A.direction,e.direction||(i?e.symbolDirection:e.gradientDirection)),t.gradientLength=()=>Rc(A.gradientLength,e.gradientLength||e.gradientWidth),t.gradientThickness=()=>Rc(A.gradientThickness,e.gradientThickness||e.gradientHeight),t.entryColumns=()=>Rc(A.columns,Rc(e.columns,+t.isVertical(!0))),t}function wqA(A,e){const t=e&&(e.update&&e.update[A]||e.enter&&e.enter[A]);return t&&t.signal?t:t?t.value:null}function Kut(A,e,t){const i=e.config.style[t];return i&&i[A]}function OT(A,e,t){return`item.anchor === '${kut}' ? ${A} : item.anchor === '${Nut}' ? ${e} : ${t}`}const CcA=OT(OA(n2),OA(o2),OA(fqA));function Uut(A){const e=A("tickBand");let t=A("tickOffset"),i,n;return e?e.signal?(i={signal:`(${e.signal}) === 'extent' ? 1 : 0.5`},n={signal:`(${e.signal}) === 'extent'`},oe(t)||(t={signal:`(${e.signal}) === 'extent' ? 0 : ${t}`})):e==="extent"?(i=1,n=!0,t=0):(i=.5,n=!1):(i=A("bandPosition"),n=A("tickExtra")),{extra:n,band:i,offset:t}}function DqA(A,e){return e?A?oe(A)?Object.assign({},A,{offset:DqA(A.offset,e)}):{value:A,offset:e}:e:A}function RI(A,e){return e?(A.name=e.name,A.style=e.style||A.style,A.interactive=!!e.interactive,A.encode=t2(A.encode,e,EL)):A.interactive=!1,A}function Vut(A,e,t,i){const n=Qr(A,t),o=n.isVertical(),g=n.gradientThickness(),a=n.gradientLength();let s,I,r,C,l;o?(I=[0,1],r=[0,0],C=g,l=a):(I=[0,0],r=[1,0],C=a,l=g);const c={enter:s={opacity:Pt,x:Pt,y:Pt,width:mg(C),height:mg(l)},update:lt({},s,{opacity:cl,fill:{gradient:e,start:I,stop:r}}),exit:{opacity:Pt}};return na(c,{stroke:n("gradientStrokeColor"),strokeWidth:n("gradientStrokeWidth")},{opacity:n("gradientOpacity")}),RI({type:bqA,role:uEt,encode:c},i)}function Xut(A,e,t,i,n){const o=Qr(A,t),g=o.isVertical(),a=o.gradientThickness(),s=o.gradientLength();let I,r,C,l,c="";g?(I="y",C="y2",r="x",l="width",c="1-"):(I="x",C="x2",r="y",l="height");const B={opacity:Pt,fill:{scale:e,field:ll}};B[I]={signal:c+"datum."+g2,mult:s},B[r]=Pt,B[C]={signal:c+"datum."+Rut,mult:s},B[l]=mg(a);const E={enter:B,update:lt({},B,{opacity:cl}),exit:{opacity:Pt}};return na(E,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),RI({type:bqA,role:QEt,key:ll,from:n,encode:E},i)}const zut=`datum.${g2}<=0?"${n2}":datum.${g2}>=1?"${o2}":"${fqA}"`,Tut=`datum.${g2}<=0?"${Sp}":datum.${g2}>=1?"${Fc}":"${Jut}"`;function GqA(A,e,t,i){const n=Qr(A,e),o=n.isVertical(),g=mg(n.gradientThickness()),a=n.gradientLength();let s=n("labelOverlap"),I,r,C,l,c="";const B={enter:I={opacity:Pt},update:r={opacity:cl,text:{field:ocA}},exit:{opacity:Pt}};return na(B,{fill:n("labelColor"),fillOpacity:n("labelOpacity"),font:n("labelFont"),fontSize:n("labelFontSize"),fontStyle:n("labelFontStyle"),fontWeight:n("labelFontWeight"),limit:Rc(A.labelLimit,e.gradientLabelLimit)}),o?(I.align={value:"left"},I.baseline=r.baseline={signal:Tut},C="y",l="x",c="1-"):(I.align=r.align={signal:zut},I.baseline={value:"top"},C="x",l="y"),I[C]=r[C]={signal:c+"datum."+g2,mult:a},I[l]=r[l]=g,g.offset=Rc(A.labelOffset,e.gradientLabelOffset)||0,s=s?{separation:n("labelSeparation"),method:s,order:"datum."+ncA}:void 0,RI({type:xb,role:tqA,style:QL,key:ll,from:i,encode:B,overlap:s},t)}function _ut(A,e,t,i,n){const o=Qr(A,e),g=t.entries,a=!!(g&&g.interactive),s=g?g.name:void 0,I=o("clipHeight"),r=o("symbolOffset"),C={data:"value"},l=`(${n}) ? datum.${Yut} : datum.${scA}`,c=I?mg(I):{field:scA},B=`datum.${ncA}`,E=`max(1, ${n})`;let u,d,f,w,y;c.mult=.5,u={enter:d={opacity:Pt,x:{signal:l,mult:.5,offset:r},y:c},update:f={opacity:cl,x:d.x,y:d.y},exit:{opacity:Pt}};let G=null,R=null;A.fill||(G=e.symbolBaseFillColor,R=e.symbolBaseStrokeColor),na(u,{fill:o("symbolFillColor",G),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",R),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),rcA.forEach(k=>{A[k]&&(f[k]=d[k]={scale:A[k],field:ll})});const x=RI({type:Wut,role:dEt,key:ll,from:C,clip:I?!0:void 0,encode:u},t.symbols),F=mg(r);F.offset=o("labelOffset"),u={enter:d={opacity:Pt,x:{signal:l,offset:F},y:c},update:f={opacity:cl,text:{field:ocA},x:d.x,y:d.y},exit:{opacity:Pt}},na(u,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const Q=RI({type:xb,role:tqA,style:QL,key:ll,from:C,encode:u},t.labels);return u={enter:{noBound:{value:!I},width:Pt,height:I?mg(I):Pt,opacity:Pt},exit:{opacity:Pt},update:f={opacity:cl,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(w=`ceil(item.mark.items.length / ${E})`,f.row.signal=`${B}%${w}`,f.column.signal=`floor(${B} / ${w})`,y={field:["row",B]}):(f.row.signal=`floor(${B} / ${E})`,f.column.signal=`${B} % ${E}`,y={field:B}),f.column.signal=`(${n})?${f.column.signal}:${B}`,i={facet:{data:i,name:"value",groupby:ncA}},uL({role:qlA,from:i,encode:t2(u,g,EL),marks:[x,Q],name:s,interactive:a,sort:y})}function Out(A,e){const t=Qr(A,e);return{align:t("gridAlign"),columns:t.entryColumns(),center:{row:!0,column:!1},padding:{row:t("rowPadding"),column:t("columnPadding")}}}const lcA='item.orient === "left"',ccA='item.orient === "right"',qT=`(${lcA} || ${ccA})`,qut=`datum.vgrad && ${qT}`,jut=OT('"top"','"bottom"','"middle"'),Put=OT('"right"','"left"','"center"'),$ut=`datum.vgrad && ${ccA} ? (${Put}) : (${qT} && !(datum.vgrad && ${lcA})) ? "left" : ${CcA}`,Adt=`item._anchor || (${qT} ? "middle" : "start")`,edt=`${qut} ? (${lcA} ? -90 : 90) : 0`,tdt=`${qT} ? (datum.vgrad ? (${ccA} ? "bottom" : "top") : ${jut}) : "top"`;function idt(A,e,t,i){const n=Qr(A,e),o={enter:{opacity:Pt},update:{opacity:cl,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Pt}};return na(o,{orient:n("titleOrient"),_anchor:n("titleAnchor"),anchor:{signal:Adt},angle:{signal:edt},align:{signal:$ut},baseline:{signal:tdt},text:A.title,fill:n("titleColor"),fillOpacity:n("titleOpacity"),font:n("titleFont"),fontSize:n("titleFontSize"),fontStyle:n("titleFontStyle"),fontWeight:n("titleFontWeight"),limit:n("titleLimit"),lineHeight:n("titleLineHeight")},{align:n("titleAlign"),baseline:n("titleBaseline")}),RI({type:xb,role:hEt,style:gcA,from:i,encode:o},t)}function ndt(A,e){let t;return oe(A)&&(A.signal?t=A.signal:A.path?t="pathShape("+kqA(A.path)+")":A.sphere&&(t="geoShape("+kqA(A.sphere)+', {type: "Sphere"})')),t?e.signalRef(t):!!A}function kqA(A){return oe(A)&&A.signal?A.signal:OA(A)}function JqA(A){const e=A.role||"";return!e.indexOf("axis")||!e.indexOf("legend")||!e.indexOf("title")?e:A.type===_T?qlA:e||_lA}function odt(A){return{marktype:A.type,name:A.name||void 0,role:A.role||JqA(A),zindex:+A.zindex||void 0,aria:A.aria,description:A.description}}function gdt(A,e){return A&&A.signal?e.signalRef(A.signal):A!==!1}function BcA(A,e){const t=_VA(A.type);t||YA("Unrecognized transform type: "+OA(A.type));const i=WT(t.type.toLowerCase(),null,NqA(t,A,e));return A.signal&&e.addSignal(A.signal,e.proxy(i)),i.metadata=t.metadata||{},i}function NqA(A,e,t){const i={},n=A.params.length;for(let o=0;o<n;++o){const g=A.params[o];i[g.name]=adt(g,e,t)}return i}function adt(A,e,t){const i=A.type,n=e[A.name];if(i==="index")return sdt(A,e,t);if(n===void 0){A.required&&YA("Missing required "+OA(e.type)+" parameter: "+OA(A.name));return}else{if(i==="param")return rdt(A,e,t);if(i==="projection")return t.projectionRef(e[A.name])}return A.array&&!eg(n)?n.map(o=>YqA(A,o,t)):YqA(A,n,t)}function YqA(A,e,t){const i=A.type;if(eg(e))return xqA(i)?YA("Expression references can not be signals."):QcA(i)?t.fieldRef(e):FqA(i)?t.compareRef(e):t.signalRef(e.signal);{const n=A.expr||QcA(i);return n&&Idt(e)?t.exprRef(e.expr,e.as):n&&Cdt(e)?cL(e.field,e.as):xqA(i)?FQ(e,t):ldt(i)?Re(t.getData(e).values):QcA(i)?cL(e):FqA(i)?t.compareRef(e):e}}function sdt(A,e,t){return ie(e.from)||YA('Lookup "from" parameter must be a string literal.'),t.getData(e.from).lookupRef(t,e.key)}function rdt(A,e,t){const i=e[A.name];return A.array?(RA(i)||YA("Expected an array of sub-parameters. Instead: "+OA(i)),i.map(n=>RqA(A,n,t))):RqA(A,i,t)}function RqA(A,e,t){const i=A.params.length;let n;for(let g=0;g<i;++g){n=A.params[g];for(const a in n.key)if(n.key[a]!==e[a]){n=null;break}if(n)break}n||YA("Unsupported parameter: "+OA(e));const o=lt(NqA(n,e,t),n.key);return Re(t.add(gut(o)))}const Idt=A=>A&&A.expr,Cdt=A=>A&&A.field,ldt=A=>A==="data",xqA=A=>A==="expr",QcA=A=>A==="field",FqA=A=>A==="compare";function cdt(A,e,t){let i,n,o,g,a;return A?(i=A.facet)&&(e||YA("Only group marks can be faceted."),i.field!=null?g=a=jT(i,t):(A.data?a=Re(t.getData(A.data).aggregate):(o=BcA(lt({type:"aggregate",groupby:te(i.groupby)},i.aggregate),t),o.params.key=t.keyRef(i.groupby),o.params.pulse=jT(i,t),g=a=Re(t.add(o))),n=t.keyRef(i.groupby,!0))):g=Re(t.add(xc(null,[{}]))),g||(g=jT(A,t)),{key:n,pulse:g,parent:a}}function jT(A,e){return A.$ref?A:A.data&&A.data.$ref?A.data:Re(e.getData(A.data).output)}function Fb(A,e,t,i,n){this.scope=A,this.input=e,this.output=t,this.values=i,this.aggregate=n,this.index={}}Fb.fromEntries=function(A,e){const t=e.length,i=e[t-1],n=e[t-2];let o=e[0],g=null,a=1;for(o&&o.type==="load"&&(o=e[1]),A.add(e[0]);a<t;++a)e[a].params.pulse=Re(e[a-1]),A.add(e[a]),e[a].type==="aggregate"&&(g=e[a]);return new Fb(A,o,n,i,g)};function MqA(A){return ie(A)?A:null}function vqA(A,e,t){const i=UT(t.op,t.field);let n;if(e.ops){for(let o=0,g=e.as.length;o<g;++o)if(e.as[o]===i)return}else e.ops=["count"],e.fields=[null],e.as=["count"];t.op&&(e.ops.push((n=t.op.signal)?A.signalRef(n):t.op),e.fields.push(A.fieldRef(t.field)),e.as.push(i))}function dL(A,e,t,i,n,o,g){const a=e[t]||(e[t]={}),s=vEt(o);let I=MqA(n),r,C;if(I!=null&&(A=e.scope,I=I+(s?"|"+s:""),r=a[I]),!r){const l=o?{field:$lA,pulse:e.countsRef(A,n,o)}:{field:A.fieldRef(n),pulse:Re(e.output)};s&&(l.sort=A.sortRef(o)),C=A.add(WT(i,void 0,l)),g&&(e.index[n]=C),r=Re(C),I!=null&&(a[I]=r)}return r}Fb.prototype={countsRef(A,e,t){const i=this,n=i.counts||(i.counts={}),o=MqA(e);let g,a,s;return o!=null&&(A=i.scope,g=n[o]),g?t&&t.field&&vqA(A,g.agg.params,t):(s={groupby:A.fieldRef(e,"key"),pulse:Re(i.output)},t&&t.field&&vqA(A,s,t),a=A.add(CqA(s)),g=A.add(xc({pulse:Re(a)})),g={agg:a,ref:Re(g)},o!=null&&(n[o]=g)),g.ref},tuplesRef(){return Re(this.values)},extentRef(A,e){return dL(A,this,"extent","extent",e,!1)},domainRef(A,e){return dL(A,this,"domain","values",e,!1)},valuesRef(A,e,t){return dL(A,this,"vals","values",e,t||!0)},lookupRef(A,e){return dL(A,this,"lookup","tupleindex",e,!1)},indataRef(A,e){return dL(A,this,"indata","tupleindex",e,!0,!0)}};function Bdt(A,e,t){const i=A.from.facet,n=i.name,o=jT(i,e);let g;i.name||YA("Facet must have a name: "+OA(i)),i.data||YA("Facet must reference a data set: "+OA(i)),i.field?g=e.add(QqA({field:e.fieldRef(i.field),pulse:o})):i.groupby?g=e.add(jEt({key:e.keyRef(i.groupby),group:Re(e.proxy(t.parent)),pulse:o})):YA("Facet must specify groupby or field: "+OA(i));const a=e.fork(),s=a.add(xc()),I=a.add(Rb({pulse:Re(s)}));a.addData(n,new Fb(a,s,s,I)),a.addSignal("parent",null),g.params.subflow={$subflow:a.parse(A).toRuntime()}}function Qdt(A,e,t){const i=e.add(QqA({pulse:t.pulse})),n=e.fork();n.add(Rb()),n.addSignal("parent",null),i.params.subflow={$subflow:n.parse(A).toRuntime()}}function LqA(A,e,t){const i=A.remove,n=A.insert,o=A.toggle,g=A.modify,a=A.values,s=e.add(KT()),I="if("+A.trigger+',modify("'+t+'",'+[n,i,o,g,a].map(C=>C??"null").join(",")+"),0)",r=FQ(I,e);s.update=r.$expr,s.params=r.$params}function PT(A,e){const t=JqA(A),i=A.type===_T,n=A.from&&A.from.facet,o=A.overlap;let g=A.layout||t===qlA||t===OlA,a,s,I,r,C,l,c;const B=t===_lA||g||n,E=cdt(A.from,i,e);s=e.add(OEt({key:E.key||(A.key?cL(A.key):void 0),pulse:E.pulse,clean:!i}));const u=Re(s);s=I=e.add(xc({pulse:u})),s=e.add(tut({markdef:odt(A),interactive:gdt(A.interactive,e),clip:ndt(A.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:Re(s)}));const d=Re(s);s=r=e.add(BqA(gqA(A.encode,A.type,t,A.style,e,{mod:!1,pulse:d}))),s.params.parent=e.encode(),A.transform&&A.transform.forEach(R=>{const x=BcA(R,e),F=x.metadata;(F.generates||F.changes)&&YA("Mark transforms should not generate new data."),F.nomod||(r.params.mod=!0),x.params.pulse=Re(s),e.add(s=x)}),A.sort&&(s=e.add(Cut({sort:e.compareRef(A.sort),pulse:Re(s)})));const f=Re(s);(n||g)&&(g=e.add(uqA({layout:e.objectProperty(A.layout),legends:e.legends,mark:d,pulse:f})),l=Re(g));const w=e.add(lqA({mark:d,pulse:l||f}));c=Re(w),i&&(B&&(a=e.operators,a.pop(),g&&a.pop()),e.pushState(f,l||c,u),n?Bdt(A,e,E):B?Qdt(A,e,E):e.parse(A),e.popState(),B&&(g&&a.push(g),a.push(w))),o&&(c=Edt(o,c,e));const y=e.add(EqA({pulse:c})),G=e.add(Rb({pulse:Re(y)},void 0,e.parent()));A.name!=null&&(C=A.name,e.addData(C,new Fb(e,I,y,G)),A.on&&A.on.forEach(R=>{(R.insert||R.remove||R.toggle)&&YA("Marks only support modify triggers."),LqA(R,e,C)}))}function Edt(A,e,t){const i=A.method,n=A.bound,o=A.separation,g={separation:eg(o)?t.signalRef(o.signal):o,method:eg(i)?t.signalRef(i.signal):i,pulse:e};if(A.order&&(g.sort=t.compareRef({field:A.order})),n){const a=n.tolerance;g.boundTolerance=eg(a)?t.signalRef(a.signal):+a,g.boundScale=t.scaleRef(n.scale),g.boundOrient=n.orient}return Re(t.add(out(g)))}function udt(A,e){const t=e.config.legend,i=A.encode||{},n=Qr(A,t),o=i.legend||{},g=o.name||void 0,a=o.interactive,s=o.style,I={};let r=0,C,l,c;rcA.forEach(w=>A[w]?(I[w]=A[w],r=r||A[w]):0),r||YA("Missing valid scale for legend.");const B=ddt(A,e.scaleType(r)),E={title:A.title!=null,scales:I,type:B,vgrad:B!=="symbol"&&n.isVertical()},u=Re(e.add(xc(null,[E]))),d={enter:{x:{value:0},y:{value:0}}},f=Re(e.add(Aut(l={type:B,scale:e.scaleRef(r),count:e.objectProperty(n("tickCount")),limit:e.property(n("symbolLimit")),values:e.objectProperty(A.values),minstep:e.property(A.tickMinStep),formatType:e.property(A.formatType),formatSpecifier:e.property(A.format)})));return B===TT?(c=[Vut(A,r,t,i.gradient),GqA(A,t,i.labels,f)],l.count=l.count||e.signalRef(`max(2,2*floor((${Yb(n.gradientLength())})/100))`)):B===acA?c=[Xut(A,r,t,i.gradient,f),GqA(A,t,i.labels,f)]:(C=Out(A,t),c=[_ut(A,t,i,f,Yb(C.columns))],l.size=pdt(A,e,c[0].marks)),c=[uL({role:EEt,from:u,encode:d,marks:c,layout:C,interactive:a})],E.title&&c.push(idt(A,t,i.title,u)),PT(uL({role:BEt,from:u,encode:t2(mdt(n,A,t),o,EL),marks:c,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:g,interactive:a,style:s}),e)}function ddt(A,e){let t=A.type||yqA;return!A.type&&hdt(A)===1&&(A.fill||A.stroke)&&(t=BrA(e)?TT:QrA(e)?acA:yqA),t!==TT?t:QrA(e)?acA:TT}function hdt(A){return rcA.reduce((e,t)=>e+(A[t]?1:0),0)}function mdt(A,e,t){const i={enter:{},update:{}};return na(i,{orient:A("orient"),offset:A("offset"),padding:A("padding"),titlePadding:A("titlePadding"),cornerRadius:A("cornerRadius"),fill:A("fillColor"),stroke:A("strokeColor"),strokeWidth:t.strokeWidth,strokeDash:t.strokeDash,x:A("legendX"),y:A("legendY"),format:e.format,formatType:e.formatType}),i}function pdt(A,e,t){const i=Yb(SqA("size",A,t)),n=Yb(SqA("strokeWidth",A,t)),o=Yb(fdt(t[1].encode,e,QL));return FQ(`max(ceil(sqrt(${i})+${n}),${o})`,e)}function SqA(A,e,t){return e[A]?`scale("${e[A]}",datum)`:wqA(A,t[0].encode)}function fdt(A,e,t){return wqA("fontSize",A)||Kut("fontSize",e,t)}const ydt=`item.orient==="${n2}"?-90:item.orient==="${o2}"?90:0`;function bdt(A,e){A=ie(A)?{text:A}:A;const t=Qr(A,e.config.title),i=A.encode||{},n=i.group||{},o=n.name||void 0,g=n.interactive,a=n.style,s=[],I={},r=Re(e.add(xc(null,[I])));return s.push(Gdt(A,t,wdt(A),r)),A.subtitle&&s.push(kdt(A,t,i.subtitle,r)),PT(uL({role:mEt,from:r,encode:Ddt(t,n),marks:s,aria:t("aria"),description:t("description"),zindex:t("zindex"),name:o,interactive:g,style:a}),e)}function wdt(A){const e=A.encode;return e&&e.title||lt({name:A.name,interactive:A.interactive,style:A.style},e)}function Ddt(A,e){const t={enter:{},update:{}};return na(t,{orient:A("orient"),anchor:A("anchor"),align:{signal:CcA},angle:{signal:ydt},limit:A("limit"),frame:A("frame"),offset:A("offset")||0,padding:A("subtitlePadding")}),t2(t,e,EL)}function Gdt(A,e,t,i){const n={value:0},o=A.text,g={enter:{opacity:n},update:{opacity:{value:1}},exit:{opacity:n}};return na(g,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),RI({type:xb,role:pEt,style:xut,from:i,encode:g},t)}function kdt(A,e,t,i){const n={value:0},o=A.subtitle,g={enter:{opacity:n},update:{opacity:{value:1}},exit:{opacity:n}};return na(g,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),RI({type:xb,role:fEt,style:Fut,from:i,encode:g},t)}function Jdt(A,e){const t=[];A.transform&&A.transform.forEach(i=>{t.push(BcA(i,e))}),A.on&&A.on.forEach(i=>{LqA(i,e,A.name)}),e.addDataPipeline(A.name,Ndt(A,e,t))}function Ndt(A,e,t){const i=[];let n=null,o=!1,g=!1,a,s,I,r,C;for(A.values?eg(A.values)||VT(A.format)?(i.push(HqA(e,A)),i.push(n=Mb())):i.push(n=Mb({$ingest:A.values,$format:A.format})):A.url?VT(A.url)||VT(A.format)?(i.push(HqA(e,A)),i.push(n=Mb())):i.push(n=Mb({$request:A.url,$format:A.format})):A.source&&(n=a=te(A.source).map(l=>Re(e.getData(l).output)),i.push(null)),s=0,I=t.length;s<I;++s)r=t[s],C=r.metadata,!n&&!C.source&&i.push(n=Mb()),i.push(r),C.generates&&(g=!0),C.modifies&&!g&&(o=!0),C.source?n=r:C.changes&&(n=null);return a&&(I=a.length-1,i[0]=rut({derive:o,pulse:I?a:a[0]}),(o||I)&&i.splice(1,0,Mb())),n||i.push(Mb()),i.push(Rb({})),i}function Mb(A){const e=xc({},A);return e.metadata={source:!0},e}function HqA(A,e){return eut({url:e.url?A.property(e.url):void 0,async:e.async?A.property(e.async):void 0,values:e.values?A.property(e.values):void 0,format:A.objectProperty(e.format)})}const ZqA=A=>A===Sp||A===Fc,$T=(A,e,t)=>eg(A)?Fdt(A.signal,e,t):A===n2||A===Fc?e:t,pg=(A,e,t)=>eg(A)?Rdt(A.signal,e,t):ZqA(A)?e:t,Mc=(A,e,t)=>eg(A)?xdt(A.signal,e,t):ZqA(A)?t:e,WqA=(A,e,t)=>eg(A)?Mdt(A.signal,e,t):A===Fc?{value:e}:{value:t},Ydt=(A,e,t)=>eg(A)?vdt(A.signal,e,t):A===o2?{value:e}:{value:t},Rdt=(A,e,t)=>KqA(`${A} === '${Fc}' || ${A} === '${Sp}'`,e,t),xdt=(A,e,t)=>KqA(`${A} !== '${Fc}' && ${A} !== '${Sp}'`,e,t),Fdt=(A,e,t)=>EcA(`${A} === '${n2}' || ${A} === '${Fc}'`,e,t),Mdt=(A,e,t)=>EcA(`${A} === '${Fc}'`,e,t),vdt=(A,e,t)=>EcA(`${A} === '${o2}'`,e,t),KqA=(A,e,t)=>(e=e!=null?mg(e):e,t=t!=null?mg(t):t,UqA(e)&&UqA(t)?(e=e?e.signal||OA(e.value):null,t=t?t.signal||OA(t.value):null,{signal:`${A} ? (${e}) : (${t})`}):[lt({test:A},e)].concat(t||[])),UqA=A=>A==null||Object.keys(A).length===1,EcA=(A,e,t)=>({signal:`${A} ? (${a2(e)}) : (${a2(t)})`}),Ldt=(A,e,t,i,n)=>({signal:(i!=null?`${A} === '${n2}' ? (${a2(i)}) : `:"")+(t!=null?`${A} === '${Sp}' ? (${a2(t)}) : `:"")+(n!=null?`${A} === '${o2}' ? (${a2(n)}) : `:"")+(e!=null?`${A} === '${Fc}' ? (${a2(e)}) : `:"")+"(null)"}),a2=A=>eg(A)?A.signal:A==null?null:OA(A),Sdt=(A,e)=>e===0?0:eg(A)?{signal:`(${A.signal}) * ${e}`}:{value:A*e},s2=(A,e)=>{const t=A.signal;return t&&t.endsWith("(null)")?{signal:t.slice(0,-6)+e.signal}:A};function r2(A,e,t,i){let n;if(e&&Je(e,A))return e[A];if(Je(t,A))return t[A];if(A.startsWith("title")){switch(A){case"titleColor":n="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":n=A[5].toLowerCase()+A.slice(6)}return i[gcA][n]}else if(A.startsWith("label")){switch(A){case"labelColor":n="fill";break;case"labelFont":case"labelFontSize":n=A[5].toLowerCase()+A.slice(6)}return i[QL][n]}return null}function VqA(A){const e={};for(const t of A)if(t)for(const i in t)e[i]=1;return Object.keys(e)}function Hdt(A,e){var t=e.config,i=t.style,n=t.axis,o=e.scaleType(A.scale)==="band"&&t.axisBand,g=A.orient,a,s,I;if(eg(g)){const r=VqA([t.axisX,t.axisY]),C=VqA([t.axisTop,t.axisBottom,t.axisLeft,t.axisRight]);a={};for(I of r)a[I]=pg(g,r2(I,t.axisX,n,i),r2(I,t.axisY,n,i));s={};for(I of C)s[I]=Ldt(g.signal,r2(I,t.axisTop,n,i),r2(I,t.axisBottom,n,i),r2(I,t.axisLeft,n,i),r2(I,t.axisRight,n,i))}else a=g===Fc||g===Sp?t.axisX:t.axisY,s=t["axis"+g[0].toUpperCase()+g.slice(1)];return a||s||o?lt({},n,a,s,o):n}function Zdt(A,e,t,i){const n=Qr(A,e),o=A.orient;let g,a;const s={enter:g={opacity:Pt},update:a={opacity:cl},exit:{opacity:Pt}};na(s,{stroke:n("domainColor"),strokeCap:n("domainCap"),strokeDash:n("domainDash"),strokeDashOffset:n("domainDashOffset"),strokeWidth:n("domainWidth"),strokeOpacity:n("domainOpacity")});const I=XqA(A,0),r=XqA(A,1);return g.x=a.x=pg(o,I,Pt),g.x2=a.x2=pg(o,r),g.y=a.y=Mc(o,I,Pt),g.y2=a.y2=Mc(o,r),RI({type:IcA,role:rEt,from:i,encode:s},t)}function XqA(A,e){return{scale:A.scale,range:e}}function Wdt(A,e,t,i,n){const o=Qr(A,e),g=A.orient,a=A.gridScale,s=$T(g,1,-1),I=Kdt(A.offset,s);let r,C,l;const c={enter:r={opacity:Pt},update:l={opacity:cl},exit:C={opacity:Pt}};na(c,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const B={scale:A.scale,field:ll,band:n.band,extra:n.extra,offset:n.offset,round:o("tickRound")},E=pg(g,{signal:"height"},{signal:"width"}),u=a?{scale:a,range:0,mult:s,offset:I}:{value:0,offset:I},d=a?{scale:a,range:1,mult:s,offset:I}:lt(E,{mult:s,offset:I});return r.x=l.x=pg(g,B,u),r.y=l.y=Mc(g,B,u),r.x2=l.x2=Mc(g,d),r.y2=l.y2=pg(g,d),C.x=pg(g,B),C.y=Mc(g,B),RI({type:IcA,role:IEt,key:ll,from:i,encode:c},t)}function Kdt(A,e){if(e!==1)if(!oe(A))A=eg(e)?{signal:`(${e.signal}) * (${A||0})`}:e*(A||0);else{let t=A=lt({},A);for(;t.mult!=null;)if(oe(t.mult))t=t.mult=lt({},t.mult);else return t.mult=eg(e)?{signal:`(${t.mult}) * (${e.signal})`}:t.mult*e,A;t.mult=e}return A}function Udt(A,e,t,i,n,o){const g=Qr(A,e),a=A.orient,s=$T(a,-1,1);let I,r,C;const l={enter:I={opacity:Pt},update:C={opacity:cl},exit:r={opacity:Pt}};na(l,{stroke:g("tickColor"),strokeCap:g("tickCap"),strokeDash:g("tickDash"),strokeDashOffset:g("tickDashOffset"),strokeOpacity:g("tickOpacity"),strokeWidth:g("tickWidth")});const c=mg(n);c.mult=s;const B={scale:A.scale,field:ll,band:o.band,extra:o.extra,offset:o.offset,round:g("tickRound")};return C.y=I.y=pg(a,Pt,B),C.y2=I.y2=pg(a,c),r.x=pg(a,B),C.x=I.x=Mc(a,Pt,B),C.x2=I.x2=Mc(a,c),r.y=Mc(a,B),RI({type:IcA,role:lEt,key:ll,from:i,encode:l},t)}function ucA(A,e,t,i,n){return{signal:'flush(range("'+A+'"), scale("'+A+'", datum.value), '+e+","+t+","+i+","+n+")"}}function Vdt(A,e,t,i,n,o){const g=Qr(A,e),a=A.orient,s=A.scale,I=$T(a,-1,1),r=Yb(g("labelFlush")),C=Yb(g("labelFlushOffset")),l=g("labelAlign"),c=g("labelBaseline");let B=r===0||!!r,E;const u=mg(n);u.mult=I,u.offset=mg(g("labelPadding")||0),u.offset.mult=I;const d={scale:s,field:ll,band:.5,offset:DqA(o.offset,g("labelOffset"))},f=pg(a,B?ucA(s,r,'"left"','"right"','"center"'):{value:"center"},Ydt(a,"left","right")),w=pg(a,WqA(a,"bottom","top"),B?ucA(s,r,'"top"','"bottom"','"middle"'):{value:"middle"}),y=ucA(s,r,`-(${C})`,C,0);B=B&&C;const G={opacity:Pt,x:pg(a,d,u),y:Mc(a,d,u)},R={enter:G,update:E={opacity:cl,text:{field:ocA},x:G.x,y:G.y,align:f,baseline:w},exit:{opacity:Pt,x:G.x,y:G.y}};na(R,{dx:!l&&B?pg(a,y):null,dy:!c&&B?Mc(a,y):null}),na(R,{angle:g("labelAngle"),fill:g("labelColor"),fillOpacity:g("labelOpacity"),font:g("labelFont"),fontSize:g("labelFontSize"),fontWeight:g("labelFontWeight"),fontStyle:g("labelFontStyle"),limit:g("labelLimit"),lineHeight:g("labelLineHeight")},{align:l,baseline:c});const x=g("labelBound");let F=g("labelOverlap");return F=F||x?{separation:g("labelSeparation"),method:F,order:"datum.index",bound:x?{scale:s,orient:a,tolerance:x}:null}:void 0,E.align!==f&&(E.align=s2(E.align,f)),E.baseline!==w&&(E.baseline=s2(E.baseline,w)),RI({type:xb,role:CEt,style:QL,key:ll,from:i,encode:R,overlap:F},t)}function Xdt(A,e,t,i){const n=Qr(A,e),o=A.orient,g=$T(o,-1,1);let a,s;const I={enter:a={opacity:Pt,anchor:mg(n("titleAnchor",null)),align:{signal:CcA}},update:s=lt({},a,{opacity:cl,text:mg(A.title)}),exit:{opacity:Pt}},r={signal:`lerp(range("${A.scale}"), ${OT(0,1,.5)})`};return s.x=pg(o,r),s.y=Mc(o,r),a.angle=pg(o,Pt,Sdt(g,90)),a.baseline=pg(o,WqA(o,Sp,Fc),{value:Sp}),s.angle=a.angle,s.baseline=a.baseline,na(I,{fill:n("titleColor"),fillOpacity:n("titleOpacity"),font:n("titleFont"),fontSize:n("titleFontSize"),fontStyle:n("titleFontStyle"),fontWeight:n("titleFontWeight"),limit:n("titleLimit"),lineHeight:n("titleLineHeight")},{align:n("titleAlign"),angle:n("titleAngle"),baseline:n("titleBaseline")}),zdt(n,o,I,t),I.update.align=s2(I.update.align,a.align),I.update.angle=s2(I.update.angle,a.angle),I.update.baseline=s2(I.update.baseline,a.baseline),RI({type:xb,role:cEt,style:gcA,from:i,encode:I},t)}function zdt(A,e,t,i){const n=(a,s)=>a!=null?(t.update[s]=s2(mg(a),t.update[s]),!1):!i2(s,i),o=n(A("titleX"),"x"),g=n(A("titleY"),"y");t.enter.auto=g===o?mg(g):pg(e,mg(g),mg(o))}function Tdt(A,e){const t=Hdt(A,e),i=A.encode||{},n=i.axis||{},o=n.name||void 0,g=n.interactive,a=n.style,s=Qr(A,t),I=Uut(s),r={scale:A.scale,ticks:!!s("ticks"),labels:!!s("labels"),grid:!!s("grid"),domain:!!s("domain"),title:A.title!=null},C=Re(e.add(xc({},[r]))),l=Re(e.add(_Et({scale:e.scaleRef(A.scale),extra:e.property(I.extra),count:e.objectProperty(A.tickCount),values:e.objectProperty(A.values),minstep:e.property(A.tickMinStep),formatType:e.property(A.formatType),formatSpecifier:e.property(A.format)}))),c=[];let B;return r.grid&&c.push(Wdt(A,t,i.grid,l,I)),r.ticks&&(B=s("tickSize"),c.push(Udt(A,t,i.ticks,l,B,I))),r.labels&&(B=r.ticks?B:0,c.push(Vdt(A,t,i.labels,l,B,I))),r.domain&&c.push(Zdt(A,t,i.domain,C)),r.title&&c.push(Xdt(A,t,i.title,C)),PT(uL({role:sEt,from:C,encode:t2(_dt(s,A),n,EL),marks:c,aria:s("aria"),description:s("description"),zindex:s("zindex"),name:o,interactive:g,style:a}),e)}function _dt(A,e){const t={enter:{},update:{}};return na(t,{orient:A("orient"),offset:A("offset")||0,position:Rc(e.position,0),titlePadding:A("titlePadding"),minExtent:A("minExtent"),maxExtent:A("maxExtent"),range:{signal:`abs(span(range("${e.scale}")))`},translate:A("translate"),format:e.format,formatType:e.formatType}),t}function zqA(A,e,t){const i=te(A.signals),n=te(A.scales);return t||i.forEach(o=>sqA(o,e)),te(A.projections).forEach(o=>Dut(o,e)),n.forEach(o=>But(o,e)),te(A.data).forEach(o=>Jdt(o,e)),n.forEach(o=>Qut(o,e)),(t||i).forEach(o=>TEt(o,e)),te(A.axes).forEach(o=>Tdt(o,e)),te(A.marks).forEach(o=>PT(o,e)),te(A.legends).forEach(o=>udt(o,e)),A.title&&bdt(A.title,e),e.parseLambdas(),e}const Odt=A=>t2({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},A);function qdt(A,e){const t=e.config,i=Re(e.root=e.add(KT())),n=jdt(A,t);n.forEach(I=>sqA(I,e)),e.description=A.description||t.description,e.eventConfig=t.events,e.legends=e.objectProperty(t.legend&&t.legend.layout),e.locale=t.locale;const o=e.add(xc()),g=e.add(BqA(gqA(Odt(A.encode),_T,OlA,A.style,e,{pulse:Re(o)}))),a=e.add(uqA({layout:e.objectProperty(A.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:i,pulse:Re(g)}));e.operators.pop(),e.pushState(Re(g),Re(a),null),zqA(A,e,n),e.operators.push(a);let s=e.add(lqA({mark:i,pulse:Re(a)}));return s=e.add(EqA({pulse:Re(s)})),s=e.add(Rb({pulse:Re(s)})),e.addData("root",new Fb(e,o,o,s)),e}function hL(A,e){return e&&e.signal?{name:A,update:e.signal}:{name:A,value:e}}function jdt(A,e){const t=g=>Rc(A[g],e[g]),i=[hL("background",t("background")),hL("autosize",oEt(t("autosize"))),hL("padding",aEt(t("padding"))),hL("width",t("width")||0),hL("height",t("height")||0)],n=i.reduce((g,a)=>(g[a.name]=a,g),{}),o={};return te(A.signals).forEach(g=>{Je(n,g.name)?g=lt(n[g.name],g):i.push(g),o[g.name]=g}),te(e.signals).forEach(g=>{!Je(o,g.name)&&!Je(n,g.name)&&i.push(g)}),i}function TqA(A,e){this.config=A||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function _qA(A){this.config=A.config,this.options=A.options,this.legends=A.legends,this.field=Object.create(A.field),this.signals=Object.create(A.signals),this.lambdas=Object.create(A.lambdas),this.scales=Object.create(A.scales),this.events=Object.create(A.events),this.data=Object.create(A.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++A._nextsub[0],this._nextsub=A._nextsub,this._parent=A._parent.slice(),this._encode=A._encode.slice(),this._lookup=A._lookup.slice(),this._markpath=A._markpath}TqA.prototype=_qA.prototype={parse(A){return zqA(A,this)},fork(){return new _qA(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(A){return this.operators.push(A),A.id=this.id(),A.refs&&(A.refs.forEach(e=>{e.$ref=A.id}),A.refs=null),A},proxy(A){const e=A instanceof PlA?Re(A):A;return this.add(sut({value:e}))},addStream(A){return this.streams.push(A),A.id=this.id(),A},addUpdate(A){return this.updates.push(A),A},finish(){let A,e;this.root&&(this.root.root=!0);for(A in this.signals)this.signals[A].signal=A;for(A in this.scales)this.scales[A].scale=A;function t(i,n,o){let g,a;i&&(g=i.data||(i.data={}),a=g[n]||(g[n]=[]),a.push(o))}for(A in this.data){e=this.data[A],t(e.input,A,"input"),t(e.output,A,"output"),t(e.values,A,"values");for(const i in e.index)t(e.index[i],A,"index:"+i)}return this},pushState(A,e,t){this._encode.push(Re(this.add(Rb({pulse:A})))),this._parent.push(e),this._lookup.push(t?Re(this.proxy(t)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Ut(this._parent)},encode(){return Ut(this._encode)},lookup(){return Ut(this._lookup)},markpath(){const A=this._markpath;return++A[A.length-1]},fieldRef(A,e){if(ie(A))return cL(A,e);A.signal||YA("Unsupported field reference: "+OA(A));const t=A.signal;let i=this.field[t];if(!i){const n={name:this.signalRef(t)};e&&(n.as=e),this.field[t]=i=Re(this.add(PEt(n)))}return i},compareRef(A){let e=!1;const t=o=>eg(o)?(e=!0,this.signalRef(o.signal)):LEt(o)?(e=!0,this.exprRef(o.expr)):o,i=te(A.field).map(t),n=te(A.order).map(t);return e?Re(this.add(cqA({fields:i,orders:n}))):rqA(i,n)},keyRef(A,e){let t=!1;const i=o=>eg(o)?(t=!0,Re(n[o.signal])):o,n=this.signals;return A=te(A).map(i),t?Re(this.add($Et({fields:A,flat:e}))):xEt(A,e)},sortRef(A){if(!A)return A;const e=UT(A.op,A.field),t=A.order||FEt;return t.signal?Re(this.add(cqA({fields:e,orders:this.signalRef(t.signal)}))):rqA(e,t)},event(A,e){const t=A+":"+e;if(!this.events[t]){const i=this.id();this.streams.push({id:i,source:A,type:e}),this.events[t]=i}return this.events[t]},hasOwnSignal(A){return Je(this.signals,A)},addSignal(A,e){this.hasOwnSignal(A)&&YA("Duplicate signal name: "+OA(A));const t=e instanceof PlA?e:this.add(KT(e));return this.signals[A]=t},getSignal(A){return this.signals[A]||YA("Unrecognized signal name: "+OA(A)),this.signals[A]},signalRef(A){return this.signals[A]?Re(this.signals[A]):(Je(this.lambdas,A)||(this.lambdas[A]=this.add(KT(null))),Re(this.lambdas[A]))},parseLambdas(){const A=Object.keys(this.lambdas);for(let e=0,t=A.length;e<t;++e){const i=A[e],n=FQ(i,this),o=this.lambdas[i];o.params=n.$params,o.update=n.$expr}},property(A){return A&&A.signal?this.signalRef(A.signal):A},objectProperty(A){return!A||!oe(A)?A:this.signalRef(A.signal||dcA(A))},exprRef(A,e){const t={expr:FQ(A,this)};return e&&(t.expr.$name=e),Re(this.add(qEt(t)))},addBinding(A,e){this.bindings||YA("Nested signals do not support binding: "+OA(A)),this.bindings.push(lt({signal:A},e))},addScaleProj(A,e){Je(this.scales,A)&&YA("Duplicate scale or projection name: "+OA(A)),this.scales[A]=this.add(e)},addScale(A,e){this.addScaleProj(A,Iut(e))},addProjection(A,e){this.addScaleProj(A,aut(e))},getScale(A){return this.scales[A]||YA("Unrecognized scale name: "+OA(A)),this.scales[A]},scaleRef(A){return Re(this.getScale(A))},scaleType(A){return this.getScale(A).params.type},projectionRef(A){return this.scaleRef(A)},projectionType(A){return this.scaleType(A)},addData(A,e){return Je(this.data,A)&&YA("Duplicate data set name: "+OA(A)),this.data[A]=e},getData(A){return this.data[A]||YA("Undefined data set name: "+OA(A)),this.data[A]},addDataPipeline(A,e){return Je(this.data,A)&&YA("Duplicate data set name: "+OA(A)),this.addData(A,Fb.fromEntries(this,e))}};function dcA(A){return(RA(A)?Pdt:$dt)(A)}function Pdt(A){const e=A.length;let t="[";for(let i=0;i<e;++i){const n=A[i];t+=(i>0?",":"")+(oe(n)?n.signal||dcA(n):OA(n))}return t+"]"}function $dt(A){let e="{",t=0,i,n;for(i in A)n=A[i],e+=(++t>1?",":"")+OA(i)+":"+(oe(n)?n.signal||dcA(n):OA(n));return e+"}"}function Aht(){const A="sans-serif",e="#4c78a8",t="#000",i="#888",n="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:e},area:{fill:e},image:null,line:{stroke:e,strokeWidth:2},path:{stroke:e},rect:{fill:e},rule:{stroke:t},shape:{stroke:e},symbol:{fill:e,size:64},text:{fill:t,font:A,fontSize:11},trail:{fill:e,size:2},style:{"guide-label":{fill:t,font:A,fontSize:10},"guide-title":{fill:t,font:A,fontSize:11,fontWeight:"bold"},"group-title":{fill:t,font:A,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:t,font:A,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:n},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:i,grid:!1,gridWidth:1,gridColor:n,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:i,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:n,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:i,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function eht(A,e,t){return oe(A)||YA("Input Vega specification must be an object."),e=QJ(Aht(),e,A.config),qdt(A,new TqA(e,t)).toRuntime()}var tht="5.26.1";lt(bJ,Ett,kgt,gat,zst,Zrt,cCt,zIt,QCt,HCt,OCt,tlt);const iht=Object.freeze(Object.defineProperty({__proto__:null,Bounds:vo,CanvasHandler:sl,CanvasRenderer:pv,DATE:rr,DAY:xa,DAYOFYEAR:pQ,Dataflow:yJ,Debug:kUA,Error:DaA,EventStream:I5,Gradient:c5A,GroupItem:K5,HOURS:wI,Handler:wp,HybridHandler:BIA,HybridRenderer:Bz,Info:GUA,Item:W5,MILLISECONDS:yc,MINUTES:DI,MONTH:Ra,Marks:va,MultiPulse:gsA,None:DUA,Operator:Oi,Parameters:r5,Pulse:cp,QUARTER:sr,RenderType:Gp,Renderer:La,ResourceLoader:JrA,SECONDS:tl,SVGHandler:oIA,SVGRenderer:lz,SVGStringRenderer:cIA,Scenegraph:PrA,TIME_UNITS:WaA,Transform:DA,View:XOA,WEEK:jo,Warn:GaA,YEAR:Aa,accessor:gr,accessorFields:ka,accessorName:ro,array:te,ascending:j9,bandwidthNRD:IsA,bin:jVA,bootstrapCI:PVA,boundClip:RzA,boundContext:Cv,boundItem:jrA,boundMark:U5A,boundStroke:ad,changeset:sb,clampRange:ZUA,codegenExpression:eOA,compare:RaA,constant:Ya,cumulativeLogNormal:EsA,cumulativeNormal:B5,cumulativeUniform:msA,dayofyear:AVA,debounce:xaA,defaultLocale:$aA,definition:_VA,densityLogNormal:QsA,densityNormal:CsA,densityUniform:hsA,domChild:$o,domClear:kI,domCreate:bp,domFind:$rA,dotbin:$VA,error:YA,expressionFunction:lo,extend:lt,extent:mQ,extentIndex:WUA,falsy:ap,fastmap:uJ,field:Al,flush:KUA,font:ez,fontFamily:Ev,fontSize:DQ,format:t5,formatLocale:A5,formats:isA,hasOwnProperty:Je,id:RM,identity:Ja,inferType:NVA,inferTypes:YVA,ingest:Ei,inherits:_A,inrange:dJ,interpolate:ErA,interpolateColors:M5,interpolateRange:q9A,intersect:kzA,intersectBoxLine:vJ,intersectPath:vrA,intersectPoint:LrA,intersectRule:k5A,isArray:RA,isBoolean:sp,isDate:rp,isFunction:Ct,isIterable:UUA,isNumber:ti,isObject:oe,isRegExp:VUA,isString:ie,isTuple:g5,key:FaA,lerp:XUA,lineHeight:fp,loader:i5,locale:GVA,logger:kaA,lruCache:zUA,markup:CIA,merge:TUA,mergeConfig:QJ,multiLineOffset:_rA,one:BJ,pad:_UA,panLinear:FUA,panLog:MUA,panPow:vUA,panSymlog:LUA,parse:eht,parseExpression:DlA,parseSelector:Lp,path:f5,pathCurves:ov,pathEqual:xzA,pathParse:xJ,pathRectangle:H5,pathRender:gv,pathSymbols:brA,pathTrail:DrA,peek:Ut,point:iz,projection:CCA,quantileLogNormal:usA,quantileNormal:Q5,quantileUniform:psA,quantiles:ssA,quantizeInterpolator:j9A,quarter:SUA,quartiles:rsA,get random(){return il},randomInteger:het,randomKDE:csA,randomLCG:det,randomLogNormal:eXA,randomMixture:tXA,randomNormal:lsA,randomUniform:iXA,read:MVA,regressionConstant:fsA,regressionExp:oXA,regressionLinear:ysA,regressionLoess:IXA,regressionLog:nXA,regressionPoly:aXA,regressionPow:gXA,regressionQuad:bsA,renderModule:HJ,repeat:xM,resetDefaultLocale:BAt,resetSVGClipId:m5A,resetSVGDefIds:zot,responseType:FVA,runtimeContext:wOA,sampleCurve:u5,sampleLogNormal:BsA,sampleNormal:c5,sampleUniform:dsA,scale:Ci,sceneEqual:EIA,sceneFromJSON:X5A,scenePickVisit:O5,sceneToJSON:V5A,sceneVisit:qn,sceneZOrder:SrA,scheme:urA,serializeXML:QzA,setHybridRendererOptions:Kot,setRandom:Eet,span:FM,splitAccessPath:hQ,stringValue:OA,textMetrics:GI,timeBin:hVA,timeFloor:aVA,timeFormatLocale:VM,timeInterval:mJ,timeOffset:IVA,timeSequence:cVA,timeUnitSpecifier:$UA,timeUnits:UaA,toBoolean:MaA,toDate:vaA,toNumber:Na,toSet:fc,toString:LaA,transform:OVA,transforms:bJ,truncate:OUA,truthy:el,tupleid:Ne,typeParsers:AsA,utcFloor:sVA,utcInterval:pJ,utcOffset:CVA,utcSequence:BVA,utcdayofyear:iVA,utcquarter:HUA,utcweek:nVA,version:tht,visitArray:Ip,week:eVA,writeConfig:EJ,zero:gp,zoomLinear:JaA,zoomLog:NaA,zoomPow:q9,zoomSymlog:YaA},Symbol.toStringTag,{value:"Module"}));function nht(A,e,t){let i;e.x2&&(e.x?(t&&A.x>A.x2&&(i=A.x,A.x=A.x2,A.x2=i),A.width=A.x2-A.x):A.x=A.x2-(A.width||0)),e.xc&&(A.x=A.xc-(A.width||0)/2),e.y2&&(e.y?(t&&A.y>A.y2&&(i=A.y,A.y=A.y2,A.y2=i),A.height=A.y2-A.y):A.y=A.y2-(A.height||0)),e.yc&&(A.y=A.yc-(A.height||0)/2)}var oht={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},ght={"*":(A,e)=>A*e,"+":(A,e)=>A+e,"-":(A,e)=>A-e,"/":(A,e)=>A/e,"%":(A,e)=>A%e,">":(A,e)=>A>e,"<":(A,e)=>A<e,"<=":(A,e)=>A<=e,">=":(A,e)=>A>=e,"==":(A,e)=>A==e,"!=":(A,e)=>A!=e,"===":(A,e)=>A===e,"!==":(A,e)=>A!==e,"&":(A,e)=>A&e,"|":(A,e)=>A|e,"^":(A,e)=>A^e,"<<":(A,e)=>A<<e,">>":(A,e)=>A>>e,">>>":(A,e)=>A>>>e},aht={"+":A=>+A,"-":A=>-A,"~":A=>~A,"!":A=>!A};const sht=Array.prototype.slice,vb=(A,e,t)=>{const i=t?t(e[0]):e[0];return i[A].apply(i,sht.call(e,1))},rht=(A,e,t,i,n,o,g)=>new Date(A,e||0,t??1,i||0,n||0,o||0,g||0);var Iht={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(A,e,t)=>Math.max(e,Math.min(t,A)),now:Date.now,utc:Date.UTC,datetime:rht,date:A=>new Date(A).getDate(),day:A=>new Date(A).getDay(),year:A=>new Date(A).getFullYear(),month:A=>new Date(A).getMonth(),hours:A=>new Date(A).getHours(),minutes:A=>new Date(A).getMinutes(),seconds:A=>new Date(A).getSeconds(),milliseconds:A=>new Date(A).getMilliseconds(),time:A=>new Date(A).getTime(),timezoneoffset:A=>new Date(A).getTimezoneOffset(),utcdate:A=>new Date(A).getUTCDate(),utcday:A=>new Date(A).getUTCDay(),utcyear:A=>new Date(A).getUTCFullYear(),utcmonth:A=>new Date(A).getUTCMonth(),utchours:A=>new Date(A).getUTCHours(),utcminutes:A=>new Date(A).getUTCMinutes(),utcseconds:A=>new Date(A).getUTCSeconds(),utcmilliseconds:A=>new Date(A).getUTCMilliseconds(),length:A=>A.length,join:function(){return vb("join",arguments)},indexof:function(){return vb("indexOf",arguments)},lastindexof:function(){return vb("lastIndexOf",arguments)},slice:function(){return vb("slice",arguments)},reverse:A=>A.slice().reverse(),parseFloat,parseInt,upper:A=>String(A).toUpperCase(),lower:A=>String(A).toLowerCase(),substring:function(){return vb("substring",arguments,String)},split:function(){return vb("split",arguments,String)},replace:function(){return vb("replace",arguments,String)},trim:A=>String(A).trim(),regexp:RegExp,test:(A,e)=>RegExp(A).test(e)};const Cht=["view","item","group","xy","x","y"],hcA=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&hcA.add(setImmediate);const lht={Literal:(A,e)=>e.value,Identifier:(A,e)=>{const t=e.name;return A.memberDepth>0?t:t==="datum"?A.datum:t==="event"?A.event:t==="item"?A.item:oht[t]||A.params["$"+t]},MemberExpression:(A,e)=>{const t=!e.computed,i=A(e.object);t&&(A.memberDepth+=1);const n=A(e.property);if(t&&(A.memberDepth-=1),hcA.has(i[n])){console.error(`Prevented interpretation of member "${n}" which could lead to insecure code execution`);return}return i[n]},CallExpression:(A,e)=>{const t=e.arguments;let i=e.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?A(t[0])?A(t[1]):A(t[2]):(A.fn[i]||Iht[i]).apply(A.fn,t.map(A))},ArrayExpression:(A,e)=>e.elements.map(A),BinaryExpression:(A,e)=>ght[e.operator](A(e.left),A(e.right)),UnaryExpression:(A,e)=>aht[e.operator](A(e.argument)),ConditionalExpression:(A,e)=>A(e.test)?A(e.consequent):A(e.alternate),LogicalExpression:(A,e)=>e.operator==="&&"?A(e.left)&&A(e.right):A(e.left)||A(e.right),ObjectExpression:(A,e)=>e.properties.reduce((t,i)=>{A.memberDepth+=1;const n=A(i.key);return A.memberDepth-=1,hcA.has(A(i.value))?console.error(`Prevented interpretation of property "${n}" which could lead to insecure code execution`):t[n]=A(i.value),t},{})};function mL(A,e,t,i,n,o){const g=a=>lht[a.type](g,a);return g.memberDepth=0,g.fn=Object.create(e),g.params=t,g.datum=i,g.event=n,g.item=o,Cht.forEach(a=>g.fn[a]=function(){return n.vega[a](...arguments)}),g(A)}var cht={operator(A,e){const t=e.ast,i=A.functions;return n=>mL(t,i,n)},parameter(A,e){const t=e.ast,i=A.functions;return(n,o)=>mL(t,i,o,n)},event(A,e){const t=e.ast,i=A.functions;return n=>mL(t,i,void 0,void 0,n)},handler(A,e){const t=e.ast,i=A.functions;return(n,o)=>{const g=o.item&&o.item.datum;return mL(t,i,n,g,o)}},encode(A,e){const{marktype:t,channels:i}=e,n=A.functions,o=t==="group"||t==="image"||t==="rect";return(g,a)=>{const s=g.datum;let I=0,r;for(const C in i)r=mL(i[C].ast,n,a,s,void 0,g),g[C]!==r&&(g[C]=r,I=1);return t!=="rule"&&nht(g,i,o),I}}};const Bht="vega-lite",Qht='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',Eht="5.16.3",uht=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],dht="https://vega.github.io/vega-lite/",hht="Vega-Lite is a concise high-level language for interactive visualization.",mht=["vega","chart","visualization"],pht="build/vega-lite.js",fht="build/vega-lite.min.js",yht="build/vega-lite.min.js",bht="build/src/index",wht="build/src/index.d.ts",Dht={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},Ght=["bin","build","src","vega-lite*","tsconfig.json"],kht={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",jest:"NODE_OPTIONS=--experimental-vm-modules npx jest",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk --experimental-vm-modules ./node_modules/.bin/jest --runInBand test","test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},Jht={type:"git",url:"https://github.com/vega/vega-lite.git"},Nht="BSD-3-Clause",Yht={url:"https://github.com/vega/vega-lite/issues"},Rht={"@babel/core":"^7.22.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/preset-env":"^7.22.10","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-alias":"^5.0.0","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-commonjs":"^25.0.4","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.2.1","@rollup/plugin-terser":"^0.4.3","@types/chai":"^4.3.5","@types/d3":"^7.4.0","@types/jest":"^29.5.4","@types/pako":"^2.0.0","@typescript-eslint/eslint-plugin":"^6.4.1","@typescript-eslint/parser":"^6.4.1",ajv:"^8.12.0","ajv-formats":"^2.1.1",chai:"^4.3.7",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^4.0.0",d3:"^7.8.5","del-cli":"^5.0.0",eslint:"^8.47.0","eslint-config-prettier":"^9.0.0","eslint-plugin-jest":"^27.2.3","eslint-plugin-prettier":"^5.0.0","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.8.0",jest:"^29.6.3","jest-dev-server":"^9.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.0.2",puppeteer:"^15.0.0","release-it":"^16.1.5",rollup:"^3.28.1","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-sourcemaps":"^0.6.3",serve:"^14.2.1",terser:"^5.19.2","ts-jest":"^29.1.1","ts-json-schema-generator":"^1.3.0",typescript:"~5.2.2","vega-cli":"^5.25.0","vega-datasets":"^2.7.0","vega-embed":"^6.22.2","vega-tooltip":"^0.33.0","yaml-front-matter":"^4.1.1"},xht={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.2","vega-event-selector":"~3.0.1","vega-expression":"~5.1.0","vega-util":"~1.17.2",yargs:"~17.7.2"},Fht={vega:"^5.24.0"},Mht={node:">=18"},vht={name:Bht,author:Qht,version:Eht,collaborators:uht,homepage:dht,description:hht,keywords:mht,main:pht,unpkg:fht,jsdelivr:yht,module:bht,types:wht,bin:Dht,files:Ght,scripts:kht,repository:Jht,license:Nht,bugs:Yht,devDependencies:Rht,dependencies:xht,peerDependencies:Fht,engines:Mht};function mcA(A){return!!A.or}function pcA(A){return!!A.and}function fcA(A){return!!A.not}function A_(A,e){if(fcA(A))A_(A.not,e);else if(pcA(A))for(const t of A.and)A_(t,e);else if(mcA(A))for(const t of A.or)A_(t,e);else e(A)}function I2(A,e){return fcA(A)?{not:I2(A.not,e)}:pcA(A)?{and:A.and.map(t=>I2(t,e))}:mcA(A)?{or:A.or.map(t=>I2(t,e))}:e(A)}const Xe=structuredClone;function OqA(A){throw new Error(A)}function C2(A,e){const t={};for(const i of e)Je(A,i)&&(t[i]=A[i]);return t}function Er(A,e){const t={...A};for(const i of e)delete t[i];return t}Set.prototype.toJSON=function(){return`Set(${[...this].map(A=>Ui(A)).join(",")})`};function Lt(A){if(ti(A))return A;const e=ie(A)?A:Ui(A);if(e.length<250)return e;let t=0;for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);t=(t<<5)-t+n,t=t&t}return t}function ycA(A){return A===!1||A===null}function St(A,e){return A.includes(e)}function Lb(A,e){let t=0;for(const[i,n]of A.entries())if(e(n,i,t++))return!0;return!1}function bcA(A,e){let t=0;for(const[i,n]of A.entries())if(!e(n,i,t++))return!1;return!0}function qqA(A,...e){for(const t of e)Lht(A,t??{});return A}function Lht(A,e){for(const t of WA(e))EJ(A,t,e[t],!0)}function MQ(A,e){const t=[],i={};let n;for(const o of A)n=e(o),!(n in i)&&(i[n]=1,t.push(o));return t}function Sht(A,e){const t=WA(A),i=WA(e);if(t.length!==i.length)return!1;for(const n of t)if(A[n]!==e[n])return!1;return!0}function jqA(A,e){if(A.size!==e.size)return!1;for(const t of A)if(!e.has(t))return!1;return!0}function wcA(A,e){for(const t of A)if(e.has(t))return!0;return!1}function DcA(A){const e=new Set;for(const t of A){const i=hQ(t).map((o,g)=>g===0?o:`[${o}]`),n=i.map((o,g)=>i.slice(0,g+1).join(""));for(const o of n)e.add(o)}return e}function GcA(A,e){return A===void 0||e===void 0?!0:wcA(DcA(A),DcA(e))}function Ki(A){return WA(A).length===0}const WA=Object.keys,oa=Object.values,Hp=Object.entries;function pL(A){return A===!0||A===!1}function Sn(A){const e=A.replace(/\W/g,"_");return(A.match(/^\d+/)?"_":"")+e}function fL(A,e){return fcA(A)?`!(${fL(A.not,e)})`:pcA(A)?`(${A.and.map(t=>fL(t,e)).join(") && (")})`:mcA(A)?`(${A.or.map(t=>fL(t,e)).join(") || (")})`:e(A)}function e_(A,e){if(e.length===0)return!0;const t=e.shift();return t in A&&e_(A[t],e)&&delete A[t],Ki(A)}function yL(A){return A.charAt(0).toUpperCase()+A.substr(1)}function kcA(A,e="datum"){const t=hQ(A),i=[];for(let n=1;n<=t.length;n++){const o=`[${t.slice(0,n).map(OA).join("][")}]`;i.push(`${e}${o}`)}return i.join(" && ")}function PqA(A,e="datum"){return`${e}[${OA(hQ(A).join("."))}]`}function Hht(A){return A.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Bl(A){return`${hQ(A).map(Hht).join("\\.")}`}function Sb(A,e,t){return A.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),t)}function JcA(A){return`${hQ(A).join(".")}`}function l2(A){return A?hQ(A).length:0}function Do(...A){for(const e of A)if(e!==void 0)return e}let $qA=42;function AjA(A){const e=++$qA;return A?String(A)+e:e}function Zht(){$qA=42}function ejA(A){return tjA(A)?A:`__${A}`}function tjA(A){return A.startsWith("__")}function bL(A){if(A!==void 0)return(A%360+360)%360}function t_(A){return ti(A)?!0:!isNaN(A)&&!isNaN(parseFloat(A))}const ijA=Object.getPrototypeOf(structuredClone({}));function xI(A,e){if(A===e)return!0;if(A&&e&&typeof A=="object"&&typeof e=="object"){if(A.constructor.name!==e.constructor.name)return!1;let t,i;if(Array.isArray(A)){if(t=A.length,t!=e.length)return!1;for(i=t;i--!==0;)if(!xI(A[i],e[i]))return!1;return!0}if(A instanceof Map&&e instanceof Map){if(A.size!==e.size)return!1;for(i of A.entries())if(!e.has(i[0]))return!1;for(i of A.entries())if(!xI(i[1],e.get(i[0])))return!1;return!0}if(A instanceof Set&&e instanceof Set){if(A.size!==e.size)return!1;for(i of A.entries())if(!e.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(A)&&ArrayBuffer.isView(e)){if(t=A.length,t!=e.length)return!1;for(i=t;i--!==0;)if(A[i]!==e[i])return!1;return!0}if(A.constructor===RegExp)return A.source===e.source&&A.flags===e.flags;if(A.valueOf!==Object.prototype.valueOf&&A.valueOf!==ijA.valueOf)return A.valueOf()===e.valueOf();if(A.toString!==Object.prototype.toString&&A.toString!==ijA.toString)return A.toString()===e.toString();const n=Object.keys(A);if(t=n.length,t!==Object.keys(e).length)return!1;for(i=t;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[i]))return!1;for(i=t;i--!==0;){const o=n[i];if(!xI(A[o],e[o]))return!1}return!0}return A!==A&&e!==e}function Ui(A){const e=[];return function t(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let n,o;if(Array.isArray(i)){for(o="[",n=0;n<i.length;n++)n&&(o+=","),o+=t(i[n])||"null";return o+"]"}if(i===null)return"null";if(e.includes(i))throw new TypeError("Converting circular structure to JSON");const g=e.push(i)-1,a=Object.keys(i).sort();for(o="",n=0;n<a.length;n++){const s=a[n],I=t(i[s]);I&&(o&&(o+=","),o+=JSON.stringify(s)+":"+I)}return e.splice(g,1),`{${o}}`}(A)}const ud="row",dd="column",i_="facet",Hn="x",fg="y",vc="x2",vQ="y2",Zp="xOffset",c2="yOffset",Lc="radius",hd="radius2",Ql="theta",md="theta2",Sc="latitude",Hc="longitude",Zc="latitude2",El="longitude2",ur="color",LQ="fill",SQ="stroke",dr="shape",pd="size",Hb="angle",fd="opacity",Wp="fillOpacity",Kp="strokeOpacity",Up="strokeWidth",Vp="strokeDash",wL="text",B2="order",DL="detail",n_="key",Zb="tooltip",o_="href",g_="url",a_="description",Wht={x:1,y:1,x2:1,y2:1},njA={theta:1,theta2:1,radius:1,radius2:1};function ojA(A){return A in njA}const NcA={longitude:1,longitude2:1,latitude:1,latitude2:1};function gjA(A){switch(A){case Sc:return"y";case Zc:return"y2";case Hc:return"x";case El:return"x2"}}function ajA(A){return A in NcA}const Kht=WA(NcA),YcA={...Wht,...njA,...NcA,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function Q2(A){return A===ur||A===LQ||A===SQ}const sjA={row:1,column:1,facet:1},ul=WA(sjA),RcA={...YcA,...sjA},Uht=WA(RcA),{order:_pi,detail:Opi,tooltip:qpi,...Vht}=RcA,{row:jpi,column:Ppi,facet:$pi,...Xht}=Vht;function zht(A){return!!Xht[A]}function rjA(A){return!!RcA[A]}const Tht=[vc,vQ,Zc,El,md,hd];function IjA(A){return Wb(A)!==A}function Wb(A){switch(A){case vc:return Hn;case vQ:return fg;case Zc:return Sc;case El:return Hc;case md:return Ql;case hd:return Lc}return A}function Xp(A){if(ojA(A))switch(A){case Ql:return"startAngle";case md:return"endAngle";case Lc:return"outerRadius";case hd:return"innerRadius"}return A}function HQ(A){switch(A){case Hn:return vc;case fg:return vQ;case Sc:return Zc;case Hc:return El;case Ql:return md;case Lc:return hd}}function hr(A){switch(A){case Hn:case vc:return"width";case fg:case vQ:return"height"}}function CjA(A){switch(A){case Hn:return"xOffset";case fg:return"yOffset";case vc:return"x2Offset";case vQ:return"y2Offset";case Ql:return"thetaOffset";case Lc:return"radiusOffset";case md:return"theta2Offset";case hd:return"radius2Offset"}}function xcA(A){switch(A){case Hn:return"xOffset";case fg:return"yOffset"}}function _ht(A){switch(A){case"xOffset":return"x";case"yOffset":return"y"}}const Oht=WA(YcA),{x:A0i,y:e0i,x2:t0i,y2:i0i,xOffset:n0i,yOffset:o0i,latitude:g0i,longitude:a0i,latitude2:s0i,longitude2:r0i,theta:I0i,theta2:C0i,radius:l0i,radius2:c0i,...FcA}=YcA,qht=WA(FcA),McA={x:1,y:1},ZQ=WA(McA);function Go(A){return A in McA}const vcA={theta:1,radius:1},jht=WA(vcA);function s_(A){return A==="width"?Hn:fg}const ljA={xOffset:1,yOffset:1};function GL(A){return A in ljA}const{text:B0i,tooltip:Q0i,href:E0i,url:u0i,description:d0i,detail:h0i,key:m0i,order:p0i,...cjA}=FcA,Pht=WA(cjA);function $ht(A){return!!FcA[A]}function Amt(A){switch(A){case ur:case LQ:case SQ:case pd:case dr:case fd:case Up:case Vp:return!0;case Wp:case Kp:case Hb:return!1}}const BjA={...McA,...vcA,...ljA,...cjA},r_=WA(BjA);function yd(A){return!!BjA[A]}function emt(A,e){return imt(A)[e]}const QjA={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:f0i,...tmt}=QjA;function imt(A){switch(A){case ur:case LQ:case SQ:case a_:case DL:case n_:case Zb:case o_:case B2:case fd:case Wp:case Kp:case Up:case i_:case ud:case dd:return QjA;case Hn:case fg:case Zp:case c2:case Sc:case Hc:return tmt;case vc:case vQ:case Zc:case El:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case pd:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Vp:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case dr:return{point:"always",geoshape:"always"};case wL:return{text:"always"};case Hb:return{point:"always",square:"always",text:"always"};case g_:return{image:"always"};case Ql:return{text:"always",arc:"always"};case Lc:return{text:"always",arc:"always"};case md:case hd:return{arc:"always"}}}function LcA(A){switch(A){case Hn:case fg:case Ql:case Lc:case Zp:case c2:case pd:case Hb:case Up:case fd:case Wp:case Kp:case vc:case vQ:case md:case hd:return;case i_:case ud:case dd:case dr:case Vp:case wL:case Zb:case o_:case g_:case a_:return"discrete";case ur:case LQ:case SQ:return"flexible";case Sc:case Hc:case Zc:case El:case DL:case n_:case B2:return}}const nmt={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},omt={count:1,min:1,max:1};function bd(A){return!!A&&!!A.argmin}function zp(A){return!!A&&!!A.argmax}function ScA(A){return ie(A)&&!!nmt[A]}const gmt=new Set(["count","valid","missing","distinct"]);function EjA(A){return ie(A)&&gmt.has(A)}function amt(A){return ie(A)&&St(["min","max"],A)}const smt=new Set(["count","sum","distinct","valid","missing"]),rmt=new Set(["mean","average","median","q1","q3","min","max"]);function ujA(A){return sp(A)&&(A=J_(A,void 0)),"bin"+WA(A).map(e=>I_(A[e])?Sn(`_${e}_${Hp(A[e])}`):Sn(`_${e}_${A[e]}`)).join("")}function Cn(A){return A===!0||Kb(A)&&!A.binned}function ga(A){return A==="binned"||Kb(A)&&A.binned===!0}function Kb(A){return oe(A)}function I_(A){return A==null?void 0:A.param}function djA(A){switch(A){case ud:case dd:case pd:case ur:case LQ:case SQ:case Up:case fd:case Wp:case Kp:case dr:return 6;case Vp:return 4;default:return 10}}function kL(A){return!!(A!=null&&A.expr)}function mr(A){const e=WA(A||{}),t={};for(const i of e)t[i]=FI(A[i]);return t}function hjA(A){const{anchor:e,frame:t,offset:i,orient:n,angle:o,limit:g,color:a,subtitleColor:s,subtitleFont:I,subtitleFontSize:r,subtitleFontStyle:C,subtitleFontWeight:l,subtitleLineHeight:c,subtitlePadding:B,...E}=A,u={...E,...a?{fill:a}:{}},d={...e?{anchor:e}:{},...t?{frame:t}:{},...i?{offset:i}:{},...n?{orient:n}:{},...o!==void 0?{angle:o}:{},...g!==void 0?{limit:g}:{}},f={...s?{subtitleColor:s}:{},...I?{subtitleFont:I}:{},...r?{subtitleFontSize:r}:{},...C?{subtitleFontStyle:C}:{},...l?{subtitleFontWeight:l}:{},...c?{subtitleLineHeight:c}:{},...B?{subtitlePadding:B}:{}},w=C2(A,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:u,subtitleMarkConfig:w,nonMarkTitleProperties:d,subtitle:f}}function Tp(A){return ie(A)||RA(A)&&ie(A[0])}function me(A){return!!(A!=null&&A.signal)}function _p(A){return!!A.step}function Imt(A){return RA(A)?!1:"fields"in A&&!("data"in A)}function Cmt(A){return RA(A)?!1:"fields"in A&&"data"in A}function wd(A){return RA(A)?!1:"field"in A&&"data"in A}const lmt={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},cmt=WA(lmt),Bmt={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},HcA=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function mjA(A){const e=RA(A.condition)?A.condition.map(pjA):pjA(A.condition);return{...FI(A),condition:e}}function FI(A){if(kL(A)){const{expr:e,...t}=A;return{signal:e,...t}}return A}function pjA(A){if(kL(A)){const{expr:e,...t}=A;return{signal:e,...t}}return A}function Dn(A){if(kL(A)){const{expr:e,...t}=A;return{signal:e,...t}}return me(A)?A:A!==void 0?{value:A}:void 0}function Qmt(A){return me(A)?A.signal:OA(A)}function fjA(A){return me(A)?A.signal:OA(A.value)}function Wc(A){return me(A)?A.signal:A==null?null:OA(A)}function Emt(A,e,t){for(const i of t){const n=Dd(i,e.markDef,e.config);n!==void 0&&(A[i]=Dn(n))}return A}function yjA(A){return[].concat(A.type,A.style??[])}function bi(A,e,t,i={}){const{vgChannel:n,ignoreVgConfig:o}=i;return n&&e[n]!==void 0?e[n]:e[A]!==void 0?e[A]:o&&(!n||n===A)?void 0:Dd(A,e,t,i)}function Dd(A,e,t,{vgChannel:i}={}){return Do(i?C_(A,e,t.style):void 0,C_(A,e,t.style),i?t[e.type][i]:void 0,t[e.type][A],i?t.mark[i]:t.mark[A])}function C_(A,e,t){return bjA(A,yjA(e),t)}function bjA(A,e,t){e=te(e);let i;for(const n of e){const o=t[n];o&&o[A]!==void 0&&(i=o[A])}return i}function wjA(A,e){return te(A).reduce((t,i)=>(t.field.push(jA(i,e)),t.order.push(i.sort??"ascending"),t),{field:[],order:[]})}function DjA(A,e){const t=[...A];return e.forEach(i=>{for(const n of t)if(xI(n,i))return;t.push(i)}),t}function GjA(A,e){return xI(A,e)||!e?A:A?[...te(A),...te(e)].join(", "):e}function kjA(A,e){const t=A.value,i=e.value;if(t==null||i===null)return{explicit:A.explicit,value:null};if((Tp(t)||me(t))&&(Tp(i)||me(i)))return{explicit:A.explicit,value:GjA(t,i)};if(Tp(t)||me(t))return{explicit:A.explicit,value:t};if(Tp(i)||me(i))return{explicit:A.explicit,value:i};if(!Tp(t)&&!me(t)&&!Tp(i)&&!me(i))return{explicit:A.explicit,value:DjA(t,i)};throw new Error("It should never reach here")}function ZcA(A){return`Invalid specification ${Ui(A)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const umt='Autosize "fit" only works for single views and layered views.';function JjA(A){return`${A=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function NjA(A){const e=A=="width"?"Width":"Height",t=A=="width"?"x":"y";return`${e} "container" only works well with autosize "fit" or "fit-${t}".`}function YjA(A){return A?`Dropping "fit-${A}" because spec has discrete ${hr(A)}.`:'Dropping "fit" because spec has discrete size.'}function WcA(A){return`Unknown field for ${A}. Cannot calculate view size.`}function RjA(A){return`Cannot project a selection on encoding channel "${A}", which has no field.`}function dmt(A,e){return`Cannot project a selection on encoding channel "${A}" as it uses an aggregate function ("${e}").`}function hmt(A){return`The "nearest" transform is not supported for ${A} marks.`}function xjA(A){return`Selection not supported for ${A} yet.`}function mmt(A){return`Cannot find a selection named "${A}".`}const pmt="Scale bindings are currently only supported for scales with unbinned, continuous domains.",fmt="Legend bindings are only supported for selections over an individual field or encoding channel.";function ymt(A){return`Lookups can only be performed on selection parameters. "${A}" is a variable parameter.`}function bmt(A){return`Cannot define and lookup the "${A}" selection in the same view. Try moving the lookup into a second, layered view?`}const wmt="The same selection must be used to override scale domains in a layered view.",Dmt='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Gmt(A){return`Unknown repeated value "${A}".`}function FjA(A){return`The "columns" property cannot be used when "${A}" has nested row/column.`}const kmt="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Jmt(A){return`Unrecognized parse "${A}".`}function MjA(A,e,t){return`An ancestor parsed field "${A}" as ${t} but a child wants to parse the field as ${e}.`}const Nmt="Attempt to add the same child twice.";function Ymt(A){return`Ignoring an invalid transform: ${Ui(A)}.`}const Rmt='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function vjA(A){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${A} are dropped.`}function xmt(A){const{parentProjection:e,projection:t}=A;return`Layer's shared projection ${Ui(e)} is overridden by a child projection ${Ui(t)}.`}const Fmt="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Mmt(A){return`${A}Offset dropped because ${A} is continuous`}function vmt(A,e,t){return`Channel ${A} is a ${e}. Converted to {value: ${Ui(t)}}.`}function LjA(A){return`Invalid field type "${A}".`}function Lmt(A,e){return`Invalid field type "${A}" for aggregate: "${e}", using "quantitative" instead.`}function Smt(A){return`Invalid aggregation operator "${A}".`}function SjA(A,e){const{fill:t,stroke:i}=e;return`Dropping color ${A} as the plot also has ${t&&i?"fill and stroke":t?"fill":"stroke"}.`}function Hmt(A){return`Position range does not support relative band size for ${A}.`}function KcA(A,e){return`Dropping ${Ui(A)} from channel "${e}" since it does not contain any data field, datum, value, or signal.`}const Zmt="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function l_(A,e,t){return`${A} dropped as it is incompatible with "${e}"${t?` when ${t}`:""}.`}function Wmt(A){return`${A}-encoding is dropped as ${A} is not a valid encoding channel.`}function Kmt(A){return`${A} encoding should be discrete (ordinal / nominal / binned).`}function Umt(A){return`${A} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Vmt(A){return`Facet encoding dropped as ${A.join(" and ")} ${A.length>1?"are":"is"} also specified.`}function UcA(A,e){return`Using discrete channel "${A}" to encode "${e}" field can be misleading as it does not encode ${e==="ordinal"?"order":"magnitude"}.`}function Xmt(A){return`The ${A} for range marks cannot be an expression`}function zmt(A,e){return`Line mark is for continuous lines and thus cannot be used with ${A&&e?"x2 and y2":A?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Tmt(A,e){return`Specified orient "${A}" overridden with "${e}".`}function _mt(A){return`Cannot use the scale property "${A}" with non-color channel.`}function Omt(A){return`Cannot use the relative band size with ${A} scale.`}function qmt(A){return`Using unaggregated domain with raw field has no effect (${Ui(A)}).`}function jmt(A){return`Unaggregated domain not applicable for "${A}" since it produces values outside the origin domain of the source data.`}function Pmt(A){return`Unaggregated domain is currently unsupported for log scale (${Ui(A)}).`}function $mt(A){return`Cannot apply size to non-oriented mark "${A}".`}function Apt(A,e,t){return`Channel "${A}" does not work with "${e}" scale. We are using "${t}" scale instead.`}function ept(A,e){return`FieldDef does not work with "${A}" scale. We are using "${e}" scale instead.`}function HjA(A,e,t){return`${t}-scale's "${e}" is dropped as it does not work with ${A} scale.`}function ZjA(A){return`The step for "${A}" is dropped because the ${A==="width"?"x":"y"} is continuous.`}function tpt(A,e,t,i){return`Conflicting ${e.toString()} property "${A.toString()}" (${Ui(t)} and ${Ui(i)}). Using ${Ui(t)}.`}function ipt(A,e,t,i){return`Conflicting ${e.toString()} property "${A.toString()}" (${Ui(t)} and ${Ui(i)}). Using the union of the two domains.`}function npt(A){return`Setting the scale to be independent for "${A}" means we also have to set the guide (axis or legend) to be independent.`}function opt(A){return`Dropping sort property ${Ui(A)} as unioned domains only support boolean or op "count", "min", and "max".`}const WjA="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",gpt="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",apt="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",spt="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function rpt(A){return`Cannot stack "${A}" if there is already "${A}2".`}function Ipt(A){return`Cannot stack non-linear scale (${A}).`}function Cpt(A){return`Stacking is applied even though the aggregate function is non-summative ("${A}").`}function c_(A,e){return`Invalid ${A}: ${Ui(e)}.`}function lpt(A){return`Dropping day from datetime ${Ui(A)} as day cannot be combined with other units.`}function cpt(A,e){return`${e?"extent ":""}${e&&A?"and ":""}${A?"center ":""}${e&&A?"are ":"is "}not needed when data are aggregated.`}function Bpt(A,e,t){return`${A} is not usually used with ${e} for ${t}.`}function Qpt(A,e){return`Continuous axis should not have customized aggregation function ${A}; ${e} already agregates the axis.`}function KjA(A){return`1D error band does not support ${A}.`}function UjA(A){return`Channel ${A} is required for "binned" bin.`}function Ept(A){return`Channel ${A} should not be used with "binned" bin.`}function upt(A){return`Domain for ${A} is required for threshold scale.`}const VjA=kaA(GaA);let E2=VjA;function dpt(A){return E2=A,E2}function hpt(){return E2=VjA,E2}function XA(...A){E2.warn(...A)}function mpt(...A){E2.debug(...A)}function Ub(A){if(A&&oe(A)){for(const e of XcA)if(e in A)return!0}return!1}const XjA=["january","february","march","april","may","june","july","august","september","october","november","december"],ppt=XjA.map(A=>A.substr(0,3)),zjA=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],fpt=zjA.map(A=>A.substr(0,3));function ypt(A){if(t_(A)&&(A=+A),ti(A))return A>4&&XA(c_("quarter",A)),A-1;throw new Error(c_("quarter",A))}function bpt(A){if(t_(A)&&(A=+A),ti(A))return A-1;{const e=A.toLowerCase(),t=XjA.indexOf(e);if(t!==-1)return t;const i=e.substr(0,3),n=ppt.indexOf(i);if(n!==-1)return n;throw new Error(c_("month",A))}}function wpt(A){if(t_(A)&&(A=+A),ti(A))return A%7;{const e=A.toLowerCase(),t=zjA.indexOf(e);if(t!==-1)return t;const i=e.substr(0,3),n=fpt.indexOf(i);if(n!==-1)return n;throw new Error(c_("day",A))}}function VcA(A,e){const t=[];if(e&&A.day!==void 0&&WA(A).length>1&&(XA(lpt(A)),A=Xe(A),delete A.day),A.year!==void 0?t.push(A.year):t.push(2012),A.month!==void 0){const i=e?bpt(A.month):A.month;t.push(i)}else if(A.quarter!==void 0){const i=e?ypt(A.quarter):A.quarter;t.push(ti(i)?i*3:`${i}*3`)}else t.push(0);if(A.date!==void 0)t.push(A.date);else if(A.day!==void 0){const i=e?wpt(A.day):A.day;t.push(ti(i)?i+1:`${i}+1`)}else t.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const n=A[i];t.push(typeof n>"u"?0:n)}return t}function Vb(A){const e=VcA(A,!0).join(", ");return A.utc?`utc(${e})`:`datetime(${e})`}function Dpt(A){const e=VcA(A,!1).join(", ");return A.utc?`utc(${e})`:`datetime(${e})`}function Gpt(A){const e=VcA(A,!0);return A.utc?+new Date(Date.UTC(...e)):+new Date(...e)}const TjA={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},XcA=WA(TjA);function kpt(A){return!!TjA[A]}function Xb(A){return oe(A)?A.binned:_jA(A)}function _jA(A){return A&&A.startsWith("binned")}function zcA(A){return A.startsWith("utc")}function Jpt(A){return A.substring(3)}const Npt={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function B_(A){return XcA.filter(e=>qjA(A,e))}function OjA(A){const e=B_(A);return e[e.length-1]}function qjA(A,e){const t=A.indexOf(e);return!(t<0||t>0&&e==="seconds"&&A.charAt(t-1)==="i"||A.length>t+3&&e==="day"&&A.charAt(t+3)==="o"||t>0&&e==="year"&&A.charAt(t-1)==="f")}function Ypt(A,e,{end:t}={end:!1}){const i=kcA(e),n=zcA(A)?"utc":"";function o(s){return s==="quarter"?`(${n}quarter(${i})-1)`:`${n}${s}(${i})`}let g;const a={};for(const s of XcA)qjA(A,s)&&(a[s]=o(s),g=s);return t&&(a[g]+="+1"),Dpt(a)}function jjA(A){if(!A)return;const e=B_(A);return`timeUnitSpecifier(${Ui(e)}, ${Ui(Npt)})`}function Rpt(A,e,t){if(!A)return;const i=jjA(A);return`${t||zcA(A)?"utc":"time"}Format(${e}, ${i})`}function yg(A){if(!A)return;let e;return ie(A)?_jA(A)?e={unit:A.substring(6),binned:!0}:e={unit:A}:oe(A)&&(e={...A,...A.unit?{unit:A.unit}:{}}),zcA(e.unit)&&(e.utc=!0,e.unit=Jpt(e.unit)),e}function xpt(A){const{utc:e,...t}=yg(A);return t.unit?(e?"utc":"")+WA(t).map(i=>Sn(`${i==="unit"?"":`_${i}_`}${t[i]}`)).join(""):(e?"utc":"")+"timeunit"+WA(t).map(i=>Sn(`_${i}_${t[i]}`)).join("")}function PjA(A,e=t=>t){const t=yg(A),i=OjA(t.unit);if(i&&i!=="day"){const n={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:g}=$jA(i,t.step),a={...n,[g]:+n[g]+o};return`${e(Vb(a))} - ${e(Vb(n))}`}}const Fpt={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Mpt(A){return!!Fpt[A]}function $jA(A,e=1){if(Mpt(A))return{part:A,step:e};switch(A){case"day":case"dayofyear":return{part:"date",step:e};case"quarter":return{part:"month",step:e*3};case"week":return{part:"date",step:e*7}}}function vpt(A){return A==null?void 0:A.param}function TcA(A){return!!(A!=null&&A.field)&&A.equal!==void 0}function _cA(A){return!!(A!=null&&A.field)&&A.lt!==void 0}function OcA(A){return!!(A!=null&&A.field)&&A.lte!==void 0}function qcA(A){return!!(A!=null&&A.field)&&A.gt!==void 0}function jcA(A){return!!(A!=null&&A.field)&&A.gte!==void 0}function PcA(A){return!!(A!=null&&A.field&&(RA(A.range)&&A.range.length===2||me(A.range)))}function $cA(A){return!!(A!=null&&A.field)&&(RA(A.oneOf)||RA(A.in))}function Lpt(A){return!!(A!=null&&A.field)&&A.valid!==void 0}function A6A(A){return $cA(A)||TcA(A)||PcA(A)||_cA(A)||qcA(A)||OcA(A)||jcA(A)}function WQ(A,e){return N_(A,{timeUnit:e,wrapTime:!0})}function Spt(A,e){return A.map(t=>WQ(t,e))}function e6A(A,e=!0){const{field:t}=A,i=yg(A.timeUnit),{unit:n,binned:o}=i||{},g=jA(A,{expr:"datum"}),a=n?`time(${o?g:Ypt(n,t)})`:g;if(TcA(A))return`${a}===${WQ(A.equal,n)}`;if(_cA(A)){const s=A.lt;return`${a}<${WQ(s,n)}`}else if(qcA(A)){const s=A.gt;return`${a}>${WQ(s,n)}`}else if(OcA(A)){const s=A.lte;return`${a}<=${WQ(s,n)}`}else if(jcA(A)){const s=A.gte;return`${a}>=${WQ(s,n)}`}else{if($cA(A))return`indexof([${Spt(A.oneOf,n).join(",")}], ${a}) !== -1`;if(Lpt(A))return ABA(a,A.valid);if(PcA(A)){const{range:s}=A,I=me(s)?{signal:`${s.signal}[0]`}:s[0],r=me(s)?{signal:`${s.signal}[1]`}:s[1];if(I!==null&&r!==null&&e)return"inrange("+a+", ["+WQ(I,n)+", "+WQ(r,n)+"])";const C=[];return I!==null&&C.push(`${a} >= ${WQ(I,n)}`),r!==null&&C.push(`${a} <= ${WQ(r,n)}`),C.length>0?C.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Ui(A)}`)}function ABA(A,e=!0){return e?`isValid(${A}) && isFinite(+${A})`:`!isValid(${A}) || !isFinite(+${A})`}function Hpt(A){return A6A(A)&&A.timeUnit?{...A,timeUnit:yg(A.timeUnit)}:A}const JL={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Zpt(A){return A==="quantitative"||A==="temporal"}function t6A(A){return A==="ordinal"||A==="nominal"}const zb=JL.quantitative,eBA=JL.ordinal,u2=JL.temporal,tBA=JL.nominal,d2=JL.geojson;function Wpt(A){if(A)switch(A=A.toLowerCase(),A){case"q":case zb:return"quantitative";case"t":case u2:return"temporal";case"o":case eBA:return"ordinal";case"n":case tBA:return"nominal";case d2:return"geojson"}}const pr={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},iBA={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function Kpt(A,e){const t=iBA[A],i=iBA[e];return t===i||t==="ordinal-position"&&i==="time"||i==="ordinal-position"&&t==="time"}const Upt={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function i6A(A){return Upt[A]}const n6A=new Set(["linear","log","pow","sqrt","symlog"]),o6A=new Set([...n6A,"time","utc"]);function g6A(A){return n6A.has(A)}const a6A=new Set(["quantile","quantize","threshold"]),Vpt=new Set([...o6A,...a6A,"sequential","identity"]),Xpt=new Set(["ordinal","bin-ordinal","point","band"]);function bg(A){return Xpt.has(A)}function MI(A){return Vpt.has(A)}function Kc(A){return o6A.has(A)}function h2(A){return a6A.has(A)}const zpt={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function Tpt(A){return!ie(A)&&!!A.name}function s6A(A){return A==null?void 0:A.param}function _pt(A){return A==null?void 0:A.unionWith}function Opt(A){return oe(A)&&"field"in A}const qpt={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:y0i,domain:b0i,range:w0i,rangeMax:D0i,rangeMin:G0i,scheme:k0i,...jpt}=qpt,Ppt=WA(jpt);function nBA(A,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(A);case"bins":return!["point","band","identity","ordinal"].includes(A);case"round":return Kc(A)||A==="band"||A==="point";case"padding":case"rangeMin":case"rangeMax":return Kc(A)||["point","band"].includes(A);case"paddingOuter":case"align":return["point","band"].includes(A);case"paddingInner":return A==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return Kc(A);case"nice":return Kc(A)||A==="quantize"||A==="threshold";case"exponent":return A==="pow";case"base":return A==="log";case"constant":return A==="symlog";case"zero":return MI(A)&&!St(["log","time","utc","threshold","quantile"],A)}}function r6A(A,e){switch(e){case"interpolate":case"scheme":case"domainMid":return Q2(A)?void 0:_mt(e);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function $pt(A,e){return St([eBA,tBA],e)?A===void 0||bg(A):e===u2?St([pr.TIME,pr.UTC,void 0],A):e===zb?g6A(A)||h2(A)||A===void 0:!0}function A0t(A,e,t=!1){if(!yd(A))return!1;switch(A){case Hn:case fg:case Zp:case c2:case Ql:case Lc:return Kc(e)||e==="band"?!0:e==="point"?!t:!1;case pd:case Up:case fd:case Wp:case Kp:case Hb:return Kc(e)||h2(e)||St(["band","point","ordinal"],e);case ur:case LQ:case SQ:return e!=="band";case Vp:case dr:return e==="ordinal"||h2(e)}}const ps={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},I6A=ps.arc,Q_=ps.area,E_=ps.bar,e0t=ps.image,u_=ps.line,d_=ps.point,t0t=ps.rect,h_=ps.rule,C6A=ps.text,oBA=ps.tick,i0t=ps.trail,gBA=ps.circle,aBA=ps.square,l6A=ps.geoshape;function Op(A){return["line","area","trail"].includes(A)}function NL(A){return["rect","bar","image","arc"].includes(A)}const n0t=new Set(WA(ps));function KQ(A){return A.type}const o0t=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],g0t=["fill","fillOpacity"],a0t=[...o0t,...g0t],s0t={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},c6A=WA(s0t),r0t={area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]},I0t={color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},C0t={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},B6A=WA(C0t);function Tb(A){return A&&A.band!=null}const l0t={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},Q6A=5,c0t={binSpacing:1,continuousBandSize:Q6A,minBandSize:.25,timeUnitBandPosition:.5},B0t={binSpacing:0,continuousBandSize:Q6A,minBandSize:.25,timeUnitBandPosition:.5},Q0t={thickness:1};function E0t(A){return KQ(A)?A.type:A}function sBA(A){const{channel:e,channelDef:t,markDef:i,scale:n,config:o}=A,g=IBA(A);return zA(t)&&!EjA(t.aggregate)&&n&&Kc(n.get("type"))?u0t({fieldDef:t,channel:e,markDef:i,ref:g,config:o}):g}function u0t({fieldDef:A,channel:e,markDef:t,ref:i,config:n}){return Op(t.type)?i:bi("invalid",t,n)===null?[d0t(A,e),i]:i}function d0t(A,e){const t=rBA(A,!0),i=Wb(e)==="y"?{field:{group:"height"}}:{value:0};return{test:t,...i}}function rBA(A,e=!0){return ABA(ie(A)?A:jA(A,{expr:"datum"}),!e)}function h0t(A){const{datum:e}=A;return Ub(e)?Vb(e):`${Ui(e)}`}function _b(A,e,t,i){const n={};if(e&&(n.scale=e),VQ(A)){const{datum:o}=A;Ub(o)?n.signal=Vb(o):me(o)?n.signal=o.signal:kL(o)?n.signal=o.expr:n.value=o}else n.field=jA(A,t);if(i){const{offset:o,band:g}=i;o&&(n.offset=o),g&&(n.band=g)}return n}function m_({scaleName:A,fieldOrDatumDef:e,fieldOrDatumDef2:t,offset:i,startSuffix:n,endSuffix:o="end",bandPosition:g=.5}){const a=!me(g)&&0<g&&g<1?"datum":void 0,s=jA(e,{expr:a,suffix:n}),I=t!==void 0?jA(t,{expr:a}):jA(e,{suffix:o,expr:a}),r={};if(g===0||g===1){r.scale=A;const C=g===0?s:I;r.field=C}else{const C=me(g)?`(1-${g.signal}) * ${s} + ${g.signal} * ${I}`:`${1-g} * ${s} + ${g} * ${I}`;r.signal=`scale("${A}", ${C})`}return i&&(r.offset=i),r}function m0t({scaleName:A,fieldDef:e}){const t=jA(e,{expr:"datum"}),i=jA(e,{expr:"datum",suffix:"end"});return`abs(scale("${A}", ${i}) - scale("${A}", ${t}))`}function IBA({channel:A,channelDef:e,channel2Def:t,markDef:i,config:n,scaleName:o,scale:g,stack:a,offset:s,defaultRef:I,bandPosition:r}){if(e){if(je(e)){const C=g==null?void 0:g.get("type");if(fs(e)){r??(r=qp({fieldDef:e,fieldDef2:t,markDef:i,config:n}));const{bin:l,timeUnit:c,type:B}=e;if(Cn(l)||r&&c&&B===u2)return a!=null&&a.impute?_b(e,o,{binSuffix:"mid"},{offset:s}):r&&!bg(C)?m_({scaleName:o,fieldOrDatumDef:e,bandPosition:r,offset:s}):_b(e,o,ML(e,A)?{binSuffix:"range"}:{},{offset:s});if(ga(l)){if(zA(t))return m_({scaleName:o,fieldOrDatumDef:e,fieldOrDatumDef2:t,bandPosition:r,offset:s});XA(UjA(A===Hn?vc:vQ))}}return _b(e,o,bg(C)?{binSuffix:"range"}:{},{offset:s,band:C==="band"?r??e.bandPosition??.5:void 0})}else if(Vc(e)){const C=e.value,l=s?{offset:s}:{};return{...YL(A,C),...l}}}return Ct(I)&&(I=I()),I&&{...I,...s?{offset:s}:{}}}function YL(A,e){return St(["x","x2"],A)&&e==="width"?{field:{group:"width"}}:St(["y","y2"],A)&&e==="height"?{field:{group:"height"}}:Dn(e)}function Ob(A){return A&&A!=="number"&&A!=="time"}function E6A(A,e,t){return`${A}(${e}${t?`, ${Ui(t)}`:""})`}const p0t=" – ";function CBA({fieldOrDatumDef:A,format:e,formatType:t,expr:i,normalizeStack:n,config:o}){var g,a;if(Ob(t))return Uc({fieldOrDatumDef:A,format:e,formatType:t,expr:i,config:o});const s=u6A(A,i,n),I=m2(A);if(e===void 0&&t===void 0&&o.customFormatTypes){if(I==="quantitative"){if(n&&o.normalizedNumberFormatType)return Uc({fieldOrDatumDef:A,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:i,config:o});if(o.numberFormatType)return Uc({fieldOrDatumDef:A,format:o.numberFormat,formatType:o.numberFormatType,expr:i,config:o})}if(I==="temporal"&&o.timeFormatType&&zA(A)&&A.timeUnit===void 0)return Uc({fieldOrDatumDef:A,format:o.timeFormat,formatType:o.timeFormatType,expr:i,config:o})}if(b2(A)){const r=y0t({field:s,timeUnit:zA(A)?(g=yg(A.timeUnit))==null?void 0:g.unit:void 0,format:e,formatType:o.timeFormatType,rawTimeFormat:o.timeFormat,isUTCScale:qb(A)&&((a=A.scale)==null?void 0:a.type)===pr.UTC});return r?{signal:r}:void 0}if(e=lBA({type:I,specifiedFormat:e,config:o,normalizeStack:n}),zA(A)&&Cn(A.bin)){const r=jA(A,{expr:i,binSuffix:"end"});return{signal:RL(s,r,e,t,o)}}else return e||m2(A)==="quantitative"?{signal:`${m6A(s,e)}`}:{signal:`isValid(${s}) ? ${s} : ""+${s}`}}function u6A(A,e,t){return zA(A)?t?`${jA(A,{expr:e,suffix:"end"})}-${jA(A,{expr:e,suffix:"start"})}`:jA(A,{expr:e}):h0t(A)}function Uc({fieldOrDatumDef:A,format:e,formatType:t,expr:i,normalizeStack:n,config:o,field:g}){if(g??(g=u6A(A,i,n)),g!=="datum.value"&&zA(A)&&Cn(A.bin)){const a=jA(A,{expr:i,binSuffix:"end"});return{signal:RL(g,a,e,t,o)}}return{signal:E6A(t,g,e)}}function d6A(A,e,t,i,n,o){var g;if(!(ie(i)&&Ob(i))&&!(t===void 0&&i===void 0&&n.customFormatTypes&&m2(A)==="quantitative"&&(n.normalizedNumberFormatType&&p2(A)&&A.stack==="normalize"||n.numberFormatType))){if(p2(A)&&A.stack==="normalize"&&n.normalizedNumberFormat)return lBA({type:"quantitative",config:n,normalizeStack:!0});if(b2(A)){const a=zA(A)?(g=yg(A.timeUnit))==null?void 0:g.unit:void 0;return a===void 0&&n.customFormatTypes&&n.timeFormatType?void 0:f0t({specifiedFormat:t,timeUnit:a,config:n,omitTimeFormatConfig:o})}return lBA({type:e,specifiedFormat:t,config:n})}}function h6A(A,e,t){var i;if(A&&(me(A)||A==="number"||A==="time"))return A;if(b2(e)&&t!=="time"&&t!=="utc")return zA(e)&&(i=yg(e==null?void 0:e.timeUnit))!=null&&i.utc?"utc":"time"}function lBA({type:A,specifiedFormat:e,config:t,normalizeStack:i}){if(ie(e))return e;if(A===zb)return i?t.normalizedNumberFormat:t.numberFormat}function f0t({specifiedFormat:A,timeUnit:e,config:t,omitTimeFormatConfig:i}){return A||(e?{signal:jjA(e)}:i?void 0:t.timeFormat)}function m6A(A,e){return`format(${A}, "${e||""}")`}function p6A(A,e,t,i){return Ob(t)?E6A(t,A,e):m6A(A,(ie(e)?e:void 0)??i.numberFormat)}function RL(A,e,t,i,n){if(t===void 0&&i===void 0&&n.customFormatTypes&&n.numberFormatType)return RL(A,e,n.numberFormat,n.numberFormatType,n);const o=p6A(A,t,i,n),g=p6A(e,t,i,n);return`${ABA(A,!1)} ? "null" : ${o} + "${p0t}" + ${g}`}function y0t({field:A,timeUnit:e,format:t,formatType:i,rawTimeFormat:n,isUTCScale:o}){return!e||t?!e&&i?`${i}(${A}, '${t}')`:(t=ie(t)?t:n,`${o?"utc":"time"}Format(${A}, '${t}')`):Rpt(e,A,o)}const p_="min",b0t={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function f6A(A){return A in b0t}function y6A(A){return!!(A!=null&&A.encoding)}function UQ(A){return A&&(A.op==="count"||!!A.field)}function b6A(A){return A&&RA(A)}function xL(A){return"row"in A||"column"in A}function cBA(A){return!!A&&"header"in A}function f_(A){return"facet"in A}function w0t(A){return A.param}function D0t(A){return A&&!ie(A)&&"repeat"in A}function w6A(A){const{field:e,timeUnit:t,bin:i,aggregate:n}=A;return{...t?{timeUnit:t}:{},...i?{bin:i}:{},...n?{aggregate:n}:{},field:e}}function BBA(A){return"sort"in A}function qp({fieldDef:A,fieldDef2:e,markDef:t,config:i}){if(je(A)&&A.bandPosition!==void 0)return A.bandPosition;if(zA(A)){const{timeUnit:n,bin:o}=A;if(n&&!e)return Dd("timeUnitBandPosition",t,i);if(Cn(o))return .5}}function D6A({channel:A,fieldDef:e,fieldDef2:t,markDef:i,config:n,scaleType:o,useVlSizeChannel:g}){var a,s,I;const r=hr(A),C=bi(g?"size":r,i,n,{vgChannel:r});if(C!==void 0)return C;if(zA(e)){const{timeUnit:l,bin:c}=e;if(l&&!t)return{band:Dd("timeUnitBandSize",i,n)};if(Cn(c)&&!bg(o))return{band:1}}if(NL(i.type))return o?bg(o)?((a=n[i.type])==null?void 0:a.discreteBandSize)||{band:1}:(s=n[i.type])==null?void 0:s.continuousBandSize:(I=n[i.type])==null?void 0:I.discreteBandSize}function G6A(A,e,t,i){return Cn(A.bin)||A.timeUnit&&fs(A)&&A.type==="temporal"?qp({fieldDef:A,fieldDef2:e,markDef:t,config:i})!==void 0:!1}function k6A(A){return A&&!!A.sort&&!A.field}function y_(A){return A&&"condition"in A}function b_(A){const e=A==null?void 0:A.condition;return!!e&&!RA(e)&&zA(e)}function FL(A){const e=A==null?void 0:A.condition;return!!e&&!RA(e)&&je(e)}function G0t(A){const e=A==null?void 0:A.condition;return!!e&&(RA(e)||Vc(e))}function zA(A){return A&&(!!A.field||A.aggregate==="count")}function m2(A){return A==null?void 0:A.type}function VQ(A){return A&&"datum"in A}function jp(A){return fs(A)&&!D_(A)||w_(A)}function J6A(A){return fs(A)&&A.type==="quantitative"&&!A.bin||w_(A)}function w_(A){return VQ(A)&&ti(A.datum)}function je(A){return zA(A)||VQ(A)}function fs(A){return A&&("field"in A||A.aggregate==="count")&&"type"in A}function Vc(A){return A&&"value"in A&&"value"in A}function qb(A){return A&&("scale"in A||"sort"in A)}function p2(A){return A&&("axis"in A||"stack"in A||"impute"in A)}function N6A(A){return A&&"legend"in A}function Y6A(A){return A&&("format"in A||"formatType"in A)}function k0t(A){return Er(A,["legend","axis","header","scale"])}function J0t(A){return"op"in A}function jA(A,e={}){let t=A.field;const i=e.prefix;let n=e.suffix,o="";if(Y0t(A))t=ejA("count");else{let g;if(!e.nofn)if(J0t(A))g=A.op;else{const{bin:a,aggregate:s,timeUnit:I}=A;Cn(a)?(g=ujA(a),n=(e.binSuffix??"")+(e.suffix??"")):s?zp(s)?(o=`["${t}"]`,t=`argmax_${s.argmax}`):bd(s)?(o=`["${t}"]`,t=`argmin_${s.argmin}`):g=String(s):I&&!Xb(I)&&(g=xpt(I),n=(!["range","mid"].includes(e.binSuffix)&&e.binSuffix||"")+(e.suffix??""))}g&&(t=t?`${g}_${t}`:g)}return n&&(t=`${t}_${n}`),i&&(t=`${i}_${t}`),e.forAs?JcA(t):e.expr?PqA(t,e.expr)+o:Bl(t)+o}function D_(A){switch(A.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return zA(A)&&!!A.bin;case"temporal":return!1}throw new Error(LjA(A.type))}function N0t(A){var e;return qb(A)&&h2((e=A.scale)==null?void 0:e.type)}function Y0t(A){return A.aggregate==="count"}function R0t(A,e){var t;const{field:i,bin:n,timeUnit:o,aggregate:g}=A;if(g==="count")return e.countTitle;if(Cn(n))return`${i} (binned)`;if(o&&!Xb(o)){const a=(t=yg(o))==null?void 0:t.unit;if(a)return`${i} (${B_(a).join("-")})`}else if(g)return zp(g)?`${i} for max ${g.argmax}`:bd(g)?`${i} for min ${g.argmin}`:`${yL(g)} of ${i}`;return i}function x0t(A){const{aggregate:e,bin:t,timeUnit:i,field:n}=A;if(zp(e))return`${n} for argmax(${e.argmax})`;if(bd(e))return`${n} for argmin(${e.argmin})`;const o=i&&!Xb(i)?yg(i):void 0,g=e||(o==null?void 0:o.unit)||(o==null?void 0:o.maxbins)&&"timeunit"||Cn(t)&&"bin";return g?`${g.toUpperCase()}(${n})`:n}const R6A=(A,e)=>{switch(e.fieldTitle){case"plain":return A.field;case"functional":return x0t(A);default:return R0t(A,e)}};let x6A=R6A;function F6A(A){x6A=A}function F0t(){F6A(R6A)}function f2(A,e,{allowDisabling:t,includeDefault:i=!0}){var n;const o=(n=QBA(A))==null?void 0:n.title;if(!zA(A))return o??A.title;const g=A,a=i?EBA(g,e):void 0;return t?Do(o,g.title,a):o??g.title??a}function QBA(A){if(p2(A)&&A.axis)return A.axis;if(N6A(A)&&A.legend)return A.legend;if(cBA(A)&&A.header)return A.header}function EBA(A,e){return x6A(A,e)}function G_(A){if(Y6A(A)){const{format:e,formatType:t}=A;return{format:e,formatType:t}}else{const e=QBA(A)??{},{format:t,formatType:i}=e;return{format:t,formatType:i}}}function M0t(A,e){var t;switch(e){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(BBA(A)&&RA(A.sort))return"ordinal";const{aggregate:i,bin:n,timeUnit:o}=A;if(o)return"temporal";if(n||i&&!zp(i)&&!bd(i))return"quantitative";if(qb(A)&&(t=A.scale)!=null&&t.type)switch(iBA[A.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function XQ(A){if(zA(A))return A;if(b_(A))return A.condition}function tg(A){if(je(A))return A;if(FL(A))return A.condition}function M6A(A,e,t,i={}){if(ie(A)||ti(A)||sp(A)){const n=ie(A)?"string":ti(A)?"number":"boolean";return XA(vmt(e,n,A)),{value:A}}return je(A)?k_(A,e,t,i):FL(A)?{...A,condition:k_(A.condition,e,t,i)}:A}function k_(A,e,t,i){if(Y6A(A)){const{format:n,formatType:o,...g}=A;if(Ob(o)&&!t.customFormatTypes)return XA(vjA(e)),k_(g,e,t,i)}else{const n=p2(A)?"axis":N6A(A)?"legend":cBA(A)?"header":null;if(n&&A[n]){const{format:o,formatType:g,...a}=A[n];if(Ob(g)&&!t.customFormatTypes)return XA(vjA(e)),k_({...A,[n]:a},e,t,i)}}return zA(A)?uBA(A,e,i):v0t(A)}function v0t(A){let e=A.type;if(e)return A;const{datum:t}=A;return e=ti(t)?"quantitative":ie(t)?"nominal":Ub(t)?"temporal":void 0,{...A,type:e}}function uBA(A,e,{compositeMark:t=!1}={}){const{aggregate:i,timeUnit:n,bin:o,field:g}=A,a={...A};if(!t&&i&&!ScA(i)&&!zp(i)&&!bd(i)&&(XA(Smt(i)),delete a.aggregate),n&&(a.timeUnit=yg(n)),g&&(a.field=`${g}`),Cn(o)&&(a.bin=J_(o,e)),ga(o)&&!Go(e)&&XA(Ept(e)),fs(a)){const{type:s}=a,I=Wpt(s);s!==I&&(a.type=I),s!=="quantitative"&&EjA(i)&&(XA(Lmt(s,i)),a.type="quantitative")}else if(!IjA(e)){const s=M0t(a,e);a.type=s}if(fs(a)){const{compatible:s,warning:I}=L0t(a,e)||{};s===!1&&XA(I)}if(BBA(a)&&ie(a.sort)){const{sort:s}=a;if(f6A(s))return{...a,sort:{encoding:s}};const I=s.substr(1);if(s.charAt(0)==="-"&&f6A(I))return{...a,sort:{encoding:I,order:"descending"}}}if(cBA(a)){const{header:s}=a;if(s){const{orient:I,...r}=s;if(I)return{...a,header:{...r,labelOrient:s.labelOrient||I,titleOrient:s.titleOrient||I}}}}return a}function J_(A,e){return sp(A)?{maxbins:djA(e)}:A==="binned"?{binned:!0}:!A.maxbins&&!A.step?{...A,maxbins:djA(e)}:A}const y2={compatible:!0};function L0t(A,e){const t=A.type;if(t==="geojson"&&e!=="shape")return{compatible:!1,warning:`Channel ${e} should not be used with a geojson data.`};switch(e){case ud:case dd:case i_:return D_(A)?y2:{compatible:!1,warning:Kmt(e)};case Hn:case fg:case Zp:case c2:case ur:case LQ:case SQ:case wL:case DL:case n_:case Zb:case o_:case g_:case Hb:case Ql:case Lc:case a_:return y2;case Hc:case El:case Sc:case Zc:return t!==zb?{compatible:!1,warning:`Channel ${e} should be used with a quantitative field only, not ${A.type} field.`}:y2;case fd:case Wp:case Kp:case Up:case pd:case md:case hd:case vc:case vQ:return t==="nominal"&&!A.sort?{compatible:!1,warning:`Channel ${e} should not be used with an unsorted discrete field.`}:y2;case dr:case Vp:return!D_(A)&&!N0t(A)?{compatible:!1,warning:Umt(e)}:y2;case B2:return A.type==="nominal"&&!("sort"in A)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:y2}}function b2(A){const{formatType:e}=G_(A);return e==="time"||!e&&S0t(A)}function S0t(A){return A&&(A.type==="temporal"||zA(A)&&!!A.timeUnit)}function N_(A,{timeUnit:e,type:t,wrapTime:i,undefinedIfExprNotRequired:n}){var o;const g=e&&((o=yg(e))==null?void 0:o.unit);let a=g||t==="temporal",s;return kL(A)?s=A.expr:me(A)?s=A.signal:Ub(A)?(a=!0,s=Vb(A)):(ie(A)||ti(A))&&a&&(s=`datetime(${Ui(A)})`,kpt(g)&&(ti(A)&&A<1e4||ie(A)&&isNaN(Date.parse(A)))&&(s=Vb({[g]:A}))),s?i&&a?`time(${s})`:s:n?void 0:Ui(A)}function v6A(A,e){const{type:t}=A;return e.map(i=>{const n=zA(A)&&!Xb(A.timeUnit)?A.timeUnit:void 0,o=N_(i,{timeUnit:n,type:t,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:i})}function ML(A,e){return Cn(A.bin)?yd(e)&&["ordinal","nominal"].includes(A.type):(console.warn("Only call this method for binned field defs."),!1)}const L6A={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function vL(A){return A==null?void 0:A.condition}const S6A=["domain","grid","labels","ticks","title"],H0t={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},H6A={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Z0t={...H6A,style:1,labelExpr:1,encoding:1};function Z6A(A){return!!Z0t[A]}const W0t={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},W6A=WA(W0t);function Gd(A){return"mark"in A}class Y_{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return Gd(e)?E0t(e.mark)===this.name:!1}}function jb(A,e){const t=A&&A[e];return t?RA(t)?Lb(t,i=>!!i.field):zA(t)||b_(t):!1}function K6A(A,e){const t=A&&A[e];return t?RA(t)?Lb(t,i=>!!i.field):zA(t)||VQ(t)||FL(t):!1}function U6A(A,e){if(Go(e)){const t=A[e];if((zA(t)||VQ(t))&&(t6A(t.type)||zA(t)&&t.timeUnit)){const i=xcA(e);return K6A(A,i)}}return!1}function dBA(A){return Lb(Uht,e=>{if(jb(A,e)){const t=A[e];if(RA(t))return Lb(t,i=>!!i.aggregate);{const i=XQ(t);return i&&!!i.aggregate}}return!1})}function V6A(A,e){const t=[],i=[],n=[],o=[],g={};return hBA(A,(a,s)=>{if(zA(a)){const{field:I,aggregate:r,bin:C,timeUnit:l,...c}=a;if(r||l||C){const B=QBA(a),E=B==null?void 0:B.title;let u=jA(a,{forAs:!0});const d={...E?[]:{title:f2(a,e,{allowDisabling:!0})},...c,field:u};if(r){let f;if(zp(r)?(f="argmax",u=jA({op:"argmax",field:r.argmax},{forAs:!0}),d.field=`${u}.${I}`):bd(r)?(f="argmin",u=jA({op:"argmin",field:r.argmin},{forAs:!0}),d.field=`${u}.${I}`):r!=="boxplot"&&r!=="errorbar"&&r!=="errorband"&&(f=r),f){const w={op:f,as:u};I&&(w.field=I),o.push(w)}}else if(t.push(u),fs(a)&&Cn(C)){if(i.push({bin:C,field:I,as:u}),t.push(jA(a,{binSuffix:"end"})),ML(a,s)&&t.push(jA(a,{binSuffix:"range"})),Go(s)){const f={field:`${u}_end`};g[`${s}2`]=f}d.bin="binned",IjA(s)||(d.type=zb)}else if(l&&!Xb(l)){n.push({timeUnit:l,field:I,as:u});const f=fs(a)&&a.type!==u2&&"time";f&&(s===wL||s===Zb?d.formatType=f:$ht(s)?d.legend={formatType:f,...d.legend}:Go(s)&&(d.axis={formatType:f,...d.axis}))}g[s]=d}else t.push(I),g[s]=A[s]}else g[s]=A[s]}),{bins:i,timeUnits:n,aggregate:o,groupby:t,encoding:g}}function K0t(A,e,t){const i=emt(e,t);if(i){if(i==="binned"){const n=A[e===vc?Hn:fg];return!!(zA(n)&&zA(A[e])&&ga(n.bin))}}else return!1;return!0}function U0t(A,e,t,i){const n={};for(const o of WA(A))rjA(o)||XA(Wmt(o));for(let o of Oht){if(!A[o])continue;const g=A[o];if(GL(o)){const a=_ht(o),s=n[a];if(zA(s)&&Zpt(s.type)&&zA(g)&&!s.timeUnit){XA(Mmt(a));continue}}if(o==="angle"&&e==="arc"&&!A.theta&&(XA(Fmt),o=Ql),!K0t(A,o,e)){XA(l_(o,e));continue}if(o===pd&&e==="line"){const a=XQ(A[o]);if(a!=null&&a.aggregate){XA(Zmt);continue}}if(o===ur&&(t?"fill"in A:"stroke"in A)){XA(SjA("encoding",{fill:"fill"in A,stroke:"stroke"in A}));continue}if(o===DL||o===B2&&!RA(g)&&!Vc(g)||o===Zb&&RA(g)){if(g){if(o===B2){const a=A[o];if(k6A(a)){n[o]=a;continue}}n[o]=te(g).reduce((a,s)=>(zA(s)?a.push(uBA(s,o)):XA(KcA(s,o)),a),[])}}else{if(o===Zb&&g===null)n[o]=null;else if(!zA(g)&&!VQ(g)&&!Vc(g)&&!y_(g)&&!me(g)){XA(KcA(g,o));continue}n[o]=M6A(g,o,i)}}return n}function R_(A,e){const t={};for(const i of WA(A)){const n=M6A(A[i],i,e,{compositeMark:!0});t[i]=n}return t}function V0t(A){const e=[];for(const t of WA(A))if(jb(A,t)){const i=A[t],n=te(i);for(const o of n)zA(o)?e.push(o):b_(o)&&e.push(o.condition)}return e}function hBA(A,e,t){if(A)for(const i of WA(A)){const n=A[i];if(RA(n))for(const o of n)e.call(t,o,i);else e.call(t,n,i)}}function X0t(A,e,t,i){return A?WA(A).reduce((n,o)=>{const g=A[o];return RA(g)?g.reduce((a,s)=>e.call(i,a,s,o),n):e.call(i,n,g,o)},t):t}function X6A(A,e){return WA(e).reduce((t,i)=>{switch(i){case Hn:case fg:case o_:case a_:case g_:case vc:case vQ:case Zp:case c2:case Ql:case md:case Lc:case hd:case Sc:case Hc:case Zc:case El:case wL:case dr:case Hb:case Zb:return t;case B2:if(A==="line"||A==="trail")return t;case DL:case n_:{const n=e[i];if(RA(n)||zA(n))for(const o of te(n))o.aggregate||t.push(jA(o,{}));return t}case pd:if(A==="trail")return t;case ur:case LQ:case SQ:case fd:case Wp:case Kp:case Vp:case Up:{const n=XQ(e[i]);return n&&!n.aggregate&&t.push(jA(n,{})),t}}},[])}function z0t(A){const{tooltip:e,...t}=A;if(!e)return{filteredEncoding:t};let i,n;if(RA(e)){for(const o of e)o.aggregate?(i||(i=[]),i.push(o)):(n||(n=[]),n.push(o));i&&(t.tooltip=i)}else e.aggregate?t.tooltip=e:n=e;return RA(n)&&n.length===1&&(n=n[0]),{customTooltipWithoutAggregatedField:n,filteredEncoding:t}}function mBA(A,e,t,i=!0){if("tooltip"in t)return{tooltip:t.tooltip};const n=A.map(({fieldPrefix:g,titlePrefix:a})=>{const s=i?` of ${pBA(e)}`:"";return{field:g+e.field,type:e.type,title:me(a)?{signal:`${a}"${escape(s)}"`}:a+s}}),o=V0t(t).map(k0t);return{tooltip:[...n,...MQ(o,Lt)]}}function pBA(A){const{title:e,field:t}=A;return Do(e,t)}function fBA(A,e,t,i,n){const{scale:o,axis:g}=t;return({partName:a,mark:s,positionPrefix:I,endPositionPrefix:r=void 0,extraEncoding:C={}})=>{const l=pBA(t);return z6A(A,a,n,{mark:s,encoding:{[e]:{field:`${I}_${t.field}`,type:t.type,...l!==void 0?{title:l}:{},...o!==void 0?{scale:o}:{},...g!==void 0?{axis:g}:{}},...ie(r)?{[`${e}2`]:{field:`${r}_${t.field}`}}:{},...i,...C}})}}function z6A(A,e,t,i){const{clip:n,color:o,opacity:g}=A,a=A.type;return A[e]||A[e]===void 0&&t[e]?[{...i,mark:{...t[e],...n?{clip:n}:{},...o?{color:o}:{},...g?{opacity:g}:{},...KQ(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(e)}`,...sp(A[e])?{}:A[e]}}]:[]}function T6A(A,e,t){const{encoding:i}=A,n=e==="vertical"?"y":"x",o=i[n],g=i[`${n}2`],a=i[`${n}Error`],s=i[`${n}Error2`];return{continuousAxisChannelDef:x_(o,t),continuousAxisChannelDef2:x_(g,t),continuousAxisChannelDefError:x_(a,t),continuousAxisChannelDefError2:x_(s,t),continuousAxis:n}}function x_(A,e){if(A!=null&&A.aggregate){const{aggregate:t,...i}=A;return t!==e&&XA(Qpt(t,e)),i}else return A}function _6A(A,e){const{mark:t,encoding:i}=A,{x:n,y:o}=i;if(KQ(t)&&t.orient)return t.orient;if(jp(n)){if(jp(o)){const g=zA(n)&&n.aggregate,a=zA(o)&&o.aggregate;if(!g&&a===e)return"vertical";if(!a&&g===e)return"horizontal";if(g===e&&a===e)throw new Error("Both x and y cannot have aggregate");return b2(o)&&!b2(n)?"horizontal":"vertical"}return"horizontal"}else{if(jp(o))return"vertical";throw new Error(`Need a valid continuous axis for ${e}s`)}}const F_="boxplot",T0t=["box","median","outliers","rule","ticks"],_0t=new Y_(F_,q6A);function O6A(A){return ti(A)?"tukey":A}function q6A(A,{config:e}){A={...A,encoding:R_(A.encoding,e)};const{mark:t,encoding:i,params:n,projection:o,...g}=A,a=KQ(t)?t:{type:t};n&&XA(xjA("boxplot"));const s=a.extent??e.boxplot.extent,I=bi("size",a,e),r=a.invalid,C=O6A(s),{bins:l,timeUnits:c,transform:B,continuousAxisChannelDef:E,continuousAxis:u,groupby:d,aggregate:f,encodingWithoutContinuousAxis:w,ticksOrient:y,boxOrient:G,customTooltipWithoutAggregatedField:R}=O0t(A,s,e),{color:x,size:F,...Q}=w,k=hA=>fBA(a,u,E,hA,e.boxplot),h=k(Q),N=k(w),v=k({...Q,...F?{size:F}:{}}),K=mBA([{fieldPrefix:C==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:C==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],E,w),U={type:"tick",color:"black",opacity:1,orient:y,invalid:r,aria:!1},V=C==="min-max"?K:mBA([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],E,w),X=[...h({partName:"rule",mark:{type:"rule",invalid:r,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:V}),...h({partName:"rule",mark:{type:"rule",invalid:r,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:V}),...h({partName:"ticks",mark:U,positionPrefix:"lower_whisker",extraEncoding:V}),...h({partName:"ticks",mark:U,positionPrefix:"upper_whisker",extraEncoding:V})],_=[...C!=="tukey"?X:[],...N({partName:"box",mark:{type:"bar",...I?{size:I}:{},orient:G,invalid:r,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:K}),...v({partName:"median",mark:{type:"tick",invalid:r,...oe(e.boxplot.median)&&e.boxplot.median.color?{color:e.boxplot.median.color}:{},...I?{size:I}:{},orient:y,aria:!1},positionPrefix:"mid_box",extraEncoding:K})];if(C==="min-max")return{...g,transform:(g.transform??[]).concat(B),layer:_};const q=`datum["lower_box_${E.field}"]`,$=`datum["upper_box_${E.field}"]`,nA=`(${$} - ${q})`,j=`${q} - ${s} * ${nA}`,O=`${$} + ${s} * ${nA}`,eA=`datum["${E.field}"]`,oA={joinaggregate:j6A(E.field),groupby:d},tA={transform:[{filter:`(${j} <= ${eA}) && (${eA} <= ${O})`},{aggregate:[{op:"min",field:E.field,as:`lower_whisker_${E.field}`},{op:"max",field:E.field,as:`upper_whisker_${E.field}`},{op:"min",field:`lower_box_${E.field}`,as:`lower_box_${E.field}`},{op:"max",field:`upper_box_${E.field}`,as:`upper_box_${E.field}`},...f],groupby:d}],layer:X},{tooltip:sA,...gA}=Q,{scale:iA,axis:aA}=E,lA=pBA(E),CA=Er(aA,["title"]),QA=z6A(a,"outliers",e.boxplot,{transform:[{filter:`(${eA} < ${j}) || (${eA} > ${O})`}],mark:"point",encoding:{[u]:{field:E.field,type:E.type,...lA!==void 0?{title:lA}:{},...iA!==void 0?{scale:iA}:{},...Ki(CA)?{}:{axis:CA}},...gA,...x?{color:x}:{},...R?{tooltip:R}:{}}})[0];let uA;const fA=[...l,...c,oA];return QA?uA={transform:fA,layer:[QA,tA]}:(uA=tA,uA.transform.unshift(...fA)),{...g,layer:[uA,{transform:B,layer:_}]}}function j6A(A){return[{op:"q1",field:A,as:`lower_box_${A}`},{op:"q3",field:A,as:`upper_box_${A}`}]}function O0t(A,e,t){const i=_6A(A,F_),{continuousAxisChannelDef:n,continuousAxis:o}=T6A(A,i,F_),g=n.field,a=O6A(e),s=[...j6A(g),{op:"median",field:g,as:`mid_box_${g}`},{op:"min",field:g,as:(a==="min-max"?"lower_whisker_":"min_")+g},{op:"max",field:g,as:(a==="min-max"?"upper_whisker_":"max_")+g}],I=a==="min-max"||a==="tukey"?[]:[{calculate:`datum["upper_box_${g}"] - datum["lower_box_${g}"]`,as:`iqr_${g}`},{calculate:`min(datum["upper_box_${g}"] + datum["iqr_${g}"] * ${e}, datum["max_${g}"])`,as:`upper_whisker_${g}`},{calculate:`max(datum["lower_box_${g}"] - datum["iqr_${g}"] * ${e}, datum["min_${g}"])`,as:`lower_whisker_${g}`}],{[o]:r,...C}=A.encoding,{customTooltipWithoutAggregatedField:l,filteredEncoding:c}=z0t(C),{bins:B,timeUnits:E,aggregate:u,groupby:d,encoding:f}=V6A(c,t),w=i==="vertical"?"horizontal":"vertical",y=i,G=[...B,...E,{aggregate:[...u,...s],groupby:d},...I];return{bins:B,timeUnits:E,transform:G,groupby:d,aggregate:u,continuousAxisChannelDef:n,continuousAxis:o,encodingWithoutContinuousAxis:f,ticksOrient:w,boxOrient:y,customTooltipWithoutAggregatedField:l}}const yBA="errorbar",q0t=["ticks","rule"],j0t=new Y_(yBA,P6A);function P6A(A,{config:e}){A={...A,encoding:R_(A.encoding,e)};const{transform:t,continuousAxisChannelDef:i,continuousAxis:n,encodingWithoutContinuousAxis:o,ticksOrient:g,markDef:a,outerSpec:s,tooltipEncoding:I}=$6A(A,yBA,e);delete o.size;const r=fBA(a,n,i,o,e.errorbar),C=a.thickness,l=a.size,c={type:"tick",orient:g,aria:!1,...C!==void 0?{thickness:C}:{},...l!==void 0?{size:l}:{}},B=[...r({partName:"ticks",mark:c,positionPrefix:"lower",extraEncoding:I}),...r({partName:"ticks",mark:c,positionPrefix:"upper",extraEncoding:I}),...r({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...C!==void 0?{size:C}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:I})];return{...s,transform:t,...B.length>1?{layer:B}:{...B[0]}}}function P0t(A,e){const{encoding:t}=A;if($0t(t))return{orient:_6A(A,e),inputType:"raw"};const i=Aft(t),n=eft(t),o=t.x,g=t.y;if(i){if(n)throw new Error(`${e} cannot be both type aggregated-upper-lower and aggregated-error`);const a=t.x2,s=t.y2;if(je(a)&&je(s))throw new Error(`${e} cannot have both x2 and y2`);if(je(a)){if(jp(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${e}`)}else if(je(s)){if(jp(g))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${e}`)}throw new Error("No ranged axis")}else{const a=t.xError,s=t.xError2,I=t.yError,r=t.yError2;if(je(s)&&!je(a))throw new Error(`${e} cannot have xError2 without xError`);if(je(r)&&!je(I))throw new Error(`${e} cannot have yError2 without yError`);if(je(a)&&je(I))throw new Error(`${e} cannot have both xError and yError with both are quantiative`);if(je(a)){if(jp(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(je(I)){if(jp(g))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function $0t(A){return(je(A.x)||je(A.y))&&!je(A.x2)&&!je(A.y2)&&!je(A.xError)&&!je(A.xError2)&&!je(A.yError)&&!je(A.yError2)}function Aft(A){return je(A.x2)||je(A.y2)}function eft(A){return je(A.xError)||je(A.xError2)||je(A.yError)||je(A.yError2)}function $6A(A,e,t){const{mark:i,encoding:n,params:o,projection:g,...a}=A,s=KQ(i)?i:{type:i};o&&XA(xjA(e));const{orient:I,inputType:r}=P0t(A,e),{continuousAxisChannelDef:C,continuousAxisChannelDef2:l,continuousAxisChannelDefError:c,continuousAxisChannelDefError2:B,continuousAxis:E}=T6A(A,I,e),{errorBarSpecificAggregate:u,postAggregateCalculates:d,tooltipSummary:f,tooltipTitleWithFieldName:w}=tft(s,C,l,c,B,r,e,t),{[E]:y,[E==="x"?"x2":"y2"]:G,[E==="x"?"xError":"yError"]:R,[E==="x"?"xError2":"yError2"]:x,...F}=n,{bins:Q,timeUnits:k,aggregate:h,groupby:N,encoding:v}=V6A(F,t),K=[...h,...u],U=r!=="raw"?[]:N,V=mBA(f,C,v,w);return{transform:[...a.transform??[],...Q,...k,...K.length===0?[]:[{aggregate:K,groupby:U}],...d],groupby:U,continuousAxisChannelDef:C,continuousAxis:E,encodingWithoutContinuousAxis:v,ticksOrient:I==="vertical"?"horizontal":"vertical",markDef:s,outerSpec:a,tooltipEncoding:V}}function tft(A,e,t,i,n,o,g,a){let s=[],I=[];const r=e.field;let C,l=!1;if(o==="raw"){const c=A.center?A.center:A.extent?A.extent==="iqr"?"median":"mean":a.errorbar.center,B=A.extent?A.extent:c==="mean"?"stderr":"iqr";if(c==="median"!=(B==="iqr")&&XA(Bpt(c,B,g)),B==="stderr"||B==="stdev")s=[{op:B,field:r,as:`extent_${r}`},{op:c,field:r,as:`center_${r}`}],I=[{calculate:`datum["center_${r}"] + datum["extent_${r}"]`,as:`upper_${r}`},{calculate:`datum["center_${r}"] - datum["extent_${r}"]`,as:`lower_${r}`}],C=[{fieldPrefix:"center_",titlePrefix:yL(c)},{fieldPrefix:"upper_",titlePrefix:A8A(c,B,"+")},{fieldPrefix:"lower_",titlePrefix:A8A(c,B,"-")}],l=!0;else{let E,u,d;B==="ci"?(E="mean",u="ci0",d="ci1"):(E="median",u="q1",d="q3"),s=[{op:u,field:r,as:`lower_${r}`},{op:d,field:r,as:`upper_${r}`},{op:E,field:r,as:`center_${r}`}],C=[{fieldPrefix:"upper_",titlePrefix:f2({field:r,aggregate:d,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:f2({field:r,aggregate:u,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:f2({field:r,aggregate:E,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(A.center||A.extent)&&XA(cpt(A.center,A.extent)),o==="aggregated-upper-lower"?(C=[],I=[{calculate:`datum["${t.field}"]`,as:`upper_${r}`},{calculate:`datum["${r}"]`,as:`lower_${r}`}]):o==="aggregated-error"&&(C=[{fieldPrefix:"",titlePrefix:r}],I=[{calculate:`datum["${r}"] + datum["${i.field}"]`,as:`upper_${r}`}],n?I.push({calculate:`datum["${r}"] + datum["${n.field}"]`,as:`lower_${r}`}):I.push({calculate:`datum["${r}"] - datum["${i.field}"]`,as:`lower_${r}`}));for(const c of I)C.push({fieldPrefix:c.as.substring(0,6),titlePrefix:Sb(Sb(c.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:I,errorBarSpecificAggregate:s,tooltipSummary:C,tooltipTitleWithFieldName:l}}function A8A(A,e,t){return`${yL(A)} ${t} ${e}`}const bBA="errorband",ift=["band","borders"],nft=new Y_(bBA,e8A);function e8A(A,{config:e}){A={...A,encoding:R_(A.encoding,e)};const{transform:t,continuousAxisChannelDef:i,continuousAxis:n,encodingWithoutContinuousAxis:o,markDef:g,outerSpec:a,tooltipEncoding:s}=$6A(A,bBA,e),I=g,r=fBA(I,n,i,o,e.errorband),C=A.encoding.x!==void 0&&A.encoding.y!==void 0;let l={type:C?"area":"rect"},c={type:C?"line":"rule"};const B={...I.interpolate?{interpolate:I.interpolate}:{},...I.tension&&I.interpolate?{tension:I.tension}:{}};return C?(l={...l,...B,ariaRoleDescription:"errorband"},c={...c,...B,aria:!1}):I.interpolate?XA(KjA("interpolate")):I.tension&&XA(KjA("tension")),{...a,transform:t,layer:[...r({partName:"band",mark:l,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:s}),...r({partName:"borders",mark:c,positionPrefix:"lower",extraEncoding:s}),...r({partName:"borders",mark:c,positionPrefix:"upper",extraEncoding:s})]}}const t8A={};function wBA(A,e,t){const i=new Y_(A,e);t8A[A]={normalizer:i,parts:t}}function oft(){return WA(t8A)}wBA(F_,q6A,T0t),wBA(yBA,P6A,q0t),wBA(bBA,e8A,ift);const gft=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],i8A={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},n8A={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},aft=WA(i8A),sft=WA(n8A),rft={header:1,headerRow:1,headerColumn:1,headerFacet:1},o8A=WA(rft),g8A=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Ift={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Cft={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Xc="_vgsid_",lft={point:{on:"click",fields:[Xc],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function DBA(A){return A==="legend"||!!(A!=null&&A.legend)}function GBA(A){return DBA(A)&&oe(A)}function kBA(A){return!!(A!=null&&A.select)}function a8A(A){const e=[];for(const t of A||[]){if(kBA(t))continue;const{expr:i,bind:n,...o}=t;if(n&&i){const g={...o,bind:n,init:i};e.push(g)}else{const g={...o,...i?{update:i}:{},...n?{bind:n}:{}};e.push(g)}}return e}function cft(A){return M_(A)||NBA(A)||JBA(A)}function JBA(A){return"concat"in A}function M_(A){return"vconcat"in A}function NBA(A){return"hconcat"in A}function s8A({step:A,offsetIsDiscrete:e}){return e?A.for??"offset":"position"}function zQ(A){return oe(A)&&A.step!==void 0}function r8A(A){return A.view||A.width||A.height}const I8A=20,Bft={align:1,bounds:1,center:1,columns:1,spacing:1},Qft=WA(Bft);function Eft(A,e,t){const i=t[e],n={},{spacing:o,columns:g}=i;o!==void 0&&(n.spacing=o),g!==void 0&&(f_(A)&&!xL(A.facet)||JBA(A))&&(n.columns=g),M_(A)&&(n.columns=1);for(const a of Qft)if(A[a]!==void 0)if(a==="spacing"){const s=A[a];n[a]=ti(s)?s:{row:s.row??o,column:s.column??o}}else n[a]=A[a];return n}function YBA(A,e){return A[e]??A[e==="width"?"continuousWidth":"continuousHeight"]}function v_(A,e){const t=L_(A,e);return zQ(t)?t.step:C8A}function L_(A,e){const t=A[e]??A[e==="width"?"discreteWidth":"discreteHeight"];return Do(t,{step:A.step})}const C8A=20,uft={continuousWidth:200,continuousHeight:200,step:C8A},dft={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:uft,mark:I0t,arc:{},area:{},bar:c0t,circle:{},geoshape:{},image:{},line:{},point:{},rect:B0t,rule:{color:"black"},square:{},text:{color:"black"},tick:Q0t,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:zpt,projection:{},legend:Ift,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:lft,style:{},title:{},facet:{spacing:I8A},concat:{spacing:I8A},normalizedNumberFormat:".0%"},kd=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],l8A={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},c8A={blue:kd[0],orange:kd[1],red:kd[2],teal:kd[3],green:kd[4],yellow:kd[5],purple:kd[6],pink:kd[7],brown:kd[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function hft(A={}){return{signals:[{name:"color",value:oe(A)?{...c8A,...A}:c8A}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function mft(A){return{signals:[{name:"fontSize",value:oe(A)?{...l8A,...A}:l8A}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function pft(A){return{text:{font:A},style:{"guide-label":{font:A},"guide-title":{font:A},"group-title":{font:A},"group-subtitle":{font:A}}}}function B8A(A){const e=WA(A||{}),t={};for(const i of e){const n=A[i];t[i]=vL(n)?mjA(n):FI(n)}return t}function fft(A){const e=WA(A),t={};for(const i of e)t[i]=B8A(A[i]);return t}const yft=[...B6A,...W6A,...o8A,"background","padding","legend","lineBreak","scale","style","title","view"];function Q8A(A={}){const{color:e,font:t,fontSize:i,selection:n,...o}=A,g=QJ({},Xe(dft),t?pft(t):{},e?hft(e):{},i?mft(i):{},o||{});n&&EJ(g,"selection",n,!0);const a=Er(g,yft);for(const s of["background","lineBreak","padding"])g[s]&&(a[s]=FI(g[s]));for(const s of B6A)g[s]&&(a[s]=mr(g[s]));for(const s of W6A)g[s]&&(a[s]=B8A(g[s]));for(const s of o8A)g[s]&&(a[s]=mr(g[s]));return g.legend&&(a.legend=mr(g.legend)),g.scale&&(a.scale=mr(g.scale)),g.style&&(a.style=fft(g.style)),g.title&&(a.title=mr(g.title)),g.view&&(a.view=mr(g.view)),a}const bft=new Set(["view",...n0t]),wft=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Dft={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...r0t};function Gft(A){A=Xe(A);for(const e of wft)delete A[e];if(A.axis)for(const e in A.axis)vL(A.axis[e])&&delete A.axis[e];if(A.legend)for(const e of gft)delete A.legend[e];if(A.mark){for(const e of c6A)delete A.mark[e];A.mark.tooltip&&oe(A.mark.tooltip)&&delete A.mark.tooltip}A.params&&(A.signals=(A.signals||[]).concat(a8A(A.params)),delete A.params);for(const e of bft){for(const i of c6A)delete A[e][i];const t=Dft[e];if(t)for(const i of t)delete A[e][i];Jft(A,e)}for(const e of oft())delete A[e];kft(A);for(const e in A)oe(A[e])&&Ki(A[e])&&delete A[e];return Ki(A)?void 0:A}function kft(A){const{titleMarkConfig:e,subtitleMarkConfig:t,subtitle:i}=hjA(A.title);Ki(e)||(A.style["group-title"]={...A.style["group-title"],...e}),Ki(t)||(A.style["group-subtitle"]={...A.style["group-subtitle"],...t}),Ki(i)?delete A.title:A.title=i}function Jft(A,e,t,i){const n=i?A[e][i]:A[e];e==="view"&&(t="cell");const o={...n,...A.style[t??e]};Ki(o)||(A.style[t??e]=o),i||delete A[e]}function S_(A){return"layer"in A}function Nft(A){return"repeat"in A}function Yft(A){return!RA(A.repeat)&&A.repeat.layer}class RBA{map(e,t){return f_(e)?this.mapFacet(e,t):Nft(e)?this.mapRepeat(e,t):NBA(e)?this.mapHConcat(e,t):M_(e)?this.mapVConcat(e,t):JBA(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(S_(e))return this.mapLayer(e,t);if(Gd(e))return this.mapUnit(e,t);throw new Error(ZcA(e))}mapLayer(e,t){return{...e,layer:e.layer.map(i=>this.mapLayerOrUnit(i,t))}}mapHConcat(e,t){return{...e,hconcat:e.hconcat.map(i=>this.map(i,t))}}mapVConcat(e,t){return{...e,vconcat:e.vconcat.map(i=>this.map(i,t))}}mapConcat(e,t){const{concat:i,...n}=e;return{...n,concat:i.map(o=>this.map(o,t))}}mapFacet(e,t){return{...e,spec:this.map(e.spec,t)}}mapRepeat(e,t){return{...e,spec:this.map(e.spec,t)}}}const Rft={zero:1,center:1,normalize:1};function xft(A){return A in Rft}const Fft=new Set([I6A,E_,Q_,h_,d_,gBA,aBA,u_,C6A,oBA]),Mft=new Set([E_,Q_,I6A]);function w2(A){return zA(A)&&m2(A)==="quantitative"&&!A.bin}function E8A(A,e,{orient:t,type:i}){const n=e==="x"?"y":"radius",o=e==="x"&&["bar","area"].includes(i),g=A[e],a=A[n];if(zA(g)&&zA(a))if(w2(g)&&w2(a)){if(g.stack)return e;if(a.stack)return n;const s=zA(g)&&!!g.aggregate,I=zA(a)&&!!a.aggregate;if(s!==I)return s?e:n;if(o){if(t==="vertical")return n;if(t==="horizontal")return e}}else{if(w2(g))return e;if(w2(a))return n}else{if(w2(g))return o&&t==="vertical"?void 0:e;if(w2(a))return o&&t==="horizontal"?void 0:n}}function vft(A){switch(A){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function u8A(A,e){var t,i;const n=KQ(A)?A:{type:A},o=n.type;if(!Fft.has(o))return null;const g=E8A(e,"x",n)||E8A(e,"theta",n);if(!g)return null;const a=e[g],s=zA(a)?jA(a,{}):void 0,I=vft(g),r=[],C=new Set;if(e[I]){const d=e[I],f=zA(d)?jA(d,{}):void 0;f&&f!==s&&(r.push(I),C.add(f))}const l=I==="x"?"xOffset":"yOffset",c=e[l],B=zA(c)?jA(c,{}):void 0;B&&B!==s&&(r.push(l),C.add(B));const E=qht.reduce((d,f)=>{if(f!=="tooltip"&&jb(e,f)){const w=e[f];for(const y of te(w)){const G=XQ(y);if(G.aggregate)continue;const R=jA(G,{});(!R||!C.has(R))&&d.push({channel:f,fieldDef:G})}}return d},[]);let u;return a.stack!==void 0?sp(a.stack)?u=a.stack?"zero":null:u=a.stack:Mft.has(o)&&(u="zero"),!u||!xft(u)||dBA(e)&&E.length===0?null:(t=a==null?void 0:a.scale)!=null&&t.type&&((i=a==null?void 0:a.scale)==null?void 0:i.type)!==pr.LINEAR?(a!=null&&a.stack&&XA(Ipt(a.scale.type)),null):je(e[HQ(g)])?(a.stack!==void 0&&XA(rpt(g)),null):(zA(a)&&a.aggregate&&!smt.has(a.aggregate)&&XA(Cpt(a.aggregate)),{groupbyChannels:r,groupbyFields:C,fieldChannel:g,impute:a.impute===null?!1:Op(o),stackBy:E,offset:u})}function d8A(A,e,t){const i=mr(A),n=bi("orient",i,t);if(i.orient=Zft(i.type,e,n),n!==void 0&&n!==i.orient&&XA(Tmt(i.orient,n)),i.type==="bar"&&i.orient){const o=bi("cornerRadiusEnd",i,t);if(o!==void 0){const g=i.orient==="horizontal"&&e.x2||i.orient==="vertical"&&e.y2?["cornerRadius"]:l0t[i.orient];for(const a of g)i[a]=o;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}return bi("opacity",i,t)===void 0&&(i.opacity=Sft(i.type,e)),bi("cursor",i,t)===void 0&&(i.cursor=Lft(i,e,t)),i}function Lft(A,e,t){return e.href||A.href||bi("href",A,t)?"pointer":A.cursor}function Sft(A,e){if(St([d_,oBA,gBA,aBA],A)&&!dBA(e))return .7}function Hft(A,e,{graticule:t}){if(t)return!1;const i=Dd("filled",A,e),n=A.type;return Do(i,n!==d_&&n!==u_&&n!==h_)}function Zft(A,e,t){switch(A){case d_:case gBA:case aBA:case C6A:case t0t:case e0t:return}const{x:i,y:n,x2:o,y2:g}=e;switch(A){case E_:if(zA(i)&&(ga(i.bin)||zA(n)&&n.aggregate&&!i.aggregate))return"vertical";if(zA(n)&&(ga(n.bin)||zA(i)&&i.aggregate&&!n.aggregate))return"horizontal";if(g||o){if(t)return t;if(!o)return(zA(i)&&i.type===zb&&!Cn(i.bin)||w_(i))&&zA(n)&&ga(n.bin)?"horizontal":"vertical";if(!g)return(zA(n)&&n.type===zb&&!Cn(n.bin)||w_(n))&&zA(i)&&ga(i.bin)?"vertical":"horizontal"}case h_:if(o&&!(zA(i)&&ga(i.bin))&&g&&!(zA(n)&&ga(n.bin)))return;case Q_:if(g)return zA(n)&&ga(n.bin)?"horizontal":"vertical";if(o)return zA(i)&&ga(i.bin)?"vertical":"horizontal";if(A===h_){if(i&&!n)return"vertical";if(n&&!i)return"horizontal"}case u_:case oBA:{const a=J6A(i),s=J6A(n);if(t)return t;if(a&&!s)return A!=="tick"?"horizontal":"vertical";if(!a&&s)return A!=="tick"?"vertical":"horizontal";if(a&&s)return"vertical";{const I=fs(i)&&i.type===u2,r=fs(n)&&n.type===u2;if(I&&!r)return"vertical";if(!I&&r)return"horizontal"}return}}return"vertical"}function Wft(A){const{point:e,line:t,...i}=A;return WA(i).length>1?i:i.type}function Kft(A){for(const e of["line","area","rule","trail"])A[e]&&(A={...A,[e]:Er(A[e],["point","line"])});return A}function xBA(A,e={},t){return A.point==="transparent"?{opacity:0}:A.point?oe(A.point)?A.point:{}:A.point!==void 0?null:e.point||t.shape?oe(e.point)?e.point:{}:void 0}function h8A(A,e={}){return A.line?A.line===!0?{}:A.line:A.line!==void 0?null:e.line?e.line===!0?{}:e.line:void 0}class Uft{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(Gd(e)){const{mark:i,encoding:n}=e,o=KQ(i)?i:{type:i};switch(o.type){case"line":case"rule":case"trail":return!!xBA(o,t[o.type],n);case"area":return!!xBA(o,t[o.type],n)||!!h8A(o,t[o.type])}}return!1}run(e,t,i){const{config:n}=t,{params:o,projection:g,mark:a,name:s,encoding:I,...r}=e,C=R_(I,n),l=KQ(a)?a:{type:a},c=xBA(l,n[l.type],C),B=l.type==="area"&&h8A(l,n[l.type]),E=[{name:s,...o?{params:o}:{},mark:Wft({...l.type==="area"&&l.opacity===void 0&&l.fillOpacity===void 0?{opacity:.7}:{},...l}),encoding:Er(C,["shape"])}],u=u8A(d8A(l,C,n),C);let d=C;if(u){const{fieldChannel:f,offset:w}=u;d={...C,[f]:{...C[f],...w?{stack:w}:{}}}}return d=Er(d,["y2","x2"]),B&&E.push({...g?{projection:g}:{},mark:{type:"line",...C2(l,["clip","interpolate","tension","tooltip"]),...B},encoding:d}),c&&E.push({...g?{projection:g}:{},mark:{type:"point",opacity:1,filled:!0,...C2(l,["clip","tooltip"]),...c},encoding:d}),i({...r,layer:E},{...t,config:Kft(n)})}}function Vft(A,e){return e?xL(A)?y8A(A,e):m8A(A,e):A}function FBA(A,e){return e?y8A(A,e):A}function MBA(A,e,t){const i=e[A];if(D0t(i)){if(i.repeat in t)return{...e,[A]:t[i.repeat]};XA(Gmt(i.repeat));return}return e}function m8A(A,e){if(A=MBA("field",A,e),A!==void 0){if(A===null)return null;if(BBA(A)&&UQ(A.sort)){const t=MBA("field",A.sort,e);A={...A,...t?{sort:t}:{}}}return A}}function p8A(A,e){if(zA(A))return m8A(A,e);{const t=MBA("datum",A,e);return t!==A&&!t.type&&(t.type="nominal"),t}}function f8A(A,e){if(je(A)){const t=p8A(A,e);if(t)return t;if(y_(A))return{condition:A.condition}}else{if(FL(A)){const t=p8A(A.condition,e);if(t)return{...A,condition:t};{const{condition:i,...n}=A;return n}}return A}}function y8A(A,e){const t={};for(const i in A)if(Je(A,i)){const n=A[i];if(RA(n))t[i]=n.map(o=>f8A(o,e)).filter(o=>o);else{const o=f8A(n,e);o!==void 0&&(t[i]=o)}}return t}class Xft{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(Gd(e)){const{encoding:t,mark:i}=e;if(i==="line"||KQ(i)&&i.type==="line")for(const n of Tht){const o=Wb(n),g=t[o];if(t[n]&&(zA(g)&&!ga(g.bin)||VQ(g)))return!0}}return!1}run(e,t,i){const{encoding:n,mark:o}=e;return XA(zmt(!!n.x2,!!n.y2)),i({...e,mark:oe(o)?{...o,type:"rule"}:"rule"},t)}}class zft extends RBA{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[_0t,j0t,nft,new Uft,new Xft]}map(e,t){if(Gd(e)){const i=jb(e.encoding,ud),n=jb(e.encoding,dd),o=jb(e.encoding,i_);if(i||n||o)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:i,parentProjection:n}=t,o=FBA(e.encoding,t.repeater),g={...e,...e.name?{name:[t.repeaterPrefix,e.name].filter(s=>s).join("_")}:{},...o?{encoding:o}:{}};if(i||n)return this.mapUnitWithParentEncodingOrProjection(g,t);const a=this.mapLayerOrUnit.bind(this);for(const s of this.nonFacetUnitNormalizers)if(s.hasMatchingType(g,t.config))return s.run(g,t,a);return g}mapRepeat(e,t){return Yft(e)?this.mapLayerRepeat(e,t):this.mapNonLayerRepeat(e,t)}mapLayerRepeat(e,t){const{repeat:i,spec:n,...o}=e,{row:g,column:a,layer:s}=i,{repeater:I={},repeaterPrefix:r=""}=t;return g||a?this.mapRepeat({...e,repeat:{...g?{row:g}:{},...a?{column:a}:{}},spec:{repeat:{layer:s},spec:n}},t):{...o,layer:s.map(C=>{const l={...I,layer:C},c=`${(n.name?`${n.name}_`:"")+r}child__layer_${Sn(C)}`,B=this.mapLayerOrUnit(n,{...t,repeater:l,repeaterPrefix:c});return B.name=c,B})}}mapNonLayerRepeat(e,t){const{repeat:i,spec:n,data:o,...g}=e;!RA(i)&&e.columns&&(e=Er(e,["columns"]),XA(FjA("repeat")));const a=[],{repeater:s={},repeaterPrefix:I=""}=t,r=!RA(i)&&i.row||[s?s.row:null],C=!RA(i)&&i.column||[s?s.column:null],l=RA(i)&&i||[s?s.repeat:null];for(const B of l)for(const E of r)for(const u of C){const d={repeat:B,row:E,column:u,layer:s.layer},f=(n.name?`${n.name}_`:"")+I+"child__"+(RA(i)?`${Sn(B)}`:(i.row?`row_${Sn(E)}`:"")+(i.column?`column_${Sn(u)}`:"")),w=this.map(n,{...t,repeater:d,repeaterPrefix:f});w.name=f,a.push(Er(w,["data"]))}const c=RA(i)?e.columns:i.column?i.column.length:1;return{data:n.data??o,align:"all",...g,columns:c,concat:a}}mapFacet(e,t){const{facet:i}=e;return xL(i)&&e.columns&&(e=Er(e,["columns"]),XA(FjA("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:i,projection:n}=e,{parentEncoding:o,parentProjection:g,config:a}=t,s=w8A({parentProjection:g,projection:n}),I=b8A({parentEncoding:o,encoding:FBA(i,t.repeater)});return this.mapUnit({...e,...s?{projection:s}:{},...I?{encoding:I}:{}},{config:a})}mapFacetedUnit(e,t){const{row:i,column:n,facet:o,...g}=e.encoding,{mark:a,width:s,projection:I,height:r,view:C,params:l,encoding:c,...B}=e,{facetMapping:E,layout:u}=this.getFacetMappingAndLayout({row:i,column:n,facet:o},t),d=FBA(g,t.repeater);return this.mapFacet({...B,...u,facet:E,spec:{...s?{width:s}:{},...r?{height:r}:{},...C?{view:C}:{},...I?{projection:I}:{},mark:a,encoding:d,...l?{params:l}:{}}},t)}getFacetMappingAndLayout(e,t){const{row:i,column:n,facet:o}=e;if(i||n){o&&XA(Vmt([...i?[ud]:[],...n?[dd]:[]]));const g={},a={};for(const s of[ud,dd]){const I=e[s];if(I){const{align:r,center:C,spacing:l,columns:c,...B}=I;g[s]=B;for(const E of["align","center","spacing"])I[E]!==void 0&&(a[E]??(a[E]={}),a[E][s]=I[E])}}return{facetMapping:g,layout:a}}else{const{align:g,center:a,spacing:s,columns:I,...r}=o;return{facetMapping:Vft(r,t.repeater),layout:{...g?{align:g}:{},...a?{center:a}:{},...s?{spacing:s}:{},...I?{columns:I}:{}}}}}mapLayer(e,{parentEncoding:t,parentProjection:i,...n}){const{encoding:o,projection:g,...a}=e,s={...n,parentEncoding:b8A({parentEncoding:t,encoding:o,layer:!0}),parentProjection:w8A({parentProjection:i,projection:g})};return super.mapLayer({...a,...e.name?{name:[s.repeaterPrefix,e.name].filter(I=>I).join("_")}:{}},s)}}function b8A({parentEncoding:A,encoding:e={},layer:t}){let i={};if(A){const n=new Set([...WA(A),...WA(e)]);for(const o of n){const g=e[o],a=A[o];if(je(g)){const s={...a,...g};i[o]=s}else FL(g)?i[o]={...g,condition:{...a,...g.condition}}:g||g===null?i[o]=g:(t||Vc(a)||me(a)||je(a)||RA(a))&&(i[o]=a)}}else i=e;return!i||Ki(i)?void 0:i}function w8A(A){const{parentProjection:e,projection:t}=A;return e&&t&&XA(xmt({parentProjection:e,projection:t})),t??e}function vBA(A){return"filter"in A}function Tft(A){return(A==null?void 0:A.stop)!==void 0}function D8A(A){return"lookup"in A}function _ft(A){return"data"in A}function Oft(A){return"param"in A}function qft(A){return"pivot"in A}function jft(A){return"density"in A}function Pft(A){return"quantile"in A}function $ft(A){return"regression"in A}function Ayt(A){return"loess"in A}function eyt(A){return"sample"in A}function tyt(A){return"window"in A}function iyt(A){return"joinaggregate"in A}function nyt(A){return"flatten"in A}function oyt(A){return"calculate"in A}function G8A(A){return"bin"in A}function gyt(A){return"impute"in A}function ayt(A){return"timeUnit"in A}function syt(A){return"aggregate"in A}function ryt(A){return"stack"in A}function Iyt(A){return"fold"in A}function Cyt(A){return"extent"in A&&!("density"in A)}function lyt(A){return A.map(e=>vBA(e)?{filter:I2(e.filter,Hpt)}:e)}class cyt extends RBA{map(e,t){return t.emptySelections??(t.emptySelections={}),t.selectionPredicates??(t.selectionPredicates={}),e=k8A(e,t),super.map(e,t)}mapLayerOrUnit(e,t){if(e=k8A(e,t),e.encoding){const i={};for(const[n,o]of Hp(e.encoding))i[n]=J8A(o,t);e={...e,encoding:i}}return super.mapLayerOrUnit(e,t)}mapUnit(e,t){const{selection:i,...n}=e;return i?{...n,params:Hp(i).map(([o,g])=>{const{init:a,bind:s,empty:I,...r}=g;r.type==="single"?(r.type="point",r.toggle=!1):r.type==="multi"&&(r.type="point"),t.emptySelections[o]=I!=="none";for(const C of oa(t.selectionPredicates[o]??{}))C.empty=I!=="none";return{name:o,value:a,select:r,bind:s}})}:e}}function k8A(A,e){const{transform:t,...i}=A;if(t){const n=t.map(o=>{if(vBA(o))return{filter:LBA(o,e)};if(G8A(o)&&Kb(o.bin))return{...o,bin:N8A(o.bin)};if(D8A(o)){const{selection:g,...a}=o.from;return g?{...o,from:{param:g,...a}}:o}return o});return{...i,transform:n}}return A}function J8A(A,e){var t,i;const n=Xe(A);if(zA(n)&&Kb(n.bin)&&(n.bin=N8A(n.bin)),qb(n)&&(i=(t=n.scale)==null?void 0:t.domain)!=null&&i.selection){const{selection:o,...g}=n.scale.domain;n.scale.domain={...g,...o?{param:o}:{}}}if(y_(n))if(RA(n.condition))n.condition=n.condition.map(o=>{const{selection:g,param:a,test:s,...I}=o;return a?o:{...I,test:LBA(o,e)}});else{const{selection:o,param:g,test:a,...s}=J8A(n.condition,e);n.condition=g?n.condition:{...s,test:LBA(n.condition,e)}}return n}function N8A(A){const e=A.extent;if(e!=null&&e.selection){const{selection:t,...i}=e;return{...A,extent:{...i,param:t}}}return A}function LBA(A,e){const t=i=>I2(i,n=>{var o;const g=e.emptySelections[n]??!0,a={param:n,empty:g};return(o=e.selectionPredicates)[n]??(o[n]=[]),e.selectionPredicates[n].push(a),a});return A.selection?t(A.selection):I2(A.test||A.filter,i=>i.selection?t(i.selection):i)}class SBA extends RBA{map(e,t){const i=t.selections??[];if(e.params&&!Gd(e)){const n=[];for(const o of e.params)kBA(o)?i.push(o):n.push(o);e.params=n}return t.selections=i,super.map(e,t)}mapUnit(e,t){const i=t.selections;if(!i||!i.length)return e;const n=(t.path??[]).concat(e.name),o=[];for(const g of i)if(!g.views||!g.views.length)o.push(g);else for(const a of g.views)(ie(a)&&(a===e.name||n.includes(a))||RA(a)&&a.map(s=>n.indexOf(s)).every((s,I,r)=>s!==-1&&(I===0||s>r[I-1])))&&o.push(g);return o.length&&(e.params=o),e}}for(const A of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const e=SBA.prototype[A];SBA.prototype[A]=function(t,i){return e.call(this,t,Byt(t,i))}}function Byt(A,e){return A.name?{...e,path:(e.path??[]).concat(A.name)}:e}function Y8A(A,e){e===void 0&&(e=Q8A(A.config));const t=dyt(A,e),{width:i,height:n}=A,o=hyt(t,{width:i,height:n,autosize:A.autosize},e);return{...t,...o?{autosize:o}:{}}}const Qyt=new zft,Eyt=new cyt,uyt=new SBA;function dyt(A,e={}){const t={config:e};return uyt.map(Qyt.map(Eyt.map(A,t),t),t)}function R8A(A){return ie(A)?{type:A}:A??{}}function hyt(A,e,t){let{width:i,height:n}=e;const o=Gd(A)||S_(A),g={};o?i=="container"&&n=="container"?(g.type="fit",g.contains="padding"):i=="container"?(g.type="fit-x",g.contains="padding"):n=="container"&&(g.type="fit-y",g.contains="padding"):(i=="container"&&(XA(JjA("width")),i=void 0),n=="container"&&(XA(JjA("height")),n=void 0));const a={type:"pad",...g,...t?R8A(t.autosize):{},...R8A(A.autosize)};if(a.type==="fit"&&!o&&(XA(umt),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&XA(NjA("width")),n=="container"&&!(a.type=="fit"||a.type=="fit-y")&&XA(NjA("height")),!xI(a,{type:"pad"}))return a}function myt(A){return A==="fit"||A==="fit-x"||A==="fit-y"}function pyt(A){return A?`fit-${s_(A)}`:"fit"}const fyt=["background","padding"];function x8A(A,e){const t={};for(const i of fyt)A&&A[i]!==void 0&&(t[i]=FI(A[i]));return e&&(t.params=A.params),t}class Jd{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new Jd(Xe(this.explicit),Xe(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return Do(this.explicit[e],this.implicit[e])}getWithExplicit(e){return this.explicit[e]!==void 0?{explicit:!0,value:this.explicit[e]}:this.implicit[e]!==void 0?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,{value:t,explicit:i}){t!==void 0&&this.set(e,t,i)}set(e,t,i){return delete this[i?"implicit":"explicit"][e],this[i?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,{explicit:t,implicit:i}){t[e]!==void 0?this.set(e,t[e],!0):i[e]!==void 0&&this.set(e,i[e],!1)}copyKeyFromObject(e,t){t[e]!==void 0&&this.set(e,t[e],!0)}copyAll(e){for(const t of WA(e.combine())){const i=e.getWithExplicit(t);this.setWithExplicit(t,i)}}}function TQ(A){return{explicit:!0,value:A}}function zc(A){return{explicit:!1,value:A}}function F8A(A){return(e,t,i,n)=>{const o=A(e.value,t.value);return o>0?e:o<0?t:H_(e,t,i,n)}}function H_(A,e,t,i){return A.explicit&&e.explicit&&XA(tpt(t,i,A.value,e.value)),A}function Pp(A,e,t,i,n=H_){return A===void 0||A.value===void 0?e:A.explicit&&!e.explicit?A:e.explicit&&!A.explicit?e:xI(A.value,e.value)?A:n(A,e,t,i)}class yyt extends Jd{constructor(e={},t={},i=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=i}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function D2(A){return"url"in A}function LL(A){return"values"in A}function M8A(A){return"name"in A&&!D2(A)&&!LL(A)&&!$p(A)}function $p(A){return A&&(v8A(A)||L8A(A)||HBA(A))}function v8A(A){return"sequence"in A}function L8A(A){return"sphere"in A}function HBA(A){return"graticule"in A}var ln;(function(A){A[A.Raw=0]="Raw",A[A.Main=1]="Main",A[A.Row=2]="Row",A[A.Column=3]="Column",A[A.Lookup=4]="Lookup"})(ln||(ln={}));function S8A(A){const{signals:e,hasLegend:t,index:i,...n}=A;return n.field=Bl(n.field),n}function Pb(A,e=!0,t=Ja){if(RA(A)){const i=A.map(n=>Pb(n,e,t));return e?`[${i.join(", ")}]`:i}else if(Ub(A))return t(e?Vb(A):Gpt(A));return e?t(Ui(A)):A}function byt(A,e){for(const t of oa(A.component.selection??{})){const i=t.name;let n=`${i}${e0}, ${t.resolve==="global"?"true":`{unit: ${Aw(A)}}`}`;for(const o of z_)o.defined(t)&&(o.signals&&(e=o.signals(A,t,e)),o.modifyExpr&&(n=o.modifyExpr(A,t,n)));e.push({name:i+tbt,on:[{events:{signal:t.name+e0},update:`modify(${OA(t.name+$b)}, ${n})`}]})}return ZBA(e)}function wyt(A,e){if(A.component.selection&&WA(A.component.selection).length){const t=OA(A.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:Lp("pointermove","scope"),update:`isTuple(facet) ? facet : group(${t}).datum`}]})}return ZBA(e)}function Dyt(A,e){let t=!1;for(const i of oa(A.component.selection??{})){const n=i.name,o=OA(n+$b);if(e.filter(g=>g.name===n).length===0){const g=i.resolve==="global"?"union":i.resolve,a=i.type==="point"?", true, true)":")";e.push({name:i.name,update:`${cPA}(${o}, ${OA(g)}${a}`})}t=!0;for(const g of z_)g.defined(i)&&g.topLevelSignals&&(e=g.topLevelSignals(A,i,e))}return t&&e.filter(i=>i.name==="unit").length===0&&e.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),ZBA(e)}function Gyt(A,e){const t=[...e],i=Aw(A,{escape:!1});for(const n of oa(A.component.selection??{})){const o={name:n.name+$b};if(n.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Xc}}]),n.init){const g=n.project.items.map(S8A);o.values=n.project.hasSelectionId?n.init.map(a=>({unit:i,[Xc]:Pb(a,!1)[0]})):n.init.map(a=>({unit:i,fields:g,values:Pb(a,!1)}))}t.filter(g=>g.name===n.name+$b).length||t.push(o)}return t}function H8A(A,e){for(const t of oa(A.component.selection??{}))for(const i of z_)i.defined(t)&&i.marks&&(e=i.marks(A,t,e));return e}function kyt(A,e){for(const t of A.children)co(t)&&(e=H8A(t,e));return e}function Jyt(A,e,t,i){const n=dPA(A,e.param,e);return{signal:MI(t.get("type"))&&RA(i)&&i[0]>i[1]?`isValid(${n}) && reverse(${n})`:n}}function ZBA(A){return A.map(e=>(e.on&&!e.on.length&&delete e.on,e))}class vi{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){if(this._children.includes(e)){XA(Nmt);return}t!==void 0?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const n of this._children)n.parent=e;this._children=[],e.removeChild(this);const i=e.parent.removeChild(e);this._parent=t,t.addChild(this,i),e.parent=this}}class ys extends vi{clone(){const e=new this.constructor;return e.debugName=`clone_${this.debugName}`,e._source=this._source,e._name=`clone_${this._name}`,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}constructor(e,t,i,n){super(e,t),this.type=i,this.refCounts=n,this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${AjA()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}function WBA(A){return A.as!==void 0}function Z8A(A){return`${A}_end`}class _Q extends vi{clone(){return new _Q(null,Xe(this.timeUnits))}constructor(e,t){super(e),this.timeUnits=t}static makeFromEncoding(e,t){const i=t.reduceFieldDef((n,o,g)=>{const{field:a,timeUnit:s}=o;if(s){let I;if(Xb(s)){if(co(t)){const{mark:r,markDef:C,config:l}=t,c=qp({fieldDef:o,markDef:C,config:l});(NL(r)||c)&&(I={timeUnit:yg(s),field:a})}}else I={as:jA(o,{forAs:!0}),field:a,timeUnit:s};if(co(t)){const{mark:r,markDef:C,config:l}=t,c=qp({fieldDef:o,markDef:C,config:l});NL(r)&&Go(g)&&c!==.5&&(I.rectBandPosition=c)}I&&(n[Lt(I)]=I)}return n},{});return Ki(i)?null:new _Q(e,i)}static makeFromTransform(e,t){const{timeUnit:i,...n}={...t},o=yg(i),g={...n,timeUnit:o};return new _Q(e,{[Lt(g)]:g})}merge(e){this.timeUnits={...this.timeUnits};for(const t in e.timeUnits)this.timeUnits[t]||(this.timeUnits[t]=e.timeUnits[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[i,n]of Hp(this.timeUnits)){const o=WBA(n)?n.as:`${n.field}_end`;e.has(o)||(t[i]=n)}this.timeUnits=t}producedFields(){return new Set(oa(this.timeUnits).map(e=>WBA(e)?e.as:Z8A(e.field)))}dependentFields(){return new Set(oa(this.timeUnits).map(e=>e.field))}hash(){return`TimeUnit ${Lt(this.timeUnits)}`}assemble(){const e=[];for(const t of oa(this.timeUnits)){const{rectBandPosition:i}=t,n=yg(t.timeUnit);if(WBA(t)){const{field:o,as:g}=t,{unit:a,utc:s,...I}=n,r=[g,`${g}_end`];e.push({field:Bl(o),type:"timeunit",...a?{units:B_(a)}:{},...s?{timezone:"utc"}:{},...I,as:r}),e.push(...K8A(r,i,n))}else if(t){const{field:o}=t,g=o.replaceAll("\\.","."),a=W8A({timeUnit:n,field:g}),s=Z8A(g);e.push({type:"formula",expr:a,as:s}),e.push(...K8A([g,s],i,n))}}return e}}const Z_="offsetted_rect_start",W_="offsetted_rect_end";function W8A({timeUnit:A,field:e,reverse:t}){const{unit:i,utc:n}=A,o=OjA(i),{part:g,step:a}=$jA(o,A.step);return`${n?"utcOffset":"timeOffset"}('${g}', datum['${e}'], ${t?-a:a})`}function K8A([A,e],t,i){if(t!==void 0&&t!==.5){const n=`datum['${A}']`,o=`datum['${e}']`;return[{type:"formula",expr:U8A([W8A({timeUnit:i,field:A,reverse:!0}),n],t+.5),as:`${A}_${Z_}`},{type:"formula",expr:U8A([n,o],t+.5),as:`${A}_${W_}`}]}return[]}function U8A([A,e],t){return`${1-t} * ${A} + ${t} * ${e}`}const SL="_tuple_fields";class Nyt{constructor(...e){this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const Yyt={defined:()=>!0,parse:(A,e,t)=>{const i=e.name,n=e.project??(e.project=new Nyt),o={},g={},a=new Set,s=(B,E)=>{const u=E==="visual"?B.channel:B.field;let d=Sn(`${i}_${u}`);for(let f=1;a.has(d);f++)d=Sn(`${i}_${u}_${f}`);return a.add(d),{[E]:d}},I=e.type,r=A.config.selection[I],C=t.value!==void 0?te(t.value):null;let{fields:l,encodings:c}=oe(t.select)?t.select:{};if(!l&&!c&&C){for(const B of C)if(oe(B))for(const E of WA(B))zht(E)?(c||(c=[])).push(E):I==="interval"?(XA(Dmt),c=r.encodings):(l??(l=[])).push(E)}!l&&!c&&(c=r.encodings,"fields"in r&&(l=r.fields));for(const B of c??[]){const E=A.fieldDef(B);if(E){let u=E.field;if(E.aggregate){XA(dmt(B,E.aggregate));continue}else if(!u){XA(RjA(B));continue}if(E.timeUnit&&!Xb(E.timeUnit)){u=A.vgField(B);const d={timeUnit:E.timeUnit,as:u,field:E.field};g[Lt(d)]=d}if(!o[u]){const d=I==="interval"&&yd(B)&&MI(A.getScaleComponent(B).get("type"))?"R":E.bin?"R-RE":"E",f={field:u,channel:B,type:d,index:n.items.length};f.signals={...s(f,"data"),...s(f,"visual")},n.items.push(o[u]=f),n.hasField[u]=o[u],n.hasSelectionId=n.hasSelectionId||u===Xc,ajA(B)?(f.geoChannel=B,f.channel=gjA(B),n.hasChannel[f.channel]=o[u]):n.hasChannel[B]=o[u]}}else XA(RjA(B))}for(const B of l??[]){if(n.hasField[B])continue;const E={type:"E",field:B,index:n.items.length};E.signals={...s(E,"data")},n.items.push(E),n.hasField[B]=E,n.hasSelectionId=n.hasSelectionId||B===Xc}C&&(e.init=C.map(B=>n.items.map(E=>oe(B)?B[E.geoChannel||E.channel]!==void 0?B[E.geoChannel||E.channel]:B[E.field]:B))),Ki(g)||(n.timeUnit=new _Q(null,g))},signals:(A,e,t)=>{const i=e.name+SL;return t.filter(n=>n.name===i).length>0||e.project.hasSelectionId?t:t.concat({name:i,value:e.project.items.map(S8A)})}},Nd={defined:A=>A.type==="interval"&&A.resolve==="global"&&A.bind&&A.bind==="scales",parse:(A,e)=>{const t=e.scales=[];for(const i of e.project.items){const n=i.channel;if(!yd(n))continue;const o=A.getScaleComponent(n),g=o?o.get("type"):void 0;if(!o||!MI(g)){XA(pmt);continue}o.set("selectionExtent",{param:e.name,field:i.field},!0),t.push(i)}},topLevelSignals:(A,e,t)=>{const i=e.scales.filter(g=>t.filter(a=>a.name===g.signals.data).length===0);if(!A.parent||V8A(A)||i.length===0)return t;const n=t.filter(g=>g.name===e.name)[0];let o=n.update;if(o.indexOf(cPA)>=0)n.update=`{${i.map(g=>`${OA(Bl(g.field))}: ${g.signals.data}`).join(", ")}}`;else{for(const g of i){const a=`${OA(Bl(g.field))}: ${g.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}n.update=o}return t.concat(i.map(g=>({name:g.signals.data})))},signals:(A,e,t)=>{if(A.parent&&!V8A(A))for(const i of e.scales){const n=t.filter(o=>o.name===i.signals.data)[0];n.push="outer",delete n.value,delete n.update}return t}};function KBA(A,e){return`domain(${OA(A.scaleName(e))})`}function V8A(A){return A.parent&&v2(A.parent)&&!A.parent.parent}const G2="_brush",X8A="_scale_trigger",HL="geo_interval_init_tick",z8A="_init",Ryt="_center",xyt={defined:A=>A.type==="interval",parse:(A,e,t)=>{var i;if(A.hasProjection){const n={...oe(t.select)?t.select:{}};n.fields=[Xc],n.encodings||(n.encodings=t.value?WA(t.value):[Hc,Sc]),t.select={type:"interval",...n}}if(e.translate&&!Nd.defined(e)){const n=`!event.item || event.item.mark.name !== ${OA(e.name+G2)}`;for(const o of e.events){if(!o.between){XA(`${o} is not an ordered event stream for interval selections.`);continue}const g=te((i=o.between[0]).filter??(i.filter=[]));g.indexOf(n)<0&&g.push(n)}}},signals:(A,e,t)=>{const i=e.name,n=i+e0,o=oa(e.project.hasChannel).filter(a=>a.channel===Hn||a.channel===fg),g=e.init?e.init[0]:null;if(t.push(...o.reduce((a,s)=>a.concat(Fyt(A,e,s,g&&g[s.index])),[])),A.hasProjection){const a=OA(A.projectionName()),s=A.projectionName()+Ryt,{x:I,y:r}=e.project.hasChannel,C=I&&I.signals.visual,l=r&&r.signals.visual,c=I?g&&g[I.index]:`${s}[0]`,B=r?g&&g[r.index]:`${s}[1]`,E=G=>A.getSizeSignalRef(G).signal,u=`[[${C?C+"[0]":"0"}, ${l?l+"[0]":"0"}],[${C?C+"[1]":E("width")}, ${l?l+"[1]":E("height")}]]`;g&&(t.unshift({name:i+z8A,init:`[scale(${a}, [${I?c[0]:c}, ${r?B[0]:B}]), scale(${a}, [${I?c[1]:c}, ${r?B[1]:B}])]`}),(!I||!r)&&(t.find(G=>G.name===s)||t.unshift({name:s,update:`invert(${a}, [${E("width")}/2, ${E("height")}/2])`})));const d=`intersect(${u}, {markname: ${OA(A.getName("marks"))}}, unit.mark)`,f=`{unit: ${Aw(A)}}`,w=`vlSelectionTuples(${d}, ${f})`,y=o.map(G=>G.signals.visual);return t.concat({name:n,on:[{events:[...y.length?[{signal:y.join(" || ")}]:[],...g?[{signal:HL}]:[]],update:w}]})}else{if(!Nd.defined(e)){const I=i+X8A,r=o.map(C=>{const l=C.channel,{data:c,visual:B}=C.signals,E=OA(A.scaleName(l)),u=A.getScaleComponent(l).get("type"),d=MI(u)?"+":"";return`(!isArray(${c}) || (${d}invert(${E}, ${B})[0] === ${d}${c}[0] && ${d}invert(${E}, ${B})[1] === ${d}${c}[1]))`});r.length&&t.push({name:I,value:{},on:[{events:o.map(C=>({scale:A.scaleName(C.channel)})),update:r.join(" && ")+` ? ${I} : {}`}]})}const a=o.map(I=>I.signals.data),s=`unit: ${Aw(A)}, fields: ${i+SL}, values`;return t.concat({name:n,...g?{init:`{${s}: ${Pb(g)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${s}: [${a}]} : null`}]}:{}})}},topLevelSignals:(A,e,t)=>(co(A)&&A.hasProjection&&e.init&&(t.filter(i=>i.name===HL).length||t.unshift({name:HL,value:null,on:[{events:"timer{1}",update:`${HL} === null ? {} : ${HL}`}]})),t),marks:(A,e,t)=>{const i=e.name,{x:n,y:o}=e.project.hasChannel,g=n==null?void 0:n.signals.visual,a=o==null?void 0:o.signals.visual,s=`data(${OA(e.name+$b)})`;if(Nd.defined(e)||!n&&!o)return t;const I={x:n!==void 0?{signal:`${g}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:n!==void 0?{signal:`${g}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(e.resolve==="global")for(const E of WA(I))I[E]=[{test:`${s}.length && ${s}[0].unit === ${Aw(A)}`,...I[E]},{value:0}];const{fill:r,fillOpacity:C,cursor:l,...c}=e.mark,B=WA(c).reduce((E,u)=>(E[u]=[{test:[n!==void 0&&`${g}[0] !== ${g}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(d=>d).join(" && "),value:c[u]},{value:null}],E),{});return[{name:`${i+G2}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:r},fillOpacity:{value:C}},update:I}},...t,{name:i+G2,type:"rect",clip:!0,encode:{enter:{...l?{cursor:{value:l}}:{},fill:{value:"transparent"}},update:{...I,...B}}}]}};function Fyt(A,e,t,i){const n=!A.hasProjection,o=t.channel,g=t.signals.visual,a=OA(n?A.scaleName(o):A.projectionName()),s=l=>`scale(${a}, ${l})`,I=A.getSizeSignalRef(o===Hn?"width":"height").signal,r=`${o}(unit)`,C=e.events.reduce((l,c)=>[...l,{events:c.between[0],update:`[${r}, ${r}]`},{events:c,update:`[${g}[0], clamp(${r}, 0, ${I})]`}],[]);if(n){const l=t.signals.data,c=Nd.defined(e),B=A.getScaleComponent(o),E=B?B.get("type"):void 0,u=i?{init:Pb(i,!0,s)}:{value:[]};return C.push({events:{signal:e.name+X8A},update:MI(E)?`[${s(`${l}[0]`)}, ${s(`${l}[1]`)}]`:"[0, 0]"}),c?[{name:l,on:[]}]:[{name:g,...u,on:C},{name:l,...i?{init:Pb(i)}:{},on:[{events:{signal:g},update:`${g}[0] === ${g}[1] ? null : invert(${a}, ${g})`}]}]}else{const l=o===Hn?0:1,c=e.name+z8A,B=i?{init:`[${c}[0][${l}], ${c}[1][${l}]]`}:{value:[]};return[{name:g,...B,on:C}]}}const Myt={defined:A=>A.type==="point",signals:(A,e,t)=>{const i=e.name,n=i+SL,o=e.project,g="(item().isVoronoi ? datum.datum : datum)",a=oa(A.component.selection??{}).reduce((C,l)=>l.type==="interval"?C.concat(l.name+G2):C,[]).map(C=>`indexof(item().mark.name, '${C}') < 0`).join(" && "),s=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let I=`unit: ${Aw(A)}, `;if(e.project.hasSelectionId)I+=`${Xc}: ${g}[${OA(Xc)}]`;else{const C=o.items.map(l=>{const c=A.fieldDef(l.channel);return c!=null&&c.bin?`[${g}[${OA(A.vgField(l.channel,{}))}], ${g}[${OA(A.vgField(l.channel,{binSuffix:"end"}))}]]`:`${g}[${OA(l.field)}]`}).join(", ");I+=`fields: ${n}, values: [${C}]`}const r=e.events;return t.concat([{name:i+e0,on:r?[{events:r,update:`${s} ? {${I}} : null`,force:!0}]:[]}])}};function k2(A,e,t,i){const n=y_(e)&&e.condition,o=i(e);if(n){const g=te(n).map(a=>{const s=i(a);if(w0t(a)){const{param:I,empty:r}=a;return{test:uPA(A,{param:I,empty:r}),...s}}else return{test:T_(A,a.test),...s}});return{[t]:[...g,...o!==void 0?[o]:[]]}}else return o!==void 0?{[t]:o}:{}}function UBA(A,e="text"){const t=A.encoding[e];return k2(A,t,e,i=>K_(i,A.config))}function K_(A,e,t="datum"){if(A){if(Vc(A))return Dn(A.value);if(je(A)){const{format:i,formatType:n}=G_(A);return CBA({fieldOrDatumDef:A,format:i,formatType:n,expr:t,config:e})}}}function T8A(A,e={}){const{encoding:t,markDef:i,config:n,stack:o}=A,g=t.tooltip;if(RA(g))return{tooltip:O8A({tooltip:g},o,n,e)};{const a=e.reactiveGeom?"datum.datum":"datum";return k2(A,g,"tooltip",s=>{const I=K_(s,n,a);if(I)return I;if(s===null)return;let r=bi("tooltip",i,n);if(r===!0&&(r={content:"encoding"}),ie(r))return{value:r};if(oe(r))return me(r)?r:r.content==="encoding"?O8A(t,o,n,e):{signal:a}})}}function _8A(A,e,t,{reactiveGeom:i}={}){const n={...t,...t.tooltipFormat},o={},g=i?"datum.datum":"datum",a=[];function s(r,C){const l=Wb(C),c=fs(r)?r:{...r,type:A[l].type},B=c.title||EBA(c,n),E=te(B).join(", ").replaceAll(/"/g,'\\"');let u;if(Go(C)){const d=C==="x"?"x2":"y2",f=XQ(A[d]);if(ga(c.bin)&&f){const w=jA(c,{expr:g}),y=jA(f,{expr:g}),{format:G,formatType:R}=G_(c);u=RL(w,y,G,R,n),o[d]=!0}}if((Go(C)||C===Ql||C===Lc)&&e&&e.fieldChannel===C&&e.offset==="normalize"){const{format:d,formatType:f}=G_(c);u=CBA({fieldOrDatumDef:c,format:d,formatType:f,expr:g,config:n,normalizeStack:!0}).signal}u??(u=K_(c,n,g).signal),a.push({channel:C,key:E,value:u})}hBA(A,(r,C)=>{zA(r)?s(r,C):b_(r)&&s(r.condition,C)});const I={};for(const{channel:r,key:C,value:l}of a)!o[r]&&!I[C]&&(I[C]=l);return I}function O8A(A,e,t,{reactiveGeom:i}={}){const n=_8A(A,e,t,{reactiveGeom:i}),o=Hp(n).map(([g,a])=>`"${g}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function vyt(A){const{markDef:e,config:t}=A,i=bi("aria",e,t);return i===!1?{}:{...i?{aria:i}:{},...Lyt(A),...Syt(A)}}function Lyt(A){const{mark:e,markDef:t,config:i}=A;if(i.aria===!1)return{};const n=bi("ariaRoleDescription",t,i);return n!=null?{ariaRoleDescription:{value:n}}:e in Bmt?{}:{ariaRoleDescription:{value:e}}}function Syt(A){const{encoding:e,markDef:t,config:i,stack:n}=A,o=e.description;if(o)return k2(A,o,"description",s=>K_(s,A.config));const g=bi("description",t,i);if(g!=null)return{description:Dn(g)};if(i.aria===!1)return{};const a=_8A(e,n,i);if(!Ki(a))return{description:{signal:Hp(a).map(([s,I],r)=>`"${r>0?"; ":""}${s}: " + (${I})`).join(" + ")}}}function wg(A,e,t={}){const{markDef:i,encoding:n,config:o}=e,{vgChannel:g}=t;let{defaultRef:a,defaultValue:s}=t;a===void 0&&(s??(s=bi(A,i,o,{vgChannel:g,ignoreVgConfig:!0})),s!==void 0&&(a=Dn(s)));const I=n[A];return k2(e,I,g??A,r=>IBA({channel:A,channelDef:r,markDef:i,config:o,scaleName:e.scaleName(A),scale:e.getScaleComponent(A),stack:null,defaultRef:a}))}function q8A(A,e={filled:void 0}){const{markDef:t,encoding:i,config:n}=A,{type:o}=t,g=e.filled??bi("filled",t,n),a=St(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,s=bi(g===!0?"color":void 0,t,n,{vgChannel:"fill"})??n.mark[g===!0&&"color"]??a,I=bi(g===!1?"color":void 0,t,n,{vgChannel:"stroke"})??n.mark[g===!1&&"color"],r=g?"fill":"stroke",C={...s?{fill:Dn(s)}:{},...I?{stroke:Dn(I)}:{}};return t.color&&(g?t.fill:t.stroke)&&XA(SjA("property",{fill:"fill"in t,stroke:"stroke"in t})),{...C,...wg("color",A,{vgChannel:r,defaultValue:g?s:I}),...wg("fill",A,{defaultValue:i.fill?s:void 0}),...wg("stroke",A,{defaultValue:i.stroke?I:void 0})}}function Hyt(A){const{encoding:e,mark:t}=A,i=e.order;return!Op(t)&&Vc(i)?k2(A,i,"zindex",n=>Dn(n.value)):{}}function J2({channel:A,markDef:e,encoding:t={},model:i,bandPosition:n}){const o=`${A}Offset`,g=e[o],a=t[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:IBA({channel:o,channelDef:a,markDef:e,config:i==null?void 0:i.config,scaleName:i.scaleName(o),scale:i.getScaleComponent(o),stack:null,defaultRef:Dn(g),bandPosition:n})};const s=e[o];return s?{offsetType:"visual",offset:s}:{}}function Ua(A,e,{defaultPos:t,vgChannel:i}){const{encoding:n,markDef:o,config:g,stack:a}=e,s=n[A],I=n[HQ(A)],r=e.scaleName(A),C=e.getScaleComponent(A),{offset:l,offsetType:c}=J2({channel:A,markDef:o,encoding:n,model:e,bandPosition:.5}),B=VBA({model:e,defaultPos:t,channel:A,scaleName:r,scale:C}),E=!s&&Go(A)&&(n.latitude||n.longitude)?{field:e.getName(A)}:Zyt({channel:A,channelDef:s,channel2Def:I,markDef:o,config:g,scaleName:r,scale:C,stack:a,offset:l,defaultRef:B,bandPosition:c==="encoding"?0:void 0});return E?{[i||A]:E}:void 0}function Zyt(A){const{channel:e,channelDef:t,scaleName:i,stack:n,offset:o,markDef:g}=A;if(je(t)&&n&&e===n.fieldChannel){if(zA(t)){let a=t.bandPosition;if(a===void 0&&g.type==="text"&&(e==="radius"||e==="theta")&&(a=.5),a!==void 0)return m_({scaleName:i,fieldOrDatumDef:t,startSuffix:"start",bandPosition:a,offset:o})}return _b(t,i,{suffix:"end"},{offset:o})}return sBA(A)}function VBA({model:A,defaultPos:e,channel:t,scaleName:i,scale:n}){const{markDef:o,config:g}=A;return()=>{const a=Wb(t),s=Xp(t),I=bi(t,o,g,{vgChannel:s});if(I!==void 0)return YL(t,I);switch(e){case"zeroOrMin":case"zeroOrMax":if(i){const r=n.get("type");if(!St([pr.LOG,pr.TIME,pr.UTC],r)&&n.domainDefinitelyIncludesZero())return{scale:i,value:0}}if(e==="zeroOrMin")return a==="y"?{field:{group:"height"}}:{value:0};switch(a){case"radius":return{signal:`min(${A.width.signal},${A.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...A[hr(t)],mult:.5}}}}const Wyt={left:"x",center:"xc",right:"x2"},Kyt={top:"y",middle:"yc",bottom:"y2"};function j8A(A,e,t,i="middle"){if(A==="radius"||A==="theta")return Xp(A);const n=A==="x"?"align":"baseline",o=bi(n,e,t);let g;return me(o)?(XA(Xmt(n)),g=void 0):g=o,A==="x"?Wyt[g||(i==="top"?"left":"center")]:Kyt[g||i]}function U_(A,e,{defaultPos:t,defaultPos2:i,range:n}){return n?P8A(A,e,{defaultPos:t,defaultPos2:i}):Ua(A,e,{defaultPos:t})}function P8A(A,e,{defaultPos:t,defaultPos2:i}){const{markDef:n,config:o}=e,g=HQ(A),a=hr(A),s=Uyt(e,i,g),I=s[a]?j8A(A,n,o):Xp(A);return{...Ua(A,e,{defaultPos:t,vgChannel:I}),...s}}function Uyt(A,e,t){const{encoding:i,mark:n,markDef:o,stack:g,config:a}=A,s=Wb(t),I=hr(t),r=Xp(t),C=i[s],l=A.scaleName(s),c=A.getScaleComponent(s),{offset:B}=t in i||t in o?J2({channel:t,markDef:o,encoding:i,model:A}):J2({channel:s,markDef:o,encoding:i,model:A});if(!C&&(t==="x2"||t==="y2")&&(i.latitude||i.longitude)){const u=hr(t),d=A.markDef[u];return d!=null?{[u]:{value:d}}:{[r]:{field:A.getName(t)}}}const E=Vyt({channel:t,channelDef:C,channel2Def:i[t],markDef:o,config:a,scaleName:l,scale:c,stack:g,offset:B,defaultRef:void 0});return E!==void 0?{[r]:E}:V_(t,o)||V_(t,{[t]:C_(t,o,a.style),[I]:C_(I,o,a.style)})||V_(t,a[n])||V_(t,a.mark)||{[r]:VBA({model:A,defaultPos:e,channel:t,scaleName:l,scale:c})()}}function Vyt({channel:A,channelDef:e,channel2Def:t,markDef:i,config:n,scaleName:o,scale:g,stack:a,offset:s,defaultRef:I}){return je(e)&&a&&A.charAt(0)===a.fieldChannel.charAt(0)?_b(e,o,{suffix:"start"},{offset:s}):sBA({channel:A,channelDef:t,scaleName:o,scale:g,stack:a,markDef:i,config:n,offset:s,defaultRef:I})}function V_(A,e){const t=hr(A),i=Xp(A);if(e[i]!==void 0)return{[i]:YL(A,e[i])};if(e[A]!==void 0)return{[i]:YL(A,e[A])};if(e[t]){const n=e[t];if(Tb(n))XA(Hmt(t));else return{[t]:YL(A,n)}}}function A0(A,e){const{config:t,encoding:i,markDef:n}=A,o=n.type,g=HQ(e),a=hr(e),s=i[e],I=i[g],r=A.getScaleComponent(e),C=r?r.get("type"):void 0,l=n.orient,c=i[a]??i.size??bi("size",n,t,{vgChannel:a}),B=CjA(e),E=o==="bar"&&(e==="x"?l==="vertical":l==="horizontal");return zA(s)&&(Cn(s.bin)||ga(s.bin)||s.timeUnit&&!I)&&!(c&&!Tb(c))&&!i[B]&&!bg(C)?Tyt({fieldDef:s,fieldDef2:I,channel:e,model:A}):(je(s)&&bg(C)||E)&&!I?zyt(s,e,A):P8A(e,A,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Xyt(A,e,t,i,n,o,g){if(Tb(n))if(t){const a=t.get("type");if(a==="band"){let s=`bandwidth('${e}')`;n.band!==1&&(s=`${n.band} * ${s}`);const I=Dd("minBandSize",{type:g},i);return{signal:I?`max(${Wc(I)}, ${s})`:s}}else n.band!==1&&(XA(Omt(a)),n=void 0)}else return{mult:n.band,field:{group:A}};else{if(me(n))return n;if(n)return{value:n}}if(t){const a=t.get("range");if(_p(a)&&ti(a.step))return{value:a.step-2}}if(!o){const{bandPaddingInner:a,barBandPaddingInner:s,rectBandPaddingInner:I}=i.scale,r=Do(a,g==="bar"?s:I);if(me(r))return{signal:`(1 - (${r.signal})) * ${A}`};if(ti(r))return{signal:`${1-r} * ${A}`}}return{value:v_(i.view,A)-2}}function zyt(A,e,t){var i,n;const{markDef:o,encoding:g,config:a,stack:s}=t,I=o.orient,r=t.scaleName(e),C=t.getScaleComponent(e),l=hr(e),c=HQ(e),B=CjA(e),E=t.scaleName(B),u=t.getScaleComponent(xcA(e)),d=I==="horizontal"&&e==="y"||I==="vertical"&&e==="x";let f;(g.size||o.size)&&(d?f=wg("size",t,{vgChannel:l,defaultRef:Dn(o.size)}):XA($mt(o.type)));const w=!!f,y=D6A({channel:e,fieldDef:A,markDef:o,config:a,scaleType:(i=C||u)==null?void 0:i.get("type"),useVlSizeChannel:d});f=f||{[l]:Xyt(l,E||r,u||C,a,y,!!A,o.type)};const G=((n=C||u)==null?void 0:n.get("type"))==="band"&&Tb(y)&&!w?"top":"middle",R=j8A(e,o,a,G),x=R==="xc"||R==="yc",{offset:F,offsetType:Q}=J2({channel:e,markDef:o,encoding:g,model:t,bandPosition:x?.5:0}),k=sBA({channel:e,channelDef:A,markDef:o,config:a,scaleName:r,scale:C,stack:s,offset:F,defaultRef:VBA({model:t,defaultPos:"mid",channel:e,scaleName:r,scale:C}),bandPosition:x?Q==="encoding"?0:.5:me(y)?{signal:`(1-${y})/2`}:Tb(y)?(1-y.band)/2:0});if(l)return{[R]:k,...f};{const h=Xp(c),N=f[l],v=F?{...N,offset:F}:N;return{[R]:k,[h]:RA(k)?[k[0],{...k[1],offset:v}]:{...k,offset:v}}}}function $8A(A,e,t,i,n,o,g){if(ojA(A))return 0;const a=A==="x"||A==="y2",s=a?-e/2:e/2;if(me(t)||me(n)||me(i)||o){const I=Wc(t),r=Wc(n),C=Wc(i),l=Wc(o),c=o?`(${g} < ${l} ? ${a?"":"-"}0.5 * (${l} - (${g})) : ${s})`:s,B=C?`${C} + `:"",E=I?`(${I} ? -1 : 1) * `:"",u=r?`(${r} + ${c})`:c;return{signal:B+E+u}}else return n=n||0,i+(t?-n-s:+n+s)}function Tyt({fieldDef:A,fieldDef2:e,channel:t,model:i}){var n;const{config:o,markDef:g,encoding:a}=i,s=i.getScaleComponent(t),I=i.scaleName(t),r=s?s.get("type"):void 0,C=s.get("reverse"),l=D6A({channel:t,fieldDef:A,markDef:g,config:o,scaleType:r}),c=(n=i.component.axes[t])==null?void 0:n[0],B=(c==null?void 0:c.get("translate"))??.5,E=Go(t)?bi("binSpacing",g,o)??0:0,u=HQ(t),d=Xp(t),f=Xp(u),w=Dd("minBandSize",g,o),{offset:y}=J2({channel:t,markDef:g,encoding:a,model:i,bandPosition:0}),{offset:G}=J2({channel:u,markDef:g,encoding:a,model:i,bandPosition:0}),R=m0t({fieldDef:A,scaleName:I}),x=$8A(t,E,C,B,y,w,R),F=$8A(u,E,C,B,G??y,w,R),Q=me(l)?{signal:`(1-${l.signal})/2`}:Tb(l)?(1-l.band)/2:.5,k=qp({fieldDef:A,fieldDef2:e,markDef:g,config:o});if(Cn(A.bin)||A.timeUnit){const h=A.timeUnit&&k!==.5;return{[f]:APA({fieldDef:A,scaleName:I,bandPosition:Q,offset:F,useRectOffsetField:h}),[d]:APA({fieldDef:A,scaleName:I,bandPosition:me(Q)?{signal:`1-${Q.signal}`}:1-Q,offset:x,useRectOffsetField:h})}}else if(ga(A.bin)){const h=_b(A,I,{},{offset:F});if(zA(e))return{[f]:h,[d]:_b(e,I,{},{offset:x})};if(Kb(A.bin)&&A.bin.step)return{[f]:h,[d]:{signal:`scale("${I}", ${jA(A,{expr:"datum"})} + ${A.bin.step})`,offset:x}}}XA(UjA(u))}function APA({fieldDef:A,scaleName:e,bandPosition:t,offset:i,useRectOffsetField:n}){return m_({scaleName:e,fieldOrDatumDef:A,bandPosition:t,offset:i,...n?{startSuffix:Z_,endSuffix:W_}:{}})}const _yt=new Set(["aria","width","height"]);function dl(A,e){const{fill:t=void 0,stroke:i=void 0}=e.color==="include"?q8A(A):{};return{...Oyt(A.markDef,e),...ePA(A,"fill",t),...ePA(A,"stroke",i),...wg("opacity",A),...wg("fillOpacity",A),...wg("strokeOpacity",A),...wg("strokeWidth",A),...wg("strokeDash",A),...Hyt(A),...T8A(A),...UBA(A,"href"),...vyt(A)}}function ePA(A,e,t){const{config:i,mark:n,markDef:o}=A;if(bi("invalid",o,i)==="hide"&&t&&!Op(n)){const g=qyt(A,{invalid:!0,channels:r_});if(g)return{[e]:[{test:g,value:null},...te(t)]}}return t?{[e]:t}:{}}function Oyt(A,e){return cmt.reduce((t,i)=>(!_yt.has(i)&&A[i]!==void 0&&e[i]!=="ignore"&&(t[i]=Dn(A[i])),t),{})}function qyt(A,{invalid:e=!1,channels:t}){const i=t.reduce((o,g)=>{const a=A.getScaleComponent(g);if(a){const s=a.get("type"),I=A.vgField(g,{expr:"datum"});I&&MI(s)&&(o[I]=!0)}return o},{}),n=WA(i);if(n.length>0){const o=e?"||":"&&";return n.map(g=>rBA(g,e)).join(` ${o} `)}}function XBA(A){const{config:e,markDef:t}=A;if(bi("invalid",t,e)){const i=jyt(A,{channels:ZQ});if(i)return{defined:{signal:i}}}return{}}function jyt(A,{invalid:e=!1,channels:t}){const i=t.reduce((o,g)=>{var a;const s=A.getScaleComponent(g);if(s){const I=s.get("type"),r=A.vgField(g,{expr:"datum",binSuffix:(a=A.stack)!=null&&a.impute?"mid":void 0});r&&MI(I)&&(o[r]=!0)}return o},{}),n=WA(i);if(n.length>0){const o=e?"||":"&&";return n.map(g=>rBA(g,e)).join(` ${o} `)}}function tPA(A,e){if(e!==void 0)return{[A]:Dn(e)}}const zBA="voronoi",iPA={defined:A=>A.type==="point"&&A.nearest,parse:(A,e)=>{if(e.events)for(const t of e.events)t.markname=A.getName(zBA)},marks:(A,e,t)=>{const{x:i,y:n}=e.project.hasChannel,o=A.mark;if(Op(o))return XA(hmt(o)),t;const g={name:A.getName(zBA),type:"path",interactive:!0,from:{data:A.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...T8A(A,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!n?"datum.datum.x || 0":"0"},y:{expr:n||!i?"datum.datum.y || 0":"0"},size:[A.getSizeSignalRef("width"),A.getSizeSignalRef("height")]}]};let a=0,s=!1;return t.forEach((I,r)=>{const C=I.name??"";C===A.component.mark[0].name?a=r:C.indexOf(zBA)>=0&&(s=!0)}),s||t.splice(a+1,0,g),t}},nPA={defined:A=>A.type==="point"&&A.resolve==="global"&&A.bind&&A.bind!=="scales"&&!DBA(A.bind),parse:(A,e,t)=>BPA(e,t),topLevelSignals:(A,e,t)=>{const i=e.name,n=e.project,o=e.bind,g=e.init&&e.init[0],a=iPA.defined(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return n.items.forEach((s,I)=>{const r=Sn(`${i}_${s.field}`);t.filter(C=>C.name===r).length||t.unshift({name:r,...g?{init:Pb(g[I])}:{value:null},on:e.events?[{events:e.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${OA(s.field)}] : null`}]:[],bind:o[s.field]??o[s.channel]??o})}),t},signals:(A,e,t)=>{const i=e.name,n=e.project,o=t.filter(I=>I.name===i+e0)[0],g=i+SL,a=n.items.map(I=>Sn(`${i}_${I.field}`)),s=a.map(I=>`${I} !== null`).join(" && ");return a.length&&(o.update=`${s} ? {fields: ${g}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,t}},X_="_toggle",oPA={defined:A=>A.type==="point"&&!!A.toggle,signals:(A,e,t)=>t.concat({name:e.name+X_,value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(A,e)=>{const t=e.name+e0,i=e.name+X_;return`${i} ? null : ${t}, `+(e.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Aw(A)}}, `)+`${i} ? ${t} : null`}},Pyt={defined:A=>A.clear!==void 0&&A.clear!==!1,parse:(A,e)=>{e.clear&&(e.clear=ie(e.clear)?Lp(e.clear,"view"):e.clear)},topLevelSignals:(A,e,t)=>{if(nPA.defined(e))for(const i of e.project.items){const n=t.findIndex(o=>o.name===Sn(`${e.name}_${i.field}`));n!==-1&&t[n].on.push({events:e.clear,update:"null"})}return t},signals:(A,e,t)=>{function i(n,o){n!==-1&&t[n].on&&t[n].on.push({events:e.clear,update:o})}if(e.type==="interval")for(const n of e.project.items){const o=t.findIndex(g=>g.name===n.signals.visual);if(i(o,"[0, 0]"),o===-1){const g=t.findIndex(a=>a.name===n.signals.data);i(g,"null")}}else{let n=t.findIndex(o=>o.name===e.name+e0);i(n,"null"),oPA.defined(e)&&(n=t.findIndex(o=>o.name===e.name+X_),i(n,"false"))}return t}},gPA={defined:A=>{const e=A.resolve==="global"&&A.bind&&DBA(A.bind),t=A.project.items.length===1&&A.project.items[0].field!==Xc;return e&&!t&&XA(fmt),e&&t},parse:(A,e,t)=>{const i=Xe(t);if(i.select=ie(i.select)?{type:i.select,toggle:e.toggle}:{...i.select,toggle:e.toggle},BPA(e,i),oe(t.select)&&(t.select.on||t.select.clear)){const g='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of e.events)a.filter=te(a.filter??[]),a.filter.includes(g)||a.filter.push(g)}const n=GBA(e.bind)?e.bind.legend:"click",o=ie(n)?Lp(n,"view"):te(n);e.bind={legend:{merge:o}}},topLevelSignals:(A,e,t)=>{const i=e.name,n=GBA(e.bind)&&e.bind.legend,o=g=>a=>{const s=Xe(a);return s.markname=g,s};for(const g of e.project.items){if(!g.hasLegend)continue;const a=`${Sn(g.field)}_legend`,s=`${i}_${a}`;if(t.filter(I=>I.name===s).length===0){const I=n.merge.map(o(`${a}_symbols`)).concat(n.merge.map(o(`${a}_labels`))).concat(n.merge.map(o(`${a}_entries`)));t.unshift({name:s,...e.init?{}:{value:null},on:[{events:I,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:n.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]})}}return t},signals:(A,e,t)=>{const i=e.name,n=e.project,o=t.find(C=>C.name===i+e0),g=i+SL,a=n.items.filter(C=>C.hasLegend).map(C=>Sn(`${i}_${Sn(C.field)}_legend`)),s=`${a.map(C=>`${C} !== null`).join(" && ")} ? {fields: ${g}, values: [${a.join(", ")}]} : null`;e.events&&a.length>0?o.on.push({events:a.map(C=>({signal:C})),update:s}):a.length>0&&(o.update=s,delete o.value,delete o.on);const I=t.find(C=>C.name===i+X_),r=GBA(e.bind)&&e.bind.legend;return I&&(e.events?I.on.push({...I.on[0],events:r}):I.on[0].events=r),t}};function $yt(A,e,t){var i;const n=(i=A.fieldDef(e))==null?void 0:i.field;for(const o of oa(A.component.selection??{})){const g=o.project.hasField[n]??o.project.hasChannel[e];if(g&&gPA.defined(o)){const a=t.get("selections")??[];a.push(o.name),t.set("selections",a,!1),g.hasLegend=!0}}}const aPA="_translate_anchor",sPA="_translate_delta",Abt={defined:A=>A.type==="interval"&&A.translate,signals:(A,e,t)=>{const i=e.name,n=Nd.defined(e),o=i+aPA,{x:g,y:a}=e.project.hasChannel;let s=Lp(e.translate,"scope");return n||(s=s.map(I=>(I.between[0].markname=i+G2,I))),t.push({name:o,value:{},on:[{events:s.map(I=>I.between[0]),update:"{x: x(unit), y: y(unit)"+(g!==void 0?`, extent_x: ${n?KBA(A,Hn):`slice(${g.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${n?KBA(A,fg):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+sPA,value:{},on:[{events:s,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),g!==void 0&&rPA(A,e,g,"width",t),a!==void 0&&rPA(A,e,a,"height",t),t}};function rPA(A,e,t,i,n){const o=e.name,g=o+aPA,a=o+sPA,s=t.channel,I=Nd.defined(e),r=n.filter(G=>G.name===t.signals[I?"data":"visual"])[0],C=A.getSizeSignalRef(i).signal,l=A.getScaleComponent(s),c=l&&l.get("type"),B=l&&l.get("reverse"),E=I?s===Hn?B?"":"-":B?"-":"":"",u=`${g}.extent_${s}`,d=`${E}${a}.${s} / ${I?`${C}`:`span(${u})`}`,f=!I||!l?"panLinear":c==="log"?"panLog":c==="symlog"?"panSymlog":c==="pow"?"panPow":"panLinear",w=I?c==="pow"?`, ${l.get("exponent")??1}`:c==="symlog"?`, ${l.get("constant")??1}`:"":"",y=`${f}(${u}, ${d}${w})`;r.on.push({events:{signal:a},update:I?y:`clampRange(${y}, 0, ${C})`})}const IPA="_zoom_anchor",CPA="_zoom_delta",ebt={defined:A=>A.type==="interval"&&A.zoom,signals:(A,e,t)=>{const i=e.name,n=Nd.defined(e),o=i+CPA,{x:g,y:a}=e.project.hasChannel,s=OA(A.scaleName(Hn)),I=OA(A.scaleName(fg));let r=Lp(e.zoom,"scope");return n||(r=r.map(C=>(C.markname=i+G2,C))),t.push({name:i+IPA,on:[{events:r,update:n?"{"+[s?`x: invert(${s}, x(unit))`:"",I?`y: invert(${I}, y(unit))`:""].filter(C=>C).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:r,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),g!==void 0&&lPA(A,e,g,"width",t),a!==void 0&&lPA(A,e,a,"height",t),t}};function lPA(A,e,t,i,n){const o=e.name,g=t.channel,a=Nd.defined(e),s=n.filter(f=>f.name===t.signals[a?"data":"visual"])[0],I=A.getSizeSignalRef(i).signal,r=A.getScaleComponent(g),C=r&&r.get("type"),l=a?KBA(A,g):s.name,c=o+CPA,B=`${o}${IPA}.${g}`,E=!a||!r?"zoomLinear":C==="log"?"zoomLog":C==="symlog"?"zoomSymlog":C==="pow"?"zoomPow":"zoomLinear",u=a?C==="pow"?`, ${r.get("exponent")??1}`:C==="symlog"?`, ${r.get("constant")??1}`:"":"",d=`${E}(${l}, ${B}, ${c}${u})`;s.on.push({events:{signal:c},update:a?d:`clampRange(${d}, 0, ${I})`})}const $b="_store",e0="_tuple",tbt="_modify",cPA="vlSelectionResolve",z_=[Myt,xyt,Yyt,oPA,nPA,Nd,gPA,Pyt,Abt,ebt,iPA];function ibt(A){let e=A.parent;for(;e&&!Oc(e);)e=e.parent;return e}function Aw(A,{escape:e}={escape:!0}){let t=e?OA(A.name):A.name;const i=ibt(A);if(i){const{facet:n}=i;for(const o of ul)n[o]&&(t+=` + '__facet_${o}_' + (facet[${OA(i.vgField(o))}])`)}return t}function TBA(A){return oa(A.component.selection??{}).reduce((e,t)=>e||t.project.hasSelectionId,!1)}function BPA(A,e){(ie(e.select)||!e.select.on)&&delete A.events,(ie(e.select)||!e.select.clear)&&delete A.clear,(ie(e.select)||!e.select.toggle)&&delete A.toggle}function _BA(A){const e=[];return A.type==="Identifier"?[A.name]:A.type==="Literal"?[A.value]:(A.type==="MemberExpression"&&(e.push(..._BA(A.object)),e.push(..._BA(A.property))),e)}function QPA(A){return A.object.type==="MemberExpression"?QPA(A.object):A.object.name==="datum"}function EPA(A){const e=DlA(A),t=new Set;return e.visit(i=>{i.type==="MemberExpression"&&QPA(i)&&t.add(_BA(i).slice(1).join("."))}),t}class N2 extends vi{clone(){return new N2(null,this.model,Xe(this.filter))}constructor(e,t,i){super(e),this.model=t,this.filter=i,this.expr=T_(this.model,this.filter,this),this._dependentFields=EPA(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function nbt(A,e){const t={},i=A.config.selection;if(!e||!e.length)return t;for(const n of e){const o=Sn(n.name),g=n.select,a=ie(g)?g:g.type,s=oe(g)?Xe(g):{type:a},I=i[a];for(const l in I)l==="fields"||l==="encodings"||(l==="mark"&&(s[l]={...I[l],...s[l]}),(s[l]===void 0||s[l]===!0)&&(s[l]=Xe(I[l]??s[l])));const r=t[o]={...s,name:o,type:a,init:n.value,bind:n.bind,events:ie(s.on)?Lp(s.on,"scope"):te(Xe(s.on))},C=Xe(n);for(const l of z_)l.defined(r)&&l.parse&&l.parse(A,r,C)}return t}function uPA(A,e,t,i="datum"){const n=ie(e)?e:e.param,o=Sn(n),g=OA(o+$b);let a;try{a=A.getSelectionComponent(o,n)}catch{return`!!${o}`}if(a.project.timeUnit){const l=t??A.component.data.raw,c=a.project.timeUnit.clone();l.parent?c.insertAsParentOf(l):l.parent=c}const s=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",I=a.resolve==="global"?")":`, ${OA(a.resolve)})`,r=`${s}${g}, ${i}${I}`,C=`length(data(${g}))`;return e.empty===!1?`${C} && ${r}`:`!${C} || ${r}`}function dPA(A,e,t){const i=Sn(e),n=t.encoding;let o=t.field,g;try{g=A.getSelectionComponent(i,e)}catch{return i}if(!n&&!o)o=g.project.items[0].field,g.project.items.length>1&&XA(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${OA(o)}.`);else if(n&&!o){const a=g.project.items.filter(s=>s.channel===n);!a.length||a.length>1?(o=g.project.items[0].field,XA((a.length?"Multiple ":"No ")+`matching ${OA(n)} encoding found for selection ${OA(t.param)}. Using "field": ${OA(o)}.`)):o=a[0].field}return`${g.name}[${OA(Bl(o))}]`}function obt(A,e){for(const[t,i]of Hp(A.component.selection??{})){const n=A.getName(`lookup_${t}`);A.component.data.outputNodes[n]=i.materialized=new ys(new N2(e,A,{param:t}),n,ln.Lookup,A.component.data.outputNodeRefCounts)}}function T_(A,e,t){return fL(e,i=>ie(i)?i:vpt(i)?uPA(A,i,t):e6A(i))}function gbt(A,e){if(A)return RA(A)&&!Tp(A)?A.map(t=>EBA(t,e)).join(", "):A}function OBA(A,e,t,i){var n,o;A.encode??(A.encode={}),(n=A.encode)[e]??(n[e]={}),(o=A.encode[e]).update??(o.update={}),A.encode[e].update[t]=i}function ZL(A,e,t,i={header:!1}){var n,o;const{disable:g,orient:a,scale:s,labelExpr:I,title:r,zindex:C,...l}=A.combine();if(!g){for(const c in l){const B=H0t[c],E=l[c];if(B&&B!==e&&B!=="both")delete l[c];else if(vL(E)){const{condition:u,...d}=E,f=te(u),w=L6A[c];if(w){const{vgProp:y,part:G}=w,R=[...f.map(x=>{const{test:F,...Q}=x;return{test:T_(null,F),...Q}}),d];OBA(l,G,y,R),delete l[c]}else if(w===null){const y={signal:f.map(G=>{const{test:R,...x}=G;return`${T_(null,R)} ? ${fjA(x)} : `}).join("")+fjA(d)};l[c]=y}}else if(me(E)){const u=L6A[c];if(u){const{vgProp:d,part:f}=u;OBA(l,f,d,E),delete l[c]}}St(["labelAlign","labelBaseline"],c)&&l[c]===null&&delete l[c]}if(e==="grid"){if(!l.grid)return;if(l.encode){const{grid:c}=l.encode;l.encode={...c?{grid:c}:{}},Ki(l.encode)&&delete l.encode}return{scale:s,orient:a,...l,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Do(C,0)}}else{if(!i.header&&A.mainExtracted)return;if(I!==void 0){let B=I;(o=(n=l.encode)==null?void 0:n.labels)!=null&&o.update&&me(l.encode.labels.update.text)&&(B=Sb(I,"datum.label",l.encode.labels.update.text.signal)),OBA(l,"labels","text",{signal:B})}if(l.labelAlign===null&&delete l.labelAlign,l.encode){for(const B of S6A)A.hasAxisPart(B)||delete l.encode[B];Ki(l.encode)&&delete l.encode}const c=gbt(r,t);return{scale:s,orient:a,grid:!1,...c?{title:c}:{},...l,...t.aria===!1?{aria:!1}:{},zindex:Do(C,0)}}}}function hPA(A){const{axes:e}=A.component,t=[];for(const i of ZQ)if(e[i]){for(const n of e[i])if(!n.get("disable")&&!n.get("gridScale")){const o=i==="x"?"height":"width",g=A.getSizeSignalRef(o).signal;o!==g&&t.push({name:o,update:g})}}return t}function abt(A,e){const{x:t=[],y:i=[]}=A;return[...t.map(n=>ZL(n,"grid",e)),...i.map(n=>ZL(n,"grid",e)),...t.map(n=>ZL(n,"main",e)),...i.map(n=>ZL(n,"main",e))].filter(n=>n)}function mPA(A,e,t,i){return Object.assign.apply(null,[{},...A.map(n=>{if(n==="axisOrient"){const o=t==="x"?"bottom":"left",g=e[t==="x"?"axisBottom":"axisLeft"]||{},a=e[t==="x"?"axisTop":"axisRight"]||{},s=new Set([...WA(g),...WA(a)]),I={};for(const r of s.values())I[r]={signal:`${i.signal} === "${o}" ? ${Wc(g[r])} : ${Wc(a[r])}`};return I}return e[n]})])}function sbt(A,e,t,i){const n=e==="band"?["axisDiscrete","axisBand"]:e==="point"?["axisDiscrete","axisPoint"]:g6A(e)?["axisQuantitative"]:e==="time"||e==="utc"?["axisTemporal"]:[],o=A==="x"?"axisX":"axisY",g=me(t)?"axisOrient":`axis${yL(t)}`,a=[...n,...n.map(I=>o+I.substr(4))],s=["axis",g,o];return{vlOnlyAxisConfig:mPA(a,i,A,t),vgAxisConfig:mPA(s,i,A,t),axisConfigStyle:rbt([...s,...a],i)}}function rbt(A,e){var t;const i=[{}];for(const n of A){let o=(t=e[n])==null?void 0:t.style;if(o){o=te(o);for(const g of o)i.push(e.style[g])}}return Object.assign.apply(null,i)}function qBA(A,e,t,i={}){var n;const o=bjA(A,t,e);if(o!==void 0)return{configFrom:"style",configValue:o};for(const g of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((n=i[g])==null?void 0:n[A])!==void 0)return{configFrom:g,configValue:i[g][A]};return{}}const pPA={scale:({model:A,channel:e})=>A.scaleName(e),format:({format:A})=>A,formatType:({formatType:A})=>A,grid:({fieldOrDatumDef:A,axis:e,scaleType:t})=>e.grid??Ibt(t,A),gridScale:({model:A,channel:e})=>Cbt(A,e),labelAlign:({axis:A,labelAngle:e,orient:t,channel:i})=>A.labelAlign||yPA(e,t,i),labelAngle:({labelAngle:A})=>A,labelBaseline:({axis:A,labelAngle:e,orient:t,channel:i})=>A.labelBaseline||fPA(e,t,i),labelFlush:({axis:A,fieldOrDatumDef:e,channel:t})=>A.labelFlush??cbt(e.type,t),labelOverlap:({axis:A,fieldOrDatumDef:e,scaleType:t})=>A.labelOverlap??Bbt(e.type,t,zA(e)&&!!e.timeUnit,zA(e)?e.sort:void 0),orient:({orient:A})=>A,tickCount:({channel:A,model:e,axis:t,fieldOrDatumDef:i,scaleType:n})=>{const o=A==="x"?"width":A==="y"?"height":void 0,g=o?e.getSizeSignalRef(o):void 0;return t.tickCount??Ebt({fieldOrDatumDef:i,scaleType:n,size:g,values:t.values})},tickMinStep:ubt,title:({axis:A,model:e,channel:t})=>{if(A.title!==void 0)return A.title;const i=bPA(e,t);if(i!==void 0)return i;const n=e.typedFieldDef(t),o=t==="x"?"x2":"y2",g=e.fieldDef(o);return DjA(n?[w6A(n)]:[],zA(g)?[w6A(g)]:[])},values:({axis:A,fieldOrDatumDef:e})=>dbt(A,e),zindex:({axis:A,fieldOrDatumDef:e,mark:t})=>A.zindex??hbt(t,e)};function Ibt(A,e){return!bg(A)&&zA(e)&&!Cn(e==null?void 0:e.bin)&&!ga(e==null?void 0:e.bin)}function Cbt(A,e){const t=e==="x"?"y":"x";if(A.getScaleComponent(t))return A.scaleName(t)}function lbt(A,e,t,i,n){const o=e==null?void 0:e.labelAngle;if(o!==void 0)return me(o)?o:bL(o);{const{configValue:g}=qBA("labelAngle",i,e==null?void 0:e.style,n);return g!==void 0?bL(g):t===Hn&&St([tBA,eBA],A.type)&&!(zA(A)&&A.timeUnit)?270:void 0}}function jBA(A){return`(((${A.signal} % 360) + 360) % 360)`}function fPA(A,e,t,i){if(A!==void 0)if(t==="x"){if(me(A)){const n=jBA(A),o=me(e)?`(${e.signal} === "top")`:e==="top";return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${o} ? "bottom" : "top"`}}if(45<A&&A<135||225<A&&A<315)return"middle";if(me(e)){const n=A<=45||315<=A?"===":"!==";return{signal:`${e.signal} ${n} "top" ? "bottom" : "top"`}}return(A<=45||315<=A)==(e==="top")?"bottom":"top"}else{if(me(A)){const n=jBA(A),o=me(e)?`(${e.signal} === "left")`:e==="left";return{signal:`${n} <= 45 || 315 <= ${n} || (135 <= ${n} && ${n} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${n} && ${n} <= 135) === ${o} ? "top" : "bottom"`}}if(A<=45||315<=A||135<=A&&A<=225)return i?"middle":null;if(me(e)){const n=45<=A&&A<=135?"===":"!==";return{signal:`${e.signal} ${n} "left" ? "top" : "bottom"`}}return(45<=A&&A<=135)==(e==="left")?"top":"bottom"}}function yPA(A,e,t){if(A===void 0)return;const i=t==="x",n=i?0:90,o=i?"bottom":"left";if(me(A)){const g=jBA(A),a=me(e)?`(${e.signal} === "${o}")`:e===o;return{signal:`(${n?`(${g} + 90)`:g} % 180 === 0) ? ${i?null:'"center"'} :(${n} < ${g} && ${g} < ${180+n}) === ${a} ? "left" : "right"`}}if((A+n)%180===0)return i?null:"center";if(me(e)){const g=n<A&&A<180+n?"===":"!==";return{signal:`${`${e.signal} ${g} "${o}"`} ? "left" : "right"`}}return(n<A&&A<180+n)==(e===o)?"left":"right"}function cbt(A,e){if(e==="x"&&St(["quantitative","temporal"],A))return!0}function Bbt(A,e,t,i){if(t&&!oe(i)||A!=="nominal"&&A!=="ordinal")return e==="log"||e==="symlog"?"greedy":!0}function Qbt(A){return A==="x"?"bottom":"left"}function Ebt({fieldOrDatumDef:A,scaleType:e,size:t,values:i}){var n;if(!i&&!bg(e)&&e!=="log"){if(zA(A)){if(Cn(A.bin))return{signal:`ceil(${t.signal}/10)`};if(A.timeUnit&&St(["month","hours","day","quarter"],(n=yg(A.timeUnit))==null?void 0:n.unit))return}return{signal:`ceil(${t.signal}/40)`}}}function ubt({format:A,fieldOrDatumDef:e}){if(A==="d")return 1;if(zA(e)){const{timeUnit:t}=e;if(t){const i=PjA(t);if(i)return{signal:i}}}}function bPA(A,e){const t=e==="x"?"x2":"y2",i=A.fieldDef(e),n=A.fieldDef(t),o=i?i.title:void 0,g=n?n.title:void 0;if(o&&g)return GjA(o,g);if(o)return o;if(g)return g;if(o!==void 0)return o;if(g!==void 0)return g}function dbt(A,e){const t=A.values;if(RA(t))return v6A(e,t);if(me(t))return t}function hbt(A,e){return A==="rect"&&D_(e)?1:0}class Y2 extends vi{clone(){return new Y2(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t,this._dependentFields=EPA(this.transform.calculate)}static parseAllForSortIndex(e,t){return t.forEachFieldDef((i,n)=>{if(qb(i)&&b6A(i.sort)){const{field:o,timeUnit:g}=i,a=i.sort,s=a.map((I,r)=>`${e6A({field:o,timeUnit:g,equal:I})} ? ${r} : `).join("")+a.length;e=new Y2(e,{calculate:s,as:R2(i,n,{forAs:!0})})}}),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Lt(this.transform)}`}}function R2(A,e,t){return jA(A,{prefix:e,suffix:"sort_index",...t??{}})}function __(A,e){return St(["top","bottom"],e)?"column":St(["left","right"],e)||A==="row"?"row":"column"}function x2(A,e,t,i){const n=i==="row"?t.headerRow:i==="column"?t.headerColumn:t.headerFacet;return Do((e||{})[A],n[A],t.header[A])}function O_(A,e,t,i){const n={};for(const o of A){const g=x2(o,e||{},t,i);g!==void 0&&(n[o]=g)}return n}const PBA=["row","column"],$BA=["header","footer"];function mbt(A,e){const t=A.component.layoutHeaders[e].title,i=A.config?A.config:void 0,n=A.component.layoutHeaders[e].facetFieldDef?A.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:g,titleOrient:a}=O_(["titleAnchor","titleAngle","titleOrient"],n.header,i,e),s=__(e,a),I=bL(g);return{name:`${e}-title`,type:"group",role:`${s}-title`,title:{text:t,...e==="row"?{orient:"left"}:{},style:"guide-title",...DPA(I,s),...wPA(s,I,o),...GPA(i,n,e,aft,i8A)}}}function wPA(A,e,t="middle"){switch(t){case"start":return{align:"left"};case"end":return{align:"right"}}const i=yPA(e,A==="row"?"left":"top",A==="row"?"y":"x");return i?{align:i}:{}}function DPA(A,e){const t=fPA(A,e==="row"?"left":"top",e==="row"?"y":"x",!0);return t?{baseline:t}:{}}function pbt(A,e){const t=A.component.layoutHeaders[e],i=[];for(const n of $BA)if(t[n])for(const o of t[n]){const g=ybt(A,e,n,t,o);g!=null&&i.push(g)}return i}function fbt(A,e){const{sort:t}=A;return UQ(t)?{field:jA(t,{expr:"datum"}),order:t.order??"ascending"}:RA(t)?{field:R2(A,e,{expr:"datum"}),order:"ascending"}:{field:jA(A,{expr:"datum"}),order:t??"ascending"}}function AQA(A,e,t){const{format:i,formatType:n,labelAngle:o,labelAnchor:g,labelOrient:a,labelExpr:s}=O_(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],A.header,t,e),I=CBA({fieldOrDatumDef:A,format:i,formatType:n,expr:"parent",config:t}).signal,r=__(e,a);return{text:{signal:s?Sb(Sb(s,"datum.label",I),"datum.value",jA(A,{expr:"parent"})):I},...e==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...DPA(o,r),...wPA(r,o,g),...GPA(t,A,e,sft,n8A)}}function ybt(A,e,t,i,n){if(n){let o=null;const{facetFieldDef:g}=i,a=A.config?A.config:void 0;if(g&&n.labels){const{labelOrient:C}=O_(["labelOrient"],g.header,a,e);(e==="row"&&!St(["top","bottom"],C)||e==="column"&&!St(["left","right"],C))&&(o=AQA(g,e,a))}const s=Oc(A)&&!xL(A.facet),I=n.axes,r=(I==null?void 0:I.length)>0;if(o||r){const C=e==="row"?"height":"width";return{name:A.getName(`${e}_${t}`),type:"group",role:`${e}-${t}`,...i.facetFieldDef?{from:{data:A.getName(`${e}_domain`)},sort:fbt(g,e)}:{},...r&&s?{from:{data:A.getName(`facet_domain_${e}`)}}:{},...o?{title:o}:{},...n.sizeSignal?{encode:{update:{[C]:n.sizeSignal}}}:{},...r?{axes:I}:{}}}}return null}const bbt={column:{start:0,end:1},row:{start:1,end:0}};function wbt(A,e){return bbt[e][A]}function Dbt(A,e){const t={};for(const i of ul){const n=A[i];if(n!=null&&n.facetFieldDef){const{titleAnchor:o,titleOrient:g}=O_(["titleAnchor","titleOrient"],n.facetFieldDef.header,e,i),a=__(i,g),s=wbt(o,a);s!==void 0&&(t[a]=s)}}return Ki(t)?void 0:t}function GPA(A,e,t,i,n){const o={};for(const g of i){if(!n[g])continue;const a=x2(g,e==null?void 0:e.header,A,t);a!==void 0&&(o[n[g]]=a)}return o}function eQA(A){return[...q_(A,"width"),...q_(A,"height"),...q_(A,"childWidth"),...q_(A,"childHeight")]}function q_(A,e){const t=e==="width"?"x":"y",i=A.component.layoutSize.get(e);if(!i||i==="merged")return[];const n=A.getSizeSignalRef(e).signal;if(i==="step"){const o=A.getScaleComponent(t);if(o){const g=o.get("type"),a=o.get("range");if(bg(g)&&_p(a)){const s=A.scaleName(t);return Oc(A.parent)&&A.parent.component.resolve.scale[t]==="independent"?[kPA(s,a)]:[kPA(s,a),{name:n,update:JPA(s,o,`domain('${s}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const o=n.endsWith("width"),g=o?"containerSize()[0]":"containerSize()[1]",a=YBA(A.config.view,o?"width":"height"),s=`isFinite(${g}) ? ${g} : ${a}`;return[{name:n,init:s,on:[{update:s,events:"window:resize"}]}]}else return[{name:n,value:i}]}function kPA(A,e){const t=`${A}_step`;return me(e.step)?{name:t,update:e.step.signal}:{name:t,value:e.step}}function JPA(A,e,t){const i=e.get("type"),n=e.get("padding"),o=Do(e.get("paddingOuter"),n);let g=e.get("paddingInner");return g=i==="band"?g!==void 0?g:n:1,`bandspace(${t}, ${Wc(g)}, ${Wc(o)}) * ${A}_step`}function NPA(A){return A==="childWidth"?"width":A==="childHeight"?"height":A}function YPA(A,e){return WA(A).reduce((t,i)=>{const n=A[i];return{...t,...k2(e,n,i,o=>Dn(o.value))}},{})}function RPA(A,e){if(Oc(e))return A==="theta"?"independent":"shared";if(v2(e))return"shared";if(EQA(e))return Go(A)||A==="theta"||A==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function tQA(A,e){const t=A.scale[e],i=Go(e)?"axis":"legend";return t==="independent"?(A[i][e]==="shared"&&XA(npt(e)),"independent"):A[i][e]||"shared"}const Gbt={...Cft,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},xPA=WA(Gbt);class kbt extends Jd{}const FPA={symbols:Jbt,gradient:Nbt,labels:Ybt,entries:Rbt};function Jbt(A,{fieldOrDatumDef:e,model:t,channel:i,legendCmpt:n,legendType:o}){if(o!=="symbol")return;const{markDef:g,encoding:a,config:s,mark:I}=t,r=g.filled&&I!=="trail";let C={...Emt({},t,a0t),...q8A(t,{filled:r})};const l=n.get("symbolOpacity")??s.legend.symbolOpacity,c=n.get("symbolFillColor")??s.legend.symbolFillColor,B=n.get("symbolStrokeColor")??s.legend.symbolStrokeColor,E=l===void 0?MPA(a.opacity)??g.opacity:void 0;if(C.fill){if(i==="fill"||r&&i===ur)delete C.fill;else if(C.fill.field)c?delete C.fill:(C.fill=Dn(s.legend.symbolBaseFillColor??"black"),C.fillOpacity=Dn(E??1));else if(RA(C.fill)){const u=iQA(a.fill??a.color)??g.fill??(r&&g.color);u&&(C.fill=Dn(u))}}if(C.stroke){if(i==="stroke"||!r&&i===ur)delete C.stroke;else if(C.stroke.field||B)delete C.stroke;else if(RA(C.stroke)){const u=Do(iQA(a.stroke||a.color),g.stroke,r?g.color:void 0);u&&(C.stroke={value:u})}}if(i!==fd){const u=zA(e)&&LPA(t,n,e);u?C.opacity=[{test:u,...Dn(E??1)},Dn(s.legend.unselectedOpacity)]:E&&(C.opacity=Dn(E))}return C={...C,...A},Ki(C)?void 0:C}function Nbt(A,{model:e,legendType:t,legendCmpt:i}){if(t!=="gradient")return;const{config:n,markDef:o,encoding:g}=e;let a={};const s=(i.get("gradientOpacity")??n.legend.gradientOpacity)===void 0?MPA(g.opacity)||o.opacity:void 0;return s&&(a.opacity=Dn(s)),a={...a,...A},Ki(a)?void 0:a}function Ybt(A,{fieldOrDatumDef:e,model:t,channel:i,legendCmpt:n}){const o=t.legend(i)||{},g=t.config,a=zA(e)?LPA(t,n,e):void 0,s=a?[{test:a,value:1},{value:g.legend.unselectedOpacity}]:void 0,{format:I,formatType:r}=o;let C;Ob(r)?C=Uc({fieldOrDatumDef:e,field:"datum.value",format:I,formatType:r,config:g}):I===void 0&&r===void 0&&g.customFormatTypes&&(e.type==="quantitative"&&g.numberFormatType?C=Uc({fieldOrDatumDef:e,field:"datum.value",format:g.numberFormat,formatType:g.numberFormatType,config:g}):e.type==="temporal"&&g.timeFormatType&&zA(e)&&e.timeUnit===void 0&&(C=Uc({fieldOrDatumDef:e,field:"datum.value",format:g.timeFormat,formatType:g.timeFormatType,config:g})));const l={...s?{opacity:s}:{},...C?{text:C}:{},...A};return Ki(l)?void 0:l}function Rbt(A,{legendCmpt:e}){const t=e.get("selections");return t!=null&&t.length?{...A,fill:{value:"transparent"}}:A}function MPA(A){return vPA(A,(e,t)=>Math.max(e,t.value))}function iQA(A){return vPA(A,(e,t)=>Do(e,t.value))}function vPA(A,e){if(G0t(A))return te(A.condition).reduce(e,A.value);if(Vc(A))return A.value}function LPA(A,e,t){const i=e.get("selections");if(!(i!=null&&i.length))return;const n=OA(t.field);return i.map(o=>`(!length(data(${OA(Sn(o)+$b)})) || (${o}[${n}] && indexof(${o}[${n}], datum.value) >= 0))`).join(" || ")}const SPA={direction:({direction:A})=>A,format:({fieldOrDatumDef:A,legend:e,config:t})=>{const{format:i,formatType:n}=e;return d6A(A,A.type,i,n,t,!1)},formatType:({legend:A,fieldOrDatumDef:e,scaleType:t})=>{const{formatType:i}=A;return h6A(i,e,t)},gradientLength:A=>{const{legend:e,legendConfig:t}=A;return e.gradientLength??t.gradientLength??Hbt(A)},labelOverlap:({legend:A,legendConfig:e,scaleType:t})=>A.labelOverlap??e.labelOverlap??Zbt(t),symbolType:({legend:A,markDef:e,channel:t,encoding:i})=>A.symbolType??Fbt(e.type,t,i.shape,e.shape),title:({fieldOrDatumDef:A,config:e})=>f2(A,e,{allowDisabling:!0}),type:({legendType:A,scaleType:e,channel:t})=>{if(Q2(t)&&Kc(e)){if(A==="gradient")return}else if(A==="symbol")return;return A},values:({fieldOrDatumDef:A,legend:e})=>xbt(e,A)};function xbt(A,e){const t=A.values;if(RA(t))return v6A(e,t);if(me(t))return t}function Fbt(A,e,t,i){if(e!=="shape"){const n=iQA(t)??i;if(n)return n}switch(A){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function Mbt(A){const{legend:e}=A;return Do(e.type,vbt(A))}function vbt({channel:A,timeUnit:e,scaleType:t}){if(Q2(A)){if(St(["quarter","month","day"],e))return"symbol";if(Kc(t))return"gradient"}return"symbol"}function Lbt({legendConfig:A,legendType:e,orient:t,legend:i}){return i.direction??A[e?"gradientDirection":"symbolDirection"]??Sbt(t,e)}function Sbt(A,e){switch(A){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return e==="gradient"?"horizontal":void 0}}function Hbt({legendConfig:A,model:e,direction:t,orient:i,scaleType:n}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:g,gradientVerticalMaxLength:a,gradientVerticalMinLength:s}=A;if(Kc(n))return t==="horizontal"?i==="top"||i==="bottom"?HPA(e,"width",g,o):g:HPA(e,"height",s,a)}function HPA(A,e,t,i){return{signal:`clamp(${A.getSizeSignalRef(e).signal}, ${t}, ${i})`}}function Zbt(A){if(St(["quantile","threshold","log","symlog"],A))return"greedy"}function ZPA(A){const e=co(A)?Wbt(A):Xbt(A);return A.component.legends=e,e}function Wbt(A){const{encoding:e}=A,t={};for(const i of[ur,...g8A]){const n=tg(e[i]);!n||!A.getScaleComponent(i)||i===dr&&zA(n)&&n.type===d2||(t[i]=Vbt(A,i))}return t}function Kbt(A,e){const t=A.scaleName(e);if(A.mark==="trail"){if(e==="color")return{stroke:t};if(e==="size")return{strokeWidth:t}}return e==="color"?A.markDef.filled?{fill:t}:{stroke:t}:{[e]:t}}function Ubt(A,e,t,i){switch(e){case"disable":return t!==void 0;case"values":return!!(t!=null&&t.values);case"title":if(e==="title"&&A===(i==null?void 0:i.title))return!0}return A===(t||{})[e]}function Vbt(A,e){var t;let i=A.legend(e);const{markDef:n,encoding:o,config:g}=A,a=g.legend,s=new kbt({},Kbt(A,e));$yt(A,e,s);const I=i!==void 0?!i:a.disable;if(s.set("disable",I,i!==void 0),I)return s;i=i||{};const r=A.getScaleComponent(e).get("type"),C=tg(o[e]),l=zA(C)?(t=yg(C.timeUnit))==null?void 0:t.unit:void 0,c=i.orient||g.legend.orient||"right",B=Mbt({legend:i,channel:e,timeUnit:l,scaleType:r}),E=Lbt({legend:i,legendType:B,orient:c,legendConfig:a}),u={legend:i,channel:e,model:A,markDef:n,encoding:o,fieldOrDatumDef:C,legendConfig:a,config:g,scaleType:r,orient:c,legendType:B,direction:E};for(const G of xPA){if(B==="gradient"&&G.startsWith("symbol")||B==="symbol"&&G.startsWith("gradient"))continue;const R=G in SPA?SPA[G](u):i[G];if(R!==void 0){const x=Ubt(R,G,i,A.fieldDef(e));(x||g.legend[G]===void 0)&&s.set(G,R,x)}}const d=(i==null?void 0:i.encoding)??{},f=s.get("selections"),w={},y={fieldOrDatumDef:C,model:A,channel:e,legendCmpt:s,legendType:B};for(const G of["labels","legend","title","symbols","gradient","entries"]){const R=YPA(d[G]??{},A),x=G in FPA?FPA[G](R,y):R;x!==void 0&&!Ki(x)&&(w[G]={...f!=null&&f.length&&zA(C)?{name:`${Sn(C.field)}_legend_${G}`}:{},...f!=null&&f.length?{interactive:!!f}:{},update:x})}return Ki(w)||s.set("encode",w,!!(i!=null&&i.encoding)),s}function Xbt(A){const{legends:e,resolve:t}=A.component;for(const i of A.children){ZPA(i);for(const n of WA(i.component.legends))t.legend[n]=tQA(A.component.resolve,n),t.legend[n]==="shared"&&(e[n]=WPA(e[n],i.component.legends[n]),e[n]||(t.legend[n]="independent",delete e[n]))}for(const i of WA(e))for(const n of A.children)n.component.legends[i]&&t.legend[i]==="shared"&&delete n.component.legends[i];return e}function WPA(A,e){var t,i,n,o;if(!A)return e.clone();const g=A.getWithExplicit("orient"),a=e.getWithExplicit("orient");if(g.explicit&&a.explicit&&g.value!==a.value)return;let s=!1;for(const I of xPA){const r=Pp(A.getWithExplicit(I),e.getWithExplicit(I),I,"legend",(C,l)=>{switch(I){case"symbolType":return zbt(C,l);case"title":return kjA(C,l);case"type":return s=!0,zc("symbol")}return H_(C,l,I,"legend")});A.setWithExplicit(I,r)}return s&&((i=(t=A.implicit)==null?void 0:t.encode)!=null&&i.gradient&&e_(A.implicit,["encode","gradient"]),(o=(n=A.explicit)==null?void 0:n.encode)!=null&&o.gradient&&e_(A.explicit,["encode","gradient"])),A}function zbt(A,e){return e.value==="circle"?e:A}function Tbt(A,e,t,i){var n,o;A.encode??(A.encode={}),(n=A.encode)[e]??(n[e]={}),(o=A.encode[e]).update??(o.update={}),A.encode[e].update[t]=i}function KPA(A){const e=A.component.legends,t={};for(const i of WA(e)){const n=A.getScaleComponent(i),o=Ui(n.get("domains"));if(t[o])for(const g of t[o])WPA(g,e[i])||t[o].push(e[i]);else t[o]=[e[i].clone()]}return oa(t).flat().map(i=>_bt(i,A.config)).filter(i=>i!==void 0)}function _bt(A,e){var t,i,n;const{disable:o,labelExpr:g,selections:a,...s}=A.combine();if(!o){if(e.aria===!1&&s.aria==null&&(s.aria=!1),(t=s.encode)!=null&&t.symbols){const I=s.encode.symbols.update;I.fill&&I.fill.value!=="transparent"&&!I.stroke&&!s.stroke&&(I.stroke={value:"transparent"});for(const r of g8A)s[r]&&delete I[r]}if(s.title||delete s.title,g!==void 0){let I=g;(n=(i=s.encode)==null?void 0:i.labels)!=null&&n.update&&me(s.encode.labels.update.text)&&(I=Sb(g,"datum.label",s.encode.labels.update.text.signal)),Tbt(s,"labels","text",{signal:I})}return s}}function Obt(A){return v2(A)||EQA(A)?qbt(A):UPA(A)}function qbt(A){return A.children.reduce((e,t)=>e.concat(t.assembleProjections()),UPA(A))}function UPA(A){const e=A.component.projection;if(!e||e.merged)return[];const t=e.combine(),{name:i}=t;if(e.data){const n={signal:`[${e.size.map(g=>g.signal).join(", ")}]`},o=e.data.reduce((g,a)=>{const s=me(a)?a.signal:`data('${A.lookupDataSource(a)}')`;return St(g,s)||g.push(s),g},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:n,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...t}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...t}]}const jbt=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class VPA extends Jd{constructor(e,t,i,n){super({...t},{name:e}),this.specifiedProjection=t,this.size=i,this.data=n,this.merged=!1}get isFit(){return!!this.data}}function XPA(A){A.component.projection=co(A)?Pbt(A):ewt(A)}function Pbt(A){if(A.hasProjection){const e=mr(A.specifiedProjection),t=!(e&&(e.scale!=null||e.translate!=null)),i=t?[A.getSizeSignalRef("width"),A.getSizeSignalRef("height")]:void 0,n=t?$bt(A):void 0,o=new VPA(A.projectionName(!0),{...mr(A.config.projection)??{},...e??{}},i,n);return o.get("type")||o.set("type","equalEarth",!1),o}}function $bt(A){const e=[],{encoding:t}=A;for(const i of[[Hc,Sc],[El,Zc]])(tg(t[i[0]])||tg(t[i[1]]))&&e.push({signal:A.getName(`geojson_${e.length}`)});return A.channelHasField(dr)&&A.typedFieldDef(dr).type===d2&&e.push({signal:A.getName(`geojson_${e.length}`)}),e.length===0&&e.push(A.requestDataName(ln.Main)),e}function Awt(A,e){const t=bcA(jbt,i=>!!(!Je(A.explicit,i)&&!Je(e.explicit,i)||Je(A.explicit,i)&&Je(e.explicit,i)&&xI(A.get(i),e.get(i))));if(xI(A.size,e.size)){if(t)return A;if(xI(A.explicit,{}))return e;if(xI(e.explicit,{}))return A}return null}function ewt(A){if(A.children.length===0)return;let e;for(const i of A.children)XPA(i);const t=bcA(A.children,i=>{const n=i.component.projection;if(n)if(e){const o=Awt(e,n);return o&&(e=o),!!o}else return e=n,!0;else return!0});if(e&&t){const i=A.projectionName(!0),n=new VPA(i,e.specifiedProjection,e.size,Xe(e.data));for(const o of A.children){const g=o.component.projection;g&&(g.isFit&&n.data.push(...o.component.projection.data),o.renameProjection(g.get("name"),i),g.merged=!0)}return n}}function twt(A,e,t,i){if(ML(e,t)){const n=co(A)?A.axis(t)??A.legend(t)??{}:{},o=jA(e,{expr:"datum"}),g=jA(e,{expr:"datum",binSuffix:"end"});return{formulaAs:jA(e,{binSuffix:"range",forAs:!0}),formula:RL(o,g,n.format,n.formatType,i)}}return{}}function zPA(A,e){return`${ujA(A)}_${e}`}function iwt(A,e){return{signal:A.getName(`${e}_bins`),extentSignal:A.getName(`${e}_extent`)}}function nQA(A,e,t){const i=J_(t,void 0)??{},n=zPA(i,e);return A.getName(`${n}_bins`)}function nwt(A){return"as"in A}function TPA(A,e,t){let i,n;nwt(A)?i=ie(A.as)?[A.as,`${A.as}_end`]:[A.as[0],A.as[1]]:i=[jA(A,{forAs:!0}),jA(A,{binSuffix:"end",forAs:!0})];const o={...J_(e,void 0)},g=zPA(o,A.field),{signal:a,extentSignal:s}=iwt(t,g);if(I_(o.extent)){const r=o.extent;n=dPA(t,r.param,r),delete o.extent}const I={bin:o,field:A.field,as:[i],...a?{signal:a}:{},...s?{extentSignal:s}:{},...n?{span:n}:{}};return{key:g,binComponent:I}}class OQ extends vi{clone(){return new OQ(null,Xe(this.bins))}constructor(e,t){super(e),this.bins=t}static makeFromEncoding(e,t){const i=t.reduceFieldDef((n,o,g)=>{if(fs(o)&&Cn(o.bin)){const{key:a,binComponent:s}=TPA(o,o.bin,t);n[a]={...s,...n[a],...twt(t,o,g,t.config)}}return n},{});return Ki(i)?null:new OQ(e,i)}static makeFromTransform(e,t,i){const{key:n,binComponent:o}=TPA(t,t.bin,i);return new OQ(e,{[n]:o})}merge(e,t){for(const i of WA(e.bins))i in this.bins?(t(e.bins[i].signal,this.bins[i].signal),this.bins[i].as=MQ([...this.bins[i].as,...e.bins[i].as],Lt)):this.bins[i]=e.bins[i];for(const i of e.children)e.removeChild(i),i.parent=this;e.remove()}producedFields(){return new Set(oa(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(oa(this.bins).map(e=>e.field))}hash(){return`Bin ${Lt(this.bins)}`}assemble(){return oa(this.bins).flatMap(e=>{const t=[],[i,...n]=e.as,{extent:o,...g}=e.bin,a={type:"bin",field:Bl(e.field),as:i,signal:e.signal,...I_(o)?{extent:null}:{extent:o},...e.span?{span:{signal:`span(${e.span})`}}:{},...g};!o&&e.extentSignal&&(t.push({type:"extent",field:Bl(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),t.push(a);for(const s of n)for(let I=0;I<2;I++)t.push({type:"formula",expr:jA({field:i[I]},{expr:"datum"}),as:s[I]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t})}}function owt(A,e,t,i){var n;const o=co(i)?i.encoding[HQ(e)]:void 0;if(fs(t)&&co(i)&&G6A(t,o,i.markDef,i.config)){A.add(jA(t,{})),A.add(jA(t,{suffix:"end"}));const{mark:g,markDef:a,config:s}=i,I=qp({fieldDef:t,markDef:a,config:s});NL(g)&&I!==.5&&Go(e)&&(A.add(jA(t,{suffix:Z_})),A.add(jA(t,{suffix:W_}))),t.bin&&ML(t,e)&&A.add(jA(t,{binSuffix:"range"}))}else if(ajA(e)){const g=gjA(e);A.add(i.getName(g))}else A.add(jA(t));return qb(t)&&Opt((n=t.scale)==null?void 0:n.range)&&A.add(t.scale.range.field),A}function gwt(A,e){for(const t of WA(e)){const i=e[t];for(const n of WA(i))t in A?A[t][n]=new Set([...A[t][n]??[],...i[n]]):A[t]={[n]:i[n]}}}class Tc extends vi{clone(){return new Tc(null,new Set(this.dimensions),Xe(this.measures))}constructor(e,t,i){super(e),this.dimensions=t,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(e,t){let i=!1;t.forEachFieldDef(g=>{g.aggregate&&(i=!0)});const n={},o=new Set;return!i||(t.forEachFieldDef((g,a)=>{const{aggregate:s,field:I}=g;if(s)if(s==="count")n["*"]??(n["*"]={}),n["*"].count=new Set([jA(g,{forAs:!0})]);else{if(bd(s)||zp(s)){const r=bd(s)?"argmin":"argmax",C=s[r];n[C]??(n[C]={}),n[C][r]=new Set([jA({op:r,field:C},{forAs:!0})])}else n[I]??(n[I]={}),n[I][s]=new Set([jA(g,{forAs:!0})]);yd(a)&&t.scaleDomain(a)==="unaggregated"&&(n[I]??(n[I]={}),n[I].min=new Set([jA({field:I,aggregate:"min"},{forAs:!0})]),n[I].max=new Set([jA({field:I,aggregate:"max"},{forAs:!0})]))}else owt(o,a,g,t)}),o.size+WA(n).length===0)?null:new Tc(e,o,n)}static makeFromTransform(e,t){const i=new Set,n={};for(const o of t.aggregate){const{op:g,field:a,as:s}=o;g&&(g==="count"?(n["*"]??(n["*"]={}),n["*"].count=new Set([s||jA(o,{forAs:!0})])):(n[a]??(n[a]={}),n[a][g]=new Set([s||jA(o,{forAs:!0})])))}for(const o of t.groupby??[])i.add(o);return i.size+WA(n).length===0?null:new Tc(e,i,n)}merge(e){return jqA(this.dimensions,e.dimensions)?(gwt(this.measures,e.measures),!0):(mpt("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...WA(this.measures)])}producedFields(){const e=new Set;for(const t of WA(this.measures))for(const i of WA(this.measures[t])){const n=this.measures[t][i];n.size===0?e.add(`${i}_${t}`):n.forEach(e.add,e)}return e}hash(){return`Aggregate ${Lt({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],i=[];for(const n of WA(this.measures))for(const o of WA(this.measures[n]))for(const g of this.measures[n][o])i.push(g),e.push(o),t.push(n==="*"?null:Bl(n));return{type:"aggregate",groupby:[...this.dimensions].map(Bl),ops:e,fields:t,as:i}}}class F2 extends vi{constructor(e,t,i,n){super(e),this.model=t,this.name=i,this.data=n;for(const o of ul){const g=t.facet[o];if(g){const{bin:a,sort:s}=g;this[o]={name:t.getName(`${o}_domain`),fields:[jA(g),...Cn(a)?[jA(g,{binSuffix:"end"})]:[]],...UQ(s)?{sortField:s}:RA(s)?{sortIndexField:R2(g,o)}:{}}}}this.childModel=t.child}hash(){let e="Facet";for(const t of ul)this[t]&&(e+=` ${t.charAt(0)}:${Lt(this[t])}`);return e}get fields(){var e;const t=[];for(const i of ul)(e=this[i])!=null&&e.fields&&t.push(...this[i].fields);return t}dependentFields(){const e=new Set(this.fields);for(const t of ul)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of ZQ){const i=this.childModel.component.scales[t];if(i&&!i.merged){const n=i.get("type"),o=i.get("range");if(bg(n)&&_p(o)){const g=P_(this.childModel,t),a=BQA(g);a?e[t]=a:XA(WcA(t))}}}return e}assembleRowColumnHeaderData(e,t,i){const n={row:"y",column:"x",facet:void 0}[e],o=[],g=[],a=[];n&&i&&i[n]&&(t?(o.push(`distinct_${i[n]}`),g.push("max")):(o.push(i[n]),g.push("distinct")),a.push(`distinct_${i[n]}`));const{sortField:s,sortIndexField:I}=this[e];if(s){const{op:r=p_,field:C}=s;o.push(C),g.push(r),a.push(jA(s,{forAs:!0}))}else I&&(o.push(I),g.push("max"),a.push(I));return{name:this[e].name,source:t??this.data,transform:[{type:"aggregate",groupby:this[e].fields,...o.length?{fields:o,ops:g,as:a}:{}}]}}assembleFacetHeaderData(e){var t;const{columns:i}=this.model.layout,{layoutHeaders:n}=this.model.component,o=[],g={};for(const I of PBA){for(const r of $BA){const C=(n[I]&&n[I][r])??[];for(const l of C)if(((t=l.axes)==null?void 0:t.length)>0){g[I]=!0;break}}if(g[I]){const r=`length(data("${this.facet.name}"))`,C=I==="row"?i?{signal:`ceil(${r} / ${i})`}:1:i?{signal:`min(${r}, ${i})`}:{signal:r};o.push({name:`${this.facet.name}_${I}`,transform:[{type:"sequence",start:0,stop:C}]})}}const{row:a,column:s}=g;return(a||s)&&o.unshift(this.assembleRowColumnHeaderData("facet",null,e)),o}assemble(){const e=[];let t=null;const i=this.getChildIndependentFieldsWithStep(),{column:n,row:o,facet:g}=this;if(n&&o&&(i.x||i.y)){t=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),s=a.map(()=>"distinct");e.push({name:t,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:s}]})}for(const a of[dd,ud])this[a]&&e.push(this.assembleRowColumnHeaderData(a,t,i));if(g){const a=this.assembleFacetHeaderData(i);a&&e.push(...a)}return e}}function _PA(A){return A.startsWith("'")&&A.endsWith("'")||A.startsWith('"')&&A.endsWith('"')?A.slice(1,-1):A}function awt(A,e){const t=kcA(A);if(e==="number")return`toNumber(${t})`;if(e==="boolean")return`toBoolean(${t})`;if(e==="string")return`toString(${t})`;if(e==="date")return`toDate(${t})`;if(e==="flatten")return t;if(e.startsWith("date:")){const i=_PA(e.slice(5,e.length));return`timeParse(${t},'${i}')`}else if(e.startsWith("utc:")){const i=_PA(e.slice(4,e.length));return`utcParse(${t},'${i}')`}else return XA(Jmt(e)),null}function swt(A){const e={};return A_(A.filter,t=>{if(A6A(t)){let i=null;TcA(t)?i=FI(t.equal):OcA(t)?i=FI(t.lte):_cA(t)?i=FI(t.lt):qcA(t)?i=FI(t.gt):jcA(t)?i=FI(t.gte):PcA(t)?i=t.range[0]:$cA(t)&&(i=(t.oneOf??t.in)[0]),i&&(Ub(i)?e[t.field]="date":ti(i)?e[t.field]="number":ie(i)&&(e[t.field]="string")),t.timeUnit&&(e[t.field]="date")}}),e}function rwt(A){const e={};function t(i){b2(i)?e[i.field]="date":i.type==="quantitative"&&amt(i.aggregate)?e[i.field]="number":l2(i.field)>1?i.field in e||(e[i.field]="flatten"):qb(i)&&UQ(i.sort)&&l2(i.sort.field)>1&&(i.sort.field in e||(e[i.sort.field]="flatten"))}if((co(A)||Oc(A))&&A.forEachFieldDef((i,n)=>{if(fs(i))t(i);else{const o=Wb(n),g=A.fieldDef(o);t({...i,type:g.type})}}),co(A)){const{mark:i,markDef:n,encoding:o}=A;if(Op(i)&&!A.encoding.order){const g=n.orient==="horizontal"?"y":"x",a=o[g];zA(a)&&a.type==="quantitative"&&!(a.field in e)&&(e[a.field]="number")}}return e}function Iwt(A){const e={};if(co(A)&&A.component.selection)for(const t of WA(A.component.selection)){const i=A.component.selection[t];for(const n of i.project.items)!n.channel&&l2(n.field)>1&&(e[n.field]="flatten")}return e}class Va extends vi{clone(){return new Va(null,Xe(this._parse))}constructor(e,t){super(e),this._parse=t}hash(){return`Parse ${Lt(this._parse)}`}static makeExplicit(e,t,i){var n;let o={};const g=t.data;return!$p(g)&&(n=g==null?void 0:g.format)!=null&&n.parse&&(o=g.format.parse),this.makeWithAncestors(e,o,{},i)}static makeWithAncestors(e,t,i,n){for(const a of WA(i)){const s=n.getWithExplicit(a);s.value!==void 0&&(s.explicit||s.value===i[a]||s.value==="derived"||i[a]==="flatten"?delete i[a]:XA(MjA(a,i[a],s.value)))}for(const a of WA(t)){const s=n.get(a);s!==void 0&&(s===t[a]?delete t[a]:XA(MjA(a,t[a],s)))}const o=new Jd(t,i);n.copyAll(o);const g={};for(const a of WA(o.combine())){const s=o.get(a);s!==null&&(g[a]=s)}return WA(g).length===0||n.parseNothing?null:new Va(e,g)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const t of WA(this._parse)){const i=this._parse[t];l2(t)===1&&(e[t]=i)}return e}producedFields(){return new Set(WA(this._parse))}dependentFields(){return new Set(WA(this._parse))}assembleTransforms(e=!1){return WA(this._parse).filter(t=>e?l2(t)>1:!0).map(t=>{const i=awt(t,this._parse[t]);return i?{type:"formula",expr:i,as:JcA(t)}:null}).filter(t=>t!==null)}}class t0 extends vi{clone(){return new t0(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([Xc])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Xc}}}class WL extends vi{clone(){return new WL(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Lt(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class KL extends vi{clone(){return new KL(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Lt(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class ew extends vi{constructor(e){super(null),e??(e={name:"source"});let t;if($p(e)||(t=e.format?{...Er(e.format,["parse"])}:{}),LL(e))this._data={values:e.values};else if(D2(e)){if(this._data={url:e.url},!t.type){let i=/(?:\.([^.]+))?$/.exec(e.url)[1];St(["json","csv","tsv","dsv","topojson"],i)||(i="json"),t.type=i}}else L8A(e)?this._data={values:[{type:"Sphere"}]}:(M8A(e)||$p(e))&&(this._data={});this._generator=$p(e),e.name&&(this._name=e.name),t&&!Ki(t)&&(this._data.format=t)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var OPA=globalThis&&globalThis.__classPrivateFieldSet||function(A,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?A!==e||!n:!e.has(A))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(A,t):n?n.value=t:e.set(A,t),t},Cwt=globalThis&&globalThis.__classPrivateFieldGet||function(A,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?A!==e||!i:!e.has(A))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(A):i?i.value:e.get(A)},UL;function oQA(A){return A instanceof ew||A instanceof WL||A instanceof KL}class gQA{constructor(){UL.set(this,void 0),OPA(this,UL,!1,"f")}setModified(){OPA(this,UL,!0,"f")}get modifiedFlag(){return Cwt(this,UL,"f")}}UL=new WeakMap;class tw extends gQA{getNodeDepths(e,t,i){i.set(e,t);for(const n of e.children)this.getNodeDepths(n,t+1,i);return i}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort((i,n)=>n[1]-i[1]);for(const i of t)this.run(i[0]);return this.modifiedFlag}}class aQA extends gQA{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class lwt extends aQA{mergeNodes(e,t){const i=t.shift();for(const n of t)e.removeChild(n),n.parent=i,n.remove()}run(e){const t=e.children.map(n=>n.hash()),i={};for(let n=0;n<t.length;n++)i[t[n]]===void 0?i[t[n]]=[e.children[n]]:i[t[n]].push(e.children[n]);for(const n of WA(i))i[n].length>1&&(this.setModified(),this.mergeNodes(e,i[n]))}}class cwt extends aQA{constructor(e){super(),this.requiresSelectionId=e&&TBA(e)}run(e){e instanceof t0&&(this.requiresSelectionId&&(oQA(e.parent)||e.parent instanceof Tc||e.parent instanceof Va)||(this.setModified(),e.remove()))}}class Bwt extends gQA{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let i=new Set;e instanceof _Q&&(i=e.producedFields(),wcA(i,t)&&(this.setModified(),e.removeFormulas(t),e.producedFields.length===0&&e.remove()));for(const n of e.children)this.run(n,new Set([...t,...i]))}}class Qwt extends aQA{constructor(){super()}run(e){e instanceof ys&&!e.isRequired()&&(this.setModified(),e.remove())}}class Ewt extends tw{run(e){if(!oQA(e)&&!(e.numChildren()>1)){for(const t of e.children)if(t instanceof Va)if(e instanceof Va)this.setModified(),e.merge(t);else{if(GcA(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}}class uwt extends tw{run(e){const t=[...e.children],i=e.children.filter(n=>n instanceof Va);if(e.numChildren()>1&&i.length>=1){const n={},o=new Set;for(const g of i){const a=g.parse;for(const s of WA(a))s in n?n[s]!==a[s]&&o.add(s):n[s]=a[s]}for(const g of o)delete n[g];if(!Ki(n)){this.setModified();const g=new Va(e,n);for(const a of t){if(a instanceof Va)for(const s of WA(n))delete a.parse[s];e.removeChild(a),a.parent=g,a instanceof Va&&WA(a.parse).length===0&&a.remove()}}}}}class dwt extends tw{run(e){e instanceof ys||e.numChildren()>0||e instanceof F2||e instanceof ew||(this.setModified(),e.remove())}}class hwt extends tw{run(e){const t=e.children.filter(n=>n instanceof _Q),i=t.pop();for(const n of t)this.setModified(),i.merge(n)}}class mwt extends tw{run(e){const t=e.children.filter(n=>n instanceof Tc),i={};for(const n of t){const o=Lt(n.groupBy);o in i||(i[o]=[]),i[o].push(n)}for(const n of WA(i)){const o=i[n];if(o.length>1){const g=o.pop();for(const a of o)g.merge(a)&&(e.removeChild(a),a.parent=g,a.remove(),this.setModified())}}}}class pwt extends tw{constructor(e){super(),this.model=e}run(e){const t=!(oQA(e)||e instanceof N2||e instanceof Va||e instanceof t0),i=[],n=[];for(const o of e.children)o instanceof OQ&&(t&&!GcA(e.producedFields(),o.dependentFields())?i.push(o):n.push(o));if(i.length>0){const o=i.pop();for(const g of i)o.merge(g,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof OQ?e.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(n.length>1){const o=n.pop();for(const g of n)o.merge(g,this.model.renameSignal.bind(this.model));this.setModified()}}}class fwt extends tw{run(e){const t=[...e.children];if(!Lb(t,o=>o instanceof ys)||e.numChildren()<=1)return;const i=[];let n;for(const o of t)if(o instanceof ys){let g=o;for(;g.numChildren()===1;){const[a]=g.children;if(a instanceof ys)g=a;else break}i.push(...g.children),n?(e.removeChild(o),o.parent=n.parent,n.parent.removeChild(n),n.parent=g,this.setModified()):n=g}else i.push(o);if(i.length){this.setModified();for(const o of i)o.parent.removeChild(o),o.parent=n}}}class iw extends vi{clone(){return new iw(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=MQ(this.transform.groupby.concat(e),t=>t)}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map(t=>t.field).filter(t=>t!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){return e.as??jA(e)}hash(){return`JoinAggregateTransform ${Lt(this.transform)}`}assemble(){const e=[],t=[],i=[];for(const o of this.transform.joinaggregate)t.push(o.op),i.push(this.getDefaultName(o)),e.push(o.field===void 0?null:o.field);const n=this.transform.groupby;return{type:"joinaggregate",as:i,ops:t,fields:e,...n!==void 0?{groupby:n}:{}}}}function ywt(A){return A.stack.stackBy.reduce((e,t)=>{const i=t.fieldDef,n=jA(i);return n&&e.push(n),e},[])}function bwt(A){return RA(A)&&A.every(e=>ie(e))&&A.length>1}class Yd extends vi{clone(){return new Yd(null,Xe(this._stack))}constructor(e,t){super(e),this._stack=t}static makeFromTransform(e,t){const{stack:i,groupby:n,as:o,offset:g="zero"}=t,a=[],s=[];if(t.sort!==void 0)for(const C of t.sort)a.push(C.field),s.push(Do(C.order,"ascending"));const I={field:a,order:s};let r;return bwt(o)?r=o:ie(o)?r=[o,`${o}_end`]:r=[`${t.stack}_start`,`${t.stack}_end`],new Yd(e,{dimensionFieldDefs:[],stackField:i,groupby:n,offset:g,sort:I,facetby:[],as:r})}static makeFromEncoding(e,t){const i=t.stack,{encoding:n}=t;if(!i)return null;const{groupbyChannels:o,fieldChannel:g,offset:a,impute:s}=i,I=o.map(c=>{const B=n[c];return XQ(B)}).filter(c=>!!c),r=ywt(t),C=t.encoding.order;let l;if(RA(C)||zA(C))l=wjA(C);else{const c=k6A(C)?C.sort:g==="y"?"descending":"ascending";l=r.reduce((B,E)=>(B.field.push(E),B.order.push(c),B),{field:[],order:[]})}return new Yd(e,{dimensionFieldDefs:I,stackField:t.vgField(g),facetby:[],stackby:r,sort:l,offset:a,impute:s,as:[t.vgField(g,{suffix:"start",forAs:!0}),t.vgField(g,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Lt(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:e,impute:t,groupby:i}=this._stack;return e.length>0?e.map(n=>n.bin?t?[jA(n,{binSuffix:"mid"})]:[jA(n,{}),jA(n,{binSuffix:"end"})]:[jA(n)]).flat():i??[]}assemble(){const e=[],{facetby:t,dimensionFieldDefs:i,stackField:n,stackby:o,sort:g,offset:a,impute:s,as:I}=this._stack;if(s)for(const r of i){const{bandPosition:C=.5,bin:l}=r;if(l){const c=jA(r,{expr:"datum"}),B=jA(r,{expr:"datum",binSuffix:"end"});e.push({type:"formula",expr:`${C}*${c}+${1-C}*${B}`,as:jA(r,{binSuffix:"mid",forAs:!0})})}e.push({type:"impute",field:n,groupby:[...o,...t],key:jA(r,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:n,sort:g,as:I,offset:a}),e}}class M2 extends vi{clone(){return new M2(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=MQ(this.transform.groupby.concat(e),t=>t)}dependentFields(){const e=new Set;return(this.transform.groupby??[]).forEach(e.add,e),(this.transform.sort??[]).forEach(t=>e.add(t.field)),this.transform.window.map(t=>t.field).filter(t=>t!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){return e.as??jA(e)}hash(){return`WindowTransform ${Lt(this.transform)}`}assemble(){const e=[],t=[],i=[],n=[];for(const C of this.transform.window)t.push(C.op),i.push(this.getDefaultName(C)),n.push(C.param===void 0?null:C.param),e.push(C.field===void 0?null:C.field);const o=this.transform.frame,g=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&t.every(C=>ScA(C)))return{type:"joinaggregate",as:i,ops:t,fields:e,...g!==void 0?{groupby:g}:{}};const a=[],s=[];if(this.transform.sort!==void 0)for(const C of this.transform.sort)a.push(C.field),s.push(C.order??"ascending");const I={field:a,order:s},r=this.transform.ignorePeers;return{type:"window",params:n,as:i,ops:t,fields:e,sort:I,...r!==void 0?{ignorePeers:r}:{},...g!==void 0?{groupby:g}:{},...o!==void 0?{frame:o}:{}}}}function wwt(A){function e(t){if(!(t instanceof F2)){const i=t.clone();if(i instanceof ys){const n=rQA+i.getSource();i.setSource(n),A.model.component.data.outputNodes[n]=i}else(i instanceof Tc||i instanceof Yd||i instanceof M2||i instanceof iw)&&i.addDimensions(A.fields);for(const n of t.children.flatMap(e))n.parent=i;return[i]}return t.children.flatMap(e)}return e}function sQA(A){if(A instanceof F2)if(A.numChildren()===1&&!(A.children[0]instanceof ys)){const e=A.children[0];(e instanceof Tc||e instanceof Yd||e instanceof M2||e instanceof iw)&&e.addDimensions(A.fields),e.swapWithParent(),sQA(A)}else{const e=A.model.component.data.main;qPA(e);const t=wwt(A),i=A.children.map(t).flat();for(const n of i)n.parent=e}else A.children.map(sQA)}function qPA(A){if(A instanceof ys&&A.type===ln.Main&&A.numChildren()===1){const e=A.children[0];e instanceof F2||(e.swapWithParent(),qPA(A))}}const rQA="scale_",j_=5;function IQA(A){for(const e of A){for(const t of e.children)if(t.parent!==e)return!1;if(!IQA(e.children))return!1}return!0}function _c(A,e){let t=!1;for(const i of e)t=A.optimize(i)||t;return t}function jPA(A,e,t){let i=A.sources,n=!1;return n=_c(new Qwt,i)||n,n=_c(new cwt(e),i)||n,i=i.filter(o=>o.numChildren()>0),n=_c(new dwt,i)||n,i=i.filter(o=>o.numChildren()>0),t||(n=_c(new Ewt,i)||n,n=_c(new pwt(e),i)||n,n=_c(new Bwt,i)||n,n=_c(new uwt,i)||n,n=_c(new mwt,i)||n,n=_c(new hwt,i)||n,n=_c(new lwt,i)||n,n=_c(new fwt,i)||n),A.sources=i,n}function Dwt(A,e){IQA(A.sources);let t=0,i=0;for(let n=0;n<j_&&jPA(A,e,!0);n++)t++;A.sources.map(sQA);for(let n=0;n<j_&&jPA(A,e,!1);n++)i++;IQA(A.sources),Math.max(t,i)===j_&&XA(`Maximum optimization runs(${j_}) reached.`)}class Dg{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new Dg(()=>e(t))}}function PPA(A){co(A)?Gwt(A):kwt(A)}function Gwt(A){const e=A.component.scales;for(const t of WA(e)){const i=Nwt(A,t);if(e[t].setWithExplicit("domains",i),Rwt(A,t),A.component.data.isFaceted){let n=A;for(;!Oc(n)&&n.parent;)n=n.parent;if(n.component.resolve.scale[t]==="shared")for(const o of i.value)wd(o)&&(o.data=rQA+o.data.replace(rQA,""))}}}function kwt(A){for(const t of A.children)PPA(t);const e=A.component.scales;for(const t of WA(e)){let i,n=null;for(const o of A.children){const g=o.component.scales[t];if(g){i===void 0?i=g.getWithExplicit("domains"):i=Pp(i,g.getWithExplicit("domains"),"domains","scale",cQA);const a=g.get("selectionExtent");n&&a&&n.param!==a.param&&XA(wmt),n=a}}e[t].setWithExplicit("domains",i),n&&e[t].set("selectionExtent",n,!0)}}function Jwt(A,e,t,i){if(A==="unaggregated"){const{valid:n,reason:o}=$PA(e,t);if(!n){XA(o);return}}else if(A===void 0&&i.useUnaggregatedDomain){const{valid:n}=$PA(e,t);if(n)return"unaggregated"}return A}function Nwt(A,e){const t=A.getScaleComponent(e).get("type"),{encoding:i}=A,n=Jwt(A.scaleDomain(e),A.typedFieldDef(e),t,A.config.scale);return n!==A.scaleDomain(e)&&(A.specifiedScales[e]={...A.specifiedScales[e],domain:n}),e==="x"&&tg(i.x2)?tg(i.x)?Pp(i0(t,n,A,"x"),i0(t,n,A,"x2"),"domain","scale",cQA):i0(t,n,A,"x2"):e==="y"&&tg(i.y2)?tg(i.y)?Pp(i0(t,n,A,"y"),i0(t,n,A,"y2"),"domain","scale",cQA):i0(t,n,A,"y2"):i0(t,n,A,e)}function Ywt(A,e,t){return A.map(i=>({signal:`{data: ${N_(i,{timeUnit:t,type:e})}}`}))}function CQA(A,e,t){var i;const n=(i=yg(t))==null?void 0:i.unit;return e==="temporal"||n?Ywt(A,e,n):[A]}function i0(A,e,t,i){const{encoding:n,markDef:o,mark:g,config:a,stack:s}=t,I=tg(n[i]),{type:r}=I,C=I.timeUnit;if(_pt(e)){const B=i0(A,void 0,t,i),E=CQA(e.unionWith,r,C);return TQ([...E,...B.value])}else{if(me(e))return TQ([e]);if(e&&e!=="unaggregated"&&!s6A(e))return TQ(CQA(e,r,C))}if(s&&i===s.fieldChannel){if(s.offset==="normalize")return zc([[0,1]]);const B=t.requestDataName(ln.Main);return zc([{data:B,field:t.vgField(i,{suffix:"start"})},{data:B,field:t.vgField(i,{suffix:"end"})}])}const l=yd(i)&&zA(I)?xwt(t,i,A):void 0;if(VQ(I)){const B=CQA([I.datum],r,C);return zc(B)}const c=I;if(e==="unaggregated"){const B=t.requestDataName(ln.Main),{field:E}=I;return zc([{data:B,field:jA({field:E,aggregate:"min"})},{data:B,field:jA({field:E,aggregate:"max"})}])}else if(Cn(c.bin)){if(bg(A))return zc(A==="bin-ordinal"?[]:[{data:pL(l)?t.requestDataName(ln.Main):t.requestDataName(ln.Raw),field:t.vgField(i,ML(c,i)?{binSuffix:"range"}:{}),sort:l===!0||!oe(l)?{field:t.vgField(i,{}),op:"min"}:l}]);{const{bin:B}=c;if(Cn(B)){const E=nQA(t,c.field,B);return zc([new Dg(()=>{const u=t.getSignalName(E);return`[${u}.start, ${u}.stop]`})])}else return zc([{data:t.requestDataName(ln.Main),field:t.vgField(i,{})}])}}else if(c.timeUnit&&St(["time","utc"],A)){const B=n[HQ(i)];if(G6A(c,B,o,a)){const E=t.requestDataName(ln.Main),u=qp({fieldDef:c,fieldDef2:B,markDef:o,config:a}),d=NL(g)&&u!==.5&&Go(i);return zc([{data:E,field:t.vgField(i,d?{suffix:Z_}:{})},{data:E,field:t.vgField(i,{suffix:d?W_:"end"})}])}}return zc(l?[{data:pL(l)?t.requestDataName(ln.Main):t.requestDataName(ln.Raw),field:t.vgField(i),sort:l}]:[{data:t.requestDataName(ln.Main),field:t.vgField(i)}])}function lQA(A,e){const{op:t,field:i,order:n}=A;return{op:t??(e?"sum":p_),...i?{field:Bl(i)}:{},...n?{order:n}:{}}}function Rwt(A,e){var t;const i=A.component.scales[e],n=A.specifiedScales[e].domain,o=(t=A.fieldDef(e))==null?void 0:t.bin,g=s6A(n)&&n,a=Kb(o)&&I_(o.extent)&&o.extent;(g||a)&&i.set("selectionExtent",g??a,!0)}function xwt(A,e,t){if(!bg(t))return;const i=A.fieldDef(e),n=i.sort;if(b6A(n))return{op:"min",field:R2(i,e),order:"ascending"};const{stack:o}=A,g=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(UQ(n)){const a=o&&!g.has(n.field);return lQA(n,a)}else if(y6A(n)){const{encoding:a,order:s}=n,I=A.fieldDef(a),{aggregate:r,field:C}=I,l=o&&!g.has(C);if(bd(r)||zp(r))return lQA({field:jA(I),order:s},l);if(ScA(r)||!r)return lQA({op:r,field:C,order:s},l)}else{if(n==="descending")return{op:"min",field:A.vgField(e),order:"descending"};if(St(["ascending",void 0],n))return!0}}function $PA(A,e){const{aggregate:t,type:i}=A;return t?ie(t)&&!rmt.has(t)?{valid:!1,reason:jmt(t)}:i==="quantitative"&&e==="log"?{valid:!1,reason:Pmt(A)}:{valid:!0}:{valid:!1,reason:qmt(A)}}function cQA(A,e,t,i){return A.explicit&&e.explicit&&XA(ipt(t,i,A.value,e.value)),{explicit:A.explicit,value:[...A.value,...e.value]}}function Fwt(A){const e=MQ(A.map(g=>{if(wd(g)){const{sort:a,...s}=g;return s}return g}),Lt),t=MQ(A.map(g=>{if(wd(g)){const a=g.sort;return a!==void 0&&!pL(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(g=>g!==void 0),Lt);if(e.length===0)return;if(e.length===1){const g=A[0];if(wd(g)&&t.length>0){let a=t[0];if(t.length>1){XA(WjA);const s=t.filter(I=>oe(I)&&"op"in I&&I.op!=="min");t.every(I=>oe(I)&&"op"in I)&&s.length===1?a=s[0]:a=!0}else if(oe(a)&&"field"in a){const s=a.field;g.field===s&&(a=a.order?{order:a.order}:!0)}return{...g,sort:a}}return g}const i=MQ(t.map(g=>pL(g)||!("op"in g)||ie(g.op)&&g.op in omt?g:(XA(opt(g)),!0)),Lt);let n;i.length===1?n=i[0]:i.length>1&&(XA(WjA),n=!0);const o=MQ(A.map(g=>wd(g)?g.data:null),g=>g);return o.length===1&&o[0]!==null?{data:o[0],fields:e.map(g=>g.field),...n?{sort:n}:{}}:{fields:e,...n?{sort:n}:{}}}function BQA(A){if(wd(A)&&ie(A.field))return A.field;if(Imt(A)){let e;for(const t of A.fields)if(wd(t)&&ie(t.field)){if(!e)e=t.field;else if(e!==t.field)return XA(gpt),e}return XA(apt),e}else if(Cmt(A)){XA(spt);const e=A.fields[0];return ie(e)?e:void 0}}function P_(A,e){const t=A.component.scales[e].get("domains").map(i=>(wd(i)&&(i.data=A.lookupDataSource(i.data)),i));return Fwt(t)}function A7A(A){return v2(A)||EQA(A)?A.children.reduce((e,t)=>e.concat(A7A(t)),e7A(A)):e7A(A)}function e7A(A){return WA(A.component.scales).reduce((e,t)=>{const i=A.component.scales[t];if(i.merged)return e;const n=i.combine(),{name:o,type:g,selectionExtent:a,domains:s,range:I,reverse:r,...C}=n,l=Mwt(n.range,o,t,A),c=P_(A,t),B=a?Jyt(A,a,i,c):null;return e.push({name:o,type:g,...c?{domain:c}:{},...B?{domainRaw:B}:{},range:l,...r!==void 0?{reverse:r}:{},...C}),e},[])}function Mwt(A,e,t,i){if(Go(t)){if(_p(A))return{step:{signal:`${e}_step`}}}else if(oe(A)&&wd(A))return{...A,data:i.lookupDataSource(A.data)};return A}class t7A extends Jd{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return this.get("zero")!==!1?!0:Lb(this.get("domains"),e=>RA(e)&&e.length===2&&ti(e[0])&&e[0]<=0&&ti(e[1])&&e[1]>=0)}}const vwt=["range","scheme"];function Lwt(A){const e=A.component.scales;for(const t of r_){const i=e[t];if(!i)continue;const n=Swt(t,A);i.setWithExplicit("range",n)}}function i7A(A,e){const t=A.fieldDef(e);if(t!=null&&t.bin){const{bin:i,field:n}=t,o=hr(e),g=A.getName(o);if(oe(i)&&i.binned&&i.step!==void 0)return new Dg(()=>{const a=A.scaleName(e),s=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${A.getSignalName(g)} / (${s})`});if(Cn(i)){const a=nQA(A,n,i);return new Dg(()=>{const s=A.getSignalName(a),I=`(${s}.stop - ${s}.start) / ${s}.step`;return`${A.getSignalName(g)} / (${I})`})}}}function Swt(A,e){const t=e.specifiedScales[A],{size:i}=e,n=e.getScaleComponent(A).get("type");for(const r of vwt)if(t[r]!==void 0){const C=nBA(n,r),l=r6A(A,r);if(!C)XA(HjA(n,r,A));else if(l)XA(l);else switch(r){case"range":{const c=t.range;if(RA(c)){if(Go(A))return TQ(c.map(B=>{if(B==="width"||B==="height"){const E=e.getName(B),u=e.getSignalName.bind(e);return Dg.fromName(u,E)}return B}))}else if(oe(c))return TQ({data:e.requestDataName(ln.Main),field:c.field,sort:{op:"min",field:e.vgField(A)}});return TQ(c)}case"scheme":return TQ(Hwt(t[r]))}}const o=A===Hn||A==="xOffset"?"width":"height",g=i[o];if(zQ(g)){if(Go(A))if(bg(n)){const r=o7A(g,e,A);if(r)return TQ({step:r})}else XA(ZjA(o));else if(GL(A)){const r=A===Zp?"x":"y";if(e.getScaleComponent(r).get("type")==="band"){const C=g7A(g,n);if(C)return TQ(C)}}}const{rangeMin:a,rangeMax:s}=t,I=Zwt(A,e);return(a!==void 0||s!==void 0)&&nBA(n,"rangeMin")&&RA(I)&&I.length===2?TQ([a??I[0],s??I[1]]):zc(I)}function Hwt(A){return Tpt(A)?{scheme:A.name,...Er(A,["name"])}:{scheme:A}}function n7A(A,e,t,{center:i}={}){const n=hr(A),o=e.getName(n),g=e.getSignalName.bind(e);return A===fg&&MI(t)?i?[Dg.fromName(a=>`${g(a)}/2`,o),Dg.fromName(a=>`-${g(a)}/2`,o)]:[Dg.fromName(g,o),0]:i?[Dg.fromName(a=>`-${g(a)}/2`,o),Dg.fromName(a=>`${g(a)}/2`,o)]:[0,Dg.fromName(g,o)]}function Zwt(A,e){const{size:t,config:i,mark:n,encoding:o}=e,{type:g}=tg(o[A]),a=e.getScaleComponent(A).get("type"),{domain:s,domainMid:I}=e.specifiedScales[A];switch(A){case Hn:case fg:{if(St(["point","band"],a)){const r=a7A(A,t,i.view);if(zQ(r))return{step:o7A(r,e,A)}}return n7A(A,e,a)}case Zp:case c2:return Wwt(A,e,a);case pd:{const r=e.component.scales[A].get("zero"),C=s7A(n,r,i),l=Vwt(n,t,e,i);return h2(a)?Uwt(C,l,Kwt(a,i,s,A)):[C,l]}case Ql:return[0,Math.PI*2];case Hb:return[0,360];case Lc:return[0,new Dg(()=>{const r=e.getSignalName("width"),C=e.getSignalName("height");return`min(${r},${C})/2`})];case Up:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Vp:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case dr:return"symbol";case ur:case LQ:case SQ:return a==="ordinal"?g==="nominal"?"category":"ordinal":I!==void 0?"diverging":n==="rect"||n==="geoshape"?"heatmap":"ramp";case fd:case Wp:case Kp:return[i.scale.minOpacity,i.scale.maxOpacity]}}function o7A(A,e,t){const{encoding:i}=e,n=e.getScaleComponent(t),o=xcA(t),g=i[o];if(s8A({step:A,offsetIsDiscrete:je(g)&&t6A(g.type)})==="offset"&&K6A(i,o)){const a=e.getScaleComponent(o);let s=`domain('${e.scaleName(o)}').length`;if(a.get("type")==="band"){const r=a.get("paddingInner")??a.get("padding")??0,C=a.get("paddingOuter")??a.get("padding")??0;s=`bandspace(${s}, ${r}, ${C})`}const I=n.get("paddingInner")??n.get("padding");return{signal:`${A.step} * ${s} / (1-${Qmt(I)})`}}else return A.step}function g7A(A,e){if(s8A({step:A,offsetIsDiscrete:bg(e)})==="offset")return{step:A.step}}function Wwt(A,e,t){const i=A===Zp?"x":"y",n=e.getScaleComponent(i);if(!n)return n7A(i,e,t,{center:!0});const o=n.get("type"),g=e.scaleName(i),{markDef:a,config:s}=e;if(o==="band"){const I=a7A(i,e.size,e.config.view);if(zQ(I)){const r=g7A(I,t);if(r)return r}return[0,{signal:`bandwidth('${g}')`}]}else{const I=e.encoding[i];if(zA(I)&&I.timeUnit){const r=PjA(I.timeUnit,B=>`scale('${g}', ${B})`),C=e.config.scale.bandWithNestedOffsetPaddingInner,l=qp({fieldDef:I,markDef:a,config:s})-.5,c=l!==0?` + ${l}`:"";if(C){const B=me(C)?`${C.signal}/2`+c:`${C/2+l}`,E=me(C)?`(1 - ${C.signal}/2)`+c:`${1-C/2+l}`;return[{signal:`${B} * (${r})`},{signal:`${E} * (${r})`}]}return[0,{signal:r}]}return OqA(`Cannot use ${A} scale if ${i} scale is not discrete.`)}}function a7A(A,e,t){const i=A===Hn?"width":"height";return e[i]||L_(t,i)}function Kwt(A,e,t,i){switch(A){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return t!==void 0&&RA(t)?t.length+1:(XA(upt(i)),3)}}function Uwt(A,e,t){const i=()=>{const n=Wc(e),o=Wc(A),g=`(${n} - ${o}) / (${t} - 1)`;return`sequence(${o}, ${n} + ${g}, ${g})`};return me(e)?new Dg(i):{signal:i()}}function s7A(A,e,t){if(e)return me(e)?{signal:`${e.signal} ? 0 : ${s7A(A,!1,t)}`}:0;switch(A){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(l_("size",A))}const r7A=.95;function Vwt(A,e,t,i){const n={x:i7A(t,"x"),y:i7A(t,"y")};switch(A){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const o=I7A(e,n,i.view);return ti(o)?o-1:new Dg(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const o=I7A(e,n,i.view);return ti(o)?Math.pow(r7A*o,2):new Dg(()=>`pow(${r7A} * ${o.signal}, 2)`)}}throw new Error(l_("size",A))}function I7A(A,e,t){const i=zQ(A.width)?A.width.step:v_(t,"width"),n=zQ(A.height)?A.height.step:v_(t,"height");return e.x||e.y?new Dg(()=>`min(${[e.x?e.x.signal:i,e.y?e.y.signal:n].join(", ")})`):Math.min(i,n)}function C7A(A,e){co(A)?Xwt(A,e):B7A(A,e)}function Xwt(A,e){const t=A.component.scales,{config:i,encoding:n,markDef:o,specifiedScales:g}=A;for(const a of WA(t)){const s=g[a],I=t[a],r=A.getScaleComponent(a),C=tg(n[a]),l=s[e],c=r.get("type"),B=r.get("padding"),E=r.get("paddingInner"),u=nBA(c,e),d=r6A(a,e);if(l!==void 0&&(u?d&&XA(d):XA(HjA(c,e,a))),u&&d===void 0)if(l!==void 0){const f=C.timeUnit,w=C.type;switch(e){case"domainMax":case"domainMin":Ub(s[e])||w==="temporal"||f?I.set(e,{signal:N_(s[e],{type:w,timeUnit:f})},!0):I.set(e,s[e],!0);break;default:I.copyKeyFromObject(e,s)}}else{const f=e in l7A?l7A[e]({model:A,channel:a,fieldOrDatumDef:C,scaleType:c,scalePadding:B,scalePaddingInner:E,domain:s.domain,domainMin:s.domainMin,domainMax:s.domainMax,markDef:o,config:i,hasNestedOffsetScale:U6A(n,a),hasSecondaryRangeChannel:!!n[HQ(a)]}):i.scale[e];f!==void 0&&I.set(e,f,!1)}}}const l7A={bins:({model:A,fieldOrDatumDef:e})=>zA(e)?zwt(A,e):void 0,interpolate:({channel:A,fieldOrDatumDef:e})=>Twt(A,e.type),nice:({scaleType:A,channel:e,domain:t,domainMin:i,domainMax:n,fieldOrDatumDef:o})=>_wt(A,e,t,i,n,o),padding:({channel:A,scaleType:e,fieldOrDatumDef:t,markDef:i,config:n})=>Owt(A,e,n.scale,t,i,n.bar),paddingInner:({scalePadding:A,channel:e,markDef:t,scaleType:i,config:n,hasNestedOffsetScale:o})=>qwt(A,e,t.type,i,n.scale,o),paddingOuter:({scalePadding:A,channel:e,scaleType:t,scalePaddingInner:i,config:n,hasNestedOffsetScale:o})=>jwt(A,e,t,i,n.scale,o),reverse:({fieldOrDatumDef:A,scaleType:e,channel:t,config:i})=>{const n=zA(A)?A.sort:void 0;return Pwt(e,n,t,i.scale)},zero:({channel:A,fieldOrDatumDef:e,domain:t,markDef:i,scaleType:n,config:o,hasSecondaryRangeChannel:g})=>$wt(A,e,t,i,n,o.scale,g)};function c7A(A){co(A)?Lwt(A):B7A(A,"range")}function B7A(A,e){const t=A.component.scales;for(const i of A.children)e==="range"?c7A(i):C7A(i,e);for(const i of WA(t)){let n;for(const o of A.children){const g=o.component.scales[i];if(g){const a=g.getWithExplicit(e);n=Pp(n,a,e,"scale",F8A((s,I)=>{switch(e){case"range":return s.step&&I.step?s.step-I.step:0}return 0}))}}t[i].setWithExplicit(e,n)}}function zwt(A,e){const t=e.bin;if(Cn(t)){const i=nQA(A,e.field,t);return new Dg(()=>A.getSignalName(i))}else if(ga(t)&&Kb(t)&&t.step!==void 0)return{step:t.step}}function Twt(A,e){if(St([ur,LQ,SQ],A)&&e!=="nominal")return"hcl"}function _wt(A,e,t,i,n,o){var g;if(!((g=XQ(o))!=null&&g.bin||RA(t)||n!=null||i!=null||St([pr.TIME,pr.UTC],A)))return Go(e)?!0:void 0}function Owt(A,e,t,i,n,o){if(Go(A)){if(Kc(e)){if(t.continuousPadding!==void 0)return t.continuousPadding;const{type:g,orient:a}=n;if(g==="bar"&&!(zA(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&A==="x"||a==="horizontal"&&A==="y"))return o.continuousBandSize}if(e===pr.POINT)return t.pointPadding}}function qwt(A,e,t,i,n,o=!1){if(A===void 0){if(Go(e)){const{bandPaddingInner:g,barBandPaddingInner:a,rectBandPaddingInner:s,bandWithNestedOffsetPaddingInner:I}=n;return o?I:Do(g,t==="bar"?a:s)}else if(GL(e)&&i===pr.BAND)return n.offsetBandPaddingInner}}function jwt(A,e,t,i,n,o=!1){if(A===void 0){if(Go(e)){const{bandPaddingOuter:g,bandWithNestedOffsetPaddingOuter:a}=n;if(o)return a;if(t===pr.BAND)return Do(g,me(i)?{signal:`${i.signal}/2`}:i/2)}else if(GL(e)){if(t===pr.POINT)return .5;if(t===pr.BAND)return n.offsetBandPaddingOuter}}}function Pwt(A,e,t,i){if(t==="x"&&i.xReverse!==void 0)return MI(A)&&e==="descending"?me(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(MI(A)&&e==="descending")return!0}function $wt(A,e,t,i,n,o,g){if(t&&t!=="unaggregated"&&MI(n)){if(RA(t)){const a=t[0],s=t[t.length-1];if(ti(a)&&a<=0&&ti(s)&&s>=0)return!0}return!1}if(A==="size"&&e.type==="quantitative"&&!h2(n))return!0;if(!(zA(e)&&e.bin)&&St([...ZQ,...jht],A)){const{orient:a,type:s}=i;return St(["bar","area","line","trail"],s)&&(a==="horizontal"&&A==="y"||a==="vertical"&&A==="x")?!1:St(["bar","area"],s)&&!g?!0:o==null?void 0:o.zero}return!1}function ADt(A,e,t,i,n=!1){const o=eDt(e,t,i,n),{type:g}=A;return yd(e)?g!==void 0?A0t(e,g)?zA(t)&&!$pt(g,t.type)?(XA(ept(g,o)),o):g:(XA(Apt(e,g,o)),o):o:null}function eDt(A,e,t,i){var n;switch(e.type){case"nominal":case"ordinal":{if(Q2(A)||LcA(A)==="discrete")return A==="shape"&&e.type==="ordinal"&&XA(UcA(A,"ordinal")),"ordinal";if(Go(A)||GL(A)){if(St(["rect","bar","image","rule"],t.type)||i)return"band"}else if(t.type==="arc"&&A in vcA)return"band";const o=t[hr(A)];return Tb(o)||p2(e)&&(n=e.axis)!=null&&n.tickBand?"band":"point"}case"temporal":return Q2(A)?"time":LcA(A)==="discrete"?(XA(UcA(A,"temporal")),"ordinal"):zA(e)&&e.timeUnit&&yg(e.timeUnit).utc?"utc":"time";case"quantitative":return Q2(A)?zA(e)&&Cn(e.bin)?"bin-ordinal":"linear":LcA(A)==="discrete"?(XA(UcA(A,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(LjA(e.type))}function tDt(A,{ignoreRange:e}={}){Q7A(A),PPA(A);for(const t of Ppt)C7A(A,t);e||c7A(A)}function Q7A(A){co(A)?A.component.scales=iDt(A):A.component.scales=oDt(A)}function iDt(A){const{encoding:e,mark:t,markDef:i}=A,n={};for(const o of r_){const g=tg(e[o]);if(g&&t===l6A&&o===dr&&g.type===d2)continue;let a=g&&g.scale;if(g&&a!==null&&a!==!1){a??(a={});const s=U6A(e,o),I=ADt(a,o,g,i,s);n[o]=new t7A(A.scaleName(`${o}`,!0),{value:I,explicit:a.type===I})}}return n}const nDt=F8A((A,e)=>i6A(A)-i6A(e));function oDt(A){var e;const t=A.component.scales={},i={},n=A.component.resolve;for(const o of A.children){Q7A(o);for(const g of WA(o.component.scales))if((e=n.scale)[g]??(e[g]=RPA(g,A)),n.scale[g]==="shared"){const a=i[g],s=o.component.scales[g].getWithExplicit("type");a?Kpt(a.value,s.value)?i[g]=Pp(a,s,"type","scale",nDt):(n.scale[g]="independent",delete i[g]):i[g]=s}}for(const o of WA(i)){const g=A.scaleName(o,!0),a=i[o];t[o]=new t7A(g,a);for(const s of A.children){const I=s.component.scales[o];I&&(s.renameScale(I.get("name"),g),I.merged=!0)}}return t}class QQA{constructor(){this.nameMap={}}rename(e,t){this.nameMap[e]=t}has(e){return this.nameMap[e]!==void 0}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function co(A){return(A==null?void 0:A.type)==="unit"}function Oc(A){return(A==null?void 0:A.type)==="facet"}function EQA(A){return(A==null?void 0:A.type)==="concat"}function v2(A){return(A==null?void 0:A.type)==="layer"}class uQA{constructor(e,t,i,n,o,g,a){this.type=t,this.parent=i,this.config=o,this.correctDataNames=s=>{var I,r,C;return(I=s.from)!=null&&I.data&&(s.from.data=this.lookupDataSource(s.from.data)),(C=(r=s.from)==null?void 0:r.facet)!=null&&C.data&&(s.from.facet.data=this.lookupDataSource(s.from.facet.data)),s},this.parent=i,this.config=o,this.view=mr(a),this.name=e.name??n,this.title=Tp(e.title)?{text:e.title}:e.title?mr(e.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new QQA,this.projectionNameMap=i?i.projectionNameMap:new QQA,this.signalNameMap=i?i.signalNameMap:new QQA,this.data=e.data,this.description=e.description,this.transforms=lyt(e.transform??[]),this.layout=t==="layer"||t==="unit"?{}:Eft(e,t,o),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:f_(e)||(i==null?void 0:i.component.data.isFaceted)&&e.data===void 0},layoutSize:new Jd,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...g?Xe(g):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){tDt(this)}parseProjection(){XPA(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){ZPA(this)}assembleEncodeFromView(e){const{style:t,...i}=e,n={};for(const o of WA(i)){const g=i[o];g!==void 0&&(n[o]=Dn(g))}return n}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),!e&&(this.description&&(t.description=Dn(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...t??{}}:Ki(t)?void 0:t}assembleLayout(){if(!this.layout)return;const{spacing:e,...t}=this.layout,{component:i,config:n}=this,o=Dbt(i.layoutHeaders,n);return{padding:e,...this.assembleDefaultLayout(),...t,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const i of ul)e[i].title&&t.push(mbt(this,i));for(const i of PBA)t=t.concat(pbt(this,i));return t}assembleAxes(){return abt(this.component.axes,this.config)}assembleLegends(){return KPA(this)}assembleProjections(){return Obt(this)}assembleTitle(){const{encoding:e,...t}=this.title??{},i={...hjA(this.config.title).nonMarkTitleProperties,...t,...e?{encode:{update:e}}:{}};if(i.text)return St(["unit","layer"],this.type)?St(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),Ki(i)?void 0:i}assembleGroup(e=[]){const t={};e=e.concat(this.assembleSignals()),e.length>0&&(t.signals=e);const i=this.assembleLayout();i&&(t.layout=i),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const n=!this.parent||Oc(this.parent)?A7A(this):[];n.length>0&&(t.scales=n);const o=this.assembleAxes();o.length>0&&(t.axes=o);const g=this.assembleLegends();return g.length>0&&(t.legends=g),t}getName(e){return Sn((this.name?`${this.name}_`:"")+e)}getDataName(e){return this.getName(ln[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),i=this.component.data.outputNodeRefCounts;return i[t]=(i[t]||0)+1,t}getSizeSignalRef(e){if(Oc(this.parent)){const t=NPA(e),i=s_(t),n=this.component.scales[i];if(n&&!n.merged){const o=n.get("type"),g=n.get("range");if(bg(o)&&_p(g)){const a=n.get("name"),s=P_(this,i),I=BQA(s);if(I){const r=jA({aggregate:"distinct",field:I},{expr:"datum"});return{signal:JPA(a,n,r)}}else return XA(WcA(i)),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){if(t)return this.getName(e);if(rjA(e)&&yd(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e)))return this.scaleNameMap.get(this.getName(e))}projectionName(e){if(e)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let i=this.component.selection[e];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(e,t)),!i)throw new Error(mmt(t));return i}hasAxisOrientSignalRef(){var e,t;return((e=this.component.axes.x)==null?void 0:e.some(i=>i.hasOrientSignalRef()))||((t=this.component.axes.y)==null?void 0:t.some(i=>i.hasOrientSignalRef()))}}class E7A extends uQA{vgField(e,t={}){const i=this.fieldDef(e);if(i)return jA(i,t)}reduceFieldDef(e,t){return X0t(this.getMapping(),(i,n,o)=>{const g=XQ(n);return g?e(i,g,o):i},t)}forEachFieldDef(e,t){hBA(this.getMapping(),(i,n)=>{const o=XQ(i);o&&e(o,n)},t)}}class $_ extends vi{clone(){return new $_(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=Xe(t);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"]}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Lt(this.transform)}`}assemble(){const{density:e,...t}=this.transform,i={type:"kde",field:e,...t};return this.transform.groupby&&(i.resolve="shared"),i}}class A4 extends vi{clone(){return new A4(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=Xe(t)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Lt(this.transform)}`}assemble(){const{extent:e,param:t}=this.transform;return{type:"extent",field:e,signal:t}}}class VL extends vi{clone(){return new VL(null,{...this.filter})}constructor(e,t){super(e),this.filter=t}static make(e,t){const{config:i,mark:n,markDef:o}=t;if(bi("invalid",o,i)!=="filter")return null;const g=t.reduceFieldDef((a,s,I)=>{const r=yd(I)&&t.getScaleComponent(I);if(r){const C=r.get("type");MI(C)&&s.aggregate!=="count"&&!Op(n)&&(a[s.field]=s)}return a},{});return WA(g).length?new VL(e,g):null}dependentFields(){return new Set(WA(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Lt(this.filter)}`}assemble(){const e=WA(this.filter).reduce((t,i)=>{const n=this.filter[i],o=jA(n,{expr:"datum"});return n!==null&&(n.type==="temporal"?t.push(`(isDate(${o}) || (isValid(${o}) && isFinite(+${o})))`):n.type==="quantitative"&&(t.push(`isValid(${o})`),t.push(`isFinite(+${o})`))),t},[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class e4 extends vi{clone(){return new e4(this.parent,Xe(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=Xe(t);const{flatten:i,as:n=[]}=this.transform;this.transform.as=i.map((o,g)=>n[g]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Lt(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class t4 extends vi{clone(){return new t4(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=Xe(t);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Lt(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class L2 extends vi{clone(){return new L2(null,Xe(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let i=0;for(const n of[[Hc,Sc],[El,Zc]]){const o=n.map(g=>{const a=tg(t.encoding[g]);return zA(a)?a.field:VQ(a)?{expr:`${a.datum}`}:Vc(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(e=new L2(e,o,null,t.getName(`geojson_${i++}`)))}if(t.channelHasField(dr)){const n=t.typedFieldDef(dr);n.type===d2&&(e=new L2(e,null,n.field,t.getName(`geojson_${i++}`)))}return e}constructor(e,t,i,n){super(e),this.fields=t,this.geojson=i,this.signal=n}dependentFields(){const e=(this.fields??[]).filter(ie);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Lt(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class XL extends vi{clone(){return new XL(null,this.projection,Xe(this.fields),Xe(this.as))}constructor(e,t,i,n){super(e),this.projection=t,this.fields=i,this.as=n}static parseAll(e,t){if(!t.projectionName())return e;for(const i of[[Hc,Sc],[El,Zc]]){const n=i.map(g=>{const a=tg(t.encoding[g]);return zA(a)?a.field:VQ(a)?{expr:`${a.datum}`}:Vc(a)?{expr:`${a.value}`}:void 0}),o=i[0]===El?"2":"";(n[0]||n[1])&&(e=new XL(e,t.projectionName(),n,[t.getName(`x${o}`),t.getName(`y${o}`)]))}return e}dependentFields(){return new Set(this.fields.filter(ie))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Lt(this.fields)} ${Lt(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class nw extends vi{clone(){return new nw(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:i,step:n}=e;return{signal:`sequence(${[t,i,...n?[n]:[]].join(",")})`}}static makeFromTransform(e,t){return new nw(e,t)}static makeFromEncoding(e,t){const i=t.encoding,n=i.x,o=i.y;if(zA(n)&&zA(o)){const g=n.impute?n:o.impute?o:void 0;if(g===void 0)return;const a=n.impute?o:o.impute?n:void 0,{method:s,value:I,frame:r,keyvals:C}=g.impute,l=X6A(t.mark,i);return new nw(e,{impute:g.field,key:a.field,...s?{method:s}:{},...I!==void 0?{value:I}:{},...r?{frame:r}:{},...C!==void 0?{keyvals:C}:{},...l.length?{groupby:l}:{}})}return null}hash(){return`Impute ${Lt(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:i,method:n,groupby:o,value:g,frame:a=[null,null]}=this.transform,s={type:"impute",field:e,key:t,...i?{keyvals:Tft(i)?this.processSequence(i):i}:{},method:"value",...o?{groupby:o}:{},value:!n||n==="value"?g:null};if(n&&n!=="value"){const I={type:"window",as:[`imputed_${e}_value`],ops:[n],fields:[e],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},r={type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e};return[s,I,r]}else return[s]}}class i4 extends vi{clone(){return new i4(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=Xe(t);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??t.on,i[1]??t.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Lt(this.transform)}`}assemble(){const{loess:e,on:t,...i}=this.transform;return{type:"loess",x:t,y:e,...i}}}class zL extends vi{clone(){return new zL(null,Xe(this.transform),this.secondary)}constructor(e,t,i){super(e),this.transform=t,this.secondary=i}static make(e,t,i,n){const o=t.component.data.sources,{from:g}=i;let a=null;if(_ft(g)){let s=m7A(g.data,o);s||(s=new ew(g.data),o.push(s));const I=t.getName(`lookup_${n}`);a=new ys(s,I,ln.Lookup,t.component.data.outputNodeRefCounts),t.component.data.outputNodes[I]=a}else if(Oft(g)){const s=g.param;i={as:s,...i};let I;try{I=t.getSelectionComponent(Sn(s),s)}catch{throw new Error(ymt(s))}if(a=I.materialized,!a)throw new Error(bmt(s))}return new zL(e,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?te(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Lt({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:te(this.transform.as)}:{}};else{let t=this.transform.as;ie(t)||(XA(Rmt),t="_lookup"),e={as:[t]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...e,...this.transform.default?{default:this.transform.default}:{}}}}class n4 extends vi{clone(){return new n4(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=Xe(t);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Lt(this.transform)}`}assemble(){const{quantile:e,...t}=this.transform;return{type:"quantile",field:e,...t}}}class o4 extends vi{clone(){return new o4(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=Xe(t);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??t.on,i[1]??t.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Lt(this.transform)}`}assemble(){const{regression:e,on:t,...i}=this.transform;return{type:"regression",x:t,y:e,...i}}}class g4 extends vi{clone(){return new g4(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=MQ((this.transform.groupby??[]).concat(e),t=>t)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Lt(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:i,limit:n,op:o}=this.transform;return{type:"pivot",field:e,value:t,...n!==void 0?{limit:n}:{},...o!==void 0?{op:o}:{},...i!==void 0?{groupby:i}:{}}}}class a4 extends vi{clone(){return new a4(null,Xe(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Lt(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function u7A(A){let e=0;function t(i,n){if(i instanceof ew&&!i.isGenerator&&!D2(i.data)&&(A.push(n),n={name:null,source:n.name,transform:[]}),i instanceof Va&&(i.parent instanceof ew&&!n.source?(n.format={...n.format??{},parse:i.assembleFormatParse()},n.transform.push(...i.assembleTransforms(!0))):n.transform.push(...i.assembleTransforms())),i instanceof F2){n.name||(n.name=`data_${e++}`),!n.source||n.transform.length>0?(A.push(n),i.data=n.name):i.data=n.source,A.push(...i.assemble());return}switch((i instanceof WL||i instanceof KL||i instanceof VL||i instanceof N2||i instanceof Y2||i instanceof XL||i instanceof Tc||i instanceof zL||i instanceof M2||i instanceof iw||i instanceof t4||i instanceof e4||i instanceof $_||i instanceof i4||i instanceof n4||i instanceof o4||i instanceof t0||i instanceof a4||i instanceof g4||i instanceof A4)&&n.transform.push(i.assemble()),(i instanceof OQ||i instanceof _Q||i instanceof nw||i instanceof Yd||i instanceof L2)&&n.transform.push(...i.assemble()),i instanceof ys&&(n.source&&n.transform.length===0?i.setSource(n.source):i.parent instanceof ys?i.setSource(n.name):(n.name||(n.name=`data_${e++}`),i.setSource(n.name),i.numChildren()===1&&(A.push(n),n={name:null,source:n.name,transform:[]}))),i.numChildren()){case 0:i instanceof ys&&(!n.source||n.transform.length>0)&&A.push(n);break;case 1:t(i.children[0],n);break;default:{n.name||(n.name=`data_${e++}`);let o=n.name;!n.source||n.transform.length>0?A.push(n):o=n.source;for(const g of i.children)t(g,{name:null,source:o,transform:[]});break}}}return t}function gDt(A){const e=[],t=u7A(e);for(const i of A.children)t(i,{source:A.name,name:null,transform:[]});return e}function aDt(A,e){const t=[],i=u7A(t);let n=0;for(const g of A.sources){g.hasName()||(g.dataName=`source_${n++}`);const a=g.assemble();i(g,a)}for(const g of t)g.transform.length===0&&delete g.transform;let o=0;for(const[g,a]of t.entries())(a.transform??[]).length===0&&!a.source&&t.splice(o++,0,t.splice(g,1)[0]);for(const g of t)for(const a of g.transform??[])a.type==="lookup"&&(a.from=A.outputNodes[a.from].getSource());for(const g of t)g.name in e&&(g.values=e[g.name]);return t}function sDt(A){return A==="top"||A==="left"||me(A)?"header":"footer"}function rDt(A){for(const e of ul)IDt(A,e);h7A(A,"x"),h7A(A,"y")}function IDt(A,e){var t;const{facet:i,config:n,child:o,component:g}=A;if(A.channelHasField(e)){const a=i[e],s=x2("title",null,n,e);let I=f2(a,n,{allowDisabling:!0,includeDefault:s===void 0||!!s});o.component.layoutHeaders[e].title&&(I=RA(I)?I.join(", "):I,I+=` / ${o.component.layoutHeaders[e].title}`,o.component.layoutHeaders[e].title=null);const r=x2("labelOrient",a.header,n,e),C=a.header!==null?Do((t=a.header)==null?void 0:t.labels,n.header.labels,!0):!1,l=St(["bottom","right"],r)?"footer":"header";g.layoutHeaders[e]={title:a.header!==null?I:null,facetFieldDef:a,[l]:e==="facet"?[]:[d7A(A,e,C)]}}}function d7A(A,e,t){const i=e==="row"?"height":"width";return{labels:t,sizeSignal:A.child.component.layoutSize.get(i)?A.child.getSizeSignalRef(i):void 0,axes:[]}}function h7A(A,e){const{child:t}=A;if(t.component.axes[e]){const{layoutHeaders:i,resolve:n}=A.component;if(n.axis[e]=tQA(n,e),n.axis[e]==="shared"){const o=e==="x"?"column":"row",g=i[o];for(const a of t.component.axes[e]){const s=sDt(a.get("orient"));g[s]??(g[s]=[d7A(A,o,!1)]);const I=ZL(a,"main",A.config,{header:!0});I&&g[s][0].axes.push(I),a.mainExtracted=!0}}}}function CDt(A){dQA(A),s4(A,"width"),s4(A,"height")}function lDt(A){dQA(A);const e=A.layout.columns===1?"width":"childWidth",t=A.layout.columns===void 0?"height":"childHeight";s4(A,e),s4(A,t)}function dQA(A){for(const e of A.children)e.parseLayoutSize()}function s4(A,e){const t=NPA(e),i=s_(t),n=A.component.resolve,o=A.component.layoutSize;let g;for(const a of A.children){const s=a.component.layoutSize.getWithExplicit(t),I=n.scale[i]??RPA(i,A);if(I==="independent"&&s.value==="step"){g=void 0;break}if(g){if(I==="independent"&&g.value!==s.value){g=void 0;break}g=Pp(g,s,t,"")}else g=s}if(g){for(const a of A.children)A.renameSignal(a.getName(t),A.getName(e)),a.component.layoutSize.set(t,"merged",!1);o.setWithExplicit(e,g)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function cDt(A){const{size:e,component:t}=A;for(const i of ZQ){const n=hr(i);if(e[n]){const o=e[n];t.layoutSize.set(n,zQ(o)?"step":o,!0)}else{const o=BDt(A,n);t.layoutSize.set(n,o,!1)}}}function BDt(A,e){const t=e==="width"?"x":"y",i=A.config,n=A.getScaleComponent(t);if(n){const o=n.get("type"),g=n.get("range");if(bg(o)){const a=L_(i.view,e);return _p(g)||zQ(a)?"step":a}else return YBA(i.view,e)}else{if(A.hasProjection||A.mark==="arc")return YBA(i.view,e);{const o=L_(i.view,e);return zQ(o)?o.step:o}}}function hQA(A,e,t){return jA(e,{suffix:`by_${jA(A)}`,...t??{}})}class TL extends E7A{constructor(e,t,i,n){super(e,"facet",t,i,n,e.resolve),this.child=bQA(e.spec,this,this.getName("child"),void 0,n),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!xL(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=WA(e),i={};for(const n of t){if(![ud,dd].includes(n)){XA(l_(n,"facet"));break}const o=e[n];if(o.field===void 0){XA(KcA(o,n));break}i[n]=this.initFacetFieldDef(o,n)}return i}initFacetFieldDef(e,t){const i=uBA(e,t);return i.header?i.header=mr(i.header):i.header===null&&(i.header=null),i}channelHasField(e){return!!this.facet[e]}fieldDef(e){return this.facet[e]}parseData(){this.component.data=r4(this),this.child.parseData()}parseLayoutSize(){dQA(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),rDt(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){const e={};for(const t of ul)for(const i of $BA){const n=this.component.layoutHeaders[t],o=n[i],{facetFieldDef:g}=n;if(g){const a=x2("titleOrient",g.header,this.config,t);if(["right","bottom"].includes(a)){const s=__(t,a);e.titleAnchor??(e.titleAnchor={}),e.titleAnchor[s]="end"}}if(o!=null&&o[0]){const a=t==="row"?"height":"width",s=i==="header"?"headerBand":"footerBand";t!=="facet"&&!this.child.component.layoutSize.get(a)&&(e[s]??(e[s]={}),e[s][t]=.5),n.title&&(e.offset??(e.offset={}),e.offset[t==="row"?"rowTitle":"columnTitle"]=10)}}return e}assembleDefaultLayout(){const{column:e,row:t}=this.facet,i=e?this.columnDistinctSignal():t?1:void 0;let n="all";return(!t&&this.component.resolve.scale.x==="independent"||!e&&this.component.resolve.scale.y==="independent")&&(n="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:n}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof TL))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(e){return this.parent&&this.parent instanceof TL?{...this.channelHasField("column")?{encode:{update:{columns:{field:jA(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],i=[];if(this.child instanceof TL){if(this.child.channelHasField("column")){const n=jA(this.child.facet.column);e.push(n),t.push("distinct"),i.push(`distinct_${n}`)}}else for(const n of ZQ){const o=this.child.component.scales[n];if(o&&!o.merged){const g=o.get("type"),a=o.get("range");if(bg(g)&&_p(a)){const s=P_(this.child,n),I=BQA(s);I?(e.push(I),t.push("distinct"),i.push(`distinct_${I}`)):XA(WcA(n))}}}return{fields:e,ops:t,as:i}}assembleFacet(){const{name:e,data:t}=this.component.data.facetRoot,{row:i,column:n}=this.facet,{fields:o,ops:g,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const r of ul){const C=this.facet[r];if(C){s.push(jA(C));const{bin:l,sort:c}=C;if(Cn(l)&&s.push(jA(C,{binSuffix:"end"})),UQ(c)){const{field:B,op:E=p_}=c,u=hQA(C,c);i&&n?(o.push(u),g.push("max"),a.push(u)):(o.push(B),g.push(E),a.push(u))}else if(RA(c)){const B=R2(C,r);o.push(B),g.push("max"),a.push(B)}}}const I=!!i&&!!n;return{name:e,data:t,groupby:s,...I||o.length>0?{aggregate:{...I?{cross:I}:{},...o.length?{fields:o,ops:g,as:a}:{}}}:{}}}facetSortFields(e){const{facet:t}=this,i=t[e];return i?UQ(i.sort)?[hQA(i,i.sort,{expr:"datum"})]:RA(i.sort)?[R2(i,e,{expr:"datum"})]:[jA(i,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,i=t[e];if(i){const{sort:n}=i;return[(UQ(n)?n.order:!RA(n)&&n)||"ascending"]}return[]}assembleLabelTitle(){var e;const{facet:t,config:i}=this;if(t.facet)return AQA(t.facet,"facet",i);const n={row:["top","bottom"],column:["left","right"]};for(const o of PBA)if(t[o]){const g=x2("labelOrient",(e=t[o])==null?void 0:e.header,i,o);if(n[o].includes(g))return AQA(t[o],o,i)}}assembleMarks(){const{child:e}=this,t=this.component.data.facetRoot,i=gDt(t),n=e.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||e.assembleTitle(),g=e.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...g?{style:g}:{},from:{facet:this.assembleFacet()},sort:{field:ul.map(a=>this.facetSortFields(a)).flat(),order:ul.map(a=>this.facetSortOrder(a)).flat()},...i.length>0?{data:i}:{},...n?{encode:{update:n}}:{},...e.assembleGroup(wyt(this,[]))}]}getMapping(){return this.facet}}function QDt(A,e){const{row:t,column:i}=e;if(t&&i){let n=null;for(const o of[t,i])if(UQ(o.sort)){const{field:g,op:a=p_}=o.sort;A=n=new iw(A,{joinaggregate:[{op:a,field:g,as:hQA(o,o.sort,{forAs:!0})}],groupby:[jA(o)]})}return n}return null}function m7A(A,e){var t,i,n,o;for(const g of e){const a=g.data;if(A.name&&g.hasName()&&A.name!==g.dataName)continue;const s=(t=A.format)==null?void 0:t.mesh,I=(i=a.format)==null?void 0:i.feature;if(s&&I)continue;const r=(n=A.format)==null?void 0:n.feature;if((r||I)&&r!==I)continue;const C=(o=a.format)==null?void 0:o.mesh;if(!((s||C)&&s!==C)){if(LL(A)&&LL(a)){if(xI(A.values,a.values))return g}else if(D2(A)&&D2(a)){if(A.url===a.url)return g}else if(M8A(A)&&A.name===g.dataName)return g}}return null}function EDt(A,e){if(A.data||!A.parent){if(A.data===null){const i=new ew({values:[]});return e.push(i),i}const t=m7A(A.data,e);if(t)return $p(A.data)||(t.data.format=qqA({},A.data.format,t.data.format)),!t.hasName()&&A.data.name&&(t.dataName=A.data.name),t;{const i=new ew(A.data);return e.push(i),i}}else return A.parent.component.data.facetRoot?A.parent.component.data.facetRoot:A.parent.component.data.main}function uDt(A,e,t){let i=0;for(const n of e.transforms){let o,g;if(oyt(n))g=A=new Y2(A,n),o="derived";else if(vBA(n)){const a=swt(n);g=A=Va.makeWithAncestors(A,{},a,t)??A,A=new N2(A,e,n.filter)}else if(G8A(n))g=A=OQ.makeFromTransform(A,n,e),o="number";else if(ayt(n))o="date",t.getWithExplicit(n.field).value===void 0&&(A=new Va(A,{[n.field]:o}),t.set(n.field,o,!1)),g=A=_Q.makeFromTransform(A,n);else if(syt(n))g=A=Tc.makeFromTransform(A,n),o="number",TBA(e)&&(A=new t0(A));else if(D8A(n))g=A=zL.make(A,e,n,i++),o="derived";else if(tyt(n))g=A=new M2(A,n),o="number";else if(iyt(n))g=A=new iw(A,n),o="number";else if(ryt(n))g=A=Yd.makeFromTransform(A,n),o="derived";else if(Iyt(n))g=A=new t4(A,n),o="derived";else if(Cyt(n))g=A=new A4(A,n),o="derived";else if(nyt(n))g=A=new e4(A,n),o="derived";else if(qft(n))g=A=new g4(A,n),o="derived";else if(eyt(n))A=new a4(A,n);else if(gyt(n))g=A=nw.makeFromTransform(A,n),o="derived";else if(jft(n))g=A=new $_(A,n),o="derived";else if(Pft(n))g=A=new n4(A,n),o="derived";else if($ft(n))g=A=new o4(A,n),o="derived";else if(Ayt(n))g=A=new i4(A,n),o="derived";else{XA(Ymt(n));continue}if(g&&o!==void 0)for(const a of g.producedFields()??[])t.set(a,o,!1)}return A}function r4(A){var e;let t=EDt(A,A.component.data.sources);const{outputNodes:i,outputNodeRefCounts:n}=A.component.data,o=A.data,g=!(o&&($p(o)||D2(o)||LL(o)))&&A.parent?A.parent.component.data.ancestorParse.clone():new yyt;$p(o)?(v8A(o)?t=new KL(t,o.sequence):HBA(o)&&(t=new WL(t,o.graticule)),g.parseNothing=!0):((e=o==null?void 0:o.format)==null?void 0:e.parse)===null&&(g.parseNothing=!0),t=Va.makeExplicit(t,A,g)??t,t=new t0(t);const a=A.parent&&v2(A.parent);(co(A)||Oc(A))&&a&&(t=OQ.makeFromEncoding(t,A)??t),A.transforms.length>0&&(t=uDt(t,A,g));const s=Iwt(A),I=rwt(A);t=Va.makeWithAncestors(t,{},{...s,...I},g)??t,co(A)&&(t=L2.parseAll(t,A),t=XL.parseAll(t,A)),(co(A)||Oc(A))&&(a||(t=OQ.makeFromEncoding(t,A)??t),t=_Q.makeFromEncoding(t,A)??t,t=Y2.parseAllForSortIndex(t,A));const r=A.getDataName(ln.Raw),C=new ys(t,r,ln.Raw,n);if(i[r]=C,t=C,co(A)){const E=Tc.makeFromEncoding(t,A);E&&(t=E,TBA(A)&&(t=new t0(t))),t=nw.makeFromEncoding(t,A)??t,t=Yd.makeFromEncoding(t,A)??t}co(A)&&(t=VL.make(t,A)??t);const l=A.getDataName(ln.Main),c=new ys(t,l,ln.Main,n);i[l]=c,t=c,co(A)&&obt(A,c);let B=null;if(Oc(A)){const E=A.getName("facet");t=QDt(t,A.facet)??t,B=new F2(t,A,E,c.getSource()),i[E]=B}return{...A.component.data,outputNodes:i,outputNodeRefCounts:n,raw:C,main:c,facetRoot:B,ancestorParse:g}}class dDt extends uQA{constructor(e,t,i,n){var o,g,a,s;super(e,"concat",t,i,n,e.resolve),(((g=(o=e.resolve)==null?void 0:o.axis)==null?void 0:g.x)==="shared"||((s=(a=e.resolve)==null?void 0:a.axis)==null?void 0:s.y)==="shared")&&XA(kmt),this.children=this.getChildren(e).map((I,r)=>bQA(I,this,this.getName(`concat_${r}`),void 0,n))}parseData(){this.component.data=r4(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of WA(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return M_(e)?e.vconcat:NBA(e)?e.hconcat:e.concat}parseLayoutSize(){lDt(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((t,i)=>i.assembleSelectionTopLevelSignals(t),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){const e=eQA(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce((t,i)=>i.assembleSelectionData(t),e)}assembleMarks(){return this.children.map(e=>{const t=e.assembleTitle(),i=e.assembleGroupStyle(),n=e.assembleGroupEncodeEntry(!1);return{type:"group",name:e.getName("group"),...t?{title:t}:{},...i?{style:i}:{},...n?{encode:{update:n}}:{},...e.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const e=this.layout.columns;return{...e!=null?{columns:e}:{},bounds:"full",align:"each"}}}function hDt(A){return A===!1||A===null}const mDt={disable:1,gridScale:1,scale:1,...H6A,labelExpr:1,encode:1},p7A=WA(mDt);class mQA extends Jd{constructor(e={},t={},i=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=i}clone(){return new mQA(Xe(this.explicit),Xe(this.implicit),this.mainExtracted)}hasAxisPart(e){return e==="axis"?!0:e==="grid"||e==="title"?!!this.get(e):!hDt(this.get(e))}hasOrientSignalRef(){return me(this.explicit.orient)}}function pDt(A,e,t){const{encoding:i,config:n}=A,o=tg(i[e])??tg(i[HQ(e)]),g=A.axis(e)||{},{format:a,formatType:s}=g;if(Ob(s))return{text:Uc({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:s,config:n}),...t};if(a===void 0&&s===void 0&&n.customFormatTypes){if(m2(o)==="quantitative"){if(p2(o)&&o.stack==="normalize"&&n.normalizedNumberFormatType)return{text:Uc({fieldOrDatumDef:o,field:"datum.value",format:n.normalizedNumberFormat,formatType:n.normalizedNumberFormatType,config:n}),...t};if(n.numberFormatType)return{text:Uc({fieldOrDatumDef:o,field:"datum.value",format:n.numberFormat,formatType:n.numberFormatType,config:n}),...t}}if(m2(o)==="temporal"&&n.timeFormatType&&zA(o)&&!o.timeUnit)return{text:Uc({fieldOrDatumDef:o,field:"datum.value",format:n.timeFormat,formatType:n.timeFormatType,config:n}),...t}}return t}function fDt(A){return ZQ.reduce((e,t)=>(A.component.scales[t]&&(e[t]=[JDt(t,A)]),e),{})}const yDt={bottom:"top",top:"bottom",left:"right",right:"left"};function bDt(A){const{axes:e,resolve:t}=A.component,i={top:0,bottom:0,right:0,left:0};for(const n of A.children){n.parseAxesAndHeaders();for(const o of WA(n.component.axes))t.axis[o]=tQA(A.component.resolve,o),t.axis[o]==="shared"&&(e[o]=wDt(e[o],n.component.axes[o]),e[o]||(t.axis[o]="independent",delete e[o]))}for(const n of ZQ){for(const o of A.children)if(o.component.axes[n]){if(t.axis[n]==="independent"){e[n]=(e[n]??[]).concat(o.component.axes[n]);for(const g of o.component.axes[n]){const{value:a,explicit:s}=g.getWithExplicit("orient");if(!me(a)){if(i[a]>0&&!s){const I=yDt[a];i[a]>i[I]&&g.set("orient",I,!1)}i[a]++}}}delete o.component.axes[n]}if(t.axis[n]==="independent"&&e[n]&&e[n].length>1)for(const[o,g]of(e[n]||[]).entries())o>0&&g.get("grid")&&!g.explicit.grid&&(g.implicit.grid=!1)}}function wDt(A,e){if(A){if(A.length!==e.length)return;const t=A.length;for(let i=0;i<t;i++){const n=A[i],o=e[i];if(!!n!=!!o)return;if(n&&o){const g=n.getWithExplicit("orient"),a=o.getWithExplicit("orient");if(g.explicit&&a.explicit&&g.value!==a.value)return;A[i]=DDt(n,o)}}}else return e.map(t=>t.clone());return A}function DDt(A,e){for(const t of p7A){const i=Pp(A.getWithExplicit(t),e.getWithExplicit(t),t,"axis",(n,o)=>{switch(t){case"title":return kjA(n,o);case"gridScale":return{explicit:n.explicit,value:Do(n.value,o.value)}}return H_(n,o,t,"axis")});A.setWithExplicit(t,i)}return A}function GDt(A,e,t,i,n){if(e==="disable")return t!==void 0;switch(t=t||{},e){case"titleAngle":case"labelAngle":return A===(me(t.labelAngle)?t.labelAngle:bL(t.labelAngle));case"values":return!!t.values;case"encode":return!!t.encoding||!!t.labelAngle;case"title":if(A===bPA(i,n))return!0}return A===t[e]}const kDt=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function JDt(A,e){var t,i;let n=e.axis(A);const o=new mQA,g=tg(e.encoding[A]),{mark:a,config:s}=e,I=(n==null?void 0:n.orient)||((t=s[A==="x"?"axisX":"axisY"])==null?void 0:t.orient)||((i=s.axis)==null?void 0:i.orient)||Qbt(A),r=e.getScaleComponent(A).get("type"),C=sbt(A,r,I,e.config),l=n!==void 0?!n:qBA("disable",s.style,n==null?void 0:n.style,C).configValue;if(o.set("disable",l,n!==void 0),l)return o;n=n||{};const c=lbt(g,n,A,s.style,C),B=h6A(n.formatType,g,r),E=d6A(g,g.type,n.format,n.formatType,s,!0),u={fieldOrDatumDef:g,axis:n,channel:A,model:e,scaleType:r,orient:I,labelAngle:c,format:E,formatType:B,mark:a,config:s};for(const w of p7A){const y=w in pPA?pPA[w](u):Z6A(w)?n[w]:void 0,G=y!==void 0,R=GDt(y,w,n,e,A);if(G&&R)o.set(w,y,R);else{const{configValue:x=void 0,configFrom:F=void 0}=Z6A(w)&&w!=="values"?qBA(w,s.style,n.style,C):{},Q=x!==void 0;G&&!Q?o.set(w,y,R):(F!=="vgAxisConfig"||kDt.has(w)&&Q||vL(x)||me(x))&&o.set(w,x,!1)}}const d=n.encoding??{},f=S6A.reduce((w,y)=>{if(!o.hasAxisPart(y))return w;const G=YPA(d[y]??{},e),R=y==="labels"?pDt(e,A,G):G;return R!==void 0&&!Ki(R)&&(w[y]={update:R}),w},{});return Ki(f)||o.set("encode",f,!!n.encoding||n.labelAngle!==void 0),o}function NDt({encoding:A,size:e}){for(const t of ZQ){const i=hr(t);zQ(e[i])&&jp(A[t])&&(delete e[i],XA(ZjA(i)))}return e}const YDt={vgMark:"arc",encodeEntry:A=>({...dl(A,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ua("x",A,{defaultPos:"mid"}),...Ua("y",A,{defaultPos:"mid"}),...A0(A,"radius"),...A0(A,"theta")})},RDt={vgMark:"area",encodeEntry:A=>({...dl(A,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...U_("x",A,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:A.markDef.orient==="horizontal"}),...U_("y",A,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:A.markDef.orient==="vertical"}),...XBA(A)})},xDt={vgMark:"rect",encodeEntry:A=>({...dl(A,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...A0(A,"x"),...A0(A,"y")})},FDt={vgMark:"shape",encodeEntry:A=>({...dl(A,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:A=>{const{encoding:e}=A,t=e.shape;return[{type:"geoshape",projection:A.projectionName(),...t&&zA(t)&&t.type===d2?{field:jA(t,{expr:"datum"})}:{}}]}},MDt={vgMark:"image",encodeEntry:A=>({...dl(A,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...A0(A,"x"),...A0(A,"y"),...UBA(A,"url")})},vDt={vgMark:"line",encodeEntry:A=>({...dl(A,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ua("x",A,{defaultPos:"mid"}),...Ua("y",A,{defaultPos:"mid"}),...wg("size",A,{vgChannel:"strokeWidth"}),...XBA(A)})},LDt={vgMark:"trail",encodeEntry:A=>({...dl(A,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ua("x",A,{defaultPos:"mid"}),...Ua("y",A,{defaultPos:"mid"}),...wg("size",A),...XBA(A)})};function pQA(A,e){const{config:t}=A;return{...dl(A,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ua("x",A,{defaultPos:"mid"}),...Ua("y",A,{defaultPos:"mid"}),...wg("size",A),...wg("angle",A),...SDt(A,t,e)}}function SDt(A,e,t){return t?{shape:{value:t}}:wg("shape",A)}const HDt={vgMark:"symbol",encodeEntry:A=>pQA(A)},ZDt={vgMark:"symbol",encodeEntry:A=>pQA(A,"circle")},WDt={vgMark:"symbol",encodeEntry:A=>pQA(A,"square")},KDt={vgMark:"rect",encodeEntry:A=>({...dl(A,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...A0(A,"x"),...A0(A,"y")})},UDt={vgMark:"rule",encodeEntry:A=>{const{markDef:e}=A,t=e.orient;return!A.encoding.x&&!A.encoding.y&&!A.encoding.latitude&&!A.encoding.longitude?{}:{...dl(A,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...U_("x",A,{defaultPos:t==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:t!=="vertical"}),...U_("y",A,{defaultPos:t==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:t!=="horizontal"}),...wg("size",A,{vgChannel:"strokeWidth"})}}},VDt={vgMark:"text",encodeEntry:A=>{const{config:e,encoding:t}=A;return{...dl(A,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Ua("x",A,{defaultPos:"mid"}),...Ua("y",A,{defaultPos:"mid"}),...UBA(A),...wg("size",A,{vgChannel:"fontSize"}),...wg("angle",A),...tPA("align",XDt(A.markDef,t,e)),...tPA("baseline",zDt(A.markDef,t,e)),...Ua("radius",A,{defaultPos:null}),...Ua("theta",A,{defaultPos:null})}}};function XDt(A,e,t){if(bi("align",A,t)===void 0)return"center"}function zDt(A,e,t){if(bi("baseline",A,t)===void 0)return"middle"}const TDt={vgMark:"rect",encodeEntry:A=>{const{config:e,markDef:t}=A,i=t.orient,n=i==="horizontal"?"width":"height",o=i==="horizontal"?"height":"width";return{...dl(A,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Ua("x",A,{defaultPos:"mid",vgChannel:"xc"}),...Ua("y",A,{defaultPos:"mid",vgChannel:"yc"}),...wg("size",A,{defaultValue:_Dt(A),vgChannel:n}),[o]:Dn(bi("thickness",t,e))}}};function _Dt(A){const{config:e,markDef:t}=A,{orient:i}=t,n=i==="horizontal"?"width":"height",o=A.getScaleComponent(i==="horizontal"?"x":"y"),g=bi("size",t,e,{vgChannel:n})??e.tick.bandSize;if(g!==void 0)return g;{const a=o?o.get("range"):void 0;return a&&_p(a)&&ti(a.step)?a.step*3/4:v_(e.view,n)*3/4}}const I4={arc:YDt,area:RDt,bar:xDt,circle:ZDt,geoshape:FDt,image:MDt,line:vDt,point:HDt,rect:KDt,rule:UDt,square:WDt,text:VDt,tick:TDt,trail:LDt};function ODt(A){if(St([u_,Q_,i0t],A.mark)){const e=X6A(A.mark,A.encoding);if(e.length>0)return qDt(A,e)}else if(A.mark===E_){const e=HcA.some(t=>bi(t,A.markDef,A.config));if(A.stack&&!A.fieldDef("size")&&e)return jDt(A)}return fQA(A)}const f7A="faceted_path_";function qDt(A,e){return[{name:A.getName("pathgroup"),type:"group",from:{facet:{name:f7A+A.requestDataName(ln.Main),data:A.requestDataName(ln.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:fQA(A,{fromPrefix:f7A})}]}const y7A="stack_group_";function jDt(A){var e;const[t]=fQA(A,{fromPrefix:y7A}),i=A.scaleName(A.stack.fieldChannel),n=(I={})=>A.vgField(A.stack.fieldChannel,I),o=(I,r)=>{const C=[n({prefix:"min",suffix:"start",expr:r}),n({prefix:"max",suffix:"start",expr:r}),n({prefix:"min",suffix:"end",expr:r}),n({prefix:"max",suffix:"end",expr:r})];return`${I}(${C.map(l=>`scale('${i}',${l})`).join(",")})`};let g,a;A.stack.fieldChannel==="x"?(g={...C2(t.encode.update,["y","yc","y2","height",...HcA]),x:{signal:o("min","datum")},x2:{signal:o("max","datum")},clip:{value:!0}},a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Er(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(g={...C2(t.encode.update,["x","xc","x2","width"]),y:{signal:o("min","datum")},y2:{signal:o("max","datum")},clip:{value:!0}},a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Er(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const I of HcA){const r=Dd(I,A.markDef,A.config);t.encode.update[I]?(g[I]=t.encode.update[I],delete t.encode.update[I]):r&&(g[I]=Dn(r)),r&&(t.encode.update[I]={value:0})}const s=[];if(((e=A.stack.groupbyChannels)==null?void 0:e.length)>0)for(const I of A.stack.groupbyChannels){const r=A.fieldDef(I),C=jA(r);C&&s.push(C),(r!=null&&r.bin||r!=null&&r.timeUnit)&&s.push(jA(r,{binSuffix:"end"}))}return g=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((I,r)=>{if(t.encode.update[r])return{...I,[r]:t.encode.update[r]};{const C=Dd(r,A.markDef,A.config);return C!==void 0?{...I,[r]:Dn(C)}:I}},g),g.stroke&&(g.strokeForeground={value:!0},g.strokeOffset={value:0}),[{type:"group",from:{facet:{data:A.requestDataName(ln.Main),name:y7A+A.requestDataName(ln.Main),groupby:s,aggregate:{fields:[n({suffix:"start"}),n({suffix:"start"}),n({suffix:"end"}),n({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:g},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}function PDt(A){var e;const{encoding:t,stack:i,mark:n,markDef:o,config:g}=A,a=t.order;if(!(!RA(a)&&Vc(a)&&ycA(a.value)||!a&&ycA(bi("order",o,g)))){if((RA(a)||zA(a))&&!i)return wjA(a,{expr:"datum"});if(Op(n)){const s=o.orient==="horizontal"?"y":"x",I=t[s];if(zA(I)){const r=I.sort;if(RA(r))return{field:jA(I,{prefix:s,suffix:"sort_index",expr:"datum"})};if(UQ(r))return{field:jA({aggregate:dBA(A.encoding)?r.op:void 0,field:r.field},{expr:"datum"})};if(y6A(r)){const C=A.fieldDef(r.encoding);return{field:jA(C,{expr:"datum"}),order:r.order}}else return r===null?void 0:{field:jA(I,{binSuffix:(e=A.stack)!=null&&e.impute?"mid":void 0,expr:"datum"})}}return}}}function fQA(A,e={fromPrefix:""}){const{mark:t,markDef:i,encoding:n,config:o}=A,g=Do(i.clip,$Dt(A),AGt(A)),a=yjA(i),s=n.key,I=PDt(A),r=eGt(A),C=bi("aria",i,o),l=I4[t].postEncodingTransform?I4[t].postEncodingTransform(A):null;return[{name:A.getName("marks"),type:I4[t].vgMark,...g?{clip:!0}:{},...a?{style:a}:{},...s?{key:s.field}:{},...I?{sort:I}:{},...r||{},...C===!1?{aria:C}:{},from:{data:e.fromPrefix+A.requestDataName(ln.Main)},encode:{update:I4[t].encodeEntry(A)},...l?{transform:l}:{}}]}function $Dt(A){const e=A.getScaleComponent("x"),t=A.getScaleComponent("y");return e!=null&&e.get("selectionExtent")||t!=null&&t.get("selectionExtent")?!0:void 0}function AGt(A){const e=A.component.projection;return e&&!e.isFit?!0:void 0}function eGt(A){if(!A.component.selection)return null;const e=WA(A.component.selection).length;let t=e,i=A.parent;for(;i&&t===0;)t=WA(i.component.selection).length,i=i.parent;return t?{interactive:e>0||A.mark==="geoshape"||!!A.encoding.tooltip}:null}class b7A extends E7A{constructor(e,t,i,n={},o){super(e,"unit",t,i,o,void 0,r8A(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const g=KQ(e.mark)?{...e.mark}:{type:e.mark},a=g.type;g.filled===void 0&&(g.filled=Hft(g,o,{graticule:e.data&&HBA(e.data)}));const s=this.encoding=U0t(e.encoding||{},a,g.filled,o);this.markDef=d8A(g,s,o),this.size=NDt({encoding:s,size:r8A(e)?{...n,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:n}),this.stack=u8A(this.markDef,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=(e.params??[]).filter(I=>kBA(I))}get hasProjection(){const{encoding:e}=this,t=this.mark===l6A,i=e&&Kht.some(n=>je(e[n]));return t||i}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return r_.reduce((i,n)=>{const o=tg(t[n]);return o&&(i[n]=this.initScale(o.scale??{})),i},{})}initScale(e){const{domain:t,range:i}=e,n=mr(e);return RA(t)&&(n.domain=t.map(FI)),RA(i)&&(n.range=i.map(FI)),n}initAxes(e){return ZQ.reduce((t,i)=>{const n=e[i];if(je(n)||i===Hn&&je(e.x2)||i===fg&&je(e.y2)){const o=je(n)?n.axis:void 0;t[i]=o&&this.initAxis({...o})}return t},{})}initAxis(e){const t=WA(e),i={};for(const n of t){const o=e[n];i[n]=vL(o)?mjA(o):FI(o)}return i}initLegends(e){return Pht.reduce((t,i)=>{const n=tg(e[i]);if(n&&Amt(i)){const o=n.legend;t[i]=o&&mr(o)}return t},{})}parseData(){this.component.data=r4(this)}parseLayoutSize(){cDt(this)}parseSelections(){this.component.selection=nbt(this,this.selection)}parseMarkGroup(){this.component.mark=ODt(this)}parseAxesAndHeaders(){this.component.axes=fDt(this)}assembleSelectionTopLevelSignals(e){return Dyt(this,e)}assembleSignals(){return[...hPA(this),...byt(this,[])]}assembleSelectionData(e){return Gyt(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return eQA(this)}assembleMarks(){let e=this.component.mark??[];return(!this.parent||!v2(this.parent))&&(e=H8A(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:e}=this.view||{};return e!==void 0?e:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return jb(this.encoding,e)}fieldDef(e){const t=this.encoding[e];return XQ(t)}typedFieldDef(e){const t=this.fieldDef(e);return fs(t)?t:null}}class yQA extends uQA{constructor(e,t,i,n,o){super(e,"layer",t,i,o,e.resolve,e.view);const g={...n,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}};this.children=e.layer.map((a,s)=>{if(S_(a))return new yQA(a,this,this.getName(`layer_${s}`),g,o);if(Gd(a))return new b7A(a,this,this.getName(`layer_${s}`),g,o);throw new Error(ZcA(a))})}parseData(){this.component.data=r4(this);for(const e of this.children)e.parseData()}parseLayoutSize(){CDt(this)}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of WA(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){bDt(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((t,i)=>i.assembleSelectionTopLevelSignals(t),e)}assembleSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleSignals()),hPA(this))}assembleLayoutSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleLayoutSignals()),eQA(this))}assembleSelectionData(e){return this.children.reduce((t,i)=>i.assembleSelectionData(t),e)}assembleGroupStyle(){const e=new Set;for(const i of this.children)for(const n of te(i.assembleGroupStyle()))e.add(n);const t=Array.from(e);return t.length>1?t:t.length===1?t[0]:void 0}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return kyt(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,t)=>e.concat(t.assembleLegends()),KPA(this))}}function bQA(A,e,t,i,n){if(f_(A))return new TL(A,e,t,n);if(S_(A))return new yQA(A,e,t,i,n);if(Gd(A))return new b7A(A,e,t,i,n);if(cft(A))return new dDt(A,e,t,n);throw new Error(ZcA(A))}function tGt(A,e={}){e.logger&&dpt(e.logger),e.fieldTitle&&F6A(e.fieldTitle);try{const t=Q8A(QJ(e.config,A.config)),i=Y8A(A,t),n=bQA(i,null,"",void 0,t);return n.parse(),Dwt(n.component.data,n),{spec:nGt(n,iGt(A,i.autosize,t,n),A.datasets,A.usermeta),normalized:i}}finally{e.logger&&hpt(),e.fieldTitle&&F0t()}}function iGt(A,e,t,i){const n=i.component.layoutSize.get("width"),o=i.component.layoutSize.get("height");if(e===void 0?(e={type:"pad"},i.hasAxisOrientSignalRef()&&(e.resize=!0)):ie(e)&&(e={type:e}),n&&o&&myt(e.type)){if(n==="step"&&o==="step")XA(YjA()),e.type="pad";else if(n==="step"||o==="step"){const g=n==="step"?"width":"height";XA(YjA(s_(g)));const a=g==="width"?"height":"width";e.type=pyt(a)}}return{...WA(e).length===1&&e.type?e.type==="pad"?{}:{autosize:e.type}:{autosize:e},...x8A(t,!1),...x8A(A,!0)}}function nGt(A,e,t={},i){const n=A.config?Gft(A.config):void 0,o=[].concat(A.assembleSelectionData([]),aDt(A.component.data,t)),g=A.assembleProjections(),a=A.assembleTitle(),s=A.assembleGroupStyle(),I=A.assembleGroupEncodeEntry(!0);let r=A.assembleLayoutSignals();r=r.filter(c=>(c.name==="width"||c.name==="height")&&c.value!==void 0?(e[c.name]=+c.value,!1):!0);const{params:C,...l}=e;return{$schema:"https://vega.github.io/schema/vega/v5.json",...A.description?{description:A.description}:{},...l,...a?{title:a}:{},...s?{style:s}:{},...I?{encode:{update:I}}:{},data:o,...g.length>0?{projections:g}:{},...A.assembleGroup([...r,...A.assembleSelectionTopLevelSignals([]),...a8A(C)]),...n?{config:n}:{},...i?{usermeta:i}:{}}}const oGt=vht.version,gGt=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:l2,accessPathWithDatum:kcA,compile:tGt,contains:St,deepEqual:xI,deleteNestedProperty:e_,duplicate:Xe,entries:Hp,every:bcA,fieldIntersection:GcA,flatAccessWithDatum:PqA,getFirstDefined:Do,hasIntersection:wcA,hash:Lt,internalField:ejA,isBoolean:pL,isEmpty:Ki,isEqual:Sht,isInternalField:tjA,isNullOrFalse:ycA,isNumeric:t_,keys:WA,logicalExpr:fL,mergeDeep:qqA,never:OqA,normalize:Y8A,normalizeAngle:bL,omit:Er,pick:C2,prefixGenerator:DcA,removePathFromField:JcA,replaceAll:Sb,replacePathInField:Bl,resetIdCounter:Zht,setEqual:jqA,some:Lb,stringify:Ui,titleCase:yL,unique:MQ,uniqueId:AjA,vals:oa,varName:Sn,version:oGt},Symbol.toStringTag,{value:"Module"}));function w7A(A){const[e,t]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(A).slice(1,3);return{library:e,version:t}}var aGt="vega-themes",sGt="2.14.0",rGt="Themes for stylized Vega and Vega-Lite visualizations.",IGt=["vega","vega-lite","themes","style"],CGt="BSD-3-Clause",lGt={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},cGt=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],BGt="build/vega-themes.js",QGt="build/vega-themes.module.js",EGt="build/vega-themes.min.js",uGt="build/vega-themes.min.js",dGt="build/vega-themes.module.d.ts",hGt={type:"git",url:"https://github.com/vega/vega-themes.git"},mGt=["src","build"],pGt={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},fGt={"@babel/core":"^7.22.9","@babel/plugin-proposal-async-generator-functions":"^7.20.7","@babel/plugin-proposal-json-strings":"^7.18.6","@babel/plugin-proposal-object-rest-spread":"^7.20.7","@babel/plugin-proposal-optional-catch-binding":"^7.18.6","@babel/plugin-transform-runtime":"^7.22.9","@babel/preset-env":"^7.22.9","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","browser-sync":"^2.29.3",concurrently:"^8.2.0",eslint:"^8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","gh-pages":"^5.0.0",prettier:"^3.0.0","release-it":"^16.1.0",rollup:"^3.26.2","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.2.0",typescript:"^5.1.6",vega:"^5.25.0","vega-lite":"^5.9.3"},yGt={vega:"*","vega-lite":"*"},bGt={},wGt={name:aGt,version:sGt,description:rGt,keywords:IGt,license:CGt,author:lGt,contributors:cGt,main:BGt,module:QGt,unpkg:EGt,jsdelivr:uGt,types:dGt,repository:hGt,files:mGt,scripts:pGt,devDependencies:fGt,peerDependencies:yGt,dependencies:bGt};const S2="#fff",D7A="#888",DGt={background:"#333",view:{stroke:D7A},title:{color:S2,subtitleColor:S2},style:{"guide-label":{fill:S2},"guide-title":{fill:S2}},axis:{domainColor:S2,gridColor:D7A,tickColor:S2}},ow="#4572a7",GGt={background:"#fff",arc:{fill:ow},area:{fill:ow},line:{stroke:ow,strokeWidth:2},path:{stroke:ow},rect:{fill:ow},shape:{stroke:ow},symbol:{fill:ow,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},gw="#30a2da",wQA="#cbcbcb",kGt="#999",JGt="#333",G7A="#f0f0f0",k7A="#333",NGt={arc:{fill:gw},area:{fill:gw},axis:{domainColor:wQA,grid:!0,gridColor:wQA,gridWidth:1,labelColor:kGt,labelFontSize:10,titleColor:JGt,tickColor:wQA,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:G7A,group:{fill:G7A},legend:{labelColor:k7A,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:k7A,titleFontSize:14,titlePadding:10},line:{stroke:gw,strokeWidth:2},path:{stroke:gw,strokeWidth:.5},rect:{fill:gw},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:gw},bar:{binSpacing:2,fill:gw,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},aw="#000",YGt={group:{fill:"#e5e5e5"},arc:{fill:aw},area:{fill:aw},line:{stroke:aw},path:{stroke:aw},rect:{fill:aw},shape:{stroke:aw},symbol:{fill:aw,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},RGt=22,xGt="normal",J7A="Benton Gothic, sans-serif",N7A=11.5,FGt="normal",sw="#82c6df",DQA="Benton Gothic Bold, sans-serif",Y7A="normal",R7A=13,_L={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},MGt={background:"#ffffff",title:{anchor:"start",color:"#000000",font:DQA,fontSize:RGt,fontWeight:xGt},arc:{fill:sw},area:{fill:sw},line:{stroke:sw,strokeWidth:2},path:{stroke:sw},rect:{fill:sw},shape:{stroke:sw},symbol:{fill:sw,size:30},axis:{labelFont:J7A,labelFontSize:N7A,labelFontWeight:FGt,titleFont:DQA,titleFontSize:R7A,titleFontWeight:Y7A},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:J7A,labelFontSize:N7A,symbolType:"square",titleFont:DQA,titleFontSize:R7A,titleFontWeight:Y7A},range:{category:_L["category-6"],diverging:_L["fireandice-6"],heatmap:_L["fire-7"],ordinal:_L["fire-7"],ramp:_L["fire-7"]}},rw="#ab5787",C4="#979797",vGt={background:"#f9f9f9",arc:{fill:rw},area:{fill:rw},line:{stroke:rw},path:{stroke:rw},rect:{fill:rw},shape:{stroke:rw},symbol:{fill:rw,size:30},axis:{domainColor:C4,domainWidth:.5,gridWidth:.2,labelColor:C4,tickColor:C4,tickWidth:.2,titleColor:C4},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Iw="#3e5c69",LGt={background:"#fff",arc:{fill:Iw},area:{fill:Iw},line:{stroke:Iw},path:{stroke:Iw},rect:{fill:Iw},shape:{stroke:Iw},symbol:{fill:Iw},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},hl="#1696d2",x7A="#000000",SGt="#FFFFFF",l4="Lato",GQA="Lato",HGt="Lato",ZGt="#DEDDDD",WGt=18,OL={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},KGt={background:SGt,title:{anchor:"start",fontSize:WGt,font:l4},axisX:{domain:!0,domainColor:x7A,domainWidth:1,grid:!1,labelFontSize:12,labelFont:GQA,labelAngle:0,tickColor:x7A,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:l4},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:ZGt,gridWidth:1,labelFontSize:12,labelFont:GQA,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:l4,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:GQA,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:l4,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:OL["six-groups-cat-1"],diverging:OL["diverging-colors"],heatmap:OL["diverging-colors"],ordinal:OL["six-groups-seq"],ramp:OL["shades-blue"]},area:{fill:hl},rect:{fill:hl},line:{color:hl,stroke:hl,strokeWidth:5},trail:{color:hl,stroke:hl,strokeWidth:0,size:1},path:{stroke:hl,strokeWidth:.5},point:{filled:!0},text:{font:HGt,color:hl,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:hl,stroke:null}},arc:{fill:hl},shape:{stroke:hl},symbol:{fill:hl,size:30}},Cw="#3366CC",F7A="#ccc",c4="Arial, sans-serif",UGt={arc:{fill:Cw},area:{fill:Cw},path:{stroke:Cw},rect:{fill:Cw},shape:{stroke:Cw},symbol:{stroke:Cw},circle:{fill:Cw},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:c4,fontSize:12},"guide-title":{font:c4,fontSize:12},"group-title":{font:c4,fontSize:12}},title:{font:c4,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:F7A,tickColor:F7A,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},kQA=A=>A*(1/3+1),M7A=kQA(9),v7A=kQA(10),L7A=kQA(12),qL="Segoe UI",S7A="wf_standard-font, helvetica, arial, sans-serif",H7A="#252423",jL="#605E5C",Z7A="transparent",VGt="#C8C6C4",qc="#118DFF",XGt="#12239E",zGt="#E66C37",TGt="#6B007B",_Gt="#E044A7",OGt="#744EC2",qGt="#D9B300",jGt="#D64550",W7A=qc,K7A="#DEEFFF",U7A=[K7A,W7A],PGt=[K7A,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",W7A],$Gt={view:{stroke:Z7A},background:Z7A,font:qL,header:{titleFont:S7A,titleFontSize:L7A,titleColor:H7A,labelFont:qL,labelFontSize:v7A,labelColor:jL},axis:{ticks:!1,grid:!1,domain:!1,labelColor:jL,labelFontSize:M7A,titleFont:S7A,titleColor:H7A,titleFontSize:L7A,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:VGt,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:qc},line:{stroke:qc,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:qL,fontSize:M7A,fill:jL},arc:{fill:qc},area:{fill:qc,line:!0,opacity:.6},path:{stroke:qc},rect:{fill:qc},point:{fill:qc,filled:!0,size:75},shape:{stroke:qc},symbol:{fill:qc,strokeWidth:1.5,size:50},legend:{titleFont:qL,titleFontWeight:"bold",titleColor:jL,labelFont:qL,labelFontSize:v7A,labelColor:jL,symbolType:"circle",symbolSize:75},range:{category:[qc,XGt,zGt,TGt,_Gt,OGt,qGt,jGt],diverging:U7A,heatmap:U7A,ordinal:PGt}},JQA='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',V7A=400,Akt=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],ekt=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function B4({type:A,background:e}){const t=A==="dark"?"#161616":"#ffffff",i=A==="dark"?"#f4f4f4":"#161616",n=A==="dark"?Akt:ekt,o=A==="dark"?"#d4bbff":"#6929c4";return{background:e,arc:{fill:o},area:{fill:o},path:{stroke:o},rect:{fill:o},shape:{stroke:o},symbol:{stroke:o},circle:{fill:o},view:{fill:t,stroke:t},group:{fill:t},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:JQA,fontWeight:600},axis:{labelColor:i,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:i,labelAngle:0},style:{"guide-label":{font:JQA,fill:i,fontWeight:V7A},"guide-title":{font:JQA,fill:i,fontWeight:V7A}},range:{category:n,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const tkt=B4({type:"light",background:"#ffffff"}),ikt=B4({type:"light",background:"#f4f4f4"}),nkt=B4({type:"dark",background:"#262626"}),okt=B4({type:"dark",background:"#161616"}),gkt=wGt.version,akt=Object.freeze(Object.defineProperty({__proto__:null,carbong10:ikt,carbong100:okt,carbong90:nkt,carbonwhite:tkt,dark:DGt,excel:GGt,fivethirtyeight:NGt,ggplot2:YGt,googlecharts:UGt,latimes:MGt,powerbi:$Gt,quartz:vGt,urbaninstitute:KGt,version:gkt,vox:LGt},Symbol.toStringTag,{value:"Module"}));function skt(A,e,t){if(RA(A))return`[${A.map(i=>e(ie(i)?i:X7A(i,t))).join(", ")}]`;if(oe(A)){let i="";const{title:n,image:o,...g}=A;n&&(i+=`<h2>${e(n)}</h2>`),o&&(i+=`<img src="${e(o)}">`);const a=Object.keys(g);if(a.length>0){i+="<table>";for(const s of a){let I=g[s];I!==void 0&&(oe(I)&&(I=X7A(I,t)),i+=`<tr><td class="key">${e(s)}</td><td class="value">${e(I)}</td></tr>`)}i+="</table>"}return i||"{}"}return e(A)}function rkt(A){const e=[];return function(t,i){if(typeof i!="object"||i===null)return i;const n=e.indexOf(this)+1;return e.length=n,e.length>A?"[Object]":e.indexOf(i)>=0?"[Circular]":(e.push(i),i)}}function X7A(A,e){return JSON.stringify(A,rkt(e))}var Ikt=`#vg-tooltip-element {
  visibility: hidden;
  padding: 8px;
  position: fixed;
  z-index: 1000;
  font-family: sans-serif;
  font-size: 11px;
  border-radius: 3px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  /* The default theme is the light theme. */
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid #d9d9d9;
  color: black;
}
#vg-tooltip-element.visible {
  visibility: visible;
}
#vg-tooltip-element h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 13px;
}
#vg-tooltip-element table {
  border-spacing: 0;
}
#vg-tooltip-element table tr {
  border: none;
}
#vg-tooltip-element table tr td {
  overflow: hidden;
  text-overflow: ellipsis;
  padding-top: 2px;
  padding-bottom: 2px;
}
#vg-tooltip-element table tr td.key {
  color: #808080;
  max-width: 150px;
  text-align: right;
  padding-right: 4px;
}
#vg-tooltip-element table tr td.value {
  display: block;
  max-width: 300px;
  max-height: 7em;
  text-align: left;
}
#vg-tooltip-element.dark-theme {
  background-color: rgba(32, 32, 32, 0.9);
  border: 1px solid #f5f5f5;
  color: white;
}
#vg-tooltip-element.dark-theme td.key {
  color: #bfbfbf;
}
`;const z7A="vg-tooltip-element",Ckt={offsetX:10,offsetY:10,id:z7A,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:lkt,maxDepth:2,formatTooltip:skt};function lkt(A){return String(A).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function ckt(A){if(!/^[A-Za-z]+[-:.\w]*$/.test(A))throw new Error("Invalid HTML ID");return Ikt.toString().replace(z7A,A)}function Bkt(A,e,t,i){let n=A.clientX+t;n+e.width>window.innerWidth&&(n=+A.clientX-t-e.width);let o=A.clientY+i;return o+e.height>window.innerHeight&&(o=+A.clientY-i-e.height),{x:n,y:o}}class Qkt{constructor(e){this.options={...Ckt,...e};const t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=ckt(t);const n=document.head;n.childNodes.length>0?n.insertBefore(i,n.childNodes[0]):n.appendChild(i)}}tooltipHandler(e,t,i,n){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),n==null||n===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(n,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:g}=Bkt(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${g}px`,this.el.style.left=`${o}px`}}function PL(A){return PL=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},PL(A)}function Ekt(A,e){if(PL(A)!=="object"||A===null)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var i=t.call(A,e||"default");if(PL(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function ukt(A){var e=Ekt(A,"string");return PL(e)==="symbol"?e:String(e)}function dkt(A,e,t){return e=ukt(e),e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function hkt(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var T7A,_7A;function mkt(){return _7A||(_7A=1,T7A=function(A){A.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),T7A}var pkt=ci;ci.Node=lw,ci.create=ci;function ci(A){var e=this;if(e instanceof ci||(e=new ci),e.tail=null,e.head=null,e.length=0,A&&typeof A.forEach=="function")A.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var t=0,i=arguments.length;t<i;t++)e.push(arguments[t]);return e}ci.prototype.removeNode=function(A){if(A.list!==this)throw new Error("removing node which does not belong to this list");var e=A.next,t=A.prev;return e&&(e.prev=t),t&&(t.next=e),A===this.head&&(this.head=e),A===this.tail&&(this.tail=t),A.list.length--,A.next=null,A.prev=null,A.list=null,e},ci.prototype.unshiftNode=function(A){if(A!==this.head){A.list&&A.list.removeNode(A);var e=this.head;A.list=this,A.next=e,e&&(e.prev=A),this.head=A,this.tail||(this.tail=A),this.length++}},ci.prototype.pushNode=function(A){if(A!==this.tail){A.list&&A.list.removeNode(A);var e=this.tail;A.list=this,A.prev=e,e&&(e.next=A),this.tail=A,this.head||(this.head=A),this.length++}},ci.prototype.push=function(){for(var A=0,e=arguments.length;A<e;A++)ykt(this,arguments[A]);return this.length},ci.prototype.unshift=function(){for(var A=0,e=arguments.length;A<e;A++)bkt(this,arguments[A]);return this.length},ci.prototype.pop=function(){if(this.tail){var A=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,A}},ci.prototype.shift=function(){if(this.head){var A=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,A}},ci.prototype.forEach=function(A,e){e=e||this;for(var t=this.head,i=0;t!==null;i++)A.call(e,t.value,i,this),t=t.next},ci.prototype.forEachReverse=function(A,e){e=e||this;for(var t=this.tail,i=this.length-1;t!==null;i--)A.call(e,t.value,i,this),t=t.prev},ci.prototype.get=function(A){for(var e=0,t=this.head;t!==null&&e<A;e++)t=t.next;if(e===A&&t!==null)return t.value},ci.prototype.getReverse=function(A){for(var e=0,t=this.tail;t!==null&&e<A;e++)t=t.prev;if(e===A&&t!==null)return t.value},ci.prototype.map=function(A,e){e=e||this;for(var t=new ci,i=this.head;i!==null;)t.push(A.call(e,i.value,this)),i=i.next;return t},ci.prototype.mapReverse=function(A,e){e=e||this;for(var t=new ci,i=this.tail;i!==null;)t.push(A.call(e,i.value,this)),i=i.prev;return t},ci.prototype.reduce=function(A,e){var t,i=this.head;if(arguments.length>1)t=e;else if(this.head)i=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)t=A(t,i.value,n),i=i.next;return t},ci.prototype.reduceReverse=function(A,e){var t,i=this.tail;if(arguments.length>1)t=e;else if(this.tail)i=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)t=A(t,i.value,n),i=i.prev;return t},ci.prototype.toArray=function(){for(var A=new Array(this.length),e=0,t=this.head;t!==null;e++)A[e]=t.value,t=t.next;return A},ci.prototype.toArrayReverse=function(){for(var A=new Array(this.length),e=0,t=this.tail;t!==null;e++)A[e]=t.value,t=t.prev;return A},ci.prototype.slice=function(A,e){e=e||this.length,e<0&&(e+=this.length),A=A||0,A<0&&(A+=this.length);var t=new ci;if(e<A||e<0)return t;A<0&&(A=0),e>this.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&i<A;i++)n=n.next;for(;n!==null&&i<e;i++,n=n.next)t.push(n.value);return t},ci.prototype.sliceReverse=function(A,e){e=e||this.length,e<0&&(e+=this.length),A=A||0,A<0&&(A+=this.length);var t=new ci;if(e<A||e<0)return t;A<0&&(A=0),e>this.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>A;i--,n=n.prev)t.push(n.value);return t},ci.prototype.splice=function(A,e,...t){A>this.length&&(A=this.length-1),A<0&&(A=this.length+A);for(var i=0,n=this.head;n!==null&&i<A;i++)n=n.next;for(var o=[],i=0;n&&i<e;i++)o.push(n.value),n=this.removeNode(n);n===null&&(n=this.tail),n!==this.head&&n!==this.tail&&(n=n.prev);for(var i=0;i<t.length;i++)n=fkt(this,n,t[i]);return o},ci.prototype.reverse=function(){for(var A=this.head,e=this.tail,t=A;t!==null;t=t.prev){var i=t.prev;t.prev=t.next,t.next=i}return this.head=e,this.tail=A,this};function fkt(A,e,t){var i=e===A.head?new lw(t,null,e,A):new lw(t,e,e.next,A);return i.next===null&&(A.tail=i),i.prev===null&&(A.head=i),A.length++,i}function ykt(A,e){A.tail=new lw(e,A.tail,null,A),A.head||(A.head=A.tail),A.length++}function bkt(A,e){A.head=new lw(e,null,A.head,A),A.tail||(A.tail=A.head),A.length++}function lw(A,e,t,i){if(!(this instanceof lw))return new lw(A,e,t,i);this.list=i,this.value=A,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{mkt()(ci)}catch{}const wkt=pkt,cw=Symbol("max"),Rd=Symbol("length"),H2=Symbol("lengthCalculator"),$L=Symbol("allowStale"),Bw=Symbol("maxAge"),xd=Symbol("dispose"),O7A=Symbol("noDisposeOnSet"),Gg=Symbol("lruList"),jc=Symbol("cache"),q7A=Symbol("updateAgeOnGet"),NQA=()=>1;class Dkt{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[cw]=e.max||1/0;const t=e.length||NQA;if(this[H2]=typeof t!="function"?NQA:t,this[$L]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Bw]=e.maxAge||0,this[xd]=e.dispose,this[O7A]=e.noDisposeOnSet||!1,this[q7A]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[cw]=e||1/0,AS(this)}get max(){return this[cw]}set allowStale(e){this[$L]=!!e}get allowStale(){return this[$L]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Bw]=e,AS(this)}get maxAge(){return this[Bw]}set lengthCalculator(e){typeof e!="function"&&(e=NQA),e!==this[H2]&&(this[H2]=e,this[Rd]=0,this[Gg].forEach(t=>{t.length=this[H2](t.value,t.key),this[Rd]+=t.length})),AS(this)}get lengthCalculator(){return this[H2]}get length(){return this[Rd]}get itemCount(){return this[Gg].length}rforEach(e,t){t=t||this;for(let i=this[Gg].tail;i!==null;){const n=i.prev;j7A(this,e,i,t),i=n}}forEach(e,t){t=t||this;for(let i=this[Gg].head;i!==null;){const n=i.next;j7A(this,e,i,t),i=n}}keys(){return this[Gg].toArray().map(e=>e.key)}values(){return this[Gg].toArray().map(e=>e.value)}reset(){this[xd]&&this[Gg]&&this[Gg].length&&this[Gg].forEach(e=>this[xd](e.key,e.value)),this[jc]=new Map,this[Gg]=new wkt,this[Rd]=0}dump(){return this[Gg].map(e=>Q4(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[Gg]}set(e,t,i){if(i=i||this[Bw],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const n=i?Date.now():0,o=this[H2](t,e);if(this[jc].has(e)){if(o>this[cw])return Z2(this,this[jc].get(e)),!1;const a=this[jc].get(e).value;return this[xd]&&(this[O7A]||this[xd](e,a.value)),a.now=n,a.maxAge=i,a.value=t,this[Rd]+=o-a.length,a.length=o,this.get(e),AS(this),!0}const g=new Gkt(e,t,o,n,i);return g.length>this[cw]?(this[xd]&&this[xd](e,t),!1):(this[Rd]+=g.length,this[Gg].unshift(g),this[jc].set(e,this[Gg].head),AS(this),!0)}has(e){if(!this[jc].has(e))return!1;const t=this[jc].get(e).value;return!Q4(this,t)}get(e){return YQA(this,e,!0)}peek(e){return YQA(this,e,!1)}pop(){const e=this[Gg].tail;return e?(Z2(this,e),e.value):null}del(e){Z2(this,this[jc].get(e))}load(e){this.reset();const t=Date.now();for(let i=e.length-1;i>=0;i--){const n=e[i],o=n.e||0;if(o===0)this.set(n.k,n.v);else{const g=o-t;g>0&&this.set(n.k,n.v,g)}}}prune(){this[jc].forEach((e,t)=>YQA(this,t,!1))}}const YQA=(A,e,t)=>{const i=A[jc].get(e);if(i){const n=i.value;if(Q4(A,n)){if(Z2(A,i),!A[$L])return}else t&&(A[q7A]&&(i.value.now=Date.now()),A[Gg].unshiftNode(i));return n.value}},Q4=(A,e)=>{if(!e||!e.maxAge&&!A[Bw])return!1;const t=Date.now()-e.now;return e.maxAge?t>e.maxAge:A[Bw]&&t>A[Bw]},AS=A=>{if(A[Rd]>A[cw])for(let e=A[Gg].tail;A[Rd]>A[cw]&&e!==null;){const t=e.prev;Z2(A,e),e=t}},Z2=(A,e)=>{if(e){const t=e.value;A[xd]&&A[xd](t.key,t.value),A[Rd]-=t.length,A[jc].delete(t.key),A[Gg].removeNode(e)}};class Gkt{constructor(e,t,i,n,o){this.key=e,this.value=t,this.length=i,this.now=n,this.maxAge=o||0}}const j7A=(A,e,t,i)=>{let n=t.value;Q4(A,n)&&(Z2(A,t),A[$L]||(n=void 0)),n&&e.call(i,n.value,n.key,A)};var kkt=Dkt;const Jkt=Object.freeze({loose:!0}),Nkt=Object.freeze({});var RQA=A=>A?typeof A!="object"?Jkt:A:Nkt,xQA={exports:{}};const Ykt="2.0.0",P7A=256,Rkt=Number.MAX_SAFE_INTEGER||9007199254740991,xkt=16,Fkt=P7A-6;var FQA={MAX_LENGTH:P7A,MAX_SAFE_COMPONENT_LENGTH:xkt,MAX_SAFE_BUILD_LENGTH:Fkt,MAX_SAFE_INTEGER:Rkt,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:Ykt,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},E4=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...A)=>console.error("SEMVER",...A):()=>{};(function(A,e){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:n}=FQA,o=E4;e=A.exports={};const g=e.re=[],a=e.safeRe=[],s=e.src=[],I=e.t={};let r=0;const C="[a-zA-Z0-9-]",l=[["\\s",1],["\\d",n],[C,i]],c=E=>{for(const[u,d]of l)E=E.split(`${u}*`).join(`${u}{0,${d}}`).split(`${u}+`).join(`${u}{1,${d}}`);return E},B=(E,u,d)=>{const f=c(u),w=r++;o(E,w,u),I[E]=w,s[w]=u,g[w]=new RegExp(u,d?"g":void 0),a[w]=new RegExp(f,d?"g":void 0)};B("NUMERICIDENTIFIER","0|[1-9]\\d*"),B("NUMERICIDENTIFIERLOOSE","\\d+"),B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${C}*`),B("MAINVERSION",`(${s[I.NUMERICIDENTIFIER]})\\.(${s[I.NUMERICIDENTIFIER]})\\.(${s[I.NUMERICIDENTIFIER]})`),B("MAINVERSIONLOOSE",`(${s[I.NUMERICIDENTIFIERLOOSE]})\\.(${s[I.NUMERICIDENTIFIERLOOSE]})\\.(${s[I.NUMERICIDENTIFIERLOOSE]})`),B("PRERELEASEIDENTIFIER",`(?:${s[I.NUMERICIDENTIFIER]}|${s[I.NONNUMERICIDENTIFIER]})`),B("PRERELEASEIDENTIFIERLOOSE",`(?:${s[I.NUMERICIDENTIFIERLOOSE]}|${s[I.NONNUMERICIDENTIFIER]})`),B("PRERELEASE",`(?:-(${s[I.PRERELEASEIDENTIFIER]}(?:\\.${s[I.PRERELEASEIDENTIFIER]})*))`),B("PRERELEASELOOSE",`(?:-?(${s[I.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[I.PRERELEASEIDENTIFIERLOOSE]})*))`),B("BUILDIDENTIFIER",`${C}+`),B("BUILD",`(?:\\+(${s[I.BUILDIDENTIFIER]}(?:\\.${s[I.BUILDIDENTIFIER]})*))`),B("FULLPLAIN",`v?${s[I.MAINVERSION]}${s[I.PRERELEASE]}?${s[I.BUILD]}?`),B("FULL",`^${s[I.FULLPLAIN]}$`),B("LOOSEPLAIN",`[v=\\s]*${s[I.MAINVERSIONLOOSE]}${s[I.PRERELEASELOOSE]}?${s[I.BUILD]}?`),B("LOOSE",`^${s[I.LOOSEPLAIN]}$`),B("GTLT","((?:<|>)?=?)"),B("XRANGEIDENTIFIERLOOSE",`${s[I.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),B("XRANGEIDENTIFIER",`${s[I.NUMERICIDENTIFIER]}|x|X|\\*`),B("XRANGEPLAIN",`[v=\\s]*(${s[I.XRANGEIDENTIFIER]})(?:\\.(${s[I.XRANGEIDENTIFIER]})(?:\\.(${s[I.XRANGEIDENTIFIER]})(?:${s[I.PRERELEASE]})?${s[I.BUILD]}?)?)?`),B("XRANGEPLAINLOOSE",`[v=\\s]*(${s[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[I.XRANGEIDENTIFIERLOOSE]})(?:${s[I.PRERELEASELOOSE]})?${s[I.BUILD]}?)?)?`),B("XRANGE",`^${s[I.GTLT]}\\s*${s[I.XRANGEPLAIN]}$`),B("XRANGELOOSE",`^${s[I.GTLT]}\\s*${s[I.XRANGEPLAINLOOSE]}$`),B("COERCE",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?(?:$|[^\\d])`),B("COERCERTL",s[I.COERCE],!0),B("LONETILDE","(?:~>?)"),B("TILDETRIM",`(\\s*)${s[I.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",B("TILDE",`^${s[I.LONETILDE]}${s[I.XRANGEPLAIN]}$`),B("TILDELOOSE",`^${s[I.LONETILDE]}${s[I.XRANGEPLAINLOOSE]}$`),B("LONECARET","(?:\\^)"),B("CARETTRIM",`(\\s*)${s[I.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",B("CARET",`^${s[I.LONECARET]}${s[I.XRANGEPLAIN]}$`),B("CARETLOOSE",`^${s[I.LONECARET]}${s[I.XRANGEPLAINLOOSE]}$`),B("COMPARATORLOOSE",`^${s[I.GTLT]}\\s*(${s[I.LOOSEPLAIN]})$|^$`),B("COMPARATOR",`^${s[I.GTLT]}\\s*(${s[I.FULLPLAIN]})$|^$`),B("COMPARATORTRIM",`(\\s*)${s[I.GTLT]}\\s*(${s[I.LOOSEPLAIN]}|${s[I.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",B("HYPHENRANGE",`^\\s*(${s[I.XRANGEPLAIN]})\\s+-\\s+(${s[I.XRANGEPLAIN]})\\s*$`),B("HYPHENRANGELOOSE",`^\\s*(${s[I.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[I.XRANGEPLAINLOOSE]})\\s*$`),B("STAR","(<|>)?=?\\s*\\*"),B("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),B("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(xQA,xQA.exports);var MQA=xQA.exports;const $7A=/^[0-9]+$/,A$A=(A,e)=>{const t=$7A.test(A),i=$7A.test(e);return t&&i&&(A=+A,e=+e),A===e?0:t&&!i?-1:i&&!t?1:A<e?-1:1};var Mkt={compareIdentifiers:A$A,rcompareIdentifiers:(A,e)=>A$A(e,A)};const u4=E4,{MAX_LENGTH:e$A,MAX_SAFE_INTEGER:d4}=FQA,{safeRe:t$A,t:i$A}=MQA,vkt=RQA,{compareIdentifiers:W2}=Mkt;var vQA=class eu{constructor(e,t){if(t=vkt(t),e instanceof eu){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>e$A)throw new TypeError(`version is longer than ${e$A} characters`);u4("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const i=e.trim().match(t.loose?t$A[i$A.LOOSE]:t$A[i$A.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>d4||this.major<0)throw new TypeError("Invalid major version");if(this.minor>d4||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>d4||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){const o=+n;if(o>=0&&o<d4)return o}return n}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(u4("SemVer.compare",this.version,this.options,e),!(e instanceof eu)){if(typeof e=="string"&&e===this.version)return 0;e=new eu(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof eu||(e=new eu(e,this.options)),W2(this.major,e.major)||W2(this.minor,e.minor)||W2(this.patch,e.patch)}comparePre(e){if(e instanceof eu||(e=new eu(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const i=this.prerelease[t],n=e.prerelease[t];if(u4("prerelease compare",t,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i!==n)return W2(i,n)}while(++t)}compareBuild(e){e instanceof eu||(e=new eu(e,this.options));let t=0;do{const i=this.build[t],n=e.build[t];if(u4("prerelease compare",t,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i!==n)return W2(i,n)}while(++t)}inc(e,t,i){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,i),this.inc("pre",t,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,i),this.inc("pre",t,i);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const n=Number(i)?1:0;if(!t&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[n];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(t===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let o=[t,n];i===!1&&(o=[t]),W2(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const n$A=vQA;var K2=(A,e,t)=>new n$A(A,t).compare(new n$A(e,t));const Lkt=K2;var Skt=(A,e,t)=>Lkt(A,e,t)===0;const Hkt=K2;var Zkt=(A,e,t)=>Hkt(A,e,t)!==0;const Wkt=K2;var Kkt=(A,e,t)=>Wkt(A,e,t)>0;const Ukt=K2;var Vkt=(A,e,t)=>Ukt(A,e,t)>=0;const Xkt=K2;var zkt=(A,e,t)=>Xkt(A,e,t)<0;const Tkt=K2;var _kt=(A,e,t)=>Tkt(A,e,t)<=0;const Okt=Skt,qkt=Zkt,jkt=Kkt,Pkt=Vkt,$kt=zkt,AJt=_kt;var eJt=(A,e,t,i)=>{switch(e){case"===":return typeof A=="object"&&(A=A.version),typeof t=="object"&&(t=t.version),A===t;case"!==":return typeof A=="object"&&(A=A.version),typeof t=="object"&&(t=t.version),A!==t;case"":case"=":case"==":return Okt(A,t,i);case"!=":return qkt(A,t,i);case">":return jkt(A,t,i);case">=":return Pkt(A,t,i);case"<":return $kt(A,t,i);case"<=":return AJt(A,t,i);default:throw new TypeError(`Invalid operator: ${e}`)}},LQA,o$A;function tJt(){if(o$A)return LQA;o$A=1;const A=Symbol("SemVer ANY");class e{static get ANY(){return A}constructor(r,C){if(C=t(C),r instanceof e){if(r.loose===!!C.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),g("comparator",r,C),this.options=C,this.loose=!!C.loose,this.parse(r),this.semver===A?this.value="":this.value=this.operator+this.semver.version,g("comp",this)}parse(r){const C=this.options.loose?i[n.COMPARATORLOOSE]:i[n.COMPARATOR],l=r.match(C);if(!l)throw new TypeError(`Invalid comparator: ${r}`);this.operator=l[1]!==void 0?l[1]:"",this.operator==="="&&(this.operator=""),l[2]?this.semver=new a(l[2],this.options.loose):this.semver=A}toString(){return this.value}test(r){if(g("Comparator.test",r,this.options.loose),this.semver===A||r===A)return!0;if(typeof r=="string")try{r=new a(r,this.options)}catch{return!1}return o(r,this.operator,this.semver,this.options)}intersects(r,C){if(!(r instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new s(r.value,C).test(this.value):r.operator===""?r.value===""?!0:new s(this.value,C).test(r.semver):(C=t(C),C.includePrerelease&&(this.value==="<0.0.0-0"||r.value==="<0.0.0-0")||!C.includePrerelease&&(this.value.startsWith("<0.0.0")||r.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&r.operator.startsWith(">")||this.operator.startsWith("<")&&r.operator.startsWith("<")||this.semver.version===r.semver.version&&this.operator.includes("=")&&r.operator.includes("=")||o(this.semver,"<",r.semver,C)&&this.operator.startsWith(">")&&r.operator.startsWith("<")||o(this.semver,">",r.semver,C)&&this.operator.startsWith("<")&&r.operator.startsWith(">")))}}LQA=e;const t=RQA,{safeRe:i,t:n}=MQA,o=eJt,g=E4,a=vQA,s=a$A();return LQA}var SQA,g$A;function a$A(){if(g$A)return SQA;g$A=1;class A{constructor(K,U){if(U=i(U),K instanceof A)return K.loose===!!U.loose&&K.includePrerelease===!!U.includePrerelease?K:new A(K.raw,U);if(K instanceof n)return this.raw=K.value,this.set=[[K]],this.format(),this;if(this.options=U,this.loose=!!U.loose,this.includePrerelease=!!U.includePrerelease,this.raw=K.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(V=>this.parseRange(V.trim())).filter(V=>V.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const V=this.set[0];if(this.set=this.set.filter(X=>!B(X[0])),this.set.length===0)this.set=[V];else if(this.set.length>1){for(const X of this.set)if(X.length===1&&E(X[0])){this.set=[X];break}}}this.format()}format(){return this.range=this.set.map(K=>K.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(K){const U=((this.options.includePrerelease&&l)|(this.options.loose&&c))+":"+K,V=t.get(U);if(V)return V;const X=this.options.loose,_=X?a[s.HYPHENRANGELOOSE]:a[s.HYPHENRANGE];K=K.replace(_,h(this.options.includePrerelease)),o("hyphen replace",K),K=K.replace(a[s.COMPARATORTRIM],I),o("comparator trim",K),K=K.replace(a[s.TILDETRIM],r),o("tilde trim",K),K=K.replace(a[s.CARETTRIM],C),o("caret trim",K);let q=K.split(" ").map(O=>d(O,this.options)).join(" ").split(/\s+/).map(O=>k(O,this.options));X&&(q=q.filter(O=>(o("loose invalid filter",O,this.options),!!O.match(a[s.COMPARATORLOOSE])))),o("range list",q);const $=new Map,nA=q.map(O=>new n(O,this.options));for(const O of nA){if(B(O))return[O];$.set(O.value,O)}$.size>1&&$.has("")&&$.delete("");const j=[...$.values()];return t.set(U,j),j}intersects(K,U){if(!(K instanceof A))throw new TypeError("a Range is required");return this.set.some(V=>u(V,U)&&K.set.some(X=>u(X,U)&&V.every(_=>X.every(q=>_.intersects(q,U)))))}test(K){if(!K)return!1;if(typeof K=="string")try{K=new g(K,this.options)}catch{return!1}for(let U=0;U<this.set.length;U++)if(N(this.set[U],K,this.options))return!0;return!1}}SQA=A;const e=kkt,t=new e({max:1e3}),i=RQA,n=tJt(),o=E4,g=vQA,{safeRe:a,t:s,comparatorTrimReplace:I,tildeTrimReplace:r,caretTrimReplace:C}=MQA,{FLAG_INCLUDE_PRERELEASE:l,FLAG_LOOSE:c}=FQA,B=v=>v.value==="<0.0.0-0",E=v=>v.value==="",u=(v,K)=>{let U=!0;const V=v.slice();let X=V.pop();for(;U&&V.length;)U=V.every(_=>X.intersects(_,K)),X=V.pop();return U},d=(v,K)=>(o("comp",v,K),v=G(v,K),o("caret",v),v=w(v,K),o("tildes",v),v=x(v,K),o("xrange",v),v=Q(v,K),o("stars",v),v),f=v=>!v||v.toLowerCase()==="x"||v==="*",w=(v,K)=>v.trim().split(/\s+/).map(U=>y(U,K)).join(" "),y=(v,K)=>{const U=K.loose?a[s.TILDELOOSE]:a[s.TILDE];return v.replace(U,(V,X,_,q,$)=>{o("tilde",v,V,X,_,q,$);let nA;return f(X)?nA="":f(_)?nA=`>=${X}.0.0 <${+X+1}.0.0-0`:f(q)?nA=`>=${X}.${_}.0 <${X}.${+_+1}.0-0`:$?(o("replaceTilde pr",$),nA=`>=${X}.${_}.${q}-${$} <${X}.${+_+1}.0-0`):nA=`>=${X}.${_}.${q} <${X}.${+_+1}.0-0`,o("tilde return",nA),nA})},G=(v,K)=>v.trim().split(/\s+/).map(U=>R(U,K)).join(" "),R=(v,K)=>{o("caret",v,K);const U=K.loose?a[s.CARETLOOSE]:a[s.CARET],V=K.includePrerelease?"-0":"";return v.replace(U,(X,_,q,$,nA)=>{o("caret",v,X,_,q,$,nA);let j;return f(_)?j="":f(q)?j=`>=${_}.0.0${V} <${+_+1}.0.0-0`:f($)?_==="0"?j=`>=${_}.${q}.0${V} <${_}.${+q+1}.0-0`:j=`>=${_}.${q}.0${V} <${+_+1}.0.0-0`:nA?(o("replaceCaret pr",nA),_==="0"?q==="0"?j=`>=${_}.${q}.${$}-${nA} <${_}.${q}.${+$+1}-0`:j=`>=${_}.${q}.${$}-${nA} <${_}.${+q+1}.0-0`:j=`>=${_}.${q}.${$}-${nA} <${+_+1}.0.0-0`):(o("no pr"),_==="0"?q==="0"?j=`>=${_}.${q}.${$}${V} <${_}.${q}.${+$+1}-0`:j=`>=${_}.${q}.${$}${V} <${_}.${+q+1}.0-0`:j=`>=${_}.${q}.${$} <${+_+1}.0.0-0`),o("caret return",j),j})},x=(v,K)=>(o("replaceXRanges",v,K),v.split(/\s+/).map(U=>F(U,K)).join(" ")),F=(v,K)=>{v=v.trim();const U=K.loose?a[s.XRANGELOOSE]:a[s.XRANGE];return v.replace(U,(V,X,_,q,$,nA)=>{o("xRange",v,V,X,_,q,$,nA);const j=f(_),O=j||f(q),eA=O||f($),oA=eA;return X==="="&&oA&&(X=""),nA=K.includePrerelease?"-0":"",j?X===">"||X==="<"?V="<0.0.0-0":V="*":X&&oA?(O&&(q=0),$=0,X===">"?(X=">=",O?(_=+_+1,q=0,$=0):(q=+q+1,$=0)):X==="<="&&(X="<",O?_=+_+1:q=+q+1),X==="<"&&(nA="-0"),V=`${X+_}.${q}.${$}${nA}`):O?V=`>=${_}.0.0${nA} <${+_+1}.0.0-0`:eA&&(V=`>=${_}.${q}.0${nA} <${_}.${+q+1}.0-0`),o("xRange return",V),V})},Q=(v,K)=>(o("replaceStars",v,K),v.trim().replace(a[s.STAR],"")),k=(v,K)=>(o("replaceGTE0",v,K),v.trim().replace(a[K.includePrerelease?s.GTE0PRE:s.GTE0],"")),h=v=>(K,U,V,X,_,q,$,nA,j,O,eA,oA,tA)=>(f(V)?U="":f(X)?U=`>=${V}.0.0${v?"-0":""}`:f(_)?U=`>=${V}.${X}.0${v?"-0":""}`:q?U=`>=${U}`:U=`>=${U}${v?"-0":""}`,f(j)?nA="":f(O)?nA=`<${+j+1}.0.0-0`:f(eA)?nA=`<${j}.${+O+1}.0-0`:oA?nA=`<=${j}.${O}.${eA}-${oA}`:v?nA=`<${j}.${O}.${+eA+1}-0`:nA=`<=${nA}`,`${U} ${nA}`.trim()),N=(v,K,U)=>{for(let V=0;V<v.length;V++)if(!v[V].test(K))return!1;if(K.prerelease.length&&!U.includePrerelease){for(let V=0;V<v.length;V++)if(o(v[V].semver),v[V].semver!==n.ANY&&v[V].semver.prerelease.length>0){const X=v[V].semver;if(X.major===K.major&&X.minor===K.minor&&X.patch===K.patch)return!0}return!1}return!0};return SQA}const iJt=a$A();var nJt=(A,e,t)=>{try{e=new iJt(e,t)}catch{return!1}return e.test(A)},s$A=hkt(nJt);function oJt(A,e,t){const i=A.open(e),n=1e4,o=250,{origin:g}=new URL(e);let a=~~(n/o);function s(r){r.source===i&&(a=0,A.removeEventListener("message",s,!1))}A.addEventListener("message",s,!1);function I(){a<=0||(i.postMessage(t,g),setTimeout(I,o),a-=1)}setTimeout(I,o)}var gJt=`.vega-embed {
  position: relative;
  display: inline-block;
  box-sizing: border-box;
}
.vega-embed.has-actions {
  padding-right: 38px;
}
.vega-embed details:not([open]) > :not(summary) {
  display: none !important;
}
.vega-embed summary {
  list-style: none;
  position: absolute;
  top: 0;
  right: 0;
  padding: 6px;
  z-index: 1000;
  background: white;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  color: #1b1e23;
  border: 1px solid #aaa;
  border-radius: 999px;
  opacity: 0.2;
  transition: opacity 0.4s ease-in;
  cursor: pointer;
  line-height: 0px;
}
.vega-embed summary::-webkit-details-marker {
  display: none;
}
.vega-embed summary:active {
  box-shadow: #aaa 0px 0px 0px 1px inset;
}
.vega-embed summary svg {
  width: 14px;
  height: 14px;
}
.vega-embed details[open] summary {
  opacity: 0.7;
}
.vega-embed:hover summary, .vega-embed:focus-within summary {
  opacity: 1 !important;
  transition: opacity 0.2s ease;
}
.vega-embed .vega-actions {
  position: absolute;
  z-index: 1001;
  top: 35px;
  right: -9px;
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
  padding-top: 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid #d9d9d9;
  background: white;
  animation-duration: 0.15s;
  animation-name: scale-in;
  animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
  text-align: left;
}
.vega-embed .vega-actions a {
  padding: 8px 16px;
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: #434a56;
  text-decoration: none;
}
.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {
  background-color: #f7f7f9;
  color: black;
}
.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
  content: "";
  display: inline-block;
  position: absolute;
}
.vega-embed .vega-actions::before {
  left: auto;
  right: 14px;
  top: -16px;
  border: 8px solid rgba(0, 0, 0, 0);
  border-bottom-color: #d9d9d9;
}
.vega-embed .vega-actions::after {
  left: auto;
  right: 15px;
  top: -14px;
  border: 7px solid rgba(0, 0, 0, 0);
  border-bottom-color: #fff;
}
.vega-embed .chart-wrapper.fit-x {
  width: 100%;
}
.vega-embed .chart-wrapper.fit-y {
  height: 100%;
}

.vega-embed-wrapper {
  max-width: 100%;
  overflow: auto;
  padding-right: 14px;
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
`;function r$A(A,...e){for(const t of e)aJt(A,t);return A}function aJt(A,e){for(const t of Object.keys(e))EJ(A,t,e[t],!0)}function I$A(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function n0(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?I$A(Object(t),!0).forEach(function(i){dkt(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):I$A(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}const qQ=iht;let eS=gGt;const HQA=typeof window<"u"?window:void 0;var C$A;eS===void 0&&(C$A=HQA==null?void 0:HQA.vl)!=null&&C$A.compile&&(eS=HQA.vl);const sJt={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},rJt={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},tS={vega:"Vega","vega-lite":"Vega-Lite"},h4={vega:qQ.version,"vega-lite":eS?eS.version:"not available"},IJt={vega:A=>A,"vega-lite":(A,e)=>eS.compile(A,{config:e}).spec},CJt=`
<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
  <circle r="2" cy="8" cx="2"></circle>
  <circle r="2" cy="8" cx="8"></circle>
  <circle r="2" cy="8" cx="14"></circle>
</svg>`,lJt="chart-wrapper";function cJt(A){return typeof A=="function"}function l$A(A,e,t,i){const n=`<html><head>${e}</head><body><pre><code class="json">`,o=`</code></pre>${t}</body></html>`,g=window.open("");g.document.write(n+A+o),g.document.title=`${tS[i]} JSON Source`}function BJt(A,e){if(A.$schema){const t=w7A(A.$schema);e&&e!==t.library&&console.warn(`The given visualization spec is written in ${tS[t.library]}, but mode argument sets ${tS[e]??e}.`);const i=t.library;return s$A(h4[i],`^${t.version.slice(1)}`)||console.warn(`The input spec uses ${tS[i]} ${t.version}, but the current version of ${tS[i]} is v${h4[i]}.`),i}return"mark"in A||"encoding"in A||"layer"in A||"hconcat"in A||"vconcat"in A||"facet"in A||"repeat"in A?"vega-lite":"marks"in A||"signals"in A||"scales"in A||"axes"in A?"vega":e??"vega"}function QJt(A){return!!(A&&"load"in A)}function c$A(A){return QJt(A)?A:qQ.loader(A)}function EJt(A){var e;const t=((e=A.usermeta)==null?void 0:e.embedOptions)??{};return ie(t.defaultStyle)&&(t.defaultStyle=!1),t}async function U2(A,e,t={}){let i,n;ie(e)?(n=c$A(t.loader),i=JSON.parse(await n.load(e))):i=e;const o=EJt(i),g=o.loader;(!n||g)&&(n=c$A(t.loader??g));const a=await B$A(o,n),s=await B$A(t,n),I=n0(n0({},r$A(s,a)),{},{config:QJ(s.config??{},a.config??{})});return await dJt(A,i,I,n)}async function B$A(A,e){const t=ie(A.config)?JSON.parse(await e.load(A.config)):A.config??{},i=ie(A.patch)?JSON.parse(await e.load(A.patch)):A.patch;return n0(n0(n0({},A),i?{patch:i}:{}),t?{config:t}:{})}function uJt(A){const e=A.getRootNode?A.getRootNode():document;return e instanceof ShadowRoot?{root:e,rootContainer:e}:{root:document,rootContainer:document.head??document.body}}async function dJt(A,e,t={},i){const n=t.theme?QJ(akt[t.theme],t.config??{}):t.config,o=sp(t.actions)?t.actions:r$A({},sJt,t.actions??{}),g=n0(n0({},rJt),t.i18n),a=t.renderer??"canvas",s=t.logLevel??qQ.Warn,I=t.downloadFileName??"visualization",r=typeof A=="string"?document.querySelector(A):A;if(!r)throw new Error(`${A} does not exist`);if(t.defaultStyle!==!1){const G="vega-embed-style",{root:R,rootContainer:x}=uJt(r);if(!R.getElementById(G)){const F=document.createElement("style");F.id=G,F.innerHTML=t.defaultStyle===void 0||t.defaultStyle===!0?gJt.toString():t.defaultStyle,x.appendChild(F)}}const C=BJt(e,t.mode);let l=IJt[C](e,n);if(C==="vega-lite"&&l.$schema){const G=w7A(l.$schema);s$A(h4.vega,`^${G.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${G.version}, but current version is v${h4.vega}.`)}r.classList.add("vega-embed"),o&&r.classList.add("has-actions"),r.innerHTML="";let c=r;if(o){const G=document.createElement("div");G.classList.add(lJt),r.appendChild(G),c=G}const B=t.patch;if(B&&(l=B instanceof Function?B(l):X9(l,B,!0,!1).newDocument),t.formatLocale&&qQ.formatLocale(t.formatLocale),t.timeFormatLocale&&qQ.timeFormatLocale(t.timeFormatLocale),t.expressionFunctions)for(const G in t.expressionFunctions){const R=t.expressionFunctions[G];"fn"in R?qQ.expressionFunction(G,R.fn,R.visitor):R instanceof Function&&qQ.expressionFunction(G,R)}const{ast:E}=t,u=qQ.parse(l,C==="vega-lite"?{}:n,{ast:E}),d=new(t.viewClass||qQ.View)(u,n0({loader:i,logLevel:s,renderer:a},E?{expr:qQ.expressionInterpreter??t.expr??cht}:{}));if(d.addSignalListener("autosize",(G,R)=>{const{type:x}=R;x=="fit-x"?(c.classList.add("fit-x"),c.classList.remove("fit-y")):x=="fit-y"?(c.classList.remove("fit-x"),c.classList.add("fit-y")):x=="fit"?c.classList.add("fit-x","fit-y"):c.classList.remove("fit-x","fit-y")}),t.tooltip!==!1){const G=cJt(t.tooltip)?t.tooltip:new Qkt(t.tooltip===!0?{}:t.tooltip).call;d.tooltip(G)}let{hover:f}=t;if(f===void 0&&(f=C==="vega"),f){const{hoverSet:G,updateSet:R}=typeof f=="boolean"?{}:f;d.hover(G,R)}t&&(t.width!=null&&d.width(t.width),t.height!=null&&d.height(t.height),t.padding!=null&&d.padding(t.padding)),await d.initialize(c,t.bind).runAsync();let w;if(o!==!1){let G=r;if(t.defaultStyle!==!1||t.forceActionsMenu){const x=document.createElement("details");x.title=g.CLICK_TO_VIEW_ACTIONS,r.append(x),G=x;const F=document.createElement("summary");F.innerHTML=CJt,x.append(F),w=Q=>{x.contains(Q.target)||x.removeAttribute("open")},document.addEventListener("click",w)}const R=document.createElement("div");if(G.append(R),R.classList.add("vega-actions"),o===!0||o.export!==!1){for(const x of["svg","png"])if(o===!0||o.export===!0||o.export[x]){const F=g[`${x.toUpperCase()}_ACTION`],Q=document.createElement("a"),k=oe(t.scaleFactor)?t.scaleFactor[x]:t.scaleFactor;Q.text=F,Q.href="#",Q.target="_blank",Q.download=`${I}.${x}`,Q.addEventListener("mousedown",async function(h){h.preventDefault();const N=await d.toImageURL(x,k);this.href=N}),R.append(Q)}}if(o===!0||o.source!==!1){const x=document.createElement("a");x.text=g.SOURCE_ACTION,x.href="#",x.addEventListener("click",function(F){l$A(waA(e),t.sourceHeader??"",t.sourceFooter??"",C),F.preventDefault()}),R.append(x)}if(C==="vega-lite"&&(o===!0||o.compiled!==!1)){const x=document.createElement("a");x.text=g.COMPILED_ACTION,x.href="#",x.addEventListener("click",function(F){l$A(waA(l),t.sourceHeader??"",t.sourceFooter??"","vega"),F.preventDefault()}),R.append(x)}if(o===!0||o.editor!==!1){const x=t.editorUrl??"https://vega.github.io/editor/",F=document.createElement("a");F.text=g.EDITOR_ACTION,F.href="#",F.addEventListener("click",function(Q){oJt(window,x,{config:n,mode:C,renderer:a,spec:waA(e)}),Q.preventDefault()}),R.append(F)}}function y(){w&&document.removeEventListener("click",w),d.finalize()}return{view:d,spec:e,vgSpec:l,finalize:y,embedOptions:t}}var ZQA=function(A,e){return ZQA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},ZQA(A,e)};function o0(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ZQA(A,e);function t(){this.constructor=A}A.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function hJt(A,e,t,i){function n(o){return o instanceof t?o:new t(function(g){g(o)})}return new(t||(t=Promise))(function(o,g){function a(r){try{I(i.next(r))}catch(C){g(C)}}function s(r){try{I(i.throw(r))}catch(C){g(C)}}function I(r){r.done?o(r.value):n(r.value).then(a,s)}I((i=i.apply(A,e||[])).next())})}function Q$A(A,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,g;return g={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function a(I){return function(r){return s([I,r])}}function s(I){if(i)throw new TypeError("Generator is already executing.");for(;g&&(g=0,I[0]&&(t=0)),t;)try{if(i=1,n&&(o=I[0]&2?n.return:I[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,I[1])).done)return o;switch(n=0,o&&(I=[I[0]&2,o.value]),I[0]){case 0:case 1:o=I;break;case 4:return t.label++,{value:I[1],done:!1};case 5:t.label++,n=I[1],I=[0];continue;case 7:I=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(I[0]===6||I[0]===2)){t=0;continue}if(I[0]===3&&(!o||I[1]>o[0]&&I[1]<o[3])){t.label=I[1];break}if(I[0]===6&&t.label<o[1]){t.label=o[1],o=I;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(I);break}o[2]&&t.ops.pop(),t.trys.pop();continue}I=e.call(A,t)}catch(r){I=[6,r],n=0}finally{i=o=0}if(I[0]&5)throw I[1];return{value:I[0]?I[1]:void 0,done:!0}}}function V2(A){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&A[e],i=0;if(t)return t.call(A);if(A&&typeof A.length=="number")return{next:function(){return A&&i>=A.length&&(A=void 0),{value:A&&A[i++],done:!A}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Qw(A,e){var t=typeof Symbol=="function"&&A[Symbol.iterator];if(!t)return A;var i=t.call(A),n,o=[],g;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(a){g={error:a}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(g)throw g.error}}return o}function Ew(A,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,o;i<n;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return A.concat(o||Array.prototype.slice.call(e))}function X2(A){return this instanceof X2?(this.v=A,this):new X2(A)}function mJt(A,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(A,e||[]),n,o=[];return n={},g("next"),g("throw"),g("return"),n[Symbol.asyncIterator]=function(){return this},n;function g(l){i[l]&&(n[l]=function(c){return new Promise(function(B,E){o.push([l,c,B,E])>1||a(l,c)})})}function a(l,c){try{s(i[l](c))}catch(B){C(o[0][3],B)}}function s(l){l.value instanceof X2?Promise.resolve(l.value.v).then(I,r):C(o[0][2],l)}function I(l){a("next",l)}function r(l){a("throw",l)}function C(l,c){l(c),o.shift(),o.length&&a(o[0][0],o[0][1])}}function pJt(A){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=A[Symbol.asyncIterator],t;return e?e.call(A):(A=typeof V2=="function"?V2(A):A[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=A[o]&&function(g){return new Promise(function(a,s){g=A[o](g),n(a,s,g.done,g.value)})}}function n(o,g,a,s){Promise.resolve(s).then(function(I){o({value:I,done:a})},g)}}function kg(A){return typeof A=="function"}function E$A(A){var e=function(i){Error.call(i),i.stack=new Error().stack},t=A(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var WQA=E$A(function(A){return function(e){A(this),this.message=e?e.length+` errors occurred during unsubscription:
`+e.map(function(t,i){return i+1+") "+t.toString()}).join(`
  `):"",this.name="UnsubscriptionError",this.errors=e}});function m4(A,e){if(A){var t=A.indexOf(e);0<=t&&A.splice(t,1)}}var iS=function(){function A(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return A.prototype.unsubscribe=function(){var e,t,i,n,o;if(!this.closed){this.closed=!0;var g=this._parentage;if(g)if(this._parentage=null,Array.isArray(g))try{for(var a=V2(g),s=a.next();!s.done;s=a.next()){var I=s.value;I.remove(this)}}catch(E){e={error:E}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else g.remove(this);var r=this.initialTeardown;if(kg(r))try{r()}catch(E){o=E instanceof WQA?E.errors:[E]}var C=this._finalizers;if(C){this._finalizers=null;try{for(var l=V2(C),c=l.next();!c.done;c=l.next()){var B=c.value;try{h$A(B)}catch(E){o=o??[],E instanceof WQA?o=Ew(Ew([],Qw(o)),Qw(E.errors)):o.push(E)}}}catch(E){i={error:E}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(i)throw i.error}}}if(o)throw new WQA(o)}},A.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)h$A(e);else{if(e instanceof A){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},A.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},A.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},A.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&m4(t,e)},A.prototype.remove=function(e){var t=this._finalizers;t&&m4(t,e),e instanceof A&&e._removeParent(this)},A.EMPTY=function(){var e=new A;return e.closed=!0,e}(),A}(),u$A=iS.EMPTY;function d$A(A){return A instanceof iS||A&&"closed"in A&&kg(A.remove)&&kg(A.add)&&kg(A.unsubscribe)}function h$A(A){kg(A)?A():A.unsubscribe()}var m$A={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},fJt={setTimeout:function(A,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,Ew([A,e],Qw(t)))},clearTimeout:function(A){return clearTimeout(A)},delegate:void 0};function p$A(A){fJt.setTimeout(function(){throw A})}function KQA(){}function p4(A){A()}var UQA=function(A){o0(e,A);function e(t){var i=A.call(this)||this;return i.isStopped=!1,t?(i.destination=t,d$A(t)&&t.add(i)):i.destination=DJt,i}return e.create=function(t,i,n){return new XQA(t,i,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,A.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(iS),yJt=Function.prototype.bind;function VQA(A,e){return yJt.call(A,e)}var bJt=function(){function A(e){this.partialObserver=e}return A.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){f4(i)}},A.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){f4(i)}else f4(e)},A.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){f4(t)}},A}(),XQA=function(A){o0(e,A);function e(t,i,n){var o=A.call(this)||this,g;if(kg(t)||!t)g={next:t??void 0,error:i??void 0,complete:n??void 0};else{var a;o&&m$A.useDeprecatedNextContext?(a=Object.create(t),a.unsubscribe=function(){return o.unsubscribe()},g={next:t.next&&VQA(t.next,a),error:t.error&&VQA(t.error,a),complete:t.complete&&VQA(t.complete,a)}):g=t}return o.destination=new bJt(g),o}return e}(UQA);function f4(A){p$A(A)}function wJt(A){throw A}var DJt={closed:!0,next:KQA,error:wJt,complete:KQA},zQA=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function f$A(A){return A}function GJt(A){return A.length===0?f$A:A.length===1?A[0]:function(e){return A.reduce(function(t,i){return i(t)},e)}}var Fd=function(){function A(e){e&&(this._subscribe=e)}return A.prototype.lift=function(e){var t=new A;return t.source=this,t.operator=e,t},A.prototype.subscribe=function(e,t,i){var n=this,o=JJt(e)?e:new XQA(e,t,i);return p4(function(){var g=n,a=g.operator,s=g.source;o.add(a?a.call(o,s):s?n._subscribe(o):n._trySubscribe(o))}),o},A.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},A.prototype.forEach=function(e,t){var i=this;return t=y$A(t),new t(function(n,o){var g=new XQA({next:function(a){try{e(a)}catch(s){o(s),g.unsubscribe()}},error:o,complete:n});i.subscribe(g)})},A.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},A.prototype[zQA]=function(){return this},A.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return GJt(e)(this)},A.prototype.toPromise=function(e){var t=this;return e=y$A(e),new e(function(i,n){var o;t.subscribe(function(g){return o=g},function(g){return n(g)},function(){return i(o)})})},A.create=function(e){return new A(e)},A}();function y$A(A){var e;return(e=A??m$A.Promise)!==null&&e!==void 0?e:Promise}function kJt(A){return A&&kg(A.next)&&kg(A.error)&&kg(A.complete)}function JJt(A){return A&&A instanceof UQA||kJt(A)&&d$A(A)}function NJt(A){return kg(A==null?void 0:A.lift)}function TQA(A){return function(e){if(NJt(e))return e.lift(function(t){try{return A(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function nS(A,e,t,i,n){return new YJt(A,e,t,i,n)}var YJt=function(A){o0(e,A);function e(t,i,n,o,g,a){var s=A.call(this,t)||this;return s.onFinalize=g,s.shouldUnsubscribe=a,s._next=i?function(I){try{i(I)}catch(r){t.error(r)}}:A.prototype._next,s._error=o?function(I){try{o(I)}catch(r){t.error(r)}finally{this.unsubscribe()}}:A.prototype._error,s._complete=n?function(){try{n()}catch(I){t.error(I)}finally{this.unsubscribe()}}:A.prototype._complete,s}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;A.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(UQA),RJt=E$A(function(A){return function(){A(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),z2=function(A){o0(e,A);function e(){var t=A.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var i=new b$A(this,this);return i.operator=t,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new RJt},e.prototype.next=function(t){var i=this;p4(function(){var n,o;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var g=V2(i.currentObservers),a=g.next();!a.done;a=g.next()){var s=a.value;s.next(t)}}catch(I){n={error:I}}finally{try{a&&!a.done&&(o=g.return)&&o.call(g)}finally{if(n)throw n.error}}}})},e.prototype.error=function(t){var i=this;p4(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=t;for(var n=i.observers;n.length;)n.shift().error(t)}})},e.prototype.complete=function(){var t=this;p4(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var i=t.observers;i.length;)i.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),A.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var i=this,n=this,o=n.hasError,g=n.isStopped,a=n.observers;return o||g?u$A:(this.currentObservers=null,a.push(t),new iS(function(){i.currentObservers=null,m4(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var i=this,n=i.hasError,o=i.thrownError,g=i.isStopped;n?t.error(o):g&&t.complete()},e.prototype.asObservable=function(){var t=new Fd;return t.source=this,t},e.create=function(t,i){return new b$A(t,i)},e}(Fd),b$A=function(A){o0(e,A);function e(t,i){var n=A.call(this)||this;return n.destination=t,n.source=i,n}return e.prototype.next=function(t){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.next)===null||n===void 0||n.call(i,t)},e.prototype.error=function(t){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.error)===null||n===void 0||n.call(i,t)},e.prototype.complete=function(){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||i===void 0||i.call(t)},e.prototype._subscribe=function(t){var i,n;return(n=(i=this.source)===null||i===void 0?void 0:i.subscribe(t))!==null&&n!==void 0?n:u$A},e}(z2),xJt={now:function(){return Date.now()},delegate:void 0},FJt=function(A){o0(e,A);function e(t,i){return A.call(this)||this}return e.prototype.schedule=function(t,i){return this},e}(iS),_QA={setInterval:function(A,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];var n=_QA.delegate;return n!=null&&n.setInterval?n.setInterval.apply(n,Ew([A,e],Qw(t))):setInterval.apply(void 0,Ew([A,e],Qw(t)))},clearInterval:function(A){return clearInterval(A)},delegate:void 0},MJt=function(A){o0(e,A);function e(t,i){var n=A.call(this,t,i)||this;return n.scheduler=t,n.work=i,n.pending=!1,n}return e.prototype.schedule=function(t,i){var n;if(i===void 0&&(i=0),this.closed)return this;this.state=t;var o=this.id,g=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(g,o,i)),this.pending=!0,this.delay=i,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(g,this.id,i),this},e.prototype.requestAsyncId=function(t,i,n){return n===void 0&&(n=0),_QA.setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,i,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return i;i!=null&&_QA.clearInterval(i)},e.prototype.execute=function(t,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,i);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,i){var n=!1,o;try{this.work(t)}catch(g){n=!0,o=g||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,i=t.id,n=t.scheduler,o=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,m4(o,this),i!=null&&(this.id=this.recycleAsyncId(n,i,null)),this.delay=null,A.prototype.unsubscribe.call(this)}},e}(FJt),w$A=function(){function A(e,t){t===void 0&&(t=A.now),this.schedulerActionCtor=e,this.now=t}return A.prototype.schedule=function(e,t,i){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(i,t)},A.now=xJt.now,A}(),vJt=function(A){o0(e,A);function e(t,i){i===void 0&&(i=w$A.now);var n=A.call(this,t,i)||this;return n.actions=[],n._active=!1,n}return e.prototype.flush=function(t){var i=this.actions;if(this._active){i.push(t);return}var n;this._active=!0;do if(n=t.execute(t.state,t.delay))break;while(t=i.shift());if(this._active=!1,n){for(;t=i.shift();)t.unsubscribe();throw n}},e}(w$A),D$A=new vJt(MJt),LJt=D$A;function SJt(A){return A&&kg(A.schedule)}function HJt(A){return A[A.length-1]}function ZJt(A){return kg(HJt(A))?A.pop():void 0}var WJt=function(A){return A&&typeof A.length=="number"&&typeof A!="function"};function KJt(A){return kg(A==null?void 0:A.then)}function UJt(A){return kg(A[zQA])}function VJt(A){return Symbol.asyncIterator&&kg(A==null?void 0:A[Symbol.asyncIterator])}function XJt(A){return new TypeError("You provided "+(A!==null&&typeof A=="object"?"an invalid object":"'"+A+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function zJt(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var TJt=zJt();function _Jt(A){return kg(A==null?void 0:A[TJt])}function OJt(A){return mJt(this,arguments,function(){var e,t,i,n;return Q$A(this,function(o){switch(o.label){case 0:e=A.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,X2(e.read())];case 3:return t=o.sent(),i=t.value,n=t.done,n?[4,X2(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,X2(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function qJt(A){return kg(A==null?void 0:A.getReader)}function G$A(A){if(A instanceof Fd)return A;if(A!=null){if(UJt(A))return jJt(A);if(WJt(A))return PJt(A);if(KJt(A))return $Jt(A);if(VJt(A))return k$A(A);if(_Jt(A))return A2t(A);if(qJt(A))return e2t(A)}throw XJt(A)}function jJt(A){return new Fd(function(e){var t=A[zQA]();if(kg(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function PJt(A){return new Fd(function(e){for(var t=0;t<A.length&&!e.closed;t++)e.next(A[t]);e.complete()})}function $Jt(A){return new Fd(function(e){A.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,p$A)})}function A2t(A){return new Fd(function(e){var t,i;try{for(var n=V2(A),o=n.next();!o.done;o=n.next()){var g=o.value;if(e.next(g),e.closed)return}}catch(a){t={error:a}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}e.complete()})}function k$A(A){return new Fd(function(e){t2t(A,e).catch(function(t){return e.error(t)})})}function e2t(A){return k$A(OJt(A))}function t2t(A,e){var t,i,n,o;return hJt(this,void 0,void 0,function(){var g,a;return Q$A(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),t=pJt(A),s.label=1;case 1:return[4,t.next()];case 2:if(i=s.sent(),!!i.done)return[3,4];if(g=i.value,e.next(g),e.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=s.sent(),n={error:a},[3,11];case 6:return s.trys.push([6,,9,10]),i&&!i.done&&(o=t.return)?[4,o.call(t)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(n)throw n.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function i2t(A){return A instanceof Date&&!isNaN(A)}function n2t(A,e,t){A===void 0&&(A=0),t===void 0&&(t=LJt);var i=-1;return e!=null&&(SJt(e)?t=e:i=e),new Fd(function(n){var o=i2t(A)?+A-t.now():A;o<0&&(o=0);var g=0;return t.schedule(function(){n.closed||(n.next(g++),0<=i?this.schedule(void 0,i):n.complete())},o)})}function o2t(A,e){return TQA(function(t,i){var n=0;t.subscribe(nS(i,function(o){return A.call(e,o,n++)&&i.next(o)}))})}function g2t(A,e){return TQA(function(t,i){var n=e??{},o=n.leading,g=o===void 0?!0:o,a=n.trailing,s=a===void 0?!1:a,I=!1,r=null,C=null,l=!1,c=function(){C==null||C.unsubscribe(),C=null,s&&(u(),l&&i.complete())},B=function(){C=null,l&&i.complete()},E=function(d){return C=G$A(A(d)).subscribe(nS(i,c,B))},u=function(){if(I){I=!1;var d=r;r=null,i.next(d),!l&&E(d)}};t.subscribe(nS(i,function(d){I=!0,r=d,!(C&&!C.closed)&&(g?u():E(d))},function(){l=!0,!(s&&I&&C&&!C.closed)&&i.complete()}))})}function a2t(A,e,t){e===void 0&&(e=D$A);var i=n2t(A,e);return g2t(function(){return i},t)}function s2t(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=ZJt(A);return TQA(function(i,n){for(var o=A.length,g=new Array(o),a=A.map(function(){return!1}),s=!1,I=function(C){G$A(A[C]).subscribe(nS(n,function(l){g[C]=l,!s&&!a[C]&&(a[C]=!0,(s=a.every(f$A))&&(a=null))},KQA))},r=0;r<o;r++)I(r);i.subscribe(nS(n,function(C){if(s){var l=Ew([C],Qw(g));n.next(t?t.apply(void 0,Ew([],Qw(l))):l)}}))})}const r2t=(A,e,t,i,n)=>{const o={getSVGData(){return Promise.all(e.current.map(a=>{if(!a.view)throw new Error("View is not available");return a.view.toSVG()}))},async getCanvasData(){return(await Promise.all(e.current.map(a=>{if(!a.view)throw new Error("View is not available");return a.view.toCanvas(2)}))).map(a=>a.toDataURL("image/png",1))},async downloadSVG(a=`gw chart ${Date.now()%1e6}`.padStart(6,"0")){const s=await Promise.all(e.current.map(r=>{if(!r.view)throw new Error("View is not available");return r.view.toSVG()})),I=[];for(let r=0;r<s.length;r+=1){const C=s[r],l=new File([C],`${a}${s.length>1?`_${r+1}`:""}.svg`),c=URL.createObjectURL(l),B=document.createElement("a");B.download=l.name,B.href=c,B.click(),requestAnimationFrame(()=>{URL.revokeObjectURL(c)})}return I},async downloadPNG(a=`gw chart ${Date.now()%1e6}`.padStart(6,"0")){const s=(await Promise.all(e.current.map(r=>{if(!r.view)throw new Error("View is not available");return r.view.toCanvas(2)}))).map(r=>r.toDataURL("image/png",1)),I=[];for(let r=0;r<s.length;r+=1){const C=s[r],l=document.createElement("a");l.download=`${a}${s.length>1?`_${r+1}`:""}.png`,l.href=C.replace(/^data:image\/[^;]/,"data:application/octet-stream"),l.click()}return I}};p.useImperativeHandle(t,()=>o);const g=_k();p.useEffect(()=>{const a=g.current;a&&(Promise.all(i.current).then(()=>{if(g.current){const s=g.current;if(s.renderStatus!=="rendering")return;setTimeout(()=>{s.renderStatus==="rendering"&&s.updateRenderStatus("idle")},0)}}).catch(()=>{if(g.current){if(g.current.renderStatus!=="rendering")return;g.current.updateRenderStatus("error")}}),a.exportChart=async(s="svg")=>{if(a.renderStatus==="error")return console.error("exportChart failed because error occurred when rendering chart."),{mode:s,title:"",nCols:0,nRows:0,charts:[],chartType:"vega",container(){return null}};if(a.renderStatus!=="idle"){let r=null;const C=new Promise((l,c)=>{r=a.onRenderStatusChange(B=>{B==="error"?c(new Error("Error occurred when rendering chart")):B==="idle"&&l()}),setTimeout(()=>c(new Error("Timeout")),1e4)});try{await C}catch(l){return console.error("exportChart failed:",`${l}`),{mode:s,title:"",nCols:0,nRows:0,charts:[],chartType:"vega",container(){return null}}}finally{r==null||r()}}const I={mode:s,title:A||"untitled",nCols:e.current.map(r=>r.x).reduce((r,C)=>Math.max(r,C),0)+1,nRows:e.current.map(r=>r.y).reduce((r,C)=>Math.max(r,C),0)+1,charts:e.current.map(r=>({rowIndex:r.y,colIndex:r.x,width:r.w,height:r.h,canvasWidth:r.innerWidth,canvasHeight:r.innerHeight,data:"",canvas(){const C=r.canvas;return C instanceof HTMLCanvasElement||C instanceof SVGSVGElement?C:null}})),container(){return n.current},chartType:"vega"};if(s==="data-url"){const r=await o.getCanvasData();if(r)for(let C=0;C<r.length;C+=1)I.charts[C].data=r[C]}else if(s==="svg"){const r=await o.getSVGData();if(r)for(let C=0;C<r.length;C+=1)I.charts[C].data=r[C]}return I},a.exportChartList=async function*(s="svg"){const I=a.chartCount,r=new Array(I).fill(0).map((l,c)=>c),C=a.chartIndex;for await(const l of r){a.openChart(l),await new Promise(B=>setTimeout(B,0));const c=await a.exportChart(s);yield{mode:s,total:I,index:l,data:c,hasNext:l<I-1}}a.openChart(C)})}),p.useEffect(()=>()=>{g.current&&(g.current.updateRenderStatus("idle"),g.current.exportChart=async(a="svg")=>({mode:a,title:"",nCols:0,nRows:0,charts:[],chartType:"vega",container(){return null}}),g.current.exportChartList=async function*(a="svg"){yield{mode:a,total:1,completed:0,index:0,data:{mode:a,title:"",nCols:0,nRows:0,charts:[],chartType:"vega",container(){return null}},hasNext:!1}})},[])};function J$A(A){switch(A){case"zh-CN":return{dateTime:"%x %A %X",date:"%Y年%-m月%-d日",time:"%H:%M:%S",periods:["上午","下午"],days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],shortDays:["周日","周一","周二","周三","周四","周五","周六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortMonths:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]};case"en-US":default:return{dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}}}/*!
 * canvas-size
 * v1.2.6
 * https://github.com/jhildenbiddle/canvas-size
 * (c) 2015-2023 John Hildenbiddle <http://hildenbiddle.com>
 * MIT license
 */function I2t(A,e){var t=A==null?null:typeof Symbol<"u"&&A[Symbol.iterator]||A["@@iterator"];if(t!=null){var i,n,o,g,a=[],s=!0,I=!1;try{if(o=(t=t.call(A)).next,e===0){if(Object(t)!==t)return;s=!1}else for(;!(s=(i=o.call(t)).done)&&(a.push(i.value),a.length!==e);s=!0);}catch(r){I=!0,n=r}finally{try{if(!s&&t.return!=null&&(g=t.return(),Object(g)!==g))return}finally{if(I)throw n}}return a}}function N$A(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function vI(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?N$A(Object(t),!0).forEach(function(i){C2t(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):N$A(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function C2t(A,e,t){return e=m2t(e),e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function l2t(A,e){if(A==null)return{};var t={},i=Object.keys(A),n,o;for(o=0;o<i.length;o++)n=i[o],!(e.indexOf(n)>=0)&&(t[n]=A[n]);return t}function c2t(A,e){if(A==null)return{};var t=l2t(A,e),i,n;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(A);for(n=0;n<o.length;n++)i=o[n],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(A,i)&&(t[i]=A[i])}return t}function Y$A(A,e){return Q2t(A)||I2t(A,e)||R$A(A,e)||d2t()}function y4(A){return B2t(A)||E2t(A)||R$A(A)||u2t()}function B2t(A){if(Array.isArray(A))return OQA(A)}function Q2t(A){if(Array.isArray(A))return A}function E2t(A){if(typeof Symbol<"u"&&A[Symbol.iterator]!=null||A["@@iterator"]!=null)return Array.from(A)}function R$A(A,e){if(A){if(typeof A=="string")return OQA(A,e);var t=Object.prototype.toString.call(A).slice(8,-1);if(t==="Object"&&A.constructor&&(t=A.constructor.name),t==="Map"||t==="Set")return Array.from(A);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return OQA(A,e)}}function OQA(A,e){(e==null||e>A.length)&&(e=A.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=A[t];return i}function u2t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d2t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h2t(A,e){if(typeof A!="object"||A===null)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var i=t.call(A,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function m2t(A){var e=h2t(A,"string");return typeof e=="symbol"?e:String(e)}function oS(A){var e=A.sizes.shift(),t=Math.max(Math.ceil(e[0]),1),i=Math.max(Math.ceil(e[1]),1),n=[t-1,i-1,1,1],o=Date.now(),g=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,a,s;g?(a=new OffscreenCanvas(1,1),s=new OffscreenCanvas(t,i)):(a=document.createElement("canvas"),a.width=1,a.height=1,s=document.createElement("canvas"),s.width=t,s.height=i);var I=a.getContext("2d"),r=s.getContext("2d");r&&(r.fillRect.apply(r,n),I.drawImage(s,t-1,i-1,1,1,0,0,1,1));var C=I&&I.getImageData(0,0,1,1).data[3]!==0,l=Date.now()-o;return[a,s].forEach(function(c){c.height=0,c.width=0}),g?(postMessage({width:t,height:i,benchmark:l,isTestPass:C}),!C&&A.sizes.length&&oS(A)):C?A.onSuccess(t,i,l):(A.onError(t,i,l),A.sizes.length&&oS(A)),C}var qQA={area:[16384,14188,11402,11180,10836,8192,4096,1],height:[8388607,65535,32767,16384,8192,4096,1],width:[4194303,65535,32767,16384,8192,4096,1]},p2t=["onError","onSuccess"],T2={max:null,min:1,sizes:[],step:1024,usePromise:!1,useWorker:!1,onError:Function.prototype,onSuccess:Function.prototype},gS={};function jQA(A){var e=A.width===A.height,t=A.height===1,i=A.width===1,n=[];if(!A.width||!A.height)A.sizes.forEach(function(r){var C=e||t?r:1,l=e||i?r:1;n.push([C,l])});else for(var o=A.min||T2.min,g=A.step||T2.step,a=Math.max(A.width,A.height);a>=o;){var s=e||t?a:1,I=e||i?a:1;n.push([s,I]),a-=g}return n}function b4(A){var e=window&&"HTMLCanvasElement"in window,t=window&&"OffscreenCanvas"in window,i=Date.now(),n=A.onError,o=A.onSuccess,g=c2t(A,p2t),a=null;if(!e)return!1;if(A.useWorker&&t){var s=`
            var canvasTest = `.concat(oS.toString(),`;
            onmessage = function(e) {
                canvasTest(e.data);
            };
        `),I=new Blob([s],{type:"application/javascript"}),r=URL.createObjectURL(I);a=new Worker(r),URL.revokeObjectURL(r),a.onmessage=function(C){var l=C.data,c=l.width,B=l.height,E=l.benchmark,u=l.isTestPass;u?(gS[i].onSuccess(c,B,E),delete gS[i]):gS[i].onError(c,B,E)}}if(A.usePromise)return new Promise(function(C,l){var c=vI(vI({},A),{},{onError:function(u,d,f){var w;if(A.sizes.length===0)w=!0;else{var y=A.sizes.slice(-1),G=Y$A(y,1),R=Y$A(G[0],2),x=R[0],F=R[1];w=u===x&&d===F}n(u,d,f),w&&l({width:u,height:d,benchmark:f})},onSuccess:function(u,d,f){o(u,d,f),C({width:u,height:d,benchmark:f})}});if(a){var B=c.onError,E=c.onSuccess;gS[i]={onError:B,onSuccess:E},a.postMessage(g)}else oS(c)});if(a)gS[i]={onError:n,onSuccess:o},a.postMessage(g);else return oS(A)}var PQA={maxArea:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=jQA({width:A.max,height:A.max,min:A.min,step:A.step,sizes:y4(qQA.area)}),t=vI(vI(vI({},T2),A),{},{sizes:e});return b4(t)},maxHeight:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=jQA({width:1,height:A.max,min:A.min,step:A.step,sizes:y4(qQA.height)}),t=vI(vI(vI({},T2),A),{},{sizes:e});return b4(t)},maxWidth:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=jQA({width:A.max,height:1,min:A.min,step:A.step,sizes:y4(qQA.width)}),t=vI(vI(vI({},T2),A),{},{sizes:e});return b4(t)},test:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=vI(vI({},T2),A);return e.sizes=y4(e.sizes),e.width&&e.height&&(e.sizes=[[e.width,e.height]]),b4(e)}};const $QA={canvasExceedSize:500,computationError:501,askVizError:502},x$A=b.createContext({reportError:()=>{}}),w4=()=>b.useContext(x$A),AEA=x$A.Provider;function f2t(A){var e=typeof A;return A!=null&&(e=="object"||e=="function")}var Md=f2t,y2t=typeof um=="object"&&um&&um.Object===Object&&um,F$A=y2t,b2t=F$A,w2t=typeof self=="object"&&self&&self.Object===Object&&self,D2t=b2t||w2t||Function("return this")(),Pc=D2t,G2t=Pc,k2t=function(){return G2t.Date.now()},J2t=k2t,N2t=/\s/;function Y2t(A){for(var e=A.length;e--&&N2t.test(A.charAt(e)););return e}var R2t=Y2t,x2t=R2t,F2t=/^\s+/;function M2t(A){return A&&A.slice(0,x2t(A)+1).replace(F2t,"")}var v2t=M2t,L2t=Pc,S2t=L2t.Symbol,aS=S2t,M$A=aS,v$A=Object.prototype,H2t=v$A.hasOwnProperty,Z2t=v$A.toString,sS=M$A?M$A.toStringTag:void 0;function W2t(A){var e=H2t.call(A,sS),t=A[sS];try{A[sS]=void 0;var i=!0}catch{}var n=Z2t.call(A);return i&&(e?A[sS]=t:delete A[sS]),n}var K2t=W2t,U2t=Object.prototype,V2t=U2t.toString;function X2t(A){return V2t.call(A)}var z2t=X2t,L$A=aS,T2t=K2t,_2t=z2t,O2t="[object Null]",q2t="[object Undefined]",S$A=L$A?L$A.toStringTag:void 0;function j2t(A){return A==null?A===void 0?q2t:O2t:S$A&&S$A in Object(A)?T2t(A):_2t(A)}var uw=j2t;function P2t(A){return A!=null&&typeof A=="object"}var vd=P2t,$2t=uw,ANt=vd,eNt="[object Symbol]";function tNt(A){return typeof A=="symbol"||ANt(A)&&$2t(A)==eNt}var D4=tNt,iNt=v2t,H$A=Md,nNt=D4,Z$A=0/0,oNt=/^[-+]0x[0-9a-f]+$/i,gNt=/^0b[01]+$/i,aNt=/^0o[0-7]+$/i,sNt=parseInt;function rNt(A){if(typeof A=="number")return A;if(nNt(A))return Z$A;if(H$A(A)){var e=typeof A.valueOf=="function"?A.valueOf():A;A=H$A(e)?e+"":e}if(typeof A!="string")return A===0?A:+A;A=iNt(A);var t=gNt.test(A);return t||aNt.test(A)?sNt(A.slice(2),t?2:8):oNt.test(A)?Z$A:+A}var INt=rNt,CNt=Md,eEA=J2t,W$A=INt,lNt="Expected a function",cNt=Math.max,BNt=Math.min;function QNt(A,e,t){var i,n,o,g,a,s,I=0,r=!1,C=!1,l=!0;if(typeof A!="function")throw new TypeError(lNt);e=W$A(e)||0,CNt(t)&&(r=!!t.leading,C="maxWait"in t,o=C?cNt(W$A(t.maxWait)||0,e):o,l="trailing"in t?!!t.trailing:l);function c(R){var x=i,F=n;return i=n=void 0,I=R,g=A.apply(F,x),g}function B(R){return I=R,a=setTimeout(d,e),r?c(R):g}function E(R){var x=R-s,F=R-I,Q=e-x;return C?BNt(Q,o-F):Q}function u(R){var x=R-s,F=R-I;return s===void 0||x>=e||x<0||C&&F>=o}function d(){var R=eEA();if(u(R))return f(R);a=setTimeout(d,E(R))}function f(R){return a=void 0,l&&i?c(R):(i=n=void 0,g)}function w(){a!==void 0&&clearTimeout(a),I=0,i=s=n=a=void 0}function y(){return a===void 0?g:f(eEA())}function G(){var R=eEA(),x=u(R);if(i=arguments,n=this,s=R,x){if(a===void 0)return B(s);if(C)return clearTimeout(a),a=setTimeout(d,e),c(s)}return a===void 0&&(a=setTimeout(d,e)),g}return G.cancel=w,G.flush=y,G}var K$A=QNt;const ENt=xC(K$A);var uNt=K$A,dNt=Md,hNt="Expected a function";function mNt(A,e,t){var i=!0,n=!0;if(typeof A!="function")throw new TypeError(hNt);return dNt(t)&&(i="leading"in t?!!t.leading:i,n="trailing"in t?!!t.trailing:n),uNt(A,e,{leading:i,maxWait:e,trailing:n})}var pNt=mNt;const fNt=xC(pNt);var tEA=function(A,e){return tEA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},tEA(A,e)};function yNt(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");tEA(A,e);function t(){this.constructor=A}A.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var iEA=function(){return iEA=Object.assign||function(A){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(A[n]=e[n])}return A},iEA.apply(this,arguments)};function bNt(A,e){var t={};for(var i in A)Object.prototype.hasOwnProperty.call(A,i)&&e.indexOf(i)<0&&(t[i]=A[i]);if(A!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(A);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(A,i[n])&&(t[i[n]]=A[i[n]]);return t}var U$A=function(A,e,t,i){switch(e){case"debounce":return ENt(A,t,i);case"throttle":return fNt(A,t,i);default:return A}},V$A=function(A){return typeof A=="function"},rS=function(){return typeof window>"u"},X$A=function(A){return A instanceof Element||A instanceof HTMLDocument};(function(A){yNt(e,A);function e(t){var i=A.call(this,t)||this;i.cancelHandler=function(){i.resizeHandler&&i.resizeHandler.cancel&&(i.resizeHandler.cancel(),i.resizeHandler=null)},i.attachObserver=function(){var I=i.props,r=I.targetRef,C=I.observerOptions;if(!rS()){r&&r.current&&(i.targetRef.current=r.current);var l=i.getElement();l&&(i.observableElement&&i.observableElement===l||(i.observableElement=l,i.resizeObserver.observe(l,C)))}},i.getElement=function(){var I=i.props,r=I.querySelector,C=I.targetDomEl;if(rS())return null;if(r)return document.querySelector(r);if(C&&X$A(C))return C;if(i.targetRef&&X$A(i.targetRef.current))return i.targetRef.current;var l=bt.findDOMNode(i);if(!l)return null;var c=i.getRenderType();switch(c){case"renderProp":return l;case"childFunction":return l;case"child":return l;case"childArray":return l;default:return l.parentElement}},i.createResizeHandler=function(I){var r=i.props,C=r.handleWidth,l=C===void 0?!0:C,c=r.handleHeight,B=c===void 0?!0:c,E=r.onResize;if(!(!l&&!B)){var u=function(d){var f=d.width,w=d.height;i.state.width===f&&i.state.height===w||i.state.width===f&&!B||i.state.height===w&&!l||(E==null||E(f,w),i.setState({width:f,height:w}))};I.forEach(function(d){var f=d&&d.contentRect||{},w=f.width,y=f.height,G=!i.skipOnMount&&!rS();G&&u({width:w,height:y}),i.skipOnMount=!1})}},i.getRenderType=function(){var I=i.props,r=I.render,C=I.children;return V$A(r)?"renderProp":V$A(C)?"childFunction":p.isValidElement(C)?"child":Array.isArray(C)?"childArray":"parent"};var n=t.skipOnMount,o=t.refreshMode,g=t.refreshRate,a=g===void 0?1e3:g,s=t.refreshOptions;return i.state={width:void 0,height:void 0},i.sizeRef={current:i.state},i.skipOnMount=n,i.targetRef=p.createRef(),i.observableElement=null,rS()||(i.resizeHandler=U$A(i.createResizeHandler,o,a,s),i.resizeObserver=new window.ResizeObserver(i.resizeHandler)),i}return e.prototype.componentDidMount=function(){this.attachObserver()},e.prototype.componentDidUpdate=function(){this.attachObserver(),this.sizeRef.current=this.state},e.prototype.componentWillUnmount=function(){rS()||(this.observableElement=null,this.resizeObserver.disconnect(),this.cancelHandler())},e.prototype.render=function(){var t=this.props,i=t.render,n=t.children,o=t.nodeType,g=o===void 0?"div":o,a=this.state,s=a.width,I=a.height,r={width:s,height:I,targetRef:this.targetRef},C=this.getRenderType();switch(C){case"renderProp":return i==null?void 0:i(r);case"childFunction":{var l=n;return l==null?void 0:l(r)}case"child":{var c=n;if(c.type&&typeof c.type=="string"){r.targetRef;var B=bNt(r,["targetRef"]);return p.cloneElement(c,B)}return p.cloneElement(c,r)}case"childArray":{var E=n;return E.map(function(u){return!!u&&p.cloneElement(u,r)})}default:return b.createElement(g,null)}},e})(p.PureComponent);function nEA(A){var e=A===void 0?{}:A,t=e.skipOnMount,i=t===void 0?!1:t,n=e.refreshMode,o=e.refreshRate,g=o===void 0?1e3:o,a=e.refreshOptions,s=e.handleWidth,I=s===void 0?!0:s,r=e.handleHeight,C=r===void 0?!0:r,l=e.targetRef,c=e.observerOptions,B=e.onResize,E=p.useRef(i),u=p.useState({width:void 0,height:void 0}),d=u[0],f=u[1],w=p.useState((l==null?void 0:l.current)||null),y=w[0],G=w[1];l&&setTimeout(function(){l.current!==y&&G(l.current)},0);var R=p.useCallback(function(k){k!==y&&G(k)},[y]);R.current=y;var x=p.useCallback(function(k,h){return!(k.width===h.width&&k.height===h.height||k.width===h.width&&!C||k.height===h.height&&!I)},[I,C]),F=p.useCallback(function(k){if(!(!I&&!C)){if(E.current){E.current=!1;return}k.forEach(function(h){var N=(h==null?void 0:h.contentRect)||{},v=N.width,K=N.height;f(function(U){return x(U,{width:v,height:K})?{width:v,height:K}:U})})}},[I,C,E,x]),Q=p.useCallback(U$A(F,n,g,a),[F,n,g,a]);return p.useEffect(function(){var k;return y?(k=new window.ResizeObserver(Q),k.observe(y,c)):(d.width||d.height)&&f({width:void 0,height:void 0}),function(){var h,N,v;(h=k==null?void 0:k.disconnect)===null||h===void 0||h.call(k),(v=(N=Q).cancel)===null||v===void 0||v.call(N)}},[Q,y]),p.useEffect(function(){B==null||B(d.width,d.height)},[d]),iEA({ref:R},d)}lo("formatBin",(A,e)=>{const t=e?Ec(e):a=>a;if(!Array.isArray(A))return t(A);const[i,n]=A,o=n-i;if(o===0)return`[${t(i)},${t(n)}]`;const g=Math.max(-Math.round(Math.log10(o))+2,0);return`[${t(Number(i.toFixed(g)))},${t(Number(n.toFixed(g)))}]`});const wNt=an.div`
    display: grid;
    grid-template-columns: repeat(${A=>A.colSize}, auto);
    grid-template-rows: repeat(${A=>A.rowSize}, 1fr);
`;function z$A(A){if(A instanceof HTMLCanvasElement)return{width:parseInt(A.style.width||`${A.width}`),height:parseInt(A.style.height||`${A.height}`),renderWidth:A.width,renderHeight:A.height};if(A instanceof SVGSVGElement){const e=A.width.baseVal.value,t=A.height.baseVal.value;return{width:e,height:t,renderWidth:0,renderHeight:0}}}const T$A="geom",oEA=new z2,gEA=new z2,DNt=gEA.pipe(s2t(oEA),o2t(([A,e])=>Object.keys(A).length>0)),_$A="__gw_brush__",O$A="__gw_point__",_2=A=>Math.max(A,1),GNt=p.forwardRef(function(A,e){const{name:t,dataSource:i=[],rows:n=[],columns:o=[],defaultAggregate:g=!0,stack:a="stack",geomType:s,color:I,opacity:r,size:C,theta:l,radius:c,shape:B,text:E,onGeomClick:u,showActions:d,interactiveScale:f,layoutMode:w,width:y,height:G,details:R=[],vegaConfig:x,locale:F="en-US",useSvg:Q,scales:k,scale:h,displayOffset:N}=A,[v,K]=p.useState([]),U=p.useContext(sQ),V=p.useMemo(()=>{const mA=k??{};if(h)for(const LA of Object.keys(h))mA[LA]={...mA[LA]??{},...h[LA]};return mA},[k,h]);p.useEffect(()=>{const mA=DNt.subscribe(([LA,UA])=>{u&&u(LA,UA)});return()=>{mA.unsubscribe()}},[u]);const X=p.useMemo(()=>n.filter(mA=>g||mA.aggName!=="expr"),[n,g]),_=p.useMemo(()=>o.filter(mA=>g||mA.aggName!=="expr"),[o,g]),q=p.useMemo(()=>X.filter(mA=>mA.analyticType==="dimension"),[X]),$=p.useMemo(()=>_.filter(mA=>mA.analyticType==="dimension"),[_]),nA=p.useMemo(()=>X.filter(mA=>mA.analyticType==="measure"),[X]),j=p.useMemo(()=>_.filter(mA=>mA.analyticType==="measure"),[_]),O=p.useMemo(()=>nA.length===0?q.slice(-1):nA,[q,nA]),eA=p.useMemo(()=>j.length===0?$.slice(-1):j,[$,j]),{reportError:oA}=w4(),[tA,sA]=p.useState(-1);p.useEffect(()=>{sA(-1),K(mA=>{const LA=Math.max(1,_2(O.length)*_2(eA.length));return LA===mA.length?mA:new Array(LA).fill(null).map((UA,ne)=>mA[ne]||b.createRef())})},[O,eA]);const gA=p.useRef([]),iA=p.useRef([]),{width:aA,height:lA,ref:CA}=nEA(),QA=()=>w==="auto"?{width:0,height:0}:w==="full"&&aA&&lA?{width:aA,height:lA}:{width:y,height:G},{width:uA,height:fA}=QA(),hA=p.useMemo(()=>unA({columns:_,dataSource:i,defaultAggregated:g,geomType:s,height:fA,interactiveScale:f,layoutMode:w,mediaTheme:U,rows:X,stack:a,width:uA,scales:V,color:I,details:R,opacity:r,radius:c,shape:B,size:C,text:E,theta:l,vegaConfig:x,displayOffset:N}),[_,i,g,s,f,w,U,X,a,V,I,R,r,c,B,C,E,l,N,uA,fA]);p.useEffect(()=>{var mA;if((mA=A.onReportSpec)==null||mA.call(A,JSON.stringify(hA.map(LA=>({...LA,data:void 0})),void 0,4)),gA.current=[],iA.current=[],O.length<=1&&eA.length<=1){if(v.length>0&&v[0].current){const LA=U2(v[0].current,hA[0],{renderer:Q?"svg":"canvas",mode:"vega-lite",actions:d,timeFormatLocale:J$A(F),config:x,tooltip:{theme:U}}).then(UA=>{const ne=UA.view.container(),SA=(ne==null?void 0:ne.querySelector("canvas"))??(ne==null?void 0:ne.querySelector("svg"))??null,ae=SA?z$A(SA):null;if(ViA(()=>{w!=="auto"||Q||ae&&PQA.test({width:ae.renderWidth||1,height:ae.renderHeight||1})||oA(SA?"canvas exceed max size":"canvas not found",$QA.canvasExceedSize)}),w!=="auto"&&ae){const EA={width:Math.max(ae.width-(aA||y),0),height:Math.max(ae.height-(lA||G),0)};if(UA.view.width()===0)try{UA.view.signal("child_width",hA[0].width-EA.width/Math.round((aA||y)/hA[0].width)),UA.view.signal("child_height",hA[0].height-EA.height/Math.round((lA||G)/hA[0].height))}catch{}else UA.view.width(hA[0].width-EA.width),UA.view.height(hA[0].height-EA.height);UA.view.runAsync()}gA.current=[{w:(ne==null?void 0:ne.clientWidth)??UA.view.width(),h:(ne==null?void 0:ne.clientHeight)??UA.view.height(),innerWidth:(SA==null?void 0:SA.clientWidth)??UA.view.width(),innerHeight:(SA==null?void 0:SA.clientHeight)??UA.view.height(),x:0,y:0,view:UA.view,canvas:SA}];try{UA.view.addEventListener("click",EA=>{oEA.next(EA)}),s!=="boxplot"&&UA.view.addSignalListener(T$A,(EA,wA)=>{gEA.next(wA)})}catch(EA){console.warn(EA)}});iA.current=[LA]}}else{let LA=0;gA.current=new Array(O.length*eA.length);const UA=new z2,ne=UA.pipe(a2t(i.length/64*O.length*eA.length,void 0,{leading:!1,trailing:!0})),SA=[],ae=EA=>{SA.push(ne.subscribe(EA))};for(let EA=0;EA<_2(O.length);EA++)for(let wA=0;wA<_2(eA.length);wA++,LA++){const se=LA,we=EA*_2(eA.length)+wA<v.length?v[EA*_2(eA.length)+wA].current:null,be=hA[LA];if(we){const Oe=LA,VA=U2(we,be,{renderer:Q?"svg":"canvas",mode:"vega-lite",actions:d,timeFormatLocale:J$A(F),config:x,tooltip:{theme:U}}).then(ZA=>{var le;const ce=ZA.view.container(),de=(ce==null?void 0:ce.querySelector("canvas"))??(ce==null?void 0:ce.querySelector("svg"))??null,rt=de?z$A(de):null;if(ViA(()=>{w!=="auto"||Q||rt&&PQA.test({width:rt.renderWidth||1,height:rt.renderHeight||1})||oA(de?"canvas exceed max size":"canvas not found",$QA.canvasExceedSize)}),w!=="auto"&&rt){const Ot={width:Math.max(rt.width-(aA||y)/eA.length,0),height:Math.max(rt.height-(lA||G)/O.length,0)};ZA.view.width()===0?ZA.view.signal("child_width")!==void 0&&(ZA.view.signal("child_width",hA[0].width-Ot.width/Math.round((aA||y)/eA.length/hA[0].width)),ZA.view.signal("child_height",hA[0].height-Ot.height/Math.round((lA||G)/O.length/hA[0].height))):(ZA.view.width(hA[0].width-Ot.width),ZA.view.height(hA[0].height-Ot.height)),ZA.view.runAsync()}gA.current[Oe]={w:(ce==null?void 0:ce.clientWidth)??ZA.view.width(),h:(ce==null?void 0:ce.clientHeight)??ZA.view.height(),innerWidth:(de==null?void 0:de.clientWidth)??ZA.view.width(),innerHeight:(de==null?void 0:de.clientHeight)??ZA.view.height(),x:wA,y:EA,view:ZA.view,canvas:de};const en=(((le=ZA.vgSpec.data)==null?void 0:le.map(Ot=>Ot.name))??[]).filter(Ot=>[_$A,O$A].map(og=>`${og}_store`).includes(Ot)).map(Ot=>Ot.replace(/_store$/,""));try{for(const Ot of en){let og=!1;ZA.view.addSignalListener(Ot,Oa=>{var hh;if(og){og=!1;return}if([_$A,O$A].includes(Oa)){const Ss=(hh=ZA.view.getState().data)==null?void 0:hh[`${Oa}_store`];(!Ss||Array.isArray(Ss)&&Ss.length===0)&&sA(-1),UA.next({signal:Oa,source:se,data:Ss??null})}}),ae(Oa=>{Oa.source===se||!Oa.data||(og=!0,ZA.view.setState({data:{[`${Oa.signal}_store`]:Oa.data}}))})}}catch(Ot){console.warn("Crossing filter failed",Ot)}try{ZA.view.addEventListener("mouseover",()=>{se!==tA&&sA(se)}),ZA.view.addEventListener("click",Ot=>{oEA.next(Ot)}),s!=="boxplot"&&ZA.view.addSignalListener(T$A,(Ot,og)=>{gEA.next(og)})}catch(Ot){console.warn(Ot)}});iA.current.push(VA)}}return()=>{var EA;SA.forEach(wA=>wA.unsubscribe()),(EA=A.onReportSpec)==null||EA.call(A,"")}}return()=>{var LA;gA.current=[],iA.current=[],(LA=A.onReportSpec)==null||LA.call(A,"")}},[hA,v,d,x,Q,F]);const yA=p.useRef(null);return r2t(t,gA,e,iA,yA),b.createElement("div",{className:w==="auto"?"w-fit h-fit relative":"w-full h-full relative",style:{overflow:w==="auto"?"visible":"hidden"}},b.createElement("div",{ref:CA,className:"inset-0 absolute"}),b.createElement(wNt,{style:{...w==="auto"?{}:{width:"100%",height:"100%"}},rowSize:Math.max(O.length,1),colSize:Math.max(eA.length,1),ref:yA},v.map((mA,LA)=>b.createElement("div",{key:LA,ref:mA,className:w==="auto"?"":"overflow-hidden"}))))}),kNt=GNt;function JNt(A){return A}var aEA=1,sEA=2,rEA=3,G4=4,q$A=1e-6;function NNt(A){return"translate("+A+",0)"}function YNt(A){return"translate(0,"+A+")"}function RNt(A){return e=>+A(e)}function xNt(A,e){return e=Math.max(0,A.bandwidth()-e*2)/2,A.round()&&(e=Math.round(e)),t=>+A(t)+e}function FNt(){return!this.__axis}function MNt(A,e){var t=[],i=null,n=null,o=6,g=6,a=3,s=typeof window<"u"&&window.devicePixelRatio>1?0:.5,I=A===aEA||A===G4?-1:1,r=A===G4||A===sEA?"x":"y",C=A===aEA||A===rEA?NNt:YNt;function l(c){var B=i??(e.ticks?e.ticks.apply(e,t):e.domain()),E=n??(e.tickFormat?e.tickFormat.apply(e,t):JNt),u=Math.max(o,0)+a,d=e.range(),f=+d[0]+s,w=+d[d.length-1]+s,y=(e.bandwidth?xNt:RNt)(e.copy(),s),G=c.selection?c.selection():c,R=G.selectAll(".domain").data([null]),x=G.selectAll(".tick").data(B,e).order(),F=x.exit(),Q=x.enter().append("g").attr("class","tick"),k=x.select("line"),h=x.select("text");R=R.merge(R.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(Q),k=k.merge(Q.append("line").attr("stroke","currentColor").attr(r+"2",I*o)),h=h.merge(Q.append("text").attr("fill","currentColor").attr(r,I*u).attr("dy",A===aEA?"0em":A===rEA?"0.71em":"0.32em")),c!==G&&(R=R.transition(c),x=x.transition(c),k=k.transition(c),h=h.transition(c),F=F.transition(c).attr("opacity",q$A).attr("transform",function(N){return isFinite(N=y(N))?C(N+s):this.getAttribute("transform")}),Q.attr("opacity",q$A).attr("transform",function(N){var v=this.parentNode.__axis;return C((v&&isFinite(v=v(N))?v:y(N))+s)})),F.remove(),R.attr("d",A===G4||A===sEA?g?"M"+I*g+","+f+"H"+s+"V"+w+"H"+I*g:"M"+s+","+f+"V"+w:g?"M"+f+","+I*g+"V"+s+"H"+w+"V"+I*g:"M"+f+","+s+"H"+w),x.attr("opacity",1).attr("transform",function(N){return C(y(N)+s)}),k.attr(r+"2",I*o),h.attr(r,I*u).text(E),G.filter(FNt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",A===sEA?"start":A===G4?"end":"middle"),G.each(function(){this.__axis=y})}return l.scale=function(c){return arguments.length?(e=c,l):e},l.ticks=function(){return t=Array.from(arguments),l},l.tickArguments=function(c){return arguments.length?(t=c==null?[]:Array.from(c),l):t.slice()},l.tickValues=function(c){return arguments.length?(i=c==null?null:Array.from(c),l):i&&i.slice()},l.tickFormat=function(c){return arguments.length?(n=c,l):n},l.tickSize=function(c){return arguments.length?(o=g=+c,l):o},l.tickSizeInner=function(c){return arguments.length?(o=+c,l):o},l.tickSizeOuter=function(c){return arguments.length?(g=+c,l):g},l.tickPadding=function(c){return arguments.length?(a=+c,l):a},l.offset=function(c){return arguments.length?(s=+c,l):s},l}function vNt(A){return MNt(rEA,A)}var IEA="http://www.w3.org/1999/xhtml";const O2={svg:"http://www.w3.org/2000/svg",xhtml:IEA,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function k4(A){var e=A+="",t=e.indexOf(":");return t>=0&&(e=A.slice(0,t))!=="xmlns"&&(A=A.slice(t+1)),O2.hasOwnProperty(e)?{space:O2[e],local:A}:A}function LNt(A){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===IEA&&e.documentElement.namespaceURI===IEA?e.createElement(A):e.createElementNS(t,A)}}function SNt(A){return function(){return this.ownerDocument.createElementNS(A.space,A.local)}}function J4(A){var e=k4(A);return(e.local?SNt:LNt)(e)}function HNt(){}function CEA(A){return A==null?HNt:function(){return this.querySelector(A)}}function ZNt(A){typeof A!="function"&&(A=CEA(A));for(var e=this._groups,t=e.length,i=new Array(t),n=0;n<t;++n)for(var o=e[n],g=o.length,a=i[n]=new Array(g),s,I,r=0;r<g;++r)(s=o[r])&&(I=A.call(s,s.__data__,r,o))&&("__data__"in s&&(I.__data__=s.__data__),a[r]=I);return new LI(i,this._parents)}function WNt(A){return A==null?[]:Array.isArray(A)?A:Array.from(A)}function KNt(){return[]}function j$A(A){return A==null?KNt:function(){return this.querySelectorAll(A)}}function UNt(A){return function(){return WNt(A.apply(this,arguments))}}function VNt(A){typeof A=="function"?A=UNt(A):A=j$A(A);for(var e=this._groups,t=e.length,i=[],n=[],o=0;o<t;++o)for(var g=e[o],a=g.length,s,I=0;I<a;++I)(s=g[I])&&(i.push(A.call(s,s.__data__,I,g)),n.push(s));return new LI(i,n)}function P$A(A){return function(){return this.matches(A)}}function $$A(A){return function(e){return e.matches(A)}}var XNt=Array.prototype.find;function zNt(A){return function(){return XNt.call(this.children,A)}}function TNt(){return this.firstElementChild}function _Nt(A){return this.select(A==null?TNt:zNt(typeof A=="function"?A:$$A(A)))}var ONt=Array.prototype.filter;function qNt(){return Array.from(this.children)}function jNt(A){return function(){return ONt.call(this.children,A)}}function PNt(A){return this.selectAll(A==null?qNt:jNt(typeof A=="function"?A:$$A(A)))}function $Nt(A){typeof A!="function"&&(A=P$A(A));for(var e=this._groups,t=e.length,i=new Array(t),n=0;n<t;++n)for(var o=e[n],g=o.length,a=i[n]=[],s,I=0;I<g;++I)(s=o[I])&&A.call(s,s.__data__,I,o)&&a.push(s);return new LI(i,this._parents)}function AAe(A){return new Array(A.length)}function AYt(){return new LI(this._enter||this._groups.map(AAe),this._parents)}function N4(A,e){this.ownerDocument=A.ownerDocument,this.namespaceURI=A.namespaceURI,this._next=null,this._parent=A,this.__data__=e}N4.prototype={constructor:N4,appendChild:function(A){return this._parent.insertBefore(A,this._next)},insertBefore:function(A,e){return this._parent.insertBefore(A,e)},querySelector:function(A){return this._parent.querySelector(A)},querySelectorAll:function(A){return this._parent.querySelectorAll(A)}};function eYt(A){return function(){return A}}function tYt(A,e,t,i,n,o){for(var g=0,a,s=e.length,I=o.length;g<I;++g)(a=e[g])?(a.__data__=o[g],i[g]=a):t[g]=new N4(A,o[g]);for(;g<s;++g)(a=e[g])&&(n[g]=a)}function iYt(A,e,t,i,n,o,g){var a,s,I=new Map,r=e.length,C=o.length,l=new Array(r),c;for(a=0;a<r;++a)(s=e[a])&&(l[a]=c=g.call(s,s.__data__,a,e)+"",I.has(c)?n[a]=s:I.set(c,s));for(a=0;a<C;++a)c=g.call(A,o[a],a,o)+"",(s=I.get(c))?(i[a]=s,s.__data__=o[a],I.delete(c)):t[a]=new N4(A,o[a]);for(a=0;a<r;++a)(s=e[a])&&I.get(l[a])===s&&(n[a]=s)}function nYt(A){return A.__data__}function oYt(A,e){if(!arguments.length)return Array.from(this,nYt);var t=e?iYt:tYt,i=this._parents,n=this._groups;typeof A!="function"&&(A=eYt(A));for(var o=n.length,g=new Array(o),a=new Array(o),s=new Array(o),I=0;I<o;++I){var r=i[I],C=n[I],l=C.length,c=gYt(A.call(r,r&&r.__data__,I,i)),B=c.length,E=a[I]=new Array(B),u=g[I]=new Array(B),d=s[I]=new Array(l);t(r,C,E,u,d,c,e);for(var f=0,w=0,y,G;f<B;++f)if(y=E[f]){for(f>=w&&(w=f+1);!(G=u[w])&&++w<B;);y._next=G||null}}return g=new LI(g,i),g._enter=a,g._exit=s,g}function gYt(A){return typeof A=="object"&&"length"in A?A:Array.from(A)}function aYt(){return new LI(this._exit||this._groups.map(AAe),this._parents)}function sYt(A,e,t){var i=this.enter(),n=this,o=this.exit();return typeof A=="function"?(i=A(i),i&&(i=i.selection())):i=i.append(A+""),e!=null&&(n=e(n),n&&(n=n.selection())),t==null?o.remove():t(o),i&&n?i.merge(n).order():n}function rYt(A){for(var e=A.selection?A.selection():A,t=this._groups,i=e._groups,n=t.length,o=i.length,g=Math.min(n,o),a=new Array(n),s=0;s<g;++s)for(var I=t[s],r=i[s],C=I.length,l=a[s]=new Array(C),c,B=0;B<C;++B)(c=I[B]||r[B])&&(l[B]=c);for(;s<n;++s)a[s]=t[s];return new LI(a,this._parents)}function IYt(){for(var A=this._groups,e=-1,t=A.length;++e<t;)for(var i=A[e],n=i.length-1,o=i[n],g;--n>=0;)(g=i[n])&&(o&&g.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(g,o),o=g);return this}function CYt(A){A||(A=lYt);function e(C,l){return C&&l?A(C.__data__,l.__data__):!C-!l}for(var t=this._groups,i=t.length,n=new Array(i),o=0;o<i;++o){for(var g=t[o],a=g.length,s=n[o]=new Array(a),I,r=0;r<a;++r)(I=g[r])&&(s[r]=I);s.sort(e)}return new LI(n,this._parents).order()}function lYt(A,e){return A<e?-1:A>e?1:A>=e?0:NaN}function cYt(){var A=arguments[0];return arguments[0]=this,A.apply(null,arguments),this}function BYt(){return Array.from(this)}function QYt(){for(var A=this._groups,e=0,t=A.length;e<t;++e)for(var i=A[e],n=0,o=i.length;n<o;++n){var g=i[n];if(g)return g}return null}function EYt(){let A=0;for(const e of this)++A;return A}function uYt(){return!this.node()}function dYt(A){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var n=e[t],o=0,g=n.length,a;o<g;++o)(a=n[o])&&A.call(a,a.__data__,o,n);return this}function hYt(A){return function(){this.removeAttribute(A)}}function mYt(A){return function(){this.removeAttributeNS(A.space,A.local)}}function pYt(A,e){return function(){this.setAttribute(A,e)}}function fYt(A,e){return function(){this.setAttributeNS(A.space,A.local,e)}}function yYt(A,e){return function(){var t=e.apply(this,arguments);t==null?this.removeAttribute(A):this.setAttribute(A,t)}}function bYt(A,e){return function(){var t=e.apply(this,arguments);t==null?this.removeAttributeNS(A.space,A.local):this.setAttributeNS(A.space,A.local,t)}}function wYt(A,e){var t=k4(A);if(arguments.length<2){var i=this.node();return t.local?i.getAttributeNS(t.space,t.local):i.getAttribute(t)}return this.each((e==null?t.local?mYt:hYt:typeof e=="function"?t.local?bYt:yYt:t.local?fYt:pYt)(t,e))}function eAe(A){return A.ownerDocument&&A.ownerDocument.defaultView||A.document&&A||A.defaultView}function DYt(A){return function(){this.style.removeProperty(A)}}function GYt(A,e,t){return function(){this.style.setProperty(A,e,t)}}function kYt(A,e,t){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(A):this.style.setProperty(A,i,t)}}function JYt(A,e,t){return arguments.length>1?this.each((e==null?DYt:typeof e=="function"?kYt:GYt)(A,e,t??"")):q2(this.node(),A)}function q2(A,e){return A.style.getPropertyValue(e)||eAe(A).getComputedStyle(A,null).getPropertyValue(e)}function NYt(A){return function(){delete this[A]}}function YYt(A,e){return function(){this[A]=e}}function RYt(A,e){return function(){var t=e.apply(this,arguments);t==null?delete this[A]:this[A]=t}}function xYt(A,e){return arguments.length>1?this.each((e==null?NYt:typeof e=="function"?RYt:YYt)(A,e)):this.node()[A]}function tAe(A){return A.trim().split(/^|\s+/)}function lEA(A){return A.classList||new iAe(A)}function iAe(A){this._node=A,this._names=tAe(A.getAttribute("class")||"")}iAe.prototype={add:function(A){var e=this._names.indexOf(A);e<0&&(this._names.push(A),this._node.setAttribute("class",this._names.join(" ")))},remove:function(A){var e=this._names.indexOf(A);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(A){return this._names.indexOf(A)>=0}};function nAe(A,e){for(var t=lEA(A),i=-1,n=e.length;++i<n;)t.add(e[i])}function oAe(A,e){for(var t=lEA(A),i=-1,n=e.length;++i<n;)t.remove(e[i])}function FYt(A){return function(){nAe(this,A)}}function MYt(A){return function(){oAe(this,A)}}function vYt(A,e){return function(){(e.apply(this,arguments)?nAe:oAe)(this,A)}}function LYt(A,e){var t=tAe(A+"");if(arguments.length<2){for(var i=lEA(this.node()),n=-1,o=t.length;++n<o;)if(!i.contains(t[n]))return!1;return!0}return this.each((typeof e=="function"?vYt:e?FYt:MYt)(t,e))}function SYt(){this.textContent=""}function HYt(A){return function(){this.textContent=A}}function ZYt(A){return function(){var e=A.apply(this,arguments);this.textContent=e??""}}function WYt(A){return arguments.length?this.each(A==null?SYt:(typeof A=="function"?ZYt:HYt)(A)):this.node().textContent}function KYt(){this.innerHTML=""}function UYt(A){return function(){this.innerHTML=A}}function VYt(A){return function(){var e=A.apply(this,arguments);this.innerHTML=e??""}}function XYt(A){return arguments.length?this.each(A==null?KYt:(typeof A=="function"?VYt:UYt)(A)):this.node().innerHTML}function zYt(){this.nextSibling&&this.parentNode.appendChild(this)}function TYt(){return this.each(zYt)}function _Yt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function OYt(){return this.each(_Yt)}function qYt(A){var e=typeof A=="function"?A:J4(A);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function jYt(){return null}function PYt(A,e){var t=typeof A=="function"?A:J4(A),i=e==null?jYt:typeof e=="function"?e:CEA(e);return this.select(function(){return this.insertBefore(t.apply(this,arguments),i.apply(this,arguments)||null)})}function $Yt(){var A=this.parentNode;A&&A.removeChild(this)}function ARt(){return this.each($Yt)}function eRt(){var A=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(A,this.nextSibling):A}function tRt(){var A=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(A,this.nextSibling):A}function iRt(A){return this.select(A?tRt:eRt)}function nRt(A){return arguments.length?this.property("__data__",A):this.node().__data__}function oRt(A){return function(e){A.call(this,e,this.__data__)}}function gRt(A){return A.trim().split(/^|\s+/).map(function(e){var t="",i=e.indexOf(".");return i>=0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}})}function aRt(A){return function(){var e=this.__on;if(e){for(var t=0,i=-1,n=e.length,o;t<n;++t)o=e[t],(!A.type||o.type===A.type)&&o.name===A.name?this.removeEventListener(o.type,o.listener,o.options):e[++i]=o;++i?e.length=i:delete this.__on}}}function sRt(A,e,t){return function(){var i=this.__on,n,o=oRt(e);if(i){for(var g=0,a=i.length;g<a;++g)if((n=i[g]).type===A.type&&n.name===A.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=o,n.options=t),n.value=e;return}}this.addEventListener(A.type,o,t),n={type:A.type,name:A.name,value:e,listener:o,options:t},i?i.push(n):this.__on=[n]}}function rRt(A,e,t){var i=gRt(A+""),n,o=i.length,g;if(arguments.length<2){var a=this.node().__on;if(a){for(var s=0,I=a.length,r;s<I;++s)for(n=0,r=a[s];n<o;++n)if((g=i[n]).type===r.type&&g.name===r.name)return r.value}return}for(a=e?sRt:aRt,n=0;n<o;++n)this.each(a(i[n],e,t));return this}function gAe(A,e,t){var i=eAe(A),n=i.CustomEvent;typeof n=="function"?n=new n(e,t):(n=i.document.createEvent("Event"),t?(n.initEvent(e,t.bubbles,t.cancelable),n.detail=t.detail):n.initEvent(e,!1,!1)),A.dispatchEvent(n)}function IRt(A,e){return function(){return gAe(this,A,e)}}function CRt(A,e){return function(){return gAe(this,A,e.apply(this,arguments))}}function lRt(A,e){return this.each((typeof e=="function"?CRt:IRt)(A,e))}function*cRt(){for(var A=this._groups,e=0,t=A.length;e<t;++e)for(var i=A[e],n=0,o=i.length,g;n<o;++n)(g=i[n])&&(yield g)}var aAe=[null];function LI(A,e){this._groups=A,this._parents=e}function IS(){return new LI([[document.documentElement]],aAe)}function BRt(){return this}LI.prototype=IS.prototype={constructor:LI,select:ZNt,selectAll:VNt,selectChild:_Nt,selectChildren:PNt,filter:$Nt,data:oYt,enter:AYt,exit:aYt,join:sYt,merge:rYt,selection:BRt,order:IYt,sort:CYt,call:cYt,nodes:BYt,node:QYt,size:EYt,empty:uYt,each:dYt,attr:wYt,style:JYt,property:xYt,classed:LYt,text:WYt,html:XYt,raise:TYt,lower:OYt,append:qYt,insert:PYt,remove:ARt,clone:iRt,datum:nRt,on:rRt,dispatch:lRt,[Symbol.iterator]:cRt};function j2(A){return typeof A=="string"?new LI([[document.querySelector(A)]],[document.documentElement]):new LI([[A]],aAe)}function QRt(A){let e;for(;e=A.sourceEvent;)A=e;return A}function ERt(A,e){if(A=QRt(A),e===void 0&&(e=A.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var i=t.createSVGPoint();return i.x=A.clientX,i.y=A.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var n=e.getBoundingClientRect();return[A.clientX-n.left-e.clientLeft,A.clientY-n.top-e.clientTop]}}return[A.pageX,A.pageY]}var uRt=DCA("start","end","cancel","interrupt"),dRt=[],sAe=0,rAe=1,cEA=2,Y4=3,IAe=4,BEA=5,R4=6;function x4(A,e,t,i,n,o){var g=A.__transition;if(!g)A.__transition={};else if(t in g)return;hRt(A,t,{name:e,index:i,group:n,on:uRt,tween:dRt,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:sAe})}function QEA(A,e){var t=$c(A,e);if(t.state>sAe)throw new Error("too late; already scheduled");return t}function jQ(A,e){var t=$c(A,e);if(t.state>Y4)throw new Error("too late; already running");return t}function $c(A,e){var t=A.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function hRt(A,e,t){var i=A.__transition,n;i[e]=t,t.timer=GCA(o,0,t.time);function o(I){t.state=rAe,t.timer.restart(g,t.delay,t.time),t.delay<=I&&g(I-t.delay)}function g(I){var r,C,l,c;if(t.state!==rAe)return s();for(r in i)if(c=i[r],c.name===t.name){if(c.state===Y4)return i4A(g);c.state===IAe?(c.state=R4,c.timer.stop(),c.on.call("interrupt",A,A.__data__,c.index,c.group),delete i[r]):+r<e&&(c.state=R4,c.timer.stop(),c.on.call("cancel",A,A.__data__,c.index,c.group),delete i[r])}if(i4A(function(){t.state===Y4&&(t.state=IAe,t.timer.restart(a,t.delay,t.time),a(I))}),t.state=cEA,t.on.call("start",A,A.__data__,t.index,t.group),t.state===cEA){for(t.state=Y4,n=new Array(l=t.tween.length),r=0,C=-1;r<l;++r)(c=t.tween[r].value.call(A,A.__data__,t.index,t.group))&&(n[++C]=c);n.length=C+1}}function a(I){for(var r=I<t.duration?t.ease.call(null,I/t.duration):(t.timer.restart(s),t.state=BEA,1),C=-1,l=n.length;++C<l;)n[C].call(A,r);t.state===BEA&&(t.on.call("end",A,A.__data__,t.index,t.group),s())}function s(){t.state=R4,t.timer.stop(),delete i[e];for(var I in i)return;delete A.__transition}}function mRt(A,e){var t=A.__transition,i,n,o=!0,g;if(t){e=e==null?null:e+"";for(g in t){if((i=t[g]).name!==e){o=!1;continue}n=i.state>cEA&&i.state<BEA,i.state=R4,i.timer.stop(),i.on.call(n?"interrupt":"cancel",A,A.__data__,i.index,i.group),delete t[g]}o&&delete A.__transition}}function pRt(A){return this.each(function(){mRt(this,A)})}function fRt(A,e){var t,i;return function(){var n=jQ(this,A),o=n.tween;if(o!==t){i=t=o;for(var g=0,a=i.length;g<a;++g)if(i[g].name===e){i=i.slice(),i.splice(g,1);break}}n.tween=i}}function yRt(A,e,t){var i,n;if(typeof t!="function")throw new Error;return function(){var o=jQ(this,A),g=o.tween;if(g!==i){n=(i=g).slice();for(var a={name:e,value:t},s=0,I=n.length;s<I;++s)if(n[s].name===e){n[s]=a;break}s===I&&n.push(a)}o.tween=n}}function bRt(A,e){var t=this._id;if(A+="",arguments.length<2){for(var i=$c(this.node(),t).tween,n=0,o=i.length,g;n<o;++n)if((g=i[n]).name===A)return g.value;return null}return this.each((e==null?fRt:yRt)(t,A,e))}function EEA(A,e,t){var i=A._id;return A.each(function(){var n=jQ(this,i);(n.value||(n.value={}))[e]=t.apply(this,arguments)}),function(n){return $c(n,i).value[e]}}function CAe(A,e){var t;return(typeof e=="number"?$g:e instanceof Ty?Ap:(t=Ty(e))?(e=t,Ap):ZgA)(A,e)}function wRt(A){return function(){this.removeAttribute(A)}}function DRt(A){return function(){this.removeAttributeNS(A.space,A.local)}}function GRt(A,e,t){var i,n=t+"",o;return function(){var g=this.getAttribute(A);return g===n?null:g===i?o:o=e(i=g,t)}}function kRt(A,e,t){var i,n=t+"",o;return function(){var g=this.getAttributeNS(A.space,A.local);return g===n?null:g===i?o:o=e(i=g,t)}}function JRt(A,e,t){var i,n,o;return function(){var g,a=t(this),s;return a==null?void this.removeAttribute(A):(g=this.getAttribute(A),s=a+"",g===s?null:g===i&&s===n?o:(n=s,o=e(i=g,a)))}}function NRt(A,e,t){var i,n,o;return function(){var g,a=t(this),s;return a==null?void this.removeAttributeNS(A.space,A.local):(g=this.getAttributeNS(A.space,A.local),s=a+"",g===s?null:g===i&&s===n?o:(n=s,o=e(i=g,a)))}}function YRt(A,e){var t=k4(A),i=t==="transform"?IKA:CAe;return this.attrTween(A,typeof e=="function"?(t.local?NRt:JRt)(t,i,EEA(this,"attr."+A,e)):e==null?(t.local?DRt:wRt)(t):(t.local?kRt:GRt)(t,i,e))}function RRt(A,e){return function(t){this.setAttribute(A,e.call(this,t))}}function xRt(A,e){return function(t){this.setAttributeNS(A.space,A.local,e.call(this,t))}}function FRt(A,e){var t,i;function n(){var o=e.apply(this,arguments);return o!==i&&(t=(i=o)&&xRt(A,o)),t}return n._value=e,n}function MRt(A,e){var t,i;function n(){var o=e.apply(this,arguments);return o!==i&&(t=(i=o)&&RRt(A,o)),t}return n._value=e,n}function vRt(A,e){var t="attr."+A;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;var i=k4(A);return this.tween(t,(i.local?FRt:MRt)(i,e))}function LRt(A,e){return function(){QEA(this,A).delay=+e.apply(this,arguments)}}function SRt(A,e){return e=+e,function(){QEA(this,A).delay=e}}function HRt(A){var e=this._id;return arguments.length?this.each((typeof A=="function"?LRt:SRt)(e,A)):$c(this.node(),e).delay}function ZRt(A,e){return function(){jQ(this,A).duration=+e.apply(this,arguments)}}function WRt(A,e){return e=+e,function(){jQ(this,A).duration=e}}function KRt(A){var e=this._id;return arguments.length?this.each((typeof A=="function"?ZRt:WRt)(e,A)):$c(this.node(),e).duration}function URt(A,e){if(typeof e!="function")throw new Error;return function(){jQ(this,A).ease=e}}function VRt(A){var e=this._id;return arguments.length?this.each(URt(e,A)):$c(this.node(),e).ease}function XRt(A,e){return function(){var t=e.apply(this,arguments);if(typeof t!="function")throw new Error;jQ(this,A).ease=t}}function zRt(A){if(typeof A!="function")throw new Error;return this.each(XRt(this._id,A))}function TRt(A){typeof A!="function"&&(A=P$A(A));for(var e=this._groups,t=e.length,i=new Array(t),n=0;n<t;++n)for(var o=e[n],g=o.length,a=i[n]=[],s,I=0;I<g;++I)(s=o[I])&&A.call(s,s.__data__,I,o)&&a.push(s);return new Ld(i,this._parents,this._name,this._id)}function _Rt(A){if(A._id!==this._id)throw new Error;for(var e=this._groups,t=A._groups,i=e.length,n=t.length,o=Math.min(i,n),g=new Array(i),a=0;a<o;++a)for(var s=e[a],I=t[a],r=s.length,C=g[a]=new Array(r),l,c=0;c<r;++c)(l=s[c]||I[c])&&(C[c]=l);for(;a<i;++a)g[a]=e[a];return new Ld(g,this._parents,this._name,this._id)}function ORt(A){return(A+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||e==="start"})}function qRt(A,e,t){var i,n,o=ORt(e)?QEA:jQ;return function(){var g=o(this,A),a=g.on;a!==i&&(n=(i=a).copy()).on(e,t),g.on=n}}function jRt(A,e){var t=this._id;return arguments.length<2?$c(this.node(),t).on.on(A):this.each(qRt(t,A,e))}function PRt(A){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==A)return;e&&e.removeChild(this)}}function $Rt(){return this.on("end.remove",PRt(this._id))}function A1t(A){var e=this._name,t=this._id;typeof A!="function"&&(A=CEA(A));for(var i=this._groups,n=i.length,o=new Array(n),g=0;g<n;++g)for(var a=i[g],s=a.length,I=o[g]=new Array(s),r,C,l=0;l<s;++l)(r=a[l])&&(C=A.call(r,r.__data__,l,a))&&("__data__"in r&&(C.__data__=r.__data__),I[l]=C,x4(I[l],e,t,l,I,$c(r,t)));return new Ld(o,this._parents,e,t)}function e1t(A){var e=this._name,t=this._id;typeof A!="function"&&(A=j$A(A));for(var i=this._groups,n=i.length,o=[],g=[],a=0;a<n;++a)for(var s=i[a],I=s.length,r,C=0;C<I;++C)if(r=s[C]){for(var l=A.call(r,r.__data__,C,s),c,B=$c(r,t),E=0,u=l.length;E<u;++E)(c=l[E])&&x4(c,e,t,E,l,B);o.push(l),g.push(r)}return new Ld(o,g,e,t)}var t1t=IS.prototype.constructor;function i1t(){return new t1t(this._groups,this._parents)}function n1t(A,e){var t,i,n;return function(){var o=q2(this,A),g=(this.style.removeProperty(A),q2(this,A));return o===g?null:o===t&&g===i?n:n=e(t=o,i=g)}}function lAe(A){return function(){this.style.removeProperty(A)}}function o1t(A,e,t){var i,n=t+"",o;return function(){var g=q2(this,A);return g===n?null:g===i?o:o=e(i=g,t)}}function g1t(A,e,t){var i,n,o;return function(){var g=q2(this,A),a=t(this),s=a+"";return a==null&&(s=a=(this.style.removeProperty(A),q2(this,A))),g===s?null:g===i&&s===n?o:(n=s,o=e(i=g,a))}}function a1t(A,e){var t,i,n,o="style."+e,g="end."+o,a;return function(){var s=jQ(this,A),I=s.on,r=s.value[o]==null?a||(a=lAe(e)):void 0;(I!==t||n!==r)&&(i=(t=I).copy()).on(g,n=r),s.on=i}}function s1t(A,e,t){var i=(A+="")=="transform"?rKA:CAe;return e==null?this.styleTween(A,n1t(A,i)).on("end.style."+A,lAe(A)):typeof e=="function"?this.styleTween(A,g1t(A,i,EEA(this,"style."+A,e))).each(a1t(this._id,A)):this.styleTween(A,o1t(A,i,e),t).on("end.style."+A,null)}function r1t(A,e,t){return function(i){this.style.setProperty(A,e.call(this,i),t)}}function I1t(A,e,t){var i,n;function o(){var g=e.apply(this,arguments);return g!==n&&(i=(n=g)&&r1t(A,g,t)),i}return o._value=e,o}function C1t(A,e,t){var i="style."+(A+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;return this.tween(i,I1t(A,e,t??""))}function l1t(A){return function(){this.textContent=A}}function c1t(A){return function(){var e=A(this);this.textContent=e??""}}function B1t(A){return this.tween("text",typeof A=="function"?c1t(EEA(this,"text",A)):l1t(A==null?"":A+""))}function Q1t(A){return function(e){this.textContent=A.call(this,e)}}function E1t(A){var e,t;function i(){var n=A.apply(this,arguments);return n!==t&&(e=(t=n)&&Q1t(n)),e}return i._value=A,i}function u1t(A){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(A==null)return this.tween(e,null);if(typeof A!="function")throw new Error;return this.tween(e,E1t(A))}function d1t(){for(var A=this._name,e=this._id,t=cAe(),i=this._groups,n=i.length,o=0;o<n;++o)for(var g=i[o],a=g.length,s,I=0;I<a;++I)if(s=g[I]){var r=$c(s,e);x4(s,A,t,I,g,{time:r.time+r.delay+r.duration,delay:0,duration:r.duration,ease:r.ease})}return new Ld(i,this._parents,A,t)}function h1t(){var A,e,t=this,i=t._id,n=t.size();return new Promise(function(o,g){var a={value:g},s={value:function(){--n===0&&o()}};t.each(function(){var I=jQ(this,i),r=I.on;r!==A&&(e=(A=r).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(s)),I.on=e}),n===0&&o()})}var m1t=0;function Ld(A,e,t,i){this._groups=A,this._parents=e,this._name=t,this._id=i}function cAe(){return++m1t}var Sd=IS.prototype;Ld.prototype={constructor:Ld,select:A1t,selectAll:e1t,selectChild:Sd.selectChild,selectChildren:Sd.selectChildren,filter:TRt,merge:_Rt,selection:i1t,transition:d1t,call:Sd.call,nodes:Sd.nodes,node:Sd.node,size:Sd.size,empty:Sd.empty,each:Sd.each,on:jRt,attr:YRt,attrTween:vRt,style:s1t,styleTween:C1t,text:B1t,textTween:u1t,remove:$Rt,tween:bRt,delay:HRt,duration:KRt,ease:VRt,easeVarying:zRt,end:h1t,[Symbol.iterator]:Sd[Symbol.iterator]};function p1t(A){return((A*=2)<=1?A*A*A:(A-=2)*A*A+2)/2}var f1t={time:null,delay:0,duration:250,ease:p1t};function y1t(A,e){for(var t;!(t=A.__transition)||!(t=t[e]);)if(!(A=A.parentNode))throw new Error(`transition ${e} not found`);return t}function b1t(A){var e,t;A instanceof Ld?(e=A._id,A=A._name):(e=cAe(),(t=f1t).time=aT(),A=A==null?null:A+"");for(var i=this._groups,n=i.length,o=0;o<n;++o)for(var g=i[o],a=g.length,s,I=0;I<a;++I)(s=g[I])&&x4(s,A,e,I,g,t||y1t(s,e));return new Ld(i,this._parents,A,e)}IS.prototype.interrupt=pRt,IS.prototype.transition=b1t;var ut=1e-6,BAe=1e-12,Dt=Math.PI,Bo=Dt/2,QAe=Dt/4,SI=Dt*2,bs=180/Dt,Qo=Dt/180,Li=Math.abs,P2=Math.atan,Hd=Math.atan2,yt=Math.cos,EAe=Math.exp,F4=Math.log,uEA=Math.pow,ct=Math.sin,ml=Math.sign||function(A){return A>0?1:A<0?-1:0},fr=Math.sqrt,dEA=Math.tan;function uAe(A){return A>1?0:A<-1?Dt:Math.acos(A)}function pl(A){return A>1?Bo:A<-1?-Bo:Math.asin(A)}function fl(){}function M4(A,e){A&&hAe.hasOwnProperty(A.type)&&hAe[A.type](A,e)}var dAe={Feature:function(A,e){M4(A.geometry,e)},FeatureCollection:function(A,e){for(var t=A.features,i=-1,n=t.length;++i<n;)M4(t[i].geometry,e)}},hAe={Sphere:function(A,e){e.sphere()},Point:function(A,e){A=A.coordinates,e.point(A[0],A[1],A[2])},MultiPoint:function(A,e){for(var t=A.coordinates,i=-1,n=t.length;++i<n;)A=t[i],e.point(A[0],A[1],A[2])},LineString:function(A,e){hEA(A.coordinates,e,0)},MultiLineString:function(A,e){for(var t=A.coordinates,i=-1,n=t.length;++i<n;)hEA(t[i],e,0)},Polygon:function(A,e){mAe(A.coordinates,e)},MultiPolygon:function(A,e){for(var t=A.coordinates,i=-1,n=t.length;++i<n;)mAe(t[i],e)},GeometryCollection:function(A,e){for(var t=A.geometries,i=-1,n=t.length;++i<n;)M4(t[i],e)}};function hEA(A,e,t){var i=-1,n=A.length-t,o;for(e.lineStart();++i<n;)o=A[i],e.point(o[0],o[1],o[2]);e.lineEnd()}function mAe(A,e){var t=-1,i=A.length;for(e.polygonStart();++t<i;)hEA(A[t],e,1);e.polygonEnd()}function dw(A,e){A&&dAe.hasOwnProperty(A.type)?dAe[A.type](A,e):M4(A,e)}function mEA(A){return[Hd(A[1],A[0]),pl(A[2])]}function $2(A){var e=A[0],t=A[1],i=yt(t);return[i*yt(e),i*ct(e),ct(t)]}function v4(A,e){return A[0]*e[0]+A[1]*e[1]+A[2]*e[2]}function L4(A,e){return[A[1]*e[2]-A[2]*e[1],A[2]*e[0]-A[0]*e[2],A[0]*e[1]-A[1]*e[0]]}function pEA(A,e){A[0]+=e[0],A[1]+=e[1],A[2]+=e[2]}function S4(A,e){return[A[0]*e,A[1]*e,A[2]*e]}function fEA(A){var e=fr(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);A[0]/=e,A[1]/=e,A[2]/=e}function yEA(A,e){function t(i,n){return i=A(i,n),e(i[0],i[1])}return A.invert&&e.invert&&(t.invert=function(i,n){return i=e.invert(i,n),i&&A.invert(i[0],i[1])}),t}function bEA(A,e){return Li(A)>Dt&&(A-=Math.round(A/SI)*SI),[A,e]}bEA.invert=bEA;function pAe(A,e,t){return(A%=SI)?e||t?yEA(yAe(A),bAe(e,t)):yAe(A):e||t?bAe(e,t):bEA}function fAe(A){return function(e,t){return e+=A,Li(e)>Dt&&(e-=Math.round(e/SI)*SI),[e,t]}}function yAe(A){var e=fAe(A);return e.invert=fAe(-A),e}function bAe(A,e){var t=yt(A),i=ct(A),n=yt(e),o=ct(e);function g(a,s){var I=yt(s),r=yt(a)*I,C=ct(a)*I,l=ct(s),c=l*t+r*i;return[Hd(C*n-c*o,r*t-l*i),pl(c*n+C*o)]}return g.invert=function(a,s){var I=yt(s),r=yt(a)*I,C=ct(a)*I,l=ct(s),c=l*n-C*o;return[Hd(C*n+l*o,r*t+c*i),pl(c*t-r*i)]},g}function w1t(A){A=pAe(A[0]*Qo,A[1]*Qo,A.length>2?A[2]*Qo:0);function e(t){return t=A(t[0]*Qo,t[1]*Qo),t[0]*=bs,t[1]*=bs,t}return e.invert=function(t){return t=A.invert(t[0]*Qo,t[1]*Qo),t[0]*=bs,t[1]*=bs,t},e}function D1t(A,e,t,i,n,o){if(t){var g=yt(e),a=ct(e),s=i*t;n==null?(n=e+i*SI,o=e-s/2):(n=wAe(g,n),o=wAe(g,o),(i>0?n<o:n>o)&&(n+=i*SI));for(var I,r=n;i>0?r>o:r<o;r-=s)I=mEA([g,-a*yt(r),-a*ct(r)]),A.point(I[0],I[1])}}function wAe(A,e){e=$2(e),e[0]-=A,fEA(e);var t=uAe(-e[1]);return((-e[2]<0?-t:t)+SI-ut)%SI}function DAe(){var A=[],e;return{point:function(t,i,n){e.push([t,i,n])},lineStart:function(){A.push(e=[])},lineEnd:fl,rejoin:function(){A.length>1&&A.push(A.pop().concat(A.shift()))},result:function(){var t=A;return A=[],e=null,t}}}function H4(A,e){return Li(A[0]-e[0])<ut&&Li(A[1]-e[1])<ut}function Z4(A,e,t,i){this.x=A,this.z=e,this.o=t,this.e=i,this.v=!1,this.n=this.p=null}function GAe(A,e,t,i,n){var o=[],g=[],a,s;if(A.forEach(function(B){if(!((E=B.length-1)<=0)){var E,u=B[0],d=B[E],f;if(H4(u,d)){if(!u[2]&&!d[2]){for(n.lineStart(),a=0;a<E;++a)n.point((u=B[a])[0],u[1]);n.lineEnd();return}d[0]+=2*ut}o.push(f=new Z4(u,B,null,!0)),g.push(f.o=new Z4(u,null,f,!1)),o.push(f=new Z4(d,B,null,!1)),g.push(f.o=new Z4(d,null,f,!0))}}),!!o.length){for(g.sort(e),kAe(o),kAe(g),a=0,s=g.length;a<s;++a)g[a].e=t=!t;for(var I=o[0],r,C;;){for(var l=I,c=!0;l.v;)if((l=l.n)===I)return;r=l.z,n.lineStart();do{if(l.v=l.o.v=!0,l.e){if(c)for(a=0,s=r.length;a<s;++a)n.point((C=r[a])[0],C[1]);else i(l.x,l.n.x,1,n);l=l.n}else{if(c)for(r=l.p.z,a=r.length-1;a>=0;--a)n.point((C=r[a])[0],C[1]);else i(l.x,l.p.x,-1,n);l=l.p}l=l.o,r=l.z,c=!c}while(!l.v);n.lineEnd()}}}function kAe(A){if(e=A.length){for(var e,t=0,i=A[0],n;++t<e;)i.n=n=A[t],n.p=i,i=n;i.n=n=A[0],n.p=i}}function wEA(A){return Li(A[0])<=Dt?A[0]:ml(A[0])*((Li(A[0])+Dt)%SI-Dt)}function G1t(A,e){var t=wEA(e),i=e[1],n=ct(i),o=[ct(t),-yt(t),0],g=0,a=0,s=new ao;n===1?i=Bo+ut:n===-1&&(i=-Bo-ut);for(var I=0,r=A.length;I<r;++I)if(l=(C=A[I]).length)for(var C,l,c=C[l-1],B=wEA(c),E=c[1]/2+QAe,u=ct(E),d=yt(E),f=0;f<l;++f,B=y,u=R,d=x,c=w){var w=C[f],y=wEA(w),G=w[1]/2+QAe,R=ct(G),x=yt(G),F=y-B,Q=F>=0?1:-1,k=Q*F,h=k>Dt,N=u*R;if(s.add(Hd(N*Q*ct(k),d*x+N*yt(k))),g+=h?F+Q*SI:F,h^B>=t^y>=t){var v=L4($2(c),$2(w));fEA(v);var K=L4(o,v);fEA(K);var U=(h^F>=0?-1:1)*pl(K[2]);(i>U||i===U&&(v[0]||v[1]))&&(a+=h^F>=0?1:-1)}}return(g<-ut||g<ut&&s<-BAe)^a&1}function JAe(A,e,t,i){return function(n){var o=e(n),g=DAe(),a=e(g),s=!1,I,r,C,l={point:c,lineStart:E,lineEnd:u,polygonStart:function(){l.point=d,l.lineStart=f,l.lineEnd=w,r=[],I=[]},polygonEnd:function(){l.point=c,l.lineStart=E,l.lineEnd=u,r=d9(r);var y=G1t(I,i);r.length?(s||(n.polygonStart(),s=!0),GAe(r,J1t,y,t,n)):y&&(s||(n.polygonStart(),s=!0),n.lineStart(),t(null,null,1,n),n.lineEnd()),s&&(n.polygonEnd(),s=!1),r=I=null},sphere:function(){n.polygonStart(),n.lineStart(),t(null,null,1,n),n.lineEnd(),n.polygonEnd()}};function c(y,G){A(y,G)&&n.point(y,G)}function B(y,G){o.point(y,G)}function E(){l.point=B,o.lineStart()}function u(){l.point=c,o.lineEnd()}function d(y,G){C.push([y,G]),a.point(y,G)}function f(){a.lineStart(),C=[]}function w(){d(C[0][0],C[0][1]),a.lineEnd();var y=a.clean(),G=g.result(),R,x=G.length,F,Q,k;if(C.pop(),I.push(C),C=null,!!x){if(y&1){if(Q=G[0],(F=Q.length-1)>0){for(s||(n.polygonStart(),s=!0),n.lineStart(),R=0;R<F;++R)n.point((k=Q[R])[0],k[1]);n.lineEnd()}return}x>1&&y&2&&G.push(G.pop().concat(G.shift())),r.push(G.filter(k1t))}}return l}}function k1t(A){return A.length>1}function J1t(A,e){return((A=A.x)[0]<0?A[1]-Bo-ut:Bo-A[1])-((e=e.x)[0]<0?e[1]-Bo-ut:Bo-e[1])}const NAe=JAe(function(){return!0},N1t,R1t,[-Dt,-Bo]);function N1t(A){var e=NaN,t=NaN,i=NaN,n;return{lineStart:function(){A.lineStart(),n=1},point:function(o,g){var a=o>0?Dt:-Dt,s=Li(o-e);Li(s-Dt)<ut?(A.point(e,t=(t+g)/2>0?Bo:-Bo),A.point(i,t),A.lineEnd(),A.lineStart(),A.point(a,t),A.point(o,t),n=0):i!==a&&s>=Dt&&(Li(e-i)<ut&&(e-=i*ut),Li(o-a)<ut&&(o-=a*ut),t=Y1t(e,t,o,g),A.point(i,t),A.lineEnd(),A.lineStart(),A.point(a,t),n=0),A.point(e=o,t=g),i=a},lineEnd:function(){A.lineEnd(),e=t=NaN},clean:function(){return 2-n}}}function Y1t(A,e,t,i){var n,o,g=ct(A-t);return Li(g)>ut?P2((ct(e)*(o=yt(i))*ct(t)-ct(i)*(n=yt(e))*ct(A))/(n*o*g)):(e+i)/2}function R1t(A,e,t,i){var n;if(A==null)n=t*Bo,i.point(-Dt,n),i.point(0,n),i.point(Dt,n),i.point(Dt,0),i.point(Dt,-n),i.point(0,-n),i.point(-Dt,-n),i.point(-Dt,0),i.point(-Dt,n);else if(Li(A[0]-e[0])>ut){var o=A[0]<e[0]?Dt:-Dt;n=t*o/2,i.point(-o,n),i.point(0,n),i.point(o,n)}else i.point(e[0],e[1])}function x1t(A){var e=yt(A),t=2*Qo,i=e>0,n=Li(e)>ut;function o(r,C,l,c){D1t(c,A,t,l,r,C)}function g(r,C){return yt(r)*yt(C)>e}function a(r){var C,l,c,B,E;return{lineStart:function(){B=c=!1,E=1},point:function(u,d){var f=[u,d],w,y=g(u,d),G=i?y?0:I(u,d):y?I(u+(u<0?Dt:-Dt),d):0;if(!C&&(B=c=y)&&r.lineStart(),y!==c&&(w=s(C,f),(!w||H4(C,w)||H4(f,w))&&(f[2]=1)),y!==c)E=0,y?(r.lineStart(),w=s(f,C),r.point(w[0],w[1])):(w=s(C,f),r.point(w[0],w[1],2),r.lineEnd()),C=w;else if(n&&C&&i^y){var R;!(G&l)&&(R=s(f,C,!0))&&(E=0,i?(r.lineStart(),r.point(R[0][0],R[0][1]),r.point(R[1][0],R[1][1]),r.lineEnd()):(r.point(R[1][0],R[1][1]),r.lineEnd(),r.lineStart(),r.point(R[0][0],R[0][1],3)))}y&&(!C||!H4(C,f))&&r.point(f[0],f[1]),C=f,c=y,l=G},lineEnd:function(){c&&r.lineEnd(),C=null},clean:function(){return E|(B&&c)<<1}}}function s(r,C,l){var c=$2(r),B=$2(C),E=[1,0,0],u=L4(c,B),d=v4(u,u),f=u[0],w=d-f*f;if(!w)return!l&&r;var y=e*d/w,G=-e*f/w,R=L4(E,u),x=S4(E,y),F=S4(u,G);pEA(x,F);var Q=R,k=v4(x,Q),h=v4(Q,Q),N=k*k-h*(v4(x,x)-1);if(!(N<0)){var v=fr(N),K=S4(Q,(-k-v)/h);if(pEA(K,x),K=mEA(K),!l)return K;var U=r[0],V=C[0],X=r[1],_=C[1],q;V<U&&(q=U,U=V,V=q);var $=V-U,nA=Li($-Dt)<ut,j=nA||$<ut;if(!nA&&_<X&&(q=X,X=_,_=q),j?nA?X+_>0^K[1]<(Li(K[0]-U)<ut?X:_):X<=K[1]&&K[1]<=_:$>Dt^(U<=K[0]&&K[0]<=V)){var O=S4(Q,(-k+v)/h);return pEA(O,x),[K,mEA(O)]}}}function I(r,C){var l=i?A:Dt-A,c=0;return r<-l?c|=1:r>l&&(c|=2),C<-l?c|=4:C>l&&(c|=8),c}return JAe(g,a,o,i?[0,-A]:[-Dt,A-Dt])}function F1t(A,e,t,i,n,o){var g=A[0],a=A[1],s=e[0],I=e[1],r=0,C=1,l=s-g,c=I-a,B;if(B=t-g,!(!l&&B>0)){if(B/=l,l<0){if(B<r)return;B<C&&(C=B)}else if(l>0){if(B>C)return;B>r&&(r=B)}if(B=n-g,!(!l&&B<0)){if(B/=l,l<0){if(B>C)return;B>r&&(r=B)}else if(l>0){if(B<r)return;B<C&&(C=B)}if(B=i-a,!(!c&&B>0)){if(B/=c,c<0){if(B<r)return;B<C&&(C=B)}else if(c>0){if(B>C)return;B>r&&(r=B)}if(B=o-a,!(!c&&B<0)){if(B/=c,c<0){if(B>C)return;B>r&&(r=B)}else if(c>0){if(B<r)return;B<C&&(C=B)}return r>0&&(A[0]=g+r*l,A[1]=a+r*c),C<1&&(e[0]=g+C*l,e[1]=a+C*c),!0}}}}}var CS=1e9,W4=-CS;function YAe(A,e,t,i){function n(I,r){return A<=I&&I<=t&&e<=r&&r<=i}function o(I,r,C,l){var c=0,B=0;if(I==null||(c=g(I,C))!==(B=g(r,C))||s(I,r)<0^C>0)do l.point(c===0||c===3?A:t,c>1?i:e);while((c=(c+C+4)%4)!==B);else l.point(r[0],r[1])}function g(I,r){return Li(I[0]-A)<ut?r>0?0:3:Li(I[0]-t)<ut?r>0?2:1:Li(I[1]-e)<ut?r>0?1:0:r>0?3:2}function a(I,r){return s(I.x,r.x)}function s(I,r){var C=g(I,1),l=g(r,1);return C!==l?C-l:C===0?r[1]-I[1]:C===1?I[0]-r[0]:C===2?I[1]-r[1]:r[0]-I[0]}return function(I){var r=I,C=DAe(),l,c,B,E,u,d,f,w,y,G,R,x={point:F,lineStart:N,lineEnd:v,polygonStart:k,polygonEnd:h};function F(U,V){n(U,V)&&r.point(U,V)}function Q(){for(var U=0,V=0,X=c.length;V<X;++V)for(var _=c[V],q=1,$=_.length,nA=_[0],j,O,eA=nA[0],oA=nA[1];q<$;++q)j=eA,O=oA,nA=_[q],eA=nA[0],oA=nA[1],O<=i?oA>i&&(eA-j)*(i-O)>(oA-O)*(A-j)&&++U:oA<=i&&(eA-j)*(i-O)<(oA-O)*(A-j)&&--U;return U}function k(){r=C,l=[],c=[],R=!0}function h(){var U=Q(),V=R&&U,X=(l=d9(l)).length;(V||X)&&(I.polygonStart(),V&&(I.lineStart(),o(null,null,1,I),I.lineEnd()),X&&GAe(l,a,U,o,I),I.polygonEnd()),r=I,l=c=B=null}function N(){x.point=K,c&&c.push(B=[]),G=!0,y=!1,f=w=NaN}function v(){l&&(K(E,u),d&&y&&C.rejoin(),l.push(C.result())),x.point=F,y&&r.lineEnd()}function K(U,V){var X=n(U,V);if(c&&B.push([U,V]),G)E=U,u=V,d=X,G=!1,X&&(r.lineStart(),r.point(U,V));else if(X&&y)r.point(U,V);else{var _=[f=Math.max(W4,Math.min(CS,f)),w=Math.max(W4,Math.min(CS,w))],q=[U=Math.max(W4,Math.min(CS,U)),V=Math.max(W4,Math.min(CS,V))];F1t(_,q,A,e,t,i)?(y||(r.lineStart(),r.point(_[0],_[1])),r.point(q[0],q[1]),X||r.lineEnd(),R=!1):X&&(r.lineStart(),r.point(U,V),R=!1)}f=U,w=V,y=X}return x}}const DEA=A=>A;var GEA=new ao,kEA=new ao,RAe,xAe,JEA,NEA,g0={point:fl,lineStart:fl,lineEnd:fl,polygonStart:function(){g0.lineStart=M1t,g0.lineEnd=L1t},polygonEnd:function(){g0.lineStart=g0.lineEnd=g0.point=fl,GEA.add(Li(kEA)),kEA=new ao},result:function(){var A=GEA/2;return GEA=new ao,A}};function M1t(){g0.point=v1t}function v1t(A,e){g0.point=FAe,RAe=JEA=A,xAe=NEA=e}function FAe(A,e){kEA.add(NEA*A-JEA*e),JEA=A,NEA=e}function L1t(){FAe(RAe,xAe)}const MAe=g0;var AN=1/0,K4=AN,lS=-AN,U4=lS,S1t={point:H1t,lineStart:fl,lineEnd:fl,polygonStart:fl,polygonEnd:fl,result:function(){var A=[[AN,K4],[lS,U4]];return lS=U4=-(K4=AN=1/0),A}};function H1t(A,e){A<AN&&(AN=A),A>lS&&(lS=A),e<K4&&(K4=e),e>U4&&(U4=e)}const V4=S1t;var YEA=0,REA=0,cS=0,X4=0,z4=0,eN=0,xEA=0,FEA=0,BS=0,vAe,LAe,PQ,$Q,AB={point:hw,lineStart:SAe,lineEnd:HAe,polygonStart:function(){AB.lineStart=K1t,AB.lineEnd=U1t},polygonEnd:function(){AB.point=hw,AB.lineStart=SAe,AB.lineEnd=HAe},result:function(){var A=BS?[xEA/BS,FEA/BS]:eN?[X4/eN,z4/eN]:cS?[YEA/cS,REA/cS]:[NaN,NaN];return YEA=REA=cS=X4=z4=eN=xEA=FEA=BS=0,A}};function hw(A,e){YEA+=A,REA+=e,++cS}function SAe(){AB.point=Z1t}function Z1t(A,e){AB.point=W1t,hw(PQ=A,$Q=e)}function W1t(A,e){var t=A-PQ,i=e-$Q,n=fr(t*t+i*i);X4+=n*(PQ+A)/2,z4+=n*($Q+e)/2,eN+=n,hw(PQ=A,$Q=e)}function HAe(){AB.point=hw}function K1t(){AB.point=V1t}function U1t(){ZAe(vAe,LAe)}function V1t(A,e){AB.point=ZAe,hw(vAe=PQ=A,LAe=$Q=e)}function ZAe(A,e){var t=A-PQ,i=e-$Q,n=fr(t*t+i*i);X4+=n*(PQ+A)/2,z4+=n*($Q+e)/2,eN+=n,n=$Q*A-PQ*e,xEA+=n*(PQ+A),FEA+=n*($Q+e),BS+=n*3,hw(PQ=A,$Q=e)}const WAe=AB;function KAe(A){this._context=A}KAe.prototype={_radius:4.5,pointRadius:function(A){return this._radius=A,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(A,e){switch(this._point){case 0:{this._context.moveTo(A,e),this._point=1;break}case 1:{this._context.lineTo(A,e);break}default:{this._context.moveTo(A+this._radius,e),this._context.arc(A,e,this._radius,0,SI);break}}},result:fl};var MEA=new ao,vEA,UAe,VAe,QS,ES,T4={point:fl,lineStart:function(){T4.point=X1t},lineEnd:function(){vEA&&XAe(UAe,VAe),T4.point=fl},polygonStart:function(){vEA=!0},polygonEnd:function(){vEA=null},result:function(){var A=+MEA;return MEA=new ao,A}};function X1t(A,e){T4.point=XAe,UAe=QS=A,VAe=ES=e}function XAe(A,e){QS-=A,ES-=e,MEA.add(fr(QS*QS+ES*ES)),QS=A,ES=e}const zAe=T4;let TAe,_4,_Ae,OAe;class qAe{constructor(e){this._append=e==null?jAe:z1t(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,t){switch(this._point){case 0:{this._append`M${e},${t}`,this._point=1;break}case 1:{this._append`L${e},${t}`;break}default:{if(this._append`M${e},${t}`,this._radius!==_Ae||this._append!==_4){const i=this._radius,n=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,_Ae=i,_4=this._append,OAe=this._,this._=n}this._+=OAe;break}}}result(){const e=this._;return this._="",e.length?e:null}}function jAe(A){let e=1;this._+=A[0];for(const t=A.length;e<t;++e)this._+=arguments[e]+A[e]}function z1t(A){const e=Math.floor(A);if(!(e>=0))throw new RangeError(`invalid digits: ${A}`);if(e>15)return jAe;if(e!==TAe){const t=10**e;TAe=e,_4=function(i){let n=1;this._+=i[0];for(const o=i.length;n<o;++n)this._+=Math.round(arguments[n]*t)/t+i[n]}}return _4}function O4(A,e){let t=3,i=4.5,n,o;function g(a){return a&&(typeof i=="function"&&o.pointRadius(+i.apply(this,arguments)),dw(a,n(o))),o.result()}return g.area=function(a){return dw(a,n(MAe)),MAe.result()},g.measure=function(a){return dw(a,n(zAe)),zAe.result()},g.bounds=function(a){return dw(a,n(V4)),V4.result()},g.centroid=function(a){return dw(a,n(WAe)),WAe.result()},g.projection=function(a){return arguments.length?(n=a==null?(A=null,DEA):(A=a).stream,g):A},g.context=function(a){return arguments.length?(o=a==null?(e=null,new qAe(t)):new KAe(e=a),typeof i!="function"&&o.pointRadius(i),g):e},g.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(o.pointRadius(+a),+a),g):i},g.digits=function(a){if(!arguments.length)return t;if(a==null)t=null;else{const s=Math.floor(a);if(!(s>=0))throw new RangeError(`invalid digits: ${a}`);t=s}return e===null&&(o=new qAe(t)),g},g.projection(A).digits(t).context(e)}function LEA(A){return{stream:q4(A)}}function q4(A){return function(e){var t=new SEA;for(var i in A)t[i]=A[i];return t.stream=e,t}}function SEA(){}SEA.prototype={constructor:SEA,point:function(A,e){this.stream.point(A,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function HEA(A,e,t){var i=A.clipExtent&&A.clipExtent();return A.scale(150).translate([0,0]),i!=null&&A.clipExtent(null),dw(t,A.stream(V4)),e(V4.result()),i!=null&&A.clipExtent(i),A}function ZEA(A,e,t){return HEA(A,function(i){var n=e[1][0]-e[0][0],o=e[1][1]-e[0][1],g=Math.min(n/(i[1][0]-i[0][0]),o/(i[1][1]-i[0][1])),a=+e[0][0]+(n-g*(i[1][0]+i[0][0]))/2,s=+e[0][1]+(o-g*(i[1][1]+i[0][1]))/2;A.scale(150*g).translate([a,s])},t)}function PAe(A,e,t){return ZEA(A,[[0,0],e],t)}function $Ae(A,e,t){return HEA(A,function(i){var n=+e,o=n/(i[1][0]-i[0][0]),g=(n-o*(i[1][0]+i[0][0]))/2,a=-o*i[0][1];A.scale(150*o).translate([g,a])},t)}function Aee(A,e,t){return HEA(A,function(i){var n=+e,o=n/(i[1][1]-i[0][1]),g=-o*i[0][0],a=(n-o*(i[1][1]+i[0][1]))/2;A.scale(150*o).translate([g,a])},t)}var eee=16,T1t=yt(30*Qo);function tee(A,e){return+e?O1t(A,e):_1t(A)}function _1t(A){return q4({point:function(e,t){e=A(e,t),this.stream.point(e[0],e[1])}})}function O1t(A,e){function t(i,n,o,g,a,s,I,r,C,l,c,B,E,u){var d=I-i,f=r-n,w=d*d+f*f;if(w>4*e&&E--){var y=g+l,G=a+c,R=s+B,x=fr(y*y+G*G+R*R),F=pl(R/=x),Q=Li(Li(R)-1)<ut||Li(o-C)<ut?(o+C)/2:Hd(G,y),k=A(Q,F),h=k[0],N=k[1],v=h-i,K=N-n,U=f*v-d*K;(U*U/w>e||Li((d*v+f*K)/w-.5)>.3||g*l+a*c+s*B<T1t)&&(t(i,n,o,g,a,s,h,N,Q,y/=x,G/=x,R,E,u),u.point(h,N),t(h,N,Q,y,G,R,I,r,C,l,c,B,E,u))}}return function(i){var n,o,g,a,s,I,r,C,l,c,B,E,u={point:d,lineStart:f,lineEnd:y,polygonStart:function(){i.polygonStart(),u.lineStart=G},polygonEnd:function(){i.polygonEnd(),u.lineStart=f}};function d(F,Q){F=A(F,Q),i.point(F[0],F[1])}function f(){C=NaN,u.point=w,i.lineStart()}function w(F,Q){var k=$2([F,Q]),h=A(F,Q);t(C,l,r,c,B,E,C=h[0],l=h[1],r=F,c=k[0],B=k[1],E=k[2],eee,i),i.point(C,l)}function y(){u.point=d,i.lineEnd()}function G(){f(),u.point=R,u.lineEnd=x}function R(F,Q){w(n=F,Q),o=C,g=l,a=c,s=B,I=E,u.point=w}function x(){t(C,l,r,c,B,E,o,g,n,a,s,I,eee,i),u.lineEnd=y,y()}return u}}var q1t=q4({point:function(A,e){this.stream.point(A*Qo,e*Qo)}});function j1t(A){return q4({point:function(e,t){var i=A(e,t);return this.stream.point(i[0],i[1])}})}function P1t(A,e,t,i,n){function o(g,a){return g*=i,a*=n,[e+A*g,t-A*a]}return o.invert=function(g,a){return[(g-e)/A*i,(t-a)/A*n]},o}function iee(A,e,t,i,n,o){if(!o)return P1t(A,e,t,i,n);var g=yt(o),a=ct(o),s=g*A,I=a*A,r=g/A,C=a/A,l=(a*t-g*e)/A,c=(a*e+g*t)/A;function B(E,u){return E*=i,u*=n,[s*E-I*u+e,t-I*E-s*u]}return B.invert=function(E,u){return[i*(r*E-C*u+l),n*(c-C*E-r*u)]},B}function a0(A){return nee(function(){return A})()}function nee(A){var e,t=150,i=480,n=250,o=0,g=0,a=0,s=0,I=0,r,C=0,l=1,c=1,B=null,E=NAe,u=null,d,f,w,y=DEA,G=.5,R,x,F,Q,k;function h(U){return F(U[0]*Qo,U[1]*Qo)}function N(U){return U=F.invert(U[0],U[1]),U&&[U[0]*bs,U[1]*bs]}h.stream=function(U){return Q&&k===U?Q:Q=q1t(j1t(r)(E(R(y(k=U)))))},h.preclip=function(U){return arguments.length?(E=U,B=void 0,K()):E},h.postclip=function(U){return arguments.length?(y=U,u=d=f=w=null,K()):y},h.clipAngle=function(U){return arguments.length?(E=+U?x1t(B=U*Qo):(B=null,NAe),K()):B*bs},h.clipExtent=function(U){return arguments.length?(y=U==null?(u=d=f=w=null,DEA):YAe(u=+U[0][0],d=+U[0][1],f=+U[1][0],w=+U[1][1]),K()):u==null?null:[[u,d],[f,w]]},h.scale=function(U){return arguments.length?(t=+U,v()):t},h.translate=function(U){return arguments.length?(i=+U[0],n=+U[1],v()):[i,n]},h.center=function(U){return arguments.length?(o=U[0]%360*Qo,g=U[1]%360*Qo,v()):[o*bs,g*bs]},h.rotate=function(U){return arguments.length?(a=U[0]%360*Qo,s=U[1]%360*Qo,I=U.length>2?U[2]%360*Qo:0,v()):[a*bs,s*bs,I*bs]},h.angle=function(U){return arguments.length?(C=U%360*Qo,v()):C*bs},h.reflectX=function(U){return arguments.length?(l=U?-1:1,v()):l<0},h.reflectY=function(U){return arguments.length?(c=U?-1:1,v()):c<0},h.precision=function(U){return arguments.length?(R=tee(x,G=U*U),K()):fr(G)},h.fitExtent=function(U,V){return ZEA(h,U,V)},h.fitSize=function(U,V){return PAe(h,U,V)},h.fitWidth=function(U,V){return $Ae(h,U,V)},h.fitHeight=function(U,V){return Aee(h,U,V)};function v(){var U=iee(t,0,0,l,c,C).apply(null,e(o,g)),V=iee(t,i-U[0],n-U[1],l,c,C);return r=pAe(a,s,I),x=yEA(e,V),F=yEA(r,x),R=tee(x,G),K()}function K(){return Q=k=null,h}return function(){return e=A.apply(this,arguments),h.invert=e.invert&&N,v()}}function WEA(A){var e=0,t=Dt/3,i=nee(A),n=i(e,t);return n.parallels=function(o){return arguments.length?i(e=o[0]*Qo,t=o[1]*Qo):[e*bs,t*bs]},n}function $1t(A){var e=yt(A);function t(i,n){return[i*e,ct(n)/e]}return t.invert=function(i,n){return[i/e,pl(n*e)]},t}function Axt(A,e){var t=ct(A),i=(t+ct(e))/2;if(Li(i)<ut)return $1t(A);var n=1+t*(2*i-t),o=fr(n)/i;function g(a,s){var I=fr(n-2*i*ct(s))/i;return[I*ct(a*=i),o-I*yt(a)]}return g.invert=function(a,s){var I=o-s,r=Hd(a,Li(I))*ml(I);return I*i<0&&(r-=Dt*ml(a)*ml(I)),[r/i,pl((n-(a*a+I*I)*i*i)/(2*i))]},g}function j4(){return WEA(Axt).scale(155.424).center([0,33.6442])}function oee(){return j4().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ext(A){var e=A.length;return{point:function(t,i){for(var n=-1;++n<e;)A[n].point(t,i)},sphere:function(){for(var t=-1;++t<e;)A[t].sphere()},lineStart:function(){for(var t=-1;++t<e;)A[t].lineStart()},lineEnd:function(){for(var t=-1;++t<e;)A[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<e;)A[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<e;)A[t].polygonEnd()}}}function txt(){var A,e,t=oee(),i,n=j4().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,g=j4().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,s,I={point:function(l,c){s=[l,c]}};function r(l){var c=l[0],B=l[1];return s=null,i.point(c,B),s||(o.point(c,B),s)||(a.point(c,B),s)}r.invert=function(l){var c=t.scale(),B=t.translate(),E=(l[0]-B[0])/c,u=(l[1]-B[1])/c;return(u>=.12&&u<.234&&E>=-.425&&E<-.214?n:u>=.166&&u<.234&&E>=-.214&&E<-.115?g:t).invert(l)},r.stream=function(l){return A&&e===l?A:A=ext([t.stream(e=l),n.stream(l),g.stream(l)])},r.precision=function(l){return arguments.length?(t.precision(l),n.precision(l),g.precision(l),C()):t.precision()},r.scale=function(l){return arguments.length?(t.scale(l),n.scale(l*.35),g.scale(l),r.translate(t.translate())):t.scale()},r.translate=function(l){if(!arguments.length)return t.translate();var c=t.scale(),B=+l[0],E=+l[1];return i=t.translate(l).clipExtent([[B-.455*c,E-.238*c],[B+.455*c,E+.238*c]]).stream(I),o=n.translate([B-.307*c,E+.201*c]).clipExtent([[B-.425*c+ut,E+.12*c+ut],[B-.214*c-ut,E+.234*c-ut]]).stream(I),a=g.translate([B-.205*c,E+.212*c]).clipExtent([[B-.214*c+ut,E+.166*c+ut],[B-.115*c-ut,E+.234*c-ut]]).stream(I),C()},r.fitExtent=function(l,c){return ZEA(r,l,c)},r.fitSize=function(l,c){return PAe(r,l,c)},r.fitWidth=function(l,c){return $Ae(r,l,c)},r.fitHeight=function(l,c){return Aee(r,l,c)};function C(){return A=e=null,r}return r.scale(1070)}function gee(A){return function(e,t){var i=yt(e),n=yt(t),o=A(i*n);return o===1/0?[2,0]:[o*n*ct(e),o*ct(t)]}}function uS(A){return function(e,t){var i=fr(e*e+t*t),n=A(i),o=ct(n),g=yt(n);return[Hd(e*o,i*g),pl(i&&t*o/i)]}}var aee=gee(function(A){return fr(2/(1+A))});aee.invert=uS(function(A){return 2*pl(A/2)});function ixt(){return a0(aee).scale(124.75).clipAngle(179.999)}var see=gee(function(A){return(A=uAe(A))&&A/ct(A)});see.invert=uS(function(A){return A});function nxt(){return a0(see).scale(79.4188).clipAngle(179.999)}function P4(A,e){return[A,F4(dEA((Bo+e)/2))]}P4.invert=function(A,e){return[A,2*P2(EAe(e))-Bo]};function oxt(){return ree(P4).scale(961/SI)}function ree(A){var e=a0(A),t=e.center,i=e.scale,n=e.translate,o=e.clipExtent,g=null,a,s,I;e.scale=function(C){return arguments.length?(i(C),r()):i()},e.translate=function(C){return arguments.length?(n(C),r()):n()},e.center=function(C){return arguments.length?(t(C),r()):t()},e.clipExtent=function(C){return arguments.length?(C==null?g=a=s=I=null:(g=+C[0][0],a=+C[0][1],s=+C[1][0],I=+C[1][1]),r()):g==null?null:[[g,a],[s,I]]};function r(){var C=Dt*i(),l=e(w1t(e.rotate()).invert([0,0]));return o(g==null?[[l[0]-C,l[1]-C],[l[0]+C,l[1]+C]]:A===P4?[[Math.max(l[0]-C,g),a],[Math.min(l[0]+C,s),I]]:[[g,Math.max(l[1]-C,a)],[s,Math.min(l[1]+C,I)]])}return r()}function $4(A){return dEA((Bo+A)/2)}function gxt(A,e){var t=yt(A),i=A===e?ct(A):F4(t/yt(e))/F4($4(e)/$4(A)),n=t*uEA($4(A),i)/i;if(!i)return P4;function o(g,a){n>0?a<-Bo+ut&&(a=-Bo+ut):a>Bo-ut&&(a=Bo-ut);var s=n/uEA($4(a),i);return[s*ct(i*g),n-s*yt(i*g)]}return o.invert=function(g,a){var s=n-a,I=ml(i)*fr(g*g+s*s),r=Hd(g,Li(s))*ml(s);return s*i<0&&(r-=Dt*ml(g)*ml(s)),[r/i,2*P2(uEA(n/I,1/i))-Bo]},o}function axt(){return WEA(gxt).scale(109.5).parallels([30,30])}function AO(A,e){return[A,e]}AO.invert=AO;function sxt(){return a0(AO).scale(152.63)}function rxt(A,e){var t=yt(A),i=A===e?ct(A):(t-yt(e))/(e-A),n=t/i+A;if(Li(i)<ut)return AO;function o(g,a){var s=n-a,I=i*g;return[s*ct(I),n-s*yt(I)]}return o.invert=function(g,a){var s=n-a,I=Hd(g,Li(s))*ml(s);return s*i<0&&(I-=Dt*ml(g)*ml(s)),[I/i,n-ml(i)*fr(g*g+s*s)]},o}function Ixt(){return WEA(rxt).scale(131.154).center([0,13.9389])}var dS=1.340264,hS=-.081106,mS=893e-6,pS=.003796,eO=fr(3)/2,Cxt=12;function Iee(A,e){var t=pl(eO*ct(e)),i=t*t,n=i*i*i;return[A*yt(t)/(eO*(dS+3*hS*i+n*(7*mS+9*pS*i))),t*(dS+hS*i+n*(mS+pS*i))]}Iee.invert=function(A,e){for(var t=e,i=t*t,n=i*i*i,o=0,g,a,s;o<Cxt&&(a=t*(dS+hS*i+n*(mS+pS*i))-e,s=dS+3*hS*i+n*(7*mS+9*pS*i),t-=g=a/s,i=t*t,n=i*i*i,!(Li(g)<BAe));++o);return[eO*A*(dS+3*hS*i+n*(7*mS+9*pS*i))/yt(t),pl(ct(t)/eO)]};function lxt(){return a0(Iee).scale(177.158)}function Cee(A,e){var t=yt(e),i=yt(A)*t;return[t*ct(A)/i,ct(e)/i]}Cee.invert=uS(P2);function cxt(){return a0(Cee).scale(144.049).clipAngle(60)}function lee(A,e){return[yt(e)*ct(A),ct(e)]}lee.invert=uS(pl);function Bxt(){return a0(lee).scale(249.5).clipAngle(90+ut)}function cee(A,e){var t=yt(e),i=1+yt(A)*t;return[t*ct(A)/i,ct(e)/i]}cee.invert=uS(function(A){return 2*P2(A)});function Qxt(){return a0(cee).scale(250).clipAngle(142)}function Bee(A,e){return[F4(dEA((Bo+e)/2)),-A]}Bee.invert=function(A,e){return[-e,2*P2(EAe(A))-Bo]};function Ext(){var A=ree(Bee),e=A.center,t=A.rotate;return A.center=function(i){return arguments.length?e([-i[1],i[0]]):(i=e(),[i[1],-i[0]])},A.rotate=function(i){return arguments.length?t([i[0],i[1],i.length>2?i[2]+90:90]):(i=t(),[i[0],i[1],i[2]-90])},t([0,0,90]).scale(159.155)}function Bt(A){for(var e=A.length/6|0,t=new Array(e),i=0;i<e;)t[i]="#"+A.slice(i*6,++i*6);return t}const uxt=Bt("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),dxt=Bt("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),hxt=Bt("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),mxt=Bt("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),pxt=Bt("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),fxt=Bt("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),yxt=Bt("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),bxt=Bt("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),wxt=Bt("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Dxt=Bt("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Gxt=Bt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),qi=A=>AKA(A[A.length-1]);var Qee=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Bt);const Eee=qi(Qee);var uee=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Bt);const dee=qi(uee);var hee=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Bt);const mee=qi(hee);var pee=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Bt);const fee=qi(pee);var KEA=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Bt);const tO=qi(KEA);var yee=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Bt);const bee=qi(yee);var UEA=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Bt);const iO=qi(UEA);var wee=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Bt);const Dee=qi(wee);var Gee=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Bt);const kee=qi(Gee);var Jee=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Bt);const Nee=qi(Jee);var Yee=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Bt);const Ree=qi(Yee);var xee=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Bt);const Fee=qi(xee);var Mee=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Bt);const vee=qi(Mee);var Lee=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Bt);const See=qi(Lee);var Hee=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Bt);const Zee=qi(Hee);var Wee=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Bt);const Kee=qi(Wee);var Uee=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Bt);const Vee=qi(Uee);var Xee=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Bt);const zee=qi(Xee);var Tee=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Bt);const _ee=qi(Tee);var Oee=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Bt);const qee=qi(Oee);var jee=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Bt);const Pee=qi(jee);var $ee=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Bt);const Ate=qi($ee);var ete=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Bt);const tte=qi(ete);var ite=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Bt);const nte=qi(ite);var ote=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Bt);const gte=qi(ote);var ate=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Bt);const ste=qi(ate);var rte=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Bt);const Ite=qi(rte);function Cte(A){return A=Math.max(0,Math.min(1,A)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-A*(35.34-A*(2381.73-A*(6402.7-A*(7024.72-A*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+A*(170.73+A*(52.82-A*(131.46-A*(176.58-A*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+A*(442.36-A*(2482.43-A*(6167.24-A*(6614.94-A*2475.67)))))))+")"}const lte=x9(dQ(300,.5,0),dQ(-240,.5,1));var cte=x9(dQ(-100,.75,.35),dQ(80,1.5,.8)),Bte=x9(dQ(260,.75,.35),dQ(80,1.5,.8)),nO=dQ();function Qte(A){(A<0||A>1)&&(A-=Math.floor(A));var e=Math.abs(A-.5);return nO.h=360*A-100,nO.s=1.5-1.5*e,nO.l=.8-.9*e,nO+""}var oO=OC(),kxt=Math.PI/3,Jxt=Math.PI*2/3;function Ete(A){var e;return A=(.5-A)*Math.PI,oO.r=255*(e=Math.sin(A))*e,oO.g=255*(e=Math.sin(A+kxt))*e,oO.b=255*(e=Math.sin(A+Jxt))*e,oO+""}function ute(A){return A=Math.max(0,Math.min(1,A)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+A*(1172.33-A*(10793.56-A*(33300.12-A*(38394.49-A*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+A*(557.33+A*(1225.33-A*(3574.96-A*(1073.77+A*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+A*(3211.1-A*(15327.97-A*(27814-A*(22569.18-A*6838.66)))))))+")"}function gO(A){var e=A.length;return function(t){return A[Math.max(0,Math.min(e-1,Math.floor(t*e)))]}}const dte=gO(Bt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var hte=gO(Bt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),mte=gO(Bt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),pte=gO(Bt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function fS(A,e,t){this.k=A,this.x=e,this.y=t}fS.prototype={constructor:fS,scale:function(A){return A===1?this:new fS(this.k*A,this.x,this.y)},translate:function(A,e){return A===0&e===0?this:new fS(this.k,this.x+this.k*A,this.y+this.k*e)},apply:function(A){return[A[0]*this.k+this.x,A[1]*this.k+this.y]},applyX:function(A){return A*this.k+this.x},applyY:function(A){return A*this.k+this.y},invert:function(A){return[(A[0]-this.x)/this.k,(A[1]-this.y)/this.k]},invertX:function(A){return(A-this.x)/this.k},invertY:function(A){return(A-this.y)/this.k},rescaleX:function(A){return A.copy().domain(A.range().map(this.invertX,this).map(A.invert,A))},rescaleY:function(A){return A.copy().domain(A.range().map(this.invertY,this).map(A.invert,A))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},fS.prototype;function s0(A){return A!=null&&!Number.isNaN(A)}function eB(A,e){return+s0(e)-+s0(A)||Oo(A,e)}function aO(A,e){return+s0(e)-+s0(A)||BM(A,e)}function VEA(A){return A!=null&&`${A}`!=""}function fte(A){return isFinite(A)?A:NaN}function sO(A){return A>0&&isFinite(A)?A:NaN}function XEA(A){return A<0&&isFinite(A)?A:NaN}function Nxt(A,e){if(A instanceof Date||(A=new Date(+A)),isNaN(A))return typeof e=="function"?e(A):e;const t=A.getUTCHours(),i=A.getUTCMinutes(),n=A.getUTCSeconds(),o=A.getUTCMilliseconds();return`${Yxt(A.getUTCFullYear())}-${Zd(A.getUTCMonth()+1,2)}-${Zd(A.getUTCDate(),2)}${t||i||n||o?`T${Zd(t,2)}:${Zd(i,2)}${n||o?`:${Zd(n,2)}${o?`.${Zd(o,3)}`:""}`:""}Z`:""}`}function Yxt(A){return A<0?`-${Zd(-A,6)}`:A>9999?`+${Zd(A,6)}`:Zd(A,4)}function Zd(A,e){return`${A}`.padStart(e,"0")}const Rxt=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function yte(A,e){return Rxt.test(A+="")?new Date(A):typeof e=="function"?e(A):e}function tN(A){if(A==null)return;const e=A[0],t=A[A.length-1];return BM(e,t)}const iN=1e3,r0=iN*60,I0=r0*60,AE=I0*24,eE=AE*7,mw=AE*30,C0=AE*365,zEA=[["millisecond",1],["2 milliseconds",2],["5 milliseconds",5],["10 milliseconds",10],["20 milliseconds",20],["50 milliseconds",50],["100 milliseconds",100],["200 milliseconds",200],["500 milliseconds",500],["second",iN],["5 seconds",5*iN],["15 seconds",15*iN],["30 seconds",30*iN],["minute",r0],["5 minutes",5*r0],["15 minutes",15*r0],["30 minutes",30*r0],["hour",I0],["3 hours",3*I0],["6 hours",6*I0],["12 hours",12*I0],["day",AE],["2 days",2*AE],["week",eE],["2 weeks",2*eE],["month",mw],["3 months",3*mw],["6 months",6*mw],["year",C0],["2 years",2*C0],["5 years",5*C0],["10 years",10*C0],["20 years",20*C0],["50 years",50*C0],["100 years",100*C0]],TEA=new Map([["second",iN],["minute",r0],["hour",I0],["day",AE],["monday",eE],["tuesday",eE],["wednesday",eE],["thursday",eE],["friday",eE],["saturday",eE],["sunday",eE],["week",eE],["month",mw],["year",C0]]),bte=new Map([["second",yI],["minute",aJ],["hour",rJ],["day",pc],["monday",wM],["tuesday",NKA],["wednesday",YKA],["thursday",$y],["friday",RKA],["saturday",xKA],["sunday",ip],["week",ip],["month",tb],["year",PC]]),_EA=new Map([["second",yI],["minute",sJ],["hour",IJ],["day",v9],["monday",DM],["tuesday",FKA],["wednesday",MKA],["thursday",eb],["friday",vKA],["saturday",LKA],["sunday",np],["week",np],["month",ib],["year",$C]]),yS=Symbol("intervalDuration"),rO=Symbol("intervalType");for(const[A,e]of bte)e[yS]=TEA.get(A),e[rO]="time";for(const[A,e]of _EA)e[yS]=TEA.get(A),e[rO]="utc";const bS=[["year",$C,"utc"],["month",ib,"utc"],["day",v9,"utc",6*mw],["hour",IJ,"utc",3*AE],["minute",sJ,"utc",6*I0],["second",yI,"utc",30*r0]],IO=[["year",PC,"time"],["month",tb,"time"],["day",pc,"time",6*mw],["hour",rJ,"time",3*AE],["minute",aJ,"time",6*I0],["second",yI,"time",30*r0]],xxt=[bS[0],IO[0],bS[1],IO[1],bS[2],IO[2],...bS.slice(3)];function wte(A){let e=`${A}`.toLowerCase();e.endsWith("s")&&(e=e.slice(0,-1));let t=1;const i=/^(?:(\d+)\s+)/.exec(e);switch(i&&(e=e.slice(i[0].length),t=+i[1]),e){case"quarter":e="month",t*=3;break;case"half":e="month",t*=6;break}let n=_EA.get(e);if(!n)throw new Error(`unknown interval: ${A}`);if(t>1&&!n.every)throw new Error(`non-periodic interval: ${e}`);return[e,t]}function Dte(A){return Gte(wte(A),"time")}function OEA(A){return Gte(wte(A),"utc")}function Gte([A,e],t){let i=(t==="time"?bte:_EA).get(A);return e>1&&(i=i.every(e),i[yS]=TEA.get(A)*e,i[rO]=t),i}function kte(A,e){if(!(e>1))return;const t=A[yS];if(!zEA.some(([,n])=>n===t)||t%AE===0&&AE<t&&t<mw)return;const[i]=zEA[Vy(([,n])=>Math.log(n)).center(zEA,Math.log(t*e))];return(A[rO]==="time"?Dte:OEA)(i)}function Jte(A,e,t){const i=e==="time"?NM:lJ;if(t==null)return i(A==="year"?"%Y":A==="month"?"%Y-%m":A==="day"?"%Y-%m-%d":A==="hour"||A==="minute"?"%Y-%m-%dT%H:%M":A==="second"?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M:%S.%L");const n=Fxt(t);switch(A){case"millisecond":return nN(i(".%L"),i(":%M:%S"),n);case"second":return nN(i(":%S"),i("%-I:%M"),n);case"minute":return nN(i("%-I:%M"),i("%p"),n);case"hour":return nN(i("%-I %p"),i("%b %-d"),n);case"day":return nN(i("%-d"),i("%b"),n);case"month":return nN(i("%b"),i("%Y"),n);case"year":return i("%Y")}throw new Error("unable to format time ticks")}function Fxt(A){return A==="left"||A==="right"?(e,t)=>`
${e}
${t}`:A==="top"?(e,t)=>`${t}
${e}`:(e,t)=>`${e}
${t}`}function Mxt(A){return A==="time"?IO:A==="utc"?bS:xxt}function vxt(A,e,t){const i=Pg(j8e(e,(n,o)=>Math.abs(o-n)));if(i<1e3)return Jte("millisecond","utc",t);for(const[n,o,g,a]of Mxt(A)){if(i>a||n==="hour"&&!i)break;if(e.every(s=>o.floor(s)>=s))return Jte(n,g,t)}}function nN(A,e,t){return(i,n,o)=>{const g=A(i,n),a=e(i,n),s=n-tN(o);return n!==s&&o[s]!==void 0&&a===e(o[s],s)?g:t(g,a)}}const qEA=Object.getPrototypeOf(Uint8Array),Lxt=Object.prototype.toString;function pw(A){return A instanceof Array||A instanceof qEA}function Nte(A){return A instanceof qEA&&!Sxt(A)}function Yte(A){return(A==null?void 0:A.prototype)instanceof qEA&&!Hxt(A)}function Sxt(A){return A instanceof BigInt64Array||A instanceof BigUint64Array}function Hxt(A){return A===BigInt64Array||A===BigUint64Array}const Rte=Symbol("reindex");function Gn(A,e,t){const i=typeof e;return i==="string"?_te(A)?PEA(A.getChild(e),t):xte(A,Fte(e),t):i==="function"?xte(A,e,t):i==="number"||e instanceof Date||i==="boolean"?So(A,Kd(e),t):typeof(e==null?void 0:e.transform)=="function"?jEA(e.transform(A),t):Zxt(jEA(e,t),A==null?void 0:A[Rte])}function Zxt(A,e){return A!=null&&e?QO(A,e):A}function xte(A,e,t){return So(A,Yte(t)?(i,n)=>AuA(e(i,n)):e,t)}function jEA(A,e){return e===void 0?l0(A):Ote(A)?PEA(A,e):A instanceof e?A:e.from(A,Yte(e)&&!Nte(A)?AuA:void 0)}function PEA(A,e){return A==null?A:(e===void 0||e===Array)&&nFt(A.type)?vte(A.toArray()):jEA(A.toArray(),e)}const CO=[null],Fte=A=>e=>{var t;const i=e[A];return i===void 0&&e.type==="Feature"?(t=e.properties)==null?void 0:t[A]:i},Wd={transform:Vd},Vi={transform:A=>A},Wxt=()=>1,Kxt=()=>!0,ws=A=>A==null?A:`${A}`,Lo=A=>A==null?A:+A,Mte=A=>A?A[0]:void 0,$EA=A=>A?A[1]:void 0,Kd=A=>()=>A;function Uxt(A){const e=+`${A}`.slice(1)/100;return(t,i)=>BQ(t,e,i)}function oN(A){return Nte(A)?A:So(A,AuA,Float64Array)}function AuA(A){return A==null?NaN:Number(A)}function vte(A){return So(A,Lte)}function Lte(A){return A instanceof Date&&!isNaN(A)?A:typeof A=="string"?yte(A):A==null||isNaN(A=Number(A))?void 0:new Date(A)}function tB(A,e){return A===void 0&&(A=e),A===null?[void 0,"none"]:dO(A)?[void 0,A]:[A,void 0]}function Ds(A,e){return A===void 0&&(A=e),A===null||typeof A=="number"?[void 0,A]:[A,void 0]}function Ste(A,e,t){if(A!=null)return iB(A,e,t)}function iB(A,e,t){const i=`${A}`.toLowerCase();if(!t.includes(i))throw new Error(`invalid ${e}: ${A}`);return i}function gN(A){return _te(A)?A:l0(A)}function l0(A){if(A==null||pw(A))return A;if(Ote(A))return PEA(A);switch(A.type){case"FeatureCollection":return A.features;case"GeometryCollection":return A.geometries;case"Feature":case"LineString":case"MultiLineString":case"MultiPoint":case"MultiPolygon":case"Point":case"Polygon":case"Sphere":return[A]}return Array.from(A)}function So(A,e,t=Array){return A==null?A:A instanceof t?A.map(e):t.from(A,e)}function wS(A,e=Array){return A instanceof e?A.slice():e.from(A)}function Hte({x:A,x1:e,x2:t}){return A!==void 0||e!==void 0||t!==void 0}function Zte({y:A,y1:e,y2:t}){return A!==void 0||e!==void 0||t!==void 0}function lO(A){return Hte(A)||Zte(A)||A.interval!==void 0}function Ud(A){return(A==null?void 0:A.toString)===Lxt}function euA(A){return Ud(A)&&(A.type!==void 0||A.domain!==void 0)}function cO(A){return Ud(A)&&typeof A.transform!="function"}function aN(A){return cO(A)&&A.value===void 0&&A.channel===void 0}function Wte(A,e,t,i=Vi){return e===void 0&&t===void 0?(e=0,t=A===void 0?i:A):e===void 0?e=A===void 0?0:A:t===void 0&&(t=A===void 0?0:A),[e,t]}function tuA(A,e){return A===void 0&&e===void 0?[Mte,$EA]:[A,e]}function BO({z:A,fill:e,stroke:t}={}){return A===void 0&&([A]=tB(e)),A===void 0&&([A]=tB(t)),A}function DS(A){return pw(A)?A.length:A==null?void 0:A.numRows}function Vd(A){const e=DS(A),t=new Uint32Array(e);for(let i=0;i<e;++i)t[i]=i;return t}function QO(A,e){return pw(A)?So(e,t=>A[t],A.constructor):So(e,t=>A.at(t))}function Vxt(A){return A.length===1?(e,t)=>A(QO(t,e)):A}function Xxt(A,e,t){return A.subarray?A.subarray(e,t):A.slice(e,t)}function Xd(A){return A!==null&&typeof A=="object"?A.valueOf():A}function Kte(A,e){if(e[A]!==void 0)return e[A];switch(A){case"x1":case"x2":A="x";break;case"y1":case"y2":A="y";break}return e[A]}function GS(A){let e;return[{transform:()=>e,label:fw(A)},t=>e=t]}function yr(A){return A==null?[A]:GS(A)}function fw(A,e){return typeof A=="string"?A:A&&A.label!==void 0?A.label:e}function EO(A,e){return{transform(t){const i=A.transform(t),n=e.transform(t);return br(i)||br(n)?So(i,(o,g)=>new Date((+i[g]+ +n[g])/2)):So(i,(o,g)=>(+i[g]+ +n[g])/2,Float64Array)},label:A.label}}function uO(A,e){const t=Ute(e==null?void 0:e.interval,e==null?void 0:e.type);return t?So(A,t):A}function Ute(A,e){const t=iuA(A,e);return t&&(i=>s0(i)?t.floor(i):i)}function iuA(A,e){if(A!=null){if(typeof A=="number")return zxt(A);if(typeof A=="string")return(e==="time"?Dte:OEA)(A);if(typeof A.floor!="function")throw new Error("invalid interval; missing floor method");if(typeof A.offset!="function")throw new Error("invalid interval; missing offset method");return A}}function zxt(A){A=+A,0<A&&A<1&&Number.isInteger(1/A)&&(A=-1/A);const e=Math.abs(A);return A<0?{floor:t=>Math.floor(t*e)/e,offset:(t,i=1)=>(t*e+Math.floor(i))/e,range:(t,i)=>Ga(Math.ceil(t*e),i*e).map(n=>n/e)}:{floor:t=>Math.floor(t/e)*e,offset:(t,i=1)=>t+e*Math.floor(i),range:(t,i)=>Ga(Math.ceil(t/e),i/e).map(n=>n*e)}}function sN(A,e){if(A=iuA(A,e),A&&typeof A.range!="function")throw new Error("invalid interval: missing range method");return A}function Txt(A,e){if(A=sN(A,e),A&&typeof A.ceil!="function")throw new Error("invalid interval: missing ceil method");return A}function _xt(A){return rN(A)&&typeof(A==null?void 0:A.floor)=="function"&&A.floor()instanceof Date}function rN(A){return typeof(A==null?void 0:A.range)=="function"}function kS(A){return A===void 0||cO(A)?A:{value:A}}function Oxt(A){return A==null?null:{transform:e=>Gn(e,A,Float64Array),label:fw(A)}}function c0(A){return A&&typeof A[Symbol.iterator]=="function"}function Vte(A){for(const e of A)if(e!=null)return typeof e!="object"||e instanceof Date}function Xte(A){for(const e of A){if(e==null)continue;const t=typeof e;return t==="string"||t==="boolean"}}function br(A){for(const e of A)if(e!=null)return e instanceof Date}function qxt(A){for(const e of A)if(e!=null)return typeof e=="string"&&isNaN(e)&&yte(e)}function jxt(A){for(const e of A)if(e!=null){if(typeof e!="string")return!1;if(e.trim())return!isNaN(e)}}function Pxt(A){for(const e of A)if(e!=null)return typeof e=="number"}function nuA(A,e){let t;for(const i of A)if(i!=null){if(!e(i))return!1;t=!0}return t}const $xt=new Set("none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow".split(","));function dO(A){return typeof A!="string"?!1:(A=A.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(A)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.*\)$/.test(A)||$xt.has(A))}function AFt(A){return typeof A=="number"&&(0<=A&&A<=1||isNaN(A))}function wr(A){return A==null||JS(A)}function JS(A){return/^\s*none\s*$/i.test(A)}function eFt(A){return/^\s*round\s*$/i.test(A)}function ouA(A,e){return Ste(A,e,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function hO(A="middle"){return ouA(A,"frameAnchor")}function tFt(A={},...e){let t=A;for(const i of e)for(const n in i)if(t[n]===void 0){const o=i[n];t===A?t={...t,[n]:o}:t[n]=o}return t}function iFt(A){console.warn("named iterables are deprecated; please use an object instead");const e=new Set;return Object.fromEntries(Array.from(A,t=>{const{name:i}=t;if(i==null)throw new Error("missing name");const n=`${i}`;if(n==="__proto__")throw new Error(`illegal name: ${n}`);if(e.has(n))throw new Error(`duplicate name: ${n}`);return e.add(n),[i,t]}))}function zte(A){return c0(A)?iFt(A):A}function Tte(A){return A===!0?A="frame":A===!1?A=null:A!=null&&(A=iB(A,"clip",["frame","sphere"])),A}function _te(A){return A&&typeof A.getChild=="function"&&typeof A.toArray=="function"&&A.schema&&Array.isArray(A.schema.fields)}function Ote(A){return A&&typeof A.toArray=="function"&&A.type}function nFt(A){return A&&(A.typeId===8||A.typeId===10)&&A.unit===1}const tE=Symbol("position"),zd=Symbol("color"),NS=Symbol("radius"),YS=Symbol("length"),RS=Symbol("opacity"),mO=Symbol("symbol"),qte=Symbol("projection"),Eo=new Map([["x",tE],["y",tE],["fx",tE],["fy",tE],["r",NS],["color",zd],["opacity",RS],["symbol",mO],["length",YS],["projection",qte]]);function oFt(A){return A===tE||A===qte}function gFt(A){return A===tE||A===NS||A===YS||A===RS}const aFt=Math.sqrt(3),sFt=2/aFt,rFt={draw(A,e){const t=Math.sqrt(e/Math.PI),i=t*sFt,n=i/2;A.moveTo(0,i),A.lineTo(t,n),A.lineTo(t,-n),A.lineTo(0,-i),A.lineTo(-t,-n),A.lineTo(-t,n),A.closePath()}},guA=new Map([["asterisk",OXA],["circle",kJ],["cross",qXA],["diamond",PXA],["diamond2",$XA],["hexagon",rFt],["plus",A9A],["square",e9A],["square2",t9A],["star",n9A],["times",s9A],["triangle",o9A],["triangle2",g9A],["wye",a9A]]);function auA(A){return A&&typeof A.draw=="function"}function IFt(A){return auA(A)?!0:typeof A!="string"?!1:guA.has(A.toLowerCase())}function suA(A){if(A==null||auA(A))return A;const e=guA.get(`${A}`.toLowerCase());if(e)return e;throw new Error(`invalid symbol: ${A}`)}function CFt(A){if(A==null||auA(A))return[void 0,A];if(typeof A=="string"){const e=guA.get(`${A}`.toLowerCase());if(e)return[void 0,e]}return[A,void 0]}function IN({filter:A,sort:e,reverse:t,transform:i,initializer:n,...o}={},g){if(i===void 0&&(A!=null&&(i=jte(A)),e!=null&&!aN(e)&&(i=ruA(i,CuA(e))),t&&(i=ruA(i,Pte))),g!=null&&n!=null)throw new Error("transforms cannot be applied after initializers");return{...o,...(e===null||aN(e))&&{sort:e},transform:ruA(i,g)}}function CN({filter:A,sort:e,reverse:t,initializer:i,...n}={},o){return i===void 0&&(A!=null&&(i=jte(A)),e!=null&&!aN(e)&&(i=IuA(i,CuA(e))),t&&(i=IuA(i,Pte))),{...n,...(e===null||aN(e))&&{sort:e},initializer:IuA(i,o)}}function ruA(A,e){return A==null?e===null?void 0:e:e==null?A===null?void 0:A:function(t,i,n){return{data:t,facets:i}=A.call(this,t,i,n),e.call(this,gN(t),i,n)}}function IuA(A,e){return A==null?e===null?void 0:e:e==null?A===null?void 0:A:function(t,i,n,...o){let g,a,s,I,r,C;return{data:a=t,facets:s=i,channels:g}=A.call(this,t,i,n,...o),{data:r=a,facets:C=s,channels:I}=e.call(this,a,s,{...n,...g},...o),{data:r,facets:C,channels:{...g,...I}}}}function lFt(A,e){return(A.initializer!=null?CN:IN)(A,e)}function jte(A){return(e,t)=>{const i=Gn(e,A);return{data:e,facets:t.map(n=>n.filter(o=>i[o]))}}}function Pte(A,e){return{data:A,facets:e.map(t=>t.slice().reverse())}}function cFt(A,{sort:e,...t}={}){return{...(cO(A)&&A.channel!==void 0?CN:lFt)(t,CuA(A)),sort:aN(e)?e:null}}function CuA(A){return(typeof A=="function"&&A.length!==1?BFt:QFt)(A)}function BFt(A){return(e,t)=>{const i=pw(e)?(n,o)=>A(e[n],e[o]):(n,o)=>A(e.get(n),e.get(o));return{data:e,facets:t.map(n=>n.slice().sort(i))}}}function QFt(A){let e,t;({channel:e,value:A,order:t}={...kS(A)});const i=e==null?void 0:e.startsWith("-");if(i&&(e=e.slice(1)),t===void 0&&(t=i?aO:eB),typeof t!="function")switch(`${t}`.toLowerCase()){case"ascending":t=eB;break;case"descending":t=aO;break;default:throw new Error(`invalid order: ${t}`)}return(n,o,g)=>{let a;if(e===void 0)a=Gn(n,A);else{if(g===void 0)throw new Error("channel sort requires an initializer");if(a=g[e],!a)return{};a=a.value}const s=(I,r)=>t(a[I],a[r]);return{data:n,facets:o.map(I=>I.slice().sort(s))}}}function $te(A,e){return luA(null,null,A,e)}function EFt(A={y:"count"},e={}){const{x:t=Vi}=e;if(t==null)throw new Error("missing channel: x");return luA(t,null,A,e)}function uFt(A={x:"count"},e={}){const{y:t=Vi}=e;if(t==null)throw new Error("missing channel: y");return luA(null,t,A,e)}function luA(A,e,{data:t=QuA,filter:i,sort:n,reverse:o,...g}={},a={}){g=mFt(g,a),t=iie(t,Vi),n=n==null?void 0:eie("sort",n,a),i=i==null?void 0:tie("filter",i,a);const[s,I]=yr(A),[r,C]=yr(e),{z:l,fill:c,stroke:B,x1:E,x2:u,y1:d,y2:f,...w}=a,[y,G]=yr(l),[R]=tB(c),[x]=tB(B),[F,Q]=yr(R),[k,h]=yr(x);return{..."z"in a&&{z:y||l},..."fill"in a&&{fill:F||c},..."stroke"in a&&{stroke:k||B},...IN(w,(N,v,K)=>{const U=uO(Gn(N,A),K==null?void 0:K.x),V=uO(Gn(N,e),K==null?void 0:K.y),X=Gn(N,l),_=Gn(N,R),q=Gn(N,x),$=nie(g,{z:X,fill:_,stroke:q}),nA=[],j=[],O=U&&I([]),eA=V&&C([]),oA=X&&G([]),tA=_&&Q([]),sA=q&&h([]);let gA=0;for(const iA of g)iA.initialize(N);n&&n.initialize(N),i&&i.initialize(N);for(const iA of v){const aA=[];for(const lA of g)lA.scope("facet",iA);n&&n.scope("facet",iA),i&&i.scope("facet",iA);for(const[lA,CA]of xS(iA,$))for(const[QA,uA]of xS(CA,V))for(const[fA,hA]of xS(uA,U)){const yA={data:N};if(U&&(yA.x=fA),V&&(yA.y=QA),$&&(yA.z=lA),!(i&&!i.reduce(hA,yA))){aA.push(gA++),j.push(t.reduceIndex(hA,N,yA)),U&&O.push(fA),V&&eA.push(QA),X&&oA.push($===X?lA:X[hA[0]]),_&&tA.push($===_?lA:_[hA[0]]),q&&sA.push($===q?lA:q[hA[0]]);for(const mA of g)mA.reduce(hA,yA);n&&n.reduce(hA,yA)}}nA.push(aA)}return oie(nA,n,o),{data:j,facets:nA}}),...!lN(g,"x")&&(s?{x:s}:{x1:E,x2:u}),...!lN(g,"y")&&(r?{y:r}:{y1:d,y2:f}),...Object.fromEntries(g.map(({name:N,output:v})=>[N,v]))}}function lN(A,...e){for(const{name:t}of A)if(e.includes(t))return!0;return!1}function Aie(A,e,t=cuA){const i=Object.entries(A);return e.title!=null&&A.title===void 0&&i.push(["title",bFt]),e.href!=null&&A.href===void 0&&i.push(["href",EuA]),i.filter(([,n])=>n!==void 0).map(([n,o])=>o===null?dFt(n):t(n,o,e))}function cuA(A,e,t,i=BuA){let n;Ud(e)&&"reduce"in e&&(n=e.scale,e=e.reduce);const o=i(A,e,t),[g,a]=GS(o.label);let s;return{name:A,output:n===void 0?g:{value:g,scale:n},initialize(I){o.initialize(I),s=a([])},scope(I,r){o.scope(I,r)},reduce(I,r){s.push(o.reduce(I,r))}}}function dFt(A){return{name:A,initialize(){},scope(){},reduce(){}}}function BuA(A,e,t,i=pO){const n=Kte(A,t),o=i(e,n);let g,a;return{label:fw(o===fO?null:n,o.label),initialize(s){g=n===void 0?s:Gn(s,n),o.scope==="data"&&(a=o.reduceIndex(Vd(s),g))},scope(s,I){o.scope===s&&(a=o.reduceIndex(I,g))},reduce(s,I){return o.scope==null?o.reduceIndex(s,g,I):o.reduceIndex(s,g,a,I)}}}function xS(A,e){return e?QM(A,t=>e[t]):[[,A]]}function pO(A,e,t=hFt){if(A==null)return t(A);if(typeof A.reduceIndex=="function")return A;if(typeof A.reduce=="function"&&Ud(A))return fFt(A);if(typeof A=="function")return yFt(A);if(/^p\d{2}$/i.test(A))return Td(Uxt(A));switch(`${A}`.toLowerCase()){case"first":return EuA;case"last":return wFt;case"identity":return QuA;case"count":return fO;case"distinct":return DFt;case"sum":return e==null?fO:GFt;case"proportion":return aie(e,"data");case"proportion-facet":return aie(e,"facet");case"deviation":return Td(ygA);case"min":return Td(dc);case"min-index":return Td(T8e);case"max":return Td(Pg);case"max-index":return Td(z8e);case"mean":return gie(b3A);case"median":return gie(hM);case"variance":return Td(Q3A);case"mode":return Td(q8e)}return t(A)}function hFt(A){throw new Error(`invalid reduce: ${A}`)}function mFt(A,e){return Aie(A,e,eie)}function eie(A,e,t){return cuA(A,e,t,tie)}function tie(A,e,t){return BuA(A,e,t,iie)}function iie(A,e){return pO(A,e,pFt)}function pFt(A){switch(`${A}`.toLowerCase()){case"x":return kFt;case"y":return JFt;case"z":return sie}throw new Error(`invalid group reduce: ${A}`)}function nie(A,e){for(const t in e){const i=e[t];if(i!==void 0&&!A.some(n=>n.name===t))return i}}function oie(A,e,t){if(e){const i=e.output.transform(),n=(o,g)=>eB(i[o],i[g]);A.forEach(o=>o.sort(n))}t&&A.forEach(i=>i.reverse())}function fFt(A){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...A,reduceIndex:A.reduce.bind(A)}}function yFt(A){return{reduceIndex(e,t,i){return A(QO(t,e),i)}}}function Td(A){return{reduceIndex(e,t){return A(e,i=>t[i])}}}function gie(A){return{reduceIndex(e,t){const i=A(e,n=>t[n]);return br(t)?new Date(i):i}}}const QuA={reduceIndex(A,e){return QO(e,A)}},EuA={reduceIndex(A,e){return e[A[0]]}},bFt={reduceIndex(A,e){const t=Q9(Pk(A,n=>n.length,n=>e[n]),$EA),i=t.slice(-5).reverse();if(i.length<t.length){const n=t.slice(0,-4);i[5-1]=[`… ${n.length.toLocaleString("en-US")} more`,QQ(n,$EA)]}return i.map(([n,o])=>`${n} (${o.toLocaleString("en-US")})`).join(`
`)}},wFt={reduceIndex(A,e){return e[A[A.length-1]]}},fO={label:"Frequency",reduceIndex(A){return A.length}},DFt={label:"Distinct",reduceIndex(A,e){const t=new qm;for(const i of A)t.add(e[i]);return t.size}},GFt=Td(QQ);function aie(A,e){return A==null?{scope:e,label:"Frequency",reduceIndex:(t,i,n=1)=>t.length/n}:{scope:e,reduceIndex:(t,i,n=1)=>QQ(t,o=>i[o])/n}}const kFt={reduceIndex(A,e,{x:t}){return t}},JFt={reduceIndex(A,e,{y:t}){return t}},sie={reduceIndex(A,e,{z:t}){return t}};function FS(A,{scale:e,type:t,value:i,filter:n,hint:o,label:g=fw(i)},a){return o===void 0&&typeof(i==null?void 0:i.transform)=="function"&&(o=i.hint),rie(a,{scale:e,type:t,value:Gn(A,i),label:g,filter:n,hint:o})}function NFt(A,e){return Object.fromEntries(Object.entries(A).map(([t,i])=>[t,FS(e,i,t)]))}function YFt(A,e){const t=Object.fromEntries(Object.entries(A).map(([i,{scale:n,value:o}])=>{const g=n==null?null:e[n];return[i,g==null?o:So(o,g)]}));return t.channels=A,t}function rie(A,e){const{scale:t,value:i}=e;if(t===!0||t==="auto")switch(A){case"fill":case"stroke":case"color":e.scale=t!==!0&&nuA(i,dO)?null:"color",e.defaultScale="color";break;case"fillOpacity":case"strokeOpacity":case"opacity":e.scale=t!==!0&&nuA(i,AFt)?null:"opacity",e.defaultScale="opacity";break;case"symbol":t!==!0&&nuA(i,IFt)?(e.scale=null,e.value=So(i,suA)):e.scale="symbol",e.defaultScale="symbol";break;default:e.scale=Eo.has(A)?A:null;break}else if(t===!1)e.scale=null;else if(t!=null&&!Eo.has(t))throw new Error(`unknown scale: ${t}`);return e}function RFt(A,e,t,i,n){const{order:o,reverse:g,reduce:a=!0,limit:s}=n;for(const I in n){if(!Eo.has(I))continue;let{value:r,order:C=o,reverse:l=g,reduce:c=a,limit:B=s}=kS(n[I]);const E=r==null?void 0:r.startsWith("-");if(E&&(r=r.slice(1)),C=C===void 0?E!==(r==="width"||r==="height")?lie:Cie:MFt(C),c==null||c===!1)continue;const u=I==="fx"||I==="fy"?FFt(e,i[I]):xFt(t,I);if(!u)throw new Error(`missing channel for scale: ${I}`);const d=u.value,[f=0,w=1/0]=c0(B)?B:B<0?[B]:[0,B];if(r==null)u.domain=()=>{let y=Array.from(new qm(d));return l&&(y=y.reverse()),(f!==0||w!==1/0)&&(y=y.slice(f,w)),y};else{const y=r==="data"?A:r==="height"?Iie(t,"y1","y2"):r==="width"?Iie(t,"x1","x2"):uuA(t,r,r==="y"?"y2":r==="x"?"x2":void 0),G=pO(c===!0?"max":c,y);u.domain=()=>{let R=W8e(Vd(d),x=>G.reduceIndex(x,y),x=>d[x]);return C&&R.sort(C),l&&R.reverse(),(f!==0||w!==1/0)&&(R=R.slice(f,w)),R.map(Mte)}}}}function xFt(A,e){for(const t in A){const i=A[t];if(i.scale===e)return i}}function FFt(A,e){const t=A.original;if(t===A)return e;const i=e.value,n=e.value=[];for(let o=0;o<t.length;++o){const g=i[t[o][0]];for(const a of A[o])n[a]=g}return e}function Iie(A,e,t){const i=uuA(A,e),n=uuA(A,t);return So(n,(o,g)=>Math.abs(o-i[g]),Float64Array)}function uuA(A,e,t){let i=A[e];if(!i&&t!==void 0&&(i=A[t]),i)return i.value;throw new Error(`missing channel: ${e}`)}function MFt(A){if(A==null||typeof A=="function")return A;switch(`${A}`.toLowerCase()){case"ascending":return Cie;case"descending":return lie}throw new Error(`invalid order: ${A}`)}function Cie([A,e],[t,i]){return eB(e,i)||eB(A,t)}function lie([A,e],[t,i]){return aO(e,i)||eB(A,t)}function cie(A,e){let t=A[e];if(t){for(;t.source;)t=t.source;return t.source===null?null:t}}const Bie=new Map([["accent",dxt],["category10",uxt],["dark2",hxt],["observable10",mxt],["paired",pxt],["pastel1",fxt],["pastel2",yxt],["set1",bxt],["set2",wxt],["set3",Dxt],["tableau10",Gxt]]);function vFt(A){return A!=null&&Bie.has(`${A}`.toLowerCase())}const Qie=new Map([...Bie,["brbg",_d(Qee,Eee)],["prgn",_d(uee,dee)],["piyg",_d(hee,mee)],["puor",_d(pee,fee)],["rdbu",_d(KEA,tO)],["rdgy",_d(yee,bee)],["rdylbu",_d(UEA,iO)],["rdylgn",_d(wee,Dee)],["spectral",_d(Gee,kee)],["burd",Eie(KEA,tO)],["buylrd",Eie(UEA,iO)],["blues",Jg($ee,Ate)],["greens",Jg(ete,tte)],["greys",Jg(ite,nte)],["oranges",Jg(rte,Ite)],["purples",Jg(ote,gte)],["reds",Jg(ate,ste)],["turbo",Od(ute)],["viridis",Od(dte)],["magma",Od(hte)],["inferno",Od(mte)],["plasma",Od(pte)],["cividis",Od(Cte)],["cubehelix",Od(lte)],["warm",Od(cte)],["cool",Od(Bte)],["bugn",Jg(Jee,Nee)],["bupu",Jg(Yee,Ree)],["gnbu",Jg(xee,Fee)],["orrd",Jg(Mee,vee)],["pubu",Jg(Hee,Zee)],["pubugn",Jg(Lee,See)],["purd",Jg(Wee,Kee)],["rdpu",Jg(Uee,Vee)],["ylgn",Jg(Tee,_ee)],["ylgnbu",Jg(Xee,zee)],["ylorbr",Jg(Oee,qee)],["ylorrd",Jg(jee,Pee)],["rainbow",uie(Qte)],["sinebow",uie(Ete)]]);function Jg(A,e){return({length:t})=>t===1?[A[3][1]]:t===2?[A[3][1],A[3][2]]:(t=Math.max(3,Math.floor(t)),t>9?qC(e,t):A[t])}function _d(A,e){return({length:t})=>t===2?[A[3][0],A[3][2]]:(t=Math.max(3,Math.floor(t)),t>11?qC(e,t):A[t])}function Eie(A,e){return({length:t})=>t===2?[A[3][2],A[3][0]]:(t=Math.max(3,Math.floor(t)),t>11?qC(i=>e(1-i),t):A[t].slice().reverse())}function Od(A){return({length:e})=>qC(A,Math.max(2,Math.floor(e)))}function uie(A){return({length:e})=>qC(A,Math.floor(e)+1).slice(0,-1)}function die(A){const e=`${A}`.toLowerCase();if(!Qie.has(e))throw new Error(`unknown ordinal scheme: ${e}`);return Qie.get(e)}function yO(A,e){const t=die(A),i=typeof t=="function"?t({length:e}):t;return i.length!==e?i.slice(0,e):i}function LFt(A,e="greys"){const t=new Set,[i,n]=yO(e,2);for(const o of A)if(o!=null)if(o===!0)t.add(n);else if(o===!1)t.add(i);else return;return[...t]}const hie=new Map([["brbg",Eee],["prgn",dee],["piyg",mee],["puor",fee],["rdbu",tO],["rdgy",bee],["rdylbu",iO],["rdylgn",Dee],["spectral",kee],["burd",A=>tO(1-A)],["buylrd",A=>iO(1-A)],["blues",Ate],["greens",tte],["greys",nte],["purples",gte],["reds",ste],["oranges",Ite],["turbo",ute],["viridis",dte],["magma",hte],["inferno",mte],["plasma",pte],["cividis",Cte],["cubehelix",lte],["warm",cte],["cool",Bte],["bugn",Nee],["bupu",Ree],["gnbu",Fee],["orrd",vee],["pubugn",See],["pubu",Zee],["purd",Kee],["rdpu",Vee],["ylgnbu",zee],["ylgn",_ee],["ylorbr",qee],["ylorrd",Pee],["rainbow",Qte],["sinebow",Ete]]);function duA(A){const e=`${A}`.toLowerCase();if(!hie.has(e))throw new Error(`unknown quantitative scheme: ${e}`);return hie.get(e)}const SFt=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function HFt(A){return A!=null&&SFt.has(`${A}`.toLowerCase())}const mie=A=>e=>A(1-e),huA=[0,1],pie=new Map([["number",$g],["rgb",Ap],["hsl",cKA],["hcl",EKA],["lab",BKA]]);function fie(A){const e=`${A}`.toLowerCase();if(!pie.has(e))throw new Error(`unknown interpolator: ${e}`);return pie.get(e)}function MS(A,e,t,{type:i,nice:n,clamp:o,zero:g,domain:a=bie(A,t),unknown:s,round:I,scheme:r,interval:C,range:l=Eo.get(A)===NS?qFt(t,a):Eo.get(A)===YS?jFt(t,a):Eo.get(A)===RS?huA:void 0,interpolate:c=Eo.get(A)===zd?r==null&&l!==void 0?Ap:duA(r!==void 0?r:i==="cyclical"?"rainbow":"turbo"):I?nJ:$g,reverse:B}){if(C=sN(C,i),(i==="cyclical"||i==="sequential")&&(i="linear"),typeof c!="function"&&(c=fie(c)),B=!!B,l!==void 0){const E=(a=l0(a)).length,u=(l=l0(l)).length;if(E!==u){if(c.length===1)throw new Error("invalid piecewise interpolator");c=oJ(c,l),l=void 0}}if(c.length===1?(B&&(c=mie(c),B=!1),l===void 0&&(l=Float64Array.from(a,(E,u)=>u/(a.length-1)),l.length===2&&(l=huA)),e.interpolate((l===huA?Kd:puA)(c))):e.interpolate(c),g){const[E,u]=_C(a);(E>0||u<0)&&(a=wS(a),(tN(a)||1)===Math.sign(E)?a[0]=0:a[a.length-1]=0)}return B&&(a=h9(a)),e.domain(a).unknown(s),n&&(e.nice(ZFt(n,i)),a=e.domain()),l!==void 0&&e.range(l),o&&e.clamp(o),{type:i,domain:a,range:l,scale:e,interpolate:c,interval:C}}function ZFt(A,e){return A===!0?void 0:typeof A=="number"?A:Txt(A,e)}function WFt(A,e,t){return MS(A,bM(),e,t)}function KFt(A,e,t){return yie(A,e,{...t,exponent:.5})}function yie(A,e,{exponent:t=1,...i}){return MS(A,M9().exponent(t),e,{...i,type:"pow"})}function UFt(A,e,{base:t=10,domain:i=PFt(e),...n}){return MS(A,XgA().base(t),e,{...n,domain:i})}function VFt(A,e,{constant:t=1,...i}){return MS(A,TgA().constant(t),e,i)}function XFt(A,e,{range:t,quantiles:i=t===void 0?5:(t=[...t]).length,n=i,scheme:o="rdylbu",domain:g=$Ft(e),unknown:a,interpolate:s,reverse:I}){return t===void 0&&(t=s!==void 0?qC(s,n):Eo.get(A)===zd?yO(o,n):void 0),g.length>0&&(g=OgA(g,t===void 0?{length:n}:t).quantiles()),muA(A,e,{domain:g,range:t,reverse:I,unknown:a})}function zFt(A,e,{range:t,n:i=t===void 0?5:(t=[...t]).length,scheme:n="rdylbu",domain:o=bie(A,e),unknown:g,interpolate:a,reverse:s}){const[I,r]=_C(o);let C;return t===void 0?(C=uM(I,r,i),C[0]<=I&&C.splice(0,1),C[C.length-1]>=r&&C.pop(),i=C.length+1,t=a!==void 0?qC(a,i):Eo.get(A)===zd?yO(n,i):void 0):(C=qC($g(I,r),i+1).slice(1,-1),I instanceof Date&&(C=C.map(l=>new Date(l)))),tN(l0(o))<0&&C.reverse(),muA(A,e,{domain:C,range:t,reverse:s,unknown:g})}function muA(A,e,{domain:t=[0],unknown:i,scheme:n="rdylbu",interpolate:o,range:g=o!==void 0?qC(o,t.length+1):Eo.get(A)===zd?yO(n,t.length+1):void 0,reverse:a}){t=l0(t);const s=tN(t);if(!isNaN(s)&&!TFt(t,s))throw new Error(`the ${A} scale has a non-monotonic domain`);return a&&(g=h9(g)),{type:"threshold",scale:qgA(s<0?h9(t):t,g===void 0?[]:g).unknown(i),domain:t,range:g}}function TFt(A,e){for(let t=1,i=A.length,n=A[0];t<i;++t){const o=BM(n,n=A[t]);if(o!==0&&o!==e)return!1}return!0}function _Ft(A){return{type:"identity",scale:gFt(Eo.get(A))?UgA():e=>e}}function vS(A,e=fte){return A.length?[dc(A,({value:t})=>t===void 0?t:dc(t,e)),Pg(A,({value:t})=>t===void 0?t:Pg(t,e))]:[0,1]}function bie(A,e){const t=Eo.get(A);return(t===NS||t===RS||t===YS?OFt:vS)(e)}function OFt(A){return[0,A.length?Pg(A,({value:e})=>e===void 0?e:Pg(e,fte)):1]}function qFt(A,e){const t=A.find(({radius:g})=>g!==void 0);if(t!==void 0)return[0,t.radius];const i=BQ(A,.5,({value:g})=>g===void 0?NaN:BQ(g,.25,sO)),n=e.map(g=>3*Math.sqrt(g/i)),o=30/Pg(n);return o<1?n.map(g=>g*o):n}function jFt(A,e){const t=hM(A,({value:o})=>o===void 0?NaN:hM(o,Math.abs)),i=e.map(o=>12*o/t),n=60/Pg(i);return n<1?i.map(o=>o*n):i}function PFt(A){for(const{value:e}of A)if(e!==void 0)for(let t of e){if(t>0)return vS(A,sO);if(t<0)return vS(A,XEA)}return[1,10]}function $Ft(A){const e=[];for(const{value:t}of A)if(t!==void 0)for(const i of t)e.push(i);return e}function puA(A){return(e,t)=>i=>A(e+i*(t-e))}let fuA=0,yuA;function AMt(){const A=fuA;return fuA=0,yuA=void 0,A}function B0(A){A!==yuA&&(yuA=A,console.warn(A),++fuA)}function bO(A,e,t,i,{type:n,nice:o,clamp:g,domain:a=vS(i),unknown:s,pivot:I=0,scheme:r,range:C,symmetric:l=!0,interpolate:c=Eo.get(A)===zd?r==null&&C!==void 0?Ap:duA(r!==void 0?r:"rdbu"):$g,reverse:B}){I=+I,a=l0(a);let[E,u]=a;if(a.length>2&&B0(`Warning: the diverging ${A} scale domain contains extra elements.`),BM(E,u)<0&&([E,u]=[u,E],B=!B),E=Math.min(E,I),u=Math.max(u,I),typeof c!="function"&&(c=fie(c)),C!==void 0&&(c=c.length===1?puA(c)(...C):oJ(c,C)),B&&(c=mie(c)),l){const d=t.apply(I),f=d-t.apply(E),w=t.apply(u)-d;f<w?E=t.invert(d-w):f>w&&(u=t.invert(d+f))}return e.domain([E,I,u]).unknown(s).interpolator(c),g&&e.clamp(g),o&&e.nice(o),{type:n,domain:[E,u],pivot:I,interpolate:c,scale:e}}function eMt(A,e,t){return bO(A,gaA(),oMt,e,t)}function tMt(A,e,t){return wie(A,e,{...t,exponent:.5})}function wie(A,e,{exponent:t=1,...i}){return bO(A,H9().exponent(t=+t),sMt(t),e,{...i,type:"diverging-pow"})}function iMt(A,e,{base:t=10,pivot:i=1,domain:n=vS(e,i<0?XEA:sO),...o}){return bO(A,aaA().base(t=+t),gMt,e,{domain:n,pivot:i,...o})}function nMt(A,e,{constant:t=1,...i}){return bO(A,saA().constant(t=+t),rMt(t),e,i)}const oMt={apply(A){return A},invert(A){return A}},gMt={apply:Math.log,invert:Math.exp},aMt={apply(A){return Math.sign(A)*Math.sqrt(Math.abs(A))},invert(A){return Math.sign(A)*(A*A)}};function sMt(A){return A===.5?aMt:{apply(e){return Math.sign(e)*Math.pow(Math.abs(e),A)},invert(e){return Math.sign(e)*Math.pow(Math.abs(e),1/A)}}}function rMt(A){return{apply(e){return Math.sign(e)*Math.log1p(Math.abs(e/A))},invert(e){return Math.sign(e)*Math.expm1(Math.abs(e))*A}}}function Die(A,e,t,i){return MS(A,e,t,i)}function IMt(A,e,t){return Die(A,iUA(),e,t)}function CMt(A,e,t){return Die(A,nUA(),e,t)}const LS=Symbol("ordinal");function Gie(A,e,t,{type:i,interval:n,domain:o,range:g,reverse:a,hint:s}){return n=sN(n,i),o===void 0&&(o=Jie(t,n,A)),(i==="categorical"||i===LS)&&(i="ordinal"),a&&(o=h9(o)),o=e.domain(o).domain(),g!==void 0&&(typeof g=="function"&&(g=g(o)),e.range(g)),{type:i,domain:o,range:g,scale:e,hint:s,interval:n}}function lMt(A,e,{type:t,interval:i,domain:n,range:o,scheme:g,unknown:a,...s}){i=sN(i,t),n===void 0&&(n=Jie(e,i,A));let I;if(Eo.get(A)===mO)I=QMt(e),o=o===void 0?EMt(I):So(o,suA);else if(Eo.get(A)===zd&&(o===void 0&&(t==="ordinal"||t===LS)&&(o=LFt(n,g),o!==void 0&&(g=void 0)),g===void 0&&o===void 0&&(g=t==="ordinal"?"turbo":"observable10"),g!==void 0))if(o!==void 0){const r=duA(g),C=o[0],l=o[1]-o[0];o=({length:c})=>qC(B=>r(C+l*B),c)}else o=die(g);if(a===m9)throw new Error(`implicit unknown on ${A} scale is not supported`);return Gie(A,$k().unknown(a),e,{...s,type:t,domain:n,range:o,hint:I})}function cMt(A,e,{align:t=.5,padding:i=.5,...n}){return kie(tPe().align(t).padding(i),e,n,A)}function BMt(A,e,{align:t=.5,padding:i=.1,paddingInner:n=i,paddingOuter:o=A==="fx"||A==="fy"?0:i,...g}){return kie(p9().align(t).paddingInner(n).paddingOuter(o),e,g,A)}function kie(A,e,t,i){let{round:n}=t;return n!==void 0&&A.round(n=!!n),A=Gie(i,A,e,t),A.round=n,A}function Jie(A,e,t){const i=new qm;for(const{value:n,domain:o}of A){if(o!==void 0)return o();if(n!==void 0)for(const g of n)i.add(g)}if(e!==void 0){const[n,o]=_C(i).map(e.floor,e);return e.range(n,e.offset(o))}if(i.size>1e4&&Eo.get(t)===tE)throw new Error(`implicit ordinal domain of ${t} scale has more than 10,000 values`);return Q9(i,eB)}function Nie(A,e){let t;for(const{hint:i}of A){const n=i==null?void 0:i[e];if(n!==void 0){if(t===void 0)t=n;else if(t!==n)return}}return t}function QMt(A){return{fill:Nie(A,"fill"),stroke:Nie(A,"stroke")}}function EMt(A){return wr(A.fill)?Ltt:vtt}function buA(A,{label:e,inset:t=0,insetTop:i=t,insetRight:n=t,insetBottom:o=t,insetLeft:g=t,round:a,nice:s,clamp:I,zero:r,align:C,padding:l,projection:c,facet:{label:B=e}={},...E}={}){const u={};for(const[d,f]of A){const w=E[d],y=pMt(d,f,{round:Eo.get(d)===tE?a:void 0,nice:s,clamp:I,zero:r,align:C,padding:l,projection:c,...w});if(y){let{label:G=d==="fx"||d==="fy"?B:e,percent:R,transform:x,inset:F,insetTop:Q=F!==void 0?F:d==="y"?i:0,insetRight:k=F!==void 0?F:d==="x"?n:0,insetBottom:h=F!==void 0?F:d==="y"?o:0,insetLeft:N=F!==void 0?F:d==="x"?g:0}=w||{};if(x==null)x=void 0;else if(typeof x!="function")throw new Error("invalid scale transform; not a function");y.percent=!!R,y.label=G===void 0?dMt(f,y):G,y.transform=x,d==="x"||d==="fx"?(y.insetLeft=+N,y.insetRight=+k):(d==="y"||d==="fy")&&(y.insetTop=+Q,y.insetBottom=+h),u[d]=y}}return u}function Yie(A){const e={},t={scales:e};for(const[i,n]of Object.entries(A)){const{scale:o,type:g,interval:a,label:s}=n;e[i]=DMt(n),t[i]=o,o.type=g,a!=null&&(o.interval=a),s!=null&&(o.label=s)}return t}function uMt(A,e){const{x:t,y:i,fx:n,fy:o}=A,g=n||o?wuA(e):e;n&&xie(n,g),o&&Fie(o,g);const a=n||o?Rie(A,e):e;t&&xie(t,a),i&&Fie(i,a)}function dMt(A=[],e){let t;for(const{label:i}of A)if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}if(t!==void 0)return!yw(e)&&e.percent&&(t=`${t} (%)`),{inferred:!0,toString:()=>t}}function hMt(A){return Math.sign(tN(A.domain()))*Math.sign(tN(A.range()))}function wuA(A){const{marginTop:e,marginRight:t,marginBottom:i,marginLeft:n,width:o,height:g,facet:{marginTop:a,marginRight:s,marginBottom:I,marginLeft:r}}=A;return{marginTop:Math.max(e,a),marginRight:Math.max(t,s),marginBottom:Math.max(i,I),marginLeft:Math.max(n,r),width:o,height:g}}function Rie({fx:A,fy:e},t){const{marginTop:i,marginRight:n,marginBottom:o,marginLeft:g,width:a,height:s}=wuA(t);return{marginTop:i,marginRight:n,marginBottom:o,marginLeft:g,width:A?A.scale.bandwidth()+g+n:a,height:e?e.scale.bandwidth()+i+o:s,facet:{width:a,height:s}}}function xie(A,e){if(A.range===void 0){const{insetLeft:t,insetRight:i}=A,{width:n,marginLeft:o=0,marginRight:g=0}=e,a=o+t,s=n-g-i;A.range=[a,Math.max(a,s)],yw(A)||(A.range=vie(A)),A.scale.range(A.range)}Mie(A)}function Fie(A,e){if(A.range===void 0){const{insetTop:t,insetBottom:i}=A,{height:n,marginTop:o=0,marginBottom:g=0}=e,a=o+t,s=n-g-i;A.range=[Math.max(a,s),a],yw(A)?A.range.reverse():A.range=vie(A),A.scale.range(A.range)}Mie(A)}function Mie(A){A.round===void 0&&yMt(A)&&mMt(A)<=30&&A.scale.round(!0)}function mMt({scale:A}){const e=A.domain().length,[t,i]=A.range(),n=A.paddingInner?A.paddingInner():1,o=A.paddingOuter?A.paddingOuter():A.padding(),g=e-n,a=Math.abs(i-t)/Math.max(1,g+o*2);return(a-Math.floor(a))*g}function vie(A){const e=A.scale.domain().length+Hie(A);if(!(e>2))return A.range;const[t,i]=A.range;return Array.from({length:e},(n,o)=>t+o/(e-1)*(i-t))}function pMt(A,e=[],t={}){const i=fMt(A,e,t);if(t.type===void 0&&t.domain===void 0&&t.range===void 0&&t.interval==null&&A!=="fx"&&A!=="fy"&&yw({type:i})){const n=e.map(({value:o})=>o).filter(o=>o!==void 0);n.some(br)?B0(`Warning: some data associated with the ${A} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${cN(i)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${A} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${A} scale to "${cN(i)}".`):n.some(qxt)?B0(`Warning: some data associated with the ${A} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${cN(i)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${A} scale to "${cN(i)}".`):n.some(jxt)&&B0(`Warning: some data associated with the ${A} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${cN(i)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${A} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${A} scale to "${cN(i)}".`)}switch(t.type=i,i){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":t=wO(e,t,oN);break;case"identity":switch(Eo.get(A)){case tE:t=wO(e,t,oN);break;case mO:t=wO(e,t,bMt);break}break;case"utc":case"time":t=wO(e,t,vte);break}switch(i){case"diverging":return eMt(A,e,t);case"diverging-sqrt":return tMt(A,e,t);case"diverging-pow":return wie(A,e,t);case"diverging-log":return iMt(A,e,t);case"diverging-symlog":return nMt(A,e,t);case"categorical":case"ordinal":case LS:return lMt(A,e,t);case"cyclical":case"sequential":case"linear":return WFt(A,e,t);case"sqrt":return KFt(A,e,t);case"threshold":return muA(A,e,t);case"quantile":return XFt(A,e,t);case"quantize":return zFt(A,e,t);case"pow":return yie(A,e,t);case"log":return UFt(A,e,t);case"symlog":return VFt(A,e,t);case"utc":return CMt(A,e,t);case"time":return IMt(A,e,t);case"point":return cMt(A,e,t);case"band":return BMt(A,e,t);case"identity":return _Ft(A);case void 0:return;default:throw new Error(`unknown scale type: ${i}`)}}function cN(A){return typeof A=="symbol"?A.description:A}function Lie(A){return typeof A=="string"?`${A}`.toLowerCase():A}const Sie={toString:()=>"projection"};function fMt(A,e,{type:t,domain:i,range:n,scheme:o,pivot:g,projection:a}){if(t=Lie(t),A==="fx"||A==="fy")return"band";(A==="x"||A==="y")&&a!=null&&(t=Sie);for(const I of e){const r=Lie(I.type);if(r!==void 0){if(t===void 0)t=r;else if(t!==r)throw new Error(`scale incompatible with channel: ${t} !== ${r}`)}}if(t===Sie)return;if(t!==void 0)return t;if(i===void 0&&!e.some(({value:I})=>I!==void 0))return;const s=Eo.get(A);if(s===NS)return"sqrt";if(s===RS||s===YS)return"linear";if(s===mO)return"ordinal";if((i||n||[]).length>2)return DuA(s);if(i!==void 0){if(Xte(i))return DuA(s);if(br(i))return"utc"}else{const I=e.map(({value:r})=>r).filter(r=>r!==void 0);if(I.some(Xte))return DuA(s);if(I.some(br))return"utc"}if(s===zd){if(g!=null||HFt(o))return"diverging";if(vFt(o))return"categorical"}return"linear"}function DuA(A){switch(A){case tE:return"point";case zd:return LS;default:return"ordinal"}}function yw({type:A}){return A==="ordinal"||A==="point"||A==="band"||A===LS}function Hie({type:A}){return A==="threshold"}function yMt({type:A}){return A==="point"||A==="band"}function iE(A){if(A===void 0)return!0;const e=A.domain(),t=A(e[0]);for(let i=1,n=e.length;i<n;++i)if(A(e[i])-t)return!1;return!0}function wO(A,{domain:e,...t},i){var n;for(const o of A)o.value!==void 0&&(e===void 0&&(e=(n=o.value)==null?void 0:n.domain),o.value=i(o.value));return{domain:e===void 0?e:i(e),...t}}function bMt(A){return So(A,suA)}function wMt(A){return e=>{if(!Eo.has(e=`${e}`))throw new Error(`unknown scale: ${e}`);return A[e]}}function DMt({scale:A,type:e,domain:t,range:i,interpolate:n,interval:o,transform:g,percent:a,pivot:s}){if(e==="identity")return{type:"identity",apply:r=>r,invert:r=>r};const I=A.unknown?A.unknown():void 0;return{type:e,domain:wS(t),...i!==void 0&&{range:wS(i)},...g!==void 0&&{transform:g},...a&&{percent:a},...I!==void 0&&{unknown:I},...o!==void 0&&{interval:o},...n!==void 0&&{interpolate:n},...A.clamp&&{clamp:A.clamp()},...s!==void 0&&{pivot:s,symmetric:!1},...A.base&&{base:A.base()},...A.exponent&&{exponent:A.exponent()},...A.constant&&{constant:A.constant()},...A.align&&{align:A.align(),round:A.round()},...A.padding&&(A.paddingInner?{paddingInner:A.paddingInner(),paddingOuter:A.paddingOuter()}:{padding:A.padding()}),...A.bandwidth&&{bandwidth:A.bandwidth(),step:A.step()},apply:r=>A(r),...A.invert&&{invert:r=>A.invert(r)}}}function GMt(A,e){const{fx:t,fy:i}=buA(A,e),n=t==null?void 0:t.scale.domain(),o=i==null?void 0:i.scale.domain();return n&&o?H8e(n,o).map(([g,a],s)=>({x:g,y:a,i:s})):n?n.map((g,a)=>({x:g,i:a})):o?o.map((g,a)=>({y:g,i:a})):void 0}function kMt(A,{x:e,y:t}){return e&&(e=kuA(e)),t&&(t=kuA(t)),A.filter(e&&t?i=>e.has(i.x)&&t.has(i.y):e?i=>e.has(i.x):i=>t.has(i.y)).sort(e&&t?(i,n)=>e.get(i.x)-e.get(n.x)||t.get(i.y)-t.get(n.y):e?(i,n)=>e.get(i.x)-e.get(n.x):(i,n)=>t.get(i.y)-t.get(n.y))}function GuA(A,{fx:e,fy:t}){const i=Vd(A),n=e==null?void 0:e.value,o=t==null?void 0:t.value;return e&&t?Pk(i,g=>(g.fx=n[g[0]],g.fy=o[g[0]],g),g=>n[g],g=>o[g]):e?Pk(i,g=>(g.fx=n[g[0]],g),g=>n[g]):Pk(i,g=>(g.fy=o[g[0]],g),g=>o[g])}function JMt(A,e,{marginTop:t,marginLeft:i}){return A&&e?({x:n,y:o})=>`translate(${A(n)-i},${e(o)-t})`:A?({x:n})=>`translate(${A(n)-i},0)`:({y:n})=>`translate(0,${e(n)-t})`}function NMt(A){const e=[],t=new Uint32Array(QQ(A,i=>i.length));for(const i of A){let n=0;for(const o of A)i!==o&&(t.set(o,n),n+=o.length);e.push(t.slice(0,n))}return e}const YMt=new Map([["top",JuA],["right",RuA],["bottom",NuA],["left",YuA],["top-left",GO(JuA,YuA)],["top-right",GO(JuA,RuA)],["bottom-left",GO(NuA,YuA)],["bottom-right",GO(NuA,RuA)],["top-empty",FMt],["right-empty",LMt],["bottom-empty",MMt],["left-empty",vMt],["empty",SMt]]);function RMt(A){if(A==null)return null;const e=YMt.get(`${A}`.toLowerCase());if(e)return e;throw new Error(`invalid facet anchor: ${A}`)}const Zie=new WeakMap;function kuA(A){let e=Zie.get(A);return e||Zie.set(A,e=new Xy(So(A,(t,i)=>[t,i]))),e}function Q0(A,e){return kuA(A).get(e)}function xMt(A,e,t){return e=Xd(e),t=Xd(t),A.find(i=>Object.is(Xd(i.x),e)&&Object.is(Xd(i.y),t))}function DO(A,e,t){var i;return(i=xMt(A,e,t))==null?void 0:i.empty}function JuA(A,{y:e},{y:t}){return e?Q0(e,t)===0:!0}function NuA(A,{y:e},{y:t}){return e?Q0(e,t)===e.length-1:!0}function YuA(A,{x:e},{x:t}){return e?Q0(e,t)===0:!0}function RuA(A,{x:e},{x:t}){return e?Q0(e,t)===e.length-1:!0}function FMt(A,{y:e},{x:t,y:i,empty:n}){if(n)return!1;if(!e)return;const o=Q0(e,i);if(o>0)return DO(A,t,e[o-1])}function MMt(A,{y:e},{x:t,y:i,empty:n}){if(n)return!1;if(!e)return;const o=Q0(e,i);if(o<e.length-1)return DO(A,t,e[o+1])}function vMt(A,{x:e},{x:t,y:i,empty:n}){if(n)return!1;if(!e)return;const o=Q0(e,t);if(o>0)return DO(A,e[o-1],i)}function LMt(A,{x:e},{x:t,y:i,empty:n}){if(n)return!1;if(!e)return;const o=Q0(e,t);if(o<e.length-1)return DO(A,e[o+1],i)}function SMt(A,e,{empty:t}){return t}function GO(A,e){return function(){return A.apply(null,arguments)&&e.apply(null,arguments)}}function xuA(A,{channels:{fx:e,fy:t},groups:i}){return e&&t?A.map(({x:n,y:o})=>{var g;return((g=i.get(n))==null?void 0:g.get(o))??[]}):e?A.map(({x:n})=>i.get(n)??[]):A.map(({y:n})=>i.get(n)??[])}const Wie=Math.PI,qd=2*Wie,FuA=.618;function HMt({projection:A,inset:e=0,insetTop:t=e,insetRight:i=e,insetBottom:n=e,insetLeft:o=e}={},g){if(A==null)return;if(typeof A.stream=="function")return A;let a,s,I="frame";if(Ud(A)){let G;if({type:A,domain:s,inset:G,insetTop:t=G!==void 0?G:t,insetRight:i=G!==void 0?G:i,insetBottom:n=G!==void 0?G:n,insetLeft:o=G!==void 0?G:o,clip:I=I,...a}=A,A==null)return}typeof A!="function"&&({type:A}=MuA(A));const{width:r,height:C,marginLeft:l,marginRight:c,marginTop:B,marginBottom:E}=g,u=r-l-c-o-i,d=C-B-E-t-n;if(A=A==null?void 0:A({width:u,height:d,clip:I,...a}),A==null)return;I=ZMt(I,l,B,r-c,C-E);let f=l+o,w=B+t,y;if(s!=null){const[[G,R],[x,F]]=O4(A).bounds(s),Q=Math.min(u/(x-G),d/(F-R));Q>0?(f-=(Q*(G+x)-u)/2,w-=(Q*(R+F)-d)/2,y=LEA({point(k,h){this.stream.point(k*Q+f,h*Q+w)}})):B0("Warning: the projection could not be fit to the specified domain; using the default scale.")}return y??(y=f===0&&w===0?Kie():LEA({point(G,R){this.stream.point(G+f,R+w)}})),{stream:G=>A.stream(y.stream(I(G)))}}function MuA(A){switch(`${A}`.toLowerCase()){case"albers-usa":return nB(txt,.7463,.4673);case"albers":return kO(oee,.7463,.4673);case"azimuthal-equal-area":return nB(ixt,4,4);case"azimuthal-equidistant":return nB(nxt,qd,qd);case"conic-conformal":return kO(axt,qd,qd);case"conic-equal-area":return kO(j4,6.1702,2.9781);case"conic-equidistant":return kO(Ixt,7.312,3.6282);case"equal-earth":return nB(lxt,5.4133,2.6347);case"equirectangular":return nB(sxt,qd,Wie);case"gnomonic":return nB(cxt,3.4641,3.4641);case"identity":return{type:Kie};case"reflect-y":return{type:WMt};case"mercator":return nB(oxt,qd,qd);case"orthographic":return nB(Bxt,2,2);case"stereographic":return nB(Qxt,2,2);case"transverse-mercator":return nB(Ext,qd,qd);default:throw new Error(`unknown projection type: ${A}`)}}function ZMt(A,e,t,i,n){if(A===!1||A==null||typeof A=="number")return o=>o;switch(A===!0&&(A="frame"),`${A}`.toLowerCase()){case"frame":return YAe(e,t,i,n);default:throw new Error(`unknown projection clip type: ${A}`)}}function nB(A,e,t){return{type:({width:i,height:n,rotate:o,precision:g=.15,clip:a})=>{var s,I,r;const C=A();return g!=null&&((s=C.precision)==null||s.call(C,g)),o!=null&&((I=C.rotate)==null||I.call(C,o)),typeof a=="number"&&((r=C.clipAngle)==null||r.call(C,a)),i!=null&&(C.scale(Math.min(i/e,n/t)),C.translate([i/2,n/2])),C},aspectRatio:t/e}}function kO(A,e,t){const{type:i,aspectRatio:n}=nB(A,e,t);return{type:o=>{const{parallels:g,domain:a,width:s,height:I}=o,r=i(o);return g!=null&&(r.parallels(g),a===void 0&&s!=null&&r.fitSize([s,I],{type:"Sphere"})),r},aspectRatio:n}}const Kie=Kd({stream:A=>A}),WMt=Kd(LEA({point(A,e){this.stream.point(A,-e)}}));function KMt(A,e,t,i){const n=t[A],o=t[e],g=n.length,a=t[A]=new Float64Array(g).fill(NaN),s=t[e]=new Float64Array(g).fill(NaN);let I;const r=i.stream({point(C,l){a[I]=C,s[I]=l}});for(I=0;I<g;++I)r.point(n[I],o[I])}function UMt({projection:A}={}){return A==null?!1:typeof A.stream=="function"?!0:(Ud(A)&&(A=A.type),A!=null)}function VMt(A){if(typeof(A==null?void 0:A.stream)=="function")return FuA;if(Ud(A)){let e,t;if({domain:e,type:A,...t}=A,e!=null&&A!=null){const i=typeof A=="string"?MuA(A).type:A,[[n,o],[g,a]]=O4(i({...t,width:100,height:100})).bounds(e),s=(a-o)/(g-n);return s&&isFinite(s)?s<.2?.2:s>5?5:s:FuA}}if(A!=null){if(typeof A!="function"){const{aspectRatio:e}=MuA(A);if(e)return e}return FuA}}function XMt(A){const e=[],t=[],i={scale:"x",value:e},n={scale:"y",value:t},o={point(g,a){e.push(g),t.push(a)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(const g of A.value)dw(g,o);return[i,n]}function vuA(A={}){const{document:e=typeof window<"u"?window.document:void 0,clip:t}=A;return{document:e,clip:Tte(t)}}function Ho(A,{document:e}){return j2(J4(A).call(e.documentElement))}const LuA=Symbol("unset");function SuA(A){return(A.length===1?zMt:TMt)(A)}function zMt(A){let e,t=LuA;return i=>(Object.is(t,i)||(t=i,e=A(i)),e)}function TMt(A){let e,t;return(...i)=>(((t==null?void 0:t.length)!==i.length||t.some((n,o)=>!Object.is(n,i[o])))&&(t=i,e=A(...i)),e)}const _Mt=SuA(A=>new Intl.NumberFormat(A));SuA((A,e)=>new Intl.DateTimeFormat(A,{timeZone:"UTC",...e&&{month:e}})),SuA((A,e)=>new Intl.DateTimeFormat(A,{timeZone:"UTC",...e&&{weekday:e}}));function OMt(A="en-US"){const e=_Mt(A);return t=>t!=null&&!isNaN(t)?e.format(t):void 0}function qMt(A){return Nxt(A,"Invalid Date")}function jMt(A="en-US"){const e=OMt(A);return t=>(t instanceof Date?qMt:typeof t=="number"?e:ws)(t)}const BN=jMt(),Gs=(typeof window<"u"?window.devicePixelRatio>1:typeof it>"u")?0:.5;let PMt=0;function $Mt(){return`plot-clip-${++PMt}`}function Avt(A,{title:e,href:t,ariaLabel:i,ariaDescription:n,ariaHidden:o,target:g,fill:a,fillOpacity:s,stroke:I,strokeWidth:r,strokeOpacity:C,strokeLinejoin:l,strokeLinecap:c,strokeMiterlimit:B,strokeDasharray:E,strokeDashoffset:u,opacity:d,mixBlendMode:f,imageFilter:w,paintOrder:y,pointerEvents:G,shapeRendering:R,channels:x},{ariaLabel:F,fill:Q="currentColor",fillOpacity:k,stroke:h="none",strokeOpacity:N,strokeWidth:v,strokeLinecap:K,strokeLinejoin:U,strokeMiterlimit:V,paintOrder:X}){Q===null&&(a=null,s=null),h===null&&(I=null,C=null),wr(Q)?!wr(h)&&(!wr(a)||x!=null&&x.fill)&&(h="none"):wr(h)&&(!wr(I)||x!=null&&x.stroke)&&(Q="none");const[_,q]=tB(a,Q),[$,nA]=Ds(s,k),[j,O]=tB(I,h),[eA,oA]=Ds(C,N),[tA,sA]=Ds(d);JS(O)||(r===void 0&&(r=v),c===void 0&&(c=K),l===void 0&&(l=U),B===void 0&&!eFt(l)&&(B=V),!JS(q)&&y===void 0&&(y=X));const[gA,iA]=Ds(r);return Q!==null&&(A.fill=aa(q,"currentColor"),A.fillOpacity=SS(nA,1)),h!==null&&(A.stroke=aa(O,"none"),A.strokeWidth=SS(iA,1),A.strokeOpacity=SS(oA,1),A.strokeLinejoin=aa(l,"miter"),A.strokeLinecap=aa(c,"butt"),A.strokeMiterlimit=SS(B,4),A.strokeDasharray=aa(E,"none"),A.strokeDashoffset=aa(u,"0")),A.target=ws(g),A.ariaLabel=ws(F),A.ariaDescription=ws(n),A.ariaHidden=ws(o),A.opacity=SS(sA,1),A.mixBlendMode=aa(f,"normal"),A.imageFilter=aa(w,"none"),A.paintOrder=aa(y,"normal"),A.pointerEvents=aa(G,"auto"),A.shapeRendering=aa(R,"auto"),{title:{value:e,optional:!0,filter:null},href:{value:t,optional:!0,filter:null},ariaLabel:{value:i,optional:!0,filter:null},fill:{value:_,scale:"auto",optional:!0},fillOpacity:{value:$,scale:"auto",optional:!0},stroke:{value:j,scale:"auto",optional:!0},strokeOpacity:{value:eA,scale:"auto",optional:!0},strokeWidth:{value:gA,optional:!0},opacity:{value:tA,scale:"auto",optional:!0}}}function evt(A,e){e&&A.filter(t=>VEA(e[t])).append("title").call(ivt,e)}function tvt(A,e){e&&A.filter(([t])=>VEA(e[t])).append("title").call(nvt,e)}function ivt(A,e){e&&A.text(t=>BN(e[t]))}function nvt(A,e){e&&A.text(([t])=>BN(e[t]))}function oB(A,{target:e,tip:t},{ariaLabel:i,title:n,fill:o,fillOpacity:g,stroke:a,strokeOpacity:s,strokeWidth:I,opacity:r,href:C}){i&&Pe(A,"aria-label",l=>i[l]),o&&Pe(A,"fill",l=>o[l]),g&&Pe(A,"fill-opacity",l=>g[l]),a&&Pe(A,"stroke",l=>a[l]),s&&Pe(A,"stroke-opacity",l=>s[l]),I&&Pe(A,"stroke-width",l=>I[l]),r&&Pe(A,"opacity",l=>r[l]),C&&zie(A,l=>C[l],e),t||evt(A,n)}function Uie(A,{target:e,tip:t},{ariaLabel:i,title:n,fill:o,fillOpacity:g,stroke:a,strokeOpacity:s,strokeWidth:I,opacity:r,href:C}){i&&Pe(A,"aria-label",([l])=>i[l]),o&&Pe(A,"fill",([l])=>o[l]),g&&Pe(A,"fill-opacity",([l])=>g[l]),a&&Pe(A,"stroke",([l])=>a[l]),s&&Pe(A,"stroke-opacity",([l])=>s[l]),I&&Pe(A,"stroke-width",([l])=>I[l]),r&&Pe(A,"opacity",([l])=>r[l]),C&&zie(A,([l])=>C[l],e),t||tvt(A,n)}function ovt({ariaLabel:A,title:e,fill:t,fillOpacity:i,stroke:n,strokeOpacity:o,strokeWidth:g,opacity:a,href:s},{tip:I}){return[A,I?void 0:e,t,i,n,o,g,a,s].filter(r=>r!==void 0)}function gvt(A,e,t){const i=QM(A,n=>e[n]);return t===void 0&&i.size>1+A.length>>1&&B0("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),i.values()}function*Vie(A,e,t,i){const{z:n}=t,{z:o}=i,g=ovt(i,t),a=[...e,...g];for(const s of o?gvt(A,o,n):[A]){let I,r;A:for(const C of s){for(const l of a)if(!s0(l[C])){r&&r.push(-1);continue A}if(I===void 0){r&&(yield r),I=g.map(l=>Xd(l[C])),r=[C];continue}r.push(C);for(let l=0;l<g.length;++l)if(Xd(g[l][C])!==I[l]){yield r,I=g.map(c=>Xd(c[C])),r=[C];continue A}}r&&(yield r)}}function avt(A,e,t,i){let n;const{clip:o=i.clip}=e;switch(o){case"frame":{A=Ho("svg:g",i).each(function(){this.appendChild(A.node()),A.node=()=>this}),n=svt(i,t);break}case"sphere":{n=rvt(i);break}}Pe(A,"aria-label",e.ariaLabel),Pe(A,"aria-description",e.ariaDescription),Pe(A,"aria-hidden",e.ariaHidden),Pe(A,"clip-path",n)}function Xie(A){const e=new WeakMap;return(t,i)=>{let n=e.get(t);if(!n){const o=$Mt();j2(t.ownerSVGElement).append("clipPath").attr("id",o).call(A,t,i),e.set(t,n=`url(#${o})`)}return n}}const svt=Xie((A,e,t)=>{const{width:i,height:n,marginLeft:o,marginRight:g,marginTop:a,marginBottom:s}=t;A.append("rect").attr("x",o).attr("y",a).attr("width",i-g-o).attr("height",n-a-s)}),rvt=Xie((A,e)=>{const{projection:t}=e;if(!t)throw new Error('the "sphere" clip option requires a projection');A.append("path").attr("d",O4(t)({type:"Sphere"}))});function yl(A,e,t,i){avt(A,e,t,i),Pe(A,"class",e.className),Pe(A,"fill",e.fill),Pe(A,"fill-opacity",e.fillOpacity),Pe(A,"stroke",e.stroke),Pe(A,"stroke-width",e.strokeWidth),Pe(A,"stroke-opacity",e.strokeOpacity),Pe(A,"stroke-linejoin",e.strokeLinejoin),Pe(A,"stroke-linecap",e.strokeLinecap),Pe(A,"stroke-miterlimit",e.strokeMiterlimit),Pe(A,"stroke-dasharray",e.strokeDasharray),Pe(A,"stroke-dashoffset",e.strokeDashoffset),Pe(A,"shape-rendering",e.shapeRendering),Pe(A,"filter",e.imageFilter),Pe(A,"paint-order",e.paintOrder);const{pointerEvents:n=i.pointerSticky===!1?"none":void 0}=e;Pe(A,"pointer-events",n)}function Dr(A,e){Ivt(A,"mix-blend-mode",e.mixBlendMode),Pe(A,"opacity",e.opacity)}function zie(A,e,t){A.each(function(i){const n=e(i);if(n!=null){const o=this.ownerDocument.createElementNS(O2.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(O2.xlink,"href",n),t!=null&&o.setAttribute("target",t),this.parentNode.insertBefore(o,this).appendChild(this)}})}function Pe(A,e,t){t!=null&&A.attr(e,t)}function Ivt(A,e,t){t!=null&&A.style(e,t)}function Gr(A,e,{x:t,y:i},n=Gs,o=Gs){n+=e.dx,o+=e.dy,t!=null&&t.bandwidth&&(n+=t.bandwidth()/2),i!=null&&i.bandwidth&&(o+=i.bandwidth()/2),(n||o)&&A.attr("transform",`translate(${n},${o})`)}function aa(A,e){if((A=ws(A))!==e)return A}function SS(A,e){if((A=Lo(A))!==e)return A}const Cvt=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function JO(A){if(A===void 0)return"plot-d6a7b5";if(A=`${A}`,!Cvt.test(A))throw new Error(`invalid class name: ${A}`);return A}function HuA(A,e){if(typeof e=="string")A.property("style",e);else if(e!=null)for(const t of A)Object.assign(t.style,e)}function HS({frameAnchor:A},{width:e,height:t,marginTop:i,marginRight:n,marginBottom:o,marginLeft:g}){return[/left$/.test(A)?g:/right$/.test(A)?e-n:(g+e-n)/2,/^top/.test(A)?i:/^bottom/.test(A)?t-o:(i+t-o)/2]}class ks{constructor(e,t={},i={},n){const{facet:o="auto",facetAnchor:g,fx:a,fy:s,sort:I,dx:r=0,dy:C=0,margin:l=0,marginTop:c=l,marginRight:B=l,marginBottom:E=l,marginLeft:u=l,className:d,clip:f=n==null?void 0:n.clip,channels:w,tip:y,render:G}=i;if(this.data=e,this.sort=aN(I)?I:null,this.initializer=CN(i).initializer,this.transform=this.initializer?i.transform:IN(i).transform,o===null||o===!1?this.facet=null:(this.facet=iB(o===!0?"include":o,"facet",["auto","include","exclude","super"]),this.fx=e===CO&&typeof a=="string"?[a]:a,this.fy=e===CO&&typeof s=="string"?[s]:s),this.facetAnchor=RMt(g),t=zte(t),w!==void 0&&(t={...lvt(w),...t}),n!==void 0&&(t={...Avt(this,i,n),...t}),this.channels=Object.fromEntries(Object.entries(t).map(([R,x])=>{if(cO(x.value)){const{value:F,label:Q=x.label,scale:k=x.scale}=x.value;x={...x,label:Q,scale:k,value:F}}if(e===CO&&typeof x.value=="string"){const{value:F}=x;x={...x,value:[F]}}return[R,x]}).filter(([R,{value:x,optional:F}])=>{if(x!=null)return!0;if(F)return!1;throw new Error(`missing channel value: ${R}`)})),this.dx=+r,this.dy=+C,this.marginTop=+c,this.marginRight=+B,this.marginBottom=+E,this.marginLeft=+u,this.clip=Tte(f),this.tip=cvt(y),this.className=d?JO(d):null,this.facet==="super"){if(a||s)throw new Error("super-faceting cannot use fx or fy");for(const R in this.channels){const{scale:x}=t[R];if(!(x!=="x"&&x!=="y"))throw new Error("super-faceting cannot use x or y")}}G!=null&&(this.render=Tie(G,this.render))}initialize(e,t,i){let n=gN(this.data);e===void 0&&n!=null&&(e=[Vd(n)]);const o=e;this.transform!=null&&({facets:e,data:n}=this.transform(n,e,i),n=gN(n)),e!==void 0&&(e.original=o);const g=NFt(this.channels,n);return this.sort!=null&&RFt(n,e,g,t,this.sort),{data:n,facets:e,channels:g}}filter(e,t,i){for(const n in t){const{filter:o=s0}=t[n];if(o!==null){const g=i[n];e=e.filter(a=>o(g[a]))}}return e}project(e,t,i){for(const n in e)if(e[n].scale==="x"&&/^x|x$/.test(n)){const o=n.replace(/^x|x$/,"y");o in e&&e[o].scale==="y"&&KMt(n,o,t,i.projection)}}scale(e,t,i){const n=YFt(e,t);return i.projection&&this.project(e,n,i),n}}function NO(...A){return A.plot=ks.prototype.plot,A}function Tie(A,e){if(A==null)return e===null?void 0:e;if(e==null)return A===null?void 0:A;if(typeof A!="function")throw new TypeError(`invalid render transform: ${A}`);if(typeof e!="function")throw new TypeError(`invalid render transform: ${e}`);return function(t,i,n,o,g,a){return A.call(this,t,i,n,o,g,(s,I,r,C,l)=>e.call(this,s,I,r,C,l,a))}}function lvt(A){return Object.fromEntries(Object.entries(zte(A)).map(([e,t])=>(t=typeof t=="string"?{value:t,label:e}:kS(t),t.filter===void 0&&t.scale==null&&(t={...t,filter:null}),[e,t])))}function cvt(A){return A===!0?"xy":A===!1||A==null?null:typeof A=="string"?iB(A,"tip",["x","y","xy"]):A}function QN(A,e){return(A==null?void 0:A.tip)===!0?{...A,tip:e}:Ud(A==null?void 0:A.tip)&&A.tip.pointer===void 0?{...A,tip:{...A.tip,pointer:e}}:A}function Bvt(A,e,t={}){let i=.5-Gs,n=.5+Gs,o=.5+Gs,g=.5-Gs;for(const{marginTop:E,marginRight:u,marginBottom:d,marginLeft:f}of e)E>i&&(i=E),u>n&&(n=u),d>o&&(o=d),f>g&&(g=f);let{margin:a,marginTop:s=a!==void 0?a:i,marginRight:I=a!==void 0?a:n,marginBottom:r=a!==void 0?a:o,marginLeft:C=a!==void 0?a:g}=t;s=+s,I=+I,r=+r,C=+C;let{width:l=640,height:c=Qvt(A,t,{width:l,marginTopDefault:i,marginRightDefault:n,marginBottomDefault:o,marginLeftDefault:g})+Math.max(0,s-i+r-o)}=t;l=+l,c=+c;const B={width:l,height:c,marginTop:s,marginRight:I,marginBottom:r,marginLeft:C};if(A.fx||A.fy){let{margin:E,marginTop:u=E!==void 0?E:s,marginRight:d=E!==void 0?E:I,marginBottom:f=E!==void 0?E:r,marginLeft:w=E!==void 0?E:C}=t.facet??{};u=+u,d=+d,f=+f,w=+w,B.facet={marginTop:u,marginRight:d,marginBottom:f,marginLeft:w}}return B}function Qvt({x:A,y:e,fy:t,fx:i},{projection:n,aspectRatio:o},{width:g,marginTopDefault:a,marginRightDefault:s,marginBottomDefault:I,marginLeftDefault:r}){const C=t&&t.scale.domain().length||1,l=VMt(n);if(l){const B=i?i.scale.domain().length:1,E=(1.1*C-.1)/(1.1*B-.1)*l,u=Math.max(.1,Math.min(10,E));return Math.round((g-r-s)*u+a+I)}const c=e?yw(e)?e.scale.domain().length||1:Math.max(7,17/C):1;if(o!=null){if(o=+o,!(isFinite(o)&&o>0))throw new Error(`invalid aspectRatio: ${o}`);const B=_ie("y",e)/(_ie("x",A)*o),E=i?i.scale.bandwidth():1,u=t?t.scale.bandwidth():1,d=E*(g-r-s)-A.insetLeft-A.insetRight;return(B*d+e.insetTop+e.insetBottom)/u+a+I}return!!(e||t)*Math.max(1,Math.min(60,c*C))*20+!!i*30+60}function _ie(A,e){if(!e)throw new Error(`aspectRatio requires ${A} scale`);const{type:t,domain:i}=e;let n;switch(t){case"linear":case"utc":case"time":n=Number;break;case"pow":{const a=e.scale.exponent();n=s=>Math.pow(s,a);break}case"log":n=Math.log;break;case"point":case"band":return i.length;default:throw new Error(`unsupported ${A} scale for aspectRatio: ${t}`)}const[o,g]=_C(i);return Math.abs(n(g)-n(o))}const Oie=new WeakMap;function ZuA(A,e,{x:t,y:i,px:n,py:o,maxRadius:g=40,channels:a,render:s,...I}={}){return g=+g,n!=null&&(t??(t=null),a={...a,px:{value:n,scale:"x"}}),o!=null&&(i??(i=null),a={...a,py:{value:o,scale:"y"}}),{x:t,y:i,channels:a,...I,render:Tie(function(r,C,l,c,B,E){B={...B,pointerSticky:!1};const u=B.ownerSVGElement,{data:d}=B.getMarkState(this);let f=Oie.get(u);f||Oie.set(u,f={sticky:!1,roots:[],renders:[]});let w=f.renders.push(O)-1;const{x:y,y:G,fx:R,fy:x}=C;let F=R?R(r.fx)-c.marginLeft:0,Q=x?x(r.fy)-c.marginTop:0;y!=null&&y.bandwidth&&(F+=y.bandwidth()/2),G!=null&&G.bandwidth&&(Q+=G.bandwidth()/2);const k=r.fi!=null;let h;if(k){let sA=f.facetStates;sA||(f.facetStates=sA=new Map),h=sA.get(this),h||sA.set(this,h=new Map)}const[N,v]=HS(this,c),{px:K,py:U}=l,V=K?sA=>K[sA]:jie(l,N),X=U?sA=>U[sA]:Pie(l,v);let _,q,$,nA;function j(sA,gA){if(k)if(nA&&(nA=cancelAnimationFrame(nA)),sA==null)h.delete(r.fi);else{h.set(r.fi,gA),nA=requestAnimationFrame(()=>{nA=null;for(const[iA,aA]of h)if(aA<gA||aA===gA&&iA<r.fi){sA=null;break}O(sA)});return}O(sA)}function O(sA){if(_===sA&&$===f.sticky)return;_=sA,$=B.pointerSticky=f.sticky;const gA=_==null?[]:[_];k&&(gA.fx=r.fx,gA.fy=r.fy,gA.fi=r.fi);const iA=E(gA,C,l,c,B);if(q){if(k){const aA=q.parentNode,lA=q.getAttribute("transform"),CA=iA.getAttribute("transform");lA?iA.setAttribute("transform",lA):iA.removeAttribute("transform"),CA?aA.setAttribute("transform",CA):aA.removeAttribute("transform"),iA.removeAttribute("aria-label"),iA.removeAttribute("aria-description"),iA.removeAttribute("aria-hidden")}q.replaceWith(iA)}if(f.roots[w]=q=iA,!(_==null&&(h==null?void 0:h.size)>1)){const aA=_==null?null:pw(d)?d[_]:d.get(_);B.dispatchValue(aA)}return iA}function eA(sA){if(f.sticky||sA.pointerType==="mouse"&&sA.buttons===1)return;let[gA,iA]=ERt(sA);gA-=F,iA-=Q;const aA=gA<c.marginLeft||gA>c.width-c.marginRight?1:A,lA=iA<c.marginTop||iA>c.height-c.marginBottom?1:e;let CA=null,QA=g*g;for(const uA of r){const fA=aA*(V(uA)-gA),hA=lA*(X(uA)-iA),yA=fA*fA+hA*hA;yA<=QA&&(CA=uA,QA=yA)}if(CA!=null&&(A!==1||e!==1)){const uA=V(CA)-gA,fA=X(CA)-iA;QA=uA*uA+fA*fA}j(CA,QA)}function oA(sA){sA.pointerType==="mouse"&&_!=null&&(f.sticky&&f.roots.some(gA=>gA==null?void 0:gA.contains(sA.target))||(f.sticky?(f.sticky=!1,f.renders.forEach(gA=>gA(null))):(f.sticky=!0,O(_)),sA.stopImmediatePropagation()))}function tA(sA){sA.pointerType==="mouse"&&(f.sticky||j(null))}return u.addEventListener("pointerenter",eA),u.addEventListener("pointermove",eA),u.addEventListener("pointerdown",oA),u.addEventListener("pointerleave",tA),O(null)},s)}}function Evt(A){return ZuA(1,1,A)}function uvt(A){return ZuA(1,.01,A)}function qie(A){return ZuA(.01,1,A)}function jie({x1:A,x2:e,x:t=A},i){return A&&e?n=>(A[n]+e[n])/2:t?n=>t[n]:()=>i}function Pie({y1:A,y2:e,y:t=A},i){return A&&e?n=>(A[n]+e[n])/2:t?n=>t[n]:()=>i}function $ie(A){return yw(A)&&A.interval===void 0?void 0:"tabular-nums"}function dvt(A,e){let{label:t=A.label,tickSize:i=6,width:n=240,height:o=44+i,marginTop:g=18,marginRight:a=0,marginBottom:s=16+i,marginLeft:I=0,style:r,ticks:C=(n-I-a)/64,tickFormat:l,fontVariant:c=$ie(A),round:B=!0,opacity:E,className:u}=e;const d=vuA(e);u=JO(u),E=Ds(E)[1],l===null&&(l=()=>null);const f=Ho("svg",d).attr("class",`${u}-ramp`).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",n).attr("height",o).attr("viewBox",`0 0 ${n} ${o}`).call(N=>N.append("style").text(`:where(.${u}-ramp) {
  display: block;
  height: auto;
  height: intrinsic;
  max-width: 100%;
  overflow: visible;
}
:where(.${u}-ramp text) {
  white-space: pre;
}`)).call(HuA,r);let w=N=>N.selectAll(".tick line").attr("y1",g+s-o),y;const G=B?(N,v)=>N.rangeRound(v):(N,v)=>N.range(v),{type:R,domain:x,range:F,interpolate:Q,scale:k,pivot:h}=A;if(Q){const N=F===void 0?Q:oJ(Q.length===1?puA(Q):Q,F);y=G(k.copy(),qC($g(I,n-a),Math.min(x.length+(h!==void 0),F===void 0?1/0:F.length)));const v=256,K=d.document.createElement("canvas");K.width=v,K.height=1;const U=K.getContext("2d");for(let V=0,X=v-1;V<v;++V)U.fillStyle=N(V/X),U.fillRect(V,0,1,1);f.append("image").attr("opacity",E).attr("x",I).attr("y",g).attr("width",n-I-a).attr("height",o-g-s).attr("preserveAspectRatio","none").attr("xlink:href",K.toDataURL())}else if(R==="threshold"){const N=x,v=l===void 0?K=>K:typeof l=="string"?Ec(l):l;y=G(bM().domain([-1,F.length-1]),[I,n-a]),f.append("g").attr("fill-opacity",E).selectAll().data(F).enter().append("rect").attr("x",(K,U)=>y(U-1)).attr("y",g).attr("width",(K,U)=>y(U)-y(U-1)).attr("height",o-g-s).attr("fill",K=>K),C=So(N,(K,U)=>U),l=K=>v(N[K],K)}else y=G(p9().domain(x),[I,n-a]),f.append("g").attr("fill-opacity",E).selectAll().data(x).enter().append("rect").attr("x",y).attr("y",g).attr("width",Math.max(0,y.bandwidth()-1)).attr("height",o-g-s).attr("fill",k),w=()=>{};return f.append("g").attr("transform",`translate(0,${o-s})`).call(vNt(y).ticks(Array.isArray(C)?null:C,typeof l=="string"?l:void 0).tickFormat(typeof l=="function"?l:void 0).tickSize(i).tickValues(Array.isArray(C)?C:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",aa(c,"normal")).call(w).call(N=>N.select(".domain").remove()),t!==void 0&&f.append("text").attr("x",I).attr("y",g-6).attr("fill","currentColor").attr("font-weight","bold").text(t),f.node()}const Ane=Math.PI/180;function YO(A,{marker:e,markerStart:t=e,markerMid:i=e,markerEnd:n=e}={}){A.markerStart=WuA(t),A.markerMid=WuA(i),A.markerEnd=WuA(n)}function WuA(A){if(A==null||A===!1)return null;if(A===!0)return tne;if(typeof A=="function")return A;switch(`${A}`.toLowerCase()){case"none":return null;case"arrow":return ene("auto");case"arrow-reverse":return ene("auto-start-reverse");case"dot":return hvt;case"circle":case"circle-fill":return tne;case"circle-stroke":return mvt;case"tick":return KuA("auto");case"tick-x":return KuA(90);case"tick-y":return KuA(0)}throw new Error(`invalid marker: ${A}`)}function ene(A){return(e,t)=>Ho("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient",A).attr("fill","none").attr("stroke",e).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(i=>i.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function hvt(A,e){return Ho("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",A).attr("stroke","none").call(t=>t.append("circle").attr("r",2.5)).node()}function tne(A,e){return Ho("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",A).attr("stroke","var(--plot-background)").attr("stroke-width",1.5).call(t=>t.append("circle").attr("r",3)).node()}function mvt(A,e){return Ho("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","var(--plot-background)").attr("stroke",A).attr("stroke-width",1.5).call(t=>t.append("circle").attr("r",3)).node()}function KuA(A){return(e,t)=>Ho("svg:marker",t).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",A).attr("stroke",e).call(i=>i.append("path").attr("d","M0,-3v6")).node()}let pvt=0;function UuA(A,e,{stroke:t},i){return nne(A,e,t&&(n=>t[n]),null,i)}function fvt(A,e,{stroke:t,z:i},n){return nne(A,e,t&&(([o])=>t[o]),i,n)}const VuA=1,ine=2;function yvt(A,e){const t=new Uint8Array(e.length),i=A.data().filter(o=>o.length>1),n=i.length;for(let o=0,g=LuA;o<n;++o){const a=i[o];if(a.length>1){const s=a[0];g!==(g=Xd(e[s]))&&(t[s]|=VuA)}}for(let o=n-1,g=LuA;o>=0;--o){const a=i[o];if(a.length>1){const s=a[0];g!==(g=Xd(e[s]))&&(t[s]|=ine)}}return([o])=>t[o]}function nne(A,{markerStart:e,markerMid:t,markerEnd:i,stroke:n},o=()=>n,g,a){if(!e&&!t&&!i)return;const s=new Map,I=g&&yvt(A,g);function r(C,l,c){return function(B){if(c&&!c(B))return;const E=o(B);let u=s.get(l);u||s.set(l,u=new Map);let d=u.get(E);if(!d){const f=this.parentNode.insertBefore(l(E,a),this),w=`plot-marker-${++pvt}`;f.setAttribute("id",w),u.set(E,d=`url(#${w})`)}this.setAttribute(C,d)}}e&&A.each(r("marker-start",e,I&&(C=>I(C)&VuA))),t&&I&&A.each(r("marker-start",t,C=>!(I(C)&VuA))),t&&A.each(r("marker-mid",t)),i&&A.each(r("marker-end",i,I&&(C=>I(C)&ine)))}function RO({inset:A,insetLeft:e,insetRight:t,...i}={}){return[e,t]=one(A,e,t),{inset:A,insetLeft:e,insetRight:t,...i}}function xO({inset:A,insetTop:e,insetBottom:t,...i}={}){return[e,t]=one(A,e,t),{inset:A,insetTop:e,insetBottom:t,...i}}function one(A,e,t){return A===void 0&&e===void 0&&t===void 0?Gs?[1,0]:[.5,.5]:[e,t]}function gne(A,{interval:e}){return A={...kS(A)},A.interval=iuA(A.interval===void 0?e:A.interval),A}function FO(A,e,t,i){const{[A]:n,[`${A}1`]:o,[`${A}2`]:g}=t,{value:a,interval:s}=gne(n,t);if(a==null||s==null&&!i)return t;const I=fw(n);if(s==null){let c;const B={transform:E=>c||(c=Gn(E,a)),label:I};return{...t,[A]:void 0,[`${A}1`]:o===void 0?B:o,[`${A}2`]:g===void 0&&!(o===g&&i)?B:g}}let r,C;function l(c){return C!==void 0&&c===r?C:C=So(Gn(r=c,a),B=>s.floor(B))}return e({...t,[A]:void 0,[`${A}1`]:o===void 0?{transform:l,label:I}:o,[`${A}2`]:g===void 0?{transform:c=>l(c).map(B=>s.offset(B)),label:I}:g})}function ane(A,e,t){const{[A]:i}=t,{value:n,interval:o}=gne(i,t);return n==null||o==null?t:e({...t,[A]:{label:fw(i),transform:g=>{const a=So(Gn(g,n),I=>o.floor(I)),s=a.map(I=>o.offset(I));return a.map(br(a)?(I,r)=>I==null||isNaN(I=+I)||(r=s[r],r==null)||isNaN(r=+r)?void 0:new Date((I+r)/2):(I,r)=>I==null||(r=s[r],r==null)?NaN:(+I+ +r)/2)}}})}function bvt(A={}){return FO("x",RO,A,!0)}function wvt(A={}){return FO("y",xO,A,!0)}function sne(A={}){return FO("x",RO,A)}function rne(A={}){return FO("y",xO,A)}function Dvt(A={}){return ane("x",RO,A)}function Gvt(A={}){return ane("y",xO,A)}const Ine={ariaLabel:"rule",fill:null,stroke:"currentColor"};class kvt extends ks{constructor(e,t={}){const{x:i,y1:n,y2:o,inset:g=0,insetTop:a=g,insetBottom:s=g}=t;super(e,{x:{value:i,scale:"x",optional:!0},y1:{value:n,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},QN(t,"x"),Ine),this.insetTop=Lo(a),this.insetBottom=Lo(s),YO(this,t)}render(e,t,i,n,o){const{x:g,y:a}=t,{x:s,y1:I,y2:r}=i,{width:C,height:l,marginTop:c,marginRight:B,marginLeft:E,marginBottom:u}=n,{insetTop:d,insetBottom:f}=this;return Ho("svg:g",o).call(yl,this,n,o).call(Gr,this,{x:s&&g},Gs,0).call(w=>w.selectAll().data(e).enter().append("line").call(Dr,this).attr("x1",s?y=>s[y]:(E+C-B)/2).attr("x2",s?y=>s[y]:(E+C-B)/2).attr("y1",I&&!iE(a)?y=>I[y]+d:c+d).attr("y2",r&&!iE(a)?a.bandwidth?y=>r[y]+a.bandwidth()-f:y=>r[y]-f:l-u-f).call(oB,this,i).call(UuA,this,i,o)).node()}}class Jvt extends ks{constructor(e,t={}){const{x1:i,x2:n,y:o,inset:g=0,insetRight:a=g,insetLeft:s=g}=t;super(e,{y:{value:o,scale:"y",optional:!0},x1:{value:i,scale:"x",optional:!0},x2:{value:n,scale:"x",optional:!0}},QN(t,"y"),Ine),this.insetRight=Lo(a),this.insetLeft=Lo(s),YO(this,t)}render(e,t,i,n,o){const{x:g,y:a}=t,{y:s,x1:I,x2:r}=i,{width:C,height:l,marginTop:c,marginRight:B,marginLeft:E,marginBottom:u}=n,{insetLeft:d,insetRight:f}=this;return Ho("svg:g",o).call(yl,this,n,o).call(Gr,this,{y:s&&a},0,Gs).call(w=>w.selectAll().data(e).enter().append("line").call(Dr,this).attr("x1",I&&!iE(g)?y=>I[y]+d:E+d).attr("x2",r&&!iE(g)?g.bandwidth?y=>r[y]+g.bandwidth()-f:y=>r[y]-f:C-B-f).attr("y1",s?y=>s[y]:(c+l-u)/2).attr("y2",s?y=>s[y]:(c+l-u)/2).call(oB,this,i).call(UuA,this,i,o)).node()}}function XuA(A,e){let{x:t=Vi,y:i,y1:n,y2:o,...g}=rne(e);return[n,o]=Cne(i,n,o),new kvt(A,{...g,x:t,y1:n,y2:o})}function zuA(A,e){let{y:t=Vi,x:i,x1:n,x2:o,...g}=sne(e);return[n,o]=Cne(i,n,o),new Jvt(A,{...g,y:t,x1:n,x2:o})}function Cne(A,e,t){if(A==null){if(e===void 0){if(t!==void 0)return[0,t]}else if(t===void 0)return[0,e]}else{if(e===void 0)return t===void 0?[0,A]:[A,t];if(t===void 0)return[A,e]}return[e,t]}function TuA(A,...e){let t=e.length;for(let i=0,n=!0;i<t;++i)typeof e[i]!="function"&&(n&&(A=A.slice(),n=!1),A.splice(i,2,A[i]+e[i]+A[i+1]),e.splice(i,1),--i,--t);return i=>{let n=A[0];for(let o=0;o<t;++o)n+=e[o](i)+A[o+1];return n}}const Nvt={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},lne="­";class _uA extends ks{constructor(e,t={}){const{x:i,y:n,text:o=c0(e)&&Vte(e)?Vi:Wd,frameAnchor:g,textAnchor:a=/right$/i.test(g)?"end":/left$/i.test(g)?"start":"middle",lineAnchor:s=/^top/i.test(g)?"top":/^bottom/i.test(g)?"bottom":"middle",lineHeight:I=1,lineWidth:r=1/0,textOverflow:C,monospace:l,fontFamily:c=l?"ui-monospace, monospace":void 0,fontSize:B,fontStyle:E,fontVariant:u,fontWeight:d,rotate:f}=t,[w,y]=Ds(f,0),[G,R]=vvt(B);if(super(e,{x:{value:i,scale:"x",optional:!0},y:{value:n,scale:"y",optional:!0},fontSize:{value:G,optional:!0},rotate:{value:Oxt(w),optional:!0},text:{value:o,filter:VEA,optional:!0}},t,Nvt),this.rotate=y,this.textAnchor=aa(a,"middle"),this.lineAnchor=iB(s,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+I,this.lineWidth=+r,this.textOverflow=cne(C),this.monospace=!!l,this.fontFamily=ws(c),this.fontSize=R,this.fontStyle=ws(E),this.fontVariant=ws(u),this.fontWeight=ws(d),this.frameAnchor=hO(g),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${r}`);this.splitLines=Ene(this),this.clipLine=une(this)}render(e,t,i,n,o){const{x:g,y:a}=t,{x:s,y:I,rotate:r,text:C,title:l,fontSize:c}=i,{rotate:B}=this,[E,u]=HS(this,n);return Ho("svg:g",o).call(yl,this,n,o).call(Bne,this,C,n).call(Gr,this,{x:s&&g,y:I&&a}).call(d=>d.selectAll().data(e).enter().append("text").call(Dr,this).call(Yvt,this,C,l).attr("transform",TuA`translate(${s?f=>s[f]:E},${I?f=>I[f]:u})${r?f=>` rotate(${r[f]})`:B?` rotate(${B})`:""}`).call(Pe,"font-size",c&&(f=>c[f])).call(oB,this,i)).node()}}function cne(A){return A==null?null:iB(A,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function Yvt(A,e,t,i){if(!t)return;const{lineAnchor:n,lineHeight:o,textOverflow:g,splitLines:a,clipLine:s}=e;A.each(function(I){const r=a(BN(t[I])??"").map(s),C=r.length,l=n==="top"?.71:n==="bottom"?1-C:(164-C*100)/200;if(C>1){let c=0;for(let B=0;B<C;++B){if(++c,!r[B])continue;const E=this.ownerDocument.createElementNS(O2.svg,"tspan");E.setAttribute("x",0),B===c-1?E.setAttribute("y",`${(l+B)*o}em`):E.setAttribute("dy",`${c*o}em`),E.textContent=r[B],this.appendChild(E),c=0}}else l&&this.setAttribute("y",`${l*o}em`),this.textContent=r[0];if(g&&!i&&r[0]!==t[I]){const c=this.ownerDocument.createElementNS(O2.svg,"title");c.textContent=t[I],this.appendChild(c)}})}function OuA(A,{x:e,y:t,...i}={}){return i.frameAnchor===void 0&&([e,t]=tuA(e,t)),new _uA(A,{...i,x:e,y:t})}function Rvt(A,{x:e=Vi,...t}={}){return new _uA(A,Gvt({...t,x:e}))}function xvt(A,{y:e=Vi,...t}={}){return new _uA(A,Dvt({...t,y:e}))}function Bne(A,e,t){Pe(A,"text-anchor",e.textAnchor),Pe(A,"font-family",e.fontFamily),Pe(A,"font-size",e.fontSize),Pe(A,"font-style",e.fontStyle),Pe(A,"font-variant",e.fontVariant===void 0?Fvt(t):e.fontVariant),Pe(A,"font-weight",e.fontWeight)}function Fvt(A){return A&&(Pxt(A)||br(A))?"tabular-nums":void 0}const Mvt=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function vvt(A){return A==null||typeof A=="number"?[void 0,A]:typeof A!="string"?[A,void 0]:(A=A.trim().toLowerCase(),Mvt.has(A)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(A)?[void 0,A]:[A,void 0])}function Lvt(A,e,t){const i=[];let n,o=0;for(const[g,a,s]of Svt(A)){if(n===void 0&&(n=g),o>n&&t(A,n,a)>e&&(i.push(A.slice(n,o)+(A[o-1]===lne?"-":"")),n=g),s){i.push(A.slice(n,a)),n=void 0;continue}o=a}return i}function*Svt(A){let e=0,t=0;const i=A.length;for(;t<i;){let n=1;switch(A[t]){case lne:case"-":++t,yield[e,t,!1],e=t;break;case" ":for(yield[e,t,!1];A[++t]===" ";);e=t;break;case"\r":A[t+1]===`
`&&++n;case`
`:yield[e,t,!0],t+=n,e=t;break;default:++t;break}}yield[e,t,!0]}const Qne={a:56,b:63,c:57,d:63,e:58,f:37,g:62,h:60,i:26,j:26,k:55,l:26,m:88,n:60,o:60,p:62,q:62,r:39,s:54,t:38,u:60,v:55,w:79,x:54,y:55,z:55,A:69,B:67,C:73,D:74,E:61,F:58,G:76,H:75,I:28,J:55,K:67,L:58,M:89,N:75,O:78,P:65,Q:78,R:67,S:65,T:65,U:75,V:69,W:98,X:69,Y:67,Z:67,0:64,1:48,2:62,3:64,4:66,5:63,6:65,7:58,8:65,9:65," ":29,"!":32,'"':49,"'":31,"(":39,")":39,",":31,"-":48,".":31,"/":32,":":31,";":31,"?":52,"‘":31,"’":31,"“":47,"”":47,"…":82};function quA(A,e=0,t=A.length){let i=0;for(let n=e;n<t;n=dN(A,n))i+=Qne[A[n]]??(fne(A,n)?120:Qne.e);return i}function juA(A,e=0,t=A.length){let i=0;for(let n=e;n<t;n=dN(A,n))i+=fne(A,n)?126:63;return i}function Ene({monospace:A,lineWidth:e,textOverflow:t}){if(t!=null||e==1/0)return o=>o.split(/\r\n?|\n/g);const i=A?juA:quA,n=e*100;return o=>Lvt(o,n,i)}function une({monospace:A,lineWidth:e,textOverflow:t}){if(t==null||e==1/0)return o=>o;const i=A?juA:quA,n=e*100;switch(t){case"clip-start":return o=>hne(o,n,i,"");case"clip-end":return o=>dne(o,n,i,"");case"ellipsis-start":return o=>hne(o,n,i,EN);case"ellipsis-middle":return o=>Hvt(o,n,i,EN);case"ellipsis-end":return o=>dne(o,n,i,EN)}}const EN="…";function uN(A,e,t,i){const n=[];let o=0;for(let g=0,a=0,s=A.length;g<s;g=a){a=dN(A,g);const I=t(A,g,a);if(o+I>e){for(o+=i;o>e&&g>0;)a=g,g=n.pop(),o-=t(A,g,a);return[g,e-o]}o+=I,n.push(g)}return[-1,0]}function dne(A,e,t,i){A=A.trim();const n=t(i),[o]=uN(A,e,t,n);return o<0?A:A.slice(0,o).trimEnd()+i}function Hvt(A,e,t,i){A=A.trim();const n=t(A);if(n<=e)return A;const o=t(i)/2,[g,a]=uN(A,e/2,t,o),[s]=uN(A,n-e/2-a+o,t,-o);return s<0?i:A.slice(0,g).trimEnd()+i+A.slice(dN(A,s)).trimStart()}function hne(A,e,t,i){A=A.trim();const n=t(A);if(n<=e)return A;const o=t(i),[g]=uN(A,n-e+o,t,-o);return g<0?i:i+A.slice(dN(A,g)).trimStart()}const PuA=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,mne=/\p{Extended_Pictographic}/uy;function dN(A,e){return e+=Zvt(A,e)?2:1,Kvt(A,e)&&(e=PuA.lastIndex),Wvt(A,e)?dN(A,e+1):e}function pne(A,e){return A.charCodeAt(e)<128}function Zvt(A,e){const t=A.charCodeAt(e);if(t>=55296&&t<56320){const i=A.charCodeAt(e+1);return i>=56320&&i<57344}return!1}function Wvt(A,e){return A.charCodeAt(e)===8205}function Kvt(A,e){return pne(A,e)?!1:(PuA.lastIndex=e,PuA.test(A))}function fne(A,e){return pne(A,e)?!1:(mne.lastIndex=e,mne.test(A))}const Uvt={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},yne=3.5,Vvt=yne*5,bne={draw(A,e,t){const i=e*t/Vvt;A.moveTo(0,0),A.lineTo(0,-e),A.moveTo(-i,i-e),A.lineTo(0,-e),A.lineTo(i,i-e)}},Xvt={draw(A,e,t){A.moveTo(-t,0),A.lineTo(0,-e),A.lineTo(t,0)}},zvt=new Map([["arrow",bne],["spike",Xvt]]);function Tvt(A){return A&&typeof A.draw=="function"}function _vt(A){if(Tvt(A))return A;const e=zvt.get(`${A}`.toLowerCase());if(e)return e;throw new Error(`invalid shape: ${A}`)}class wne extends ks{constructor(e,t={}){const{x:i,y:n,r:o=yne,length:g,rotate:a,shape:s=bne,anchor:I="middle",frameAnchor:r}=t,[C,l]=Ds(g,12),[c,B]=Ds(a,0);super(e,{x:{value:i,scale:"x",optional:!0},y:{value:n,scale:"y",optional:!0},length:{value:C,scale:"length",optional:!0},rotate:{value:c,optional:!0}},t,Uvt),this.r=+o,this.length=l,this.rotate=B,this.shape=_vt(s),this.anchor=iB(I,"anchor",["start","middle","end"]),this.frameAnchor=hO(r)}render(e,t,i,n,o){const{x:g,y:a}=t,{x:s,y:I,length:r,rotate:C}=i,{length:l,rotate:c,anchor:B,shape:E,r:u}=this,[d,f]=HS(this,n);return Ho("svg:g",o).call(yl,this,n,o).call(Gr,this,{x:s&&g,y:I&&a}).call(w=>w.selectAll().data(e).enter().append("path").call(Dr,this).attr("transform",TuA`translate(${s?y=>s[y]:d},${I?y=>I[y]:f})${C?y=>` rotate(${C[y]})`:c?` rotate(${c})`:""}${B==="start"?"":B==="end"?r?y=>` translate(0,${r[y]})`:` translate(0,${l})`:r?y=>` translate(0,${r[y]/2})`:` translate(0,${l/2})`}`).attr("d",r?y=>{const G=Ib();return E.draw(G,r[y],u),G}:(()=>{const y=Ib();return E.draw(y,l,u),y})()).call(oB,this,i)).node()}}function Ovt(A,e={}){const{x:t=Vi,...i}=e;return new wne(A,{...i,x:t})}function qvt(A,e={}){const{y:t=Vi,...i}=e;return new wne(A,{...i,y:t})}function E0(A,e){return arguments.length<2&&!c0(A)&&(e=A,A=null),e===void 0&&(e={}),[A,e]}function MO({anchor:A}={},e){return A===void 0?e[0]:iB(A,"anchor",e)}function Dne(A){return MO(A,["left","right"])}function Gne(A){return MO(A,["right","left"])}function kne(A){return MO(A,["bottom","top"])}function Jne(A){return MO(A,["top","bottom"])}function Nne(){const[A,e]=E0(...arguments);return Rne("y",Dne(e),A,e)}function jvt(){const[A,e]=E0(...arguments);return Rne("fy",Gne(e),A,e)}function Yne(){const[A,e]=E0(...arguments);return xne("x",kne(e),A,e)}function Pvt(){const[A,e]=E0(...arguments);return xne("fx",Jne(e),A,e)}function Rne(A,e,t,{color:i="currentColor",opacity:n=1,stroke:o=i,strokeOpacity:g=n,strokeWidth:a=1,fill:s=i,fillOpacity:I=n,textAnchor:r,textStroke:C,textStrokeOpacity:l,textStrokeWidth:c,tickSize:B=A==="y"?6:0,tickPadding:E,tickRotate:u,x:d,margin:f,marginTop:w=f===void 0?20:f,marginRight:y=f===void 0?e==="right"?40:0:f,marginBottom:G=f===void 0?20:f,marginLeft:R=f===void 0?e==="left"?40:0:f,label:x,labelAnchor:F,labelArrow:Q,labelOffset:k,...h}){return B=Lo(B),E=Lo(E),u=Lo(u),F!==void 0&&(F=iB(F,"labelAnchor",["center","top","bottom"])),Q=Wne(Q),NO(B&&!wr(o)?$vt(A,e,t,{stroke:o,strokeOpacity:g,strokeWidth:a,tickSize:B,tickPadding:E,tickRotate:u,x:d,...h}):null,wr(s)?null:eLt(A,e,t,{fill:s,fillOpacity:I,stroke:C,strokeOpacity:l,strokeWidth:c,textAnchor:r,tickSize:B,tickPadding:E,tickRotate:u,x:d,marginTop:w,marginRight:y,marginBottom:G,marginLeft:R,...h}),!wr(s)&&x!==null?OuA([],Lne({fill:s,fillOpacity:I,...h},function(N,v,K,U,V){const X=U[A],{marginTop:_,marginRight:q,marginBottom:$,marginLeft:nA}=A==="y"&&V.inset||V,j=F??(X.bandwidth?"center":"top"),O=k??(e==="right"?q:nA)-3;return j==="center"?(this.textAnchor=void 0,this.lineAnchor=e==="right"?"bottom":"top",this.frameAnchor=e,this.rotate=-90):(this.textAnchor=e==="right"?"end":"start",this.lineAnchor=j,this.frameAnchor=`${j}-${e}`,this.rotate=0),this.dy=j==="top"?3-_:j==="bottom"?$-3:0,this.dx=e==="right"?O:-O,this.ariaLabel=`${A}-axis label`,{facets:[[0]],channels:{text:{value:[Zne(A,X,{anchor:e,label:x,labelAnchor:j,labelArrow:Q})]}}}})):null)}function xne(A,e,t,{color:i="currentColor",opacity:n=1,stroke:o=i,strokeOpacity:g=n,strokeWidth:a=1,fill:s=i,fillOpacity:I=n,textAnchor:r,textStroke:C,textStrokeOpacity:l,textStrokeWidth:c,tickSize:B=A==="x"?6:0,tickPadding:E,tickRotate:u,y:d,margin:f,marginTop:w=f===void 0?e==="top"?30:0:f,marginRight:y=f===void 0?20:f,marginBottom:G=f===void 0?e==="bottom"?30:0:f,marginLeft:R=f===void 0?20:f,label:x,labelAnchor:F,labelArrow:Q,labelOffset:k,...h}){return B=Lo(B),E=Lo(E),u=Lo(u),F!==void 0&&(F=iB(F,"labelAnchor",["center","left","right"])),Q=Wne(Q),NO(B&&!wr(o)?ALt(A,e,t,{stroke:o,strokeOpacity:g,strokeWidth:a,tickSize:B,tickPadding:E,tickRotate:u,y:d,...h}):null,wr(s)?null:tLt(A,e,t,{fill:s,fillOpacity:I,stroke:C,strokeOpacity:l,strokeWidth:c,textAnchor:r,tickSize:B,tickPadding:E,tickRotate:u,y:d,marginTop:w,marginRight:y,marginBottom:G,marginLeft:R,...h}),!wr(s)&&x!==null?OuA([],Lne({fill:s,fillOpacity:I,...h},function(N,v,K,U,V){const X=U[A],{marginTop:_,marginRight:q,marginBottom:$,marginLeft:nA}=A==="x"&&V.inset||V,j=F??(X.bandwidth?"center":"right"),O=k??(e==="top"?_:$)-3;return j==="center"?(this.frameAnchor=e,this.textAnchor=void 0):(this.frameAnchor=`${e}-${j}`,this.textAnchor=j==="right"?"end":"start"),this.lineAnchor=e,this.dy=e==="top"?-O:O,this.dx=j==="right"?q-3:j==="left"?3-nA:0,this.ariaLabel=`${A}-axis label`,{facets:[[0]],channels:{text:{value:[Zne(A,X,{anchor:e,label:x,labelAnchor:j,labelArrow:Q})]}}}})):null)}function $vt(A,e,t,{strokeWidth:i=1,strokeLinecap:n=null,strokeLinejoin:o=null,facetAnchor:g=e+(A==="y"?"-empty":""),frameAnchor:a=e,tickSize:s,inset:I=0,insetLeft:r=I,insetRight:C=I,dx:l=0,y:c=A==="y"?void 0:null,...B}){return hN(qvt,A,t,{ariaLabel:`${A}-axis tick`,ariaHidden:!0},{strokeWidth:i,strokeLinecap:n,strokeLinejoin:o,facetAnchor:g,frameAnchor:a,y:c,...B,dx:e==="left"?+l-Gs+ +r:+l+Gs-C,anchor:"start",length:s,shape:e==="left"?ILt:CLt})}function ALt(A,e,t,{strokeWidth:i=1,strokeLinecap:n=null,strokeLinejoin:o=null,facetAnchor:g=e+(A==="x"?"-empty":""),frameAnchor:a=e,tickSize:s,inset:I=0,insetTop:r=I,insetBottom:C=I,dy:l=0,x:c=A==="x"?void 0:null,...B}){return hN(Ovt,A,t,{ariaLabel:`${A}-axis tick`,ariaHidden:!0},{strokeWidth:i,strokeLinejoin:o,strokeLinecap:n,facetAnchor:g,frameAnchor:a,x:c,...B,dy:e==="bottom"?+l-Gs-C:+l+Gs+ +r,anchor:"start",length:s,shape:e==="bottom"?sLt:rLt})}function eLt(A,e,t,{facetAnchor:i=e+(A==="y"?"-empty":""),frameAnchor:n=e,tickSize:o,tickRotate:g=0,tickPadding:a=Math.max(3,9-o)+(Math.abs(g)>60?4*Math.cos(g*Ane):0),text:s,textAnchor:I=Math.abs(g)>60?"middle":e==="left"?"end":"start",lineAnchor:r=g>60?"top":g<-60?"bottom":"middle",fontVariant:C,inset:l=0,insetLeft:c=l,insetRight:B=l,dx:E=0,y:u=A==="y"?void 0:null,...d}){return hN(xvt,A,t,{ariaLabel:`${A}-axis tick label`},{facetAnchor:i,frameAnchor:n,text:s,textAnchor:I,lineAnchor:r,fontVariant:C,rotate:g,y:u,...d,dx:e==="left"?+E-o-a+ +c:+E+ +o+ +a-B},function(f,w,y,G,R){C===void 0&&(this.fontVariant=Hne(f)),s===void 0&&(R.text=Sne(f,w,y,G,e))})}function tLt(A,e,t,{facetAnchor:i=e+(A==="x"?"-empty":""),frameAnchor:n=e,tickSize:o,tickRotate:g=0,tickPadding:a=Math.max(3,9-o)+(Math.abs(g)>=10?4*Math.cos(g*Ane):0),text:s,textAnchor:I=Math.abs(g)>=10?g<0^e==="bottom"?"start":"end":"middle",lineAnchor:r=Math.abs(g)>=10?"middle":e==="bottom"?"top":"bottom",fontVariant:C,inset:l=0,insetTop:c=l,insetBottom:B=l,dy:E=0,x:u=A==="x"?void 0:null,...d}){return hN(Rvt,A,t,{ariaLabel:`${A}-axis tick label`},{facetAnchor:i,frameAnchor:n,text:s===void 0?null:s,textAnchor:I,lineAnchor:r,fontVariant:C,rotate:g,x:u,...d,dy:e==="bottom"?+E+ +o+ +a-B:+E-o-a+ +c},function(f,w,y,G,R){C===void 0&&(this.fontVariant=Hne(f)),s===void 0&&(R.text=Sne(f,w,y,G,e))})}function iLt(){const[A,e]=E0(...arguments);return Fne("y",Dne(e),A,e)}function nLt(){const[A,e]=E0(...arguments);return Fne("fy",Gne(e),A,e)}function oLt(){const[A,e]=E0(...arguments);return Mne("x",kne(e),A,e)}function gLt(){const[A,e]=E0(...arguments);return Mne("fx",Jne(e),A,e)}function Fne(A,e,t,{y:i=A==="y"?void 0:null,x:n=null,x1:o=e==="left"?n:null,x2:g=e==="right"?n:null,...a}){return hN(zuA,A,t,{ariaLabel:`${A}-grid`,ariaHidden:!0},{y:i,x1:o,x2:g,...vne(a)})}function Mne(A,e,t,{x:i=A==="x"?void 0:null,y:n=null,y1:o=e==="top"?n:null,y2:g=e==="bottom"?n:null,...a}){return hN(XuA,A,t,{ariaLabel:`${A}-grid`,ariaHidden:!0},{x:i,y1:o,y2:g,...vne(a)})}function vne({color:A="currentColor",opacity:e=.1,stroke:t=A,strokeOpacity:i=e,strokeWidth:n=1,...o}){return{stroke:t,strokeOpacity:i,strokeWidth:n,...o}}function Lne({fill:A,fillOpacity:e,fontFamily:t,fontSize:i,fontStyle:n,fontVariant:o,fontWeight:g,monospace:a,pointerEvents:s,shapeRendering:I,clip:r=!1},C){return[,A]=tB(A),[,e]=Ds(e),{facet:"super",x:null,y:null,fill:A,fillOpacity:e,fontFamily:t,fontSize:i,fontStyle:n,fontVariant:o,fontWeight:g,monospace:a,pointerEvents:s,shapeRendering:I,clip:r,initializer:C}}function hN(A,e,t,i,n,o){let g;function a(r,C,l,c,B,E){const u=r==null&&(e==="fx"||e==="fy"),{[e]:d}=c;if(!d)throw new Error(`missing scale: ${e}`);const f=d.domain();let{interval:w,ticks:y,tickFormat:G,tickSpacing:R=e==="x"?80:35}=n;if(typeof y=="string"&&Kne(d)&&(w=y,y=void 0),y===void 0&&(y=sN(w,d.type)??aLt(d,R)),r==null){if(c0(y))r=l0(y);else if(rN(y))r=AdA(y,..._C(f));else if(d.interval){let F=d.interval;if(d.ticks){const[Q,k]=_C(f),h=(k-Q)/F[yS];F=kte(F,h/y)??F,r=AdA(F,Q,k)}else{r=f;const Q=r.length;F=kte(F,Q/y)??F,F!==d.interval&&(r=AdA(F,..._C(r)))}if(F===d.interval){const Q=Math.round(r.length/y);Q>1&&(r=r.filter((k,h)=>h%Q===0))}}else d.ticks?r=d.ticks(y):r=f;if(!d.ticks&&r.length&&r!==f){const F=new qm(f);r=r.filter(Q=>F.has(Q)),r.length||B0(`Warning: the ${e}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}e==="y"||e==="x"?C=[Vd(r)]:g[e]={scale:e,value:Vi}}o==null||o.call(this,d,r,y,G,g);const x=Object.fromEntries(Object.entries(g).map(([F,Q])=>[F,{...Q,value:Gn(r,Q.value)}]));return u&&(C=E.filterFacets(r,x)),{data:r,facets:C,channels:x}}const s=CN(n).initializer,I=A(t,CN({...n,initializer:a},s));return t==null?(g=I.channels,I.channels={}):g={},i!==void 0&&Object.assign(I,i),I.clip===void 0&&(I.clip=!1),I}function aLt(A,e){const[t,i]=_C(A.range());return(i-t)/e}function Sne(A,e,t,i,n){return{value:$uA(A,e,t,i,n)}}function $uA(A,e,t,i,n){return typeof i=="function"&&!(A.type==="log"&&A.tickFormat)?i:i===void 0&&e&&br(e)?vxt(A.type,e,n)??BN:A.tickFormat?A.tickFormat(typeof t=="number"?t:null,i):i===void 0?BN:typeof i=="string"?(br(A.domain())?lJ:Ec)(i):Kd(i)}function AdA(A,e,t){return A.range(e,A.offset(A.floor(t)))}const sLt={draw(A,e){A.moveTo(0,0),A.lineTo(0,e)}},rLt={draw(A,e){A.moveTo(0,0),A.lineTo(0,-e)}},ILt={draw(A,e){A.moveTo(0,0),A.lineTo(-e,0)}},CLt={draw(A,e){A.moveTo(0,0),A.lineTo(e,0)}};function Hne(A){return A.bandwidth&&!A.interval?void 0:"tabular-nums"}function Zne(A,e,{anchor:t,label:i=e.label,labelAnchor:n,labelArrow:o}={}){if(!(i==null||i.inferred&&Kne(e)&&/^(date|time|year)$/i.test(i))){if(i=String(i),o==="auto"&&(o=(!e.bandwidth||e.interval)&&!/[↑↓→←]/.test(i)),!o)return i;if(o===!0){const g=hMt(e);g&&(o=/x$/.test(A)||n==="center"?/x$/.test(A)===g<0?"left":"right":g<0?"up":"down")}switch(o){case"left":return`← ${i}`;case"right":return`${i} →`;case"up":return t==="right"?`${i} ↑`:`↑ ${i}`;case"down":return t==="right"?`${i} ↓`:`↓ ${i}`}return i}}function Wne(A="auto"){return wr(A)?!1:typeof A=="boolean"?A:iB(A,"labelArrow",["auto","up","right","down","left"])}function Kne(A){return br(A.domain())}function Une(A,e){if(e==null)return e;const t=A(e);if(!t)throw new Error(`scale not found: ${e}`);return t}function lLt(A,{opacity:e,...t}={}){if(!yw(A)&&!Hie(A))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${A.type})`);return Vne(A,t,(i,n,o,g)=>i.append("svg").attr("width",o).attr("height",g).attr("fill",n.scale).attr("fill-opacity",Ds(e)[1]).append("rect").attr("width","100%").attr("height","100%"))}function cLt(A,{fill:e=(I=>(I=A.hint)==null?void 0:I.fill)()!==void 0?A.hint.fill:"none",fillOpacity:t=1,stroke:i=(I=>(I=A.hint)==null?void 0:I.stroke)()!==void 0?A.hint.stroke:wr(e)?"currentColor":"none",strokeOpacity:n=1,strokeWidth:o=1.5,r:g=4.5,...a}={},s){const[I,r]=tB(e),[C,l]=tB(i),c=Une(s,I),B=Une(s,C),E=g*g*Math.PI;return t=Ds(t)[1],n=Ds(n)[1],o=Ds(o)[1],Vne(A,a,(u,d,f,w)=>u.append("svg").attr("viewBox","-8 -8 16 16").attr("width",f).attr("height",w).attr("fill",I==="color"?y=>c.scale(y):r).attr("fill-opacity",t).attr("stroke",C==="color"?y=>B.scale(y):l).attr("stroke-opacity",n).attr("stroke-width",o).append("path").attr("d",y=>{const G=Ib();return A.scale(y).draw(G,E),G}))}function Vne(A,e={},t){let{columns:i,tickFormat:n,fontVariant:o=$ie(A),swatchSize:g=15,swatchWidth:a=g,swatchHeight:s=g,marginLeft:I=0,className:r,style:C,width:l}=e;const c=vuA(e);r=JO(r),n=$uA(A.scale,A.domain,void 0,n);const B=Ho("div",c).attr("class",`${r}-swatches ${r}-swatches-${i!=null?"columns":"wrap"}`);let E;return i!=null?(E=`:where(.${r}-swatches-columns .${r}-swatch) {
  display: flex;
  align-items: center;
  break-inside: avoid;
  padding-bottom: 1px;
}
:where(.${r}-swatches-columns .${r}-swatch::before) {
  flex-shrink: 0;
}
:where(.${r}-swatches-columns .${r}-swatch-label) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}`,B.style("columns",i).selectAll().data(A.domain).enter().append("div").attr("class",`${r}-swatch`).call(t,A,a,s).call(u=>u.append("div").attr("class",`${r}-swatch-label`).attr("title",n).text(n))):(E=`:where(.${r}-swatches-wrap) {
  display: flex;
  align-items: center;
  min-height: 33px;
  flex-wrap: wrap;
}
:where(.${r}-swatches-wrap .${r}-swatch) {
  display: inline-flex;
  align-items: center;
  margin-right: 1em;
}`,B.selectAll().data(A.domain).enter().append("span").attr("class",`${r}-swatch`).call(t,A,a,s).append(function(){return this.ownerDocument.createTextNode(n.apply(this,arguments))})),B.call(u=>u.insert("style","*").text(`:where(.${r}-swatches) {
  font-family: system-ui, sans-serif;
  font-size: 10px;
  margin-bottom: 0.5em;
}
:where(.${r}-swatch > svg) {
  margin-right: 0.5em;
  overflow: visible;
}
${E}`)).style("margin-left",I?`${+I}px`:null).style("width",l===void 0?null:`${+l}px`).style("font-variant",aa(o,"normal")).call(HuA,C).node()}const edA=new Map([["symbol",cLt],["color",zne],["opacity",QLt]]);function BLt(A,e,t={}){return(i,n)=>{if(!edA.has(i))throw new Error(`unknown legend type: ${i}`);if(i in A)return edA.get(i)(A[i],Xne(e,t[i],n),o=>A[o])}}function Xne({className:A,...e},{label:t,ticks:i,tickFormat:n}={},o){return tFt(o,{className:A,...e},{label:t,ticks:i,tickFormat:n})}function zne(A,{legend:e=!0,...t}){if(e===!0&&(e=A.type==="ordinal"?"swatches":"ramp"),A.domain!==void 0)switch(`${e}`.toLowerCase()){case"swatches":return lLt(A,t);case"ramp":return dvt(A,t);default:throw new Error(`unknown legend type: ${e}`)}}function QLt({type:A,interpolate:e,...t},{legend:i=!0,color:n=OC(0,0,0),...o}){if(!e)throw new Error(`${A} opacity scales are not supported`);if(i===!0&&(i="ramp"),`${i}`.toLowerCase()!=="ramp")throw new Error(`${i} opacity legends are not supported`);return zne({type:A,...t,interpolate:ELt(n)},{legend:i,...o})}function ELt(A){const{r:e,g:t,b:i}=OC(A)||OC(0,0,0);return n=>`rgba(${e},${t},${i},${n})`}function uLt(A,e,t){const i=[];for(const[n,o]of edA){const g=t[n];if(g!=null&&g.legend&&n in A){const a=o(A[n],Xne(e,A[n],g),s=>A[s]);a!=null&&i.push(a)}}return i}function tdA(A={}){return Hte(A)?A:{...A,x:Vi}}function idA(A={}){return Zte(A)?A:{...A,y:Vi}}function dLt(A,e){if(e.length===1)return{data:A,facets:e};const t=DS(A),i=new Uint8Array(t);let n=0;for(const a of e)for(const s of a)i[s]&&++n,i[s]=1;if(n===0)return{data:A,facets:e};A=wS(A);const o=A[Rte]=new Uint32Array(t+n);e=e.map(a=>wS(a,Uint32Array));let g=t;i.fill(0);for(const a of e)for(let s=0,I=a.length;s<I;++s){const r=a[s];i[r]?(a[s]=g,A[g]=A[r],o[g]=r,++g):o[r]=r,i[r]=1}return{data:A,facets:e}}function Tne(A={},e={}){arguments.length===1&&([A,e]=One(A));const{y1:t,y:i=t,x:n,...o}=e,[g,a,s,I]=qne(i,n,"y","x",A,o);return{...g,y1:t,y:a,x1:s,x2:I,x:EO(s,I)}}function _ne(A={},e={}){arguments.length===1&&([A,e]=One(A));const{x1:t,x:i=t,y:n,...o}=e,[g,a,s,I]=qne(i,n,"x","y",A,o);return{...g,x1:t,x:a,y1:s,y2:I,y:EO(s,I)}}function ndA({x:A,x1:e,x2:t,...i}={}){return i=QN(i,"y"),e===void 0&&t===void 0?Tne({x:A,...i}):([e,t]=Wte(A,e,t),{...i,x1:e,x2:t})}function odA({y:A,y1:e,y2:t,...i}={}){return i=QN(i,"x"),e===void 0&&t===void 0?_ne({y:A,...i}):([e,t]=Wte(A,e,t),{...i,y1:e,y2:t})}function One(A){const{offset:e,order:t,reverse:i,...n}=A;return[{offset:e,order:t,reverse:i},n]}const hLt={length:!0};function qne(A,e=Wxt,t,i,{offset:n,order:o,reverse:g},a){if(e===null)throw new Error(`stack requires ${i}`);const s=BO(a),[I,r]=yr(A),[C,l]=GS(e),[c,B]=GS(e);return C.hint=c.hint=hLt,n=mLt(n),o=yLt(o,n,i),[IN(a,(E,u,d)=>{({data:E,facets:u}=dLt(E,u));const f=A==null?void 0:r(uO(Gn(E,A),d==null?void 0:d[t])),w=Gn(E,e,Float64Array),y=Gn(E,s),G=o&&o(E,f,w,y),R=DS(E),x=l(new Float64Array(R)),F=B(new Float64Array(R)),Q=[];for(const k of u){const h=f?Array.from(QM(k,N=>f[N]).values()):[k];if(G)for(const N of h)N.sort(G);for(const N of h){let v=0,K=0;g&&N.reverse();for(const U of N){const V=w[U];V<0?v=F[U]=(x[U]=v)+V:V>0?K=F[U]=(x[U]=K)+V:F[U]=x[U]=K}}Q.push(h)}return n&&n(Q,x,F,y),{data:E,facets:u}}),I,C,c]}function mLt(A){if(A!=null){if(typeof A=="function")return A;switch(`${A}`.toLowerCase()){case"expand":case"normalize":return pLt;case"center":case"silhouette":return fLt;case"wiggle":return Pne}throw new Error(`unknown offset: ${A}`)}}function jne(A,e){let t=0,i=0;for(const n of A){const o=e[n];o<t&&(t=o),o>i&&(i=o)}return[t,i]}function pLt(A,e,t){for(const i of A)for(const n of i){const[o,g]=jne(n,t);for(const a of n){const s=1/(g-o||1);e[a]=s*(e[a]-o),t[a]=s*(t[a]-o)}}}function fLt(A,e,t){for(const i of A){for(const n of i){const[o,g]=jne(n,t);for(const a of n){const s=(g+o)/2;e[a]-=s,t[a]-=s}}$ne(i,e,t)}Aoe(A,e,t)}function Pne(A,e,t,i){for(const n of A){const o=new Xy;let g=0;for(const a of n){let s=-1;const I=a.map(c=>Math.abs(t[c]-e[c])),r=a.map(c=>{s=i?i[c]:++s;const B=t[c]-e[c],E=o.has(s)?B-o.get(s):0;return o.set(s,B),E}),C=[0,...Z8e(r)];for(const c of a)e[c]+=g,t[c]+=g;const l=QQ(I);l&&(g-=QQ(I,(c,B)=>(r[B]/2+C[B])*c)/l)}$ne(n,e,t)}Aoe(A,e,t)}function $ne(A,e,t){const i=dc(A,n=>dc(n,o=>e[o]));for(const n of A)for(const o of n)e[o]-=i,t[o]-=i}function Aoe(A,e,t){const i=A.length;if(i===1)return;const n=A.map(a=>a.flat()),o=n.map(a=>(dc(a,s=>e[s])+Pg(a,s=>t[s]))/2),g=dc(o);for(let a=0;a<i;a++){const s=g-o[a];for(const I of n[a])e[I]+=s,t[I]+=s}}function yLt(A,e,t){if(A===void 0&&e===Pne)return eoe(eB);if(A!=null){if(typeof A=="string"){const i=A.startsWith("-"),n=i?aO:eB;switch((i?A.slice(1):A).toLowerCase()){case"value":case t:return bLt(n);case"z":return wLt(n);case"sum":return DLt(n);case"appearance":return GLt(n);case"inside-out":return eoe(n)}return toe(Fte(A))}if(typeof A=="function")return(A.length===1?toe:kLt)(A);if(pw(A))return JLt(A);throw new Error(`invalid order: ${A}`)}}function bLt(A){return(e,t,i)=>(n,o)=>A(i[n],i[o])}function wLt(A){return(e,t,i,n)=>(o,g)=>A(n[o],n[g])}function DLt(A){return vO(A,(e,t,i,n)=>kgA(Vd(e),o=>QQ(o,g=>i[g]),o=>n[o]))}function GLt(A){return vO(A,(e,t,i,n)=>kgA(Vd(e),o=>t[p3A(o,g=>i[g])],o=>n[o]))}function eoe(A){return vO(A,(e,t,i,n)=>{const o=Vd(e),g=kgA(o,C=>t[p3A(C,l=>i[l])],C=>n[C]),a=Pk(o,C=>QQ(C,l=>i[l]),C=>n[C]),s=[],I=[];let r=0;for(const C of g)r<0?(r+=a.get(C),s.push(C)):(r-=a.get(C),I.push(C));return I.reverse().concat(s)})}function toe(A){return e=>{const t=Gn(e,A);return(i,n)=>eB(t[i],t[n])}}function kLt(A){return e=>pw(e)?(t,i)=>A(e[t],e[i]):(t,i)=>A(e.get(t),e.get(i))}function JLt(A){return vO(eB,()=>A)}function vO(A,e){return(t,i,n,o)=>{if(!o)throw new Error("missing channel: z");const g=new Xy(e(t,i,n,o).map((a,s)=>[a,s]));return(a,s)=>A(g.get(o[a]),g.get(o[s]))}}const NLt={ariaLabel:"rect"};class ioe extends ks{constructor(e,t={}){const{x1:i,y1:n,x2:o,y2:g}=t;super(e,{x1:{value:i,scale:"x",type:i!=null&&o==null?"band":void 0,optional:!0},y1:{value:n,scale:"y",type:n!=null&&g==null?"band":void 0,optional:!0},x2:{value:o,scale:"x",optional:!0},y2:{value:g,scale:"y",optional:!0}},t,NLt),gdA(this,t),adA(this,t)}render(e,t,i,n,o){const{x:g,y:a}=t;let{x1:s,y1:I,x2:r,y2:C}=i;const{marginTop:l,marginRight:c,marginBottom:B,marginLeft:E,width:u,height:d}=n,{projection:f}=o,{insetTop:w,insetRight:y,insetBottom:G,insetLeft:R}=this,{rx:x,ry:F,rx1y1:Q,rx1y2:k,rx2y1:h,rx2y2:N}=this;(s||r)&&!f&&iE(g)&&(s=r=null),(I||C)&&!f&&iE(a)&&(I=C=null);const v=g!=null&&g.bandwidth?g.bandwidth():0,K=a!=null&&a.bandwidth?a.bandwidth():0;return Ho("svg:g",o).call(yl,this,n,o).call(Gr,this,{},0,0).call(U=>U.selectAll().data(e).enter().call(Q||k||h||N?V=>V.append("path").call(Dr,this).call(sdA,s&&r?X=>s[X]+(r[X]<s[X]?-y:R):s?X=>s[X]+R:E+R,I&&C?X=>I[X]+(C[X]<I[X]?-G:w):I?X=>I[X]+w:l+w,s&&r?X=>r[X]-(r[X]<s[X]?-R:y):s?X=>s[X]+v-y:u-c-y,I&&C?X=>C[X]-(C[X]<I[X]?-w:G):I?X=>I[X]+K-G:d-B-G,this).call(oB,this,i):V=>V.append("rect").call(Dr,this).attr("x",s?r?X=>Math.min(s[X],r[X])+R:X=>s[X]+R:E+R).attr("y",I?C?X=>Math.min(I[X],C[X])+w:X=>I[X]+w:l+w).attr("width",s?r?X=>Math.max(0,Math.abs(r[X]-s[X])+v-R-y):v-R-y:u-c-E-y-R).attr("height",I?C?X=>Math.max(0,Math.abs(I[X]-C[X])+K-w-G):K-w-G:d-l-B-w-G).call(Pe,"rx",x).call(Pe,"ry",F).call(oB,this,i))).node()}}function gdA(A,{inset:e=0,insetTop:t=e,insetRight:i=e,insetBottom:n=e,insetLeft:o=e}={}){A.insetTop=Lo(t),A.insetRight=Lo(i),A.insetBottom=Lo(n),A.insetLeft=Lo(o)}function adA(A,{r:e,rx:t,ry:i,rx1:n=e,ry1:o=e,rx2:g=e,ry2:a=e,rx1y1:s=n!==void 0?+n:o!==void 0?+o:0,rx1y2:I=n!==void 0?+n:a!==void 0?+a:0,rx2y1:r=g!==void 0?+g:o!==void 0?+o:0,rx2y2:C=g!==void 0?+g:a!==void 0?+a:0}={}){s||I||r||C?(A.rx1y1=s,A.rx1y2=I,A.rx2y1=r,A.rx2y2=C):(A.rx=aa(t,"auto"),A.ry=aa(i,"auto"))}function sdA(A,e,t,i,n,o){const{rx1y1:g,rx1y2:a,rx2y1:s,rx2y2:I}=o;typeof e!="function"&&(e=Kd(e)),typeof t!="function"&&(t=Kd(t)),typeof i!="function"&&(i=Kd(i)),typeof n!="function"&&(n=Kd(n));const r=Math.max(Math.abs(g+s),Math.abs(a+I)),C=Math.max(Math.abs(g+a),Math.abs(s+I));A.attr("d",l=>{const c=e(l),B=t(l),E=i(l),u=n(l),d=c>E,f=B>u,w=d?E:c,y=d?c:E,G=f?u:B,R=f?B:u,x=Math.min(1,(y-w)/r,(R-G)/C),F=x*(d?f?I:s:f?a:g),Q=x*(d?f?a:g:f?I:s),k=x*(d?f?g:a:f?s:I),h=x*(d?f?s:I:f?g:a);return`M${w},${G+SO(F,h)}A${F},${F} 0 0 ${F<0?0:1} ${w+LO(F,h)},${G}H${y-LO(Q,k)}A${Q},${Q} 0 0 ${Q<0?0:1} ${y},${G+SO(Q,k)}V${R-SO(k,Q)}A${k},${k} 0 0 ${k<0?0:1} ${y-LO(k,Q)},${R}H${w+LO(h,F)}A${h},${h} 0 0 ${h<0?0:1} ${w},${R-SO(h,F)}Z`})}function LO(A,e){return e<0?A:Math.abs(A)}function SO(A,e){return e<0?Math.abs(A):A}function YLt(A,e={}){return lO(e)||(e={...e,y:Wd,x2:Vi,interval:1}),new ioe(A,ndA(wvt(tdA(e))))}function RLt(A,e={}){return lO(e)||(e={...e,x:Wd,y2:Vi,interval:1}),new ioe(A,odA(bvt(idA(e))))}const xLt={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},FLt={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1};class MLt extends ks{constructor(e={}){const{anchor:t=null}=e;super(CO,void 0,e,t==null?xLt:FLt),this.anchor=Ste(t,"anchor",["top","right","bottom","left"]),gdA(this,e),t||adA(this,e)}render(e,t,i,n,o){const{marginTop:g,marginRight:a,marginBottom:s,marginLeft:I,width:r,height:C}=n,{anchor:l,insetTop:c,insetRight:B,insetBottom:E,insetLeft:u}=this,{rx:d,ry:f,rx1y1:w,rx1y2:y,rx2y1:G,rx2y2:R}=this,x=I+u,F=r-a-B,Q=g+c,k=C-s-E;return Ho(l?"svg:line":w||y||G||R?"svg:path":"svg:rect",o).datum(0).call(yl,this,n,o).call(Dr,this).call(oB,this,i).call(Gr,this,{}).call(l==="left"?h=>h.attr("x1",x).attr("x2",x).attr("y1",Q).attr("y2",k):l==="right"?h=>h.attr("x1",F).attr("x2",F).attr("y1",Q).attr("y2",k):l==="top"?h=>h.attr("x1",x).attr("x2",F).attr("y1",Q).attr("y2",Q):l==="bottom"?h=>h.attr("x1",x).attr("x2",F).attr("y1",k).attr("y2",k):w||y||G||R?h=>h.call(sdA,x,Q,F,k,this):h=>h.attr("x",x).attr("y",Q).attr("width",F-x).attr("height",k-Q).attr("rx",d).attr("ry",f)).node()}}function vLt(A){return new MLt(A)}const rdA={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},LLt=new Set(["geometry","href","src","ariaLabel","scales"]);class SLt extends ks{constructor(e,t={}){t.tip&&(t={...t,tip:!1}),t.title===void 0&&c0(e)&&Vte(e)&&(t={...t,title:Vi});const{x:i,y:n,x1:o,x2:g,y1:a,y2:s,anchor:I,preferredAnchor:r="bottom",monospace:C,fontFamily:l=C?"ui-monospace, monospace":void 0,fontSize:c,fontStyle:B,fontVariant:E,fontWeight:u,lineHeight:d=1,lineWidth:f=20,frameAnchor:w,format:y,textAnchor:G="start",textOverflow:R,textPadding:x=8,title:F,pointerSize:Q=12,pathFilter:k="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=t;super(e,{x:{value:o!=null&&g!=null?null:i,scale:"x",optional:!0},y:{value:a!=null&&s!=null?null:n,scale:"y",optional:!0},x1:{value:o,scale:"x",optional:g==null},y1:{value:a,scale:"y",optional:s==null},x2:{value:g,scale:"x",optional:o==null},y2:{value:s,scale:"y",optional:a==null},title:{value:F,optional:!0}},t,rdA),this.anchor=ouA(I,"anchor"),this.preferredAnchor=ouA(r,"preferredAnchor"),this.frameAnchor=hO(w),this.textAnchor=aa(G,"middle"),this.textPadding=+x,this.pointerSize=+Q,this.pathFilter=ws(k),this.lineHeight=+d,this.lineWidth=+f,this.textOverflow=cne(R),this.monospace=!!C,this.fontFamily=ws(l),this.fontSize=Lo(c),this.fontStyle=ws(B),this.fontVariant=ws(E),this.fontWeight=ws(u);for(const h in rdA)h in this.channels&&(this[h]=rdA[h]);this.splitLines=Ene(this),this.clipLine=une(this),this.format=typeof y=="string"||typeof y=="function"?{title:y}:{...y}}render(e,t,i,n,o){const g=this,{x:a,y:s,fx:I,fy:r}=t,{ownerSVGElement:C,document:l}=o,{anchor:c,monospace:B,lineHeight:E,lineWidth:u}=this,{textPadding:d,pointerSize:f,pathFilter:w}=this,{marginTop:y,marginLeft:G}=n,{x1:R,y1:x,x2:F,y2:Q,x:k=R??F,y:h=x??Q}=i,N=I?I(e.fx)-G:0,v=r?r(e.fy)-y:0,[K,U]=HS(this,n),V=jie(i,K),X=Pie(i,U),_=B?juA:quA,q=_(EN);let $,nA;"title"in i?($=noe.call(this,{title:i.channels.title},t),nA=ULt):($=noe.call(this,i.channels,t),nA=VLt);const j=Ho("svg:g",o).call(yl,this,n,o).call(Bne,this).call(Gr,this,{x:k&&a,y:h&&s}).call(oA=>oA.selectAll().data(e).enter().append("g").attr("transform",tA=>`translate(${Math.round(V(tA))},${Math.round(X(tA))})`).call(Dr,this).call(tA=>tA.append("path").attr("filter",w)).call(tA=>tA.append("text").each(function(sA){const gA=j2(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");const iA=nA.call(g,sA,e,$,t,i);if(typeof iA=="string")for(const aA of g.splitLines(iA))O(gA,{value:g.clipLine(aA)});else{const aA=new Set;for(const lA of iA){const{label:CA=""}=lA;CA&&aA.has(CA)||(aA.add(CA),O(gA,lA))}}})));function O(oA,{label:tA,value:sA,color:gA,opacity:iA}){tA??(tA=""),sA??(sA="");const aA=gA!=null||iA!=null;let lA,CA=u*100;const[QA]=uN(tA,CA,_,q);if(QA>=0)tA=tA.slice(0,QA).trimEnd()+EN,lA=sA.trim(),sA="";else{(tA||!sA&&!aA)&&(sA=" "+sA);const[fA]=uN(sA,CA-_(tA),_,q);fA>=0&&(lA=sA.trim(),sA=sA.slice(0,fA).trimEnd()+EN)}const uA=oA.append("tspan").attr("x",0).attr("dy",`${E}em`).text("​");tA&&uA.append("tspan").attr("font-weight","bold").text(tA),sA&&uA.append(()=>l.createTextNode(sA)),aA&&uA.append("tspan").text(" ■").attr("fill",gA).attr("fill-opacity",iA).style("user-select","none"),lA&&uA.append("title").text(lA)}function eA(){const{width:oA,height:tA}=n.facet??n;j.selectChildren().each(function(sA){let{x:gA,width:iA,height:aA}=this.getBBox();iA=Math.round(iA),aA=Math.round(aA);let lA=c;if(lA===void 0){const uA=V(sA)+N,fA=X(sA)+v,hA=uA+iA+f+d*2<oA,yA=uA-iA-f-d*2>0,mA=fA+aA+f+d*2<tA,LA=fA-aA-f-d*2>0;lA=hA&&yA?mA&&LA?g.preferredAnchor:LA?"bottom":"top":mA&&LA?hA?"left":"right":(hA||yA)&&(mA||LA)?`${LA?"bottom":"top"}-${hA?"left":"right"}`:g.preferredAnchor}const CA=this.firstChild,QA=this.lastChild;if(CA.setAttribute("d",KLt(lA,f,d,iA,aA)),gA)for(const uA of QA.childNodes)uA.setAttribute("x",-gA);QA.setAttribute("y",`${+ZLt(lA,QA.childNodes.length,E).toFixed(6)}em`),QA.setAttribute("transform",`translate(${WLt(lA,f,d,iA,aA)})`)}),j.attr("visibility",null)}return e.length&&(j.attr("visibility","hidden"),C.isConnected?Promise.resolve().then(eA):typeof requestAnimationFrame<"u"&&requestAnimationFrame(eA)),j.node()}}function HLt(A,{x:e,y:t,...i}={}){return i.frameAnchor===void 0&&([e,t]=tuA(e,t)),new SLt(A,{...i,x:e,y:t})}function ZLt(A,e,t){return/^top(?:-|$)/.test(A)?.94-t:-.29-e*t}function WLt(A,e,t,i,n){switch(A){case"middle":return[-i/2,n/2];case"top-left":return[t,e+t];case"top":return[-i/2,e/2+t];case"top-right":return[-i-t,e+t];case"right":return[-e/2-i-t,n/2];case"bottom-left":return[t,-e-t];case"bottom":return[-i/2,-e/2-t];case"bottom-right":return[-i-t,-e-t];case"left":return[t+e/2,n/2]}}function KLt(A,e,t,i,n){const o=i+t*2,g=n+t*2;switch(A){case"middle":return`M${-o/2},${-g/2}h${o}v${g}h${-o}z`;case"top-left":return`M0,0l${e},${e}h${o-e}v${g}h${-o}z`;case"top":return`M0,0l${e/2},${e/2}h${(o-e)/2}v${g}h${-o}v${-g}h${(o-e)/2}z`;case"top-right":return`M0,0l${-e},${e}h${e-o}v${g}h${o}z`;case"right":return`M0,0l${-e/2},${-e/2}v${e/2-g/2}h${-o}v${g}h${o}v${e/2-g/2}z`;case"bottom-left":return`M0,0l${e},${-e}h${o-e}v${-g}h${-o}z`;case"bottom":return`M0,0l${e/2},${-e/2}h${(o-e)/2}v${-g}h${-o}v${g}h${(o-e)/2}z`;case"bottom-right":return`M0,0l${-e},${-e}h${e-o}v${-g}h${o}z`;case"left":return`M0,0l${e/2},${-e/2}v${e/2-g/2}h${o}v${g}h${-o}v${e/2-g/2}z`}}function noe(A,e){var t,i;const n={};let o=this.format;o=ooe(o,A,"x"),o=ooe(o,A,"y"),this.format=o;for(const g in o){const a=o[g];if(!(a===null||a===!1))if(g==="fx"||g==="fy")n[g]=!0;else{const s=cie(A,g);s&&(n[g]=s)}}for(const g in A){if(g in n||g in o||LLt.has(g)||(g==="x"||g==="y")&&A.geometry)continue;const a=cie(A,g);if(a){if(a.scale==null&&a.defaultScale==="color")continue;n[g]=a}}this.facet&&(e.fx&&!("fx"in o)&&(n.fx=!0),e.fy&&!("fy"in o)&&(n.fy=!0));for(const g in n){const a=this.format[g];if(typeof a=="string"){const s=((t=n[g])==null?void 0:t.value)??((i=e[g])==null?void 0:i.domain())??[];this.format[g]=(br(s)?lJ:Ec)(a)}else if(a===void 0||a===!0){const s=e[g];this.format[g]=s!=null&&s.bandwidth?$uA(s,s.domain()):BN}}return n}function ooe(A,e,t){if(!(t in A))return A;const i=`${t}1`,n=`${t}2`;if((i in A||!(i in e))&&(n in A||!(n in e)))return A;const o=Object.entries(A),g=A[t];return o.splice(o.findIndex(([a])=>a===t)+1,0,[i,g],[n,g]),Object.fromEntries(o)}function ULt(A,e,{title:t}){return this.format.title(t.value[A],A)}function*VLt(A,e,t,i,n){for(const o in t){if(o==="fx"||o==="fy"){yield{label:HO(i,t,o),value:this.format[o](e[o],A)};continue}if(o==="x1"&&"x2"in t||o==="y1"&&"y2"in t)continue;const g=t[o];if(o==="x2"&&"x1"in t)yield{label:aoe(i,t,"x"),value:goe(this.format.x2,t.x1,g,A)};else if(o==="y2"&&"y1"in t)yield{label:aoe(i,t,"y"),value:goe(this.format.y2,t.y1,g,A)};else{const a=g.value[A],s=g.scale;if(!s0(a)&&s==null)continue;yield{label:HO(i,t,o),value:this.format[o](a,A),color:s==="color"?n[o][A]:null,opacity:s==="opacity"?n[o][A]:null}}}}function goe(A,e,t,i){var n;return(n=t.hint)!=null&&n.length?`${A(t.value[i]-e.value[i],i)}`:`${A(e.value[i],i)}–${A(t.value[i],i)}`}function aoe(A,e,t){const i=HO(A,e,`${t}1`,t),n=HO(A,e,`${t}2`,t);return i===n?i:`${i}–${n}`}function HO(A,e,t,i=t){const n=e[t],o=A[(n==null?void 0:n.scale)??t];return String((o==null?void 0:o.label)??(n==null?void 0:n.label)??i)}function soe(A={}){var e;const{facet:t,style:i,title:n,subtitle:o,caption:g,ariaLabel:a,ariaDescription:s}=A,I=JO(A.className),r=A.marks===void 0?[]:Ioe(A.marks);r.push(...jLt(r));const C=OLt(t,A),l=new Map;for(const $ of r){const nA=loe($,C,A);nA&&l.set($,nA)}const c=new Map;C&&ZS(c,[C],A),ZS(c,l,A);const B=Ioe(PLt(r,c,A));for(const $ of B){const nA=loe($,C,A);nA&&l.set($,nA)}r.unshift(...B);let E=GMt(c,A);if(E!==void 0){const $=C?xuA(E,C):void 0;for(const j of r){if(j.facet===null||j.facet==="super")continue;const O=l.get(j);O!==void 0&&(O.facetsIndex=j.fx!=null||j.fy!=null?xuA(E,O):$)}const nA=new Set;for(const{facetsIndex:j}of l.values())j==null||j.forEach((O,eA)=>{(O==null?void 0:O.length)>0&&nA.add(eA)});E.forEach(0<nA.size&&nA.size<E.length?(j,O)=>j.empty=!nA.has(O):j=>j.empty=!1);for(const j of r)if(j.facet==="exclude"){const O=l.get(j);O!==void 0&&(O.facetsIndex=NMt(O.facetsIndex))}}for(const $ of Eo.keys())euA(A[$])&&$!=="fx"&&$!=="fy"&&c.set($,[]);const u=new Map;for(const $ of r){if(u.has($))throw new Error("duplicate mark; each mark must be unique");const{facetsIndex:nA,channels:j}=l.get($)??{},{data:O,facets:eA,channels:oA}=$.initialize(nA,j,A);IdA(oA,A),u.set($,{data:O,facets:eA,channels:oA})}const d=buA(ZS(c,u,A),A),f=Bvt(d,r,A);uMt(d,f);const w=Yie(d),{fx:y,fy:G}=w,R=y||G?Rie(d,f):f,x=y||G?oSt(w,f):f,F=vuA(A),Q=F.document,k=J4("svg").call(Q.documentElement);let h=k;F.ownerSVGElement=k,F.className=I,F.projection=HMt(A,R),F.filterFacets=($,nA)=>xuA(E,{channels:nA,groups:GuA($,nA)}),F.getMarkState=$=>{const nA=u.get($),j=l.get($);return{...nA,channels:{...nA.channels,...j==null?void 0:j.channels}}},F.dispatchValue=$=>{h.value!==$&&(h.value=$,h.dispatchEvent(new Event("input",{bubbles:!0})))};const N=new Set;for(const[$,nA]of u)if($.initializer!=null){const j=$.facet==="super"?x:R,O=$.initializer(nA.data,nA.facets,nA.channels,w,j,F);if(O.data!==void 0&&(nA.data=O.data),O.facets!==void 0&&(nA.facets=O.facets),O.channels!==void 0){const{fx:eA,fy:oA,...tA}=O.channels;_Lt(tA),Object.assign(nA.channels,tA);for(const sA of Object.values(tA)){const{scale:gA}=sA;gA!=null&&!oFt(Eo.get(gA))&&(Coe(sA,A),N.add(gA))}(eA!=null||oA!=null)&&l.set($,!0)}}if(N.size){const $=new Map;ZS($,u,A,eA=>N.has(eA)),ZS(c,u,A,eA=>N.has(eA));const nA=nSt(buA($,A),d),{scales:j,...O}=Yie(nA);Object.assign(d,nA),Object.assign(w,O),Object.assign(w.scales,j)}let v,K;E!==void 0&&(v={x:y==null?void 0:y.domain(),y:G==null?void 0:G.domain()},E=kMt(E,v),K=JMt(y,G,f));for(const[$,nA]of u)nA.values=$.scale(nA.channels,w,F);const{width:U,height:V}=f;j2(k).attr("class",I).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",U).attr("height",V).attr("viewBox",`0 0 ${U} ${V}`).attr("aria-label",a).attr("aria-description",s).call($=>$.append("style").text(`:where(.${I}) {
  --plot-background: white;
  display: block;
  height: auto;
  height: intrinsic;
  max-width: 100%;
}
:where(.${I} text),
:where(.${I} tspan) {
  white-space: pre;
}`)).call(HuA,i);for(const $ of r){const{channels:nA,values:j,facets:O}=u.get($);if(E===void 0||$.facet==="super"){let eA=null;if(O&&(eA=O[0],eA=$.filter(eA,nA,j),eA.length===0))continue;const oA=$.render(eA,w,j,x,F);if(oA==null)continue;k.appendChild(oA)}else{let eA;for(const oA of E){if(!(((e=$.facetAnchor)==null?void 0:e.call($,E,v,oA))??!oA.empty))continue;let tA=null;if(O){const gA=l.has($);if(tA=O[gA?oA.i:0],tA=$.filter(tA,nA,j),tA.length===0)continue;!gA&&tA===O[0]&&(tA=Xxt(tA)),tA.fx=oA.x,tA.fy=oA.y,tA.fi=oA.i}const sA=$.render(tA,w,j,R,F);if(sA!=null){(eA??(eA=j2(k).append("g"))).append(()=>sA).datum(oA);for(const gA of["aria-label","aria-description","aria-hidden","transform"])sA.hasAttribute(gA)&&(eA.attr(gA,sA.getAttribute(gA)),sA.removeAttribute(gA))}}eA==null||eA.selectChildren().attr("transform",K)}}const X=uLt(d,F,A),{figure:_=n!=null||o!=null||g!=null||X.length>0}=A;_&&(h=Q.createElement("figure"),h.className=`${I}-figure`,h.style.maxWidth="initial",n!=null&&h.append(roe(Q,n,"h2")),o!=null&&h.append(roe(Q,o,"h3")),h.append(...X,k),g!=null&&h.append(XLt(Q,g)),"value"in k&&(h.value=k.value,delete k.value)),h.scale=wMt(w.scales),h.legend=BLt(d,F,A);const q=AMt();return q>0&&j2(k).append("text").attr("x",U).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("⚠️").append("title").text(`${q.toLocaleString("en-US")} warning${q===1?"":"s"}. Please check the console.`),h}function roe(A,e,t){if(e.ownerDocument)return e;const i=A.createElement(t);return i.append(e),i}function XLt(A,e){const t=A.createElement("figcaption");return t.append(e),t}function Ioe(A){return A.flat(1/0).filter(e=>e!=null).map(zLt)}function zLt(A){return typeof A.render=="function"?A:new TLt(A)}class TLt extends ks{constructor(e){if(typeof e!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=e}render(){}}function IdA(A,e){for(const t in A)Coe(A[t],e);return A}function Coe(A,e){const{scale:t,transform:i=!0}=A;if(t==null||!i)return;const{type:n,percent:o,interval:g,transform:a=o?s=>s==null?NaN:s*100:Ute(g,n)}=e[t]??{};a!=null&&(A.value=So(A.value,a),A.transform=!1)}function _Lt(A){for(const e in A)rie(e,A[e])}function ZS(A,e,t,i=Kxt){var n,o;for(const{channels:g}of e.values())for(const a in g){const s=g[a],{scale:I}=s;if(I!=null&&i(I))if(I==="projection"){if(!UMt(t)){const r=((n=t.x)==null?void 0:n.domain)===void 0,C=((o=t.y)==null?void 0:o.domain)===void 0;if(r||C){const[l,c]=XMt(s);r&&CdA(A,"x",l),C&&CdA(A,"y",c)}}}else CdA(A,I,s)}return A}function CdA(A,e,t){const i=A.get(e);i!==void 0?i.push(t):A.set(e,[t])}function OLt(A,e){if(A==null)return;const{x:t,y:i}=A;if(t==null&&i==null)return;const n=gN(A.data);if(n==null)throw new Error("missing facet data");const o={};t!=null&&(o.fx=FS(n,{value:t,scale:"fx"})),i!=null&&(o.fy=FS(n,{value:i,scale:"fy"})),IdA(o,e);const g=GuA(n,o);return{channels:o,groups:g,data:A.data}}function loe(A,e,t){if(A.facet===null||A.facet==="super")return;const{fx:i,fy:n}=A;if(i!=null||n!=null){const s=gN(A.data??i??n);if(s===void 0)throw new Error(`missing facet data in ${A.ariaLabel}`);if(s===null)return;const I={};return i!=null&&(I.fx=FS(s,{value:i,scale:"fx"})),n!=null&&(I.fy=FS(s,{value:n,scale:"fy"})),IdA(I,t),{channels:I,groups:GuA(s,I)}}if(e===void 0)return;const{channels:o,groups:g,data:a}=e;if(A.facet!=="auto"||A.data===a)return{channels:o,groups:g};a.length>0&&(g.size>1||g.size===1&&o.fx&&o.fy&&[...g][0][1].size>1)&&DS(gN(A.data))===DS(a)&&B0(`Warning: the ${A.ariaLabel} mark appears to use faceted data, but isn’t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function qLt(A,e={}){return CN({...e,x:null,y:null},(t,i,n,o,g,a)=>a.getMarkState(A))}function jLt(A){const e=[];for(const t of A){let i=t.tip;if(i){i===!0?i={}:typeof i=="string"&&(i={pointer:i});let{pointer:n,preferredAnchor:o}=i;n=/^x$/i.test(n)?uvt:/^y$/i.test(n)?qie:Evt,i=n(qLt(t,i)),i.title=null,o===void 0&&(i.preferredAnchor=n===qie?"left":"bottom");const g=HLt(t.data,i);g.facet=t.facet,g.facetAnchor=t.facetAnchor,e.push(g)}}return e}function PLt(A,e,t){let{projection:i,x:n={},y:o={},fx:g={},fy:a={},axis:s,grid:I,facet:r={},facet:{axis:C=s,grid:l}=r,x:{axis:c=s,grid:B=c===null?null:I}=n,y:{axis:E=s,grid:u=E===null?null:I}=o,fx:{axis:d=C,grid:f=d===null?null:l}=g,fy:{axis:w=C,grid:y=w===null?null:l}=a}=t;(i||!euA(n)&&!coe("x",A))&&(c=B=null),(i||!euA(o)&&!coe("y",A))&&(E=u=null),e.has("fx")||(d=f=null),e.has("fy")||(w=y=null),c===void 0&&(c=!KO(A,"x")),E===void 0&&(E=!KO(A,"y")),d===void 0&&(d=!KO(A,"fx")),w===void 0&&(w=!KO(A,"fy")),c===!0&&(c="bottom"),E===!0&&(E="left"),d===!0&&(d=c==="top"||c===null?"bottom":"top"),w===!0&&(w=E==="right"||E===null?"left":"right");const G=[];return WO(G,y,nLt,a),ZO(G,w,jvt,"right","left",r,a),WO(G,f,gLt,g),ZO(G,d,Pvt,"top","bottom",r,g),WO(G,u,iLt,o),ZO(G,E,Nne,"left","right",t,o),WO(G,B,oLt,n),ZO(G,c,Yne,"bottom","top",t,n),G}function ZO(A,e,t,i,n,o,g){if(!e)return;const a=$Lt(e);g=ASt(a?i:e,o,g);const{line:s}=g;(t===Nne||t===Yne)&&s&&!JS(s)&&A.push(vLt(eSt(g))),A.push(t(g)),a&&A.push(t({...g,anchor:n,label:null}))}function WO(A,e,t,i){!e||JS(e)||A.push(t(tSt(e,i)))}function $Lt(A){return/^\s*both\s*$/i.test(A)}function ASt(A,e,{line:t=e.line,ticks:i,tickSize:n,tickSpacing:o,tickPadding:g,tickFormat:a,tickRotate:s,fontVariant:I,ariaLabel:r,ariaDescription:C,label:l=e.label,labelAnchor:c,labelArrow:B=e.labelArrow,labelOffset:E}){return{anchor:A,line:t,ticks:i,tickSize:n,tickSpacing:o,tickPadding:g,tickFormat:a,tickRotate:s,fontVariant:I,ariaLabel:r,ariaDescription:C,label:l,labelAnchor:c,labelArrow:B,labelOffset:E}}function eSt(A){const{anchor:e,line:t}=A;return{anchor:e,facetAnchor:e+"-empty",stroke:t===!0?void 0:t}}function tSt(A,{stroke:e=dO(A)?A:void 0,ticks:t=iSt(A)?A:void 0,tickSpacing:i,ariaLabel:n,ariaDescription:o}){return{stroke:e,ticks:t,tickSpacing:i,ariaLabel:n,ariaDescription:o}}function iSt(A){switch(typeof A){case"number":return!0;case"string":return!dO(A)}return c0(A)||typeof(A==null?void 0:A.range)=="function"}function KO(A,e){const t=`${e}-axis `;return A.some(i=>{var n;return(n=i.ariaLabel)==null?void 0:n.startsWith(t)})}function coe(A,e){for(const t of e)for(const i in t.channels){const{scale:n}=t.channels[i];if(n===A||n==="projection")return!0}return!1}function nSt(A,e){for(const t in A){const i=A[t],n=e[t];i.label===void 0&&n&&(i.label=n.label)}return A}function oSt({fx:A,fy:e},t){const{marginTop:i,marginRight:n,marginBottom:o,marginLeft:g,width:a,height:s}=wuA(t),I=A&&Boe(A),r=e&&Boe(e);return{marginTop:e?r[0]:i,marginRight:A?a-I[1]:n,marginBottom:e?s-r[1]:o,marginLeft:A?I[0]:g,inset:{marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:t.marginBottom,marginLeft:t.marginLeft},width:a,height:s}}function Boe(A){const e=A.domain();if(e.length===0)return[0,A.bandwidth()];let t=A(e[0]),i=A(e[e.length-1]);return i<t&&([t,i]=[i,t]),[t,i+A.bandwidth()]}const gSt=new Map([["basis",I9A],["basis-closed",l9A],["basis-open",B9A],["bundle",E9A],["bump-x",Gtt],["bump-y",ktt],["cardinal",u9A],["cardinal-closed",d9A],["cardinal-open",h9A],["catmull-rom",p9A],["catmull-rom-closed",y9A],["catmull-rom-open",w9A],["linear",GJ],["linear-closed",G9A],["monotone-x",x9A],["monotone-y",F9A],["natural",L9A],["step",S9A],["step-after",Z9A],["step-before",H9A]]);function Qoe(A=GJ,e){if(typeof A=="function")return A;const t=gSt.get(`${A}`.toLowerCase());if(!t)throw new Error(`unknown curve: ${A}`);if(e!==void 0){if("beta"in t)return t.beta(e);if("tension"in t)return t.tension(e);if("alpha"in t)return t.alpha(e)}return t}function aSt(A=UO,e){return typeof A!="function"&&`${A}`.toLowerCase()==="auto"?UO:Qoe(A,e)}function UO(A){return GJ(A)}function sSt(A={y:"count"},e={}){[A,e]=moe(A,e);const{x:t,y:i}=e;return hoe(poe(t,e,Vi),null,null,i,A,RO(e))}function rSt(A={x:"count"},e={}){[A,e]=moe(A,e);const{x:t,y:i}=e;return hoe(null,poe(i,e,Vi),t,null,A,xO(e))}function Eoe(A,e,t={}){if((t==null?void 0:t.interval)==null)return t;const{reduce:i=EuA}=t,n={filter:null};return t[e]!=null&&(n[e]=i),t[`${e}1`]!=null&&(n[`${e}1`]=i),t[`${e}2`]!=null&&(n[`${e}2`]=i),A(n,t)}function uoe(A={}){return Eoe(sSt,"y",QN(A,"x"))}function doe(A={}){return Eoe(rSt,"x",QN(A,"y"))}function hoe(A,e,t,i,{data:n=QuA,filter:o=fO,sort:g,reverse:a,...s}={},I={}){A=foe(A),e=foe(e),s=CSt(s,I),n=woe(n,Vi),g=g==null?void 0:yoe("sort",g,I),o=o==null?void 0:boe("filter",o,I),t!=null&&lN(s,"x","x1","x2")&&(t=null),i!=null&&lN(s,"y","y1","y2")&&(i=null);const[r,C]=yr(A),[l,c]=yr(A),[B,E]=yr(e),[u,d]=yr(e),[f,w]=t!=null?[t,"x"]:i!=null?[i,"y"]:[],[y,G]=yr(f),{x:R,y:x,z:F,fill:Q,stroke:k,x1:h,x2:N,y1:v,y2:K,domain:U,cumulative:V,thresholds:X,interval:_,...q}=I,[$,nA]=yr(F),[j]=tB(Q),[O]=tB(k),[eA,oA]=yr(j),[tA,sA]=yr(O);return{..."z"in I&&{z:$||F},..."fill"in I&&{fill:eA||Q},..."stroke"in I&&{stroke:tA||k},...IN(q,(gA,iA,aA)=>{const lA=uO(Gn(gA,f),aA==null?void 0:aA[w]),CA=Gn(gA,F),QA=Gn(gA,j),uA=Gn(gA,O),fA=nie(s,{z:CA,fill:QA,stroke:uA}),hA=[],yA=[],mA=lA&&G([]),LA=CA&&nA([]),UA=QA&&oA([]),ne=uA&&sA([]),SA=A&&C([]),ae=A&&c([]),EA=e&&E([]),wA=e&&d([]),se=BSt(A,e,gA);let we=0;for(const be of s)be.initialize(gA);g&&g.initialize(gA),o&&o.initialize(gA);for(const be of iA){const Oe=[];for(const VA of s)VA.scope("facet",be);g&&g.scope("facet",be),o&&o.scope("facet",be);for(const[VA,ZA]of xS(be,fA))for(const[le,ce]of xS(ZA,lA))for(const[de,rt]of se(ce))if(fA&&(rt.z=VA),!(o&&!o.reduce(de,rt))){Oe.push(we++),yA.push(n.reduceIndex(de,gA,rt)),lA&&mA.push(le),CA&&LA.push(fA===CA?VA:CA[(de.length>0?de:ce)[0]]),QA&&UA.push(fA===QA?VA:QA[(de.length>0?de:ce)[0]]),uA&&ne.push(fA===uA?VA:uA[(de.length>0?de:ce)[0]]),SA&&(SA.push(rt.x1),ae.push(rt.x2)),EA&&(EA.push(rt.y1),wA.push(rt.y2));for(const en of s)en.reduce(de,rt);g&&g.reduce(de,rt)}hA.push(Oe)}return oie(hA,g,a),{data:yA,facets:hA}}),...!lN(s,"x")&&(r?{x1:r,x2:l,x:EO(r,l)}:{x:R,x1:h,x2:N}),...!lN(s,"y")&&(B?{y1:B,y2:u,y:EO(B,u)}:{y:x,y1:v,y2:K}),...y&&{[w]:y},...Object.fromEntries(s.map(({name:gA,output:iA})=>[gA,iA]))}}function moe({cumulative:A,domain:e,thresholds:t,interval:i,...n},o){return[n,{cumulative:A,domain:e,thresholds:t,interval:i,...o}]}function poe(A,{cumulative:e,domain:t,thresholds:i,interval:n},o){return A={...kS(A)},A.domain===void 0&&(A.domain=t),A.cumulative===void 0&&(A.cumulative=e),A.thresholds===void 0&&(A.thresholds=i),A.interval===void 0&&(A.interval=n),A.value===void 0&&(A.value=o),A.thresholds=ISt(A.thresholds,A.interval),A}function foe(A){if(A==null)return;const{value:e,cumulative:t,domain:i=_C,thresholds:n}=A,o=g=>{let a=Gn(g,e),s;if(br(a)||cSt(n)){a=So(a,Lte,Float64Array);let[r,C]=typeof i=="function"?i(a):i,l=typeof n=="function"&&!rN(n)?n(a,r,C):n;typeof l=="number"&&(l=HKA(r,C,l)),rN(l)&&(i===_C&&(r=l.floor(r),C=l.offset(l.floor(C))),l=l.range(r,l.offset(C))),s=l}else{a=oN(a);let[r,C]=typeof i=="function"?i(a):i,l=typeof n=="function"&&!rN(n)?n(a,r,C):n;if(typeof l=="number")if(i===_C){let c=u9(r,C,l);if(isFinite(c))if(c>0){let B=Math.round(r/c),E=Math.round(C/c);B*c<=r||--B,E*c>C||++E;let u=E-B+1;l=new Float64Array(u);for(let d=0;d<u;++d)l[d]=(B+d)*c}else if(c<0){c=-c;let B=Math.round(r*c),E=Math.round(C*c);B/c<=r||--B,E/c>C||++E;let u=E-B+1;l=new Float64Array(u);for(let d=0;d<u;++d)l[d]=(B+d)/c}else l=[r];else l=[r]}else l=uM(r,C,l);else rN(l)&&(i===_C&&(r=l.floor(r),C=l.offset(l.floor(C))),l=l.range(r,l.offset(C)));s=l}const I=[];if(s.length===1)I.push([s[0],s[0]]);else for(let r=1;r<s.length;++r)I.push([s[r-1],s[r]]);return I.bin=(t<0?ESt:t>0?QSt:ldA)(I,s,a),I};return o.label=fw(e),o}function ISt(A,e,t=Doe){if(A===void 0)return e===void 0?t:sN(e);if(typeof A=="string"){switch(A.toLowerCase()){case"freedman-diaconis":return _8e;case"scott":return y3A;case"sturges":return X8e;case"auto":return Doe}return OEA(A)}return A}function CSt(A,e){return Aie(A,e,yoe)}function yoe(A,e,t){return cuA(A,e,t,boe)}function boe(A,e,t){return BuA(A,e,t,woe)}function woe(A,e){return pO(A,e,lSt)}function lSt(A){switch(`${A}`.toLowerCase()){case"x":return uSt;case"x1":return hSt;case"x2":return mSt;case"y":return dSt;case"y1":return pSt;case"y2":return fSt;case"z":return sie}throw new Error(`invalid bin reduce: ${A}`)}function Doe(A,e,t){return Math.min(200,y3A(A,e,t))}function cSt(A){return _xt(A)||c0(A)&&br(A)}function BSt(A,e,t){const i=A==null?void 0:A(t),n=e==null?void 0:e(t);return i&&n?function*(o){const g=i.bin(o);for(const[a,[s,I]]of i.entries()){const r=n.bin(g[a]);for(const[C,[l,c]]of n.entries())yield[r[C],{data:t,x1:s,y1:l,x2:I,y2:c}]}}:i?function*(o){const g=i.bin(o);for(const[a,[s,I]]of i.entries())yield[g[a],{data:t,x1:s,x2:I}]}:function*(o){const g=n.bin(o);for(const[a,[s,I]]of n.entries())yield[g[a],{data:t,y1:s,y2:I}]}}function ldA(A,e,t){return e=oN(e),i=>{var n;const o=A.map(()=>[]);for(const g of i)(n=o[jk(e,t[g])-1])==null||n.push(g);return o}}function QSt(A,e,t){const i=ldA(A,e,t);return n=>{const o=i(n);for(let g=1,a=o.length;g<a;++g){const s=o[g-1],I=o[g];for(const r of s)I.push(r)}return o}}function ESt(A,e,t){const i=ldA(A,e,t);return n=>{const o=i(n);for(let g=o.length-2;g>=0;--g){const a=o[g+1],s=o[g];for(const I of a)s.push(I)}return o}}function Goe(A,e){const t=(+A+ +e)/2;return A instanceof Date?new Date(t):t}const uSt={reduceIndex(A,e,{x1:t,x2:i}){return Goe(t,i)}},dSt={reduceIndex(A,e,{y1:t,y2:i}){return Goe(t,i)}},hSt={reduceIndex(A,e,{x1:t}){return t}},mSt={reduceIndex(A,e,{x2:t}){return t}},pSt={reduceIndex(A,e,{y1:t}){return t}},fSt={reduceIndex(A,e,{y2:t}){return t}},ySt={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class koe extends ks{constructor(e,t={}){const{x1:i,y1:n,x2:o,y2:g,z:a,curve:s,tension:I}=t;super(e,{x1:{value:i,scale:"x"},y1:{value:n,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:g,scale:"y",optional:!0},z:{value:BO(t),optional:!0}},t,ySt),this.z=a,this.curve=Qoe(s,I)}filter(e){return e}render(e,t,i,n,o){const{x1:g,y1:a,x2:s=g,y2:I=a}=i;return Ho("svg:g",o).call(yl,this,n,o).call(Gr,this,t,0,0).call(r=>r.selectAll().data(Vie(e,[g,a,s,I],this,i)).enter().append("path").call(Dr,this).call(Uie,this,i).attr("d",Av().curve(this.curve).defined(C=>C>=0).x0(C=>g[C]).y0(C=>a[C]).x1(C=>s[C]).y1(C=>I[C]))).node()}}function bSt(A,e){const{y:t=Wd,...i}=doe(e);return new koe(A,ndA(tdA({...i,y1:t,y2:void 0})))}function wSt(A,e){const{x:t=Wd,...i}=uoe(e);return new koe(A,odA(idA({...i,x1:t,x2:void 0})))}const DSt={ariaLabel:"bar"};class Joe extends ks{constructor(e,t,i={},n=DSt){super(e,t,i,n),gdA(this,i),adA(this,i)}render(e,t,i,n,o){const{rx:g,ry:a,rx1y1:s,rx1y2:I,rx2y1:r,rx2y2:C}=this,l=this._x(t,i,n),c=this._y(t,i,n),B=this._width(t,i,n),E=this._height(t,i,n);return Ho("svg:g",o).call(yl,this,n,o).call(this._transform,this,t).call(u=>u.selectAll().data(e).enter().call(s||I||r||C?d=>d.append("path").call(Dr,this).call(sdA,l,c,Noe(l,B),Noe(c,E),this).call(oB,this,i):d=>d.append("rect").call(Dr,this).attr("x",l).attr("width",B).attr("y",c).attr("height",E).call(Pe,"rx",g).call(Pe,"ry",a).call(oB,this,i))).node()}_x(e,{x:t},{marginLeft:i}){const{insetLeft:n}=this;return t?o=>t[o]+n:i+n}_y(e,{y:t},{marginTop:i}){const{insetTop:n}=this;return t?o=>t[o]+n:i+n}_width({x:e},{x:t},{marginRight:i,marginLeft:n,width:o}){const{insetLeft:g,insetRight:a}=this,s=t&&e?e.bandwidth():o-i-n;return Math.max(0,s-g-a)}_height({y:e},{y:t},{marginTop:i,marginBottom:n,height:o}){const{insetTop:g,insetBottom:a}=this,s=t&&e?e.bandwidth():o-i-n;return Math.max(0,s-g-a)}}function Noe(A,e){return typeof A=="function"&&typeof e=="function"?t=>A(t)+e(t):typeof A=="function"?t=>A(t)+e:typeof e=="function"?t=>A+e(t):A+e}class GSt extends Joe{constructor(e,t={},i){const{x1:n,x2:o,y:g}=t;super(e,{x1:{value:n,scale:"x"},x2:{value:o,scale:"x"},y:{value:g,scale:"y",type:"band",optional:!0}},t,i)}_transform(e,t,{x:i}){e.call(Gr,t,{x:i},0,0)}_x({x:e},{x1:t,x2:i},{marginLeft:n}){const{insetLeft:o}=this;return iE(e)?n+o:g=>Math.min(t[g],i[g])+o}_width({x:e},{x1:t,x2:i},{marginRight:n,marginLeft:o,width:g}){const{insetLeft:a,insetRight:s}=this;return iE(e)?g-n-o-a-s:I=>Math.max(0,Math.abs(i[I]-t[I])-a-s)}}class kSt extends Joe{constructor(e,t={},i){const{x:n,y1:o,y2:g}=t;super(e,{y1:{value:o,scale:"y"},y2:{value:g,scale:"y"},x:{value:n,scale:"x",type:"band",optional:!0}},t,i)}_transform(e,t,{y:i}){e.call(Gr,t,{y:i},0,0)}_y({y:e},{y1:t,y2:i},{marginTop:n}){const{insetTop:o}=this;return iE(e)?n+o:g=>Math.min(t[g],i[g])+o}_height({y:e},{y1:t,y2:i},{marginTop:n,marginBottom:o,height:g}){const{insetTop:a,insetBottom:s}=this;return iE(e)?g-n-o-a-s:I=>Math.max(0,Math.abs(i[I]-t[I])-a-s)}}function Yoe(A,e={}){return lO(e)||(e={...e,y:Wd,x2:Vi}),new GSt(A,ndA(sne(tdA(e))))}function Roe(A,e={}){return lO(e)||(e={...e,x:Wd,y2:Vi}),new kSt(A,odA(rne(idA(e))))}const JSt={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function NSt(A){return A.sort===void 0&&A.reverse===void 0?cFt({channel:"-r"},A):A}class YSt extends ks{constructor(e,t={}){const{x:i,y:n,r:o,rotate:g,symbol:a=kJ,frameAnchor:s}=t,[I,r]=Ds(g,0),[C,l]=CFt(a),[c,B]=Ds(o,C==null?3:4.5);super(e,{x:{value:i,scale:"x",optional:!0},y:{value:n,scale:"y",optional:!0},r:{value:c,scale:"r",filter:sO,optional:!0},rotate:{value:I,optional:!0},symbol:{value:C,scale:"auto",optional:!0}},NSt(t),JSt),this.r=B,this.rotate=r,this.symbol=l,this.frameAnchor=hO(s);const{channels:E}=this,{symbol:u}=E;if(u){const{fill:d,stroke:f}=E;u.hint={fill:d?d.value===u.value?"color":"currentColor":this.fill??"currentColor",stroke:f?f.value===u.value?"color":"currentColor":this.stroke??"none"}}}render(e,t,i,n,o){const{x:g,y:a}=t,{x:s,y:I,r,rotate:C,symbol:l}=i,{r:c,rotate:B,symbol:E}=this,[u,d]=HS(this,n),f=E===kJ,w=r?void 0:c*c*Math.PI;return XEA(c)&&(e=[]),Ho("svg:g",o).call(yl,this,n,o).call(Gr,this,{x:s&&g,y:I&&a}).call(y=>y.selectAll().data(e).enter().append(f?"circle":"path").call(Dr,this).call(f?G=>{G.attr("cx",s?R=>s[R]:u).attr("cy",I?R=>I[R]:d).attr("r",r?R=>r[R]:c)}:G=>{G.attr("transform",TuA`translate(${s?R=>s[R]:u},${I?R=>I[R]:d})${C?R=>` rotate(${C[R]})`:B?` rotate(${B})`:""}`).attr("d",r&&l?R=>{const x=Ib();return l[R].draw(x,r[R]*r[R]*Math.PI),x}:r?R=>{const x=Ib();return E.draw(x,r[R]*r[R]*Math.PI),x}:l?R=>{const x=Ib();return l[R].draw(x,w),x}:(()=>{const R=Ib();return E.draw(R,w),R})())}).call(oB,this,i)).node()}}function mN(A,{x:e,y:t,...i}={}){return i.frameAnchor===void 0&&([e,t]=tuA(e,t)),new YSt(A,{...i,x:e,y:t})}const RSt={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class xoe extends ks{constructor(e,t={}){const{x:i,y:n,z:o,curve:g,tension:a}=t;super(e,{x:{value:i,scale:"x"},y:{value:n,scale:"y"},z:{value:BO(t),optional:!0}},t,RSt),this.z=o,this.curve=aSt(g,a),YO(this,t)}filter(e){return e}project(e,t,i){this.curve!==UO&&super.project(e,t,i)}render(e,t,i,n,o){const{x:g,y:a}=i,{curve:s}=this;return Ho("svg:g",o).call(yl,this,n,o).call(Gr,this,t).call(I=>I.selectAll().data(Vie(e,[g,a],this,i)).enter().append("path").call(Dr,this).call(Uie,this,i).call(fvt,this,i,o).attr("d",s===UO&&o.projection?xSt(o.projection,g,a):w5().curve(s).defined(r=>r>=0).x(r=>g[r]).y(r=>a[r]))).node()}}function xSt(A,e,t){const i=O4(A);return e=oN(e),t=oN(t),n=>{let o=[];const g=[o];for(const a of n)a===-1?(o=[],g.push(o)):o.push([e[a],t[a]]);return i({type:"MultiLineString",coordinates:g})}}function FSt(A,{x:e=Vi,y:t=Wd,...i}={}){return new xoe(A,doe({...i,x:e,y:t}))}function MSt(A,{x:e=Wd,y:t=Vi,...i}={}){return new xoe(A,uoe({...i,x:e,y:t}))}function Foe(A={},e={}){const t=BO(e),i=Object.entries(A).map(([n,o])=>{const g=Kte(n,e);if(g==null)throw new Error(`missing channel: ${n}`);const[a,s]=GS(g);return{key:n,input:g,output:a,setOutput:s,map:vSt(o)}});return{...IN(e,(n,o)=>{const g=Gn(n,t),a=i.map(({input:I})=>Gn(n,I)),s=i.map(({setOutput:I})=>I(new Array(n.length)));for(const I of o)for(const r of g?QM(I,C=>g[C]).values():[I])i.forEach(({map:C},l)=>C.mapIndex(r,a[l],s[l]));return{data:n,facets:o}}),...Object.fromEntries(i.map(({key:n,output:o})=>[n,o]))}}function vSt(A){if(A==null)throw new Error("missing map");if(typeof A.mapIndex=="function")return A;if(typeof A.map=="function"&&Ud(A))return LSt(A);if(typeof A=="function")return cdA(Vxt(A));switch(`${A}`.toLowerCase()){case"cumsum":return HSt;case"rank":return cdA((e,t)=>w3A(e,i=>t[i]));case"quantile":return cdA((e,t)=>SSt(e,i=>t[i]))}throw new Error(`invalid map: ${A}`)}function LSt(A){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:A.map.bind(A)}}function SSt(A,e){const t=B9(A,e)-1;return w3A(A,e).map(i=>i/t)}function cdA(A){return{mapIndex(e,t,i){const n=A(e,t);if(n.length!==e.length)throw new Error("map function returned a mismatched length");for(let o=0,g=e.length;o<g;++o)i[e[o]]=n[o]}}}const HSt={mapIndex(A,e,t){let i=0;for(const n of A)t[n]=i+=e[n]}},ZSt={ariaLabel:"tick",fill:null,stroke:"currentColor"};class Moe extends ks{constructor(e,t,i){super(e,t,i,ZSt),YO(this,i)}render(e,t,i,n,o){return Ho("svg:g",o).call(yl,this,n,o).call(this._transform,this,t).call(g=>g.selectAll().data(e).enter().append("line").call(Dr,this).attr("x1",this._x1(t,i,n)).attr("x2",this._x2(t,i,n)).attr("y1",this._y1(t,i,n)).attr("y2",this._y2(t,i,n)).call(oB,this,i).call(UuA,this,i,o)).node()}}class WSt extends Moe{constructor(e,t={}){const{x:i,y:n,inset:o=0,insetTop:g=o,insetBottom:a=o}=t;super(e,{x:{value:i,scale:"x"},y:{value:n,scale:"y",type:"band",optional:!0}},t),this.insetTop=Lo(g),this.insetBottom=Lo(a)}_transform(e,t,{x:i}){e.call(Gr,t,{x:i},Gs,0)}_x1(e,{x:t}){return i=>t[i]}_x2(e,{x:t}){return i=>t[i]}_y1({y:e},{y:t},{marginTop:i}){const{insetTop:n}=this;return t&&e?o=>t[o]+n:i+n}_y2({y:e},{y:t},{height:i,marginBottom:n}){const{insetBottom:o}=this;return t&&e?g=>t[g]+e.bandwidth()-o:i-n-o}}class KSt extends Moe{constructor(e,t={}){const{x:i,y:n,inset:o=0,insetRight:g=o,insetLeft:a=o}=t;super(e,{y:{value:n,scale:"y"},x:{value:i,scale:"x",type:"band",optional:!0}},t),this.insetRight=Lo(g),this.insetLeft=Lo(a)}_transform(e,t,{y:i}){e.call(Gr,t,{y:i},0,Gs)}_x1({x:e},{x:t},{marginLeft:i}){const{insetLeft:n}=this;return t&&e?o=>t[o]+n:i+n}_x2({x:e},{x:t},{width:i,marginRight:n}){const{insetRight:o}=this;return t&&e?g=>t[g]+e.bandwidth()-o:i-n-o}_y1(e,{y:t}){return i=>t[i]}_y2(e,{y:t}){return i=>t[i]}}function voe(A,{x:e=Vi,...t}={}){return new WSt(A,{...t,x:e})}function Loe(A,{y:e=Vi,...t}={}){return new KSt(A,{...t,y:e})}function USt(A,{x:e=Vi,y:t=null,r:i,fill:n="#ccc",fillOpacity:o,stroke:g="currentColor",strokeOpacity:a,strokeWidth:s=2,sort:I,...r}={}){const C=t!=null?uFt:$te;return NO(zuA(A,C({x1:BdA,x2:QdA},{x:e,y:t,stroke:g,strokeOpacity:a,...r})),Yoe(A,C({x1:"p25",x2:"p75"},{x:e,y:t,fill:n,fillOpacity:o,...r})),voe(A,C({x:"p50"},{x:e,y:t,stroke:g,strokeOpacity:a,strokeWidth:s,sort:I,...r})),mN(A,Foe({x:Soe},{x:e,y:t,z:t,r:i,stroke:g,strokeOpacity:a,...r})))}function VSt(A,{y:e=Vi,x:t=null,r:i,fill:n="#ccc",fillOpacity:o,stroke:g="currentColor",strokeOpacity:a,strokeWidth:s=2,sort:I,...r}={}){const C=t!=null?EFt:$te;return NO(XuA(A,C({y1:BdA,y2:QdA},{x:t,y:e,stroke:g,strokeOpacity:a,...r})),Roe(A,C({y1:"p25",y2:"p75"},{x:t,y:e,fill:n,fillOpacity:o,...r})),Loe(A,C({y:"p50"},{x:t,y:e,stroke:g,strokeOpacity:a,strokeWidth:s,sort:I,...r})),mN(A,Foe({y:Soe},{x:t,y:e,z:t,r:i,stroke:g,strokeOpacity:a,...r})))}function Soe(A){const e=BdA(A),t=QdA(A);return A.map(i=>i<e||i>t?i:NaN)}function BdA(A){const e=Hoe(A)*2.5-Zoe(A)*1.5;return dc(A,t=>t>=e?t:NaN)}function QdA(A){const e=Zoe(A)*2.5-Hoe(A)*1.5;return Pg(A,t=>t<=e?t:NaN)}function Hoe(A){return BQ(A,.25)}function Zoe(A){return BQ(A,.75)}ks.prototype.plot=function({marks:A=[],...e}={}){return soe({...e,marks:[...A,this]})};function XSt(A){var e,t,i,n,o,g,a,s,I,r,C,l,c,B,E,u,d,f,w,y,G,R,x,F;const Q=((e=A==null?void 0:A.data)==null?void 0:e.values)||[];let k=A.mark;typeof k=="object"&&k.type&&(k=k.type),console.log({encoding:A.encoding,markType:k});const h=A.encoding||{},N=((t=h.x)==null?void 0:t.field)||null,v=((i=h.y)==null?void 0:i.field)||null,K=((n=h.column)==null?void 0:n.field)||null,U=((o=h.row)==null?void 0:o.field)||null,V=((g=h.color)==null?void 0:g.field)||null,X=((a=h.size)==null?void 0:a.field)||null,_=h.tooltip;console.log({xField:N,yField:v,xFacetField:K,yFacetField:U,colorField:V,sizeField:X,tooltipEnc:_});const q=(gA,iA)=>{var aA,lA,CA,QA,uA,fA,hA,yA;const mA=((aA=iA.x)==null?void 0:aA.type)==="quantitative",LA=((lA=iA.y)==null?void 0:lA.type)==="quantitative";(CA=iA.x)==null||CA.type,(QA=iA.y)==null||QA.type;const UA={bar:{X:Yoe,Y:Roe},area:{X:bSt,Y:wSt},line:{X:FSt,Y:MSt},tick:{X:voe,Y:Loe},rect:{X:YLt,Y:RLt},rule:{X:XuA,Y:zuA},boxplot:{X:USt,Y:VSt}};return UA[gA]?mA&&!LA?(console.log(`Using X-direction mark for ${gA}: X is quantitative (${(uA=iA.x)==null?void 0:uA.type}), Y is ${(fA=iA.y)==null?void 0:fA.type}`),{markFunction:UA[gA].X,stackAxis:"X"}):LA&&!mA?(console.log(`Using Y-direction mark for ${gA}: Y is quantitative (${(hA=iA.y)==null?void 0:hA.type}), X is ${(yA=iA.x)==null?void 0:yA.type}`),{markFunction:UA[gA].Y,stackAxis:"Y"}):mA&&LA?(console.log(`Both axes quantitative for ${gA}, defaulting to Y-direction`),{markFunction:UA[gA].Y,stackAxis:"Y"}):(console.log(`Neither axis quantitative for ${gA}, defaulting to Y-direction`),{markFunction:UA[gA].Y,stackAxis:"Y"}):{markFunction:{point:mN,circle:mN,dot:mN,text:OuA}[gA]||mN,stackAxis:"Y"}},$=(gA,iA,aA)=>{const{xField:lA,yField:CA,colorField:QA,sizeField:uA,xFacetField:fA,yFacetField:hA}=aA,yA={x:lA||void 0,y:CA||void 0,fx:fA||void 0,fy:hA||void 0};switch(gA){case"bar":case"area":case"rect":case"boxplot":yA.fill=QA||void 0;break;case"line":case"tick":case"rule":yA.stroke=QA||void 0;break;case"point":yA.stroke=QA||void 0,yA.fill="none",yA.r=uA||void 0;break;case"circle":case"dot":yA.fill=QA||void 0,yA.stroke=void 0,yA.r=uA||void 0;break;case"text":yA.text=CA||lA||void 0,yA.fill=QA||void 0;break}return yA},nA=(gA,iA)=>{if(!O||!V)return iA;const aA={};return gA==="normalize"?aA.offset="normalize":gA==="center"&&(aA.offset="center"),console.log("Stack options for mark:",{stackMode:gA,stackOptions:aA}),aA},j=(gA,iA,aA,lA)=>{if(!O||!V)return gA(iA,aA);const CA=[...iA].sort((hA,yA)=>{var mA,LA;let UA=0,ne=lA==="X"?v:N;return ne&&((lA==="X"?(mA=h.y)==null?void 0:mA.type:(LA=h.x)==null?void 0:LA.type)==="temporal"?UA=new Date(hA[ne]).getTime()-new Date(yA[ne]).getTime():hA[ne]<yA[ne]?UA=-1:hA[ne]>yA[ne]?UA=1:UA=0),UA!==0?UA:V&&hA[V]<yA[V]?-1:1}),QA=nA(eA,aA),uA=lA==="X"?Tne:_ne,fA={...aA,z:V||void 0};return console.log(`Applying ${lA}-direction stacking:`,{stackFunction:uA.name,stackOptions:QA,dataLength:CA.length,primaryField:lA==="X"?v:N,colorField:V}),gA(CA,uA(QA,fA))};let O=!1,eA=null;if(((s=h.x)==null?void 0:s.stack)!==null&&((I=h.x)==null?void 0:I.stack)!==!1&&((r=h.x)==null?void 0:r.type)==="quantitative"&&(O=!0,eA=h.x.stack),((C=h.y)==null?void 0:C.stack)!==null&&((l=h.y)==null?void 0:l.stack)!==!1&&((c=h.y)==null?void 0:c.type)==="quantitative"&&(O=!0,eA=h.y.stack),((B=h.theta)==null?void 0:B.stack)!==null&&((E=h.theta)==null?void 0:E.stack)!==!1&&((u=h.theta)==null?void 0:u.type)==="quantitative"&&(O=!0,eA=h.theta.stack),((d=h.radius)==null?void 0:d.stack)!==null&&((f=h.radius)==null?void 0:f.stack)!==!1&&((w=h.radius)==null?void 0:w.type)==="quantitative"&&(O=!0,eA=h.radius.stack),Array.isArray(A.transform))for(const gA of A.transform)gA.stack&&(O=!0);let oA=((gA,iA,aA,lA)=>{var CA,QA,uA,fA,hA,yA;const{colorField:mA}=lA,{markFunction:LA,stackAxis:UA}=q(gA,aA),ne=$(gA,aA,lA),SA=O||mA&&["bar","area"].includes(gA)&&O!==!1;if(console.log(`Creating ${gA} mark:`,{markFunction:LA.name,stackAxis:UA,shouldStack:SA,stacked:O,stackMode:eA,colorField:mA,hasColorField:!!mA,isStackableMarkType:["bar","area"].includes(gA),xType:(CA=aA.x)==null?void 0:CA.type,yType:(QA=aA.y)==null?void 0:QA.type}),SA&&mA)return j(LA,iA,ne,UA);if(mA&&["line","area"].includes(gA)){let ae=iA;if(gA==="line"){const wA=((uA=aA.x)==null?void 0:uA.type)==="quantitative",se=((fA=aA.y)==null?void 0:fA.type)==="temporal",we=((hA=aA.x)==null?void 0:hA.type)==="temporal";if((yA=aA.y)==null||yA.type,ae=[...iA].sort((be,Oe)=>{let VA=null;if(we?VA=N:se&&(VA=v),VA){const ZA=new Date(be[VA]).getTime()-new Date(Oe[VA]).getTime();if(ZA!==0)return ZA}return mA&&be[mA]<Oe[mA]?-1:1}),console.log("Sorted line chart data:",{temporalField:we?N:v,xIsQuantitative:wA,yIsTemporal:se,originalLength:iA.length,sortedLength:ae.length,sampleData:ae.slice(0,3)}),wA&&se){console.log('Special case: X quantitative, Y temporal - using curve: "linear" for better connection');const be={...ne,z:mA||void 0,curve:"linear"};return LA(ae,be)}}const EA={...ne,z:mA||void 0};return LA(ae,EA)}else return LA(iA,ne)})(k,Q,h,{xField:N,yField:v,colorField:V,sizeField:X,xFacetField:K,yFacetField:U}),tA;_&&(Array.isArray(_)?tA=gA=>_.map(iA=>`${iA.field}: ${gA[iA.field]}`).join(", "):_.field&&(tA=gA=>`${_.field}: ${gA[_.field]}`)),tA&&(oA.title=tA);const sA=gA=>{const iA=h[gA],aA=h[gA==="x"?"y":"x"];return k==="bar"&&(iA==null?void 0:iA.type)==="temporal"&&(aA==null?void 0:aA.type)==="quantitative"||k==="tick"&&(iA==null?void 0:iA.type)==="temporal"};return{marks:[oA],x:{label:((y=h.x)==null?void 0:y.title)||void 0,type:((G=h.x)==null?void 0:G.type)==="temporal"?sA("x")?"band":"utc":void 0},y:{label:((R=h.y)==null?void 0:R.title)||void 0,type:((x=h.y)==null?void 0:x.type)==="temporal"?sA("y")?"band":"utc":void 0},color:{label:((F=h.color)==null?void 0:F.title)||void 0,legend:V?!0:void 0}}}function zSt({rows:A,columns:e,color:t,opacity:i,size:n,shape:o,theta:g,radius:a,text:s,details:I=[],interactiveScale:r,dataSource:C,layoutMode:l,width:c,height:B,defaultAggregated:E,geomType:u,stack:d,scales:f,mediaTheme:w,vegaConfig:y,displayOffset:G}){const R=unA({rows:A,columns:e,color:t,opacity:i,size:n,shape:o,theta:g,radius:a,text:s,details:I,interactiveScale:r,dataSource:C,layoutMode:l,width:c,height:B,defaultAggregated:E,geomType:u,stack:d,scales:f,mediaTheme:w,vegaConfig:y,displayOffset:G});console.log({vlSpecs:R});const x=R.map(F=>XSt(F));return console.log({plotSpecs:x}),x}const TSt=an.div`
    display: grid;
    grid-template-columns: repeat(${A=>A.colSize}, auto);
    grid-template-rows: repeat(${A=>A.rowSize}, 1fr);
`,_St=new z2;new z2;const OSt=p.forwardRef(function(A,e){const{name:t,rows:i=[],columns:n=[],dataSource:o=[],defaultAggregate:g=!0,stack:a="stack",geomType:s,color:I,opacity:r,size:C,theta:l,radius:c,shape:B,text:E,onGeomClick:u,showActions:d,interactiveScale:f,layoutMode:w,width:y,height:G,details:R=[],locale:x="en-US",useSvg:F,scales:Q,scale:k,displayOffset:h,vegaConfig:N,onReportSpec:v}=A,K=p.useContext(sQ),{reportError:U}=w4(),V=p.useMemo(()=>i.filter(QA=>g||QA.aggName!=="expr"),[i,g]),X=p.useMemo(()=>n.filter(QA=>g||QA.aggName!=="expr"),[n,g]),_=p.useMemo(()=>V.filter(QA=>QA.analyticType==="dimension"),[V]),q=p.useMemo(()=>X.filter(QA=>QA.analyticType==="dimension"),[X]),$=p.useMemo(()=>V.filter(QA=>QA.analyticType==="measure"),[V]),nA=p.useMemo(()=>X.filter(QA=>QA.analyticType==="measure"),[X]),j=p.useMemo(()=>$.length===0?_.slice(-1):$,[_,$]),O=p.useMemo(()=>nA.length===0?q.slice(-1):nA,[q,nA]),[eA,oA]=p.useState([]),tA=p.useRef(null);p.useEffect(()=>{const QA=Math.max(1,j.length*O.length);oA(uA=>QA===uA.length?uA:new Array(QA).fill(null).map((fA,hA)=>uA[hA]||b.createRef()))},[j,O]);const{width:sA,height:gA,ref:iA}=nEA(),aA=p.useMemo(()=>w==="auto"?{w:0,h:0}:w==="full"&&sA&&gA?{w:sA,h:gA}:{w:y,h:G},[w,y,G,sA,gA]),lA=p.useMemo(()=>{let QA=[];if(j.length===0&&O.length===0)return[];const uA=j.length*O.length;return console.log({count:uA,rowRepeatFields:j,colRepeatFields:O}),QA=zSt({columns:X,dataSource:o,defaultAggregated:g,geomType:s,height:aA.h??300,interactiveScale:f,layoutMode:w,mediaTheme:K,rows:V,stack:a,width:aA.w??400,scales:Q,color:I,details:R,opacity:r,radius:c,shape:B,size:C,text:E,theta:l,vegaConfig:N,displayOffset:h}),console.log({specsArr:QA}),QA},[A,j,O]);p.useEffect(()=>(v&&v(JSON.stringify(lA,null,2)),()=>{v==null||v("")}),[lA]);const CA=p.useRef([]);return p.useEffect(()=>(CA.current.forEach(QA=>{QA.canvas&&QA.canvas.parentNode&&QA.canvas.parentNode.removeChild(QA.canvas)}),CA.current=[],lA.forEach((QA,uA)=>{var fA;const hA=(fA=eA[uA])==null?void 0:fA.current;if(!hA)return;hA.innerHTML="";const yA=soe({...QA,width:w==="auto"?void 0:(aA.w??400)/Math.max(1,O.length),height:w==="auto"?void 0:(aA.h??300)/Math.max(1,j.length)});hA.appendChild(yA),CA.current.push({w:yA.clientWidth,h:yA.clientHeight,x:uA%Math.max(1,O.length),y:Math.floor(uA/Math.max(1,O.length)),view:null,canvas:yA,innerWidth:yA.clientWidth,innerHeight:yA.clientHeight}),yA.addEventListener("pointerdown",mA=>{_St.next(mA),u==null||u(null,mA)}),ViA(()=>{w!=="auto"||F||PQA.test({width:yA.clientWidth||1,height:yA.clientHeight||1})||U("canvas exceed max size",$QA.canvasExceedSize)})}),()=>{CA.current.forEach(QA=>{QA.canvas&&QA.canvas.parentNode&&QA.canvas.parentNode.removeChild(QA.canvas)}),CA.current=[]}),[lA,eA,aA]),b.useImperativeHandle(e,()=>({getSVGData:async()=>{const QA=[];return CA.current.forEach(uA=>{var fA,hA;if(uA.canvas instanceof SVGSVGElement)QA.push(uA.canvas.outerHTML);else if((hA=(fA=uA.canvas)==null?void 0:fA.querySelector)!=null&&hA.call(fA,"svg")){const yA=uA.canvas.querySelector("svg");yA&&QA.push(yA.outerHTML)}}),QA},getCanvasData:async()=>{const QA=[];return CA.current.forEach(uA=>{var fA,hA;const yA=(hA=(fA=uA.canvas)==null?void 0:fA.querySelector)==null?void 0:hA.call(fA,"canvas");yA&&QA.push(yA.toDataURL())}),QA},downloadSVG:async QA=>{var uA;return await((uA=e.current)==null?void 0:uA.getSVGData())},downloadPNG:async QA=>{var uA;return await((uA=e.current)==null?void 0:uA.getCanvasData())}}),[]),b.createElement("div",{className:w==="auto"?"w-fit h-fit relative":"w-full h-full relative",style:{overflow:w==="auto"?"visible":"hidden"}},b.createElement("div",{ref:iA,className:"inset-0 absolute"}),b.createElement(TSt,{style:{...w==="auto"?{}:{width:"100%",height:"100%"}},rowSize:Math.max(j.length,1),colSize:Math.max(O.length,1),ref:tA},eA.map((QA,uA)=>b.createElement("div",{key:uA,ref:QA,className:w==="auto"?"":"overflow-hidden"}))))}),qSt=p.forwardRef(function({name:A,layout:e,data:t,draggableFieldState:i,visualConfig:n,onGeomClick:o,onChartResize:g,locale:a,onReportSpec:s,vizThemeConfig:I,scales:r,disableCollapse:C},l){const{geoms:c,defaultAggregated:B,coordSystem:E,timezoneDisplayOffset:u}=n,{interactiveScale:d,stack:f,showActions:w,size:y,format:G,background:R,zeroScale:x,resolve:F,useSvg:Q,primaryColor:k,colorPalette:h,scale:N}=e,v=i.rows,K=i.columns,U=i.color,V=i.opacity,X=i.shape,_=i.theta,q=i.radius,$=i.size,nA=i.details,j=i.text,O=G,eA=c[0]==="table",oA=y.mode==="fixed"&&!!g,tA=p.useContext(sQ),sA=p.useContext(znA),gA=IUA({vizThemeConfig:I,mediaTheme:tA,primaryColor:k,colorPalette:h}),iA=p.useMemo(()=>{const lA={...gA,background:BSA(sA[tA].background),customFormatTypes:!0};return O.normalizedNumberFormat&&O.normalizedNumberFormat.length>0&&(lA.normalizedNumberFormat=O.normalizedNumberFormat),O.numberFormat&&O.numberFormat.length>0&&(lA.numberFormat=O.numberFormat),O.timeFormat&&O.timeFormat.length>0&&(lA.timeFormat=O.timeFormat),lA.scale||(lA.scale={}),lA.scale.zero=!!x,lA.resolve=F,R&&(lA.background=R),lA},[gA,tA,x,F,R,O.normalizedNumberFormat,O.numberFormat,O.timeFormat]);if(eA)return b.createElement(Q8e,{data:t,draggableFieldState:i,visualConfig:n,layout:e,vizThemeConfig:I,disableCollapse:C});const aA=E==="geographic";return b.createElement(U6e,{className:oA?"border-primary border-2 max-h-screen max-w-[100vw]":"max-h-screen max-w-[100vw]",style:{padding:"12px"},onResizeStop:(lA,CA,QA,uA)=>{g==null||g(y.width+uA.width,y.height+uA.height)},enable:oA?void 0:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},size:y.mode==="fixed"?{width:y.width+"px",height:y.height+"px"}:y.mode==="full"?{width:"100%",height:"100%"}:aA?{width:uaA+"px",height:U9+"px"}:{width:"auto",height:"auto"}},aA&&b.createElement(mUA,{name:A,data:t,draggableFieldState:i,visualConfig:n,visualLayout:e,vegaConfig:iA,scales:r,scale:N}),!aA&&(!e.renderer||e.renderer==="vega-lite")&&b.createElement(kNt,{name:A,vegaConfig:iA,layoutMode:y.mode,interactiveScale:d,geomType:c[0],defaultAggregate:B,stack:f,dataSource:t,rows:v,columns:K,color:U[0],theta:_[0],radius:q[0],shape:X[0],opacity:V[0],size:$[0],details:nA,text:j[0],showActions:w,width:y.width-12*4,height:y.height-12*4,ref:l,onGeomClick:o,locale:a,useSvg:Q,scales:r,scale:N,onReportSpec:s,displayOffset:u}),!aA&&e.renderer==="observable-plot"&&b.createElement(OSt,{name:A,vegaConfig:iA,layoutMode:y.mode,interactiveScale:d,geomType:c[0],defaultAggregate:B,stack:f,dataSource:t,rows:v,columns:K,color:U[0],theta:_[0],radius:q[0],shape:X[0],opacity:V[0],size:$[0],details:nA,text:j[0],showActions:w,width:y.width-12*4,height:y.height-12*4,ref:l,onGeomClick:o,locale:a,useSvg:Q,scales:r,scale:N,onReportSpec:s,displayOffset:u}))}),EdA=qSt,WS=A=>{const{allFields:e,viewDimensions:t,viewMeasures:i,filters:n,defaultAggregated:o,sort:g,limit:a,computationFunction:s,folds:I,timezoneDisplayOffset:r}=A,[C,l]=p.useState(!1),c=p.useRef(0),B=p.useMemo(()=>Hm(n,e,t,i,o,g,I,a>0?a:void 0,r),[n,e,t,i,o,g,I,a]),[E,u]=p.useState([]),[d,f]=p.useState([]),w=_k();p.useEffect(()=>{var G;const R=++c.current;(G=w.current)==null||G.updateRenderStatus("computing"),l(!0),t9(s,B,a>0?a:void 0).then(x=>GvA(x,o,e,i,t,I)).then(x=>{var F;R===c.current&&((F=w.current)==null||F.updateRenderStatus("rendering"),bt.unstable_batchedUpdates(()=>{l(!1),u(x),f(B)}))}).catch(x=>{var F;R===c.current&&((F=w.current)==null||F.updateRenderStatus("error"),console.error(x),bt.unstable_batchedUpdates(()=>{l(!1),u([]),f([])}))})},[s,B]);const y=p.useMemo(()=>({workflow:d}),[d]);return p.useMemo(()=>({viewData:E,loading:C,parsed:y}),[E,C])},jSt=A=>{const e=_k();p.useEffect(()=>{e.current&&(e.current.chartCount=A.count,e.current.chartIndex=A.index,e.current.openChart=function(t){t!==this.chartIndex&&(Number.isInteger(t)&&t>=0&&t<this.chartCount?A.onChange(t):console.warn(`Invalid chart index: ${t}`))})}),p.useEffect(()=>()=>{e.current&&(e.current.chartCount=1,e.current.chartIndex=0,e.current.openChart=()=>{})},[])},PSt=p.forwardRef(function(A,e){const{computationFunction:t,vizThemeConfig:i,csvRef:n,overrideSize:o}=A,g=xt(),{allFields:a,viewFilters:s,viewDimensions:I,viewMeasures:r,config:C,layout:l,currentVis:c,visIndex:B,visLength:E,sort:u,limit:d}=g,f=p.useMemo(()=>({...l,...o?{size:o}:{}}),[l,o]),w=c.encodings,{i18n:y}=ve(),[G,R]=p.useState(XiA),[x,F]=p.useState(ziA),[Q,k]=p.useState([]),{viewData:h,loading:N}=WS({allFields:a,viewDimensions:I,viewMeasures:r,filters:s,defaultAggregated:C.defaultAggregated,sort:u,limit:d,folds:C.folds,computationFunction:t,timezoneDisplayOffset:C.timezoneDisplayOffset});p.useEffect(()=>{n&&(n.current={download(){const _=I.concat(r).map($=>$.fid===no?{name:"Count",fid:no}:G.defaultAggregated&&$.analyticType==="measure"?{fid:Fo($.fid,$.aggName),name:wy($.name,$.aggName)}:{fid:$.fid,name:$.name}),q=`${_.map($=>$.name).join(",")}
${h.map($=>_.map(nA=>$[nA.fid]).join(",")).join(`
`)}`;Y3e(q,`${c.name}.csv`,"text/plain")}})},[c.name,n,h,I,r,G.defaultAggregated]);const v=p.useRef({data:h,draggableFieldState:w,visualConfig:C});v.current={data:h,draggableFieldState:w,visualConfig:C},p.useEffect(()=>{N===!1&&bt.unstable_batchedUpdates(()=>{k(v.current.data),F(v.current.draggableFieldState),R(v.current.visualConfig)})},[N,h,g]),jSt({count:E,index:B,onChange:_=>g.selectVisualization(_)});const K=p.useCallback((_,q)=>{if(q.stopPropagation(),ke.EMBEDED_MENU_LIST.length>0){XxA(()=>{g.showEmbededMenu([q.clientX,q.clientY]),g.setFilters(_)});const{vlPoint:$,...nA}=_,j=Object.fromEntries(Object.entries(nA).map(([oA,tA])=>[oA,tA instanceof Array?tA[0]:void 0])),O=fk(C.geoms[0]).flatMap(oA=>x[oA]),eA=Object.keys(j).map(oA=>O.find(tA=>tA.fid===oA)).filter(oA=>!!oA&&oA.semanticType==="temporal");if(eA.length>0){const oA=C.timezoneDisplayOffset??new Date().getTimezoneOffset();eA.forEach(tA=>{const sA=tA.offset??new Date().getTimezoneOffset(),gA=new Set(Q.map(iA=>iA[tA.fid]));j[tA.fid]=Array.from(gA).find(iA=>{const aA=DF(iA);let lA=oA*-6e4;return aA!=="timestamp"&&(lA+=sA*6e4,$MA.includes(aA)||(lA-=new Date().getTimezoneOffset()*6e4)),new Date(iA).getTime()+lA===j[tA.fid]})})}if(q.item.mark.marktype==="line"){const oA=new Set(Object.keys(q.item.mark.group.datum??{}));g.updateSelectedMarkObject(Object.fromEntries(Object.entries(j).filter(([tA])=>oA.has(tA))))}else g.updateSelectedMarkObject(j)}},[g,Q,x,C]),U=p.useCallback((_,q)=>{g.setVisualLayout("size",{mode:"fixed",width:_,height:q})},[g]),V=G.coordSystem==="geographic",X=p.useRef(f.size);return X.current=f.size,p.useEffect(()=>{if(V){const _=X.current;if(X.current.width<uaA||X.current.height<U9)return g.setVisualLayout("size",{mode:X.current.mode,width:Math.max(_.width,uaA),height:Math.max(_.height,U9)}),()=>{g.setVisualLayout("size",_)}}},[V,g]),b.createElement("div",{className:"w-full h-full"},N&&b.createElement(nr,null),b.createElement("div",{className:"overflow-auto w-full h-full"},b.createElement(EdA,{name:c==null?void 0:c.name,data:Q,ref:e,vizThemeConfig:i,locale:y.language,draggableFieldState:x,visualConfig:G,onGeomClick:K,onChartResize:U,layout:f,scales:A.scales,onReportSpec:_=>{g.updateLastSpec(_)}})))}),Woe=ze(PSt);var VO="Dialog",[Koe,U0i]=Tg(VO),[$St,gB]=Koe(VO),Uoe=A=>{const{__scopeDialog:e,children:t,open:i,defaultOpen:n,onOpenChange:o,modal:g=!0}=A,a=p.useRef(null),s=p.useRef(null),[I,r]=is({prop:i,defaultProp:n??!1,onChange:o,caller:VO});return cA($St,{scope:e,triggerRef:a,contentRef:s,contentId:_o(),titleId:_o(),descriptionId:_o(),open:I,onOpenChange:r,onOpenToggle:p.useCallback(()=>r(C=>!C),[r]),modal:g,children:t})};Uoe.displayName=VO;var Voe="DialogTrigger",AHt=p.forwardRef((A,e)=>{const{__scopeDialog:t,...i}=A,n=gB(Voe,t),o=Te(e,n.triggerRef);return cA(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":hdA(n.open),...i,ref:o,onClick:TA(A.onClick,n.onOpenToggle)})});AHt.displayName=Voe;var udA="DialogPortal",[eHt,Xoe]=Koe(udA,{forceMount:void 0}),zoe=A=>{const{__scopeDialog:e,forceMount:t,children:i,container:n}=A,o=gB(udA,e);return cA(eHt,{scope:e,forceMount:t,children:p.Children.map(i,g=>cA(qg,{present:t||o.open,children:cA(Jk,{asChild:!0,container:n,children:g})}))})};zoe.displayName=udA;var XO="DialogOverlay",Toe=p.forwardRef((A,e)=>{const t=Xoe(XO,A.__scopeDialog),{forceMount:i=t.forceMount,...n}=A,o=gB(XO,A.__scopeDialog);return o.modal?cA(qg,{present:i||o.open,children:cA(iHt,{...n,ref:e})}):null});Toe.displayName=XO;var tHt=Ym("DialogOverlay.RemoveScroll"),iHt=p.forwardRef((A,e)=>{const{__scopeDialog:t,...i}=A,n=gB(XO,t);return cA(QX,{as:tHt,allowPinchZoom:!0,shards:[n.contentRef],children:cA(re.div,{"data-state":hdA(n.open),...i,ref:e,style:{pointerEvents:"auto",...i.style}})})}),bw="DialogContent",_oe=p.forwardRef((A,e)=>{const t=Xoe(bw,A.__scopeDialog),{forceMount:i=t.forceMount,...n}=A,o=gB(bw,A.__scopeDialog);return cA(qg,{present:i||o.open,children:o.modal?cA(nHt,{...n,ref:e}):cA(oHt,{...n,ref:e})})});_oe.displayName=bw;var nHt=p.forwardRef((A,e)=>{const t=gB(bw,A.__scopeDialog),i=p.useRef(null),n=Te(e,t.contentRef,i);return p.useEffect(()=>{const o=i.current;if(o)return sX(o)},[]),cA(Ooe,{...A,ref:n,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:TA(A.onCloseAutoFocus,o=>{var g;o.preventDefault(),(g=t.triggerRef.current)==null||g.focus()}),onPointerDownOutside:TA(A.onPointerDownOutside,o=>{const g=o.detail.originalEvent,a=g.button===0&&g.ctrlKey===!0;(g.button===2||a)&&o.preventDefault()}),onFocusOutside:TA(A.onFocusOutside,o=>o.preventDefault())})}),oHt=p.forwardRef((A,e)=>{const t=gB(bw,A.__scopeDialog),i=p.useRef(!1),n=p.useRef(!1);return cA(Ooe,{...A,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var g,a;(g=A.onCloseAutoFocus)==null||g.call(A,o),o.defaultPrevented||(i.current||(a=t.triggerRef.current)==null||a.focus(),o.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:o=>{var g,a;(g=A.onInteractOutside)==null||g.call(A,o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=o.target;(a=t.triggerRef.current)!=null&&a.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&n.current&&o.preventDefault()}})}),Ooe=p.forwardRef((A,e)=>{const{__scopeDialog:t,trapFocus:i,onOpenAutoFocus:n,onCloseAutoFocus:o,...g}=A,a=gB(bw,t),s=p.useRef(null),I=Te(e,s);return qV(),Ic(yy,{children:[cA(kF,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:n,onUnmountAutoFocus:o,children:cA(Ny,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":hdA(a.open),...g,ref:I,onDismiss:()=>a.onOpenChange(!1)})}),Ic(yy,{children:[cA(gHt,{titleId:a.titleId}),cA(sHt,{contentRef:s,descriptionId:a.descriptionId})]})]})}),ddA="DialogTitle",qoe=p.forwardRef((A,e)=>{const{__scopeDialog:t,...i}=A,n=gB(ddA,t);return cA(re.h2,{id:n.titleId,...i,ref:e})});qoe.displayName=ddA;var joe="DialogDescription",Poe=p.forwardRef((A,e)=>{const{__scopeDialog:t,...i}=A,n=gB(joe,t);return cA(re.p,{id:n.descriptionId,...i,ref:e})});Poe.displayName=joe;var $oe="DialogClose",Age=p.forwardRef((A,e)=>{const{__scopeDialog:t,...i}=A,n=gB($oe,t);return cA(re.button,{type:"button",...i,ref:e,onClick:TA(A.onClick,()=>n.onOpenChange(!1))})});Age.displayName=$oe;function hdA(A){return A?"open":"closed"}var ege="DialogTitleWarning",[V0i,tge]=wZe(ege,{contentName:bw,titleName:ddA,docsSlug:"dialog"}),gHt=({titleId:A})=>{const e=tge(ege),t=`\`${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 p.useEffect(()=>{A&&(document.getElementById(A)||console.error(t))},[t,A]),null},aHt="DialogDescriptionWarning",sHt=({contentRef:A,descriptionId:e})=>{const t=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tge(aHt).contentName}}.`;return p.useEffect(()=>{var i;const n=(i=A.current)==null?void 0:i.getAttribute("aria-describedby");e&&n&&(document.getElementById(e)||console.warn(t))},[t,A,e]),null},ige=Uoe,nge=zoe,oge=Toe,KS=_oe,gge=qoe,age=Poe,sge=Age;const rge=p.forwardRef(({className:A,children:e,...t},i)=>p.createElement("div",{ref:i,className:Ce("relative overflow-auto dark:[color-scheme:dark]",A),...t},e)),sa=ige,Ige=nge,mdA=p.forwardRef(({className:A,...e},t)=>p.createElement("div",{ref:t,className:Ce("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",A),...e}));mdA.displayName=oge.displayName;const ra=p.forwardRef(({className:A,containerClassName:e,showCloseButton:t=!0,children:i,...n},o)=>p.createElement(Ige,{container:p.useContext(Ry)},p.createElement(mdA,null),p.createElement(KS,{ref:o,className:Ce("fixed left-[50%] top-[50%] z-50 grid w-[98%] sm:w-[80%] lg:w-[880px] translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background 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 overflow-hidden",A),...n},p.createElement(rge,{className:Ce("overscroll-none max-h-[calc(min(800px,90vh))] w-full relative p-6",e)},i),t&&p.createElement(sge,{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"},p.createElement(SHA,{className:"h-4 w-4"}),p.createElement("span",{className:"sr-only"},"Close")))));ra.displayName=KS.displayName;const Cge=p.forwardRef(({className:A,containerClassName:e,children:t,...i},n)=>p.createElement(Ige,{container:p.useContext(Ry)},p.createElement(mdA,null),p.createElement(KS,{ref:n,className:Ce("fixed left-[50%] top-[50%] z-50 grid w-[98%] sm:w-[80%] lg:w-[880px] translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background 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 overflow-hidden",A),...i},t,p.createElement(sge,{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"},p.createElement(SHA,{className:"h-4 w-4"}),p.createElement("span",{className:"sr-only"},"Close")))));Cge.displayName=KS.displayName;const US=({className:A,...e})=>p.createElement("div",{className:Ce("flex flex-col space-y-1.5 text-center sm:text-left",A),...e});US.displayName="DialogHeader";const nE=({className:A,...e})=>p.createElement("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",A),...e});nE.displayName="DialogFooter";const pdA=p.forwardRef(({className:A,...e},t)=>p.createElement(gge,{ref:t,className:Ce("text-lg font-semibold leading-none tracking-tight",A),...e}));pdA.displayName=gge.displayName;const rHt=p.forwardRef(({className:A,...e},t)=>p.createElement(age,{ref:t,className:Ce("text-sm text-muted-foreground",A),...e}));rHt.displayName=age.displayName;const IHt=ze(function(){const{t:A}=ve(),e=xt();return b.createElement(sa,{onOpenChange:()=>e.closeRemoveConfirmModal(),open:e.removeConfirmIdx!==null},b.createElement(ra,null,b.createElement(US,null,A("main.tablist.remove_confirm")),b.createElement(nE,{className:"mt-4"},b.createElement(fe,{variant:"outline",onClick:()=>{e.closeRemoveConfirmModal()}},A("actions.cancel")),b.createElement(fe,{variant:"destructive",onClick:()=>{e.removeVisualization(e.removeConfirmIdx),e.closeRemoveConfirmModal()}},A("actions.confirm")))))}),CHt=IHt;function lHt(...A){return A.filter(Boolean).join(" ")}const cHt=A=>{const[e,t]=p.useState(0),i=p.useRef(null),n=p.useRef(null),o=p.useRef(null),g=p.useCallback(I=>{var r,C,l;I.preventDefault(),I.stopPropagation();const c=(r=i.current)==null?void 0:r.getBoundingClientRect().width,B=(l=(C=i.current)==null?void 0:C.children[0])==null?void 0:l.getBoundingClientRect().width;return c&&B&&t(E=>Math.min(Math.max(0,B-c),Math.max(0,E+I.deltaY+I.deltaX))),!1},[]),a=p.useCallback(I=>{var r;if((r=n.current)==null||r.call(n),I==null)return;const C=new ResizeObserver(l=>{var c,B;for(const E of l){const u=E.contentRect.width,d=(B=(c=i.current)==null?void 0:c.children[0])==null?void 0:B.getBoundingClientRect().width;u&&d&&t(f=>Math.min(Math.max(0,d-u),f))}});C.observe(I),i.current=I,I.addEventListener("wheel",g,{passive:!1}),n.current=()=>{var l;C.disconnect(),(l=i.current)==null||l.removeEventListener("wheel",g)}},[g]),s=p.useCallback(I=>{var r;if((r=o.current)==null||r.call(o),I===null)return;const C=new ResizeObserver(l=>{var c;for(const B of l){const E=(c=i.current)==null?void 0:c.getBoundingClientRect().width,u=B.contentRect.width;E&&u&&t(d=>Math.min(Math.max(0,u-E),d))}});o.current=()=>{C.disconnect()},C.observe(I)},[]);return b.createElement("div",{style:{overflowX:"clip"},ref:a,onWheel:I=>(I.preventDefault(),I.stopPropagation(),I.nativeEvent.preventDefault(),t(r=>Math.max(0,r+I.deltaY)),!1),className:A.className},b.createElement("div",{ref:s,style:{left:`-${e}px`,width:"min-content",position:"relative"}},A.children))};function BHt(A){const{tabs:e,selectedKey:t,onSelected:i,onEditLabel:n,onRemove:o,onDuplicate:g,showRemove:a}=A,[s,I]=p.useState(-1),[r,C]=p.useState(""),{t:l}=ve();return b.createElement("div",{className:"overflow-y-visible"},b.createElement(CHt,null),b.createElement(sa,{open:s>-1,onOpenChange:()=>{I(-1)}},b.createElement(ra,null,b.createElement(US,null,l("main.tablist.chart_name")),b.createElement("div",{className:"py-4"},b.createElement(oo,{value:r,onChange:c=>{C(c.target.value)}})),b.createElement(nE,null,b.createElement(fe,{variant:"outline",onClick:()=>{bt.unstable_batchedUpdates(()=>{I(-1),C("")})}},l("actions.cancel")),b.createElement(fe,{onClick:()=>{bt.unstable_batchedUpdates(()=>{n&&n(r,s),I(-1),C("")})}},l("actions.confirm"))))),b.createElement(cHt,null,b.createElement("nav",{className:"-mb-px flex h-8",role:"tablist","aria-label":"Tabs"},e.map((c,B)=>b.createElement("span",{role:"tab",tabIndex:0,onClick:()=>{i(c.key,B)},key:c.key,className:lHt(c.key===t?"border":"text-muted-foreground hover:text-accent-foreground hover:bg-accent","flex whitespace-nowrap rounded-t group py-1 px-2 pr-2 text-sm cursor-default")},c.label,c.key===t&&c.editable&&b.createElement(JX,null,b.createElement(NX,null,b.createElement(rF,{className:"h-4 w-4","aria-hidden":"true"})),b.createElement(_F,{align:"start"},b.createElement(OF,{className:"text-xs",onClick:E=>{E.stopPropagation(),bt.unstable_batchedUpdates(()=>{I(B),C(c.label)})}},"Edit"),b.createElement(OF,{className:"text-xs",onClick:E=>{E.stopPropagation(),g==null||g(B)}},"Duplicate"),a&&b.createElement(OF,{className:"text-xs text-destructive",onClick:E=>{E.stopPropagation(),o==null||o(B)}},"Remove"))))))))}const lge="_add",QHt=A=>{const e=xt(),{currentVis:t,visLength:i,vizList:n}=e,{t:o}=ve(),g=n.map(C=>({key:C.visId,label:C.name??"vis",editable:!0}));g.push({key:lge,label:o("main.tablist.new")});const a=p.useCallback((C,l)=>{C===lge?e.addVisualization(c=>o("main.tablist.auto_title",{idx:c})):e.selectVisualization(l)},[e,i]),s=p.useCallback((C,l)=>{e.setVisName(l,C)},[e]),I=p.useCallback(C=>{e.openRemoveConfirmModal(C)},[e]),r=p.useCallback(C=>{e.duplicateVisualization(C)},[e]);return b.createElement(BHt,{selectedKey:t.visId,tabs:g,onEditLabel:s,onSelected:a,onDuplicate:r,onRemove:I,showRemove:i>1})},EHt=ze(QHt);var cge=[],uHt=cge.forEach,dHt=cge.slice;function hHt(A){return uHt.call(dHt.call(arguments,1),function(e){if(e)for(var t in e)A[t]===void 0&&(A[t]=e[t])}),A}var Bge=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,mHt=function(A,e,t){var i=t||{};i.path=i.path||"/";var n=encodeURIComponent(e),o="".concat(A,"=").concat(n);if(i.maxAge>0){var g=i.maxAge-0;if(Number.isNaN(g))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(g))}if(i.domain){if(!Bge.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(i.domain)}if(i.path){if(!Bge.test(i.path))throw new TypeError("option path is invalid");o+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.sameSite){var a=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(a){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},Qge={create:function(A,e,t,i){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+t*60*1e3)),i&&(n.domain=i),document.cookie=mHt(A,encodeURIComponent(e),n)},read:function(A){for(var e="".concat(A,"="),t=document.cookie.split(";"),i=0;i<t.length;i++){for(var n=t[i];n.charAt(0)===" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return n.substring(e.length,n.length)}return null},remove:function(A){this.create(A,"",-1)}},pHt={name:"cookie",lookup:function(A){var e;if(A.lookupCookie&&typeof document<"u"){var t=Qge.read(A.lookupCookie);t&&(e=t)}return e},cacheUserLanguage:function(A,e){e.lookupCookie&&typeof document<"u"&&Qge.create(e.lookupCookie,A,e.cookieMinutes,e.cookieDomain,e.cookieOptions)}},fHt={name:"querystring",lookup:function(A){var e;if(typeof window<"u"){var t=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(t=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=t.substring(1),n=i.split("&"),o=0;o<n.length;o++){var g=n[o].indexOf("=");if(g>0){var a=n[o].substring(0,g);a===A.lookupQuerystring&&(e=n[o].substring(g+1))}}}return e}},VS=null,Ege=function(){if(VS!==null)return VS;try{VS=window!=="undefined"&&window.localStorage!==null;var A="i18next.translate.boo";window.localStorage.setItem(A,"foo"),window.localStorage.removeItem(A)}catch{VS=!1}return VS},yHt={name:"localStorage",lookup:function(A){var e;if(A.lookupLocalStorage&&Ege()){var t=window.localStorage.getItem(A.lookupLocalStorage);t&&(e=t)}return e},cacheUserLanguage:function(A,e){e.lookupLocalStorage&&Ege()&&window.localStorage.setItem(e.lookupLocalStorage,A)}},XS=null,uge=function(){if(XS!==null)return XS;try{XS=window!=="undefined"&&window.sessionStorage!==null;var A="i18next.translate.boo";window.sessionStorage.setItem(A,"foo"),window.sessionStorage.removeItem(A)}catch{XS=!1}return XS},bHt={name:"sessionStorage",lookup:function(A){var e;if(A.lookupSessionStorage&&uge()){var t=window.sessionStorage.getItem(A.lookupSessionStorage);t&&(e=t)}return e},cacheUserLanguage:function(A,e){e.lookupSessionStorage&&uge()&&window.sessionStorage.setItem(e.lookupSessionStorage,A)}},wHt={name:"navigator",lookup:function(A){var e=[];if(typeof navigator<"u"){if(navigator.languages)for(var t=0;t<navigator.languages.length;t++)e.push(navigator.languages[t]);navigator.userLanguage&&e.push(navigator.userLanguage),navigator.language&&e.push(navigator.language)}return e.length>0?e:void 0}},DHt={name:"htmlTag",lookup:function(A){var e,t=A.htmlTag||(typeof document<"u"?document.documentElement:null);return t&&typeof t.getAttribute=="function"&&(e=t.getAttribute("lang")),e}},GHt={name:"path",lookup:function(A){var e;if(typeof window<"u"){var t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(t instanceof Array)if(typeof A.lookupFromPathIndex=="number"){if(typeof t[A.lookupFromPathIndex]!="string")return;e=t[A.lookupFromPathIndex].replace("/","")}else e=t[0].replace("/","")}return e}},kHt={name:"subdomain",lookup:function(A){var e=typeof A.lookupFromSubdomainIndex=="number"?A.lookupFromSubdomainIndex+1:1,t=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(t)return t[e]}};function JHt(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var dge=function(){function A(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};WC(this,A),this.type="languageDetector",this.detectors={},this.init(e,t)}return KC(A,[{key:"init",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=hHt(t,this.options||{},JHt()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(pHt),this.addDetector(fHt),this.addDetector(yHt),this.addDetector(bHt),this.addDetector(wHt),this.addDetector(DHt),this.addDetector(GHt),this.addDetector(kHt)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var i=[];return e.forEach(function(n){if(t.detectors[n]){var o=t.detectors[n].lookup(t.options);o&&typeof o=="string"&&(o=[o]),o&&(i=i.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var i=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(function(n){i.detectors[n]&&i.detectors[n].cacheUserLanguage(e,i.options)}))}}]),A}();dge.type="languageDetector";const NHt={scheme:"Scheme",primary_color:"Primary Color",color_palette:"Color Palette",theme:"Theme",row:"Row",column:"Column",radius:"Radius",theta:"Theta",opacity:"Opacity",default_color_palette:"Default",size:"Size",type:"Scale Type",min_domain:"Domain Min",max_domain:"Domain Max",range:"Range",format:"Format",numberFormat:"Number format",timeFormat:"Time format",normalizedNumberFormat:"Normalized number format",background:"Background",color:"Color",independence:"Independence",x:"x-Axis",y:"y-Axis",zeroScale:"Zero Scale",misc:"Misc",formatGuidesDocs:"Format guides docs",readHere:"read here",svg:"Use SVG",customTile:"Use a Custom Tile for map",customOffset:"Use a Specific timezone",map_settings:"Map Settings",map_settings_desc:"Configure how map visualizations display and use custom map tile services.",customTile_desc:"Specify a custom map tile URL for geographic visualizations.",choropleth_settings:"Choropleth Settings",choropleth_settings_desc:"Control how geographic shapes and data are displayed in choropleth maps.",include_unmatched:"Include unmatched choropleth in scale",include_unmatched_desc:"Include regions without data matches when calculating color scales.",include_shapes:"Include shapes without data",include_shapes_desc:"Show all geographic shapes even if they don't have associated data values.",visualization_settings:"Visualization Settings",visualization_settings_desc:"Configure general settings for all visualizations.",zeroScale_desc:"Force numeric axes to start at zero instead of auto-scaling to data range.",svg_desc:"Use SVG renderer instead of Canvas for higher quality but potentially slower performance.",timezone_settings:"Timezone Settings",timezone_settings_desc:"Configure how time-based data is displayed across different timezones.",customOffset_desc:"Specify a custom timezone for displaying time-based data."},YHt={row_count:"Row count",mea_key:"Measure names",mea_val:"Measure values",paint_key:"Paint Field",analytic_type:{dimension:"dimension",measure:"measure"},semantic_type:{nominal:"nominal",ordinal:"ordinal",temporal:"temporal",quantitative:"quantitative"},mark_type:{__enum__:"Mark Type",auto:"Auto",bar:"Bar",line:"Line",area:"Area",trail:"Trail",point:"Scatter",circle:"Circle",tick:"Tick",rect:"Rectangle",arc:"Arc",boxplot:"Box (Box Plot)",table:"Table",text:"Text",poi:"POI",choropleth:"Choropleth"},coord_system:{__enum__:"Coordinate System",generic:"Generic",geographic:"Geographic"},stack_mode:{__enum__:"Stack Mode",none:"None",stack:"Stack",normalize:"Normalize",center:"Center"},layout_type:{__enum__:"Layout Mode",auto:"Auto",fixed:"Fixed",full:"Container"},exploration_mode:{__enum__:"Exploration Mode",none:"Off",brush:"Brush",point:"Point"},brush_mode:{__enum__:"Brush Direction",default:"Both",x:"X-Only",y:"Y-Only"},draggable_key:{fields:"Fields",columns:"X-Axis",rows:"Y-Axis",color:"Color",opacity:"Opacity",size:"Size",shape:"Shape",theta:"Angle",radius:"Radius",filters:"Filters",details:"Details",text:"Text",longitude:"Longitude",latitude:"Latitude",geoId:"Geometry ID"},aggregator:{sum:"Sum",mean:"Mean",count:"Count",median:"Median",min:"Min",max:"Max",q1:"Q1",q3:"Q3",stdev:"Standard Deviation",variance:"Variance"},filter_type:{one_of:"Value set",one_of_desc:"Select values specified",range:"Range",range_desc:"Select values in a range [start, end]",temporal_range:"Date Range",temporal_range_desc:"Select values in a date range [start, end]"}},RHt={labels:{data_interpretation:"Interpret Data",data_view:"View Data"},segments:{vis:"Visualization",data:"Data",chat:"Chat"},feedback:{vote:"Is the result of Askviz good?",voteup:"Yes",votedown:"No",report:"Please help us improving Askviz with correct Chart",report_button:"Report correct chart"}},xHt={labels:{cur_dataset:"Current Dataset"},buttons:{create_dataset:"Create Dataset",export_as_file:"Save As File",import_file:"Import Graphic Walker File"},dialog:{create_data_source:"New Data Source",data_types:"DataSource Type",text_file_data:"Local Files",public_data:"Public Datasets",data_source_type:"Data Source Type: {{sourceType}}",file:{open:"Open...",submit:"Submit",dataset_name:"Dataset Name",choose_file:"Choose a Data File",get_start_desc:"Get started by creating a dataset."},public:{submit:"Submit"}}},FHt={tablist:{new:"+ New",auto_title:"Chart {{idx}}",chart_name:"Chart Name",remove_confirm:"Are you sure you want to remove this chart?"},tabpanel:{menubar:{undo:"Undo",redo:"Redo"},askviz:{placeholder:"What visualization your want to draw from the dataset"},settings:{toggle:{aggregation:"Aggregation",stack:"Stack",axes_resize:"Axes Resizing",debug:"debugging"},sort:"Sorting Order",button:{ascending:"Sort in Ascending Order",descending:"Sort in Descending Order",transpose:"Transpose",config:"Config",export_chart:"Export",export_chart_as:"Export as {{type}}",export_code:"Export Code",geojson:"Geography Configuration",painter:"Open Painter",disabled_painter:{aggergation:"disable aggregation to create a paint",temporal:"painter doesn't support temporal fields now",count:"drag single field on x and y to create a paint"}},paint:{palette:"Palette",eraser:"Eraser",color:"Brush Color",label:"Brush Label",brush_size:"Brush Size",save_paint:"Save Painting",reset_paint:"Reset Painting",cancel:"Cancel",delete_paint:"Delete Painting"},limit:"enable query limit (rows)",size:"Resize",size_setting:{width:"Width",height:"Height"},table:{summary:"Show summary"},geography:"Geography Configuration",geography_settings:{geoKey:"Feature ID",format:"Format",geojson:"GeoJSON",topojson:"TopoJSON",objectKey:"Extract Feature Key",jsonInputPlaceholder:"Drop {{format}} file here",href:"{{format}} URL",hrefPlaceholder:"Enter {{format}} URL",load:"Load",loading:"Loading Geographic Data..."}},DatasetFields:{field_list:"Field List"}}},MHt={to_edit:"Edit This Rule",empty_rule:"! (empty rule)",editing:"Filter Rule Settings",form:{name:"Field",aggregation:"Aggregation",rule:"Rule"},header:{visibility:"Visible",value:"Label",count:"Count"},selected_keys:"{{ count }} items selected",btn:{select_all:"Select All",unselect_all:"Unselect All",reverse:"Reverse Selection",confirm:"Confirm",cancel:"Cancel"},range:{start_value:"Start Value",end_value:"End Value"}},vHt={lg_than:"greater than",sm_than:"less than",expection:"expectation",unrecognized:"Unrecognized",score:"score",contains:"contains",reason:{selection_dim_distribution:"dimensions' clues",selection_mea_distribution:"measures' clues",children_major_factor:"major factor",children_outlier:"outlier"}},LHt={prev:"Previous",next:"Next",drop_field:"Drop Field Here",confirm:"Confirm",cancel:"Cancel"},SHt={to_dim:"Move to dimensions",to_mea:"Move to measures",semantic_type:{name:"Change Semantic Type",types:{nominal:"Nominal",ordinal:"Ordinal",quantitative:"Quantitative",temporal:"Temporal"}},new_calc:"New calculation",bin:"Bin",binCount:"Bin Count",log:"Log{{ base }}",binCustom:"Bin(customize)",logCustom:"Log(customize)",drill:{name:"Time Unit",feature_name:"Time feature",levels:{year:"Year",quarter:"Quarter",month:"Month",week:"Week",weekday:"Weekday",day:"Day",hour:"Hour",minute:"Minute",second:"Second",iso_year:"ISO Year",iso_week:"ISO Week",iso_weekday:"ISO Weekday"}}},HHt={bin_panel_title:"Bins",bin_panel_desc:"Set bin config for field",bin_panel_option_widths:"Bin with equal widths",bin_panel_option_counts:"Bin with equal counts",bin_panel_number:"Bin number",log_panel_title:"Logarithm Transformation",log_panel_desc:"Set log config for field",log_panel_number:"Logarithmic base"},hge={config:NHt,constant:YHt,App:RHt,DataSource:xHt,main:FHt,filters:MHt,explain:vHt,actions:LHt,field_menu:SHt,calc:HHt},ZHt={scheme:"スキーム",primary_color:"プライマリカラー",color_palette:"カラーパレット",theme:"テーマ",opacity:"不透明度",default_color_palette:"デフォルト",size:"サイズ",min_domain:"最小ドメイン",max_domain:"最大ドメイン",range:"範囲",format:"フォーマット",numberFormat:"数字",timeFormat:"日付",normalizedNumberFormat:"正規化された数字",background:"背景",color:"色",independence:"独立したスケーリング",x:"x軸",y:"y軸",zeroScale:"０を含む",misc:"その他",formatGuidesDocs:"フォーマットガイド",readHere:"ここを読む",svg:"SVGを使う",customTile:"地図タイルをカスタマイズ",customOffset:"タイムゾーンをカスタマイズ",map_settings:"地図設定",map_settings_desc:"地図の可視化の表示方法とカスタム地図タイルサービスの使用方法を設定します。",customTile_desc:"地理的可視化のためのカスタム地図タイルURLを指定します。",choropleth_settings:"コロプレス設定",choropleth_settings_desc:"コロプレス地図での地理的形状とデータの表示方法を制御します。",include_unmatched:"マッチしないコロプレスをスケールに含める",include_unmatched_desc:"カラースケールを計算する際にデータの一致がない地域を含めます。",include_shapes:"データのない形状を含める",include_shapes_desc:"関連するデータ値がなくても、すべての地理的形状を表示します。",visualization_settings:"可視化設定",visualization_settings_desc:"すべての可視化に対する一般的な設定を構成します。",zeroScale_desc:"データ範囲に合わせて自動スケーリングする代わりに、数値軸をゼロから始めるように強制します。",svg_desc:"高品質だがパフォーマンスが低下する可能性のあるSVGレンダラーを使用します。",timezone_settings:"タイムゾーン設定",timezone_settings_desc:"異なるタイムゾーン間での時間ベースのデータの表示方法を設定します。",customOffset_desc:"時間ベースのデータを表示するためのカスタムタイムゾーンを指定します。"},WHt={row_count:"行数",mea_key:"名",mea_val:"値",paint_key:"キャンバスでのフィールド",analytic_type:{dimension:"ディメンション",measure:"メジャー"},semantic_type:{nominal:"名義尺度",ordinal:"順序尺度",temporal:"時間尺度",quantitative:"数量尺度"},mark_type:{__enum__:"マークタイプ",auto:"自動",bar:"バー",line:"ライン",area:"エリア",trail:"トレイル",point:"散布図",circle:"円",tick:"棒線図",rect:"長方形",arc:"アーク",boxplot:"ボックスプロット",table:"テーブル",text:"文字",poi:"POI",choropleth:"コロプレス"},stack_mode:{__enum__:"スタックモード",none:"なし",stack:"スタック",normalize:"正規化",center:"中央"},layout_type:{__enum__:"レイアウトタイプ",auto:"自動",fixed:"固定",full:"コンテナー"},exploration_mode:{__enum__:"探索モード",none:"オフ",brush:"ブラシ",point:"ポイント"},brush_mode:{__enum__:"ブラシの方向",default:"両方",x:"X軸のみ",y:"Y軸のみ"},draggable_key:{fields:"フィールド",columns:"X軸",rows:"Y軸",color:"色",opacity:"不透明度",size:"大きさ",shape:"形状",theta:"角度",radius:"半径",filters:"フィルター",text:"テキスト",longitude:"経度",latitude:"緯度",geoId:"地理ID"},aggregator:{sum:"合計",mean:"平均",count:"件数",median:"中央値",min:"最小値",max:"最大値",q1:"第一四分位数",q3:"第三四分位数",stdev:"標準偏差",variance:"分散"},filter_type:{one_of:"値のセット",one_of_desc:"指定された値を選択します",range:"範囲",range_desc:"範囲 [開始, 終了] 内の値を選択します",temporal_range:"日付範囲",temporal_range_desc:"日付範囲 [開始, 終了] 内の値を選択します"}},KHt={labels:{data_interpretation:"データ解釈",data_view:"データ一覧"},segments:{vis:"可視化",data:"データ",chat:"会話"},feedback:{vote:"Askvizの結果はどうですか？",voteup:"いいね",votedown:"ダメかも",report:"Askvizを改善することに手伝って、正しいチャットを教えてもよろしいですか？",report_button:"フィードバック"}},UHt={labels:{cur_dataset:"現在のデータセット"},buttons:{create_dataset:"データセットを作成",export_as_file:"ファイルとして保存",import_file:"Graphic Walkerファイルをインポート"},dialog:{create_data_source:"新しいデータソース",data_types:"データソースの種類",text_file_data:"ローカルファイル",public_data:"公開データセット",data_source_type:"データソースの種類：{{sourceType}}",file:{open:"開く...",submit:"提出する",dataset_name:"データセット名",choose_file:"データファイルを選択してください",get_start_desc:"データセットの作成を始めましょう。"},public:{submit:"提出する"}}},VHt={tablist:{new:"+ 新規作成",auto_title:"グラフ {{idx}}",chart_name:"グラフ名",remove_confirm:"このグラフを削除してもよろしいですか？"},askviz:{placeholder:"データセットから描画したい視覚化は何ですか？"},tabpanel:{menubar:{undo:"元に戻す",redo:"やり直し"},settings:{toggle:{aggregation:"集計",stack:"スタック",axes_resize:"軸のサイズ変更",debug:"デバッグ"},sort:"並べ替えの順序",button:{ascending:"昇順に並べ替える",descending:"降順に並べ替える",transpose:"転置",config:"設定",export_chart:"エクスポート",export_chart_as:"{{type}}としてエクスポート",export_code:"コードをエクスポート",geojson:"地理情報設定",painter:"データキャンバスを開く",disabled_painter:{aggergation:"データキャンバスを作るには集計をオフにするが必要",temporal:"時間的フィールドはまたデータキャンバスで使うことができない",count:"データキャンバスを作るにはフィールドをXY軸に設置してください"}},paint:{palette:"パレット",eraser:"消しゴム",color:"色",label:"ラベル",brush_size:"ブラシサイズ",save_paint:"キャンバスを保存",reset_paint:"キャンバスをリセット",cancel:"キャンセル",delete_paint:"キャンバスを削除"},limit:"クエリ制限 (行数) を有効にする",size:"サイズ変更",size_setting:{width:"幅",height:"高さ"},table:{summary:"サマリを表示"},geography:"地理情報設定",geography_settings:{geoKey:"フィーチャーID",format:"データ形式",geojson:"GeoJSON",topojson:"TopoJSON",objectKey:"Feature のキー",jsonInputPlaceholder:"{{format}}ファイルをここに",href:"{{format}} URL",hrefPlaceholder:"{{format}} URLを入力",load:"ロード",loading:"地理データを読み込んでいます..."}},DatasetFields:{field_list:"フィールド一覧"}}},XHt={to_edit:"このルールを編集",empty_rule:"! (未設定)",editing:"フィルターの設定",form:{name:"フィールド",aggregation:"集計",rule:"ルール"},header:{visibility:"表示",value:"ラベル",count:"件数"},selected_keys:"{{ count }}件が選択されました",btn:{select_all:"すべて選択",unselect_all:"すべての選択を解除",reverse:"選択を反転する",confirm:"確認",cancel:"キャンセル"},range:{start_value:"最小",end_value:"最大"}},zHt={lg_than:"より大きい",sm_than:"より小さい",expection:"期待値",unrecognized:"未認識",score:"スコア",contains:"を含む",reason:{selection_dim_distribution:"次元のヒント",selection_mea_distribution:"尺度のヒント",children_major_factor:"主要要因",children_outlier:"外れ値"}},THt={prev:"前へ",next:"次へ",drop_field:"ここにフィールドをドロップ",confirm:"確認",cancel:"キャンセル"},_Ht={to_dim:"ディメンションに変更",to_mea:"メジャーに変更",new_calc:"計算フィールドを作成",bin:"ビン",binCount:"ビンカウント",log:"対数({{ base }})",binCustom:"ビン（カスタム）",logCustom:"対数（カスタム）",semantic_type:{name:"セマンティックタイプの変更",types:{nominal:"名義",ordinal:"序数",quantitative:"量的",temporal:"時間的"}},drill:{name:"時間単位",feature_name:"時間特性",levels:{year:"年",quarter:"四半期",month:"月",week:"週",weekday:"曜日",day:"日",hour:"時",minute:"分",second:"秒",iso_year:"ISO年",iso_week:"ISO週",iso_weekday:"ISO曜日"}}},OHt={bin_panel_title:"ビン",bin_panel_desc:"フィールドのビン構成を設定する",bin_panel_option_widths:"等しい幅のビン",bin_panel_option_counts:"等しい数のビン",bin_panel_number:"ビンの数",log_panel_title:"対数変換",log_panel_desc:"フィールドの対数設定を設定する",log_panel_number:"対数の底"},mge={config:ZHt,constant:WHt,App:KHt,DataSource:UHt,main:VHt,filters:XHt,explain:zHt,actions:THt,field_menu:_Ht,calc:OHt},qHt={scheme:"方案",primary_color:"主要颜色",color_palette:"调色板",theme:"主题",opacity:"不透明度",default_color_palette:"默认",size:"尺寸",min_domain:"最小域值",max_domain:"最大域值",range:"范围",format:"格式",numberFormat:"数字格式",timeFormat:"时间格式",normalizedNumberFormat:"标准化数字格式",background:"背景",color:"颜色",independence:"独立性",x:"x轴",y:"y轴",zeroScale:"零刻度",misc:"其他",formatGuidesDocs:"格式指南",readHere:"阅读此处",svg:"使用SVG",customTile:"使用自定义的地图区块",customOffset:"使用自定义的时区",map_settings:"地图设置",map_settings_desc:"配置地图可视化显示方式和使用自定义地图瓦片服务。",customTile_desc:"为地理可视化指定自定义地图瓦片URL。",choropleth_settings:"区域图设置",choropleth_settings_desc:"控制区域图中地理形状和数据的显示方式。",include_unmatched:"在比例尺中包含未匹配的区域",include_unmatched_desc:"在计算颜色比例尺时包含没有数据匹配的区域。",include_shapes:"包含没有数据的形状",include_shapes_desc:"显示所有地理形状，即使它们没有关联的数据值。",visualization_settings:"可视化设置",visualization_settings_desc:"配置所有可视化的通用设置。",zeroScale_desc:"强制数值轴从零开始，而不是根据数据范围自动缩放。",svg_desc:"使用SVG渲染器代替Canvas，可获得更高质量但可能降低性能。",timezone_settings:"时区设置",timezone_settings_desc:"配置时间数据在不同时区之间的显示方式。",customOffset_desc:"为显示基于时间的数据指定自定义时区。"},jHt={row_count:"行数",mea_key:"度量名称",mea_val:"度量值",paint_key:"绘制字段",analytic_type:{dimension:"维度",measure:"度量"},semantic_type:{nominal:"类别类型",ordinal:"有序类型",temporal:"时间类型",quantitative:"数值类型"},mark_type:{__enum__:"标记类型",auto:"自动",bar:"条形",line:"折线",area:"面积",trail:"痕迹",point:"散点",circle:"圆",tick:"标记",rect:"矩形",arc:"弧形",boxplot:"统计箱",table:"表格",text:"文本",poi:"兴趣点",choropleth:"区域图"},coord_system:{__enum__:"坐标系统",generic:"通用",geographic:"地理"},layout_type:{__enum__:"尺寸模式",auto:"自动",fixed:"固定",full:"容器"},exploration_mode:{__enum__:"探索交互",none:"关",brush:"范围",point:"目标"},brush_mode:{__enum__:"框选方向",default:"所有",x:"仅 X 轴",y:"仅 Y 轴"},stack_mode:{__enum__:"堆叠模式",none:"关闭",stack:"堆叠",normalize:"归一化",center:"中央"},draggable_key:{fields:"字段",columns:"列",rows:"行",color:"颜色",opacity:"透明度",size:"大小",shape:"形状",theta:"角度",radius:"半径",filters:"筛选器",details:"信息",text:"文本",longitude:"经度",latitude:"纬度",geoId:"地理 ID"},aggregator:{sum:"求和",mean:"平均值",count:"计数",median:"中位数",min:"最小值",max:"最大值",q1:"Q1",q3:"Q3",stdev:"标准差",variance:"方差"},filter_type:{one_of:"按值筛选",one_of_desc:"选择指定的值",range:"按范围筛选",range_desc:"选择范围内的值 [开始, 结束]",temporal_range:"按日期范围筛选",temporal_range_desc:"选择日期范围内的值 [开始, 结束]"}},PHt={labels:{data_interpretation:"数据解读",data_view:"查看数据"},segments:{vis:"可视化",data:"数据",chat:"会话"},feedback:{vote:"对Askviz的结果满意吗？",voteup:"满意",votedown:"不满意",report:"为了改进AskViz，请将正确的图表反馈给我们",report_button:"反馈"}},$Ht={labels:{cur_dataset:"当前数据集"},buttons:{create_dataset:"创建数据集",export_as_file:"保存到文件",import_file:"导入文件"},dialog:{create_data_source:"创建数据源",data_types:"选择类型",text_file_data:"导入文件",public_data:"公共数据集",data_source_type:"数据源类型：{{sourceType}}",file:{open:"打开文件...",submit:"确认",dataset_name:"数据集名称",choose_file:"选择文件",get_start_desc:"创建一个数据集以开始分析"},public:{submit:"确认"}}},AZt={tablist:{new:"+ 新建",auto_title:"图表 {{idx}}",chart_name:"图表名称",remove_confirm:"你确定要删除这个图表吗？"},askviz:{placeholder:"想从数据集中绘制哪种可视化呢?"},tabpanel:{menubar:{undo:"撤销",redo:"重做"},settings:{toggle:{aggregation:"聚合度量",stack:"开启堆叠",axes_resize:"坐标系缩放",debug:"图表调试"},sort:"排序",button:{ascending:"升序排序",descending:"降序排序",transpose:"转置",config:"配置",export_chart:"导出",export_chart_as:"导出 {{type}}",export_code:"导出代码",geojson:"地理信息配置",painter:"打开数据绘板",disabled_painter:{aggergation:"创建绘制字段需要关闭聚合",temporal:"绘制字段暂不支持时间字段",count:"在x和y轴上分别放置一个字段来创建绘制字段"}},paint:{palette:"色板",eraser:"橡皮",color:"颜色",label:"标签",brush_size:"笔刷大小",save_paint:"保存画板",reset_paint:"重置画板",cancel:"取消改动",delete_paint:"删除画板"},limit:"启用查询限制（行）",size:"调整尺寸",size_setting:{width:"宽度",height:"高度"},table:{summary:"显示摘要"},geography:"地理信息配置",geography_settings:{geoKey:"地理 ID",format:"数据格式",geojson:"GeoJSON",topojson:"TopoJSON",objectKey:"提取要素键",jsonInputPlaceholder:"拖动{{format}}文件到此",href:"{{format}} URL",hrefPlaceholder:"输入在线资源地址",load:"加载",loading:"加载地理数据中..."}},DatasetFields:{field_list:"字段列表"}}},eZt={to_edit:"编辑这条规则",empty_rule:"! (空的规则)",editing:"筛选器规则设定",form:{name:"字段",aggregation:"聚合",rule:"规则"},header:{visibility:"可见",value:"标签",count:"计数"},selected_keys:"{{ count }} 个标签已选择",btn:{select_all:"全部选中",unselect_all:"全部取消",reverse:"选择反向",confirm:"确认",cancel:"取消"},range:{start_value:"起始值",end_value:"终止值"}},tZt={lg_than:"大于",sm_than:"小于",expection:"期望值",unrecognized:"未识别",score:"得分",contains:"包含",reason:{selection_dim_distribution:"维度线索",selection_mea_distribution:"度量线索",children_major_factor:"子节点主要因素",children_outlier:"子节点异常"}},iZt={prev:"向前",next:"向后",drop_field:"拖拽字段至此",confirm:"确认",cancel:"取消"},nZt={to_dim:"移动到维度",to_mea:"移动到度量",new_calc:"新的计算字段",bin:"分箱",binCount:"计数分箱",log:"对数（{{ base }}）",binCustom:"自定义分箱",logCustom:"自定义对数",semantic_type:{name:"更改语义类型",types:{nominal:"名义",ordinal:"序数",quantitative:"计量",temporal:"时间"}},drill:{name:"时间粒度",feature_name:"时间特征",levels:{year:"年",quarter:"季度",month:"月",week:"周",weekdat:"星期几",day:"日",hour:"时",minute:"分",second:"秒",iso_year:"ISO年",iso_week:"ISO周",iso_weekday:"ISO星期几"}}},oZt={bin_panel_title:"分箱",bin_panel_desc:"设置字段的箱体配置",bin_panel_option_widths:"等宽箱体",bin_panel_option_counts:"等量箱体",bin_panel_number:"箱体数量",log_panel_title:"对数变换",log_panel_desc:"设置字段的对数配置",log_panel_number:"对数底数"},pge={config:qHt,constant:jHt,App:PHt,DataSource:$Ht,main:AZt,filters:eZt,explain:tZt,actions:iZt,field_menu:nZt,calc:oZt},gZt={en:{translation:hge},"en-US":{translation:hge},zh:{translation:pge},"zh-CN":{translation:pge},ja:{translation:mge},"ja-JP":{translation:mge}};Qk.use(NLe).use(dge).init({fallbackLng:"en-US",interpolation:{escapeValue:!1},resources:gZt});const fge=[],fdA=A=>{for(const e in A)if(Object.prototype.hasOwnProperty.call(A,e)){if(fge.includes(e))continue;fge.push(e);const t=A[e];Qk.addResourceBundle(e,"translation",t,!1,!0)}},ydA=A=>Qk.changeLanguage(A),aZt=an.div`
    user-select: none;
    align-items: stretch;
    border-style: solid;
    border-width: 1px;
    box-sizing: border-box;
    cursor: default;
    display: flex;
    flex-direction: column;
    font-size: 12px;
    min-width: 150px;
    overflow-y: hidden;
    padding: 0;

    > * {
        flex-grow: 1;
        padding-block: 0.2em;
        padding-inline: 0.5em;
    }

    > header {
        height: 20px;
        border-bottom-width: 1px;
    }

    > div.output {
        min-height: 20px;

        > span {
            overflow-y: hidden;
            max-height: 4em;
        }

        .icon {
            display: none;

            &:hover {
                display: unset;
            }
        }
    }
`,sZt=ze(A=>{const{provided:e,fIndex:t}=A,i=xt(),{viewFilters:n,config:o}=i,{timezoneDisplayOffset:g}=o,a=n[t],{t:s}=ve("translation",{keyPrefix:"filters"}),I=a.enableAgg?`${a.aggName}(${a.name})`:a.name;return b.createElement(aZt,{className:"text-foreground touch-none",ref:TC(e.innerRef),...e.draggableProps,...e.dragHandleProps},b.createElement("header",{className:"bg-secondary"},I),b.createElement("div",{className:"bg-background  text-muted-foreground hover:bg-accent flex flex-row output",onClick:()=>i.setFilterEditing(t),style:{cursor:"pointer"},title:s("to_edit")},a.rule?b.createElement("span",{className:"flex-1"},a.rule.type==="one of"&&b.createElement(b.Fragment,null,"oneOf: [",[...a.rule.value].map(r=>JSON.stringify(r)).join(", "),"]"),a.rule.type==="range"&&b.createElement(b.Fragment,null,"range: [",a.rule.value[0],", ",a.rule.value[1],"]"),a.rule.type==="not in"&&b.createElement(b.Fragment,null,"notIn: [",[...a.rule.value].map(r=>JSON.stringify(r)).join(", "),"]"),a.rule.type==="temporal range"&&b.createElement(b.Fragment,null,"range: [",a.rule.value[0]?Uu(Sm(g,a.rule.offset)(a.rule.value[0])):"",", ",a.rule.value[1]?Uu(Sm(g,a.rule.offset)(a.rule.value[1])):"","]")):b.createElement("span",{className:"text-muted-foreground flex-1"},s("empty_rule")),b.createElement(vXe,{className:"icon flex-grow-0 flex-shrink-0 pointer-events-none text-muted-foreground",role:"presentation","aria-hidden":!0,width:"1.4em",height:"1.4em"})))}),rZt=sZt,zO=p.forwardRef(({className:A,...e},t)=>p.createElement(kV,{ref:t,minStepsBetweenThumbs:1,className:Ce("relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50",A),...e},p.createElement(CMA,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20"},p.createElement(lMA,{className:"absolute h-full bg-primary"})),p.createElement(HiA,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"}),p.createElement(HiA,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})));zO.displayName=kV.displayName;const IZt=an.div`
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding-block: 1em;

    > .output {
        display: flex;
        justify-content: space-between;
        margin-top: 1em;

        > output {
            width: 100%;
        }

        > output:first-child {
            margin-right: 0.5em;
        }

        > output:last-child {
            margin-left: 0.5em;
        }
    }
`,yge=A=>{const{min:e,max:t,value:i,step:n,resetValue:o,onChange:g}=A,[a,s]=p.useState(`${i??o}`),I=()=>{const r=Number(a);!isNaN(r)&&r<=t&&r>=e?g(r):(g(o),s(`${o}`))};return p.useEffect(()=>{s(`${i??o}`)},[i]),b.createElement(oo,{type:"number",min:e,max:t,step:n,value:a,onChange:r=>s(r.target.value),onBlur:I,onKeyDown:r=>{r.key==="Enter"&&!r.nativeEvent.isComposing&&I()}})},CZt=b.memo(function({min:A,max:e,value:t,onChange:i}){const{t:n}=ve(),o=10**Math.floor(Math.log10((e-A)/100));return b.createElement(IZt,null,b.createElement(zO,{value:[t[0]??A,t[1]??e],min:A,max:e,step:o,onValueChange:([g,a])=>i([g,a])}),b.createElement("div",{className:"output"},b.createElement("output",{htmlFor:"slider:min"},b.createElement("div",{className:"my-1"},n("filters.range.start_value")),b.createElement(yge,{min:A,max:t[1]??e,value:t[0]??A,step:o,resetValue:A,onChange:g=>i([g,t[1]??e])})),b.createElement("output",{htmlFor:"slider:max"},b.createElement("div",{className:"my-1"},n("filters.range.end_value")),b.createElement(yge,{min:t[0]??A,max:e,value:t[1]??e,step:o,resetValue:e,onChange:g=>i([t[0]??A,g])}))))}),lZt=CZt;function pN(A,e,t){let i=t.initialDeps??[],n;function o(){var g,a,s,I;let r;t.key&&(g=t.debug)!=null&&g.call(t)&&(r=Date.now());const C=A();if(!(C.length!==i.length||C.some((c,B)=>i[B]!==c)))return n;i=C;let l;if(t.key&&(a=t.debug)!=null&&a.call(t)&&(l=Date.now()),n=e(...C),t.key&&(s=t.debug)!=null&&s.call(t)){const c=Math.round((Date.now()-r)*100)/100,B=Math.round((Date.now()-l)*100)/100,E=B/16,u=(d,f)=>{for(d=String(d);d.length<f;)d=" "+d;return d};console.info(`%c⏱ ${u(B,5)} /${u(c,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*E,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(I=t==null?void 0:t.onChange)==null||I.call(t,n),n}return o.updateDeps=g=>{i=g},o}function bge(A,e){if(A===void 0)throw new Error(`Unexpected undefined${e?`: ${e}`:""}`);return A}const cZt=(A,e)=>Math.abs(A-e)<1.01,BZt=(A,e,t)=>{let i;return function(...n){A.clearTimeout(i),i=A.setTimeout(()=>e.apply(this,n),t)}},wge=A=>{const{offsetWidth:e,offsetHeight:t}=A;return{width:e,height:t}},QZt=A=>A,EZt=A=>{const e=Math.max(A.startIndex-A.overscan,0),t=Math.min(A.endIndex+A.overscan,A.count-1),i=[];for(let n=e;n<=t;n++)i.push(n);return i},uZt=(A,e)=>{const t=A.scrollElement;if(!t)return;const i=A.targetWindow;if(!i)return;const n=g=>{const{width:a,height:s}=g;e({width:Math.round(a),height:Math.round(s)})};if(n(wge(t)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(g=>{const a=()=>{const s=g[0];if(s!=null&&s.borderBoxSize){const I=s.borderBoxSize[0];if(I){n({width:I.inlineSize,height:I.blockSize});return}}n(wge(t))};A.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Dge={passive:!0},Gge=typeof window>"u"?!0:"onscrollend"in window,dZt=(A,e)=>{const t=A.scrollElement;if(!t)return;const i=A.targetWindow;if(!i)return;let n=0;const o=A.options.useScrollendEvent&&Gge?()=>{}:BZt(i,()=>{e(n,!1)},A.options.isScrollingResetDelay),g=r=>()=>{const{horizontal:C,isRtl:l}=A.options;n=C?t.scrollLeft*(l&&-1||1):t.scrollTop,o(),e(n,r)},a=g(!0),s=g(!1);s(),t.addEventListener("scroll",a,Dge);const I=A.options.useScrollendEvent&&Gge;return I&&t.addEventListener("scrollend",s,Dge),()=>{t.removeEventListener("scroll",a),I&&t.removeEventListener("scrollend",s)}},hZt=(A,e,t)=>{if(e!=null&&e.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[t.options.horizontal?"inlineSize":"blockSize"])}return A[t.options.horizontal?"offsetWidth":"offsetHeight"]},mZt=(A,{adjustments:e=0,behavior:t},i)=>{var n,o;const g=A+e;(o=(n=i.scrollElement)==null?void 0:n.scrollTo)==null||o.call(n,{[i.options.horizontal?"left":"top"]:g,behavior:t})};class pZt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const i=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(o=>{const g=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(g):g()})}));return{disconnect:()=>{var n;(n=i())==null||n.disconnect(),t=null},observe:n=>{var o;return(o=i())==null?void 0:o.observe(n,{box:"border-box"})},unobserve:n=>{var o;return(o=i())==null?void 0:o.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([i,n])=>{typeof n>"u"&&delete t[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:QZt,rangeExtractor:EZt,onChange:()=>{},measureElement:hZt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var i,n;(n=(i=this.options).onChange)==null||n.call(i,this,t)},this.maybeNotify=pN(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,i)=>{const n=new Map,o=new Map;for(let g=i-1;g>=0;g--){const a=t[g];if(n.has(a.lane))continue;const s=o.get(a.lane);if(s==null||a.end>s.end?o.set(a.lane,a):a.end<s.end&&n.set(a.lane,!0),n.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((g,a)=>g.end===a.end?g.index-a.index:g.end-a.end)[0]:void 0},this.getMeasurementOptions=pN(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,i,n,o,g)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:g}),{key:!1}),this.getMeasurements=pN(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:g},a)=>{if(!g)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(r=>{this.itemSizeCache.set(r.key,r.size)}));const s=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const I=this.measurementsCache.slice(0,s);for(let r=s;r<t;r++){const C=o(r),l=this.options.lanes===1?I[r-1]:this.getFurthestMeasurement(I,r),c=l?l.end+this.options.gap:i+n,B=a.get(C),E=typeof B=="number"?B:this.options.estimateSize(r),u=c+E,d=l?l.lane:r%this.options.lanes;I[r]={index:r,start:c,size:E,end:u,key:C,lane:d}}return this.measurementsCache=I,I},{key:!1,debug:()=>this.options.debug}),this.calculateRange=pN(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,i,n,o)=>this.range=t.length>0&&i>0?fZt({measurements:t,outerSize:i,scrollOffset:n,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=pN(()=>{let t=null,i=null;const n=this.calculateRange();return n&&(t=n.startIndex,i=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,i]},(t,i,n,o,g)=>o===null||g===null?[]:t({startIndex:o,endIndex:g,overscan:i,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const i=this.options.indexAttribute,n=t.getAttribute(i);return n?parseInt(n,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this._measureElement=(t,i)=>{const n=this.indexFromElement(t),o=this.measurementsCache[n];if(!o)return;const g=o.key,a=this.elementsCache.get(g);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(g,t)),t.isConnected&&this.resizeItem(n,this.options.measureElement(t,i,this))},this.resizeItem=(t,i)=>{const n=this.measurementsCache[t];if(!n)return;const o=this.itemSizeCache.get(n.key)??n.size,g=i-o;g!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(n,g,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=g,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,i)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((i,n)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(n))});return}this._measureElement(t,void 0)},this.getVirtualItems=pN(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,i)=>{const n=[];for(let o=0,g=t.length;o<g;o++){const a=t[o],s=i[a];n.push(s)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(i.length!==0)return bge(i[kge(0,i.length-1,n=>bge(i[n]).start,t)])},this.getOffsetForAlignment=(t,i,n=0)=>{const o=this.getSize(),g=this.getScrollOffset();i==="auto"&&(i=t>=g+o?"end":"start"),i==="center"?t+=(n-o)/2:i==="end"&&(t-=o);const a=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,i="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const n=this.measurementsCache[t];if(!n)return;const o=this.getSize(),g=this.getScrollOffset();if(i==="auto")if(n.end>=g+o-this.options.scrollPaddingEnd)i="end";else if(n.start<=g+this.options.scrollPaddingStart)i="start";else return[g,i];const a=i==="end"?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,i,n.size),i]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:i="start",behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,i),{adjustments:void 0,behavior:n})},this.scrollToIndex=(t,{align:i="auto",behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let o=0;const g=10,a=I=>{if(!this.targetWindow)return;const r=this.getOffsetForIndex(t,I);if(!r){console.warn("Failed to get offset for index:",t);return}const[C,l]=r;this._scrollToOffset(C,{adjustments:void 0,behavior:n}),this.targetWindow.requestAnimationFrame(()=>{const c=this.getScrollOffset(),B=this.getOffsetForIndex(t,l);if(!B){console.warn("Failed to get offset for index:",t);return}cZt(B[0],c)||s(l)})},s=I=>{this.targetWindow&&(o++,o<g?this.targetWindow.requestAnimationFrame(()=>a(I)):console.warn(`Failed to scroll to index ${t} after ${g} attempts.`))};a(i)},this.scrollBy=(t,{behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:i})},this.getTotalSize=()=>{var t;const i=this.getMeasurements();let n;if(i.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((t=i[i.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let g=i.length-1;for(;g>=0&&o.some(a=>a===null);){const a=i[g];o[a.lane]===null&&(o[a.lane]=a.end),g--}n=Math.max(...o.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:i,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const kge=(A,e,t,i)=>{for(;A<=e;){const n=(A+e)/2|0,o=t(n);if(o<i)A=n+1;else if(o>i)e=n-1;else return n}return A>0?A-1:0};function fZt({measurements:A,outerSize:e,scrollOffset:t,lanes:i}){const n=A.length-1,o=s=>A[s].start;if(A.length<=i)return{startIndex:0,endIndex:n};let g=kge(0,n,o,t),a=g;if(i===1)for(;a<n&&A[a].end<t+e;)a++;else if(i>1){const s=Array(i).fill(0);for(;a<n&&s.some(r=>r<t+e);){const r=A[a];s[r.lane]=r.end,a++}const I=Array(i).fill(t+e);for(;g>=0&&I.some(r=>r>=t);){const r=A[g];I[r.lane]=r.start,g--}g=Math.max(0,g-g%i),a=Math.min(n,a+(i-1-a%i))}return{startIndex:g,endIndex:a}}const Jge=typeof document<"u"?p.useLayoutEffect:p.useEffect;function yZt(A){const e=p.useReducer(()=>({}),{})[1],t={...A,onChange:(n,o)=>{var g;o?bt.flushSync(e):e(),(g=A.onChange)==null||g.call(A,n,o)}},[i]=p.useState(()=>new pZt(t));return i.setOptions(t),Jge(()=>i._didMount(),[]),Jge(()=>i._willUpdate()),i}function Nge(A){return yZt({observeElementRect:uZt,observeElementOffset:dZt,scrollToFn:mZt,...A})}var bdA="Radio",[bZt,Yge]=Tg(bdA),[wZt,DZt]=bZt(bdA),Rge=p.forwardRef((A,e)=>{const{__scopeRadio:t,name:i,checked:n=!1,required:o,disabled:g,value:a="on",onCheck:s,form:I,...r}=A,[C,l]=p.useState(null),c=Te(e,u=>l(u)),B=p.useRef(!1),E=C?I||!!C.closest("form"):!0;return Ic(wZt,{scope:t,checked:n,disabled:g,children:[cA(re.button,{type:"button",role:"radio","aria-checked":n,"data-state":vge(n),"data-disabled":g?"":void 0,disabled:g,value:a,...r,ref:c,onClick:TA(A.onClick,u=>{n||s==null||s(),E&&(B.current=u.isPropagationStopped(),B.current||u.stopPropagation())})}),E&&cA(Mge,{control:C,bubbles:!B.current,name:i,value:a,checked:n,required:o,disabled:g,form:I,style:{transform:"translateX(-100%)"}})]})});Rge.displayName=bdA;var xge="RadioIndicator",Fge=p.forwardRef((A,e)=>{const{__scopeRadio:t,forceMount:i,...n}=A,o=DZt(xge,t);return cA(qg,{present:i||o.checked,children:cA(re.span,{"data-state":vge(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:e})})});Fge.displayName=xge;var GZt="RadioBubbleInput",Mge=p.forwardRef(({__scopeRadio:A,control:e,checked:t,bubbles:i=!0,...n},o)=>{const g=p.useRef(null),a=Te(g,o),s=lF(t),I=cF(e);return p.useEffect(()=>{const r=g.current;if(!r)return;const C=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(C,"checked").set;if(s!==t&&l){const c=new Event("click",{bubbles:i});l.call(r,t),r.dispatchEvent(c)}},[s,t,i]),cA(re.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...n,tabIndex:-1,ref:a,style:{...n.style,...I,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Mge.displayName=GZt;function vge(A){return A?"checked":"unchecked"}var kZt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],TO="RadioGroup",[JZt,X0i]=Tg(TO,[Sk,Yge]),Lge=Sk(),Sge=Yge(),[NZt,YZt]=JZt(TO),Hge=p.forwardRef((A,e)=>{const{__scopeRadioGroup:t,name:i,defaultValue:n,value:o,required:g=!1,disabled:a=!1,orientation:s,dir:I,loop:r=!0,onValueChange:C,...l}=A,c=Lge(t),B=Ck(I),[E,u]=is({prop:o,defaultProp:n??null,onChange:C,caller:TO});return cA(NZt,{scope:t,name:i,required:g,disabled:a,value:E,onValueChange:u,children:cA(toA,{asChild:!0,...c,orientation:s,dir:B,loop:r,children:cA(re.div,{role:"radiogroup","aria-required":g,"aria-orientation":s,"data-disabled":a?"":void 0,dir:B,...l,ref:e})})})});Hge.displayName=TO;var Zge="RadioGroupItem",Wge=p.forwardRef((A,e)=>{const{__scopeRadioGroup:t,disabled:i,...n}=A,o=YZt(Zge,t),g=o.disabled||i,a=Lge(t),s=Sge(t),I=p.useRef(null),r=Te(e,I),C=o.value===n.value,l=p.useRef(!1);return p.useEffect(()=>{const c=E=>{kZt.includes(E.key)&&(l.current=!0)},B=()=>l.current=!1;return document.addEventListener("keydown",c),document.addEventListener("keyup",B),()=>{document.removeEventListener("keydown",c),document.removeEventListener("keyup",B)}},[]),cA(ioA,{asChild:!0,...a,focusable:!g,active:C,children:cA(Rge,{disabled:g,required:o.required,checked:C,...s,...n,name:o.name,ref:r,onCheck:()=>o.onValueChange(n.value),onKeyDown:TA(c=>{c.key==="Enter"&&c.preventDefault()}),onFocus:TA(n.onFocus,()=>{var c;l.current&&((c=I.current)==null||c.click())})})})});Wge.displayName=Zge;var RZt="RadioGroupIndicator",Kge=p.forwardRef((A,e)=>{const{__scopeRadioGroup:t,...i}=A,n=Sge(t);return cA(Fge,{...n,...i,ref:e})});Kge.displayName=RZt;var Uge=Hge,Vge=Wge,xZt=Kge;const _O=p.forwardRef(({className:A,...e},t)=>p.createElement(Uge,{className:Ce("grid gap-2",A),...e,ref:t}));_O.displayName=Uge.displayName;const zS=p.forwardRef(({className:A,...e},t)=>p.createElement(Vge,{ref:t,className:Ce("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",A),...e},p.createElement(xZt,{className:"flex items-center justify-center"},p.createElement(TF,{className:"h-3.5 w-3.5 fill-primary"}))));zS.displayName=Vge.displayName;var FZt="Label",Xge=p.forwardRef((A,e)=>cA(re.label,{...A,ref:e,onMouseDown:t=>{var i;t.target.closest("button, input, select, textarea")||((i=A.onMouseDown)==null||i.call(A,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Xge.displayName=FZt;var zge=Xge;const MZt=_V("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),oE=p.forwardRef(({className:A,...e},t)=>p.createElement(zge,{ref:t,className:Ce(MZt(),A),...e}));oE.displayName=zge.displayName;function fN({className:A,...e}){return p.createElement("div",{className:Ce("animate-pulse rounded-md bg-primary/10",A),...e})}function Tge({content:A,children:e,...t}){return b.createElement(JSA,{...t},b.createElement(NSA,null,b.createElement(YSA,{asChild:!0},e),b.createElement(PnA,null,A)))}/**
 * @license
 * MIT License
 * 
 * Copyright (c) 2014-present, Lee Byron and other contributors.
 * 
 * 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.
 */var TS="delete",ji=5,HI=1<<ji,Js=HI-1,Xt={};function wdA(){return{value:!1}}function bl(A){A&&(A.value=!0)}function DdA(){}function yN(A){return A.size===void 0&&(A.size=A.__iterate(_ge)),A.size}function u0(A,e){if(typeof e!="number"){var t=e>>>0;if(""+t!==e||t===4294967295)return NaN;e=t}return e<0?yN(A)+e:e}function _ge(){return!0}function OO(A,e,t){return(A===0&&!qge(A)||t!==void 0&&A<=-t)&&(e===void 0||t!==void 0&&e>=t)}function _S(A,e){return Oge(A,e,0)}function qO(A,e){return Oge(A,e,e)}function Oge(A,e,t){return A===void 0?t:qge(A)?e===1/0?e:Math.max(0,e+A)|0:e===void 0||e===A?A:Math.min(e,A)|0}function qge(A){return A<0||A===0&&1/A===-1/0}var jge="@@__IMMUTABLE_ITERABLE__@@";function ZI(A){return!!(A&&A[jge])}var jO="@@__IMMUTABLE_KEYED__@@";function Zn(A){return!!(A&&A[jO])}var PO="@@__IMMUTABLE_INDEXED__@@";function wl(A){return!!(A&&A[PO])}function GdA(A){return Zn(A)||wl(A)}var Xa=function(A){return ZI(A)?A:kr(A)},Dl=function(A){function e(t){return Zn(t)?t:h0(t)}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e}(Xa),ww=function(A){function e(t){return wl(t)?t:aB(t)}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e}(Xa),bN=function(A){function e(t){return ZI(t)&&!GdA(t)?t:kN(t)}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e}(Xa);Xa.Keyed=Dl,Xa.Indexed=ww,Xa.Set=bN;var Pge="@@__IMMUTABLE_SEQ__@@";function kdA(A){return!!(A&&A[Pge])}var $ge="@@__IMMUTABLE_RECORD__@@";function wN(A){return!!(A&&A[$ge])}function gE(A){return ZI(A)||wN(A)}var d0="@@__IMMUTABLE_ORDERED__@@";function aE(A){return!!(A&&A[d0])}var DN=0,WI=1,KI=2,JdA=typeof Symbol=="function"&&Symbol.iterator,Aae="@@iterator",$O=JdA||Aae,ii=function(A){this.next=A};ii.prototype.toString=function(){return"[Iterator]"},ii.KEYS=DN,ii.VALUES=WI,ii.ENTRIES=KI,ii.prototype.inspect=ii.prototype.toSource=function(){return this.toString()},ii.prototype[$O]=function(){return this};function Wn(A,e,t,i){var n=A===DN?e:A===WI?t:[e,t];return i?i.value=n:i={value:n,done:!1},i}function Ns(){return{value:void 0,done:!0}}function eae(A){return Array.isArray(A)?!0:!!Aq(A)}function tae(A){return A&&typeof A.next=="function"}function NdA(A){var e=Aq(A);return e&&e.call(A)}function Aq(A){var e=A&&(JdA&&A[JdA]||A[Aae]);if(typeof e=="function")return e}function vZt(A){var e=Aq(A);return e&&e===A.entries}function LZt(A){var e=Aq(A);return e&&e===A.keys}var GN=Object.prototype.hasOwnProperty;function iae(A){return Array.isArray(A)||typeof A=="string"?!0:A&&typeof A=="object"&&Number.isInteger(A.length)&&A.length>=0&&(A.length===0?Object.keys(A).length===1:A.hasOwnProperty(A.length-1))}var kr=function(A){function e(t){return t==null?RdA():gE(t)?t.toSeq():HZt(t)}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,i){var n=this._cache;if(n){for(var o=n.length,g=0;g!==o;){var a=n[i?o-++g:g++];if(t(a[1],a[0],this)===!1)break}return g}return this.__iterateUncached(t,i)},e.prototype.__iterator=function(t,i){var n=this._cache;if(n){var o=n.length,g=0;return new ii(function(){if(g===o)return Ns();var a=n[i?o-++g:g++];return Wn(t,a[0],a[1])})}return this.__iteratorUncached(t,i)},e}(Xa),h0=function(A){function e(t){return t==null?RdA().toKeyedSeq():ZI(t)?Zn(t)?t.toSeq():t.fromEntrySeq():wN(t)?t.toSeq():xdA(t)}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(kr),aB=function(A){function e(t){return t==null?RdA():ZI(t)?Zn(t)?t.entrySeq():t.toIndexedSeq():wN(t)?t.toSeq().entrySeq():oae(t)}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(kr),kN=function(A){function e(t){return(ZI(t)&&!GdA(t)?t:aB(t)).toSetSeq()}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(kr);kr.isSeq=kdA,kr.Keyed=h0,kr.Set=kN,kr.Indexed=aB,kr.prototype[Pge]=!0;var JN=function(A){function e(t){this._array=t,this.size=t.length}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.get=function(t,i){return this.has(t)?this._array[u0(this,t)]:i},e.prototype.__iterate=function(t,i){for(var n=this._array,o=n.length,g=0;g!==o;){var a=i?o-++g:g++;if(t(n[a],a,this)===!1)break}return g},e.prototype.__iterator=function(t,i){var n=this._array,o=n.length,g=0;return new ii(function(){if(g===o)return Ns();var a=i?o-++g:g++;return Wn(t,a,n[a])})},e}(aB),YdA=function(A){function e(t){var i=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=i,this.size=i.length}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.get=function(t,i){return i!==void 0&&!this.has(t)?i:this._object[t]},e.prototype.has=function(t){return GN.call(this._object,t)},e.prototype.__iterate=function(t,i){for(var n=this._object,o=this._keys,g=o.length,a=0;a!==g;){var s=o[i?g-++a:a++];if(t(n[s],s,this)===!1)break}return a},e.prototype.__iterator=function(t,i){var n=this._object,o=this._keys,g=o.length,a=0;return new ii(function(){if(a===g)return Ns();var s=o[i?g-++a:a++];return Wn(t,s,n[s])})},e}(h0);YdA.prototype[d0]=!0;var SZt=function(A){function e(t){this._collection=t,this.size=t.length||t.size}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,i){if(i)return this.cacheResult().__iterate(t,i);var n=this._collection,o=NdA(n),g=0;if(tae(o))for(var a;!(a=o.next()).done&&t(a.value,g++,this)!==!1;);return g},e.prototype.__iteratorUncached=function(t,i){if(i)return this.cacheResult().__iterator(t,i);var n=this._collection,o=NdA(n);if(!tae(o))return new ii(Ns);var g=0;return new ii(function(){var a=o.next();return a.done?a:Wn(t,g++,a.value)})},e}(aB),nae;function RdA(){return nae||(nae=new JN([]))}function xdA(A){var e=FdA(A);if(e)return e.fromEntrySeq();if(typeof A=="object")return new YdA(A);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+A)}function oae(A){var e=FdA(A);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+A)}function HZt(A){var e=FdA(A);if(e)return vZt(A)?e.fromEntrySeq():LZt(A)?e.toSetSeq():e;if(typeof A=="object")return new YdA(A);throw new TypeError("Expected Array or collection object of values, or keyed object: "+A)}function FdA(A){return iae(A)?new JN(A):eae(A)?new SZt(A):void 0}var gae="@@__IMMUTABLE_MAP__@@";function MdA(A){return!!(A&&A[gae])}function aae(A){return MdA(A)&&aE(A)}function sae(A){return!!(A&&typeof A.equals=="function"&&typeof A.hashCode=="function")}function UI(A,e){if(A===e||A!==A&&e!==e)return!0;if(!A||!e)return!1;if(typeof A.valueOf=="function"&&typeof e.valueOf=="function"){if(A=A.valueOf(),e=e.valueOf(),A===e||A!==A&&e!==e)return!0;if(!A||!e)return!1}return!!(sae(A)&&sae(e)&&A.equals(e))}var OS=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(A,e){A|=0,e|=0;var t=A&65535,i=e&65535;return t*i+((A>>>16)*i+t*(e>>>16)<<16>>>0)|0};function eq(A){return A>>>1&1073741824|A&3221225471}var ZZt=Object.prototype.valueOf;function VI(A){if(A==null)return rae(A);if(typeof A.hashCode=="function")return eq(A.hashCode(A));var e=zZt(A);if(e==null)return rae(e);switch(typeof e){case"boolean":return e?1108378657:1108378656;case"number":return WZt(e);case"string":return e.length>TZt?KZt(e):vdA(e);case"object":case"function":return VZt(e);case"symbol":return UZt(e);default:if(typeof e.toString=="function")return vdA(e.toString());throw new Error("Value type "+typeof e+" cannot be hashed.")}}function rae(A){return A===null?1108378658:1108378659}function WZt(A){if(A!==A||A===1/0)return 0;var e=A|0;for(e!==A&&(e^=A*4294967295);A>4294967295;)A/=4294967295,e^=A;return eq(e)}function KZt(A){var e=WdA[A];return e===void 0&&(e=vdA(A),ZdA===_Zt&&(ZdA=0,WdA={}),ZdA++,WdA[A]=e),e}function vdA(A){for(var e=0,t=0;t<A.length;t++)e=31*e+A.charCodeAt(t)|0;return eq(e)}function UZt(A){var e=cae[A];return e!==void 0||(e=lae(),cae[A]=e),e}function VZt(A){var e;if(LdA&&(e=SdA.get(A),e!==void 0)||(e=A[Dw],e!==void 0)||!Cae&&(e=A.propertyIsEnumerable&&A.propertyIsEnumerable[Dw],e!==void 0||(e=XZt(A),e!==void 0)))return e;if(e=lae(),LdA)SdA.set(A,e);else{if(Iae!==void 0&&Iae(A)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(Cae)Object.defineProperty(A,Dw,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(A.propertyIsEnumerable!==void 0&&A.propertyIsEnumerable===A.constructor.prototype.propertyIsEnumerable)A.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},A.propertyIsEnumerable[Dw]=e;else if(A.nodeType!==void 0)A[Dw]=e;else throw new Error("Unable to set a non-enumerable property on object.")}return e}var Iae=Object.isExtensible,Cae=function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}}();function XZt(A){if(A&&A.nodeType>0)switch(A.nodeType){case 1:return A.uniqueID;case 9:return A.documentElement&&A.documentElement.uniqueID}}function zZt(A){return A.valueOf!==ZZt&&typeof A.valueOf=="function"?A.valueOf(A):A}function lae(){var A=++HdA;return HdA&1073741824&&(HdA=0),A}var LdA=typeof WeakMap=="function",SdA;LdA&&(SdA=new WeakMap);var cae=Object.create(null),HdA=0,Dw="__immutablehash__";typeof Symbol=="function"&&(Dw=Symbol(Dw));var TZt=16,_Zt=255,ZdA=0,WdA={},tq=function(A){function e(t,i){this._iter=t,this._useKeys=i,this.size=t.size}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.get=function(t,i){return this._iter.get(t,i)},e.prototype.has=function(t){return this._iter.has(t)},e.prototype.valueSeq=function(){return this._iter.valueSeq()},e.prototype.reverse=function(){var t=this,i=KdA(this,!0);return this._useKeys||(i.valueSeq=function(){return t._iter.toSeq().reverse()}),i},e.prototype.map=function(t,i){var n=this,o=dae(this,t,i);return this._useKeys||(o.valueSeq=function(){return n._iter.toSeq().map(t,i)}),o},e.prototype.__iterate=function(t,i){var n=this;return this._iter.__iterate(function(o,g){return t(o,g,n)},i)},e.prototype.__iterator=function(t,i){return this._iter.__iterator(t,i)},e}(h0);tq.prototype[d0]=!0;var Bae=function(A){function e(t){this._iter=t,this.size=t.size}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.includes=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,i){var n=this,o=0;return i&&yN(this),this._iter.__iterate(function(g){return t(g,i?n.size-++o:o++,n)},i)},e.prototype.__iterator=function(t,i){var n=this,o=this._iter.__iterator(WI,i),g=0;return i&&yN(this),new ii(function(){var a=o.next();return a.done?a:Wn(t,i?n.size-++g:g++,a.value,a)})},e}(aB),Qae=function(A){function e(t){this._iter=t,this.size=t.size}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.has=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,i){var n=this;return this._iter.__iterate(function(o){return t(o,o,n)},i)},e.prototype.__iterator=function(t,i){var n=this._iter.__iterator(WI,i);return new ii(function(){var o=n.next();return o.done?o:Wn(t,o.value,o.value,o)})},e}(kN),Eae=function(A){function e(t){this._iter=t,this.size=t.size}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.entrySeq=function(){return this._iter.toSeq()},e.prototype.__iterate=function(t,i){var n=this;return this._iter.__iterate(function(o){if(o){yae(o);var g=ZI(o);return t(g?o.get(1):o[1],g?o.get(0):o[0],n)}},i)},e.prototype.__iterator=function(t,i){var n=this._iter.__iterator(WI,i);return new ii(function(){for(;;){var o=n.next();if(o.done)return o;var g=o.value;if(g){yae(g);var a=ZI(g);return Wn(t,a?g.get(0):g[0],a?g.get(1):g[1],o)}}})},e}(h0);Bae.prototype.cacheResult=tq.prototype.cacheResult=Qae.prototype.cacheResult=Eae.prototype.cacheResult=XdA;function uae(A){var e=sE(A);return e._iter=A,e.size=A.size,e.flip=function(){return A},e.reverse=function(){var t=A.reverse.apply(this);return t.flip=function(){return A.reverse()},t},e.has=function(t){return A.includes(t)},e.includes=function(t){return A.has(t)},e.cacheResult=XdA,e.__iterateUncached=function(t,i){var n=this;return A.__iterate(function(o,g){return t(g,o,n)!==!1},i)},e.__iteratorUncached=function(t,i){if(t===KI){var n=A.__iterator(t,i);return new ii(function(){var o=n.next();if(!o.done){var g=o.value[0];o.value[0]=o.value[1],o.value[1]=g}return o})}return A.__iterator(t===WI?DN:WI,i)},e}function dae(A,e,t){var i=sE(A);return i.size=A.size,i.has=function(n){return A.has(n)},i.get=function(n,o){var g=A.get(n,Xt);return g===Xt?o:e.call(t,g,n,A)},i.__iterateUncached=function(n,o){var g=this;return A.__iterate(function(a,s,I){return n(e.call(t,a,s,I),s,g)!==!1},o)},i.__iteratorUncached=function(n,o){var g=A.__iterator(KI,o);return new ii(function(){var a=g.next();if(a.done)return a;var s=a.value,I=s[0];return Wn(n,I,e.call(t,s[1],I,A),a)})},i}function KdA(A,e){var t=this,i=sE(A);return i._iter=A,i.size=A.size,i.reverse=function(){return A},A.flip&&(i.flip=function(){var n=uae(A);return n.reverse=function(){return A.flip()},n}),i.get=function(n,o){return A.get(e?n:-1-n,o)},i.has=function(n){return A.has(e?n:-1-n)},i.includes=function(n){return A.includes(n)},i.cacheResult=XdA,i.__iterate=function(n,o){var g=this,a=0;return o&&yN(A),A.__iterate(function(s,I){return n(s,e?I:o?g.size-++a:a++,g)},!o)},i.__iterator=function(n,o){var g=0;o&&yN(A);var a=A.__iterator(KI,!o);return new ii(function(){var s=a.next();if(s.done)return s;var I=s.value;return Wn(n,e?I[0]:o?t.size-++g:g++,I[1],s)})},i}function hae(A,e,t,i){var n=sE(A);return i&&(n.has=function(o){var g=A.get(o,Xt);return g!==Xt&&!!e.call(t,g,o,A)},n.get=function(o,g){var a=A.get(o,Xt);return a!==Xt&&e.call(t,a,o,A)?a:g}),n.__iterateUncached=function(o,g){var a=this,s=0;return A.__iterate(function(I,r,C){if(e.call(t,I,r,C))return s++,o(I,i?r:s-1,a)},g),s},n.__iteratorUncached=function(o,g){var a=A.__iterator(KI,g),s=0;return new ii(function(){for(;;){var I=a.next();if(I.done)return I;var r=I.value,C=r[0],l=r[1];if(e.call(t,l,C,A))return Wn(o,i?C:s++,l,I)}})},n}function OZt(A,e,t){var i=RN().asMutable();return A.__iterate(function(n,o){i.update(e.call(t,n,o,A),0,function(g){return g+1})}),i.asImmutable()}function qZt(A,e,t){var i=Zn(A),n=(aE(A)?CE():RN()).asMutable();A.__iterate(function(g,a){n.update(e.call(t,g,a,A),function(s){return s=s||[],s.push(i?[a,g]:g),s})});var o=VdA(A);return n.map(function(g){return Pi(A,o(g))}).asImmutable()}function jZt(A,e,t){var i=Zn(A),n=[[],[]];A.__iterate(function(g,a){n[e.call(t,g,a,A)?1:0].push(i?[a,g]:g)});var o=VdA(A);return n.map(function(g){return Pi(A,o(g))})}function UdA(A,e,t,i){var n=A.size;if(OO(e,t,n))return A;if(typeof n>"u"&&(e<0||t<0))return UdA(A.toSeq().cacheResult(),e,t,i);var o=_S(e,n),g=qO(t,n),a=g-o,s;a===a&&(s=a<0?0:a);var I=sE(A);return I.size=s===0?s:A.size&&s||void 0,!i&&kdA(A)&&s>=0&&(I.get=function(r,C){return r=u0(this,r),r>=0&&r<s?A.get(r+o,C):C}),I.__iterateUncached=function(r,C){var l=this;if(s===0)return 0;if(C)return this.cacheResult().__iterate(r,C);var c=0,B=!0,E=0;return A.__iterate(function(u,d){if(!(B&&(B=c++<o)))return E++,r(u,i?d:E-1,l)!==!1&&E!==s}),E},I.__iteratorUncached=function(r,C){if(s!==0&&C)return this.cacheResult().__iterator(r,C);if(s===0)return new ii(Ns);var l=A.__iterator(r,C),c=0,B=0;return new ii(function(){for(;c++<o;)l.next();if(++B>s)return Ns();var E=l.next();return i||r===WI||E.done?E:r===DN?Wn(r,B-1,void 0,E):Wn(r,B-1,E.value[1],E)})},I}function PZt(A,e,t){var i=sE(A);return i.__iterateUncached=function(n,o){var g=this;if(o)return this.cacheResult().__iterate(n,o);var a=0;return A.__iterate(function(s,I,r){return e.call(t,s,I,r)&&++a&&n(s,I,g)}),a},i.__iteratorUncached=function(n,o){var g=this;if(o)return this.cacheResult().__iterator(n,o);var a=A.__iterator(KI,o),s=!0;return new ii(function(){if(!s)return Ns();var I=a.next();if(I.done)return I;var r=I.value,C=r[0],l=r[1];return e.call(t,l,C,g)?n===KI?I:Wn(n,C,l,I):(s=!1,Ns())})},i}function mae(A,e,t,i){var n=sE(A);return n.__iterateUncached=function(o,g){var a=this;if(g)return this.cacheResult().__iterate(o,g);var s=!0,I=0;return A.__iterate(function(r,C,l){if(!(s&&(s=e.call(t,r,C,l))))return I++,o(r,i?C:I-1,a)}),I},n.__iteratorUncached=function(o,g){var a=this;if(g)return this.cacheResult().__iterator(o,g);var s=A.__iterator(KI,g),I=!0,r=0;return new ii(function(){var C,l,c;do{if(C=s.next(),C.done)return i||o===WI?C:o===DN?Wn(o,r++,void 0,C):Wn(o,r++,C.value[1],C);var B=C.value;l=B[0],c=B[1],I&&(I=e.call(t,c,l,a))}while(I);return o===KI?C:Wn(o,l,c,C)})},n}var $Zt=function(A){function e(t){this._wrappedIterables=t.flatMap(function(i){return i._wrappedIterables?i._wrappedIterables:[i]}),this.size=this._wrappedIterables.reduce(function(i,n){if(i!==void 0){var o=n.size;if(o!==void 0)return i+o}},0),this[jO]=this._wrappedIterables[0][jO],this[PO]=this._wrappedIterables[0][PO],this[d0]=this._wrappedIterables[0][d0]}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,i){if(this._wrappedIterables.length!==0){if(i)return this.cacheResult().__iterate(t,i);for(var n=0,o=Zn(this),g=o?KI:WI,a=this._wrappedIterables[n].__iterator(g,i),s=!0,I=0;s;){for(var r=a.next();r.done;){if(n++,n===this._wrappedIterables.length)return I;a=this._wrappedIterables[n].__iterator(g,i),r=a.next()}var C=o?t(r.value[1],r.value[0],this):t(r.value,I,this);s=C!==!1,I++}return I}},e.prototype.__iteratorUncached=function(t,i){var n=this;if(this._wrappedIterables.length===0)return new ii(Ns);if(i)return this.cacheResult().__iterator(t,i);var o=0,g=this._wrappedIterables[o].__iterator(t,i);return new ii(function(){for(var a=g.next();a.done;){if(o++,o===n._wrappedIterables.length)return a;g=n._wrappedIterables[o].__iterator(t,i),a=g.next()}return a})},e}(kr);function AWt(A,e){var t=Zn(A),i=[A].concat(e).map(function(o){return ZI(o)?t&&(o=Dl(o)):o=t?xdA(o):oae(Array.isArray(o)?o:[o]),o}).filter(function(o){return o.size!==0});if(i.length===0)return A;if(i.length===1){var n=i[0];if(n===A||t&&Zn(n)||wl(A)&&wl(n))return n}return new $Zt(i)}function pae(A,e,t){var i=sE(A);return i.__iterateUncached=function(n,o){if(o)return this.cacheResult().__iterate(n,o);var g=0,a=!1;function s(I,r){I.__iterate(function(C,l){return(!e||r<e)&&ZI(C)?s(C,r+1):(g++,n(C,t?l:g-1,i)===!1&&(a=!0)),!a},o)}return s(A,0),g},i.__iteratorUncached=function(n,o){if(o)return this.cacheResult().__iterator(n,o);var g=A.__iterator(n,o),a=[],s=0;return new ii(function(){for(;g;){var I=g.next();if(I.done!==!1){g=a.pop();continue}var r=I.value;if(n===KI&&(r=r[1]),(!e||a.length<e)&&ZI(r))a.push(g),g=r.__iterator(n,o);else return t?I:Wn(n,s++,r,I)}return Ns()})},i}function eWt(A,e,t){var i=VdA(A);return A.toSeq().map(function(n,o){return i(e.call(t,n,o,A))}).flatten(!0)}function tWt(A,e){var t=sE(A);return t.size=A.size&&A.size*2-1,t.__iterateUncached=function(i,n){var o=this,g=0;return A.__iterate(function(a){return(!g||i(e,g++,o)!==!1)&&i(a,g++,o)!==!1},n),g},t.__iteratorUncached=function(i,n){var o=A.__iterator(WI,n),g=0,a;return new ii(function(){return(!a||g%2)&&(a=o.next(),a.done)?a:g%2?Wn(i,g++,e):Wn(i,g++,a.value,a)})},t}function NN(A,e,t){e||(e=bae);var i=Zn(A),n=0,o=A.toSeq().map(function(g,a){return[a,g,n++,t?t(g,a,A):g]}).valueSeq().toArray();return o.sort(function(g,a){return e(g[3],a[3])||g[2]-a[2]}).forEach(i?function(g,a){o[a].length=2}:function(g,a){o[a]=g[1]}),i?h0(o):wl(A)?aB(o):kN(o)}function iq(A,e,t){if(e||(e=bae),t){var i=A.toSeq().map(function(n,o){return[n,t(n,o,A)]}).reduce(function(n,o){return fae(e,n[1],o[1])?o:n});return i&&i[0]}return A.reduce(function(n,o){return fae(e,n,o)?o:n})}function fae(A,e,t){var i=A(t,e);return i===0&&t!==e&&(t==null||t!==t)||i>0}function nq(A,e,t,i){var n=sE(A),o=new JN(t).map(function(g){return g.size});return n.size=i?o.max():o.min(),n.__iterate=function(g,a){for(var s=this.__iterator(WI,a),I,r=0;!(I=s.next()).done&&g(I.value,r++,this)!==!1;);return r},n.__iteratorUncached=function(g,a){var s=t.map(function(C){return C=Xa(C),NdA(a?C.reverse():C)}),I=0,r=!1;return new ii(function(){var C;return r||(C=s.map(function(l){return l.next()}),r=i?C.every(function(l){return l.done}):C.some(function(l){return l.done})),r?Ns():Wn(g,I++,e.apply(null,C.map(function(l){return l.value})))})},n}function Pi(A,e){return A===e?A:kdA(A)?e:A.constructor(e)}function yae(A){if(A!==Object(A))throw new TypeError("Expected [K, V] tuple: "+A)}function VdA(A){return Zn(A)?Dl:wl(A)?ww:bN}function sE(A){return Object.create((Zn(A)?h0:wl(A)?aB:kN).prototype)}function XdA(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):kr.prototype.cacheResult.call(this)}function bae(A,e){return A===void 0&&e===void 0?0:A===void 0?1:e===void 0?-1:A>e?1:A<e?-1:0}function rE(A,e){e=e||0;for(var t=Math.max(0,A.length-e),i=new Array(t),n=0;n<t;n++)i[n]=A[n+e];return i}function qS(A,e){if(!A)throw new Error(e)}function XI(A){qS(A!==1/0,"Cannot perform this action with an infinite size.")}function wae(A){if(iae(A)&&typeof A!="string")return A;if(aE(A))return A.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+A)}var iWt=Object.prototype.toString;function nWt(A){if(!A||typeof A!="object"||iWt.call(A)!=="[object Object]")return!1;var e=Object.getPrototypeOf(A);if(e===null)return!0;for(var t=e,i=Object.getPrototypeOf(e);i!==null;)t=i,i=Object.getPrototypeOf(t);return t===e}function m0(A){return typeof A=="object"&&(gE(A)||Array.isArray(A)||nWt(A))}function jS(A){try{return typeof A=="string"?JSON.stringify(A):String(A)}catch{return JSON.stringify(A)}}function oWt(A,e){return gE(A)?A.has(e):m0(A)&&GN.call(A,e)}function Dae(A,e,t){return gE(A)?A.get(e,t):oWt(A,e)?typeof A.get=="function"?A.get(e):A[e]:t}function oq(A){if(Array.isArray(A))return rE(A);var e={};for(var t in A)GN.call(A,t)&&(e[t]=A[t]);return e}function gWt(A,e){if(!m0(A))throw new TypeError("Cannot update non-data-structure value: "+A);if(gE(A)){if(!A.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+A);return A.remove(e)}if(!GN.call(A,e))return A;var t=oq(A);return Array.isArray(t)?t.splice(e,1):delete t[e],t}function aWt(A,e,t){if(!m0(A))throw new TypeError("Cannot update non-data-structure value: "+A);if(gE(A)){if(!A.set)throw new TypeError("Cannot update immutable value without .set() method: "+A);return A.set(e,t)}if(GN.call(A,e)&&t===A[e])return A;var i=oq(A);return i[e]=t,i}function YN(A,e,t,i){i||(i=t,t=void 0);var n=Gae(gE(A),A,wae(e),0,t,i);return n===Xt?t:n}function Gae(A,e,t,i,n,o){var g=e===Xt;if(i===t.length){var a=g?n:e,s=o(a);return s===a?e:s}if(!g&&!m0(e))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(t).slice(0,i).map(jS)+"]: "+e);var I=t[i];if(typeof I>"u")throw new TypeError("Index can not be undefined in updateIn(). This should not happen");var r=g?Xt:Dae(e,I,Xt),C=Gae(r===Xt?A:gE(r),r,t,i+1,n,o);return C===r?e:C===Xt?gWt(e,I):aWt(g?A?IE():{}:e,I,C)}function sWt(A,e,t){return YN(A,e,Xt,function(){return t})}function zdA(A,e){return sWt(this,A,e)}function rWt(A,e){return YN(A,e,function(){return Xt})}function TdA(A){return rWt(this,A)}function kae(A,e,t,i){return YN(A,[e],t,i)}function _dA(A,e,t){return arguments.length===1?A(this):kae(this,A,e,t)}function OdA(A,e,t){return YN(this,A,e,t)}function Jae(){for(var A=[],e=arguments.length;e--;)A[e]=arguments[e];return Yae(this,A)}function Nae(A){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];if(typeof A!="function")throw new TypeError("Invalid merger function: "+A);return Yae(this,e,A)}function Yae(A,e,t){for(var i=[],n=0;n<e.length;n++){var o=Dl(e[n]);o.size!==0&&i.push(o)}return i.length===0?A:A.toSeq().size===0&&!A.__ownerID&&i.length===1?A.constructor(i[0]):A.withMutations(function(g){for(var a=t?function(I,r){kae(g,r,Xt,function(C){return C===Xt?I:t(C,I,r)})}:function(I,r){g.set(r,I)},s=0;s<i.length;s++)i[s].forEach(a)})}function qdA(A,e,t){return jdA(A,e,IWt(t))}function jdA(A,e,t){if(!m0(A))throw new TypeError("Cannot merge into non-data-structure value: "+A);if(gE(A))return typeof t=="function"&&A.mergeWith?A.mergeWith.apply(A,[t].concat(e)):A.merge?A.merge.apply(A,e):A.concat.apply(A,e);for(var i=Array.isArray(A),n=A,o=i?ww:Dl,g=i?function(s){n===A&&(n=oq(n)),n.push(s)}:function(s,I){var r=GN.call(n,I),C=r&&t?t(n[I],s,I):s;(!r||C!==n[I])&&(n===A&&(n=oq(n)),n[I]=C)},a=0;a<e.length;a++)o(e[a]).forEach(g);return n}function IWt(A){function e(t,i,n){return m0(t)&&m0(i)&&CWt(t,i)?jdA(t,[i],e):A?A(t,i,n):i}return e}function CWt(A,e){var t=kr(A),i=kr(e);return wl(t)===wl(i)&&Zn(t)===Zn(i)}function Rae(){for(var A=[],e=arguments.length;e--;)A[e]=arguments[e];return qdA(this,A)}function xae(A){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];return qdA(this,e,A)}function PdA(A){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];return YN(this,A,IE(),function(i){return jdA(i,e)})}function $dA(A){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];return YN(this,A,IE(),function(i){return qdA(i,e)})}function PS(A){var e=this.asMutable();return A(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function $S(){return this.__ownerID?this:this.__ensureOwner(new DdA)}function AH(){return this.__ensureOwner()}function AhA(){return this.__altered}var RN=function(A){function e(t){return t==null?IE():MdA(t)&&!aE(t)?t:IE().withMutations(function(i){var n=A(t);XI(n.size),n.forEach(function(o,g){return i.set(g,o)})})}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,i){return this._root?this._root.get(0,void 0,t,i):i},e.prototype.set=function(t,i){return vae(this,t,i)},e.prototype.remove=function(t){return vae(this,t,Xt)},e.prototype.deleteAll=function(t){var i=Xa(t);return i.size===0?this:this.withMutations(function(n){i.forEach(function(o){return n.remove(o)})})},e.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):IE()},e.prototype.sort=function(t){return CE(NN(this,t))},e.prototype.sortBy=function(t,i){return CE(NN(this,i,t))},e.prototype.map=function(t,i){var n=this;return this.withMutations(function(o){o.forEach(function(g,a){o.set(a,t.call(i,g,a,n))})})},e.prototype.__iterator=function(t,i){return new lWt(this,t,i)},e.prototype.__iterate=function(t,i){var n=this,o=0;return this._root&&this._root.iterate(function(g){return o++,t(g[1],g[0],n)},i),o},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?thA(this.size,this._root,t,this.__hash):this.size===0?IE():(this.__ownerID=t,this.__altered=!1,this)},e}(Dl);RN.isMap=MdA;var kn=RN.prototype;kn[gae]=!0,kn[TS]=kn.remove,kn.removeAll=kn.deleteAll,kn.setIn=zdA,kn.removeIn=kn.deleteIn=TdA,kn.update=_dA,kn.updateIn=OdA,kn.merge=kn.concat=Jae,kn.mergeWith=Nae,kn.mergeDeep=Rae,kn.mergeDeepWith=xae,kn.mergeIn=PdA,kn.mergeDeepIn=$dA,kn.withMutations=PS,kn.wasAltered=AhA,kn.asImmutable=AH,kn["@@transducer/init"]=kn.asMutable=$S,kn["@@transducer/step"]=function(A,e){return A.set(e[0],e[1])},kn["@@transducer/result"]=function(A){return A.asImmutable()};var eH=function(A,e){this.ownerID=A,this.entries=e};eH.prototype.get=function(A,e,t,i){for(var n=this.entries,o=0,g=n.length;o<g;o++)if(UI(t,n[o][0]))return n[o][1];return i},eH.prototype.update=function(A,e,t,i,n,o,g){for(var a=n===Xt,s=this.entries,I=0,r=s.length;I<r&&!UI(i,s[I][0]);I++);var C=I<r;if(C?s[I][1]===n:a)return this;if(bl(g),(a||!C)&&bl(o),!(a&&s.length===1)){if(!C&&!a&&s.length>=dWt)return cWt(A,s,i,n);var l=A&&A===this.ownerID,c=l?s:rE(s);return C?a?I===r-1?c.pop():c[I]=c.pop():c[I]=[i,n]:c.push([i,n]),l?(this.entries=c,this):new eH(A,c)}};var xN=function(A,e,t){this.ownerID=A,this.bitmap=e,this.nodes=t};xN.prototype.get=function(A,e,t,i){e===void 0&&(e=VI(t));var n=1<<((A===0?e:e>>>A)&Js),o=this.bitmap;return o&n?this.nodes[Sae(o&n-1)].get(A+ji,e,t,i):i},xN.prototype.update=function(A,e,t,i,n,o,g){t===void 0&&(t=VI(i));var a=(e===0?t:t>>>e)&Js,s=1<<a,I=this.bitmap,r=(I&s)!==0;if(!r&&n===Xt)return this;var C=Sae(I&s-1),l=this.nodes,c=r?l[C]:void 0,B=ihA(c,A,e+ji,t,i,n,o,g);if(B===c)return this;if(!r&&B&&l.length>=hWt)return QWt(A,l,I,a,B);if(r&&!B&&l.length===2&&Lae(l[C^1]))return l[C^1];if(r&&B&&l.length===1&&Lae(B))return B;var E=A&&A===this.ownerID,u=r?B?I:I^s:I|s,d=r?B?Hae(l,C,B,E):uWt(l,C,E):EWt(l,C,B,E);return E?(this.bitmap=u,this.nodes=d,this):new xN(A,u,d)};var tH=function(A,e,t){this.ownerID=A,this.count=e,this.nodes=t};tH.prototype.get=function(A,e,t,i){e===void 0&&(e=VI(t));var n=(A===0?e:e>>>A)&Js,o=this.nodes[n];return o?o.get(A+ji,e,t,i):i},tH.prototype.update=function(A,e,t,i,n,o,g){t===void 0&&(t=VI(i));var a=(e===0?t:t>>>e)&Js,s=n===Xt,I=this.nodes,r=I[a];if(s&&!r)return this;var C=ihA(r,A,e+ji,t,i,n,o,g);if(C===r)return this;var l=this.count;if(!r)l++;else if(!C&&(l--,l<mWt))return BWt(A,I,l,a);var c=A&&A===this.ownerID,B=Hae(I,a,C,c);return c?(this.count=l,this.nodes=B,this):new tH(A,l,B)};var FN=function(A,e,t){this.ownerID=A,this.keyHash=e,this.entries=t};FN.prototype.get=function(A,e,t,i){for(var n=this.entries,o=0,g=n.length;o<g;o++)if(UI(t,n[o][0]))return n[o][1];return i},FN.prototype.update=function(A,e,t,i,n,o,g){t===void 0&&(t=VI(i));var a=n===Xt;if(t!==this.keyHash)return a?this:(bl(g),bl(o),nhA(this,A,e,t,[i,n]));for(var s=this.entries,I=0,r=s.length;I<r&&!UI(i,s[I][0]);I++);var C=I<r;if(C?s[I][1]===n:a)return this;if(bl(g),(a||!C)&&bl(o),a&&r===2)return new jd(A,this.keyHash,s[I^1]);var l=A&&A===this.ownerID,c=l?s:rE(s);return C?a?I===r-1?c.pop():c[I]=c.pop():c[I]=[i,n]:c.push([i,n]),l?(this.entries=c,this):new FN(A,this.keyHash,c)};var jd=function(A,e,t){this.ownerID=A,this.keyHash=e,this.entry=t};jd.prototype.get=function(A,e,t,i){return UI(t,this.entry[0])?this.entry[1]:i},jd.prototype.update=function(A,e,t,i,n,o,g){var a=n===Xt,s=UI(i,this.entry[0]);if(s?n===this.entry[1]:a)return this;if(bl(g),a){bl(o);return}return s?A&&A===this.ownerID?(this.entry[1]=n,this):new jd(A,this.keyHash,[i,n]):(bl(o),nhA(this,A,e,VI(i),[i,n]))},eH.prototype.iterate=FN.prototype.iterate=function(A,e){for(var t=this.entries,i=0,n=t.length-1;i<=n;i++)if(A(t[e?n-i:i])===!1)return!1},xN.prototype.iterate=tH.prototype.iterate=function(A,e){for(var t=this.nodes,i=0,n=t.length-1;i<=n;i++){var o=t[e?n-i:i];if(o&&o.iterate(A,e)===!1)return!1}},jd.prototype.iterate=function(A,e){return A(this.entry)};var lWt=function(A){function e(t,i,n){this._type=i,this._reverse=n,this._stack=t._root&&Fae(t._root)}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.next=function(){for(var t=this._type,i=this._stack;i;){var n=i.node,o=i.index++,g=void 0;if(n.entry){if(o===0)return ehA(t,n.entry)}else if(n.entries){if(g=n.entries.length-1,o<=g)return ehA(t,n.entries[this._reverse?g-o:o])}else if(g=n.nodes.length-1,o<=g){var a=n.nodes[this._reverse?g-o:o];if(a){if(a.entry)return ehA(t,a.entry);i=this._stack=Fae(a,i)}continue}i=this._stack=this._stack.__prev}return Ns()},e}(ii);function ehA(A,e){return Wn(A,e[0],e[1])}function Fae(A,e){return{node:A,index:0,__prev:e}}function thA(A,e,t,i){var n=Object.create(kn);return n.size=A,n._root=e,n.__ownerID=t,n.__hash=i,n.__altered=!1,n}var Mae;function IE(){return Mae||(Mae=thA(0))}function vae(A,e,t){var i,n;if(A._root){var o=wdA(),g=wdA();if(i=ihA(A._root,A.__ownerID,0,void 0,e,t,o,g),!g.value)return A;n=A.size+(o.value?t===Xt?-1:1:0)}else{if(t===Xt)return A;n=1,i=new eH(A.__ownerID,[[e,t]])}return A.__ownerID?(A.size=n,A._root=i,A.__hash=void 0,A.__altered=!0,A):i?thA(n,i):IE()}function ihA(A,e,t,i,n,o,g,a){return A?A.update(e,t,i,n,o,g,a):o===Xt?A:(bl(a),bl(g),new jd(e,i,[n,o]))}function Lae(A){return A.constructor===jd||A.constructor===FN}function nhA(A,e,t,i,n){if(A.keyHash===i)return new FN(e,i,[A.entry,n]);var o=(t===0?A.keyHash:A.keyHash>>>t)&Js,g=(t===0?i:i>>>t)&Js,a,s=o===g?[nhA(A,e,t+ji,i,n)]:(a=new jd(e,i,n),o<g?[A,a]:[a,A]);return new xN(e,1<<o|1<<g,s)}function cWt(A,e,t,i){A||(A=new DdA);for(var n=new jd(A,VI(t),[t,i]),o=0;o<e.length;o++){var g=e[o];n=n.update(A,0,void 0,g[0],g[1])}return n}function BWt(A,e,t,i){for(var n=0,o=0,g=new Array(t),a=0,s=1,I=e.length;a<I;a++,s<<=1){var r=e[a];r!==void 0&&a!==i&&(n|=s,g[o++]=r)}return new xN(A,n,g)}function QWt(A,e,t,i,n){for(var o=0,g=new Array(HI),a=0;t!==0;a++,t>>>=1)g[a]=t&1?e[o++]:void 0;return g[i]=n,new tH(A,o+1,g)}function Sae(A){return A-=A>>1&1431655765,A=(A&858993459)+(A>>2&858993459),A=A+(A>>4)&252645135,A+=A>>8,A+=A>>16,A&127}function Hae(A,e,t,i){var n=i?A:rE(A);return n[e]=t,n}function EWt(A,e,t,i){var n=A.length+1;if(i&&e+1===n)return A[e]=t,A;for(var o=new Array(n),g=0,a=0;a<n;a++)a===e?(o[a]=t,g=-1):o[a]=A[a+g];return o}function uWt(A,e,t){var i=A.length-1;if(t&&e===i)return A.pop(),A;for(var n=new Array(i),o=0,g=0;g<i;g++)g===e&&(o=1),n[g]=A[g+o];return n}var dWt=HI/4,hWt=HI/2,mWt=HI/4,Zae="@@__IMMUTABLE_LIST__@@";function Wae(A){return!!(A&&A[Zae])}var gq=function(A){function e(t){var i=aq();if(t==null)return i;if(Wae(t))return t;var n=A(t),o=n.size;return o===0?i:(XI(o),o>0&&o<HI?nH(0,o,ji,null,new p0(n.toArray())):i.withMutations(function(g){g.setSize(o),n.forEach(function(a,s){return g.set(s,a)})}))}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("List [","]")},e.prototype.get=function(t,i){if(t=u0(this,t),t>=0&&t<this.size){t+=this._origin;var n=Uae(this,t);return n&&n.array[t&Js]}return i},e.prototype.set=function(t,i){return pWt(this,t,i)},e.prototype.remove=function(t){return this.has(t)?t===0?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,i){return this.splice(t,0,i)},e.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=ji,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):aq()},e.prototype.push=function(){var t=arguments,i=this.size;return this.withMutations(function(n){f0(n,0,i+t.length);for(var o=0;o<t.length;o++)n.set(i+o,t[o])})},e.prototype.pop=function(){return f0(this,0,-1)},e.prototype.unshift=function(){var t=arguments;return this.withMutations(function(i){f0(i,-t.length);for(var n=0;n<t.length;n++)i.set(n,t[n])})},e.prototype.shift=function(){return f0(this,1)},e.prototype.shuffle=function(t){return t===void 0&&(t=Math.random),this.withMutations(function(i){for(var n=i.size,o,g;n;)o=Math.floor(t()*n--),g=i.get(o),i.set(o,i.get(n)),i.set(n,g)})},e.prototype.concat=function(){for(var t=arguments,i=[],n=0;n<arguments.length;n++){var o=t[n],g=A(typeof o!="string"&&eae(o)?o:[o]);g.size!==0&&i.push(g)}return i.length===0?this:this.size===0&&!this.__ownerID&&i.length===1?this.constructor(i[0]):this.withMutations(function(a){i.forEach(function(s){return s.forEach(function(I){return a.push(I)})})})},e.prototype.setSize=function(t){return f0(this,0,t)},e.prototype.map=function(t,i){var n=this;return this.withMutations(function(o){for(var g=0;g<n.size;g++)o.set(g,t.call(i,o.get(g),g,n))})},e.prototype.slice=function(t,i){var n=this.size;return OO(t,i,n)?this:f0(this,_S(t,n),qO(i,n))},e.prototype.__iterator=function(t,i){var n=i?this.size:0,o=Kae(this,i);return new ii(function(){var g=o();return g===iH?Ns():Wn(t,i?--n:n++,g)})},e.prototype.__iterate=function(t,i){for(var n=i?this.size:0,o=Kae(this,i),g;(g=o())!==iH&&t(g,i?--n:n++,this)!==!1;);return n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?nH(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):this.size===0?aq():(this.__ownerID=t,this.__altered=!1,this)},e}(ww);gq.isList=Wae;var Zo=gq.prototype;Zo[Zae]=!0,Zo[TS]=Zo.remove,Zo.merge=Zo.concat,Zo.setIn=zdA,Zo.deleteIn=Zo.removeIn=TdA,Zo.update=_dA,Zo.updateIn=OdA,Zo.mergeIn=PdA,Zo.mergeDeepIn=$dA,Zo.withMutations=PS,Zo.wasAltered=AhA,Zo.asImmutable=AH,Zo["@@transducer/init"]=Zo.asMutable=$S,Zo["@@transducer/step"]=function(A,e){return A.push(e)},Zo["@@transducer/result"]=function(A){return A.asImmutable()};var p0=function(A,e){this.array=A,this.ownerID=e};p0.prototype.removeBefore=function(A,e,t){if(!(t&(1<<e+ji)-1)||this.array.length===0)return this;var i=t>>>e&Js;if(i>=this.array.length)return new p0([],A);var n=i===0,o;if(e>0){var g=this.array[i];if(o=g&&g.removeBefore(A,e-ji,t),o===g&&n)return this}if(n&&!o)return this;var a=MN(this,A);if(!n)for(var s=0;s<i;s++)a.array[s]=void 0;return o&&(a.array[i]=o),a},p0.prototype.removeAfter=function(A,e,t){if(t===(e?1<<e+ji:HI)||this.array.length===0)return this;var i=t-1>>>e&Js;if(i>=this.array.length)return this;var n;if(e>0){var o=this.array[i];if(n=o&&o.removeAfter(A,e-ji,t),n===o&&i===this.array.length-1)return this}var g=MN(this,A);return g.array.splice(i+1),n&&(g.array[i]=n),g};var iH={};function Kae(A,e){var t=A._origin,i=A._capacity,n=oH(i),o=A._tail;return g(A._root,A._level,0);function g(I,r,C){return r===0?a(I,C):s(I,r,C)}function a(I,r){var C=r===n?o&&o.array:I&&I.array,l=r>t?0:t-r,c=i-r;return c>HI&&(c=HI),function(){if(l===c)return iH;var B=e?--c:l++;return C&&C[B]}}function s(I,r,C){var l,c=I&&I.array,B=C>t?0:t-C>>r,E=(i-C>>r)+1;return E>HI&&(E=HI),function(){for(;;){if(l){var u=l();if(u!==iH)return u;l=null}if(B===E)return iH;var d=e?--E:B++;l=g(c&&c[d],r-ji,C+(d<<r))}}}}function nH(A,e,t,i,n,o,g){var a=Object.create(Zo);return a.size=e-A,a._origin=A,a._capacity=e,a._level=t,a._root=i,a._tail=n,a.__ownerID=o,a.__hash=g,a.__altered=!1,a}function aq(){return nH(0,0,ji)}function pWt(A,e,t){if(e=u0(A,e),e!==e)return A;if(e>=A.size||e<0)return A.withMutations(function(g){e<0?f0(g,e).set(0,t):f0(g,0,e+1).set(e,t)});e+=A._origin;var i=A._tail,n=A._root,o=wdA();return e>=oH(A._capacity)?i=ohA(i,A.__ownerID,0,e,t,o):n=ohA(n,A.__ownerID,A._level,e,t,o),o.value?A.__ownerID?(A._root=n,A._tail=i,A.__hash=void 0,A.__altered=!0,A):nH(A._origin,A._capacity,A._level,n,i):A}function ohA(A,e,t,i,n,o){var g=i>>>t&Js,a=A&&g<A.array.length;if(!a&&n===void 0)return A;var s;if(t>0){var I=A&&A.array[g],r=ohA(I,e,t-ji,i,n,o);return r===I?A:(s=MN(A,e),s.array[g]=r,s)}return a&&A.array[g]===n?A:(o&&bl(o),s=MN(A,e),n===void 0&&g===s.array.length-1?s.array.pop():s.array[g]=n,s)}function MN(A,e){return e&&A&&e===A.ownerID?A:new p0(A?A.array.slice():[],e)}function Uae(A,e){if(e>=oH(A._capacity))return A._tail;if(e<1<<A._level+ji){for(var t=A._root,i=A._level;t&&i>0;)t=t.array[e>>>i&Js],i-=ji;return t}}function f0(A,e,t){e!==void 0&&(e|=0),t!==void 0&&(t|=0);var i=A.__ownerID||new DdA,n=A._origin,o=A._capacity,g=n+e,a=t===void 0?o:t<0?o+t:n+t;if(g===n&&a===o)return A;if(g>=a)return A.clear();for(var s=A._level,I=A._root,r=0;g+r<0;)I=new p0(I&&I.array.length?[void 0,I]:[],i),s+=ji,r+=1<<s;r&&(g+=r,n+=r,a+=r,o+=r);for(var C=oH(o),l=oH(a);l>=1<<s+ji;)I=new p0(I&&I.array.length?[I]:[],i),s+=ji;var c=A._tail,B=l<C?Uae(A,a-1):l>C?new p0([],i):c;if(c&&l>C&&g<o&&c.array.length){I=MN(I,i);for(var E=I,u=s;u>ji;u-=ji){var d=C>>>u&Js;E=E.array[d]=MN(E.array[d],i)}E.array[C>>>ji&Js]=c}if(a<o&&(B=B&&B.removeAfter(i,0,a)),g>=l)g-=l,a-=l,s=ji,I=null,B=B&&B.removeBefore(i,0,g);else if(g>n||l<C){for(r=0;I;){var f=g>>>s&Js;if(f!==l>>>s&Js)break;f&&(r+=(1<<s)*f),s-=ji,I=I.array[f]}I&&g>n&&(I=I.removeBefore(i,s,g-r)),I&&l<C&&(I=I.removeAfter(i,s,l-r)),r&&(g-=r,a-=r)}return A.__ownerID?(A.size=a-g,A._origin=g,A._capacity=a,A._level=s,A._root=I,A._tail=B,A.__hash=void 0,A.__altered=!0,A):nH(g,a,s,I,B)}function oH(A){return A<HI?0:A-1>>>ji<<ji}var CE=function(A){function e(t){return t==null?gH():aae(t)?t:gH().withMutations(function(i){var n=Dl(t);XI(n.size),n.forEach(function(o,g){return i.set(g,o)})})}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,i){var n=this._map.get(t);return n!==void 0?this._list.get(n)[1]:i},e.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):gH()},e.prototype.set=function(t,i){return Xae(this,t,i)},e.prototype.remove=function(t){return Xae(this,t,Xt)},e.prototype.__iterate=function(t,i){var n=this;return this._list.__iterate(function(o){return o&&t(o[1],o[0],n)},i)},e.prototype.__iterator=function(t,i){return this._list.fromEntrySeq().__iterator(t,i)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var i=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?ghA(i,n,t,this.__hash):this.size===0?gH():(this.__ownerID=t,this.__altered=!1,this._map=i,this._list=n,this)},e}(RN);CE.isOrderedMap=aae,CE.prototype[d0]=!0,CE.prototype[TS]=CE.prototype.remove;function ghA(A,e,t,i){var n=Object.create(CE.prototype);return n.size=A?A.size:0,n._map=A,n._list=e,n.__ownerID=t,n.__hash=i,n.__altered=!1,n}var Vae;function gH(){return Vae||(Vae=ghA(IE(),aq()))}function Xae(A,e,t){var i=A._map,n=A._list,o=i.get(e),g=o!==void 0,a,s;if(t===Xt){if(!g)return A;n.size>=HI&&n.size>=i.size*2?(s=n.filter(function(I,r){return I!==void 0&&o!==r}),a=s.toKeyedSeq().map(function(I){return I[0]}).flip().toMap(),A.__ownerID&&(a.__ownerID=s.__ownerID=A.__ownerID)):(a=i.remove(e),s=o===n.size-1?n.pop():n.set(o,void 0))}else if(g){if(t===n.get(o)[1])return A;a=i,s=n.set(o,[e,t])}else a=i.set(e,n.size),s=n.set(n.size,[e,t]);return A.__ownerID?(A.size=a.size,A._map=a,A._list=s,A.__hash=void 0,A.__altered=!0,A):ghA(a,s)}var zae="@@__IMMUTABLE_STACK__@@";function ahA(A){return!!(A&&A[zae])}var shA=function(A){function e(t){return t==null?sq():ahA(t)?t:sq().pushAll(t)}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,i){var n=this._head;for(t=u0(this,t);n&&t--;)n=n.next;return n?n.value:i},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(arguments.length===0)return this;for(var i=this.size+arguments.length,n=this._head,o=arguments.length-1;o>=0;o--)n={value:t[o],next:n};return this.__ownerID?(this.size=i,this._head=n,this.__hash=void 0,this.__altered=!0,this):aH(i,n)},e.prototype.pushAll=function(t){if(t=A(t),t.size===0)return this;if(this.size===0&&ahA(t))return t;XI(t.size);var i=this.size,n=this._head;return t.__iterate(function(o){i++,n={value:o,next:n}},!0),this.__ownerID?(this.size=i,this._head=n,this.__hash=void 0,this.__altered=!0,this):aH(i,n)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):sq()},e.prototype.slice=function(t,i){if(OO(t,i,this.size))return this;var n=_S(t,this.size),o=qO(i,this.size);if(o!==this.size)return A.prototype.slice.call(this,t,i);for(var g=this.size-n,a=this._head;n--;)a=a.next;return this.__ownerID?(this.size=g,this._head=a,this.__hash=void 0,this.__altered=!0,this):aH(g,a)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?aH(this.size,this._head,t,this.__hash):this.size===0?sq():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,i){var n=this;if(i)return new JN(this.toArray()).__iterate(function(a,s){return t(a,s,n)},i);for(var o=0,g=this._head;g&&t(g.value,o++,this)!==!1;)g=g.next;return o},e.prototype.__iterator=function(t,i){if(i)return new JN(this.toArray()).__iterator(t,i);var n=0,o=this._head;return new ii(function(){if(o){var g=o.value;return o=o.next,Wn(t,n++,g)}return Ns()})},e}(ww);shA.isStack=ahA;var Ys=shA.prototype;Ys[zae]=!0,Ys.shift=Ys.pop,Ys.unshift=Ys.push,Ys.unshiftAll=Ys.pushAll,Ys.withMutations=PS,Ys.wasAltered=AhA,Ys.asImmutable=AH,Ys["@@transducer/init"]=Ys.asMutable=$S,Ys["@@transducer/step"]=function(A,e){return A.unshift(e)},Ys["@@transducer/result"]=function(A){return A.asImmutable()};function aH(A,e,t,i){var n=Object.create(Ys);return n.size=A,n._head=e,n.__ownerID=t,n.__hash=i,n.__altered=!1,n}var Tae;function sq(){return Tae||(Tae=aH(0))}var _ae="@@__IMMUTABLE_SET__@@";function rhA(A){return!!(A&&A[_ae])}function Oae(A){return rhA(A)&&aE(A)}function qae(A,e){if(A===e)return!0;if(!ZI(e)||A.size!==void 0&&e.size!==void 0&&A.size!==e.size||A.__hash!==void 0&&e.__hash!==void 0&&A.__hash!==e.__hash||Zn(A)!==Zn(e)||wl(A)!==wl(e)||aE(A)!==aE(e))return!1;if(A.size===0&&e.size===0)return!0;var t=!GdA(A);if(aE(A)){var i=A.entries();return e.every(function(s,I){var r=i.next().value;return r&&UI(r[1],s)&&(t||UI(r[0],I))})&&i.next().done}var n=!1;if(A.size===void 0)if(e.size===void 0)typeof A.cacheResult=="function"&&A.cacheResult();else{n=!0;var o=A;A=e,e=o}var g=!0,a=e.__iterate(function(s,I){if(t?!A.has(s):n?!UI(s,A.get(I,Xt)):!UI(A.get(I,Xt),s))return g=!1,!1});return g&&A.size===a}function Gw(A,e){var t=function(i){A.prototype[i]=e[i]};return Object.keys(e).forEach(t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(t),A}function rq(A){if(!A||typeof A!="object")return A;if(!ZI(A)){if(!m0(A))return A;A=kr(A)}if(Zn(A)){var e={};return A.__iterate(function(i,n){e[n]=rq(i)}),e}var t=[];return A.__iterate(function(i){t.push(rq(i))}),t}var Iq=function(A){function e(t){return t==null?sH():rhA(t)&&!aE(t)?t:sH().withMutations(function(i){var n=A(t);XI(n.size),n.forEach(function(o){return i.add(o)})})}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(Dl(t).keySeq())},e.intersect=function(t){return t=Xa(t).toArray(),t.length?Ia.intersect.apply(e(t.pop()),t):sH()},e.union=function(t){return t=Xa(t).toArray(),t.length?Ia.union.apply(e(t.pop()),t):sH()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Cq(this,this._map.set(t,t))},e.prototype.remove=function(t){return Cq(this,this._map.remove(t))},e.prototype.clear=function(){return Cq(this,this._map.clear())},e.prototype.map=function(t,i){var n=this,o=!1,g=Cq(this,this._map.mapEntries(function(a){var s=a[1],I=t.call(i,s,s,n);return I!==s&&(o=!0),[I,I]},i));return o?g:this},e.prototype.union=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return t=t.filter(function(n){return n.size!==0}),t.length===0?this:this.size===0&&!this.__ownerID&&t.length===1?this.constructor(t[0]):this.withMutations(function(n){for(var o=0;o<t.length;o++)typeof t[o]=="string"?n.add(t[o]):A(t[o]).forEach(function(g){return n.add(g)})})},e.prototype.intersect=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if(t.length===0)return this;t=t.map(function(o){return A(o)});var n=[];return this.forEach(function(o){t.every(function(g){return g.includes(o)})||n.push(o)}),this.withMutations(function(o){n.forEach(function(g){o.remove(g)})})},e.prototype.subtract=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if(t.length===0)return this;t=t.map(function(o){return A(o)});var n=[];return this.forEach(function(o){t.some(function(g){return g.includes(o)})&&n.push(o)}),this.withMutations(function(o){n.forEach(function(g){o.remove(g)})})},e.prototype.sort=function(t){return IH(NN(this,t))},e.prototype.sortBy=function(t,i){return IH(NN(this,i,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(t,i){var n=this;return this._map.__iterate(function(o){return t(o,o,n)},i)},e.prototype.__iterator=function(t,i){return this._map.__iterator(t,i)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var i=this._map.__ensureOwner(t);return t?this.__make(i,t):this.size===0?this.__empty():(this.__ownerID=t,this._map=i,this)},e}(bN);Iq.isSet=rhA;var Ia=Iq.prototype;Ia[_ae]=!0,Ia[TS]=Ia.remove,Ia.merge=Ia.concat=Ia.union,Ia.withMutations=PS,Ia.asImmutable=AH,Ia["@@transducer/init"]=Ia.asMutable=$S,Ia["@@transducer/step"]=function(A,e){return A.add(e)},Ia["@@transducer/result"]=function(A){return A.asImmutable()},Ia.__empty=sH,Ia.__make=jae;function Cq(A,e){return A.__ownerID?(A.size=e.size,A._map=e,A):e===A._map?A:e.size===0?A.__empty():A.__make(e)}function jae(A,e){var t=Object.create(Ia);return t.size=A?A.size:0,t._map=A,t.__ownerID=e,t}var Pae;function sH(){return Pae||(Pae=jae(IE()))}var fWt=function(A){function e(t,i,n){if(n===void 0&&(n=1),!(this instanceof e))return new e(t,i,n);if(qS(n!==0,"Cannot step a Range by 0"),qS(t!==void 0,"You must define a start value when using Range"),qS(i!==void 0,"You must define an end value when using Range"),n=Math.abs(n),i<t&&(n=-n),this._start=t,this._end=i,this._step=n,this.size=Math.max(0,Math.ceil((i-t)/n-1)+1),this.size===0){if(IhA)return IhA;IhA=this}}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"},e.prototype.get=function(t,i){return this.has(t)?this._start+u0(this,t)*this._step:i},e.prototype.includes=function(t){var i=(t-this._start)/this._step;return i>=0&&i<this.size&&i===Math.floor(i)},e.prototype.slice=function(t,i){return OO(t,i,this.size)?this:(t=_S(t,this.size),i=qO(i,this.size),i<=t?new e(0,0):new e(this.get(t,this._end),this.get(i,this._end),this._step))},e.prototype.indexOf=function(t){var i=t-this._start;if(i%this._step===0){var n=i/this._step;if(n>=0&&n<this.size)return n}return-1},e.prototype.lastIndexOf=function(t){return this.indexOf(t)},e.prototype.__iterate=function(t,i){for(var n=this.size,o=this._step,g=i?this._start+(n-1)*o:this._start,a=0;a!==n&&t(g,i?n-++a:a++,this)!==!1;)g+=i?-o:o;return a},e.prototype.__iterator=function(t,i){var n=this.size,o=this._step,g=i?this._start+(n-1)*o:this._start,a=0;return new ii(function(){if(a===n)return Ns();var s=g;return g+=i?-o:o,Wn(t,i?n-++a:a++,s)})},e.prototype.equals=function(t){return t instanceof e?this._start===t._start&&this._end===t._end&&this._step===t._step:qae(this,t)},e}(aB),IhA;function $ae(A,e,t){for(var i=wae(e),n=0;n!==i.length;)if(A=Dae(A,i[n++],Xt),A===Xt)return t;return A}function Ase(A,e){return $ae(this,A,e)}function yWt(A,e){return $ae(A,e,Xt)!==Xt}function bWt(A){return yWt(this,A)}function ese(){XI(this.size);var A={};return this.__iterate(function(e,t){A[t]=e}),A}Xa.Iterator=ii,Gw(Xa,{toArray:function(){XI(this.size);var A=new Array(this.size||0),e=Zn(this),t=0;return this.__iterate(function(i,n){A[t++]=e?[n,i]:i}),A},toIndexedSeq:function(){return new Bae(this)},toJS:function(){return rq(this)},toKeyedSeq:function(){return new tq(this,!0)},toMap:function(){return RN(this.toKeyedSeq())},toObject:ese,toOrderedMap:function(){return CE(this.toKeyedSeq())},toOrderedSet:function(){return IH(Zn(this)?this.valueSeq():this)},toSet:function(){return Iq(Zn(this)?this.valueSeq():this)},toSetSeq:function(){return new Qae(this)},toSeq:function(){return wl(this)?this.toIndexedSeq():Zn(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return shA(Zn(this)?this.valueSeq():this)},toList:function(){return gq(Zn(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(A,e){return this.size===0?A+e:A+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var A=[],e=arguments.length;e--;)A[e]=arguments[e];return Pi(this,AWt(this,A))},includes:function(A){return this.some(function(e){return UI(e,A)})},entries:function(){return this.__iterator(KI)},every:function(A,e){XI(this.size);var t=!0;return this.__iterate(function(i,n,o){if(!A.call(e,i,n,o))return t=!1,!1}),t},filter:function(A,e){return Pi(this,hae(this,A,e,!0))},partition:function(A,e){return jZt(this,A,e)},find:function(A,e,t){var i=this.findEntry(A,e);return i?i[1]:t},forEach:function(A,e){return XI(this.size),this.__iterate(e?A.bind(e):A)},join:function(A){XI(this.size),A=A!==void 0?""+A:",";var e="",t=!0;return this.__iterate(function(i){t?t=!1:e+=A,e+=i!=null?i.toString():""}),e},keys:function(){return this.__iterator(DN)},map:function(A,e){return Pi(this,dae(this,A,e))},reduce:function(A,e,t){return tse(this,A,e,t,arguments.length<2,!1)},reduceRight:function(A,e,t){return tse(this,A,e,t,arguments.length<2,!0)},reverse:function(){return Pi(this,KdA(this,!0))},slice:function(A,e){return Pi(this,UdA(this,A,e,!0))},some:function(A,e){XI(this.size);var t=!1;return this.__iterate(function(i,n,o){if(A.call(e,i,n,o))return t=!0,!1}),t},sort:function(A){return Pi(this,NN(this,A))},values:function(){return this.__iterator(WI)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(A,e){return yN(A?this.toSeq().filter(A,e):this)},countBy:function(A,e){return OZt(this,A,e)},equals:function(A){return qae(this,A)},entrySeq:function(){var A=this;if(A._cache)return new JN(A._cache);var e=A.toSeq().map(DWt).toIndexedSeq();return e.fromEntrySeq=function(){return A.toSeq()},e},filterNot:function(A,e){return this.filter(ChA(A),e)},findEntry:function(A,e,t){var i=t;return this.__iterate(function(n,o,g){if(A.call(e,n,o,g))return i=[o,n],!1}),i},findKey:function(A,e){var t=this.findEntry(A,e);return t&&t[0]},findLast:function(A,e,t){return this.toKeyedSeq().reverse().find(A,e,t)},findLastEntry:function(A,e,t){return this.toKeyedSeq().reverse().findEntry(A,e,t)},findLastKey:function(A,e){return this.toKeyedSeq().reverse().findKey(A,e)},first:function(A){return this.find(_ge,null,A)},flatMap:function(A,e){return Pi(this,eWt(this,A,e))},flatten:function(A){return Pi(this,pae(this,A,!0))},fromEntrySeq:function(){return new Eae(this)},get:function(A,e){return this.find(function(t,i){return UI(i,A)},void 0,e)},getIn:Ase,groupBy:function(A,e){return qZt(this,A,e)},has:function(A){return this.get(A,Xt)!==Xt},hasIn:bWt,isSubset:function(A){return A=typeof A.includes=="function"?A:Xa(A),this.every(function(e){return A.includes(e)})},isSuperset:function(A){return A=typeof A.isSubset=="function"?A:Xa(A),A.isSubset(this)},keyOf:function(A){return this.findKey(function(e){return UI(e,A)})},keySeq:function(){return this.toSeq().map(wWt).toIndexedSeq()},last:function(A){return this.toSeq().reverse().first(A)},lastKeyOf:function(A){return this.toKeyedSeq().reverse().keyOf(A)},max:function(A){return iq(this,A)},maxBy:function(A,e){return iq(this,e,A)},min:function(A){return iq(this,A?ise(A):ose)},minBy:function(A,e){return iq(this,e?ise(e):ose,A)},rest:function(){return this.slice(1)},skip:function(A){return A===0?this:this.slice(Math.max(0,A))},skipLast:function(A){return A===0?this:this.slice(0,-Math.max(0,A))},skipWhile:function(A,e){return Pi(this,mae(this,A,e,!0))},skipUntil:function(A,e){return this.skipWhile(ChA(A),e)},sortBy:function(A,e){return Pi(this,NN(this,e,A))},take:function(A){return this.slice(0,Math.max(0,A))},takeLast:function(A){return this.slice(-Math.max(0,A))},takeWhile:function(A,e){return Pi(this,PZt(this,A,e))},takeUntil:function(A,e){return this.takeWhile(ChA(A),e)},update:function(A){return A(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=GWt(this))}});var za=Xa.prototype;za[jge]=!0,za[$O]=za.values,za.toJSON=za.toArray,za.__toStringMapper=jS,za.inspect=za.toSource=function(){return this.toString()},za.chain=za.flatMap,za.contains=za.includes,Gw(Dl,{flip:function(){return Pi(this,uae(this))},mapEntries:function(A,e){var t=this,i=0;return Pi(this,this.toSeq().map(function(n,o){return A.call(e,[o,n],i++,t)}).fromEntrySeq())},mapKeys:function(A,e){var t=this;return Pi(this,this.toSeq().flip().map(function(i,n){return A.call(e,i,n,t)}).flip())}});var rH=Dl.prototype;rH[jO]=!0,rH[$O]=za.entries,rH.toJSON=ese,rH.__toStringMapper=function(A,e){return jS(e)+": "+jS(A)},Gw(ww,{toKeyedSeq:function(){return new tq(this,!1)},filter:function(A,e){return Pi(this,hae(this,A,e,!1))},findIndex:function(A,e){var t=this.findEntry(A,e);return t?t[0]:-1},indexOf:function(A){var e=this.keyOf(A);return e===void 0?-1:e},lastIndexOf:function(A){var e=this.lastKeyOf(A);return e===void 0?-1:e},reverse:function(){return Pi(this,KdA(this,!1))},slice:function(A,e){return Pi(this,UdA(this,A,e,!1))},splice:function(A,e){var t=arguments.length;if(e=Math.max(e||0,0),t===0||t===2&&!e)return this;A=_S(A,A<0?this.count():this.size);var i=this.slice(0,A);return Pi(this,t===1?i:i.concat(rE(arguments,2),this.slice(A+e)))},findLastIndex:function(A,e){var t=this.findLastEntry(A,e);return t?t[0]:-1},first:function(A){return this.get(0,A)},flatten:function(A){return Pi(this,pae(this,A,!1))},get:function(A,e){return A=u0(this,A),A<0||this.size===1/0||this.size!==void 0&&A>this.size?e:this.find(function(t,i){return i===A},void 0,e)},has:function(A){return A=u0(this,A),A>=0&&(this.size!==void 0?this.size===1/0||A<this.size:this.indexOf(A)!==-1)},interpose:function(A){return Pi(this,tWt(this,A))},interleave:function(){var A=[this].concat(rE(arguments)),e=nq(this.toSeq(),aB.of,A),t=e.flatten(!0);return e.size&&(t.size=e.size*A.length),Pi(this,t)},keySeq:function(){return fWt(0,this.size)},last:function(A){return this.get(-1,A)},skipWhile:function(A,e){return Pi(this,mae(this,A,e,!1))},zip:function(){var A=[this].concat(rE(arguments));return Pi(this,nq(this,nse,A))},zipAll:function(){var A=[this].concat(rE(arguments));return Pi(this,nq(this,nse,A,!0))},zipWith:function(A){var e=rE(arguments);return e[0]=this,Pi(this,nq(this,A,e))}});var vN=ww.prototype;vN[PO]=!0,vN[d0]=!0,Gw(bN,{get:function(A,e){return this.has(A)?A:e},includes:function(A){return this.has(A)},keySeq:function(){return this.valueSeq()}});var LN=bN.prototype;LN.has=za.includes,LN.contains=LN.includes,LN.keys=LN.values,Gw(h0,rH),Gw(aB,vN),Gw(kN,LN);function tse(A,e,t,i,n,o){return XI(A.size),A.__iterate(function(g,a,s){n?(n=!1,t=g):t=e.call(i,t,g,a,s)},o),t}function wWt(A,e){return e}function DWt(A,e){return[e,A]}function ChA(A){return function(){return!A.apply(this,arguments)}}function ise(A){return function(){return-A.apply(this,arguments)}}function nse(){return rE(arguments)}function ose(A,e){return A<e?1:A>e?-1:0}function GWt(A){if(A.size===1/0)return 0;var e=aE(A),t=Zn(A),i=e?1:0;return A.__iterate(t?e?function(n,o){i=31*i+gse(VI(n),VI(o))|0}:function(n,o){i=i+gse(VI(n),VI(o))|0}:e?function(n){i=31*i+VI(n)|0}:function(n){i=i+VI(n)|0}),kWt(A.size,i)}function kWt(A,e){return e=OS(e,3432918353),e=OS(e<<15|e>>>-15,461845907),e=OS(e<<13|e>>>-13,5),e=(e+3864292196|0)^A,e=OS(e^e>>>16,2246822507),e=OS(e^e>>>13,3266489909),e=eq(e^e>>>16),e}function gse(A,e){return A^e+2654435769+(A<<6)+(A>>2)|0}var IH=function(A){function e(t){return t==null?lhA():Oae(t)?t:lhA().withMutations(function(i){var n=bN(t);XI(n.size),n.forEach(function(o){return i.add(o)})})}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(Dl(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Iq);IH.isOrderedSet=Oae;var kw=IH.prototype;kw[d0]=!0,kw.zip=vN.zip,kw.zipWith=vN.zipWith,kw.zipAll=vN.zipAll,kw.__empty=lhA,kw.__make=ase;function ase(A,e){var t=Object.create(kw);return t.size=A?A.size:0,t._map=A,t.__ownerID=e,t}var sse;function lhA(){return sse||(sse=ase(gH()))}function JWt(A){if(wN(A))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(gE(A))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(A===null||typeof A!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var Ng=function(A,e){var t;JWt(A);var i=function(o){var g=this;if(o instanceof i)return o;if(!(this instanceof i))return new i(o);if(!t){t=!0;var a=Object.keys(A),s=n._indices={};n._name=e,n._keys=a,n._defaultValues=A;for(var I=0;I<a.length;I++){var r=a[I];s[r]=I,n[r]?typeof console=="object"&&console.warn&&console.warn("Cannot define "+BhA(this)+' with property "'+r+'" since that property name is part of the Record API.'):NWt(n,r)}}return this.__ownerID=void 0,this._values=gq().withMutations(function(C){C.setSize(g._keys.length),Dl(o).forEach(function(l,c){C.set(g._indices[c],l===g._defaultValues[c]?void 0:l)})}),this},n=i.prototype=Object.create(cn);return n.constructor=i,e&&(i.displayName=e),i};Ng.prototype.toString=function(){for(var A=BhA(this)+" { ",e=this._keys,t,i=0,n=e.length;i!==n;i++)t=e[i],A+=(i?", ":"")+t+": "+jS(this.get(t));return A+" }"},Ng.prototype.equals=function(A){return this===A||wN(A)&&SN(this).equals(SN(A))},Ng.prototype.hashCode=function(){return SN(this).hashCode()},Ng.prototype.has=function(A){return this._indices.hasOwnProperty(A)},Ng.prototype.get=function(A,e){if(!this.has(A))return e;var t=this._indices[A],i=this._values.get(t);return i===void 0?this._defaultValues[A]:i},Ng.prototype.set=function(A,e){if(this.has(A)){var t=this._values.set(this._indices[A],e===this._defaultValues[A]?void 0:e);if(t!==this._values&&!this.__ownerID)return chA(this,t)}return this},Ng.prototype.remove=function(A){return this.set(A)},Ng.prototype.clear=function(){var A=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:chA(this,A)},Ng.prototype.wasAltered=function(){return this._values.wasAltered()},Ng.prototype.toSeq=function(){return SN(this)},Ng.prototype.toJS=function(){return rq(this)},Ng.prototype.entries=function(){return this.__iterator(KI)},Ng.prototype.__iterator=function(A,e){return SN(this).__iterator(A,e)},Ng.prototype.__iterate=function(A,e){return SN(this).__iterate(A,e)},Ng.prototype.__ensureOwner=function(A){if(A===this.__ownerID)return this;var e=this._values.__ensureOwner(A);return A?chA(this,e,A):(this.__ownerID=A,this._values=e,this)},Ng.isRecord=wN,Ng.getDescriptiveName=BhA;var cn=Ng.prototype;cn[$ge]=!0,cn[TS]=cn.remove,cn.deleteIn=cn.removeIn=TdA,cn.getIn=Ase,cn.hasIn=za.hasIn,cn.merge=Jae,cn.mergeWith=Nae,cn.mergeIn=PdA,cn.mergeDeep=Rae,cn.mergeDeepWith=xae,cn.mergeDeepIn=$dA,cn.setIn=zdA,cn.update=_dA,cn.updateIn=OdA,cn.withMutations=PS,cn.asMutable=$S,cn.asImmutable=AH,cn[$O]=cn.entries,cn.toJSON=cn.toObject=za.toObject,cn.inspect=cn.toSource=function(){return this.toString()};function chA(A,e,t){var i=Object.create(Object.getPrototypeOf(A));return i._values=e,i.__ownerID=t,i}function BhA(A){return A.constructor.displayName||A.constructor.name||"Record"}function SN(A){return xdA(A._keys.map(function(e){return[e,A.get(e)]}))}function NWt(A,e){try{Object.defineProperty(A,e,{get:function(){return this.get(e)},set:function(t){qS(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch{}}class HN{constructor(e){ai(this,"tree"),this.tree=e||CE()}static create(){return new HN}get(e){return this.tree.has(e)?this.tree.get(e):null}set(e,t){const i=this.tree.set(e,t);return new HN(i)}slice(e,t){const i=[];for(let n=e;n<t;n++)i.push(this.get(n));return i}putIn(e,t){let i=this.tree;for(let n=0;n<t.length;n++)i=i.set(e+n,t[n]);return new HN(i)}}const QhA=an.div`
    margin-block: 1em;

    > .btn-grp {
        display: flex;
        flex-direction: row;
        margin-block: 1em;

        > * {
            margin-inline-start: 0.6em;

            &:first-child {
                margin-inline-start: 0;
            }
        }
    }
`,EhA=an.div`
    display: flex;
    flex-direction: column;
    max-height: 30vh;
    overflow-y: scroll;
`,CH=an.div`
    display: flex;
    & > input,
    & > *[for] {
        cursor: pointer;
    }
    & > * {
        padding-block: 0.6em;
        padding-inline: 0.2em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        user-select: none;
        border-bottom: 0.8px solid hsl(var(--border));
        flex-shink: 0;
    }
    & > *:first-child {
        width: 4em;
    }
    & > *:last-child {
        width: max-content;
    }
    & > *:first-child + * {
        flex: 1;
    }
`,YWt=an.div`
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
`,RWt=an.div`
    display: flex;
    padding-block: 1em;
    width: 100%;

    > .calendar-input {
        width: 100%;
    }

    > .calendar-input:first-child {
        margin-right: 0.5em;
    }

    > .calendar-input:last-child {
        margin-left: 0.5em;
    }
`,xWt=an.div``,FWt=an.div``,MWt=A=>{const{currentNum:e,totalNum:t,onChange:i}=A;let n;return e===t?n=!0:e<t&&e>0?n="indeterminate":n=!1,A.loading?b.createElement(I9,{className:"h-4 w-4 text-muted-foreground"}):b.createElement(Bc,{checked:n,disabled:A.disabled,onCheckedChange:()=>i()})},lq=(A,e,t,i,n)=>{const{values:o,range:g,valuesMeta:a,selectedCount:s,displayOffset:I,keyword:r}=e,[C,l]=b.useState(!0),[c,B]=b.useState(null),E=Dy(A);return b.useEffect(()=>{l(!0);let u=!1;return sM(i,A,{values:o,range:g,valuesMeta:a,sortBy:t,selectedCount:s,timezoneDisplayOffset:I,keyword:r},n).then(d=>{u||(B(d),l(!1))}).catch(d=>{console.warn(d),!u&&(B(null),l(!1))}),()=>{u=!0}},[E,i,o,g,a,t,s,r,I]),[C?null:c,c]},cq=20,uhA=HN.create(),rse=(A,e,t,i,n,o)=>{var g,a,s,I;const r=p.useMemo(()=>{var V,X;return((V=A.rule)==null?void 0:V.type)==="not in"||((X=A.rule)==null?void 0:X.type)==="one of"?A.rule.value:[]},[A.fid,t]),[C]=lq(A,{values:!1,range:!1,selectedCount:r,valuesMeta:!0,displayOffset:o.displayOffset},"none",t,n),[l,c]=lq(A,{values:!1,range:!1,valuesMeta:!0,keyword:o.keyword},"none",t,n),[B,E]=p.useState(0);p.useEffect(()=>{C&&E(C.selectedCount)},[C]);const[u,d]=p.useState(uhA),f=p.useRef(u),w=p.useCallback(V=>{typeof V=="function"?f.current=V(f.current):f.current=V,d(f.current)},[]),y=p.useRef({}),G=p.useCallback(V=>{const X=Math.floor(V/cq);if(f.current.get(V)===null&&y.current[X]===void 0){const _=sM(t,A,{range:!1,values:!0,valuesMeta:!1,sortBy:e,valuesLimit:cq,valuesOffset:cq*X,timezoneDisplayOffset:o.displayOffset,keyword:o.keyword},n);y.current[X]=_,_.then(q=>{if(y.current[X]===_){const{values:$}=q;w(nA=>nA.putIn(X*cq,$))}})}},[t,A.fid,e,n,o.displayOffset,o.keyword]);p.useEffect(()=>{y.current={},w(HN.create()),G(0)},[G]);const R=u===uhA||!l,x=p.useMemo(()=>l!=null&&l.valuesMeta.distinctTotal?u:uhA,[u,l==null?void 0:l.valuesMeta.distinctTotal]),F=((g=A.rule)==null?void 0:g.type)==="one of"?A.rule.value.length:C&&((a=A.rule)==null?void 0:a.type)==="not in"?C.valuesMeta.distinctTotal-A.rule.value.length:0,Q=((s=A.rule)==null?void 0:s.type)==="one of"?B:C&&((I=A.rule)==null?void 0:I.type)==="not in"?C.valuesMeta.total-B:0,k=p.useCallback(()=>{!A.rule||A.rule.type!=="one of"&&A.rule.type!=="not in"||!C||(E(0),i({type:F===C.valuesMeta.distinctTotal?"one of":"not in",value:[]}))},[A.rule,i,C,F]),[h,N]=p.useState(!1),v=p.useCallback(async()=>{if(!(!A.rule||A.rule.type!=="one of"&&A.rule.type!=="not in"||!l)){if(!o.keyword){k();return}try{N(!0);const V=await sM(t,A,{range:!1,values:!0,valuesMeta:!1,sortBy:e,keyword:o.keyword,timezoneDisplayOffset:o.displayOffset},n),{values:X}=V;if(!X||X.length===0)return;const _=new Set(A.rule.value.map($=>tQ($)));let q=0;X.forEach($=>{_.has(tQ($.value))||(_.add(tQ($.value)),q+=$.count)}),q===0?(X.forEach($=>{_.delete(tQ($.value)),q+=$.count}),E($=>$-q)):E($=>$+q),i({type:A.rule.type,value:Array.from(_)})}finally{N(!1)}}},[A.rule,i,l,F,t,e,o.keyword,o.displayOffset,n,u]),K=p.useCallback(()=>{!A.rule||A.rule.type!=="one of"&&A.rule.type!=="not in"||!C||i({type:A.rule.type==="one of"?"not in":"one of",value:A.rule.value})},[A.rule,i,C]),U=p.useCallback((V,X,_)=>{if(!A.rule||A.rule.type!=="one of"&&A.rule.type!=="not in")return;const q=new Set(A.rule.value);X===(A.rule.type==="one of")?(E($=>$+_),q.add(V)):(E($=>$-_),q.delete(V)),i({type:A.rule.type,value:Array.from(q)})},[A.rule,i]);return{total:C==null?void 0:C.valuesMeta.total,distinctTotal:C==null?void 0:C.valuesMeta.distinctTotal,currentRows:c==null?void 0:c.valuesMeta.distinctTotal,currentCount:F,currentSum:Q,handleToggleFullOrEmptySet:k,handleToggleReverseSet:K,handleToggleCurrentFullSet:v,handleSelect:U,data:x,loadData:G,loading:!C,loadingPageData:R,loadingSelectAll:h}},vWt=A=>(p.useEffect(()=>{A.effect()},[A.effectId]),null);function dhA(A){return b.createElement(Tge,{content:A.label},b.createElement("div",{onClick:()=>{var e;(e=A.onChange)==null||e.call(A,!A.value)},className:lc(A.value?"bg-primary text-primary-foreground":"hover:bg-accent","rounded cursor-pointer p-1 w-6 h-6 flex items-center justify-center")},A.children))}const Ise=({config:{key:A,ascending:e},currentKey:t,setSortConfig:i,id:n})=>{const o=A===t;return b.createElement(fe,{id:n,variant:o?"secondary":"ghost",size:"icon-xs",className:lc("ml-2"),onClick:g=>{g.preventDefault(),i({key:t,ascending:o?!e:!0})}},o&&!e?b.createElement(dSe,{className:"h-4 w-4"}):b.createElement(DSe,{className:"h-4 w-4"}))},Cse=({active:A,field:e,onChange:t,allFields:i,displayOffset:n})=>{var o,g;const[a,s]=p.useState({key:"count",ascending:!0}),{t:I}=ve("translation"),r=Og();b.useEffect(()=>{var oA,tA;A&&((oA=e.rule)==null?void 0:oA.type)!=="one of"&&((tA=e.rule)==null?void 0:tA.type)!=="not in"&&t({type:"not in",value:[]})},[A,t,e]);const[C,l]=p.useState(""),[c,B]=p.useState(!1),[E,u]=p.useState(!1),[d,f]=p.useState(!1),w=p.useMemo(()=>C?{value:C,caseSenstive:c,word:E,regexp:d}:void 0,[C,c,E,d]),y=p.useMemo(()=>{const{timeout:oA,...tA}=ke.KEYWORD_DEBOUNCE_SETTING;return function(sA){return Ik(sA,oA,tA)}},[]),G=RiA(y)(w),R=e.semanticType==="nominal",x=R?G:void 0,{currentCount:F,currentSum:Q,distinctTotal:k,data:h,currentRows:N,handleSelect:v,handleToggleFullOrEmptySet:K,handleToggleCurrentFullSet:U,handleToggleReverseSet:V,loadData:X,loading:_,loadingPageData:q,loadingSelectAll:$}=rse(e,`${a.key}${a.ascending?"":"_dsc"}`,r,t,i,{displayOffset:n,keyword:x}),nA=q||w!==G,j=b.useRef(null),O=Nge({count:N??0,getScrollElement:()=>j.current,estimateSize:()=>32,overscan:10}),eA=p.useMemo(()=>{var oA;return e.rule&&(e.rule.type==="not in"||((oA=e.rule)==null?void 0:oA.type)==="one of")?new Set(e.rule.value.map(tA=>tQ(tA))):null},[e]);return((o=e.rule)==null?void 0:o.type)==="one of"||((g=e.rule)==null?void 0:g.type)==="not in"?b.createElement(QhA,null,b.createElement("div",null,I("constant.filter_type.one_of")),b.createElement("div",{className:"text-muted-foreground"},I("constant.filter_type.one_of_desc")),b.createElement("div",{className:"btn-grp"},b.createElement(fe,{variant:"outline",size:"sm",onClick:()=>K()},I(F===k?"filters.btn.unselect_all":"filters.btn.select_all")),b.createElement(fe,{variant:"outline",size:"sm",onClick:()=>V()},I("filters.btn.reverse"))),R&&b.createElement("div",{className:"relative"},b.createElement(oo,{className:"mb-2 pr-[88px]",type:"search",value:C,placeholder:"Search Value...",onChange:oA=>{l(oA.target.value)}}),b.createElement("div",{className:"absolute flex space-x-1 items-center inset-y-0 right-2"},b.createElement(dhA,{label:"Match Case",value:c,onChange:B},b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},b.createElement("path",{fill:"currentColor",d:"M8.854 11.702h-1l-.816-2.159H3.772l-.768 2.16H2L4.954 4h.935zm-2.111-2.97L5.534 5.45a3.142 3.142 0 0 1-.118-.515h-.021c-.036.218-.077.39-.124.515L4.073 8.732zm7.013 2.97h-.88v-.86h-.022c-.383.66-.947.99-1.692.99c-.548 0-.978-.146-1.29-.436c-.307-.29-.461-.675-.461-1.155c0-1.027.605-1.625 1.815-1.794l1.65-.23c0-.935-.379-1.403-1.134-1.403c-.663 0-1.26.226-1.794.677V6.59c.54-.344 1.164-.516 1.87-.516c1.292 0 1.938.684 1.938 2.052zm-.88-2.782l-1.327.183c-.409.057-.717.159-.924.306c-.208.143-.312.399-.312.768c0 .268.095.489.285.66c.193.169.45.253.768.253a1.41 1.41 0 0 0 1.08-.457c.286-.308.43-.696.43-1.165z"}))),b.createElement(dhA,{label:"Match Whole Word",value:E,onChange:u},b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},b.createElement("g",{fill:"currentColor"},b.createElement("path",{fillRule:"evenodd",d:"M0 11h1v2h14v-2h1v3H0z",clipRule:"evenodd"}),b.createElement("path",{d:"M6.84 11h-.88v-.86h-.022c-.383.66-.947.989-1.692.989c-.548 0-.977-.145-1.289-.435c-.308-.29-.462-.675-.462-1.155c0-1.028.605-1.626 1.816-1.794l1.649-.23c0-.935-.378-1.403-1.134-1.403c-.662 0-1.26.226-1.794.677v-.902c.541-.344 1.164-.516 1.87-.516c1.292 0 1.938.684 1.938 2.052zm-.88-2.782L4.633 8.4c-.408.058-.716.16-.924.307c-.208.143-.311.399-.311.768c0 .268.095.488.284.66c.194.168.45.253.768.253a1.41 1.41 0 0 0 1.08-.457c.286-.308.43-.696.43-1.165zm3.388 1.987h-.022V11h-.88V2.857h.88v3.61h.021c.434-.73 1.068-1.096 1.902-1.096c.705 0 1.257.247 1.654.741c.401.49.602 1.15.602 1.977c0 .92-.224 1.658-.672 2.213c-.447.551-1.06.827-1.837.827c-.726 0-1.276-.308-1.649-.924m-.022-2.218v.768c0 .455.147.841.44 1.16c.298.315.674.473 1.128.473c.534 0 .951-.204 1.252-.613c.304-.408.456-.975.456-1.702c0-.613-.141-1.092-.424-1.44c-.283-.347-.666-.52-1.15-.52c-.511 0-.923.178-1.235.536c-.311.355-.467.8-.467 1.338"})))),b.createElement(dhA,{label:"Use Regular Expression",value:d,onChange:f},b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},b.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.012 2h.976v3.113l2.56-1.557l.486.885L11.47 6l2.564 1.559l-.485.885l-2.561-1.557V10h-.976V6.887l-2.56 1.557l-.486-.885L9.53 6L6.966 4.441l.485-.885l2.561 1.557zM2 10h4v4H2z",clipRule:"evenodd"}))))),b.createElement("div",{className:"relative"},b.createElement(EhA,null,b.createElement(CH,null,b.createElement("div",{className:"flex justify-center items-center"},b.createElement(MWt,{currentNum:F,totalNum:k??0,onChange:U,loading:$})),b.createElement("div",{className:"header text-muted-foreground flex items-center"},b.createElement("label",{htmlFor:"value_sort"},I("filters.header.value")),b.createElement(Ise,{id:"value_sort",currentKey:"value",setSortConfig:s,config:a})),b.createElement("div",{className:"header text-muted-foreground flex items-center"},b.createElement("label",{htmlFor:"count_sort"},I("filters.header.count")),b.createElement(Ise,{id:"count_sort",currentKey:"count",setSortConfig:s,config:a})))),_&&b.createElement("div",{className:"h-24 w-full relative"},b.createElement(nr,null)),!_&&b.createElement(EhA,{ref:j},nA&&O.getTotalSize()===0&&b.createElement(nr,null),nA&&b.createElement("div",{style:{paddingBottom:`${O.getTotalSize()}px`,width:"100%",position:"relative"}},O.getVirtualItems().map(oA=>b.createElement(CH,{key:oA.index,className:"animate-pulse",style:{height:`${oA.size}px`,transform:`translateY(${oA.start}px)`,position:"absolute",top:0,left:0,width:"100%"}},b.createElement("div",{className:"flex justify-center items-center"},b.createElement(fN,{className:"h-4 w-4"})),b.createElement("div",{className:"flex justify-left items-center"},b.createElement(fN,{className:"h-3 w-20"})),b.createElement("div",{className:"flex justify-right items-center"},b.createElement(fN,{className:"h-3 w-6"}))))),!nA&&b.createElement("div",{style:{paddingBottom:`${O.getTotalSize()}px`,width:"100%",position:"relative"}},O.getVirtualItems().map(oA=>{var tA,sA;const gA=oA.index,iA=h==null?void 0:h.get(gA);if(!iA)return b.createElement(CH,{key:gA,className:"animate-pulse",style:{height:`${oA.size}px`,transform:`translateY(${oA.start}px)`,position:"absolute",top:0,left:0,width:"100%"}},b.createElement("div",{className:"flex justify-center items-center"},b.createElement(fN,{className:"h-4 w-4"})),b.createElement("div",{className:"flex justify-left items-center"},b.createElement(fN,{className:"h-3 w-20"})),b.createElement("div",{className:"flex justify-right items-center"},b.createElement(fN,{className:"h-3 w-6"})),b.createElement(vWt,{effect:()=>X(gA),effectId:`${e.fid}_${a.key}${a.ascending?"":"_dsc"}_${gA}`}));const{value:aA,count:lA}=iA,CA=`rule_checkbox_${gA}`,QA=!!eA&&((tA=e.rule)==null?void 0:tA.type)==="one of"&&eA.has(tQ(aA))||!!eA&&((sA=e.rule)==null?void 0:sA.type)==="not in"&&!eA.has(tQ(aA)),uA=e.semanticType==="temporal"?Uu(Sm(n,e.offset)(aA)):`${aA}`;return b.createElement(CH,{key:gA,style:{height:`${oA.size}px`,transform:`translateY(${oA.start}px)`,position:"absolute",top:0,left:0,width:"100%"}},b.createElement("div",{className:"flex justify-center items-center"},b.createElement(Bc,{className:"h-4 w-4",checked:QA,id:CA,"aria-describedby":`${CA}_label`,title:uA,onCheckedChange:fA=>v(aA,!!fA,lA)})),b.createElement("label",{id:`${CA}_label`,htmlFor:CA,title:uA},uA),b.createElement("label",{htmlFor:CA},lA))}))),xi(k)&&b.createElement(EhA,{className:"text-muted-foreground"},b.createElement(CH,null,b.createElement("label",null),b.createElement("label",null,I("filters.selected_keys",{count:F})),b.createElement("label",null,Q))))):null},Bq=A=>{const{min:e,max:t,value:i,onChange:n,displayOffset:o}=A,g=s=>{const I=mF(o)(s);return Number.isNaN(I.getTime())?"":Uu(I)},a=s=>{const I=mF(o)(s).getTime();I<=t&&I>=e&&n(I)};return b.createElement("input",{className:lc("dark:[color-scheme:dark] flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",A.className??""),type:"datetime-local",min:g(e),max:g(t),defaultValue:g(i),onChange:s=>a(s.target.value)})},LWt=({active:A,field:e,allFields:t,onChange:i,displayOffset:n})=>{var o;const{t:g}=ve("translation"),a=Og(),[s,I]=p.useState(()=>[0,0,"",!1]);b.useEffect(()=>{wWA(e,t,a,{timezoneDisplayOffset:n})(u=>DWA(u,e.fid,e.offset)).then(([u,d,f])=>I([u,d,f,!0]))},[e.fid]);const[r,C,l,c]=s,B=e.offset??new Date().getTimezoneOffset();b.useEffect(()=>{var u;A&&((u=e.rule)==null?void 0:u.type)!=="temporal range"&&c&&i({type:"temporal range",value:[r,C],format:l,offset:B})},[i,e,r,C,l,B,A]);const E=b.useCallback(u=>{i({type:"temporal range",value:u,format:l,offset:B})},[l,B]);return c?((o=e.rule)==null?void 0:o.type)==="temporal range"?b.createElement(QhA,{className:"overflow-visible"},b.createElement("div",null,g("constant.filter_type.temporal_range")),b.createElement("div",{className:"text-muted-foreground"},g("constant.filter_type.temporal_range_desc")),b.createElement(RWt,null,b.createElement("div",{className:"calendar-input"},b.createElement("div",{className:"my-1"},g("filters.range.start_value")),b.createElement(Bq,{displayOffset:n,min:r,max:e.rule.value[1]??C,value:e.rule.value[0]??r,onChange:u=>{var d;return E([u,(d=e.rule)==null?void 0:d.value[1]])}})),b.createElement("div",{className:"calendar-input"},b.createElement("div",{className:"my-1"},g("filters.range.end_value")),b.createElement(Bq,{displayOffset:n,min:e.rule.value[0]??r,max:C,value:e.rule.value[1]??C,onChange:u=>{var d;return E([(d=e.rule)==null?void 0:d.value[0],u])}})))):null:b.createElement("div",{className:"h-24 w-full relative"},b.createElement(nr,null))},SWt=({active:A,field:e,onChange:t,allFields:i,displayOffset:n})=>{var o;const{t:g}=ve("translation",{keyPrefix:"constant.filter_type"}),a=Og(),[s]=lq(e,{values:!1,range:!0,valuesMeta:!1,displayOffset:n},"none",a,i),I=s==null?void 0:s.range;b.useEffect(()=>{var C;I&&A&&((C=e.rule)==null?void 0:C.type)!=="range"&&t({type:"range",value:I})},[t,e,I,A]);const r=b.useCallback(C=>{t({type:"range",value:C})},[]);return I?((o=e.rule)==null?void 0:o.type)==="range"?b.createElement(QhA,null,b.createElement("div",null,g("range")),b.createElement("div",{className:"text-muted-foreground"},g("range_desc")),b.createElement(lZt,{min:I[0],max:I[1],value:e.rule.value,onChange:r})):null:b.createElement("div",{className:"h-24 w-full relative"},b.createElement(nr,null))},HWt={"one of":Cse,"not in":Cse,range:SWt,"temporal range":LWt},Qq={"one of":{key:"one_of",descKey:"one_of_desc"},range:{key:"range",descKey:"range_desc"},"temporal range":{key:"temporal_range",descKey:"temporal_range_desc"}},ZWt=A=>A==="not in"?"one of":A,Eq=({allFields:A,field:e,onChange:t,tabs:i,displayOffset:n})=>{var o;const{t:g}=ve("translation",{keyPrefix:"constant.filter_type"}),[a,s]=b.useState(ZWt((o=e.rule)==null?void 0:o.type)??i[0]);return b.useEffect(()=>{i.includes(a)||s(i[0])},[i]),b.createElement(YWt,null,b.createElement(_O,{value:a,onValueChange:I=>s(I)},i.map(I=>b.createElement("div",{className:"flex my-2",key:I},b.createElement("div",{className:"align-top"},b.createElement(zS,{id:I,value:I})),b.createElement("div",{className:"ml-3"},b.createElement(oE,{htmlFor:I},g(Qq[I].key)),b.createElement("div",{className:"text-muted-foreground"},g(Qq[I].descKey)))))),b.createElement("hr",{className:"my-0.5"}),b.createElement(xWt,null,i.map((I,r)=>{const C=HWt[I];return C?b.createElement(FWt,{key:r,id:`filter-panel-${Qq[I]}`,"aria-labelledby":`filter-tab-${Qq[I]}`,role:"tabpanel",hidden:a!==I,tabIndex:0},b.createElement(C,{displayOffset:n,field:e,onChange:t,active:a===I,allFields:A})):null})))};var WWt=[" ","Enter","ArrowUp","ArrowDown"],KWt=[" ","Enter"],Jw="Select",[uq,dq,UWt]=DV(Jw),[ZN,z0i]=Tg(Jw,[UWt,aQ]),hq=aQ(),[VWt,y0]=ZN(Jw),[XWt,zWt]=ZN(Jw),lse=A=>{const{__scopeSelect:e,children:t,open:i,defaultOpen:n,onOpenChange:o,value:g,defaultValue:a,onValueChange:s,dir:I,name:r,autoComplete:C,disabled:l,required:c,form:B}=A,E=hq(e),[u,d]=p.useState(null),[f,w]=p.useState(null),[y,G]=p.useState(!1),R=Ck(I),[x,F]=is({prop:i,defaultProp:n??!1,onChange:o,caller:Jw}),[Q,k]=is({prop:g,defaultProp:a,onChange:s,caller:Jw}),h=p.useRef(null),N=u?B||!!u.closest("form"):!0,[v,K]=p.useState(new Set),U=Array.from(v).map(V=>V.props.value).join(";");return cA(RF,{...E,children:Ic(VWt,{required:c,scope:e,trigger:u,onTriggerChange:d,valueNode:f,onValueNodeChange:w,valueNodeHasChildren:y,onValueNodeHasChildrenChange:G,contentId:_o(),value:Q,onValueChange:k,open:x,onOpenChange:F,dir:R,triggerPointerDownPosRef:h,disabled:l,children:[cA(uq.Provider,{scope:e,children:cA(XWt,{scope:A.__scopeSelect,onNativeOptionAdd:p.useCallback(V=>{K(X=>new Set(X).add(V))},[]),onNativeOptionRemove:p.useCallback(V=>{K(X=>{const _=new Set(X);return _.delete(V),_})},[]),children:t})}),N?Ic(vse,{"aria-hidden":!0,required:c,tabIndex:-1,name:r,autoComplete:C,value:Q,onChange:V=>k(V.target.value),disabled:l,form:B,children:[Q===void 0?cA("option",{value:""}):null,Array.from(v)]},U):null]})})};lse.displayName=Jw;var cse="SelectTrigger",Bse=p.forwardRef((A,e)=>{const{__scopeSelect:t,disabled:i=!1,...n}=A,o=hq(t),g=y0(cse,t),a=g.disabled||i,s=Te(e,g.onTriggerChange),I=dq(t),r=p.useRef("touch"),[C,l,c]=Sse(E=>{const u=I().filter(w=>!w.disabled),d=u.find(w=>w.value===g.value),f=Hse(u,E,d);f!==void 0&&g.onValueChange(f.value)}),B=E=>{a||(g.onOpenChange(!0),c()),E&&(g.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return cA(kk,{asChild:!0,...o,children:cA(re.button,{type:"button",role:"combobox","aria-controls":g.contentId,"aria-expanded":g.open,"aria-required":g.required,"aria-autocomplete":"none",dir:g.dir,"data-state":g.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Lse(g.value)?"":void 0,...n,ref:s,onClick:TA(n.onClick,E=>{E.currentTarget.focus(),r.current!=="mouse"&&B(E)}),onPointerDown:TA(n.onPointerDown,E=>{r.current=E.pointerType;const u=E.target;u.hasPointerCapture(E.pointerId)&&u.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(B(E),E.preventDefault())}),onKeyDown:TA(n.onKeyDown,E=>{const u=C.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&l(E.key),!(u&&E.key===" ")&&WWt.includes(E.key)&&(B(),E.preventDefault())})})})});Bse.displayName=cse;var Qse="SelectValue",Ese=p.forwardRef((A,e)=>{const{__scopeSelect:t,className:i,style:n,children:o,placeholder:g="",...a}=A,s=y0(Qse,t),{onValueNodeHasChildrenChange:I}=s,r=o!==void 0,C=Te(e,s.onValueNodeChange);return _g(()=>{I(r)},[I,r]),cA(re.span,{...a,ref:C,style:{pointerEvents:"none"},children:Lse(s.value)?cA(yy,{children:g}):o})});Ese.displayName=Qse;var TWt="SelectIcon",use=p.forwardRef((A,e)=>{const{__scopeSelect:t,children:i,...n}=A;return cA(re.span,{"aria-hidden":!0,...n,ref:e,children:i||"▼"})});use.displayName=TWt;var _Wt="SelectPortal",dse=A=>cA(Jk,{asChild:!0,...A});dse.displayName=_Wt;var Nw="SelectContent",hse=p.forwardRef((A,e)=>{const t=y0(Nw,A.__scopeSelect),[i,n]=p.useState();if(_g(()=>{n(new DocumentFragment)},[]),!t.open){const o=i;return o?bt.createPortal(cA(mse,{scope:A.__scopeSelect,children:cA(uq.Slot,{scope:A.__scopeSelect,children:cA("div",{children:A.children})})}),o):null}return cA(pse,{...A,ref:e})});hse.displayName=Nw;var sB=10,[mse,b0]=ZN(Nw),OWt="SelectContentImpl",qWt=Ym("SelectContent.RemoveScroll"),pse=p.forwardRef((A,e)=>{const{__scopeSelect:t,position:i="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:o,onPointerDownOutside:g,side:a,sideOffset:s,align:I,alignOffset:r,arrowPadding:C,collisionBoundary:l,collisionPadding:c,sticky:B,hideWhenDetached:E,avoidCollisions:u,...d}=A,f=y0(Nw,t),[w,y]=p.useState(null),[G,R]=p.useState(null),x=Te(e,sA=>y(sA)),[F,Q]=p.useState(null),[k,h]=p.useState(null),N=dq(t),[v,K]=p.useState(!1),U=p.useRef(!1);p.useEffect(()=>{if(w)return sX(w)},[w]),qV();const V=p.useCallback(sA=>{const[gA,...iA]=N().map(CA=>CA.ref.current),[aA]=iA.slice(-1),lA=document.activeElement;for(const CA of sA)if(CA===lA||(CA==null||CA.scrollIntoView({block:"nearest"}),CA===gA&&G&&(G.scrollTop=0),CA===aA&&G&&(G.scrollTop=G.scrollHeight),CA==null||CA.focus(),document.activeElement!==lA))return},[N,G]),X=p.useCallback(()=>V([F,w]),[V,F,w]);p.useEffect(()=>{v&&X()},[v,X]);const{onOpenChange:_,triggerPointerDownPosRef:q}=f;p.useEffect(()=>{if(w){let sA={x:0,y:0};const gA=aA=>{var lA,CA;sA={x:Math.abs(Math.round(aA.pageX)-(((lA=q.current)==null?void 0:lA.x)??0)),y:Math.abs(Math.round(aA.pageY)-(((CA=q.current)==null?void 0:CA.y)??0))}},iA=aA=>{sA.x<=10&&sA.y<=10?aA.preventDefault():w.contains(aA.target)||_(!1),document.removeEventListener("pointermove",gA),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",gA),document.addEventListener("pointerup",iA,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",gA),document.removeEventListener("pointerup",iA,{capture:!0})}}},[w,_,q]),p.useEffect(()=>{const sA=()=>_(!1);return window.addEventListener("blur",sA),window.addEventListener("resize",sA),()=>{window.removeEventListener("blur",sA),window.removeEventListener("resize",sA)}},[_]);const[$,nA]=Sse(sA=>{const gA=N().filter(lA=>!lA.disabled),iA=gA.find(lA=>lA.ref.current===document.activeElement),aA=Hse(gA,sA,iA);aA&&setTimeout(()=>aA.ref.current.focus())}),j=p.useCallback((sA,gA,iA)=>{const aA=!U.current&&!iA;(f.value!==void 0&&f.value===gA||aA)&&(Q(sA),aA&&(U.current=!0))},[f.value]),O=p.useCallback(()=>w==null?void 0:w.focus(),[w]),eA=p.useCallback((sA,gA,iA)=>{const aA=!U.current&&!iA;(f.value!==void 0&&f.value===gA||aA)&&h(sA)},[f.value]),oA=i==="popper"?hhA:fse,tA=oA===hhA?{side:a,sideOffset:s,align:I,alignOffset:r,arrowPadding:C,collisionBoundary:l,collisionPadding:c,sticky:B,hideWhenDetached:E,avoidCollisions:u}:{};return cA(mse,{scope:t,content:w,viewport:G,onViewportChange:R,itemRefCallback:j,selectedItem:F,onItemLeave:O,itemTextRefCallback:eA,focusSelectedItem:X,selectedItemText:k,position:i,isPositioned:v,searchRef:$,children:cA(QX,{as:qWt,allowPinchZoom:!0,children:cA(kF,{asChild:!0,trapped:f.open,onMountAutoFocus:sA=>{sA.preventDefault()},onUnmountAutoFocus:TA(n,sA=>{var gA;(gA=f.trigger)==null||gA.focus({preventScroll:!0}),sA.preventDefault()}),children:cA(Ny,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:g,onFocusOutside:sA=>sA.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:cA(oA,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:sA=>sA.preventDefault(),...d,...tA,onPlaced:()=>K(!0),ref:x,style:{display:"flex",flexDirection:"column",outline:"none",...d.style},onKeyDown:TA(d.onKeyDown,sA=>{const gA=sA.ctrlKey||sA.altKey||sA.metaKey;if(sA.key==="Tab"&&sA.preventDefault(),!gA&&sA.key.length===1&&nA(sA.key),["ArrowUp","ArrowDown","Home","End"].includes(sA.key)){let iA=N().filter(aA=>!aA.disabled).map(aA=>aA.ref.current);if(["ArrowUp","End"].includes(sA.key)&&(iA=iA.slice().reverse()),["ArrowUp","ArrowDown"].includes(sA.key)){const aA=sA.target,lA=iA.indexOf(aA);iA=iA.slice(lA+1)}setTimeout(()=>V(iA)),sA.preventDefault()}})})})})})})});pse.displayName=OWt;var jWt="SelectItemAlignedPosition",fse=p.forwardRef((A,e)=>{const{__scopeSelect:t,onPlaced:i,...n}=A,o=y0(Nw,t),g=b0(Nw,t),[a,s]=p.useState(null),[I,r]=p.useState(null),C=Te(e,x=>r(x)),l=dq(t),c=p.useRef(!1),B=p.useRef(!0),{viewport:E,selectedItem:u,selectedItemText:d,focusSelectedItem:f}=g,w=p.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&I&&E&&u&&d){const x=o.trigger.getBoundingClientRect(),F=I.getBoundingClientRect(),Q=o.valueNode.getBoundingClientRect(),k=d.getBoundingClientRect();if(o.dir!=="rtl"){const aA=k.left-F.left,lA=Q.left-aA,CA=x.left-lA,QA=x.width+CA,uA=Math.max(QA,F.width),fA=window.innerWidth-sB,hA=wV(lA,[sB,Math.max(sB,fA-uA)]);a.style.minWidth=QA+"px",a.style.left=hA+"px"}else{const aA=F.right-k.right,lA=window.innerWidth-Q.right-aA,CA=window.innerWidth-x.right-lA,QA=x.width+CA,uA=Math.max(QA,F.width),fA=window.innerWidth-sB,hA=wV(lA,[sB,Math.max(sB,fA-uA)]);a.style.minWidth=QA+"px",a.style.right=hA+"px"}const h=l(),N=window.innerHeight-sB*2,v=E.scrollHeight,K=window.getComputedStyle(I),U=parseInt(K.borderTopWidth,10),V=parseInt(K.paddingTop,10),X=parseInt(K.borderBottomWidth,10),_=parseInt(K.paddingBottom,10),q=U+V+v+_+X,$=Math.min(u.offsetHeight*5,q),nA=window.getComputedStyle(E),j=parseInt(nA.paddingTop,10),O=parseInt(nA.paddingBottom,10),eA=x.top+x.height/2-sB,oA=N-eA,tA=u.offsetHeight/2,sA=u.offsetTop+tA,gA=U+V+sA,iA=q-gA;if(gA<=eA){const aA=h.length>0&&u===h[h.length-1].ref.current;a.style.bottom="0px";const lA=I.clientHeight-E.offsetTop-E.offsetHeight,CA=Math.max(oA,tA+(aA?O:0)+lA+X),QA=gA+CA;a.style.height=QA+"px"}else{const aA=h.length>0&&u===h[0].ref.current;a.style.top="0px";const lA=Math.max(eA,U+E.offsetTop+(aA?j:0)+tA)+iA;a.style.height=lA+"px",E.scrollTop=gA-eA+E.offsetTop}a.style.margin=`${sB}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=N+"px",i==null||i(),requestAnimationFrame(()=>c.current=!0)}},[l,o.trigger,o.valueNode,a,I,E,u,d,o.dir,i]);_g(()=>w(),[w]);const[y,G]=p.useState();_g(()=>{I&&G(window.getComputedStyle(I).zIndex)},[I]);const R=p.useCallback(x=>{x&&B.current===!0&&(w(),f==null||f(),B.current=!1)},[w,f]);return cA($Wt,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:c,onScrollButtonChange:R,children:cA("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:y},children:cA(re.div,{...n,ref:C,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});fse.displayName=jWt;var PWt="SelectPopperPosition",hhA=p.forwardRef((A,e)=>{const{__scopeSelect:t,align:i="start",collisionPadding:n=sB,...o}=A,g=hq(t);return cA(xF,{...g,...o,ref:e,align:i,collisionPadding:n,style:{boxSizing:"border-box",...o.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)"}})});hhA.displayName=PWt;var[$Wt,mhA]=ZN(Nw,{}),phA="SelectViewport",yse=p.forwardRef((A,e)=>{const{__scopeSelect:t,nonce:i,...n}=A,o=b0(phA,t),g=mhA(phA,t),a=Te(e,o.onViewportChange),s=p.useRef(0);return Ic(yy,{children:[cA("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:i}),cA(uq.Slot,{scope:t,children:cA(re.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:TA(n.onScroll,I=>{const r=I.currentTarget,{contentWrapper:C,shouldExpandOnScrollRef:l}=g;if(l!=null&&l.current&&C){const c=Math.abs(s.current-r.scrollTop);if(c>0){const B=window.innerHeight-sB*2,E=parseFloat(C.style.minHeight),u=parseFloat(C.style.height),d=Math.max(E,u);if(d<B){const f=d+c,w=Math.min(B,f),y=f-w;C.style.height=w+"px",C.style.bottom==="0px"&&(r.scrollTop=y>0?y:0,C.style.justifyContent="flex-end")}}}s.current=r.scrollTop})})})]})});yse.displayName=phA;var bse="SelectGroup",[A3t,e3t]=ZN(bse),t3t=p.forwardRef((A,e)=>{const{__scopeSelect:t,...i}=A,n=_o();return cA(A3t,{scope:t,id:n,children:cA(re.div,{role:"group","aria-labelledby":n,...i,ref:e})})});t3t.displayName=bse;var wse="SelectLabel",Dse=p.forwardRef((A,e)=>{const{__scopeSelect:t,...i}=A,n=e3t(wse,t);return cA(re.div,{id:n.id,...i,ref:e})});Dse.displayName=wse;var mq="SelectItem",[i3t,Gse]=ZN(mq),kse=p.forwardRef((A,e)=>{const{__scopeSelect:t,value:i,disabled:n=!1,textValue:o,...g}=A,a=y0(mq,t),s=b0(mq,t),I=a.value===i,[r,C]=p.useState(o??""),[l,c]=p.useState(!1),B=Te(e,f=>{var w;return(w=s.itemRefCallback)==null?void 0:w.call(s,f,i,n)}),E=_o(),u=p.useRef("touch"),d=()=>{n||(a.onValueChange(i),a.onOpenChange(!1))};if(i==="")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 cA(i3t,{scope:t,value:i,disabled:n,textId:E,isSelected:I,onItemTextChange:p.useCallback(f=>{C(w=>w||((f==null?void 0:f.textContent)??"").trim())},[]),children:cA(uq.ItemSlot,{scope:t,value:i,disabled:n,textValue:r,children:cA(re.div,{role:"option","aria-labelledby":E,"data-highlighted":l?"":void 0,"aria-selected":I&&l,"data-state":I?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...g,ref:B,onFocus:TA(g.onFocus,()=>c(!0)),onBlur:TA(g.onBlur,()=>c(!1)),onClick:TA(g.onClick,()=>{u.current!=="mouse"&&d()}),onPointerUp:TA(g.onPointerUp,()=>{u.current==="mouse"&&d()}),onPointerDown:TA(g.onPointerDown,f=>{u.current=f.pointerType}),onPointerMove:TA(g.onPointerMove,f=>{var w;u.current=f.pointerType,n?(w=s.onItemLeave)==null||w.call(s):u.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:TA(g.onPointerLeave,f=>{var w;f.currentTarget===document.activeElement&&((w=s.onItemLeave)==null||w.call(s))}),onKeyDown:TA(g.onKeyDown,f=>{var w;((w=s.searchRef)==null?void 0:w.current)!==""&&f.key===" "||(KWt.includes(f.key)&&d(),f.key===" "&&f.preventDefault())})})})})});kse.displayName=mq;var lH="SelectItemText",Jse=p.forwardRef((A,e)=>{const{__scopeSelect:t,className:i,style:n,...o}=A,g=y0(lH,t),a=b0(lH,t),s=Gse(lH,t),I=zWt(lH,t),[r,C]=p.useState(null),l=Te(e,d=>C(d),s.onItemTextChange,d=>{var f;return(f=a.itemTextRefCallback)==null?void 0:f.call(a,d,s.value,s.disabled)}),c=r==null?void 0:r.textContent,B=p.useMemo(()=>cA("option",{value:s.value,disabled:s.disabled,children:c},s.value),[s.disabled,s.value,c]),{onNativeOptionAdd:E,onNativeOptionRemove:u}=I;return _g(()=>(E(B),()=>u(B)),[E,u,B]),Ic(yy,{children:[cA(re.span,{id:s.textId,...o,ref:l}),s.isSelected&&g.valueNode&&!g.valueNodeHasChildren?bt.createPortal(o.children,g.valueNode):null]})});Jse.displayName=lH;var Nse="SelectItemIndicator",Yse=p.forwardRef((A,e)=>{const{__scopeSelect:t,...i}=A;return Gse(Nse,t).isSelected?cA(re.span,{"aria-hidden":!0,...i,ref:e}):null});Yse.displayName=Nse;var fhA="SelectScrollUpButton",Rse=p.forwardRef((A,e)=>{const t=b0(fhA,A.__scopeSelect),i=mhA(fhA,A.__scopeSelect),[n,o]=p.useState(!1),g=Te(e,i.onScrollButtonChange);return _g(()=>{if(t.viewport&&t.isPositioned){let a=function(){const I=s.scrollTop>0;o(I)};const s=t.viewport;return a(),s.addEventListener("scroll",a),()=>s.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?cA(Fse,{...A,ref:g,onAutoScroll:()=>{const{viewport:a,selectedItem:s}=t;a&&s&&(a.scrollTop=a.scrollTop-s.offsetHeight)}}):null});Rse.displayName=fhA;var yhA="SelectScrollDownButton",xse=p.forwardRef((A,e)=>{const t=b0(yhA,A.__scopeSelect),i=mhA(yhA,A.__scopeSelect),[n,o]=p.useState(!1),g=Te(e,i.onScrollButtonChange);return _g(()=>{if(t.viewport&&t.isPositioned){let a=function(){const I=s.scrollHeight-s.clientHeight,r=Math.ceil(s.scrollTop)<I;o(r)};const s=t.viewport;return a(),s.addEventListener("scroll",a),()=>s.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?cA(Fse,{...A,ref:g,onAutoScroll:()=>{const{viewport:a,selectedItem:s}=t;a&&s&&(a.scrollTop=a.scrollTop+s.offsetHeight)}}):null});xse.displayName=yhA;var Fse=p.forwardRef((A,e)=>{const{__scopeSelect:t,onAutoScroll:i,...n}=A,o=b0("SelectScrollButton",t),g=p.useRef(null),a=dq(t),s=p.useCallback(()=>{g.current!==null&&(window.clearInterval(g.current),g.current=null)},[]);return p.useEffect(()=>()=>s(),[s]),_g(()=>{var I;const r=a().find(C=>C.ref.current===document.activeElement);(I=r==null?void 0:r.ref.current)==null||I.scrollIntoView({block:"nearest"})},[a]),cA(re.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:TA(n.onPointerDown,()=>{g.current===null&&(g.current=window.setInterval(i,50))}),onPointerMove:TA(n.onPointerMove,()=>{var I;(I=o.onItemLeave)==null||I.call(o),g.current===null&&(g.current=window.setInterval(i,50))}),onPointerLeave:TA(n.onPointerLeave,()=>{s()})})}),n3t="SelectSeparator",Mse=p.forwardRef((A,e)=>{const{__scopeSelect:t,...i}=A;return cA(re.div,{"aria-hidden":!0,...i,ref:e})});Mse.displayName=n3t;var bhA="SelectArrow",o3t=p.forwardRef((A,e)=>{const{__scopeSelect:t,...i}=A,n=hq(t),o=y0(bhA,t),g=b0(bhA,t);return o.open&&g.position==="popper"?cA(FF,{...n,...i,ref:e}):null});o3t.displayName=bhA;var g3t="SelectBubbleInput",vse=p.forwardRef(({__scopeSelect:A,value:e,...t},i)=>{const n=p.useRef(null),o=Te(i,n),g=lF(e);return p.useEffect(()=>{const a=n.current;if(!a)return;const s=window.HTMLSelectElement.prototype,I=Object.getOwnPropertyDescriptor(s,"value").set;if(g!==e&&I){const r=new Event("change",{bubbles:!0});I.call(a,e),a.dispatchEvent(r)}},[g,e]),cA(re.select,{...t,style:{...hSA,...t.style},ref:o,defaultValue:e})});vse.displayName=g3t;function Lse(A){return A===""||A===void 0}function Sse(A){const e=oQ(A),t=p.useRef(""),i=p.useRef(0),n=p.useCallback(g=>{const a=t.current+g;e(a),function s(I){t.current=I,window.clearTimeout(i.current),I!==""&&(i.current=window.setTimeout(()=>s(""),1e3))}(a)},[e]),o=p.useCallback(()=>{t.current="",window.clearTimeout(i.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(i.current),[]),[t,n,o]}function Hse(A,e,t){const i=e.length>1&&Array.from(e).every(a=>a===e[0])?e[0]:e,n=t?A.indexOf(t):-1;let o=a3t(A,Math.max(n,0));i.length===1&&(o=o.filter(a=>a!==t));const g=o.find(a=>a.textValue.toLowerCase().startsWith(i.toLowerCase()));return g!==t?g:void 0}function a3t(A,e){return A.map((t,i)=>A[(e+i)%A.length])}var s3t=lse,Zse=Bse,r3t=Ese,I3t=use,C3t=dse,Wse=hse,l3t=yse,Kse=Dse,Use=kse,c3t=Jse,B3t=Yse,Vse=Rse,Xse=xse,zse=Mse;const whA=s3t,DhA=r3t,pq=p.forwardRef(({className:A,children:e,...t},i)=>p.createElement(Zse,{ref:i,className:Ce("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",A),...t},e,p.createElement(I3t,{asChild:!0},p.createElement(vHA,{className:"h-4 w-4 opacity-50"}))));pq.displayName=Zse.displayName;const Tse=p.forwardRef(({className:A,...e},t)=>p.createElement(Vse,{ref:t,className:Ce("flex cursor-default items-center justify-center py-1",A),...e},p.createElement(v5e,null)));Tse.displayName=Vse.displayName;const _se=p.forwardRef(({className:A,...e},t)=>p.createElement(Xse,{ref:t,className:Ce("flex cursor-default items-center justify-center py-1",A),...e},p.createElement(Y5e,null)));_se.displayName=Xse.displayName;const fq=p.forwardRef(({className:A,children:e,position:t="popper",...i},n)=>p.createElement(C3t,{container:p.useContext(Ry)},p.createElement(Wse,{ref:n,className:Ce("relative z-50 max-h-96 min-w-[8rem] overflow-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",t==="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",A),position:t,...i},p.createElement(Tse,null),p.createElement(l3t,{className:Ce("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},e),p.createElement(_se,null))));fq.displayName=Wse.displayName;const Q3t=p.forwardRef(({className:A,...e},t)=>p.createElement(Kse,{ref:t,className:Ce("px-2 py-1.5 text-sm font-semibold",A),...e}));Q3t.displayName=Kse.displayName;const Gl=p.forwardRef(({className:A,children:e,...t},i)=>p.createElement(Use,{ref:i,className:Ce("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",A),...t},p.createElement("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},p.createElement(B3t,null,p.createElement(TF,{className:"h-4 w-4"}))),p.createElement(c3t,null,e)));Gl.displayName=Use.displayName;const E3t=p.forwardRef(({className:A,...e},t)=>p.createElement(zse,{ref:t,className:Ce("-mx-1 my-1 h-px bg-muted",A),...e}));E3t.displayName=zse.displayName;const u3t=A=>{const{options:e=[],disable:t,selectedKey:i,onSelect:n,placeholder:o="Select an option",className:g}=A;return b.createElement(whA,{disabled:t,value:i,onValueChange:a=>{a==="_none"?n==null||n(""):n==null||n(a)}},b.createElement(pq,{className:g},b.createElement(DhA,{placeholder:o})),b.createElement(fq,null,e.map(a=>b.createElement(Gl,{key:a.value,value:a.value},a.label))))},cH=u3t,d3t=ke.AGGREGATOR_LIST.map(A=>({label:A,value:A})).concat([{label:"-",value:"_none"}]),h3t=({allFields:A,field:e,onChange:t,displayOffset:i})=>b.createElement(Eq,{field:e,onChange:t,tabs:["range","one of"],allFields:A,displayOffset:i}),m3t=({allFields:A,field:e,onChange:t,displayOffset:i})=>b.createElement(Eq,{field:e,onChange:t,tabs:["one of"],allFields:A,displayOffset:i}),p3t=({allFields:A,field:e,onChange:t,displayOffset:i})=>b.createElement(Eq,{field:e,onChange:t,tabs:["one of"],allFields:A,displayOffset:i}),f3t=({allFields:A,field:e,onChange:t,displayOffset:i})=>b.createElement(Eq,{field:e,onChange:t,tabs:["temporal range","one of"],allFields:A,displayOffset:i}),y3t=()=>b.createElement(b.Fragment,null),Ose=A=>{const{editingFilterIdx:e,viewFilters:t,meta:i,options:n,onSelectFilter:o,onWriteFilter:g,onClose:a,onSelectAgg:s}=A,{t:I}=ve("translation",{keyPrefix:"filters"}),r=b.useMemo(()=>e!==null?t[e]:null,[e,t]),[C,l]=XFA(r),c=b.useCallback(u=>{e!==null&&l(d=>({...d,rule:u}))},[e]),B=b.useCallback(()=>{e!==null&&g(e,(C==null?void 0:C.rule)??null),a()},[e,C==null?void 0:C.rule,g]),E=r?{quantitative:h3t,nominal:m3t,ordinal:p3t,temporal:f3t}[r.semanticType]:y3t;return C?b.createElement(sa,{open:!!C,onOpenChange:a},b.createElement(ra,null,b.createElement(US,null,b.createElement(pdA,null,I("editing"))),b.createElement("div",{className:"pt-4 text-xs"},b.createElement("div",{className:"grid grid-cols-2 gap-4"},b.createElement("div",null,b.createElement("div",{className:"py-1"},I("form.name")),b.createElement(cH,{buttonClassName:"w-96",className:"mb-2",options:n,selectedKey:C.fid,onSelect:o})),s&&e!==null&&C.analyticType==="measure"&&b.createElement("div",null,b.createElement("div",{className:"py-1"},I("form.aggregation")),b.createElement(cH,{buttonClassName:"w-96",className:"mb-2",options:d3t,selectedKey:C.enableAgg?C.aggName??"":"",onSelect:u=>s(e,u===""?null:u)}))),b.createElement(E,{allFields:i,key:Dy(C),field:C,onChange:c,displayOffset:A.displayOffset}),b.createElement(nE,null,b.createElement(fe,{onClick:B,children:I("btn.confirm")}),b.createElement(fe,{variant:"outline",onClick:a,children:I("btn.cancel")}))))):null},b3t=ze(()=>{var A,e;const t=xt(),{editingFilterIdx:i,viewFilters:n,dimensions:o,measures:g,meta:a,allFields:s,viewDimensions:I,config:r}=t,{timezoneDisplayOffset:C}=r,l=Og(),c=i!==null&&(A=n[i])!=null&&A.enableAgg?s.find(G=>G.fid===n[i].fid):void 0,B=i!==null&&(e=n[i])!=null&&e.enableAgg?n[i].aggName:void 0,E=p.useMemo(()=>{if(c&&I.length>0){const G=Hm([],s,I,[{...c,aggName:B}],!0,"none",[],void 0,C).map(R=>R.type==="view"?{...R,query:R.query.map(x=>x.op==="aggregate"?{...x,measures:x.measures.map(F=>({...F,asFieldKey:F.field}))}:x)}:R);return R=>l({...R,workflow:G.concat(R.workflow.filter(x=>x.type!=="transform"))})}else return l},[l,I,c,B]),u=b.useCallback(()=>t.closeFilterEditing(),[t]),d=b.useCallback((G,R)=>{G!==null&&t.writeFilter(G,R??null)},[t]),f=G=>{const R=n.findIndex(x=>x.fid===G);if(R>=0)t.setFilterEditing(R);else{const x=o.find(Q=>Q.fid===G)?"dimensions":"measures",F=x==="dimensions"?o.findIndex(Q=>Q.fid===G):g.findIndex(Q=>Q.fid===G);i!==null&&t.modFilter(i,x,F)}},w=b.useMemo(()=>s.filter(G=>![no,fi,yi].includes(G.fid)).map(G=>({label:G.name,value:G.fid})),[s]),y=(G,R)=>{t.setFilterAggregator(G,R??"")};return b.createElement(GF.Provider,{value:E},b.createElement(Ose,{options:w,editingFilterIdx:i,displayOffset:C,meta:a,onClose:u,onSelectFilter:f,onWriteFilter:d,viewFilters:n,onSelectAgg:y}))}),w3t=b3t,D3t=ze(({provided:A})=>{const e=xt(),{viewFilters:t}=e;return b.createElement(fze,{className:"touch-none",...A.droppableProps,ref:TC(A.innerRef)},t.map((i,n)=>b.createElement(OG,{key:`filters_${n}_${EI(i)}`,draggableId:`filters_${n}_${EI(i)}`,index:n},(o,g)=>b.createElement(rZt,{fIndex:n,provided:o}))),A.placeholder,b.createElement(w3t,null))}),G3t=()=>b.createElement("div",null,b.createElement(mze,null,b.createElement(By,{droppableId:"filters",direction:"vertical"},(A,e)=>b.createElement(D3t,{provided:A})))),k3t=G3t,qse=({className:A,...e})=>p.createElement("nav",{role:"navigation","aria-label":"pagination",className:Ce("mx-auto flex w-full justify-center",A),...e});qse.displayName="Pagination";const jse=p.forwardRef(({className:A,...e},t)=>p.createElement("ul",{ref:t,className:Ce("flex flex-row items-center gap-1",A),...e}));jse.displayName="PaginationContent";const BH=p.forwardRef(({className:A,...e},t)=>p.createElement("li",{ref:t,className:Ce("cursor-pointer",A),...e}));BH.displayName="PaginationItem";const yq=({className:A,isActive:e,size:t="icon",...i})=>p.createElement("a",{"aria-current":e?"page":void 0,className:Ce(OV({variant:e?"outline":"ghost",size:t}),A),...i});yq.displayName="PaginationLink";const Pse=({className:A,children:e,...t})=>p.createElement(yq,{"aria-label":"Go to previous page",size:"default",className:Ce("gap-1 pl-2.5",A),...t},p.createElement(x5e,{className:"h-4 w-4"}),p.createElement("span",null,e));Pse.displayName="PaginationPrevious";const $se=({className:A,children:e,...t})=>p.createElement(yq,{"aria-label":"Go to next page",size:"default",className:Ce("gap-1 pr-2.5",A),...t},p.createElement("span",null,e),p.createElement(LHA,{className:"h-4 w-4"}));$se.displayName="PaginationNext";const Are=({className:A,...e})=>p.createElement("span",{"aria-hidden":!0,className:Ce("flex h-9 w-9 items-center justify-center",A),...e},p.createElement(W5e,{className:"h-4 w-4"}),p.createElement("span",{className:"sr-only"},"More pages"));Are.displayName="PaginationEllipsis";function J3t(A,e,t,i){const n=Math.ceil(A/(t||1)),o=[{index:0,disabled:!1,type:"page"},...new Array(1+i*2).fill(0).map((s,I)=>({index:e-(i-I),disabled:!1,type:"page"})),{index:n-1,disabled:!1,type:"page"}].filter(s=>s.index>=0&&s.index<n),g=[],a=new Set;for(let s of o)a.has(s.index)||(g.push(s),a.add(s.index));return g.reduce((s,I)=>{if(s.length===0)return[I];const r=s[s.length-1];return I.index===r.index+1?[...s,I]:[...s,{index:-1,type:"placeholder"},I]},[])}function N3t(A){const{total:e,onNext:t,onPrev:i,pageIndex:n,onPageChange:o,pageSize:g=100,extendPageNumber:a=1}=A,{t:s}=ve(),I=p.useMemo(()=>J3t(e,n,g,a),[n,g,a,e,n]),r=C=>b.createElement(BH,{key:C},b.createElement(yq,{size:"default",className:"px-3 min-w-[2.25rem]",isActive:C===n,onClick:()=>{o&&o(C)}},C+1));return I.length>0?b.createElement(qse,null,b.createElement(jse,null,b.createElement(BH,null,b.createElement(Pse,{onClick:()=>{i()}},s("actions.prev"))),I.map(C=>C.type==="placeholder"?b.createElement(BH,{key:C.index},b.createElement(Are,null)):r(C.index)),b.createElement(BH,null,b.createElement($se,{onClick:()=>{t()}},s("actions.next"))))):null}function ere({computation:A,field:e,valueRenderer:t=i=>`${i}`}){const[i,n]=p.useState();if(p.useEffect(()=>{D6e(GWA(A,"profiling"),e).then(n)},[A,e]),!xi(i))return b.createElement("div",{className:"h-24 flex items-center justify-center"},"Loading...");const o=I=>t(I)||b.createElement("span",{className:"text-destructive"},"(Empty)"),[g,a]=i,s=g.distinctTotal<10||a[0].count>1.3*g.total/g.distinctTotal&&a[0].count>g.total/100;return g.distinctTotal===1?b.createElement("div",{className:"h-24 flex items-center justify-center text-xl"},"= ",o(a[0].value)):b.createElement("div",{className:"h-24 flex items-center justify-center flex-col gap-2 text-xs"},s&&b.createElement(b.Fragment,null,a.map(({count:I,value:r},C)=>{const l=o(r);return b.createElement(Tge,{key:C,content:l},b.createElement("div",{className:"w-full rounded-md px-2 py-1 hover:bg-accent flex justify-between space-x-2"},b.createElement("div",{className:"min-w-[0px] flex-shrink truncate max-w-[180px]"},l),b.createElement("div",{className:"flex-shrink-0"},Math.floor(100*I/g.total),"%")))}),g.distinctTotal>a.length&&b.createElement("div",{className:"w-full rounded-md px-2 py-1 text-muted-foreground hover:bg-accent flex justify-between space-x-2"},b.createElement("div",{className:"min-w-[0px] flex-shrink whitespace-nowrap text-ellipsis overflow-hidden"},"Other (",g.distinctTotal-a.length,")"),b.createElement("div",{className:"flex-shrink-0"},100-a.reduce((I,{count:r})=>I+Math.floor(100*r/g.total),0),"%"))),!s&&b.createElement(b.Fragment,null,b.createElement("div",{className:"text-lg"},g.distinctTotal),b.createElement("div",null,"unique values")))}const bq=Ec("~s");function Y3t({computation:A,field:e}){const[t,i]=p.useState();return p.useEffect(()=>{G6e(GWA(A,"profiling"),e).then(i)},[A,e]),xi(t)?t.min===t.max?b.createElement("div",{className:"h-24 flex items-center justify-center text-xl"},"= ",t.min):b.createElement("div",{className:"h-24 w-full flex flex-col space-y-1"},b.createElement(R3t,{data:t}),b.createElement("div",{className:"flex justify-between w-full text-xs font-medium leading-none"},b.createElement("div",null,bq(t.min)),b.createElement("div",null,bq(t.max)))):b.createElement("div",{className:"h-24 flex items-center justify-center"},"Loading...")}function R3t({data:A}){const e=p.useContext(sQ),{vizThemeConfig:t}=p.useContext(hX),i=IUA({mediaTheme:e,vizThemeConfig:t}),n=p.useMemo(()=>({...i,background:"transparent"}),[i]),o=p.useCallback(g=>{if(!g)return;const{width:a}=g.getBoundingClientRect(),s={width:a-10,height:70,autosize:"fit",data:{values:A.binValues.map(({from:I,to:r,count:C})=>({value:`${bq(I)} - ${bq(r)}`,sort:I,count:C}))},mark:{type:"bar",opacity:.96,tooltip:{content:"data"}},encoding:{x:{field:"value",type:"ordinal",sort:{op:"sum",field:"sort"},axis:!1},y:{field:"count",type:"quantitative",axis:!1},tooltip:[{field:"value",type:"ordinal",title:"Value"},{field:"count",type:"quantitative",title:"Count"}]},config:{view:{stroke:null}}};U2(g,s,{renderer:"canvas",mode:"vega-lite",actions:!1,config:n,tooltip:{theme:e}})},[A,n]);return b.createElement("div",{ref:o})}function x3t(A){return function(e){const[t,i]=p.useState(!1),n=p.useRef(null),o=p.useCallback(g=>{var a;if((a=n.current)==null||a.disconnect(),g){const s=new IntersectionObserver(I=>{I.forEach(r=>{r.isIntersecting&&(i(!0),s.disconnect())})});s.observe(g),n.current=s}},[]);return b.createElement(b.Fragment,null,t&&b.createElement(A,{...e}),b.createElement("div",{className:"w-0 h-0",ref:o}))}}function F3t(A){const{semanticType:e,displayOffset:t,offset:i,...n}=A;switch(e){case"nominal":case"ordinal":return b.createElement(ere,{...n});case"temporal":{const o=g=>Uu(Sm(t,i)(g));return b.createElement(ere,{...n,valueRenderer:o})}case"quantitative":return b.createElement(Y3t,{...n})}}const M3t=x3t(F3t),v3t=_V("inline-flex items-center rounded-md 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 shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function L3t({className:A,variant:e,...t}){return p.createElement("div",{className:Ce(v3t({variant:e}),A),...t})}var GhA,wq="HoverCard",[tre,T0i]=Tg(wq,[aQ]),Dq=aQ(),[S3t,Gq]=tre(wq),ire=A=>{const{__scopeHoverCard:e,children:t,open:i,defaultOpen:n,onOpenChange:o,openDelay:g=700,closeDelay:a=300}=A,s=Dq(e),I=p.useRef(0),r=p.useRef(0),C=p.useRef(!1),l=p.useRef(!1),[c,B]=is({prop:i,defaultProp:n??!1,onChange:o,caller:wq}),E=p.useCallback(()=>{clearTimeout(r.current),I.current=window.setTimeout(()=>B(!0),g)},[g,B]),u=p.useCallback(()=>{clearTimeout(I.current),!C.current&&!l.current&&(r.current=window.setTimeout(()=>B(!1),a))},[a,B]),d=p.useCallback(()=>B(!1),[B]);return p.useEffect(()=>()=>{clearTimeout(I.current),clearTimeout(r.current)},[]),cA(S3t,{scope:e,open:c,onOpenChange:B,onOpen:E,onClose:u,onDismiss:d,hasSelectionRef:C,isPointerDownOnContentRef:l,children:cA(RF,{...s,children:t})})};ire.displayName=wq;var nre="HoverCardTrigger",ore=p.forwardRef((A,e)=>{const{__scopeHoverCard:t,...i}=A,n=Gq(nre,t),o=Dq(t);return cA(kk,{asChild:!0,...o,children:cA(re.a,{"data-state":n.open?"open":"closed",...i,ref:e,onPointerEnter:TA(A.onPointerEnter,Jq(n.onOpen)),onPointerLeave:TA(A.onPointerLeave,Jq(n.onClose)),onFocus:TA(A.onFocus,n.onOpen),onBlur:TA(A.onBlur,n.onClose),onTouchStart:TA(A.onTouchStart,g=>g.preventDefault())})})});ore.displayName=nre;var khA="HoverCardPortal",[H3t,Z3t]=tre(khA,{forceMount:void 0}),gre=A=>{const{__scopeHoverCard:e,forceMount:t,children:i,container:n}=A,o=Gq(khA,e);return cA(H3t,{scope:e,forceMount:t,children:cA(qg,{present:t||o.open,children:cA(Jk,{asChild:!0,container:n,children:i})})})};gre.displayName=khA;var kq="HoverCardContent",are=p.forwardRef((A,e)=>{const t=Z3t(kq,A.__scopeHoverCard),{forceMount:i=t.forceMount,...n}=A,o=Gq(kq,A.__scopeHoverCard);return cA(qg,{present:i||o.open,children:cA(W3t,{"data-state":o.open?"open":"closed",...n,onPointerEnter:TA(A.onPointerEnter,Jq(o.onOpen)),onPointerLeave:TA(A.onPointerLeave,Jq(o.onClose)),ref:e})})});are.displayName=kq;var W3t=p.forwardRef((A,e)=>{const{__scopeHoverCard:t,onEscapeKeyDown:i,onPointerDownOutside:n,onFocusOutside:o,onInteractOutside:g,...a}=A,s=Gq(kq,t),I=Dq(t),r=p.useRef(null),C=Te(e,r),[l,c]=p.useState(!1);return p.useEffect(()=>{if(l){const B=document.body;return GhA=B.style.userSelect||B.style.webkitUserSelect,B.style.userSelect="none",B.style.webkitUserSelect="none",()=>{B.style.userSelect=GhA,B.style.webkitUserSelect=GhA}}},[l]),p.useEffect(()=>{if(r.current){const B=()=>{c(!1),s.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var E;((E=document.getSelection())==null?void 0:E.toString())!==""&&(s.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",B),()=>{document.removeEventListener("pointerup",B),s.hasSelectionRef.current=!1,s.isPointerDownOnContentRef.current=!1}}},[s.isPointerDownOnContentRef,s.hasSelectionRef]),p.useEffect(()=>{r.current&&V3t(r.current).forEach(B=>B.setAttribute("tabindex","-1"))}),cA(Ny,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:g,onEscapeKeyDown:i,onPointerDownOutside:n,onFocusOutside:TA(o,B=>{B.preventDefault()}),onDismiss:s.onDismiss,children:cA(xF,{...I,...a,onPointerDown:TA(a.onPointerDown,B=>{B.currentTarget.contains(B.target)&&c(!0),s.hasSelectionRef.current=!1,s.isPointerDownOnContentRef.current=!0}),ref:C,style:{...a.style,userSelect:l?"text":void 0,WebkitUserSelect:l?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),K3t="HoverCardArrow",U3t=p.forwardRef((A,e)=>{const{__scopeHoverCard:t,...i}=A,n=Dq(t);return cA(FF,{...n,...i,ref:e})});U3t.displayName=K3t;function Jq(A){return e=>e.pointerType==="touch"?void 0:A()}function V3t(A){const e=[],t=document.createTreeWalker(A,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;t.nextNode();)e.push(t.currentNode);return e}var X3t=ire,z3t=ore,T3t=gre,sre=are;const _3t=X3t,O3t=z3t,rre=p.forwardRef(({className:A,align:e="center",sideOffset:t=4,...i},n)=>p.createElement(T3t,{container:p.useContext(Ry)},p.createElement(sre,{ref:n,align:e,sideOffset:t,className:Ce("z-50 w-64 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",A),...i})));rre.displayName=sre.displayName;const q3t=an.div`
    overflow-x: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    table {
        box-sizing: content-box;
        border-collapse: collapse;
        font-size: 12px;
        tbody {
            td {
            }
            td.number {
                text-align: right;
            }
            td.text {
                text-align: left;
            }
        }
    }
`,j3t=["nominal","ordinal","quantitative","temporal"];function Ire(A){return A.analyticType==="dimension"?"text":"number"}function P3t(A){return A.analyticType==="dimension"?"border-t-2 border-dimension":"border-t-2 border-measure"}function Cre(A){switch(A.semanticType){case"nominal":return"border border-transparent bg-sky-100 text-sky-800 dark:bg-sky-900 dark:text-sky-100 dark:border-sky-600";case"ordinal":return"border border-transparent bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-100 dark:border-indigo-600";case"quantitative":return"border border-transparent bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-100 dark:border-purple-600";case"temporal":return"border border-transparent bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100 dark:border-yellow-600";default:return"border border-transparent bg-gray-400"}}const $3t=A=>{const e=A.map(n=>{var o;return((o=n.path)==null?void 0:o.length)??1}).reduce((n,o)=>Math.max(n,o),0),t=[...Array(e)].map(()=>[]);let i=1;return A.forEach((n,o)=>{const g=n.path??[n.name??n.fid];if(g.length>i)for(let a=i-1;a<g.length-1;a++)t[a].push({colSpan:0,rowSpan:1,type:"name",value:g[a]});i=g.length;for(let a=0;a<g.length-1;a++)t[a][t[a].length-1].colSpan++;t[g.length-1].push({type:"field",value:n,colSpan:1,rowSpan:e-g.length+1,fIndex:o})}),t},lre=A=>A.type==="name"?A.value:A.value.name??A.value.fid;function AKt(A){const[e,t]=p.useState([]),[i,n]=p.useState(null),o=p.useMemo(()=>A.map(r=>({label:r.name??r.fid,value:r.fid})),[A]),g=p.useCallback(r=>{const C=e.findIndex(l=>l.fid===r);if(C>-1)n(C);else{const l=A.find(B=>B.fid===r);if(!l)return;const c={fid:r,rule:null,analyticType:l.analyticType,name:l.name??l.fid,semanticType:l.semanticType};i===null||!e[i]?(t(e.concat(c)),n(e.length)):t(e.map((B,E)=>E===i?c:B))}},[A,e,i]),a=p.useCallback((r,C)=>{t(l=>l.map((c,B)=>B===r?{...c,rule:C}:c))},[]),s=p.useCallback(r=>{t(C=>C.filter((l,c)=>c!==r))},[]),I=p.useCallback(()=>{n(null)},[]);return{filters:e,options:o,editingFilterIdx:i,onSelectFilter:g,onDeleteFilter:s,onWriteFilter:a,onClose:I}}function eKt(A){const{field:e,item:t}=A;return e.semanticType==="temporal"?Uu(Sm(A.displayOffset,e.offset)(t[e.fid])):`${t[e.fid]}`}function tKt(A){const[e,t]=p.useState(!1);return p.useEffect(()=>{if(e){const i=setTimeout(()=>{t(!1)},2e3);return()=>{clearTimeout(i)}}},[e]),b.createElement(fe,{variant:"secondary",className:"h-6 px-2 text-xs w-14",size:"sm",onClick:()=>{try{navigator.clipboard.writeText(A.value),t(!0)}catch(i){console.error(i)}},disabled:e},e?"Copied":"Copy")}function iKt(A){const e=p.useRef(null),[t,i]=p.useState(!1),[n,o]=p.useState(!1);return p.useEffect(()=>{e.current&&i(e.current.offsetWidth<e.current.scrollWidth)},[e.current]),b.createElement(_3t,{open:n&&t,onOpenChange:o},b.createElement(O3t,{ref:e,className:"truncate block"},A.value),b.createElement(rre,{className:"flex space-x-2 items-center w-fit py-2 px-3"},b.createElement("p",{className:"text-xs max-w-[360px] line-clamp-4 break-all"},A.value),b.createElement(tKt,{value:A.value})))}const nKt=p.forwardRef((A,e)=>{const{size:t=10,onMetaChange:i,metas:n,computation:o,disableFilter:g,disableSorting:a,hideSemanticType:s,displayOffset:I,hidePaginationAtOnepage:r,hideProfiling:C}=A,[l,c]=p.useState(0),{t:B}=ve(),E=o,u=p.useMemo(()=>j3t.map(iA=>({value:iA,label:B(`constant.semantic_type.${iA}`)})),[]),[d,f]=p.useState([]),[w,y]=p.useState(!1),G=p.useRef(0),[R,x]=p.useState(),{filters:F,editingFilterIdx:Q,onClose:k,onDeleteFilter:h,onSelectFilter:N,onWriteFilter:v,options:K}=AKt(n),U=p.useRef(F);U.current=F,p.useImperativeHandle(e,()=>({getFilters:()=>U.current.filter(iA=>iA.rule)}));const[V,X]=p.useState(0),[_,q]=p.useState(!1);p.useEffect(()=>{const iA=F.filter(aA=>aA.rule).map(aA=>({...aA,rule:aA.rule}));q(!0),o({workflow:[...!g&&iA&&iA.length>0?[{type:"filter",filters:iA}]:[],{type:"view",query:[{op:"aggregate",groupBy:[],measures:[{field:"*",agg:"count",asFieldKey:"count"}]}]}]}).then(aA=>{var lA;X(((lA=aA[0])==null?void 0:lA.count)??0),q(!1)})},[g,F,o]);const $=l*t,nA=Math.min((l+1)*t-1,V-1);p.useEffect(()=>{$>V&&c(0)},[$,V]),p.useEffect(()=>{y(!0);const iA=++G.current;return y6e(E,t,l,{sorting:a?void 0:R,filters:F.filter(aA=>aA.rule).map(aA=>({...aA,rule:aA.rule}))}).then(aA=>{iA===G.current&&(y(!1),f(aA))}).catch(aA=>{iA===G.current&&(console.error(aA),y(!1),f([]))}),()=>{G.current++}},[E,l,t,R,F,a]);const j=p.useMemo(()=>{const iA=F.filter(aA=>aA.rule).map(YvA);return aA=>o(RvA(aA,iA))},[o,F]),O=_||w,eA=p.useMemo(()=>$3t(n),[n]),[oA,tA]=p.useState(!1),sA=p.useRef(null),gA=p.useCallback(iA=>{var aA;if((aA=sA.current)==null||aA.disconnect(),iA){const lA=new IntersectionObserver(CA=>{CA.forEach(QA=>{tA(!QA.isIntersecting)})});lA.observe(iA),sA.current=lA}},[]);return b.createElement(q3t,{className:"relative"},!g&&F.length>0&&b.createElement("div",{className:"flex items-center p-2 space-x-2"},b.createElement("span",null,"Filters: "),F.map((iA,aA)=>b.createElement(oKt,{key:iA.fid,name:iA.name,onClick:()=>N(iA.fid),onRemove:()=>h(aA)}))),!(r&&V<=t)&&b.createElement("nav",{className:"flex items-center justify-end space-x-2 p-2","aria-label":"Pagination"},b.createElement("div",{className:"hidden sm:block flex-1"},b.createElement("p",{className:"text-sm text-muted-foreground"},"Showing ",b.createElement("span",{className:"font-medium"},$+1)," to ",b.createElement("span",{className:"font-medium"},nA+1)," of"," ",b.createElement("span",{className:"font-medium"},V)," results")),b.createElement("div",{className:"space-x-2"},b.createElement(N3t,{total:V,pageSize:t,pageIndex:l,onNext:()=>{c(Math.min(Math.ceil(V/t)-1,l+1))},onPrev:()=>{c(Math.max(0,l-1))},onPageChange:iA=>{c(Math.max(0,Math.min(Math.ceil(V/t)-1,iA)))}}))),b.createElement("div",{className:"overflow-y-auto h-full",style:{maxHeight:"600px"}},b.createElement("div",{className:"h-0 w-full",ref:gA}),b.createElement("table",{className:"min-w-full relative border-x"},b.createElement("thead",{className:`sticky top-0 bg-background ${oA?"shadow-md":""}`},eA.map(iA=>b.createElement("tr",{className:"divide-x divide-border",key:`row_${lre(iA[0])}`},iA.map((aA,lA)=>b.createElement("th",{colSpan:aA.colSpan,rowSpan:aA.rowSpan,key:lre(aA),className:"align-top p-0 border-b bg-background",style:{zIndex:iA.length-lA}},aA.type==="name"&&b.createElement("div",{className:"inset-x-0 border-t-4 border-yellow-400 whitespace-nowrap py-3.5 text-left text-xs font-medium text-foreground"},b.createElement("b",{className:"sticky inset-x-0 w-fit px-4 sm:pl-6"},aA.value)),aA.type==="field"&&b.createElement("div",{className:P3t(aA.value)+" whitespace-nowrap py-3.5 px-4 text-left text-xs font-medium text-foreground flex items-center gap-1 group"},b.createElement("div",{className:"font-normal block"},!s&&!i&&b.createElement("span",{className:"inline-flex p-0.5 text-xs mt-1 rounded "+Cre(aA.value)},b.createElement(Vk,{dataType:aA.value.semanticType,analyticType:aA.value.analyticType})),!s&&i&&b.createElement(xX,{options:u,onSelect:CA=>{i(aA.value.fid,aA.fIndex,{semanticType:CA})}},b.createElement("span",{className:"cursor-pointer inline-flex p-0.5 text-xs mt-1 rounded hover:scale-125 "+Cre(aA.value)},b.createElement(Vk,{dataType:aA.value.semanticType,analyticType:aA.value.analyticType})))),b.createElement("b",{className:"inline-block",onClick:()=>{a||x(CA=>(CA==null?void 0:CA.fid)===aA.value.fid&&CA.sort==="descending"?{fid:aA.value.fid,sort:"ascending"}:{fid:aA.value.fid,sort:"descending"})}},aA.value.basename||aA.value.name||aA.value.fid),!a&&(R==null?void 0:R.fid)===aA.value.fid&&b.createElement("div",{className:"mx-1"},R.sort==="ascending"&&b.createElement(JiA,{className:"w-3"}),R.sort==="descending"&&b.createElement(kiA,{className:"w-3"})),!g&&b.createElement("div",{className:OV({variant:"ghost",className:"cursor-pointer invisible group-hover:visible",size:"icon-sm"}),onClick:()=>N(aA.value.fid)},b.createElement(_Se,{className:"w-4 inline-block"}))))))),!A.hideProfiling&&b.createElement("tr",{className:"divide-x divide-border border-b"},n.map(iA=>b.createElement("th",{key:iA.fid,className:Ire(iA)+" whitespace-nowrap py-2 px-3 text-xs text-muted-foreground"},b.createElement(M3t,{field:iA.fid,semanticType:iA.semanticType,computation:j,displayOffset:I,offset:iA.offset}))))),b.createElement("tbody",{className:"divide-y divide-border bg-background font-mono"},d.map((iA,aA)=>b.createElement("tr",{className:"divide-x divide-border",key:aA},n.map(lA=>{const CA=eKt({field:lA,item:iA,displayOffset:I});return b.createElement("td",{key:lA.fid+aA,className:Ire(lA)+" whitespace-nowrap py-2 px-4 text-xs text-muted-foreground max-w-[240px]"},b.createElement(iKt,{value:CA}))})))))),O&&b.createElement(nr,null),!g&&b.createElement(GF.Provider,{value:o},b.createElement("div",{className:"text-xs"},b.createElement(Ose,{editingFilterIdx:Q,meta:n,onClose:k,onSelectFilter:N,onWriteFilter:v,options:K,viewFilters:F,displayOffset:I}))))}),Nq=nKt,oKt=A=>b.createElement(L3t,{onClick:A.onClick,className:"gap-x-0.5"},A.name,b.createElement(fe,{onClick:e=>{var t;e.stopPropagation(),(t=A.onRemove)==null||t.call(A)},variant:"ghost",size:"none",className:"relative -mr-1 h-3.5 w-3.5 rounded-sm"},b.createElement("span",{className:"sr-only"},"Remove"),b.createElement("svg",{viewBox:"0 0 14 14",className:"h-3.5 w-3.5 stroke-current"},b.createElement("path",{d:"M4 4l6 6m0-6l-6 6"})),b.createElement("span",{className:"absolute -inset-1"}))),gKt=({hideProfiling:A})=>{const e=xt(),t=Og(),i=mV(e.meta);return b.createElement("div",{className:"relative"},b.createElement(Nq,{size:100,metas:i,computation:t,displayOffset:e.config.timezoneDisplayOffset,onMetaChange:(n,o,g)=>{e.updateCurrentDatasetMetas(n,g)},hideProfiling:A}))},aKt=ze(gKt);var Yq="Tabs",[sKt,_0i]=Tg(Yq,[Sk]),cre=Sk(),[rKt,JhA]=sKt(Yq),Bre=p.forwardRef((A,e)=>{const{__scopeTabs:t,value:i,onValueChange:n,defaultValue:o,orientation:g="horizontal",dir:a,activationMode:s="automatic",...I}=A,r=Ck(a),[C,l]=is({prop:i,onChange:n,defaultProp:o??"",caller:Yq});return cA(rKt,{scope:t,baseId:_o(),value:C,onValueChange:l,orientation:g,dir:r,activationMode:s,children:cA(re.div,{dir:r,"data-orientation":g,...I,ref:e})})});Bre.displayName=Yq;var Qre="TabsList",Ere=p.forwardRef((A,e)=>{const{__scopeTabs:t,loop:i=!0,...n}=A,o=JhA(Qre,t),g=cre(t);return cA(toA,{asChild:!0,...g,orientation:o.orientation,dir:o.dir,loop:i,children:cA(re.div,{role:"tablist","aria-orientation":o.orientation,...n,ref:e})})});Ere.displayName=Qre;var ure="TabsTrigger",dre=p.forwardRef((A,e)=>{const{__scopeTabs:t,value:i,disabled:n=!1,...o}=A,g=JhA(ure,t),a=cre(t),s=mre(g.baseId,i),I=pre(g.baseId,i),r=i===g.value;return cA(ioA,{asChild:!0,...a,focusable:!n,active:r,children:cA(re.button,{type:"button",role:"tab","aria-selected":r,"aria-controls":I,"data-state":r?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:s,...o,ref:e,onMouseDown:TA(A.onMouseDown,C=>{!n&&C.button===0&&C.ctrlKey===!1?g.onValueChange(i):C.preventDefault()}),onKeyDown:TA(A.onKeyDown,C=>{[" ","Enter"].includes(C.key)&&g.onValueChange(i)}),onFocus:TA(A.onFocus,()=>{const C=g.activationMode!=="manual";!r&&!n&&C&&g.onValueChange(i)})})})});dre.displayName=ure;var hre="TabsContent",QH=p.forwardRef((A,e)=>{const{__scopeTabs:t,value:i,forceMount:n,children:o,...g}=A,a=JhA(hre,t),s=mre(a.baseId,i),I=pre(a.baseId,i),r=i===a.value,C=p.useRef(r);return p.useEffect(()=>{const l=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(l)},[]),cA(qg,{present:n||r,children:({present:l})=>cA(re.div,{"data-state":r?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":s,hidden:!l,id:I,tabIndex:0,...g,ref:e,style:{...A.style,animationDuration:C.current?"0s":void 0},children:l&&o})})});QH.displayName=hre;function mre(A,e){return`${A}-trigger-${e}`}function pre(A,e){return`${A}-content-${e}`}var IKt=Bre,fre=Ere,yre=dre,bre=QH;const EH=p.forwardRef(({...A},e)=>p.createElement(IKt,{ref:e,activationMode:"manual",...A})),WN=p.forwardRef(({className:A,...e},t)=>p.createElement(fre,{ref:t,className:Ce("border-b flex h-9 space-x-8 items-center justify-start py-1",A),...e}));WN.displayName=fre.displayName;const rB=p.forwardRef(({className:A,...e},t)=>p.createElement(yre,{ref:t,className:Ce("inline-flex items-center justify-center whitespace-nowrap text-muted-foreground border-b-2 border-transparent hover:text-accent-foreground hover:border-accent-foreground px-1 py-2 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-primary data-[state=active]:border-primary",A),...e}));rB.displayName=yre.displayName;const uH=p.forwardRef(({className:A,...e},t)=>p.createElement(bre,{ref:t,className:Ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",A),...e}));uH.displayName=bre.displayName;const CKt=A=>(typeof A!="string"&&(A=JSON.stringify(A,void 0,4)),A=A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br>").replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\s/g,"&nbsp;"),A.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(e){var t="text-sky-500";return/^"/.test(e)?/:$/.test(e)?t="text-purple-500":t="text-emerald-500":/true|false/.test(e)?t="text-blue-500":/null/.test(e)&&(t="text-sky-500"),'<span class="'+t+'">'+e+"</span>"})),lKt=ze(A=>{const e=xt(),{showCodeExportPanel:t}=e,{t:i}=ve(),[n,o]=p.useState("graphic-walker"),[g,a]=p.useState(""),s=[{key:"graphic-walker",label:"Graphic-Walker"},{key:"vega-lite",label:"Vega-Lite"},...e.layout.showActions?[{key:"workflow",label:"Workflow"}]:[]];return p.useEffect(()=>{if(t)if(n==="graphic-walker"){const I=e.exportCode();a(JSON.stringify(I,null,4))}else if(n==="vega-lite")a(JSON.stringify(e.exportCode().map(WKe),null,4));else if(n==="workflow"){const I=e.workflow;a(JSON.stringify(I,null,4))}else console.error("unknown tabKey")},[n,t,e]),b.createElement(sa,{open:t,onOpenChange:()=>{e.setShowCodeExportPanel(!1)}},b.createElement(ra,null,b.createElement("h1",null,"Code Export"),b.createElement(EH,{value:n,onValueChange:o},b.createElement(WN,{className:"my-1"},s.map(I=>b.createElement(rB,{key:I.key,value:I.key},I.label))),b.createElement("div",{className:"border rounded-md overflow-hidden"},b.createElement("div",{className:"text-sm px-6 max-h-96 overflow-auto "},b.createElement("code",{dangerouslySetInnerHTML:{__html:CKt(g)}})))),b.createElement(nE,{className:"mt-2"},b.createElement(fe,{children:"Copy to Clipboard",onClick:()=>{navigator.clipboard.writeText(g),e.setShowCodeExportPanel(!1)}}),b.createElement(fe,{variant:"outline",children:i("actions.cancel"),onClick:()=>{e.setShowCodeExportPanel(!1)}}))))}),cKt=lKt;var Rq="Switch",[BKt,O0i]=Tg(Rq),[QKt,EKt]=BKt(Rq),wre=p.forwardRef((A,e)=>{const{__scopeSwitch:t,name:i,checked:n,defaultChecked:o,required:g,disabled:a,value:s="on",onCheckedChange:I,form:r,...C}=A,[l,c]=p.useState(null),B=Te(e,w=>c(w)),E=p.useRef(!1),u=l?r||!!l.closest("form"):!0,[d,f]=is({prop:n,defaultProp:o??!1,onChange:I,caller:Rq});return Ic(QKt,{scope:t,checked:d,disabled:a,children:[cA(re.button,{type:"button",role:"switch","aria-checked":d,"aria-required":g,"data-state":Jre(d),"data-disabled":a?"":void 0,disabled:a,value:s,...C,ref:B,onClick:TA(A.onClick,w=>{f(y=>!y),u&&(E.current=w.isPropagationStopped(),E.current||w.stopPropagation())})}),u&&cA(kre,{control:l,bubbles:!E.current,name:i,value:s,checked:d,required:g,disabled:a,form:r,style:{transform:"translateX(-100%)"}})]})});wre.displayName=Rq;var Dre="SwitchThumb",Gre=p.forwardRef((A,e)=>{const{__scopeSwitch:t,...i}=A,n=EKt(Dre,t);return cA(re.span,{"data-state":Jre(n.checked),"data-disabled":n.disabled?"":void 0,...i,ref:e})});Gre.displayName=Dre;var uKt="SwitchBubbleInput",kre=p.forwardRef(({__scopeSwitch:A,control:e,checked:t,bubbles:i=!0,...n},o)=>{const g=p.useRef(null),a=Te(g,o),s=lF(t),I=cF(e);return p.useEffect(()=>{const r=g.current;if(!r)return;const C=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(C,"checked").set;if(s!==t&&l){const c=new Event("click",{bubbles:i});l.call(r,t),r.dispatchEvent(c)}},[s,t,i]),cA("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...n,tabIndex:-1,ref:a,style:{...n.style,...I,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});kre.displayName=uKt;function Jre(A){return A?"checked":"unchecked"}var Nre=wre,dKt=Gre;const Yre=p.forwardRef(({className:A,...e},t)=>p.createElement(Nre,{className:Ce("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",A),...e,ref:t},p.createElement(dKt,{className:Ce("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})));Yre.displayName=Nre.displayName;function w0(A){const{enabled:e,onChange:t,label:i}=A;return b.createElement("div",{className:"flex items-center space-x-2"},b.createElement(Yre,{id:i,checked:e,onCheckedChange:t}),b.createElement(oE,{htmlFor:i},i))}const dH=p.forwardRef(({className:A,type:e,value:t,onChange:i,...n},o)=>{const[g,a]=XFA(t);return p.createElement("input",{type:"number",className:Ce("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",A),ref:o,value:g,onChange:s=>{a(s.target.value)},onBlur:s=>{i==null||i(s)},...n})});dH.displayName="NumberInput";function Rre(A){const{t:e}=ve();return b.createElement("div",{className:"flex md:flex-row flex-col gap-6 my-2"},b.createElement("div",{className:"flex flex-col space-y-2 items-start"},b.createElement("div",{className:"flex items-center space-x-2"},b.createElement(Bc,{id:`type_${A.text}`,checked:A.enableType,onCheckedChange:A.setEnableType}),b.createElement(oE,{htmlFor:`type_${A.text}`},e("config.type"))),b.createElement(whA,{value:A.type,disabled:!A.enableType,onValueChange:A.setType},b.createElement(pq,null,b.createElement(DhA,null)),b.createElement(fq,null,b.createElement(Gl,{value:"linear"},"Linear"),b.createElement(Gl,{value:"log"},"Log"),b.createElement(Gl,{value:"pow"},"Pow"),b.createElement(Gl,{value:"sqrt"},"Sqrt"),b.createElement(Gl,{value:"symlog"},"Symlog")))),b.createElement("div",{className:"flex flex-col space-y-2 items-start"},b.createElement("div",{className:"flex items-center space-x-2"},b.createElement(Bc,{id:`min_domain_${A.text}`,checked:A.enableMinDomain,onCheckedChange:A.setEnableMinDomain}),b.createElement(oE,{htmlFor:`min_domain_${A.text}`},e("config.min_domain"))),b.createElement(dH,{className:"w-32",value:A.domainMin,onChange:t=>{const i=Number(t.target.value);isNaN(i)||A.setDomainMin(i)},type:"number",disabled:!A.enableMinDomain})),b.createElement("div",{className:"flex flex-col space-y-2 items-start"},b.createElement("div",{className:"flex items-center space-x-2"},b.createElement(Bc,{id:`max_domain_${A.text}`,checked:A.enableMaxDomain,onCheckedChange:A.setEnableMaxDomain}),b.createElement(oE,{htmlFor:`max_domain_${A.text}`},e("config.max_domain"))),b.createElement(dH,{className:"w-32",value:A.domainMax,onChange:t=>{const i=Number(t.target.value);isNaN(i)||A.setDomainMax(i)},type:"number",disabled:!A.enableMaxDomain})),b.createElement("div",{className:"flex flex-col items-start w-48 space-y-2"},b.createElement("div",{className:"flex items-center space-x-2"},b.createElement(Bc,{id:`range_${A.text}`,checked:A.enableRange,onCheckedChange:A.setEnableRange}),b.createElement(oE,{htmlFor:`range_${A.text}`},e("config.range"))),b.createElement("div",{className:"flex w-full flex-col space-y-2 pt-2"},b.createElement(zO,{disabled:!A.enableRange,max:A.maxRange,min:A.minRange,value:[A.rangeMin,A.rangeMax],onValueChange:([t,i])=>{A.setRangeMin(t),A.setRangeMax(i)},step:A.maxRange<2?.01:1}),b.createElement("div",{className:"relative w-full h-4"},b.createElement("div",{className:"text-xs absolute left-0 text-foreground inset-y-0"},A.rangeMin),b.createElement("div",{className:"text-xs absolute right-0 text-foreground inset-y-0"},A.rangeMax)))))}function hH(A){const{t:e}=ve();return b.createElement("div",{className:"flex md:flex-row flex-col gap-6 my-2"},b.createElement("div",{className:"flex flex-col space-y-2 items-start"},b.createElement("div",{className:"flex items-center space-x-2"},b.createElement(Bc,{id:`type_${A.text}`,checked:A.enableType,onCheckedChange:A.setEnableType}),b.createElement(oE,{htmlFor:`type_${A.text}`},e("config.type"))),b.createElement(whA,{value:A.type,disabled:!A.enableType,onValueChange:A.setType},b.createElement(pq,null,b.createElement(DhA,null)),b.createElement(fq,null,b.createElement(Gl,{value:"linear"},"Linear"),b.createElement(Gl,{value:"log"},"Log"),b.createElement(Gl,{value:"pow"},"Pow"),b.createElement(Gl,{value:"sqrt"},"Sqrt"),b.createElement(Gl,{value:"symlog"},"Symlog")))),b.createElement("div",{className:"flex flex-col space-y-2 items-start"},b.createElement("div",{className:"flex items-center space-x-2"},b.createElement(Bc,{id:`min_domain_${A.text}`,checked:A.enableMinDomain,onCheckedChange:A.setEnableMinDomain}),b.createElement(oE,{htmlFor:`min_domain_${A.text}`},e("config.min_domain"))),b.createElement(dH,{className:"w-32",value:A.domainMin,onChange:t=>{const i=Number(t.target.value);isNaN(i)||A.setDomainMin(i)},type:"number",disabled:!A.enableMinDomain})),b.createElement("div",{className:"flex flex-col space-y-2 items-start"},b.createElement("div",{className:"flex items-center space-x-2"},b.createElement(Bc,{id:`max_domain_${A.text}`,checked:A.enableMaxDomain,onCheckedChange:A.setEnableMaxDomain}),b.createElement(oE,{htmlFor:`max_domain_${A.text}`},e("config.max_domain"))),b.createElement(dH,{className:"w-32",value:A.domainMax,onChange:t=>{const i=Number(t.target.value);isNaN(i)||A.setDomainMax(i)},type:"number",disabled:!A.enableMaxDomain})))}function mH(A){return b.createElement("div",{className:"border p-4 m-4 rounded-lg"},A.children)}function pH(A){return b.createElement("div",{className:"border-t mt-4 pt-4"},A.children)}function fH(A){return b.createElement("div",{className:"text-xs text-muted-foreground font-medium"},A.children)}function yH(A){return b.createElement("h2",{className:"text-xl text-foreground font-medium"},A.children)}const hKt=[{value:720,name:"(UTC-12:00) Dateline Standard Time"},{value:660,name:"(UTC-11:00) Niue Time, Samoa Standard Time"},{value:600,name:"(UTC-10:00) Cook Is. Time, Hawaii Standard Time, Tahiti Time"},{value:570,name:"(UTC-09:30) Marquesas Time"},{value:540,name:"(UTC-09:00) Gambier Time, Hawaii Daylight Time"},{value:480,name:"(UTC-08:00) Alaska Daylight Time, Pacific Standard Time, Pitcairn Standard Time"},{value:420,name:"(UTC-07:00) Mountain Standard Time, Pacific Daylight Time"},{value:360,name:"(UTC-06:00) Central Standard Time, Galapagos Time, Mountain Daylight Time"},{value:300,name:"(UTC-05:00) Acre Time, Central Daylight Time, Colombia Time, Easter Is. Time, Eastern Standard Time, Ecuador Time, Peru Time"},{value:270,name:"(UTC-04:30) Venezuela Time"},{value:240,name:"(UTC-04:00) Amazon Time, Atlantic Standard Time, Bolivia Time, Cuba Daylight Time, Eastern Daylight Time, Guyana Time, Paraguay Time"},{value:180,name:"(UTC-03:00) Argentine Time, Atlantic Daylight Time, Brasilia Time, Chile Time, Falkland Is. Time, French Guiana Time, Rothera Time, Suriname Time, Uruguay Time"},{value:150,name:"(UTC-02:30) Newfoundland Daylight Time"},{value:120,name:"(UTC-02:00) Fernando de Noronha Time, Pierre & Miquelon Daylight Time, South Georgia Standard Time, Western Greenland Summer Time"},{value:60,name:"(UTC-01:00) Cape Verde Time"},{value:0,name:"(UTC) Azores Summer Time, Coordinated Universal Time, Eastern Greenland Summer Time, Ghana Mean Time, Greenwich Mean Time"},{value:-60,name:"(UTC+01:00) British Summer Time, Central European Time, Irish Summer Time, Western African Time, Western European Summer Time"},{value:-120,name:"(UTC+02:00) Central African Time, Central European Summer Time, Eastern European Time, Middle Europe Summer Time, South Africa Standard Time"},{value:-180,name:"(UTC+03:00) Arabia Standard Time, Eastern African Time, Eastern European Summer Time, Israel Daylight Time, Moscow Standard Time, Syowa Time"},{value:-240,name:"(UTC+04:00) Armenia Time, Georgia Time, Gulf Standard Time, Mauritius Time, Reunion Time, Samara Time, Seychelles Time"},{value:-270,name:"(UTC+04:30) Afghanistan Time, Iran Daylight Time"},{value:-300,name:"(UTC+05:00) Aqtau Time, Aqtobe Time, Azerbaijan Summer Time, French Southern & Antarctic Lands Time, Maldives Time, Mawson Time, Oral Time, Pakistan Time, Tajikistan Time, Turkmenistan Time, Uzbekistan Time, Yekaterinburg Time"},{value:-330,name:"(UTC+05:30) India Standard Time"},{value:-345,name:"(UTC+05:45) Nepal Time"},{value:-360,name:"(UTC+06:00) Alma-Ata Time, Bangladesh Time, Bhutan Time, Indian Ocean Territory Time, Kirgizstan Time, Novosibirsk Time, Omsk Time, Qyzylorda Time, Vostok Time, Xinjiang Standard Time"},{value:-390,name:"(UTC+06:30) Cocos Islands Time, Myanmar Time"},{value:-420,name:"(UTC+07:00) Christmas Island Time, Davis Time, Indochina Time, Krasnoyarsk Time, West Indonesia Time"},{value:-480,name:"(UTC+08:00) Australian Western Standard Time, Brunei Time, Central Indonesia Time, China Standard Time, Hong Kong Time, Hovd Summer Time, Irkutsk Time, Malaysia Time, Philippines Time, Singapore Time"},{value:-525,name:"(UTC+08:45) Australian Central Western Standard Time"},{value:-540,name:"(UTC+09:00) Choibalsan Summer Time, East Indonesia Time, Japan Standard Time, Khandyga Time, Korea Standard Time, Palau Time, Timor-Leste Time, Ulaanbaatar Summer Time, Yakutsk Time"},{value:-570,name:"(UTC+09:30) Australian Central Standard Time (Northern Territory), Australian Central Standard Time (South Australia), Australian Central Standard Time (South Australia/New South Wales)"},{value:-600,name:"(UTC+10:00) Australian Eastern Standard Time (New South Wales), Australian Eastern Standard Time (Queensland), Australian Eastern Standard Time (Tasmania), Australian Eastern Standard Time (Victoria), Chamorro Standard Time, Chuuk Time, Dumont-d'Urville Time, Magadan Time, Papua New Guinea Time, Sakhalin Time, Ust-Nera Time, Vladivostok Time"},{value:-630,name:"(UTC+10:30) Lord Howe Standard Time"},{value:-660,name:"(UTC+11:00) Bougainville Standard Time, Kosrae Time, Macquarie Island Standard Time, New Caledonia Time, Pohnpei Time, Solomon Is. Time, Srednekolymsk Time, Vanuatu Time"},{value:-690,name:"(UTC+11:30) Norfolk Time"},{value:-720,name:"(UTC+12:00) Anadyr Time, Fiji Time, Gilbert Is. Time, Marshall Islands Time, Nauru Time, New Zealand Standard Time, Petropavlovsk-Kamchatski Time, Tuvalu Time, Wake Time, Wallis & Futuna Time"},{value:-765,name:"(UTC+12:45) Chatham Standard Time"},{value:-780,name:"(UTC+13:00) Phoenix Is. Time, Tokelau Time, Tonga Time, West Samoa Standard Time"},{value:-840,name:"(UTC+14:00) Line Is. Time"}];var xre=1,mKt=.9,pKt=.8,fKt=.17,NhA=.1,YhA=.999,yKt=.9999,bKt=.99,wKt=/[\\\/_+.#"@\[\(\{&]/,DKt=/[\\\/_+.#"@\[\(\{&]/g,GKt=/[\s-]/,Fre=/[\s-]/g;function RhA(A,e,t,i,n,o,g){if(o===e.length)return n===A.length?xre:bKt;var a=`${n},${o}`;if(g[a]!==void 0)return g[a];for(var s=i.charAt(o),I=t.indexOf(s,n),r=0,C,l,c,B;I>=0;)C=RhA(A,e,t,i,I+1,o+1,g),C>r&&(I===n?C*=xre:wKt.test(A.charAt(I-1))?(C*=pKt,c=A.slice(n,I-1).match(DKt),c&&n>0&&(C*=Math.pow(YhA,c.length))):GKt.test(A.charAt(I-1))?(C*=mKt,B=A.slice(n,I-1).match(Fre),B&&n>0&&(C*=Math.pow(YhA,B.length))):(C*=fKt,n>0&&(C*=Math.pow(YhA,I-n))),A.charAt(I)!==e.charAt(o)&&(C*=yKt)),(C<NhA&&t.charAt(I-1)===i.charAt(o+1)||i.charAt(o+1)===i.charAt(o)&&t.charAt(I-1)!==i.charAt(o))&&(l=RhA(A,e,t,i,I+1,o+2,g),l*NhA>C&&(C=l*NhA)),C>r&&(r=C),I=t.indexOf(s,I+1);return g[a]=r,r}function Mre(A){return A.toLowerCase().replace(Fre," ")}function kKt(A,e,t){return A=t&&t.length>0?`${A+" "+t.join(" ")}`:A,RhA(A,e,Mre(A),Mre(e),0,0,{})}var bH='[cmdk-group=""]',xhA='[cmdk-group-items=""]',JKt='[cmdk-group-heading=""]',vre='[cmdk-item=""]',Lre=`${vre}:not([aria-disabled="true"])`,FhA="cmdk-item-select",KN="data-value",NKt=(A,e,t)=>kKt(A,e,t),Sre=p.createContext(void 0),wH=()=>p.useContext(Sre),Hre=p.createContext(void 0),MhA=()=>p.useContext(Hre),Zre=p.createContext(void 0),Wre=p.forwardRef((A,e)=>{let t=UN(()=>{var j,O;return{search:"",value:(O=(j=A.value)!=null?j:A.defaultValue)!=null?O:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=UN(()=>new Set),n=UN(()=>new Map),o=UN(()=>new Map),g=UN(()=>new Set),a=Kre(A),{label:s,children:I,value:r,onValueChange:C,filter:l,shouldFilter:c,loop:B,disablePointerSelection:E=!1,vimBindings:u=!0,...d}=A,f=_o(),w=_o(),y=_o(),G=p.useRef(null),R=WKt();Yw(()=>{if(r!==void 0){let j=r.trim();t.current.value=j,x.emit()}},[r]),Yw(()=>{R(6,v)},[]);let x=p.useMemo(()=>({subscribe:j=>(g.current.add(j),()=>g.current.delete(j)),snapshot:()=>t.current,setState:(j,O,eA)=>{var oA,tA,sA,gA;if(!Object.is(t.current[j],O)){if(t.current[j]=O,j==="search")N(),k(),R(1,h);else if(j==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let iA=document.getElementById(y);iA?iA.focus():(oA=document.getElementById(f))==null||oA.focus()}if(R(7,()=>{var iA;t.current.selectedItemId=(iA=K())==null?void 0:iA.id,x.emit()}),eA||R(5,v),((tA=a.current)==null?void 0:tA.value)!==void 0){let iA=O??"";(gA=(sA=a.current).onValueChange)==null||gA.call(sA,iA);return}}x.emit()}},emit:()=>{g.current.forEach(j=>j())}}),[]),F=p.useMemo(()=>({value:(j,O,eA)=>{var oA;O!==((oA=o.current.get(j))==null?void 0:oA.value)&&(o.current.set(j,{value:O,keywords:eA}),t.current.filtered.items.set(j,Q(O,eA)),R(2,()=>{k(),x.emit()}))},item:(j,O)=>(i.current.add(j),O&&(n.current.has(O)?n.current.get(O).add(j):n.current.set(O,new Set([j]))),R(3,()=>{N(),k(),t.current.value||h(),x.emit()}),()=>{o.current.delete(j),i.current.delete(j),t.current.filtered.items.delete(j);let eA=K();R(4,()=>{N(),(eA==null?void 0:eA.getAttribute("id"))===j&&h(),x.emit()})}),group:j=>(n.current.has(j)||n.current.set(j,new Set),()=>{o.current.delete(j),n.current.delete(j)}),filter:()=>a.current.shouldFilter,label:s||A["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:f,inputId:y,labelId:w,listInnerRef:G}),[]);function Q(j,O){var eA,oA;let tA=(oA=(eA=a.current)==null?void 0:eA.filter)!=null?oA:NKt;return j?tA(j,t.current.search,O):0}function k(){if(!t.current.search||a.current.shouldFilter===!1)return;let j=t.current.filtered.items,O=[];t.current.filtered.groups.forEach(oA=>{let tA=n.current.get(oA),sA=0;tA.forEach(gA=>{let iA=j.get(gA);sA=Math.max(iA,sA)}),O.push([oA,sA])});let eA=G.current;U().sort((oA,tA)=>{var sA,gA;let iA=oA.getAttribute("id"),aA=tA.getAttribute("id");return((sA=j.get(aA))!=null?sA:0)-((gA=j.get(iA))!=null?gA:0)}).forEach(oA=>{let tA=oA.closest(xhA);tA?tA.appendChild(oA.parentElement===tA?oA:oA.closest(`${xhA} > *`)):eA.appendChild(oA.parentElement===eA?oA:oA.closest(`${xhA} > *`))}),O.sort((oA,tA)=>tA[1]-oA[1]).forEach(oA=>{var tA;let sA=(tA=G.current)==null?void 0:tA.querySelector(`${bH}[${KN}="${encodeURIComponent(oA[0])}"]`);sA==null||sA.parentElement.appendChild(sA)})}function h(){let j=U().find(eA=>eA.getAttribute("aria-disabled")!=="true"),O=j==null?void 0:j.getAttribute(KN);x.setState("value",O||void 0)}function N(){var j,O,eA,oA;if(!t.current.search||a.current.shouldFilter===!1){t.current.filtered.count=i.current.size;return}t.current.filtered.groups=new Set;let tA=0;for(let sA of i.current){let gA=(O=(j=o.current.get(sA))==null?void 0:j.value)!=null?O:"",iA=(oA=(eA=o.current.get(sA))==null?void 0:eA.keywords)!=null?oA:[],aA=Q(gA,iA);t.current.filtered.items.set(sA,aA),aA>0&&tA++}for(let[sA,gA]of n.current)for(let iA of gA)if(t.current.filtered.items.get(iA)>0){t.current.filtered.groups.add(sA);break}t.current.filtered.count=tA}function v(){var j,O,eA;let oA=K();oA&&(((j=oA.parentElement)==null?void 0:j.firstChild)===oA&&((eA=(O=oA.closest(bH))==null?void 0:O.querySelector(JKt))==null||eA.scrollIntoView({block:"nearest"})),oA.scrollIntoView({block:"nearest"}))}function K(){var j;return(j=G.current)==null?void 0:j.querySelector(`${vre}[aria-selected="true"]`)}function U(){var j;return Array.from(((j=G.current)==null?void 0:j.querySelectorAll(Lre))||[])}function V(j){let O=U()[j];O&&x.setState("value",O.getAttribute(KN))}function X(j){var O;let eA=K(),oA=U(),tA=oA.findIndex(gA=>gA===eA),sA=oA[tA+j];(O=a.current)!=null&&O.loop&&(sA=tA+j<0?oA[oA.length-1]:tA+j===oA.length?oA[0]:oA[tA+j]),sA&&x.setState("value",sA.getAttribute(KN))}function _(j){let O=K(),eA=O==null?void 0:O.closest(bH),oA;for(;eA&&!oA;)eA=j>0?HKt(eA,bH):ZKt(eA,bH),oA=eA==null?void 0:eA.querySelector(Lre);oA?x.setState("value",oA.getAttribute(KN)):X(j)}let q=()=>V(U().length-1),$=j=>{j.preventDefault(),j.metaKey?q():j.altKey?_(1):X(1)},nA=j=>{j.preventDefault(),j.metaKey?V(0):j.altKey?_(-1):X(-1)};return p.createElement(re.div,{ref:e,tabIndex:-1,...d,"cmdk-root":"",onKeyDown:j=>{var O;(O=d.onKeyDown)==null||O.call(d,j);let eA=j.nativeEvent.isComposing||j.keyCode===229;if(!(j.defaultPrevented||eA))switch(j.key){case"n":case"j":{u&&j.ctrlKey&&$(j);break}case"ArrowDown":{$(j);break}case"p":case"k":{u&&j.ctrlKey&&nA(j);break}case"ArrowUp":{nA(j);break}case"Home":{j.preventDefault(),V(0);break}case"End":{j.preventDefault(),q();break}case"Enter":{j.preventDefault();let oA=K();if(oA){let tA=new Event(FhA);oA.dispatchEvent(tA)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:F.inputId,id:F.labelId,style:UKt},s),xq(A,j=>p.createElement(Hre.Provider,{value:x},p.createElement(Sre.Provider,{value:F},j))))}),YKt=p.forwardRef((A,e)=>{var t,i;let n=_o(),o=p.useRef(null),g=p.useContext(Zre),a=wH(),s=Kre(A),I=(i=(t=s.current)==null?void 0:t.forceMount)!=null?i:g==null?void 0:g.forceMount;Yw(()=>{if(!I)return a.item(n,g==null?void 0:g.id)},[I]);let r=Ure(n,o,[A.value,A.children,o],A.keywords),C=MhA(),l=D0(R=>R.value&&R.value===r.current),c=D0(R=>I||a.filter()===!1?!0:R.search?R.filtered.items.get(n)>0:!0);p.useEffect(()=>{let R=o.current;if(!(!R||A.disabled))return R.addEventListener(FhA,B),()=>R.removeEventListener(FhA,B)},[c,A.onSelect,A.disabled]);function B(){var R,x;E(),(x=(R=s.current).onSelect)==null||x.call(R,r.current)}function E(){C.setState("value",r.current,!0)}if(!c)return null;let{disabled:u,value:d,onSelect:f,forceMount:w,keywords:y,...G}=A;return p.createElement(re.div,{ref:Wu(o,e),...G,id:n,"cmdk-item":"",role:"option","aria-disabled":!!u,"aria-selected":!!l,"data-disabled":!!u,"data-selected":!!l,onPointerMove:u||a.getDisablePointerSelection()?void 0:E,onClick:u?void 0:B},A.children)}),RKt=p.forwardRef((A,e)=>{let{heading:t,children:i,forceMount:n,...o}=A,g=_o(),a=p.useRef(null),s=p.useRef(null),I=_o(),r=wH(),C=D0(c=>n||r.filter()===!1?!0:c.search?c.filtered.groups.has(g):!0);Yw(()=>r.group(g),[]),Ure(g,a,[A.value,A.heading,s]);let l=p.useMemo(()=>({id:g,forceMount:n}),[n]);return p.createElement(re.div,{ref:Wu(a,e),...o,"cmdk-group":"",role:"presentation",hidden:C?void 0:!0},t&&p.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:I},t),xq(A,c=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?I:void 0},p.createElement(Zre.Provider,{value:l},c))))}),xKt=p.forwardRef((A,e)=>{let{alwaysRender:t,...i}=A,n=p.useRef(null),o=D0(g=>!g.search);return!t&&!o?null:p.createElement(re.div,{ref:Wu(n,e),...i,"cmdk-separator":"",role:"separator"})}),FKt=p.forwardRef((A,e)=>{let{onValueChange:t,...i}=A,n=A.value!=null,o=MhA(),g=D0(I=>I.search),a=D0(I=>I.selectedItemId),s=wH();return p.useEffect(()=>{A.value!=null&&o.setState("search",A.value)},[A.value]),p.createElement(re.input,{ref:e,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,"aria-activedescendant":a,id:s.inputId,type:"text",value:n?A.value:g,onChange:I=>{n||o.setState("search",I.target.value),t==null||t(I.target.value)}})}),MKt=p.forwardRef((A,e)=>{let{children:t,label:i="Suggestions",...n}=A,o=p.useRef(null),g=p.useRef(null),a=D0(I=>I.selectedItemId),s=wH();return p.useEffect(()=>{if(g.current&&o.current){let I=g.current,r=o.current,C,l=new ResizeObserver(()=>{C=requestAnimationFrame(()=>{let c=I.offsetHeight;r.style.setProperty("--cmdk-list-height",c.toFixed(1)+"px")})});return l.observe(I),()=>{cancelAnimationFrame(C),l.unobserve(I)}}},[]),p.createElement(re.div,{ref:Wu(o,e),...n,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":i,id:s.listId},xq(A,I=>p.createElement("div",{ref:Wu(g,s.listInnerRef),"cmdk-list-sizer":""},I)))}),vKt=p.forwardRef((A,e)=>{let{open:t,onOpenChange:i,overlayClassName:n,contentClassName:o,container:g,...a}=A;return p.createElement(ige,{open:t,onOpenChange:i},p.createElement(nge,{container:g},p.createElement(oge,{"cmdk-overlay":"",className:n}),p.createElement(KS,{"aria-label":A.label,"cmdk-dialog":"",className:o},p.createElement(Wre,{ref:e,...a}))))}),LKt=p.forwardRef((A,e)=>D0(t=>t.filtered.count===0)?p.createElement(re.div,{ref:e,...A,"cmdk-empty":"",role:"presentation"}):null),SKt=p.forwardRef((A,e)=>{let{progress:t,children:i,label:n="Loading...",...o}=A;return p.createElement(re.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},xq(A,g=>p.createElement("div",{"aria-hidden":!0},g)))}),DH=Object.assign(Wre,{List:MKt,Item:YKt,Input:FKt,Group:RKt,Separator:xKt,Dialog:vKt,Empty:LKt,Loading:SKt});function HKt(A,e){let t=A.nextElementSibling;for(;t;){if(t.matches(e))return t;t=t.nextElementSibling}}function ZKt(A,e){let t=A.previousElementSibling;for(;t;){if(t.matches(e))return t;t=t.previousElementSibling}}function Kre(A){let e=p.useRef(A);return Yw(()=>{e.current=A}),e}var Yw=typeof window>"u"?p.useEffect:p.useLayoutEffect;function UN(A){let e=p.useRef();return e.current===void 0&&(e.current=A()),e}function D0(A){let e=MhA(),t=()=>A(e.snapshot());return p.useSyncExternalStore(e.subscribe,t,t)}function Ure(A,e,t,i=[]){let n=p.useRef(),o=wH();return Yw(()=>{var g;let a=(()=>{var I;for(let r of t){if(typeof r=="string")return r.trim();if(typeof r=="object"&&"current"in r)return r.current?(I=r.current.textContent)==null?void 0:I.trim():n.current}})(),s=i.map(I=>I.trim());o.value(A,a,s),(g=e.current)==null||g.setAttribute(KN,a),n.current=a}),n}var WKt=()=>{let[A,e]=p.useState(),t=UN(()=>new Map);return Yw(()=>{t.current.forEach(i=>i()),t.current=new Map},[A]),(i,n)=>{t.current.set(i,n),e({})}};function KKt(A){let e=A.type;return typeof e=="function"?e(A.props):"render"in e?e.render(A.props):A}function xq({asChild:A,children:e},t){return A&&p.isValidElement(e)?p.cloneElement(KKt(e),{ref:e.ref},t(e.props.children)):t(e)}var UKt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function VKt({className:A,...e}){return p.createElement(DH,{"data-slot":"command",className:Ce("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",A),...e})}function XKt({className:A,...e}){return p.createElement("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3"},p.createElement(U5e,{className:"size-4 shrink-0 opacity-50"}),p.createElement(DH.Input,{"data-slot":"command-input",className:Ce("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",A),...e}))}function zKt({...A}){return p.createElement(DH.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...A})}function TKt({className:A,...e}){return p.createElement(DH.Group,{"data-slot":"command-group",className:Ce("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",A),...e})}function _Kt({className:A,...e}){return p.createElement(DH.Item,{"data-slot":"command-item",className:Ce("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",A),...e})}function Fq({options:A=[],selectedKey:e,onSelect:t,className:i,popClassName:n,placeholder:o="Select A Value"}){var g;const[a,s]=p.useState(!1),I=e||"_none";return b.createElement(TnA,{open:a,onOpenChange:s},b.createElement(_nA,{asChild:!0},b.createElement(fe,{variant:"outline",role:"combobox","aria-expanded":a,className:Ce("flex justify-between",i)},b.createElement("div",{className:"shrink min-w-[0px] overflow-hidden text-ellipsis whitespace-nowrap"},((g=A.find(r=>r.value===I))==null?void 0:g.label)??o),b.createElement(vHA,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"}))),b.createElement(mX,{className:Ce("p-0",n)},b.createElement(VKt,null,b.createElement(XKt,{placeholder:"Search...",className:"h-9"}),b.createElement(zKt,null,"No options found."),b.createElement(rge,{className:"h-min max-h-48"},b.createElement(TKt,null,A.map(r=>b.createElement(_Kt,{key:r.value,value:r.value,onSelect:()=>{r.value==="_none"?t==null||t(""):t==null||t(r.value===I?"":r.value),s(!1)}},r.label,b.createElement(TF,{className:Ce("ml-auto h-4 w-4",I===r.value?"opacity-100":"opacity-0")}))))))))}var kl={},GH={},OKt=Array.isArray,IB=OKt,qKt=uw,jKt=IB,PKt=vd,$Kt="[object String]";function AUt(A){return typeof A=="string"||!jKt(A)&&PKt(A)&&qKt(A)==$Kt}var eUt=AUt;function tUt(A){return function(e,t,i){for(var n=-1,o=Object(e),g=i(e),a=g.length;a--;){var s=g[A?a:++n];if(t(o[s],s,o)===!1)break}return e}}var iUt=tUt,nUt=iUt,oUt=nUt(),gUt=oUt;function aUt(A,e){for(var t=-1,i=Array(A);++t<A;)i[t]=e(t);return i}var sUt=aUt,rUt=uw,IUt=vd,CUt="[object Arguments]";function lUt(A){return IUt(A)&&rUt(A)==CUt}var cUt=lUt,Vre=cUt,BUt=vd,Xre=Object.prototype,QUt=Xre.hasOwnProperty,EUt=Xre.propertyIsEnumerable,uUt=Vre(function(){return arguments}())?Vre:function(A){return BUt(A)&&QUt.call(A,"callee")&&!EUt.call(A,"callee")},zre=uUt,Mq={exports:{}};function dUt(){return!1}var hUt=dUt;Mq.exports,function(A,e){var t=Pc,i=hUt,n=e&&!e.nodeType&&e,o=n&&!0&&A&&!A.nodeType&&A,g=o&&o.exports===n,a=g?t.Buffer:void 0,s=a?a.isBuffer:void 0,I=s||i;A.exports=I}(Mq,Mq.exports);var vhA=Mq.exports,mUt=9007199254740991,pUt=/^(?:0|[1-9]\d*)$/;function fUt(A,e){var t=typeof A;return e=e??mUt,!!e&&(t=="number"||t!="symbol"&&pUt.test(A))&&A>-1&&A%1==0&&A<e}var Tre=fUt,yUt=9007199254740991;function bUt(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=yUt}var LhA=bUt,wUt=uw,DUt=LhA,GUt=vd,kUt="[object Arguments]",JUt="[object Array]",NUt="[object Boolean]",YUt="[object Date]",RUt="[object Error]",xUt="[object Function]",FUt="[object Map]",MUt="[object Number]",vUt="[object Object]",LUt="[object RegExp]",SUt="[object Set]",HUt="[object String]",ZUt="[object WeakMap]",WUt="[object ArrayBuffer]",KUt="[object DataView]",UUt="[object Float32Array]",VUt="[object Float64Array]",XUt="[object Int8Array]",zUt="[object Int16Array]",TUt="[object Int32Array]",_Ut="[object Uint8Array]",OUt="[object Uint8ClampedArray]",qUt="[object Uint16Array]",jUt="[object Uint32Array]",Jn={};Jn[UUt]=Jn[VUt]=Jn[XUt]=Jn[zUt]=Jn[TUt]=Jn[_Ut]=Jn[OUt]=Jn[qUt]=Jn[jUt]=!0,Jn[kUt]=Jn[JUt]=Jn[WUt]=Jn[NUt]=Jn[KUt]=Jn[YUt]=Jn[RUt]=Jn[xUt]=Jn[FUt]=Jn[MUt]=Jn[vUt]=Jn[LUt]=Jn[SUt]=Jn[HUt]=Jn[ZUt]=!1;function PUt(A){return GUt(A)&&DUt(A.length)&&!!Jn[wUt(A)]}var $Ut=PUt;function AVt(A){return function(e){return A(e)}}var ShA=AVt,vq={exports:{}};vq.exports,function(A,e){var t=F$A,i=e&&!e.nodeType&&e,n=i&&!0&&A&&!A.nodeType&&A,o=n&&n.exports===i,g=o&&t.process,a=function(){try{var s=n&&n.require&&n.require("util").types;return s||g&&g.binding&&g.binding("util")}catch{}}();A.exports=a}(vq,vq.exports);var HhA=vq.exports,eVt=$Ut,tVt=ShA,_re=HhA,Ore=_re&&_re.isTypedArray,iVt=Ore?tVt(Ore):eVt,qre=iVt,nVt=sUt,oVt=zre,gVt=IB,aVt=vhA,sVt=Tre,rVt=qre,IVt=Object.prototype,CVt=IVt.hasOwnProperty;function lVt(A,e){var t=gVt(A),i=!t&&oVt(A),n=!t&&!i&&aVt(A),o=!t&&!i&&!n&&rVt(A),g=t||i||n||o,a=g?nVt(A.length,String):[],s=a.length;for(var I in A)(e||CVt.call(A,I))&&!(g&&(I=="length"||n&&(I=="offset"||I=="parent")||o&&(I=="buffer"||I=="byteLength"||I=="byteOffset")||sVt(I,s)))&&a.push(I);return a}var jre=lVt,cVt=Object.prototype;function BVt(A){var e=A&&A.constructor,t=typeof e=="function"&&e.prototype||cVt;return A===t}var ZhA=BVt;function QVt(A,e){return function(t){return A(e(t))}}var Pre=QVt,EVt=Pre,uVt=EVt(Object.keys,Object),dVt=uVt,hVt=ZhA,mVt=dVt,pVt=Object.prototype,fVt=pVt.hasOwnProperty;function yVt(A){if(!hVt(A))return mVt(A);var e=[];for(var t in Object(A))fVt.call(A,t)&&t!="constructor"&&e.push(t);return e}var bVt=yVt,wVt=uw,DVt=Md,GVt="[object AsyncFunction]",kVt="[object Function]",JVt="[object GeneratorFunction]",NVt="[object Proxy]";function YVt(A){if(!DVt(A))return!1;var e=wVt(A);return e==kVt||e==JVt||e==GVt||e==NVt}var $re=YVt,RVt=$re,xVt=LhA;function FVt(A){return A!=null&&xVt(A.length)&&!RVt(A)}var Lq=FVt,MVt=jre,vVt=bVt,LVt=Lq;function SVt(A){return LVt(A)?MVt(A):vVt(A)}var kH=SVt,HVt=gUt,ZVt=kH;function WVt(A,e){return A&&HVt(A,e,ZVt)}var AIe=WVt;function KVt(A){return A}var eIe=KVt,UVt=eIe;function VVt(A){return typeof A=="function"?A:UVt}var XVt=VVt,zVt=AIe,TVt=XVt;function _Vt(A,e){return A&&zVt(A,TVt(e))}var WhA=_Vt,OVt=Pre,qVt=OVt(Object.getPrototypeOf,Object),KhA=qVt,jVt=uw,PVt=KhA,$Vt=vd,AXt="[object Object]",eXt=Function.prototype,tXt=Object.prototype,tIe=eXt.toString,iXt=tXt.hasOwnProperty,nXt=tIe.call(Object);function oXt(A){if(!$Vt(A)||jVt(A)!=AXt)return!1;var e=PVt(A);if(e===null)return!0;var t=iXt.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&tIe.call(t)==nXt}var gXt=oXt;function aXt(A,e){for(var t=-1,i=A==null?0:A.length,n=Array(i);++t<i;)n[t]=e(A[t],t,A);return n}var iIe=aXt;function sXt(){this.__data__=[],this.size=0}var rXt=sXt;function IXt(A,e){return A===e||A!==A&&e!==e}var UhA=IXt,CXt=UhA;function lXt(A,e){for(var t=A.length;t--;)if(CXt(A[t][0],e))return t;return-1}var Sq=lXt,cXt=Sq,BXt=Array.prototype,QXt=BXt.splice;function EXt(A){var e=this.__data__,t=cXt(e,A);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():QXt.call(e,t,1),--this.size,!0}var uXt=EXt,dXt=Sq;function hXt(A){var e=this.__data__,t=dXt(e,A);return t<0?void 0:e[t][1]}var mXt=hXt,pXt=Sq;function fXt(A){return pXt(this.__data__,A)>-1}var yXt=fXt,bXt=Sq;function wXt(A,e){var t=this.__data__,i=bXt(t,A);return i<0?(++this.size,t.push([A,e])):t[i][1]=e,this}var DXt=wXt,GXt=rXt,kXt=uXt,JXt=mXt,NXt=yXt,YXt=DXt;function VN(A){var e=-1,t=A==null?0:A.length;for(this.clear();++e<t;){var i=A[e];this.set(i[0],i[1])}}VN.prototype.clear=GXt,VN.prototype.delete=kXt,VN.prototype.get=JXt,VN.prototype.has=NXt,VN.prototype.set=YXt;var Hq=VN,RXt=Hq;function xXt(){this.__data__=new RXt,this.size=0}var FXt=xXt;function MXt(A){var e=this.__data__,t=e.delete(A);return this.size=e.size,t}var vXt=MXt;function LXt(A){return this.__data__.get(A)}var SXt=LXt;function HXt(A){return this.__data__.has(A)}var ZXt=HXt,WXt=Pc,KXt=WXt["__core-js_shared__"],UXt=KXt,VhA=UXt,nIe=function(){var A=/[^.]+$/.exec(VhA&&VhA.keys&&VhA.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}();function VXt(A){return!!nIe&&nIe in A}var XXt=VXt,zXt=Function.prototype,TXt=zXt.toString;function _Xt(A){if(A!=null){try{return TXt.call(A)}catch{}try{return A+""}catch{}}return""}var oIe=_Xt,OXt=$re,qXt=XXt,jXt=Md,PXt=oIe,$Xt=/[\\^$.*+?()[\]{}|]/g,A9t=/^\[object .+?Constructor\]$/,e9t=Function.prototype,t9t=Object.prototype,i9t=e9t.toString,n9t=t9t.hasOwnProperty,o9t=RegExp("^"+i9t.call(n9t).replace($Xt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g9t(A){if(!jXt(A)||qXt(A))return!1;var e=OXt(A)?o9t:A9t;return e.test(PXt(A))}var a9t=g9t;function s9t(A,e){return A==null?void 0:A[e]}var r9t=s9t,I9t=a9t,C9t=r9t;function l9t(A,e){var t=C9t(A,e);return I9t(t)?t:void 0}var Rw=l9t,c9t=Rw,B9t=Pc,Q9t=c9t(B9t,"Map"),XhA=Q9t,E9t=Rw,u9t=E9t(Object,"create"),Zq=u9t,gIe=Zq;function d9t(){this.__data__=gIe?gIe(null):{},this.size=0}var h9t=d9t;function m9t(A){var e=this.has(A)&&delete this.__data__[A];return this.size-=e?1:0,e}var p9t=m9t,f9t=Zq,y9t="__lodash_hash_undefined__",b9t=Object.prototype,w9t=b9t.hasOwnProperty;function D9t(A){var e=this.__data__;if(f9t){var t=e[A];return t===y9t?void 0:t}return w9t.call(e,A)?e[A]:void 0}var G9t=D9t,k9t=Zq,J9t=Object.prototype,N9t=J9t.hasOwnProperty;function Y9t(A){var e=this.__data__;return k9t?e[A]!==void 0:N9t.call(e,A)}var R9t=Y9t,x9t=Zq,F9t="__lodash_hash_undefined__";function M9t(A,e){var t=this.__data__;return this.size+=this.has(A)?0:1,t[A]=x9t&&e===void 0?F9t:e,this}var v9t=M9t,L9t=h9t,S9t=p9t,H9t=G9t,Z9t=R9t,W9t=v9t;function XN(A){var e=-1,t=A==null?0:A.length;for(this.clear();++e<t;){var i=A[e];this.set(i[0],i[1])}}XN.prototype.clear=L9t,XN.prototype.delete=S9t,XN.prototype.get=H9t,XN.prototype.has=Z9t,XN.prototype.set=W9t;var K9t=XN,aIe=K9t,U9t=Hq,V9t=XhA;function X9t(){this.size=0,this.__data__={hash:new aIe,map:new(V9t||U9t),string:new aIe}}var z9t=X9t;function T9t(A){var e=typeof A;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?A!=="__proto__":A===null}var _9t=T9t,O9t=_9t;function q9t(A,e){var t=A.__data__;return O9t(e)?t[typeof e=="string"?"string":"hash"]:t.map}var Wq=q9t,j9t=Wq;function P9t(A){var e=j9t(this,A).delete(A);return this.size-=e?1:0,e}var $9t=P9t,A5t=Wq;function e5t(A){return A5t(this,A).get(A)}var t5t=e5t,i5t=Wq;function n5t(A){return i5t(this,A).has(A)}var o5t=n5t,g5t=Wq;function a5t(A,e){var t=g5t(this,A),i=t.size;return t.set(A,e),this.size+=t.size==i?0:1,this}var s5t=a5t,r5t=z9t,I5t=$9t,C5t=t5t,l5t=o5t,c5t=s5t;function zN(A){var e=-1,t=A==null?0:A.length;for(this.clear();++e<t;){var i=A[e];this.set(i[0],i[1])}}zN.prototype.clear=r5t,zN.prototype.delete=I5t,zN.prototype.get=C5t,zN.prototype.has=l5t,zN.prototype.set=c5t;var zhA=zN,B5t=Hq,Q5t=XhA,E5t=zhA,u5t=200;function d5t(A,e){var t=this.__data__;if(t instanceof B5t){var i=t.__data__;if(!Q5t||i.length<u5t-1)return i.push([A,e]),this.size=++t.size,this;t=this.__data__=new E5t(i)}return t.set(A,e),this.size=t.size,this}var h5t=d5t,m5t=Hq,p5t=FXt,f5t=vXt,y5t=SXt,b5t=ZXt,w5t=h5t;function TN(A){var e=this.__data__=new m5t(A);this.size=e.size}TN.prototype.clear=p5t,TN.prototype.delete=f5t,TN.prototype.get=y5t,TN.prototype.has=b5t,TN.prototype.set=w5t;var ThA=TN,D5t="__lodash_hash_undefined__";function G5t(A){return this.__data__.set(A,D5t),this}var k5t=G5t;function J5t(A){return this.__data__.has(A)}var N5t=J5t,Y5t=zhA,R5t=k5t,x5t=N5t;function Kq(A){var e=-1,t=A==null?0:A.length;for(this.__data__=new Y5t;++e<t;)this.add(A[e])}Kq.prototype.add=Kq.prototype.push=R5t,Kq.prototype.has=x5t;var F5t=Kq;function M5t(A,e){for(var t=-1,i=A==null?0:A.length;++t<i;)if(e(A[t],t,A))return!0;return!1}var v5t=M5t;function L5t(A,e){return A.has(e)}var S5t=L5t,H5t=F5t,Z5t=v5t,W5t=S5t,K5t=1,U5t=2;function V5t(A,e,t,i,n,o){var g=t&K5t,a=A.length,s=e.length;if(a!=s&&!(g&&s>a))return!1;var I=o.get(A),r=o.get(e);if(I&&r)return I==e&&r==A;var C=-1,l=!0,c=t&U5t?new H5t:void 0;for(o.set(A,e),o.set(e,A);++C<a;){var B=A[C],E=e[C];if(i)var u=g?i(E,B,C,e,A,o):i(B,E,C,A,e,o);if(u!==void 0){if(u)continue;l=!1;break}if(c){if(!Z5t(e,function(d,f){if(!W5t(c,f)&&(B===d||n(B,d,t,i,o)))return c.push(f)})){l=!1;break}}else if(!(B===E||n(B,E,t,i,o))){l=!1;break}}return o.delete(A),o.delete(e),l}var sIe=V5t,X5t=Pc,z5t=X5t.Uint8Array,rIe=z5t;function T5t(A){var e=-1,t=Array(A.size);return A.forEach(function(i,n){t[++e]=[n,i]}),t}var _5t=T5t;function O5t(A){var e=-1,t=Array(A.size);return A.forEach(function(i){t[++e]=i}),t}var q5t=O5t,IIe=aS,CIe=rIe,j5t=UhA,P5t=sIe,$5t=_5t,Azt=q5t,ezt=1,tzt=2,izt="[object Boolean]",nzt="[object Date]",ozt="[object Error]",gzt="[object Map]",azt="[object Number]",szt="[object RegExp]",rzt="[object Set]",Izt="[object String]",Czt="[object Symbol]",lzt="[object ArrayBuffer]",czt="[object DataView]",lIe=IIe?IIe.prototype:void 0,_hA=lIe?lIe.valueOf:void 0;function Bzt(A,e,t,i,n,o,g){switch(t){case czt:if(A.byteLength!=e.byteLength||A.byteOffset!=e.byteOffset)return!1;A=A.buffer,e=e.buffer;case lzt:return!(A.byteLength!=e.byteLength||!o(new CIe(A),new CIe(e)));case izt:case nzt:case azt:return j5t(+A,+e);case ozt:return A.name==e.name&&A.message==e.message;case szt:case Izt:return A==e+"";case gzt:var a=$5t;case rzt:var s=i&ezt;if(a||(a=Azt),A.size!=e.size&&!s)return!1;var I=g.get(A);if(I)return I==e;i|=tzt,g.set(A,e);var r=P5t(a(A),a(e),i,n,o,g);return g.delete(A),r;case Czt:if(_hA)return _hA.call(A)==_hA.call(e)}return!1}var Qzt=Bzt;function Ezt(A,e){for(var t=-1,i=e.length,n=A.length;++t<i;)A[n+t]=e[t];return A}var cIe=Ezt,uzt=cIe,dzt=IB;function hzt(A,e,t){var i=e(A);return dzt(A)?i:uzt(i,t(A))}var BIe=hzt;function mzt(A,e){for(var t=-1,i=A==null?0:A.length,n=0,o=[];++t<i;){var g=A[t];e(g,t,A)&&(o[n++]=g)}return o}var pzt=mzt;function fzt(){return[]}var QIe=fzt,yzt=pzt,bzt=QIe,wzt=Object.prototype,Dzt=wzt.propertyIsEnumerable,EIe=Object.getOwnPropertySymbols,Gzt=EIe?function(A){return A==null?[]:(A=Object(A),yzt(EIe(A),function(e){return Dzt.call(A,e)}))}:bzt,OhA=Gzt,kzt=BIe,Jzt=OhA,Nzt=kH;function Yzt(A){return kzt(A,Nzt,Jzt)}var uIe=Yzt,dIe=uIe,Rzt=1,xzt=Object.prototype,Fzt=xzt.hasOwnProperty;function Mzt(A,e,t,i,n,o){var g=t&Rzt,a=dIe(A),s=a.length,I=dIe(e),r=I.length;if(s!=r&&!g)return!1;for(var C=s;C--;){var l=a[C];if(!(g?l in e:Fzt.call(e,l)))return!1}var c=o.get(A),B=o.get(e);if(c&&B)return c==e&&B==A;var E=!0;o.set(A,e),o.set(e,A);for(var u=g;++C<s;){l=a[C];var d=A[l],f=e[l];if(i)var w=g?i(f,d,l,e,A,o):i(d,f,l,A,e,o);if(!(w===void 0?d===f||n(d,f,t,i,o):w)){E=!1;break}u||(u=l=="constructor")}if(E&&!u){var y=A.constructor,G=e.constructor;y!=G&&"constructor"in A&&"constructor"in e&&!(typeof y=="function"&&y instanceof y&&typeof G=="function"&&G instanceof G)&&(E=!1)}return o.delete(A),o.delete(e),E}var vzt=Mzt,Lzt=Rw,Szt=Pc,Hzt=Lzt(Szt,"DataView"),Zzt=Hzt,Wzt=Rw,Kzt=Pc,Uzt=Wzt(Kzt,"Promise"),Vzt=Uzt,Xzt=Rw,zzt=Pc,Tzt=Xzt(zzt,"Set"),_zt=Tzt,Ozt=Rw,qzt=Pc,jzt=Ozt(qzt,"WeakMap"),Pzt=jzt,qhA=Zzt,jhA=XhA,PhA=Vzt,$hA=_zt,AmA=Pzt,hIe=uw,_N=oIe,mIe="[object Map]",$zt="[object Object]",pIe="[object Promise]",fIe="[object Set]",yIe="[object WeakMap]",bIe="[object DataView]",ATt=_N(qhA),eTt=_N(jhA),tTt=_N(PhA),iTt=_N($hA),nTt=_N(AmA),xw=hIe;(qhA&&xw(new qhA(new ArrayBuffer(1)))!=bIe||jhA&&xw(new jhA)!=mIe||PhA&&xw(PhA.resolve())!=pIe||$hA&&xw(new $hA)!=fIe||AmA&&xw(new AmA)!=yIe)&&(xw=function(A){var e=hIe(A),t=e==$zt?A.constructor:void 0,i=t?_N(t):"";if(i)switch(i){case ATt:return bIe;case eTt:return mIe;case tTt:return pIe;case iTt:return fIe;case nTt:return yIe}return e});var Uq=xw,emA=ThA,oTt=sIe,gTt=Qzt,aTt=vzt,wIe=Uq,DIe=IB,GIe=vhA,sTt=qre,rTt=1,kIe="[object Arguments]",JIe="[object Array]",Vq="[object Object]",ITt=Object.prototype,NIe=ITt.hasOwnProperty;function CTt(A,e,t,i,n,o){var g=DIe(A),a=DIe(e),s=g?JIe:wIe(A),I=a?JIe:wIe(e);s=s==kIe?Vq:s,I=I==kIe?Vq:I;var r=s==Vq,C=I==Vq,l=s==I;if(l&&GIe(A)){if(!GIe(e))return!1;g=!0,r=!1}if(l&&!r)return o||(o=new emA),g||sTt(A)?oTt(A,e,t,i,n,o):gTt(A,e,s,t,i,n,o);if(!(t&rTt)){var c=r&&NIe.call(A,"__wrapped__"),B=C&&NIe.call(e,"__wrapped__");if(c||B){var E=c?A.value():A,u=B?e.value():e;return o||(o=new emA),n(E,u,t,i,o)}}return l?(o||(o=new emA),aTt(A,e,t,i,n,o)):!1}var lTt=CTt,cTt=lTt,YIe=vd;function RIe(A,e,t,i,n){return A===e?!0:A==null||e==null||!YIe(A)&&!YIe(e)?A!==A&&e!==e:cTt(A,e,t,i,RIe,n)}var xIe=RIe,BTt=ThA,QTt=xIe,ETt=1,uTt=2;function dTt(A,e,t,i){var n=t.length,o=n,g=!i;if(A==null)return!o;for(A=Object(A);n--;){var a=t[n];if(g&&a[2]?a[1]!==A[a[0]]:!(a[0]in A))return!1}for(;++n<o;){a=t[n];var s=a[0],I=A[s],r=a[1];if(g&&a[2]){if(I===void 0&&!(s in A))return!1}else{var C=new BTt;if(i)var l=i(I,r,s,A,e,C);if(!(l===void 0?QTt(r,I,ETt|uTt,i,C):l))return!1}}return!0}var hTt=dTt,mTt=Md;function pTt(A){return A===A&&!mTt(A)}var FIe=pTt,fTt=FIe,yTt=kH;function bTt(A){for(var e=yTt(A),t=e.length;t--;){var i=e[t],n=A[i];e[t]=[i,n,fTt(n)]}return e}var wTt=bTt;function DTt(A,e){return function(t){return t==null?!1:t[A]===e&&(e!==void 0||A in Object(t))}}var MIe=DTt,GTt=hTt,kTt=wTt,JTt=MIe;function NTt(A){var e=kTt(A);return e.length==1&&e[0][2]?JTt(e[0][0],e[0][1]):function(t){return t===A||GTt(t,A,e)}}var YTt=NTt,RTt=IB,xTt=D4,FTt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,MTt=/^\w*$/;function vTt(A,e){if(RTt(A))return!1;var t=typeof A;return t=="number"||t=="symbol"||t=="boolean"||A==null||xTt(A)?!0:MTt.test(A)||!FTt.test(A)||e!=null&&A in Object(e)}var tmA=vTt,vIe=zhA,LTt="Expected a function";function imA(A,e){if(typeof A!="function"||e!=null&&typeof e!="function")throw new TypeError(LTt);var t=function(){var i=arguments,n=e?e.apply(this,i):i[0],o=t.cache;if(o.has(n))return o.get(n);var g=A.apply(this,i);return t.cache=o.set(n,g)||o,g};return t.cache=new(imA.Cache||vIe),t}imA.Cache=vIe;var STt=imA,HTt=STt,ZTt=500;function WTt(A){var e=HTt(A,function(i){return t.size===ZTt&&t.clear(),i}),t=e.cache;return e}var KTt=WTt,UTt=KTt,VTt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,XTt=/\\(\\)?/g,zTt=UTt(function(A){var e=[];return A.charCodeAt(0)===46&&e.push(""),A.replace(VTt,function(t,i,n,o){e.push(n?o.replace(XTt,"$1"):i||t)}),e}),TTt=zTt,LIe=aS,_Tt=iIe,OTt=IB,qTt=D4,jTt=1/0,SIe=LIe?LIe.prototype:void 0,HIe=SIe?SIe.toString:void 0;function ZIe(A){if(typeof A=="string")return A;if(OTt(A))return _Tt(A,ZIe)+"";if(qTt(A))return HIe?HIe.call(A):"";var e=A+"";return e=="0"&&1/A==-jTt?"-0":e}var PTt=ZIe,$Tt=PTt;function A_t(A){return A==null?"":$Tt(A)}var e_t=A_t,t_t=IB,i_t=tmA,n_t=TTt,o_t=e_t;function g_t(A,e){return t_t(A)?A:i_t(A,e)?[A]:n_t(o_t(A))}var WIe=g_t,a_t=D4,s_t=1/0;function r_t(A){if(typeof A=="string"||a_t(A))return A;var e=A+"";return e=="0"&&1/A==-s_t?"-0":e}var Xq=r_t,I_t=WIe,C_t=Xq;function l_t(A,e){e=I_t(e,A);for(var t=0,i=e.length;A!=null&&t<i;)A=A[C_t(e[t++])];return t&&t==i?A:void 0}var KIe=l_t,c_t=KIe;function B_t(A,e,t){var i=A==null?void 0:c_t(A,e);return i===void 0?t:i}var Q_t=B_t;function E_t(A,e){return A!=null&&e in Object(A)}var u_t=E_t,d_t=WIe,h_t=zre,m_t=IB,p_t=Tre,f_t=LhA,y_t=Xq;function b_t(A,e,t){e=d_t(e,A);for(var i=-1,n=e.length,o=!1;++i<n;){var g=y_t(e[i]);if(!(o=A!=null&&t(A,g)))break;A=A[g]}return o||++i!=n?o:(n=A==null?0:A.length,!!n&&f_t(n)&&p_t(g,n)&&(m_t(A)||h_t(A)))}var w_t=b_t,D_t=u_t,G_t=w_t;function k_t(A,e){return A!=null&&G_t(A,e,D_t)}var J_t=k_t,N_t=xIe,Y_t=Q_t,R_t=J_t,x_t=tmA,F_t=FIe,M_t=MIe,v_t=Xq,L_t=1,S_t=2;function H_t(A,e){return x_t(A)&&F_t(e)?M_t(v_t(A),e):function(t){var i=Y_t(t,A);return i===void 0&&i===e?R_t(t,A):N_t(e,i,L_t|S_t)}}var Z_t=H_t;function W_t(A){return function(e){return e==null?void 0:e[A]}}var K_t=W_t,U_t=KIe;function V_t(A){return function(e){return U_t(e,A)}}var X_t=V_t,z_t=K_t,T_t=X_t,__t=tmA,O_t=Xq;function q_t(A){return __t(A)?z_t(O_t(A)):T_t(A)}var j_t=q_t,P_t=YTt,$_t=Z_t,A4t=eIe,e4t=IB,t4t=j_t;function i4t(A){return typeof A=="function"?A:A==null?A4t:typeof A=="object"?e4t(A)?$_t(A[0],A[1]):P_t(A):t4t(A)}var n4t=i4t,o4t=Lq;function g4t(A,e){return function(t,i){if(t==null)return t;if(!o4t(t))return A(t,i);for(var n=t.length,o=e?n:-1,g=Object(t);(e?o--:++o<n)&&i(g[o],o,g)!==!1;);return t}}var a4t=g4t,s4t=AIe,r4t=a4t,I4t=r4t(s4t),C4t=I4t,l4t=C4t,c4t=Lq;function B4t(A,e){var t=-1,i=c4t(A)?Array(A.length):[];return l4t(A,function(n,o,g){i[++t]=e(n,o,g)}),i}var Q4t=B4t,E4t=iIe,u4t=n4t,d4t=Q4t,h4t=IB;function m4t(A,e){var t=h4t(A)?E4t:d4t;return t(A,u4t(e))}var p4t=m4t;Object.defineProperty(GH,"__esModule",{value:!0}),GH.flattenNames=void 0;var f4t=eUt,y4t=zq(f4t),b4t=WhA,w4t=zq(b4t),D4t=gXt,G4t=zq(D4t),k4t=p4t,J4t=zq(k4t);function zq(A){return A&&A.__esModule?A:{default:A}}var N4t=GH.flattenNames=function A(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[];return(0,J4t.default)(e,function(i){Array.isArray(i)?A(i).map(function(n){return t.push(n)}):(0,G4t.default)(i)?(0,w4t.default)(i,function(n,o){n===!0&&t.push(o),t.push(o+"-"+n)}):(0,y4t.default)(i)&&t.push(i)}),t};GH.default=N4t;var JH={};function Y4t(A,e){for(var t=-1,i=A==null?0:A.length;++t<i&&e(A[t],t,A)!==!1;);return A}var R4t=Y4t,x4t=Rw,F4t=function(){try{var A=x4t(Object,"defineProperty");return A({},"",{}),A}catch{}}(),M4t=F4t,UIe=M4t;function v4t(A,e,t){e=="__proto__"&&UIe?UIe(A,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):A[e]=t}var VIe=v4t,L4t=VIe,S4t=UhA,H4t=Object.prototype,Z4t=H4t.hasOwnProperty;function W4t(A,e,t){var i=A[e];(!(Z4t.call(A,e)&&S4t(i,t))||t===void 0&&!(e in A))&&L4t(A,e,t)}var XIe=W4t,K4t=XIe,U4t=VIe;function V4t(A,e,t,i){var n=!t;t||(t={});for(var o=-1,g=e.length;++o<g;){var a=e[o],s=i?i(t[a],A[a],a,t,A):void 0;s===void 0&&(s=A[a]),n?U4t(t,a,s):K4t(t,a,s)}return t}var Tq=V4t,X4t=Tq,z4t=kH;function T4t(A,e){return A&&X4t(e,z4t(e),A)}var _4t=T4t;function O4t(A){var e=[];if(A!=null)for(var t in Object(A))e.push(t);return e}var q4t=O4t,j4t=Md,P4t=ZhA,$4t=q4t,AOt=Object.prototype,eOt=AOt.hasOwnProperty;function tOt(A){if(!j4t(A))return $4t(A);var e=P4t(A),t=[];for(var i in A)i=="constructor"&&(e||!eOt.call(A,i))||t.push(i);return t}var iOt=tOt,nOt=jre,oOt=iOt,gOt=Lq;function aOt(A){return gOt(A)?nOt(A,!0):oOt(A)}var nmA=aOt,sOt=Tq,rOt=nmA;function IOt(A,e){return A&&sOt(e,rOt(e),A)}var COt=IOt,_q={exports:{}};_q.exports,function(A,e){var t=Pc,i=e&&!e.nodeType&&e,n=i&&!0&&A&&!A.nodeType&&A,o=n&&n.exports===i,g=o?t.Buffer:void 0,a=g?g.allocUnsafe:void 0;function s(I,r){if(r)return I.slice();var C=I.length,l=a?a(C):new I.constructor(C);return I.copy(l),l}A.exports=s}(_q,_q.exports);var lOt=_q.exports;function cOt(A,e){var t=-1,i=A.length;for(e||(e=Array(i));++t<i;)e[t]=A[t];return e}var BOt=cOt,QOt=Tq,EOt=OhA;function uOt(A,e){return QOt(A,EOt(A),e)}var dOt=uOt,hOt=cIe,mOt=KhA,pOt=OhA,fOt=QIe,yOt=Object.getOwnPropertySymbols,bOt=yOt?function(A){for(var e=[];A;)hOt(e,pOt(A)),A=mOt(A);return e}:fOt,zIe=bOt,wOt=Tq,DOt=zIe;function GOt(A,e){return wOt(A,DOt(A),e)}var kOt=GOt,JOt=BIe,NOt=zIe,YOt=nmA;function ROt(A){return JOt(A,YOt,NOt)}var xOt=ROt,FOt=Object.prototype,MOt=FOt.hasOwnProperty;function vOt(A){var e=A.length,t=new A.constructor(e);return e&&typeof A[0]=="string"&&MOt.call(A,"index")&&(t.index=A.index,t.input=A.input),t}var LOt=vOt,TIe=rIe;function SOt(A){var e=new A.constructor(A.byteLength);return new TIe(e).set(new TIe(A)),e}var omA=SOt,HOt=omA;function ZOt(A,e){var t=e?HOt(A.buffer):A.buffer;return new A.constructor(t,A.byteOffset,A.byteLength)}var WOt=ZOt,KOt=/\w*$/;function UOt(A){var e=new A.constructor(A.source,KOt.exec(A));return e.lastIndex=A.lastIndex,e}var VOt=UOt,_Ie=aS,OIe=_Ie?_Ie.prototype:void 0,qIe=OIe?OIe.valueOf:void 0;function XOt(A){return qIe?Object(qIe.call(A)):{}}var zOt=XOt,TOt=omA;function _Ot(A,e){var t=e?TOt(A.buffer):A.buffer;return new A.constructor(t,A.byteOffset,A.length)}var OOt=_Ot,qOt=omA,jOt=WOt,POt=VOt,$Ot=zOt,Aqt=OOt,eqt="[object Boolean]",tqt="[object Date]",iqt="[object Map]",nqt="[object Number]",oqt="[object RegExp]",gqt="[object Set]",aqt="[object String]",sqt="[object Symbol]",rqt="[object ArrayBuffer]",Iqt="[object DataView]",Cqt="[object Float32Array]",lqt="[object Float64Array]",cqt="[object Int8Array]",Bqt="[object Int16Array]",Qqt="[object Int32Array]",Eqt="[object Uint8Array]",uqt="[object Uint8ClampedArray]",dqt="[object Uint16Array]",hqt="[object Uint32Array]";function mqt(A,e,t){var i=A.constructor;switch(e){case rqt:return qOt(A);case eqt:case tqt:return new i(+A);case Iqt:return jOt(A,t);case Cqt:case lqt:case cqt:case Bqt:case Qqt:case Eqt:case uqt:case dqt:case hqt:return Aqt(A,t);case iqt:return new i;case nqt:case aqt:return new i(A);case oqt:return POt(A);case gqt:return new i;case sqt:return $Ot(A)}}var pqt=mqt,fqt=Md,jIe=Object.create,yqt=function(){function A(){}return function(e){if(!fqt(e))return{};if(jIe)return jIe(e);A.prototype=e;var t=new A;return A.prototype=void 0,t}}(),bqt=yqt,wqt=bqt,Dqt=KhA,Gqt=ZhA;function kqt(A){return typeof A.constructor=="function"&&!Gqt(A)?wqt(Dqt(A)):{}}var Jqt=kqt,Nqt=Uq,Yqt=vd,Rqt="[object Map]";function xqt(A){return Yqt(A)&&Nqt(A)==Rqt}var Fqt=xqt,Mqt=Fqt,vqt=ShA,PIe=HhA,$Ie=PIe&&PIe.isMap,Lqt=$Ie?vqt($Ie):Mqt,Sqt=Lqt,Hqt=Uq,Zqt=vd,Wqt="[object Set]";function Kqt(A){return Zqt(A)&&Hqt(A)==Wqt}var Uqt=Kqt,Vqt=Uqt,Xqt=ShA,ACe=HhA,eCe=ACe&&ACe.isSet,zqt=eCe?Xqt(eCe):Vqt,Tqt=zqt,_qt=ThA,Oqt=R4t,qqt=XIe,jqt=_4t,Pqt=COt,$qt=lOt,Ajt=BOt,ejt=dOt,tjt=kOt,ijt=uIe,njt=xOt,ojt=Uq,gjt=LOt,ajt=pqt,sjt=Jqt,rjt=IB,Ijt=vhA,Cjt=Sqt,ljt=Md,cjt=Tqt,Bjt=kH,Qjt=nmA,Ejt=1,ujt=2,djt=4,tCe="[object Arguments]",hjt="[object Array]",mjt="[object Boolean]",pjt="[object Date]",fjt="[object Error]",iCe="[object Function]",yjt="[object GeneratorFunction]",bjt="[object Map]",wjt="[object Number]",nCe="[object Object]",Djt="[object RegExp]",Gjt="[object Set]",kjt="[object String]",Jjt="[object Symbol]",Njt="[object WeakMap]",Yjt="[object ArrayBuffer]",Rjt="[object DataView]",xjt="[object Float32Array]",Fjt="[object Float64Array]",Mjt="[object Int8Array]",vjt="[object Int16Array]",Ljt="[object Int32Array]",Sjt="[object Uint8Array]",Hjt="[object Uint8ClampedArray]",Zjt="[object Uint16Array]",Wjt="[object Uint32Array]",Bn={};Bn[tCe]=Bn[hjt]=Bn[Yjt]=Bn[Rjt]=Bn[mjt]=Bn[pjt]=Bn[xjt]=Bn[Fjt]=Bn[Mjt]=Bn[vjt]=Bn[Ljt]=Bn[bjt]=Bn[wjt]=Bn[nCe]=Bn[Djt]=Bn[Gjt]=Bn[kjt]=Bn[Jjt]=Bn[Sjt]=Bn[Hjt]=Bn[Zjt]=Bn[Wjt]=!0,Bn[fjt]=Bn[iCe]=Bn[Njt]=!1;function Oq(A,e,t,i,n,o){var g,a=e&Ejt,s=e&ujt,I=e&djt;if(t&&(g=n?t(A,i,n,o):t(A)),g!==void 0)return g;if(!ljt(A))return A;var r=rjt(A);if(r){if(g=gjt(A),!a)return Ajt(A,g)}else{var C=ojt(A),l=C==iCe||C==yjt;if(Ijt(A))return $qt(A,a);if(C==nCe||C==tCe||l&&!n){if(g=s||l?{}:sjt(A),!a)return s?tjt(A,Pqt(g,A)):ejt(A,jqt(g,A))}else{if(!Bn[C])return n?A:{};g=ajt(A,C,a)}}o||(o=new _qt);var c=o.get(A);if(c)return c;o.set(A,g),cjt(A)?A.forEach(function(u){g.add(Oq(u,e,t,u,A,o))}):Cjt(A)&&A.forEach(function(u,d){g.set(d,Oq(u,e,t,d,A,o))});var B=I?s?njt:ijt:s?Qjt:Bjt,E=r?void 0:B(A);return Oqt(E||A,function(u,d){E&&(d=u,u=A[d]),qqt(g,d,Oq(u,e,t,d,A,o))}),g}var Kjt=Oq,Ujt=Kjt,Vjt=1,Xjt=4;function zjt(A){return Ujt(A,Vjt|Xjt)}var Tjt=zjt;Object.defineProperty(JH,"__esModule",{value:!0}),JH.mergeClasses=void 0;var _jt=WhA,Ojt=oCe(_jt),qjt=Tjt,jjt=oCe(qjt),Pjt=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A};function oCe(A){return A&&A.__esModule?A:{default:A}}var $jt=JH.mergeClasses=function(A){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=A.default&&(0,jjt.default)(A.default)||{};return e.map(function(i){var n=A[i];return n&&(0,Ojt.default)(n,function(o,g){t[g]||(t[g]={}),t[g]=Pjt({},t[g],n[g])}),i}),t};JH.default=$jt;var NH={};Object.defineProperty(NH,"__esModule",{value:!0}),NH.autoprefix=void 0;var A6t=WhA,gCe=t6t(A6t),e6t=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A};function t6t(A){return A&&A.__esModule?A:{default:A}}var i6t={borderRadius:function(A){return{msBorderRadius:A,MozBorderRadius:A,OBorderRadius:A,WebkitBorderRadius:A,borderRadius:A}},boxShadow:function(A){return{msBoxShadow:A,MozBoxShadow:A,OBoxShadow:A,WebkitBoxShadow:A,boxShadow:A}},userSelect:function(A){return{WebkitTouchCallout:A,KhtmlUserSelect:A,MozUserSelect:A,msUserSelect:A,WebkitUserSelect:A,userSelect:A}},flex:function(A){return{WebkitBoxFlex:A,MozBoxFlex:A,WebkitFlex:A,msFlex:A,flex:A}},flexBasis:function(A){return{WebkitFlexBasis:A,flexBasis:A}},justifyContent:function(A){return{WebkitJustifyContent:A,justifyContent:A}},transition:function(A){return{msTransition:A,MozTransition:A,OTransition:A,WebkitTransition:A,transition:A}},transform:function(A){return{msTransform:A,MozTransform:A,OTransform:A,WebkitTransform:A,transform:A}},absolute:function(A){var e=A&&A.split(" ");return{position:"absolute",top:e&&e[0],right:e&&e[1],bottom:e&&e[2],left:e&&e[3]}},extend:function(A,e){var t=e[A];return t||{extend:A}}},n6t=NH.autoprefix=function(A){var e={};return(0,gCe.default)(A,function(t,i){var n={};(0,gCe.default)(t,function(o,g){var a=i6t[g];a?n=e6t({},n,a(o)):n[g]=o}),e[i]=n}),e};NH.default=n6t;var YH={};Object.defineProperty(YH,"__esModule",{value:!0}),YH.hover=void 0;var o6t=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},g6t=b,gmA=a6t(g6t);function a6t(A){return A&&A.__esModule?A:{default:A}}function s6t(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function aCe(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:A}function r6t(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}var I6t=YH.hover=function(A){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(t){r6t(i,t);function i(){var n,o,g,a;s6t(this,i);for(var s=arguments.length,I=Array(s),r=0;r<s;r++)I[r]=arguments[r];return a=(o=(g=aCe(this,(n=i.__proto__||Object.getPrototypeOf(i)).call.apply(n,[this].concat(I))),g),g.state={hover:!1},g.handleMouseOver=function(){return g.setState({hover:!0})},g.handleMouseOut=function(){return g.setState({hover:!1})},g.render=function(){return gmA.default.createElement(e,{onMouseOver:g.handleMouseOver,onMouseOut:g.handleMouseOut},gmA.default.createElement(A,o6t({},g.props,g.state)))},o),aCe(g,a)}return i}(gmA.default.Component)};YH.default=I6t;var RH={};Object.defineProperty(RH,"__esModule",{value:!0}),RH.active=void 0;var C6t=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},l6t=b,amA=c6t(l6t);function c6t(A){return A&&A.__esModule?A:{default:A}}function B6t(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function sCe(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:A}function Q6t(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}var E6t=RH.active=function(A){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(t){Q6t(i,t);function i(){var n,o,g,a;B6t(this,i);for(var s=arguments.length,I=Array(s),r=0;r<s;r++)I[r]=arguments[r];return a=(o=(g=sCe(this,(n=i.__proto__||Object.getPrototypeOf(i)).call.apply(n,[this].concat(I))),g),g.state={active:!1},g.handleMouseDown=function(){return g.setState({active:!0})},g.handleMouseUp=function(){return g.setState({active:!1})},g.render=function(){return amA.default.createElement(e,{onMouseDown:g.handleMouseDown,onMouseUp:g.handleMouseUp},amA.default.createElement(A,C6t({},g.props,g.state)))},o),sCe(g,a)}return i}(amA.default.Component)};RH.default=E6t;var smA={};Object.defineProperty(smA,"__esModule",{value:!0});var u6t=function(A,e){var t={},i=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;t[n]=o};return A===0&&i("first-child"),A===e-1&&i("last-child"),(A===0||A%2===0)&&i("even"),Math.abs(A%2)===1&&i("odd"),i("nth-child",A),t};smA.default=u6t,Object.defineProperty(kl,"__esModule",{value:!0}),kl.ReactCSS=kl.loop=kl.handleActive=rmA=kl.handleHover=kl.hover=void 0;var d6t=GH,h6t=ON(d6t),m6t=JH,p6t=ON(m6t),f6t=NH,y6t=ON(f6t),b6t=YH,rCe=ON(b6t),w6t=RH,D6t=ON(w6t),G6t=smA,k6t=ON(G6t);function ON(A){return A&&A.__esModule?A:{default:A}}kl.hover=rCe.default;var rmA=kl.handleHover=rCe.default;kl.handleActive=D6t.default,kl.loop=k6t.default;var J6t=kl.ReactCSS=function(A){for(var e=arguments.length,t=Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];var n=(0,h6t.default)(t),o=(0,p6t.default)(A,n);return(0,y6t.default)(o)},_e=kl.default=J6t,N6t=function(A,e,t,i,n){var o=n.clientWidth,g=n.clientHeight,a=typeof A.pageX=="number"?A.pageX:A.touches[0].pageX,s=typeof A.pageY=="number"?A.pageY:A.touches[0].pageY,I=a-(n.getBoundingClientRect().left+window.pageXOffset),r=s-(n.getBoundingClientRect().top+window.pageYOffset);if(t==="vertical"){var C=void 0;if(r<0?C=0:r>g?C=1:C=Math.round(r*100/g)/100,e.a!==C)return{h:e.h,s:e.s,l:e.l,a:C,source:"rgb"}}else{var l=void 0;if(I<0?l=0:I>o?l=1:l=Math.round(I*100/o)/100,i!==l)return{h:e.h,s:e.s,l:e.l,a:l,source:"rgb"}}return null},ImA={},Y6t=function(A,e,t,i){if(typeof document>"u"&&!i)return null;var n=i?new i:document.createElement("canvas");n.width=t*2,n.height=t*2;var o=n.getContext("2d");return o?(o.fillStyle=A,o.fillRect(0,0,n.width,n.height),o.fillStyle=e,o.fillRect(0,0,t,t),o.translate(t,t),o.fillRect(0,0,t,t),n.toDataURL()):null},R6t=function(A,e,t,i){var n=A+"-"+e+"-"+t+(i?"-server":"");if(ImA[n])return ImA[n];var o=Y6t(A,e,t,i);return ImA[n]=o,o},ICe=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},qN=function(A){var e=A.white,t=A.grey,i=A.size,n=A.renderers,o=A.borderRadius,g=A.boxShadow,a=A.children,s=_e({default:{grid:{borderRadius:o,boxShadow:g,absolute:"0px 0px 0px 0px",background:"url("+R6t(e,t,i,n.canvas)+") center left"}}});return p.isValidElement(a)?b.cloneElement(a,ICe({},a.props,{style:ICe({},a.props.style,s.grid)})):b.createElement("div",{style:s.grid})};qN.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var x6t=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},F6t=function(){function A(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,i){return t&&A(e.prototype,t),i&&A(e,i),e}}();function M6t(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function CCe(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:A}function v6t(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}var CmA=function(A){v6t(e,A);function e(){var t,i,n,o;M6t(this,e);for(var g=arguments.length,a=Array(g),s=0;s<g;s++)a[s]=arguments[s];return o=(i=(n=CCe(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(a))),n),n.handleChange=function(I){var r=N6t(I,n.props.hsl,n.props.direction,n.props.a,n.container);r&&typeof n.props.onChange=="function"&&n.props.onChange(r,I)},n.handleMouseDown=function(I){n.handleChange(I),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleChange),window.removeEventListener("mouseup",n.handleMouseUp)},i),CCe(n,o)}return F6t(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var t=this,i=this.props.rgb,n=_e({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+i.r+","+i.g+","+i.b+`, 0) 0%,
           rgba(`+i.r+","+i.g+","+i.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:i.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+i.r+","+i.g+","+i.b+`, 0) 0%,
           rgba(`+i.r+","+i.g+","+i.b+", 1) 100%)"},pointer:{left:0,top:i.a*100+"%"}},overwrite:x6t({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return b.createElement("div",{style:n.alpha},b.createElement("div",{style:n.checkboard},b.createElement(qN,{renderers:this.props.renderers})),b.createElement("div",{style:n.gradient}),b.createElement("div",{style:n.container,ref:function(o){return t.container=o},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},b.createElement("div",{style:n.pointer},this.props.pointer?b.createElement(this.props.pointer,this.props):b.createElement("div",{style:n.slider}))))}}]),e}(p.PureComponent||p.Component),L6t=function(){function A(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,i){return t&&A(e.prototype,t),i&&A(e,i),e}}();function S6t(A,e,t){return e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function H6t(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function Z6t(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:A}function W6t(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}var K6t=1,lCe=38,U6t=40,V6t=[lCe,U6t],X6t=function(A){return V6t.indexOf(A)>-1},z6t=function(A){return Number(String(A).replace(/%/g,""))},T6t=1,zt=function(A){W6t(e,A);function e(t){H6t(this,e);var i=Z6t(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.handleBlur=function(){i.state.blurValue&&i.setState({value:i.state.blurValue,blurValue:null})},i.handleChange=function(n){i.setUpdatedValue(n.target.value,n)},i.handleKeyDown=function(n){var o=z6t(n.target.value);if(!isNaN(o)&&X6t(n.keyCode)){var g=i.getArrowOffset(),a=n.keyCode===lCe?o+g:o-g;i.setUpdatedValue(a,n)}},i.handleDrag=function(n){if(i.props.dragLabel){var o=Math.round(i.props.value+n.movementX);o>=0&&o<=i.props.dragMax&&i.props.onChange&&i.props.onChange(i.getValueObjectWithLabel(o),n)}},i.handleMouseDown=function(n){i.props.dragLabel&&(n.preventDefault(),i.handleDrag(n),window.addEventListener("mousemove",i.handleDrag),window.addEventListener("mouseup",i.handleMouseUp))},i.handleMouseUp=function(){i.unbindEventListeners()},i.unbindEventListeners=function(){window.removeEventListener("mousemove",i.handleDrag),window.removeEventListener("mouseup",i.handleMouseUp)},i.state={value:String(t.value).toUpperCase(),blurValue:String(t.value).toUpperCase()},i.inputId="rc-editable-input-"+T6t++,i}return L6t(e,[{key:"componentDidUpdate",value:function(t,i){this.props.value!==this.state.value&&(t.value!==this.props.value||i.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(t){return S6t({},this.props.label,t)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||K6t}},{key:"setUpdatedValue",value:function(t,i){var n=this.props.label?this.getValueObjectWithLabel(t):t;this.props.onChange&&this.props.onChange(n,i),this.setState({value:t})}},{key:"render",value:function(){var t=this,i=_e({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return b.createElement("div",{style:i.wrap},b.createElement("input",{id:this.inputId,style:i.input,ref:function(n){return t.input=n},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?b.createElement("label",{htmlFor:this.inputId,style:i.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(p.PureComponent||p.Component),_6t=function(A,e,t,i){var n=i.clientWidth,o=i.clientHeight,g=typeof A.pageX=="number"?A.pageX:A.touches[0].pageX,a=typeof A.pageY=="number"?A.pageY:A.touches[0].pageY,s=g-(i.getBoundingClientRect().left+window.pageXOffset),I=a-(i.getBoundingClientRect().top+window.pageYOffset);if(e==="vertical"){var r=void 0;if(I<0)r=359;else if(I>o)r=0;else{var C=-(I*100/o)+100;r=360*C/100}if(t.h!==r)return{h:r,s:t.s,l:t.l,a:t.a,source:"hsl"}}else{var l=void 0;if(s<0)l=0;else if(s>n)l=359;else{var c=s*100/n;l=360*c/100}if(t.h!==l)return{h:l,s:t.s,l:t.l,a:t.a,source:"hsl"}}return null},O6t=function(){function A(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,i){return t&&A(e.prototype,t),i&&A(e,i),e}}();function q6t(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function cCe(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:A}function j6t(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}var jN=function(A){j6t(e,A);function e(){var t,i,n,o;q6t(this,e);for(var g=arguments.length,a=Array(g),s=0;s<g;s++)a[s]=arguments[s];return o=(i=(n=cCe(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(a))),n),n.handleChange=function(I){var r=_6t(I,n.props.direction,n.props.hsl,n.container);r&&typeof n.props.onChange=="function"&&n.props.onChange(r,I)},n.handleMouseDown=function(I){n.handleChange(I),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},i),cCe(n,o)}return O6t(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var t=this,i=this.props.direction,n=i===void 0?"horizontal":i,o=_e({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:n==="vertical"});return b.createElement("div",{style:o.hue},b.createElement("div",{className:"hue-"+n,style:o.container,ref:function(g){return t.container=g},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},b.createElement("style",null,`
            .hue-horizontal {
              background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0
                33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
              background: -webkit-linear-gradient(to right, #f00 0%, #ff0
                17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
            }

            .hue-vertical {
              background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,
                #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
              background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,
                #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
            }
          `),b.createElement("div",{style:o.pointer},this.props.pointer?b.createElement(this.props.pointer,this.props):b.createElement("div",{style:o.slider}))))}}]),e}(p.PureComponent||p.Component),BCe={exports:{}},lmA,QCe;function P6t(){if(QCe)return lmA;QCe=1;var A="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return lmA=A,lmA}var cmA,ECe;function $6t(){if(ECe)return cmA;ECe=1;var A=P6t();function e(){}function t(){}return t.resetWarningCache=e,cmA=function(){function i(g,a,s,I,r,C){if(C!==A){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}i.isRequired=i;function n(){return i}var o={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:n,element:i,elementType:i,instanceOf:n,node:i,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:t,resetWarningCache:e};return o.PropTypes=o,o},cmA}BCe.exports=$6t()();var A8t=BCe.exports;const FA=xC(A8t);var xH=function(A){var e=A.zDepth,t=A.radius,i=A.background,n=A.children,o=A.styles,g=o===void 0?{}:o,a=_e(ir({default:{wrap:{position:"relative",display:"inline-block"},content:{position:"relative"},bg:{absolute:"0px 0px 0px 0px",boxShadow:"0 "+e+"px "+e*4+"px rgba(0,0,0,.24)",borderRadius:t,background:i}},"zDepth-0":{bg:{boxShadow:"none"}},"zDepth-1":{bg:{boxShadow:"0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"}},"zDepth-2":{bg:{boxShadow:"0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"}},"zDepth-3":{bg:{boxShadow:"0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"}},"zDepth-4":{bg:{boxShadow:"0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"}},"zDepth-5":{bg:{boxShadow:"0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"}},square:{bg:{borderRadius:"0"}},circle:{bg:{borderRadius:"50%"}}},g),{"zDepth-1":e===1});return b.createElement("div",{style:a.wrap},b.createElement("div",{style:a.bg}),b.createElement("div",{style:a.content},n))};xH.propTypes={background:FA.string,zDepth:FA.oneOf([0,1,2,3,4,5]),radius:FA.number,styles:FA.object},xH.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}};var e8t=function(A,e,t){var i=t.getBoundingClientRect(),n=i.width,o=i.height,g=typeof A.pageX=="number"?A.pageX:A.touches[0].pageX,a=typeof A.pageY=="number"?A.pageY:A.touches[0].pageY,s=g-(t.getBoundingClientRect().left+window.pageXOffset),I=a-(t.getBoundingClientRect().top+window.pageYOffset);s<0?s=0:s>n&&(s=n),I<0?I=0:I>o&&(I=o);var r=s/n,C=1-I/o;return{h:e.h,s:r,v:C,a:e.a,source:"hsv"}},t8t=function(){function A(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,i){return t&&A(e.prototype,t),i&&A(e,i),e}}();function i8t(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function n8t(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:A}function o8t(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}var qq=function(A){o8t(e,A);function e(t){i8t(this,e);var i=n8t(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.handleChange=function(n){typeof i.props.onChange=="function"&&i.throttle(i.props.onChange,e8t(n,i.props.hsl,i.container),n)},i.handleMouseDown=function(n){i.handleChange(n);var o=i.getContainerRenderWindow();o.addEventListener("mousemove",i.handleChange),o.addEventListener("mouseup",i.handleMouseUp)},i.handleMouseUp=function(){i.unbindEventListeners()},i.throttle=f6e(function(n,o,g){n(o,g)},50),i}return t8t(e,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var t=this.container,i=window;!i.document.contains(t)&&i.parent!==i;)i=i.parent;return i}},{key:"unbindEventListeners",value:function(){var t=this.getContainerRenderWindow();t.removeEventListener("mousemove",this.handleChange),t.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var t=this,i=this.props.style||{},n=i.color,o=i.white,g=i.black,a=i.pointer,s=i.circle,I=_e({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-(this.props.hsv.v*100)+100+"%",left:this.props.hsv.s*100+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:`0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),
            0 0 1px 2px rgba(0,0,0,.4)`,borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:n,white:o,black:g,pointer:a,circle:s}},{custom:!!this.props.style});return b.createElement("div",{style:I.color,ref:function(r){return t.container=r},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},b.createElement("style",null,`
          .saturation-white {
            background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));
            background: linear-gradient(to right, #fff, rgba(255,255,255,0));
          }
          .saturation-black {
            background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));
            background: linear-gradient(to top, #000, rgba(0,0,0,0));
          }
        `),b.createElement("div",{style:I.white,className:"saturation-white"},b.createElement("div",{style:I.black,className:"saturation-black"}),b.createElement("div",{style:I.pointer},this.props.pointer?b.createElement(this.props.pointer,this.props):b.createElement("div",{style:I.circle}))))}}]),e}(p.PureComponent||p.Component);function jq(A){return jq=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},jq(A)}var g8t=/^\s+/,a8t=/\s+$/;function ye(A,e){if(A=A||"",e=e||{},A instanceof ye)return A;if(!(this instanceof ye))return new ye(A,e);var t=s8t(A);this._originalInput=A,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=t.ok}ye.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var A=this.toRgb();return(A.r*299+A.g*587+A.b*114)/1e3},getLuminance:function(){var A=this.toRgb(),e,t,i,n,o,g;return e=A.r/255,t=A.g/255,i=A.b/255,e<=.03928?n=e/12.92:n=Math.pow((e+.055)/1.055,2.4),t<=.03928?o=t/12.92:o=Math.pow((t+.055)/1.055,2.4),i<=.03928?g=i/12.92:g=Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*o+.0722*g},setAlpha:function(A){return this._a=fCe(A),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var A=dCe(this._r,this._g,this._b);return{h:A.h*360,s:A.s,v:A.v,a:this._a}},toHsvString:function(){var A=dCe(this._r,this._g,this._b),e=Math.round(A.h*360),t=Math.round(A.s*100),i=Math.round(A.v*100);return this._a==1?"hsv("+e+", "+t+"%, "+i+"%)":"hsva("+e+", "+t+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var A=uCe(this._r,this._g,this._b);return{h:A.h*360,s:A.s,l:A.l,a:this._a}},toHslString:function(){var A=uCe(this._r,this._g,this._b),e=Math.round(A.h*360),t=Math.round(A.s*100),i=Math.round(A.l*100);return this._a==1?"hsl("+e+", "+t+"%, "+i+"%)":"hsla("+e+", "+t+"%, "+i+"%, "+this._roundA+")"},toHex:function(A){return hCe(this._r,this._g,this._b,A)},toHexString:function(A){return"#"+this.toHex(A)},toHex8:function(A){return l8t(this._r,this._g,this._b,this._a,A)},toHex8String:function(A){return"#"+this.toHex8(A)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Kn(this._r,255)*100)+"%",g:Math.round(Kn(this._g,255)*100)+"%",b:Math.round(Kn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Kn(this._r,255)*100)+"%, "+Math.round(Kn(this._g,255)*100)+"%, "+Math.round(Kn(this._b,255)*100)+"%)":"rgba("+Math.round(Kn(this._r,255)*100)+"%, "+Math.round(Kn(this._g,255)*100)+"%, "+Math.round(Kn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:b8t[hCe(this._r,this._g,this._b,!0)]||!1},toFilter:function(A){var e="#"+mCe(this._r,this._g,this._b,this._a),t=e,i=this._gradientType?"GradientType = 1, ":"";if(A){var n=ye(A);t="#"+mCe(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+t+")"},toString:function(A){var e=!!A;A=A||this._format;var t=!1,i=this._a<1&&this._a>=0,n=!e&&i&&(A==="hex"||A==="hex6"||A==="hex3"||A==="hex4"||A==="hex8"||A==="name");return n?A==="name"&&this._a===0?this.toName():this.toRgbString():(A==="rgb"&&(t=this.toRgbString()),A==="prgb"&&(t=this.toPercentageRgbString()),(A==="hex"||A==="hex6")&&(t=this.toHexString()),A==="hex3"&&(t=this.toHexString(!0)),A==="hex4"&&(t=this.toHex8String(!0)),A==="hex8"&&(t=this.toHex8String()),A==="name"&&(t=this.toName()),A==="hsl"&&(t=this.toHslString()),A==="hsv"&&(t=this.toHsvString()),t||this.toHexString())},clone:function(){return ye(this.toString())},_applyModification:function(A,e){var t=A.apply(null,[this].concat([].slice.call(e)));return this._r=t._r,this._g=t._g,this._b=t._b,this.setAlpha(t._a),this},lighten:function(){return this._applyModification(E8t,arguments)},brighten:function(){return this._applyModification(u8t,arguments)},darken:function(){return this._applyModification(d8t,arguments)},desaturate:function(){return this._applyModification(c8t,arguments)},saturate:function(){return this._applyModification(B8t,arguments)},greyscale:function(){return this._applyModification(Q8t,arguments)},spin:function(){return this._applyModification(h8t,arguments)},_applyCombination:function(A,e){return A.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(f8t,arguments)},complement:function(){return this._applyCombination(m8t,arguments)},monochromatic:function(){return this._applyCombination(y8t,arguments)},splitcomplement:function(){return this._applyCombination(p8t,arguments)},triad:function(){return this._applyCombination(pCe,[3])},tetrad:function(){return this._applyCombination(pCe,[4])}},ye.fromRatio=function(A,e){if(jq(A)=="object"){var t={};for(var i in A)A.hasOwnProperty(i)&&(i==="a"?t[i]=A[i]:t[i]=FH(A[i]));A=t}return ye(A,e)};function s8t(A){var e={r:0,g:0,b:0},t=1,i=null,n=null,o=null,g=!1,a=!1;return typeof A=="string"&&(A=k8t(A)),jq(A)=="object"&&(Pd(A.r)&&Pd(A.g)&&Pd(A.b)?(e=r8t(A.r,A.g,A.b),g=!0,a=String(A.r).substr(-1)==="%"?"prgb":"rgb"):Pd(A.h)&&Pd(A.s)&&Pd(A.v)?(i=FH(A.s),n=FH(A.v),e=C8t(A.h,i,n),g=!0,a="hsv"):Pd(A.h)&&Pd(A.s)&&Pd(A.l)&&(i=FH(A.s),o=FH(A.l),e=I8t(A.h,i,o),g=!0,a="hsl"),A.hasOwnProperty("a")&&(t=A.a)),t=fCe(t),{ok:g,format:A.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}function r8t(A,e,t){return{r:Kn(A,255)*255,g:Kn(e,255)*255,b:Kn(t,255)*255}}function uCe(A,e,t){A=Kn(A,255),e=Kn(e,255),t=Kn(t,255);var i=Math.max(A,e,t),n=Math.min(A,e,t),o,g,a=(i+n)/2;if(i==n)o=g=0;else{var s=i-n;switch(g=a>.5?s/(2-i-n):s/(i+n),i){case A:o=(e-t)/s+(e<t?6:0);break;case e:o=(t-A)/s+2;break;case t:o=(A-e)/s+4;break}o/=6}return{h:o,s:g,l:a}}function I8t(A,e,t){var i,n,o;A=Kn(A,360),e=Kn(e,100),t=Kn(t,100);function g(I,r,C){return C<0&&(C+=1),C>1&&(C-=1),C<.16666666666666666?I+(r-I)*6*C:C<.5?r:C<.6666666666666666?I+(r-I)*(.6666666666666666-C)*6:I}if(e===0)i=n=o=t;else{var a=t<.5?t*(1+e):t+e-t*e,s=2*t-a;i=g(s,a,A+.3333333333333333),n=g(s,a,A),o=g(s,a,A-.3333333333333333)}return{r:i*255,g:n*255,b:o*255}}function dCe(A,e,t){A=Kn(A,255),e=Kn(e,255),t=Kn(t,255);var i=Math.max(A,e,t),n=Math.min(A,e,t),o,g,a=i,s=i-n;if(g=i===0?0:s/i,i==n)o=0;else{switch(i){case A:o=(e-t)/s+(e<t?6:0);break;case e:o=(t-A)/s+2;break;case t:o=(A-e)/s+4;break}o/=6}return{h:o,s:g,v:a}}function C8t(A,e,t){A=Kn(A,360)*6,e=Kn(e,100),t=Kn(t,100);var i=Math.floor(A),n=A-i,o=t*(1-e),g=t*(1-n*e),a=t*(1-(1-n)*e),s=i%6,I=[t,g,o,o,a,t][s],r=[a,t,t,g,o,o][s],C=[o,o,a,t,t,g][s];return{r:I*255,g:r*255,b:C*255}}function hCe(A,e,t,i){var n=[CB(Math.round(A).toString(16)),CB(Math.round(e).toString(16)),CB(Math.round(t).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function l8t(A,e,t,i,n){var o=[CB(Math.round(A).toString(16)),CB(Math.round(e).toString(16)),CB(Math.round(t).toString(16)),CB(yCe(i))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function mCe(A,e,t,i){var n=[CB(yCe(i)),CB(Math.round(A).toString(16)),CB(Math.round(e).toString(16)),CB(Math.round(t).toString(16))];return n.join("")}ye.equals=function(A,e){return!A||!e?!1:ye(A).toRgbString()==ye(e).toRgbString()},ye.random=function(){return ye.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function c8t(A,e){e=e===0?0:e||10;var t=ye(A).toHsl();return t.s-=e/100,t.s=Pq(t.s),ye(t)}function B8t(A,e){e=e===0?0:e||10;var t=ye(A).toHsl();return t.s+=e/100,t.s=Pq(t.s),ye(t)}function Q8t(A){return ye(A).desaturate(100)}function E8t(A,e){e=e===0?0:e||10;var t=ye(A).toHsl();return t.l+=e/100,t.l=Pq(t.l),ye(t)}function u8t(A,e){e=e===0?0:e||10;var t=ye(A).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),ye(t)}function d8t(A,e){e=e===0?0:e||10;var t=ye(A).toHsl();return t.l-=e/100,t.l=Pq(t.l),ye(t)}function h8t(A,e){var t=ye(A).toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,ye(t)}function m8t(A){var e=ye(A).toHsl();return e.h=(e.h+180)%360,ye(e)}function pCe(A,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=ye(A).toHsl(),i=[ye(A)],n=360/e,o=1;o<e;o++)i.push(ye({h:(t.h+o*n)%360,s:t.s,l:t.l}));return i}function p8t(A){var e=ye(A).toHsl(),t=e.h;return[ye(A),ye({h:(t+72)%360,s:e.s,l:e.l}),ye({h:(t+216)%360,s:e.s,l:e.l})]}function f8t(A,e,t){e=e||6,t=t||30;var i=ye(A).toHsl(),n=360/t,o=[ye(A)];for(i.h=(i.h-(n*e>>1)+720)%360;--e;)i.h=(i.h+n)%360,o.push(ye(i));return o}function y8t(A,e){e=e||6;for(var t=ye(A).toHsv(),i=t.h,n=t.s,o=t.v,g=[],a=1/e;e--;)g.push(ye({h:i,s:n,v:o})),o=(o+a)%1;return g}ye.mix=function(A,e,t){t=t===0?0:t||50;var i=ye(A).toRgb(),n=ye(e).toRgb(),o=t/100,g={r:(n.r-i.r)*o+i.r,g:(n.g-i.g)*o+i.g,b:(n.b-i.b)*o+i.b,a:(n.a-i.a)*o+i.a};return ye(g)},ye.readability=function(A,e){var t=ye(A),i=ye(e);return(Math.max(t.getLuminance(),i.getLuminance())+.05)/(Math.min(t.getLuminance(),i.getLuminance())+.05)},ye.isReadable=function(A,e,t){var i=ye.readability(A,e),n,o;switch(o=!1,n=J8t(t),n.level+n.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7;break}return o},ye.mostReadable=function(A,e,t){var i=null,n=0,o,g,a,s;t=t||{},g=t.includeFallbackColors,a=t.level,s=t.size;for(var I=0;I<e.length;I++)o=ye.readability(A,e[I]),o>n&&(n=o,i=ye(e[I]));return ye.isReadable(A,i,{level:a,size:s})||!g?i:(t.includeFallbackColors=!1,ye.mostReadable(A,["#fff","#000"],t))};var BmA=ye.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",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",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",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:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},b8t=ye.hexNames=w8t(BmA);function w8t(A){var e={};for(var t in A)A.hasOwnProperty(t)&&(e[A[t]]=t);return e}function fCe(A){return A=parseFloat(A),(isNaN(A)||A<0||A>1)&&(A=1),A}function Kn(A,e){D8t(A)&&(A="100%");var t=G8t(A);return A=Math.min(e,Math.max(0,parseFloat(A))),t&&(A=parseInt(A*e,10)/100),Math.abs(A-e)<1e-6?1:A%e/parseFloat(e)}function Pq(A){return Math.min(1,Math.max(0,A))}function zI(A){return parseInt(A,16)}function D8t(A){return typeof A=="string"&&A.indexOf(".")!=-1&&parseFloat(A)===1}function G8t(A){return typeof A=="string"&&A.indexOf("%")!=-1}function CB(A){return A.length==1?"0"+A:""+A}function FH(A){return A<=1&&(A=A*100+"%"),A}function yCe(A){return Math.round(parseFloat(A)*255).toString(16)}function bCe(A){return zI(A)/255}var lB=function(){var A="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+A+")",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Pd(A){return!!lB.CSS_UNIT.exec(A)}function k8t(A){A=A.replace(g8t,"").replace(a8t,"").toLowerCase();var e=!1;if(BmA[A])A=BmA[A],e=!0;else if(A=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=lB.rgb.exec(A))?{r:t[1],g:t[2],b:t[3]}:(t=lB.rgba.exec(A))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=lB.hsl.exec(A))?{h:t[1],s:t[2],l:t[3]}:(t=lB.hsla.exec(A))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=lB.hsv.exec(A))?{h:t[1],s:t[2],v:t[3]}:(t=lB.hsva.exec(A))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=lB.hex8.exec(A))?{r:zI(t[1]),g:zI(t[2]),b:zI(t[3]),a:bCe(t[4]),format:e?"name":"hex8"}:(t=lB.hex6.exec(A))?{r:zI(t[1]),g:zI(t[2]),b:zI(t[3]),format:e?"name":"hex"}:(t=lB.hex4.exec(A))?{r:zI(t[1]+""+t[1]),g:zI(t[2]+""+t[2]),b:zI(t[3]+""+t[3]),a:bCe(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=lB.hex3.exec(A))?{r:zI(t[1]+""+t[1]),g:zI(t[2]+""+t[2]),b:zI(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function J8t(A){var e,t;return A=A||{level:"AA",size:"small"},e=(A.level||"AA").toUpperCase(),t=(A.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}var wCe=function(A){var e=["r","g","b","a","h","s","l","v"],t=0,i=0;return l6e(e,function(n){if(A[n]&&(t+=1,isNaN(A[n])||(i+=1),n==="s"||n==="l")){var o=/^\d+%$/;o.test(A[n])&&(i+=1)}}),t===i?A:!1},MH=function(A,e){var t=A.hex?ye(A.hex):ye(A),i=t.toHsl(),n=t.toHsv(),o=t.toRgb(),g=t.toHex();i.s===0&&(i.h=e||0,n.h=e||0);var a=g==="000000"&&o.a===0;return{hsl:i,hex:a?"transparent":"#"+g,rgb:o,hsv:n,oldHue:A.h||e||i.h,source:A.source}},G0=function(A){if(A==="transparent")return!0;var e=String(A).charAt(0)==="#"?1:0;return A.length!==4+e&&A.length<7+e&&ye(A).isValid()},QmA=function(A){if(!A)return"#fff";var e=MH(A);if(e.hex==="transparent")return"rgba(0,0,0,0.4)";var t=(e.rgb.r*299+e.rgb.g*587+e.rgb.b*114)/1e3;return t>=128?"#000":"#fff"},EmA=function(A,e){var t=A.replace("°","");return ye(e+" ("+t+")")._ok},vH=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},N8t=function(){function A(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,i){return t&&A(e.prototype,t),i&&A(e,i),e}}();function Y8t(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function R8t(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:A}function x8t(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}var Jr=function(A){var e=function(t){x8t(i,t);function i(n){Y8t(this,i);var o=R8t(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));return o.handleChange=function(g,a){var s=wCe(g);if(s){var I=MH(g,g.h||o.state.oldHue);o.setState(I),o.props.onChangeComplete&&o.debounce(o.props.onChangeComplete,I,a),o.props.onChange&&o.props.onChange(I,a)}},o.handleSwatchHover=function(g,a){var s=wCe(g);if(s){var I=MH(g,g.h||o.state.oldHue);o.props.onSwatchHover&&o.props.onSwatchHover(I,a)}},o.state=vH({},MH(n.color,0)),o.debounce=Ik(function(g,a,s){g(a,s)},100),o}return N8t(i,[{key:"render",value:function(){var n={};return this.props.onSwatchHover&&(n.onSwatchHover=this.handleSwatchHover),b.createElement(A,vH({},this.props,this.state,{onChange:this.handleChange},n))}}],[{key:"getDerivedStateFromProps",value:function(n,o){return vH({},MH(n.color,o.oldHue))}}]),i}(p.PureComponent||p.Component);return e.propTypes=vH({},A.propTypes),e.defaultProps=vH({},A.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),e},F8t=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},M8t=function(){function A(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,i){return t&&A(e.prototype,t),i&&A(e,i),e}}();function v8t(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function DCe(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:A}function L8t(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}var S8t=function(A){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(t){L8t(i,t);function i(){var n,o,g,a;v8t(this,i);for(var s=arguments.length,I=Array(s),r=0;r<s;r++)I[r]=arguments[r];return a=(o=(g=DCe(this,(n=i.__proto__||Object.getPrototypeOf(i)).call.apply(n,[this].concat(I))),g),g.state={focus:!1},g.handleFocus=function(){return g.setState({focus:!0})},g.handleBlur=function(){return g.setState({focus:!1})},o),DCe(g,a)}return M8t(i,[{key:"render",value:function(){return b.createElement(e,{onFocus:this.handleFocus,onBlur:this.handleBlur},b.createElement(A,F8t({},this.props,this.state)))}}]),i}(b.Component)},GCe=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},H8t=13,Z8t=function(A){var e=A.color,t=A.style,i=A.onClick,n=i===void 0?function(){}:i,o=A.onHover,g=A.title,a=g===void 0?e:g,s=A.children,I=A.focus,r=A.focusStyle,C=r===void 0?{}:r,l=e==="transparent",c=_e({default:{swatch:GCe({background:e,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},t,I?C:{})}}),B=function(f){return n(e,f)},E=function(f){return f.keyCode===H8t&&n(e,f)},u=function(f){return o(e,f)},d={};return o&&(d.onMouseOver=u),b.createElement("div",GCe({style:c.swatch,onClick:B,title:a,tabIndex:0,onKeyDown:E},d),s,l&&b.createElement(qN,{borderRadius:c.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))};const Fw=S8t(Z8t);var W8t=function(A){var e=A.direction,t=_e({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:e==="vertical"});return b.createElement("div",{style:t.picker})},K8t=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},kCe=function(A){var e=A.rgb,t=A.hsl,i=A.width,n=A.height,o=A.onChange,g=A.direction,a=A.style,s=A.renderers,I=A.pointer,r=A.className,C=r===void 0?"":r,l=_e({default:{picker:{position:"relative",width:i,height:n},alpha:{radius:"2px",style:a}}});return b.createElement("div",{style:l.picker,className:"alpha-picker "+C},b.createElement(CmA,K8t({},l.alpha,{rgb:e,hsl:t,pointer:I,renderers:s,onChange:o,direction:g})))};kCe.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:W8t},Jr(kCe);var U8t=function(A){var e=A.colors,t=A.onClick,i=A.onSwatchHover,n=_e({default:{swatches:{marginRight:"-10px"},swatch:{width:"22px",height:"22px",float:"left",marginRight:"10px",marginBottom:"10px",borderRadius:"4px"},clear:{clear:"both"}}});return b.createElement("div",{style:n.swatches},Wy(e,function(o){return b.createElement(Fw,{key:o,color:o,style:n.swatch,onClick:t,onHover:i,focusStyle:{boxShadow:"0 0 4px "+o}})}),b.createElement("div",{style:n.clear}))},umA=function(A){var e=A.onChange,t=A.onSwatchHover,i=A.hex,n=A.colors,o=A.width,g=A.triangle,a=A.styles,s=a===void 0?{}:a,I=A.className,r=I===void 0?"":I,C=i==="transparent",l=function(B,E){G0(B)&&e({hex:B,source:"hex"},E)},c=_e(ir({default:{card:{width:o,background:"#fff",boxShadow:"0 1px rgba(0,0,0,.1)",borderRadius:"6px",position:"relative"},head:{height:"110px",background:i,borderRadius:"6px 6px 0 0",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},body:{padding:"10px"},label:{fontSize:"18px",color:QmA(i),position:"relative"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 10px 10px 10px",borderColor:"transparent transparent "+i+" transparent",position:"absolute",top:"-10px",left:"50%",marginLeft:"-10px"},input:{width:"100%",fontSize:"12px",color:"#666",border:"0px",outline:"none",height:"22px",boxShadow:"inset 0 0 0 1px #ddd",borderRadius:"4px",padding:"0 7px",boxSizing:"border-box"}},"hide-triangle":{triangle:{display:"none"}}},s),{"hide-triangle":g==="hide"});return b.createElement("div",{style:c.card,className:"block-picker "+r},b.createElement("div",{style:c.triangle}),b.createElement("div",{style:c.head},C&&b.createElement(qN,{borderRadius:"6px 6px 0 0"}),b.createElement("div",{style:c.label},i)),b.createElement("div",{style:c.body},b.createElement(U8t,{colors:n,onClick:l,onSwatchHover:t}),b.createElement(zt,{style:{input:c.input},value:i,onChange:l})))};umA.propTypes={width:FA.oneOfType([FA.string,FA.number]),colors:FA.arrayOf(FA.string),triangle:FA.oneOf(["top","hide"]),styles:FA.object},umA.defaultProps={width:170,colors:["#D9E3F0","#F47373","#697689","#37D67A","#2CCCE4","#555555","#dce775","#ff8a65","#ba68c8"],triangle:"top",styles:{}},Jr(umA);var PN={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a400:"#ff1744",a700:"#d50000"},$N={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a400:"#f50057",a700:"#c51162"},AY={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a400:"#d500f9",a700:"#aa00ff"},eY={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a400:"#651fff",a700:"#6200ea"},tY={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a400:"#3d5afe",a700:"#304ffe"},iY={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a400:"#2979ff",a700:"#2962ff"},nY={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a400:"#00b0ff",a700:"#0091ea"},oY={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a400:"#00e5ff",a700:"#00b8d4"},gY={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a400:"#1de9b6",a700:"#00bfa5"},LH={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a400:"#00e676",a700:"#00c853"},aY={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a400:"#76ff03",a700:"#64dd17"},sY={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a400:"#c6ff00",a700:"#aeea00"},rY={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a400:"#ffea00",a700:"#ffd600"},IY={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a400:"#ffc400",a700:"#ffab00"},CY={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a400:"#ff9100",a700:"#ff6d00"},lY={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a400:"#ff3d00",a700:"#dd2c00"},cY={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723"},BY={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238"},JCe=function(A){var e=A.color,t=A.onClick,i=A.onSwatchHover,n=A.hover,o=A.active,g=A.circleSize,a=A.circleSpacing,s=_e({default:{swatch:{width:g,height:g,marginRight:a,marginBottom:a,transform:"scale(1)",transition:"100ms transform ease"},Swatch:{borderRadius:"50%",background:"transparent",boxShadow:"inset 0 0 0 "+(g/2+1)+"px "+e,transition:"100ms box-shadow ease"}},hover:{swatch:{transform:"scale(1.2)"}},active:{Swatch:{boxShadow:"inset 0 0 0 3px "+e}}},{hover:n,active:o});return b.createElement("div",{style:s.swatch},b.createElement(Fw,{style:s.Swatch,color:e,onClick:t,onHover:i,focusStyle:{boxShadow:s.Swatch.boxShadow+", 0 0 5px "+e}}))};JCe.defaultProps={circleSize:28,circleSpacing:14};const V8t=rmA(JCe);var dmA=function(A){var e=A.width,t=A.onChange,i=A.onSwatchHover,n=A.colors,o=A.hex,g=A.circleSize,a=A.styles,s=a===void 0?{}:a,I=A.circleSpacing,r=A.className,C=r===void 0?"":r,l=_e(ir({default:{card:{width:e,display:"flex",flexWrap:"wrap",marginRight:-I,marginBottom:-I}}},s)),c=function(B,E){return t({hex:B,source:"hex"},E)};return b.createElement("div",{style:l.card,className:"circle-picker "+C},Wy(n,function(B){return b.createElement(V8t,{key:B,color:B,onClick:c,onSwatchHover:i,active:o===B.toLowerCase(),circleSize:g,circleSpacing:I})}))};dmA.propTypes={width:FA.oneOfType([FA.string,FA.number]),circleSize:FA.number,circleSpacing:FA.number,styles:FA.object},dmA.defaultProps={width:252,circleSize:28,circleSpacing:14,colors:[PN[500],$N[500],AY[500],eY[500],tY[500],iY[500],nY[500],oY[500],gY[500],LH[500],aY[500],sY[500],rY[500],IY[500],CY[500],lY[500],cY[500],BY[500]],styles:{}},Jr(dmA);var NCe={};Object.defineProperty(NCe,"__esModule",{value:!0});var YCe=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},X8t=b,RCe=z8t(X8t);function z8t(A){return A&&A.__esModule?A:{default:A}}function T8t(A,e){var t={};for(var i in A)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(A,i)&&(t[i]=A[i]);return t}var $q=24,_8t=NCe.default=function(A){var e=A.fill,t=e===void 0?"currentColor":e,i=A.width,n=i===void 0?$q:i,o=A.height,g=o===void 0?$q:o,a=A.style,s=a===void 0?{}:a,I=T8t(A,["fill","width","height","style"]);return RCe.default.createElement("svg",YCe({viewBox:"0 0 "+$q+" "+$q,style:YCe({fill:t,width:n,height:g},s)},I),RCe.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},O8t=function(){function A(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,i){return t&&A(e.prototype,t),i&&A(e,i),e}}();function q8t(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function j8t(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:A}function P8t(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}var xCe=function(A){P8t(e,A);function e(t){q8t(this,e);var i=j8t(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.toggleViews=function(){i.state.view==="hex"?i.setState({view:"rgb"}):i.state.view==="rgb"?i.setState({view:"hsl"}):i.state.view==="hsl"&&(i.props.hsl.a===1?i.setState({view:"hex"}):i.setState({view:"rgb"}))},i.handleChange=function(n,o){n.hex?G0(n.hex)&&i.props.onChange({hex:n.hex,source:"hex"},o):n.r||n.g||n.b?i.props.onChange({r:n.r||i.props.rgb.r,g:n.g||i.props.rgb.g,b:n.b||i.props.rgb.b,source:"rgb"},o):n.a?(n.a<0?n.a=0:n.a>1&&(n.a=1),i.props.onChange({h:i.props.hsl.h,s:i.props.hsl.s,l:i.props.hsl.l,a:Math.round(n.a*100)/100,source:"rgb"},o)):(n.h||n.s||n.l)&&(typeof n.s=="string"&&n.s.includes("%")&&(n.s=n.s.replace("%","")),typeof n.l=="string"&&n.l.includes("%")&&(n.l=n.l.replace("%","")),n.s==1?n.s=.01:n.l==1&&(n.l=.01),i.props.onChange({h:n.h||i.props.hsl.h,s:Number(bWA(n.s)?i.props.hsl.s:n.s),l:Number(bWA(n.l)?i.props.hsl.l:n.l),source:"hsl"},o))},i.showHighlight=function(n){n.currentTarget.style.background="#eee"},i.hideHighlight=function(n){n.currentTarget.style.background="transparent"},t.hsl.a!==1&&t.view==="hex"?i.state={view:"rgb"}:i.state={view:t.view},i}return O8t(e,[{key:"render",value:function(){var t=this,i=_e({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),n=void 0;return this.state.view==="hex"?n=b.createElement("div",{style:i.fields,className:"flexbox-fix"},b.createElement("div",{style:i.field},b.createElement(zt,{style:{input:i.input,label:i.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?n=b.createElement("div",{style:i.fields,className:"flexbox-fix"},b.createElement("div",{style:i.field},b.createElement(zt,{style:{input:i.input,label:i.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),b.createElement("div",{style:i.field},b.createElement(zt,{style:{input:i.input,label:i.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),b.createElement("div",{style:i.field},b.createElement(zt,{style:{input:i.input,label:i.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),b.createElement("div",{style:i.alpha},b.createElement(zt,{style:{input:i.input,label:i.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(n=b.createElement("div",{style:i.fields,className:"flexbox-fix"},b.createElement("div",{style:i.field},b.createElement(zt,{style:{input:i.input,label:i.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),b.createElement("div",{style:i.field},b.createElement(zt,{style:{input:i.input,label:i.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),b.createElement("div",{style:i.field},b.createElement(zt,{style:{input:i.input,label:i.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),b.createElement("div",{style:i.alpha},b.createElement(zt,{style:{input:i.input,label:i.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),b.createElement("div",{style:i.wrap,className:"flexbox-fix"},n,b.createElement("div",{style:i.toggle},b.createElement("div",{style:i.icon,onClick:this.toggleViews,ref:function(o){return t.icon=o}},b.createElement(_8t,{style:i.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(t,i){return t.hsl.a!==1&&i.view==="hex"?{view:"rgb"}:null}}]),e}(b.Component);xCe.defaultProps={view:"hex"};var FCe=function(){var A=_e({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return b.createElement("div",{style:A.picker})},$8t=function(){var A=_e({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return b.createElement("div",{style:A.picker})},hmA=function(A){var e=A.width,t=A.onChange,i=A.disableAlpha,n=A.rgb,o=A.hsl,g=A.hsv,a=A.hex,s=A.renderers,I=A.styles,r=I===void 0?{}:I,C=A.className,l=C===void 0?"":C,c=A.defaultView,B=_e(ir({default:{picker:{width:e,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+n.r+", "+n.g+", "+n.b+", "+n.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},r),{disableAlpha:i});return b.createElement("div",{style:B.picker,className:"chrome-picker "+l},b.createElement("div",{style:B.saturation},b.createElement(qq,{style:B.Saturation,hsl:o,hsv:g,pointer:$8t,onChange:t})),b.createElement("div",{style:B.body},b.createElement("div",{style:B.controls,className:"flexbox-fix"},b.createElement("div",{style:B.color},b.createElement("div",{style:B.swatch},b.createElement("div",{style:B.active}),b.createElement(qN,{renderers:s}))),b.createElement("div",{style:B.toggles},b.createElement("div",{style:B.hue},b.createElement(jN,{style:B.Hue,hsl:o,pointer:FCe,onChange:t})),b.createElement("div",{style:B.alpha},b.createElement(CmA,{style:B.Alpha,rgb:n,hsl:o,pointer:FCe,renderers:s,onChange:t})))),b.createElement(xCe,{rgb:n,hsl:o,hex:a,view:c,onChange:t,disableAlpha:i})))};hmA.propTypes={width:FA.oneOfType([FA.string,FA.number]),disableAlpha:FA.bool,styles:FA.object,defaultView:FA.oneOf(["hex","rgb","hsl"])},hmA.defaultProps={width:225,disableAlpha:!1,styles:{}},Jr(hmA);var APt=function(A){var e=A.color,t=A.onClick,i=t===void 0?function(){}:t,n=A.onSwatchHover,o=A.active,g=_e({default:{color:{background:e,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:QmA(e),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:o,"color-#FFFFFF":e==="#FFFFFF",transparent:e==="transparent"});return b.createElement(Fw,{style:g.color,color:e,onClick:i,onHover:n,focusStyle:{boxShadow:"0 0 4px "+e}},b.createElement("div",{style:g.dot}))},ePt=function(A){var e=A.hex,t=A.rgb,i=A.onChange,n=_e({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:e},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),o=function(g,a){g.r||g.g||g.b?i({r:g.r||t.r,g:g.g||t.g,b:g.b||t.b,source:"rgb"},a):i({hex:g.hex,source:"hex"},a)};return b.createElement("div",{style:n.fields,className:"flexbox-fix"},b.createElement("div",{style:n.active}),b.createElement(zt,{style:{wrap:n.HEXwrap,input:n.HEXinput,label:n.HEXlabel},label:"hex",value:e,onChange:o}),b.createElement(zt,{style:{wrap:n.RGBwrap,input:n.RGBinput,label:n.RGBlabel},label:"r",value:t.r,onChange:o}),b.createElement(zt,{style:{wrap:n.RGBwrap,input:n.RGBinput,label:n.RGBlabel},label:"g",value:t.g,onChange:o}),b.createElement(zt,{style:{wrap:n.RGBwrap,input:n.RGBinput,label:n.RGBlabel},label:"b",value:t.b,onChange:o}))},mmA=function(A){var e=A.onChange,t=A.onSwatchHover,i=A.colors,n=A.hex,o=A.rgb,g=A.styles,a=g===void 0?{}:g,s=A.className,I=s===void 0?"":s,r=_e(ir({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},a)),C=function(l,c){l.hex?G0(l.hex)&&e({hex:l.hex,source:"hex"},c):e(l,c)};return b.createElement(xH,{style:r.Compact,styles:a},b.createElement("div",{style:r.compact,className:"compact-picker "+I},b.createElement("div",null,Wy(i,function(l){return b.createElement(APt,{key:l,color:l,active:l.toLowerCase()===n,onClick:C,onSwatchHover:t})}),b.createElement("div",{style:r.clear})),b.createElement(ePt,{hex:n,rgb:o,onChange:C})))};mmA.propTypes={colors:FA.arrayOf(FA.string),styles:FA.object},mmA.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}},Jr(mmA);var tPt=function(A){var e=A.hover,t=A.color,i=A.onClick,n=A.onSwatchHover,o={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},g=_e({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:o}},{hover:e});return b.createElement("div",{style:g.swatch},b.createElement(Fw,{color:t,onClick:i,onHover:n,focusStyle:o}))};const iPt=rmA(tPt);var pmA=function(A){var e=A.width,t=A.colors,i=A.onChange,n=A.onSwatchHover,o=A.triangle,g=A.styles,a=g===void 0?{}:g,s=A.className,I=s===void 0?"":s,r=_e(ir({default:{card:{width:e,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},a),{"hide-triangle":o==="hide","top-left-triangle":o==="top-left","top-right-triangle":o==="top-right","bottom-left-triangle":o==="bottom-left","bottom-right-triangle":o==="bottom-right"}),C=function(l,c){return i({hex:l,source:"hex"},c)};return b.createElement("div",{style:r.card,className:"github-picker "+I},b.createElement("div",{style:r.triangleShadow}),b.createElement("div",{style:r.triangle}),Wy(t,function(l){return b.createElement(iPt,{color:l,key:l,onClick:C,onSwatchHover:n})}))};pmA.propTypes={width:FA.oneOfType([FA.string,FA.number]),colors:FA.arrayOf(FA.string),triangle:FA.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:FA.object},pmA.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}},Jr(pmA);var nPt=function(A){var e=A.direction,t=_e({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:e==="vertical"});return b.createElement("div",{style:t.picker})},oPt=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},fmA=function(A){var e=A.width,t=A.height,i=A.onChange,n=A.hsl,o=A.direction,g=A.pointer,a=A.styles,s=a===void 0?{}:a,I=A.className,r=I===void 0?"":I,C=_e(ir({default:{picker:{position:"relative",width:e,height:t},hue:{radius:"2px"}}},s)),l=function(c){return i({a:1,h:c.h,l:.5,s:1})};return b.createElement("div",{style:C.picker,className:"hue-picker "+r},b.createElement(jN,oPt({},C.hue,{hsl:n,pointer:g,onChange:l,direction:o})))};fmA.propTypes={styles:FA.object},fmA.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:nPt,styles:{}},Jr(fmA);var gPt=function(A){var e=A.onChange,t=A.hex,i=A.rgb,n=A.styles,o=n===void 0?{}:n,g=A.className,a=g===void 0?"":g,s=_e(ir({default:{material:{width:"98px",height:"98px",padding:"16px",fontFamily:"Roboto"},HEXwrap:{position:"relative"},HEXinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"2px solid "+t,outline:"none",height:"30px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},Hex:{style:{}},RGBwrap:{position:"relative"},RGBinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"1px solid #eee",outline:"none",height:"30px"},RGBlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},split:{display:"flex",marginRight:"-10px",paddingTop:"11px"},third:{flex:"1",paddingRight:"10px"}}},o)),I=function(r,C){r.hex?G0(r.hex)&&e({hex:r.hex,source:"hex"},C):(r.r||r.g||r.b)&&e({r:r.r||i.r,g:r.g||i.g,b:r.b||i.b,source:"rgb"},C)};return b.createElement(xH,{styles:o},b.createElement("div",{style:s.material,className:"material-picker "+a},b.createElement(zt,{style:{wrap:s.HEXwrap,input:s.HEXinput,label:s.HEXlabel},label:"hex",value:t,onChange:I}),b.createElement("div",{style:s.split,className:"flexbox-fix"},b.createElement("div",{style:s.third},b.createElement(zt,{style:{wrap:s.RGBwrap,input:s.RGBinput,label:s.RGBlabel},label:"r",value:i.r,onChange:I})),b.createElement("div",{style:s.third},b.createElement(zt,{style:{wrap:s.RGBwrap,input:s.RGBinput,label:s.RGBlabel},label:"g",value:i.g,onChange:I})),b.createElement("div",{style:s.third},b.createElement(zt,{style:{wrap:s.RGBwrap,input:s.RGBinput,label:s.RGBlabel},label:"b",value:i.b,onChange:I})))))};Jr(gPt);var aPt=function(A){var e=A.onChange,t=A.rgb,i=A.hsv,n=A.hex,o=_e({default:{fields:{paddingTop:"5px",paddingBottom:"9px",width:"80px",position:"relative"},divider:{height:"5px"},RGBwrap:{position:"relative"},RGBinput:{marginLeft:"40%",width:"40%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"5px",fontSize:"13px",paddingLeft:"3px",marginRight:"10px"},RGBlabel:{left:"0px",top:"0px",width:"34px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px",position:"absolute"},HEXwrap:{position:"relative"},HEXinput:{marginLeft:"20%",width:"80%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"6px",fontSize:"13px",paddingLeft:"3px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",width:"14px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px"},fieldSymbols:{position:"absolute",top:"5px",right:"-7px",fontSize:"13px"},symbol:{height:"20px",lineHeight:"22px",paddingBottom:"7px"}}}),g=function(a,s){a["#"]?G0(a["#"])&&e({hex:a["#"],source:"hex"},s):a.r||a.g||a.b?e({r:a.r||t.r,g:a.g||t.g,b:a.b||t.b,source:"rgb"},s):(a.h||a.s||a.v)&&e({h:a.h||i.h,s:a.s||i.s,v:a.v||i.v,source:"hsv"},s)};return b.createElement("div",{style:o.fields},b.createElement(zt,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"h",value:Math.round(i.h),onChange:g}),b.createElement(zt,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"s",value:Math.round(i.s*100),onChange:g}),b.createElement(zt,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"v",value:Math.round(i.v*100),onChange:g}),b.createElement("div",{style:o.divider}),b.createElement(zt,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:t.r,onChange:g}),b.createElement(zt,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:t.g,onChange:g}),b.createElement(zt,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:t.b,onChange:g}),b.createElement("div",{style:o.divider}),b.createElement(zt,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"#",value:n.replace("#",""),onChange:g}),b.createElement("div",{style:o.fieldSymbols},b.createElement("div",{style:o.symbol},"°"),b.createElement("div",{style:o.symbol},"%"),b.createElement("div",{style:o.symbol},"%")))},sPt=function(A){var e=A.hsl,t=_e({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}},"black-outline":{picker:{boxShadow:"inset 0 0 0 1px #000"}}},{"black-outline":e.l>.5});return b.createElement("div",{style:t.picker})},rPt=function(){var A=_e({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return b.createElement("div",{style:A.pointer},b.createElement("div",{style:A.left},b.createElement("div",{style:A.leftInside})),b.createElement("div",{style:A.right},b.createElement("div",{style:A.rightInside})))},MCe=function(A){var e=A.onClick,t=A.label,i=A.children,n=A.active,o=_e({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:n});return b.createElement("div",{style:o.button,onClick:e},t||i)},IPt=function(A){var e=A.rgb,t=A.currentColor,i=_e({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+e.r+","+e.g+", "+e.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:t,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return b.createElement("div",null,b.createElement("div",{style:i.label},"new"),b.createElement("div",{style:i.swatches},b.createElement("div",{style:i.new}),b.createElement("div",{style:i.current})),b.createElement("div",{style:i.label},"current"))},CPt=function(){function A(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,i){return t&&A(e.prototype,t),i&&A(e,i),e}}();function lPt(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function cPt(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:A}function BPt(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}var ymA=function(A){BPt(e,A);function e(t){lPt(this,e);var i=cPt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.state={currentColor:t.hex},i}return CPt(e,[{key:"render",value:function(){var t=this.props,i=t.styles,n=i===void 0?{}:i,o=t.className,g=o===void 0?"":o,a=_e(ir({default:{picker:{background:"#DCDCDC",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)",boxSizing:"initial",width:"513px"},head:{backgroundImage:"linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)",borderBottom:"1px solid #B1B1B1",boxShadow:"inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)",height:"23px",lineHeight:"24px",borderRadius:"4px 4px 0 0",fontSize:"13px",color:"#4D4D4D",textAlign:"center"},body:{padding:"15px 15px 0",display:"flex"},saturation:{width:"256px",height:"256px",position:"relative",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0",overflow:"hidden"},hue:{position:"relative",height:"256px",width:"19px",marginLeft:"10px",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0"},controls:{width:"180px",marginLeft:"10px"},top:{display:"flex"},previews:{width:"60px"},actions:{flex:"1",marginLeft:"20px"}}},n));return b.createElement("div",{style:a.picker,className:"photoshop-picker "+g},b.createElement("div",{style:a.head},this.props.header),b.createElement("div",{style:a.body,className:"flexbox-fix"},b.createElement("div",{style:a.saturation},b.createElement(qq,{hsl:this.props.hsl,hsv:this.props.hsv,pointer:sPt,onChange:this.props.onChange})),b.createElement("div",{style:a.hue},b.createElement(jN,{direction:"vertical",hsl:this.props.hsl,pointer:rPt,onChange:this.props.onChange})),b.createElement("div",{style:a.controls},b.createElement("div",{style:a.top,className:"flexbox-fix"},b.createElement("div",{style:a.previews},b.createElement(IPt,{rgb:this.props.rgb,currentColor:this.state.currentColor})),b.createElement("div",{style:a.actions},b.createElement(MCe,{label:"OK",onClick:this.props.onAccept,active:!0}),b.createElement(MCe,{label:"Cancel",onClick:this.props.onCancel}),b.createElement(aPt,{onChange:this.props.onChange,rgb:this.props.rgb,hsv:this.props.hsv,hex:this.props.hex}))))))}}]),e}(b.Component);ymA.propTypes={header:FA.string,styles:FA.object},ymA.defaultProps={header:"Color Picker",styles:{}},Jr(ymA);var QPt=function(A){var e=A.onChange,t=A.rgb,i=A.hsl,n=A.hex,o=A.disableAlpha,g=_e({default:{fields:{display:"flex",paddingTop:"4px"},single:{flex:"1",paddingLeft:"6px"},alpha:{flex:"1",paddingLeft:"6px"},double:{flex:"2"},input:{width:"80%",padding:"4px 10% 3px",border:"none",boxShadow:"inset 0 0 0 1px #ccc",fontSize:"11px"},label:{display:"block",textAlign:"center",fontSize:"11px",color:"#222",paddingTop:"3px",paddingBottom:"4px",textTransform:"capitalize"}},disableAlpha:{alpha:{display:"none"}}},{disableAlpha:o}),a=function(s,I){s.hex?G0(s.hex)&&e({hex:s.hex,source:"hex"},I):s.r||s.g||s.b?e({r:s.r||t.r,g:s.g||t.g,b:s.b||t.b,a:t.a,source:"rgb"},I):s.a&&(s.a<0?s.a=0:s.a>100&&(s.a=100),s.a/=100,e({h:i.h,s:i.s,l:i.l,a:s.a,source:"rgb"},I))};return b.createElement("div",{style:g.fields,className:"flexbox-fix"},b.createElement("div",{style:g.double},b.createElement(zt,{style:{input:g.input,label:g.label},label:"hex",value:n.replace("#",""),onChange:a})),b.createElement("div",{style:g.single},b.createElement(zt,{style:{input:g.input,label:g.label},label:"r",value:t.r,onChange:a,dragLabel:"true",dragMax:"255"})),b.createElement("div",{style:g.single},b.createElement(zt,{style:{input:g.input,label:g.label},label:"g",value:t.g,onChange:a,dragLabel:"true",dragMax:"255"})),b.createElement("div",{style:g.single},b.createElement(zt,{style:{input:g.input,label:g.label},label:"b",value:t.b,onChange:a,dragLabel:"true",dragMax:"255"})),b.createElement("div",{style:g.alpha},b.createElement(zt,{style:{input:g.input,label:g.label},label:"a",value:Math.round(t.a*100),onChange:a,dragLabel:"true",dragMax:"100"})))},EPt=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},vCe=function(A){var e=A.colors,t=A.onClick,i=t===void 0?function(){}:t,n=A.onSwatchHover,o=_e({default:{colors:{margin:"0 -10px",padding:"10px 0 0 10px",borderTop:"1px solid #eee",display:"flex",flexWrap:"wrap",position:"relative"},swatchWrap:{width:"16px",height:"16px",margin:"0 10px 10px 0"},swatch:{borderRadius:"3px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15)"}},"no-presets":{colors:{display:"none"}}},{"no-presets":!e||!e.length}),g=function(a,s){i({hex:a,source:"hex"},s)};return b.createElement("div",{style:o.colors,className:"flexbox-fix"},e.map(function(a){var s=typeof a=="string"?{color:a}:a,I=""+s.color+(s.title||"");return b.createElement("div",{key:I,style:o.swatchWrap},b.createElement(Fw,EPt({},s,{style:o.swatch,onClick:g,onHover:n,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+s.color}})))}))};vCe.propTypes={colors:FA.arrayOf(FA.oneOfType([FA.string,FA.shape({color:FA.string,title:FA.string})])).isRequired};var uPt=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},bmA=function(A){var e=A.width,t=A.rgb,i=A.hex,n=A.hsv,o=A.hsl,g=A.onChange,a=A.onSwatchHover,s=A.disableAlpha,I=A.presetColors,r=A.renderers,C=A.styles,l=C===void 0?{}:C,c=A.className,B=c===void 0?"":c,E=_e(ir({default:uPt({picker:{width:e,padding:"10px 10px 0",boxSizing:"initial",background:"#fff",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"},saturation:{width:"100%",paddingBottom:"75%",position:"relative",overflow:"hidden"},Saturation:{radius:"3px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},controls:{display:"flex"},sliders:{padding:"4px 0",flex:"1"},color:{width:"24px",height:"24px",position:"relative",marginTop:"4px",marginLeft:"4px",borderRadius:"3px"},activeColor:{absolute:"0px 0px 0px 0px",borderRadius:"2px",background:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hue:{position:"relative",height:"10px",overflow:"hidden"},Hue:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},alpha:{position:"relative",height:"10px",marginTop:"4px",overflow:"hidden"},Alpha:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"}},l),disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},l),{disableAlpha:s});return b.createElement("div",{style:E.picker,className:"sketch-picker "+B},b.createElement("div",{style:E.saturation},b.createElement(qq,{style:E.Saturation,hsl:o,hsv:n,onChange:g})),b.createElement("div",{style:E.controls,className:"flexbox-fix"},b.createElement("div",{style:E.sliders},b.createElement("div",{style:E.hue},b.createElement(jN,{style:E.Hue,hsl:o,onChange:g})),b.createElement("div",{style:E.alpha},b.createElement(CmA,{style:E.Alpha,rgb:t,hsl:o,renderers:r,onChange:g}))),b.createElement("div",{style:E.color},b.createElement(qN,null),b.createElement("div",{style:E.activeColor}))),b.createElement(QPt,{rgb:t,hsl:o,hex:i,onChange:g,disableAlpha:s}),b.createElement(vCe,{colors:I,onClick:g,onSwatchHover:a}))};bmA.propTypes={disableAlpha:FA.bool,width:FA.oneOfType([FA.string,FA.number]),styles:FA.object},bmA.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]};const dPt=Jr(bmA);var SH=function(A){var e=A.hsl,t=A.offset,i=A.onClick,n=i===void 0?function(){}:i,o=A.active,g=A.first,a=A.last,s=_e({default:{swatch:{height:"12px",background:"hsl("+e.h+", 50%, "+t*100+"%)",cursor:"pointer"}},first:{swatch:{borderRadius:"2px 0 0 2px"}},last:{swatch:{borderRadius:"0 2px 2px 0"}},active:{swatch:{transform:"scaleY(1.8)",borderRadius:"3.6px/2px"}}},{active:o,first:g,last:a}),I=function(r){return n({h:e.h,s:.5,l:t,source:"hsl"},r)};return b.createElement("div",{style:s.swatch,onClick:I})},hPt=function(A){var e=A.onClick,t=A.hsl,i=_e({default:{swatches:{marginTop:"20px"},swatch:{boxSizing:"border-box",width:"20%",paddingRight:"1px",float:"left"},clear:{clear:"both"}}}),n=.1;return b.createElement("div",{style:i.swatches},b.createElement("div",{style:i.swatch},b.createElement(SH,{hsl:t,offset:".80",active:Math.abs(t.l-.8)<n&&Math.abs(t.s-.5)<n,onClick:e,first:!0})),b.createElement("div",{style:i.swatch},b.createElement(SH,{hsl:t,offset:".65",active:Math.abs(t.l-.65)<n&&Math.abs(t.s-.5)<n,onClick:e})),b.createElement("div",{style:i.swatch},b.createElement(SH,{hsl:t,offset:".50",active:Math.abs(t.l-.5)<n&&Math.abs(t.s-.5)<n,onClick:e})),b.createElement("div",{style:i.swatch},b.createElement(SH,{hsl:t,offset:".35",active:Math.abs(t.l-.35)<n&&Math.abs(t.s-.5)<n,onClick:e})),b.createElement("div",{style:i.swatch},b.createElement(SH,{hsl:t,offset:".20",active:Math.abs(t.l-.2)<n&&Math.abs(t.s-.5)<n,onClick:e,last:!0})),b.createElement("div",{style:i.clear}))},mPt=function(){var A=_e({default:{picker:{width:"14px",height:"14px",borderRadius:"6px",transform:"translate(-7px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return b.createElement("div",{style:A.picker})},wmA=function(A){var e=A.hsl,t=A.onChange,i=A.pointer,n=A.styles,o=n===void 0?{}:n,g=A.className,a=g===void 0?"":g,s=_e(ir({default:{hue:{height:"12px",position:"relative"},Hue:{radius:"2px"}}},o));return b.createElement("div",{style:s.wrap||{},className:"slider-picker "+a},b.createElement("div",{style:s.hue},b.createElement(jN,{style:s.Hue,hsl:e,pointer:i,onChange:t})),b.createElement("div",{style:s.swatches},b.createElement(hPt,{hsl:e,onClick:t})))};wmA.propTypes={styles:FA.object},wmA.defaultProps={pointer:mPt,styles:{}},Jr(wmA);var LCe={};Object.defineProperty(LCe,"__esModule",{value:!0});var SCe=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},pPt=b,HCe=fPt(pPt);function fPt(A){return A&&A.__esModule?A:{default:A}}function yPt(A,e){var t={};for(var i in A)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(A,i)&&(t[i]=A[i]);return t}var Aj=24,bPt=LCe.default=function(A){var e=A.fill,t=e===void 0?"currentColor":e,i=A.width,n=i===void 0?Aj:i,o=A.height,g=o===void 0?Aj:o,a=A.style,s=a===void 0?{}:a,I=yPt(A,["fill","width","height","style"]);return HCe.default.createElement("svg",SCe({viewBox:"0 0 "+Aj+" "+Aj,style:SCe({fill:t,width:n,height:g},s)},I),HCe.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},wPt=function(A){var e=A.color,t=A.onClick,i=t===void 0?function(){}:t,n=A.onSwatchHover,o=A.first,g=A.last,a=A.active,s=_e({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:e,marginBottom:"1px"},check:{color:QmA(e),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:o,last:g,active:a,"color-#FFFFFF":e==="#FFFFFF",transparent:e==="transparent"});return b.createElement(Fw,{color:e,style:s.color,onClick:i,onHover:n,focusStyle:{boxShadow:"0 0 4px "+e}},b.createElement("div",{style:s.check},b.createElement(bPt,null)))},DPt=function(A){var e=A.onClick,t=A.onSwatchHover,i=A.group,n=A.active,o=_e({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return b.createElement("div",{style:o.group},Wy(i,function(g,a){return b.createElement(wPt,{key:g,color:g,active:g.toLowerCase()===n,first:a===0,last:a===i.length-1,onClick:e,onSwatchHover:t})}))},DmA=function(A){var e=A.width,t=A.height,i=A.onChange,n=A.onSwatchHover,o=A.colors,g=A.hex,a=A.styles,s=a===void 0?{}:a,I=A.className,r=I===void 0?"":I,C=_e(ir({default:{picker:{width:e,height:t},overflow:{height:t,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},s)),l=function(c,B){return i({hex:c,source:"hex"},B)};return b.createElement("div",{style:C.picker,className:"swatches-picker "+r},b.createElement(xH,null,b.createElement("div",{style:C.overflow},b.createElement("div",{style:C.body},Wy(o,function(c){return b.createElement(DPt,{key:c.toString(),group:c,active:g,onClick:l,onSwatchHover:n})}),b.createElement("div",{style:C.clear})))))};DmA.propTypes={width:FA.oneOfType([FA.string,FA.number]),height:FA.oneOfType([FA.string,FA.number]),colors:FA.arrayOf(FA.arrayOf(FA.string)),styles:FA.object},DmA.defaultProps={width:320,height:240,colors:[[PN[900],PN[700],PN[500],PN[300],PN[100]],[$N[900],$N[700],$N[500],$N[300],$N[100]],[AY[900],AY[700],AY[500],AY[300],AY[100]],[eY[900],eY[700],eY[500],eY[300],eY[100]],[tY[900],tY[700],tY[500],tY[300],tY[100]],[iY[900],iY[700],iY[500],iY[300],iY[100]],[nY[900],nY[700],nY[500],nY[300],nY[100]],[oY[900],oY[700],oY[500],oY[300],oY[100]],[gY[900],gY[700],gY[500],gY[300],gY[100]],["#194D33",LH[700],LH[500],LH[300],LH[100]],[aY[900],aY[700],aY[500],aY[300],aY[100]],[sY[900],sY[700],sY[500],sY[300],sY[100]],[rY[900],rY[700],rY[500],rY[300],rY[100]],[IY[900],IY[700],IY[500],IY[300],IY[100]],[CY[900],CY[700],CY[500],CY[300],CY[100]],[lY[900],lY[700],lY[500],lY[300],lY[100]],[cY[900],cY[700],cY[500],cY[300],cY[100]],[BY[900],BY[700],BY[500],BY[300],BY[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}},Jr(DmA);var GmA=function(A){var e=A.onChange,t=A.onSwatchHover,i=A.hex,n=A.colors,o=A.width,g=A.triangle,a=A.styles,s=a===void 0?{}:a,I=A.className,r=I===void 0?"":I,C=_e(ir({default:{card:{width:o,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},s),{"hide-triangle":g==="hide","top-left-triangle":g==="top-left","top-right-triangle":g==="top-right"}),l=function(c,B){G0(c)&&e({hex:c,source:"hex"},B)};return b.createElement("div",{style:C.card,className:"twitter-picker "+r},b.createElement("div",{style:C.triangleShadow}),b.createElement("div",{style:C.triangle}),b.createElement("div",{style:C.body},Wy(n,function(c,B){return b.createElement(Fw,{key:B,color:c,hex:c,style:C.swatch,onClick:l,onHover:t,focusStyle:{boxShadow:"0 0 4px "+c}})}),b.createElement("div",{style:C.hash},"#"),b.createElement(zt,{label:null,style:{input:C.input},value:i.replace("#",""),onChange:l}),b.createElement("div",{style:C.clear})))};GmA.propTypes={width:FA.oneOfType([FA.string,FA.number]),triangle:FA.oneOf(["hide","top-left","top-right"]),colors:FA.arrayOf(FA.string),styles:FA.object},GmA.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}},Jr(GmA);var kmA=function(A){var e=_e({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(A.hsl.h)+", "+Math.round(A.hsl.s*100)+"%, "+Math.round(A.hsl.l*100)+"%)"}}});return b.createElement("div",{style:e.picker})};kmA.propTypes={hsl:FA.shape({h:FA.number,s:FA.number,l:FA.number,a:FA.number})},kmA.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var JmA=function(A){var e=_e({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(A.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return b.createElement("div",{style:e.picker})};JmA.propTypes={hsl:FA.shape({h:FA.number,s:FA.number,l:FA.number,a:FA.number})},JmA.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var GPt=function(A){var e=A.onChange,t=A.rgb,i=A.hsl,n=A.hex,o=A.hsv,g=function(C,l){if(C.hex)G0(C.hex)&&e({hex:C.hex,source:"hex"},l);else if(C.rgb){var c=C.rgb.split(",");EmA(C.rgb,"rgb")&&e({r:c[0],g:c[1],b:c[2],a:1,source:"rgb"},l)}else if(C.hsv){var B=C.hsv.split(",");EmA(C.hsv,"hsv")&&(B[2]=B[2].replace("%",""),B[1]=B[1].replace("%",""),B[0]=B[0].replace("°",""),B[1]==1?B[1]=.01:B[2]==1&&(B[2]=.01),e({h:Number(B[0]),s:Number(B[1]),v:Number(B[2]),source:"hsv"},l))}else if(C.hsl){var E=C.hsl.split(",");EmA(C.hsl,"hsl")&&(E[2]=E[2].replace("%",""),E[1]=E[1].replace("%",""),E[0]=E[0].replace("°",""),r[1]==1?r[1]=.01:r[2]==1&&(r[2]=.01),e({h:Number(E[0]),s:Number(E[1]),v:Number(E[2]),source:"hsl"},l))}},a=_e({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),s=t.r+", "+t.g+", "+t.b,I=Math.round(i.h)+"°, "+Math.round(i.s*100)+"%, "+Math.round(i.l*100)+"%",r=Math.round(o.h)+"°, "+Math.round(o.s*100)+"%, "+Math.round(o.v*100)+"%";return b.createElement("div",{style:a.wrap,className:"flexbox-fix"},b.createElement("div",{style:a.fields},b.createElement("div",{style:a.double},b.createElement(zt,{style:{input:a.input,label:a.label},label:"hex",value:n,onChange:g})),b.createElement("div",{style:a.column},b.createElement("div",{style:a.single},b.createElement(zt,{style:{input:a.input2,label:a.label2},label:"rgb",value:s,onChange:g})),b.createElement("div",{style:a.single},b.createElement(zt,{style:{input:a.input2,label:a.label2},label:"hsv",value:r,onChange:g})),b.createElement("div",{style:a.single},b.createElement(zt,{style:{input:a.input2,label:a.label2},label:"hsl",value:I,onChange:g})))))},NmA=function(A){var e=A.width,t=A.onChange,i=A.rgb,n=A.hsl,o=A.hsv,g=A.hex,a=A.header,s=A.styles,I=s===void 0?{}:s,r=A.className,C=r===void 0?"":r,l=_e(ir({default:{picker:{width:e,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+i.r+", "+i.g+", "+i.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},I));return b.createElement("div",{style:l.picker,className:"google-picker "+C},b.createElement("div",{style:l.head},a),b.createElement("div",{style:l.swatch}),b.createElement("div",{style:l.saturation},b.createElement(qq,{hsl:n,hsv:o,pointer:kmA,onChange:t})),b.createElement("div",{style:l.body},b.createElement("div",{style:l.controls,className:"flexbox-fix"},b.createElement("div",{style:l.hue},b.createElement(jN,{style:l.Hue,hsl:n,radius:"4px",pointer:JmA,onChange:t}))),b.createElement(GPt,{rgb:i,hsl:n,hex:g,hsv:o,onChange:t})))};NmA.propTypes={width:FA.oneOfType([FA.string,FA.number]),styles:FA.object,header:FA.string},NmA.defaultProps={width:652,styles:{},header:"Color picker"},Jr(NmA);const ZCe=an(dPt)`
    --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
    box-shadow: ${({noShadow:A})=>A?"none":"var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)"} !important;
    border-color: hsl(var(--border)) !important;
    border-width: ${({noBorder:A})=>A?"0":"1px"} !important;
    background: hsl(var(--popover)) !important;
    color: hsl(var(--popover-foreground)) !important;
    .flexbox-fix {
        border-color: hsl(var(--border)) !important;
    }
    label {
        color: hsl(var(--popover-foreground)) !important;
    }
    input {
        box-shadow: none !important;
        border-radius: calc(var(--radius) - 2px) !important;
        border: 1px solid hsl(var(--input)) !important;
        background-color: transparent !important;
        width: 100% !important;
    }
`,kPt=p.createContext(null),YmA={didCatch:!1,error:null};class HH extends p.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=YmA}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,i,n=arguments.length,o=new Array(n),g=0;g<n;g++)o[g]=arguments[g];(t=(i=this.props).onReset)===null||t===void 0||t.call(i,{args:o,reason:"imperative-api"}),this.setState(YmA)}}componentDidCatch(e,t){var i,n;(i=(n=this.props).onError)===null||i===void 0||i.call(n,e,t)}componentDidUpdate(e,t){const{didCatch:i}=this.state,{resetKeys:n}=this.props;if(i&&t.error!==null&&JPt(e.resetKeys,n)){var o,g;(o=(g=this.props).onReset)===null||o===void 0||o.call(g,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(YmA)}}render(){const{children:e,fallbackRender:t,FallbackComponent:i,fallback:n}=this.props,{didCatch:o,error:g}=this.state;let a=e;if(o){const s={error:g,resetErrorBoundary:this.resetErrorBoundary};if(p.isValidElement(n))a=n;else if(typeof t=="function")a=t(s);else if(i)a=p.createElement(i,s);else throw g}return p.createElement(kPt.Provider,{value:{didCatch:o,error:g,resetErrorBoundary:this.resetErrorBoundary}},a)}}function JPt(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return A.length!==e.length||A.some((t,i)=>!Object.is(t,e[i]))}const NPt=["#5B8FF9","#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],WCe=({defaultColor:A,setDefaultColor:e,setPrimaryColorEdited:t,displayColorPicker:i,setDisplayColorPicker:n})=>b.createElement(HH,{fallback:b.createElement("div",{className:"flex space-x-2"},b.createElement("div",{className:"w-4 h-4",style:{backgroundColor:`rgba(${A.r},${A.g},${A.b},${A.a})`}}),b.createElement(oo,{value:A.r,type:"number",onChange:o=>{t(!0),e(g=>({...g,r:Number(o.target.value)}))}}),b.createElement(oo,{value:A.g,type:"number",onChange:o=>{t(!0),e(g=>({...g,g:Number(o.target.value)}))}}),b.createElement(oo,{value:A.b,type:"number",onChange:o=>{t(!0),e(g=>({...g,b:Number(o.target.value)}))}}))},b.createElement("div",{className:"relative",onClick:o=>{o.stopPropagation(),o.preventDefault()}},b.createElement("div",{className:"w-8 h-5 border-2",style:{backgroundColor:`rgba(${A.r},${A.g},${A.b},${A.a})`},onClick:o=>{o.stopPropagation(),o.preventDefault(),n(!0)}}),b.createElement("div",{className:"absolute left-0 top-8 z-40 shadow-sm"},i&&b.createElement(ZCe,{presetColors:NPt,color:A,onChange:o=>{t(!0),e({...o.rgb,a:o.rgb.a??1})}}))));function ZH(){const[A,e]=p.useState(!1),[t,i]=p.useState(!1),[n,o]=p.useState(0),[g,a]=p.useState(100),[s,I]=p.useState(!1),[r,C]=p.useState("linear"),l=p.useCallback(c=>{i(xi(c.domainMax)),e(xi(c.domainMin)),I(xi(c.type)),o(c.domainMin??0),a(c.domainMax??100),C(c.type??"linear")},[]);return{value:p.useMemo(()=>({...s?{type:r}:{},...t?{domainMax:g}:{},...A?{domainMin:n}:{}}),[t&&g,A&&n,s&&r]),setValue:l,enableMaxDomain:t,enableMinDomain:A,domainMax:g,domainMin:n,setEnableMinDomain:e,setEnableMaxDomain:i,setDomainMin:o,setDomainMax:a,enableType:s,type:r,setType:C,setEnableType:I}}function KCe(A,e,t,i){const[n,o]=p.useState(!1),[g,a]=p.useState(!1),[s,I]=p.useState(!1),[r,C]=p.useState(0),[l,c]=p.useState(100),[B,E]=p.useState(t??A),[u,d]=p.useState(i??e),[f,w]=p.useState(!1),[y,G]=p.useState("linear"),R=p.useCallback(F=>{a(xi(F.domainMax)),o(xi(F.domainMin)),I(xi(F.rangeMax)||xi(F.rangeMin)),w(xi(F.type)),C(F.domainMin??0),c(F.domainMax??100),d(F.rangeMax??i??e),E(F.rangeMin??t??A),G(F.type??"linear")},[i,t,e,A]),x=p.useMemo(()=>({...f?{type:y}:{},...g?{domainMax:l}:{},...n?{domainMin:r}:{},...s?{rangeMax:u,rangeMin:B}:{}}),[g&&l,n&&r,s&&u,s&&B,f&&y]);return{type:y,setType:G,enableType:f,setEnableType:w,value:x,setValue:R,enableMaxDomain:g,enableMinDomain:n,enableRange:s,rangeMax:u,rangeMin:B,domainMax:l,domainMin:r,setEnableMinDomain:o,setEnableMaxDomain:a,setEnableRange:I,setDomainMin:C,setDomainMax:c,setRangeMin:E,setRangeMax:d}}const YPt=()=>{const A=xt(),{layout:e,showVisualConfigPanel:t,config:i}=A,{t:n}=ve(),o=["numberFormat","timeFormat","normalizedNumberFormat"],[g,a]=p.useState({numberFormat:e.format.numberFormat,timeFormat:e.format.timeFormat,normalizedNumberFormat:e.format.normalizedNumberFormat}),[s,I]=p.useState({x:e.resolve.x,y:e.resolve.y,color:e.resolve.color,opacity:e.resolve.opacity,shape:e.resolve.shape,size:e.resolve.size}),[r,C]=p.useState(e.zeroScale),[l,c]=p.useState(e.useSvg??!1),[B,E]=p.useState(e.scaleIncludeUnmatchedChoropleth??!1),[u,d]=p.useState(e.showAllGeoshapeInChoropleth??!1),[f,w]=p.useState(e.renderer??"vega-lite"),[y,G]=p.useState({r:255,g:255,b:255,a:0}),[R,x]=p.useState({r:91,g:143,b:249,a:1}),[F,Q]=p.useState(!1),[k,h]=p.useState(!1),[N,v]=p.useState(!1),[K,U]=p.useState(!1),[V,X]=p.useState(""),{vizThemeConfig:_,setVizThemeConfig:q}=p.useContext(hX),[$,nA]=p.useState(typeof _=="string"?_:"vega"),[j,O]=p.useState(void 0),[eA,oA]=p.useState(void 0),[tA,sA]=p.useState(!1),[gA,iA]=p.useState([]),aA=ZH(),lA=ZH(),CA=ZH(),QA=ZH(),uA=ZH(),fA=KCe(0,1,.3,.8),hA=KCe(0,100),yA=new Set(gA);return p.useEffect(()=>{var mA,LA,UA,ne,SA,ae,EA;C(e.zeroScale),c(e.useSvg??!1),w(e.renderer??"vega-lite"),G(sUA({r:255,g:255,b:255,a:0},e.background)),I(e.resolve),x(sUA({r:91,g:143,b:249,a:1},e.primaryColor)),Q(!1),h(!1),E(e.scaleIncludeUnmatchedChoropleth??!1),a({numberFormat:e.format.numberFormat,timeFormat:e.format.timeFormat,normalizedNumberFormat:e.format.normalizedNumberFormat}),X(e.colorPalette??""),nA(typeof _=="string"?_:"vega");const wA=Object.entries(e.scale??{}).filter(([se,we])=>Object.entries(we).filter(([be,Oe])=>!!Oe).length>0).map(([se])=>se);iA(wA.length===0?["opacity","size"]:wA),aA.setValue(((mA=e.scale)==null?void 0:mA.column)??{}),lA.setValue(((LA=e.scale)==null?void 0:LA.row)??{}),CA.setValue(((UA=e.scale)==null?void 0:UA.color)??{}),QA.setValue(((ne=e.scale)==null?void 0:ne.theta)??{}),uA.setValue(((SA=e.scale)==null?void 0:SA.radius)??{}),fA.setValue(((ae=e.scale)==null?void 0:ae.opacity)??{}),hA.setValue(((EA=e.scale)==null?void 0:EA.size)??{}),O(e.geoMapTileUrl),oA(i.timezoneDisplayOffset),sA(!1)},[t,_]),b.createElement(sa,{open:t,onOpenChange:()=>{A.setShowVisualConfigPanel(!1)}},b.createElement(Cge,{className:"p-0",onClick:()=>{v(!1),U(!1)}},b.createElement("div",{className:"flex flex-col max-h-[calc(min(800px,90vh))] py-6"},b.createElement("div",{className:"overflow-y-auto flex-shrink-1 min-h-0 px-6"},b.createElement(mH,null,b.createElement(fH,null,b.createElement(yH,null,"Colors")),b.createElement(pH,null,b.createElement("div",{className:"flex gap-6 flex-col md:flex-row"},b.createElement("div",null,b.createElement("label",{className:"block text-xs font-medium leading-6"},n("config.primary_color")),b.createElement(WCe,{defaultColor:R,setDefaultColor:x,setPrimaryColorEdited:Q,displayColorPicker:N,setDisplayColorPicker:v})),b.createElement("div",null,b.createElement("label",{className:"block text-xs font-medium leading-6"},n("config.background")," ",n("config.color")),b.createElement(WCe,{defaultColor:y,setDefaultColor:G,setPrimaryColorEdited:h,displayColorPicker:K,setDisplayColorPicker:U})),b.createElement("div",null,b.createElement("label",{className:"block text-xs font-medium leading-6"},n("config.theme")),b.createElement(Fq,{className:"w-48 h-fit",popClassName:"w-48",selectedKey:$,onSelect:mA=>nA(mA),options:[{value:"vega",label:"vega"},{value:"g2",label:"g2"},{value:"streamlit",label:"streamlit"}]})),b.createElement("div",null,b.createElement("label",{className:"block text-xs font-medium leading-6"},n("config.color_palette")),b.createElement(Fq,{className:"w-48 h-fit",popClassName:"w-48",selectedKey:V,onSelect:X,placeholder:n("config.default_color_palette"),options:n$e.map(mA=>({value:mA.name,label:b.createElement(b.Fragment,null,b.createElement("div",{key:mA.name,className:"flex flex-col justify-start items-center w-32"},b.createElement("div",{className:"font-light"},mA.name),b.createElement("div",{className:"flex w-full"},mA.value.map((LA,UA)=>b.createElement("div",{key:UA,className:"h-4 flex-1",style:{backgroundColor:`${LA}`}})))))})).concat({value:"_none",label:b.createElement(b.Fragment,null,n("config.default_color_palette"))})}))))),b.createElement(mH,null,b.createElement(fH,null,b.createElement("div",{className:"flex justify-between items-center"},b.createElement(yH,null,"Scale"),b.createElement(JX,null,b.createElement(NX,{asChild:!0},b.createElement(fe,{variant:"outline"},"Select Scale")),b.createElement(_F,null,["row","column","color","theta","radius","opacity","size"].map(mA=>b.createElement(HHA,{key:mA,checked:yA.has(mA),onCheckedChange:LA=>{iA(LA?UA=>[...UA,mA]:UA=>UA.filter(ne=>ne!==mA))}},n(`config.${mA}`))))))),b.createElement(pH,null,yA.has("column")&&b.createElement("div",null,b.createElement("label",{className:"block text-xs font-medium leading-6"},n("config.column")),b.createElement(hH,{...aA,text:"column"})),yA.has("row")&&b.createElement("div",null,b.createElement("label",{className:"block text-xs font-medium leading-6"},n("config.row")),b.createElement(hH,{...lA,text:"row"})),yA.has("color")&&b.createElement("div",null,b.createElement("label",{className:"block text-xs font-medium leading-6"},n("config.color")),b.createElement(hH,{...CA,text:"color"})),yA.has("theta")&&b.createElement("div",null,b.createElement("label",{className:"block text-xs font-medium leading-6"},n("config.theta")),b.createElement(hH,{...QA,text:"theta"})),yA.has("radius")&&b.createElement("div",null,b.createElement("label",{className:"block text-xs font-medium leading-6"},n("config.radius")),b.createElement(hH,{...uA,text:"radius"})),yA.has("opacity")&&b.createElement("div",null,b.createElement("label",{className:"block text-xs font-medium leading-6"},n("config.opacity")),b.createElement(Rre,{...fA,text:"opacity",maxRange:1,minRange:0})),yA.has("size")&&b.createElement("div",null,b.createElement("label",{className:"block text-xs font-medium leading-6"},n("config.size")),b.createElement(Rre,{...hA,text:"size",maxRange:100,minRange:0})))),b.createElement(mH,null,b.createElement(fH,null,b.createElement(yH,null,n("config.format")),b.createElement("p",{className:"text-xs"},n("config.formatGuidesDocs"),":"," ",b.createElement("a",{target:"_blank",className:"hover:underline text-primary",href:"https://github.com/d3/d3-format#locale_format"},n("config.readHere")))),b.createElement(pH,null,b.createElement("div",{className:"flex gap-4"},o.map(mA=>b.createElement("div",{className:"my-2",key:mA},b.createElement("label",{className:"block text-xs font-medium leading-6"},n(`config.${mA}`)),b.createElement("div",{className:"mt-1"},b.createElement(oo,{type:"text",value:g[mA]??"",onChange:LA=>{a(UA=>({...UA,[mA]:LA.target.value}))}}))))))),b.createElement(mH,null,b.createElement(fH,null,b.createElement(yH,null,n("config.independence"))),b.createElement(pH,null,b.createElement("div",{className:"flex gap-x-6 gap-y-2 flex-wrap"},ke.POSITION_CHANNEL_CONFIG_LIST.map(mA=>b.createElement(w0,{label:n(`config.${mA}`),key:mA,enabled:s[mA]??!1,onChange:LA=>{I(UA=>({...UA,[mA]:LA}))}})),ke.NON_POSITION_CHANNEL_CONFIG_LIST.map(mA=>b.createElement(w0,{label:n(`constant.draggable_key.${mA}`),key:mA,enabled:s[mA]??!1,onChange:LA=>{I(UA=>({...UA,[mA]:LA}))}}))))),b.createElement(mH,null,b.createElement(fH,null,b.createElement(yH,null,n("config.misc"))),b.createElement(pH,null,b.createElement("div",{className:"flex flex-col space-y-6"},b.createElement("div",{className:"space-y-2 border-b pb-4"},b.createElement("h3",{className:"text-sm font-medium"},n("config.map_settings")),b.createElement("p",{className:"text-xs text-gray-500 mb-4"},n("config.map_settings_desc")),b.createElement("div",{className:"border rounded-md p-4"},b.createElement("div",{className:"flex justify-between items-center"},b.createElement("div",null,b.createElement("label",{className:"text-xs font-medium leading-6"},n("config.customTile")),b.createElement("p",{className:"text-xs text-gray-500"},n("config.customTile_desc"))),b.createElement(w0,{enabled:xi(j),onChange:mA=>{O(mA?"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png":void 0)}})),xi(j)&&b.createElement(oo,{type:"text",value:j,onChange:mA=>{O(mA.target.value)},className:"mt-4 max-w-md",placeholder:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}))),b.createElement("div",{className:"space-y-2 border-b pb-4"},b.createElement("h3",{className:"text-sm font-medium"},n("config.choropleth_settings")),b.createElement("p",{className:"text-xs text-gray-500 mb-4"},n("config.choropleth_settings_desc")),b.createElement("div",{className:"border rounded-md"},b.createElement("div",{className:"p-4"},b.createElement("div",{className:"flex justify-between items-center"},b.createElement("div",null,b.createElement("label",{className:"text-xs font-medium leading-6"},n("config.include_unmatched")),b.createElement("p",{className:"text-xs text-gray-500"},n("config.include_unmatched_desc"))),b.createElement(w0,{enabled:B,onChange:mA=>{E(mA)}}))),b.createElement("hr",null),b.createElement("div",{className:"p-4"},b.createElement("div",{className:"flex justify-between items-center"},b.createElement("div",null,b.createElement("label",{className:"text-xs font-medium leading-6"},n("config.include_shapes")),b.createElement("p",{className:"text-xs text-gray-500"},n("config.include_shapes_desc"))),b.createElement(w0,{enabled:u,onChange:mA=>{d(mA)}}))))),b.createElement("div",{className:"space-y-2 border-b pb-4"},b.createElement("h3",{className:"text-sm font-medium"},n("config.visualization_settings")),b.createElement("p",{className:"text-xs text-gray-500 mb-4"},n("config.visualization_settings_desc")),b.createElement("div",{className:"border rounded-md"},b.createElement("div",{className:"p-4"},b.createElement("div",{className:"flex justify-between items-center"},b.createElement("div",null,b.createElement("label",{className:"text-xs font-medium leading-6"},n("config.zeroScale")),b.createElement("p",{className:"text-xs text-gray-500"},n("config.zeroScale_desc"))),b.createElement(w0,{enabled:r,onChange:mA=>{C(mA)}}))),b.createElement("hr",null),b.createElement("div",{className:"p-4"},b.createElement("div",{className:"flex justify-between items-center"},b.createElement("div",null,b.createElement("label",{className:"text-xs font-medium leading-6"},n("config.svg")),b.createElement("p",{className:"text-xs text-gray-500"},n("config.svg_desc"))),b.createElement(w0,{enabled:l,onChange:mA=>{c(mA)}}))),b.createElement("hr",null),b.createElement("div",{className:"p-4"},b.createElement("div",{className:"flex justify-between items-center"},b.createElement("div",null,b.createElement("label",{className:"text-xs font-medium leading-6"},"Renderer"),b.createElement("p",{className:"text-xs text-gray-500"},"Choose between VegaLite and Observable Plot renderers")),b.createElement(Fq,{className:"w-40 h-fit",popClassName:"w-40",selectedKey:f,onSelect:mA=>w(mA),options:ke.RENDERER_TYPES.map(mA=>({value:mA,label:mA==="vega-lite"?"VegaLite":"Observable Plot"}))}))))),b.createElement("div",{className:"space-y-2"},b.createElement("h3",{className:"text-sm font-medium"},n("config.timezone_settings")),b.createElement("p",{className:"text-xs text-gray-500 mb-4"},n("config.timezone_settings_desc")),b.createElement("div",{className:"border rounded-md p-4"},b.createElement("div",{className:"flex justify-between items-center"},b.createElement("div",null,b.createElement("label",{className:"text-xs font-medium leading-6"},n("config.customOffset")),b.createElement("p",{className:"text-xs text-gray-500"},n("config.customOffset_desc"))),b.createElement(w0,{enabled:xi(eA),onChange:mA=>{sA(!0),oA(mA?new Date().getTimezoneOffset():void 0)}})),xi(eA)&&b.createElement(Fq,{className:"mt-4 max-w-md",popClassName:"w-[400px]",selectedKey:`${eA}`,onSelect:mA=>{sA(!0),oA(parseInt(mA))},options:hKt.map(mA=>({value:`${mA.value}`,label:b.createElement("span",{title:mA.name},mA.name)}))}))))))),b.createElement(nE,{className:"gap-2 mt-4 px-6"},b.createElement(fe,{variant:"outline",onClick:()=>{A.setShowVisualConfigPanel(!1)}},n("actions.cancel")),b.createElement(fe,{onClick:()=>{XxA(()=>{A.setVisualLayout(["format",g],["zeroScale",r],["scaleIncludeUnmatchedChoropleth",B],["showAllGeoshapeInChoropleth",u],["resolve",s],["colorPalette",V],["useSvg",l],["renderer",f],["scale",{opacity:fA.value,size:hA.value,column:aA.value,row:lA.value,color:CA.value,theta:QA.value,radius:uA.value}],...k?[["background",`rgba(${y.r},${y.g},${y.b},${y.a})`]]:[],...F?[["primaryColor",`rgba(${R.r},${R.g},${R.b},${R.a})`]]:[],["geoMapTileUrl",j]),tA&&A.setVisualConfig("timezoneDisplayOffset",eA),q==null||q($),A.setShowVisualConfigPanel(!1)})}},n("actions.confirm"))))))},RPt=ze(YPt);function xPt(A,e,t,i){const n={},o={};t.forEach(s=>{n[s]=0,o[s]=0}),e.forEach(s=>{t.forEach(I=>{n[I]+=Math.abs(s[I])})}),A.forEach(s=>{t.forEach(I=>{o[I]+=Math.abs(s[I])})});const g=[];e.forEach(s=>{const I={...s};t.forEach(r=>{I[r]/=n[r]}),g.push(I)});const a=[];return A.forEach(s=>{const I={...s};t.forEach(r=>{i?I[r]/=n[r]:I[r]/=o[r]}),a.push(I)}),{normalizedData:a,normalizedParentData:g}}function FPt(A,e,t,i){let n=0;const o=e.map(()=>!1);for(let a of A){let s=e.findIndex((I,r)=>!o[r]&&t.every(C=>I[C]===a[C]));if(s>-1){o[s]=!0;const I=e[s];let r=a[i],C=I[i];if(r===0||C===0)continue;let l=.5*(r+C);n+=.5*r*Math.log2(r/l)+.5*C*Math.log2(C/l)}}const g=o.filter(a=>a===!0).length/o.length;return n*g}function MPt(A){return A.all.filter(e=>e.analyticType==="dimension").filter(e=>!A.selection.find(t=>t.fid===e.fid))}const vPt=10;async function LPt(A){const{allFields:e,viewFilters:t,viewMeasures:i,viewDimensions:n,predicates:o,computationFunction:g,timezoneDisplayOffset:a}=A,s=MPt({all:e.filter(r=>r.analyticType==="dimension"),selection:n}),I=[];for(let r of s){let C=r.fid,l=[];r.semanticType==="quantitative"&&l.push({type:"transform",transform:[{key:C,expression:{op:"bin",as:C,num:vPt,params:[{type:"field",value:r.fid}]}}]});for(let c of i){const B=Hm(t,e,[r],[c],!0,"none",[],void 0,a),E=l?[...l,...B]:B,u=await t9(g,E),d=Hm(t,e,[...n,r],[c],!0,"none",[],void 0,a),f=l?[...l,...d]:d,w=await t9(g,f),y=l3e(w,o);let G=xPt(y,u,[Fo(c.fid,c.aggName??"sum")],!1),R=FPt(G.normalizedData,G.normalizedParentData,[r.fid],Fo(c.fid,c.aggName??"sum"));I.push({measureField:c,targetField:r,score:R,normalizedData:y,normalizedParentData:u})}}return I.sort((r,C)=>C.score-r.score)}const SPt=an.div`
    height: 50vh;
    overflow-y: hidden;
`,HPt=an.div`
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    height: 100%;
    overflow-y: scroll;
`,ZPt=an.div`
    margin-block: 0.2em;
    margin-inline: 0.2em;
    padding: 0.5em;
    border-width: 2px;
    cursor: pointer;
`,UCe=(A,e)=>{if(e.semanticType==="quantitative"){let t=e.fid;return`${A[t][0].toFixed(2)}-${A[t][1].toFixed(2)}`}else return A[e.fid]},WPt=ze(({themeKey:A})=>{const e=xt(),t=p.useContext(sQ),i=Og(),{allFields:n,viewMeasures:o,viewDimensions:g,viewFilters:a,showInsightBoard:s,selectedMarkObject:I,config:r}=e,{timezoneDisplayOffset:C}=r,[l,c]=p.useState([]),[B,E]=p.useState(0),u=p.useRef(null),d=p.useMemo(()=>{var w;return{...(w=Z9[A??"vega"])==null?void 0:w[t]}},[A,t]);ve();const f=async w=>{const y=await LPt({predicates:w,viewFilters:a,allFields:n,viewMeasures:o,viewDimensions:g,computationFunction:i,timezoneDisplayOffset:C});c(y)};return p.useEffect(()=>{if(!s||Object.keys(I).length===0)return;const w=g.map(y=>({key:y.fid,type:"discrete",range:new Set([I[y.fid]])}));f(w)},[o,g,s,I]),p.useEffect(()=>{if(u.current&&l.length>0){const{normalizedData:w,normalizedParentData:y,targetField:G,measureField:R}=l[B],{semanticType:x,name:F,fid:Q}=G,k=[...w.map(v=>({category:UCe(v,G),...v,type:"child"})),...y.map(v=>({category:UCe(v,G),...v,type:"parent"}))],h={x:{field:"category",type:x==="quantitative"?"ordinal":x,axis:{title:`Distribution of Values for ${F}`}}},N={data:{values:k},width:320,height:200,encoding:{...h,color:{legend:{orient:"bottom"}}},layer:[{mark:{type:"bar",width:15,opacity:.7},encoding:{y:{field:Fo(R.fid,R.aggName),type:"quantitative",title:`${R.aggName} ${R.name} for All Marks`},color:{datum:"All Marks"}},transform:[{filter:"datum.type === 'parent'"}]},{mark:{type:"bar",width:10,opacity:.7},encoding:{y:{field:Fo(R.fid,R.aggName),type:"quantitative",title:`${R.aggName} ${R.name} for Selected Mark`},color:{datum:"Selected Mark"}},transform:[{filter:"datum.type === 'child'"}]}],resolve:{scale:{y:"independent"}}};U2(u.current,N,{mode:"vega-lite",actions:!1,config:d,tooltip:{theme:t}})}},[l,u.current,B,d]),b.createElement(sa,{open:s,onOpenChange:()=>{e.setShowInsightBoard(!1),E(0)}},b.createElement(ra,null,l.length===0&&b.createElement(nr,null),b.createElement(SPt,{className:"grid grid-cols-4"},b.createElement(HPt,{className:"col-span-1"},l.map((w,y)=>b.createElement(ZPt,{key:y,className:`${B===y?"border-primary":""} text-xs`,onClick:()=>E(y)},w.targetField.name," ",w.score.toFixed(2)))),b.createElement("div",{className:"col-span-3 text-center overflow-y-scroll"},b.createElement("div",{ref:u})))))}),KPt=WPt;var UPt=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function WH(A,e){var t=VPt(A);if(typeof t.path!="string"){var i=A.webkitRelativePath;Object.defineProperty(t,"path",{value:typeof e=="string"?e:typeof i=="string"&&i.length>0?i:A.name,writable:!1,configurable:!1,enumerable:!0})}return t}function VPt(A){var e=A.name,t=e&&e.lastIndexOf(".")!==-1;if(t&&!A.type){var i=e.split(".").pop().toLowerCase(),n=UPt.get(i);n&&Object.defineProperty(A,"type",{value:n,writable:!1,configurable:!1,enumerable:!0})}return A}var XPt=[".DS_Store","Thumbs.db"];function zPt(A){return Yk(this,void 0,void 0,function(){return Rk(this,function(e){return ej(A)&&TPt(A.dataTransfer)?[2,jPt(A.dataTransfer,A.type)]:_Pt(A)?[2,OPt(A)]:Array.isArray(A)&&A.every(function(t){return"getFile"in t&&typeof t.getFile=="function"})?[2,qPt(A)]:[2,[]]})})}function TPt(A){return ej(A)}function _Pt(A){return ej(A)&&ej(A.target)}function ej(A){return typeof A=="object"&&A!==null}function OPt(A){return RmA(A.target.files).map(function(e){return WH(e)})}function qPt(A){return Yk(this,void 0,void 0,function(){var e;return Rk(this,function(t){switch(t.label){case 0:return[4,Promise.all(A.map(function(i){return i.getFile()}))];case 1:return e=t.sent(),[2,e.map(function(i){return WH(i)})]}})})}function jPt(A,e){return Yk(this,void 0,void 0,function(){var t,i;return Rk(this,function(n){switch(n.label){case 0:return A.items?(t=RmA(A.items).filter(function(o){return o.kind==="file"}),e!=="drop"?[2,t]:[4,Promise.all(t.map(PPt))]):[3,2];case 1:return i=n.sent(),[2,VCe(XCe(i))];case 2:return[2,VCe(RmA(A.files).map(function(o){return WH(o)}))]}})})}function VCe(A){return A.filter(function(e){return XPt.indexOf(e.name)===-1})}function RmA(A){if(A===null)return[];for(var e=[],t=0;t<A.length;t++){var i=A[t];e.push(i)}return e}function PPt(A){if(typeof A.webkitGetAsEntry!="function")return zCe(A);var e=A.webkitGetAsEntry();return e&&e.isDirectory?TCe(e):zCe(A)}function XCe(A){return A.reduce(function(e,t){return MLA(MLA([],FLA(e),!1),FLA(Array.isArray(t)?XCe(t):[t]),!1)},[])}function zCe(A){var e=A.getAsFile();if(!e)return Promise.reject("".concat(A," is not a File"));var t=WH(e);return Promise.resolve(t)}function $Pt(A){return Yk(this,void 0,void 0,function(){return Rk(this,function(e){return[2,A.isDirectory?TCe(A):A7t(A)]})})}function TCe(A){var e=A.createReader();return new Promise(function(t,i){var n=[];function o(){var g=this;e.readEntries(function(a){return Yk(g,void 0,void 0,function(){var s,I,r;return Rk(this,function(C){switch(C.label){case 0:if(a.length)return[3,5];C.label=1;case 1:return C.trys.push([1,3,,4]),[4,Promise.all(n)];case 2:return s=C.sent(),t(s),[3,4];case 3:return I=C.sent(),i(I),[3,4];case 4:return[3,6];case 5:r=Promise.all(a.map($Pt)),n.push(r),o(),C.label=6;case 6:return[2]}})})},function(a){i(a)})}o()})}function A7t(A){return Yk(this,void 0,void 0,function(){return Rk(this,function(e){return[2,new Promise(function(t,i){A.file(function(n){var o=WH(n,A.fullPath);t(o)},function(n){i(n)})})]})})}var e7t=function(A,e){if(A&&e){var t=Array.isArray(e)?e:e.split(","),i=A.name||"",n=(A.type||"").toLowerCase(),o=n.replace(/\/.*$/,"");return t.some(function(g){var a=g.trim().toLowerCase();return a.charAt(0)==="."?i.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):n===a})}return!0};function _Ce(A){return n7t(A)||i7t(A)||PCe(A)||t7t()}function t7t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i7t(A){if(typeof Symbol<"u"&&A[Symbol.iterator]!=null||A["@@iterator"]!=null)return Array.from(A)}function n7t(A){if(Array.isArray(A))return xmA(A)}function OCe(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function qCe(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?OCe(Object(t),!0).forEach(function(i){jCe(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):OCe(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function jCe(A,e,t){return e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function KH(A,e){return a7t(A)||g7t(A,e)||PCe(A,e)||o7t()}function o7t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PCe(A,e){if(A){if(typeof A=="string")return xmA(A,e);var t=Object.prototype.toString.call(A).slice(8,-1);if(t==="Object"&&A.constructor&&(t=A.constructor.name),t==="Map"||t==="Set")return Array.from(A);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return xmA(A,e)}}function xmA(A,e){(e==null||e>A.length)&&(e=A.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=A[t];return i}function g7t(A,e){var t=A==null?null:typeof Symbol<"u"&&A[Symbol.iterator]||A["@@iterator"];if(t!=null){var i=[],n=!0,o=!1,g,a;try{for(t=t.call(A);!(n=(g=t.next()).done)&&(i.push(g.value),!(e&&i.length===e));n=!0);}catch(s){o=!0,a=s}finally{try{!n&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function a7t(A){if(Array.isArray(A))return A}var s7t="file-invalid-type",r7t="file-too-large",I7t="file-too-small",C7t="too-many-files",l7t=function(A){A=Array.isArray(A)&&A.length===1?A[0]:A;var e=Array.isArray(A)?"one of ".concat(A.join(", ")):A;return{code:s7t,message:"File type must be ".concat(e)}},$Ce=function(A){return{code:r7t,message:"File is larger than ".concat(A," ").concat(A===1?"byte":"bytes")}},Ale=function(A){return{code:I7t,message:"File is smaller than ".concat(A," ").concat(A===1?"byte":"bytes")}},c7t={code:C7t,message:"Too many files"};function ele(A,e){var t=A.type==="application/x-moz-file"||e7t(A,e);return[t,t?null:l7t(e)]}function tle(A,e,t){if(Mw(A.size))if(Mw(e)&&Mw(t)){if(A.size>t)return[!1,$Ce(t)];if(A.size<e)return[!1,Ale(e)]}else{if(Mw(e)&&A.size<e)return[!1,Ale(e)];if(Mw(t)&&A.size>t)return[!1,$Ce(t)]}return[!0,null]}function Mw(A){return A!=null}function B7t(A){var e=A.files,t=A.accept,i=A.minSize,n=A.maxSize,o=A.multiple,g=A.maxFiles,a=A.validator;return!o&&e.length>1||o&&g>=1&&e.length>g?!1:e.every(function(s){var I=ele(s,t),r=KH(I,1),C=r[0],l=tle(s,i,n),c=KH(l,1),B=c[0],E=a?a(s):null;return C&&B&&!E})}function tj(A){return typeof A.isPropagationStopped=="function"?A.isPropagationStopped():typeof A.cancelBubble<"u"?A.cancelBubble:!1}function ij(A){return A.dataTransfer?Array.prototype.some.call(A.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!A.target&&!!A.target.files}function ile(A){A.preventDefault()}function Q7t(A){return A.indexOf("MSIE")!==-1||A.indexOf("Trident/")!==-1}function E7t(A){return A.indexOf("Edge/")!==-1}function u7t(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Q7t(A)||E7t(A)}function lE(){for(var A=arguments.length,e=new Array(A),t=0;t<A;t++)e[t]=arguments[t];return function(i){for(var n=arguments.length,o=new Array(n>1?n-1:0),g=1;g<n;g++)o[g-1]=arguments[g];return e.some(function(a){return!tj(i)&&a&&a.apply(void 0,[i].concat(o)),tj(i)})}}function d7t(){return"showOpenFilePicker"in window}function h7t(A){if(Mw(A)){var e=Object.entries(A).filter(function(t){var i=KH(t,2),n=i[0],o=i[1],g=!0;return nle(n)||(console.warn('Skipped "'.concat(n,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),g=!1),(!Array.isArray(o)||!o.every(ole))&&(console.warn('Skipped "'.concat(n,'" because an invalid file extension was provided.')),g=!1),g}).reduce(function(t,i){var n=KH(i,2),o=n[0],g=n[1];return qCe(qCe({},t),{},jCe({},o,g))},{});return[{description:"Files",accept:e}]}return A}function m7t(A){if(Mw(A))return Object.entries(A).reduce(function(e,t){var i=KH(t,2),n=i[0],o=i[1];return[].concat(_Ce(e),[n],_Ce(o))},[]).filter(function(e){return nle(e)||ole(e)}).join(",")}function p7t(A){return A instanceof DOMException&&(A.name==="AbortError"||A.code===A.ABORT_ERR)}function f7t(A){return A instanceof DOMException&&(A.name==="SecurityError"||A.code===A.SECURITY_ERR)}function nle(A){return A==="audio/*"||A==="video/*"||A==="image/*"||A==="text/*"||/\w+\/[-+.\w]+/g.test(A)}function ole(A){return/^.*\.[\w]+$/.test(A)}var y7t=["children"],b7t=["open"],w7t=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],D7t=["refKey","onChange","onClick"];function G7t(A){return N7t(A)||J7t(A)||gle(A)||k7t()}function k7t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J7t(A){if(typeof Symbol<"u"&&A[Symbol.iterator]!=null||A["@@iterator"]!=null)return Array.from(A)}function N7t(A){if(Array.isArray(A))return MmA(A)}function FmA(A,e){return x7t(A)||R7t(A,e)||gle(A,e)||Y7t()}function Y7t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gle(A,e){if(A){if(typeof A=="string")return MmA(A,e);var t=Object.prototype.toString.call(A).slice(8,-1);if(t==="Object"&&A.constructor&&(t=A.constructor.name),t==="Map"||t==="Set")return Array.from(A);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return MmA(A,e)}}function MmA(A,e){(e==null||e>A.length)&&(e=A.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=A[t];return i}function R7t(A,e){var t=A==null?null:typeof Symbol<"u"&&A[Symbol.iterator]||A["@@iterator"];if(t!=null){var i=[],n=!0,o=!1,g,a;try{for(t=t.call(A);!(n=(g=t.next()).done)&&(i.push(g.value),!(e&&i.length===e));n=!0);}catch(s){o=!0,a=s}finally{try{!n&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function x7t(A){if(Array.isArray(A))return A}function ale(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function Pn(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ale(Object(t),!0).forEach(function(i){vmA(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):ale(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function vmA(A,e,t){return e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function nj(A,e){if(A==null)return{};var t=F7t(A,e),i,n;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(A);for(n=0;n<o.length;n++)i=o[n],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(A,i)&&(t[i]=A[i])}return t}function F7t(A,e){if(A==null)return{};var t={},i=Object.keys(A),n,o;for(o=0;o<i.length;o++)n=i[o],!(e.indexOf(n)>=0)&&(t[n]=A[n]);return t}var oj=p.forwardRef(function(A,e){var t=A.children,i=nj(A,y7t),n=v7t(i),o=n.open,g=nj(n,b7t);return p.useImperativeHandle(e,function(){return{open:o}},[o]),b.createElement(p.Fragment,null,t(Pn(Pn({},g),{},{open:o})))});oj.displayName="Dropzone";var sle={disabled:!1,getFilesFromEvent:zPt,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};oj.defaultProps=sle,oj.propTypes={children:FA.func,accept:FA.objectOf(FA.arrayOf(FA.string)),multiple:FA.bool,preventDropOnDocument:FA.bool,noClick:FA.bool,noKeyboard:FA.bool,noDrag:FA.bool,noDragEventsBubbling:FA.bool,minSize:FA.number,maxSize:FA.number,maxFiles:FA.number,disabled:FA.bool,getFilesFromEvent:FA.func,onFileDialogCancel:FA.func,onFileDialogOpen:FA.func,useFsAccessApi:FA.bool,autoFocus:FA.bool,onDragEnter:FA.func,onDragLeave:FA.func,onDragOver:FA.func,onDrop:FA.func,onDropAccepted:FA.func,onDropRejected:FA.func,onError:FA.func,validator:FA.func};const M7t=oj;var LmA={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function v7t(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Pn(Pn({},sle),A),t=e.accept,i=e.disabled,n=e.getFilesFromEvent,o=e.maxSize,g=e.minSize,a=e.multiple,s=e.maxFiles,I=e.onDragEnter,r=e.onDragLeave,C=e.onDragOver,l=e.onDrop,c=e.onDropAccepted,B=e.onDropRejected,E=e.onFileDialogCancel,u=e.onFileDialogOpen,d=e.useFsAccessApi,f=e.autoFocus,w=e.preventDropOnDocument,y=e.noClick,G=e.noKeyboard,R=e.noDrag,x=e.noDragEventsBubbling,F=e.onError,Q=e.validator,k=p.useMemo(function(){return m7t(t)},[t]),h=p.useMemo(function(){return h7t(t)},[t]),N=p.useMemo(function(){return typeof u=="function"?u:rle},[u]),v=p.useMemo(function(){return typeof E=="function"?E:rle},[E]),K=p.useRef(null),U=p.useRef(null),V=p.useReducer(L7t,LmA),X=FmA(V,2),_=X[0],q=X[1],$=_.isFocused,nA=_.isFileDialogActive,j=p.useRef(typeof window<"u"&&window.isSecureContext&&d&&d7t()),O=function(){!j.current&&nA&&setTimeout(function(){if(U.current){var EA=U.current.files;EA.length||(q({type:"closeDialog"}),v())}},300)};p.useEffect(function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}},[U,nA,v,j]);var eA=p.useRef([]),oA=function(EA){K.current&&K.current.contains(EA.target)||(EA.preventDefault(),eA.current=[])};p.useEffect(function(){return w&&(document.addEventListener("dragover",ile,!1),document.addEventListener("drop",oA,!1)),function(){w&&(document.removeEventListener("dragover",ile),document.removeEventListener("drop",oA))}},[K,w]),p.useEffect(function(){return!i&&f&&K.current&&K.current.focus(),function(){}},[K,f,i]);var tA=p.useCallback(function(EA){F?F(EA):console.error(EA)},[F]),sA=p.useCallback(function(EA){EA.preventDefault(),EA.persist(),UA(EA),eA.current=[].concat(G7t(eA.current),[EA.target]),ij(EA)&&Promise.resolve(n(EA)).then(function(wA){if(!(tj(EA)&&!x)){var se=wA.length,we=se>0&&B7t({files:wA,accept:k,minSize:g,maxSize:o,multiple:a,maxFiles:s,validator:Q}),be=se>0&&!we;q({isDragAccept:we,isDragReject:be,isDragActive:!0,type:"setDraggedFiles"}),I&&I(EA)}}).catch(function(wA){return tA(wA)})},[n,I,tA,x,k,g,o,a,s,Q]),gA=p.useCallback(function(EA){EA.preventDefault(),EA.persist(),UA(EA);var wA=ij(EA);if(wA&&EA.dataTransfer)try{EA.dataTransfer.dropEffect="copy"}catch{}return wA&&C&&C(EA),!1},[C,x]),iA=p.useCallback(function(EA){EA.preventDefault(),EA.persist(),UA(EA);var wA=eA.current.filter(function(we){return K.current&&K.current.contains(we)}),se=wA.indexOf(EA.target);se!==-1&&wA.splice(se,1),eA.current=wA,!(wA.length>0)&&(q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),ij(EA)&&r&&r(EA))},[K,r,x]),aA=p.useCallback(function(EA,wA){var se=[],we=[];EA.forEach(function(be){var Oe=ele(be,k),VA=FmA(Oe,2),ZA=VA[0],le=VA[1],ce=tle(be,g,o),de=FmA(ce,2),rt=de[0],en=de[1],Ot=Q?Q(be):null;if(ZA&&rt&&!Ot)se.push(be);else{var og=[le,en];Ot&&(og=og.concat(Ot)),we.push({file:be,errors:og.filter(function(Oa){return Oa})})}}),(!a&&se.length>1||a&&s>=1&&se.length>s)&&(se.forEach(function(be){we.push({file:be,errors:[c7t]})}),se.splice(0)),q({acceptedFiles:se,fileRejections:we,type:"setFiles"}),l&&l(se,we,wA),we.length>0&&B&&B(we,wA),se.length>0&&c&&c(se,wA)},[q,a,k,g,o,s,l,c,B,Q]),lA=p.useCallback(function(EA){EA.preventDefault(),EA.persist(),UA(EA),eA.current=[],ij(EA)&&Promise.resolve(n(EA)).then(function(wA){tj(EA)&&!x||aA(wA,EA)}).catch(function(wA){return tA(wA)}),q({type:"reset"})},[n,aA,tA,x]),CA=p.useCallback(function(){if(j.current){q({type:"openDialog"}),N();var EA={multiple:a,types:h};window.showOpenFilePicker(EA).then(function(wA){return n(wA)}).then(function(wA){aA(wA,null),q({type:"closeDialog"})}).catch(function(wA){p7t(wA)?(v(wA),q({type:"closeDialog"})):f7t(wA)?(j.current=!1,U.current?(U.current.value=null,U.current.click()):tA(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):tA(wA)});return}U.current&&(q({type:"openDialog"}),N(),U.current.value=null,U.current.click())},[q,N,v,d,aA,tA,h,a]),QA=p.useCallback(function(EA){!K.current||!K.current.isEqualNode(EA.target)||(EA.key===" "||EA.key==="Enter"||EA.keyCode===32||EA.keyCode===13)&&(EA.preventDefault(),CA())},[K,CA]),uA=p.useCallback(function(){q({type:"focus"})},[]),fA=p.useCallback(function(){q({type:"blur"})},[]),hA=p.useCallback(function(){y||(u7t()?setTimeout(CA,0):CA())},[y,CA]),yA=function(EA){return i?null:EA},mA=function(EA){return G?null:yA(EA)},LA=function(EA){return R?null:yA(EA)},UA=function(EA){x&&EA.stopPropagation()},ne=p.useMemo(function(){return function(){var EA=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},wA=EA.refKey,se=wA===void 0?"ref":wA,we=EA.role,be=EA.onKeyDown,Oe=EA.onFocus,VA=EA.onBlur,ZA=EA.onClick,le=EA.onDragEnter,ce=EA.onDragOver,de=EA.onDragLeave,rt=EA.onDrop,en=nj(EA,w7t);return Pn(Pn(vmA({onKeyDown:mA(lE(be,QA)),onFocus:mA(lE(Oe,uA)),onBlur:mA(lE(VA,fA)),onClick:yA(lE(ZA,hA)),onDragEnter:LA(lE(le,sA)),onDragOver:LA(lE(ce,gA)),onDragLeave:LA(lE(de,iA)),onDrop:LA(lE(rt,lA)),role:typeof we=="string"&&we!==""?we:"presentation"},se,K),!i&&!G?{tabIndex:0}:{}),en)}},[K,QA,uA,fA,hA,sA,gA,iA,lA,G,R,i]),SA=p.useCallback(function(EA){EA.stopPropagation()},[]),ae=p.useMemo(function(){return function(){var EA=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},wA=EA.refKey,se=wA===void 0?"ref":wA,we=EA.onChange,be=EA.onClick,Oe=nj(EA,D7t),VA=vmA({accept:k,multiple:a,type:"file",style:{display:"none"},onChange:yA(lE(we,lA)),onClick:yA(lE(be,SA)),tabIndex:-1},se,U);return Pn(Pn({},VA),Oe)}},[U,t,a,lA,i]);return Pn(Pn({},_),{},{isFocused:$&&!i,getRootProps:ne,getInputProps:ae,rootRef:K,inputRef:U,open:yA(CA)})}function L7t(A,e){switch(e.type){case"focus":return Pn(Pn({},A),{},{isFocused:!0});case"blur":return Pn(Pn({},A),{},{isFocused:!1});case"openDialog":return Pn(Pn({},LmA),{},{isFileDialogActive:!0});case"closeDialog":return Pn(Pn({},A),{},{isFileDialogActive:!1});case"setDraggedFiles":return Pn(Pn({},A),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return Pn(Pn({},A),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return Pn({},LmA);default:return A}}function rle(){}function Ile(A){const e=p.useMemo(()=>A.data&&A.type?H7t(A.data,A.type):void 0,[A.data,A.type]),t=dUA(e,A.url),[i,n]=p.useState(0);p.useEffect(()=>n(g=>g+1),[t]);const{t:o}=ve("translation",{keyPrefix:"main.tabpanel.settings"});return!e&&!A.url?null:t?b.createElement("div",{className:"w-full flex-1 relative"},b.createElement(S7t,{key:i,data:t})):b.createElement("div",{className:"w-full flex-1 flex items-center justify-center border-l"},o("geography_settings.loading"))}function S7t(A){return b.createElement(fgA,{preferCanvas:!0,attributionControl:!1,center:[0,0],bounds:[[-180,-90],[180,90]],renderer:uc.canvas(),zoom:1,style:{width:"100%",height:"100%",zIndex:1}},b.createElement(lM,{className:"map-tile",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),b.createElement(hgA,{prefix:"Leaflet"}),A.data&&b.createElement(N8e,{data:A.data}))}function H7t(A,e){try{const t=JSON.parse(A),i=e==="GeoJSON"?t:zV(t,Object.keys(t.objects)[0]);if(!("features"in i)){console.error("Invalid GeoJSON: GeoJSON must be a FeatureCollection, but got",i);return}return i}catch(t){console.error(t)}}const Z7t=[],W7t=({geoList:A=Z7t})=>{const e=xt(),{layout:t,showGeoJSONConfigPanel:i}=e,{geoKey:n,geojson:o,geoUrl:g}=t,{t:a}=ve("translation"),{t:s}=ve("translation",{keyPrefix:"main.tabpanel.settings"}),[I,r]=p.useState((g==null?void 0:g.type)??"GeoJSON"),[C,l]=p.useState(""),[c,B]=p.useState((g==null?void 0:g.url)??""),[E,u]=p.useState(""),[d,f]=p.useState(""),[w,y]=p.useState(""),[G,R]=p.useState(g),[x,F]=p.useState(!1),Q=c||o,[k,h]=p.useState(()=>{const X=A.findIndex(_=>_.url===(g==null?void 0:g.url)&&_.type===(g==null?void 0:g.type));return X===-1&&Q?-2:X}),N=p.useMemo(()=>[{label:"Select a Geographic Data",value:"-1"}].concat(A.map((X,_)=>({label:X.name,value:`${_}`}))).concat({label:"Manual Configuration",value:"-2"}),[A]),v=p.useMemo(()=>X=>h(parseInt(X)),[]),K=(A??[]).length===0||k===-2,U=p.useMemo(()=>{try{const X=JSON.parse(d);return Object.keys(X.objects)[0]||""}catch{return""}},[d]);p.useEffect(()=>{l(n||"")},[n]),p.useEffect(()=>{u(o?JSON.stringify(o,null,2):"")},[o]);const V=()=>{if(!K){const X=A[k];X?e.setVisualLayout("geoUrl",{type:X.type,url:X.url}):(e.clearGeographicData(),e.updateGeoKey(C)),e.setShowGeoJSONConfigPanel(!1);return}try{if(!(I==="GeoJSON"?E:d)&&G){e.setShowGeoJSONConfigPanel(!1);return}const X=JSON.parse(I==="GeoJSON"?E:d);I==="TopoJSON"?e.setGeographicData({type:"TopoJSON",data:X,objectKey:w||U},C,(G==null?void 0:G.type)==="TopoJSON"?G:void 0):e.setGeographicData({type:"GeoJSON",data:X},C,(G==null?void 0:G.type)==="GeoJSON"?G:void 0),e.setShowGeoJSONConfigPanel(!1)}catch(X){console.error(X)}};return b.createElement(sa,{open:i,onOpenChange:()=>{e.setShowGeoJSONConfigPanel(!1)}},b.createElement(ra,null,b.createElement("h2",{className:"text-lg mb-4"},s("geography")),b.createElement("div",null,b.createElement("div",{className:"my-2"},b.createElement("label",{className:"block text-xs font-medium leading-6"},s("geography_settings.geoKey")),b.createElement("div",{className:"mt-1"},b.createElement(oo,{type:"text",value:C,onChange:X=>l(X.target.value)}))),A.length>0&&b.createElement("div",{className:"my-2"},b.createElement("label",{className:"block text-xs font-medium leading-6"},"GeoData"),b.createElement(cH,{options:N,selectedKey:`${k}`,onSelect:v})),!K&&k>=0&&b.createElement("div",{className:"relative justify-center flex w-full h-80 rounded border shadow-sm"},b.createElement(Ile,{type:A[k].type,url:A[k]})),K&&b.createElement("div",{className:"my-2"},b.createElement("label",{className:"block text-xs font-medium leading-6"},s(`geography_settings.${I.toLowerCase()}`)),b.createElement("div",{className:"mt-1 flex flex-col space-y-2"},b.createElement("div",{role:"radiogroup"},b.createElement(_O,{value:I,onValueChange:X=>r(X),className:"flex items-center space-x-2"},b.createElement(zS,{value:"GeoJSON",id:"geojson"}),b.createElement("label",{htmlFor:"geojson",className:"text-xs whitespace-nowrap"},s("geography_settings.geojson")),b.createElement(zS,{value:"TopoJSON",id:"topojson"}),b.createElement("label",{htmlFor:"topojson",className:"text-xs whitespace-nowrap"},s("geography_settings.topojson")))),b.createElement("div",{className:"flex items-center space-x-2"},b.createElement("label",{className:"text-xs whitespace-nowrap capitalize"},s("geography_settings.href",{format:I.toLowerCase()})),b.createElement(oo,{type:"text",value:c,placeholder:s("geography_settings.hrefPlaceholder",{format:I.toLowerCase()}),onChange:X=>{B(X.target.value)}}),b.createElement(fe,{className:"mr-2 flex-shrink-0",disabled:x,onClick:()=>{c&&(F(!0),fetch(c).then(X=>X.json()).then(X=>{(I==="GeoJSON"?u:f)(JSON.stringify(X,null,2)),R({type:I,url:c}),F(!1)}).catch(()=>{F(!1)}))}},x&&b.createElement(I9,null),s("geography_settings.load"))),b.createElement(M7t,{onDrop:X=>{const _=X[0];if(_){const q=new FileReader;q.addEventListener("load",$=>{const nA=$.target.result;R(void 0),(I==="GeoJSON"?u:f)(nA)}),q.readAsText(_)}},noClick:!0},({getRootProps:X,getInputProps:_,isDragActive:q,open:$})=>b.createElement("div",{className:"relative justify-center flex w-full h-80 rounded border shadow-sm",...X()},q&&b.createElement("div",{className:"absolute items-center justify-center left-0 right-0 top-0 bottom-0 z-20 bg-accent opacity-80"}),b.createElement("input",{..._()}),b.createElement("div",{onClick:$,className:"flex h-full items-center justify-center w-48"},s("geography_settings.jsonInputPlaceholder",{format:I.toLowerCase()})),b.createElement(Ile,{data:I==="GeoJSON"?E:d,type:I,url:G}))),I==="TopoJSON"&&b.createElement("div",{className:"flex items-center space-x-2"},b.createElement("label",{className:"text-xs whitespace-nowrap capitalize"},s("geography_settings.objectKey")),b.createElement(oo,{type:"text",value:w,placeholder:U,onChange:X=>{y(X.target.value)}}))))),b.createElement(nE,null,b.createElement(fe,{children:a("actions.confirm"),onClick:V}),b.createElement(fe,{children:a("actions.cancel"),variant:"outline",onClick:()=>{e.setShowGeoJSONConfigPanel(!1)}}))))},K7t=ze(W7t),U7t="https://api.kanaries.net/vis/text2gw";async function V7t(A,e,t,i){const n=await(await fetch(A,{headers:{"Content-Type":"application/json",...i},credentials:"include",method:"POST",body:JSON.stringify({metas:e,messages:[{role:"user",content:t}]})})).json();if(n.success)return n.data;throw new Error(n.message)}async function SmA(A,e,t){if(typeof A=="function")return A(e);const i=await(await fetch(A,{headers:{"Content-Type":"application/json",...t},credentials:"include",method:"POST",body:JSON.stringify(e)})).json();if(!i.success)throw new Error(i.message)}const X7t=A=>{const{feedbackApi:e}=A,[t,i]=p.useState(""),[n,o]=p.useState(!1),g=xt(),{t:a}=ve(),[s,I]=p.useState("none"),r=g.allFields,{reportError:C}=w4(),[l,c]=p.useState(null),B=p.useCallback(()=>{o(!0),(typeof A.api=="function"?Promise.resolve(A.api(r,t)):V7t(A.api||U7t,r,t,A.headers??{})).then(u=>{g.appendFromCode(u),g.setAskvizFeedback(!0),c({question:t,data:JSON.stringify(u)}),I("vote")}).catch(u=>{C(dk(u),502)}).finally(()=>{o(!1)})},[A.api,A.headers,r,t,g]),E=e&&l&&g.showAskvizFeedbackIndex===g.visIndex;return b.createElement("div",{className:"right-0 flex relative"},b.createElement(oo,{type:"text",className:"pr-24",placeholder:a("main.tabpanel.askviz.placeholder"),value:t,onChange:u=>i(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!u.nativeEvent.isComposing&&n===!1&&t.length>0&&B()},disabled:n||r.length===0}),b.createElement(fe,{className:"rounded-l-none w-20 absolute inset-y-0 right-0",disabled:n||t.length===0||r.length===0,onClick:B,id:"askviz_ask"},"Ask",!n&&b.createElement(wHe,{className:"w-4 ml-1"}),n&&b.createElement(I9,{className:"w-4 h-4 ml-1"})),E&&s==="vote"&&b.createElement("div",{className:"absolute z-10 top-full right-0 flex-col space-y-2 w-56 mt-1 p-4 border rounded bg-popover text-popover-foreground"},b.createElement("div",null,a("App.feedback.vote")),b.createElement("div",{className:"flex space-x-2"},b.createElement(fe,{type:"button",onClick:()=>{SmA(e,{action:"voteup",question:l.question,spec:l.data},A.headers??{}),I("none")}},b.createElement(gHe,{className:"w-4 h-4"}),a("App.feedback.voteup")),b.createElement(fe,{type:"button",variant:"outline",onClick:()=>{SmA(e,{action:"votedown",question:l.question,spec:l.data},A.headers??{}),I("report")}},b.createElement(iHe,{className:"w-4 h-4"}),a("App.feedback.votedown")))),E&&s==="report"&&b.createElement("div",{className:"absolute z-10 top-full right-0 flex-col space-y-2 w-56 mt-1 p-4 border rounded bg-popover text-popover-foreground"},b.createElement("div",null,a("App.feedback.report")),b.createElement("div",null,b.createElement(fe,{type:"button",variant:"outline",disabled:!g.canUndo,onClick:()=>{SmA(e,{action:"report",question:l.question,spec:JSON.stringify(g.exportCode()[g.visIndex])},A.headers??{}),I("none")}},a("App.feedback.report_button")))))},z7t=ze(X7t),T7t=async(A,e,t,i)=>{let n=A;for await(const o of e)switch(o.type){case"filter":{n=await O6e(n,o.filters.map(g=>({fid:g.fid,rule:g.rule})).filter(Boolean));break}case"transform":{n=await q6e(n,o.transform);break}case"view":{for await(const g of o.query)n=await j6e(n,g);break}case"sort":{n=await $6e(n,o.by,o.sort);break}default:{console.warn(new Error(`Unknown step type: ${o.type}`));break}}return n.slice(t??0,i?(t??0)+i:void 0)},k0=A=>e=>T7t(A,e.workflow,e.offset,e.limit),_7t=A=>{const e=xt(),{showLogSettingPanel:t}=e,[i,n]=p.useState(""),{t:o}=ve();return p.useEffect(()=>{n("")},[t]),b.createElement(sa,{open:t,onOpenChange:()=>{e.setShowLogSettingPanel(!1)}},b.createElement(ra,{className:"!w-fit"},b.createElement("div",{className:"flex flex-col justify-center items-start text-xs "},b.createElement("h2",{className:"text-lg font-medium mb-2"},o("calc.log_panel_title")),b.createElement("p",{className:"font-normal text-muted-foreground"},o("calc.log_panel_desc")),b.createElement("fieldset",{className:"mt-2 gap-1 flex flex-col justify-center items-start"},b.createElement("div",{className:"flex items-center space-x-2"},b.createElement("label",{className:"text-ml whitespace-nowrap"},o("calc.log_panel_number")),b.createElement(oo,{type:"text",value:i,onChange:g=>{n(g.target.value)}})))),b.createElement(nE,{className:"mt-2"},b.createElement(fe,{children:o("actions.confirm"),onClick:()=>{const g=e.createField;e.createLogField(g.channel,g.index,"log",Number(i)),e.setShowLogSettingPanel(!1)}}),b.createElement(fe,{variant:"outline",children:o("actions.cancel"),onClick:()=>{e.setShowLogSettingPanel(!1)}}))))},O7t=ze(_7t),q7t=A=>{const e=xt(),{showBinSettingPanel:t,setShowBinSettingPanel:i}=e,{t:n}=ve(),[o,g]=p.useState("widths"),[a,s]=p.useState(""),I=["widths","counts"];return p.useEffect(()=>{g("widths"),s("")},[t]),b.createElement(sa,{open:t,onOpenChange:()=>{i(!1)}},b.createElement(ra,{className:"!w-fit"},b.createElement("div",{className:"flex flex-col justify-center items-start text-xs"},b.createElement("h2",{className:"text-lg font-medium mb-2"},n("calc.bin_panel_title")),b.createElement("p",{className:"font-normal text-muted-foreground"},n("calc.bin_panel_desc")),b.createElement(_O,{value:o,onValueChange:r=>g(r),className:"mt-2 gap-1 flex flex-col justify-center items-start"},I.map((r,C)=>b.createElement("div",{key:C},b.createElement("div",{className:"flex my-1",key:r},b.createElement("div",{className:"align-top"},b.createElement(zS,{id:r,value:r})),b.createElement("div",{className:"ml-3"},b.createElement("label",{htmlFor:r},n(`calc.bin_panel_option_${r}`)))),o===r&&b.createElement("div",{className:"flex items-center space-x-2"},b.createElement("label",{className:"text-ml whitespace-nowrap"},n("calc.bin_panel_number")),b.createElement(oo,{type:"text",value:a,onChange:l=>{s(l.target.value)}})))))),b.createElement(nE,{className:"mt-2"},b.createElement(fe,{children:n("actions.confirm"),onClick:()=>{const r=e.createField;e.createBinField(r.channel,r.index,o==="widths"?"bin":"binCount",Number(a)),e.setShowBinSettingPanel(!1)}}),b.createElement(fe,{variant:"outline",children:n("actions.cancel"),onClick:()=>{e.setShowBinSettingPanel(!1)}}))))},j7t=ze(q7t),P7t=A=>{const e=xt(),{showRenamePanel:t,createField:i,currentEncodings:n}=e,{t:o}=ve(),[g,a]=p.useState("");return p.useEffect(()=>{var s,I;i&&a(((I=(s=n[i.channel])==null?void 0:s[i.index])==null?void 0:I.name)??"")},[t]),b.createElement(sa,{open:t,onOpenChange:()=>e.setShowRenamePanel(!1)},b.createElement(ra,{className:"!w-fit"},b.createElement("div",{className:"flex flex-col justify-center items-start text-xs"},b.createElement("h2",{className:"text-lg font-medium mb-2"},"Rename Field"),b.createElement("p",{className:"font-normal text-muted-foreground"},"This action will rename this field's name in the chart."),b.createElement("div",{className:"flex items-center space-x-2 mt-2"},b.createElement("label",{className:"text-ml whitespace-nowrap"},"New Name"),b.createElement(oo,{type:"text",value:g,onChange:s=>{a(s.target.value)}}))),b.createElement(nE,{className:"mt-2"},b.createElement(fe,{children:o("actions.confirm"),onClick:()=>{const s=e.createField;e.renameFieldInChart(s.channel,s.index,g),e.setShowRenamePanel(!1)}}),b.createElement(fe,{variant:"outline",children:o("actions.cancel"),onClick:()=>{e.setShowRenamePanel(!1)}}))))},$7t=ze(P7t),HmA=ze(function(){const A=xt();ve();const e=()=>{A.updateShowErrorResolutionPanel(0)};switch(A.showErrorResolutionPanel){case 0:return null;case 500:return b.createElement(sa,{open:!0,onOpenChange:e},b.createElement(ra,{className:"!w-fit"},b.createElement("div",{className:"flex flex-col justify-center items-start"},b.createElement("h2",{className:"font-medium text-xl my-2"},"Oops!"),b.createElement("p",{className:"font-normal my-2"},"The chart is too large to render. You can try options above:"),b.createElement("p",{className:"font-normal my-2"},"1. Set the chart to a fixed size.",b.createElement("a",{className:"mx-2 cursor-pointer font-semibold text-primary",onClick:()=>{A.setVisualLayout("size",{mode:"fixed",width:800,height:600}),e()}},"Set Now")),b.createElement("p",{className:"font-normal my-2"},"2. Change to SVG renderer.",b.createElement("a",{className:"mx-2 cursor-pointer font-semibold text-primary",onClick:()=>{A.setVisualLayout("useSvg",!0),e()}},"Set Now")),b.createElement("p",{className:"font-normal my-2"},"3. Close this modal and edit the chart to reduce chart size."),b.createElement("fieldset",{className:"mt-2 gap-1 flex flex-col justify-center items-end w-full"},b.createElement("div",{className:"mt-2"},b.createElement(fe,{variant:"outline",children:"Close",className:"mr-2",onClick:e}))))));case 501:return b.createElement(sa,{open:!0,onOpenChange:e},b.createElement(ra,null,b.createElement("div",{className:"flex flex-col justify-center items-start"},b.createElement("h2",{className:"font-medium text-xl my-2"},"Oops!"),b.createElement("p",{className:"font-normal my-2"},"There is some error with Computation service. Here is the Error message:"),b.createElement("p",{className:"font-normal my-2"},A.lastErrorMessage),b.createElement("fieldset",{className:"mt-2 gap-1 flex flex-col justify-center items-end w-full"},b.createElement("div",{className:"mt-2"},b.createElement(fe,{variant:"outline",children:"Close",className:"mr-2",onClick:e}))))));case 502:return b.createElement(sa,{open:!0,onOpenChange:e},b.createElement(ra,null,b.createElement("div",{className:"flex flex-col justify-center items-start"},b.createElement("h2",{className:"font-medium text-xl my-2"},"Oops!"),b.createElement("p",{className:"font-normal my-2"},"There is some error with Askviz service. Here is the Error message:"),b.createElement("p",{className:"font-normal my-2"},A.lastErrorMessage),b.createElement("fieldset",{className:"mt-2 gap-1 flex flex-col justify-center items-end w-full"},b.createElement("div",{className:"mt-2"},b.createElement(fe,{variant:"outline",children:"Close",className:"mr-2",onClick:e}))))))}return null});function A$t(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function gj(A="media"){const[e,t]=p.useState(A==="media"?A$t():A);return p.useEffect(()=>{var i;if(A==="media"){const n=(i=window.matchMedia)==null?void 0:i.call(window,"(prefers-color-scheme: dark)"),o=g=>{t(g.matches?"dark":"light")};return n==null||n.addEventListener("change",o),()=>{n==null||n.removeEventListener("change",o)}}else t(A)},[A]),e}var e$t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cle(A,e){return A(e={exports:{}},e.exports),e.exports}var t$t=Cle(function(A){(function(e){var t=function(u,d,f){if(!s(d)||r(d)||C(d)||l(d)||a(d))return d;var w,y=0,G=0;if(I(d))for(w=[],G=d.length;y<G;y++)w.push(t(u,d[y],f));else for(var R in w={},d)Object.prototype.hasOwnProperty.call(d,R)&&(w[u(R,f)]=t(u,d[R],f));return w},i=function(u){return c(u)?u:(u=u.replace(/[\-_\s]+(.)?/g,function(d,f){return f?f.toUpperCase():""})).substr(0,1).toLowerCase()+u.substr(1)},n=function(u){var d=i(u);return d.substr(0,1).toUpperCase()+d.substr(1)},o=function(u,d){return function(f,w){var y=(w=w||{}).separator||"_",G=w.split||/(?=[A-Z])/;return f.split(G).join(y)}(u,d).toLowerCase()},g=Object.prototype.toString,a=function(u){return typeof u=="function"},s=function(u){return u===Object(u)},I=function(u){return g.call(u)=="[object Array]"},r=function(u){return g.call(u)=="[object Date]"},C=function(u){return g.call(u)=="[object RegExp]"},l=function(u){return g.call(u)=="[object Boolean]"},c=function(u){return(u-=0)==u},B=function(u,d){var f=d&&"process"in d?d.process:d;return typeof f!="function"?u:function(w,y){return f(w,u,y)}},E={camelize:i,decamelize:o,pascalize:n,depascalize:o,camelizeKeys:function(u,d){return t(B(i,d),u)},decamelizeKeys:function(u,d){return t(B(o,d),u,d)},pascalizeKeys:function(u,d){return t(B(n,d),u)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};A.exports?A.exports=E:e.humps=E})(e$t)}).decamelize,i$t=function(A){if(Array.isArray(A))return A},n$t=function(A,e){if(typeof Symbol<"u"&&Symbol.iterator in Object(A)){var t=[],i=!0,n=!1,o=void 0;try{for(var g,a=A[Symbol.iterator]();!(i=(g=a.next()).done)&&(t.push(g.value),!e||t.length!==e);i=!0);}catch(s){n=!0,o=s}finally{try{i||a.return==null||a.return()}finally{if(n)throw o}}return t}},lle=function(A,e){(e==null||e>A.length)&&(e=A.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=A[t];return i},o$t=function(A,e){if(A){if(typeof A=="string")return lle(A,e);var t=Object.prototype.toString.call(A).slice(8,-1);return t==="Object"&&A.constructor&&(t=A.constructor.name),t==="Map"||t==="Set"?Array.from(A):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?lle(A,e):void 0}},g$t=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},a$t=function(A,e){return i$t(A)||n$t(A,e)||o$t(A,e)||g$t()},cle=Cle(function(A){function e(){return A.exports=e=Object.assign||function(t){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},e.apply(this,arguments)}A.exports=e}),s$t=function(A,e){if(A==null)return{};var t,i,n={},o=Object.keys(A);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)>=0||(n[t]=A[t]);return n},Ble=function(A,e){if(A==null)return{};var t,i,n=s$t(A,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(A);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(A,t)&&(n[t]=A[t])}return n},r$t=p.createContext(null);function Qle(A){var e=A.children,t=e===void 0?"":e,i=Ble(A,["children"]);return typeof t!="string"&&(t=tYe(t)),b.createElement("template",cle({},i,{dangerouslySetInnerHTML:{__html:t}}))}function Ele(A){var e=A.root,t=A.children;return bt.createPortal(t===void 0?null:t,e)}function I$t(A){var e=p.forwardRef(function(t,i){var n,o,g=t.mode,a=g===void 0?"open":g,s=t.delegatesFocus,I=s!==void 0&&s,r=t.styleSheets,C=r===void 0?[]:r,l=t.ssr,c=l!==void 0&&l,B=t.children,E=Ble(t,["mode","delegatesFocus","styleSheets","ssr","children"]),u=(o=p.useRef((n=i)&&n.current),p.useEffect(function(){n&&(n.current=o.current)},[n]),o),d=p.useState(null),f=a$t(d,2),w=f[0],y=f[1],G="node_".concat(a).concat(I);return p.useLayoutEffect(function(){if(u.current)try{if(typeof i=="function"&&i(u.current),c){var R=u.current.shadowRoot;return void y(R)}var x=u.current.attachShadow({mode:a,delegatesFocus:I});C.length>0&&(x.adoptedStyleSheets=C),y(x)}catch(F){(function(Q){var k=Q.error,h=Q.styleSheets,N=Q.root;switch(k.name){case"NotSupportedError":h.length>0&&(N.adoptedStyleSheets=h);break;default:throw k}})({error:F,styleSheets:C,root:w})}},[i,u,C]),b.createElement(b.Fragment,null,b.createElement(A.tag,cle({key:G,ref:u},E),(w||c)&&b.createElement(r$t.Provider,{value:w},c?b.createElement(Qle,{shadowroot:a,shadowrootmode:a},A.render({root:w,ssr:c,children:B})):b.createElement(Ele,{root:w},A.render({root:w,ssr:c,children:B})))))});return e.propTypes={mode:FA.oneOf(["open","closed"]),delegatesFocus:FA.bool,styleSheets:FA.arrayOf(FA.instanceOf(globalThis.CSSStyleSheet)),ssr:FA.bool,children:FA.node},e}Qle.propTypes={children:FA.oneOfType([FA.string,FA.node])},Ele.propTypes={root:FA.object.isRequired,children:FA.node};var ZmA=new Map;function C$t(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"core",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(i){return i.children};return new Proxy(A,{get:function(i,n){var o=t$t(n,{separator:"-"}),g="".concat(e,"-").concat(o);return ZmA.has(g)||ZmA.set(g,I$t({tag:o,render:t})),ZmA.get(g)}})}var l$t=C$t();const c$t=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-inset-1{top:-.25rem;right:-.25rem;bottom:-.25rem;left:-.25rem}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-x-2{left:.5rem;right:.5rem}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-\\[5px\\]{bottom:5px}.left-0{left:0}.left-2{left:.5rem}.left-\\[50\\%\\]{left:50%}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-5{right:1.25rem}.right-\\[7px\\]{right:7px}.top-0{top:0}.top-2{top:.5rem}.top-4{top:1rem}.top-5{top:1.25rem}.top-8{top:2rem}.top-\\[50\\%\\]{top:50%}.top-full{top:100%}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.col-span-1{grid-column:span 1 / span 1}.col-span-3{grid-column:span 3 / span 3}.float-right{float:right}.m-0{margin:0}.m-0\\.5{margin:.125rem}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-4{margin:1rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-px{margin-left:-1px;margin-right:-1px}.mx-0{margin-left:0;margin-right:0}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-top:0;margin-bottom:0}.my-0\\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\\.5{margin-top:.375rem;margin-bottom:.375rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.-mb-px{margin-bottom:-1px}.-mr-1{margin-right:-.25rem}.-mt-px{margin-top:-1px}.mb-1{margin-bottom:.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-0{margin-left:0}.ml-0\\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mr-0{margin-right:0}.mr-0\\.5{margin-right:.125rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.box-border{box-sizing:border-box}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.\\!h-8{height:2rem!important}.h-0{height:0px}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-5\\/6{height:83.333333%}.h-6{height:1.5rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-\\[11px\\]{height:11px}.h-\\[18px\\]{height:18px}.h-\\[1px\\]{height:1px}.h-\\[30px\\]{height:30px}.h-\\[34px\\]{height:34px}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-min{height:min-content}.h-px{height:1px}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.max-h-\\[300px\\]{max-height:300px}.max-h-\\[calc\\(min\\(800px\\,90vh\\)\\)\\]{max-height:min(800px,90vh)}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-\\[100px\\]{min-height:100px}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[300px\\]{min-height:300px}.min-h-\\[36px\\]{min-height:36px}.min-h-\\[512px\\]{min-height:512px}.min-h-\\[60px\\]{min-height:60px}.\\!w-fit{width:-moz-fit-content!important;width:fit-content!important}.w-0{width:0px}.w-12{width:3rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\\[11px\\]{width:11px}.w-\\[18px\\]{width:18px}.w-\\[1px\\]{width:1px}.w-\\[400px\\]{width:400px}.w-\\[98\\%\\]{width:98%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-\\[0px\\]{min-width:0px}.min-w-\\[100\\%\\]{min-width:100%}.min-w-\\[2\\.25rem\\]{min-width:2.25rem}.min-w-\\[600px\\]{min-width:600px}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.max-w-\\[100vw\\]{max-width:100vw}.max-w-\\[160px\\]{max-width:160px}.max-w-\\[16rem\\]{max-width:16rem}.max-w-\\[180px\\]{max-width:180px}.max-w-\\[240px\\]{max-width:240px}.max-w-\\[360px\\]{max-width:360px}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.flex-grow-0{flex-grow:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.border-collapse{border-collapse:collapse}.origin-top-left{transform-origin:top left}.-translate-x-1{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\\/2{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\\[-50\\%\\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[-50\\%\\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-\\[67\\%\\]{--tw-scale-x: 67%;--tw-scale-y: 67%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.\\!cursor-none{cursor:none!important}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-none{cursor:none}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.scroll-py-1{scroll-padding-top:.25rem;scroll-padding-bottom:.25rem}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-0{column-gap:0px}.gap-x-0\\.5{column-gap:.125rem}.gap-x-6{column-gap:1.5rem}.gap-y-2{row-gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){border-color:hsl(var(--border))}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-visible{overflow-y:visible}.overflow-y-scroll{overflow-y:scroll}.overscroll-none{overscroll-behavior:none}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-tl-none{border-top-left-radius:0}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-x{border-left-width:1px;border-right-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-t-2{border-top-width:2px}.border-t-4{border-top-width:4px}.\\!border-none{border-style:none!important}.border-border{border-color:hsl(var(--border))}.border-dimension{border-color:hsl(var(--dimension))}.border-input{border-color:hsl(var(--input))}.border-measure{border-color:hsl(var(--measure))}.border-primary{border-color:hsl(var(--primary))}.border-primary\\/50{border-color:hsl(var(--primary) / .5)}.border-transparent{border-color:transparent}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(250 204 21 / var(--tw-border-opacity))}.\\!bg-transparent{background-color:transparent!important}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/10{background-color:#0000001a}.bg-black\\/80{background-color:#000c}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-dimension\\/20{background-color:hsl(var(--dimension) / .2)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity))}.bg-measure\\/20{background-color:hsl(var(--measure) / .2)}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-popover\\/30{background-color:hsl(var(--popover) / .3)}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\\/20{background-color:hsl(var(--primary) / .2)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sky-100{--tw-bg-opacity: 1;background-color:rgb(224 242 254 / var(--tw-bg-opacity))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.fill-primary{fill:hsl(var(--primary))}.stroke-current{stroke:currentColor}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-0{padding-bottom:0}.pb-0\\.5{padding-bottom:.125rem}.pb-12{padding-bottom:3rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-0{padding-left:0}.pl-10{padding-left:2.5rem}.pl-14{padding-left:3.5rem}.pl-16{padding-left:4rem}.pl-2{padding-left:.5rem}.pl-2\\.5{padding-left:.625rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-2\\.5{padding-right:.625rem}.pr-24{padding-right:6rem}.pr-4{padding-right:1rem}.pr-8{padding-right:2rem}.pr-\\[88px\\]{padding-right:88px}.pt-0{padding-top:0}.pt-0\\.5{padding-top:.125rem}.pt-10{padding-top:2.5rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-start{text-align:start}.align-top{vertical-align:top}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.capitalize{text-transform:capitalize}.ordinal{--tw-ordinal: ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-6{line-height:1.5rem}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.text-amber-500\\/0{color:#f59e0b00}.text-amber-500\\/10{color:#f59e0b1a}.text-amber-500\\/100{color:#f59e0b}.text-amber-500\\/20{color:#f59e0b33}.text-amber-500\\/25{color:#f59e0b40}.text-amber-500\\/30{color:#f59e0b4d}.text-amber-500\\/40{color:#f59e0b66}.text-amber-500\\/5{color:#f59e0b0d}.text-amber-500\\/50{color:#f59e0b80}.text-amber-500\\/60{color:#f59e0b99}.text-amber-500\\/70{color:#f59e0bb3}.text-amber-500\\/75{color:#f59e0bbf}.text-amber-500\\/80{color:#f59e0bcc}.text-amber-500\\/90{color:#f59e0be6}.text-amber-500\\/95{color:#f59e0bf2}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-blue-500\\/0{color:#3b82f600}.text-blue-500\\/10{color:#3b82f61a}.text-blue-500\\/100{color:#3b82f6}.text-blue-500\\/20{color:#3b82f633}.text-blue-500\\/25{color:#3b82f640}.text-blue-500\\/30{color:#3b82f64d}.text-blue-500\\/40{color:#3b82f666}.text-blue-500\\/5{color:#3b82f60d}.text-blue-500\\/50{color:#3b82f680}.text-blue-500\\/60{color:#3b82f699}.text-blue-500\\/70{color:#3b82f6b3}.text-blue-500\\/75{color:#3b82f6bf}.text-blue-500\\/80{color:#3b82f6cc}.text-blue-500\\/90{color:#3b82f6e6}.text-blue-500\\/95{color:#3b82f6f2}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-500{--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity))}.text-cyan-500\\/0{color:#06b6d400}.text-cyan-500\\/10{color:#06b6d41a}.text-cyan-500\\/100{color:#06b6d4}.text-cyan-500\\/20{color:#06b6d433}.text-cyan-500\\/25{color:#06b6d440}.text-cyan-500\\/30{color:#06b6d44d}.text-cyan-500\\/40{color:#06b6d466}.text-cyan-500\\/5{color:#06b6d40d}.text-cyan-500\\/50{color:#06b6d480}.text-cyan-500\\/60{color:#06b6d499}.text-cyan-500\\/70{color:#06b6d4b3}.text-cyan-500\\/75{color:#06b6d4bf}.text-cyan-500\\/80{color:#06b6d4cc}.text-cyan-500\\/90{color:#06b6d4e6}.text-cyan-500\\/95{color:#06b6d4f2}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-dimension{color:hsl(var(--dimension))}.text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity))}.text-emerald-500\\/0{color:#10b98100}.text-emerald-500\\/10{color:#10b9811a}.text-emerald-500\\/100{color:#10b981}.text-emerald-500\\/20{color:#10b98133}.text-emerald-500\\/25{color:#10b98140}.text-emerald-500\\/30{color:#10b9814d}.text-emerald-500\\/40{color:#10b98166}.text-emerald-500\\/5{color:#10b9810d}.text-emerald-500\\/50{color:#10b98180}.text-emerald-500\\/60{color:#10b98199}.text-emerald-500\\/70{color:#10b981b3}.text-emerald-500\\/75{color:#10b981bf}.text-emerald-500\\/80{color:#10b981cc}.text-emerald-500\\/90{color:#10b981e6}.text-emerald-500\\/95{color:#10b981f2}.text-foreground{color:hsl(var(--foreground))}.text-fuchsia-500{--tw-text-opacity: 1;color:rgb(217 70 239 / var(--tw-text-opacity))}.text-fuchsia-500\\/0{color:#d946ef00}.text-fuchsia-500\\/10{color:#d946ef1a}.text-fuchsia-500\\/100{color:#d946ef}.text-fuchsia-500\\/20{color:#d946ef33}.text-fuchsia-500\\/25{color:#d946ef40}.text-fuchsia-500\\/30{color:#d946ef4d}.text-fuchsia-500\\/40{color:#d946ef66}.text-fuchsia-500\\/5{color:#d946ef0d}.text-fuchsia-500\\/50{color:#d946ef80}.text-fuchsia-500\\/60{color:#d946ef99}.text-fuchsia-500\\/70{color:#d946efb3}.text-fuchsia-500\\/75{color:#d946efbf}.text-fuchsia-500\\/80{color:#d946efcc}.text-fuchsia-500\\/90{color:#d946efe6}.text-fuchsia-500\\/95{color:#d946eff2}.text-fuchsia-700{--tw-text-opacity: 1;color:rgb(162 28 175 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-500\\/0{color:#6b728000}.text-gray-500\\/10{color:#6b72801a}.text-gray-500\\/100{color:#6b7280}.text-gray-500\\/20{color:#6b728033}.text-gray-500\\/25{color:#6b728040}.text-gray-500\\/30{color:#6b72804d}.text-gray-500\\/40{color:#6b728066}.text-gray-500\\/5{color:#6b72800d}.text-gray-500\\/50{color:#6b728080}.text-gray-500\\/60{color:#6b728099}.text-gray-500\\/70{color:#6b7280b3}.text-gray-500\\/75{color:#6b7280bf}.text-gray-500\\/80{color:#6b7280cc}.text-gray-500\\/90{color:#6b7280e6}.text-gray-500\\/95{color:#6b7280f2}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-green-500\\/0{color:#22c55e00}.text-green-500\\/10{color:#22c55e1a}.text-green-500\\/100{color:#22c55e}.text-green-500\\/20{color:#22c55e33}.text-green-500\\/25{color:#22c55e40}.text-green-500\\/30{color:#22c55e4d}.text-green-500\\/40{color:#22c55e66}.text-green-500\\/5{color:#22c55e0d}.text-green-500\\/50{color:#22c55e80}.text-green-500\\/60{color:#22c55e99}.text-green-500\\/70{color:#22c55eb3}.text-green-500\\/75{color:#22c55ebf}.text-green-500\\/80{color:#22c55ecc}.text-green-500\\/90{color:#22c55ee6}.text-green-500\\/95{color:#22c55ef2}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity))}.text-indigo-500\\/0{color:#6366f100}.text-indigo-500\\/10{color:#6366f11a}.text-indigo-500\\/100{color:#6366f1}.text-indigo-500\\/20{color:#6366f133}.text-indigo-500\\/25{color:#6366f140}.text-indigo-500\\/30{color:#6366f14d}.text-indigo-500\\/40{color:#6366f166}.text-indigo-500\\/5{color:#6366f10d}.text-indigo-500\\/50{color:#6366f180}.text-indigo-500\\/60{color:#6366f199}.text-indigo-500\\/70{color:#6366f1b3}.text-indigo-500\\/75{color:#6366f1bf}.text-indigo-500\\/80{color:#6366f1cc}.text-indigo-500\\/90{color:#6366f1e6}.text-indigo-500\\/95{color:#6366f1f2}.text-indigo-800{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity))}.text-lime-500{--tw-text-opacity: 1;color:rgb(132 204 22 / var(--tw-text-opacity))}.text-lime-500\\/0{color:#84cc1600}.text-lime-500\\/10{color:#84cc161a}.text-lime-500\\/100{color:#84cc16}.text-lime-500\\/20{color:#84cc1633}.text-lime-500\\/25{color:#84cc1640}.text-lime-500\\/30{color:#84cc164d}.text-lime-500\\/40{color:#84cc1666}.text-lime-500\\/5{color:#84cc160d}.text-lime-500\\/50{color:#84cc1680}.text-lime-500\\/60{color:#84cc1699}.text-lime-500\\/70{color:#84cc16b3}.text-lime-500\\/75{color:#84cc16bf}.text-lime-500\\/80{color:#84cc16cc}.text-lime-500\\/90{color:#84cc16e6}.text-lime-500\\/95{color:#84cc16f2}.text-measure{color:hsl(var(--measure))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-neutral-500{--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity))}.text-neutral-500\\/0{color:#73737300}.text-neutral-500\\/10{color:#7373731a}.text-neutral-500\\/100{color:#737373}.text-neutral-500\\/20{color:#73737333}.text-neutral-500\\/25{color:#73737340}.text-neutral-500\\/30{color:#7373734d}.text-neutral-500\\/40{color:#73737366}.text-neutral-500\\/5{color:#7373730d}.text-neutral-500\\/50{color:#73737380}.text-neutral-500\\/60{color:#73737399}.text-neutral-500\\/70{color:#737373b3}.text-neutral-500\\/75{color:#737373bf}.text-neutral-500\\/80{color:#737373cc}.text-neutral-500\\/90{color:#737373e6}.text-neutral-500\\/95{color:#737373f2}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity))}.text-orange-500\\/0{color:#f9731600}.text-orange-500\\/10{color:#f973161a}.text-orange-500\\/100{color:#f97316}.text-orange-500\\/20{color:#f9731633}.text-orange-500\\/25{color:#f9731640}.text-orange-500\\/30{color:#f973164d}.text-orange-500\\/40{color:#f9731666}.text-orange-500\\/5{color:#f973160d}.text-orange-500\\/50{color:#f9731680}.text-orange-500\\/60{color:#f9731699}.text-orange-500\\/70{color:#f97316b3}.text-orange-500\\/75{color:#f97316bf}.text-orange-500\\/80{color:#f97316cc}.text-orange-500\\/90{color:#f97316e6}.text-orange-500\\/95{color:#f97316f2}.text-pink-500{--tw-text-opacity: 1;color:rgb(236 72 153 / var(--tw-text-opacity))}.text-pink-500\\/0{color:#ec489900}.text-pink-500\\/10{color:#ec48991a}.text-pink-500\\/100{color:#ec4899}.text-pink-500\\/20{color:#ec489933}.text-pink-500\\/25{color:#ec489940}.text-pink-500\\/30{color:#ec48994d}.text-pink-500\\/40{color:#ec489966}.text-pink-500\\/5{color:#ec48990d}.text-pink-500\\/50{color:#ec489980}.text-pink-500\\/60{color:#ec489999}.text-pink-500\\/70{color:#ec4899b3}.text-pink-500\\/75{color:#ec4899bf}.text-pink-500\\/80{color:#ec4899cc}.text-pink-500\\/90{color:#ec4899e6}.text-pink-500\\/95{color:#ec4899f2}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity))}.text-purple-500\\/0{color:#a855f700}.text-purple-500\\/10{color:#a855f71a}.text-purple-500\\/100{color:#a855f7}.text-purple-500\\/20{color:#a855f733}.text-purple-500\\/25{color:#a855f740}.text-purple-500\\/30{color:#a855f74d}.text-purple-500\\/40{color:#a855f766}.text-purple-500\\/5{color:#a855f70d}.text-purple-500\\/50{color:#a855f780}.text-purple-500\\/60{color:#a855f799}.text-purple-500\\/70{color:#a855f7b3}.text-purple-500\\/75{color:#a855f7bf}.text-purple-500\\/80{color:#a855f7cc}.text-purple-500\\/90{color:#a855f7e6}.text-purple-500\\/95{color:#a855f7f2}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-red-500\\/0{color:#ef444400}.text-red-500\\/10{color:#ef44441a}.text-red-500\\/100{color:#ef4444}.text-red-500\\/20{color:#ef444433}.text-red-500\\/25{color:#ef444440}.text-red-500\\/30{color:#ef44444d}.text-red-500\\/40{color:#ef444466}.text-red-500\\/5{color:#ef44440d}.text-red-500\\/50{color:#ef444480}.text-red-500\\/60{color:#ef444499}.text-red-500\\/70{color:#ef4444b3}.text-red-500\\/75{color:#ef4444bf}.text-red-500\\/80{color:#ef4444cc}.text-red-500\\/90{color:#ef4444e6}.text-red-500\\/95{color:#ef4444f2}.text-rose-500{--tw-text-opacity: 1;color:rgb(244 63 94 / var(--tw-text-opacity))}.text-rose-500\\/0{color:#f43f5e00}.text-rose-500\\/10{color:#f43f5e1a}.text-rose-500\\/100{color:#f43f5e}.text-rose-500\\/20{color:#f43f5e33}.text-rose-500\\/25{color:#f43f5e40}.text-rose-500\\/30{color:#f43f5e4d}.text-rose-500\\/40{color:#f43f5e66}.text-rose-500\\/5{color:#f43f5e0d}.text-rose-500\\/50{color:#f43f5e80}.text-rose-500\\/60{color:#f43f5e99}.text-rose-500\\/70{color:#f43f5eb3}.text-rose-500\\/75{color:#f43f5ebf}.text-rose-500\\/80{color:#f43f5ecc}.text-rose-500\\/90{color:#f43f5ee6}.text-rose-500\\/95{color:#f43f5ef2}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sky-500{--tw-text-opacity: 1;color:rgb(14 165 233 / var(--tw-text-opacity))}.text-sky-500\\/0{color:#0ea5e900}.text-sky-500\\/10{color:#0ea5e91a}.text-sky-500\\/100{color:#0ea5e9}.text-sky-500\\/20{color:#0ea5e933}.text-sky-500\\/25{color:#0ea5e940}.text-sky-500\\/30{color:#0ea5e94d}.text-sky-500\\/40{color:#0ea5e966}.text-sky-500\\/5{color:#0ea5e90d}.text-sky-500\\/50{color:#0ea5e980}.text-sky-500\\/60{color:#0ea5e999}.text-sky-500\\/70{color:#0ea5e9b3}.text-sky-500\\/75{color:#0ea5e9bf}.text-sky-500\\/80{color:#0ea5e9cc}.text-sky-500\\/90{color:#0ea5e9e6}.text-sky-500\\/95{color:#0ea5e9f2}.text-sky-800{--tw-text-opacity: 1;color:rgb(7 89 133 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-slate-500\\/0{color:#64748b00}.text-slate-500\\/10{color:#64748b1a}.text-slate-500\\/100{color:#64748b}.text-slate-500\\/20{color:#64748b33}.text-slate-500\\/25{color:#64748b40}.text-slate-500\\/30{color:#64748b4d}.text-slate-500\\/40{color:#64748b66}.text-slate-500\\/5{color:#64748b0d}.text-slate-500\\/50{color:#64748b80}.text-slate-500\\/60{color:#64748b99}.text-slate-500\\/70{color:#64748bb3}.text-slate-500\\/75{color:#64748bbf}.text-slate-500\\/80{color:#64748bcc}.text-slate-500\\/90{color:#64748be6}.text-slate-500\\/95{color:#64748bf2}.text-stone-500{--tw-text-opacity: 1;color:rgb(120 113 108 / var(--tw-text-opacity))}.text-stone-500\\/0{color:#78716c00}.text-stone-500\\/10{color:#78716c1a}.text-stone-500\\/100{color:#78716c}.text-stone-500\\/20{color:#78716c33}.text-stone-500\\/25{color:#78716c40}.text-stone-500\\/30{color:#78716c4d}.text-stone-500\\/40{color:#78716c66}.text-stone-500\\/5{color:#78716c0d}.text-stone-500\\/50{color:#78716c80}.text-stone-500\\/60{color:#78716c99}.text-stone-500\\/70{color:#78716cb3}.text-stone-500\\/75{color:#78716cbf}.text-stone-500\\/80{color:#78716ccc}.text-stone-500\\/90{color:#78716ce6}.text-stone-500\\/95{color:#78716cf2}.text-teal-500{--tw-text-opacity: 1;color:rgb(20 184 166 / var(--tw-text-opacity))}.text-teal-500\\/0{color:#14b8a600}.text-teal-500\\/10{color:#14b8a61a}.text-teal-500\\/100{color:#14b8a6}.text-teal-500\\/20{color:#14b8a633}.text-teal-500\\/25{color:#14b8a640}.text-teal-500\\/30{color:#14b8a64d}.text-teal-500\\/40{color:#14b8a666}.text-teal-500\\/5{color:#14b8a60d}.text-teal-500\\/50{color:#14b8a680}.text-teal-500\\/60{color:#14b8a699}.text-teal-500\\/70{color:#14b8a6b3}.text-teal-500\\/75{color:#14b8a6bf}.text-teal-500\\/80{color:#14b8a6cc}.text-teal-500\\/90{color:#14b8a6e6}.text-teal-500\\/95{color:#14b8a6f2}.text-transparent{color:transparent}.text-violet-500{--tw-text-opacity: 1;color:rgb(139 92 246 / var(--tw-text-opacity))}.text-violet-500\\/0{color:#8b5cf600}.text-violet-500\\/10{color:#8b5cf61a}.text-violet-500\\/100{color:#8b5cf6}.text-violet-500\\/20{color:#8b5cf633}.text-violet-500\\/25{color:#8b5cf640}.text-violet-500\\/30{color:#8b5cf64d}.text-violet-500\\/40{color:#8b5cf666}.text-violet-500\\/5{color:#8b5cf60d}.text-violet-500\\/50{color:#8b5cf680}.text-violet-500\\/60{color:#8b5cf699}.text-violet-500\\/70{color:#8b5cf6b3}.text-violet-500\\/75{color:#8b5cf6bf}.text-violet-500\\/80{color:#8b5cf6cc}.text-violet-500\\/90{color:#8b5cf6e6}.text-violet-500\\/95{color:#8b5cf6f2}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity))}.text-yellow-500\\/0{color:#eab30800}.text-yellow-500\\/10{color:#eab3081a}.text-yellow-500\\/100{color:#eab308}.text-yellow-500\\/20{color:#eab30833}.text-yellow-500\\/25{color:#eab30840}.text-yellow-500\\/30{color:#eab3084d}.text-yellow-500\\/40{color:#eab30866}.text-yellow-500\\/5{color:#eab3080d}.text-yellow-500\\/50{color:#eab30880}.text-yellow-500\\/60{color:#eab30899}.text-yellow-500\\/70{color:#eab308b3}.text-yellow-500\\/75{color:#eab308bf}.text-yellow-500\\/80{color:#eab308cc}.text-yellow-500\\/90{color:#eab308e6}.text-yellow-500\\/95{color:#eab308f2}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity))}.text-zinc-500{--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity))}.text-zinc-500\\/0{color:#71717a00}.text-zinc-500\\/10{color:#71717a1a}.text-zinc-500\\/100{color:#71717a}.text-zinc-500\\/20{color:#71717a33}.text-zinc-500\\/25{color:#71717a40}.text-zinc-500\\/30{color:#71717a4d}.text-zinc-500\\/40{color:#71717a66}.text-zinc-500\\/5{color:#71717a0d}.text-zinc-500\\/50{color:#71717a80}.text-zinc-500\\/60{color:#71717a99}.text-zinc-500\\/70{color:#71717ab3}.text-zinc-500\\/75{color:#71717abf}.text-zinc-500\\/80{color:#71717acc}.text-zinc-500\\/90{color:#71717ae6}.text-zinc-500\\/95{color:#71717af2}.text-opacity-50{--tw-text-opacity: .5}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.caret-foreground{caret-color:hsl(var(--foreground))}.\\!opacity-50{opacity:.5!important}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-ring{--tw-ring-color: hsl(var(--ring))}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-75{transition-duration:75ms}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-100{animation-duration:.1s}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-75{animation-duration:75ms}.ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:italic::placeholder{font-style:italic}.placeholder\\:text-gray-400::placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\\:left-1\\/2:after{content:var(--tw-content);left:50%}.after\\:w-1:after{content:var(--tw-content);width:.25rem}.after\\:-translate-x-1\\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:border-2:hover{border-width:2px}.hover\\:border-accent-foreground:hover{border-color:hsl(var(--accent-foreground))}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-destructive\\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-dimension\\/20:hover{background-color:hsl(var(--dimension) / .2)}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:bg-measure\\/20:hover{background-color:hsl(var(--measure) / .2)}.hover\\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\\:bg-primary\\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\\:ring-1:active{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.active\\:ring-ring:active{--tw-ring-color: hsl(var(--ring))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\\:visible{visibility:visible}.group:hover .group-hover\\:translate-y-\\[40\\%\\]{--tw-translate-y: 40%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:disabled~.peer-disabled\\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\\:opacity-70{opacity:.7}.data-\\[disabled\\=true\\]\\:pointer-events-none[data-disabled=true],.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[panel-group-direction\\=vertical\\]\\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\\[panel-group-direction\\=vertical\\]\\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[panel-group-direction\\=vertical\\]\\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\\[state\\=active\\]\\:border-primary[data-state=active]{border-color:hsl(var(--primary))}.data-\\[selected\\=true\\]\\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked],.data-\\[state\\=on\\]\\:bg-primary[data-state=on]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\\[selected\\=true\\]\\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\\[state\\=active\\]\\:text-primary[data-state=active]{color:hsl(var(--primary))}.data-\\[state\\=checked\\]\\:text-primary-foreground[data-state=checked],.data-\\[state\\=on\\]\\:text-primary-foreground[data-state=on]{color:hsl(var(--primary-foreground))}.data-\\[state\\=open\\]\\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\\[state\\=open\\]\\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\\[disabled\\=true\\]\\:opacity-50[data-disabled=true],.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\\[state\\=closed\\]\\:slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\\[state\\=closed\\]\\:slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\\[state\\=open\\]\\:slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\\[state\\=open\\]\\:slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y: -48%}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:-translate-y-1\\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[panel-group-direction\\=vertical\\]\\:after\\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:is(.dark .dark\\:border-indigo-600){--tw-border-opacity: 1;border-color:rgb(79 70 229 / var(--tw-border-opacity))}:is(.dark .dark\\:border-purple-600){--tw-border-opacity: 1;border-color:rgb(147 51 234 / var(--tw-border-opacity))}:is(.dark .dark\\:border-sky-600){--tw-border-opacity: 1;border-color:rgb(2 132 199 / var(--tw-border-opacity))}:is(.dark .dark\\:border-yellow-600){--tw-border-opacity: 1;border-color:rgb(202 138 4 / var(--tw-border-opacity))}:is(.dark .dark\\:bg-indigo-900){--tw-bg-opacity: 1;background-color:rgb(49 46 129 / var(--tw-bg-opacity))}:is(.dark .dark\\:bg-purple-900){--tw-bg-opacity: 1;background-color:rgb(88 28 135 / var(--tw-bg-opacity))}:is(.dark .dark\\:bg-sky-900){--tw-bg-opacity: 1;background-color:rgb(12 74 110 / var(--tw-bg-opacity))}:is(.dark .dark\\:bg-yellow-900){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity))}:is(.dark .dark\\:bg-zinc-700){--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}:is(.dark .dark\\:text-amber-600){--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity))}:is(.dark .dark\\:text-blue-600){--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}:is(.dark .dark\\:text-fuchsia-600){--tw-text-opacity: 1;color:rgb(192 38 211 / var(--tw-text-opacity))}:is(.dark .dark\\:text-gray-200){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}:is(.dark .dark\\:text-green-600){--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}:is(.dark .dark\\:text-indigo-100){--tw-text-opacity: 1;color:rgb(224 231 255 / var(--tw-text-opacity))}:is(.dark .dark\\:text-purple-100){--tw-text-opacity: 1;color:rgb(243 232 255 / var(--tw-text-opacity))}:is(.dark .dark\\:text-sky-100){--tw-text-opacity: 1;color:rgb(224 242 254 / var(--tw-text-opacity))}:is(.dark .dark\\:text-yellow-100){--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity))}:is(.dark .dark\\:text-yellow-600){--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity))}:is(.dark .dark\\:\\[color-scheme\\:dark\\]){color-scheme:dark}:is(.dark .dark\\:hover\\:bg-gray-800:hover){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}:is(.dark .dark\\:hover\\:bg-zinc-700:hover){--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}@media (min-width: 640px){.sm\\:mx-0{margin-left:0;margin-right:0}.sm\\:mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.sm\\:ml-0{margin-left:0}.sm\\:ml-0\\.5{margin-left:.125rem}.sm\\:mr-0{margin-right:0}.sm\\:mr-0\\.5{margin-right:.125rem}.sm\\:block{display:block}.sm\\:flex{display:flex}.sm\\:h-full{height:100%}.sm\\:max-h-\\[380px\\]{max-height:380px}.sm\\:min-h-full{min-height:100%}.sm\\:w-\\[80\\%\\]{width:80%}.sm\\:min-w-\\[164px\\]{min-width:164px}.sm\\:min-w-\\[96px\\]{min-width:96px}.sm\\:max-w-\\[314px\\]{max-width:314px}.sm\\:max-w-\\[35\\%\\]{max-width:35%}.sm\\:flex-row{flex-direction:row}.sm\\:flex-col{flex-direction:column}.sm\\:justify-end{justify-content:flex-end}.sm\\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\\:overflow-y-auto{overflow-y:auto}.sm\\:rounded-lg{border-radius:var(--radius)}.sm\\:pl-6{padding-left:1.5rem}.sm\\:text-left{text-align:left}.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\\:flex-row{flex-direction:row}}@media (min-width: 1024px){.lg\\:w-\\[880px\\]{width:880px}.lg\\:flex-nowrap{flex-wrap:nowrap}}.\\[\\&\\>span\\]\\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\[data-panel-group-direction\\=vertical\\]\\>div\\]\\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium [cmdk-group-heading]{font-weight:500}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\\[\\&_\\[cmdk-group\\]\\]\\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\\[\\&_\\[cmdk-input\\]\\]\\:h-12 [cmdk-input]{height:3rem}.\\[\\&_\\[cmdk-item\\]\\]\\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-item\\]\\]\\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 [cmdk-item] svg{height:1.25rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 [cmdk-item] svg{width:1.25rem}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground svg:not([class*=text-]){color:hsl(var(--muted-foreground))}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}
`,B$t=`code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.App{height:100%;background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.dark.App{color-scheme:dark}*{border-color:hsl(var(--border))}*:focus-visible{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: hsl(var(--ring))}#vg-tooltip-element{background-color:hsl(var(--popover));color:hsl(var(--popover-foreground))}:host{--map-tiles-filter: brightness(.6) invert(1) contrast(3) hue-rotate(200deg) saturate(.3) brightness(.7);--radius: .5rem}.dark .map-tile{filter:var(--map-tiles-filter, none)}.dark .leaflet-container{background-color:hsl(var(--background))}.dark .leaflet-control-zoom-out,.dark .leaflet-control-zoom-in{background-color:hsl(var(--background));color:hsl(var(--foreground));border-color:hsl(var(--input))}.dark .leaflet-control-zoom-out:hover,.dark .leaflet-control-zoom-in:hover{background-color:hsl(var(--accent));color:hsl(var(--accent-foreground))}.dark .leaflet-control-zoom{border:2px solid hsl(var(--input))!important}.dark .leaflet-container .leaflet-control-attribution{background-color:hsla(var(--secondary) / .8);color:hsl(var(--secondary-foreground))}.dark .leaflet-tooltip{background-color:hsl(var(--popover));color:hsl(var(--popover-foreground));border-color:hsl(var(--border))}.dark .leaflet-tooltip-right:before{border-right-color:hsl(var(--popover))}.dark .leaflet-tooltip-left:before{border-left-color:hsl(var(--popover))}
`,ule=p.createContext({root:null}),aj=function({onMount:A,onUnmount:e,children:t,uiTheme:i=dSA,...n}){const[o,g]=p.useState(null),a=p.useRef(null),s=p.useRef(A);s.current=A;const I=p.useRef(e);I.current=e;const r=p.useMemo(()=>GXe(i),[i]);return p.useEffect(()=>{var C;if(a.current){const l=a.current.shadowRoot;return g(l),(C=s.current)==null||C.call(s,l),()=>{var c;(c=I.current)==null||c.call(I)}}},[]),b.createElement(l$t.div,{...n,mode:"open",ref:a},b.createElement(znA.Provider,{value:i},b.createElement("style",null,c$t),b.createElement("style",null,B$t),b.createElement("style",null,r),b.createElement("link",{rel:"stylesheet",href:"https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",integrity:"sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=",crossOrigin:""}),o&&b.createElement(Ike,{target:o},b.createElement(ule.Provider,{value:{root:o}},t))))},dle=A=>{const{className:e,color:t,dia:i,factor:n,style:o}=A,g=b.useMemo(()=>{const a=new Array(i).fill(0).map((s,I)=>[I,1/0,-1]);return AvA(i).forEach(([s,I])=>{a[I][1]=Math.min(s,a[I][1]),a[I][2]=Math.max(s,a[I][1])}),a.filter(s=>s[1]!==1/0)},[i]);return b.createElement("div",{className:e,style:o},b.createElement("div",{className:"relative",style:{width:n*i,height:n*i}},g.map(([a,s,I])=>b.createElement("div",{className:"absolute",key:`cursor_${a}`,style:{background:t,width:(I-s+1)*n,height:n,opacity:.6,top:a*n,left:s*n}}))))},hle=A=>{const{color:e,cursor:t,offsetX:i,offsetY:n,children:o,showPreview:g}=A,[a,s]=b.useState(null);return b.createElement("div",{className:"relative cursor-none",onMouseOut:()=>s(null),onMouseMoveCapture:I=>s([I.nativeEvent.offsetX,I.nativeEvent.offsetY]),onTouchMoveCapture:I=>{const r=I.currentTarget.getBoundingClientRect();s([I.changedTouches[0].pageX-r.left,I.changedTouches[0].pageY-r.top])},onTouchEnd:()=>s(null)},o,a!==null&&t.type==="rect"&&b.createElement(b.Fragment,null,b.createElement("div",{className:"absolute pointer-events-none",style:{backgroundColor:e,left:Math.floor((a[0]-i)/t.xFactor)*t.xFactor+i-(t.x-t.x%2)/2*t.xFactor,top:Math.floor((a[1]-n)/t.yFactor)*t.yFactor+n-((t.y-t.y%2)/2-1+t.y%2)*t.yFactor,width:t.x*t.xFactor,height:t.y*t.yFactor,opacity:.6}}),b.createElement("div",{className:"absolute pointer-events-none bg-primary",style:{width:16,height:16,borderRadius:16,opacity:.4,left:a[0]-8,top:a[1]-8}})),g&&!a&&t.type==="rect"&&b.createElement("div",{className:"absolute pointer-events-none",style:{backgroundColor:e,width:t.x*t.xFactor,height:t.y*t.yFactor,opacity:.6,left:`calc(50% - ${(t.x-t.x%2)/2*t.xFactor}px)`,top:`calc(50% - ${(t.y-t.y%2)/2*t.yFactor}px)`}}),a!==null&&t.type==="circle"&&b.createElement(dle,{className:"absolute pointer-events-none",color:e,factor:t.factor,dia:t.dia,style:{left:Math.floor((a[0]-i)/t.factor)*t.factor+i-(t.dia-t.dia%2)/2*t.factor,top:Math.floor((a[1]-n)/t.factor)*t.factor+n-((t.dia-t.dia%2)/2-1+t.dia%2)*t.factor}}),g&&!a&&t.type==="circle"&&b.createElement(dle,{className:"absolute pointer-events-none",color:e,factor:t.factor,dia:t.dia,style:{left:`calc(50% - ${(t.dia-t.dia%2)/2*t.factor}px)`,top:`calc(50% - ${(t.dia-t.dia%2)/2*t.factor}px)`}}))},mle=A=>{const[e,t]=b.useState(!1),i=n=>{n.target.value&&A.onChange(n.target.value),t(!1)};return e?b.createElement(oo,{autoFocus:!0,defaultValue:A.value,onBlur:i,onKeyUp:n=>n.key==="Enter"&&!n.nativeEvent.isComposing?(i(n),!1):!0}):b.createElement("label",{className:"px-3 py-1 text-sm transition-colors rounded hover:bg-accent leading-6",onClick:()=>{t(!0)}},A.value)},ple=A=>{const[e,t]=b.useState(!1),[i,n]=b.useState(!1),o=b.useRef(null),g=b.useContext(ule);p.useEffect(()=>{if(e){const I=C=>{var l;C.target&&!((l=o.current)!=null&&l.contains(C.target))&&t(!1)},r=g.root;return r==null||r.addEventListener("click",I),()=>r==null?void 0:r.removeEventListener("click",I)}},[e]);const[a,s]=b.useState(A.color);return b.createElement(HH,{fallback:b.createElement("div",{className:"flex space-x-2"},b.createElement("div",{className:"w-4 h-4",style:{backgroundColor:A.color}}),b.createElement(oo,{value:A.color,onChange:I=>{A.onChangeColor(I.target.value)}}))},b.createElement("div",{className:"relative",ref:o},b.createElement("div",{className:"w-8 h-5 border-2",style:{backgroundColor:A.color},onClick:I=>{I.stopPropagation(),I.preventDefault(),t(!0),n(!1),s(A.color)}}),e&&b.createElement("div",{className:"absolute right-0 top-8 z-40 flex-col space-y-1 bg-popover shadow-lg rounded-md border"},b.createElement(ZCe,{presetColors:A.colors,color:a,onChange:I=>{n(!0),s(I.hex)},noShadow:!0,noBorder:!0}),b.createElement("div",{className:"flex justify-end p-2"},b.createElement(fe,{variant:"outline",children:"Save",onClick:()=>{t(!1),i&&A.onChangeColor(a)}})))))};var Q$t=u$t,WmA={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},E$t=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function u$t(A){var e=[];return A.replace(E$t,function(t,i,n){var o=i.toLowerCase();for(n=h$t(n),o=="m"&&n.length>2&&(e.push([i].concat(n.splice(0,2))),o="l",i=i=="m"?"l":"L");;){if(n.length==WmA[o])return n.unshift(i),e.push(n);if(n.length<WmA[o])throw new Error("malformed path data");e.push([i].concat(n.splice(0,WmA[o])))}}),e}var d$t=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function h$t(A){var e=A.match(d$t);return e?e.map(Number):[]}const m$t=xC(Q$t);var sj={exports:{}};function p$t(A,e){var t=A[0]-e[0],i=A[1]-e[1];return t*t+i*i}var f$t=function(A,e){if(A.length<=1)return A;e=typeof e=="number"?e:1;for(var t=e*e,i=A[0],n=[i],o,g=1,a=A.length;g<a;g++)o=A[g],p$t(o,i)>t&&(n.push(o),i=o);return i!==o&&n.push(o),n};function y$t(A,e,t){var i=e[0],n=e[1],o=t[0]-i,g=t[1]-n;if(o!==0||g!==0){var a=((A[0]-i)*o+(A[1]-n)*g)/(o*o+g*g);a>1?(i=t[0],n=t[1]):a>0&&(i+=o*a,n+=g*a)}return o=A[0]-i,g=A[1]-n,o*o+g*g}function KmA(A,e,t,i,n){for(var o=i,g,a=e+1;a<t;a++){var s=y$t(A[a],A[e],A[t]);s>o&&(g=a,o=s)}o>i&&(g-e>1&&KmA(A,e,g,i,n),n.push(A[g]),t-g>1&&KmA(A,g,t,i,n))}var b$t=function(A,e){if(A.length<=1)return A;e=typeof e=="number"?e:1;var t=e*e,i=A.length-1,n=[A[0]];return KmA(A,0,i,t,n),n.push(A[i]),n},fle=f$t,yle=b$t;sj.exports=function(A,e){return A=fle(A,e),A=yle(A,e),A},sj.exports.radialDistance=fle,sj.exports.douglasPeucker=yle;var w$t=sj.exports;const D$t=xC(w$t);function ble(A){return[A[0],A[1]]}function TI(A,e){return[A,e]}var G$t=function(A){A=A||{};var e=typeof A.recursion=="number"?A.recursion:8,t=typeof A.epsilon=="number"?A.epsilon:11920929e-14,i=typeof A.pathEpsilon=="number"?A.pathEpsilon:1,n=typeof A.angleEpsilon=="number"?A.angleEpsilon:.01,o=A.angleTolerance||0,g=A.cuspLimit||0;return function(I,r,C,l,c,B){B||(B=[]),c=typeof c=="number"?c:1;var E=i/c;return E*=E,a(I,r,C,l,B,E),B};function a(I,r,C,l,c,B){c.push(ble(I));var E=I[0],u=I[1],d=r[0],f=r[1],w=C[0],y=C[1],G=l[0],R=l[1];s(E,u,d,f,w,y,G,R,c,B,0),c.push(ble(l))}function s(I,r,C,l,c,B,E,u,d,f,w){if(!(w>e)){var y=Math.PI,G=(I+C)/2,R=(r+l)/2,x=(C+c)/2,F=(l+B)/2,Q=(c+E)/2,k=(B+u)/2,h=(G+x)/2,N=(R+F)/2,v=(x+Q)/2,K=(F+k)/2,U=(h+v)/2,V=(N+K)/2;if(w>0){var X=E-I,_=u-r,q=Math.abs((C-E)*_-(l-u)*X),$=Math.abs((c-E)*_-(B-u)*X),nA,j;if(q>t&&$>t){if((q+$)*(q+$)<=f*(X*X+_*_)){if(o<n){d.push(TI(U,V));return}var O=Math.atan2(B-l,c-C);if(nA=Math.abs(O-Math.atan2(l-r,C-I)),j=Math.abs(Math.atan2(u-B,E-c)-O),nA>=y&&(nA=2*y-nA),j>=y&&(j=2*y-j),nA+j<o){d.push(TI(U,V));return}if(g!==0){if(nA>g){d.push(TI(C,l));return}if(j>g){d.push(TI(c,B));return}}}}else if(q>t){if(q*q<=f*(X*X+_*_)){if(o<n){d.push(TI(U,V));return}if(nA=Math.abs(Math.atan2(B-l,c-C)-Math.atan2(l-r,C-I)),nA>=y&&(nA=2*y-nA),nA<o){d.push(TI(C,l)),d.push(TI(c,B));return}if(g!==0&&nA>g){d.push(TI(C,l));return}}}else if($>t){if($*$<=f*(X*X+_*_)){if(o<n){d.push(TI(U,V));return}if(nA=Math.abs(Math.atan2(u-B,E-c)-Math.atan2(B-l,c-C)),nA>=y&&(nA=2*y-nA),nA<o){d.push(TI(C,l)),d.push(TI(c,B));return}if(g!==0&&nA>g){d.push(TI(c,B));return}}}else if(X=U-(I+E)/2,_=V-(r+u)/2,X*X+_*_<=f){d.push(TI(U,V));return}}s(I,r,G,R,h,N,U,V,d,f,w+1),s(U,V,v,K,Q,k,E,u,d,f,w+1)}}},k$t=G$t(),J$t=N$t;function N$t(A){var e=0,t=0,i=0,n=0;return A.map(function(o){o=o.slice();var g=o[0],a=g.toUpperCase();if(g!=a)switch(o[0]=a,g){case"a":o[6]+=i,o[7]+=n;break;case"v":o[1]+=n;break;case"h":o[1]+=i;break;default:for(var s=1;s<o.length;)o[s++]+=i,o[s++]+=n}switch(a){case"Z":i=e,n=t;break;case"H":i=o[1];break;case"V":n=o[1];break;case"M":i=e=o[1],n=t=o[2];break;default:i=o[o.length-2],n=o[o.length-1]}return o})}var vw=Math.PI,wle=kle(120),Y$t=R$t;function R$t(A){for(var e,t=[],i=0,n=0,o=0,g=0,a=null,s=null,I=0,r=0,C=0,l=A.length;C<l;C++){var c=A[C],B=c[0];switch(B){case"M":o=c[1],g=c[2];break;case"A":c=Gle(I,r,c[1],c[2],kle(c[3]),c[4],c[5],c[6],c[7]),c.unshift("C"),c.length>7&&(t.push(c.splice(0,7)),c.unshift("C"));break;case"S":var E=I,u=r;(e=="C"||e=="S")&&(E+=E-i,u+=u-n),c=["C",E,u,c[1],c[2],c[3],c[4]];break;case"T":e=="Q"||e=="T"?(a=I*2-a,s=r*2-s):(a=I,s=r),c=Dle(I,r,a,s,c[1],c[2]);break;case"Q":a=c[1],s=c[2],c=Dle(I,r,c[1],c[2],c[3],c[4]);break;case"L":c=rj(I,r,c[1],c[2]);break;case"H":c=rj(I,r,c[1],r);break;case"V":c=rj(I,r,I,c[1]);break;case"Z":c=rj(I,r,o,g);break}e=B,I=c[c.length-2],r=c[c.length-1],c.length>4?(i=c[c.length-4],n=c[c.length-3]):(i=I,n=r),t.push(c)}return t}function rj(A,e,t,i){return["C",A,e,t,i,t,i]}function Dle(A,e,t,i,n,o){return["C",A/3+.6666666666666666*t,e/3+.6666666666666666*i,n/3+.6666666666666666*t,o/3+.6666666666666666*i,n,o]}function Gle(A,e,t,i,n,o,g,a,s,I){if(I)w=I[0],y=I[1],d=I[2],f=I[3];else{var r=UmA(A,e,-n);A=r.x,e=r.y,r=UmA(a,s,-n),a=r.x,s=r.y;var C=(A-a)/2,l=(e-s)/2,c=C*C/(t*t)+l*l/(i*i);c>1&&(c=Math.sqrt(c),t=c*t,i=c*i);var B=t*t,E=i*i,u=(o==g?-1:1)*Math.sqrt(Math.abs((B*E-B*l*l-E*C*C)/(B*l*l+E*C*C)));u==1/0&&(u=1);var d=u*t*l/i+(A+a)/2,f=u*-i*C/t+(e+s)/2,w=Math.asin(((e-f)/i).toFixed(9)),y=Math.asin(((s-f)/i).toFixed(9));w=A<d?vw-w:w,y=a<d?vw-y:y,w<0&&(w=vw*2+w),y<0&&(y=vw*2+y),g&&w>y&&(w=w-vw*2),!g&&y>w&&(y=y-vw*2)}if(Math.abs(y-w)>wle){var G=y,R=a,x=s;y=w+wle*(g&&y>w?1:-1),a=d+t*Math.cos(y),s=f+i*Math.sin(y);var F=Gle(a,s,t,i,n,0,g,R,x,[y,G,d,f])}var Q=Math.tan((y-w)/4),k=4/3*t*Q,h=4/3*i*Q,N=[2*A-(A+k*Math.sin(w)),2*e-(e-h*Math.cos(w)),a+k*Math.sin(y),s-h*Math.cos(y),a,s];if(I)return N;F&&(N=N.concat(F));for(var v=0;v<N.length;){var K=UmA(N[v],N[v+1],n);N[v++]=K.x,N[v++]=K.y}return N}function UmA(A,e,t){return{x:A*Math.cos(t)-e*Math.sin(t),y:A*Math.sin(t)+e*Math.cos(t)}}function kle(A){return A*(vw/180)}var x$t=function(A,e){return A[0]=e[0],A[1]=e[1],A},F$t=k$t,M$t=J$t,v$t=Y$t,L$t=x$t;function Ij(A,e,t){return A[0]=e,A[1]=t,A}var S$t=[0,0],H$t=[0,0],Z$t=[0,0];function W$t(A,e,t,i){F$t(t,Ij(S$t,i[1],i[2]),Ij(H$t,i[3],i[4]),Ij(Z$t,i[5],i[6]),e,A)}var K$t=function(A,e){var t=[],i=[],n=[0,0];return v$t(M$t(A)).forEach(function(o,g,a){if(o[0]==="M")L$t(n,o.slice(1)),i.length>0&&(t.push(i),i=[]);else if(o[0]==="C")W$t(i,e,n,o),Ij(n,o[5],o[6]);else throw new Error("illegal type in SVG: "+o[0])}),i.length>0&&t.push(i),t};const U$t=xC(K$t);var uo={},V$t=uo;uo.WINDING_ODD=0,uo.WINDING_NONZERO=1,uo.WINDING_POSITIVE=2,uo.WINDING_NEGATIVE=3,uo.WINDING_ABS_GEQ_TWO=4,uo.POLYGONS=0,uo.CONNECTED_POLYGONS=1,uo.BOUNDARY_CONTOURS=2,uo.tesselate=function(A){for(var e=A.debug||!1,t=new Mle,i=0;i<A.contours.length;i++)t.addContour(A.vertexSize||2,A.contours[i]);return t.tesselate(A.windingRule||uo.WINDING_ODD,A.elementType||uo.POLYGONS,A.polySize||3,A.vertexSize||2,A.normal||[0,0,1]),{vertices:t.vertices,vertexIndices:t.vertexIndices,vertexCount:t.vertexCount,elements:t.elements,elementCount:t.elementCount,mesh:e?t.mesh:void 0}};var De=function(A){if(!A)throw"Assertion Failed!"};function QY(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}function UH(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}function VH(A){this.next=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Org=null,this.Lface=null,this.activeRegion=null,this.winding=0,this.side=A}VH.prototype={get Rface(){return this.Sym.Lface},set Rface(A){this.Sym.Lface=A},get Dst(){return this.Sym.Org},set Dst(A){this.Sym.Org=A},get Oprev(){return this.Sym.Lnext},set Oprev(A){this.Sym.Lnext=A},get Lprev(){return this.Onext.Sym},set Lprev(A){this.Onext.Sym=A},get Dprev(){return this.Lnext.Sym},set Dprev(A){this.Lnext.Sym=A},get Rprev(){return this.Sym.Onext},set Rprev(A){this.Sym.Onext=A},get Dnext(){return this.Sym.Onext.Sym},set Dnext(A){this.Sym.Onext.Sym=A},get Rnext(){return this.Sym.Lnext.Sym},set Rnext(A){this.Sym.Lnext.Sym=A}};function Jle(){var A=new QY,e=new UH,t=new VH(0),i=new VH(1);A.next=A.prev=A,A.anEdge=null,e.next=e.prev=e,e.anEdge=null,e.trail=null,e.marked=!1,e.inside=!1,t.next=t,t.Sym=i,t.Onext=null,t.Lnext=null,t.Org=null,t.Lface=null,t.winding=0,t.activeRegion=null,i.next=i,i.Sym=t,i.Onext=null,i.Lnext=null,i.Org=null,i.Lface=null,i.winding=0,i.activeRegion=null,this.vHead=A,this.fHead=e,this.eHead=t,this.eHeadSym=i}Jle.prototype={makeEdge_:function(A){var e=new VH(0),t=new VH(1);A.Sym.side<A.side&&(A=A.Sym);var i=A.Sym.next;return t.next=i,i.Sym.next=e,e.next=A,A.Sym.next=t,e.Sym=t,e.Onext=e,e.Lnext=t,e.Org=null,e.Lface=null,e.winding=0,e.activeRegion=null,t.Sym=e,t.Onext=t,t.Lnext=e,t.Org=null,t.Lface=null,t.winding=0,t.activeRegion=null,e},splice_:function(A,e){var t=A.Onext,i=e.Onext;t.Sym.Lnext=e,i.Sym.Lnext=A,A.Onext=i,e.Onext=t},makeVertex_:function(A,e,t){var i=A;De(i!==null);var n=t.prev;i.prev=n,n.next=i,i.next=t,t.prev=i,i.anEdge=e;var o=e;do o.Org=i,o=o.Onext;while(o!==e)},makeFace_:function(A,e,t){var i=A;De(i!==null);var n=t.prev;i.prev=n,n.next=i,i.next=t,t.prev=i,i.anEdge=e,i.trail=null,i.marked=!1,i.inside=t.inside;var o=e;do o.Lface=i,o=o.Lnext;while(o!==e)},killEdge_:function(A){A.Sym.side<A.side&&(A=A.Sym);var e=A.next,t=A.Sym.next;e.Sym.next=t,t.Sym.next=e},killVertex_:function(A,e){var t=A.anEdge,i=t;do i.Org=e,i=i.Onext;while(i!==t);var n=A.prev,o=A.next;o.prev=n,n.next=o},killFace_:function(A,e){var t=A.anEdge,i=t;do i.Lface=e,i=i.Lnext;while(i!==t);var n=A.prev,o=A.next;o.prev=n,n.next=o},makeEdge:function(){var A=new QY,e=new QY,t=new UH,i=this.makeEdge_(this.eHead);return this.makeVertex_(A,i,this.vHead),this.makeVertex_(e,i.Sym,this.vHead),this.makeFace_(t,i,this.fHead),i},splice:function(A,e){var t=!1,i=!1;if(A!==e){if(e.Org!==A.Org&&(i=!0,this.killVertex_(e.Org,A.Org)),e.Lface!==A.Lface&&(t=!0,this.killFace_(e.Lface,A.Lface)),this.splice_(e,A),!i){var n=new QY;this.makeVertex_(n,e,A.Org),A.Org.anEdge=A}if(!t){var o=new UH;this.makeFace_(o,e,A.Lface),A.Lface.anEdge=A}}},delete:function(A){var e=A.Sym,t=!1;if(A.Lface!==A.Rface&&(t=!0,this.killFace_(A.Lface,A.Rface)),A.Onext===A)this.killVertex_(A.Org,null);else if(A.Rface.anEdge=A.Oprev,A.Org.anEdge=A.Onext,this.splice_(A,A.Oprev),!t){var i=new UH;this.makeFace_(i,A,A.Lface)}e.Onext===e?(this.killVertex_(e.Org,null),this.killFace_(e.Lface,null)):(A.Lface.anEdge=e.Oprev,e.Org.anEdge=e.Onext,this.splice_(e,e.Oprev)),this.killEdge_(A)},addEdgeVertex:function(A){var e=this.makeEdge_(A),t=e.Sym;this.splice_(e,A.Lnext),e.Org=A.Dst;var i=new QY;return this.makeVertex_(i,t,e.Org),e.Lface=t.Lface=A.Lface,e},splitEdge:function(A,e){var t=this.addEdgeVertex(A),i=t.Sym;return this.splice_(A.Sym,A.Sym.Oprev),this.splice_(A.Sym,i),A.Dst=i.Org,i.Dst.anEdge=i.Sym,i.Rface=A.Rface,i.winding=A.winding,i.Sym.winding=A.Sym.winding,i},connect:function(A,e){var t=!1,i=this.makeEdge_(A),n=i.Sym;if(e.Lface!==A.Lface&&(t=!0,this.killFace_(e.Lface,A.Lface)),this.splice_(i,A.Lnext),this.splice_(n,e),i.Org=A.Dst,n.Org=e.Org,i.Lface=n.Lface=A.Lface,A.Lface.anEdge=n,!t){var o=new UH;this.makeFace_(o,i,A.Lface)}return i},zapFace:function(A){var e=A.anEdge,t,i,n,o,g;i=e.Lnext;do t=i,i=t.Lnext,t.Lface=null,t.Rface===null&&(t.Onext===t?this.killVertex_(t.Org,null):(t.Org.anEdge=t.Onext,this.splice_(t,t.Oprev)),n=t.Sym,n.Onext===n?this.killVertex_(n.Org,null):(n.Org.anEdge=n.Onext,this.splice_(n,n.Oprev)),this.killEdge_(t));while(t!=e);o=A.prev,g=A.next,g.prev=o,o.next=g},countFaceVerts_:function(A){var e=A.anEdge,t=0;do t++,e=e.Lnext;while(e!==A.anEdge);return t},mergeConvexFaces:function(A){var e,t,i,n,o,g,a;for(e=this.fHead.next;e!==this.fHead;e=e.next)if(e.inside)for(t=e.anEdge,o=t.Org;i=t.Lnext,n=t.Sym,n&&n.Lface&&n.Lface.inside&&(g=this.countFaceVerts_(e),a=this.countFaceVerts_(n.Lface),g+a-2<=A&&KA.vertCCW(t.Lprev.Org,t.Org,n.Lnext.Lnext.Org)&&KA.vertCCW(n.Lprev.Org,n.Org,t.Lnext.Lnext.Org)&&(i=n.Lnext,this.delete(n),t=null,n=null)),!(t&&t.Lnext.Org===o);)t=i;return!0},check:function(){var A=this.fHead,e=this.vHead,t=this.eHead,i,n,o,g,a,s;for(n=A,n=A;(i=n.next)!==A;n=i){De(i.prev===n),a=i.anEdge;do De(a.Sym!==a),De(a.Sym.Sym===a),De(a.Lnext.Onext.Sym===a),De(a.Onext.Sym.Lnext===a),De(a.Lface===i),a=a.Lnext;while(a!==i.anEdge)}for(De(i.prev===n&&i.anEdge===null),g=e,g=e;(o=g.next)!==e;g=o){De(o.prev===g),a=o.anEdge;do De(a.Sym!==a),De(a.Sym.Sym===a),De(a.Lnext.Onext.Sym===a),De(a.Onext.Sym.Lnext===a),De(a.Org===o),a=a.Onext;while(a!==o.anEdge)}for(De(o.prev===g&&o.anEdge===null),s=t,s=t;(a=s.next)!==t;s=a)De(a.Sym.next===s.Sym),De(a.Sym!==a),De(a.Sym.Sym===a),De(a.Org!==null),De(a.Dst!==null),De(a.Lnext.Onext.Sym===a),De(a.Onext.Sym.Lnext===a);De(a.Sym.next===s.Sym&&a.Sym===this.eHeadSym&&a.Sym.Sym===a&&a.Org===null&&a.Dst===null&&a.Lface===null&&a.Rface===null)}};var KA={};KA.vertEq=function(A,e){return A.s===e.s&&A.t===e.t},KA.vertLeq=function(A,e){return A.s<e.s||A.s===e.s&&A.t<=e.t},KA.transLeq=function(A,e){return A.t<e.t||A.t===e.t&&A.s<=e.s},KA.edgeGoesLeft=function(A){return KA.vertLeq(A.Dst,A.Org)},KA.edgeGoesRight=function(A){return KA.vertLeq(A.Org,A.Dst)},KA.vertL1dist=function(A,e){return Math.abs(A.s-e.s)+Math.abs(A.t-e.t)},KA.edgeEval=function(A,e,t){De(KA.vertLeq(A,e)&&KA.vertLeq(e,t));var i=e.s-A.s,n=t.s-e.s;return i+n>0?i<n?e.t-A.t+(A.t-t.t)*(i/(i+n)):e.t-t.t+(t.t-A.t)*(n/(i+n)):0},KA.edgeSign=function(A,e,t){De(KA.vertLeq(A,e)&&KA.vertLeq(e,t));var i=e.s-A.s,n=t.s-e.s;return i+n>0?(e.t-t.t)*i+(e.t-A.t)*n:0},KA.transEval=function(A,e,t){De(KA.transLeq(A,e)&&KA.transLeq(e,t));var i=e.t-A.t,n=t.t-e.t;return i+n>0?i<n?e.s-A.s+(A.s-t.s)*(i/(i+n)):e.s-t.s+(t.s-A.s)*(n/(i+n)):0},KA.transSign=function(A,e,t){De(KA.transLeq(A,e)&&KA.transLeq(e,t));var i=e.t-A.t,n=t.t-e.t;return i+n>0?(e.s-t.s)*i+(e.s-A.s)*n:0},KA.vertCCW=function(A,e,t){return A.s*(e.t-t.t)+e.s*(t.t-A.t)+t.s*(A.t-e.t)>=0},KA.interpolate=function(A,e,t,i){return A=A<0?0:A,t=t<0?0:t,A<=t?t==0?(e+i)/2:e+(i-e)*(A/(A+t)):i+(e-i)*(t/(A+t))},KA.intersect=function(A,e,t,i,n){var o,g,a;KA.vertLeq(A,e)||(a=A,A=e,e=a),KA.vertLeq(t,i)||(a=t,t=i,i=a),KA.vertLeq(A,t)||(a=A,A=t,t=a,a=e,e=i,i=a),KA.vertLeq(t,e)?KA.vertLeq(e,i)?(o=KA.edgeEval(A,t,e),g=KA.edgeEval(t,e,i),o+g<0&&(o=-o,g=-g),n.s=KA.interpolate(o,t.s,g,e.s)):(o=KA.edgeSign(A,t,e),g=-KA.edgeSign(A,i,e),o+g<0&&(o=-o,g=-g),n.s=KA.interpolate(o,t.s,g,i.s)):n.s=(t.s+e.s)/2,KA.transLeq(A,e)||(a=A,A=e,e=a),KA.transLeq(t,i)||(a=t,t=i,i=a),KA.transLeq(A,t)||(a=A,A=t,t=a,a=e,e=i,i=a),KA.transLeq(t,e)?KA.transLeq(e,i)?(o=KA.transEval(A,t,e),g=KA.transEval(t,e,i),o+g<0&&(o=-o,g=-g),n.t=KA.interpolate(o,t.t,g,e.t)):(o=KA.transSign(A,t,e),g=-KA.transSign(A,i,e),o+g<0&&(o=-o,g=-g),n.t=KA.interpolate(o,t.t,g,i.t)):n.t=(t.t+e.t)/2};function Nle(){this.key=null,this.next=null,this.prev=null}function Yle(A,e){this.head=new Nle,this.head.next=this.head,this.head.prev=this.head,this.frame=A,this.leq=e}Yle.prototype={min:function(){return this.head.next},max:function(){return this.head.prev},insert:function(A){return this.insertBefore(this.head,A)},search:function(A){var e=this.head;do e=e.next;while(e.key!==null&&!this.leq(this.frame,A,e.key));return e},insertBefore:function(A,e){do A=A.prev;while(A.key!==null&&!this.leq(this.frame,A.key,e));var t=new Nle;return t.key=e,t.next=A.next,A.next.prev=t,t.prev=A,A.next=t,t},delete:function(A){A.next.prev=A.prev,A.prev.next=A.next}};function Rle(){this.handle=null}function xle(){this.key=null,this.node=null}function Fle(A,e){this.size=0,this.max=A,this.nodes=[],this.nodes.length=A+1;for(var t=0;t<this.nodes.length;t++)this.nodes[t]=new Rle;this.handles=[],this.handles.length=A+1;for(var t=0;t<this.handles.length;t++)this.handles[t]=new xle;this.initialized=!1,this.freeList=0,this.leq=e,this.nodes[1].handle=1,this.handles[1].key=null}Fle.prototype={floatDown_:function(A){var e=this.nodes,t=this.handles,i,n,o;for(i=e[A].handle;;){if(o=A<<1,o<this.size&&this.leq(t[e[o+1].handle].key,t[e[o].handle].key)&&++o,De(o<=this.max),n=e[o].handle,o>this.size||this.leq(t[i].key,t[n].key)){e[A].handle=i,t[i].node=A;break}e[A].handle=n,t[n].node=A,A=o}},floatUp_:function(A){var e=this.nodes,t=this.handles,i,n,o;for(i=e[A].handle;;){if(o=A>>1,n=e[o].handle,o==0||this.leq(t[n].key,t[i].key)){e[A].handle=i,t[i].node=A;break}e[A].handle=n,t[n].node=A,A=o}},init:function(){for(var A=this.size;A>=1;--A)this.floatDown_(A);this.initialized=!0},min:function(){return this.handles[this.nodes[1].handle].key},isEmpty:function(){this.size},insert:function(A){var e,t;if(e=++this.size,e*2>this.max){this.max*=2;var i;i=this.nodes.length,this.nodes.length=this.max+1;for(var n=i;n<this.nodes.length;n++)this.nodes[n]=new Rle;i=this.handles.length,this.handles.length=this.max+1;for(var n=i;n<this.handles.length;n++)this.handles[n]=new xle}return this.freeList===0?t=e:(t=this.freeList,this.freeList=this.handles[t].node),this.nodes[e].handle=t,this.handles[t].node=e,this.handles[t].key=A,this.initialized&&this.floatUp_(e),t},extractMin:function(){var A=this.nodes,e=this.handles,t=A[1].handle,i=e[t].key;return this.size>0&&(A[1].handle=A[this.size].handle,e[A[1].handle].node=1,e[t].key=null,e[t].node=this.freeList,this.freeList=t,--this.size,this.size>0&&this.floatDown_(1)),i},delete:function(A){var e=this.nodes,t=this.handles,i;De(A>=1&&A<=this.max&&t[A].key!==null),i=t[A].node,e[i].handle=e[this.size].handle,t[e[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(t[e[i>>1].handle].key,t[e[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),t[A].key=null,t[A].node=this.freeList,this.freeList=A}};function VmA(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}var GA={};GA.regionBelow=function(A){return A.nodeUp.prev.key},GA.regionAbove=function(A){return A.nodeUp.next.key},GA.debugEvent=function(A){},GA.addWinding=function(A,e){A.winding+=e.winding,A.Sym.winding+=e.Sym.winding},GA.edgeLeq=function(A,e,t){var i=A.event,g,a,n=e.eUp,o=t.eUp;if(n.Dst===i)return o.Dst===i?KA.vertLeq(n.Org,o.Org)?KA.edgeSign(o.Dst,n.Org,o.Org)<=0:KA.edgeSign(n.Dst,o.Org,n.Org)>=0:KA.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return KA.edgeSign(n.Dst,i,n.Org)>=0;var g=KA.edgeEval(n.Dst,i,n.Org),a=KA.edgeEval(o.Dst,i,o.Org);return g>=a},GA.deleteRegion=function(A,e){e.fixUpperEdge&&De(e.eUp.winding===0),e.eUp.activeRegion=null,A.dict.delete(e.nodeUp)},GA.fixUpperEdge=function(A,e,t){De(e.fixUpperEdge),A.mesh.delete(e.eUp),e.fixUpperEdge=!1,e.eUp=t,t.activeRegion=e},GA.topLeftRegion=function(A,e){var t=e.eUp.Org,i;do e=GA.regionAbove(e);while(e.eUp.Org===t);if(e.fixUpperEdge){if(i=A.mesh.connect(GA.regionBelow(e).eUp.Sym,e.eUp.Lnext),i===null)return null;GA.fixUpperEdge(A,e,i),e=GA.regionAbove(e)}return e},GA.topRightRegion=function(t){var e=t.eUp.Dst,t=null;do t=GA.regionAbove(t);while(t.eUp.Dst===e);return t},GA.addRegionBelow=function(A,e,t){var i=new VmA;return i.eUp=t,i.nodeUp=A.dict.insertBefore(e.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,t.activeRegion=i,i},GA.isWindingInside=function(A,e){switch(A.windingRule){case uo.WINDING_ODD:return(e&1)!=0;case uo.WINDING_NONZERO:return e!=0;case uo.WINDING_POSITIVE:return e>0;case uo.WINDING_NEGATIVE:return e<0;case uo.WINDING_ABS_GEQ_TWO:return e>=2||e<=-2}return De(!1),!1},GA.computeWinding=function(A,e){e.windingNumber=GA.regionAbove(e).windingNumber+e.eUp.winding,e.inside=GA.isWindingInside(A,e.windingNumber)},GA.finishRegion=function(A,e){var t=e.eUp,i=t.Lface;i.inside=e.inside,i.anEdge=t,GA.deleteRegion(A,e)},GA.finishLeftRegions=function(A,e,t){for(var i,g,n=null,o=e,g=e.eUp;o!==t;){if(o.fixUpperEdge=!1,n=GA.regionBelow(o),i=n.eUp,i.Org!=g.Org){if(!n.fixUpperEdge){GA.finishRegion(A,o);break}i=A.mesh.connect(g.Lprev,i.Sym),GA.fixUpperEdge(A,n,i)}g.Onext!==i&&(A.mesh.splice(i.Oprev,i),A.mesh.splice(g,i)),GA.finishRegion(A,o),g=n.eUp,o=n}return g},GA.addRightEdges=function(A,e,t,i,n,o){var g,a,s,I,r=!0;s=t;do De(KA.vertLeq(s.Org,s.Dst)),GA.addRegionBelow(A,e,s.Sym),s=s.Onext;while(s!==i);for(n===null&&(n=GA.regionBelow(e).eUp.Rprev),a=e,I=n;g=GA.regionBelow(a),s=g.eUp.Sym,s.Org===I.Org;)s.Onext!==I&&(A.mesh.splice(s.Oprev,s),A.mesh.splice(I.Oprev,s)),g.windingNumber=a.windingNumber-s.winding,g.inside=GA.isWindingInside(A,g.windingNumber),a.dirty=!0,!r&&GA.checkForRightSplice(A,a)&&(GA.addWinding(s,I),GA.deleteRegion(A,a),A.mesh.delete(I)),r=!1,a=g,I=s;a.dirty=!0,De(a.windingNumber-s.winding===g.windingNumber),o&&GA.walkDirtyRegions(A,a)},GA.spliceMergeVertices=function(A,e,t){A.mesh.splice(e,t)},GA.vertexWeights=function(A,e,t){var i=KA.vertL1dist(e,A),n=KA.vertL1dist(t,A),o=.5*n/(i+n),g=.5*i/(i+n);A.coords[0]+=o*e.coords[0]+g*t.coords[0],A.coords[1]+=o*e.coords[1]+g*t.coords[1],A.coords[2]+=o*e.coords[2]+g*t.coords[2]},GA.getIntersectData=function(A,e,t,i,n,o){e.coords[0]=e.coords[1]=e.coords[2]=0,e.idx=-1,GA.vertexWeights(e,t,i),GA.vertexWeights(e,n,o)},GA.checkForRightSplice=function(A,e){var t=GA.regionBelow(e),i=e.eUp,n=t.eUp;if(KA.vertLeq(i.Org,n.Org)){if(KA.edgeSign(n.Dst,i.Org,n.Org)>0)return!1;KA.vertEq(i.Org,n.Org)?i.Org!==n.Org&&(A.pq.delete(i.Org.pqHandle),GA.spliceMergeVertices(A,n.Oprev,i)):(A.mesh.splitEdge(n.Sym),A.mesh.splice(i,n.Oprev),e.dirty=t.dirty=!0)}else{if(KA.edgeSign(i.Dst,n.Org,i.Org)<0)return!1;GA.regionAbove(e).dirty=e.dirty=!0,A.mesh.splitEdge(i.Sym),A.mesh.splice(n.Oprev,i)}return!0},GA.checkForLeftSplice=function(A,e){var t=GA.regionBelow(e),i=e.eUp,n=t.eUp,o;if(De(!KA.vertEq(i.Dst,n.Dst)),KA.vertLeq(i.Dst,n.Dst)){if(KA.edgeSign(i.Dst,n.Dst,i.Org)<0)return!1;GA.regionAbove(e).dirty=e.dirty=!0,o=A.mesh.splitEdge(i),A.mesh.splice(n.Sym,o),o.Lface.inside=e.inside}else{if(KA.edgeSign(n.Dst,i.Dst,n.Org)>0)return!1;e.dirty=t.dirty=!0,o=A.mesh.splitEdge(n),A.mesh.splice(i.Lnext,n.Sym),o.Rface.inside=e.inside}return!0},GA.checkForIntersect=function(A,e){var t=GA.regionBelow(e),i=e.eUp,n=t.eUp,o=i.Org,g=n.Org,a=i.Dst,s=n.Dst,I,r,C=new QY,l,c;if(De(!KA.vertEq(s,a)),De(KA.edgeSign(a,A.event,o)<=0),De(KA.edgeSign(s,A.event,g)>=0),De(o!==A.event&&g!==A.event),De(!e.fixUpperEdge&&!t.fixUpperEdge),o===g||(I=Math.min(o.t,a.t),r=Math.max(g.t,s.t),I>r))return!1;if(KA.vertLeq(o,g)){if(KA.edgeSign(s,o,g)>0)return!1}else if(KA.edgeSign(a,g,o)<0)return!1;return GA.debugEvent(A),KA.intersect(a,o,s,g,C),De(Math.min(o.t,a.t)<=C.t),De(C.t<=Math.max(g.t,s.t)),De(Math.min(s.s,a.s)<=C.s),De(C.s<=Math.max(g.s,o.s)),KA.vertLeq(C,A.event)&&(C.s=A.event.s,C.t=A.event.t),l=KA.vertLeq(o,g)?o:g,KA.vertLeq(l,C)&&(C.s=l.s,C.t=l.t),KA.vertEq(C,o)||KA.vertEq(C,g)?(GA.checkForRightSplice(A,e),!1):!KA.vertEq(a,A.event)&&KA.edgeSign(a,A.event,C)>=0||!KA.vertEq(s,A.event)&&KA.edgeSign(s,A.event,C)<=0?s===A.event?(A.mesh.splitEdge(i.Sym),A.mesh.splice(n.Sym,i),e=GA.topLeftRegion(A,e),i=GA.regionBelow(e).eUp,GA.finishLeftRegions(A,GA.regionBelow(e),t),GA.addRightEdges(A,e,i.Oprev,i,i,!0),TRUE):a===A.event?(A.mesh.splitEdge(n.Sym),A.mesh.splice(i.Lnext,n.Oprev),t=e,e=GA.topRightRegion(e),c=GA.regionBelow(e).eUp.Rprev,t.eUp=n.Oprev,n=GA.finishLeftRegions(A,t,null),GA.addRightEdges(A,e,n.Onext,i.Rprev,c,!0),!0):(KA.edgeSign(a,A.event,C)>=0&&(GA.regionAbove(e).dirty=e.dirty=!0,A.mesh.splitEdge(i.Sym),i.Org.s=A.event.s,i.Org.t=A.event.t),KA.edgeSign(s,A.event,C)<=0&&(e.dirty=t.dirty=!0,A.mesh.splitEdge(n.Sym),n.Org.s=A.event.s,n.Org.t=A.event.t),!1):(A.mesh.splitEdge(i.Sym),A.mesh.splitEdge(n.Sym),A.mesh.splice(n.Oprev,i),i.Org.s=C.s,i.Org.t=C.t,i.Org.pqHandle=A.pq.insert(i.Org),GA.getIntersectData(A,i.Org,o,a,g,s),GA.regionAbove(e).dirty=e.dirty=t.dirty=!0,!1)},GA.walkDirtyRegions=function(A,e){for(var t=GA.regionBelow(e),i,n;;){for(;t.dirty;)e=t,t=GA.regionBelow(t);if(!e.dirty&&(t=e,e=GA.regionAbove(e),e==null||!e.dirty))return;if(e.dirty=!1,i=e.eUp,n=t.eUp,i.Dst!==n.Dst&&GA.checkForLeftSplice(A,e)&&(t.fixUpperEdge?(GA.deleteRegion(A,t),A.mesh.delete(n),t=GA.regionBelow(e),n=t.eUp):e.fixUpperEdge&&(GA.deleteRegion(A,e),A.mesh.delete(i),e=GA.regionAbove(t),i=e.eUp)),i.Org!==n.Org)if(i.Dst!==n.Dst&&!e.fixUpperEdge&&!t.fixUpperEdge&&(i.Dst===A.event||n.Dst===A.event)){if(GA.checkForIntersect(A,e))return}else GA.checkForRightSplice(A,e);i.Org===n.Org&&i.Dst===n.Dst&&(GA.addWinding(n,i),GA.deleteRegion(A,e),A.mesh.delete(i),e=GA.regionAbove(t))}},GA.connectRightVertex=function(A,e,t){var i,n=t.Onext,o=GA.regionBelow(e),g=e.eUp,a=o.eUp,s=!1;if(g.Dst!==a.Dst&&GA.checkForIntersect(A,e),KA.vertEq(g.Org,A.event)&&(A.mesh.splice(n.Oprev,g),e=GA.topLeftRegion(A,e),n=GA.regionBelow(e).eUp,GA.finishLeftRegions(A,GA.regionBelow(e),o),s=!0),KA.vertEq(a.Org,A.event)&&(A.mesh.splice(t,a.Oprev),t=GA.finishLeftRegions(A,o,null),s=!0),s){GA.addRightEdges(A,e,t.Onext,n,n,!0);return}KA.vertLeq(a.Org,g.Org)?i=a.Oprev:i=g,i=A.mesh.connect(t.Lprev,i),GA.addRightEdges(A,e,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,GA.walkDirtyRegions(A,e)},GA.connectLeftDegenerate=function(A,e,t){var i,n,o,g,a;if(i=e.eUp,KA.vertEq(i.Org,t)){De(!1),GA.spliceMergeVertices(A,i,t.anEdge);return}if(!KA.vertEq(i.Dst,t)){A.mesh.splitEdge(i.Sym),e.fixUpperEdge&&(A.mesh.delete(i.Onext),e.fixUpperEdge=!1),A.mesh.splice(t.anEdge,i),GA.sweepEvent(A,t);return}De(!1),e=GA.topRightRegion(e),a=GA.regionBelow(e),o=a.eUp.Sym,n=g=o.Onext,a.fixUpperEdge&&(De(n!==o),GA.deleteRegion(A,a),A.mesh.delete(o),o=n.Oprev),A.mesh.splice(t.anEdge,o),KA.edgeGoesLeft(n)||(n=null),GA.addRightEdges(A,e,o.Onext,g,n,!0)},GA.connectLeftVertex=function(A,e){var t,i,n,o,g,a,s=new VmA;if(s.eUp=e.anEdge.Sym,t=A.dict.search(s).key,i=GA.regionBelow(t),!!i){if(o=t.eUp,g=i.eUp,KA.edgeSign(o.Dst,e,o.Org)===0){GA.connectLeftDegenerate(A,t,e);return}if(n=KA.vertLeq(g.Dst,o.Dst)?t:i,t.inside||n.fixUpperEdge){if(n===t)a=A.mesh.connect(e.anEdge.Sym,o.Lnext);else{var I=A.mesh.connect(g.Dnext,e.anEdge);a=I.Sym}n.fixUpperEdge?GA.fixUpperEdge(A,n,a):GA.computeWinding(A,GA.addRegionBelow(A,t,a)),GA.sweepEvent(A,e)}else GA.addRightEdges(A,t,e.anEdge,e.anEdge,null,!0)}},GA.sweepEvent=function(A,e){A.event=e,GA.debugEvent(A);for(var t=e.anEdge;t.activeRegion===null;)if(t=t.Onext,t==e.anEdge){GA.connectLeftVertex(A,e);return}var i=GA.topLeftRegion(A,t.activeRegion);De(i!==null);var n=GA.regionBelow(i),o=n.eUp,g=GA.finishLeftRegions(A,n,null);g.Onext===o?GA.connectRightVertex(A,i,g):GA.addRightEdges(A,i,g.Onext,o,o,!0)},GA.addSentinel=function(A,e,t,i){var n=new VmA,o=A.mesh.makeEdge();o.Org.s=t,o.Org.t=i,o.Dst.s=e,o.Dst.t=i,A.event=o.Dst,n.eUp=o,n.windingNumber=0,n.inside=!1,n.fixUpperEdge=!1,n.sentinel=!0,n.dirty=!1,n.nodeUp=A.dict.insert(n)},GA.initEdgeDict=function(A){A.dict=new Yle(A,GA.edgeLeq);var e=A.bmax[0]-A.bmin[0],t=A.bmax[1]-A.bmin[1],i=A.bmin[0]-e,n=A.bmax[0]+e,o=A.bmin[1]-t,g=A.bmax[1]+t;GA.addSentinel(A,i,n,o),GA.addSentinel(A,i,n,g)},GA.doneEdgeDict=function(A){for(var e,t=0;(e=A.dict.min().key)!==null;)e.sentinel||(De(e.fixUpperEdge),De(++t==1)),De(e.windingNumber==0),GA.deleteRegion(A,e)},GA.removeDegenerateEdges=function(A){var e,t,i,n=A.mesh.eHead;for(e=n.next;e!==n;e=t)t=e.next,i=e.Lnext,KA.vertEq(e.Org,e.Dst)&&e.Lnext.Lnext!==e&&(GA.spliceMergeVertices(A,i,e),A.mesh.delete(e),e=i,i=e.Lnext),i.Lnext===e&&(i!==e&&((i===t||i===t.Sym)&&(t=t.next),A.mesh.delete(i)),(e===t||e===t.Sym)&&(t=t.next),A.mesh.delete(e))},GA.initPriorityQ=function(A){var e,t,i,n=0;for(i=A.mesh.vHead,t=i.next;t!==i;t=t.next)n++;for(n+=8,e=A.pq=new Fle(n,KA.vertLeq),i=A.mesh.vHead,t=i.next;t!==i;t=t.next)t.pqHandle=e.insert(t);return t!==i?!1:(e.init(),!0)},GA.donePriorityQ=function(A){A.pq=null},GA.removeDegenerateFaces=function(A,e){var t,i,n;for(t=e.fHead.next;t!==e.fHead;t=i)i=t.next,n=t.anEdge,De(n.Lnext!==n),n.Lnext.Lnext===n&&(GA.addWinding(n.Onext,n),A.mesh.delete(n));return!0},GA.computeInterior=function(A){var e,t;if(GA.removeDegenerateEdges(A),!GA.initPriorityQ(A))return!1;for(GA.initEdgeDict(A);(e=A.pq.extractMin())!==null;){for(;t=A.pq.min(),!(t===null||!KA.vertEq(t,e));)t=A.pq.extractMin(),GA.spliceMergeVertices(A,e.anEdge,t.anEdge);GA.sweepEvent(A,e)}return A.event=A.dict.min().key.eUp.Org,GA.debugEvent(A),GA.doneEdgeDict(A),GA.donePriorityQ(A),GA.removeDegenerateFaces(A,A.mesh)?(A.mesh.check(),!0):!1};function Mle(){this.mesh=null,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=uo.WINDING_ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}Mle.prototype={dot_:function(A,e){return A[0]*e[0]+A[1]*e[1]+A[2]*e[2]},normalize_:function(A){var e=A[0]*A[0]+A[1]*A[1]+A[2]*A[2];De(e>0),e=Math.sqrt(e),A[0]/=e,A[1]/=e,A[2]/=e},longAxis_:function(A){var e=0;return Math.abs(A[1])>Math.abs(A[0])&&(e=1),Math.abs(A[2])>Math.abs(A[e])&&(e=2),e},computeNormal_:function(A){var e,t,i,n,o,g,a=[0,0,0],s=[0,0,0],I=[0,0,0],r=[0,0,0],C=[0,0,0],l=[null,null,null],c=[null,null,null],B=this.mesh.vHead,E;for(e=B.next,E=0;E<3;++E)n=e.coords[E],s[E]=n,c[E]=e,a[E]=n,l[E]=e;for(e=B.next;e!==B;e=e.next)for(E=0;E<3;++E)n=e.coords[E],n<s[E]&&(s[E]=n,c[E]=e),n>a[E]&&(a[E]=n,l[E]=e);if(E=0,a[1]-s[1]>a[0]-s[0]&&(E=1),a[2]-s[2]>a[E]-s[E]&&(E=2),s[E]>=a[E]){A[0]=0,A[1]=0,A[2]=1;return}for(g=0,t=c[E],i=l[E],I[0]=t.coords[0]-i.coords[0],I[1]=t.coords[1]-i.coords[1],I[2]=t.coords[2]-i.coords[2],e=B.next;e!==B;e=e.next)r[0]=e.coords[0]-i.coords[0],r[1]=e.coords[1]-i.coords[1],r[2]=e.coords[2]-i.coords[2],C[0]=I[1]*r[2]-I[2]*r[1],C[1]=I[2]*r[0]-I[0]*r[2],C[2]=I[0]*r[1]-I[1]*r[0],o=C[0]*C[0]+C[1]*C[1]+C[2]*C[2],o>g&&(g=o,A[0]=C[0],A[1]=C[1],A[2]=C[2]);g<=0&&(A[0]=A[1]=A[2]=0,A[this.longAxis_(I)]=1)},checkOrientation_:function(){var A,e,t=this.mesh.fHead,i,n=this.mesh.vHead,o;for(A=0,e=t.next;e!==t;e=e.next)if(o=e.anEdge,!(o.winding<=0))do A+=(o.Org.s-o.Dst.s)*(o.Org.t+o.Dst.t),o=o.Lnext;while(o!==e.anEdge);if(A<0){for(i=n.next;i!==n;i=i.next)i.t=-i.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},projectPolygon_:function(){var A,e=this.mesh.vHead,t=[0,0,0],i,n,o,g,a=!1;for(t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],t[0]===0&&t[1]===0&&t[2]===0&&(this.computeNormal_(t),a=!0),i=this.sUnit,n=this.tUnit,o=this.longAxis_(t),i[o]=0,i[(o+1)%3]=1,i[(o+2)%3]=0,n[o]=0,n[(o+1)%3]=0,n[(o+2)%3]=t[o]>0?1:-1,A=e.next;A!==e;A=A.next)A.s=this.dot_(A.coords,i),A.t=this.dot_(A.coords,n);for(a&&this.checkOrientation_(),g=!0,A=e.next;A!==e;A=A.next)g?(this.bmin[0]=this.bmax[0]=A.s,this.bmin[1]=this.bmax[1]=A.t,g=!1):(A.s<this.bmin[0]&&(this.bmin[0]=A.s),A.s>this.bmax[0]&&(this.bmax[0]=A.s),A.t<this.bmin[1]&&(this.bmin[1]=A.t),A.t>this.bmax[1]&&(this.bmax[1]=A.t))},addWinding_:function(A,e){A.winding+=e.winding,A.Sym.winding+=e.Sym.winding},tessellateMonoRegion_:function(A,e){var t,i;for(t=e.anEdge,De(t.Lnext!==t&&t.Lnext.Lnext!==t);KA.vertLeq(t.Dst,t.Org);t=t.Lprev);for(;KA.vertLeq(t.Org,t.Dst);t=t.Lnext);for(i=t.Lprev;t.Lnext!==i;)if(KA.vertLeq(t.Dst,i.Org)){for(;i.Lnext!==t&&(KA.edgeGoesLeft(i.Lnext)||KA.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);){var n=A.connect(i.Lnext,i);i=n.Sym}i=i.Lprev}else{for(;i.Lnext!=t&&(KA.edgeGoesRight(t.Lprev)||KA.edgeSign(t.Dst,t.Org,t.Lprev.Org)>=0);){var n=A.connect(t,t.Lprev);t=n.Sym}t=t.Lnext}for(De(i.Lnext!==t);i.Lnext.Lnext!==t;){var n=A.connect(i.Lnext,i);i=n.Sym}return!0},tessellateInterior_:function(A){var e,t;for(e=A.fHead.next;e!==A.fHead;e=t)if(t=e.next,e.inside&&!this.tessellateMonoRegion_(A,e))return!1;return!0},discardExterior_:function(A){var e,t;for(e=A.fHead.next;e!==A.fHead;e=t)t=e.next,e.inside||A.zapFace(e)},setWindingNumber_:function(A,e,t){var i,n;for(i=A.eHead.next;i!==A.eHead;i=n)n=i.next,i.Rface.inside!==i.Lface.inside?i.winding=i.Lface.inside?e:-e:t?A.delete(i):i.winding=0},getNeighbourFace_:function(A){return!A.Rface||!A.Rface.inside?-1:A.Rface.n},outputPolymesh_:function(A,e,t,i){var n,o,g,a=0,s=0,I,r;for(t>3&&A.mergeConvexFaces(t),n=A.vHead.next;n!==A.vHead;n=n.next)n.n=-1;for(o=A.fHead.next;o!=A.fHead;o=o.next)if(o.n=-1,!!o.inside){g=o.anEdge,I=0;do n=g.Org,n.n===-1&&(n.n=s,s++),I++,g=g.Lnext;while(g!==o.anEdge);De(I<=t),o.n=a,++a}for(this.elementCount=a,e==uo.CONNECTED_POLYGONS&&(a*=2),this.elements=[],this.elements.length=a*t,this.vertexCount=s,this.vertices=[],this.vertices.length=s*i,this.vertexIndices=[],this.vertexIndices.length=s,n=A.vHead.next;n!==A.vHead;n=n.next)if(n.n!=-1){var C=n.n*i;this.vertices[C+0]=n.coords[0],this.vertices[C+1]=n.coords[1],i>2&&(this.vertices[C+2]=n.coords[2]),this.vertexIndices[n.n]=n.idx}var l=0;for(o=A.fHead.next;o!==A.fHead;o=o.next)if(o.inside){g=o.anEdge,I=0;do n=g.Org,this.elements[l++]=n.n,I++,g=g.Lnext;while(g!==o.anEdge);for(r=I;r<t;++r)this.elements[l++]=-1;if(e==uo.CONNECTED_POLYGONS){g=o.anEdge;do this.elements[l++]=this.getNeighbourFace_(g),g=g.Lnext;while(g!==o.anEdge);for(r=I;r<t;++r)this.elements[l++]=-1}}},outputContours_:function(A,e){var t,i,n,o=0,g=0;for(this.vertexCount=0,this.elementCount=0,t=A.fHead.next;t!==A.fHead;t=t.next)if(t.inside){n=i=t.anEdge;do this.vertexCount++,i=i.Lnext;while(i!==n);this.elementCount++}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*e,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var a=0,s=0,I=0;for(o=0,t=A.fHead.next;t!==A.fHead;t=t.next)if(t.inside){g=0,n=i=t.anEdge;do this.vertices[a++]=i.Org.coords[0],this.vertices[a++]=i.Org.coords[1],e>2&&(this.vertices[a++]=i.Org.coords[2]),this.vertexIndices[s++]=i.Org.idx,g++,i=i.Lnext;while(i!==n);this.elements[I++]=o,this.elements[I++]=g,o+=g}},addContour:function(A,e){var t,i;for(this.mesh===null&&(this.mesh=new Jle),A<2&&(A=2),A>3&&(A=3),t=null,i=0;i<e.length;i+=A)t==null?(t=this.mesh.makeEdge(),this.mesh.splice(t,t.Sym)):(this.mesh.splitEdge(t),t=t.Lnext),t.Org.coords[0]=e[i+0],t.Org.coords[1]=e[i+1],A>2?t.Org.coords[2]=e[i+2]:t.Org.coords[2]=0,t.Org.idx=this.vertexIndexCounter++,t.winding=1,t.Sym.winding=-1},tesselate:function(A,e,t,i,n){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,n&&(this.normal[0]=n[0],this.normal[1]=n[1],this.normal[2]=n[2]),this.windingRule=A,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),GA.computeInterior(this);var o=this.mesh;return e==uo.BOUNDARY_CONTOURS?this.setWindingNumber_(o,1,!0):this.tessellateInterior_(o),o.check(),e==uo.BOUNDARY_CONTOURS?this.outputContours_(o,i):this.outputPolymesh_(o,e,t,i),!0}};var X$t=V$t,z$t=_$t,T$t=Object.prototype.hasOwnProperty;function _$t(){for(var A={},e=0;e<arguments.length;e++){var t=arguments[e];for(var i in t)T$t.call(t,i)&&(A[i]=t[i])}return A}var XmA=X$t,O$t=z$t,q$t=function(A,e){if(e=e||{},A=A.filter(function(r){return r.length>0}),A.length===0)return{positions:[],cells:[]};typeof e.vertexSize!="number"&&(e.vertexSize=A[0][0].length),A=A.map(function(r){return r.reduce(function(C,l){return C.concat(l)})});for(var t=XmA.tesselate(O$t({contours:A,windingRule:XmA.WINDING_ODD,elementType:XmA.POLYGONS,polySize:3,vertexSize:2},e)),i=[],n=0;n<t.vertices.length;n+=e.vertexSize){var o=t.vertices.slice(n,n+e.vertexSize);i.push(o)}var g=[];for(n=0;n<t.elements.length;n+=3){var a=t.elements[n],s=t.elements[n+1],I=t.elements[n+2];g.push([a,s,I])}return{positions:i,cells:g}};const j$t=xC(q$t);function EY(A,e,t){var i=e;if(A._pathCache[i])return A._pathCacheHit++,A._pathCache[i];if(A._pathCacheMiss++,t=t||1,!e)return{lines:[],triangles:[],closed:!1,z:0};var n=U$t(m$t(e)),o;n=n.map(function(d){return D$t(d,t)});try{o=j$t(n)}catch{o={positions:[],cells:[]}}for(var g=A._randomZ?.25*(Math.random()-.5):0,a=[],s=o.cells.length,I=o.cells,r=o.positions,C=0;C<s;C++){var l=I[C],c=r[l[0]],B=r[l[1]],E=r[l[2]];a.push(c[0],c[1],g,B[0],B[1],g,E[0],E[1],g)}var u={lines:n,triangles:a,closed:e.endsWith("Z"),z:g,key:i};return A._pathCache[i]=u,A._pathCacheSize++,A._pathCacheSize>1e4&&(A._pathCache={},A._pathCacheSize=0),u}function XH(A){return A.x||0}function zH(A){return A.y||0}function vle(A){return A.width||0}function P$t(A){return A.width||A.height||1}function Lle(A){return A.height||0}function $$t(A){return(A.x||0)+(A.width||0)}function AAi(A){return(A.y||0)+(A.height||0)}function zmA(A){return A.cornerRadius||0}function eAi(A){return A.padAngle||0}function Cj(A){return A.defined!==!1}function tAi(A){return A.size==null?64:A.size}function iAi(A){return brA(A.shape||"circle")}var Sle=UXA().cornerRadius(zmA).padAngle(eAi),nAi=Av().x(XH).y1(zH).y0(AAi).defined(Cj),oAi=Av().y(zH).x1(XH).x0($$t).defined(Cj),gAi=w5().x(XH).y(zH).defined(Cj),aAi=DrA().x(XH).y(zH).defined(Cj).size(P$t);H5().x(XH).y(zH).width(vle).height(Lle).cornerRadius(zmA);var sAi=H5().x(0).y(0).width(vle).height(Lle).cornerRadius(zmA);r9A().type(iAi).size(tAi);function rAi(A,e){return!A||A.arc?Sle.context(A)(e):EY(A,Sle.context(null)(e),.1)}function IAi(A,e){var t=e[0],i=t.interpolate||"linear",n=i==="trail"?aAi:(t.orient==="horizontal"?oAi:nAi).curve(ov(i,t.orient,t.tension));return!A||A.arc?n.context(A)(e):EY(A,n.context(null)(e),.1)}function CAi(A,e){var t=e.mark.shape||e.shape;return!A||A.arc?t.context(A)(e):EY(A,t.context(null)(e),.1)}function lAi(A,e){var t=e[0],i=t.interpolate||"linear",n=gAi.curve(ov(i,t.orient,t.tension));return!A||A.arc?n.context(A)(e):EY(A,n.context(null)(e))}function cAi(A,e,t,i){return EY(A,sAi.context(null)(e,t,i),.1)}function TH(A,e,t){var i=t.opacity==null?1:t.opacity,n=e._tx+e._origin[0],o=e._ty+e._origin[1];i<=0||A.numTriangles!==0&&(e.useProgram(e._shaderProgram),e.bindBuffer(e.ARRAY_BUFFER,A.triangleBuffer),e.vertexAttribPointer(e._coordLocation,3,e.FLOAT,!1,0,0),e.enableVertexAttribArray(e._coordLocation),e._lastTriangleBuffer=A.triangleBuffer,e.bindBuffer(e.ARRAY_BUFFER,A.colorBuffer),e.vertexAttribPointer(e._colorLocation,4,e.FLOAT,!1,0,0),e.enableVertexAttribArray(e._colorLocation),e._lastColorBuffer=A.colorBuffer,e.uniform2fv(e._offsetLocation,[n,o]),e.uniform4fv(e._clipLocation,e._clip),e.drawArrays(e.TRIANGLES,0,A.numTriangles*3))}function TmA(A,e,t){A.prototype=e.prototype=t,t.constructor=A}function Hle(A,e){var t=Object.create(A.prototype);for(var i in e)t[i]=e[i];return t}function _H(){}var OH=.7,lj=1/OH,uY="\\s*([+-]?\\d+)\\s*",qH="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",cE="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",BAi=/^#([0-9a-f]{3,8})$/,QAi=new RegExp("^rgb\\("+[uY,uY,uY]+"\\)$"),EAi=new RegExp("^rgb\\("+[cE,cE,cE]+"\\)$"),uAi=new RegExp("^rgba\\("+[uY,uY,uY,qH]+"\\)$"),dAi=new RegExp("^rgba\\("+[cE,cE,cE,qH]+"\\)$"),hAi=new RegExp("^hsl\\("+[qH,cE,cE]+"\\)$"),mAi=new RegExp("^hsla\\("+[qH,cE,cE,qH]+"\\)$"),Zle={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};TmA(_H,cj,{copy:function(A){return Object.assign(new this.constructor,this,A)},displayable:function(){return this.rgb().displayable()},hex:Wle,formatHex:Wle,formatHsl:pAi,formatRgb:Kle,toString:Kle});function Wle(){return this.rgb().formatHex()}function pAi(){return Tle(this).formatHsl()}function Kle(){return this.rgb().formatRgb()}function cj(A){var e,t;return A=(A+"").trim().toLowerCase(),(e=BAi.exec(A))?(t=e[1].length,e=parseInt(e[1],16),t===6?Ule(e):t===3?new _I(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Bj(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Bj(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=QAi.exec(A))?new _I(e[1],e[2],e[3],1):(e=EAi.exec(A))?new _I(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=uAi.exec(A))?Bj(e[1],e[2],e[3],e[4]):(e=dAi.exec(A))?Bj(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=hAi.exec(A))?zle(e[1],e[2]/100,e[3]/100,1):(e=mAi.exec(A))?zle(e[1],e[2]/100,e[3]/100,e[4]):Zle.hasOwnProperty(A)?Ule(Zle[A]):A==="transparent"?new _I(NaN,NaN,NaN,0):null}function Ule(A){return new _I(A>>16&255,A>>8&255,A&255,1)}function Bj(A,e,t,i){return i<=0&&(A=e=t=NaN),new _I(A,e,t,i)}function fAi(A){return A instanceof _H||(A=cj(A)),A?(A=A.rgb(),new _I(A.r,A.g,A.b,A.opacity)):new _I}function yAi(A,e,t,i){return arguments.length===1?fAi(A):new _I(A,e,t,i??1)}function _I(A,e,t,i){this.r=+A,this.g=+e,this.b=+t,this.opacity=+i}TmA(_I,yAi,Hle(_H,{brighter:function(A){return A=A==null?lj:Math.pow(lj,A),new _I(this.r*A,this.g*A,this.b*A,this.opacity)},darker:function(A){return A=A==null?OH:Math.pow(OH,A),new _I(this.r*A,this.g*A,this.b*A,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Vle,formatHex:Vle,formatRgb:Xle,toString:Xle}));function Vle(){return"#"+_mA(this.r)+_mA(this.g)+_mA(this.b)}function Xle(){var A=this.opacity;return A=isNaN(A)?1:Math.max(0,Math.min(1,A)),(A===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(A===1?")":", "+A+")")}function _mA(A){return A=Math.max(0,Math.min(255,Math.round(A)||0)),(A<16?"0":"")+A.toString(16)}function zle(A,e,t,i){return i<=0?A=e=t=NaN:t<=0||t>=1?A=e=NaN:e<=0&&(A=NaN),new BE(A,e,t,i)}function Tle(A){if(A instanceof BE)return new BE(A.h,A.s,A.l,A.opacity);if(A instanceof _H||(A=cj(A)),!A)return new BE;if(A instanceof BE)return A;A=A.rgb();var e=A.r/255,t=A.g/255,i=A.b/255,n=Math.min(e,t,i),o=Math.max(e,t,i),g=NaN,a=o-n,s=(o+n)/2;return a?(e===o?g=(t-i)/a+(t<i)*6:t===o?g=(i-e)/a+2:g=(e-t)/a+4,a/=s<.5?o+n:2-o-n,g*=60):a=s>0&&s<1?0:g,new BE(g,a,s,A.opacity)}function bAi(A,e,t,i){return arguments.length===1?Tle(A):new BE(A,e,t,i??1)}function BE(A,e,t,i){this.h=+A,this.s=+e,this.l=+t,this.opacity=+i}TmA(BE,bAi,Hle(_H,{brighter:function(A){return A=A==null?lj:Math.pow(lj,A),new BE(this.h,this.s,this.l*A,this.opacity)},darker:function(A){return A=A==null?OH:Math.pow(OH,A),new BE(this.h,this.s,this.l*A,this.opacity)},rgb:function(){var A=this.h%360+(this.h<0)*360,e=isNaN(A)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,n=2*t-i;return new _I(OmA(A>=240?A-240:A+120,n,i),OmA(A,n,i),OmA(A<120?A+240:A-120,n,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var A=this.opacity;return A=isNaN(A)?1:Math.max(0,Math.min(1,A)),(A===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(A===1?")":", "+A+")")}}));function OmA(A,e,t){return(A<60?e+(t-e)*A/60:A<180?t:A<240?e+(t-e)*(240-A)/60:e)*255}var Qj={};function Lw(A,e,t){if(!t)return[1,1,1];if(t.id)return[1,1,1];if(Qj[t])return Qj[t];var i=cj(t).rgb();return Qj[t]=[i.r/255,i.g/255,i.b/255],Qj[t]}var wAi=function(A,e){return typeof A=="number"?A:typeof e=="number"?e:0},DAi=GAi;function GAi(A,e){return A[0]=e[0],A[1]=e[1],A}var kAi=JAi;function JAi(A,e,t,i){return A[0]=e[0]+t[0]*i,A[1]=e[1]+t[1]*i,A}var _le=NAi;function NAi(A,e){return A[0]*e[0]+A[1]*e[1]}function YAi(A){return[A[0],A[1]]}function RAi(){return[0,0]}var xAi={create:RAi,clone:YAi,copy:DAi,scaleAndAdd:kAi,dot:_le},jH={},qmA,Ole;function FAi(){if(Ole)return qmA;Ole=1,qmA=A;function A(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}return qmA}var jmA,qle;function MAi(){if(qle)return jmA;qle=1,jmA=A;function A(e,t,i){return e[0]=t,e[1]=i,e}return jmA}var PmA,jle;function vAi(){if(jle)return PmA;jle=1,PmA=A;function A(e,t){var i=t[0],n=t[1],o=i*i+n*n;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o),e}return PmA}var $mA,Ple;function LAi(){if(Ple)return $mA;Ple=1,$mA=A;function A(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}return $mA}var $le;function SAi(){if($le)return jH;$le=1;var A=FAi(),e=MAi(),t=vAi(),i=LAi(),n=_le,o=[0,0];return jH.computeMiter=function(g,a,s,I,r){return A(g,s,I),t(g,g),e(a,-g[1],g[0]),e(o,-s[1],s[0]),r/n(a,o)},jH.normal=function(g,a){return e(g,-a[1],a[0]),g},jH.direction=function(g,a,s){return i(g,a,s),t(g,g),g},jH}var Ace=wAi,ho=xAi,OI=ho.create(),Ej=ho.create(),dY=ho.create(),ApA=ho.create(),ece=ho.create(),uj=ho.create(),epA=SAi(),HAi=epA.computeMiter,tpA=epA.normal,tce=epA.direction;function hY(A){if(!(this instanceof hY))return new hY(A);A=A||{},this.miterLimit=Ace(A.miterLimit,10),this.thickness=Ace(A.thickness,1),this.join=A.join||"miter",this.cap=A.cap||"butt",this._normal=null,this._lastFlip=-1,this._started=!1}hY.prototype.mapThickness=function(A,e,t){return this.thickness},hY.prototype.build=function(A){var e={positions:[],cells:[]};if(A.length<=1)return e;var t=A.length;this._lastFlip=-1,this._started=!1,this._normal=null;for(var i=1,n=0;i<t;i++){var o=A[i-1],g=A[i],a=i<A.length-1?A[i+1]:null,s=this.mapThickness(g,i,A),I=this._seg(e,n,o,g,a,s/2);n+=I}return e},hY.prototype._seg=function(A,e,t,i,n,o){var g=0,a=A.cells,s=A.positions,I=this.cap==="square",r=this.join==="bevel";if(tce(dY,i,t),this._normal||(this._normal=ho.create(),tpA(this._normal,dY)),this._started||(this._started=!0,I&&(ho.scaleAndAdd(Ej,t,dY,-o),t=Ej),ipA(s,t,this._normal,o)),a.push([e+0,e+1,e+2]),!n)tpA(this._normal,dY),I&&(ho.scaleAndAdd(Ej,i,dY,o),i=Ej),ipA(s,i,this._normal,o),a.push(this._lastFlip===1?[e,e+2,e+3]:[e+2,e+1,e+3]),g+=2;else{tce(ApA,n,i);var C=HAi(ece,uj,dY,ApA,o),l=ho.dot(ece,this._normal)<0?-1:1,c=r;if(!c&&this.join==="miter"){var B=C/o;B>this.miterLimit&&(c=!0)}c?(ho.scaleAndAdd(OI,i,this._normal,-o*l),s.push(ho.clone(OI)),ho.scaleAndAdd(OI,i,uj,C*l),s.push(ho.clone(OI)),a.push(this._lastFlip!==-l?[e,e+2,e+3]:[e+2,e+1,e+3]),a.push([e+2,e+3,e+4]),tpA(OI,ApA),ho.copy(this._normal,OI),ho.scaleAndAdd(OI,i,OI,-o*l),s.push(ho.clone(OI)),g+=3):(ipA(s,i,uj,C),a.push(this._lastFlip===1?[e,e+2,e+3]:[e+2,e+1,e+3]),l=-1,ho.copy(this._normal,uj),g+=2),this._lastFlip=l}return g};function ipA(A,e,t,i){ho.scaleAndAdd(OI,e,t,-i),A.push(ho.clone(OI)),ho.scaleAndAdd(OI,e,t,i),A.push(ho.clone(OI))}var ZAi=hY;const WAi=xC(ZAi);function PH(A,e,t){var i=(i=e.strokeWidth)!=null?i:1,n=(n=e.strokeCap)!=null?n:"butt",o=[],g,a,s,I,r,C,l=[],c=[],B,E,u,d,f,w,y,G,R,x=0,F=!1,Q=!1,k=e.opacity==null?1:e.opacity,h=k*(e.fillOpacity==null?1:e.fillOpacity),N=k*(e.strokeOpacity==null?1:e.strokeOpacity),v,K=t.z||0,U=t.triangles,V;if(e.fill==="transparent"&&(h=0),e.fill&&h>0&&(F=!0,x=U?U.length/9:0),e.stroke==="transparent"&&(N=0),i>0&&e.stroke&&N>0)for(Q=!0,v=WAi({thickness:i,cap:n,join:"miter",miterLimit:1,closed:!!t.closed}),I=0;I<t.lines.length;I++)C=v.build(t.lines[I]),o.push(C),x+=C.cells.length;if(l=new Float32Array(x*3*3),c=new Float32Array(x*3*4),F){for(s=Lw(A,e,e.fill),g=0,a=U.length;g<a;g+=3)l[g]=U[g],l[g+1]=U[g+1],l[g+2]=U[g+2];for(g=0,a=U.length/3;g<a;g++)c[g*4]=s[0],c[g*4+1]=s[1],c[g*4+2]=s[2],c[g*4+3]=h}if(Q)for(s=Lw(A,e,e.stroke),g=F?U.length/3:0,I=0;I<o.length;I++)for(C=o[I],f=C.positions,w=C.cells,y=C.cells.length,r=0;r<y;r++)B=w[r],E=f[B[0]],u=f[B[1]],d=f[B[2]],l[g*3]=E[0],l[g*3+1]=E[1],l[g*3+2]=K,c[g*4]=s[0],c[g*4+1]=s[1],c[g*4+2]=s[2],c[g*4+3]=N,g++,l[g*3]=u[0],l[g*3+1]=u[1],l[g*3+2]=K,c[g*4]=s[0],c[g*4+1]=s[1],c[g*4+2]=s[2],c[g*4+3]=N,g++,l[g*3]=d[0],l[g*3+1]=d[1],l[g*3+2]=K,c[g*4]=s[0],c[g*4+1]=s[1],c[g*4+2]=s[2],c[g*4+3]=N,g++;return G=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,G),A.bufferData(A.ARRAY_BUFFER,l,A.STATIC_DRAW),R=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,R),A.bufferData(A.ARRAY_BUFFER,c,A.STATIC_DRAW),V={triangleBuffer:G,colorBuffer:R,numTriangles:x},e._geom&&(e._geom.triangleBuffer&&A.deleteBuffer(e._geom.triangleBuffer),e._geom.colorBuffer&&A.deleteBuffer(e._geom.colorBuffer)),V}function ice(A,e){function t(i,n,o){qn(n,function(g){if(!(o&&!o.intersects(g.bounds))){var a=g.x||0,s=g.y||0,I;i._tx+=a,i._ty+=s,(i._fullRedraw||g._dirty||!g._geom||g._geom.deleted)&&(I=e(i,g),g._geom=PH(i,g,I)),TH(g._geom,i,g),i._tx-=a,i._ty-=s}})}return{type:A,drawGL:t}}const KAi=ice("arc",rAi);function nce(A,e){function t(i,n,o){if(n.items.length&&(!o||o.intersects(n.bounds))){for(var g=n.items[0],a=!1,s=0;s<n.items.length;s++)if(n.items[s]._dirty){a=!0;break}if(i._fullRedraw||a||!g._geom||g._geom.deleted){var I=e(i,n.items);g._geom=PH(i,g,I)}TH(g._geom,i,g)}}return{type:A,drawGL:t}}const UAi=nce("area",IAi);function VAi(A,e,t){var i=this;qn(e,function(n){var o=n.x||0,g=n.y||0,a=n.width||0,s=n.height||0,I,r;if(A._tx+=o,A._ty+=g,A._textContext.save(),A._textContext.translate(o,g),A._fullRedraw||n._dirty||!n._geom||n._geom.deleted){I=n.stroke?.5:0;var C=cAi(A,n,I,I);n._geom=PH(A,n,C)}TH(n._geom,A,n),n.clip&&(r=A._clip,A._clip=[A._origin[0]+A._tx,A._origin[1]+A._ty,A._origin[0]+A._tx+a,A._origin[1]+A._ty+s]),t&&t.translate(-o,-g),qn(n,function(l){i.draw(A,l,t)}),t&&t.translate(o,g),n.clip&&(A._clip=r),A._tx-=o,A._ty-=g,A._textContext.restore()})}const XAi={type:"group",drawGL:VAi};function J0(A,e){for(var t=[0,0,4,1,8,2,12,3,1,0,5,1,9,2,13,3,2,0,6,1,10,2,14,3,3,0,7,1,11,2,15,3,0,4,4,5,8,6,12,7,1,4,5,5,9,6,13,7,2,4,6,5,10,6,14,7,3,4,7,5,11,6,15,7,0,8,4,9,8,10,12,11,1,8,5,9,9,10,13,11,2,8,6,9,10,10,14,11,3,8,7,9,11,10,15,11,0,12,4,13,8,14,12,15,1,12,5,13,9,14,13,15,2,12,6,13,10,14,14,15,3,12,7,13,11,14,15,15],i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<t.length/2;n++)i[Math.floor(n/4)]+=A[t[2*n]]*e[t[2*n+1]];return i}function zAi(A,e,t,i){var n=Math.tan(Math.PI*.5-.5*A),o=1/(t-i);return[n/e,0,0,0,0,n,0,0,0,0,(t+i)*o,-1,0,0,t*i*o*2,0]}function TAi(A){return[1,0,0,0,0,Math.cos(A),Math.sin(A),0,0,-Math.sin(A),Math.cos(A),0,0,0,0,1]}function _Ai(A){return[Math.cos(A),0,-Math.sin(A),0,0,1,0,0,Math.sin(A),0,Math.cos(A),0,0,0,0,1]}function OAi(A){return[Math.cos(A),Math.sin(A),0,0,-Math.sin(A),Math.cos(A),0,0,0,0,1,0,0,0,0,1]}function oce(A,e,t){return[1,0,0,0,0,1,0,0,0,0,1,0,A,e,t,1]}function gce(A,e){var t=A.createTexture();A.bindTexture(A.TEXTURE_2D,t),A.texImage2D(A.TEXTURE_2D,0,A.RGBA,1,1,0,A.RGBA,A.UNSIGNED_BYTE,new Uint8Array([0,0,255,255])),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,A.LINEAR);var i={texture:t};return i.width=e.width,i.height=e.height,A.bindTexture(A.TEXTURE_2D,i.texture),A.texImage2D(A.TEXTURE_2D,0,A.RGBA,A.RGBA,A.UNSIGNED_BYTE,e),i}function qAi(A,e,t){A.bindTexture(A.TEXTURE_2D,e.texture),A.useProgram(A._imageShaderProgram),A.bindBuffer(A.ARRAY_BUFFER,A._imagePositionBuffer),A.enableVertexAttribArray(A._imagePositionLocation),A.vertexAttribPointer(A._imagePositionLocation,2,A.FLOAT,!1,0,0),A.bindBuffer(A.ARRAY_BUFFER,A._imageTexcoordBuffer),A.enableVertexAttribArray(A._imageTexcoordLocation),A.vertexAttribPointer(A._imageTexcoordLocation,2,A.FLOAT,!1,0,0);var i=[e.w,0,0,0,0,e.h,0,0,0,0,1,0,e.x,e.y,0,1];t=J0(t,i),A.uniformMatrix4fv(A._imageMatrixLocation,!1,t),A.uniform1i(A._imageTextureLocation,0),A.drawArrays(A.TRIANGLES,0,6)}function jAi(A,e){var t=A.image;return(!t||t.url!==A.url)&&(t={loaded:!1,width:0,height:0},e.loadImage(A.url).then(function(i){A.image=i,A.image.url=A.url})),t}function PAi(A,e){return A==="center"?e/2:A==="right"?e:0}function $Ai(A,e){return A==="middle"?e/2:A==="bottom"?e:0}function Aei(A,e,t){var i=this;qn(e,function(n){if(!(t&&!t.intersects(n.bounds))){var o=jAi(n,i),g=n.x||0,a=n.y||0,s=n.width||o.width||0,I=n.height||o.height||0;if(g-=PAi(n.align,s),a-=$Ai(n.baseline,I),o.loaded){var r=gce(A,o);r.x=g+A._tx+A._origin[0],r.y=a+A._ty+A._origin[1],r.w=s,r.h=I,A._images.push(r)}}})}const eei={type:"image",drawGL:Aei},tei=nce("line",lAi);function iei(A,e){qn(e,function(t){var i=t.path;if(i==null)return!0;var n=t.x||0,o=t.y||0;if(A._tx+=n,A._ty+=o,A._fullRedraw||t._dirty||!t._geom||t._geom.deleted){var g=EY(A,i);t._geom=PH(A,t,g)}TH(t._geom,A,t),A._tx-=n,A._ty-=o})}const nei={type:"path",drawGL:iei};function oei(A,e,t){var i,n,o,g,a,s,I,r,C,l,c,B,E,u,d,f,w,y,G=0,R=0,x=0,F=e.items.length,Q,k,h=!1,N,v=e._rectGeom;for(k=0;k<e.items.length;++k)if(N=e.items[k],N.stroke&&N.stroke.id||N.fill&&N.fill.id){h=!0;break}if(h){va.rect.draw(A._textContext,e,t);return}if(v&&v.numPts===F)i=v.unit,l=v.unitBuffer,n=v.pos,o=v.size,g=v.strokeWidth,a=v.strokeOpacity,s=v.strokeColor,I=v.fillOpacity,r=v.fillColor,C=v.cornerRadius;else for(v&&A.deleteBuffer(v.unitBuffer),i=new Float32Array(6*F*2),n=new Float32Array(6*F*3),o=new Float32Array(6*F*2),g=new Float32Array(6*F),a=new Float32Array(6*F),s=new Float32Array(6*F*3),I=new Float32Array(6*F),r=new Float32Array(6*F*3),C=new Float32Array(6*F),Q=[0,1,1,1,1,0,1,0,0,0,0,1],k=0;k<F*Q.length;k+=1)i[k]=Q[k%Q.length];v&&(A.deleteBuffer(v.posBuffer),A.deleteBuffer(v.sizeBuffer),A.deleteBuffer(v.strokeWidthBuffer),A.deleteBuffer(v.strokeOpacityBuffer),A.deleteBuffer(v.strokeColorBuffer),A.deleteBuffer(v.fillOpacityBuffer),A.deleteBuffer(v.fillColorBuffer),A.deleteBuffer(v.cornerRadiusBuffer)),qn(e,function(K){var U=(K.x||0)+A._tx+A._origin[0],V=(K.y||0)+A._ty+A._origin[1],X=Lw(A,K,K.fill),_=Lw(A,K,K.stroke),q=K.opacity==null?1:K.opacity,$=q*(K.fill==null||K.fill=="transparent"?0:1)*(K.fillOpacity==null?1:K.fillOpacity),nA=q*(K.stroke==null||K.stroke=="transparent"?0:1)*(K.strokeOpacity==null?1:K.strokeOpacity),j=(K.stroke==null||K.stroke=="transparent"?0:1)*(K.strokeWidth==null?1:K.strokeWidth),O=K.width==null?0:K.width,eA=K.height==null?0:K.height,oA=K.cornerRadius==null?0:K.cornerRadius;for(k=0;k<6;k+=1,G+=1,R+=2,x+=3)n[x]=U,n[x+1]=V,n[x+2]=0,o[R]=O,o[R+1]=eA,g[G]=j,a[G]=nA,s[x]=_[0],s[x+1]=_[1],s[x+2]=_[2],I[G]=$,r[x]=X[0],r[x+1]=X[1],r[x+2]=X[2],C[G]=oA}),A.useProgram(A._rectShaderProgram),l?(A.bindBuffer(A.ARRAY_BUFFER,l),A.vertexAttribPointer(A._rectUnitLocation,2,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._rectUnitLocation)):(l=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,l),A.bufferData(A.ARRAY_BUFFER,i,A.STATIC_DRAW),A.vertexAttribPointer(A._rectUnitLocation,2,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._rectUnitLocation)),c=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,c),A.bufferData(A.ARRAY_BUFFER,n,A.STATIC_DRAW),A.vertexAttribPointer(A._rectPosLocation,3,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._rectPosLocation),B=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,B),A.bufferData(A.ARRAY_BUFFER,o,A.STATIC_DRAW),A.vertexAttribPointer(A._rectSizeLocation,2,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._rectSizeLocation),E=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,E),A.bufferData(A.ARRAY_BUFFER,g,A.STATIC_DRAW),A.vertexAttribPointer(A._rectStrokeWidthLocation,1,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._rectStrokeWidthLocation),u=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,u),A.bufferData(A.ARRAY_BUFFER,a,A.STATIC_DRAW),A.vertexAttribPointer(A._rectStrokeOpacityLocation,1,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._rectStrokeOpacityLocation),d=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,d),A.bufferData(A.ARRAY_BUFFER,s,A.STATIC_DRAW),A.vertexAttribPointer(A._rectStrokeColorLocation,3,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._rectStrokeColorLocation),f=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,f),A.bufferData(A.ARRAY_BUFFER,I,A.STATIC_DRAW),A.vertexAttribPointer(A._rectFillOpacityLocation,1,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._rectFillOpacityLocation),w=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,w),A.bufferData(A.ARRAY_BUFFER,r,A.STATIC_DRAW),A.vertexAttribPointer(A._rectFillColorLocation,3,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._rectFillColorLocation),y=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,y),A.bufferData(A.ARRAY_BUFFER,C,A.STATIC_DRAW),A.vertexAttribPointer(A._rectCornerRadiusLocation,1,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._rectCornerRadiusLocation),A.uniformMatrix4fv(A._rectMatrixLocation,!1,A._matrix),A.uniform4fv(A._rectClipLocation,A._clip),A.drawArrays(A.TRIANGLES,0,F*6),e._rectGeom={numPts:F,unit:i,pos:n,size:o,strokeWidth:g,strokeOpacity:a,strokeColor:s,fillOpacity:I,fillColor:r,cornerRadius:C,unitBuffer:l,posBuffer:c,sizeBuffer:B,strokeWidthBuffer:E,strokeOpacityBuffer:u,strokeColorBuffer:d,fillOpacityBuffer:f,fillColorBuffer:w,cornerRadiusBuffer:y}}const gei={type:"rect",drawGL:oei};function aei(A,e,t){qn(e,function(i){var n,o,g,a,s;t&&!t.intersects(i.bounds)||((A._fullRedraw||i._dirty||!i._geom||i._geom.deleted)&&(n=i.x||0,o=i.y||0,g=i.x2!=null?i.x2:n,a=i.y2!=null?i.y2:o,s={lines:[[[n,o],[g,a]]],closed:!1},s.key=JSON.stringify(s.lines),i._geom=PH(A,i,s)),TH(i._geom,A,i))})}const sei={type:"rule",drawGL:aei},rei=ice("shape",CAi);function Iei(A,e){var t,i,n,o,g,a,s,I,r,C,l,c,B,E,u,d,f,w,y=0,G=0,R=e.items.length,x=0,F=0,Q=1,k=1,h,N,v=e._symbolGeom,K;if(R!==0){if(K={circle:0,cross:1,diamond:2,square:3,star:4,triangle:5,"triangle-up":5,"triangle-right":6,"triangle-down":7,"triangle-left":8,wye:9},v&&v.numPts===R)t=v.unit,C=v.unitBuffer,i=v.pos,n=v.size,o=v.shape,g=v.strokeWidth,a=v.strokeOpacity,s=v.strokeColor,I=v.fillOpacity,r=v.fillColor;else for(v&&A.deleteBuffer(v.unitBuffer),t=new Float32Array(3*R*2),i=new Float32Array(3*R*3),n=new Float32Array(3*R),o=new Float32Array(3*R),g=new Float32Array(3*R),a=new Float32Array(3*R),s=new Float32Array(3*R*3),I=new Float32Array(3*R),r=new Float32Array(3*R*3),N=[x,F-k*2,x-Q*Math.sqrt(3),F+k,x+Q*Math.sqrt(3),F+k],h=0;h<R*N.length;h+=1)t[h]=N[h%N.length];v&&(A.deleteBuffer(v.posBuffer),A.deleteBuffer(v.sizeBuffer),A.deleteBuffer(v.shapeBuffer),A.deleteBuffer(v.strokeWidthBuffer),A.deleteBuffer(v.strokeOpacityBuffer),A.deleteBuffer(v.strokeColorBuffer),A.deleteBuffer(v.fillOpacityBuffer),A.deleteBuffer(v.fillColorBuffer)),qn(e,function(U){var V=(U.x||0)+A._tx+A._origin[0],X=(U.y||0)+A._ty+A._origin[1],_=Lw(A,U,U.fill),q=Lw(A,U,U.stroke),$=U.opacity==null?1:U.opacity,nA=$*(U.fill==null||U.fill=="transparent"?0:1)*(U.fillOpacity==null?1:U.fillOpacity),j=$*(U.stroke==null||U.stroke=="transparent"?0:1)*(U.strokeOpacity==null?1:U.strokeOpacity),O=(U.stroke==null||U.stroke=="transparent"?0:1)*(U.strokeWidth==null?1:U.strokeWidth),eA=U.size==null?64:U.size,oA=K[U.shape]==null?0:K[U.shape];for(h=0;h<3;h+=1,y+=1,G+=3)i[G]=V,i[G+1]=X,i[G+2]=0,n[y]=eA,g[y]=O,o[y]=oA,a[y]=j,s[G]=q[0],s[G+1]=q[1],s[G+2]=q[2],I[y]=nA,r[G]=_[0],r[G+1]=_[1],r[G+2]=_[2]}),A.useProgram(A._symbolShaderProgram),C?(A.bindBuffer(A.ARRAY_BUFFER,C),A.vertexAttribPointer(A._symbolUnitLocation,2,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._symbolUnitLocation)):(C=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,C),A.bufferData(A.ARRAY_BUFFER,t,A.STATIC_DRAW),A.vertexAttribPointer(A._symbolUnitLocation,2,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._symbolUnitLocation)),l=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,l),A.bufferData(A.ARRAY_BUFFER,i,A.STATIC_DRAW),A.vertexAttribPointer(A._symbolPosLocation,3,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._symbolPosLocation),c=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,c),A.bufferData(A.ARRAY_BUFFER,n,A.STATIC_DRAW),A.vertexAttribPointer(A._symbolSizeLocation,1,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._symbolSizeLocation),B=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,B),A.bufferData(A.ARRAY_BUFFER,o,A.STATIC_DRAW),A.vertexAttribPointer(A._symbolShapeLocation,1,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._symbolShapeLocation),E=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,E),A.bufferData(A.ARRAY_BUFFER,g,A.STATIC_DRAW),A.vertexAttribPointer(A._symbolStrokeWidthLocation,1,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._symbolStrokeWidthLocation),u=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,u),A.bufferData(A.ARRAY_BUFFER,a,A.STATIC_DRAW),A.vertexAttribPointer(A._symbolStrokeOpacityLocation,1,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._symbolStrokeOpacityLocation),d=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,d),A.bufferData(A.ARRAY_BUFFER,s,A.STATIC_DRAW),A.vertexAttribPointer(A._symbolStrokeColorLocation,3,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._symbolStrokeColorLocation),f=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,f),A.bufferData(A.ARRAY_BUFFER,I,A.STATIC_DRAW),A.vertexAttribPointer(A._symbolFillOpacityLocation,1,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._symbolFillOpacityLocation),w=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,w),A.bufferData(A.ARRAY_BUFFER,r,A.STATIC_DRAW),A.vertexAttribPointer(A._symbolFillColorLocation,3,A.FLOAT,!1,0,0),A.enableVertexAttribArray(A._symbolFillColorLocation),A.uniformMatrix4fv(A._symbolMatrixLocation,!1,A._matrix),A.uniform4fv(A._symbolClipLocation,A._clip),A.drawArrays(A.TRIANGLES,0,R*3),e._symbolGeom={numPts:R,unit:t,pos:i,size:n,shape:o,strokeWidth:g,strokeOpacity:a,strokeColor:s,fillOpacity:I,fillColor:r,unitBuffer:C,posBuffer:l,sizeBuffer:c,shapeBuffer:B,strokeWidthBuffer:E,strokeOpacityBuffer:u,strokeColorBuffer:d,fillOpacityBuffer:f,fillColorBuffer:w}}}const Cei={type:"symbol",drawGL:Iei};function lei(A,e,t){va.text.draw(A._textContext,e,t)}const cei={type:"text",drawGL:lei},Bei={arc:KAi,area:UAi,group:XAi,image:eei,line:tei,path:nei,rect:gei,rule:sei,shape:rei,symbol:Cei,text:cei};function Qei(A,e){var t=A.prototype=Object.create(e.prototype);return t.constructor=A,t}function Eei(A,e){var t=document.createElement("canvas");t.width=A,t.height=e;var i=t.getContext("webgl")||t.getContext("experimental-webgl");i._pathCache={},i._pathCacheSize=0,i._itemCache={},i._itemCacheSize=0,i._shapeCache={},i._shapeCacheSize=0,i._textCanvas=document.createElement("canvas"),i._textCanvas.width=A,i._textCanvas.height=e,i._textContext=i._textCanvas.getContext("2d"),t._textCanvas=i._textCanvas,i.clearColor(1,1,1,1),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.enable(i.BLEND),i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);var n="attribute vec3 coordinates;attribute vec4 color;uniform mat4 matrix;uniform float zFactor;uniform vec2 offset;varying vec4 vColor;varying vec4 vPosition;void main(void) {  vPosition = vec4(coordinates.x + offset.x, coordinates.y + offset.y, coordinates.z*zFactor - 1.0, 1.0);  gl_Position = matrix * vPosition;  vColor = color;}",o=i.createShader(i.VERTEX_SHADER);if(i.shaderSource(o,n),i.compileShader(o),!i.getShaderParameter(o,i.COMPILE_STATUS))throw i.getShaderInfoLog(o);var g="precision mediump float;varying vec4 vColor;varying vec4 vPosition;uniform vec4 clip;void main(void) {  if (vPosition.x < clip[0] || vPosition.x > clip[2] || vPosition.y < clip[1] || vPosition.y > clip[3]) {    discard;  }  gl_FragColor = vColor;}",a=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(a,g),i.compileShader(a),!i.getShaderParameter(a,i.COMPILE_STATUS))throw i.getShaderInfoLog(a);var s=i.createProgram();if(i.attachShader(s,o),i.attachShader(s,a),i.linkProgram(s),i.useProgram(s),i._shaderProgram=s,i._coordLocation=i.getAttribLocation(i._shaderProgram,"coordinates"),i._colorLocation=i.getAttribLocation(i._shaderProgram,"color"),i._matrixLocation=i.getUniformLocation(i._shaderProgram,"matrix"),i._zFactorLocation=i.getUniformLocation(i._shaderProgram,"zFactor"),i._offsetLocation=i.getUniformLocation(i._shaderProgram,"offset"),i._clipLocation=i.getUniformLocation(i._shaderProgram,"clip"),n="attribute vec2 a_position;attribute vec2 a_texcoord;uniform mat4 u_matrix;varying vec2 v_texcoord;void main() {  gl_Position = u_matrix * vec4(a_position, -1.0, 1.0);  v_texcoord = a_texcoord;}",o=i.createShader(i.VERTEX_SHADER),i.shaderSource(o,n),i.compileShader(o),!i.getShaderParameter(o,i.COMPILE_STATUS))throw i.getShaderInfoLog(o);if(g="precision mediump float;varying vec2 v_texcoord;uniform sampler2D u_texture;void main() {  gl_FragColor = texture2D(u_texture, v_texcoord);}",a=i.createShader(i.FRAGMENT_SHADER),i.shaderSource(a,g),i.compileShader(a),!i.getShaderParameter(a,i.COMPILE_STATUS))throw i.getShaderInfoLog(a);s=i.createProgram(),i.attachShader(s,o),i.attachShader(s,a),i.linkProgram(s);var I=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,I);var r=[0,0,0,1,1,0,1,0,0,1,1,1];i.bufferData(i.ARRAY_BUFFER,new Float32Array(r),i.STATIC_DRAW);var C=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,C);var l=[0,0,0,1,1,0,1,0,0,1,1,1];if(i.bufferData(i.ARRAY_BUFFER,new Float32Array(l),i.STATIC_DRAW),i._imageShaderProgram=s,i._imagePositionLocation=i.getAttribLocation(i._imageShaderProgram,"a_position"),i._imageTexcoordLocation=i.getAttribLocation(i._imageShaderProgram,"a_texcoord"),i._imageMatrixLocation=i.getUniformLocation(i._imageShaderProgram,"u_matrix"),i._imageTextureLocation=i.getUniformLocation(i._imageShaderProgram,"u_texture"),i._imagePositionBuffer=I,i._imageTexcoordBuffer=C,n=["attribute vec3 pos;","attribute vec3 fillColor;","attribute vec3 strokeColor;","attribute float fillOpacity;","attribute float strokeWidth;","attribute float size;","attribute float shape;","attribute float strokeOpacity;","attribute vec2 unit;","uniform mat4 matrix;","varying vec4 positionVar;","varying vec4 fillColorVar;","varying vec4 strokeColorVar;","varying float sizeVar;","varying float shapeVar;","varying float strokeWidthVar;","varying vec2 unitVar;","void main(void)","{","  strokeWidthVar = strokeWidth;","  fillColorVar = vec4(fillColor, fillOpacity);","  strokeColorVar = vec4(strokeColor, strokeOpacity);","  if (shape == 0.0) {","    sizeVar = sqrt(size) / 2.0;","  }","  if (shape == 1.0) {","    sizeVar = sqrt(size) / 2.0;","  }","  if (shape == 2.0) {","    sizeVar = sqrt(size) / 2.0;","  }","  if (shape == 3.0) {","    sizeVar = sqrt(2.0) * sqrt(size) / 2.0;","  }","  if (shape == 4.0) {","    sizeVar = sqrt(size) / 2.0;","  }","  if (shape == 5.0) {","    sizeVar = (sqrt(6.0)/2.0) * sqrt(size) / 2.0;","  }","  if (shape == 6.0) {","    sizeVar = (sqrt(6.0)/2.0) * sqrt(size) / 2.0;","  }","  if (shape == 7.0) {","    sizeVar = (sqrt(6.0)/2.0) * sqrt(size) / 2.0;","  }","  if (shape == 8.0) {","    sizeVar = (sqrt(6.0)/2.0) * sqrt(size) / 2.0;","  }","  if (shape == 9.0) {","    sizeVar = sqrt(size) / 2.0;","  }","  shapeVar = shape;","  float factor = (sizeVar + strokeWidth / 2.0 + 1.0) / sizeVar;","  unitVar = factor * unit;","  positionVar = vec4(pos.xy + factor * sizeVar * unit, -1.0, 1.0);","  gl_Position = matrix * positionVar;","}"].join(`
`),o=i.createShader(i.VERTEX_SHADER),i.shaderSource(o,n),i.compileShader(o),!i.getShaderParameter(o,i.COMPILE_STATUS))throw i.getShaderInfoLog(o);if(g=["precision mediump float;","const float PI = 3.1415926535897932384626433832795;","varying vec4 positionVar;","varying vec4 fillColorVar;","varying vec4 strokeColorVar;","varying vec2 unitVar;","varying float sizeVar;","varying float shapeVar;","varying float strokeWidthVar;","uniform vec4 clip;","float distToLine(vec2 pt1, vec2 pt2, vec2 testPt)","{","  vec2 lineDir = pt2 - pt1;","  vec2 perpDir = vec2(lineDir.y, -lineDir.x);","  vec2 dirToPt1 = pt1 - testPt;","  return dot(normalize(perpDir), dirToPt1);","}","float distToAngle(vec2 apex, vec2 left, vec2 right, vec2 testPt)","{","  float dist = distToLine(apex, left, testPt);","  dist = min(dist, distToLine(right, apex, testPt));","  float cut = distToLine(left, right, testPt);","  if (cut < 0.0) return -1.0;","  return dist;","}","float distToHull(vec2 p1, vec2 p2, vec2 p3, vec2 p4, vec2 testPt)","{","  float dist = distToLine(p1, p2, testPt);","  dist = min(dist, distToLine(p2, p3, testPt));","  dist = min(dist, distToLine(p4, p1, testPt));","  float cut = distToLine(p3, p4, testPt);","  if (cut < 0.0) return -1.0;","  return dist;","}","vec2 rotate(vec2 pt, float a)","{","  return vec2(cos(a)*pt.x - sin(a)*pt.y, sin(a)*pt.x + cos(a)*pt.y);","}","void main () {","  if (positionVar.x < clip[0] || positionVar.x > clip[2] || positionVar.y < clip[1] || positionVar.y > clip[3]) {","    discard;","  }","  float dist;","  float d1;","  float d2;","  if (shapeVar == 0.0) {","    dist = length(unitVar);","  }","  if (shapeVar == 1.0) {","    float inset = 1.0 / 2.5;","    d1 = distToLine(vec2(-inset, -1.0), vec2(inset, -1.0), unitVar);","    d1 = min(d1, distToLine(vec2(inset, -1.0), vec2(inset, 1.0), unitVar));","    d1 = min(d1, distToLine(vec2(inset, 1.0), vec2(-inset, 1.0), unitVar));","    d1 = min(d1, distToLine(vec2(-inset, 1.0), vec2(-inset, -1.0), unitVar));","    d1 = 1.0 - d1;","    d2 = distToLine(vec2(1.0, -inset), vec2(1.0, inset), unitVar);","    d2 = min(d2, distToLine(vec2(1.0, inset), vec2(-1.0, inset), unitVar));","    d2 = min(d2, distToLine(vec2(-1.0, inset), vec2(-1.0, -inset), unitVar));","    d2 = min(d2, distToLine(vec2(-1.0, -inset), vec2(1.0, -inset), unitVar));","    d2 = 1.0 - d2;","    dist = min(d1, d2);","  }","  if (shapeVar == 2.0) {","    dist = distToLine(vec2(0.0, -1.0), vec2(1.0, 0.0), unitVar);","    dist = min(dist, distToLine(vec2(1.0, 0.0), vec2(0.0, 1.0), unitVar));","    dist = min(dist, distToLine(vec2(0.0, 1.0), vec2(-1.0, 0.0), unitVar));","    dist = min(dist, distToLine(vec2(-1.0, 0.0), vec2(0.0, -1.0), unitVar));","    dist = 1.0 - dist;","  }","  if (shapeVar == 3.0) {","    float side = sqrt(2.0)/2.0;","    dist = distToLine(vec2(-side, -side), vec2(side, -side), unitVar);","    dist = min(dist, distToLine(vec2(side, -side), vec2(side, side), unitVar));","    dist = min(dist, distToLine(vec2(side, side), vec2(-side, side), unitVar));","    dist = min(dist, distToLine(vec2(-side, side), vec2(-side, -side), unitVar));","    dist = 1.0 - dist;","  }","  if (shapeVar == 4.0) {","    float h = 1.0;","    float x = h * tan(PI/10.0);","    vec2 p1 = vec2(0.0, -h);","    vec2 p2 = vec2(x, 0);","    vec2 p3 = vec2(-x, 0);","    float angle = 0.0;","    dist = 1.0 - distToAngle(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), unitVar);","    angle = angle + 2.0*PI/5.0;","    dist = min(dist, 1.0 - distToAngle(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), unitVar));","    angle = angle + 2.0*PI/5.0;","    dist = min(dist, 1.0 - distToAngle(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), unitVar));","    angle = angle + 2.0*PI/5.0;","    dist = min(dist, 1.0 - distToAngle(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), unitVar));","    angle = angle + 2.0*PI/5.0;","    dist = min(dist, 1.0 - distToAngle(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), unitVar));","  }","  if (shapeVar == 5.0) {","    vec2 p1 = vec2(0.0, -sqrt(2.0)/2.0);","    vec2 p2 = vec2(sqrt(6.0)/3.0, sqrt(2.0)/2.0);","    vec2 p3 = vec2(-sqrt(6.0)/3.0, sqrt(2.0)/2.0);","    dist = distToLine(p1, p2, unitVar);","    dist = min(dist, distToLine(p2, p3, unitVar));","    dist = min(dist, distToLine(p3, p1, unitVar));","    dist = 1.0 - dist;","  }","  if (shapeVar == 6.0) {","    vec2 p1 = vec2(sqrt(2.0)/2.0, 0.0);","    vec2 p2 = vec2(-sqrt(2.0)/2.0, sqrt(6.0)/3.0);","    vec2 p3 = vec2(-sqrt(2.0)/2.0, -sqrt(6.0)/3.0);","    dist = distToLine(p1, p2, unitVar);","    dist = min(dist, distToLine(p2, p3, unitVar));","    dist = min(dist, distToLine(p3, p1, unitVar));","    dist = 1.0 - dist;","  }","  if (shapeVar == 7.0) {","    vec2 p1 = vec2(0.0, sqrt(2.0)/2.0);","    vec2 p2 = vec2(-sqrt(6.0)/3.0, -sqrt(2.0)/2.0);","    vec2 p3 = vec2(sqrt(6.0)/3.0, -sqrt(2.0)/2.0);","    dist = distToLine(p1, p2, unitVar);","    dist = min(dist, distToLine(p2, p3, unitVar));","    dist = min(dist, distToLine(p3, p1, unitVar));","    dist = 1.0 - dist;","  }","  if (shapeVar == 8.0) {","    vec2 p1 = vec2(-sqrt(2.0)/2.0, 0.0);","    vec2 p2 = vec2(sqrt(2.0)/2.0, -sqrt(6.0)/3.0);","    vec2 p3 = vec2(sqrt(2.0)/2.0, sqrt(6.0)/3.0);","    dist = distToLine(p1, p2, unitVar);","    dist = min(dist, distToLine(p2, p3, unitVar));","    dist = min(dist, distToLine(p3, p1, unitVar));","    dist = 1.0 - dist;","  }","  if (shapeVar == 9.0) {","    float h = 12.0 / (12.0 + sqrt(12.0));","    float y = h / sqrt(12.0) + h;","    vec2 p1 = vec2(h / 2.0, y);","    vec2 p2 = vec2(-h / 2.0, y);","    vec2 p3 = vec2(-h / 2.0, 0.0);","    vec2 p4 = vec2(h / 2.0, 0.0);","    float angle = 0.0;","    dist = 1.0 - distToHull(p1, p2, p3, p4, unitVar);","    angle = angle + 2.0*PI/3.0;","    dist = min(dist, 1.0 - distToHull(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), rotate(p4, angle), unitVar));","    angle = angle + 2.0*PI/3.0;","    dist = min(dist, 1.0 - distToHull(rotate(p1, angle), rotate(p2, angle), rotate(p3, angle), rotate(p4, angle), unitVar));","  }","  float endStep = 1.0;","  float antialiasDist = 1.0 / sizeVar / 2.0;","  float widthDist = strokeWidthVar / sizeVar / 2.0;","  vec4 c1;","  vec4 c2;","  float step;","  if (dist < endStep) {","    step = smoothstep(endStep - widthDist - antialiasDist, endStep - widthDist + antialiasDist, dist);","    if (fillColorVar.a > 0.0) {","      c1 = fillColorVar;","    } else {","      c1 = vec4(strokeColorVar.rgb, 0.0);","    }","    if (strokeColorVar.a > 0.0) {","      c2 = strokeColorVar;","    } else {","      c2 = vec4(fillColorVar.rgb, 0.0);","    }","  } else {","    step = smoothstep(endStep + widthDist - antialiasDist, endStep + widthDist + antialiasDist, dist);","    if (strokeColorVar.a > 0.0) {","      c1 = strokeColorVar;","      c2 = vec4(strokeColorVar.rgb, 0.0);","    } else {","      c1 = vec4(fillColorVar.rgb, 0.0);","      c2 = vec4(fillColorVar.rgb, 0.0);","    }","  }","  gl_FragColor = mix(c1, c2, step);","}"].join(`
`),a=i.createShader(i.FRAGMENT_SHADER),i.shaderSource(a,g),i.compileShader(a),!i.getShaderParameter(a,i.COMPILE_STATUS))throw i.getShaderInfoLog(a);if(s=i.createProgram(),i.attachShader(s,o),i.attachShader(s,a),i.linkProgram(s),i._symbolShaderProgram=s,i._symbolPosLocation=i.getAttribLocation(s,"pos"),i._symbolFillColorLocation=i.getAttribLocation(s,"fillColor"),i._symbolStrokeColorLocation=i.getAttribLocation(s,"strokeColor"),i._symbolFillOpacityLocation=i.getAttribLocation(s,"fillOpacity"),i._symbolStrokeWidthLocation=i.getAttribLocation(s,"strokeWidth"),i._symbolSizeLocation=i.getAttribLocation(s,"size"),i._symbolShapeLocation=i.getAttribLocation(s,"shape"),i._symbolStrokeOpacityLocation=i.getAttribLocation(s,"strokeOpacity"),i._symbolUnitLocation=i.getAttribLocation(s,"unit"),i._symbolMatrixLocation=i.getUniformLocation(s,"matrix"),i._symbolClipLocation=i.getUniformLocation(s,"clip"),n=["attribute vec3 pos;","attribute vec3 fillColor;","attribute vec3 strokeColor;","attribute float fillOpacity;","attribute float strokeWidth;","attribute float strokeOpacity;","attribute float cornerRadius;","attribute vec2 size;","attribute vec2 unit;","uniform mat4 matrix;","varying vec4 fillColorVar;","varying vec4 strokeColorVar;","varying float strokeWidthVar;","varying float cornerRadiusVar;","varying float factorVar;","varying vec2 sizeVar;","varying vec2 unitVar;","varying vec4 positionVar;","void main(void)","{","  strokeWidthVar = strokeWidth;","  fillColorVar = vec4(fillColor, fillOpacity);","  strokeColorVar = vec4(strokeColor, strokeOpacity);","  cornerRadiusVar = cornerRadius;","  sizeVar = size;","  unitVar = unit;","  factorVar = max(size.x, size.y) + strokeWidth + 1.0;","  positionVar = vec4(pos.xy + factorVar*unitVar - 0.5*strokeWidth - 0.5, -1.0, 1.0);","  gl_Position = matrix * positionVar;","}"].join(`
`),o=i.createShader(i.VERTEX_SHADER),i.shaderSource(o,n),i.compileShader(o),!i.getShaderParameter(o,i.COMPILE_STATUS))throw i.getShaderInfoLog(o);if(g=["precision mediump float;","const float PI = 3.1415926535897932384626433832795;","varying vec4 fillColorVar;","varying vec4 strokeColorVar;","varying float strokeWidthVar;","varying float cornerRadiusVar;","varying float factorVar;","varying vec2 unitVar;","varying vec2 sizeVar;","varying vec4 positionVar;","uniform vec4 clip;","float distToLine(vec2 pt1, vec2 pt2, vec2 testPt)","{","  vec2 lineDir = pt2 - pt1;","  vec2 perpDir = vec2(lineDir.y, -lineDir.x);","  vec2 dirToPt1 = pt1 - testPt;","  return dot(normalize(perpDir), dirToPt1);","}","float cornerDist(vec2 pt, float radius, float xdir, float ydir, vec2 testPt)","{","  if (xdir * (pt.x - testPt.x) > 0.0) return 1.0;","  if (ydir * (pt.y - testPt.y) > 0.0) return 1.0;","  return radius - length(pt - testPt);","}","void main () {","  if (positionVar.x < clip[0] || positionVar.x > clip[2] || positionVar.y < clip[1] || positionVar.y > clip[3]) {","    discard;","  }","  float delta = (0.5 + 0.5*strokeWidthVar)/factorVar;","  float xmax = (0.5 + 0.5*strokeWidthVar + sizeVar.x)/factorVar;","  float ymax = (0.5 + 0.5*strokeWidthVar + sizeVar.y)/factorVar;","  vec2 p1 = vec2(delta, delta);","  vec2 p2 = vec2(xmax, delta);","  vec2 p3 = vec2(xmax, ymax);","  vec2 p4 = vec2(delta, ymax);","  float dist = distToLine(p1, p2, unitVar);","  dist = min(dist, distToLine(p2, p3, unitVar));","  dist = min(dist, distToLine(p3, p4, unitVar));","  dist = min(dist, distToLine(p4, p1, unitVar));","  if (cornerRadiusVar > 0.0) {","    delta = (0.5 + 0.5*strokeWidthVar + cornerRadiusVar)/factorVar;","    xmax = (0.5 + 0.5*strokeWidthVar + sizeVar.x - cornerRadiusVar)/factorVar;","    ymax = (0.5 + 0.5*strokeWidthVar + sizeVar.y - cornerRadiusVar)/factorVar;","    p1 = vec2(delta, delta);","    p2 = vec2(xmax, delta);","    p3 = vec2(xmax, ymax);","    p4 = vec2(delta, ymax);","    dist = min(dist, cornerDist(p1, cornerRadiusVar/factorVar, -1.0, -1.0, unitVar));","    dist = min(dist, cornerDist(p2, cornerRadiusVar/factorVar, 1.0, -1.0, unitVar));","    dist = min(dist, cornerDist(p3, cornerRadiusVar/factorVar, 1.0, 1.0, unitVar));","    dist = min(dist, cornerDist(p4, cornerRadiusVar/factorVar, -1.0, 1.0, unitVar));","  }","  dist = 1.0 - dist;","  float endStep = 1.0;","  float antialiasDist = 0.5 / factorVar;","  float widthDist = 0.5*strokeWidthVar / factorVar;","  vec4 c1;","  vec4 c2;","  float step;","  if (dist < endStep) {","    step = smoothstep(endStep - widthDist - antialiasDist, endStep - widthDist + antialiasDist, dist);","    if (fillColorVar.a > 0.0) {","      c1 = fillColorVar;","    } else {","      c1 = vec4(strokeColorVar.rgb, 0.0);","    }","    if (strokeWidthVar > 0.0) {","      c2 = strokeColorVar;","    } else {","      c2 = vec4(fillColorVar.rgb, 0.0);","    }","  } else {","    step = smoothstep(endStep + widthDist - antialiasDist, endStep + widthDist + antialiasDist, dist);","    if (strokeWidthVar > 0.0) {","      c1 = strokeColorVar;","      c2 = vec4(strokeColorVar.rgb, 0.0);","    } else {","      c1 = vec4(fillColorVar.rgb, 0.0);","      c2 = vec4(fillColorVar.rgb, 0.0);","    }","  }","  gl_FragColor = mix(c1, c2, step);","}"].join(`
`),a=i.createShader(i.FRAGMENT_SHADER),i.shaderSource(a,g),i.compileShader(a),!i.getShaderParameter(a,i.COMPILE_STATUS))throw i.getShaderInfoLog(a);return s=i.createProgram(),i.attachShader(s,o),i.attachShader(s,a),i.linkProgram(s),i._rectShaderProgram=s,i._rectPosLocation=i.getAttribLocation(s,"pos"),i._rectFillColorLocation=i.getAttribLocation(s,"fillColor"),i._rectStrokeColorLocation=i.getAttribLocation(s,"strokeColor"),i._rectFillOpacityLocation=i.getAttribLocation(s,"fillOpacity"),i._rectStrokeWidthLocation=i.getAttribLocation(s,"strokeWidth"),i._rectSizeLocation=i.getAttribLocation(s,"size"),i._rectStrokeOpacityLocation=i.getAttribLocation(s,"strokeOpacity"),i._rectCornerRadiusLocation=i.getAttribLocation(s,"cornerRadius"),i._rectUnitLocation=i.getAttribLocation(s,"unit"),i._rectMatrixLocation=i.getUniformLocation(s,"matrix"),i._rectClipLocation=i.getUniformLocation(s,"clip"),t}var uei=typeof window<"u"&&window.devicePixelRatio||1;function dei(A,e,t,i){var n=typeof HTMLElement<"u"&&A instanceof HTMLElement&&A.parentNode!=null,o=A.getContext("webgl")||A.getContext("experimental-webgl"),g=n?uei:1;return A.width=e*g,A.height=t*g,o._textCanvas.width=e*g,o._textCanvas.height=t*g,o._textContext.pixelRatio=g,o._textContext.setTransform(g,0,0,g,g*i[0],g*i[1]),g!==1&&(A.style.width=e+"px",A.style.height=t+"px"),o.lineWidth(g),o.viewport(0,0,o.canvas.width,o.canvas.height),o._origin=i,o._ratio=g,o._clip=[0,0,A.width/o._ratio,A.height/o._ratio],A}function npA(A){La.call(this,A),this._redraw=!1,this._angleX=0,this._angleY=0,this._angleZ=0,this._translateX=0,this._translateY=0,this._translateZ=0,this._zFactor=0,this._depthTest=!1,this._randomZ=!1}var Rs=Qei(npA,La),ace=La.prototype;Rs.initialize=function(A,e,t,i){return this._canvas=Eei(1,1),A&&(kI(A,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),ace.initialize.call(this,A,e,t,i)},Rs.resize=function(A,e,t){return ace.resize.call(this,A,e,t),dei(this._canvas,this._width,this._height,this._origin),this._redraw=!0,this},Rs.canvas=function(){return this._canvas},Rs.context=function(){return this._canvas?this._canvas.getContext("webgl")||this._canvas.getContext("experimental-webgl"):null},Rs.rotate=function(A,e,t){return this._angleX=A,this._angleY=e,this._angleZ=t,this},Rs.translate=function(A,e,t){return this._translateX=A,this._translateY=e,this._translateZ=t,this},Rs.zFactor=function(A){return this._zFactor=A,this},Rs.depthTest=function(A){return this._depthTest=A,this},Rs.randomZ=function(A){return this._randomZ=A,this},Rs._updateUniforms=function(){var A=this.context();A.useProgram(A._shaderProgram);var e=A.canvas.width/A._ratio,t=A.canvas.height/A._ratio,i=[2/e,0,0,0,0,-2/e,0,0,0,0,1,0,-1,t/e,0,1];this.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.matrix=J0(this.matrix,zAi(Math.PI/2,e/t,.01,3e3)),this.matrix=J0(this.matrix,oce(this._translateX,this._translateY,(this._translateZ-1)*t/e)),this.matrix=J0(this.matrix,OAi(this._angleZ)),this.matrix=J0(this.matrix,_Ai(this._angleY)),this.matrix=J0(this.matrix,TAi(this._angleX)),this.matrix=J0(this.matrix,oce(0,0,1)),this.matrix=J0(this.matrix,i),A._matrix=this.matrix,A.uniform1f(A._zFactorLocation,this._zFactor),A.uniformMatrix4fv(A._matrixLocation,!1,this.matrix)},Rs._render=function(A,e){var t=this.context(),i,n;if(t._tx=0,t._ty=0,t._triangleGeometry=[],t._triangleColor=[],t._images)for(n=0;n<t._images.length;n++)t.deleteTexture(t._images[n].texture);if(t._images=[],t._randomZ=this._randomZ,t._pathCacheHit=0,t._pathCacheMiss=0,t._itemCacheHit=0,t._itemCacheMiss=0,t._shapeCacheHit=0,t._shapeCacheMiss=0,i=!e||this._redraw?(this._redraw=!1,null):void 0,e)for(n=0;n<e.length;n++)e[n]._dirty=!0,e[n].exit&&va[e[n].mark.marktype].nested&&e[n].mark.items.length&&(e[n].mark.items[0]._dirty=!0);else t._fullRedraw=!0;this._depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this._updateUniforms(),this.clear(),this.draw(t,A,i);var o=gce(t,t._textCanvas);for(o.x=0,o.y=0,o.w=t.canvas.width/t._ratio,o.h=t.canvas.height/t._ratio,t._images.push(o),n=0;n<t._images.length;n++)qAi(t,t._images[n],this.matrix);if(e)for(n=0;n<e.length;n++)e[n]._dirty=!1;return t._fullRedraw=!1,this._lastScene=A,this},Rs.frame=function(){return this._lastScene&&this._render(this._lastScene,[]),this},Rs.draw=function(A,e,t){var i=Bei[e.marktype];i.drawGL&&i.drawGL.call(this,A,e,t)},Rs.toDataURL=function(A){return this.render(A,null),this.canvas().toDataURL("image/png",1)},Rs.clear=function(){var A=this.context(),e;this._bgcolor!=null?(e=Lw(A,null,this._bgcolor),A.clearColor(e[0],e[1],e[2],1)):A.clearColor(1,1,1,1),A.clear(A.COLOR_BUFFER_BIT|A.DEPTH_BUFFER_BIT),A._textContext.save(),A._textContext.setTransform(1,0,0,1,0,0),A._textContext.clearRect(0,0,A._textCanvas.width,A._textCanvas.height),A._textContext.restore()},sl.prototype.context=function(){return this._canvas.getContext("2d")||this._canvas._textCanvas.getContext("2d")},HJ("webgl",{handler:sl,renderer:npA});function hei(A,e,t,i,n){sce(A,e,t||0,i||A.length-1,n||mei)}function sce(A,e,t,i,n){for(;i>t;){if(i-t>600){var o=i-t+1,g=e-t+1,a=Math.log(o),s=.5*Math.exp(2*a/3),I=.5*Math.sqrt(a*s*(o-s)/o)*(g-o/2<0?-1:1),r=Math.max(t,Math.floor(e-g*s/o+I)),C=Math.min(i,Math.floor(e+(o-g)*s/o+I));sce(A,e,r,C,n)}var l=A[e],c=t,B=i;for($H(A,t,e),n(A[i],l)>0&&$H(A,t,i);c<B;){for($H(A,c,B),c++,B--;n(A[c],l)<0;)c++;for(;n(A[B],l)>0;)B--}n(A[t],l)===0?$H(A,t,B):(B++,$H(A,B,i)),B<=e&&(t=B+1),e<=B&&(i=B-1)}}function $H(A,e,t){var i=A[e];A[e]=A[t],A[t]=i}function mei(A,e){return A<e?-1:A>e?1:0}class pei{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const i=[];if(!hj(e,t))return i;const n=this.toBBox,o=[];for(;t;){for(let g=0;g<t.children.length;g++){const a=t.children[g],s=t.leaf?n(a):a;hj(e,s)&&(t.leaf?i.push(a):gpA(e,s)?this._all(a,i):o.push(a))}t=o.pop()}return i}collides(e){let t=this.data;if(!hj(e,t))return!1;const i=[];for(;t;){for(let n=0;n<t.children.length;n++){const o=t.children[n],g=t.leaf?this.toBBox(o):o;if(hj(e,g)){if(t.leaf||gpA(e,g))return!0;i.push(o)}}t=i.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let i=0;i<e.length;i++)this.insert(e[i]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const i=this.data;this.data=t,t=i}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=pY([]),this}remove(e,t){if(!e)return this;let i=this.data;const n=this.toBBox(e),o=[],g=[];let a,s,I;for(;i||o.length;){if(i||(i=o.pop(),s=o[o.length-1],a=g.pop(),I=!0),i.leaf){const r=fei(e,i.children,t);if(r!==-1)return i.children.splice(r,1),o.push(i),this._condense(o),this}!I&&!i.leaf&&gpA(i,n)?(o.push(i),g.push(a),a=0,s=i,i=i.children[0]):s?(a++,i=s.children[a],I=!1):i=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const i=[];for(;e;)e.leaf?t.push(...e.children):i.push(...e.children),e=i.pop();return t}_build(e,t,i,n){const o=i-t+1;let g=this._maxEntries,a;if(o<=g)return a=pY(e.slice(t,i+1)),mY(a,this.toBBox),a;n||(n=Math.ceil(Math.log(o)/Math.log(g)),g=Math.ceil(o/Math.pow(g,n-1))),a=pY([]),a.leaf=!1,a.height=n;const s=Math.ceil(o/g),I=s*Math.ceil(Math.sqrt(g));rce(e,t,i,I,this.compareMinX);for(let r=t;r<=i;r+=I){const C=Math.min(r+I-1,i);rce(e,r,C,s,this.compareMinY);for(let l=r;l<=C;l+=s){const c=Math.min(l+s-1,C);a.children.push(this._build(e,l,c,n-1))}}return mY(a,this.toBBox),a}_chooseSubtree(e,t,i,n){for(;n.push(t),!(t.leaf||n.length-1===i);){let o=1/0,g=1/0,a;for(let s=0;s<t.children.length;s++){const I=t.children[s],r=opA(I),C=wei(e,I)-r;C<g?(g=C,o=r<o?r:o,a=I):C===g&&r<o&&(o=r,a=I)}t=a||t.children[0]}return t}_insert(e,t,i){const n=i?e:this.toBBox(e),o=[],g=this._chooseSubtree(n,this.data,t,o);for(g.children.push(e),eZ(g,n);t>=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(n,o,t)}_split(e,t){const i=e[t],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);const g=this._chooseSplitIndex(i,o,n),a=pY(i.children.splice(g,i.children.length-g));a.height=i.height,a.leaf=i.leaf,mY(i,this.toBBox),mY(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this.data=pY([e,t]),this.data.height=e.height+1,this.data.leaf=!1,mY(this.data,this.toBBox)}_chooseSplitIndex(e,t,i){let n,o=1/0,g=1/0;for(let a=t;a<=i-t;a++){const s=AZ(e,0,a,this.toBBox),I=AZ(e,a,i,this.toBBox),r=Dei(s,I),C=opA(s)+opA(I);r<o?(o=r,n=a,g=C<g?C:g):r===o&&C<g&&(g=C,n=a)}return n||i-t}_chooseSplitAxis(e,t,i){const n=e.leaf?this.compareMinX:yei,o=e.leaf?this.compareMinY:bei,g=this._allDistMargin(e,t,i,n),a=this._allDistMargin(e,t,i,o);g<a&&e.children.sort(n)}_allDistMargin(e,t,i,n){e.children.sort(n);const o=this.toBBox,g=AZ(e,0,t,o),a=AZ(e,i-t,i,o);let s=dj(g)+dj(a);for(let I=t;I<i-t;I++){const r=e.children[I];eZ(g,e.leaf?o(r):r),s+=dj(g)}for(let I=i-t-1;I>=t;I--){const r=e.children[I];eZ(a,e.leaf?o(r):r),s+=dj(a)}return s}_adjustParentBBoxes(e,t,i){for(let n=i;n>=0;n--)eZ(t[n],e)}_condense(e){for(let t=e.length-1,i;t>=0;t--)e[t].children.length===0?t>0?(i=e[t-1].children,i.splice(i.indexOf(e[t]),1)):this.clear():mY(e[t],this.toBBox)}}function fei(A,e,t){if(!t)return e.indexOf(A);for(let i=0;i<e.length;i++)if(t(A,e[i]))return i;return-1}function mY(A,e){AZ(A,0,A.children.length,e,A)}function AZ(A,e,t,i,n){n||(n=pY(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let o=e;o<t;o++){const g=A.children[o];eZ(n,A.leaf?i(g):g)}return n}function eZ(A,e){return A.minX=Math.min(A.minX,e.minX),A.minY=Math.min(A.minY,e.minY),A.maxX=Math.max(A.maxX,e.maxX),A.maxY=Math.max(A.maxY,e.maxY),A}function yei(A,e){return A.minX-e.minX}function bei(A,e){return A.minY-e.minY}function opA(A){return(A.maxX-A.minX)*(A.maxY-A.minY)}function dj(A){return A.maxX-A.minX+(A.maxY-A.minY)}function wei(A,e){return(Math.max(e.maxX,A.maxX)-Math.min(e.minX,A.minX))*(Math.max(e.maxY,A.maxY)-Math.min(e.minY,A.minY))}function Dei(A,e){const t=Math.max(A.minX,e.minX),i=Math.max(A.minY,e.minY),n=Math.min(A.maxX,e.maxX),o=Math.min(A.maxY,e.maxY);return Math.max(0,n-t)*Math.max(0,o-i)}function gpA(A,e){return A.minX<=e.minX&&A.minY<=e.minY&&e.maxX<=A.maxX&&e.maxY<=A.maxY}function hj(A,e){return e.minX<=A.maxX&&e.minY<=A.maxY&&e.maxX>=A.minX&&e.maxY>=A.minY}function pY(A){return{children:A,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function rce(A,e,t,i,n){const o=[e,t];for(;o.length;){if(t=o.pop(),e=o.pop(),t-e<=i)continue;const g=e+Math.ceil((t-e)/i/2)*i;hei(A,g,e,t,n),o.push(e,g,g,t)}}sl.prototype.context=function(){return this._canvas.getContext("2d")||this._canvas._textCanvas.getContext("2d")},HJ("webgl",{handler:sl,renderer:npA});const Jl=5,mj="_gw_pixel_index",$d=255,Ice={PRIMARY:1,SECONDARY:2,WHELL:4,BACK:8,FORWARD:16},apA=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],pj=Object.fromEntries(apA.map((A,e)=>[e+1,{name:`L_${e+1}`,color:A}])),spA=[];function Cce(A,e,t){const[i,n]=p.useState(t),[o,g]=p.useState(!0);return p.useEffect(()=>{let a=!1;g(!0);const s=A();if(s!=null)return s.then(I=>{a||(g(!1),n(I))}),()=>{a=!0}},e),[i,o]}function lce(A){const e=[];let t=0;function i(n){if(n.interactive!==!1){if(n._ig_start=t,n.items)for(let o of n.items)i(o);n._ig_end=t,n.interactive===!0&&n._ig_start===n._ig_end&&(e.push(n),++t,++n._ig_end)}}return i(A.root),e}const cce=A=>A.domain.type==="nominal"?ke.PAINT_SIZE_FACTOR*ke.PAINT_MAP_SIZE/A.domain.width:ke.PAINT_SIZE_FACTOR;function Gei(A){return A.every(e=>e==="quantitative")?"circle":A.find(e=>e==="quantitative")?"bar":"square"}function kei(A){return A.every(e=>e==="quantitative")?"circle":A.find(e=>e==="quantitative")?"tick":"square"}const Jei=["circle","bar"],fj=A=>A==="quantitative"?"quantitative":"nominal",yj=function(A,e){const t=new Map;return A.forEach(i=>t.set(e(i),i)),[...t.values()]},Bce=A=>yj([A.x,A.y,A.color,A.size,A.opacity,A.shape].filter(e=>!!e).filter(e=>e.analyticType==="dimension"),e=>e.fid),Qce=(A,e,t)=>e.domain.value.every(i=>i instanceof Array)?{field:`${A.fid}[0]`,title:A.name,type:e.domain.type,axis:{labelOverlap:!0},scale:{domain:e.domain.type==="nominal"&&t!=null&&t.reverseNominalDomain?e.domain.value.toReversed().map(i=>i[0]):e.domain.value.map(i=>i[0])}}:{field:A.fid,title:A.name,type:e.domain.type,axis:{labelOverlap:!0},scale:{domain:e.domain.type==="nominal"&&t!=null&&t.reverseNominalDomain?e.domain.value.toReversed():e.domain.value}},fY=(A,e,t)=>e!=null&&e.domain.value.every(i=>i instanceof Array)?{field:`${A.fid}[0]`,title:A.name,type:fj(A.semanticType),axis:{labelOverlap:!0},scale:e?{domain:e.domain.type==="nominal"&&t!=null&&t.reverseNominalDomain?e.domain.value.toReversed().map(i=>i[0]):e.domain.value.map(i=>i[0])}:void 0,aggregate:(t==null?void 0:t.aggregate)&&A.analyticType==="measure"}:{field:A.fid,title:A.name,type:fj(A.semanticType),axis:{labelOverlap:!0},scale:e?{domain:e.domain.type==="nominal"&&t!=null&&t.reverseNominalDomain?e.domain.value.toReversed():e.domain.value}:void 0,aggregate:(t==null?void 0:t.aggregate)&&A.analyticType==="measure"},Nei=A=>{var e;const{t}=ve(),i=p.useContext(sQ),n=Og(),o=p.useMemo(()=>[A.x,A.y,A.color,A.size,A.opacity,A.shape].filter(N=>N).map(N=>N.field),[A.x,A.y,A.color,A.size,A.opacity,A.shape]),[g,a]=p.useMemo(()=>[yj(o.concat(A.facets.flatMap(N=>N.dimensions.map(v=>({fid:v.fid,name:v.fid,semanticType:v.domain.type,analyticType:v.domain.type==="nominal"?"dimension":"measure"})))),N=>N.fid).filter(N=>N.analyticType==="dimension"),o.filter(N=>N.analyticType==="measure")],[o,A.facets]),s=p.useMemo(()=>yj([A.x,A.y,A.color,A.size,A.opacity,A.shape].filter(N=>N).filter(N=>N.domain),N=>N.field.fid).map(N=>N.domain),[]),I=p.useRef(ke.PAINT_DEFAULT_BRUSH_SIZE),[r,C]=p.useState(ke.PAINT_DEFAULT_BRUSH_SIZE);I.current=r;const l=p.useRef(2),[c,B]=p.useState(2);l.current=c;const E=p.useRef(null),{loading:u,viewData:d}=WS({computationFunction:n,defaultAggregated:!0,filters:spA,allFields:A.allFields,limit:-1,sort:"none",viewDimensions:g,viewMeasures:a,timezoneDisplayOffset:A.displayOffset}),f=p.useMemo(()=>d.map(qiA(s)),[d,s]),[w,y]=Cce(async()=>{const N=await tvA(d,{dict:A.dict,facets:A.facets,usedColor:[]});return d.map((v,K)=>{var U;const V=A.paintMapRef.current[f[K]];return{...v,[In]:V===0?N[K]??A.dict[1].name:(U=A.dict[V])==null?void 0:U.name,[mj]:f[K]}})},[f,d,A.dict,A.facets]),[G,R]=p.useState([0,0]),x=p.useRef(()=>{}),F=u||y;p.useEffect(()=>{if(!F&&E.current){const N=Gei([fj(A.y.field.semanticType),fj(A.x.field.semanticType)]),v=A.mark==="auto"?TV([A.x.field.semanticType,A.y.field.semanticType]):A.mark,K=Object.entries(A.dict),U=Jei.includes(v)?v:N,V={data:{name:"data",values:w},mark:{type:U,fillOpacity:.66,strokeWidth:4,strokeOpacity:1,size:U==="circle"?600:void 0},encoding:{x:fY(A.x.field,A.x.domain,{aggregate:!0}),y:fY(A.y.field,A.y.domain,{reverseNominalDomain:!0,aggregate:!0}),fill:{field:In,type:"nominal",title:"custom feature",scale:{domain:K.map(([X,_])=>_.name),range:K.map(([X,_])=>_.color)}},stroke:A.color?fY(A.color.field,A.color.domain):void 0,opacity:A.opacity?fY(A.opacity.field,A.opacity.domain):void 0,size:A.size?fY(A.size.field,A.size.domain):void 0,shape:A.shape?fY(A.shape.field,A.shape.domain):void 0},width:ke.PAINT_MAP_SIZE*ke.PAINT_SIZE_FACTOR,height:ke.PAINT_MAP_SIZE*ke.PAINT_SIZE_FACTOR};Object.values(V.encoding).forEach(X=>{if(!X||X.aggregate===null)return;const _=a.find(q=>q.fid===X.field);_&&(X.title=wy(_.name,_.aggName),X.field=Fo(_.fid,_.aggName))}),U2(E.current,V,{renderer:"webgl",config:A.vegaConfig,actions:!1,tooltip:{theme:i}}).then(X=>{const _=X.view.scenegraph(),q=X.view.origin();R([q[0]+Jl,q[1]+Jl]);const $=new Map,nA=lce(_),j=new pei;nA.forEach(oA=>qn(oA,tA=>{var sA;if("datum"in tA){const gA=tA.datum[mj];$.has(gA)||$.set(gA,[]),(sA=$.get(gA))==null||sA.push(tA),tA.bounds&&j.insert({minX:tA.bounds.x1,minY:tA.bounds.y1,maxX:tA.bounds.x2,maxY:tA.bounds.y2,id:gA})}}));const O=Hk(()=>X.view._renderer._render(_.root),15,{trailing:!0});x.current=()=>{A.onReset(),A.paintMapRef.current=SV(s);const{name:oA,color:tA}=A.dict[1];nA.forEach(sA=>qn(sA,gA=>{"datum"in gA&&(gA.fill=tA,gA.datum[In]=oA)})),O()};const eA=oA=>{oA.stopPropagation(),oA.preventDefault();const tA=(sA,gA)=>{const iA=l.current===$d?{name:"",color:"transparent"}:A.dict[l.current];if(!iA)return;const aA=j.search({minX:sA-I.current,minY:gA-I.current,maxX:sA+I.current,maxY:gA+I.current}).map(CA=>CA.id);let lA=0;aA.forEach(CA=>{var QA;(QA=$.get(CA))==null||QA.forEach(uA=>{uA.fill=iA.color,uA.datum[In]=iA.name,lA++}),A.paintMapRef.current[CA]=l.current}),lA>0&&O()};if(oA instanceof MouseEvent&&oA.buttons&Ice.PRIMARY)tA(oA.offsetX-q[0]-Jl,oA.offsetY-q[1]-Jl);else if(window.TouchEvent&&oA instanceof TouchEvent){const sA=E.current.getBoundingClientRect();tA(oA.changedTouches[0].pageX-sA.left-q[0]-Jl,oA.changedTouches[0].pageY-sA.top-q[1]-Jl)}};X.view.addEventListener("mousedown",eA),X.view.addEventListener("mousemove",eA),X.view.addEventListener("touchstart",eA),X.view.addEventListener("touchmove",eA)})}},[F,w,A.dict,A.vegaConfig,s,A.onReset,A.mark]);const[Q,k]=b.useState(!1),h=p.useMemo(()=>({type:"rect",x:r,y:r,xFactor:ke.PAINT_SIZE_FACTOR,yFactor:ke.PAINT_SIZE_FACTOR}),[r]);return p.useEffect(()=>{k(!0);const N=setTimeout(()=>{k(!1)},1e3);return()=>{clearTimeout(N)}},[r,c]),b.createElement("div",{className:"flex"},b.createElement(hle,{color:((e=A.dict[c])==null?void 0:e.color)??"#333",cursor:h,offsetX:G[0],offsetY:G[1],showPreview:Q},b.createElement("div",{ref:E,id:"painter-container",className:"!cursor-none min-w-[600px] min-h-[512px]"})),b.createElement("div",{className:"flex flex-col space-y-2 pt-10 w-40 flex-shrink-0 px-1"},b.createElement(EH,{value:c===$d?"eraser":"palette",onValueChange:N=>{B(N==="palette"?2:$d)}},b.createElement(WN,null,b.createElement(rB,{value:"palette"}," ",t("main.tabpanel.settings.paint.palette")),b.createElement(rB,{value:"eraser"}," ",t("main.tabpanel.settings.paint.eraser"))),c!==$d&&b.createElement(uH,{value:"palette"},b.createElement("div",{className:"grid grid-cols-5 gap-2 p-2"},Object.entries(A.dict).map(([N,{color:v}])=>b.createElement("div",{key:N,className:`box-border rounded-full border-primary hover: ${N===`${c}`?"border-2":"hover:border-2"} active:ring-ring active:ring-1 w-4 h-4`,style:{background:v},onClick:()=>B(Number(N))}))),b.createElement("div",{className:"flex space-x-2"},b.createElement("label",{className:"block text-xs font-medium"},t("main.tabpanel.settings.paint.color")),b.createElement(ple,{color:A.dict[c].color,colors:apA,onChangeColor:N=>{A.onChangeDict({...A.dict,[c]:{color:N,name:A.dict[c].name}})}})),b.createElement("div",{className:"flex flex-col space-y-2"},b.createElement("label",{className:"block text-xs font-medium"},t("main.tabpanel.settings.paint.label")),b.createElement(mle,{value:A.dict[c].name,onChange:N=>{A.onChangeDict({...A.dict,[c]:{color:A.dict[c].color,name:N}})}})))),b.createElement("div",{className:"pt-2"},b.createElement("output",{className:"text-sm"},t("main.tabpanel.settings.paint.brush_size"),": ",`${r}`),b.createElement(dF,{className:"mt-2",value:[r],min:ke.PAINT_MIN_BRUSH_SIZE,max:ke.PAINT_MAX_BRUSH_SIZE,onValueChange:([N])=>C(N)})),b.createElement("div",{className:"flex-1 flex flex-col space-y-2 justify-end"},b.createElement(fe,{variant:"destructive",children:t("main.tabpanel.settings.paint.delete_paint"),onClick:A.onDelete}),b.createElement(fe,{variant:"outline",children:t("main.tabpanel.settings.paint.reset_paint"),onClick:()=>x.current()}),b.createElement(fe,{variant:"outline",children:t("main.tabpanel.settings.paint.cancel"),onClick:A.onCancel}),b.createElement(fe,{children:t("main.tabpanel.settings.paint.save_paint"),onClick:A.onSave}))))},Yei=["point","circle","tick"],Rei=A=>{var e;const{t}=ve(),i=p.useContext(sQ),n=Og(),o=p.useMemo(()=>yj([{...A.x,analyticType:"measure"},{...A.y,analyticType:"measure"}].concat(A.facets.flatMap(Q=>Q.dimensions.map(k=>({fid:k.fid,name:k.fid,semanticType:k.domain.type,analyticType:"measure"})))),Q=>Q.fid),[A.x,A.y]),g=p.useRef(ke.PAINT_DEFAULT_BRUSH_SIZE),[a,s]=p.useState(ke.PAINT_DEFAULT_BRUSH_SIZE);g.current=a;const I=p.useRef(2),[r,C]=p.useState(2);I.current=r;const l=p.useRef(null),{loading:c,viewData:B}=WS({computationFunction:n,defaultAggregated:!1,filters:spA,allFields:A.allFields,limit:-1,sort:"none",viewDimensions:spA,viewMeasures:o,timezoneDisplayOffset:A.displayOffset}),E=p.useMemo(()=>B.map(qiA([A.domainY,A.domainX])),[B,A.domainX,A.domainY]),[u,d]=Cce(async()=>{const Q=await tvA(B,{dict:A.dict,facets:A.facets,usedColor:[]});return B.map((k,h)=>{var N;const v=A.paintMapRef.current[E[h]];return{...k,[In]:v===0?Q[h]:(N=A.dict[v])==null?void 0:N.name,[mj]:E[h]}})},[E,B,A.dict,A.facets]),[f,w]=p.useState([0,0]),y=p.useRef(()=>{}),G=c||d;p.useEffect(()=>{if(!G&&l.current){const Q=kei([A.domainY.domain.type,A.domainX.domain.type]),k=A.mark==="auto"?TV([A.x.semanticType,A.y.semanticType]):A.mark,h=Object.entries(A.dict),N={data:{name:"data",values:u},mark:{type:Yei.includes(k)?k:Q,opacity:.66},encoding:{x:Qce(A.x,A.domainX),y:Qce(A.y,A.domainY,{reverseNominalDomain:!0}),color:{field:In,type:"nominal",title:"custom feature",scale:{domain:h.map(([v,K])=>K.name),range:h.map(([v,K])=>K.color)}}},width:ke.PAINT_MAP_SIZE*ke.PAINT_SIZE_FACTOR,height:ke.PAINT_MAP_SIZE*ke.PAINT_SIZE_FACTOR};U2(l.current,N,{renderer:"webgl",config:A.vegaConfig,actions:!1,tooltip:{theme:i}}).then(v=>{const K=v.view.scenegraph(),U=v.view.origin();w([U[0]+Jl,U[1]+Jl]);const V=new Map,X=lce(K);X.forEach($=>qn($,nA=>{var j;if("datum"in nA){const O=nA.datum[mj];V.has(O)||V.set(O,[]),(j=V.get(O))==null||j.push(nA)}}));const _=Hk(()=>v.view._renderer._render(K.root),15,{trailing:!0});y.current=()=>{A.onReset(),A.paintMapRef.current=SV([A.domainY,A.domainX]);const{name:$,color:nA}=A.dict[1];X.forEach(j=>qn(j,O=>{"datum"in O&&(O.fill&&O.fill!=="transparent"&&(O.fill=nA),O.stroke&&O.stroke!=="transparent"&&(O.stroke=nA),O.datum[In]=$)})),_()};const q=$=>{$.stopPropagation(),$.preventDefault();const nA=(j,O)=>{const eA=I.current===$d?{name:"",color:"transparent"}:A.dict[I.current];if(!eA)return;const oA=W3e([Math.floor(j/cce(A.domainX)),A.domainY.domain.width-1-Math.floor(O/cce(A.domainY))],g.current,[A.domainY,A.domainX]);let tA=0;oA.forEach(sA=>{var gA;(gA=V.get(sA))==null||gA.forEach(iA=>{switch(iA.ariaRoleDescription){case"circle":case"square":case"tick":iA.fill=eA.color;break;case"point":iA.stroke=eA.color;break}iA.datum[In]=eA.name,tA++}),A.paintMapRef.current[sA]=I.current}),tA>0&&_()};if($ instanceof MouseEvent&&$.buttons&Ice.PRIMARY)nA($.offsetX-U[0]-Jl,$.offsetY-U[1]-Jl);else if(window.TouchEvent&&$ instanceof TouchEvent){const j=l.current.getBoundingClientRect();nA($.changedTouches[0].pageX-j.left-U[0]-Jl,$.changedTouches[0].pageY-j.top-U[1]-Jl)}};v.view.addEventListener("mousedown",q),v.view.addEventListener("mousemove",q),v.view.addEventListener("touchstart",q),v.view.addEventListener("touchmove",q)})}},[G,u,A.dict,A.vegaConfig,A.domainX,A.domainY,A.onReset,A.mark]);const[R,x]=b.useState(!1),F=p.useMemo(()=>A.domainX.domain.type==="quantitative"&&A.domainY.domain.type==="quantitative"?{dia:a,factor:ke.PAINT_SIZE_FACTOR,type:"circle"}:{type:"rect",x:A.domainX.domain.type==="nominal"?1:a,xFactor:A.domainX.domain.type==="nominal"?ke.PAINT_SIZE_FACTOR*ke.PAINT_MAP_SIZE/A.domainX.domain.width:ke.PAINT_SIZE_FACTOR,y:A.domainY.domain.type==="nominal"?1:a,yFactor:A.domainY.domain.type==="nominal"?ke.PAINT_SIZE_FACTOR*ke.PAINT_MAP_SIZE/A.domainY.domain.width:ke.PAINT_SIZE_FACTOR},[A.domainX,A.domainY,a]);return p.useEffect(()=>{x(!0);const Q=setTimeout(()=>{x(!1)},1e3);return()=>{clearTimeout(Q)}},[a,r]),b.createElement("div",{className:"flex"},b.createElement(hle,{color:((e=A.dict[r])==null?void 0:e.color)??"#333",cursor:F,offsetX:f[0],offsetY:f[1],showPreview:R},b.createElement("div",{ref:l,id:"painter-container",className:"!cursor-none min-w-[600px] min-h-[512px]"})),b.createElement("div",{className:"flex flex-col space-y-2 pt-10 w-40 flex-shrink-0 px-1"},b.createElement(EH,{value:r===$d?"eraser":"palette",onValueChange:Q=>{C(Q==="palette"?2:$d)}},b.createElement(WN,null,b.createElement(rB,{value:"palette"}," ",t("main.tabpanel.settings.paint.palette")),b.createElement(rB,{value:"eraser"}," ",t("main.tabpanel.settings.paint.eraser"))),r!==$d&&b.createElement(uH,{value:"palette"},b.createElement("div",{className:"grid grid-cols-5 gap-2 p-2"},Object.entries(A.dict).map(([Q,{color:k}])=>b.createElement("div",{key:Q,className:`box-border rounded-full border-primary hover: ${Q===`${r}`?"border-2":"hover:border-2"} active:ring-ring active:ring-1 w-4 h-4`,style:{background:k},onClick:()=>C(Number(Q))}))),b.createElement("div",{className:"flex space-x-2"},b.createElement("label",{className:"block text-xs font-medium"},t("main.tabpanel.settings.paint.color")),b.createElement(ple,{color:A.dict[r].color,colors:apA,onChangeColor:Q=>{A.onChangeDict({...A.dict,[r]:{color:Q,name:A.dict[r].name}})}})),b.createElement("div",{className:"flex flex-col space-y-2"},b.createElement("label",{className:"block text-xs font-medium"},t("main.tabpanel.settings.paint.label")),b.createElement(mle,{value:A.dict[r].name,onChange:Q=>{A.onChangeDict({...A.dict,[r]:{color:A.dict[r].color,name:Q}})}})))),(A.domainX.domain.type==="quantitative"||A.domainY.domain.type==="quantitative")&&b.createElement("div",{className:"pt-2"},b.createElement("output",{className:"text-sm"},t("main.tabpanel.settings.paint.brush_size"),": ",`${a}`),b.createElement(dF,{className:"mt-2",value:[a],min:ke.PAINT_MIN_BRUSH_SIZE,max:ke.PAINT_MAX_BRUSH_SIZE,onValueChange:([Q])=>s(Q)})),b.createElement("div",{className:"flex-1 flex flex-col space-y-2 justify-end"},b.createElement(fe,{variant:"destructive",children:t("main.tabpanel.settings.paint.delete_paint"),onClick:A.onDelete}),b.createElement(fe,{variant:"outline",children:t("main.tabpanel.settings.paint.reset_paint"),onClick:()=>y.current()}),b.createElement(fe,{variant:"outline",children:t("main.tabpanel.settings.paint.cancel"),onClick:A.onCancel}),b.createElement(fe,{children:t("main.tabpanel.settings.paint.save_paint"),onClick:A.onSave}))))};function xei([A,e]){return A<0&&e>0||A===0||e===0}function rpA(A,e){return A?A.type==="nominal"?!0:xei(A.value)===e:!1}function Fei([A,e]){return A>0?[0,e]:e<0?[A,0]:[A,e]}const Mei=({themeConfig:A,themeKey:e})=>{const t=xt(),{showPainterPanel:i,allFields:n,layout:o,config:g}=t,{geoms:a,timezoneDisplayOffset:s}=g,{zeroScale:I}=o,{t:r}=ve(),C=Og(),[l,c]=p.useState(!0),B=p.useRef(null),[E,u]=p.useState(pj),[d,f]=p.useState(null),[w,y]=p.useState(),[G,R]=p.useState(),[x,F]=p.useState(),[Q,k]=p.useState(),[h,N]=p.useState([]);p.useEffect(()=>{i&&(c(!0),(async()=>{var _,q,$,nA,j,O;const{paintInfo:eA,allFields:oA}=t,tA=async iA=>{if(iA.semanticType==="quantitative"){const aA=await sM(C,iA,{range:!0,values:!1,valuesMeta:!1},oA);return{domain:{type:"quantitative",value:I?Fei(aA.range):aA.range,width:ke.PAINT_MAP_SIZE},fid:iA.fid}}else{const aA=(await sM(C,iA,{range:!1,values:!0,valuesMeta:!1},oA)).values.map(lA=>lA.value).sort();return{domain:{type:"nominal",value:aA,width:aA.length},fid:iA.fid}}},sA=async iA=>{const[aA,lA]=await Promise.all([tA(iA.x),tA(iA.y)]);return{x:iA.x,y:iA.y,domainX:aA,domainY:lA,map:SV([lA,aA])}},gA=async iA=>{const aA=Bce(iA),lA=await Promise.all(aA.map(CA=>tA(CA)));return{x:{field:iA.x,domain:lA.find(CA=>CA.fid===iA.x.fid)},y:{field:iA.y,domain:lA.find(CA=>CA.fid===iA.y.fid)},color:iA.color?{field:iA.color,domain:lA.find(CA=>CA.fid===iA.color.fid)}:void 0,size:iA.size?{field:iA.size,domain:lA.find(CA=>CA.fid===iA.size.fid)}:void 0,opacity:iA.opacity?{field:iA.opacity,domain:lA.find(CA=>CA.fid===iA.opacity.fid)}:void 0,shape:iA.shape?{field:iA.shape,domain:lA.find(CA=>CA.fid===iA.shape.fid)}:void 0,map:SV(lA)}};if(eA){if(eA.type==="exist"){const iA=eA.item.facets.at(-1);if(eA.new.type==="new")if(((_=iA.dimensions[0])==null?void 0:_.fid)!==eA.new.y.fid||((q=iA.dimensions[1])==null?void 0:q.fid)!==eA.new.x.fid||!rpA(($=iA.dimensions[0])==null?void 0:$.domain,I)||!rpA((nA=iA.dimensions[1])==null?void 0:nA.domain,I)){const{domainX:aA,domainY:lA,map:CA}=await sA(eA.new);eA.item.facets[0]&&!eA.item.facets[0].usedColor&&(eA.item.facets[0].usedColor=eA.item.usedColor),B.current=CA,bt.unstable_batchedUpdates(()=>{u(eA.item.dict),F(aA),k(lA),N(eA.item.facets),y(eA.new.x),R(eA.new.y),f(null),c(!1)})}else{B.current=await OiA(iA.map);const aA=(j=iA.dimensions.at(-1))==null?void 0:j.fid,lA=(O=iA.dimensions.at(-2))==null?void 0:O.fid,CA=oA.find(uA=>uA.fid===aA),QA=oA.find(uA=>uA.fid===lA);bt.unstable_batchedUpdates(()=>{u(eA.item.dict),F(iA.dimensions.at(-1)),k(iA.dimensions.at(-2)),N(eA.item.facets.slice(0,-1)),y(CA),R(QA),f(null),c(!1)})}else if(eA.new.type==="agg")if(Bce(eA.new).every((aA,lA)=>{const CA=iA.dimensions[lA];return(aA==null?void 0:aA.fid)===(CA==null?void 0:CA.fid)&&rpA(CA==null?void 0:CA.domain,I)})){B.current=await OiA(iA.map);const{map:aA,...lA}=await gA(eA.new);bt.unstable_batchedUpdates(()=>{u(eA.item.dict),f(lA),N(eA.item.facets.slice(0,-1)),F(void 0),k(void 0),y(void 0),R(void 0),c(!1)})}else{const{map:aA,...lA}=await gA(eA.new);B.current=aA,bt.unstable_batchedUpdates(()=>{u(pj),f(lA),N(eA.item.facets),F(void 0),k(void 0),y(void 0),R(void 0),c(!1)})}else throw new Error("paintInfo.new.type is not supported")}else if(eA.type==="new"){const{domainX:iA,domainY:aA,map:lA}=await sA(eA);B.current=lA,bt.unstable_batchedUpdates(()=>{u(pj),F(iA),k(aA),y(eA.x),R(eA.y),f(null),N([]),c(!1)})}else if(eA.type==="agg"){const{map:iA,...aA}=await gA(eA);B.current=iA,bt.unstable_batchedUpdates(()=>{u(pj),f(aA),N([]),F(void 0),k(void 0),y(void 0),R(void 0),c(!1)})}}})())},[i,t,C,I]);const v=async()=>{const _=x&&Q?[Q,x]:d?[d.x,d.y,d.color,d.size,d.opacity,d.shape].map(q=>q==null?void 0:q.domain).filter(q=>!!q):null;if(_&&B.current){const q=[...h,{map:await U3e(B.current),dimensions:_,usedColor:Array.from(new Set(B.current)).map(nA=>nA||1)}],$=Object.keys(E).map(nA=>parseInt(nA)).concat($d);t.updatePaint({dict:E,facets:q,usedColor:Array.from(new Set(q.flatMap(nA=>nA.usedColor??$)))},r("constant.paint_key"))}t.setShowPainter(!1)},K=p.useCallback(()=>{N([])},[]),U=p.useContext(sQ),V=p.useContext(znA),X=p.useMemo(()=>{const _=A??Z9[e??"vega"];return{..._==null?void 0:_[U],background:BSA(V[U].background)}},[V,A,e,U]);return b.createElement(sa,{open:i,onOpenChange:()=>{t.setShowPainter(!1)}},b.createElement(ra,null,l&&b.createElement(nr,null),!l&&!d&&b.createElement(Rei,{mark:a[0],vegaConfig:X,onSave:v,onDelete:()=>{t.updatePaint(null,""),t.setShowPainter(!1)},onCancel:()=>{t.setShowPainter(!1)},x:w,y:G,facets:h,allFields:n,domainX:x,domainY:Q,dict:E,onChangeDict:u,paintMapRef:B,onReset:K,displayOffset:s}),!l&&d&&b.createElement(Nei,{mark:a[0],vegaConfig:X,onSave:v,onDelete:()=>{t.updatePaint(null,""),t.setShowPainter(!1)},onCancel:()=>{t.setShowPainter(!1)},x:d.x,y:d.y,color:d.color,size:d.size,opacity:d.opacity,shape:d.shape,facets:h,allFields:n,dict:E,onChangeDict:u,paintMapRef:B,onReset:K,displayOffset:s})))},vei=ze(Mei),Lei=an.div`
    min-width: 100px;
    position: absolute;
    z-index: 99;
    cursor: pointer;
    padding: 4px;
`,Sei=A=>{const{x:e,y:t,children:i}=A,[n,o]=p.useState(),g=p.useCallback(I=>{I&&o(I.getBoundingClientRect())},[]),a=e-((n==null?void 0:n.left)??0),s=t-((n==null?void 0:n.top)??0);return b.createElement("div",{ref:g},b.createElement(Lei,{className:"shadow-lg text-sm border rounded-md bg-popover text-popover-foreground border-border",style:{left:a,top:s}},i))},Hei=Sei,Zei=ze(function(){const A=xt(),{t:e}=ve(),{vizEmbededMenu:t}=A;return b.createElement(VX,{appear:!0,show:t.show,className:"absolute inset-0",enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95"},b.createElement(Hei,{x:t.position[0],y:t.position[1]},ke.EMBEDED_MENU_LIST.map(i=>{switch(i){case"data_interpretation":return b.createElement("div",{key:i,className:"flex items-center whitespace-nowrap rounded-md transition-colors py-1 px-4 hover:bg-accent hover:text-accent-foreground cursor-pointer",onClick:()=>{A.closeEmbededMenu(),A.setShowInsightBoard(!0)}},b.createElement("span",{className:"flex-1 pr-2"},e("App.labels.data_interpretation")),b.createElement(vFA,{className:"ml-1 w-3 flex-grow-0 flex-shrink-0"}));case"data_view":return b.createElement("div",{key:i,className:"flex items-center whitespace-nowrap rounded-md transition-colors py-1 px-4 hover:bg-accent hover:text-accent-foreground cursor-pointer",onClick:()=>{A.closeEmbededMenu(),A.setShowDataBoard(!0)}},b.createElement("span",{className:"flex-1 pr-2"},e("App.labels.data_view")));default:return console.error("Unknown item",i),null}})))}),Wei=ze(function({hideProfiling:A}){const e=xt(),t=Og(),{showDataBoard:i,selectedMarkObject:n,allFields:o,config:g,viewFilters:a}=e,s=p.useMemo(()=>{const l=mV(n),c=Object.entries(l).filter(B=>![fi,yi,no].includes(B[0])&&xi(B[1]));return xi(l[fi])&&xi(l[yi])&&c.push([l[fi],l[yi]]),c.map(([B,E])=>({fid:B,rule:{type:"one of",value:[E]}}))},[n]),I=p.useMemo(()=>o.filter(l=>l.fid!==no&&l.computed&&l.expression&&l.aggName!=="expr"),[o]),r=p.useMemo(()=>l=>t(yKe(RvA(l,a.map(c=>({fid:c.fid,rule:c.rule})).filter(c=>!!c.rule).concat(s)),I.map(c=>({expression:wF(c.expression,o,g),key:c.fid})))),[t,s,I,o,g]),C=p.useMemo(()=>o.filter(l=>l.aggName!=="expr").filter(l=>![fi,yi,no].includes(l.fid)),[o]);return b.createElement(sa,{open:i,onOpenChange:()=>{e.setShowDataBoard(!1)}},b.createElement(ra,null,b.createElement("div",{className:"mt-4"},b.createElement(Nq,{hideProfiling:A,size:100,computation:r,metas:C,disableFilter:!0,displayOffset:g.timezoneDisplayOffset}))))}),Kei=Wei;function Ece(A){const e=p.useRef(null),[t,i]=p.useState(!1),[n,o]=p.useState(A.defaultWidth),g=b.useCallback(()=>{i(!0)},[]),a=b.useCallback(()=>{i(!1)},[]),s=b.useCallback(I=>{t&&o(I.clientX-e.current.getBoundingClientRect().left)},[t]);return b.useEffect(()=>(window.addEventListener("mousemove",s),window.addEventListener("mouseup",a),()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",a)}),[s,a]),b.createElement("div",{className:`relative ${A.className}`,style:{width:n},ref:e},A.children,b.createElement("div",{className:`absolute right-0 inset-y-0 cursor-col-resize ${A.handlerClassName}`,style:{width:A.handleWidth??6},onMouseDown:g}))}const Uei=new Set(["column","row","color","opacity","shape","size","details","theta","x","y","facet","order","radius"]),Vei=A=>Uei.has(A),Xei=new Set(["sum","count","max","min","mean","median","variance","stdev"]),zei=A=>!!A&&Xei.has(A),tZ={fid:"gw_count_fid",name:"Row count",analyticType:"measure",semanticType:"quantitative",aggName:"sum",computed:!0,expression:{op:"one",params:[],as:"gw_count_fid"}},Tei=A=>A==="zero"||A===!0?"stack":A===null?"none":A;function uce(A){let e="none";if(typeof A=="string"?e=A:A&&A instanceof Object&&(e=A.order??"ascending"),e!=="none"){const t=["x","y","color","size","opacity"];if(e.startsWith("-")||e==="descending")return"descending";if(t.indexOf(e)>-1||e==="ascending")return"ascending"}}const _ei={row:"facetY",facet:"facetY",column:"facetX",x:"column",y:"row",opacity:"opacity",size:"size",shape:"shape",radius:"radius",theta:"theta",details:"details",text:"text",color:"color"},dce=new Set(["theta","x","y"]);function Oei(A){const e=`gw_${XMA(4)}`;return{fid:e,name:`bin(${A.name})`,semanticType:"ordinal",analyticType:"dimension",computed:!0,expression:{op:"bin",as:e,params:[{type:"field",value:A.fid}]}}}function qei(A,e,t){switch(A){case"order":return{sort:uce(e.sort)};default:const i=dce.has(A),n=t.get(e.field)??tZ,o=e.bin?Oei(n):n,g=o===tZ?"count":zei(e.aggregate)&&i?e.aggregate:void 0;let a;return o===tZ||g?a="measure":o.analyticType==="measure"&&dce.has(A)?a="auto":a="dimension",{dimension:o,binDimension:e.bin?o:void 0,dimensionType:_ei[A],analyticType:a,aggregate:g,stack:Tei(e.stack),sort:e.sort?uce(e.sort):void 0}}}const yY=A=>Object.keys(A).map(e=>({name:e,value:A[e]}));function iZ(A){function e(t){switch(t){case"interval":case"bar":return"bar";case"line":return"line";case"boxplot":return"boxplot";case"area":return"area";case"point":return"point";case"arc":return"arc";case"circle":return"circle";case"heatmap":return"circle";case"rect":return"rect";case"tick":default:return"tick"}}return e(typeof A=="string"?A:A.type)}const hce=A=>{switch(A){case"==":case"===":case"equal":case"oneOf":return"one of";case"!=":case"!==":return"not in";case">":case">=":case"<":case"<=":case"lt":case"lte":case"gt":case"gte":case"range":return"range"}return"one of"};function mce(A,e){const t=new Set,i=[];return A.forEach(n=>{const o=e(n);t.has(o)||(t.add(o),i.push(n))}),i}function pce(A,e,t,i){let n="tick";const o=[];A.facet&&o.push(...yY(A.facet)),A.encoding&&o.push(...yY(A.encoding)),A.mark&&(n=iZ(A.mark)),A.spec&&(n=iZ(A.spec.mark),A.spec.encoding&&o.push(...yY(A.spec.encoding))),A.concat&&A.concat.forEach(y=>{n=iZ(y.mark),y.encoding&&o.push(...yY(y.encoding))}),A.hconcat&&A.hconcat.forEach(y=>{n=iZ(y.mark),y.encoding&&o.push(...yY(y.encoding))}),A.vconcat&&A.vconcat.forEach(y=>{n=iZ(y.mark),y.encoding&&o.push(...yY(y.encoding))});const g={},a=new Map,s=new Map;e.forEach(y=>{s.set(y.name,y)});const I=(y,G,R)=>{const x=`${y}|${hce(G)}`;a.has(x)||a.set(x,{field:y,rule:hce(G),value:[]}),G.startsWith(">")||G.startsWith("gt")?a.get(x).value=[R,a.get(x).value[1]??null]:G.startsWith("<")||G.startsWith("lt")?a.get(x).value=[a.get(x).value[0]??null,R]:G==="range"?a.get(x).value=R:G==="oneOf"?a.get(x).value.push(...R):a.get(x).value.push(R)};A.transform&&A.transform.forEach(y=>{if(y.fold&&(g.folds=y.fold.map(G=>{var R;return((R=s.get(G))==null?void 0:R.fid)??G})),y.filter&&(typeof y.filter=="string"&&y.filter.split(/[\&\&|\|\|]/g).forEach(G=>{const R=/datum(\.[A-z_]+|\[['"][A-z\s_]+['"]\])\s*((\!=|==|>|<)=?)\s*(.*)/.exec(G);if(R){const x=/(?:\.|\[["'])([A-z\s_]*)(?:["']\])?/.exec(R[1]),F=/["'](.*)["']/.exec(R[4]);if(!x||!F)return;const Q=R[2];I(x[1],Q,F[1])}}),typeof y.filter=="object"))if(y.filter.field==="rank")y.filter.lte?g.limit=y.filter.lte:y.filter.lt&&(g.limit=Math.floor(y.filter.lt),g.limit==y.filter.lt&&(g.limit-=1));else{const G=Object.keys(y.filter).find(R=>["equal","oneOf","lt","lte","gt","gte","range"].includes(R));G&&I(y.filter.field,G,y.filter[G])}});const r=Array.from(a.values()).map(({field:y,rule:G,value:R})=>({fid:y,rule:{type:G,value:R}})),C=o.flatMap(({name:y,value:G})=>Vei(y)?[qei(y,G,s)]:[]),l=C.reduce((y,G)=>y||!!G.aggregate,!1),c=C.reduce((y,G)=>G.sort??y,"none"),B=C.reduce((y,G)=>G.stack??y,["bar","area","arc"].includes(n)?"stack":"none"),E=C.reduce((y,G)=>G.binDimension&&!y.has(G.binDimension.name)?y.set(G.binDimension.name,G.binDimension):y,new Map),u=C.flatMap(y=>{if(y.dimension&&y.dimensionType){if(y.binDimension)return[{name:y.dimensionType,value:E.get(y.binDimension.name)??y.binDimension}];const G=y.analyticType==="auto"?l?"dimension":"measure":y.analyticType;return[{name:y.dimensionType,value:{...y.dimension,analyticType:G,...y.aggregate?{aggName:y.aggregate}:{},...c&&c!=="none"&&(y.dimensionType==="column"||y.dimensionType==="row")&&G==="dimension"?{sort:c}:{}}}]}return[]}),d=y=>G=>G.name===y,f=y=>y.value,w=y=>mce(y,G=>G.fid);return hvA({visId:t,name:i,encodings:{dimensions:e.filter(y=>y.analyticType==="dimension").concat(...E.values()),measures:e.filter(y=>y.analyticType==="measure"&&y.fid!==tZ.fid).concat(tZ),columns:w(u.filter(d("facetX")).concat(u.filter(d("column"))).map(f)),rows:w(u.filter(d("facetY")).concat(u.filter(d("row"))).map(f)),details:w(u.filter(d("details")).map(f)),opacity:w(u.filter(d("opacity")).map(f)),radius:w(u.filter(d("radius")).map(f)),shape:w(u.filter(d("shape")).map(f)),size:w(u.filter(d("size")).map(f)),text:w(u.filter(d("text")).map(f)),theta:w(u.filter(d("theta")).map(f)),color:w(u.filter(d("color")).map(f)),filters:mce(r.map(y=>({...s.get(y.fid),rule:y.rule})),y=>{var G;return`${y.fid}_${(G=y.rule)==null?void 0:G.type}`})},layout:{stack:B},config:{defaultAggregated:l,geoms:[n],...g}})}function jei(A){return b.forwardRef(function({placeholder:e,onChange:t,value:i},n){const o=A(i);return b.createElement("div",{className:"relative flex min-h-[60px] w-full rounded-md border border-input bg-transparent text-sm shadow-sm"},b.createElement("div",{className:"absolute whitespace-pre inset-0 pointer-events-none px-3 py-2",dangerouslySetInnerHTML:{__html:o}}),e&&i===""&&b.createElement("div",{className:"px-3 py-2 pointer-events-none text-muted-foreground absolute inset-0 select-none"},e),b.createElement("div",{ref:n,contentEditable:"plaintext-only",onInput:g=>{const a=g.currentTarget.textContent??"";t==null||t(a)},className:"px-3 py-2 w-full focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 rounded-md border-0 text-transparent caret-foreground"}))})}const Pei=new RegExp(`\\b(${Array.from(z3e).join("|")})\\b`,"gi"),$ei=new RegExp(`\\b(${Array.from(T3e).join("|")})(\\s*)\\(`,"gi"),Ati=new RegExp(`\\b(${Array.from(ivA).join("|")})(\\s*)\\(`,"gi"),eti=/('[^']*'?)/g,tti=ze(()=>{const A=xt(),{editingComputedFieldFid:e}=A,[t,i]=p.useState(""),[n,o]=p.useState(""),[g,a]=p.useState(""),s=p.useRef(null),I=p.useMemo(()=>{const r=A.allFields.filter(l=>![no,fi,yi,In].includes(l.fid)).map(l=>l.name.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|"),C=r.length>0?new RegExp(`\\b(${r})\\b`,"gi"):null;return jei(l=>(C&&(l=l.replace(C,'<span class="text-blue-700 dark:text-blue-600">$1</span>')),l=l.replace(Pei,'<span class="text-fuchsia-700 dark:text-fuchsia-600">$1</span>'),l=l.replace($ei,'<span class="text-yellow-700 dark:text-yellow-600">$1</span>$2('),l=l.replace(Ati,'<span class="text-amber-700 dark:text-amber-600">$1</span>$2('),l=l.replace(eti,'<span class="text-green-700 dark:text-green-600">$1</span>'),l))},[A.allFields]);return p.useEffect(()=>{var r;if(xi(e))if(e===""){let C=1;for(;A.allFields.find(l=>l.name===`Computed ${C}`);)C++;bt.unstable_batchedUpdates(()=>{i(`Computed ${C}`),o(""),a("")}),s.current&&(s.current.innerHTML="")}else{const C=A.allFields.find(c=>c.fid===e);if(!C||!C.computed||((r=C.expression)==null?void 0:r.op)!=="expr"){A.setComputedFieldFid("");return}const l=C.expression.params.find(c=>c.type==="sql");if(!l){A.setComputedFieldFid("");return}bt.unstable_batchedUpdates(()=>{i(C.name),o(l.value),a("")}),s.current&&(s.current.innerHTML=l.value)}},[e,A]),xi(e)?b.createElement(sa,{open:!0,onOpenChange:()=>{A.setComputedFieldFid()}},b.createElement(ra,null,b.createElement("div",{className:"flex flex-col space-y-2"},b.createElement("div",null,b.createElement("div",{className:"text-xl font-bold"},e===""?"Add Computed Field":"Edit Computed Field"),b.createElement("span",{className:"text-xs text-muted-foreground"},"Computed fields guide:"," ",b.createElement("a",{target:"_blank",className:"underline text-primary",href:"https://github.com/Kanaries/graphic-walker/wiki/How-to-Create-Computed-field-in-Graphic-Walker"},"read here"))),b.createElement("div",{className:"flex flex-col space-y-2"},b.createElement("label",{className:"text-ml whitespace-nowrap"},"Name"),b.createElement(oo,{type:"text",value:t,placeholder:"Enter Field Name...",onChange:r=>{i(r.target.value)}}),b.createElement("label",{className:"text-ml whitespace-nowrap"},"SQL"),b.createElement(I,{ref:s,value:n,onChange:o,placeholder:"Enter SQL..."})),g&&b.createElement("div",{className:"text-xs text-red-500"},g),b.createElement("div",{className:"flex justify-end space-x-2"},b.createElement(fe,{disabled:!n||!t,children:e===""?"Add":"Edit",onClick:()=>{try{A.upsertComputedField(e,t,n),A.setComputedFieldFid()}catch(r){a(dk(r))}}}),b.createElement(fe,{variant:"outline",children:"Cancel",onClick:()=>A.setComputedFieldFid()}))))):null}),iti=tti;function nti(A){return function(e){let t=e.children;return Object.keys(A).forEach(i=>{const n=A[i];t=b.createElement(n.Provider,{value:e[i]},t)}),t}}const bj=nti({ComputationContext:GF,themeContext:sQ,vegaThemeContext:hX,portalContainerContext:Ry}),IpA=p.forwardRef(({className:A,...e},t)=>p.createElement("div",{ref:t,className:Ce("rounded-xl border bg-card text-card-foreground shadow",A),...e}));IpA.displayName="Card";const oti=p.forwardRef(({className:A,...e},t)=>p.createElement("div",{ref:t,className:Ce("flex flex-col space-y-1.5 p-6",A),...e}));oti.displayName="CardHeader";const CpA=p.forwardRef(({className:A,...e},t)=>p.createElement("h3",{ref:t,className:Ce("font-semibold leading-none tracking-tight",A),...e}));CpA.displayName="CardTitle";const gti=p.forwardRef(({className:A,...e},t)=>p.createElement("p",{ref:t,className:Ce("text-sm text-muted-foreground",A),...e}));gti.displayName="CardDescription";const lpA=p.forwardRef(({className:A,...e},t)=>p.createElement("div",{ref:t,className:Ce("p-6 pt-0",A),...e}));lpA.displayName="CardContent";const ati=p.forwardRef(({className:A,...e},t)=>p.createElement("div",{ref:t,className:Ce("flex items-center p-6 pt-0",A),...e}));ati.displayName="CardFooter";var wj="Collapsible",[sti,q0i]=Tg(wj),[rti,cpA]=sti(wj),fce=p.forwardRef((A,e)=>{const{__scopeCollapsible:t,open:i,defaultOpen:n,disabled:o,onOpenChange:g,...a}=A,[s,I]=is({prop:i,defaultProp:n??!1,onChange:g,caller:wj});return cA(rti,{scope:t,disabled:o,contentId:_o(),open:s,onOpenToggle:p.useCallback(()=>I(r=>!r),[I]),children:cA(re.div,{"data-state":QpA(s),"data-disabled":o?"":void 0,...a,ref:e})})});fce.displayName=wj;var yce="CollapsibleTrigger",bce=p.forwardRef((A,e)=>{const{__scopeCollapsible:t,...i}=A,n=cpA(yce,t);return cA(re.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||!1,"data-state":QpA(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...i,ref:e,onClick:TA(A.onClick,n.onOpenToggle)})});bce.displayName=yce;var BpA="CollapsibleContent",wce=p.forwardRef((A,e)=>{const{forceMount:t,...i}=A,n=cpA(BpA,A.__scopeCollapsible);return cA(qg,{present:t||n.open,children:({present:o})=>cA(Iti,{...i,ref:e,present:o})})});wce.displayName=BpA;var Iti=p.forwardRef((A,e)=>{const{__scopeCollapsible:t,present:i,children:n,...o}=A,g=cpA(BpA,t),[a,s]=p.useState(i),I=p.useRef(null),r=Te(e,I),C=p.useRef(0),l=C.current,c=p.useRef(0),B=c.current,E=g.open||a,u=p.useRef(E),d=p.useRef(void 0);return p.useEffect(()=>{const f=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(f)},[]),_g(()=>{const f=I.current;if(f){d.current=d.current||{transitionDuration:f.style.transitionDuration,animationName:f.style.animationName},f.style.transitionDuration="0s",f.style.animationName="none";const w=f.getBoundingClientRect();C.current=w.height,c.current=w.width,u.current||(f.style.transitionDuration=d.current.transitionDuration,f.style.animationName=d.current.animationName),s(i)}},[g.open,i]),cA(re.div,{"data-state":QpA(g.open),"data-disabled":g.disabled?"":void 0,id:g.contentId,hidden:!E,...o,ref:r,style:{"--radix-collapsible-content-height":l?`${l}px`:void 0,"--radix-collapsible-content-width":B?`${B}px`:void 0,...A.style},children:E&&n})});function QpA(A){return A?"open":"closed"}var Cti=fce;const lti=Cti,cti=bce,Bti=wce,Dce=p.forwardRef(({className:A,...e},t)=>p.createElement("textarea",{className:Ce("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",A),ref:t,...e}));Dce.displayName="Textarea";async function Qti(A,e,t,i){const n=await(await fetch(A,{headers:{"Content-Type":"application/json",...i},credentials:"include",method:"POST",body:JSON.stringify({metas:e,messages:t})})).json();if(n.success)return n.data;throw new Error(n.message)}async function Eti(A,e,t){const i=e.chats.concat({role:"user",content:e.query,type:"normal"});return typeof A=="string"?Qti(A,e.metas,i,t):A(e.metas,i)}function uti(A){const e=A.message.type==="generated";return b.createElement(IpA,null,b.createElement("div",{className:"p-6 pb-2 flex space-x-2 items-center"},b.createElement("div",{className:"p-1 w-6 h-6 rounded-full bg-muted"},b.createElement(zHe,{className:"w-4 h-4"})),b.createElement(CpA,{className:"flex-1"},"You"),A.onRemove&&b.createElement(fe,{variant:"ghost",size:"icon-sm",onClick:A.onRemove},b.createElement(yV,{className:"w-4 h-4"}))),b.createElement(lpA,{className:"pl-14"},e&&b.createElement(lti,null,b.createElement(cti,{className:"text-muted-foreground"},"Click to expand auto generated message"),b.createElement(Bti,{className:"whitespace-pre"},A.message.content)),!e&&A.message.content))}const dti=ze(function(A){const e=Og(),{config:t,encodings:i,layout:n,name:o}=A.message.chart,{vizThemeConfig:g}=p.useContext(hX),a=uk(i),{allFields:s,viewDimensions:I,viewMeasures:r,filters:C}=p.useMemo(()=>{const E=[],u=[],{dimensions:d,measures:f,filters:w,...y}=i,G=[...d,...f],R=Object.keys(y);for(const x of R)for(const F of y[x])F.analyticType==="dimension"?E.push(F):F.analyticType==="measure"&&u.push(F);return{allFields:G,viewDimensions:E,viewMeasures:u,filters:w}},[i]),{viewData:l,loading:c}=WS({allFields:s,viewDimensions:I,viewMeasures:r,filters:C,defaultAggregated:t.defaultAggregated,sort:a,folds:t.folds,limit:t.limit??-1,computationFunction:e,timezoneDisplayOffset:t.timezoneDisplayOffset}),{i18n:B}=ve();return b.createElement(IpA,null,b.createElement("div",{className:"p-6 pb-2 flex space-x-2 items-center"},b.createElement("div",{className:"p-1 w-6 h-6 rounded-full bg-muted"},b.createElement(FSe,{className:"w-4 h-4"})),b.createElement(CpA,{className:"flex-1"},"Viz.GPT"),A.onRemove&&b.createElement(fe,{variant:"ghost",size:"icon-sm",onClick:A.onRemove},b.createElement(yV,{className:"w-4 h-4"}))),b.createElement(lpA,{className:"pl-16"},c&&b.createElement(nr,null),b.createElement(EdA,{vizThemeConfig:g,name:o,data:l,draggableFieldState:i,visualConfig:t,layout:{...n,size:{mode:"auto",width:300,height:200}},locale:B.language,scales:A.scales})))}),hti="https://api.kanaries.net/vis/chat2gw",mti=ze(function(A){const[e,t]=p.useState(""),[i,n]=p.useState(!1),o=xt(),{chatMessages:g,allFields:a}=o,{reportError:s}=w4(),I=async()=>{n(!0),Eti(A.api||hti,{chats:g,metas:a,query:e},A.headers??{}).then(r=>{o.replaceWithNLPQuery(e,JSON.stringify(r)),t("")}).catch(r=>{s(dk(r),502)}).finally(()=>{n(!1)})};return b.createElement("div",{className:"flex flex-col gap-4 p-4 pb-12"},g.map((r,C,l)=>{if(r.role==="assistant")return b.createElement(dti,{message:r,scales:A.scales,key:C,onRemove:C===l.length-1&&r.type==="normal"?()=>o.undo():void 0});if(r.role==="user")return b.createElement(uti,{message:r,key:C,onRemove:C===l.length-2&&r.type=="normal"?()=>o.undo():void 0})}),b.createElement("div",{className:"flex gap-4"},b.createElement(Dce,{className:"resize-none min-h-[36px]",disabled:i,rows:1,value:e,onKeyDown:r=>{r.key==="Enter"&&!r.nativeEvent.isComposing&&!r.shiftKey&&i===!1&&e.length>0&&(r.preventDefault(),I())},placeholder:"Ask question about your data",onChange:r=>t(r.target.value)}),b.createElement(fe,{disabled:i,onClick:I},i&&b.createElement(HLe,{className:"w-3 h-3 mr-2 animate-spin"}),"Submit")))}),pti=ze(function(A){var e,t,i;const{computation:n,darkMode:o="light",i18nLang:g="en-US",enhanceAPI:a,i18nResources:s,themeKey:I="vega",themeConfig:r,vizThemeConfig:C,toolbar:l,geographicData:c,computationTimeout:B=6e4,spec:E,chart:u,vlSpec:d,onError:f,hideSegmentNav:w,hideProfiling:y}=A,{t:G,i18n:R}=ve(),x=R.language;p.useEffect(()=>{s&&fdA(s)},[s]),p.useEffect(()=>{g!==x&&ydA(g)},[g,x]);const F=xt();p.useEffect(()=>{c&&F.setGeographicData(c,c.key)},[F,c]),p.useEffect(()=>{E&&F.replaceNow(WvA(E,F.meta,F.currentVis.name??"Chart 1",F.currentVis.visId))},[E,F]),p.useEffect(()=>{u&&F.importCode(u)},[u,F]),p.useEffect(()=>{if(d){const nA=XV(F.meta,"");F.replaceNow(pce(d,[...nA.encodings.dimensions,...nA.encodings.measures],F.currentVis.visId,F.currentVis.name??"Chart 1"))}},[d,F]);const Q=p.useRef(null),k=p.useRef({download(){}}),h=p.useCallback((nA,j)=>{const O=new Error(`Error${j?`(${j})`:""}: ${nA}`);console.error(O),f==null||f(O),j&&F.updateShowErrorResolutionPanel(j,nA)},[F,f]),{segmentKey:N,vizEmbededMenu:v}=F,[K,U]=p.useState(C??r??I),V=typeof K=="string"?K:I,X=typeof K=="object"?K:r,_=p.useMemo(()=>n?mnA(hnA(n,B),nA=>h(dk(nA),501)):async()=>[],[h,n,B]),[q,$]=p.useState(null);return b.createElement(AEA,{value:{reportError:h}},b.createElement(HH,{fallback:b.createElement("div",null,"Something went wrong"),onError:A.onError},b.createElement(bj,{ComputationContext:_,themeContext:o,vegaThemeContext:{vizThemeConfig:K,setVizThemeConfig:U},portalContainerContext:q},b.createElement("div",{className:lc("App font-sans bg-background text-foreground m-0 p-0 w-full h-full",o==="dark"?"dark":"")},b.createElement(kze,null,b.createElement("div",{className:"bg-background text-foreground w-full h-full"},b.createElement(HmA,null),b.createElement(EH,{value:N,onValueChange:nA=>F.setSegmentKey(nA),className:"w-full h-full flex flex-col"},!w&&b.createElement(WN,{className:"mx-4"},b.createElement(rB,{value:Zu.data},b.createElement(JSe,{className:"w-4 mr-2"})," ",G("App.segments.data")),b.createElement(rB,{value:Zu.vis},b.createElement(aSe,{className:"w-4 mr-2"})," ",G("App.segments.vis")),((e=a==null?void 0:a.features)==null?void 0:e.vlChat)&&b.createElement(rB,{value:Zu.chat},b.createElement(ISe,{className:"w-4 mr-2"})," ",G("App.segments.chat"))),b.createElement(QH,{value:Zu.data},b.createElement("div",{className:"mx-4 -mt-px p-4 border rounded-md rounded-t-none"},b.createElement(aKt,{hideProfiling:y}))),b.createElement(QH,{value:Zu.vis,className:"flex-1 min-h-0 flex flex-col"},!A.hideChartNav&&b.createElement("div",{className:"px-2 mx-2 mt-2"},b.createElement(EHt,null)),b.createElement("div",{style:{marginTop:"0em"},className:Ce("m-4 p-4 border border-border rounded-md rounded-tl-none flex-1 min-h-0 flex flex-col",A.hideChartNav?"border-t-0 rounded-t-none":"")},((t=a==null?void 0:a.features)==null?void 0:t.askviz)&&b.createElement(z7t,{api:typeof a.features.askviz=="boolean"?"":a.features.askviz,feedbackApi:typeof a.features.feedbackAskviz=="boolean"?"":a.features.feedbackAskviz,headers:a==null?void 0:a.header}),b.createElement(dze,{csvHandler:k,rendererHandler:Q,darkModePreference:o,experimentalFeatures:A.experimentalFeatures,exclude:l==null?void 0:l.exclude,extra:l==null?void 0:l.extra}),b.createElement(cKt,null),b.createElement(KPt,{themeKey:V}),F.showDataBoard&&b.createElement(Kei,{hideProfiling:y}),b.createElement(RPt,null),b.createElement(O7t,null),b.createElement(j7t,null),b.createElement($7t,null),b.createElement(iti,null),b.createElement(vei,{themeConfig:X,themeKey:V}),F.showGeoJSONConfigPanel&&b.createElement(K7t,{geoList:A.geoList}),b.createElement("div",{className:"sm:flex flex-1 min-h-0"},b.createElement(Ece,{defaultWidth:240,handleWidth:4,className:"min-w-[100%] max-w-full sm:min-w-[96px] sm:max-w-[35%] flex-shrink-0 sm:min-h-full flex flex-col",handlerClassName:"hidden sm:block"},b.createElement(F6e,null)),b.createElement(Ece,{defaultWidth:180,handleWidth:4,className:"min-w-[100%] max-w-full sm:min-w-[164px] sm:max-w-[314px] flex-shrink-0 flex flex-col",handlerClassName:"hidden sm:block"},b.createElement(k3t,null),b.createElement(O_e,null)),b.createElement("div",{className:"flex-1 min-w-[0px] flex flex-col"},b.createElement("div",null,b.createElement(W_e,null)),b.createElement("div",{className:"my-0.5 sm:ml-0.5 p-1 border relative flex-1 min-h-0",onMouseLeave:()=>{v.show&&F.closeEmbededMenu()},onClick:()=>{v.show&&F.closeEmbededMenu()}},n&&b.createElement(Woe,{csvRef:k,ref:Q,vizThemeConfig:K,computationFunction:_,scales:A.scales??A.channelScales}),b.createElement(Zei,null)))))),((i=a==null?void 0:a.features)==null?void 0:i.vlChat)&&b.createElement(QH,{value:Zu.chat},b.createElement(mti,{api:typeof a.features.vlChat=="boolean"?"":a.features.vlChat,headers:a==null?void 0:a.header,scales:A.scales??A.channelScales}))))),b.createElement("div",{ref:$})))))});function fti(A){const{computation:e,onMetaChange:t,fieldKeyGuard:i,keepAlive:n,storeRef:o,defaultConfig:g,defaultRenderer:a,...s}=A,I=A.appearance??A.dark,r=A.data??A.dataSource,C=A.fields??A.rawFields??[],{computation:l,safeMetas:c,onMetaChange:B}=p.useMemo(()=>{if(r){if(A.fieldKeyGuard){const{safeData:u,safeMetas:d}=EnA(r,C);return{safeMetas:d,computation:k0(u),onMetaChange:(f,w)=>{var y;const G=d.findIndex(R=>R.fid===f);G>=0&&((y=A.onMetaChange)==null||y.call(A,C[G].fid,w))}}}return{safeMetas:C,computation:k0(r),onMetaChange:A.onMetaChange}}return{safeMetas:C,computation:A.computation,onMetaChange:A.onMetaChange}},[C,r||A.computation,A.fieldKeyGuard,A.onMetaChange]),E=gj(I);return b.createElement(dnA,{onMetaChange:B,meta:c,keepAlive:n,storeRef:o,defaultConfig:g,defaultRenderer:a},b.createElement(pti,{darkMode:E,computation:l,...s}))}const yti=ze(function(A){const{computation:e,darkMode:t="light",i18nLang:i="en-US",i18nResources:n,computationTimeout:o=6e4,onError:g,pageSize:a=20,themeConfig:s,themeKey:I,vizThemeConfig:r}=A,{i18n:C}=ve(),l=C.language;p.useEffect(()=>{n&&fdA(n)},[n]),p.useEffect(()=>{i!==l&&ydA(i)},[i,l]);const c=xt(),[B,E]=p.useState(r??s??I),u=p.useCallback((G,R)=>{const x=new Error(`Error${R?`(${R})`:""}: ${G}`);console.error(x),g==null||g(x),R&&c.updateShowErrorResolutionPanel(R,G)},[c,g]),d=p.useMemo(()=>e?mnA(hnA(e,o),G=>u(dk(G),501)):async()=>[],[u,e,o]),f=mV(c.meta),[w,y]=p.useState(null);return b.createElement(AEA,{value:{reportError:u}},b.createElement(HH,{fallback:b.createElement("div",null,"Something went wrong"),onError:A.onError},b.createElement(bj,{ComputationContext:d,themeContext:t,vegaThemeContext:{vizThemeConfig:B,setVizThemeConfig:E},portalContainerContext:w},b.createElement("div",{className:`${t==="dark"?"dark":""} App font-sans bg-background text-foreground h-full m-0 p-0`},b.createElement("div",{className:"bg-background text-foreground h-full"},b.createElement(Nq,{ref:A.tableFilterRef,onMetaChange:c.onMetaChange?(G,R,x)=>{c.updateCurrentDatasetMetas(G,x)}:void 0,size:a,metas:f,computation:d,displayOffset:A.displayOffset,hidePaginationAtOnepage:A.hidePaginationAtOnepage,hideProfiling:A.hideProfiling,disableFilter:A.disableFilter,disableSorting:A.disableSorting,hideSemanticType:A.hideSemanticType})),b.createElement("div",{ref:y})),b.createElement(HmA,null))))});function bti(A){const{dark:e,dataSource:t,computation:i,onMetaChange:n,fieldKeyGuard:o,keepAlive:g,storeRef:a,defaultConfig:s,defaultRenderer:I,...r}=A,C=A.appearance??A.dark,l=A.data??A.dataSource,c=A.fields??A.rawFields??[],{computation:B,safeMetas:E,onMetaChange:u}=p.useMemo(()=>{if(l){if(A.fieldKeyGuard){const{safeData:f,safeMetas:w}=EnA(l,c);return{safeMetas:w,computation:k0(f),onMetaChange:n?(y,G)=>{const R=w.findIndex(x=>x.fid===y);R>=0&&n(c[R].fid,G)}:void 0}}return{safeMetas:c,computation:k0(l),onMetaChange:n}}return{safeMetas:c,computation:A.computation,onMetaChange:n}},[c,l||A.computation,A.fieldKeyGuard,n]),d=gj(C);return b.createElement(dnA,{onMetaChange:u,meta:E,keepAlive:g,storeRef:a,defaultConfig:s,defaultRenderer:I},b.createElement(yti,{darkMode:d,computation:B,...r}))}const Gce={key:"value",ascending:!0},wti=ze(function({field:A,onChange:e}){var t;if(((t=A.rule)==null?void 0:t.type)!=="regexp")return null;const{value:i,caseSensitive:n}=A.rule;return b.createElement("div",{className:"flex flex-col space-y-2 p-2"},b.createElement("label",{className:"text-sm leading-none font-medium"},A.name),b.createElement("div",{className:"relative"},b.createElement(oo,{type:"search",className:"pr-8",value:i,placeholder:"Input Regular Expression...",onChange:o=>{e({type:"regexp",value:o.target.value,caseSensitive:!!n})}}),b.createElement("div",{className:"absolute flex space-x-1 items-center inset-y-0 right-2"},b.createElement(Dj,{label:"Match Case",value:!!n,onChange:o=>{e({type:"regexp",value:i,caseSensitive:o})}},b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},b.createElement("path",{fill:"currentColor",d:"M8.854 11.702h-1l-.816-2.159H3.772l-.768 2.16H2L4.954 4h.935zm-2.111-2.97L5.534 5.45a3.142 3.142 0 0 1-.118-.515h-.021c-.036.218-.077.39-.124.515L4.073 8.732zm7.013 2.97h-.88v-.86h-.022c-.383.66-.947.99-1.692.99c-.548 0-.978-.146-1.29-.436c-.307-.29-.461-.675-.461-1.155c0-1.027.605-1.625 1.815-1.794l1.65-.23c0-.935-.379-1.403-1.134-1.403c-.663 0-1.26.226-1.794.677V6.59c.54-.344 1.164-.516 1.87-.516c1.292 0 1.938.684 1.938 2.052zm-.88-2.782l-1.327.183c-.409.057-.717.159-.924.306c-.208.143-.312.399-.312.768c0 .268.095.489.285.66c.193.169.45.253.768.253a1.41 1.41 0 0 0 1.08-.457c.286-.308.43-.696.43-1.165z"}))))))});function Dj(A){return b.createElement("div",{title:A.label,onClick:()=>{var e;(e=A.onChange)==null||e.call(A,!A.value)},className:lc(A.value?"bg-gray-100 dark:bg-zinc-700":"hover:bg-gray-100 dark:hover:bg-zinc-700","rounded cursor-pointer p-1 w-6 h-6 flex items-center justify-center")},A.children)}const Dti=ze(function({field:A,onChange:e,allFields:t,displayOffset:i}){var n,o;const g=Og(),[a,s]=p.useState(""),[I,r]=p.useState(!1),[C,l]=p.useState(!1),[c,B]=p.useState(!1),E=p.useMemo(()=>a?{value:a,caseSenstive:I,word:C,regexp:c}:void 0,[a,I,C,c]),u=p.useMemo(()=>{const{timeout:Q,...k}=ke.KEYWORD_DEBOUNCE_SETTING;return function(h){return Ik(h,Q,k)}},[]),d=RiA(u)(E),f=A.semanticType==="nominal",w=f?d:void 0,{data:y,currentRows:G,handleSelect:R,loadData:x,loading:F}=rse(A,`${Gce.key}`,g,e,t,{displayOffset:i,keyword:w});return((n=A.rule)==null?void 0:n.type)!=="one of"&&((o=A.rule)==null?void 0:o.type)!=="not in"?null:b.createElement("div",{className:"flex flex-col space-y-2 p-2 relative"},b.createElement("label",{className:"text-sm leading-none font-medium"},A.name),b.createElement(LoA,{className:"w-full"},b.createElement(LoA.Button,{className:"flex shadow-sm items-center h-9 space-x-2 px-4 py-2 rounded-md border w-full text-left text-sm outline-none hover:bg-accent transition-colors bg-popover"},A.rule.value.length>0&&b.createElement("div",{className:"flex flex-1 space-x-2 min-w-[0px]"},b.createElement("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap"},A.rule.type==="not in"?"exclude: ":"",Array.from(A.rule.value).slice(0,3).join(", ")),A.rule.value.length>3&&b.createElement("div",{className:"flex-shrink-0"},"+",A.rule.value.length-3)),A.rule.value.length===0&&b.createElement("div",{className:"flex-1 text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap"},A.rule.type==="one of"?"Select Values...":"Select Values to Exclude..."),b.createElement("span",null,b.createElement(sF,{className:"h-4 w-4 text-gray-400","aria-hidden":"true"}))),b.createElement(VX,{as:p.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1"},b.createElement(LoA.Panel,{className:"absolute mt-2 z-10 border rounded-md inset-x-2 bg-popover shadow-md"},b.createElement("div",{className:"flex flex-col w-full"},f&&b.createElement("div",{className:"relative border-b p-3 flex space-x-2 items-center text-sm"},b.createElement(BHe,{className:"w-4 h-4"}),b.createElement("input",{type:"search",autoFocus:!0,className:"block focus:ring-0 focus:outline-none py-0 pl-0  w-full border-0 shadow-none bg-transparent text-gray-700 text-sm h-4 dark:text-gray-200 placeholder:text-gray-400",value:a,placeholder:"Search Value...",onChange:Q=>{s(Q.target.value)}}),b.createElement("div",{className:"absolute flex space-x-1 items-center inset-y-0 right-3"},b.createElement(Dj,{label:"Match Case",value:I,onChange:r},b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},b.createElement("path",{fill:"currentColor",d:"M8.854 11.702h-1l-.816-2.159H3.772l-.768 2.16H2L4.954 4h.935zm-2.111-2.97L5.534 5.45a3.142 3.142 0 0 1-.118-.515h-.021c-.036.218-.077.39-.124.515L4.073 8.732zm7.013 2.97h-.88v-.86h-.022c-.383.66-.947.99-1.692.99c-.548 0-.978-.146-1.29-.436c-.307-.29-.461-.675-.461-1.155c0-1.027.605-1.625 1.815-1.794l1.65-.23c0-.935-.379-1.403-1.134-1.403c-.663 0-1.26.226-1.794.677V6.59c.54-.344 1.164-.516 1.87-.516c1.292 0 1.938.684 1.938 2.052zm-.88-2.782l-1.327.183c-.409.057-.717.159-.924.306c-.208.143-.312.399-.312.768c0 .268.095.489.285.66c.193.169.45.253.768.253a1.41 1.41 0 0 0 1.08-.457c.286-.308.43-.696.43-1.165z"}))),b.createElement(Dj,{label:"Match Whole Word",value:C,onChange:l},b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},b.createElement("g",{fill:"currentColor"},b.createElement("path",{fillRule:"evenodd",d:"M0 11h1v2h14v-2h1v3H0z",clipRule:"evenodd"}),b.createElement("path",{d:"M6.84 11h-.88v-.86h-.022c-.383.66-.947.989-1.692.989c-.548 0-.977-.145-1.289-.435c-.308-.29-.462-.675-.462-1.155c0-1.028.605-1.626 1.816-1.794l1.649-.23c0-.935-.378-1.403-1.134-1.403c-.662 0-1.26.226-1.794.677v-.902c.541-.344 1.164-.516 1.87-.516c1.292 0 1.938.684 1.938 2.052zm-.88-2.782L4.633 8.4c-.408.058-.716.16-.924.307c-.208.143-.311.399-.311.768c0 .268.095.488.284.66c.194.168.45.253.768.253a1.41 1.41 0 0 0 1.08-.457c.286-.308.43-.696.43-1.165zm3.388 1.987h-.022V11h-.88V2.857h.88v3.61h.021c.434-.73 1.068-1.096 1.902-1.096c.705 0 1.257.247 1.654.741c.401.49.602 1.15.602 1.977c0 .92-.224 1.658-.672 2.213c-.447.551-1.06.827-1.837.827c-.726 0-1.276-.308-1.649-.924m-.022-2.218v.768c0 .455.147.841.44 1.16c.298.315.674.473 1.128.473c.534 0 .951-.204 1.252-.613c.304-.408.456-.975.456-1.702c0-.613-.141-1.092-.424-1.44c-.283-.347-.666-.52-1.15-.52c-.511 0-.923.178-1.235.536c-.311.355-.467.8-.467 1.338"})))),b.createElement(Dj,{label:"Use Regular Expression",value:c,onChange:B},b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},b.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.012 2h.976v3.113l2.56-1.557l.486.885L11.47 6l2.564 1.559l-.485.885l-2.561-1.557V10h-.976V6.887l-2.56 1.557l-.486-.885L9.53 6L6.966 4.441l.485-.885l2.561 1.557zM2 10h4v4H2z",clipRule:"evenodd"}))))),F&&b.createElement("div",{className:"h-24 w-full relative"},b.createElement(nr,null)),!F&&b.createElement(Gti,{field:A,data:y,distinctTotal:G,handleSelect:R,loadData:x,displayOffset:i}))))))}),kce="relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none space-x-2 hover:bg-gray-100 dark:hover:bg-gray-800";function Gti({field:A,distinctTotal:e,data:t,handleSelect:i,loadData:n,displayOffset:o}){const g=p.useRef(null),a=Nge({count:e??0,getScrollElement:()=>g.current,estimateSize:()=>32,overscan:10}),s=p.useMemo(()=>{var I;return A.rule&&(A.rule.type==="not in"||((I=A.rule)==null?void 0:I.type)==="one of")?new Set(A.rule.value.map(r=>tQ(r))):null},[A]);return b.createElement("div",{className:"overflow-y-auto w-full flex flex-col max-h-64 p-1",ref:g},b.createElement("div",{style:{paddingBottom:`${a.getTotalSize()}px`,width:"100%",position:"relative"}},a.getVirtualItems().map(I=>{var r,C;const l=I.index,c=t==null?void 0:t.get(l);if(!c)return b.createElement("div",{key:l,className:lc("animate-pulse",kce),style:{height:`${I.size}px`,transform:`translateY(${I.start}px)`,position:"absolute",top:0,left:0,width:"100%"}},b.createElement("div",{className:"h-4 w-4"}),b.createElement("div",{className:"flex justify-left items-center"},b.createElement("div",{className:"h-3 w-20 bg-slate-200 rounded"})),b.createElement(kti,{effect:()=>n(l),effectId:`${A.fid}_${Gce.key}_${l}`}));const{value:B,count:E}=c,u=!!s&&((r=A.rule)==null?void 0:r.type)==="one of"&&s.has(tQ(B))||!!s&&((C=A.rule)==null?void 0:C.type)==="not in"&&!s.has(tQ(B)),d=A.semanticType==="temporal"?Uu(Sm(o,A.offset)(B)):`${B}`;return b.createElement("div",{key:l,className:kce,style:{height:`${I.size}px`,transform:`translateY(${I.start}px)`,position:"absolute",top:0,left:0,width:"100%"},onClick:()=>i(B,!u,E)},b.createElement(FFA,{className:lc("w-4 h-4",u?"opacity-100":"opacity-0")}),b.createElement("div",{className:"whitespace-nowrap text-ellipsis overflow-hidden min-w-0 flex-1"},d))})),e===0&&b.createElement("div",{className:"py-6 text-center"},"No value found."))}const kti=A=>(p.useEffect(()=>{A.effect()},[A.effectId]),null),Jti=({field:A,allFields:e,onChange:t,displayOffset:i})=>{var n;const o=Og(),[g,a]=p.useState(()=>[0,0,"",!1]);b.useEffect(()=>{wWA(A,e,o,{timezoneDisplayOffset:i})(B=>DWA(B,A.fid,A.offset)).then(([B,E,u])=>a([B,E,u,!0]))},[A.fid]);const[s,I,r,C]=g,l=A.offset??new Date().getTimezoneOffset(),c=b.useCallback(B=>{t({type:"temporal range",value:B,format:r,offset:l})},[r,l]);return((n=A.rule)==null?void 0:n.type)!=="temporal range"?null:C?b.createElement("div",{className:"flex flex-col space-y-2 p-2"},b.createElement("label",{className:"text-sm leading-none font-medium"},A.name),b.createElement("div",{className:"flex space-x-2 items-center h-9"},b.createElement("div",{className:"flex-1"},b.createElement(Bq,{className:"h-9 py-4",displayOffset:i,min:s,max:A.rule.value[1]??I,value:A.rule.value[0]??s,onChange:B=>{var E;return c([B,(E=A.rule)==null?void 0:E.value[1]])}})),b.createElement("div",{className:"flex-shrink-0"},b.createElement(KLe,{className:"w-4 h-4"})),b.createElement("div",{className:"flex-1"},b.createElement(Bq,{className:"h-9 py-4",displayOffset:i,min:A.rule.value[0]??s,max:I,value:A.rule.value[1]??I,onChange:B=>{var E;return c([(E=A.rule)==null?void 0:E.value[0],B])}})))):b.createElement("div",{className:"flex flex-col space-y-2 p-2"},b.createElement("label",{className:"text-sm leading-none font-medium"},A.name),b.createElement("div",{className:"h-9 w-full relative"},b.createElement(nr,null)))},Nti=({field:A,onChange:e,allFields:t,displayOffset:i})=>{var n;const o=Og(),[g]=lq(A,{values:!1,range:!0,valuesMeta:!1,displayOffset:i},"none",o,t),a=g==null?void 0:g.range,s=b.useCallback(I=>{e({type:"range",value:I})},[]);return((n=A.rule)==null?void 0:n.type)!=="range"?null:a?b.createElement(Yti,{name:A.name,value:A.rule.value,range:a,onChange:s}):b.createElement("div",{className:"flex flex-col space-y-2 p-2"},b.createElement("label",{className:"text-sm leading-none font-medium"},A.name),b.createElement("div",{className:"h-9 w-full relative"},b.createElement(nr,null)))};function Yti({name:A,value:e,range:t,onChange:i}){const[n,o]=xiA(e,i),g=10**Math.floor(Math.log10((t[1]-t[0])/100));return b.createElement("div",{className:"flex flex-col space-y-2 p-2"},b.createElement("div",{className:"flex justify-between text-sm leading-none"},b.createElement("label",{className:"font-medium"},A),b.createElement("span",{className:"text-right text-gray-500"},"[",n[0],",",n[1],"]")),b.createElement("div",{className:"flex items-center h-9"},b.createElement(zO,{step:g,min:t[0],max:t[1],value:[n[0]??t[0],n[1]??t[1]],onValueChange:([a,s])=>o([a,s])})))}const Rti=1280,xti=768,Fti=ze(function(A){const{computation:e,darkMode:t="light",i18nLang:i="en-US",i18nResources:n,themeKey:o="vega",themeConfig:g,vizThemeConfig:a,geographicData:s,computationTimeout:I=6e4,spec:r,vlSpec:C,chart:l,onError:c}=A,{i18n:B}=ve(),E=B.language;p.useEffect(()=>{n&&fdA(n)},[n]),p.useEffect(()=>{i!==E&&ydA(i)},[i,E]);const u=xt(),[d,f]=p.useState(a??g??o);p.useEffect(()=>{s&&u.setGeographicData(s,s.key)},[u,s]),p.useEffect(()=>{r&&u.replaceNow(WvA(r,u.meta,u.currentVis.name??"Chart 1",u.currentVis.visId))},[r,u]),p.useEffect(()=>{l&&u.importCode(l)},[l,u]),p.useEffect(()=>{if(C){const x=XV(u.meta,"");u.replaceNow(pce(r,[...x.encodings.dimensions,...x.encodings.measures],u.currentVis.name??"Chart 1",u.currentVis.visId))}},[C,u]);const w=p.useCallback((x,F)=>{const Q=new Error(`Error${F?`(${F})`:""}: ${x}`);console.error(Q),c==null||c(Q),F&&u.updateShowErrorResolutionPanel(F,x)},[u,c]),y=p.useMemo(()=>e?mnA(hnA(e,I),x=>w(dk(x),501)):async()=>[],[w,e,I]),[G,R]=p.useState(null);return b.createElement(AEA,{value:{reportError:w}},b.createElement(HH,{fallback:b.createElement("div",null,"Something went wrong"),onError:A.onError},b.createElement(bj,{ComputationContext:y,themeContext:t,vegaThemeContext:{vizThemeConfig:d,setVizThemeConfig:f},portalContainerContext:G},b.createElement("div",{className:`${t==="dark"?"dark":""} App font-sans bg-background text-foreground m-0 p-0`},b.createElement("div",{className:"flex flex-col space-y-2 bg-background text-foreground"},b.createElement(HmA,null),b.createElement(vti,null),b.createElement("div",{className:A.containerClassName,style:A.containerStyle},e&&b.createElement(Woe,{vizThemeConfig:d,computationFunction:y,scales:A.scales??A.channelScales,overrideSize:A.overrideSize}))),b.createElement("div",{ref:R})))))}),Mti=ze(function({filter:A,onChange:e}){var t,i,n,o,g;const a=xt(),{allFields:s,viewDimensions:I,config:r}=a,{timezoneDisplayOffset:C}=r,l=Og(),c=A.enableAgg?s.find(u=>u.fid===A.fid):void 0,B=A!=null&&A.enableAgg?A.aggName:void 0,E=p.useMemo(()=>{if(c&&I.length>0){const u=Hm([],s,I,[{...c,aggName:B}],!0,"none",[],void 0,C).map(d=>d.type==="view"?{...d,query:d.query.map(f=>f.op==="aggregate"?{...f,measures:f.measures.map(w=>({...w,asFieldKey:w.field}))}:f)}:d);return d=>l({...d,workflow:u.concat(d.workflow.filter(f=>f.type!=="transform"))})}else return l},[l,I,c,B]);return b.createElement(GF.Provider,{value:E},((t=A.rule)==null?void 0:t.type)==="regexp"&&b.createElement(wti,{allFields:s,key:Dy(A),field:A,onChange:e,displayOffset:C}),(((i=A.rule)==null?void 0:i.type)==="not in"||((n=A.rule)==null?void 0:n.type)==="one of")&&b.createElement(Dti,{allFields:s,key:Dy(A),field:A,onChange:e,displayOffset:C}),((o=A.rule)==null?void 0:o.type)==="range"&&b.createElement(Nti,{allFields:s,key:Dy(A),field:A,onChange:e,displayOffset:C}),((g=A.rule)==null?void 0:g.type)==="temporal range"&&b.createElement(Jti,{allFields:s,key:Dy(A),field:A,onChange:e,displayOffset:C}))}),vti=ze(function(){const A=xt(),e=b.useCallback((o,g)=>{o!==null&&A.writeFilter(o,g??null)},[A]),{width:t=0,ref:i}=nEA(),n=t>Rti?"grid-cols-3":t>xti?"grid-cols-2":"grid-cols-1";return b.createElement("div",{className:lc("grid gap-2 px-2",n),ref:i},A.viewFilters.map((o,g)=>b.createElement(Mti,{key:o.fid,filter:o,onChange:a=>e(g,a)})))});function Lti(A){const{dark:e,dataSource:t,computation:i,onMetaChange:n,fieldKeyGuard:o,keepAlive:g,storeRef:a,defaultConfig:s,defaultRenderer:I,...r}=A,C=A.appearance??A.dark,l=A.data??A.dataSource,c=A.fields??A.rawFields??[],{computation:B,safeMetas:E,onMetaChange:u}=p.useMemo(()=>{if(l){if(A.fieldKeyGuard){const{safeData:f,safeMetas:w}=EnA(l,c);return{safeMetas:w,computation:k0(f),onMetaChange:(y,G)=>{var R;const x=w.findIndex(F=>F.fid===y);x>=0&&((R=A.onMetaChange)==null||R.call(A,c[x].fid,G))}}}return{safeMetas:c,computation:k0(l),onMetaChange:A.onMetaChange}}return{safeMetas:c,computation:A.computation,onMetaChange:A.onMetaChange}},[c,l||A.computation,A.fieldKeyGuard,A.onMetaChange]),d=gj(C);return b.createElement(dnA,{onMetaChange:u,meta:E,keepAlive:g,storeRef:a,defaultConfig:s,defaultRenderer:I},b.createElement(Fti,{...r,darkMode:d,computation:B}))}const Jce=ze(p.forwardRef((A,e)=>{const[t,i]=p.useState(null),n=g=>{i(g)},o=()=>{i(null)};return b.createElement(a9,{ref:e},b.createElement(aj,{className:A.className,style:A.style,onMount:n,onUnmount:o,uiTheme:A.uiTheme??A.colorConfig},b.createElement(mtA,{value:{head:t??document.head,body:t??document.body}},b.createElement(fti,{...A}))))})),Nce=ze(p.forwardRef((A,e)=>{const[t,i]=p.useState(null),n=g=>{i(g)},o=()=>{i(null)};return b.createElement(a9,{ref:e},b.createElement(aj,{onMount:n,onUnmount:o,uiTheme:A.uiTheme??A.colorConfig},b.createElement(mtA,{value:{head:t??document.head,body:t??document.body}},b.createElement(Lti,{...A}))))})),Yce=ze(p.forwardRef((A,e)=>{const[t,i]=p.useState(null),n=g=>{i(g)},o=()=>{i(null)};return b.createElement(a9,{ref:e},b.createElement(aj,{style:A.style??{width:"100%",height:"100%"},className:A.className,onMount:n,onUnmount:o,uiTheme:A.uiTheme??A.colorConfig},b.createElement(mtA,{value:{head:t??document.head,body:t??document.body}},b.createElement(bti,{...A}))))})),Sti=p.forwardRef(function(A,e){const{name:t,className:i,themeKey:n,uiTheme:o,colorConfig:g,vizThemeConfig:a,appearance:s,dark:I,visualState:r,visualConfig:C,visualLayout:l,overrideSize:c,locale:B,type:E,themeConfig:u,channelScales:d,scales:f,disableCollapse:w}=A,y=p.useMemo(()=>A.type==="remote"?A.computation:k0(A.rawData),[E,E==="remote"?A.computation:A.rawData]),G=l??C,R=p.useMemo(()=>({...G,...c?{size:c}:{}}),[G,c]),x=R.size.mode,F=uk(r),Q=C.limit??-1,k=(C==null?void 0:C.defaultAggregated)??!1,[h,N]=p.useState([]),{allFields:v,viewDimensions:K,viewMeasures:U,filters:V}=p.useMemo(()=>{const sA=[],gA=[],{dimensions:iA,measures:aA,filters:lA,...CA}=r,QA=[...iA,...aA],uA=Object.keys(CA);for(const fA of uA)for(const hA of CA[fA])hA.analyticType==="dimension"?sA.push(hA):hA.analyticType==="measure"&&gA.push(hA);return{allFields:QA,viewDimensions:sA,viewMeasures:gA,filters:lA}},[r]),{viewData:X,loading:_}=WS({allFields:v,viewDimensions:K,viewMeasures:U,filters:V,defaultAggregated:k,sort:F,folds:C.folds,limit:Q,computationFunction:y,timezoneDisplayOffset:C.timezoneDisplayOffset}),q=p.useRef({data:X});q.current={data:X},p.useEffect(()=>{_===!1&&bt.unstable_batchedUpdates(()=>{N(q.current.data)})},[_]);const{coordSystem:$="generic"}=C,nA=$==="geographic",j=gj(s??I),[O,eA]=p.useState(a??u??n),[oA,tA]=p.useState(null);return b.createElement(aj,{style:x==="full"?{width:"100%",height:"100%"}:void 0,className:i,uiTheme:o??g},b.createElement(bj,{ComputationContext:y,themeContext:j,vegaThemeContext:{vizThemeConfig:O,setVizThemeConfig:eA},portalContainerContext:oA},_&&b.createElement(nr,null),b.createElement("div",{className:`App relative ${j==="dark"?"dark":""}`,style:x==="full"?{width:"100%",height:"100%"}:void 0},nA&&b.createElement("div",{className:"max-w-full",style:{height:U9,flexGrow:1}},b.createElement(mUA,{data:X,draggableFieldState:r,visualConfig:C,visualLayout:R})),nA||b.createElement(EdA,{name:t,data:h,ref:e,draggableFieldState:r,visualConfig:C,layout:R,locale:B??"en-US",scales:f??d,vizThemeConfig:O,disableCollapse:w}),b.createElement("div",{ref:tA}))))}),EpA=ze(A8e(Sti)),Hti=A=>b.createElement("input",{style:{display:"none"},type:"file",ref:A.fileRef,onChange:e=>{const t=e.target.files;if(t!==null){const i=t[0];A.onImport(i)}}}),Zti=Hti;var Rce={exports:{}};/* @license
Papa Parse
v5.4.1
https://github.com/mholt/PapaParse
License: MIT
*/(function(A,e){(function(t,i){A.exports=i()})(um,function t(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},n=!i.document&&!!i.postMessage,o=i.IS_PAPA_WORKER||!1,g={},a=0,s={parse:function(F,Q){var k=(Q=Q||{}).dynamicTyping||!1;if(x(k)&&(Q.dynamicTypingFunction=k,k={}),Q.dynamicTyping=k,Q.transform=!!x(Q.transform)&&Q.transform,Q.worker&&s.WORKERS_SUPPORTED){var h=function(){if(!s.WORKERS_SUPPORTED)return!1;var v=(U=i.URL||i.webkitURL||null,V=t.toString(),s.BLOB_URL||(s.BLOB_URL=U.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",V,")();"],{type:"text/javascript"})))),K=new i.Worker(v),U,V;return K.onmessage=f,K.id=a++,g[K.id]=K}();return h.userStep=Q.step,h.userChunk=Q.chunk,h.userComplete=Q.complete,h.userError=Q.error,Q.step=x(Q.step),Q.chunk=x(Q.chunk),Q.complete=x(Q.complete),Q.error=x(Q.error),delete Q.worker,void h.postMessage({input:F,config:Q,workerId:h.id})}var N=null;return s.NODE_STREAM_INPUT,typeof F=="string"?(F=function(v){return v.charCodeAt(0)===65279?v.slice(1):v}(F),N=Q.download?new C(Q):new c(Q)):F.readable===!0&&x(F.read)&&x(F.on)?N=new B(Q):(i.File&&F instanceof File||F instanceof Object)&&(N=new l(Q)),N.stream(F)},unparse:function(F,Q){var k=!1,h=!0,N=",",v=`\r
`,K='"',U=K+K,V=!1,X=null,_=!1;(function(){if(typeof Q=="object"){if(typeof Q.delimiter!="string"||s.BAD_DELIMITERS.filter(function(j){return Q.delimiter.indexOf(j)!==-1}).length||(N=Q.delimiter),(typeof Q.quotes=="boolean"||typeof Q.quotes=="function"||Array.isArray(Q.quotes))&&(k=Q.quotes),typeof Q.skipEmptyLines!="boolean"&&typeof Q.skipEmptyLines!="string"||(V=Q.skipEmptyLines),typeof Q.newline=="string"&&(v=Q.newline),typeof Q.quoteChar=="string"&&(K=Q.quoteChar),typeof Q.header=="boolean"&&(h=Q.header),Array.isArray(Q.columns)){if(Q.columns.length===0)throw new Error("Option columns is empty");X=Q.columns}Q.escapeChar!==void 0&&(U=Q.escapeChar+K),(typeof Q.escapeFormulae=="boolean"||Q.escapeFormulae instanceof RegExp)&&(_=Q.escapeFormulae instanceof RegExp?Q.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var q=new RegExp(u(K),"g");if(typeof F=="string"&&(F=JSON.parse(F)),Array.isArray(F)){if(!F.length||Array.isArray(F[0]))return $(null,F,V);if(typeof F[0]=="object")return $(X||Object.keys(F[0]),F,V)}else if(typeof F=="object")return typeof F.data=="string"&&(F.data=JSON.parse(F.data)),Array.isArray(F.data)&&(F.fields||(F.fields=F.meta&&F.meta.fields||X),F.fields||(F.fields=Array.isArray(F.data[0])?F.fields:typeof F.data[0]=="object"?Object.keys(F.data[0]):[]),Array.isArray(F.data[0])||typeof F.data[0]=="object"||(F.data=[F.data])),$(F.fields||[],F.data||[],V);throw new Error("Unable to serialize unrecognized input");function $(j,O,eA){var oA="";typeof j=="string"&&(j=JSON.parse(j)),typeof O=="string"&&(O=JSON.parse(O));var tA=Array.isArray(j)&&0<j.length,sA=!Array.isArray(O[0]);if(tA&&h){for(var gA=0;gA<j.length;gA++)0<gA&&(oA+=N),oA+=nA(j[gA],gA);0<O.length&&(oA+=v)}for(var iA=0;iA<O.length;iA++){var aA=tA?j.length:O[iA].length,lA=!1,CA=tA?Object.keys(O[iA]).length===0:O[iA].length===0;if(eA&&!tA&&(lA=eA==="greedy"?O[iA].join("").trim()==="":O[iA].length===1&&O[iA][0].length===0),eA==="greedy"&&tA){for(var QA=[],uA=0;uA<aA;uA++){var fA=sA?j[uA]:uA;QA.push(O[iA][fA])}lA=QA.join("").trim()===""}if(!lA){for(var hA=0;hA<aA;hA++){0<hA&&!CA&&(oA+=N);var yA=tA&&sA?j[hA]:hA;oA+=nA(O[iA][yA],hA)}iA<O.length-1&&(!eA||0<aA&&!CA)&&(oA+=v)}}return oA}function nA(j,O){if(j==null)return"";if(j.constructor===Date)return JSON.stringify(j).slice(1,25);var eA=!1;_&&typeof j=="string"&&_.test(j)&&(j="'"+j,eA=!0);var oA=j.toString().replace(q,U);return(eA=eA||k===!0||typeof k=="function"&&k(j,O)||Array.isArray(k)&&k[O]||function(tA,sA){for(var gA=0;gA<sA.length;gA++)if(-1<tA.indexOf(sA[gA]))return!0;return!1}(oA,s.BAD_DELIMITERS)||-1<oA.indexOf(N)||oA.charAt(0)===" "||oA.charAt(oA.length-1)===" ")?K+oA+K:oA}}};if(s.RECORD_SEP=String.fromCharCode(30),s.UNIT_SEP=String.fromCharCode(31),s.BYTE_ORDER_MARK="\uFEFF",s.BAD_DELIMITERS=["\r",`
`,'"',s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!n&&!!i.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=",",s.Parser=d,s.ParserHandle=E,s.NetworkStreamer=C,s.FileStreamer=l,s.StringStreamer=c,s.ReadableStreamStreamer=B,i.jQuery){var I=i.jQuery;I.fn.parse=function(F){var Q=F.config||{},k=[];return this.each(function(v){if(!(I(this).prop("tagName").toUpperCase()==="INPUT"&&I(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var K=0;K<this.files.length;K++)k.push({file:this.files[K],inputElem:this,instanceConfig:I.extend({},Q)})}),h(),this;function h(){if(k.length!==0){var v,K,U,V,X=k[0];if(x(F.before)){var _=F.before(X.file,X.inputElem);if(typeof _=="object"){if(_.action==="abort")return v="AbortError",K=X.file,U=X.inputElem,V=_.reason,void(x(F.error)&&F.error({name:v},K,U,V));if(_.action==="skip")return void N();typeof _.config=="object"&&(X.instanceConfig=I.extend(X.instanceConfig,_.config))}else if(_==="skip")return void N()}var q=X.instanceConfig.complete;X.instanceConfig.complete=function($){x(q)&&q($,X.file,X.inputElem),N()},s.parse(X.file,X.instanceConfig)}else x(F.complete)&&F.complete()}function N(){k.splice(0,1),h()}}}function r(F){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(Q){var k=G(Q);k.chunkSize=parseInt(k.chunkSize),Q.step||Q.chunk||(k.chunkSize=null),this._handle=new E(k),(this._handle.streamer=this)._config=k}.call(this,F),this.parseChunk=function(Q,k){if(this.isFirstChunk&&x(this._config.beforeFirstChunk)){var h=this._config.beforeFirstChunk(Q);h!==void 0&&(Q=h)}this.isFirstChunk=!1,this._halted=!1;var N=this._partialLine+Q;this._partialLine="";var v=this._handle.parse(N,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var K=v.meta.cursor;this._finished||(this._partialLine=N.substring(K-this._baseIndex),this._baseIndex=K),v&&v.data&&(this._rowCount+=v.data.length);var U=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(o)i.postMessage({results:v,workerId:s.WORKER_ID,finished:U});else if(x(this._config.chunk)&&!k){if(this._config.chunk(v,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);v=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(v.data),this._completeResults.errors=this._completeResults.errors.concat(v.errors),this._completeResults.meta=v.meta),this._completed||!U||!x(this._config.complete)||v&&v.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),U||v&&v.meta.paused||this._nextChunk(),v}this._halted=!0},this._sendError=function(Q){x(this._config.error)?this._config.error(Q):o&&this._config.error&&i.postMessage({workerId:s.WORKER_ID,error:Q,finished:!1})}}function C(F){var Q;(F=F||{}).chunkSize||(F.chunkSize=s.RemoteChunkSize),r.call(this,F),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(k){this._input=k,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(Q=new XMLHttpRequest,this._config.withCredentials&&(Q.withCredentials=this._config.withCredentials),n||(Q.onload=R(this._chunkLoaded,this),Q.onerror=R(this._chunkError,this)),Q.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var k=this._config.downloadRequestHeaders;for(var h in k)Q.setRequestHeader(h,k[h])}if(this._config.chunkSize){var N=this._start+this._config.chunkSize-1;Q.setRequestHeader("Range","bytes="+this._start+"-"+N)}try{Q.send(this._config.downloadRequestBody)}catch(v){this._chunkError(v.message)}n&&Q.status===0&&this._chunkError()}},this._chunkLoaded=function(){Q.readyState===4&&(Q.status<200||400<=Q.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:Q.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(k){var h=k.getResponseHeader("Content-Range");return h===null?-1:parseInt(h.substring(h.lastIndexOf("/")+1))}(Q),this.parseChunk(Q.responseText)))},this._chunkError=function(k){var h=Q.statusText||k;this._sendError(new Error(h))}}function l(F){var Q,k;(F=F||{}).chunkSize||(F.chunkSize=s.LocalChunkSize),r.call(this,F);var h=typeof FileReader<"u";this.stream=function(N){this._input=N,k=N.slice||N.webkitSlice||N.mozSlice,h?((Q=new FileReader).onload=R(this._chunkLoaded,this),Q.onerror=R(this._chunkError,this)):Q=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var N=this._input;if(this._config.chunkSize){var v=Math.min(this._start+this._config.chunkSize,this._input.size);N=k.call(N,this._start,v)}var K=Q.readAsText(N,this._config.encoding);h||this._chunkLoaded({target:{result:K}})},this._chunkLoaded=function(N){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(N.target.result)},this._chunkError=function(){this._sendError(Q.error)}}function c(F){var Q;r.call(this,F=F||{}),this.stream=function(k){return Q=k,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var k,h=this._config.chunkSize;return h?(k=Q.substring(0,h),Q=Q.substring(h)):(k=Q,Q=""),this._finished=!Q,this.parseChunk(k)}}}function B(F){r.call(this,F=F||{});var Q=[],k=!0,h=!1;this.pause=function(){r.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){r.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(N){this._input=N,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){h&&Q.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),Q.length?this.parseChunk(Q.shift()):k=!0},this._streamData=R(function(N){try{Q.push(typeof N=="string"?N:N.toString(this._config.encoding)),k&&(k=!1,this._checkIsFinished(),this.parseChunk(Q.shift()))}catch(v){this._streamError(v)}},this),this._streamError=R(function(N){this._streamCleanUp(),this._sendError(N)},this),this._streamEnd=R(function(){this._streamCleanUp(),h=!0,this._streamData("")},this),this._streamCleanUp=R(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function E(F){var Q,k,h,N=Math.pow(2,53),v=-N,K=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,U=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,V=this,X=0,_=0,q=!1,$=!1,nA=[],j={data:[],errors:[],meta:{}};if(x(F.step)){var O=F.step;F.step=function(iA){if(j=iA,tA())oA();else{if(oA(),j.data.length===0)return;X+=iA.data.length,F.preview&&X>F.preview?k.abort():(j.data=j.data[0],O(j,V))}}}function eA(iA){return F.skipEmptyLines==="greedy"?iA.join("").trim()==="":iA.length===1&&iA[0].length===0}function oA(){return j&&h&&(gA("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),h=!1),F.skipEmptyLines&&(j.data=j.data.filter(function(iA){return!eA(iA)})),tA()&&function(){if(!j)return;function iA(lA,CA){x(F.transformHeader)&&(lA=F.transformHeader(lA,CA)),nA.push(lA)}if(Array.isArray(j.data[0])){for(var aA=0;tA()&&aA<j.data.length;aA++)j.data[aA].forEach(iA);j.data.splice(0,1)}else j.data.forEach(iA)}(),function(){if(!j||!F.header&&!F.dynamicTyping&&!F.transform)return j;function iA(lA,CA){var QA,uA=F.header?{}:[];for(QA=0;QA<lA.length;QA++){var fA=QA,hA=lA[QA];F.header&&(fA=QA>=nA.length?"__parsed_extra":nA[QA]),F.transform&&(hA=F.transform(hA,fA)),hA=sA(fA,hA),fA==="__parsed_extra"?(uA[fA]=uA[fA]||[],uA[fA].push(hA)):uA[fA]=hA}return F.header&&(QA>nA.length?gA("FieldMismatch","TooManyFields","Too many fields: expected "+nA.length+" fields but parsed "+QA,_+CA):QA<nA.length&&gA("FieldMismatch","TooFewFields","Too few fields: expected "+nA.length+" fields but parsed "+QA,_+CA)),uA}var aA=1;return!j.data.length||Array.isArray(j.data[0])?(j.data=j.data.map(iA),aA=j.data.length):j.data=iA(j.data,0),F.header&&j.meta&&(j.meta.fields=nA),_+=aA,j}()}function tA(){return F.header&&nA.length===0}function sA(iA,aA){return lA=iA,F.dynamicTypingFunction&&F.dynamicTyping[lA]===void 0&&(F.dynamicTyping[lA]=F.dynamicTypingFunction(lA)),(F.dynamicTyping[lA]||F.dynamicTyping)===!0?aA==="true"||aA==="TRUE"||aA!=="false"&&aA!=="FALSE"&&(function(CA){if(K.test(CA)){var QA=parseFloat(CA);if(v<QA&&QA<N)return!0}return!1}(aA)?parseFloat(aA):U.test(aA)?new Date(aA):aA===""?null:aA):aA;var lA}function gA(iA,aA,lA,CA){var QA={type:iA,code:aA,message:lA};CA!==void 0&&(QA.row=CA),j.errors.push(QA)}this.parse=function(iA,aA,lA){var CA=F.quoteChar||'"';if(F.newline||(F.newline=function(fA,hA){fA=fA.substring(0,1048576);var yA=new RegExp(u(hA)+"([^]*?)"+u(hA),"gm"),mA=(fA=fA.replace(yA,"")).split("\r"),LA=fA.split(`
`),UA=1<LA.length&&LA[0].length<mA[0].length;if(mA.length===1||UA)return`
`;for(var ne=0,SA=0;SA<mA.length;SA++)mA[SA][0]===`
`&&ne++;return ne>=mA.length/2?`\r
`:"\r"}(iA,CA)),h=!1,F.delimiter)x(F.delimiter)&&(F.delimiter=F.delimiter(iA),j.meta.delimiter=F.delimiter);else{var QA=function(fA,hA,yA,mA,LA){var UA,ne,SA,ae;LA=LA||[",","	","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var EA=0;EA<LA.length;EA++){var wA=LA[EA],se=0,we=0,be=0;SA=void 0;for(var Oe=new d({comments:mA,delimiter:wA,newline:hA,preview:10}).parse(fA),VA=0;VA<Oe.data.length;VA++)if(yA&&eA(Oe.data[VA]))be++;else{var ZA=Oe.data[VA].length;we+=ZA,SA!==void 0?0<ZA&&(se+=Math.abs(ZA-SA),SA=ZA):SA=ZA}0<Oe.data.length&&(we/=Oe.data.length-be),(ne===void 0||se<=ne)&&(ae===void 0||ae<we)&&1.99<we&&(ne=se,UA=wA,ae=we)}return{successful:!!(F.delimiter=UA),bestDelimiter:UA}}(iA,F.newline,F.skipEmptyLines,F.comments,F.delimitersToGuess);QA.successful?F.delimiter=QA.bestDelimiter:(h=!0,F.delimiter=s.DefaultDelimiter),j.meta.delimiter=F.delimiter}var uA=G(F);return F.preview&&F.header&&uA.preview++,Q=iA,k=new d(uA),j=k.parse(Q,aA,lA),oA(),q?{meta:{paused:!0}}:j||{meta:{paused:!1}}},this.paused=function(){return q},this.pause=function(){q=!0,k.abort(),Q=x(F.chunk)?"":Q.substring(k.getCharIndex())},this.resume=function(){V.streamer._halted?(q=!1,V.streamer.parseChunk(Q,!0)):setTimeout(V.resume,3)},this.aborted=function(){return $},this.abort=function(){$=!0,k.abort(),j.meta.aborted=!0,x(F.complete)&&F.complete(j),Q=""}}function u(F){return F.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(F){var Q,k=(F=F||{}).delimiter,h=F.newline,N=F.comments,v=F.step,K=F.preview,U=F.fastMode,V=Q=F.quoteChar===void 0||F.quoteChar===null?'"':F.quoteChar;if(F.escapeChar!==void 0&&(V=F.escapeChar),(typeof k!="string"||-1<s.BAD_DELIMITERS.indexOf(k))&&(k=","),N===k)throw new Error("Comment character same as delimiter");N===!0?N="#":(typeof N!="string"||-1<s.BAD_DELIMITERS.indexOf(N))&&(N=!1),h!==`
`&&h!=="\r"&&h!==`\r
`&&(h=`
`);var X=0,_=!1;this.parse=function(q,$,nA){if(typeof q!="string")throw new Error("Input must be a string");var j=q.length,O=k.length,eA=h.length,oA=N.length,tA=x(v),sA=[],gA=[],iA=[],aA=X=0;if(!q)return le();if(F.header&&!$){var lA=q.split(h)[0].split(k),CA=[],QA={},uA=!1;for(var fA in lA){var hA=lA[fA];x(F.transformHeader)&&(hA=F.transformHeader(hA,fA));var yA=hA,mA=QA[hA]||0;for(0<mA&&(uA=!0,yA=hA+"_"+mA),QA[hA]=mA+1;CA.includes(yA);)yA=yA+"_"+mA;CA.push(yA)}if(uA){var LA=q.split(h);LA[0]=CA.join(k),q=LA.join(h)}}if(U||U!==!1&&q.indexOf(Q)===-1){for(var UA=q.split(h),ne=0;ne<UA.length;ne++){if(iA=UA[ne],X+=iA.length,ne!==UA.length-1)X+=h.length;else if(nA)return le();if(!N||iA.substring(0,oA)!==N){if(tA){if(sA=[],be(iA.split(k)),ce(),_)return le()}else be(iA.split(k));if(K&&K<=ne)return sA=sA.slice(0,K),le(!0)}}return le()}for(var SA=q.indexOf(k,X),ae=q.indexOf(h,X),EA=new RegExp(u(V)+u(Q),"g"),wA=q.indexOf(Q,X);;)if(q[X]!==Q)if(N&&iA.length===0&&q.substring(X,X+oA)===N){if(ae===-1)return le();X=ae+eA,ae=q.indexOf(h,X),SA=q.indexOf(k,X)}else if(SA!==-1&&(SA<ae||ae===-1))iA.push(q.substring(X,SA)),X=SA+O,SA=q.indexOf(k,X);else{if(ae===-1)break;if(iA.push(q.substring(X,ae)),ZA(ae+eA),tA&&(ce(),_))return le();if(K&&sA.length>=K)return le(!0)}else for(wA=X,X++;;){if((wA=q.indexOf(Q,wA+1))===-1)return nA||gA.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:sA.length,index:X}),VA();if(wA===j-1)return VA(q.substring(X,wA).replace(EA,Q));if(Q!==V||q[wA+1]!==V){if(Q===V||wA===0||q[wA-1]!==V){SA!==-1&&SA<wA+1&&(SA=q.indexOf(k,wA+1)),ae!==-1&&ae<wA+1&&(ae=q.indexOf(h,wA+1));var se=Oe(ae===-1?SA:Math.min(SA,ae));if(q.substr(wA+1+se,O)===k){iA.push(q.substring(X,wA).replace(EA,Q)),q[X=wA+1+se+O]!==Q&&(wA=q.indexOf(Q,X)),SA=q.indexOf(k,X),ae=q.indexOf(h,X);break}var we=Oe(ae);if(q.substring(wA+1+we,wA+1+we+eA)===h){if(iA.push(q.substring(X,wA).replace(EA,Q)),ZA(wA+1+we+eA),SA=q.indexOf(k,X),wA=q.indexOf(Q,X),tA&&(ce(),_))return le();if(K&&sA.length>=K)return le(!0);break}gA.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:sA.length,index:X}),wA++}}else wA++}return VA();function be(de){sA.push(de),aA=X}function Oe(de){var rt=0;if(de!==-1){var en=q.substring(wA+1,de);en&&en.trim()===""&&(rt=en.length)}return rt}function VA(de){return nA||(de===void 0&&(de=q.substring(X)),iA.push(de),X=j,be(iA),tA&&ce()),le()}function ZA(de){X=de,be(iA),iA=[],ae=q.indexOf(h,X)}function le(de){return{data:sA,errors:gA,meta:{delimiter:k,linebreak:h,aborted:_,truncated:!!de,cursor:aA+($||0)}}}function ce(){v(le()),sA=[],gA=[]}},this.abort=function(){_=!0},this.getCharIndex=function(){return X}}function f(F){var Q=F.data,k=g[Q.workerId],h=!1;if(Q.error)k.userError(Q.error,Q.file);else if(Q.results&&Q.results.data){var N={abort:function(){h=!0,w(Q.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(x(k.userStep)){for(var v=0;v<Q.results.data.length&&(k.userStep({data:Q.results.data[v],errors:Q.results.errors,meta:Q.results.meta},N),!h);v++);delete Q.results}else x(k.userChunk)&&(k.userChunk(Q.results,N,Q.file),delete Q.results)}Q.finished&&!h&&w(Q.workerId,Q.results)}function w(F,Q){var k=g[F];x(k.userComplete)&&k.userComplete(Q),k.terminate(),delete g[F]}function y(){throw new Error("Not implemented.")}function G(F){if(typeof F!="object"||F===null)return F;var Q=Array.isArray(F)?[]:{};for(var k in F)Q[k]=G(F[k]);return Q}function R(F,Q){return function(){F.apply(Q,arguments)}}function x(F){return typeof F=="function"}return o&&(i.onmessage=function(F){var Q=F.data;if(s.WORKER_ID===void 0&&Q&&(s.WORKER_ID=Q.workerId),typeof Q.input=="string")i.postMessage({workerId:s.WORKER_ID,results:s.parse(Q.input,Q.config),finished:!0});else if(i.File&&Q.input instanceof File||Q.input instanceof Object){var k=s.parse(Q.input,Q.config);k&&i.postMessage({workerId:s.WORKER_ID,results:k,finished:!0})}}),(C.prototype=Object.create(r.prototype)).constructor=C,(l.prototype=Object.create(r.prototype)).constructor=l,(c.prototype=Object.create(c.prototype)).constructor=c,(B.prototype=Object.create(r.prototype)).constructor=B,s})})(Rce);var xce=Rce.exports;const Fce=1e4;function Wti(A){const{file:e,config:t,onLoading:i,encoding:n="utf-8"}=A;return new Promise((o,g)=>{t?Uti(e,n,t.size,o,g,i):Kti(e,n,o,g,i)})}function Kti(A,e,t,i,n){const o=[];let g=[],a=-1,s=0;xce.parse(A,{worker:!0,encoding:e,step(I){s+=I.data.join(",").length,a===-1?g=I.data:I.data&&I.data.length&&I.data.length===g.length&&o.push(I.data),n&&a%Fce===0&&n(s/A.size),a++},complete(){const I=Mce(g,o);n&&n(1),t(I)},error(I){i(I)}})}function Uti(A,e,t,i,n,o){const g=[];let a=[],s=-1,I=0;xce.parse(A,{worker:!0,encoding:e,step(r){if(I+=r.data.join(",").length,s===-1)a=r.data;else if(r.data&&r.data.length&&r.data.length===a.length)if(s<t)g.push(r.data);else{let C=Math.round(Math.random()*s);C<t&&(g[C]=r.data)}o&&s%Fce===0&&o(I/A.size),s++},complete(){const r=Mce(a,g);o&&o(1),i(r)},error(r){n(r)}})}function Mce(A,e){const t=[];for(let i=0;i<e.length;i++){let n={};for(let o=0;o<A.length;o++)n[A[o]]=e[i][o];t.push(n)}return t}const Vti=({commonStore:A,size:e=10})=>{const{tmpDSRawFields:t,tmpDataSource:i,displayOffset:n}=A,o=mV(t),g=b.useMemo(()=>k0(i),[i]);return b.createElement("div",{className:"rounded border"},b.createElement(Nq,{size:e,metas:o,computation:g,displayOffset:n,onMetaChange:(a,s,I)=>{A.updateTempDatasetMetas(a,I)}}))},vce=ze(Vti),Xti=[{label:"UTF-8",value:"utf-8"},{label:"UTF-16 LE",value:"utf-16"},{label:"UTF-16 BE",value:"utf-16be"},{label:"GBK/GB2312",value:"gbk"},{label:"Big5",value:"big5"},{label:"GB18030",value:"gb18030"},{label:"EUC-JP",value:"euc-jp"},{label:"ISO-2022-JP",value:"iso-2022-jp"},{label:"Shift JIS",value:"shift-jis"},{label:"EUC-KR",value:"euc-kr"}];function zti(A){return new Promise((e,t)=>{const i=new FileReader;i.onload=()=>{try{const n=JSON.parse(i.result);if(!Array.isArray(n))throw new Error("Invalid JSON file");e(n)}catch(n){t(n)}},i.readAsText(A)})}const Tti=({commonStore:A})=>{const e=p.useRef(null),{tmpDSName:t,tmpDataSource:i,tmpDSRawFields:n}=A,[o,g]=p.useState("utf-8"),a=p.useCallback(()=>{A.commitTempDS()},[A]),{t:s}=ve("translation",{keyPrefix:"DataSource.dialog.file"}),I=i.length>0&&n.length>0,r=p.useCallback(C=>{const l=C.target.files;if(l!==null){const c=l[0];(c.name.toLowerCase().endsWith(".json")?"json":"csv")=="csv"?Wti({file:c,config:{type:"reservoirSampling",size:1/0},onLoading:()=>{},encoding:o}).then(B=>{A.updateTempDS(B)}):zti(c).then(B=>{A.updateTempDS(B)})}},[A,o]);return b.createElement("div",{className:"min-h-[300px]"},!I&&b.createElement("div",{className:"text-center"},b.createElement("svg",{className:"mx-auto h-12 w-12 text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},b.createElement("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})),b.createElement("h3",{className:"mt-2 text-sm font-semibold text-foreground"},s("choose_file")),b.createElement("p",{className:"mt-1 text-sm text-muted-foreground"},s("get_start_desc"))),b.createElement("input",{style:{display:"none"},type:"file",ref:e,onChange:r,accept:".csv,.json"}),!I&&b.createElement("div",{className:"my-1"},b.createElement("div",{className:"flex flex-col items-center gap-1 w-fit mx-auto"},b.createElement("div",{className:"flex w-full"},b.createElement(fe,{className:"mr-2",variant:"outline",onClick:()=>{e.current&&e.current.click()}},s("open")),b.createElement("div",{className:"relative flex-grow"},b.createElement(cH,{className:"w-full",options:Xti,selectedKey:o,onSelect:C=>{g(C)}}))))),I&&b.createElement("div",{className:"mb-2 mt-6"},b.createElement("label",{className:"block text-xs text-secondary-foreground mb-1 font-bold"},s("dataset_name")),b.createElement("div",{className:"flex space-x-2"},b.createElement(oo,{type:"text",placeholder:s("dataset_name"),value:t,onChange:C=>{A.updateTempName(C.target.value)},className:"text-xs placeholder:italic w-36"}),b.createElement(fe,{disabled:i.length===0,onClick:()=>{a()}},s("submit")))),I&&b.createElement(vce,{commonStore:A}))},_ti=ze(Tti),Oti={CARS:"https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-cars-service.json",STUDENTS:"https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-students-service.json",BTC_GOLD:"https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-btcgold-service.json",BIKE_SHARING:"https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-bikesharing-service.json",CAR_SALES:"https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-carsales-service.json",COLLAGE:"https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-collage-service.json",TITANIC:"https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-titanic-service.json",KELPER:"https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-kelper-service.json",EARTHQUAKE:"https://pub-2422ed4100b443659f588f2382cfc7b1.r2.dev/datasets/ds-earthquake-service.json"},qti=[{key:"CARS",title:"Cars"},{key:"STUDENTS",title:"Students' Performance"},{key:"BIKE_SHARING",title:"Bike Sharing"},{key:"EARTHQUAKE",title:"Earthquakes"},{key:"CAR_SALES",title:"Car Sales"},{key:"COLLAGE",title:"Collage"},{key:"KELPER",title:"NASA Kelper"},{key:"BTC_GOLD",title:"2022MCM Problem C: Trading Strategies"},{key:"TITANIC",title:"Titanic"}],jti=({commonStore:A})=>{const{tmpDataSource:e}=A,{t}=ve("translation",{keyPrefix:"DataSource.dialog.public"}),i=async n=>{try{const o=await(await fetch(Oti[n.key])).json();A.updateTempSTDDS({dataSource:o.dataSource,rawFields:o.fields.map(g=>({fid:g.fid,name:g.name,analyticType:g.analyticType,semanticType:g.semanticType,dataType:g.dataType||"?"})),name:n.title})}catch(o){console.error("Error fetching public data:",o)}};return b.createElement("div",null,b.createElement(ZoA,{className:"h-48 overflow-auto mb-1",by:"key",onChange:i},qti.map(n=>b.createElement(ZoA.Option,{key:n.key,value:n,className:({active:o,checked:g})=>lc("flex focus:outline-none border ring-ring rounded items-center justify-between p-2 m-2 cursor-pointer hover:bg-accent hover:text-accent-foreground",o?"ring-2 ring-offset-2":"",g?"bg-muted text-muted-foreground":"")},({checked:o})=>b.createElement(b.Fragment,null,b.createElement(ZoA.Label,{as:"p"},n.title),o&&b.createElement("div",{className:"shrink-0 text-primary"},b.createElement(NXe,{className:"w-5 h-5"})))))),b.createElement(fe,{className:"my-1",disabled:e.length===0,onClick:()=>{A.commitTempDS()}},t("submit")),b.createElement(vce,{commonStore:A}))},Pti=ze(jti),$ti=A=>{const{commonStore:e}=A,{t}=ve("translation",{keyPrefix:"DataSource"});return b.createElement("div",{className:"text-sm"},b.createElement("div",{className:"mt-4"},b.createElement(EH,{defaultValue:"file"},b.createElement(WN,null,b.createElement(rB,{value:"file"},t("dialog.text_file_data")),b.createElement(rB,{value:"public"},t("dialog.public_data"))),b.createElement(uH,{value:"file"},b.createElement(_ti,{commonStore:e})),b.createElement(uH,{value:"public"},b.createElement(Pti,{commonStore:e})))))},Aii=$ti;ze(A=>{const{commonStore:e,dataSources:t,onSelectId:i,selectedId:n,onLoad:o,onSave:g}=A,a=p.useRef(null),{t:s}=ve(),{showDSPanel:I}=e;return b.createElement("div",{className:"font-sans gap-2 flex flex-wrap items-center m-4 p-4 border rounded-md"},A.onLoad&&b.createElement(Zti,{onImport:A.onLoad,fileRef:a}),b.createElement("div",null,b.createElement(cH,{className:"text-xs !h-8",options:t.map(r=>({label:r.name,value:r.id})),selectedKey:n,onSelect:i,placeholder:s("DataSource.labels.cur_dataset")})),b.createElement(fe,{size:"sm",onClick:()=>{e.startDSBuildingTask()}},s("DataSource.buttons.create_dataset")),g&&b.createElement(fe,{size:"sm",variant:"outline",onClick:async()=>{const r=await g();R3e(r,"graphic-walker-notebook.json")}},s("DataSource.buttons.export_as_file")),A.onLoad&&b.createElement(fe,{size:"sm",variant:"outline",onClick:()=>{a.current&&a.current.click()}},s("DataSource.buttons.import_file")),b.createElement(sa,{onOpenChange:()=>{e.setShowDSPanel(!1)},open:I},b.createElement(ra,null,b.createElement(US,null,b.createElement(pdA,null,s("DataSource.dialog.create_data_source"))),b.createElement(Aii,{commonStore:e}))))}),p.createContext(null);function Ft(A,e,{checkForDefaultPrevented:t=!0}={}){return function(n){if(A==null||A(n),t===!1||!n.defaultPrevented)return e==null?void 0:e(n)}}function eii(A,e){const t=p.createContext(e),i=o=>{const{children:g,...a}=o,s=p.useMemo(()=>a,Object.values(a));return IA(t.Provider,{value:s,children:g})};i.displayName=A+"Provider";function n(o){const g=p.useContext(t);if(g)return g;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${A}\``)}return[i,n]}function N0(A,e=[]){let t=[];function i(o,g){const a=p.createContext(g),s=t.length;t=[...t,g];const I=C=>{var d;const{scope:l,children:c,...B}=C,E=((d=l==null?void 0:l[A])==null?void 0:d[s])||a,u=p.useMemo(()=>B,Object.values(B));return IA(E.Provider,{value:u,children:c})};I.displayName=o+"Provider";function r(C,l){var E;const c=((E=l==null?void 0:l[A])==null?void 0:E[s])||a,B=p.useContext(c);if(B)return B;if(g!==void 0)return g;throw new Error(`\`${C}\` must be used within \`${o}\``)}return[I,r]}const n=()=>{const o=t.map(g=>p.createContext(g));return function(a){const s=(a==null?void 0:a[A])||o;return p.useMemo(()=>({[`__scope${A}`]:{...a,[A]:s}}),[a,s])}};return n.scopeName=A,[i,tii(n,...e)]}function tii(...A){const e=A[0];if(A.length===1)return e;const t=()=>{const i=A.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(o){const g=i.reduce((a,{useScope:s,scopeName:I})=>{const C=s(o)[`__scope${I}`];return{...a,...C}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:g}),[g])}};return t.scopeName=e.scopeName,t}function Lce(A,e){if(typeof A=="function")return A(e);A!=null&&(A.current=e)}function bY(...A){return e=>{let t=!1;const i=A.map(n=>{const o=Lce(n,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let n=0;n<i.length;n++){const o=i[n];typeof o=="function"?o():Lce(A[n],null)}}}}function Un(...A){return p.useCallback(bY(...A),A)}function Sce(A){const e=iii(A),t=p.forwardRef((i,n)=>{const{children:o,...g}=i,a=p.Children.toArray(o),s=a.find(oii);if(s){const I=s.props.children,r=a.map(C=>C===s?p.Children.count(I)>1?p.Children.only(null):p.isValidElement(I)?I.props.children:null:C);return IA(e,{...g,ref:n,children:p.isValidElement(I)?p.cloneElement(I,void 0,r):null})}return IA(e,{...g,ref:n,children:o})});return t.displayName=`${A}.Slot`,t}function iii(A){const e=p.forwardRef((t,i)=>{const{children:n,...o}=t;if(p.isValidElement(n)){const g=aii(n),a=gii(o,n.props);return n.type!==p.Fragment&&(a.ref=i?bY(i,g):g),p.cloneElement(n,a)}return p.Children.count(n)>1?p.Children.only(null):null});return e.displayName=`${A}.SlotClone`,e}var nii=Symbol("radix.slottable");function oii(A){return p.isValidElement(A)&&typeof A.type=="function"&&"__radixId"in A.type&&A.type.__radixId===nii}function gii(A,e){const t={...e};for(const i in e){const n=A[i],o=e[i];/^on[A-Z]/.test(i)?n&&o?t[i]=(...a)=>{const s=o(...a);return n(...a),s}:n&&(t[i]=n):i==="style"?t[i]={...n,...o}:i==="className"&&(t[i]=[n,o].filter(Boolean).join(" "))}return{...A,...t}}function aii(A){var i,n;let e=(i=Object.getOwnPropertyDescriptor(A.props,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?A.ref:(e=(n=Object.getOwnPropertyDescriptor(A,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?A.props.ref:A.props.ref||A.ref)}function Hce(A){const e=A+"CollectionProvider",[t,i]=N0(e),[n,o]=t(e,{collectionRef:{current:null},itemMap:new Map}),g=E=>{const{scope:u,children:d}=E,f=b.useRef(null),w=b.useRef(new Map).current;return IA(n,{scope:u,itemMap:w,collectionRef:f,children:d})};g.displayName=e;const a=A+"CollectionSlot",s=Sce(a),I=b.forwardRef((E,u)=>{const{scope:d,children:f}=E,w=o(a,d),y=Un(u,w.collectionRef);return IA(s,{ref:y,children:f})});I.displayName=a;const r=A+"CollectionItemSlot",C="data-radix-collection-item",l=Sce(r),c=b.forwardRef((E,u)=>{const{scope:d,children:f,...w}=E,y=b.useRef(null),G=Un(u,y),R=o(r,d);return b.useEffect(()=>(R.itemMap.set(y,{ref:y,...w}),()=>void R.itemMap.delete(y))),IA(l,{[C]:"",ref:G,children:f})});c.displayName=r;function B(E){const u=o(A+"CollectionConsumer",E);return b.useCallback(()=>{const f=u.collectionRef.current;if(!f)return[];const w=Array.from(f.querySelectorAll(`[${C}]`));return Array.from(u.itemMap.values()).sort((R,x)=>w.indexOf(R.ref.current)-w.indexOf(x.ref.current))},[u.collectionRef,u.itemMap])}return[{Provider:g,Slot:I,ItemSlot:c},B,i]}var Ta=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},sii=bf[" useId ".trim().toString()]||(()=>{}),rii=0;function Y0(A){const[e,t]=p.useState(sii());return Ta(()=>{A||t(i=>i??String(rii++))},[A]),A||(e?`radix-${e}`:"")}function Iii(A){const e=Cii(A),t=p.forwardRef((i,n)=>{const{children:o,...g}=i,a=p.Children.toArray(o),s=a.find(cii);if(s){const I=s.props.children,r=a.map(C=>C===s?p.Children.count(I)>1?p.Children.only(null):p.isValidElement(I)?I.props.children:null:C);return IA(e,{...g,ref:n,children:p.isValidElement(I)?p.cloneElement(I,void 0,r):null})}return IA(e,{...g,ref:n,children:o})});return t.displayName=`${A}.Slot`,t}function Cii(A){const e=p.forwardRef((t,i)=>{const{children:n,...o}=t;if(p.isValidElement(n)){const g=Qii(n),a=Bii(o,n.props);return n.type!==p.Fragment&&(a.ref=i?bY(i,g):g),p.cloneElement(n,a)}return p.Children.count(n)>1?p.Children.only(null):null});return e.displayName=`${A}.SlotClone`,e}var lii=Symbol("radix.slottable");function cii(A){return p.isValidElement(A)&&typeof A.type=="function"&&"__radixId"in A.type&&A.type.__radixId===lii}function Bii(A,e){const t={...e};for(const i in e){const n=A[i],o=e[i];/^on[A-Z]/.test(i)?n&&o?t[i]=(...a)=>{const s=o(...a);return n(...a),s}:n&&(t[i]=n):i==="style"?t[i]={...n,...o}:i==="className"&&(t[i]=[n,o].filter(Boolean).join(" "))}return{...A,...t}}function Qii(A){var i,n;let e=(i=Object.getOwnPropertyDescriptor(A.props,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?A.ref:(e=(n=Object.getOwnPropertyDescriptor(A,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?A.props.ref:A.props.ref||A.ref)}var Eii=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gt=Eii.reduce((A,e)=>{const t=Iii(`Primitive.${e}`),i=p.forwardRef((n,o)=>{const{asChild:g,...a}=n,s=g?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),IA(s,{...a,ref:o})});return i.displayName=`Primitive.${e}`,{...A,[e]:i}},{});function uii(A,e){A&&bt.flushSync(()=>A.dispatchEvent(e))}function R0(A){const e=p.useRef(A);return p.useEffect(()=>{e.current=A}),p.useMemo(()=>(...t)=>{var i;return(i=e.current)==null?void 0:i.call(e,...t)},[])}var dii=bf[" useInsertionEffect ".trim().toString()]||Ta;function Ah({prop:A,defaultProp:e,onChange:t=()=>{},caller:i}){const[n,o,g]=hii({defaultProp:e,onChange:t}),a=A!==void 0,s=a?A:n;{const r=p.useRef(A!==void 0);p.useEffect(()=>{const C=r.current;C!==a&&console.warn(`${i} is changing from ${C?"controlled":"uncontrolled"} to ${a?"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.`),r.current=a},[a,i])}const I=p.useCallback(r=>{var C;if(a){const l=mii(r)?r(A):r;l!==A&&((C=g.current)==null||C.call(g,l))}else o(r)},[a,A,o,g]);return[s,I]}function hii({defaultProp:A,onChange:e}){const[t,i]=p.useState(A),n=p.useRef(t),o=p.useRef(e);return dii(()=>{o.current=e},[e]),p.useEffect(()=>{var g;n.current!==t&&((g=o.current)==null||g.call(o,t),n.current=t)},[t,n]),[t,i,o]}function mii(A){return typeof A=="function"}var pii=p.createContext(void 0);function Gj(A){const e=p.useContext(pii);return A||e||"ltr"}var upA="rovingFocusGroup.onEntryFocus",fii={bubbles:!1,cancelable:!0},nZ="RovingFocusGroup",[dpA,Zce,yii]=Hce(nZ),[bii,kj]=N0(nZ,[yii]),[wii,Dii]=bii(nZ),Wce=p.forwardRef((A,e)=>IA(dpA.Provider,{scope:A.__scopeRovingFocusGroup,children:IA(dpA.Slot,{scope:A.__scopeRovingFocusGroup,children:IA(Gii,{...A,ref:e})})}));Wce.displayName=nZ;var Gii=p.forwardRef((A,e)=>{const{__scopeRovingFocusGroup:t,orientation:i,loop:n=!1,dir:o,currentTabStopId:g,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:s,onEntryFocus:I,preventScrollOnEntryFocus:r=!1,...C}=A,l=p.useRef(null),c=Un(e,l),B=Gj(o),[E,u]=Ah({prop:g,defaultProp:a??null,onChange:s,caller:nZ}),[d,f]=p.useState(!1),w=R0(I),y=Zce(t),G=p.useRef(!1),[R,x]=p.useState(0);return p.useEffect(()=>{const F=l.current;if(F)return F.addEventListener(upA,w),()=>F.removeEventListener(upA,w)},[w]),IA(wii,{scope:t,orientation:i,dir:B,loop:n,currentTabStopId:E,onItemFocus:p.useCallback(F=>u(F),[u]),onItemShiftTab:p.useCallback(()=>f(!0),[]),onFocusableItemAdd:p.useCallback(()=>x(F=>F+1),[]),onFocusableItemRemove:p.useCallback(()=>x(F=>F-1),[]),children:IA(Gt.div,{tabIndex:d||R===0?-1:0,"data-orientation":i,...C,ref:c,style:{outline:"none",...A.style},onMouseDown:Ft(A.onMouseDown,()=>{G.current=!0}),onFocus:Ft(A.onFocus,F=>{const Q=!G.current;if(F.target===F.currentTarget&&Q&&!d){const k=new CustomEvent(upA,fii);if(F.currentTarget.dispatchEvent(k),!k.defaultPrevented){const h=y().filter(V=>V.focusable),N=h.find(V=>V.active),v=h.find(V=>V.id===E),U=[N,v,...h].filter(Boolean).map(V=>V.ref.current);Vce(U,r)}}G.current=!1}),onBlur:Ft(A.onBlur,()=>f(!1))})})}),Kce="RovingFocusGroupItem",Uce=p.forwardRef((A,e)=>{const{__scopeRovingFocusGroup:t,focusable:i=!0,active:n=!1,tabStopId:o,children:g,...a}=A,s=Y0(),I=o||s,r=Dii(Kce,t),C=r.currentTabStopId===I,l=Zce(t),{onFocusableItemAdd:c,onFocusableItemRemove:B,currentTabStopId:E}=r;return p.useEffect(()=>{if(i)return c(),()=>B()},[i,c,B]),IA(dpA.ItemSlot,{scope:t,id:I,focusable:i,active:n,children:IA(Gt.span,{tabIndex:C?0:-1,"data-orientation":r.orientation,...a,ref:e,onMouseDown:Ft(A.onMouseDown,u=>{i?r.onItemFocus(I):u.preventDefault()}),onFocus:Ft(A.onFocus,()=>r.onItemFocus(I)),onKeyDown:Ft(A.onKeyDown,u=>{if(u.key==="Tab"&&u.shiftKey){r.onItemShiftTab();return}if(u.target!==u.currentTarget)return;const d=Nii(u,r.orientation,r.dir);if(d!==void 0){if(u.metaKey||u.ctrlKey||u.altKey||u.shiftKey)return;u.preventDefault();let w=l().filter(y=>y.focusable).map(y=>y.ref.current);if(d==="last")w.reverse();else if(d==="prev"||d==="next"){d==="prev"&&w.reverse();const y=w.indexOf(u.currentTarget);w=r.loop?Yii(w,y+1):w.slice(y+1)}setTimeout(()=>Vce(w))}}),children:typeof g=="function"?g({isCurrentTabStop:C,hasTabStop:E!=null}):g})})});Uce.displayName=Kce;var kii={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jii(A,e){return e!=="rtl"?A:A==="ArrowLeft"?"ArrowRight":A==="ArrowRight"?"ArrowLeft":A}function Nii(A,e,t){const i=Jii(A.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return kii[i]}function Vce(A,e=!1){const t=document.activeElement;for(const i of A)if(i===t||(i.focus({preventScroll:e}),document.activeElement!==t))return}function Yii(A,e){return A.map((t,i)=>A[(e+i)%A.length])}var Xce=Wce,zce=Uce;function Rii(A,e){return p.useReducer((t,i)=>e[t][i]??t,A)}var wY=A=>{const{present:e,children:t}=A,i=xii(e),n=typeof t=="function"?t({present:i.isPresent}):p.Children.only(t),o=Un(i.ref,Fii(n));return typeof t=="function"||i.isPresent?p.cloneElement(n,{ref:o}):null};wY.displayName="Presence";function xii(A){const[e,t]=p.useState(),i=p.useRef(null),n=p.useRef(A),o=p.useRef("none"),g=A?"mounted":"unmounted",[a,s]=Rii(g,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const I=Jj(i.current);o.current=a==="mounted"?I:"none"},[a]),Ta(()=>{const I=i.current,r=n.current;if(r!==A){const l=o.current,c=Jj(I);A?s("MOUNT"):c==="none"||(I==null?void 0:I.display)==="none"?s("UNMOUNT"):s(r&&l!==c?"ANIMATION_OUT":"UNMOUNT"),n.current=A}},[A,s]),Ta(()=>{if(e){let I;const r=e.ownerDocument.defaultView??window,C=c=>{const E=Jj(i.current).includes(CSS.escape(c.animationName));if(c.target===e&&E&&(s("ANIMATION_END"),!n.current)){const u=e.style.animationFillMode;e.style.animationFillMode="forwards",I=r.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=u)})}},l=c=>{c.target===e&&(o.current=Jj(i.current))};return e.addEventListener("animationstart",l),e.addEventListener("animationcancel",C),e.addEventListener("animationend",C),()=>{r.clearTimeout(I),e.removeEventListener("animationstart",l),e.removeEventListener("animationcancel",C),e.removeEventListener("animationend",C)}}else s("ANIMATION_END")},[e,s]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(I=>{i.current=I?getComputedStyle(I):null,t(I)},[])}}function Jj(A){return(A==null?void 0:A.animationName)||"none"}function Fii(A){var i,n;let e=(i=Object.getOwnPropertyDescriptor(A.props,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?A.ref:(e=(n=Object.getOwnPropertyDescriptor(A,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?A.props.ref:A.props.ref||A.ref)}var Nj="Tabs",[Mii,j0i]=N0(Nj,[kj]),Tce=kj(),[vii,hpA]=Mii(Nj),_ce=p.forwardRef((A,e)=>{const{__scopeTabs:t,value:i,onValueChange:n,defaultValue:o,orientation:g="horizontal",dir:a,activationMode:s="automatic",...I}=A,r=Gj(a),[C,l]=Ah({prop:i,onChange:n,defaultProp:o??"",caller:Nj});return IA(vii,{scope:t,baseId:Y0(),value:C,onValueChange:l,orientation:g,dir:r,activationMode:s,children:IA(Gt.div,{dir:r,"data-orientation":g,...I,ref:e})})});_ce.displayName=Nj;var Oce="TabsList",qce=p.forwardRef((A,e)=>{const{__scopeTabs:t,loop:i=!0,...n}=A,o=hpA(Oce,t),g=Tce(t);return IA(Xce,{asChild:!0,...g,orientation:o.orientation,dir:o.dir,loop:i,children:IA(Gt.div,{role:"tablist","aria-orientation":o.orientation,...n,ref:e})})});qce.displayName=Oce;var jce="TabsTrigger",Pce=p.forwardRef((A,e)=>{const{__scopeTabs:t,value:i,disabled:n=!1,...o}=A,g=hpA(jce,t),a=Tce(t),s=eBe(g.baseId,i),I=tBe(g.baseId,i),r=i===g.value;return IA(zce,{asChild:!0,...a,focusable:!n,active:r,children:IA(Gt.button,{type:"button",role:"tab","aria-selected":r,"aria-controls":I,"data-state":r?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:s,...o,ref:e,onMouseDown:Ft(A.onMouseDown,C=>{!n&&C.button===0&&C.ctrlKey===!1?g.onValueChange(i):C.preventDefault()}),onKeyDown:Ft(A.onKeyDown,C=>{[" ","Enter"].includes(C.key)&&g.onValueChange(i)}),onFocus:Ft(A.onFocus,()=>{const C=g.activationMode!=="manual";!r&&!n&&C&&g.onValueChange(i)})})})});Pce.displayName=jce;var $ce="TabsContent",ABe=p.forwardRef((A,e)=>{const{__scopeTabs:t,value:i,forceMount:n,children:o,...g}=A,a=hpA($ce,t),s=eBe(a.baseId,i),I=tBe(a.baseId,i),r=i===a.value,C=p.useRef(r);return p.useEffect(()=>{const l=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(l)},[]),IA(wY,{present:n||r,children:({present:l})=>IA(Gt.div,{"data-state":r?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":s,hidden:!l,id:I,tabIndex:0,...g,ref:e,style:{...A.style,animationDuration:C.current?"0s":void 0},children:l&&o})})});ABe.displayName=$ce;function eBe(A,e){return`${A}-trigger-${e}`}function tBe(A,e){return`${A}-content-${e}`}var Lii=_ce,iBe=qce,nBe=Pce,oBe=ABe;function gBe(A){var e,t,i="";if(typeof A=="string"||typeof A=="number")i+=A;else if(typeof A=="object")if(Array.isArray(A)){var n=A.length;for(e=0;e<n;e++)A[e]&&(t=gBe(A[e]))&&(i&&(i+=" "),i+=t)}else for(t in A)A[t]&&(i&&(i+=" "),i+=t);return i}function aBe(){for(var A,e,t=0,i="",n=arguments.length;t<n;t++)(A=arguments[t])&&(e=gBe(A))&&(i&&(i+=" "),i+=e);return i}function Sii(){for(var A=0,e,t,i="";A<arguments.length;)(e=arguments[A++])&&(t=sBe(e))&&(i&&(i+=" "),i+=t);return i}function sBe(A){if(typeof A=="string")return A;for(var e,t="",i=0;i<A.length;i++)A[i]&&(e=sBe(A[i]))&&(t&&(t+=" "),t+=e);return t}var mpA="-";function Hii(A){var e=Wii(A),t=A.conflictingClassGroups,i=A.conflictingClassGroupModifiers,n=i===void 0?{}:i;function o(a){var s=a.split(mpA);return s[0]===""&&s.length!==1&&s.shift(),rBe(s,e)||Zii(a)}function g(a,s){var I=t[a]||[];return s&&n[a]?[].concat(I,n[a]):I}return{getClassGroupId:o,getConflictingClassGroupIds:g}}function rBe(A,e){var g;if(A.length===0)return e.classGroupId;var t=A[0],i=e.nextPart.get(t),n=i?rBe(A.slice(1),i):void 0;if(n)return n;if(e.validators.length!==0){var o=A.join(mpA);return(g=e.validators.find(function(a){var s=a.validator;return s(o)}))==null?void 0:g.classGroupId}}var IBe=/^\[(.+)\]$/;function Zii(A){if(IBe.test(A)){var e=IBe.exec(A)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function Wii(A){var e=A.theme,t=A.prefix,i={nextPart:new Map,validators:[]},n=Uii(Object.entries(A.classGroups),t);return n.forEach(function(o){var g=o[0],a=o[1];ppA(a,i,g,e)}),i}function ppA(A,e,t,i){A.forEach(function(n){if(typeof n=="string"){var o=n===""?e:CBe(e,n);o.classGroupId=t;return}if(typeof n=="function"){if(Kii(n)){ppA(n(i),e,t,i);return}e.validators.push({validator:n,classGroupId:t});return}Object.entries(n).forEach(function(g){var a=g[0],s=g[1];ppA(s,CBe(e,a),t,i)})})}function CBe(A,e){var t=A;return e.split(mpA).forEach(function(i){t.nextPart.has(i)||t.nextPart.set(i,{nextPart:new Map,validators:[]}),t=t.nextPart.get(i)}),t}function Kii(A){return A.isThemeGetter}function Uii(A,e){return e?A.map(function(t){var i=t[0],n=t[1],o=n.map(function(g){return typeof g=="string"?e+g:typeof g=="object"?Object.fromEntries(Object.entries(g).map(function(a){var s=a[0],I=a[1];return[e+s,I]})):g});return[i,o]}):A}function Vii(A){if(A<1)return{get:function(){},set:function(){}};var e=0,t=new Map,i=new Map;function n(o,g){t.set(o,g),e++,e>A&&(e=0,i=t,t=new Map)}return{get:function(g){var a=t.get(g);if(a!==void 0)return a;if((a=i.get(g))!==void 0)return n(g,a),a},set:function(g,a){t.has(g)?t.set(g,a):n(g,a)}}}var lBe="!";function Xii(A){var e=A.separator||":",t=e.length===1,i=e[0],n=e.length;return function(g){for(var a=[],s=0,I=0,r,C=0;C<g.length;C++){var l=g[C];if(s===0){if(l===i&&(t||g.slice(C,C+n)===e)){a.push(g.slice(I,C)),I=C+n;continue}if(l==="/"){r=C;continue}}l==="["?s++:l==="]"&&s--}var c=a.length===0?g:g.substring(I),B=c.startsWith(lBe),E=B?c.substring(1):c,u=r&&r>I?r-I:void 0;return{modifiers:a,hasImportantModifier:B,baseClassName:E,maybePostfixModifierPosition:u}}}function zii(A){if(A.length<=1)return A;var e=[],t=[];return A.forEach(function(i){var n=i[0]==="[";n?(e.push.apply(e,t.sort().concat([i])),t=[]):t.push(i)}),e.push.apply(e,t.sort()),e}function Tii(A){return{cache:Vii(A.cacheSize),splitModifiers:Xii(A),...Hii(A)}}var _ii=/\s+/;function Oii(A,e){var t=e.splitModifiers,i=e.getClassGroupId,n=e.getConflictingClassGroupIds,o=new Set;return A.trim().split(_ii).map(function(g){var a=t(g),s=a.modifiers,I=a.hasImportantModifier,r=a.baseClassName,C=a.maybePostfixModifierPosition,l=i(C?r.substring(0,C):r),c=Boolean(C);if(!l){if(!C)return{isTailwindClass:!1,originalClassName:g};if(l=i(r),!l)return{isTailwindClass:!1,originalClassName:g};c=!1}var B=zii(s).join(":"),E=I?B+lBe:B;return{isTailwindClass:!0,modifierId:E,classGroupId:l,originalClassName:g,hasPostfixModifier:c}}).reverse().filter(function(g){if(!g.isTailwindClass)return!0;var a=g.modifierId,s=g.classGroupId,I=g.hasPostfixModifier,r=a+s;return o.has(r)?!1:(o.add(r),n(s,I).forEach(function(C){return o.add(a+C)}),!0)}).reverse().map(function(g){return g.originalClassName}).join(" ")}function qii(){for(var A=arguments.length,e=new Array(A),t=0;t<A;t++)e[t]=arguments[t];var i,n,o,g=a;function a(I){var r=e[0],C=e.slice(1),l=C.reduce(function(c,B){return B(c)},r());return i=Tii(l),n=i.cache.get,o=i.cache.set,g=s,s(I)}function s(I){var r=n(I);if(r)return r;var C=Oii(I,i);return o(I,C),C}return function(){return g(Sii.apply(null,arguments))}}function Nn(A){var e=function(i){return i[A]||[]};return e.isThemeGetter=!0,e}var cBe=/^\[(?:([a-z-]+):)?(.+)\]$/i,jii=/^\d+\/\d+$/,Pii=new Set(["px","full","screen"]),$ii=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ani=/\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$/,eni=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function cB(A){return Sw(A)||Pii.has(A)||jii.test(A)||fpA(A)}function fpA(A){return Hw(A,"length",ani)}function tni(A){return Hw(A,"size",BBe)}function ini(A){return Hw(A,"position",BBe)}function nni(A){return Hw(A,"url",sni)}function Yj(A){return Hw(A,"number",Sw)}function Sw(A){return!Number.isNaN(Number(A))}function oni(A){return A.endsWith("%")&&Sw(A.slice(0,-1))}function oZ(A){return QBe(A)||Hw(A,"number",QBe)}function Ht(A){return cBe.test(A)}function gZ(){return!0}function x0(A){return $ii.test(A)}function gni(A){return Hw(A,"",rni)}function Hw(A,e,t){var i=cBe.exec(A);return i?i[1]?i[1]===e:t(i[2]):!1}function ani(A){return Ani.test(A)}function BBe(){return!1}function sni(A){return A.startsWith("url(")}function QBe(A){return Number.isInteger(Number(A))}function rni(A){return eni.test(A)}function Ini(){var A=Nn("colors"),e=Nn("spacing"),t=Nn("blur"),i=Nn("brightness"),n=Nn("borderColor"),o=Nn("borderRadius"),g=Nn("borderSpacing"),a=Nn("borderWidth"),s=Nn("contrast"),I=Nn("grayscale"),r=Nn("hueRotate"),C=Nn("invert"),l=Nn("gap"),c=Nn("gradientColorStops"),B=Nn("gradientColorStopPositions"),E=Nn("inset"),u=Nn("margin"),d=Nn("opacity"),f=Nn("padding"),w=Nn("saturate"),y=Nn("scale"),G=Nn("sepia"),R=Nn("skew"),x=Nn("space"),F=Nn("translate"),Q=function(){return["auto","contain","none"]},k=function(){return["auto","hidden","clip","visible","scroll"]},h=function(){return["auto",Ht,e]},N=function(){return[Ht,e]},v=function(){return["",cB]},K=function(){return["auto",Sw,Ht]},U=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},V=function(){return["solid","dashed","dotted","double","none"]},X=function(){return["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},_=function(){return["start","end","center","between","around","evenly","stretch"]},q=function(){return["","0",Ht]},$=function(){return["auto","avoid","all","avoid-page","page","left","right","column"]},nA=function(){return[Sw,Yj]},j=function(){return[Sw,Ht]};return{cacheSize:500,theme:{colors:[gZ],spacing:[cB],blur:["none","",x0,Ht],brightness:nA(),borderColor:[A],borderRadius:["none","","full",x0,Ht],borderSpacing:N(),borderWidth:v(),contrast:nA(),grayscale:q(),hueRotate:j(),invert:q(),gap:N(),gradientColorStops:[A],gradientColorStopPositions:[oni,fpA],inset:h(),margin:h(),opacity:nA(),padding:N(),saturate:nA(),scale:nA(),sepia:q(),skew:j(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",Ht]}],container:["container"],columns:[{columns:[x0]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(U(),[Ht])}],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:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",oZ]}],basis:[{basis:h()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ht]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",oZ]}],"grid-cols":[{"grid-cols":[gZ]}],"col-start-end":[{col:["auto",{span:["full",oZ]},Ht]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[gZ]}],"row-start-end":[{row:["auto",{span:[oZ]},Ht]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ht]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ht]}],gap:[{gap:[l]}],"gap-x":[{"gap-x":[l]}],"gap-y":[{"gap-y":[l]}],"justify-content":[{justify:["normal"].concat(_())}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(_(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(_(),["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],mt:[{mt:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[x]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[x]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",Ht,e]}],"min-w":[{"min-w":["min","max","fit",Ht,cB]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[x0]},x0,Ht]}],h:[{h:[Ht,e,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Ht,cB]}],"max-h":[{"max-h":[Ht,e,"min","max","fit"]}],"font-size":[{text:["base",x0,fpA]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yj]}],"font-family":[{font:[gZ]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ht]}],"line-clamp":[{"line-clamp":["none",Sw,Yj]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ht,cB]}],"list-image":[{"list-image":["none",Ht]}],"list-style-type":[{list:["none","disc","decimal",Ht]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[A]}],"placeholder-opacity":[{"placeholder-opacity":[d]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[A]}],"text-opacity":[{"text-opacity":[d]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(V(),["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",cB]}],"underline-offset":[{"underline-offset":["auto",Ht,cB]}],"text-decoration-color":[{decoration:[A]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ht]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[d]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(U(),[ini])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",tni]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nni]}],"bg-color":[{bg:[A]}],"gradient-from-pos":[{from:[B]}],"gradient-via-pos":[{via:[B]}],"gradient-to-pos":[{to:[B]}],"gradient-from":[{from:[c]}],"gradient-via":[{via:[c]}],"gradient-to":[{to:[c]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[d]}],"border-style":[{border:[].concat(V(),["hidden"])}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[d]}],"divide-style":[{divide:V()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:[""].concat(V())}],"outline-offset":[{"outline-offset":[Ht,cB]}],"outline-w":[{outline:[cB]}],"outline-color":[{outline:[A]}],"ring-w":[{ring:v()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[A]}],"ring-opacity":[{"ring-opacity":[d]}],"ring-offset-w":[{"ring-offset":[cB]}],"ring-offset-color":[{"ring-offset":[A]}],shadow:[{shadow:["","inner","none",x0,gni]}],"shadow-color":[{shadow:[gZ]}],opacity:[{opacity:[d]}],"mix-blend":[{"mix-blend":X()}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[i]}],contrast:[{contrast:[s]}],"drop-shadow":[{"drop-shadow":["","none",x0,Ht]}],grayscale:[{grayscale:[I]}],"hue-rotate":[{"hue-rotate":[r]}],invert:[{invert:[C]}],saturate:[{saturate:[w]}],sepia:[{sepia:[G]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[s]}],"backdrop-grayscale":[{"backdrop-grayscale":[I]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[r]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[d]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[G]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[g]}],"border-spacing-x":[{"border-spacing-x":[g]}],"border-spacing-y":[{"border-spacing-y":[g]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ht]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",Ht]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ht]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[oZ,Ht]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ht]}],accent:[{accent:["auto",A]}],appearance:["appearance-none"],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",Ht]}],"caret-color":[{caret:[A]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ht]}],fill:[{fill:[A,"none"]}],"stroke-w":[{stroke:[cB,Yj]}],stroke:[{stroke:[A,"none"]}],sr:["sr-only","not-sr-only"]},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"],"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"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}var Cni=qii(Ini);function Vn(...A){return Cni(aBe(A))}const ypA=Lii,Rj=p.forwardRef(({className:A,...e},t)=>IA(iBe,{ref:t,className:Vn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",A),...e}));Rj.displayName=iBe.displayName;const aZ=p.forwardRef(({className:A,...e},t)=>IA(nBe,{ref:t,className:Vn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",A),...e}));aZ.displayName=nBe.displayName;const sZ=p.forwardRef(({className:A,...e},t)=>IA(oBe,{ref:t,className:Vn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",A),...e}));sZ.displayName=oBe.displayName;var bpA=function(A,e){return bpA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},bpA(A,e)};function Nr(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");bpA(A,e);function t(){this.constructor=A}A.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var vA=function(){return vA=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},vA.apply(this,arguments)};function xj(A,e){var t={};for(var i in A)Object.prototype.hasOwnProperty.call(A,i)&&e.indexOf(i)<0&&(t[i]=A[i]);if(A!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(A);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(A,i[n])&&(t[i[n]]=A[i[n]]);return t}function xA(A,e,t,i){function n(o){return o instanceof t?o:new t(function(g){g(o)})}return new(t||(t=Promise))(function(o,g){function a(r){try{I(i.next(r))}catch(C){g(C)}}function s(r){try{I(i.throw(r))}catch(C){g(C)}}function I(r){r.done?o(r.value):n(r.value).then(a,s)}I((i=i.apply(A,e||[])).next())})}function ge(A,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,g=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return g.next=a(0),g.throw=a(1),g.return=a(2),typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function a(I){return function(r){return s([I,r])}}function s(I){if(i)throw new TypeError("Generator is already executing.");for(;g&&(g=0,I[0]&&(t=0)),t;)try{if(i=1,n&&(o=I[0]&2?n.return:I[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,I[1])).done)return o;switch(n=0,o&&(I=[I[0]&2,o.value]),I[0]){case 0:case 1:o=I;break;case 4:return t.label++,{value:I[1],done:!1};case 5:t.label++,n=I[1],I=[0];continue;case 7:I=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(I[0]===6||I[0]===2)){t=0;continue}if(I[0]===3&&(!o||I[1]>o[0]&&I[1]<o[3])){t.label=I[1];break}if(I[0]===6&&t.label<o[1]){t.label=o[1],o=I;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(I);break}o[2]&&t.ops.pop(),t.trys.pop();continue}I=e.call(A,t)}catch(r){I=[6,r],n=0}finally{i=o=0}if(I[0]&5)throw I[1];return{value:I[0]?I[1]:void 0,done:!0}}}function EBe(A){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&A[e],i=0;if(t)return t.call(A);if(A&&typeof A.length=="number")return{next:function(){return A&&i>=A.length&&(A=void 0),{value:A&&A[i++],done:!A}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function $n(A,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,o;i<n;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return A.concat(o||Array.prototype.slice.call(e))}function dt(A){return this instanceof dt?(this.v=A,this):new dt(A)}function QE(A,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(A,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",g),n[Symbol.asyncIterator]=function(){return this},n;function g(c){return function(B){return Promise.resolve(B).then(c,C)}}function a(c,B){i[c]&&(n[c]=function(E){return new Promise(function(u,d){o.push([c,E,u,d])>1||s(c,E)})},B&&(n[c]=B(n[c])))}function s(c,B){try{I(i[c](B))}catch(E){l(o[0][3],E)}}function I(c){c.value instanceof dt?Promise.resolve(c.value.v).then(r,C):l(o[0][2],c)}function r(c){s("next",c)}function C(c){s("throw",c)}function l(c,B){c(B),o.shift(),o.length&&s(o[0][0],o[0][1])}}function Fj(A){var e,t;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,o){e[n]=A[n]?function(g){return(t=!t)?{value:dt(A[n](g)),done:!1}:o?o(g):g}:o}}function Zw(A){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=A[Symbol.asyncIterator],t;return e?e.call(A):(A=typeof EBe=="function"?EBe(A):A[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=A[o]&&function(g){return new Promise(function(a,s){g=A[o](g),n(a,s,g.done,g.value)})}}function n(o,g,a,s){Promise.resolve(s).then(function(I){o({value:I,done:a})},g)}}typeof SuppressedError=="function"&&SuppressedError;const lni=new TextDecoder("utf-8"),wpA=A=>lni.decode(A),cni=new TextEncoder,DpA=A=>cni.encode(A),[P0i,Bni]=(()=>{const A=()=>{throw new Error("BigInt is not available in this environment")};function e(){throw A()}return e.asIntN=()=>{throw A()},e.asUintN=()=>{throw A()},typeof BigInt<"u"?[BigInt,!0]:[e,!1]})(),[rZ,$0i]=(()=>{const A=()=>{throw new Error("BigInt64Array is not available in this environment")};class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw A()}static from(){throw A()}constructor(){throw A()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[e,!1]})(),[IZ,Afi]=(()=>{const A=()=>{throw new Error("BigUint64Array is not available in this environment")};class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw A()}static from(){throw A()}constructor(){throw A()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[e,!1]})(),Qni=A=>typeof A=="number",uBe=A=>typeof A=="boolean",ig=A=>typeof A=="function",Yr=A=>A!=null&&Object(A)===A,F0=A=>Yr(A)&&ig(A.then),CZ=A=>Yr(A)&&ig(A[Symbol.iterator]),DY=A=>Yr(A)&&ig(A[Symbol.asyncIterator]),GpA=A=>Yr(A)&&Yr(A.schema),dBe=A=>Yr(A)&&"done"in A&&"value"in A,hBe=A=>Yr(A)&&ig(A.stat)&&Qni(A.fd),mBe=A=>Yr(A)&&kpA(A.body),Mj=A=>"_getDOMStream"in A&&"_getNodeStream"in A,Eni=A=>Yr(A)&&ig(A.abort)&&ig(A.getWriter)&&!Mj(A),kpA=A=>Yr(A)&&ig(A.cancel)&&ig(A.getReader)&&!Mj(A),uni=A=>Yr(A)&&ig(A.end)&&ig(A.write)&&uBe(A.writable)&&!Mj(A),pBe=A=>Yr(A)&&ig(A.read)&&ig(A.pipe)&&uBe(A.readable)&&!Mj(A),dni=A=>Yr(A)&&ig(A.clear)&&ig(A.bytes)&&ig(A.position)&&ig(A.setPosition)&&ig(A.capacity)&&ig(A.getBufferIdentifier)&&ig(A.createLong),JpA=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function hni(A){const e=A[0]?[A[0]]:[];let t,i,n,o;for(let g,a,s=0,I=0,r=A.length;++s<r;){if(g=e[I],a=A[s],!g||!a||g.buffer!==a.buffer||a.byteOffset<g.byteOffset){a&&(e[++I]=a);continue}if({byteOffset:t,byteLength:n}=g,{byteOffset:i,byteLength:o}=a,t+n<i||i+o<t){a&&(e[++I]=a);continue}e[I]=new Uint8Array(g.buffer,t,i-t+o)}return e}function fBe(A,e,t=0,i=e.byteLength){const n=A.byteLength,o=new Uint8Array(A.buffer,A.byteOffset,n),g=new Uint8Array(e.buffer,e.byteOffset,Math.min(i,n));return o.set(g,t),A}function EE(A,e){const t=hni(A),i=t.reduce((r,C)=>r+C.byteLength,0);let n,o,g,a=0,s=-1;const I=Math.min(e||Number.POSITIVE_INFINITY,i);for(const r=t.length;++s<r;){if(n=t[s],o=n.subarray(0,Math.min(n.length,I-a)),I<=a+o.length){o.length<n.length?t[s]=n.subarray(o.length):o.length===n.length&&s++,g?fBe(g,o,a):g=o;break}fBe(g||(g=new Uint8Array(I)),o,a),a+=o.length}return[g||new Uint8Array(0),t.slice(s),i-(g?g.byteLength:0)]}function $i(A,e){let t=dBe(e)?e.value:e;return t instanceof A?A===Uint8Array?new A(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=DpA(t)),t instanceof ArrayBuffer?new A(t):t instanceof JpA?new A(t):dni(t)?$i(A,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new A(0):new A(t.buffer,t.byteOffset,t.byteLength/A.BYTES_PER_ELEMENT):A.from(t)):new A(0)}const lZ=A=>$i(Int32Array,A),ui=A=>$i(Uint8Array,A),NpA=A=>(A.next(),A);function*mni(A,e){const t=function*(n){yield n},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof JpA?t(e):CZ(e)?e:t(e);return yield*NpA(function*(n){let o=null;do o=n.next(yield $i(A,o));while(!o.done)}(i[Symbol.iterator]())),new A}const pni=A=>mni(Uint8Array,A);function yBe(A,e){return QE(this,arguments,function*(){if(F0(e))return yield dt(yield dt(yield*Fj(Zw(yBe(A,yield dt(e))))));const i=function(g){return QE(this,arguments,function*(){yield yield dt(yield dt(g))})},n=function(g){return QE(this,arguments,function*(){yield dt(yield*Fj(Zw(NpA(function*(a){let s=null;do s=a.next(yield s==null?void 0:s.value);while(!s.done)}(g[Symbol.iterator]())))))})},o=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof JpA?i(e):CZ(e)?n(e):DY(e)?e:i(e);return yield dt(yield*Fj(Zw(NpA(function(g){return QE(this,arguments,function*(){let a=null;do a=yield dt(g.next(yield yield dt($i(A,a))));while(!a.done)})}(o[Symbol.asyncIterator]()))))),yield dt(new A)})}const fni=A=>yBe(Uint8Array,A);function YpA(A,e,t){if(A!==0){t=t.slice(0,e+1);for(let i=-1;++i<=e;)t[i]+=A}return t}function yni(A,e){let t=0;const i=A.length;if(i!==e.length)return!1;if(i>0)do if(A[t]!==e[t])return!1;while(++t<i);return!0}const Nl={fromIterable(A){return vj(bni(A))},fromAsyncIterable(A){return vj(wni(A))},fromDOMStream(A){return vj(Dni(A))},fromNodeStream(A){return vj(kni(A))},toDOMStream(A,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(A,e){throw new Error('"toNodeStream" not available in this environment')}},vj=A=>(A.next(),A);function*bni(A){let e,t=!1,i=[],n,o,g,a=0;function s(){return o==="peek"?EE(i,g)[0]:([n,i,a]=EE(i,g),n)}({cmd:o,size:g}=yield null);const I=pni(A)[Symbol.iterator]();try{do if({done:e,value:n}=Number.isNaN(g-a)?I.next():I.next(g-a),!e&&n.byteLength>0&&(i.push(n),a+=n.byteLength),e||g<=a)do({cmd:o,size:g}=yield s());while(g<a);while(!e)}catch(r){(t=!0)&&typeof I.throw=="function"&&I.throw(r)}finally{t===!1&&typeof I.return=="function"&&I.return(null)}return null}function wni(A){return QE(this,arguments,function*(){let t,i=!1,n=[],o,g,a,s=0;function I(){return g==="peek"?EE(n,a)[0]:([o,n,s]=EE(n,a),o)}({cmd:g,size:a}=yield yield dt(null));const r=fni(A)[Symbol.asyncIterator]();try{do if({done:t,value:o}=Number.isNaN(a-s)?yield dt(r.next()):yield dt(r.next(a-s)),!t&&o.byteLength>0&&(n.push(o),s+=o.byteLength),t||a<=s)do({cmd:g,size:a}=yield yield dt(I()));while(a<s);while(!t)}catch(C){(i=!0)&&typeof r.throw=="function"&&(yield dt(r.throw(C)))}finally{i===!1&&typeof r.return=="function"&&(yield dt(r.return(new Uint8Array(0))))}return yield dt(null)})}function Dni(A){return QE(this,arguments,function*(){let t=!1,i=!1,n=[],o,g,a,s=0;function I(){return g==="peek"?EE(n,a)[0]:([o,n,s]=EE(n,a),o)}({cmd:g,size:a}=yield yield dt(null));const r=new Gni(A);try{do if({done:t,value:o}=Number.isNaN(a-s)?yield dt(r.read()):yield dt(r.read(a-s)),!t&&o.byteLength>0&&(n.push(ui(o)),s+=o.byteLength),t||a<=s)do({cmd:g,size:a}=yield yield dt(I()));while(a<s);while(!t)}catch(C){(i=!0)&&(yield dt(r.cancel(C)))}finally{i===!1?yield dt(r.cancel()):A.locked&&r.releaseLock()}return yield dt(null)})}class Gni{constructor(e){this.source=e,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return xA(this,void 0,void 0,function*(){const{reader:t,source:i}=this;t&&(yield t.cancel(e).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(e){return xA(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};const t=yield this.reader.read();return!t.done&&(t.value=ui(t)),t})}}const RpA=(A,e)=>{const t=n=>i([e,n]);let i;return[e,t,new Promise(n=>(i=n)&&A.once(e,t))]};function kni(A){return QE(this,arguments,function*(){const t=[];let i="error",n=!1,o=null,g,a,s=0,I=[],r;function C(){return g==="peek"?EE(I,a)[0]:([r,I,s]=EE(I,a),r)}if({cmd:g,size:a}=yield yield dt(null),A.isTTY)return yield yield dt(new Uint8Array(0)),yield dt(null);try{t[0]=RpA(A,"end"),t[1]=RpA(A,"error");do{if(t[2]=RpA(A,"readable"),[i,o]=yield dt(Promise.race(t.map(c=>c[2]))),i==="error")break;if((n=i==="end")||(Number.isFinite(a-s)?(r=ui(A.read(a-s)),r.byteLength<a-s&&(r=ui(A.read()))):r=ui(A.read()),r.byteLength>0&&(I.push(r),s+=r.byteLength)),n||a<=s)do({cmd:g,size:a}=yield yield dt(C()));while(a<s)}while(!n)}finally{yield dt(l(t,i==="error"?o:null))}return yield dt(null);function l(c,B){return r=I=null,new Promise((E,u)=>{for(const[d,f]of c)A.off(d,f);try{const d=A.destroy;d&&d.call(A,B),B=void 0}catch(d){B=d||B}finally{B!=null?u(B):E()}})}})}var qI;(function(A){A[A.V1=0]="V1",A[A.V2=1]="V2",A[A.V3=2]="V3",A[A.V4=3]="V4",A[A.V5=4]="V5"})(qI||(qI={}));var jI;(function(A){A[A.Sparse=0]="Sparse",A[A.Dense=1]="Dense"})(jI||(jI={}));var Rr;(function(A){A[A.HALF=0]="HALF",A[A.SINGLE=1]="SINGLE",A[A.DOUBLE=2]="DOUBLE"})(Rr||(Rr={}));var eh;(function(A){A[A.DAY=0]="DAY",A[A.MILLISECOND=1]="MILLISECOND"})(eh||(eh={}));var di;(function(A){A[A.SECOND=0]="SECOND",A[A.MILLISECOND=1]="MILLISECOND",A[A.MICROSECOND=2]="MICROSECOND",A[A.NANOSECOND=3]="NANOSECOND"})(di||(di={}));var M0;(function(A){A[A.YEAR_MONTH=0]="YEAR_MONTH",A[A.DAY_TIME=1]="DAY_TIME",A[A.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(M0||(M0={}));var wi;(function(A){A[A.NONE=0]="NONE",A[A.Schema=1]="Schema",A[A.DictionaryBatch=2]="DictionaryBatch",A[A.RecordBatch=3]="RecordBatch",A[A.Tensor=4]="Tensor",A[A.SparseTensor=5]="SparseTensor"})(wi||(wi={}));var dA;(function(A){A[A.NONE=0]="NONE",A[A.Null=1]="Null",A[A.Int=2]="Int",A[A.Float=3]="Float",A[A.Binary=4]="Binary",A[A.Utf8=5]="Utf8",A[A.Bool=6]="Bool",A[A.Decimal=7]="Decimal",A[A.Date=8]="Date",A[A.Time=9]="Time",A[A.Timestamp=10]="Timestamp",A[A.Interval=11]="Interval",A[A.List=12]="List",A[A.Struct=13]="Struct",A[A.Union=14]="Union",A[A.FixedSizeBinary=15]="FixedSizeBinary",A[A.FixedSizeList=16]="FixedSizeList",A[A.Map=17]="Map",A[A.Dictionary=-1]="Dictionary",A[A.Int8=-2]="Int8",A[A.Int16=-3]="Int16",A[A.Int32=-4]="Int32",A[A.Int64=-5]="Int64",A[A.Uint8=-6]="Uint8",A[A.Uint16=-7]="Uint16",A[A.Uint32=-8]="Uint32",A[A.Uint64=-9]="Uint64",A[A.Float16=-10]="Float16",A[A.Float32=-11]="Float32",A[A.Float64=-12]="Float64",A[A.DateDay=-13]="DateDay",A[A.DateMillisecond=-14]="DateMillisecond",A[A.TimestampSecond=-15]="TimestampSecond",A[A.TimestampMillisecond=-16]="TimestampMillisecond",A[A.TimestampMicrosecond=-17]="TimestampMicrosecond",A[A.TimestampNanosecond=-18]="TimestampNanosecond",A[A.TimeSecond=-19]="TimeSecond",A[A.TimeMillisecond=-20]="TimeMillisecond",A[A.TimeMicrosecond=-21]="TimeMicrosecond",A[A.TimeNanosecond=-22]="TimeNanosecond",A[A.DenseUnion=-23]="DenseUnion",A[A.SparseUnion=-24]="SparseUnion",A[A.IntervalDayTime=-25]="IntervalDayTime",A[A.IntervalYearMonth=-26]="IntervalYearMonth"})(dA||(dA={}));var th;(function(A){A[A.OFFSET=0]="OFFSET",A[A.DATA=1]="DATA",A[A.VALIDITY=2]="VALIDITY",A[A.TYPE=3]="TYPE"})(th||(th={}));const Jni=void 0;function cZ(A){if(A===null)return"null";if(A===Jni)return"undefined";switch(typeof A){case"number":return`${A}`;case"bigint":return`${A}`;case"string":return`"${A}"`}return typeof A[Symbol.toPrimitive]=="function"?A[Symbol.toPrimitive]("string"):ArrayBuffer.isView(A)?A instanceof rZ||A instanceof IZ?`[${[...A].map(e=>cZ(e))}]`:`[${A}]`:ArrayBuffer.isView(A)?`[${A}]`:JSON.stringify(A,(e,t)=>typeof t=="bigint"?`${t}`:t)}const Nni=Symbol.for("isArrowBigNum");function BB(A,...e){return e.length===0?Object.setPrototypeOf($i(this.TypedArray,A),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(A,...e),this.constructor.prototype)}BB.prototype[Nni]=!0,BB.prototype.toJSON=function(){return`"${Ww(this)}"`},BB.prototype.valueOf=function(){return bBe(this)},BB.prototype.toString=function(){return Ww(this)},BB.prototype[Symbol.toPrimitive]=function(A="default"){switch(A){case"number":return bBe(this);case"string":return Ww(this);case"default":return xpA(this)}return Ww(this)};function GY(...A){return BB.apply(this,A)}function kY(...A){return BB.apply(this,A)}function BZ(...A){return BB.apply(this,A)}Object.setPrototypeOf(GY.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(kY.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(BZ.prototype,Object.create(Uint32Array.prototype)),Object.assign(GY.prototype,BB.prototype,{constructor:GY,signed:!0,TypedArray:Int32Array,BigIntArray:rZ}),Object.assign(kY.prototype,BB.prototype,{constructor:kY,signed:!1,TypedArray:Uint32Array,BigIntArray:IZ}),Object.assign(BZ.prototype,BB.prototype,{constructor:BZ,signed:!0,TypedArray:Uint32Array,BigIntArray:IZ});function bBe(A){const{buffer:e,byteOffset:t,length:i,signed:n}=A,o=new IZ(e,t,i),g=n&&o[o.length-1]&BigInt(1)<<BigInt(63);let a=BigInt(g?1:0),s=BigInt(0);if(g){for(const I of o)a+=~I*(BigInt(1)<<BigInt(32)*s++);a*=BigInt(-1)}else for(const I of o)a+=I*(BigInt(1)<<BigInt(32)*s++);return a}let Ww,xpA;Bni?(xpA=A=>A.byteLength===8?new A.BigIntArray(A.buffer,A.byteOffset,1)[0]:FpA(A),Ww=A=>A.byteLength===8?`${new A.BigIntArray(A.buffer,A.byteOffset,1)[0]}`:FpA(A)):(Ww=FpA,xpA=Ww);function FpA(A){let e="";const t=new Uint32Array(2);let i=new Uint16Array(A.buffer,A.byteOffset,A.byteLength/2);const n=new Uint32Array((i=new Uint16Array(i).reverse()).buffer);let o=-1;const g=i.length-1;do{for(t[0]=i[o=0];o<g;)i[o++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+i[o];i[o]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e=`${t[0]}${e}`}while(n[0]||n[1]||n[2]||n[3]);return e??"0"}class MpA{static new(e,t){switch(t){case!0:return new GY(e);case!1:return new kY(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case rZ:return new GY(e)}return e.byteLength===16?new BZ(e):new kY(e)}static signed(e){return new GY(e)}static unsigned(e){return new kY(e)}static decimal(e){return new BZ(e)}constructor(e,t){return MpA.new(e,t)}}var wBe,DBe,GBe,kBe,JBe,NBe,YBe,RBe,xBe,FBe,MBe,vBe,LBe,SBe,HBe,ZBe,WBe,KBe,UBe;class $e{static isNull(e){return(e==null?void 0:e.typeId)===dA.Null}static isInt(e){return(e==null?void 0:e.typeId)===dA.Int}static isFloat(e){return(e==null?void 0:e.typeId)===dA.Float}static isBinary(e){return(e==null?void 0:e.typeId)===dA.Binary}static isUtf8(e){return(e==null?void 0:e.typeId)===dA.Utf8}static isBool(e){return(e==null?void 0:e.typeId)===dA.Bool}static isDecimal(e){return(e==null?void 0:e.typeId)===dA.Decimal}static isDate(e){return(e==null?void 0:e.typeId)===dA.Date}static isTime(e){return(e==null?void 0:e.typeId)===dA.Time}static isTimestamp(e){return(e==null?void 0:e.typeId)===dA.Timestamp}static isInterval(e){return(e==null?void 0:e.typeId)===dA.Interval}static isList(e){return(e==null?void 0:e.typeId)===dA.List}static isStruct(e){return(e==null?void 0:e.typeId)===dA.Struct}static isUnion(e){return(e==null?void 0:e.typeId)===dA.Union}static isFixedSizeBinary(e){return(e==null?void 0:e.typeId)===dA.FixedSizeBinary}static isFixedSizeList(e){return(e==null?void 0:e.typeId)===dA.FixedSizeList}static isMap(e){return(e==null?void 0:e.typeId)===dA.Map}static isDictionary(e){return(e==null?void 0:e.typeId)===dA.Dictionary}static isDenseUnion(e){return $e.isUnion(e)&&e.mode===jI.Dense}static isSparseUnion(e){return $e.isUnion(e)&&e.mode===jI.Sparse}get typeId(){return dA.NONE}}wBe=Symbol.toStringTag,$e[wBe]=(A=>(A.children=null,A.ArrayType=Array,A[Symbol.toStringTag]="DataType"))($e.prototype);let v0=class extends $e{toString(){return"Null"}get typeId(){return dA.Null}};DBe=Symbol.toStringTag,v0[DBe]=(A=>A[Symbol.toStringTag]="Null")(v0.prototype);class L0 extends $e{constructor(e,t){super(),this.isSigned=e,this.bitWidth=t}get typeId(){return dA.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?rZ:IZ}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}GBe=Symbol.toStringTag,L0[GBe]=(A=>(A.isSigned=null,A.bitWidth=null,A[Symbol.toStringTag]="Int"))(L0.prototype);class QZ extends L0{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(QZ.prototype,"ArrayType",{value:Int32Array});class EZ extends $e{constructor(e){super(),this.precision=e}get typeId(){return dA.Float}get ArrayType(){switch(this.precision){case Rr.HALF:return Uint16Array;case Rr.SINGLE:return Float32Array;case Rr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}kBe=Symbol.toStringTag,EZ[kBe]=(A=>(A.precision=null,A[Symbol.toStringTag]="Float"))(EZ.prototype);let Lj=class extends $e{constructor(){super()}get typeId(){return dA.Binary}toString(){return"Binary"}};JBe=Symbol.toStringTag,Lj[JBe]=(A=>(A.ArrayType=Uint8Array,A[Symbol.toStringTag]="Binary"))(Lj.prototype);let Sj=class extends $e{constructor(){super()}get typeId(){return dA.Utf8}toString(){return"Utf8"}};NBe=Symbol.toStringTag,Sj[NBe]=(A=>(A.ArrayType=Uint8Array,A[Symbol.toStringTag]="Utf8"))(Sj.prototype);let Hj=class extends $e{constructor(){super()}get typeId(){return dA.Bool}toString(){return"Bool"}};YBe=Symbol.toStringTag,Hj[YBe]=(A=>(A.ArrayType=Uint8Array,A[Symbol.toStringTag]="Bool"))(Hj.prototype);let Zj=class extends $e{constructor(e,t,i=128){super(),this.scale=e,this.precision=t,this.bitWidth=i}get typeId(){return dA.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};RBe=Symbol.toStringTag,Zj[RBe]=(A=>(A.scale=null,A.precision=null,A.ArrayType=Uint32Array,A[Symbol.toStringTag]="Decimal"))(Zj.prototype);class Wj extends $e{constructor(e){super(),this.unit=e}get typeId(){return dA.Date}toString(){return`Date${(this.unit+1)*32}<${eh[this.unit]}>`}}xBe=Symbol.toStringTag,Wj[xBe]=(A=>(A.unit=null,A.ArrayType=Int32Array,A[Symbol.toStringTag]="Date"))(Wj.prototype);class uZ extends $e{constructor(e,t){super(),this.unit=e,this.bitWidth=t}get typeId(){return dA.Time}toString(){return`Time${this.bitWidth}<${di[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return rZ}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}FBe=Symbol.toStringTag,uZ[FBe]=(A=>(A.unit=null,A.bitWidth=null,A[Symbol.toStringTag]="Time"))(uZ.prototype);class Kj extends $e{constructor(e,t){super(),this.unit=e,this.timezone=t}get typeId(){return dA.Timestamp}toString(){return`Timestamp<${di[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}MBe=Symbol.toStringTag,Kj[MBe]=(A=>(A.unit=null,A.timezone=null,A.ArrayType=Int32Array,A[Symbol.toStringTag]="Timestamp"))(Kj.prototype);class Uj extends $e{constructor(e){super(),this.unit=e}get typeId(){return dA.Interval}toString(){return`Interval<${M0[this.unit]}>`}}vBe=Symbol.toStringTag,Uj[vBe]=(A=>(A.unit=null,A.ArrayType=Int32Array,A[Symbol.toStringTag]="Interval"))(Uj.prototype);let Vj=class extends $e{constructor(e){super(),this.children=[e]}get typeId(){return dA.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};LBe=Symbol.toStringTag,Vj[LBe]=(A=>(A.children=null,A[Symbol.toStringTag]="List"))(Vj.prototype);class xs extends $e{constructor(e){super(),this.children=e}get typeId(){return dA.Struct}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}}SBe=Symbol.toStringTag,xs[SBe]=(A=>(A.children=null,A[Symbol.toStringTag]="Struct"))(xs.prototype);class Xj extends $e{constructor(e,t,i){super(),this.mode=e,this.children=i,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((n,o,g)=>(n[o]=g)&&n||n,Object.create(null))}get typeId(){return dA.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}}HBe=Symbol.toStringTag,Xj[HBe]=(A=>(A.mode=null,A.typeIds=null,A.children=null,A.typeIdToChildIndex=null,A.ArrayType=Int8Array,A[Symbol.toStringTag]="Union"))(Xj.prototype);let zj=class extends $e{constructor(e){super(),this.byteWidth=e}get typeId(){return dA.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};ZBe=Symbol.toStringTag,zj[ZBe]=(A=>(A.byteWidth=null,A.ArrayType=Uint8Array,A[Symbol.toStringTag]="FixedSizeBinary"))(zj.prototype);let Tj=class extends $e{constructor(e,t){super(),this.listSize=e,this.children=[t]}get typeId(){return dA.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};WBe=Symbol.toStringTag,Tj[WBe]=(A=>(A.children=null,A.listSize=null,A[Symbol.toStringTag]="FixedSizeList"))(Tj.prototype);class _j extends $e{constructor(e,t=!1){super(),this.children=[e],this.keysSorted=t}get typeId(){return dA.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}}KBe=Symbol.toStringTag,_j[KBe]=(A=>(A.children=null,A.keysSorted=null,A[Symbol.toStringTag]="Map_"))(_j.prototype);const Yni=(A=>()=>++A)(-1);class JY extends $e{constructor(e,t,i,n){super(),this.indices=t,this.dictionary=e,this.isOrdered=n||!1,this.id=i==null?Yni():typeof i=="number"?i:i.low}get typeId(){return dA.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}UBe=Symbol.toStringTag,JY[UBe]=(A=>(A.id=null,A.indices=null,A.isOrdered=null,A.dictionary=null,A[Symbol.toStringTag]="Dictionary"))(JY.prototype);function ih(A){const e=A;switch(A.typeId){case dA.Decimal:return A.bitWidth/32;case dA.Timestamp:return 2;case dA.Date:return 1+e.unit;case dA.Interval:return 1+e.unit;case dA.FixedSizeList:return e.listSize;case dA.FixedSizeBinary:return e.byteWidth;default:return 1}}class Tt{visitMany(e,...t){return e.map((i,n)=>this.visit(i,...t.map(o=>o[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Rni(this,e,t)}getVisitFnByTypeId(e,t=!0){return NY(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}}function Rni(A,e,t=!0){return typeof e=="number"?NY(A,e,t):typeof e=="string"&&e in dA?NY(A,dA[e],t):e&&e instanceof $e?NY(A,VBe(e),t):e!=null&&e.type&&e.type instanceof $e?NY(A,VBe(e.type),t):NY(A,dA.NONE,t)}function NY(A,e,t=!0){let i=null;switch(e){case dA.Null:i=A.visitNull;break;case dA.Bool:i=A.visitBool;break;case dA.Int:i=A.visitInt;break;case dA.Int8:i=A.visitInt8||A.visitInt;break;case dA.Int16:i=A.visitInt16||A.visitInt;break;case dA.Int32:i=A.visitInt32||A.visitInt;break;case dA.Int64:i=A.visitInt64||A.visitInt;break;case dA.Uint8:i=A.visitUint8||A.visitInt;break;case dA.Uint16:i=A.visitUint16||A.visitInt;break;case dA.Uint32:i=A.visitUint32||A.visitInt;break;case dA.Uint64:i=A.visitUint64||A.visitInt;break;case dA.Float:i=A.visitFloat;break;case dA.Float16:i=A.visitFloat16||A.visitFloat;break;case dA.Float32:i=A.visitFloat32||A.visitFloat;break;case dA.Float64:i=A.visitFloat64||A.visitFloat;break;case dA.Utf8:i=A.visitUtf8;break;case dA.Binary:i=A.visitBinary;break;case dA.FixedSizeBinary:i=A.visitFixedSizeBinary;break;case dA.Date:i=A.visitDate;break;case dA.DateDay:i=A.visitDateDay||A.visitDate;break;case dA.DateMillisecond:i=A.visitDateMillisecond||A.visitDate;break;case dA.Timestamp:i=A.visitTimestamp;break;case dA.TimestampSecond:i=A.visitTimestampSecond||A.visitTimestamp;break;case dA.TimestampMillisecond:i=A.visitTimestampMillisecond||A.visitTimestamp;break;case dA.TimestampMicrosecond:i=A.visitTimestampMicrosecond||A.visitTimestamp;break;case dA.TimestampNanosecond:i=A.visitTimestampNanosecond||A.visitTimestamp;break;case dA.Time:i=A.visitTime;break;case dA.TimeSecond:i=A.visitTimeSecond||A.visitTime;break;case dA.TimeMillisecond:i=A.visitTimeMillisecond||A.visitTime;break;case dA.TimeMicrosecond:i=A.visitTimeMicrosecond||A.visitTime;break;case dA.TimeNanosecond:i=A.visitTimeNanosecond||A.visitTime;break;case dA.Decimal:i=A.visitDecimal;break;case dA.List:i=A.visitList;break;case dA.Struct:i=A.visitStruct;break;case dA.Union:i=A.visitUnion;break;case dA.DenseUnion:i=A.visitDenseUnion||A.visitUnion;break;case dA.SparseUnion:i=A.visitSparseUnion||A.visitUnion;break;case dA.Dictionary:i=A.visitDictionary;break;case dA.Interval:i=A.visitInterval;break;case dA.IntervalDayTime:i=A.visitIntervalDayTime||A.visitInterval;break;case dA.IntervalYearMonth:i=A.visitIntervalYearMonth||A.visitInterval;break;case dA.FixedSizeList:i=A.visitFixedSizeList;break;case dA.Map:i=A.visitMap;break}if(typeof i=="function")return i;if(!t)return()=>null;throw new Error(`Unrecognized type '${dA[e]}'`)}function VBe(A){switch(A.typeId){case dA.Null:return dA.Null;case dA.Int:{const{bitWidth:e,isSigned:t}=A;switch(e){case 8:return t?dA.Int8:dA.Uint8;case 16:return t?dA.Int16:dA.Uint16;case 32:return t?dA.Int32:dA.Uint32;case 64:return t?dA.Int64:dA.Uint64}return dA.Int}case dA.Float:switch(A.precision){case Rr.HALF:return dA.Float16;case Rr.SINGLE:return dA.Float32;case Rr.DOUBLE:return dA.Float64}return dA.Float;case dA.Binary:return dA.Binary;case dA.Utf8:return dA.Utf8;case dA.Bool:return dA.Bool;case dA.Decimal:return dA.Decimal;case dA.Time:switch(A.unit){case di.SECOND:return dA.TimeSecond;case di.MILLISECOND:return dA.TimeMillisecond;case di.MICROSECOND:return dA.TimeMicrosecond;case di.NANOSECOND:return dA.TimeNanosecond}return dA.Time;case dA.Timestamp:switch(A.unit){case di.SECOND:return dA.TimestampSecond;case di.MILLISECOND:return dA.TimestampMillisecond;case di.MICROSECOND:return dA.TimestampMicrosecond;case di.NANOSECOND:return dA.TimestampNanosecond}return dA.Timestamp;case dA.Date:switch(A.unit){case eh.DAY:return dA.DateDay;case eh.MILLISECOND:return dA.DateMillisecond}return dA.Date;case dA.Interval:switch(A.unit){case M0.DAY_TIME:return dA.IntervalDayTime;case M0.YEAR_MONTH:return dA.IntervalYearMonth}return dA.Interval;case dA.Map:return dA.Map;case dA.List:return dA.List;case dA.Struct:return dA.Struct;case dA.Union:switch(A.mode){case jI.Dense:return dA.DenseUnion;case jI.Sparse:return dA.SparseUnion}return dA.Union;case dA.FixedSizeBinary:return dA.FixedSizeBinary;case dA.FixedSizeList:return dA.FixedSizeList;case dA.Dictionary:return dA.Dictionary}throw new Error(`Unrecognized type '${dA[A.typeId]}'`)}Tt.prototype.visitInt8=null,Tt.prototype.visitInt16=null,Tt.prototype.visitInt32=null,Tt.prototype.visitInt64=null,Tt.prototype.visitUint8=null,Tt.prototype.visitUint16=null,Tt.prototype.visitUint32=null,Tt.prototype.visitUint64=null,Tt.prototype.visitFloat16=null,Tt.prototype.visitFloat32=null,Tt.prototype.visitFloat64=null,Tt.prototype.visitDateDay=null,Tt.prototype.visitDateMillisecond=null,Tt.prototype.visitTimestampSecond=null,Tt.prototype.visitTimestampMillisecond=null,Tt.prototype.visitTimestampMicrosecond=null,Tt.prototype.visitTimestampNanosecond=null,Tt.prototype.visitTimeSecond=null,Tt.prototype.visitTimeMillisecond=null,Tt.prototype.visitTimeMicrosecond=null,Tt.prototype.visitTimeNanosecond=null,Tt.prototype.visitDenseUnion=null,Tt.prototype.visitSparseUnion=null,Tt.prototype.visitIntervalDayTime=null,Tt.prototype.visitIntervalYearMonth=null;const XBe=new Float64Array(1),YY=new Uint32Array(XBe.buffer);function zBe(A){const e=(A&31744)>>10,t=(A&1023)/1024,i=Math.pow(-1,(A&32768)>>15);switch(e){case 31:return i*(t?Number.NaN:1/0);case 0:return i*(t?6103515625e-14*t:0)}return i*Math.pow(2,e-15)*(1+t)}function xni(A){if(A!==A)return 32256;XBe[0]=A;const e=(YY[1]&2147483648)>>16&65535;let t=YY[1]&2146435072,i=0;return t>=1089470464?YY[0]>0?t=31744:(t=(t&2080374784)>>16,i=(YY[1]&1048575)>>10):t<=1056964608?(i=1048576+(YY[1]&1048575),i=1048576+(i<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,i=(YY[1]&1048575)+512>>10),e|t|i&65535}class gt extends Tt{}function Qt(A){return(e,t,i)=>{if(e.setValid(t,i!=null))return A(e,t,i)}}const Fni=(A,e,t)=>{A[e]=Math.trunc(t/864e5)},vpA=(A,e,t)=>{A[e]=Math.trunc(t%4294967296),A[e+1]=Math.trunc(t/4294967296)},Mni=(A,e,t)=>{A[e]=Math.trunc(t*1e3%4294967296),A[e+1]=Math.trunc(t*1e3/4294967296)},vni=(A,e,t)=>{A[e]=Math.trunc(t*1e6%4294967296),A[e+1]=Math.trunc(t*1e6/4294967296)},TBe=(A,e,t,i)=>{if(t+1<e.length){const{[t]:n,[t+1]:o}=e;A.set(i.subarray(0,o-n),n)}},Lni=({offset:A,values:e},t,i)=>{const n=A+t;i?e[n>>3]|=1<<n%8:e[n>>3]&=~(1<<n%8)},nh=({values:A},e,t)=>{A[e]=t},LpA=({values:A},e,t)=>{A[e]=t},_Be=({values:A},e,t)=>{A[e]=xni(t)},Sni=(A,e,t)=>{switch(A.type.precision){case Rr.HALF:return _Be(A,e,t);case Rr.SINGLE:case Rr.DOUBLE:return LpA(A,e,t)}},OBe=({values:A},e,t)=>{Fni(A,e,t.valueOf())},qBe=({values:A},e,t)=>{vpA(A,e*2,t.valueOf())},Hni=({stride:A,values:e},t,i)=>{e.set(i.subarray(0,A),A*t)},Zni=({values:A,valueOffsets:e},t,i)=>TBe(A,e,t,i),Wni=({values:A,valueOffsets:e},t,i)=>{TBe(A,e,t,DpA(i))},Kni=(A,e,t)=>{A.type.unit===eh.DAY?OBe(A,e,t):qBe(A,e,t)},jBe=({values:A},e,t)=>vpA(A,e*2,t/1e3),PBe=({values:A},e,t)=>vpA(A,e*2,t),$Be=({values:A},e,t)=>Mni(A,e*2,t),AQe=({values:A},e,t)=>vni(A,e*2,t),Uni=(A,e,t)=>{switch(A.type.unit){case di.SECOND:return jBe(A,e,t);case di.MILLISECOND:return PBe(A,e,t);case di.MICROSECOND:return $Be(A,e,t);case di.NANOSECOND:return AQe(A,e,t)}},eQe=({values:A},e,t)=>{A[e]=t},tQe=({values:A},e,t)=>{A[e]=t},iQe=({values:A},e,t)=>{A[e]=t},nQe=({values:A},e,t)=>{A[e]=t},Vni=(A,e,t)=>{switch(A.type.unit){case di.SECOND:return eQe(A,e,t);case di.MILLISECOND:return tQe(A,e,t);case di.MICROSECOND:return iQe(A,e,t);case di.NANOSECOND:return nQe(A,e,t)}},Xni=({values:A,stride:e},t,i)=>{A.set(i.subarray(0,e),e*t)},zni=(A,e,t)=>{const i=A.children[0],n=A.valueOffsets,o=Yl.getVisitFn(i);if(Array.isArray(t))for(let g=-1,a=n[e],s=n[e+1];a<s;)o(i,a++,t[++g]);else for(let g=-1,a=n[e],s=n[e+1];a<s;)o(i,a++,t.get(++g))},Tni=(A,e,t)=>{const i=A.children[0],{valueOffsets:n}=A,o=Yl.getVisitFn(i);let{[e]:g,[e+1]:a}=n;const s=t instanceof Map?t.entries():Object.entries(t);for(const I of s)if(o(i,g,I),++g>=a)break},_ni=(A,e)=>(t,i,n,o)=>i&&t(i,A,e[o]),Oni=(A,e)=>(t,i,n,o)=>i&&t(i,A,e.get(o)),qni=(A,e)=>(t,i,n,o)=>i&&t(i,A,e.get(n.name)),jni=(A,e)=>(t,i,n,o)=>i&&t(i,A,e[n.name]),Pni=(A,e,t)=>{const i=A.type.children.map(o=>Yl.getVisitFn(o.type)),n=t instanceof Map?qni(e,t):t instanceof Di?Oni(e,t):Array.isArray(t)?_ni(e,t):jni(e,t);A.type.children.forEach((o,g)=>n(i[g],A.children[g],o,g))},$ni=(A,e,t)=>{A.type.mode===jI.Dense?oQe(A,e,t):gQe(A,e,t)},oQe=(A,e,t)=>{const i=A.type.typeIdToChildIndex[A.typeIds[e]],n=A.children[i];Yl.visit(n,A.valueOffsets[e],t)},gQe=(A,e,t)=>{const i=A.type.typeIdToChildIndex[A.typeIds[e]],n=A.children[i];Yl.visit(n,e,t)},Aoi=(A,e,t)=>{var i;(i=A.dictionary)===null||i===void 0||i.set(A.values[e],t)},eoi=(A,e,t)=>{A.type.unit===M0.DAY_TIME?aQe(A,e,t):sQe(A,e,t)},aQe=({values:A},e,t)=>{A.set(t.subarray(0,2),2*e)},sQe=({values:A},e,t)=>{A[e]=t[0]*12+t[1]%12},toi=(A,e,t)=>{const{stride:i}=A,n=A.children[0],o=Yl.getVisitFn(n);if(Array.isArray(t))for(let g=-1,a=e*i;++g<i;)o(n,a+g,t[g]);else for(let g=-1,a=e*i;++g<i;)o(n,a+g,t.get(g))};gt.prototype.visitBool=Qt(Lni),gt.prototype.visitInt=Qt(nh),gt.prototype.visitInt8=Qt(nh),gt.prototype.visitInt16=Qt(nh),gt.prototype.visitInt32=Qt(nh),gt.prototype.visitInt64=Qt(nh),gt.prototype.visitUint8=Qt(nh),gt.prototype.visitUint16=Qt(nh),gt.prototype.visitUint32=Qt(nh),gt.prototype.visitUint64=Qt(nh),gt.prototype.visitFloat=Qt(Sni),gt.prototype.visitFloat16=Qt(_Be),gt.prototype.visitFloat32=Qt(LpA),gt.prototype.visitFloat64=Qt(LpA),gt.prototype.visitUtf8=Qt(Wni),gt.prototype.visitBinary=Qt(Zni),gt.prototype.visitFixedSizeBinary=Qt(Hni),gt.prototype.visitDate=Qt(Kni),gt.prototype.visitDateDay=Qt(OBe),gt.prototype.visitDateMillisecond=Qt(qBe),gt.prototype.visitTimestamp=Qt(Uni),gt.prototype.visitTimestampSecond=Qt(jBe),gt.prototype.visitTimestampMillisecond=Qt(PBe),gt.prototype.visitTimestampMicrosecond=Qt($Be),gt.prototype.visitTimestampNanosecond=Qt(AQe),gt.prototype.visitTime=Qt(Vni),gt.prototype.visitTimeSecond=Qt(eQe),gt.prototype.visitTimeMillisecond=Qt(tQe),gt.prototype.visitTimeMicrosecond=Qt(iQe),gt.prototype.visitTimeNanosecond=Qt(nQe),gt.prototype.visitDecimal=Qt(Xni),gt.prototype.visitList=Qt(zni),gt.prototype.visitStruct=Qt(Pni),gt.prototype.visitUnion=Qt($ni),gt.prototype.visitDenseUnion=Qt(oQe),gt.prototype.visitSparseUnion=Qt(gQe),gt.prototype.visitDictionary=Qt(Aoi),gt.prototype.visitInterval=Qt(eoi),gt.prototype.visitIntervalDayTime=Qt(aQe),gt.prototype.visitIntervalYearMonth=Qt(sQe),gt.prototype.visitFixedSizeList=Qt(toi),gt.prototype.visitMap=Qt(Tni);const Yl=new gt,QB=Symbol.for("parent"),RY=Symbol.for("rowIndex");class SpA{constructor(e,t){return this[QB]=e,this[RY]=t,new Proxy(this,new noi)}toArray(){return Object.values(this.toJSON())}toJSON(){const e=this[RY],t=this[QB],i=t.type.children,n={};for(let o=-1,g=i.length;++o<g;)n[i[o].name]=xr.visit(t.children[o],e);return n}toString(){return`{${[...this].map(([e,t])=>`${cZ(e)}: ${cZ(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new ioi(this[QB],this[RY])}}class ioi{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,xr.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(SpA.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[QB]:{writable:!0,enumerable:!1,configurable:!1,value:null},[RY]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class noi{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[QB].type.children.map(t=>t.name)}has(e,t){return e[QB].type.children.findIndex(i=>i.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[QB].type.children.findIndex(i=>i.name===t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];const i=e[QB].type.children.findIndex(n=>n.name===t);if(i!==-1){const n=xr.visit(e[QB].children[i],e[RY]);return Reflect.set(e,t,n),n}}set(e,t,i){const n=e[QB].type.children.findIndex(o=>o.name===t);return n!==-1?(Yl.visit(e[QB].children[n],e[RY],i),Reflect.set(e,t,i)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,i):!1}}class At extends Tt{}function at(A){return(e,t)=>e.getValid(t)?A(e,t):null}const ooi=(A,e)=>864e5*A[e],HpA=(A,e)=>4294967296*A[e+1]+(A[e]>>>0),goi=(A,e)=>4294967296*(A[e+1]/1e3)+(A[e]>>>0)/1e3,aoi=(A,e)=>4294967296*(A[e+1]/1e6)+(A[e]>>>0)/1e6,rQe=A=>new Date(A),soi=(A,e)=>rQe(ooi(A,e)),roi=(A,e)=>rQe(HpA(A,e)),Ioi=(A,e)=>null,IQe=(A,e,t)=>{if(t+1>=e.length)return null;const i=e[t],n=e[t+1];return A.subarray(i,n)},Coi=({offset:A,values:e},t)=>{const i=A+t;return(e[i>>3]&1<<i%8)!==0},CQe=({values:A},e)=>soi(A,e),lQe=({values:A},e)=>roi(A,e*2),S0=({stride:A,values:e},t)=>e[A*t],loi=({stride:A,values:e},t)=>zBe(e[A*t]),cQe=({values:A},e)=>A[e],coi=({stride:A,values:e},t)=>e.subarray(A*t,A*(t+1)),Boi=({values:A,valueOffsets:e},t)=>IQe(A,e,t),Qoi=({values:A,valueOffsets:e},t)=>{const i=IQe(A,e,t);return i!==null?wpA(i):null},Eoi=({values:A},e)=>A[e],uoi=({type:A,values:e},t)=>A.precision!==Rr.HALF?e[t]:zBe(e[t]),doi=(A,e)=>A.type.unit===eh.DAY?CQe(A,e):lQe(A,e),BQe=({values:A},e)=>1e3*HpA(A,e*2),QQe=({values:A},e)=>HpA(A,e*2),EQe=({values:A},e)=>goi(A,e*2),uQe=({values:A},e)=>aoi(A,e*2),hoi=(A,e)=>{switch(A.type.unit){case di.SECOND:return BQe(A,e);case di.MILLISECOND:return QQe(A,e);case di.MICROSECOND:return EQe(A,e);case di.NANOSECOND:return uQe(A,e)}},dQe=({values:A},e)=>A[e],hQe=({values:A},e)=>A[e],mQe=({values:A},e)=>A[e],pQe=({values:A},e)=>A[e],moi=(A,e)=>{switch(A.type.unit){case di.SECOND:return dQe(A,e);case di.MILLISECOND:return hQe(A,e);case di.MICROSECOND:return mQe(A,e);case di.NANOSECOND:return pQe(A,e)}},poi=({values:A,stride:e},t)=>MpA.decimal(A.subarray(e*t,e*(t+1))),foi=(A,e)=>{const{valueOffsets:t,stride:i,children:n}=A,{[e*i]:o,[e*i+1]:g}=t,s=n[0].slice(o,g-o);return new Di([s])},yoi=(A,e)=>{const{valueOffsets:t,children:i}=A,{[e]:n,[e+1]:o}=t,g=i[0];return new ZpA(g.slice(n,o-n))},boi=(A,e)=>new SpA(A,e),woi=(A,e)=>A.type.mode===jI.Dense?fQe(A,e):yQe(A,e),fQe=(A,e)=>{const t=A.type.typeIdToChildIndex[A.typeIds[e]],i=A.children[t];return xr.visit(i,A.valueOffsets[e])},yQe=(A,e)=>{const t=A.type.typeIdToChildIndex[A.typeIds[e]],i=A.children[t];return xr.visit(i,e)},Doi=(A,e)=>{var t;return(t=A.dictionary)===null||t===void 0?void 0:t.get(A.values[e])},Goi=(A,e)=>A.type.unit===M0.DAY_TIME?bQe(A,e):wQe(A,e),bQe=({values:A},e)=>A.subarray(2*e,2*(e+1)),wQe=({values:A},e)=>{const t=A[e],i=new Int32Array(2);return i[0]=Math.trunc(t/12),i[1]=Math.trunc(t%12),i},koi=(A,e)=>{const{stride:t,children:i}=A,o=i[0].slice(e*t,t);return new Di([o])};At.prototype.visitNull=at(Ioi),At.prototype.visitBool=at(Coi),At.prototype.visitInt=at(Eoi),At.prototype.visitInt8=at(S0),At.prototype.visitInt16=at(S0),At.prototype.visitInt32=at(S0),At.prototype.visitInt64=at(cQe),At.prototype.visitUint8=at(S0),At.prototype.visitUint16=at(S0),At.prototype.visitUint32=at(S0),At.prototype.visitUint64=at(cQe),At.prototype.visitFloat=at(uoi),At.prototype.visitFloat16=at(loi),At.prototype.visitFloat32=at(S0),At.prototype.visitFloat64=at(S0),At.prototype.visitUtf8=at(Qoi),At.prototype.visitBinary=at(Boi),At.prototype.visitFixedSizeBinary=at(coi),At.prototype.visitDate=at(doi),At.prototype.visitDateDay=at(CQe),At.prototype.visitDateMillisecond=at(lQe),At.prototype.visitTimestamp=at(hoi),At.prototype.visitTimestampSecond=at(BQe),At.prototype.visitTimestampMillisecond=at(QQe),At.prototype.visitTimestampMicrosecond=at(EQe),At.prototype.visitTimestampNanosecond=at(uQe),At.prototype.visitTime=at(moi),At.prototype.visitTimeSecond=at(dQe),At.prototype.visitTimeMillisecond=at(hQe),At.prototype.visitTimeMicrosecond=at(mQe),At.prototype.visitTimeNanosecond=at(pQe),At.prototype.visitDecimal=at(poi),At.prototype.visitList=at(foi),At.prototype.visitStruct=at(boi),At.prototype.visitUnion=at(woi),At.prototype.visitDenseUnion=at(fQe),At.prototype.visitSparseUnion=at(yQe),At.prototype.visitDictionary=at(Doi),At.prototype.visitInterval=at(Goi),At.prototype.visitIntervalDayTime=at(bQe),At.prototype.visitIntervalYearMonth=at(wQe),At.prototype.visitFixedSizeList=at(koi),At.prototype.visitMap=at(yoi);const xr=new At,uE=Symbol.for("keys"),xY=Symbol.for("vals");class ZpA{constructor(e){return this[uE]=new Di([e.children[0]]).memoize(),this[xY]=e.children[1],new Proxy(this,new Noi)}[Symbol.iterator](){return new Joi(this[uE],this[xY])}get size(){return this[uE].length}toArray(){return Object.values(this.toJSON())}toJSON(){const e=this[uE],t=this[xY],i={};for(let n=-1,o=e.length;++n<o;)i[e.get(n)]=xr.visit(t,n);return i}toString(){return`{${[...this].map(([e,t])=>`${cZ(e)}: ${cZ(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class Joi{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){const e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),xr.visit(this.vals,e)]})}}class Noi{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[uE].toArray().map(String)}has(e,t){return e[uE].includes(t)}getOwnPropertyDescriptor(e,t){if(e[uE].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];const i=e[uE].indexOf(t);if(i!==-1){const n=xr.visit(Reflect.get(e,xY),i);return Reflect.set(e,t,n),n}}set(e,t,i){const n=e[uE].indexOf(t);return n!==-1?(Yl.visit(Reflect.get(e,xY),n,i),Reflect.set(e,t,i)):Reflect.has(e,t)?Reflect.set(e,t,i):!1}}Object.defineProperties(ZpA.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[uE]:{writable:!0,enumerable:!1,configurable:!1,value:null},[xY]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let DQe;function GQe(A,e,t,i){const{length:n=0}=A;let o=typeof e!="number"?0:e,g=typeof t!="number"?n:t;return o<0&&(o=(o%n+n)%n),g<0&&(g=(g%n+n)%n),g<o&&(DQe=o,o=g,g=DQe),g>n&&(g=n),i?i(A,o,g):[o,g]}const kQe=A=>A!==A;function FY(A){if(typeof A!=="object"||A===null)return kQe(A)?kQe:t=>t===A;if(A instanceof Date){const t=A.valueOf();return i=>i instanceof Date?i.valueOf()===t:!1}return ArrayBuffer.isView(A)?t=>t?yni(A,t):!1:A instanceof Map?Roi(A):Array.isArray(A)?Yoi(A):A instanceof Di?xoi(A):Foi(A,!0)}function Yoi(A){const e=[];for(let t=-1,i=A.length;++t<i;)e[t]=FY(A[t]);return Oj(e)}function Roi(A){let e=-1;const t=[];for(const i of A.values())t[++e]=FY(i);return Oj(t)}function xoi(A){const e=[];for(let t=-1,i=A.length;++t<i;)e[t]=FY(A.get(t));return Oj(e)}function Foi(A,e=!1){const t=Object.keys(A);if(!e&&t.length===0)return()=>!1;const i=[];for(let n=-1,o=t.length;++n<o;)i[n]=FY(A[t[n]]);return Oj(i,t)}function Oj(A,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return Moi(A,t);case Map:return JQe(A,t,t.keys());case ZpA:case SpA:case Object:case void 0:return JQe(A,t,e||Object.keys(t))}return t instanceof Di?voi(A,t):!1}}function Moi(A,e){const t=A.length;if(e.length!==t)return!1;for(let i=-1;++i<t;)if(!A[i](e[i]))return!1;return!0}function voi(A,e){const t=A.length;if(e.length!==t)return!1;for(let i=-1;++i<t;)if(!A[i](e.get(i)))return!1;return!0}function JQe(A,e,t){const i=t[Symbol.iterator](),n=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),o=e instanceof Map?e.values():Object.values(e)[Symbol.iterator]();let g=0;const a=A.length;let s=o.next(),I=i.next(),r=n.next();for(;g<a&&!I.done&&!r.done&&!s.done&&!(I.value!==r.value||!A[g](s.value));++g,I=i.next(),r=n.next(),s=o.next());return g===a&&I.done&&r.done&&s.done?!0:(i.return&&i.return(),n.return&&n.return(),o.return&&o.return(),!1)}function NQe(A,e,t,i){return(t&1<<i)!==0}function Loi(A,e,t,i){return(t&1<<i)>>i}function WpA(A,e,t){const i=t.byteLength+7&-8;if(A>0||t.byteLength<i){const n=new Uint8Array(i);return n.set(A%8===0?t.subarray(A>>3):qj(new KpA(t,A,e,null,NQe)).subarray(0,i)),n}return t}function qj(A){const e=[];let t=0,i=0,n=0;for(const g of A)g&&(n|=1<<i),++i===8&&(e[t++]=n,n=i=0);(t===0||i>0)&&(e[t++]=n);const o=new Uint8Array(e.length+7&-8);return o.set(e),o}class KpA{constructor(e,t,i,n,o){this.bytes=e,this.length=i,this.context=n,this.get=o,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}function UpA(A,e,t){if(t-e<=0)return 0;if(t-e<8){let o=0;for(const g of new KpA(A,e,t-e,A,Loi))o+=g;return o}const i=t>>3<<3,n=e+(e%8===0?0:8-e%8);return UpA(A,e,n)+UpA(A,i,t)+Soi(A,n>>3,i-n>>3)}function Soi(A,e,t){let i=0,n=Math.trunc(e);const o=new DataView(A.buffer,A.byteOffset,A.byteLength),g=t===void 0?A.byteLength:n+t;for(;g-n>=4;)i+=VpA(o.getUint32(n)),n+=4;for(;g-n>=2;)i+=VpA(o.getUint16(n)),n+=2;for(;g-n>=1;)i+=VpA(o.getUint8(n)),n+=1;return i}function VpA(A){let e=Math.trunc(A);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}const Hoi=-1;class Qn{constructor(e,t,i,n,o,g=[],a){this.type=e,this.children=g,this.dictionary=a,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let s;o instanceof Qn?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=ih(e),o&&((s=o[0])&&(this.valueOffsets=s),(s=o[1])&&(this.values=s),(s=o[2])&&(this.nullBitmap=s),(s=o[3])&&(this.typeIds=s))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let e=0;const{valueOffsets:t,values:i,nullBitmap:n,typeIds:o}=this;return t&&(e+=t.byteLength),i&&(e+=i.byteLength),n&&(e+=n.byteLength),o&&(e+=o.byteLength),this.children.reduce((g,a)=>g+a.byteLength,e)}get nullCount(){let e=this._nullCount,t;return e<=Hoi&&(t=this.nullBitmap)&&(this._nullCount=e=this.length-UpA(t,this.offset,this.offset+this.length)),e}getValid(e){if(this.nullable&&this.nullCount>0){const t=this.offset+e;return(this.nullBitmap[t>>3]&1<<t%8)!==0}return!0}setValid(e,t){if(!this.nullable)return t;if(!this.nullBitmap||this.nullBitmap.byteLength<=e>>3){const{nullBitmap:s}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:s,_nullCount:0})}const{nullBitmap:i,offset:n}=this,o=n+e>>3,g=(n+e)%8,a=i[o]>>g&1;return t?a===0&&(i[o]|=1<<g,this._nullCount=this.nullCount+1):a===1&&(i[o]&=~(1<<g),this._nullCount=this.nullCount-1),t}clone(e=this.type,t=this.offset,i=this.length,n=this._nullCount,o=this,g=this.children){return new Qn(e,t,i,n,o,g,this.dictionary)}slice(e,t){const{stride:i,typeId:n,children:o}=this,g=+(this._nullCount===0)-1,a=n===16?i:1,s=this._sliceBuffers(e,t,i,n);return this.clone(this.type,this.offset+e,t,g,s,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*e,a*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===dA.Null)return this.clone(this.type,0,e,0);const{length:t,nullCount:i}=this,n=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);n[t>>3]=(1<<t-(t&-8))-1,i>0&&n.set(WpA(this.offset,t,this.nullBitmap),0);const o=this.buffers;return o[th.VALIDITY]=n,this.clone(this.type,0,e,i+(e-t),o)}_sliceBuffers(e,t,i,n){let o;const{buffers:g}=this;return(o=g[th.TYPE])&&(g[th.TYPE]=o.subarray(e,e+t)),(o=g[th.OFFSET])&&(g[th.OFFSET]=o.subarray(e,e+t+1))||(o=g[th.DATA])&&(g[th.DATA]=n===6?o:o.subarray(i*e,i*(e+t))),g}_sliceChildren(e,t,i){return e.map(n=>n.slice(t,i))}}Qn.prototype.children=Object.freeze([]);class dZ extends Tt{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){const{["type"]:t,["offset"]:i=0,["length"]:n=0}=e;return new Qn(t,i,n,0)}visitBool(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.nullBitmap),o=$i(t.ArrayType,e.data),{["length"]:g=o.length>>3,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new Qn(t,i,g,a,[void 0,o,n])}visitInt(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.nullBitmap),o=$i(t.ArrayType,e.data),{["length"]:g=o.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new Qn(t,i,g,a,[void 0,o,n])}visitFloat(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.nullBitmap),o=$i(t.ArrayType,e.data),{["length"]:g=o.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new Qn(t,i,g,a,[void 0,o,n])}visitUtf8(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.data),o=ui(e.nullBitmap),g=lZ(e.valueOffsets),{["length"]:a=g.length-1,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Qn(t,i,a,s,[g,n,o])}visitBinary(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.data),o=ui(e.nullBitmap),g=lZ(e.valueOffsets),{["length"]:a=g.length-1,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Qn(t,i,a,s,[g,n,o])}visitFixedSizeBinary(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.nullBitmap),o=$i(t.ArrayType,e.data),{["length"]:g=o.length/ih(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new Qn(t,i,g,a,[void 0,o,n])}visitDate(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.nullBitmap),o=$i(t.ArrayType,e.data),{["length"]:g=o.length/ih(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new Qn(t,i,g,a,[void 0,o,n])}visitTimestamp(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.nullBitmap),o=$i(t.ArrayType,e.data),{["length"]:g=o.length/ih(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new Qn(t,i,g,a,[void 0,o,n])}visitTime(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.nullBitmap),o=$i(t.ArrayType,e.data),{["length"]:g=o.length/ih(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new Qn(t,i,g,a,[void 0,o,n])}visitDecimal(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.nullBitmap),o=$i(t.ArrayType,e.data),{["length"]:g=o.length/ih(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new Qn(t,i,g,a,[void 0,o,n])}visitList(e){const{["type"]:t,["offset"]:i=0,["child"]:n}=e,o=ui(e.nullBitmap),g=lZ(e.valueOffsets),{["length"]:a=g.length-1,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Qn(t,i,a,s,[g,void 0,o],[n])}visitStruct(e){const{["type"]:t,["offset"]:i=0,["children"]:n=[]}=e,o=ui(e.nullBitmap),{length:g=n.reduce((s,{length:I})=>Math.max(s,I),0),nullCount:a=e.nullBitmap?-1:0}=e;return new Qn(t,i,g,a,[void 0,void 0,o],n)}visitUnion(e){const{["type"]:t,["offset"]:i=0,["children"]:n=[]}=e,o=ui(e.nullBitmap),g=$i(t.ArrayType,e.typeIds),{["length"]:a=g.length,["nullCount"]:s=e.nullBitmap?-1:0}=e;if($e.isSparseUnion(t))return new Qn(t,i,a,s,[void 0,void 0,o,g],n);const I=lZ(e.valueOffsets);return new Qn(t,i,a,s,[I,void 0,o,g],n)}visitDictionary(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.nullBitmap),o=$i(t.indices.ArrayType,e.data),{["dictionary"]:g=new Di([new dZ().visit({type:t.dictionary})])}=e,{["length"]:a=o.length,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Qn(t,i,a,s,[void 0,o,n],[],g)}visitInterval(e){const{["type"]:t,["offset"]:i=0}=e,n=ui(e.nullBitmap),o=$i(t.ArrayType,e.data),{["length"]:g=o.length/ih(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new Qn(t,i,g,a,[void 0,o,n])}visitFixedSizeList(e){const{["type"]:t,["offset"]:i=0,["child"]:n=new dZ().visit({type:t.valueType})}=e,o=ui(e.nullBitmap),{["length"]:g=n.length/ih(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new Qn(t,i,g,a,[void 0,void 0,o],[n])}visitMap(e){const{["type"]:t,["offset"]:i=0,["child"]:n=new dZ().visit({type:t.childType})}=e,o=ui(e.nullBitmap),g=lZ(e.valueOffsets),{["length"]:a=g.length-1,["nullCount"]:s=e.nullBitmap?-1:0}=e;return new Qn(t,i,a,s,[g,void 0,o],[n])}}function _t(A){return new dZ().visit(A)}class YQe{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){const e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}function RQe(A){return A.reduce((e,t)=>e+t.nullCount,0)}function xQe(A){return A.reduce((e,t,i)=>(e[i+1]=e[i]+t.length,e),new Uint32Array(A.length+1))}function FQe(A,e,t,i){const n=[];for(let o=-1,g=A.length;++o<g;){const a=A[o],s=e[o],{length:I}=a;if(s>=i)break;if(t>=s+I)continue;if(s>=t&&s+I<=i){n.push(a);continue}const r=Math.max(0,t-s),C=Math.min(i-s,I);n.push(a.slice(r,C-r))}return n.length===0&&n.push(A[0].slice(0,0)),n}function XpA(A,e,t,i){let n=0,o=0,g=e.length-1;do{if(n>=g-1)return t<e[g]?i(A,n,t-e[n]):null;o=n+Math.trunc((g-n)*.5),t<e[o]?g=o:n=o}while(n<g)}function zpA(A,e){return A.getValid(e)}function MY(A){function e(t,i,n){return A(t[i],n)}return function(t){const i=this.data;return XpA(i,this._offsets,t,e)}}function MQe(A){let e;function t(i,n,o){return A(i[n],o,e)}return function(i,n){const o=this.data;e=n;const g=XpA(o,this._offsets,i,t);return e=void 0,g}}function vQe(A){let e;function t(i,n,o){let g=o,a=0,s=0;for(let I=n-1,r=i.length;++I<r;){const C=i[I];if(~(a=A(C,e,g)))return s+a;g=0,s+=C.length}return-1}return function(i,n){e=i;const o=this.data,g=typeof n!="number"?t(o,0,0):XpA(o,this._offsets,n,t);return e=void 0,g}}class et extends Tt{}function Zoi(A,e){return e===null&&A.length>0?0:-1}function Woi(A,e){const{nullBitmap:t}=A;if(!t||A.nullCount<=0)return-1;let i=0;for(const n of new KpA(t,A.offset+(e||0),A.length,t,NQe)){if(!n)return i;++i}return-1}function pt(A,e,t){if(e===void 0)return-1;if(e===null)return Woi(A,t);const i=xr.getVisitFn(A),n=FY(e);for(let o=(t||0)-1,g=A.length;++o<g;)if(n(i(A,o)))return o;return-1}function LQe(A,e,t){const i=xr.getVisitFn(A),n=FY(e);for(let o=(t||0)-1,g=A.length;++o<g;)if(n(i(A,o)))return o;return-1}et.prototype.visitNull=Zoi,et.prototype.visitBool=pt,et.prototype.visitInt=pt,et.prototype.visitInt8=pt,et.prototype.visitInt16=pt,et.prototype.visitInt32=pt,et.prototype.visitInt64=pt,et.prototype.visitUint8=pt,et.prototype.visitUint16=pt,et.prototype.visitUint32=pt,et.prototype.visitUint64=pt,et.prototype.visitFloat=pt,et.prototype.visitFloat16=pt,et.prototype.visitFloat32=pt,et.prototype.visitFloat64=pt,et.prototype.visitUtf8=pt,et.prototype.visitBinary=pt,et.prototype.visitFixedSizeBinary=pt,et.prototype.visitDate=pt,et.prototype.visitDateDay=pt,et.prototype.visitDateMillisecond=pt,et.prototype.visitTimestamp=pt,et.prototype.visitTimestampSecond=pt,et.prototype.visitTimestampMillisecond=pt,et.prototype.visitTimestampMicrosecond=pt,et.prototype.visitTimestampNanosecond=pt,et.prototype.visitTime=pt,et.prototype.visitTimeSecond=pt,et.prototype.visitTimeMillisecond=pt,et.prototype.visitTimeMicrosecond=pt,et.prototype.visitTimeNanosecond=pt,et.prototype.visitDecimal=pt,et.prototype.visitList=pt,et.prototype.visitStruct=pt,et.prototype.visitUnion=pt,et.prototype.visitDenseUnion=LQe,et.prototype.visitSparseUnion=LQe,et.prototype.visitDictionary=pt,et.prototype.visitInterval=pt,et.prototype.visitIntervalDayTime=pt,et.prototype.visitIntervalYearMonth=pt,et.prototype.visitFixedSizeList=pt,et.prototype.visitMap=pt;const jj=new et;class tt extends Tt{}function st(A){const{type:e}=A;if(A.nullCount===0&&A.stride===1&&(e.typeId===dA.Timestamp||e instanceof L0&&e.bitWidth!==64||e instanceof uZ&&e.bitWidth!==64||e instanceof EZ&&e.precision!==Rr.HALF))return new YQe(A.data.length,i=>{const n=A.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let t=0;return new YQe(A.data.length,i=>{const o=A.data[i].length,g=A.slice(t,t+o);return t+=o,new Koi(g)})}class Koi{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}}tt.prototype.visitNull=st,tt.prototype.visitBool=st,tt.prototype.visitInt=st,tt.prototype.visitInt8=st,tt.prototype.visitInt16=st,tt.prototype.visitInt32=st,tt.prototype.visitInt64=st,tt.prototype.visitUint8=st,tt.prototype.visitUint16=st,tt.prototype.visitUint32=st,tt.prototype.visitUint64=st,tt.prototype.visitFloat=st,tt.prototype.visitFloat16=st,tt.prototype.visitFloat32=st,tt.prototype.visitFloat64=st,tt.prototype.visitUtf8=st,tt.prototype.visitBinary=st,tt.prototype.visitFixedSizeBinary=st,tt.prototype.visitDate=st,tt.prototype.visitDateDay=st,tt.prototype.visitDateMillisecond=st,tt.prototype.visitTimestamp=st,tt.prototype.visitTimestampSecond=st,tt.prototype.visitTimestampMillisecond=st,tt.prototype.visitTimestampMicrosecond=st,tt.prototype.visitTimestampNanosecond=st,tt.prototype.visitTime=st,tt.prototype.visitTimeSecond=st,tt.prototype.visitTimeMillisecond=st,tt.prototype.visitTimeMicrosecond=st,tt.prototype.visitTimeNanosecond=st,tt.prototype.visitDecimal=st,tt.prototype.visitList=st,tt.prototype.visitStruct=st,tt.prototype.visitUnion=st,tt.prototype.visitDenseUnion=st,tt.prototype.visitSparseUnion=st,tt.prototype.visitDictionary=st,tt.prototype.visitInterval=st,tt.prototype.visitIntervalDayTime=st,tt.prototype.visitIntervalYearMonth=st,tt.prototype.visitFixedSizeList=st,tt.prototype.visitMap=st;const TpA=new tt,Uoi=(A,e)=>A+e;class H0 extends Tt{visitNull(e,t){return 0}visitInt(e,t){return e.type.bitWidth/8}visitFloat(e,t){return e.type.ArrayType.BYTES_PER_ELEMENT}visitBool(e,t){return .125}visitDecimal(e,t){return e.type.bitWidth/8}visitDate(e,t){return(e.type.unit+1)*4}visitTime(e,t){return e.type.bitWidth/8}visitTimestamp(e,t){return e.type.unit===di.SECOND?4:8}visitInterval(e,t){return(e.type.unit+1)*4}visitStruct(e,t){return e.children.reduce((i,n)=>i+dE.visit(n,t),0)}visitFixedSizeBinary(e,t){return e.type.byteWidth}visitMap(e,t){return 8+e.children.reduce((i,n)=>i+dE.visit(n,t),0)}visitDictionary(e,t){var i;return e.type.indices.bitWidth/8+(((i=e.dictionary)===null||i===void 0?void 0:i.getByteLength(e.values[t]))||0)}}const Voi=({valueOffsets:A},e)=>8+(A[e+1]-A[e]),Xoi=({valueOffsets:A},e)=>8+(A[e+1]-A[e]),zoi=({valueOffsets:A,stride:e,children:t},i)=>{const n=t[0],{[i*e]:o}=A,{[i*e+1]:g}=A,a=dE.getVisitFn(n.type),s=n.slice(o,g-o);let I=8;for(let r=-1,C=g-o;++r<C;)I+=a(s,r);return I},Toi=({stride:A,children:e},t)=>{const i=e[0],n=i.slice(t*A,A),o=dE.getVisitFn(i.type);let g=0;for(let a=-1,s=n.length;++a<s;)g+=o(n,a);return g},_oi=(A,e)=>A.type.mode===jI.Dense?SQe(A,e):HQe(A,e),SQe=({type:A,children:e,typeIds:t,valueOffsets:i},n)=>{const o=A.typeIdToChildIndex[t[n]];return 8+dE.visit(e[o],i[n])},HQe=({children:A},e)=>4+dE.visitMany(A,A.map(()=>e)).reduce(Uoi,0);H0.prototype.visitUtf8=Voi,H0.prototype.visitBinary=Xoi,H0.prototype.visitList=zoi,H0.prototype.visitFixedSizeList=Toi,H0.prototype.visitUnion=_oi,H0.prototype.visitDenseUnion=SQe,H0.prototype.visitSparseUnion=HQe;const dE=new H0;var ZQe;const WQe={},KQe={};class Di{constructor(e){var t,i,n;const o=e[0]instanceof Di?e.flatMap(a=>a.data):e;if(o.length===0||o.some(a=>!(a instanceof Qn)))throw new TypeError("Vector constructor expects an Array of Data instances.");const g=(t=o[0])===null||t===void 0?void 0:t.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:s,indexOf:I,byteLength:r}=WQe[g.typeId],C=o[0];this.isValid=l=>zpA(C,l),this.get=l=>a(C,l),this.set=(l,c)=>s(C,l,c),this.indexOf=l=>I(C,l),this.getByteLength=l=>r(C,l),this._offsets=[0,C.length];break}default:Object.setPrototypeOf(this,KQe[g.typeId]),this._offsets=xQe(o);break}this.data=o,this.type=g,this.stride=ih(g),this.numChildren=(n=(i=g.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets[this._offsets.length-1]}get byteLength(){return this._byteLength===-1&&(this._byteLength=this.data.reduce((e,t)=>e+t.byteLength,0)),this._byteLength}get nullCount(){return this._nullCount===-1&&(this._nullCount=RQe(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${dA[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>0}getByteLength(e){return 0}[Symbol.iterator](){return TpA.visit(this)}concat(...e){return new Di(this.data.concat(e.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(e,t){return new Di(GQe(this,e,t,({data:i,_offsets:n},o,g)=>FQe(i,n,o,g)))}toJSON(){return[...this]}toArray(){const{type:e,data:t,length:i,stride:n,ArrayType:o}=this;switch(e.typeId){case dA.Int:case dA.Float:case dA.Decimal:case dA.Time:case dA.Timestamp:switch(t.length){case 0:return new o;case 1:return t[0].values.subarray(0,i*n);default:return t.reduce((g,{values:a,length:s})=>(g.array.set(a.subarray(0,s*n),g.offset),g.offset+=s*n,g),{array:new o(i*n),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)===null||t===void 0?void 0:t.findIndex(i=>i.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new Di(this.data.map(({children:t})=>t[e])):null}get isMemoized(){return $e.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if($e.isDictionary(this.type)){const e=new Pj(this.data[0].dictionary),t=this.data.map(i=>{const n=i.clone();return n.dictionary=e,n});return new Di(t)}return new Pj(this)}unmemoize(){if($e.isDictionary(this.type)&&this.isMemoized){const e=this.data[0].dictionary.unmemoize(),t=this.data.map(i=>{const n=i.clone();return n.dictionary=e,n});return new Di(t)}return this}}ZQe=Symbol.toStringTag,Di[ZQe]=(A=>{A.type=$e.prototype,A.data=[],A.length=0,A.stride=1,A.numChildren=0,A._nullCount=-1,A._byteLength=-1,A._offsets=new Uint32Array([0]),A[Symbol.isConcatSpreadable]=!0;const e=Object.keys(dA).map(t=>dA[t]).filter(t=>typeof t=="number"&&t!==dA.NONE);for(const t of e){const i=xr.getVisitFnByTypeId(t),n=Yl.getVisitFnByTypeId(t),o=jj.getVisitFnByTypeId(t),g=dE.getVisitFnByTypeId(t);WQe[t]={get:i,set:n,indexOf:o,byteLength:g},KQe[t]=Object.create(A,{isValid:{value:MY(zpA)},get:{value:MY(xr.getVisitFnByTypeId(t))},set:{value:MQe(Yl.getVisitFnByTypeId(t))},indexOf:{value:vQe(jj.getVisitFnByTypeId(t))},getByteLength:{value:MY(dE.getVisitFnByTypeId(t))}})}return"Vector"})(Di.prototype);class Pj extends Di{constructor(e){super(e.data);const t=this.get,i=this.set,n=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(g){const a=o[g];if(a!==void 0)return a;const s=t.call(this,g);return o[g]=s,s}}),Object.defineProperty(this,"set",{value(g,a){i.call(this,g,a),o[g]=a}}),Object.defineProperty(this,"slice",{value:(g,a)=>new Pj(n.call(this,g,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Di(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}class _pA{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,i,n){return e.prep(8,24),e.writeInt64(n),e.pad(4),e.writeInt32(i),e.writeInt64(t),e.offset()}}const OpA=2,hE=4,oh=4,An=4,Z0=new Int32Array(2),UQe=new Float32Array(Z0.buffer),VQe=new Float64Array(Z0.buffer),$j=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;let gh=class gbA{constructor(e,t){this.low=e|0,this.high=t|0}static create(e,t){return e==0&&t==0?gbA.ZERO:new gbA(e,t)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(e){return this.low==e.low&&this.high==e.high}};gh.ZERO=new gh(0,0);var qpA;(function(A){A[A.UTF8_BYTES=1]="UTF8_BYTES",A[A.UTF16_STRING=2]="UTF16_STRING"})(qpA||(qpA={}));let vY=class Efe{constructor(e){this.bytes_=e,this.position_=0}static allocate(e){return new Efe(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return new gh(this.readInt32(e),this.readInt32(e+4))}readUint64(e){return new gh(this.readUint32(e),this.readUint32(e+4))}readFloat32(e){return Z0[0]=this.readInt32(e),UQe[0]}readFloat64(e){return Z0[$j?0:1]=this.readInt32(e),Z0[$j?1:0]=this.readInt32(e+4),VQe[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,t.low),this.writeInt32(e+4,t.high)}writeUint64(e,t){this.writeUint32(e,t.low),this.writeUint32(e+4,t.high)}writeFloat32(e,t){UQe[0]=t,this.writeInt32(e,Z0[0])}writeFloat64(e,t){VQe[0]=t,this.writeInt32(e,Z0[$j?0:1]),this.writeInt32(e+4,Z0[$j?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+hE+oh)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<oh;t++)e+=String.fromCharCode(this.readInt8(this.position_+hE+t));return e}__offset(e,t){const i=e-this.readInt32(e);return t<this.readInt16(i)?this.readInt16(i+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);const i=this.readInt32(e);let n="",o=0;if(e+=hE,t===qpA.UTF8_BYTES)return this.bytes_.subarray(e,e+i);for(;o<i;){let g;const a=this.readUint8(e+o++);if(a<192)g=a;else{const s=this.readUint8(e+o++);if(a<224)g=(a&31)<<6|s&63;else{const I=this.readUint8(e+o++);if(a<240)g=(a&15)<<12|(s&63)<<6|I&63;else{const r=this.readUint8(e+o++);g=(a&7)<<18|(s&63)<<12|(I&63)<<6|r&63}}}g<65536?n+=String.fromCharCode(g):(g-=65536,n+=String.fromCharCode((g>>10)+55296,(g&(1<<10)-1)+56320))}return n}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+hE}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=oh)throw new Error("FlatBuffers: file identifier must be length "+oh);for(let t=0;t<oh;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+hE+t))return!1;return!0}createLong(e,t){return gh.create(e,t)}createScalarList(e,t){const i=[];for(let n=0;n<t;++n)e(n)!==null&&i.push(e(n));return i}createObjList(e,t){const i=[];for(let n=0;n<t;++n){const o=e(n);o!==null&&i.push(o.unpack())}return i}},XQe=class ufe{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null;let t;e?t=e:t=1024,this.bb=vY.allocate(t),this.space=t}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,t){e>this.minalign&&(this.minalign=e);const i=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space<i+e+t;){const n=this.bb.capacity();this.bb=ufe.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(i)}pad(e){for(let t=0;t<e;t++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,t,i){(this.force_defaults||t!=i)&&(this.addInt8(t),this.slot(e))}addFieldInt16(e,t,i){(this.force_defaults||t!=i)&&(this.addInt16(t),this.slot(e))}addFieldInt32(e,t,i){(this.force_defaults||t!=i)&&(this.addInt32(t),this.slot(e))}addFieldInt64(e,t,i){(this.force_defaults||!t.equals(i))&&(this.addInt64(t),this.slot(e))}addFieldFloat32(e,t,i){(this.force_defaults||t!=i)&&(this.addFloat32(t),this.slot(e))}addFieldFloat64(e,t,i){(this.force_defaults||t!=i)&&(this.addFloat64(t),this.slot(e))}addFieldOffset(e,t,i){(this.force_defaults||t!=i)&&(this.addOffset(t),this.slot(e))}addFieldStruct(e,t,i){t!=i&&(this.nested(t),this.slot(e))}nested(e){if(e!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){const t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const i=t<<1,n=vY.allocate(i);return n.setPosition(i-t),n.bytes().set(e.bytes(),i-t),n}addOffset(e){this.prep(hE,0),this.writeInt32(this.offset()-e+hE)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);const e=this.offset();let t=this.vtable_in_use-1;for(;t>=0&&this.vtable[t]==0;t--);const i=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);const n=2;this.addInt16(e-this.object_start);const o=(i+n)*OpA;this.addInt16(o);let g=0;const a=this.space;A:for(t=0;t<this.vtables.length;t++){const s=this.bb.capacity()-this.vtables[t];if(o==this.bb.readInt16(s)){for(let I=OpA;I<o;I+=OpA)if(this.bb.readInt16(a+I)!=this.bb.readInt16(s+I))continue A;g=this.vtables[t];break}}return g?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,g-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,t,i){const n=i?An:0;if(t){const o=t;if(this.prep(this.minalign,hE+oh+n),o.length!=oh)throw new Error("FlatBuffers: file identifier must be length "+oh);for(let g=oh-1;g>=0;g--)this.writeInt8(o.charCodeAt(g))}this.prep(this.minalign,hE+n),this.addOffset(e),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){const i=this.bb.capacity()-e,n=i-this.bb.readInt32(i);if(!(this.bb.readInt16(n+t)!=0))throw new Error("FlatBuffers: field "+t+" must be set")}startVector(e,t,i){this.notNested(),this.vector_num_elems=t,this.prep(hE,e*t),this.prep(i,e*t)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);const t=this.createString(e);return this.string_maps.set(e,t),t}createString(e){if(!e)return 0;let t;if(e instanceof Uint8Array)t=e;else{t=[];let i=0;for(;i<e.length;){let n;const o=e.charCodeAt(i++);if(o<55296||o>=56320)n=o;else{const g=e.charCodeAt(i++);n=(o<<10)+g+(65536-(55296<<10)-56320)}n<128?t.push(n):(n<2048?t.push(n>>6&31|192):(n<65536?t.push(n>>12&15|224):t.push(n>>18&7|240,n>>12&63|128),t.push(n>>6&63|128)),t.push(n&63|128))}}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length);for(let i=0,n=this.space,o=this.bb.bytes();i<t.length;i++)o[n++]=t[i];return this.endVector()}createLong(e,t){return gh.create(e,t)}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){const t=[];for(let i=0;i<e.length;++i){const n=e[i];if(n!==null)t.push(this.createObjectOffset(n));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return t}createStructOffsetList(e,t){return t(this,e.length),this.createObjectOffsetList(e),this.endVector()}};class ng{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new ng).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+An),(t||new ng).__init(e.readInt32(e.position())+e.position(),e)}key(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,i){return ng.startKeyValue(e),ng.addKey(e,t),ng.addValue(e,i),ng.endKeyValue(e)}}var LY;(function(A){A[A.V1=0]="V1",A[A.V2=1]="V2",A[A.V3=2]="V3",A[A.V4=3]="V4",A[A.V5=4]="V5"})(LY||(LY={}));var SY;(function(A){A[A.Little=0]="Little",A[A.Big=1]="Big"})(SY||(SY={}));var A6;(function(A){A[A.DenseArray=0]="DenseArray"})(A6||(A6={}));class PI{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new PI).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+An),(t||new PI).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){const e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,i){return PI.startInt(e),PI.addBitWidth(e,t),PI.addIsSigned(e,i),PI.endInt(e)}}class ah{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new ah).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+An),(t||new ah).__init(e.readInt32(e.position())+e.position(),e)}id(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}indexType(e){const t=this.bb.__offset(this.bb_pos,6);return t?(e||new PI).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){const e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):A6.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,A6.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}class Kw{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new Kw).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+An),(t||new Kw).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return Kw.startBinary(e),Kw.endBinary(e)}}class Uw{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new Uw).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+An),(t||new Uw).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return Uw.startBool(e),Uw.endBool(e)}}var e6;(function(A){A[A.DAY=0]="DAY",A[A.MILLISECOND=1]="MILLISECOND"})(e6||(e6={}));let t6=class vR{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new vR).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+An),(t||new vR).__init(e.readInt32(e.position())+e.position(),e)}unit(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):e6.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,e6.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return vR.startDate(e),vR.addUnit(e,t),vR.endDate(e)}};class Fr{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new Fr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+An),(t||new Fr).__init(e.readInt32(e.position())+e.position(),e)}precision(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,i,n){return Fr.startDecimal(e),Fr.addPrecision(e,t),Fr.addScale(e,i),Fr.addBitWidth(e,n),Fr.endDecimal(e)}}var HY;(function(A){A[A.SECOND=0]="SECOND",A[A.MILLISECOND=1]="MILLISECOND",A[A.MICROSECOND=2]="MICROSECOND",A[A.NANOSECOND=3]="NANOSECOND"})(HY||(HY={}));class mE{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new mE).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+An),(t||new mE).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return mE.startFixedSizeBinary(e),mE.addByteWidth(e,t),mE.endFixedSizeBinary(e)}}class pE{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new pE).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+An),(t||new pE).__init(e.readInt32(e.position())+e.position(),e)}listSize(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return pE.startFixedSizeList(e),pE.addListSize(e,t),pE.endFixedSizeList(e)}}var i6;(function(A){A[A.HALF=0]="HALF",A[A.SINGLE=1]="SINGLE",A[A.DOUBLE=2]="DOUBLE"})(i6||(i6={}));class fE{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new fE).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+An),(t||new fE).__init(e.readInt32(e.position())+e.position(),e)}precision(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):i6.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,i6.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return fE.startFloatingPoint(e),fE.addPrecision(e,t),fE.endFloatingPoint(e)}}var n6;(function(A){A[A.YEAR_MONTH=0]="YEAR_MONTH",A[A.DAY_TIME=1]="DAY_TIME",A[A.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(n6||(n6={}));class yE{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new yE).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+An),(t||new yE).__init(e.readInt32(e.position())+e.position(),e)}unit(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):n6.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,n6.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return yE.startInterval(e),yE.addUnit(e,t),yE.endInterval(e)}}class Vw{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new Vw).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+An),(t||new Vw).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return Vw.startList(e),Vw.endList(e)}}let o6=class LR{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new LR).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+An),(t||new LR).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){const e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return LR.startMap(e),LR.addKeysSorted(e,t),LR.endMap(e)}};class Xw{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new Xw).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+An),(t||new Xw).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return Xw.startNull(e),Xw.endNull(e)}}class zw{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new zw).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+An),(t||new zw).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return zw.startStruct_(e),zw.endStruct_(e)}}class Rl{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new Rl).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+An),(t||new Rl).__init(e.readInt32(e.position())+e.position(),e)}unit(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):HY.MILLISECOND}bitWidth(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,HY.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,i){return Rl.startTime(e),Rl.addUnit(e,t),Rl.addBitWidth(e,i),Rl.endTime(e)}}class xl{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new xl).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+An),(t||new xl).__init(e.readInt32(e.position())+e.position(),e)}unit(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):HY.SECOND}timezone(e){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,HY.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,i){return xl.startTimestamp(e),xl.addUnit(e,t),xl.addTimezone(e,i),xl.endTimestamp(e)}}var g6;(function(A){A[A.Sparse=0]="Sparse",A[A.Dense=1]="Dense"})(g6||(g6={}));class Mr{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new Mr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+An),(t||new Mr).__init(e.readInt32(e.position())+e.position(),e)}mode(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):g6.Sparse}typeIds(e){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){const e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,g6.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let i=t.length-1;i>=0;i--)e.addInt32(t[i]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,i){return Mr.startUnion(e),Mr.addMode(e,t),Mr.addTypeIds(e,i),Mr.endUnion(e)}}class Tw{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new Tw).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+An),(t||new Tw).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return Tw.startUtf8(e),Tw.endUtf8(e)}}var Ao;(function(A){A[A.NONE=0]="NONE",A[A.Null=1]="Null",A[A.Int=2]="Int",A[A.FloatingPoint=3]="FloatingPoint",A[A.Binary=4]="Binary",A[A.Utf8=5]="Utf8",A[A.Bool=6]="Bool",A[A.Decimal=7]="Decimal",A[A.Date=8]="Date",A[A.Time=9]="Time",A[A.Timestamp=10]="Timestamp",A[A.Interval=11]="Interval",A[A.List=12]="List",A[A.Struct_=13]="Struct_",A[A.Union=14]="Union",A[A.FixedSizeBinary=15]="FixedSizeBinary",A[A.FixedSizeList=16]="FixedSizeList",A[A.Map=17]="Map",A[A.Duration=18]="Duration",A[A.LargeBinary=19]="LargeBinary",A[A.LargeUtf8=20]="LargeUtf8",A[A.LargeList=21]="LargeList"})(Ao||(Ao={}));let Fl=class QP{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new QP).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+An),(t||new QP).__init(e.readInt32(e.position())+e.position(),e)}name(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){const e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):Ao.NONE}type(e){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){const t=this.bb.__offset(this.bb_pos,12);return t?(e||new ah).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){const i=this.bb.__offset(this.bb_pos,14);return i?(t||new QP).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}childrenLength(){const e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){const i=this.bb.__offset(this.bb_pos,16);return i?(t||new ng).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}customMetadataLength(){const e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,Ao.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let i=t.length-1;i>=0;i--)e.addOffset(t[i]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let i=t.length-1;i>=0;i--)e.addOffset(t[i]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}},bE=class Gh{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new Gh).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+An),(t||new Gh).__init(e.readInt32(e.position())+e.position(),e)}endianness(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):SY.Little}fields(e,t){const i=this.bb.__offset(this.bb_pos,6);return i?(t||new Fl).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}fieldsLength(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){const i=this.bb.__offset(this.bb_pos,8);return i?(t||new ng).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}customMetadataLength(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):this.bb.createLong(0,0)}featuresLength(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,SY.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let i=t.length-1;i>=0;i--)e.addOffset(t[i]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let i=t.length-1;i>=0;i--)e.addOffset(t[i]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let i=t.length-1;i>=0;i--)e.addInt64(t[i]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(e,t,i,n,o){return Gh.startSchema(e),Gh.addEndianness(e,t),Gh.addFields(e,i),Gh.addCustomMetadata(e,n),Gh.addFeatures(e,o),Gh.endSchema(e)}};class $I{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new $I).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+An),(t||new $I).__init(e.readInt32(e.position())+e.position(),e)}version(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):LY.V1}schema(e){const t=this.bb.__offset(this.bb_pos,6);return t?(e||new bE).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){const i=this.bb.__offset(this.bb_pos,8);return i?(t||new _pA).__init(this.bb.__vector(this.bb_pos+i)+e*24,this.bb):null}dictionariesLength(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){const i=this.bb.__offset(this.bb_pos,10);return i?(t||new _pA).__init(this.bb.__vector(this.bb_pos+i)+e*24,this.bb):null}recordBatchesLength(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){const i=this.bb.__offset(this.bb_pos,12);return i?(t||new ng).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}customMetadataLength(){const e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,LY.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let i=t.length-1;i>=0;i--)e.addOffset(t[i]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}}class Gi{constructor(e=[],t,i){this.fields=e||[],this.metadata=t||new Map,i||(i=jpA(e)),this.dictionaries=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(", ")} }>`}select(e){const t=new Set(e),i=this.fields.filter(n=>t.has(n.name));return new Gi(i,this.metadata)}selectAt(e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Gi(t,this.metadata)}assign(...e){const t=e[0]instanceof Gi?e[0]:Array.isArray(e[0])?new Gi(e[0]):new Gi(e),i=[...this.fields],n=a6(a6(new Map,this.metadata),t.metadata),o=t.fields.filter(a=>{const s=i.findIndex(I=>I.name===a.name);return~s?(i[s]=a.clone({metadata:a6(a6(new Map,i[s].metadata),a.metadata)}))&&!1:!0}),g=jpA(o,new Map);return new Gi([...i,...o],n,new Map([...this.dictionaries,...g]))}}Gi.prototype.fields=null,Gi.prototype.metadata=null,Gi.prototype.dictionaries=null;class Yn{constructor(e,t,i=!1,n){this.name=e,this.type=t,this.nullable=i,this.metadata=n||new Map}static new(...e){let[t,i,n,o]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],i===void 0&&(i=e[0].type),n===void 0&&(n=e[0].nullable),o===void 0&&(o=e[0].metadata)),new Yn(`${t}`,i,n,o)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...e){let[t,i,n,o]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,i=this.type,n=this.nullable,o=this.metadata]=e:{name:t=this.name,type:i=this.type,nullable:n=this.nullable,metadata:o=this.metadata}=e[0],Yn.new(t,i,n,o)}}Yn.prototype.type=null,Yn.prototype.name=null,Yn.prototype.nullable=null,Yn.prototype.metadata=null;function a6(A,e){return new Map([...A||new Map,...e||new Map])}function jpA(A,e=new Map){for(let t=-1,i=A.length;++t<i;){const o=A[t].type;if($e.isDictionary(o)){if(!e.has(o.id))e.set(o.id,o.dictionary);else if(e.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&jpA(o.children,e)}return e}var zQe=gh,Ooi=XQe,qoi=vY;class hZ{constructor(e,t=qI.V4,i,n){this.schema=e,this.version=t,i&&(this._recordBatches=i),n&&(this._dictionaryBatches=n)}static decode(e){e=new qoi(ui(e));const t=$I.getRootAsFooter(e),i=Gi.decode(t.schema());return new joi(i,t)}static encode(e){const t=new Ooi,i=Gi.encode(t,e.schema);$I.startRecordBatchesVector(t,e.numRecordBatches);for(const g of[...e.recordBatches()].slice().reverse())W0.encode(t,g);const n=t.endVector();$I.startDictionariesVector(t,e.numDictionaries);for(const g of[...e.dictionaryBatches()].slice().reverse())W0.encode(t,g);const o=t.endVector();return $I.startFooter(t),$I.addSchema(t,i),$I.addVersion(t,qI.V4),$I.addRecordBatches(t,n),$I.addDictionaries(t,o),$I.finishFooterBuffer(t,$I.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let e,t=-1,i=this.numRecordBatches;++t<i;)(e=this.getRecordBatch(t))&&(yield e)}*dictionaryBatches(){for(let e,t=-1,i=this.numDictionaries;++t<i;)(e=this.getDictionaryBatch(t))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}}class joi extends hZ{constructor(e,t){super(e,t.version()),this._footer=t}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){const t=this._footer.recordBatches(e);if(t)return W0.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){const t=this._footer.dictionaries(e);if(t)return W0.decode(t)}return null}}class W0{constructor(e,t,i){this.metaDataLength=e,this.offset=typeof i=="number"?i:i.low,this.bodyLength=typeof t=="number"?t:t.low}static decode(e){return new W0(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){const{metaDataLength:i}=t,n=new zQe(t.offset,0),o=new zQe(t.bodyLength,0);return _pA.createBlock(e,n,i,o)}}const eo=Object.freeze({done:!0,value:void 0});class TQe{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class PpA{tee(){return this._getDOMStream().tee()}pipe(e,t){return this._getNodeStream().pipe(e,t)}pipeTo(e,t){return this._getDOMStream().pipeTo(e,t)}pipeThrough(e,t){return this._getDOMStream().pipeThrough(e,t)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}class Poi extends PpA{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return xA(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){const{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(eo);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Nl.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Nl.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return xA(this,void 0,void 0,function*(){return yield this.abort(e),eo})}return(e){return xA(this,void 0,void 0,function*(){return yield this.close(),eo})}read(e){return xA(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return xA(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,i)=>{this.resolvers.push({resolve:t,reject:i})}):Promise.resolve(eo)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class s6 extends Poi{write(e){if((e=ui(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?wpA(this.toUint8Array(!0)):this.toUint8Array(!1).then(wpA)}toUint8Array(e=!1){return e?EE(this._values)[0]:(()=>xA(this,void 0,void 0,function*(){var t,i;const n=[];let o=0;try{for(var g=Zw(this),a;a=yield g.next(),!a.done;){const s=a.value;n.push(s),o+=s.byteLength}}catch(s){t={error:s}}finally{try{a&&!a.done&&(i=g.return)&&(yield i.call(g))}finally{if(t)throw t.error}}return EE(n,o)[0]}))()}}class r6{constructor(e){e&&(this.source=new $oi(Nl.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}}class ZY{constructor(e){e instanceof ZY?this.source=e.source:e instanceof s6?this.source=new _w(Nl.fromAsyncIterable(e)):pBe(e)?this.source=new _w(Nl.fromNodeStream(e)):kpA(e)?this.source=new _w(Nl.fromDOMStream(e)):mBe(e)?this.source=new _w(Nl.fromDOMStream(e.body)):CZ(e)?this.source=new _w(Nl.fromIterable(e)):F0(e)?this.source=new _w(Nl.fromAsyncIterable(e)):DY(e)&&(this.source=new _w(Nl.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}}class $oi{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||eo)}return(e){return Object.create(this.source.return&&this.source.return(e)||eo)}}class _w{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return xA(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return xA(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return xA(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e,t="read"){return xA(this,void 0,void 0,function*(){return yield this.source.next({cmd:t,size:e})})}throw(e){return xA(this,void 0,void 0,function*(){const t=this.source.throw&&(yield this.source.throw(e))||eo;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return xA(this,void 0,void 0,function*(){const t=this.source.return&&(yield this.source.return(e))||eo;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}}class _Qe extends r6{constructor(e,t){super(),this.position=0,this.buffer=ui(e),this.size=typeof t>"u"?this.buffer.byteLength:t}readInt32(e){const{buffer:t,byteOffset:i}=this.readAt(e,4);return new DataView(t,i).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){const{buffer:t,size:i,position:n}=this;return t&&n<i?(typeof e!="number"&&(e=Number.POSITIVE_INFINITY),this.position=Math.min(i,n+Math.min(i-n,e)),t.subarray(n,this.position)):null}readAt(e,t){const i=this.buffer,n=Math.min(this.size,e+t);return i?i.subarray(e,n):new Uint8Array(t)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}}class I6 extends ZY{constructor(e,t){super(),this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=(()=>xA(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return xA(this,void 0,void 0,function*(){const{buffer:t,byteOffset:i}=yield this.readAt(e,4);return new DataView(t,i).getInt32(0,!0)})}seek(e){return xA(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return xA(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:t,size:i,position:n}=this;if(t&&n<i){typeof e!="number"&&(e=Number.POSITIVE_INFINITY);let o=n,g=0,a=0;const s=Math.min(i,o+Math.min(i-o,e)),I=new Uint8Array(Math.max(0,(this.position=s)-o));for(;(o+=a)<s&&(g+=a)<I.byteLength;)({bytesRead:a}=yield t.read(I,g,I.byteLength-g,o));return I}return null})}readAt(e,t){return xA(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:i,size:n}=this;if(i&&e+t<n){const o=Math.min(n,e+t),g=new Uint8Array(o-e);return(yield i.read(g,0,t,e)).buffer}return new Uint8Array(t)})}close(){return xA(this,void 0,void 0,function*(){const e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return xA(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return xA(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}}const Agi=1<<16;function WY(A){return A<0&&(A=4294967295+A+1),`0x${A.toString(16)}`}const KY=8,$pA=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class OQe{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){const t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),i=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]);let n=t[3]*i[3];this.buffer[0]=n&65535;let o=n>>>16;return n=t[2]*i[3],o+=n,n=t[3]*i[2]>>>0,o+=n,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<n?Agi:0,this.buffer[1]+=o>>>16,this.buffer[1]+=t[1]*i[3]+t[2]*i[2]+t[3]*i[1],this.buffer[1]+=t[0]*i[3]+t[1]*i[2]+t[2]*i[1]+t[3]*i[0]<<16,this}_plus(e){const t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${WY(this.buffer[1])} ${WY(this.buffer[0])}`}}class Si extends OQe{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return Si.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return Si.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){const i=e.length,n=new Si(t);for(let o=0;o<i;){const g=KY<i-o?KY:i-o,a=new Si(new Uint32Array([Number.parseInt(e.slice(o,o+g),10),0])),s=new Si(new Uint32Array([$pA[g],0]));n.times(s),n.plus(a),o+=g}return n}static convertArray(e){const t=new Uint32Array(e.length*2);for(let i=-1,n=e.length;++i<n;)Si.from(e[i],new Uint32Array(t.buffer,t.byteOffset+2*i*4,2));return t}static multiply(e,t){return new Si(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new Si(new Uint32Array(e.buffer)).plus(t)}}class vr extends OQe{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){const t=this.buffer[1]<<0,i=e.buffer[1]<<0;return t<i||t===i&&this.buffer[0]<e.buffer[0]}static from(e,t=new Uint32Array(2)){return vr.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return vr.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){const i=e.startsWith("-"),n=e.length,o=new vr(t);for(let g=i?1:0;g<n;){const a=KY<n-g?KY:n-g,s=new vr(new Uint32Array([Number.parseInt(e.slice(g,g+a),10),0])),I=new vr(new Uint32Array([$pA[a],0]));o.times(I),o.plus(s),g+=a}return i?o.negate():o}static convertArray(e){const t=new Uint32Array(e.length*2);for(let i=-1,n=e.length;++i<n;)vr.from(e[i],new Uint32Array(t.buffer,t.byteOffset+2*i*4,2));return t}static multiply(e,t){return new vr(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new vr(new Uint32Array(e.buffer)).plus(t)}}class wE{constructor(e){this.buffer=e}high(){return new vr(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new vr(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(e){const t=new Si(new Uint32Array([this.buffer[3],0])),i=new Si(new Uint32Array([this.buffer[2],0])),n=new Si(new Uint32Array([this.buffer[1],0])),o=new Si(new Uint32Array([this.buffer[0],0])),g=new Si(new Uint32Array([e.buffer[3],0])),a=new Si(new Uint32Array([e.buffer[2],0])),s=new Si(new Uint32Array([e.buffer[1],0])),I=new Si(new Uint32Array([e.buffer[0],0]));let r=Si.multiply(o,I);this.buffer[0]=r.low();const C=new Si(new Uint32Array([r.high(),0]));return r=Si.multiply(n,I),C.plus(r),r=Si.multiply(o,s),C.plus(r),this.buffer[1]=C.low(),this.buffer[3]=C.lessThan(r)?1:0,this.buffer[2]=C.high(),new Si(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Si.multiply(i,I)).plus(Si.multiply(n,s)).plus(Si.multiply(o,a)),this.buffer[3]+=Si.multiply(t,I).plus(Si.multiply(i,s)).plus(Si.multiply(n,a)).plus(Si.multiply(o,g)).low(),this}plus(e){const t=new Uint32Array(4);return t[3]=this.buffer[3]+e.buffer[3]>>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]<this.buffer[0]>>>0&&++t[1],t[1]<this.buffer[1]>>>0&&++t[2],t[2]<this.buffer[2]>>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${WY(this.buffer[3])} ${WY(this.buffer[2])} ${WY(this.buffer[1])} ${WY(this.buffer[0])}`}static multiply(e,t){return new wE(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new wE(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return wE.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return wE.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){const i=e.startsWith("-"),n=e.length,o=new wE(t);for(let g=i?1:0;g<n;){const a=KY<n-g?KY:n-g,s=new wE(new Uint32Array([Number.parseInt(e.slice(g,g+a),10),0,0,0])),I=new wE(new Uint32Array([$pA[a],0,0,0]));o.times(I),o.plus(s),g+=a}return i?o.negate():o}static convertArray(e){const t=new Uint32Array(e.length*4);for(let i=-1,n=e.length;++i<n;)wE.from(e[i],new Uint32Array(t.buffer,t.byteOffset+16*i,4));return t}}class qQe extends Tt{constructor(e,t,i,n){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=e,this.nodes=t,this.buffers=i,this.dictionaries=n}visit(e){return super.visit(e instanceof Yn?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return _t({type:e,length:t})}visitBool(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitInt(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitFloat(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitUtf8(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitBinary(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitFixedSizeBinary(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitDate(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitTimestamp(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitTime(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitDecimal(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitList(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitStruct(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),children:this.visitMany(e.children)})}visitUnion(e){return e.mode===jI.Sparse?this.visitSparseUnion(e):this.visitDenseUnion(e)}visitDenseUnion(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),typeIds:this.readTypeIds(e),valueOffsets:this.readOffsets(e),children:this.visitMany(e.children)})}visitSparseUnion(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e.indices),dictionary:this.readDictionary(e)})}visitInterval(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),data:this.readData(e)})}visitFixedSizeList(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),child:this.visit(e.children[0])})}visitMap(e,{length:t,nullCount:i}=this.nextFieldNode()){return _t({type:e,length:t,nullCount:i,nullBitmap:this.readNullBitmap(e,i),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,t,i=this.nextBufferRange()){return t>0&&this.readData(e,i)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:i}=this.nextBufferRange()){return this.bytes.subarray(i,i+t)}readDictionary(e){return this.dictionaries.get(e.id)}}class egi extends qQe{constructor(e,t,i,n){super(new Uint8Array(0),t,i,n),this.sources=e}readNullBitmap(e,t,{offset:i}=this.nextBufferRange()){return t<=0?new Uint8Array(0):qj(this.sources[i])}readOffsets(e,{offset:t}=this.nextBufferRange()){return $i(Uint8Array,$i(Int32Array,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return $i(Uint8Array,$i(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){const{sources:i}=this;return $e.isTimestamp(e)||($e.isInt(e)||$e.isTime(e))&&e.bitWidth===64||$e.isDate(e)&&e.unit===eh.MILLISECOND?$i(Uint8Array,vr.convertArray(i[t])):$e.isDecimal(e)?$i(Uint8Array,wE.convertArray(i[t])):$e.isBinary(e)||$e.isFixedSizeBinary(e)?tgi(i[t]):$e.isBool(e)?qj(i[t]):$e.isUtf8(e)?DpA(i[t].join("")):$i(Uint8Array,$i(e.ArrayType,i[t].map(n=>+n)))}}function tgi(A){const e=A.join(""),t=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)t[i>>1]=Number.parseInt(e.slice(i,i+2),16);return t}class nt extends Tt{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((i,n)=>this.compareFields(i,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}}function Lr(A,e){return e instanceof A.constructor}function mZ(A,e){return A===e||Lr(A,e)}function sh(A,e){return A===e||Lr(A,e)&&A.bitWidth===e.bitWidth&&A.isSigned===e.isSigned}function C6(A,e){return A===e||Lr(A,e)&&A.precision===e.precision}function igi(A,e){return A===e||Lr(A,e)&&A.byteWidth===e.byteWidth}function A0A(A,e){return A===e||Lr(A,e)&&A.unit===e.unit}function pZ(A,e){return A===e||Lr(A,e)&&A.unit===e.unit&&A.timezone===e.timezone}function fZ(A,e){return A===e||Lr(A,e)&&A.unit===e.unit&&A.bitWidth===e.bitWidth}function ngi(A,e){return A===e||Lr(A,e)&&A.children.length===e.children.length&&K0.compareManyFields(A.children,e.children)}function ogi(A,e){return A===e||Lr(A,e)&&A.children.length===e.children.length&&K0.compareManyFields(A.children,e.children)}function e0A(A,e){return A===e||Lr(A,e)&&A.mode===e.mode&&A.typeIds.every((t,i)=>t===e.typeIds[i])&&K0.compareManyFields(A.children,e.children)}function ggi(A,e){return A===e||Lr(A,e)&&A.id===e.id&&A.isOrdered===e.isOrdered&&K0.visit(A.indices,e.indices)&&K0.visit(A.dictionary,e.dictionary)}function t0A(A,e){return A===e||Lr(A,e)&&A.unit===e.unit}function agi(A,e){return A===e||Lr(A,e)&&A.listSize===e.listSize&&A.children.length===e.children.length&&K0.compareManyFields(A.children,e.children)}function sgi(A,e){return A===e||Lr(A,e)&&A.keysSorted===e.keysSorted&&A.children.length===e.children.length&&K0.compareManyFields(A.children,e.children)}nt.prototype.visitNull=mZ,nt.prototype.visitBool=mZ,nt.prototype.visitInt=sh,nt.prototype.visitInt8=sh,nt.prototype.visitInt16=sh,nt.prototype.visitInt32=sh,nt.prototype.visitInt64=sh,nt.prototype.visitUint8=sh,nt.prototype.visitUint16=sh,nt.prototype.visitUint32=sh,nt.prototype.visitUint64=sh,nt.prototype.visitFloat=C6,nt.prototype.visitFloat16=C6,nt.prototype.visitFloat32=C6,nt.prototype.visitFloat64=C6,nt.prototype.visitUtf8=mZ,nt.prototype.visitBinary=mZ,nt.prototype.visitFixedSizeBinary=igi,nt.prototype.visitDate=A0A,nt.prototype.visitDateDay=A0A,nt.prototype.visitDateMillisecond=A0A,nt.prototype.visitTimestamp=pZ,nt.prototype.visitTimestampSecond=pZ,nt.prototype.visitTimestampMillisecond=pZ,nt.prototype.visitTimestampMicrosecond=pZ,nt.prototype.visitTimestampNanosecond=pZ,nt.prototype.visitTime=fZ,nt.prototype.visitTimeSecond=fZ,nt.prototype.visitTimeMillisecond=fZ,nt.prototype.visitTimeMicrosecond=fZ,nt.prototype.visitTimeNanosecond=fZ,nt.prototype.visitDecimal=mZ,nt.prototype.visitList=ngi,nt.prototype.visitStruct=ogi,nt.prototype.visitUnion=e0A,nt.prototype.visitDenseUnion=e0A,nt.prototype.visitSparseUnion=e0A,nt.prototype.visitDictionary=ggi,nt.prototype.visitInterval=t0A,nt.prototype.visitIntervalDayTime=t0A,nt.prototype.visitIntervalYearMonth=t0A,nt.prototype.visitFixedSizeList=agi,nt.prototype.visitMap=sgi;const K0=new nt;function i0A(A,e){return K0.compareSchemas(A,e)}function n0A(A,e){return rgi(A,e.map(t=>t.data.concat()))}function rgi(A,e){const t=[...A.fields],i=[],n={numBatches:e.reduce((C,l)=>Math.max(C,l.length),0)};let o=0,g=0,a=-1;const s=e.length;let I,r=[];for(;n.numBatches-- >0;){for(g=Number.POSITIVE_INFINITY,a=-1;++a<s;)r[a]=I=e[a].shift(),g=Math.min(g,I?I.length:g);Number.isFinite(g)&&(r=Igi(t,g,r,e,n),g>0&&(i[o++]=_t({type:new xs(t),length:g,nullCount:0,children:r.slice()})))}return[A=A.assign(t),i.map(C=>new Sr(A,C))]}function Igi(A,e,t,i,n){var o;const g=(e+63&-64)>>3;for(let a=-1,s=i.length;++a<s;){const I=t[a],r=I==null?void 0:I.length;if(r>=e)r===e?t[a]=I:(t[a]=I.slice(0,e),n.numBatches=Math.max(n.numBatches,i[a].unshift(I.slice(e,r-e))));else{const C=A[a];A[a]=C.clone({nullable:!0}),t[a]=(o=I==null?void 0:I._changeLengthAndBackfillNullBitmap(e))!==null&&o!==void 0?o:_t({type:C.type,length:e,nullCount:e,nullBitmap:new Uint8Array(g)})}}return t}var jQe;class Fs{constructor(...e){var t,i;if(e.length===0)return this.batches=[],this.schema=new Gi([]),this._offsets=[0],this;let n,o;e[0]instanceof Gi&&(n=e.shift()),e[e.length-1]instanceof Uint32Array&&(o=e.pop());const g=s=>{if(s){if(s instanceof Sr)return[s];if(s instanceof Fs)return s.batches;if(s instanceof Qn){if(s.type instanceof xs)return[new Sr(new Gi(s.type.children),s)]}else{if(Array.isArray(s))return s.flatMap(I=>g(I));if(typeof s[Symbol.iterator]=="function")return[...s].flatMap(I=>g(I));if(typeof s=="object"){const I=Object.keys(s),r=I.map(c=>new Di([s[c]])),C=new Gi(I.map((c,B)=>new Yn(String(c),r[B].type))),[,l]=n0A(C,r);return l.length===0?[new Sr(s)]:l}}}return[]},a=e.flatMap(s=>g(s));if(n=(i=n??((t=a[0])===null||t===void 0?void 0:t.schema))!==null&&i!==void 0?i:new Gi([]),!(n instanceof Gi))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const s of a){if(!(s instanceof Sr))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!i0A(n,s.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=a,this._offsets=o??xQe(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=RQe(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}set(e,t){}indexOf(e,t){return-1}getByteLength(e){return 0}[Symbol.iterator](){return this.batches.length>0?TpA.visit(new Di(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
  ${this.toArray().join(`,
  `)}
]`}concat(...e){const t=this.schema,i=this.data.concat(e.flatMap(({data:n})=>n));return new Fs(t,i.map(n=>new Sr(t,n)))}slice(e,t){const i=this.schema;[e,t]=GQe({length:this.numRows},e,t);const n=FQe(this.data,this._offsets,e,t);return new Fs(i,n.map(o=>new Sr(i,o)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){const t=this.data.map(i=>i.children[e]);if(t.length===0){const{type:i}=this.schema.fields[e],n=_t({type:i,length:0,nullCount:0});t.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new Di(t)}return null}setChild(e,t){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===e),t)}setChildAt(e,t){let i=this.schema,n=[...this.batches];if(e>-1&&e<this.numCols){t||(t=new Di([_t({type:new v0,length:this.numRows})]));const o=i.fields.slice(),g=o[e].clone({type:t.type}),a=this.schema.fields.map((s,I)=>this.getChildAt(I));[o[e],a[e]]=[g,t],[i,n]=n0A(i,a)}return new Fs(i,n)}select(e){const t=this.schema.fields.reduce((i,n,o)=>i.set(n.name,o),new Map);return this.selectAt(e.map(i=>t.get(i)).filter(i=>i>-1))}selectAt(e){const t=this.schema.selectAt(e),i=this.batches.map(n=>n.selectAt(e));return new Fs(t,i)}assign(e){const t=this.schema.fields,[i,n]=e.schema.fields.reduce((a,s,I)=>{const[r,C]=a,l=t.findIndex(c=>c.name===s.name);return~l?C[l]=I:r.push(I),a},[[],[]]),o=this.schema.assign(e.schema),g=[...t.map((a,s)=>[s,n[s]]).map(([a,s])=>s===void 0?this.getChildAt(a):e.getChildAt(s)),...i.map(a=>e.getChildAt(a))].filter(Boolean);return new Fs(...n0A(o,g))}}jQe=Symbol.toStringTag,Fs[jQe]=(A=>(A.schema=null,A.batches=[],A._offsets=new Uint32Array([0]),A._nullCount=-1,A[Symbol.isConcatSpreadable]=!0,A.isValid=MY(zpA),A.get=MY(xr.getVisitFn(dA.Struct)),A.set=MQe(Yl.getVisitFn(dA.Struct)),A.indexOf=vQe(jj.getVisitFn(dA.Struct)),A.getByteLength=MY(dE.getVisitFn(dA.Struct)),"Table"))(Fs.prototype);var PQe;let Sr=class BW{constructor(...e){switch(e.length){case 2:{if([this.schema]=e,!(this.schema instanceof Gi))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=_t({nullCount:0,type:new xs(this.schema.fields),children:this.schema.fields.map(t=>_t({type:t.type,nullCount:0}))})]=e,!(this.data instanceof Qn))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=$Qe(this.schema,this.data.children);break}case 1:{const[t]=e,{fields:i,children:n,length:o}=Object.keys(t).reduce((s,I,r)=>(s.children[r]=t[I],s.length=Math.max(s.length,t[I].length),s.fields[r]=Yn.new({name:I,type:t[I].type,nullable:!0}),s),{length:0,fields:new Array,children:new Array}),g=new Gi(i),a=_t({type:new xs(i),length:o,children:n,nullCount:0});[this.schema,this.data]=$Qe(g,a.children,o);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=AEe(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return xr.visit(this.data,e)}set(e,t){return Yl.visit(this.data,e,t)}indexOf(e,t){return jj.visit(this.data,e,t)}getByteLength(e){return dE.visit(this.data,e)}[Symbol.iterator](){return TpA.visit(new Di([this.data]))}toArray(){return[...this]}concat(...e){return new Fs(this.schema,[this,...e])}slice(e,t){const[i]=new Di([this.data]).slice(e,t).data;return new BW(this.schema,i)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)===null||t===void 0?void 0:t.findIndex(i=>i.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new Di([this.data.children[e]]):null}setChild(e,t){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===e),t)}setChildAt(e,t){let i=this.schema,n=this.data;if(e>-1&&e<this.numCols){t||(t=new Di([_t({type:new v0,length:this.numRows})]));const o=i.fields.slice(),g=n.children.slice(),a=o[e].clone({type:t.type});[o[e],g[e]]=[a,t.data[0]],i=new Gi(o,new Map(this.schema.metadata)),n=_t({type:new xs(o),children:g})}return new BW(i,n)}select(e){const t=this.schema.select(e),i=new xs(t.fields),n=[];for(const o of e){const g=this.schema.fields.findIndex(a=>a.name===o);~g&&(n[g]=this.data.children[g])}return new BW(t,_t({type:i,length:this.numRows,children:n}))}selectAt(e){const t=this.schema.selectAt(e),i=e.map(o=>this.data.children[o]).filter(Boolean),n=_t({type:new xs(t.fields),length:this.numRows,children:i});return new BW(t,n)}};PQe=Symbol.toStringTag,Sr[PQe]=(A=>(A._nullCount=-1,A[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Sr.prototype);function $Qe(A,e,t=e.reduce((i,n)=>Math.max(i,n.length),0)){var i;const n=[...A.fields],o=[...e],g=(t+63&-64)>>3;for(const[a,s]of A.fields.entries()){const I=e[a];(!I||I.length!==t)&&(n[a]=s.clone({nullable:!0}),o[a]=(i=I==null?void 0:I._changeLengthAndBackfillNullBitmap(t))!==null&&i!==void 0?i:_t({type:s.type,length:t,nullCount:t,nullBitmap:new Uint8Array(g)}))}return[A.assign(n),_t({type:new xs(n),length:t,children:o})]}function AEe(A,e,t=new Map){for(let i=-1,n=A.length;++i<n;){const g=A[i].type,a=e[i];if($e.isDictionary(g)){if(!t.has(g.id))a.dictionary&&t.set(g.id,a.dictionary);else if(t.get(g.id)!==a.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}g.children&&g.children.length>0&&AEe(g.children,a.children,t)}return t}class o0A extends Sr{constructor(e){const t=e.fields.map(n=>_t({type:n.type})),i=_t({type:new xs(e.fields),nullCount:0,children:t});super(e,i)}}var l6;(function(A){A[A.BUFFER=0]="BUFFER"})(l6||(l6={}));var c6;(function(A){A[A.LZ4_FRAME=0]="LZ4_FRAME",A[A.ZSTD=1]="ZSTD"})(c6||(c6={}));class U0{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new U0).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+An),(t||new U0).__init(e.readInt32(e.position())+e.position(),e)}codec(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):c6.LZ4_FRAME}method(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):l6.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,c6.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,l6.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,i){return U0.startBodyCompression(e),U0.addCodec(e,t),U0.addMethod(e,i),U0.endBodyCompression(e)}}let eEe=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,t,i){return e.prep(8,16),e.writeInt64(i),e.writeInt64(t),e.offset()}},tEe=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,t,i){return e.prep(8,16),e.writeInt64(i),e.writeInt64(t),e.offset()}},rh=class abA{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new abA).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+An),(t||new abA).__init(e.readInt32(e.position())+e.position(),e)}length(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}nodes(e,t){const i=this.bb.__offset(this.bb_pos,6);return i?(t||new tEe).__init(this.bb.__vector(this.bb_pos+i)+e*16,this.bb):null}nodesLength(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){const i=this.bb.__offset(this.bb_pos,8);return i?(t||new eEe).__init(this.bb.__vector(this.bb_pos+i)+e*16,this.bb):null}buffersLength(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){const t=this.bb.__offset(this.bb_pos,10);return t?(e||new U0).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}static startRecordBatch(e){e.startObject(4)}static addLength(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static endRecordBatch(e){return e.endObject()}},UY=class sbA{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new sbA).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+An),(t||new sbA).__init(e.readInt32(e.position())+e.position(),e)}id(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}data(e){const t=this.bb.__offset(this.bb_pos,6);return t?(e||new rh).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){const e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}};var B6;(function(A){A[A.NONE=0]="NONE",A[A.Schema=1]="Schema",A[A.DictionaryBatch=2]="DictionaryBatch",A[A.RecordBatch=3]="RecordBatch",A[A.Tensor=4]="Tensor",A[A.SparseTensor=5]="SparseTensor"})(B6||(B6={}));let V0=class tu{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new tu).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+An),(t||new tu).__init(e.readInt32(e.position())+e.position(),e)}version(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):LY.V1}headerType(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):B6.NONE}header(e){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}customMetadata(e,t){const i=this.bb.__offset(this.bb_pos,12);return i?(t||new ng).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+e*4),this.bb):null}customMetadataLength(){const e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,LY.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,B6.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,e.createLong(0,0))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let i=t.length-1;i>=0;i--)e.addOffset(t[i]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,i,n,o,g){return tu.startMessage(e),tu.addVersion(e,t),tu.addHeaderType(e,i),tu.addHeader(e,n),tu.addBodyLength(e,o),tu.addCustomMetadata(e,g),tu.endMessage(e)}};var Cgi=gh;class lgi extends Tt{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Xw.startNull(t),Xw.endNull(t)}visitInt(e,t){return PI.startInt(t),PI.addBitWidth(t,e.bitWidth),PI.addIsSigned(t,e.isSigned),PI.endInt(t)}visitFloat(e,t){return fE.startFloatingPoint(t),fE.addPrecision(t,e.precision),fE.endFloatingPoint(t)}visitBinary(e,t){return Kw.startBinary(t),Kw.endBinary(t)}visitBool(e,t){return Uw.startBool(t),Uw.endBool(t)}visitUtf8(e,t){return Tw.startUtf8(t),Tw.endUtf8(t)}visitDecimal(e,t){return Fr.startDecimal(t),Fr.addScale(t,e.scale),Fr.addPrecision(t,e.precision),Fr.addBitWidth(t,e.bitWidth),Fr.endDecimal(t)}visitDate(e,t){return t6.startDate(t),t6.addUnit(t,e.unit),t6.endDate(t)}visitTime(e,t){return Rl.startTime(t),Rl.addUnit(t,e.unit),Rl.addBitWidth(t,e.bitWidth),Rl.endTime(t)}visitTimestamp(e,t){const i=e.timezone&&t.createString(e.timezone)||void 0;return xl.startTimestamp(t),xl.addUnit(t,e.unit),i!==void 0&&xl.addTimezone(t,i),xl.endTimestamp(t)}visitInterval(e,t){return yE.startInterval(t),yE.addUnit(t,e.unit),yE.endInterval(t)}visitList(e,t){return Vw.startList(t),Vw.endList(t)}visitStruct(e,t){return zw.startStruct_(t),zw.endStruct_(t)}visitUnion(e,t){Mr.startTypeIdsVector(t,e.typeIds.length);const i=Mr.createTypeIdsVector(t,e.typeIds);return Mr.startUnion(t),Mr.addMode(t,e.mode),Mr.addTypeIds(t,i),Mr.endUnion(t)}visitDictionary(e,t){const i=this.visit(e.indices,t);return ah.startDictionaryEncoding(t),ah.addId(t,new Cgi(e.id,0)),ah.addIsOrdered(t,e.isOrdered),i!==void 0&&ah.addIndexType(t,i),ah.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return mE.startFixedSizeBinary(t),mE.addByteWidth(t,e.byteWidth),mE.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return pE.startFixedSizeList(t),pE.addListSize(t,e.listSize),pE.endFixedSizeList(t)}visitMap(e,t){return o6.startMap(t),o6.addKeysSorted(t,e.keysSorted),o6.endMap(t)}}const g0A=new lgi;function cgi(A,e=new Map){return new Gi(Qgi(A,e),Q6(A.customMetadata),e)}function iEe(A){return new AC(A.count,oEe(A.columns),gEe(A.columns))}function Bgi(A){return new DE(iEe(A.data),A.id,A.isDelta)}function Qgi(A,e){return(A.fields||[]).filter(Boolean).map(t=>Yn.fromJSON(t,e))}function nEe(A,e){return(A.children||[]).filter(Boolean).map(t=>Yn.fromJSON(t,e))}function oEe(A){return(A||[]).reduce((e,t)=>[...e,new qw(t.count,Egi(t.VALIDITY)),...oEe(t.children)],[])}function gEe(A,e=[]){for(let t=-1,i=(A||[]).length;++t<i;){const n=A[t];n.VALIDITY&&e.push(new GE(e.length,n.VALIDITY.length)),n.TYPE&&e.push(new GE(e.length,n.TYPE.length)),n.OFFSET&&e.push(new GE(e.length,n.OFFSET.length)),n.DATA&&e.push(new GE(e.length,n.DATA.length)),e=gEe(n.children,e)}return e}function Egi(A){return(A||[]).reduce((e,t)=>e+ +(t===0),0)}function ugi(A,e){let t,i,n,o,g,a;return!e||!(o=A.dictionary)?(g=sEe(A,nEe(A,e)),n=new Yn(A.name,g,A.nullable,Q6(A.customMetadata))):e.has(t=o.id)?(i=(i=o.indexType)?aEe(i):new QZ,a=new JY(e.get(t),i,t,o.isOrdered),n=new Yn(A.name,a,A.nullable,Q6(A.customMetadata))):(i=(i=o.indexType)?aEe(i):new QZ,e.set(t,g=sEe(A,nEe(A,e))),a=new JY(g,i,t,o.isOrdered),n=new Yn(A.name,a,A.nullable,Q6(A.customMetadata))),n||null}function Q6(A){return new Map(Object.entries(A||{}))}function aEe(A){return new L0(A.isSigned,A.bitWidth)}function sEe(A,e){const t=A.type.name;switch(t){case"NONE":return new v0;case"null":return new v0;case"binary":return new Lj;case"utf8":return new Sj;case"bool":return new Hj;case"list":return new Vj((e||[])[0]);case"struct":return new xs(e||[]);case"struct_":return new xs(e||[])}switch(t){case"int":{const i=A.type;return new L0(i.isSigned,i.bitWidth)}case"floatingpoint":{const i=A.type;return new EZ(Rr[i.precision])}case"decimal":{const i=A.type;return new Zj(i.scale,i.precision,i.bitWidth)}case"date":{const i=A.type;return new Wj(eh[i.unit])}case"time":{const i=A.type;return new uZ(di[i.unit],i.bitWidth)}case"timestamp":{const i=A.type;return new Kj(di[i.unit],i.timezone)}case"interval":{const i=A.type;return new Uj(M0[i.unit])}case"union":{const i=A.type;return new Xj(jI[i.mode],i.typeIds||[],e||[])}case"fixedsizebinary":{const i=A.type;return new zj(i.byteWidth)}case"fixedsizelist":{const i=A.type;return new Tj(i.listSize,(e||[])[0])}case"map":{const i=A.type;return new _j((e||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}var Ow=gh,dgi=XQe,hgi=vY;class Ms{constructor(e,t,i,n){this._version=t,this._headerType=i,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=typeof e=="number"?e:e.low}static fromJSON(e,t){const i=new Ms(0,qI.V4,t);return i._createHeader=mgi(e,t),i}static decode(e){e=new hgi(ui(e));const t=V0.getRootAsMessage(e),i=t.bodyLength(),n=t.version(),o=t.headerType(),g=new Ms(i,n,o);return g._createHeader=pgi(t,o),g}static encode(e){const t=new dgi;let i=-1;return e.isSchema()?i=Gi.encode(t,e.header()):e.isRecordBatch()?i=AC.encode(t,e.header()):e.isDictionaryBatch()&&(i=DE.encode(t,e.header())),V0.startMessage(t),V0.addVersion(t,qI.V4),V0.addHeader(t,i),V0.addHeaderType(t,e.headerType),V0.addBodyLength(t,new Ow(e.bodyLength,0)),V0.finishMessageBuffer(t,V0.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof Gi)return new Ms(0,qI.V4,wi.Schema,e);if(e instanceof AC)return new Ms(t,qI.V4,wi.RecordBatch,e);if(e instanceof DE)return new Ms(t,qI.V4,wi.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===wi.Schema}isRecordBatch(){return this.headerType===wi.RecordBatch}isDictionaryBatch(){return this.headerType===wi.DictionaryBatch}}class AC{constructor(e,t,i){this._nodes=t,this._buffers=i,this._length=typeof e=="number"?e:e.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}}class DE{constructor(e,t,i=!1){this._data=e,this._isDelta=i,this._id=typeof t=="number"?t:t.low}get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}}class GE{constructor(e,t){this.offset=typeof e=="number"?e:e.low,this.length=typeof t=="number"?t:t.low}}class qw{constructor(e,t){this.length=typeof e=="number"?e:e.low,this.nullCount=typeof t=="number"?t:t.low}}function mgi(A,e){return()=>{switch(e){case wi.Schema:return Gi.fromJSON(A);case wi.RecordBatch:return AC.fromJSON(A);case wi.DictionaryBatch:return DE.fromJSON(A)}throw new Error(`Unrecognized Message type: { name: ${wi[e]}, type: ${e} }`)}}function pgi(A,e){return()=>{switch(e){case wi.Schema:return Gi.decode(A.header(new bE));case wi.RecordBatch:return AC.decode(A.header(new rh),A.version());case wi.DictionaryBatch:return DE.decode(A.header(new UY),A.version())}throw new Error(`Unrecognized Message type: { name: ${wi[e]}, type: ${e} }`)}}Yn.encode=Rgi,Yn.decode=Ngi,Yn.fromJSON=ugi,Gi.encode=Ygi,Gi.decode=fgi,Gi.fromJSON=cgi,AC.encode=xgi,AC.decode=ygi,AC.fromJSON=iEe,DE.encode=Fgi,DE.decode=bgi,DE.fromJSON=Bgi,qw.encode=Mgi,qw.decode=Dgi,GE.encode=vgi,GE.decode=wgi;function fgi(A,e=new Map){const t=Jgi(A,e);return new Gi(t,E6(A),e)}function ygi(A,e=qI.V4){if(A.compression()!==null)throw new Error("Record batch compression not implemented");return new AC(A.length(),Ggi(A),kgi(A,e))}function bgi(A,e=qI.V4){return new DE(AC.decode(A.data(),e),A.id(),A.isDelta())}function wgi(A){return new GE(A.offset(),A.length())}function Dgi(A){return new qw(A.length(),A.nullCount())}function Ggi(A){const e=[];for(let t,i=-1,n=-1,o=A.nodesLength();++i<o;)(t=A.nodes(i))&&(e[++n]=qw.decode(t));return e}function kgi(A,e){const t=[];for(let i,n=-1,o=-1,g=A.buffersLength();++n<g;)(i=A.buffers(n))&&(e<qI.V4&&(i.bb_pos+=8*(n+1)),t[++o]=GE.decode(i));return t}function Jgi(A,e){const t=[];for(let i,n=-1,o=-1,g=A.fieldsLength();++n<g;)(i=A.fields(n))&&(t[++o]=Yn.decode(i,e));return t}function rEe(A,e){const t=[];for(let i,n=-1,o=-1,g=A.childrenLength();++n<g;)(i=A.children(n))&&(t[++o]=Yn.decode(i,e));return t}function Ngi(A,e){let t,i,n,o,g,a;return!e||!(a=A.dictionary())?(n=CEe(A,rEe(A,e)),i=new Yn(A.name(),n,A.nullable(),E6(A))):e.has(t=a.id().low)?(o=(o=a.indexType())?IEe(o):new QZ,g=new JY(e.get(t),o,t,a.isOrdered()),i=new Yn(A.name(),g,A.nullable(),E6(A))):(o=(o=a.indexType())?IEe(o):new QZ,e.set(t,n=CEe(A,rEe(A,e))),g=new JY(n,o,t,a.isOrdered()),i=new Yn(A.name(),g,A.nullable(),E6(A))),i||null}function E6(A){const e=new Map;if(A)for(let t,i,n=-1,o=Math.trunc(A.customMetadataLength());++n<o;)(t=A.customMetadata(n))&&(i=t.key())!=null&&e.set(i,t.value());return e}function IEe(A){return new L0(A.isSigned(),A.bitWidth())}function CEe(A,e){const t=A.typeType();switch(t){case Ao.NONE:return new v0;case Ao.Null:return new v0;case Ao.Binary:return new Lj;case Ao.Utf8:return new Sj;case Ao.Bool:return new Hj;case Ao.List:return new Vj((e||[])[0]);case Ao.Struct_:return new xs(e||[])}switch(t){case Ao.Int:{const i=A.type(new PI);return new L0(i.isSigned(),i.bitWidth())}case Ao.FloatingPoint:{const i=A.type(new fE);return new EZ(i.precision())}case Ao.Decimal:{const i=A.type(new Fr);return new Zj(i.scale(),i.precision(),i.bitWidth())}case Ao.Date:{const i=A.type(new t6);return new Wj(i.unit())}case Ao.Time:{const i=A.type(new Rl);return new uZ(i.unit(),i.bitWidth())}case Ao.Timestamp:{const i=A.type(new xl);return new Kj(i.unit(),i.timezone())}case Ao.Interval:{const i=A.type(new yE);return new Uj(i.unit())}case Ao.Union:{const i=A.type(new Mr);return new Xj(i.mode(),i.typeIdsArray()||[],e||[])}case Ao.FixedSizeBinary:{const i=A.type(new mE);return new zj(i.byteWidth())}case Ao.FixedSizeList:{const i=A.type(new pE);return new Tj(i.listSize(),(e||[])[0])}case Ao.Map:{const i=A.type(new o6);return new _j((e||[])[0],i.keysSorted())}}throw new Error(`Unrecognized type: "${Ao[t]}" (${t})`)}function Ygi(A,e){const t=e.fields.map(o=>Yn.encode(A,o));bE.startFieldsVector(A,t.length);const i=bE.createFieldsVector(A,t),n=e.metadata&&e.metadata.size>0?bE.createCustomMetadataVector(A,[...e.metadata].map(([o,g])=>{const a=A.createString(`${o}`),s=A.createString(`${g}`);return ng.startKeyValue(A),ng.addKey(A,a),ng.addValue(A,s),ng.endKeyValue(A)})):-1;return bE.startSchema(A),bE.addFields(A,i),bE.addEndianness(A,Lgi?SY.Little:SY.Big),n!==-1&&bE.addCustomMetadata(A,n),bE.endSchema(A)}function Rgi(A,e){let t=-1,i=-1,n=-1;const o=e.type;let g=e.typeId;$e.isDictionary(o)?(g=o.dictionary.typeId,n=g0A.visit(o,A),i=g0A.visit(o.dictionary,A)):i=g0A.visit(o,A);const a=(o.children||[]).map(r=>Yn.encode(A,r)),s=Fl.createChildrenVector(A,a),I=e.metadata&&e.metadata.size>0?Fl.createCustomMetadataVector(A,[...e.metadata].map(([r,C])=>{const l=A.createString(`${r}`),c=A.createString(`${C}`);return ng.startKeyValue(A),ng.addKey(A,l),ng.addValue(A,c),ng.endKeyValue(A)})):-1;return e.name&&(t=A.createString(e.name)),Fl.startField(A),Fl.addType(A,i),Fl.addTypeType(A,g),Fl.addChildren(A,s),Fl.addNullable(A,!!e.nullable),t!==-1&&Fl.addName(A,t),n!==-1&&Fl.addDictionary(A,n),I!==-1&&Fl.addCustomMetadata(A,I),Fl.endField(A)}function xgi(A,e){const t=e.nodes||[],i=e.buffers||[];rh.startNodesVector(A,t.length);for(const g of t.slice().reverse())qw.encode(A,g);const n=A.endVector();rh.startBuffersVector(A,i.length);for(const g of i.slice().reverse())GE.encode(A,g);const o=A.endVector();return rh.startRecordBatch(A),rh.addLength(A,new Ow(e.length,0)),rh.addNodes(A,n),rh.addBuffers(A,o),rh.endRecordBatch(A)}function Fgi(A,e){const t=AC.encode(A,e.data);return UY.startDictionaryBatch(A),UY.addId(A,new Ow(e.id,0)),UY.addIsDelta(A,e.isDelta),UY.addData(A,t),UY.endDictionaryBatch(A)}function Mgi(A,e){return tEe.createFieldNode(A,new Ow(e.length,0),new Ow(e.nullCount,0))}function vgi(A,e){return eEe.createBuffer(A,new Ow(e.offset,0),new Ow(e.length,0))}const Lgi=(()=>{const A=new ArrayBuffer(2);return new DataView(A).setInt16(0,256,!0),new Int16Array(A)[0]===256})(),a0A=A=>`Expected ${wi[A]} Message in stream, but was null or length 0.`,s0A=A=>`Header pointer of flatbuffer-encoded ${wi[A]} Message is null or length 0.`,lEe=(A,e)=>`Expected to read ${A} metadata bytes, but only read ${e}.`,cEe=(A,e)=>`Expected to read ${A} bytes for message body, but only read ${e}.`;class BEe{constructor(e){this.source=e instanceof r6?e:new r6(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?eo:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(a0A(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);const t=ui(this.source.read(e));if(t.byteLength<e)throw new Error(cEe(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){const t=wi.Schema,i=this.readMessage(t),n=i==null?void 0:i.header();if(e&&!n)throw new Error(s0A(t));return n}readMetadataLength(){const e=this.source.read(u6),t=e&&new vY(e),i=(t==null?void 0:t.readInt32(0))||0;return{done:i===0,value:i}}readMetadata(e){const t=this.source.read(e);if(!t)return eo;if(t.byteLength<e)throw new Error(lEe(e,t.byteLength));return{done:!1,value:Ms.decode(t)}}}class Sgi{constructor(e,t){this.source=e instanceof ZY?e:hBe(e)?new I6(e,t):new ZY(e)}[Symbol.asyncIterator](){return this}next(){return xA(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done||e.value===-1&&(e=yield this.readMetadataLength()).done||(e=yield this.readMetadata(e.value)).done?eo:e})}throw(e){return xA(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return xA(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return xA(this,void 0,void 0,function*(){let t;if((t=yield this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(a0A(e));return t.value})}readMessageBody(e){return xA(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);const t=ui(yield this.source.read(e));if(t.byteLength<e)throw new Error(cEe(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(e=!1){return xA(this,void 0,void 0,function*(){const t=wi.Schema,i=yield this.readMessage(t),n=i==null?void 0:i.header();if(e&&!n)throw new Error(s0A(t));return n})}readMetadataLength(){return xA(this,void 0,void 0,function*(){const e=yield this.source.read(u6),t=e&&new vY(e),i=(t==null?void 0:t.readInt32(0))||0;return{done:i===0,value:i}})}readMetadata(e){return xA(this,void 0,void 0,function*(){const t=yield this.source.read(e);if(!t)return eo;if(t.byteLength<e)throw new Error(lEe(e,t.byteLength));return{done:!1,value:Ms.decode(t)}})}}class Hgi extends BEe{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof TQe?e:new TQe(e)}next(){const{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Ms.fromJSON(e.schema,wi.Schema)};if(this._dictionaryIndex<e.dictionaries.length){const t=e.dictionaries[this._dictionaryIndex++];return this._body=t.data.columns,{done:!1,value:Ms.fromJSON(t,wi.DictionaryBatch)}}if(this._batchIndex<e.batches.length){const t=e.batches[this._batchIndex++];return this._body=t.columns,{done:!1,value:Ms.fromJSON(t,wi.RecordBatch)}}return this._body=[],eo}readMessageBody(e){return t(this._body);function t(i){return(i||[]).reduce((n,o)=>[...n,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE&&[o.TYPE]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...t(o.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(a0A(e));return t.value}readSchema(){const e=wi.Schema,t=this.readMessage(e),i=t==null?void 0:t.header();if(!t||!i)throw new Error(s0A(e));return i}}const u6=4,r0A="ARROW1",yZ=new Uint8Array(r0A.length);for(let A=0;A<r0A.length;A+=1)yZ[A]=r0A.codePointAt(A);function I0A(A,e=0){for(let t=-1,i=yZ.length;++t<i;)if(yZ[t]!==A[e+t])return!1;return!0}const bZ=yZ.length,QEe=bZ+u6,Zgi=bZ*2+u6;class Ih extends PpA{constructor(e){super(),this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){const t=this._impl.open(e);return F0(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Nl.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Nl.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof Ih?e:GpA(e)?Vgi(e):hBe(e)?Tgi(e):F0(e)?(()=>xA(this,void 0,void 0,function*(){return yield Ih.from(yield e)}))():mBe(e)||kpA(e)||pBe(e)||DY(e)?zgi(new ZY(e)):Xgi(new r6(e))}static readAll(e){return e instanceof Ih?e.isSync()?mEe(e):pEe(e):GpA(e)||ArrayBuffer.isView(e)||CZ(e)||dBe(e)?mEe(e):pEe(e)}}class d6 extends Ih{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return QE(this,arguments,function*(){yield dt(yield*Fj(Zw(this[Symbol.iterator]())))})}}class h6 extends Ih{constructor(e){super(e),this._impl=e}readAll(){var e,t;return xA(this,void 0,void 0,function*(){const i=new Array;try{for(var n=Zw(this),o;o=yield n.next(),!o.done;){const g=o.value;i.push(g)}}catch(g){e={error:g}}finally{try{o&&!o.done&&(t=n.return)&&(yield t.call(n))}finally{if(e)throw e.error}}return i})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class EEe extends d6{constructor(e){super(e),this._impl=e}}class Wgi extends h6{constructor(e){super(e),this._impl=e}}class uEe{constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){const i=this._loadVectors(e,t,this.schema.fields),n=_t({type:new xs(this.schema.fields),length:e.length,children:i});return new Sr(this.schema,n)}_loadDictionaryBatch(e,t){const{id:i,isDelta:n}=e,{dictionaries:o,schema:g}=this,a=o.get(i);if(n||!a){const s=g.dictionaries.get(i),I=this._loadVectors(e.data,t,[s]);return(a&&n?a.concat(new Di(I)):new Di(I)).memoize()}return a.memoize()}_loadVectors(e,t,i){return new qQe(t,e.nodes,e.buffers,this.dictionaries).visitMany(i)}}class m6 extends uEe{constructor(e,t){super(t),this._reader=GpA(e)?new Hgi(this._handle=e):new BEe(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=hEe(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):eo}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):eo}next(){if(this.closed)return eo;let e;const{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;const i=e.header(),n=t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;const i=e.header(),n=t.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new o0A(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}}class p6 extends uEe{constructor(e,t){super(t),this._reader=new Sgi(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return xA(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return xA(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=hEe(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return xA(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):eo})}return(e){return xA(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):eo})}next(){return xA(this,void 0,void 0,function*(){if(this.closed)return eo;let e;const{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;const i=e.header(),n=yield t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;const i=e.header(),n=yield t.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new o0A(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return xA(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}}class dEe extends m6{constructor(e,t){super(e instanceof _Qe?e:new _Qe(e),t)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();const i=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(wi.RecordBatch);if(n!=null&&n.isRecordBatch()){const o=n.header(),g=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,g)}}return null}_readDictionaryBatch(e){var t;const i=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(wi.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const o=n.header(),g=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(o,g);this.dictionaries.set(o.id,a)}}}_readFooter(){const{_handle:e}=this,t=e.size-QEe,i=e.readInt32(t),n=e.readAt(t-i,i);return hZ.decode(n)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const i=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(this._recordBatchIndex);if(i&&this._handle.seek(i.offset))return this._reader.readMessage(e)}return null}}class Kgi extends p6{constructor(e,...t){const i=typeof t[0]!="number"?t.shift():void 0,n=t[0]instanceof Map?t.shift():void 0;super(e instanceof I6?e:new I6(e,i),n)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}open(e){const t=Object.create(null,{open:{get:()=>super.open}});return xA(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){var t;return xA(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());const i=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(wi.RecordBatch);if(n!=null&&n.isRecordBatch()){const o=n.header(),g=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,g)}}return null})}_readDictionaryBatch(e){var t;return xA(this,void 0,void 0,function*(){const i=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(wi.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const o=n.header(),g=yield this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(o,g);this.dictionaries.set(o.id,a)}}})}_readFooter(){return xA(this,void 0,void 0,function*(){const{_handle:e}=this;e._pending&&(yield e._pending);const t=e.size-QEe,i=yield e.readInt32(t),n=yield e.readAt(t-i,i);return hZ.decode(n)})}_readNextMessageAndValidate(e){return xA(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){const t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}}class Ugi extends m6{constructor(e,t){super(e,t)}_loadVectors(e,t,i){return new egi(t,e.nodes,e.buffers,this.dictionaries).visitMany(i)}}function hEe(A,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:A.autoDestroy}function*mEe(A){const e=Ih.from(A);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function pEe(A){return QE(this,arguments,function*(){const t=yield dt(Ih.from(A));try{if(!(yield dt(t.open({autoDestroy:!1}))).closed)do yield yield dt(t);while(!(yield dt(t.reset().open())).closed)}finally{yield dt(t.cancel())}})}function Vgi(A){return new d6(new Ugi(A))}function Xgi(A){const e=A.peek(bZ+7&-8);return e&&e.byteLength>=4?I0A(e)?new EEe(new dEe(A.read())):new d6(new m6(A)):new d6(new m6(function*(){}()))}function zgi(A){return xA(this,void 0,void 0,function*(){const e=yield A.peek(bZ+7&-8);return e&&e.byteLength>=4?I0A(e)?new EEe(new dEe(yield A.read())):new h6(new p6(A)):new h6(new p6(function(){return QE(this,arguments,function*(){})}()))})}function Tgi(A){return xA(this,void 0,void 0,function*(){const{size:e}=yield A.stat(),t=new I6(A,e);return e>=Zgi&&I0A(yield t.readAt(0,bZ+7&-8))?new Wgi(new Kgi(t)):new h6(new p6(t))})}class Wo extends Tt{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...e){const t=n=>n.flatMap(o=>Array.isArray(o)?t(o):o instanceof Sr?o.data.children:o.data),i=new Wo;return i.visitMany(t(e)),i}visit(e){if(e instanceof Di)return this.visitMany(e.data),this;const{type:t}=e;if(!$e.isDictionary(t)){const{length:i,nullCount:n}=e;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");$e.isNull(t)||EB.call(this,n<=0?new Uint8Array(0):WpA(e.offset,i,e.nullBitmap)),this.nodes.push(new qw(i,n))}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function EB(A){const e=A.byteLength+7&-8;return this.buffers.push(A),this.bufferRegions.push(new GE(this._byteLength,e)),this._byteLength+=e,this}function _gi(A){const{type:e,length:t,typeIds:i,valueOffsets:n}=A;if(EB.call(this,i),e.mode===jI.Sparse)return l0A.call(this,A);if(e.mode===jI.Dense){if(A.offset<=0)return EB.call(this,n),l0A.call(this,A);{const o=i.reduce((r,C)=>Math.max(r,C),i[0]),g=new Int32Array(o+1),a=new Int32Array(o+1).fill(-1),s=new Int32Array(t),I=YpA(-n[0],t,n);for(let r,C,l=-1;++l<t;)(C=a[r=i[l]])===-1&&(C=a[r]=I[r]),s[l]=I[l]-C,++g[r];EB.call(this,s);for(let r,C=-1,l=e.children.length;++C<l;)if(r=A.children[C]){const c=e.typeIds[C],B=Math.min(t,g[c]);this.visit(r.slice(a[c],B))}}}return this}function Ogi(A){let e;return A.nullCount>=A.length?EB.call(this,new Uint8Array(0)):(e=A.values)instanceof Uint8Array?EB.call(this,WpA(A.offset,A.length,e)):EB.call(this,qj(A.values))}function X0(A){return EB.call(this,A.values.subarray(0,A.length*A.stride))}function fEe(A){const{length:e,values:t,valueOffsets:i}=A,n=i[0],o=i[e],g=Math.min(o-n,t.byteLength-n);return EB.call(this,YpA(-i[0],e,i)),EB.call(this,t.subarray(n,n+g)),this}function C0A(A){const{length:e,valueOffsets:t}=A;return t&&EB.call(this,YpA(t[0],e,t)),this.visit(A.children[0])}function l0A(A){return this.visitMany(A.type.children.map((e,t)=>A.children[t]).filter(Boolean))[0]}Wo.prototype.visitBool=Ogi,Wo.prototype.visitInt=X0,Wo.prototype.visitFloat=X0,Wo.prototype.visitUtf8=fEe,Wo.prototype.visitBinary=fEe,Wo.prototype.visitFixedSizeBinary=X0,Wo.prototype.visitDate=X0,Wo.prototype.visitTimestamp=X0,Wo.prototype.visitTime=X0,Wo.prototype.visitDecimal=X0,Wo.prototype.visitList=C0A,Wo.prototype.visitStruct=l0A,Wo.prototype.visitUnion=_gi,Wo.prototype.visitInterval=X0,Wo.prototype.visitFixedSizeList=C0A,Wo.prototype.visitMap=C0A;class yEe extends PpA{constructor(e){super(),this._position=0,this._started=!1,this._sink=new s6,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,Yr(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return F0(e)?e.then(t=>this.writeAll(t)):DY(e)?E0A(this,e):Q0A(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof s6?this._sink=e:(this._sink=new s6,e&&Eni(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&uni(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!t||!i0A(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof Fs&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof Sr&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!i0A(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof Sr?e instanceof o0A||this._writeRecordBatch(e):e instanceof Fs?this.writeAll(e.batches):CZ(e)&&this.writeAll(e)}_writeMessage(e,t=8){const i=t-1,n=Ms.encode(e),o=n.byteLength,g=this._writeLegacyIpcFormat?4:8,a=o+g+i&~i,s=a-o-g;return e.headerType===wi.RecordBatch?this._recordBatchBlocks.push(new W0(a,e.bodyLength,this._position)):e.headerType===wi.DictionaryBatch&&this._dictionaryBlocks.push(new W0(a,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-g)),o>0&&this._write(n),this._writePadding(s)}_write(e){if(this._started){const t=ui(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(Ms.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(yZ)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){const{byteLength:t,nodes:i,bufferRegions:n,buffers:o}=Wo.assemble(e),g=new AC(e.numRows,i,n),a=Ms.from(g,t);return this._writeDictionaries(e)._writeMessage(a)._writeBodyBuffers(o)}_writeDictionaryBatch(e,t,i=!1){this._dictionaryDeltaOffsets.set(t,e.length+(this._dictionaryDeltaOffsets.get(t)||0));const{byteLength:n,nodes:o,bufferRegions:g,buffers:a}=Wo.assemble(new Di([e])),s=new AC(e.length,o,g),I=new DE(s,t,i),r=Ms.from(I,n);return this._writeMessage(r)._writeBodyBuffers(a)}_writeBodyBuffers(e){let t,i,n;for(let o=-1,g=e.length;++o<g;)(t=e[o])&&(i=t.byteLength)>0&&(this._write(t),(n=(i+7&-8)-i)>0&&this._writePadding(n));return this}_writeDictionaries(e){for(let[t,i]of e.dictionaries){let n=this._dictionaryDeltaOffsets.get(t)||0;if(n===0||(i=i==null?void 0:i.slice(n)).length>0)for(const o of i.data)this._writeDictionaryBatch(o,t,n>0),n+=o.length}return this}}class c0A extends yEe{static writeAll(e,t){const i=new c0A(t);return F0(e)?e.then(n=>i.writeAll(n)):DY(e)?E0A(i,e):Q0A(i,e)}}class B0A extends yEe{static writeAll(e){const t=new B0A;return F0(e)?e.then(i=>t.writeAll(i)):DY(e)?E0A(t,e):Q0A(t,e)}constructor(){super(),this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeFooter(e){const t=hZ.encode(new hZ(e,qI.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}}function Q0A(A,e){let t=e;e instanceof Fs&&(t=e.batches,A.reset(void 0,e.schema));for(const i of t)A.write(i);return A.finish()}function E0A(A,e){var t,i,n,o;return xA(this,void 0,void 0,function*(){try{for(t=Zw(e);i=yield t.next(),!i.done;){const g=i.value;A.write(g)}}catch(g){n={error:g}}finally{try{i&&!i.done&&(o=t.return)&&(yield o.call(t))}finally{if(n)throw n.error}}return A.finish()})}function wZ(A){const e=Ih.from(A);return F0(e)?e.then(t=>wZ(t)):e.isAsync()?e.readAll().then(t=>new Fs(t)):new Fs(e.readAll())}function u0A(A,e="stream"){return(e==="stream"?c0A:B0A).writeAll(A).toUint8Array(!0)}var bEe=function(){function A(e,t,i,n){var o=this;this.getCell=function(g,a){var s=g<o.headerRows&&a<o.headerColumns,I=g>=o.headerRows&&a<o.headerColumns,r=g<o.headerRows&&a>=o.headerColumns;if(s){var C=["blank"];return a>0&&C.push("level"+g),{type:"blank",classNames:C.join(" "),content:""}}else if(r){var l=a-o.headerColumns,C=["col_heading","level"+g,"col"+l];return{type:"columns",classNames:C.join(" "),content:o.getContent(o.columnsTable,l,g)}}else if(I){var c=g-o.headerRows,C=["row_heading","level"+a,"row"+c];return{type:"index",id:"T_".concat(o.uuid,"level").concat(a,"_row").concat(c),classNames:C.join(" "),content:o.getContent(o.indexTable,c,a)}}else{var c=g-o.headerRows,l=a-o.headerColumns,C=["data","row"+c,"col"+l],B=o.styler?o.getContent(o.styler.displayValuesTable,c,l):o.getContent(o.dataTable,c,l);return{type:"data",id:"T_".concat(o.uuid,"row").concat(c,"_col").concat(l),classNames:C.join(" "),content:B}}},this.getContent=function(g,a,s){var I=g.getChildAt(s);if(I===null)return"";var r=o.getColumnTypeId(g,s);switch(r){case dA.Timestamp:return o.nanosToDate(I.get(a));default:return I.get(a)}},this.dataTable=wZ(e),this.indexTable=wZ(t),this.columnsTable=wZ(i),this.styler=n?{caption:n.caption,displayValuesTable:wZ(n.displayValues),styles:n.styles,uuid:n.uuid}:void 0}return Object.defineProperty(A.prototype,"rows",{get:function(){return this.indexTable.numRows+this.columnsTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"dataRows",{get:function(){return this.dataTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"table",{get:function(){return this.dataTable},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"index",{get:function(){return this.indexTable},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!1,configurable:!0}),A.prototype.serialize=function(){return{data:u0A(this.dataTable),index:u0A(this.indexTable),columns:u0A(this.columnsTable)}},A.prototype.getColumnTypeId=function(e,t){return e.schema.fields[t].type.typeId},A.prototype.nanosToDate=function(e){return new Date(e/1e6)},A}(),DZ=globalThis&&globalThis.__assign||function(){return DZ=Object.assign||function(A){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(A[n]=e[n])}return A},DZ.apply(this,arguments)},GZ;(function(A){A.COMPONENT_READY="streamlit:componentReady",A.SET_COMPONENT_VALUE="streamlit:setComponentValue",A.SET_FRAME_HEIGHT="streamlit:setFrameHeight"})(GZ||(GZ={}));var kE=function(){function A(){}return A.API_VERSION=1,A.RENDER_EVENT="streamlit:render",A.events=new EventTarget,A.registeredMessageListener=!1,A.setComponentReady=function(){A.registeredMessageListener||(window.addEventListener("message",A.onMessageEvent),A.registeredMessageListener=!0),A.sendBackMsg(GZ.COMPONENT_READY,{apiVersion:A.API_VERSION})},A.setFrameHeight=function(e){e===void 0&&(e=document.body.scrollHeight),e!==A.lastFrameHeight&&(A.lastFrameHeight=e,A.sendBackMsg(GZ.SET_FRAME_HEIGHT,{height:e}))},A.setComponentValue=function(e){var t;e instanceof bEe?(t="dataframe",e=e.serialize()):jgi(e)?(t="bytes",e=new Uint8Array(e.buffer)):e instanceof ArrayBuffer?(t="bytes",e=new Uint8Array(e)):t="json",A.sendBackMsg(GZ.SET_COMPONENT_VALUE,{value:e,dataType:t})},A.onMessageEvent=function(e){var t=e.data.type;switch(t){case A.RENDER_EVENT:A.onRenderMessage(e.data);break}},A.onRenderMessage=function(e){var t=e.args;t==null&&(console.error("Got null args in onRenderMessage. This should never happen"),t={});var i=e.dfs&&e.dfs.length>0?A.argsDataframeToObject(e.dfs):{};t=DZ(DZ({},t),i);var n=Boolean(e.disabled),o=e.theme;o&&qgi(o);var g={disabled:n,args:t,theme:o},a=new CustomEvent(A.RENDER_EVENT,{detail:g});A.events.dispatchEvent(a)},A.argsDataframeToObject=function(e){var t=e.map(function(i){var n=i.key,o=i.value;return[n,A.toArrowTable(o)]});return Object.fromEntries(t)},A.toArrowTable=function(e){var t,i=(t=e.data,t.data),n=t.index,o=t.columns,g=t.styler;return new bEe(i,n,o,g)},A.sendBackMsg=function(e,t){window.parent.postMessage(DZ({isStreamlitMessage:!0,type:e},t),"*")},A}(),qgi=function(A){var e=document.createElement("style");document.head.appendChild(e),e.innerHTML=`
    :root {
      --primary-color: `.concat(A.primaryColor,`;
      --background-color: `).concat(A.backgroundColor,`;
      --secondary-background-color: `).concat(A.secondaryBackgroundColor,`;
      --text-color: `).concat(A.textColor,`;
      --font: `).concat(A.font,`;
    }

    body {
      background-color: var(--background-color);
      color: var(--text-color);
    }
  `)};function jgi(A){var e=!1;try{e=A instanceof BigInt64Array||A instanceof BigUint64Array}catch{}return A instanceof Int8Array||A instanceof Uint8Array||A instanceof Uint8ClampedArray||A instanceof Int16Array||A instanceof Uint16Array||A instanceof Int32Array||A instanceof Uint32Array||A instanceof Float32Array||A instanceof Float64Array||e}var wEe=globalThis&&globalThis.__extends||function(){var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(i[o]=n[o])},A(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");A(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();(function(A){wEe(e,A);function e(){return A!==null&&A.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){kE.setFrameHeight()},e.prototype.componentDidUpdate=function(){kE.setFrameHeight()},e})(b.PureComponent);function Pgi(A){var e=function(t){wEe(i,t);function i(n){var o=t.call(this,n)||this;return o.componentDidMount=function(){kE.events.addEventListener(kE.RENDER_EVENT,o.onRenderEvent),kE.setComponentReady()},o.componentDidUpdate=function(){o.state.componentError!=null&&kE.setFrameHeight()},o.componentWillUnmount=function(){kE.events.removeEventListener(kE.RENDER_EVENT,o.onRenderEvent)},o.onRenderEvent=function(g){o.setState({renderData:g.detail})},o.state={renderData:void 0,componentError:void 0},o}return i.prototype.render=function(){return this.state.componentError!=null?b.createElement("div",null,b.createElement("h1",null,"Component Error"),b.createElement("span",null,this.state.componentError.message)):this.state.renderData==null?null:b.createElement(A,{width:window.innerWidth,disabled:this.state.renderData.disabled,args:this.state.renderData.args,theme:this.state.renderData.theme})},i.getDerivedStateFromError=function(n){return{componentError:n}},i}(b.PureComponent);return OJA(e,A)}let DEe=p.createContext(null);function $gi(){let A=p.useContext(DEe);if(!A)throw new Error("RenderContext not found");return A}function Aai(){return $gi().model}function eai(A){return({el:e,model:t,experimental:i})=>{let n=wf.createRoot(e);return n.render(p.createElement(p.StrictMode,null,p.createElement(DEe.Provider,{value:{model:t,experimental:i}},p.createElement(A)))),()=>n.unmount()}}const tai=async A=>navigator.clipboard.writeText(A),iai=[{header:"Using pip:",cmd:"pip install pygwalker --upgrade"},{header:"Using anaconda:",cmd:"conda install -c conda-forge pygwalker"}],nai=A=>{const[e,t]=p.useState(!1);return PA(ua,{children:[IA("header",{children:A.header}),PA("div",{children:[IA("code",{children:A.cmd}),PA("div",{role:"button","aria-label":"Copy command",tabIndex:0,"aria-disabled":e,onClick:()=>{e||(t(!0),tai(A.cmd).finally(()=>{setTimeout(()=>{t(!1)},2e3)}))},children:[IA("small",{children:e?"Copied":"Copy"}),IA("span",{children:e?"✅":"❏"})]})]})]})},oai=Math.random().toString(16).split(".").at(1)+new Date().getTime().toString(16).padStart(16,"0"),gai=A=>{var r,C,l;const[e,t]=p.useState(!1),[i,n]=p.useState({}),[o,g]=p.useState(!1);window.localStorage.getItem("HASH")===null&&window.localStorage.setItem("HASH",oai);const a="https://5agko11g7e.execute-api.us-west-1.amazonaws.com/default/check_updates",s=(window==null?void 0:window.__GW_VERSION)||"current",I=window.localStorage.getItem("HASH");return p.useEffect(()=>{var c;if(((c=A.userConfig)==null?void 0:c.privacy)!=="offline"){const B=`${a}?pkg=pygwalker-app&v=${s}&hashcode=${I}&env=production&kernelHashcode=${A.hashcode}`;fetch(B,{headers:{"Content-Type":"application/json"}}).then(E=>E.json()).then(E=>{var u;n({data:E.data}),t(((u=E==null?void 0:E.data)==null?void 0:u.outdated)||!1)})}},[]),p.useEffect(()=>{g(!1)},[e]),p.useEffect(()=>{if(!o)return;const c=()=>{g(!1)};return document.addEventListener("click",c),()=>{document.removeEventListener("click",c)}},[o]),p.useEffect(()=>{g(!1)},[e]),p.useEffect(()=>{if(!o)return;const c=()=>{g(!1)};return document.addEventListener("click",c),()=>{document.removeEventListener("click",c)}},[o]),PA(ua,{children:[IA("style",{children:`
        .update_link {
            position: fixed;
            right: 2rem;
            top: 1rem;
            background-color: rgba(56,189,248,.1);
            color: rgb(2, 132, 199);
            --line-height: 1.25rem;
            line-height: var(--line-height);
            --padding-block: 0.25rem;
            padding: var(--padding-block) 0.75rem;
            border-radius: calc(var(--padding-block) + var(--line-height) * .5);
            font-weight: 500;
            font-size: .75rem;
            font-family: sans-serif;
            text-align: end;
        }
        .update_link p {
            margin: 0;
            padding: 0;
        }
        .update_link *[role="button"] {
            cursor: pointer;
        }
        .update_link *[role="separator"] {
            user-select: none;
            margin-inline: 0.5em;
            display: inline-block;
        }
        .update_link .solutions {
            margin: 1em 0 1em 2em;
            display: grid;
            grid-template-columns: repeat(2, auto);
            gap: 0.2em 0.8em;
            font-family: monospace;
        }
        .update_link .solutions > * {
            display: flex;
            align-items: center;
        }
        .update_link .solutions div:has(> code) {
            display: flex;
            align-items: center;
            background-color: #777;
            color: #eee;
            padding-inline: 0.8em 6em;
            padding-block: 0.1em;
            border-radius: 2px;
            position: relative;
            height: 2em;
        }
        .update_link *[aria-disabled="true"] {
            opacity: 1 !important;
            cursor: default !important;
        }
        .update_link .solutions div *[role="button"] {
            user-select: none;
            flex-grow: 0;
            flex-shrink: 0;
            cursor: pointer;
            margin-left: 1em;
            background-color: #eee;
            color: #444;
            padding-inline: 0.4em;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            border-radius: 1em;
            opacity: 0.5;
            position: absolute;
            right: 0.5em;
            z-index: 10;
            font-family: 
        }
        .update_link .solutions div:hover *[role="button"] {
            opacity: 1;
        }
        .update_link .solutions div *[role="button"] > small {
            font-size: 0.65rem;
            margin-right: 0.5em;
        }
        .update_link .solutions div > code {
            flex-grow: 1;
            flex-shrink: 1;
            text-align: start;
        }
        .update_link a {
            font-family: monospace;
            color: inherit;
            text-decoration: none;
            cursor: pointer;
        }
        .update_link a span {
            filter: brightness(1.8);
        }
        .update_link p span {
            font-family: monospace;
            color: inherit;
        }
        @media (prefers-color-scheme: dark) {
            .update_link span, .update_link header, .update_link a {
                filter: brightness(1.5);
            }
        }
    `}),e&&PA("div",{className:"update_link","aria-live":"assertive",role:"alert",tabIndex:0,onClick:c=>c.stopPropagation(),children:[PA("p",{children:[PA("a",{href:"https://pypi.org/project/pygwalker",target:"_blank",children:["Update: ",`${s}↑`,IA("span",{children:` ${((l=(C=(r=i==null?void 0:i.data)==null?void 0:r.latest)==null?void 0:C.release)==null?void 0:l.version)||"latest"}`})]}),IA("span",{role:"separator",children:"|"}),IA("span",{"aria-haspopup":!0,role:"button",tabIndex:0,onClick:()=>g(c=>!c),children:`${o?"Hide":" Cmd"} ❏`})]}),o&&IA("div",{className:"solutions",children:iai.map((c,B)=>IA(nai,{...c},B))})]})]})};class aai{constructor(){LB(this,"_notifyTimeoutFunc",setTimeout(()=>{},0));LB(this,"initModalOpen",!1);LB(this,"initModalInfo",{total:0,curIndex:0,title:""});LB(this,"showCloudTool",!1);LB(this,"version","");LB(this,"notification",null);LB(this,"uploadSpecModalOpen",!1);LB(this,"uploadChartModalOpen",!1);LB(this,"isStreamlitComponent",!1);lAA(this,{initModalOpen:on,initModalInfo:on,showCloudTool:on,version:on,notification:on,uploadSpecModalOpen:on,uploadChartModalOpen:on,isStreamlitComponent:on,setInitModalOpen:da,setInitModalInfo:da,setShowCloudTool:da,setVersion:da,setNotification:da,setUploadSpecModalOpen:da,setUploadChartModalOpen:da,setIsStreamlitComponent:da})}setInitModalOpen(e){this.initModalOpen=e}setInitModalInfo(e){this.initModalInfo=e}setShowCloudTool(e){this.showCloudTool=e}setVersion(e){this.version=e}setNotification(e,t=5e3){clearTimeout(this._notifyTimeoutFunc),this.notification=e,this._notifyTimeoutFunc=setTimeout(()=>{this.notification=null},t)}setUploadSpecModalOpen(e){this.uploadSpecModalOpen=e}setUploadChartModalOpen(e){this.uploadChartModalOpen=e}setIsStreamlitComponent(e){this.isStreamlitComponent=e}}const Me=new aai;class sai{constructor(){LB(this,"comm",null);lAA(this,{comm:on,setComm:da})}setComm(e){this.comm=e}}const Hr=new sai;let _a,kZ=0,JZ=null;function f6(){return(JZ===null||JZ.byteLength===0)&&(JZ=new Uint8Array(_a.memory.buffer)),JZ}const y6=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},rai=typeof y6.encodeInto=="function"?function(A,e){return y6.encodeInto(A,e)}:function(A,e){const t=y6.encode(A);return e.set(t),{read:A.length,written:t.length}};function d0A(A,e,t){if(t===void 0){const a=y6.encode(A),s=e(a.length,1)>>>0;return f6().subarray(s,s+a.length).set(a),kZ=a.length,s}let i=A.length,n=e(i,1)>>>0;const o=f6();let g=0;for(;g<i;g++){const a=A.charCodeAt(g);if(a>127)break;o[n+g]=a}if(g!==i){g!==0&&(A=A.slice(g)),n=t(n,i,i=g+A.length*3,1)>>>0;const a=f6().subarray(n+g,n+i),s=rai(A,a);g+=s.written,n=t(n,i,g,1)>>>0}return kZ=g,n}let NZ=null;function GEe(){return(NZ===null||NZ.byteLength===0)&&(NZ=new Int32Array(_a.memory.buffer)),NZ}const kEe=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&kEe.decode();function Iai(A,e){return A=A>>>0,kEe.decode(f6().subarray(A,A+e))}function JEe(A,e,t){let i,n;try{const a=_a.__wbindgen_add_to_stack_pointer(-16),s=d0A(A,_a.__wbindgen_malloc,_a.__wbindgen_realloc),I=kZ,r=d0A(e,_a.__wbindgen_malloc,_a.__wbindgen_realloc),C=kZ,l=d0A(t,_a.__wbindgen_malloc,_a.__wbindgen_realloc),c=kZ;_a.parser_dsl_with_meta(a,s,I,r,C,l,c);var o=GEe()[a/4+0],g=GEe()[a/4+1];return i=o,n=g,Iai(o,g)}finally{_a.__wbindgen_add_to_stack_pointer(16),_a.__wbindgen_free(i,n,1)}}async function Cai(A,e){if(typeof Response=="function"&&A instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(A,e)}catch(i){if(A.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}const t=await A.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(A,e);return t instanceof WebAssembly.Instance?{instance:t,module:A}:t}}function lai(){const A={};return A.wbg={},A}function cai(A,e){return _a=A.exports,b6.__wbindgen_wasm_module=e,NZ=null,JZ=null,_a}async function b6(A){if(_a!==void 0)return _a;typeof A>"u"&&(A=new URL("data:application/wasm;base64, ",self.location));const e=lai();(typeof A=="string"||typeof Request=="function"&&A instanceof Request||typeof URL=="function"&&A instanceof URL)&&(A=fetch(A));const{instance:t,module:i}=await Cai(await A,e);return cai(t,i)}async function Bai(A){const{dataSourceId:e}=A;return new Promise((t,i)=>{const n=new Array,o=()=>{i("timeout")};let g=setTimeout(o,1e5);const a=s=>{try{s.data.dataSourceId===e&&(clearTimeout(g),g=setTimeout(o,1e5),s.data.action==="postData"?(Me.setInitModalOpen(!0),Me.setInitModalInfo({total:s.data.total,curIndex:s.data.curIndex,title:"Loading Data"}),n.push(...s.data.data??[])):s.data.action==="finishData"&&(window.removeEventListener("message",a),t(n)))}catch(I){i({message:"handler",error:I})}};window.addEventListener("message",a)})}function Qai(A){window.postMessage({action:"postData",dataSourceId:A.dataSourceId,total:A.total,curIndex:A.curIndex,data:A.data},"*")}function Eai(A){window.postMessage({action:"finishData",dataSourceId:A.dataSourceId},"*")}function NEe(A){const e=[],t=async n=>{var g;const o=await((g=Hr.comm)==null?void 0:g.sendMsg(A,{queryList:n.map(a=>a.query)},6e4));if(o)for(let a=0;a<n.length;a++)n[a].resolve(o.data.datas[a]);else for(let a=0;a<n.length;a++)n[a].reject("get result error")};return{getDatas:n=>new Promise((o,g)=>{e.push({query:n,resolve:o,reject:g}),e.length===1&&setTimeout(()=>{t(e.splice(0,e.length))},100)})}}const uai=NEe("batch_get_datas_by_sql"),dai=NEe("batch_get_datas_by_payload"),w6=5e4;function YEe(){Me.setNotification({type:"warning",title:"Data Limit Reached",message:PA(ua,{children:["The current computation has returned more than 50,000 rows of data. To ensure optimal performance, we are currently rendering only the first 50,000 rows. If you need to render the entire all datas, please use the 'limit' tool (",IA("svg",{className:"inline bg-black",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:IA("path",{d:"M9.94969 7.49989C9.94969 8.85288 8.85288 9.94969 7.49989 9.94969C6.14691 9.94969 5.0501 8.85288 5.0501 7.49989C5.0501 6.14691 6.14691 5.0501 7.49989 5.0501C8.85288 5.0501 9.94969 6.14691 9.94969 7.49989ZM10.8632 8C10.6213 9.64055 9.20764 10.8997 7.49989 10.8997C5.79214 10.8997 4.37847 9.64055 4.13662 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H4.13659C4.37835 5.35935 5.79206 4.1001 7.49989 4.1001C9.20772 4.1001 10.6214 5.35935 10.8632 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H10.8632Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),") to manually set the maximum number of rows to be returned."]})},6e4)}function hai(A){return async e=>{const t=JEe("pygwalker_mid_table",JSON.stringify({...e,limit:e.limit??w6}),JSON.stringify({pygwalker_mid_table:A})),i=await uai.getDatas(t)??[];return!e.limit&&i.length===w6&&YEe(),i}}async function mai(A){const e=await dai.getDatas({...A,limit:A.limit??w6})??[];return!A.limit&&e.length===w6&&YEe(),e}var D6,pai=new Uint8Array(16);function fai(){if(!D6&&(D6=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!D6))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return D6(pai)}const yai=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function bai(A){return typeof A=="string"&&yai.test(A)}for(var Ca=[],h0A=0;h0A<256;++h0A)Ca.push((h0A+256).toString(16).substr(1));function wai(A){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(Ca[A[e+0]]+Ca[A[e+1]]+Ca[A[e+2]]+Ca[A[e+3]]+"-"+Ca[A[e+4]]+Ca[A[e+5]]+"-"+Ca[A[e+6]]+Ca[A[e+7]]+"-"+Ca[A[e+8]]+Ca[A[e+9]]+"-"+Ca[A[e+10]]+Ca[A[e+11]]+Ca[A[e+12]]+Ca[A[e+13]]+Ca[A[e+14]]+Ca[A[e+15]]).toLowerCase();if(!bai(t))throw TypeError("Stringified UUID is invalid");return t}function YZ(A,e,t){A=A||{};var i=A.random||(A.rng||fai)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(var n=0;n<16;++n)e[t+n]=i[n];return e}return wai(i)}const G6=A=>`hacker-comm-pyg-done-signal-${A}`,Dai=()=>window.parent.location.host==="datalore.jetbrains.com"?"datalore":"jupyter",VY=(A,e)=>{let t=IA(ua,{children:A});switch(e){case 20001:t=PA(ua,{children:[IA("p",{className:"py-1",children:"kanaries_api_key is not valid."}),IA("p",{className:"py-1",children:"Please set kanaries_api_key first."}),IA("p",{className:"py-1",children:"execute it in terminal:"}),IA("p",{className:"font-semibold px-1 py-1",children:"`pygwalker login`"})]});break;case 20002:t=IA(ua,{children:PA("p",{className:"py-1",children:["The usage of cloud config has reached the upper limit. If you want to use more cloud config files, please subscribe to different cloud packages according to your usage:",IA("a",{className:"font-semibold px-1",href:"https://kanaries.net/home/pygwalker",target:"_blank",children:"https://kanaries.net/home/pygwalker"})]})});break}Me.setNotification({type:"error",title:"Error",message:t||"Unknown error"},2e4)},Gai=A=>{let t=0;const i=Dai(),n=window.parent.document,o=n.getElementsByClassName(`hacker-comm-pyg-html-store-${A}`)[0].childNodes[1],g=Array.from({length:5},(B,E)=>E).map(B=>n.getElementsByClassName(`hacker-comm-pyg-kernel-store-${A}-${B}`)[0].childNodes[1]),a=new Map,s=new Map,I=B=>{const E=new Event("input",{bubbles:!0}),u=g[t];u.value=B,u.dispatchEvent(E),t=(t+1)%5},r=B=>{const E=JSON.parse(B),u=E.action;if(u==="finish_request"){s.set(E.rid,E.data),n.dispatchEvent(new CustomEvent(G6(E.rid)));return}const d=a.get(u);if(d){const f=d(E.data)??{};l("finish_request",f,E.rid)}},C=async(B,E,u=3e4)=>{const d=YZ();return new Promise((w,y)=>{setTimeout(()=>{l(B,E,d)},0);const G=setTimeout(()=>{VY("communication timeout",0),y(new Error("get result timeout"))},u);n.addEventListener(G6(d),R=>{clearTimeout(G);const x=s.get(d);x.code!==0&&(VY(x.message,x.code),y(new Error(x.message))),w(x)})})},l=(B,E,u)=>{u=u??YZ(),I(JSON.stringify({gid:A,rid:u,action:B,data:E}))},c=(B,E)=>{a.set(B,E)};if(i==="datalore"){const B=window.parent.Jupyter.notebook.kernel;B.__pre_can_handle_message===void 0&&(B.__pre_can_handle_message=B._can_handle_message),B._can_handle_message=E=>{if(E.msg_type==="comm_msg"&&E.content.data.method==="update"){const u=E.content.data.state.value;try{JSON.parse(u).gid===A&&r(u)}catch{}}return B.__pre_can_handle_message(E)}}else new MutationObserver(E=>{E.forEach(u=>{u.type==="attributes"&&r(o.value)})}).observe(o,{attributes:!0,attributeFilter:["placeholder"]});return{sendMsg:C,registerEndpoint:c,sendMsgAsync:l}},kai=async(A,e)=>{if(A==="")return e;const t=A.split("/"),i=[];for(let o=t.length;o>=0;o--)i.push(t.slice(0,o).join("/"));const n=i.slice(0,2).map(o=>`${o.length===0?"":"/"}${o}/${e}`);return(await Promise.all(n.map(async o=>{try{return(await(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"ping",data:{}})})).json()).code===0?o:null}catch{return null}}))).find(o=>o!==null)},Jai=async(A,e)=>{const t=window.parent.document.location.host.split(".").slice(-2).join(".");let i="";if(t==="streamlit.app")i=`/~/+/_stcore/_pygwalker/comm/${A}`;else{const a=window.parent.location.pathname.replace(/\/+$/,"").replace(/^\/+/,"");i=await kai(a,`${e}/${A}`)}i="/"+i.replace(new RegExp("/*"),"");const n=async(a,s,I=3e4)=>{const r=setTimeout(()=>{throw VY("communication timeout",0),new Error("get result timeout")},I);try{const C=await o(a,s);if(C.code!==0)throw VY(C.message,C.code),new Error(C.message);return C}finally{clearTimeout(r)}},o=async(a,s)=>{const I=YZ();return await(await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:a,data:s,rid:I,gid:A})})).json()};return{sendMsg:n,registerEndpoint:(a,s)=>{},sendMsgAsync:o}},Nai=A=>{Me.isStreamlitComponent&&kE.setComponentValue(A)},Yai=async(A,e)=>{const t=new Map,i=a=>{const s=JSON.parse(a);if(s.action==="finish_request"){t.set(s.rid,s.data),document.dispatchEvent(new CustomEvent(G6(s.rid)));return}};e.on("msg:custom",a=>{a.type==="pyg_response"&&i(a.data)});const n=async(a,s,I=3e4)=>{const r=YZ();return new Promise((l,c)=>{setTimeout(()=>{o(a,s,r)},0);const B=setTimeout(()=>{VY("communication timeout",0),c(new Error("get result timeout"))},I);document.addEventListener(G6(r),E=>{clearTimeout(B);const u=t.get(r);u.code!==0&&(VY(u.message,u.code),c(new Error(u.message))),l(u)})})},o=(a,s,I)=>{I=I??YZ(),e.send({type:"pyg_request",msg:{gid:A,rid:I,action:a,data:s}})};return{sendMsg:n,registerEndpoint:(a,s)=>{},sendMsgAsync:o}};let REe={privacy:"events"};function xEe(){return REe.privacy!=="offline"}function Rai(A){REe=A}function xai(A,e){if(A==null)return{};var t={};for(var i in A)if({}.hasOwnProperty.call(A,i)){if(e.indexOf(i)!==-1)continue;t[i]=A[i]}return t}function Fai(A,e){if(A==null)return{};var t,i,n=xai(A,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(A);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(A,t)&&(n[t]=A[t])}return n}function m0A(A,e){(e==null||e>A.length)&&(e=A.length);for(var t=0,i=Array(e);t<e;t++)i[t]=A[t];return i}function Mai(A){if(Array.isArray(A))return m0A(A)}function FEe(A){if(typeof Symbol<"u"&&A[Symbol.iterator]!=null||A["@@iterator"]!=null)return Array.from(A)}function MEe(A,e){if(A){if(typeof A=="string")return m0A(A,e);var t={}.toString.call(A).slice(8,-1);return t==="Object"&&A.constructor&&(t=A.constructor.name),t==="Map"||t==="Set"?Array.from(A):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?m0A(A,e):void 0}}function vai(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p0A(A){return Mai(A)||FEe(A)||MEe(A)||vai()}function uB(A){return uB=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},uB(A)}function Lai(A,e){if(uB(A)!="object"||!A)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var i=t.call(A,e||"default");if(uB(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function vEe(A){var e=Lai(A,"string");return uB(e)=="symbol"?e:e+""}function JE(A,e,t){return(e=vEe(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function f0A(){return f0A=Object.assign?Object.assign.bind():function(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(A[i]=t[i])}return A},f0A.apply(null,arguments)}function LEe(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function XY(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?LEe(Object(t),!0).forEach(function(i){JE(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):LEe(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function Sai(A){var e=A.length;if(e===0||e===1)return A;if(e===2)return[A[0],A[1],"".concat(A[0],".").concat(A[1]),"".concat(A[1],".").concat(A[0])];if(e===3)return[A[0],A[1],A[2],"".concat(A[0],".").concat(A[1]),"".concat(A[0],".").concat(A[2]),"".concat(A[1],".").concat(A[0]),"".concat(A[1],".").concat(A[2]),"".concat(A[2],".").concat(A[0]),"".concat(A[2],".").concat(A[1]),"".concat(A[0],".").concat(A[1],".").concat(A[2]),"".concat(A[0],".").concat(A[2],".").concat(A[1]),"".concat(A[1],".").concat(A[0],".").concat(A[2]),"".concat(A[1],".").concat(A[2],".").concat(A[0]),"".concat(A[2],".").concat(A[0],".").concat(A[1]),"".concat(A[2],".").concat(A[1],".").concat(A[0])];if(e>=4)return[A[0],A[1],A[2],A[3],"".concat(A[0],".").concat(A[1]),"".concat(A[0],".").concat(A[2]),"".concat(A[0],".").concat(A[3]),"".concat(A[1],".").concat(A[0]),"".concat(A[1],".").concat(A[2]),"".concat(A[1],".").concat(A[3]),"".concat(A[2],".").concat(A[0]),"".concat(A[2],".").concat(A[1]),"".concat(A[2],".").concat(A[3]),"".concat(A[3],".").concat(A[0]),"".concat(A[3],".").concat(A[1]),"".concat(A[3],".").concat(A[2]),"".concat(A[0],".").concat(A[1],".").concat(A[2]),"".concat(A[0],".").concat(A[1],".").concat(A[3]),"".concat(A[0],".").concat(A[2],".").concat(A[1]),"".concat(A[0],".").concat(A[2],".").concat(A[3]),"".concat(A[0],".").concat(A[3],".").concat(A[1]),"".concat(A[0],".").concat(A[3],".").concat(A[2]),"".concat(A[1],".").concat(A[0],".").concat(A[2]),"".concat(A[1],".").concat(A[0],".").concat(A[3]),"".concat(A[1],".").concat(A[2],".").concat(A[0]),"".concat(A[1],".").concat(A[2],".").concat(A[3]),"".concat(A[1],".").concat(A[3],".").concat(A[0]),"".concat(A[1],".").concat(A[3],".").concat(A[2]),"".concat(A[2],".").concat(A[0],".").concat(A[1]),"".concat(A[2],".").concat(A[0],".").concat(A[3]),"".concat(A[2],".").concat(A[1],".").concat(A[0]),"".concat(A[2],".").concat(A[1],".").concat(A[3]),"".concat(A[2],".").concat(A[3],".").concat(A[0]),"".concat(A[2],".").concat(A[3],".").concat(A[1]),"".concat(A[3],".").concat(A[0],".").concat(A[1]),"".concat(A[3],".").concat(A[0],".").concat(A[2]),"".concat(A[3],".").concat(A[1],".").concat(A[0]),"".concat(A[3],".").concat(A[1],".").concat(A[2]),"".concat(A[3],".").concat(A[2],".").concat(A[0]),"".concat(A[3],".").concat(A[2],".").concat(A[1]),"".concat(A[0],".").concat(A[1],".").concat(A[2],".").concat(A[3]),"".concat(A[0],".").concat(A[1],".").concat(A[3],".").concat(A[2]),"".concat(A[0],".").concat(A[2],".").concat(A[1],".").concat(A[3]),"".concat(A[0],".").concat(A[2],".").concat(A[3],".").concat(A[1]),"".concat(A[0],".").concat(A[3],".").concat(A[1],".").concat(A[2]),"".concat(A[0],".").concat(A[3],".").concat(A[2],".").concat(A[1]),"".concat(A[1],".").concat(A[0],".").concat(A[2],".").concat(A[3]),"".concat(A[1],".").concat(A[0],".").concat(A[3],".").concat(A[2]),"".concat(A[1],".").concat(A[2],".").concat(A[0],".").concat(A[3]),"".concat(A[1],".").concat(A[2],".").concat(A[3],".").concat(A[0]),"".concat(A[1],".").concat(A[3],".").concat(A[0],".").concat(A[2]),"".concat(A[1],".").concat(A[3],".").concat(A[2],".").concat(A[0]),"".concat(A[2],".").concat(A[0],".").concat(A[1],".").concat(A[3]),"".concat(A[2],".").concat(A[0],".").concat(A[3],".").concat(A[1]),"".concat(A[2],".").concat(A[1],".").concat(A[0],".").concat(A[3]),"".concat(A[2],".").concat(A[1],".").concat(A[3],".").concat(A[0]),"".concat(A[2],".").concat(A[3],".").concat(A[0],".").concat(A[1]),"".concat(A[2],".").concat(A[3],".").concat(A[1],".").concat(A[0]),"".concat(A[3],".").concat(A[0],".").concat(A[1],".").concat(A[2]),"".concat(A[3],".").concat(A[0],".").concat(A[2],".").concat(A[1]),"".concat(A[3],".").concat(A[1],".").concat(A[0],".").concat(A[2]),"".concat(A[3],".").concat(A[1],".").concat(A[2],".").concat(A[0]),"".concat(A[3],".").concat(A[2],".").concat(A[0],".").concat(A[1]),"".concat(A[3],".").concat(A[2],".").concat(A[1],".").concat(A[0])]}var y0A={};function Hai(A){if(A.length===0||A.length===1)return A;var e=A.join(".");return y0A[e]||(y0A[e]=Sai(A)),y0A[e]}function Zai(A){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0,i=A.filter(function(o){return o!=="token"}),n=Hai(i);return n.reduce(function(o,g){return XY(XY({},o),t[g])},e)}function SEe(A){return A.join(" ")}function Wai(A,e){var t=0;return function(i){return t+=1,i.map(function(n,o){return HEe({node:n,stylesheet:A,useInlineStyles:e,key:"code-segment-".concat(t,"-").concat(o)})})}}function HEe(A){var e=A.node,t=A.stylesheet,i=A.style,n=i===void 0?{}:i,o=A.useInlineStyles,g=A.key,a=e.properties,s=e.type,I=e.tagName,r=e.value;if(s==="text")return r;if(I){var C=Wai(t,o),l;if(!o)l=XY(XY({},a),{},{className:SEe(a.className)});else{var c=Object.keys(t).reduce(function(d,f){return f.split(".").forEach(function(w){d.includes(w)||d.push(w)}),d},[]),B=a.className&&a.className.includes("token")?["token"]:[],E=a.className&&B.concat(a.className.filter(function(d){return!c.includes(d)}));l=XY(XY({},a),{},{className:SEe(E)||void 0,style:Zai(a.className,Object.assign({},a.style,n),t)})}var u=C(e.children);return b.createElement(I,f0A({key:g},l),u)}}const Kai=function(A,e){var t=A.listLanguages();return t.indexOf(e)!==-1};var Uai=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function ZEe(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function z0(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ZEe(Object(t),!0).forEach(function(i){JE(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):ZEe(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}var Vai=/\n/g;function Xai(A){return A.match(Vai)}function zai(A){var e=A.lines,t=A.startingLineNumber,i=A.style;return e.map(function(n,o){var g=o+t;return b.createElement("span",{key:"line-".concat(o),className:"react-syntax-highlighter-line-number",style:typeof i=="function"?i(g):i},"".concat(g,`
`))})}function Tai(A){var e=A.codeString,t=A.codeStyle,i=A.containerStyle,n=i===void 0?{float:"left",paddingRight:"10px"}:i,o=A.numberStyle,g=o===void 0?{}:o,a=A.startingLineNumber;return b.createElement("code",{style:Object.assign({},t,n)},zai({lines:e.replace(/\n$/,"").split(`
`),style:g,startingLineNumber:a}))}function _ai(A){return"".concat(A.toString().length,".25em")}function WEe(A,e){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(A),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:e},children:[{type:"text",value:A}]}}function KEe(A,e,t){var i={display:"inline-block",minWidth:_ai(t),paddingRight:"1em",textAlign:"right",userSelect:"none"},n=typeof A=="function"?A(e):A,o=z0(z0({},i),n);return o}function k6(A){var e=A.children,t=A.lineNumber,i=A.lineNumberStyle,n=A.largestLineNumber,o=A.showInlineLineNumbers,g=A.lineProps,a=g===void 0?{}:g,s=A.className,I=s===void 0?[]:s,r=A.showLineNumbers,C=A.wrapLongLines,l=A.wrapLines,c=l===void 0?!1:l,B=c?z0({},typeof a=="function"?a(t):a):{};if(B.className=B.className?[].concat(p0A(B.className.trim().split(/\s+/)),p0A(I)):I,t&&o){var E=KEe(i,t,n);e.unshift(WEe(t,E))}return C&r&&(B.style=z0({display:"flex"},B.style)),{type:"element",tagName:"span",properties:B,children:e}}function UEe(A){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],i=0;i<A.length;i++){var n=A[i];if(n.type==="text")t.push(k6({children:[n],className:p0A(new Set(e))}));else if(n.children){var o=e.concat(n.properties.className);UEe(n.children,o).forEach(function(g){return t.push(g)})}}return t}function Oai(A,e,t,i,n,o,g,a,s){var I,r=UEe(A.value),C=[],l=-1,c=0;function B(G,R){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return k6({children:G,lineNumber:R,lineNumberStyle:a,largestLineNumber:g,showInlineLineNumbers:n,lineProps:t,className:x,showLineNumbers:i,wrapLongLines:s,wrapLines:e})}function E(G,R){if(i&&R&&n){var x=KEe(a,R,g);G.unshift(WEe(R,x))}return G}function u(G,R){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return e||x.length>0?B(G,R,x):E(G,R)}for(var d=function(){var R=r[c],x=R.children[0].value,F=Xai(x);if(F){var Q=x.split(`
`);Q.forEach(function(k,h){var N=i&&C.length+o,v={type:"text",value:"".concat(k,`
`)};if(h===0){var K=r.slice(l+1,c).concat(k6({children:[v],className:R.properties.className})),U=u(K,N);C.push(U)}else if(h===Q.length-1){var V=r[c+1]&&r[c+1].children&&r[c+1].children[0],X={type:"text",value:"".concat(k)};if(V){var _=k6({children:[X],className:R.properties.className});r.splice(c+1,0,_)}else{var q=[X],$=u(q,N,R.properties.className);C.push($)}}else{var nA=[v],j=u(nA,N,R.properties.className);C.push(j)}}),l=c}c++};c<r.length;)d();if(l!==r.length-1){var f=r.slice(l+1,r.length);if(f&&f.length){var w=i&&C.length+o,y=u(f,w);C.push(y)}}return e?C:(I=[]).concat.apply(I,C)}function qai(A){var e=A.rows,t=A.stylesheet,i=A.useInlineStyles;return e.map(function(n,o){return HEe({node:n,stylesheet:t,useInlineStyles:i,key:"code-segment-".concat(o)})})}function VEe(A){return A&&typeof A.highlightAuto<"u"}function jai(A){var e=A.astGenerator,t=A.language,i=A.code,n=A.defaultCodeValue;if(VEe(e)){var o=Kai(e,t);return t==="text"?{value:n,language:"text"}:o?e.highlight(t,i):e.highlightAuto(i)}try{return t&&t!=="text"?{value:e.highlight(i,t)}:{value:n}}catch{return{value:n}}}function Pai(A,e){return function(i){var n,o,g=i.language,a=i.children,s=i.style,I=s===void 0?e:s,r=i.customStyle,C=r===void 0?{}:r,l=i.codeTagProps,c=l===void 0?{className:g?"language-".concat(g):void 0,style:z0(z0({},I['code[class*="language-"]']),I['code[class*="language-'.concat(g,'"]')])}:l,B=i.useInlineStyles,E=B===void 0?!0:B,u=i.showLineNumbers,d=u===void 0?!1:u,f=i.showInlineLineNumbers,w=f===void 0?!0:f,y=i.startingLineNumber,G=y===void 0?1:y,R=i.lineNumberContainerStyle,x=i.lineNumberStyle,F=x===void 0?{}:x,Q=i.wrapLines,k=i.wrapLongLines,h=k===void 0?!1:k,N=i.lineProps,v=N===void 0?{}:N,K=i.renderer,U=i.PreTag,V=U===void 0?"pre":U,X=i.CodeTag,_=X===void 0?"code":X,q=i.code,$=q===void 0?(Array.isArray(a)?a[0]:a)||"":q,nA=i.astGenerator,j=Fai(i,Uai);nA=nA||A;var O=d?b.createElement(Tai,{containerStyle:R,codeStyle:c.style||{},numberStyle:F,startingLineNumber:G,codeString:$}):null,eA=I.hljs||I['pre[class*="language-"]']||{backgroundColor:"#fff"},oA=VEe(nA)?"hljs":"prismjs",tA=E?Object.assign({},j,{style:Object.assign({},eA,C)}):Object.assign({},j,{className:j.className?"".concat(oA," ").concat(j.className):oA,style:Object.assign({},C)});if(h?c.style=z0({whiteSpace:"pre-wrap"},c.style):c.style=z0({whiteSpace:"pre"},c.style),!nA)return b.createElement(V,tA,O,b.createElement(_,c,$));(Q===void 0&&K||h)&&(Q=!0),K=K||qai;var sA=[{type:"text",value:$}],gA=jai({astGenerator:nA,language:g,code:$,defaultCodeValue:sA});gA.language===null&&(gA.value=sA);var iA=(n=(o=$.match(/\n/g))===null||o===void 0?void 0:o.length)!==null&&n!==void 0?n:0,aA=G+iA,lA=Oai(gA,Q,v,d,w,G,aA,F,h);return b.createElement(V,tA,b.createElement(_,c,!w&&O,K({rows:lA,stylesheet:I,useInlineStyles:E})))}}var jw={};function b0A(A){return A instanceof Map?A.clear=A.delete=A.set=function(){throw new Error("map is read-only")}:A instanceof Set&&(A.add=A.clear=A.delete=function(){throw new Error("set is read-only")}),Object.freeze(A),Object.getOwnPropertyNames(A).forEach(function(e){var t=A[e];typeof t=="object"&&!Object.isFrozen(t)&&b0A(t)}),A}var XEe=b0A,$ai=b0A;XEe.default=$ai;let zEe=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function zY(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function T0(A,...e){const t=Object.create(null);for(const i in A)t[i]=A[i];return e.forEach(function(i){for(const n in i)t[n]=i[n]}),t}const Asi="</span>",TEe=A=>!!A.kind;class esi{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=zY(e)}openNode(e){if(!TEe(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){TEe(e)&&(this.buffer+=Asi)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class w0A{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(i=>this._walk(e,i)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{w0A._collapse(t)}))}}class tsi extends w0A{constructor(e){super(),this.options=e}addKeyword(e,t){e!==""&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,t){const i=e.root;i.kind=t,i.sublanguage=!0,this.add(i)}toHTML(){return new esi(this,this.options).value()}finalize(){return!0}}function isi(A){return new RegExp(A.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function RZ(A){return A?typeof A=="string"?A:A.source:null}function nsi(...A){return A.map(t=>RZ(t)).join("")}function osi(...A){return"("+A.map(t=>RZ(t)).join("|")+")"}function gsi(A){return new RegExp(A.toString()+"|").exec("").length-1}function asi(A,e){const t=A&&A.exec(e);return t&&t.index===0}const ssi=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function rsi(A,e="|"){let t=0;return A.map(i=>{t+=1;const n=t;let o=RZ(i),g="";for(;o.length>0;){const a=ssi.exec(o);if(!a){g+=o;break}g+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?g+="\\"+String(Number(a[1])+n):(g+=a[0],a[0]==="("&&t++)}return g}).map(i=>`(${i})`).join(e)}const Isi=/\b\B/,_Ee="[a-zA-Z]\\w*",D0A="[a-zA-Z_]\\w*",G0A="\\b\\d+(\\.\\d+)?",OEe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",qEe="\\b(0b[01]+)",Csi="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",lsi=(A={})=>{const e=/^#![ ]*\//;return A.binary&&(A.begin=nsi(e,/.*\b/,A.binary,/\b.*/)),T0({className:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,i)=>{t.index!==0&&i.ignoreMatch()}},A)},xZ={begin:"\\\\[\\s\\S]",relevance:0},csi={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[xZ]},Bsi={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[xZ]},jEe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},J6=function(A,e,t={}){const i=T0({className:"comment",begin:A,end:e,contains:[]},t);return i.contains.push(jEe),i.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),i},Qsi=J6("//","$"),Esi=J6("/\\*","\\*/"),usi=J6("#","$"),dsi={className:"number",begin:G0A,relevance:0},hsi={className:"number",begin:OEe,relevance:0},msi={className:"number",begin:qEe,relevance:0},psi={className:"number",begin:G0A+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},fsi={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[xZ,{begin:/\[/,end:/\]/,relevance:0,contains:[xZ]}]}]},ysi={className:"title",begin:_Ee,relevance:0},bsi={className:"title",begin:D0A,relevance:0},wsi={begin:"\\.\\s*"+D0A,relevance:0};var N6=Object.freeze({__proto__:null,MATCH_NOTHING_RE:Isi,IDENT_RE:_Ee,UNDERSCORE_IDENT_RE:D0A,NUMBER_RE:G0A,C_NUMBER_RE:OEe,BINARY_NUMBER_RE:qEe,RE_STARTERS_RE:Csi,SHEBANG:lsi,BACKSLASH_ESCAPE:xZ,APOS_STRING_MODE:csi,QUOTE_STRING_MODE:Bsi,PHRASAL_WORDS_MODE:jEe,COMMENT:J6,C_LINE_COMMENT_MODE:Qsi,C_BLOCK_COMMENT_MODE:Esi,HASH_COMMENT_MODE:usi,NUMBER_MODE:dsi,C_NUMBER_MODE:hsi,BINARY_NUMBER_MODE:msi,CSS_NUMBER_MODE:psi,REGEXP_MODE:fsi,TITLE_MODE:ysi,UNDERSCORE_TITLE_MODE:bsi,METHOD_GUARD:wsi,END_SAME_AS_BEGIN:function(A){return Object.assign(A,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function Dsi(A,e){A.input[A.index-1]==="."&&e.ignoreMatch()}function Gsi(A,e){e&&A.beginKeywords&&(A.begin="\\b("+A.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",A.__beforeBegin=Dsi,A.keywords=A.keywords||A.beginKeywords,delete A.beginKeywords,A.relevance===void 0&&(A.relevance=0))}function ksi(A,e){Array.isArray(A.illegal)&&(A.illegal=osi(...A.illegal))}function Jsi(A,e){if(A.match){if(A.begin||A.end)throw new Error("begin & end are not supported with match");A.begin=A.match,delete A.match}}function Nsi(A,e){A.relevance===void 0&&(A.relevance=1)}const Ysi=["of","and","for","in","not","or","if","then","parent","list","value"],Rsi="keyword";function PEe(A,e,t=Rsi){const i={};return typeof A=="string"?n(t,A.split(" ")):Array.isArray(A)?n(t,A):Object.keys(A).forEach(function(o){Object.assign(i,PEe(A[o],e,o))}),i;function n(o,g){e&&(g=g.map(a=>a.toLowerCase())),g.forEach(function(a){const s=a.split("|");i[s[0]]=[o,xsi(s[0],s[1])]})}}function xsi(A,e){return e?Number(e):Fsi(A)?0:1}function Fsi(A){return Ysi.includes(A.toLowerCase())}function Msi(A,{plugins:e}){function t(a,s){return new RegExp(RZ(a),"m"+(A.case_insensitive?"i":"")+(s?"g":""))}class i{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,I){I.position=this.position++,this.matchIndexes[this.matchAt]=I,this.regexes.push([I,s]),this.matchAt+=gsi(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const s=this.regexes.map(I=>I[1]);this.matcherRe=t(rsi(s),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const I=this.matcherRe.exec(s);if(!I)return null;const r=I.findIndex((l,c)=>c>0&&l!==void 0),C=this.matchIndexes[r];return I.splice(0,r),Object.assign(I,C)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];const I=new i;return this.rules.slice(s).forEach(([r,C])=>I.addRule(r,C)),I.compile(),this.multiRegexes[s]=I,I}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,I){this.rules.push([s,I]),I.type==="begin"&&this.count++}exec(s){const I=this.getMatcher(this.regexIndex);I.lastIndex=this.lastIndex;let r=I.exec(s);if(this.resumingScanAtSamePosition()&&!(r&&r.index===this.lastIndex)){const C=this.getMatcher(0);C.lastIndex=this.lastIndex+1,r=C.exec(s)}return r&&(this.regexIndex+=r.position+1,this.regexIndex===this.count&&this.considerAll()),r}}function o(a){const s=new n;return a.contains.forEach(I=>s.addRule(I.begin,{rule:I,type:"begin"})),a.terminatorEnd&&s.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&s.addRule(a.illegal,{type:"illegal"}),s}function g(a,s){const I=a;if(a.isCompiled)return I;[Jsi].forEach(C=>C(a,s)),A.compilerExtensions.forEach(C=>C(a,s)),a.__beforeBegin=null,[Gsi,ksi,Nsi].forEach(C=>C(a,s)),a.isCompiled=!0;let r=null;if(typeof a.keywords=="object"&&(r=a.keywords.$pattern,delete a.keywords.$pattern),a.keywords&&(a.keywords=PEe(a.keywords,A.case_insensitive)),a.lexemes&&r)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return r=r||a.lexemes||/\w+/,I.keywordPatternRe=t(r,!0),s&&(a.begin||(a.begin=/\B|\b/),I.beginRe=t(a.begin),a.endSameAsBegin&&(a.end=a.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(I.endRe=t(a.end)),I.terminatorEnd=RZ(a.end)||"",a.endsWithParent&&s.terminatorEnd&&(I.terminatorEnd+=(a.end?"|":"")+s.terminatorEnd)),a.illegal&&(I.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(C){return vsi(C==="self"?a:C)})),a.contains.forEach(function(C){g(C,I)}),a.starts&&g(a.starts,s),I.matcher=o(I),I}if(A.compilerExtensions||(A.compilerExtensions=[]),A.contains&&A.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return A.classNameAliases=T0(A.classNameAliases||{}),g(A)}function $Ee(A){return A?A.endsWithParent||$Ee(A.starts):!1}function vsi(A){return A.variants&&!A.cachedVariants&&(A.cachedVariants=A.variants.map(function(e){return T0(A,{variants:null},e)})),A.cachedVariants?A.cachedVariants:$Ee(A)?T0(A,{starts:A.starts?T0(A.starts):null}):Object.isFrozen(A)?T0(A):A}var Lsi="10.7.3";function Ssi(A){return Boolean(A||A==="")}function Hsi(A){const e={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!A.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,zY(this.code);let i={};return this.autoDetect?(i=A.highlightAuto(this.code),this.detectedLanguage=i.language):(i=A.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),i.value},autoDetect(){return!this.language||Ssi(this.autodetect)},ignoreIllegals(){return!0}},render(i){return i("pre",{},[i("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:e,VuePlugin:{install(i){i.component("highlightjs",e)}}}}const Zsi={"after:highlightElement":({el:A,result:e,text:t})=>{const i=Aue(A);if(!i.length)return;const n=document.createElement("div");n.innerHTML=e.value,e.value=Wsi(i,Aue(n),t)}};function k0A(A){return A.nodeName.toLowerCase()}function Aue(A){const e=[];return function t(i,n){for(let o=i.firstChild;o;o=o.nextSibling)o.nodeType===3?n+=o.nodeValue.length:o.nodeType===1&&(e.push({event:"start",offset:n,node:o}),n=t(o,n),k0A(o).match(/br|hr|img|input/)||e.push({event:"stop",offset:n,node:o}));return n}(A,0),e}function Wsi(A,e,t){let i=0,n="";const o=[];function g(){return!A.length||!e.length?A.length?A:e:A[0].offset!==e[0].offset?A[0].offset<e[0].offset?A:e:e[0].event==="start"?A:e}function a(r){function C(l){return" "+l.nodeName+'="'+zY(l.value)+'"'}n+="<"+k0A(r)+[].map.call(r.attributes,C).join("")+">"}function s(r){n+="</"+k0A(r)+">"}function I(r){(r.event==="start"?a:s)(r.node)}for(;A.length||e.length;){let r=g();if(n+=zY(t.substring(i,r[0].offset)),i=r[0].offset,r===A){o.reverse().forEach(s);do I(r.splice(0,1)[0]),r=g();while(r===A&&r.length&&r[0].offset===i);o.reverse().forEach(a)}else r[0].event==="start"?o.push(r[0].node):o.pop(),I(r.splice(0,1)[0])}return n+zY(t.substr(i))}const eue={},J0A=A=>{console.error(A)},tue=(A,...e)=>{console.log(`WARN: ${A}`,...e)},Ml=(A,e)=>{eue[`${A}/${e}`]||(console.log(`Deprecated as of ${A}. ${e}`),eue[`${A}/${e}`]=!0)},N0A=zY,iue=T0,nue=Symbol("nomatch");var Ksi=function(A){const e=Object.create(null),t=Object.create(null),i=[];let n=!0;const o=/(^(<[^>]+>|\t|)+|\n)/gm,g="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let s={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:tsi};function I(O){return s.noHighlightRe.test(O)}function r(O){let eA=O.className+" ";eA+=O.parentNode?O.parentNode.className:"";const oA=s.languageDetectRe.exec(eA);if(oA){const tA=U(oA[1]);return tA||(tue(g.replace("{}",oA[1])),tue("Falling back to no-highlight mode for this block.",O)),tA?oA[1]:"no-highlight"}return eA.split(/\s+/).find(tA=>I(tA)||U(tA))}function C(O,eA,oA,tA){let sA="",gA="";typeof eA=="object"?(sA=O,oA=eA.ignoreIllegals,gA=eA.language,tA=void 0):(Ml("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ml("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),gA=O,sA=eA);const iA={code:sA,language:gA};$("before:highlight",iA);const aA=iA.result?iA.result:l(iA.language,iA.code,oA,tA);return aA.code=iA.code,$("after:highlight",aA),aA}function l(O,eA,oA,tA){function sA(VA,ZA){const le=LA.case_insensitive?ZA[0].toLowerCase():ZA[0];return Object.prototype.hasOwnProperty.call(VA.keywords,le)&&VA.keywords[le]}function gA(){if(!SA.keywords){EA.addText(wA);return}let VA=0;SA.keywordPatternRe.lastIndex=0;let ZA=SA.keywordPatternRe.exec(wA),le="";for(;ZA;){le+=wA.substring(VA,ZA.index);const ce=sA(SA,ZA);if(ce){const[de,rt]=ce;if(EA.addText(le),le="",se+=rt,de.startsWith("_"))le+=ZA[0];else{const en=LA.classNameAliases[de]||de;EA.addKeyword(ZA[0],en)}}else le+=ZA[0];VA=SA.keywordPatternRe.lastIndex,ZA=SA.keywordPatternRe.exec(wA)}le+=wA.substr(VA),EA.addText(le)}function iA(){if(wA==="")return;let VA=null;if(typeof SA.subLanguage=="string"){if(!e[SA.subLanguage]){EA.addText(wA);return}VA=l(SA.subLanguage,wA,!0,ae[SA.subLanguage]),ae[SA.subLanguage]=VA.top}else VA=B(wA,SA.subLanguage.length?SA.subLanguage:null);SA.relevance>0&&(se+=VA.relevance),EA.addSublanguage(VA.emitter,VA.language)}function aA(){SA.subLanguage!=null?iA():gA(),wA=""}function lA(VA){return VA.className&&EA.openNode(LA.classNameAliases[VA.className]||VA.className),SA=Object.create(VA,{parent:{value:SA}}),SA}function CA(VA,ZA,le){let ce=asi(VA.endRe,le);if(ce){if(VA["on:end"]){const de=new zEe(VA);VA["on:end"](ZA,de),de.isMatchIgnored&&(ce=!1)}if(ce){for(;VA.endsParent&&VA.parent;)VA=VA.parent;return VA}}if(VA.endsWithParent)return CA(VA.parent,ZA,le)}function QA(VA){return SA.matcher.regexIndex===0?(wA+=VA[0],1):(Oe=!0,0)}function uA(VA){const ZA=VA[0],le=VA.rule,ce=new zEe(le),de=[le.__beforeBegin,le["on:begin"]];for(const rt of de)if(rt&&(rt(VA,ce),ce.isMatchIgnored))return QA(ZA);return le&&le.endSameAsBegin&&(le.endRe=isi(ZA)),le.skip?wA+=ZA:(le.excludeBegin&&(wA+=ZA),aA(),!le.returnBegin&&!le.excludeBegin&&(wA=ZA)),lA(le),le.returnBegin?0:ZA.length}function fA(VA){const ZA=VA[0],le=eA.substr(VA.index),ce=CA(SA,VA,le);if(!ce)return nue;const de=SA;de.skip?wA+=ZA:(de.returnEnd||de.excludeEnd||(wA+=ZA),aA(),de.excludeEnd&&(wA=ZA));do SA.className&&EA.closeNode(),!SA.skip&&!SA.subLanguage&&(se+=SA.relevance),SA=SA.parent;while(SA!==ce.parent);return ce.starts&&(ce.endSameAsBegin&&(ce.starts.endRe=ce.endRe),lA(ce.starts)),de.returnEnd?0:ZA.length}function hA(){const VA=[];for(let ZA=SA;ZA!==LA;ZA=ZA.parent)ZA.className&&VA.unshift(ZA.className);VA.forEach(ZA=>EA.openNode(ZA))}let yA={};function mA(VA,ZA){const le=ZA&&ZA[0];if(wA+=VA,le==null)return aA(),0;if(yA.type==="begin"&&ZA.type==="end"&&yA.index===ZA.index&&le===""){if(wA+=eA.slice(ZA.index,ZA.index+1),!n){const ce=new Error("0 width match regex");throw ce.languageName=O,ce.badRule=yA.rule,ce}return 1}if(yA=ZA,ZA.type==="begin")return uA(ZA);if(ZA.type==="illegal"&&!oA){const ce=new Error('Illegal lexeme "'+le+'" for mode "'+(SA.className||"<unnamed>")+'"');throw ce.mode=SA,ce}else if(ZA.type==="end"){const ce=fA(ZA);if(ce!==nue)return ce}if(ZA.type==="illegal"&&le==="")return 1;if(be>1e5&&be>ZA.index*3)throw new Error("potential infinite loop, way more iterations than matches");return wA+=le,le.length}const LA=U(O);if(!LA)throw J0A(g.replace("{}",O)),new Error('Unknown language: "'+O+'"');const UA=Msi(LA,{plugins:i});let ne="",SA=tA||UA;const ae={},EA=new s.__emitter(s);hA();let wA="",se=0,we=0,be=0,Oe=!1;try{for(SA.matcher.considerAll();;){be++,Oe?Oe=!1:SA.matcher.considerAll(),SA.matcher.lastIndex=we;const VA=SA.matcher.exec(eA);if(!VA)break;const ZA=eA.substring(we,VA.index),le=mA(ZA,VA);we=VA.index+le}return mA(eA.substr(we)),EA.closeAllNodes(),EA.finalize(),ne=EA.toHTML(),{relevance:Math.floor(se),value:ne,language:O,illegal:!1,emitter:EA,top:SA}}catch(VA){if(VA.message&&VA.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:VA.message,context:eA.slice(we-100,we+100),mode:VA.mode},sofar:ne,relevance:0,value:N0A(eA),emitter:EA};if(n)return{illegal:!1,relevance:0,value:N0A(eA),emitter:EA,language:O,top:SA,errorRaised:VA};throw VA}}function c(O){const eA={relevance:0,emitter:new s.__emitter(s),value:N0A(O),illegal:!1,top:a};return eA.emitter.addText(O),eA}function B(O,eA){eA=eA||s.languages||Object.keys(e);const oA=c(O),tA=eA.filter(U).filter(X).map(lA=>l(lA,O,!1));tA.unshift(oA);const sA=tA.sort((lA,CA)=>{if(lA.relevance!==CA.relevance)return CA.relevance-lA.relevance;if(lA.language&&CA.language){if(U(lA.language).supersetOf===CA.language)return 1;if(U(CA.language).supersetOf===lA.language)return-1}return 0}),[gA,iA]=sA,aA=gA;return aA.second_best=iA,aA}function E(O){return s.tabReplace||s.useBR?O.replace(o,eA=>eA===`
`?s.useBR?"<br>":eA:s.tabReplace?eA.replace(/\t/g,s.tabReplace):eA):O}function u(O,eA,oA){const tA=eA?t[eA]:oA;O.classList.add("hljs"),tA&&O.classList.add(tA)}const d={"before:highlightElement":({el:O})=>{s.useBR&&(O.innerHTML=O.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,`
`))},"after:highlightElement":({result:O})=>{s.useBR&&(O.value=O.value.replace(/\n/g,"<br>"))}},f=/^(<[^>]+>|\t)+/gm,w={"after:highlightElement":({result:O})=>{s.tabReplace&&(O.value=O.value.replace(f,eA=>eA.replace(/\t/g,s.tabReplace)))}};function y(O){let eA=null;const oA=r(O);if(I(oA))return;$("before:highlightElement",{el:O,language:oA}),eA=O;const tA=eA.textContent,sA=oA?C(tA,{language:oA,ignoreIllegals:!0}):B(tA);$("after:highlightElement",{el:O,result:sA,text:tA}),O.innerHTML=sA.value,u(O,oA,sA.language),O.result={language:sA.language,re:sA.relevance,relavance:sA.relevance},sA.second_best&&(O.second_best={language:sA.second_best.language,re:sA.second_best.relevance,relavance:sA.second_best.relevance})}function G(O){O.useBR&&(Ml("10.3.0","'useBR' will be removed entirely in v11.0"),Ml("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),s=iue(s,O)}const R=()=>{if(R.called)return;R.called=!0,Ml("10.6.0","initHighlighting() is deprecated.  Use highlightAll() instead."),document.querySelectorAll("pre code").forEach(y)};function x(){Ml("10.6.0","initHighlightingOnLoad() is deprecated.  Use highlightAll() instead."),F=!0}let F=!1;function Q(){if(document.readyState==="loading"){F=!0;return}document.querySelectorAll("pre code").forEach(y)}function k(){F&&Q()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",k,!1);function h(O,eA){let oA=null;try{oA=eA(A)}catch(tA){if(J0A("Language definition for '{}' could not be registered.".replace("{}",O)),n)J0A(tA);else throw tA;oA=a}oA.name||(oA.name=O),e[O]=oA,oA.rawDefinition=eA.bind(null,A),oA.aliases&&V(oA.aliases,{languageName:O})}function N(O){delete e[O];for(const eA of Object.keys(t))t[eA]===O&&delete t[eA]}function v(){return Object.keys(e)}function K(O){Ml("10.4.0","requireLanguage will be removed entirely in v11."),Ml("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const eA=U(O);if(eA)return eA;throw new Error("The '{}' language is required, but not loaded.".replace("{}",O))}function U(O){return O=(O||"").toLowerCase(),e[O]||e[t[O]]}function V(O,{languageName:eA}){typeof O=="string"&&(O=[O]),O.forEach(oA=>{t[oA.toLowerCase()]=eA})}function X(O){const eA=U(O);return eA&&!eA.disableAutodetect}function _(O){O["before:highlightBlock"]&&!O["before:highlightElement"]&&(O["before:highlightElement"]=eA=>{O["before:highlightBlock"](Object.assign({block:eA.el},eA))}),O["after:highlightBlock"]&&!O["after:highlightElement"]&&(O["after:highlightElement"]=eA=>{O["after:highlightBlock"](Object.assign({block:eA.el},eA))})}function q(O){_(O),i.push(O)}function $(O,eA){const oA=O;i.forEach(function(tA){tA[oA]&&tA[oA](eA)})}function nA(O){return Ml("10.2.0","fixMarkup will be removed entirely in v11.0"),Ml("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),E(O)}function j(O){return Ml("10.7.0","highlightBlock will be removed entirely in v12.0"),Ml("10.7.0","Please use highlightElement now."),y(O)}Object.assign(A,{highlight:C,highlightAuto:B,highlightAll:Q,fixMarkup:nA,highlightElement:y,highlightBlock:j,configure:G,initHighlighting:R,initHighlightingOnLoad:x,registerLanguage:h,unregisterLanguage:N,listLanguages:v,getLanguage:U,registerAliases:V,requireLanguage:K,autoDetection:X,inherit:iue,addPlugin:q,vuePlugin:Hsi(A).VuePlugin}),A.debugMode=function(){n=!1},A.safeMode=function(){n=!0},A.versionString=Lsi;for(const O in N6)typeof N6[O]=="object"&&XEe(N6[O]);return Object.assign(A,N6),A.addPlugin(d),A.addPlugin(Zsi),A.addPlugin(w),A}({}),Usi=Ksi,Y0A={},Vsi={get exports(){return Y0A},set exports(A){Y0A=A}};(function(A){(function(){var e;e=A.exports=n,e.format=n,e.vsprintf=i,typeof console<"u"&&typeof console.log=="function"&&(e.printf=t);function t(){console.log(n.apply(null,arguments))}function i(o,g){return n.apply(null,[o].concat(g))}function n(o){for(var g=1,a=[].slice.call(arguments),s=0,I=o.length,r="",C,l=!1,c,B,E=!1,u,d=function(){return a[g++]},f=function(){for(var w="";/\d/.test(o[s]);)w+=o[s++],C=o[s];return w.length>0?parseInt(w):null};s<I;++s)if(C=o[s],l)switch(l=!1,C=="."?(E=!1,C=o[++s]):C=="0"&&o[s+1]=="."?(E=!0,s+=2,C=o[s]):E=!0,u=f(),C){case"b":r+=parseInt(d(),10).toString(2);break;case"c":c=d(),typeof c=="string"||c instanceof String?r+=c:r+=String.fromCharCode(parseInt(c,10));break;case"d":r+=parseInt(d(),10);break;case"f":B=String(parseFloat(d()).toFixed(u||6)),r+=E?B:B.replace(/^0/,"");break;case"j":r+=JSON.stringify(d());break;case"o":r+="0"+parseInt(d(),10).toString(8);break;case"s":r+=d();break;case"x":r+="0x"+parseInt(d(),10).toString(16);break;case"X":r+="0x"+parseInt(d(),10).toString(16).toUpperCase();break;default:r+=C;break}else C==="%"?l=!0:r+=C;return r}})()})(Vsi);var Xsi=Y0A,_0=O0(Error),zsi=_0;_0.eval=O0(EvalError),_0.range=O0(RangeError),_0.reference=O0(ReferenceError),_0.syntax=O0(SyntaxError),_0.type=O0(TypeError),_0.uri=O0(URIError),_0.create=O0;function O0(A){return e.displayName=A.displayName||A.name,e;function e(t){return t&&(t=Xsi.apply(null,arguments)),new A(t)}}var NE=Usi,Y6=zsi;jw.highlight=oue,jw.highlightAuto=_si,jw.registerLanguage=Osi,jw.listLanguages=qsi,jw.registerAlias=jsi,Ch.prototype.addText=Ari,Ch.prototype.addKeyword=Psi,Ch.prototype.addSublanguage=$si,Ch.prototype.openNode=eri,Ch.prototype.closeNode=tri,Ch.prototype.closeAllNodes=gue,Ch.prototype.finalize=gue,Ch.prototype.toHTML=iri;var Tsi="hljs-";function oue(A,e,t){var i=NE.configure({}),n=t||{},o=n.prefix,g;if(typeof A!="string")throw Y6("Expected `string` for name, got `%s`",A);if(!NE.getLanguage(A))throw Y6("Unknown language: `%s` is not registered",A);if(typeof e!="string")throw Y6("Expected `string` for value, got `%s`",e);if(o==null&&(o=Tsi),NE.configure({__emitter:Ch,classPrefix:o}),g=NE.highlight(e,{language:A,ignoreIllegals:!0}),NE.configure(i||{}),g.errorRaised)throw g.errorRaised;return{relevance:g.relevance,language:g.language,value:g.emitter.rootNode.children}}function _si(A,e){var t=e||{},i=t.subset||NE.listLanguages();t.prefix;var n=i.length,o=-1,g,a,s,I;if(typeof A!="string")throw Y6("Expected `string` for value, got `%s`",A);for(a={relevance:0,language:null,value:[]},g={relevance:0,language:null,value:[]};++o<n;)I=i[o],NE.getLanguage(I)&&(s=oue(I,A,e),s.language=I,s.relevance>a.relevance&&(a=s),s.relevance>g.relevance&&(a=g,g=s));return a.language&&(g.secondBest=a),g}function Osi(A,e){NE.registerLanguage(A,e)}function qsi(){return NE.listLanguages()}function jsi(A,e){var t=A,i;e&&(t={},t[A]=e);for(i in t)NE.registerAliases(t[i],{languageName:i})}function Ch(A){this.options=A,this.rootNode={children:[]},this.stack=[this.rootNode]}function Psi(A,e){this.openNode(e),this.addText(A),this.closeNode()}function $si(A,e){var t=this.stack,i=t[t.length-1],n=A.rootNode.children,o=e?{type:"element",tagName:"span",properties:{className:[e]},children:n}:n;i.children=i.children.concat(o)}function Ari(A){var e=this.stack,t,i;A!==""&&(t=e[e.length-1],i=t.children[t.children.length-1],i&&i.type==="text"?i.value+=A:t.children.push({type:"text",value:A}))}function eri(A){var e=this.stack,t=this.options.classPrefix+A,i=e[e.length-1],n={type:"element",tagName:"span",properties:{className:[t]},children:[]};i.children.push(n),e.push(n)}function tri(){this.stack.pop()}function iri(){return""}function gue(){}function nri(A){const e={literal:"true false null"},t=[A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE],i=[A.QUOTE_STRING_MODE,A.C_NUMBER_MODE],n={end:",",endsWithParent:!0,excludeEnd:!0,contains:i,keywords:e},o={begin:/\{/,end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/,contains:[A.BACKSLASH_ESCAPE],illegal:"\\n"},A.inherit(n,{begin:/:/})].concat(t),illegal:"\\S"},g={begin:"\\[",end:"\\]",contains:[A.inherit(n)],illegal:"\\S"};return i.push(o,g),t.forEach(function(a){i.push(a)}),{name:"JSON",contains:i,keywords:e,illegal:"\\S"}}var ori=nri;const gri=ori;function ari(A){return A?typeof A=="string"?A:A.source:null}function sri(A){return rri("(?=",A,")")}function rri(...A){return A.map(t=>ari(t)).join("")}function Iri(A){const o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},g={className:"meta",begin:/^(>>>|\.\.\.) /},a={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},s={begin:/\{\{/,relevance:0},I={className:"string",contains:[A.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[A.BACKSLASH_ESCAPE,g],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[A.BACKSLASH_ESCAPE,g],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[A.BACKSLASH_ESCAPE,g,s,a]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[A.BACKSLASH_ESCAPE,g,s,a]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[A.BACKSLASH_ESCAPE,s,a]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[A.BACKSLASH_ESCAPE,s,a]},A.APOS_STRING_MODE,A.QUOTE_STRING_MODE]},r="[0-9](_?[0-9])*",C=`(\\b(${r}))?\\.(${r})|\\b(${r})\\.`,l={className:"number",relevance:0,variants:[{begin:`(\\b(${r})|(${C}))[eE][+-]?(${r})[jJ]?\\b`},{begin:`(${C})[jJ]?`},{begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${r})[jJ]\\b`}]},c={className:"comment",begin:sri(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},B={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",g,l,I,A.HASH_COMMENT_MODE]}]};return a.contains=[I,l,g],{name:"Python",aliases:["py","gyp","ipython"],keywords:o,illegal:/(<\/|->|\?)|=>/,contains:[g,l,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},I,c,A.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[A.UNDERSCORE_TITLE_MODE,B,{begin:/->/,endsWithParent:!0,keywords:o}]},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[l,B,I]}]}}var Cri=Iri;const lri=Cri;function YE(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function aue(A,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(A,vEe(i.key),i)}}function RE(A,e,t){return e&&aue(A.prototype,e),t&&aue(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A}function q0(A){if(A===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function FZ(A,e){if(e&&(uB(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q0(A)}function xE(A){return xE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xE(A)}function R0A(A,e){return R0A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},R0A(A,e)}function R6(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&R0A(A,e)}var sue=Pai(jw,{});sue.registerLanguage=jw.registerLanguage;const x6=sue,rue={hljs:{display:"block",overflowX:"auto",padding:"0.5em",color:"#383a42",background:"#fafafa"},"hljs-comment":{color:"#a0a1a7",fontStyle:"italic"},"hljs-quote":{color:"#a0a1a7",fontStyle:"italic"},"hljs-doctag":{color:"#a626a4"},"hljs-keyword":{color:"#a626a4"},"hljs-formula":{color:"#a626a4"},"hljs-section":{color:"#e45649"},"hljs-name":{color:"#e45649"},"hljs-selector-tag":{color:"#e45649"},"hljs-deletion":{color:"#e45649"},"hljs-subst":{color:"#e45649"},"hljs-literal":{color:"#0184bb"},"hljs-string":{color:"#50a14f"},"hljs-regexp":{color:"#50a14f"},"hljs-addition":{color:"#50a14f"},"hljs-attribute":{color:"#50a14f"},"hljs-meta-string":{color:"#50a14f"},"hljs-built_in":{color:"#c18401"},"hljs-class .hljs-title":{color:"#c18401"},"hljs-attr":{color:"#986801"},"hljs-variable":{color:"#986801"},"hljs-template-variable":{color:"#986801"},"hljs-type":{color:"#986801"},"hljs-selector-class":{color:"#986801"},"hljs-selector-attr":{color:"#986801"},"hljs-selector-pseudo":{color:"#986801"},"hljs-number":{color:"#986801"},"hljs-symbol":{color:"#4078f2"},"hljs-bullet":{color:"#4078f2"},"hljs-link":{color:"#4078f2",textDecoration:"underline"},"hljs-meta":{color:"#4078f2"},"hljs-selector-id":{color:"#4078f2"},"hljs-title":{color:"#4078f2"},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},Iue={hljs:{display:"block",overflowX:"auto",padding:"0.5em",color:"#abb2bf",background:"#282c34"},"hljs-comment":{color:"#5c6370",fontStyle:"italic"},"hljs-quote":{color:"#5c6370",fontStyle:"italic"},"hljs-doctag":{color:"#c678dd"},"hljs-keyword":{color:"#c678dd"},"hljs-formula":{color:"#c678dd"},"hljs-section":{color:"#e06c75"},"hljs-name":{color:"#e06c75"},"hljs-selector-tag":{color:"#e06c75"},"hljs-deletion":{color:"#e06c75"},"hljs-subst":{color:"#e06c75"},"hljs-literal":{color:"#56b6c2"},"hljs-string":{color:"#98c379"},"hljs-regexp":{color:"#98c379"},"hljs-addition":{color:"#98c379"},"hljs-attribute":{color:"#98c379"},"hljs-meta-string":{color:"#98c379"},"hljs-built_in":{color:"#e6c07b"},"hljs-class .hljs-title":{color:"#e6c07b"},"hljs-attr":{color:"#d19a66"},"hljs-variable":{color:"#d19a66"},"hljs-template-variable":{color:"#d19a66"},"hljs-type":{color:"#d19a66"},"hljs-selector-class":{color:"#d19a66"},"hljs-selector-attr":{color:"#d19a66"},"hljs-selector-pseudo":{color:"#d19a66"},"hljs-number":{color:"#d19a66"},"hljs-symbol":{color:"#61aeee"},"hljs-bullet":{color:"#61aeee"},"hljs-link":{color:"#61aeee",textDecoration:"underline"},"hljs-meta":{color:"#61aeee"},"hljs-selector-id":{color:"#61aeee"},"hljs-title":{color:"#61aeee"},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}};function cri(A){return function(e){let t=e.children;return Object.keys(A).forEach(i=>{const n=A[i];t=IA(n.Provider,{value:e[i],children:t})}),t}}const x0A=p.createContext(null),j0=p.createContext("light"),Bri=cri({portalContainerContext:x0A,darkModeContext:j0});var Qri=Symbol.for("react.lazy"),F6=bf[" use ".trim().toString()];function Eri(A){return typeof A=="object"&&A!==null&&"then"in A}function Cue(A){return A!=null&&typeof A=="object"&&"$$typeof"in A&&A.$$typeof===Qri&&"_payload"in A&&Eri(A._payload)}function lue(A){const e=dri(A),t=p.forwardRef((i,n)=>{let{children:o,...g}=i;Cue(o)&&typeof F6=="function"&&(o=F6(o._payload));const a=p.Children.toArray(o),s=a.find(mri);if(s){const I=s.props.children,r=a.map(C=>C===s?p.Children.count(I)>1?p.Children.only(null):p.isValidElement(I)?I.props.children:null:C);return IA(e,{...g,ref:n,children:p.isValidElement(I)?p.cloneElement(I,void 0,r):null})}return IA(e,{...g,ref:n,children:o})});return t.displayName=`${A}.Slot`,t}var uri=lue("Slot");function dri(A){const e=p.forwardRef((t,i)=>{let{children:n,...o}=t;if(Cue(n)&&typeof F6=="function"&&(n=F6(n._payload)),p.isValidElement(n)){const g=fri(n),a=pri(o,n.props);return n.type!==p.Fragment&&(a.ref=i?bY(i,g):g),p.cloneElement(n,a)}return p.Children.count(n)>1?p.Children.only(null):null});return e.displayName=`${A}.SlotClone`,e}var hri=Symbol("radix.slottable");function mri(A){return p.isValidElement(A)&&typeof A.type=="function"&&"__radixId"in A.type&&A.type.__radixId===hri}function pri(A,e){const t={...e};for(const i in e){const n=A[i],o=e[i];/^on[A-Z]/.test(i)?n&&o?t[i]=(...a)=>{const s=o(...a);return n(...a),s}:n&&(t[i]=n):i==="style"?t[i]={...n,...o}:i==="className"&&(t[i]=[n,o].filter(Boolean).join(" "))}return{...A,...t}}function fri(A){var i,n;let e=(i=Object.getOwnPropertyDescriptor(A.props,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?A.ref:(e=(n=Object.getOwnPropertyDescriptor(A,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?A.props.ref:A.props.ref||A.ref)}const cue=A=>typeof A=="boolean"?`${A}`:A===0?"0":A,Bue=aBe,M6=(A,e)=>t=>{var i;if((e==null?void 0:e.variants)==null)return Bue(A,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:n,defaultVariants:o}=e,g=Object.keys(n).map(I=>{const r=t==null?void 0:t[I],C=o==null?void 0:o[I];if(r===null)return null;const l=cue(r)||cue(C);return n[I][l]}),a=t&&Object.entries(t).reduce((I,r)=>{let[C,l]=r;return l===void 0||(I[C]=l),I},{}),s=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((I,r)=>{let{class:C,className:l,...c}=r;return Object.entries(c).every(B=>{let[E,u]=B;return Array.isArray(u)?u.includes({...o,...a}[E]):{...o,...a}[E]===u})?[...I,C,l]:I},[]);return Bue(A,g,s,t==null?void 0:t.class,t==null?void 0:t.className)},yri=M6("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),lh=p.forwardRef(({className:A,variant:e,size:t,asChild:i=!1,...n},o)=>IA(i?uri:"button",{className:Vn(yri({variant:e,size:t,className:A})),ref:o,...n}));lh.displayName="Button";function bri(A,e=globalThis==null?void 0:globalThis.document){const t=R0(A);p.useEffect(()=>{const i=n=>{n.key==="Escape"&&t(n)};return e.addEventListener("keydown",i,{capture:!0}),()=>e.removeEventListener("keydown",i,{capture:!0})},[t,e])}var wri="DismissableLayer",F0A="dismissableLayer.update",Dri="dismissableLayer.pointerDownOutside",Gri="dismissableLayer.focusOutside",Que,Eue=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),M0A=p.forwardRef((A,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:i,onPointerDownOutside:n,onFocusOutside:o,onInteractOutside:g,onDismiss:a,...s}=A,I=p.useContext(Eue),[r,C]=p.useState(null),l=(r==null?void 0:r.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,c]=p.useState({}),B=Un(e,x=>C(x)),E=Array.from(I.layers),[u]=[...I.layersWithOutsidePointerEventsDisabled].slice(-1),d=E.indexOf(u),f=r?E.indexOf(r):-1,w=I.layersWithOutsidePointerEventsDisabled.size>0,y=f>=d,G=Nri(x=>{const F=x.target,Q=[...I.branches].some(k=>k.contains(F));!y||Q||(n==null||n(x),g==null||g(x),x.defaultPrevented||a==null||a())},l),R=Yri(x=>{const F=x.target;[...I.branches].some(k=>k.contains(F))||(o==null||o(x),g==null||g(x),x.defaultPrevented||a==null||a())},l);return bri(x=>{f===I.layers.size-1&&(i==null||i(x),!x.defaultPrevented&&a&&(x.preventDefault(),a()))},l),p.useEffect(()=>{if(r)return t&&(I.layersWithOutsidePointerEventsDisabled.size===0&&(Que=l.body.style.pointerEvents,l.body.style.pointerEvents="none"),I.layersWithOutsidePointerEventsDisabled.add(r)),I.layers.add(r),uue(),()=>{t&&I.layersWithOutsidePointerEventsDisabled.size===1&&(l.body.style.pointerEvents=Que)}},[r,l,t,I]),p.useEffect(()=>()=>{r&&(I.layers.delete(r),I.layersWithOutsidePointerEventsDisabled.delete(r),uue())},[r,I]),p.useEffect(()=>{const x=()=>c({});return document.addEventListener(F0A,x),()=>document.removeEventListener(F0A,x)},[]),IA(Gt.div,{...s,ref:B,style:{pointerEvents:w?y?"auto":"none":void 0,...A.style},onFocusCapture:Ft(A.onFocusCapture,R.onFocusCapture),onBlurCapture:Ft(A.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Ft(A.onPointerDownCapture,G.onPointerDownCapture)})});M0A.displayName=wri;var kri="DismissableLayerBranch",Jri=p.forwardRef((A,e)=>{const t=p.useContext(Eue),i=p.useRef(null),n=Un(e,i);return p.useEffect(()=>{const o=i.current;if(o)return t.branches.add(o),()=>{t.branches.delete(o)}},[t.branches]),IA(Gt.div,{...A,ref:n})});Jri.displayName=kri;function Nri(A,e=globalThis==null?void 0:globalThis.document){const t=R0(A),i=p.useRef(!1),n=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!i.current){let s=function(){due(Dri,t,I,{discrete:!0})};const I={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",n.current),n.current=s,e.addEventListener("click",n.current,{once:!0})):s()}else e.removeEventListener("click",n.current);i.current=!1},g=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(g),e.removeEventListener("pointerdown",o),e.removeEventListener("click",n.current)}},[e,t]),{onPointerDownCapture:()=>i.current=!0}}function Yri(A,e=globalThis==null?void 0:globalThis.document){const t=R0(A),i=p.useRef(!1);return p.useEffect(()=>{const n=o=>{o.target&&!i.current&&due(Gri,t,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",n),()=>e.removeEventListener("focusin",n)},[e,t]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function uue(){const A=new CustomEvent(F0A);document.dispatchEvent(A)}function due(A,e,t,{discrete:i}){const n=t.originalEvent.target,o=new CustomEvent(A,{bubbles:!1,cancelable:!0,detail:t});e&&n.addEventListener(A,e,{once:!0}),i?uii(n,o):n.dispatchEvent(o)}var v0A="focusScope.autoFocusOnMount",L0A="focusScope.autoFocusOnUnmount",hue={bubbles:!1,cancelable:!0},Rri="FocusScope",S0A=p.forwardRef((A,e)=>{const{loop:t=!1,trapped:i=!1,onMountAutoFocus:n,onUnmountAutoFocus:o,...g}=A,[a,s]=p.useState(null),I=R0(n),r=R0(o),C=p.useRef(null),l=Un(e,E=>s(E)),c=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(i){let E=function(w){if(c.paused||!a)return;const y=w.target;a.contains(y)?C.current=y:P0(C.current,{select:!0})},u=function(w){if(c.paused||!a)return;const y=w.relatedTarget;y!==null&&(a.contains(y)||P0(C.current,{select:!0}))},d=function(w){if(document.activeElement===document.body)for(const G of w)G.removedNodes.length>0&&P0(a)};document.addEventListener("focusin",E),document.addEventListener("focusout",u);const f=new MutationObserver(d);return a&&f.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",u),f.disconnect()}}},[i,a,c.paused]),p.useEffect(()=>{if(a){fue.add(c);const E=document.activeElement;if(!a.contains(E)){const d=new CustomEvent(v0A,hue);a.addEventListener(v0A,I),a.dispatchEvent(d),d.defaultPrevented||(xri(Sri(mue(a)),{select:!0}),document.activeElement===E&&P0(a))}return()=>{a.removeEventListener(v0A,I),setTimeout(()=>{const d=new CustomEvent(L0A,hue);a.addEventListener(L0A,r),a.dispatchEvent(d),d.defaultPrevented||P0(E??document.body,{select:!0}),a.removeEventListener(L0A,r),fue.remove(c)},0)}}},[a,I,r,c]);const B=p.useCallback(E=>{if(!t&&!i||c.paused)return;const u=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,d=document.activeElement;if(u&&d){const f=E.currentTarget,[w,y]=Fri(f);w&&y?!E.shiftKey&&d===y?(E.preventDefault(),t&&P0(w,{select:!0})):E.shiftKey&&d===w&&(E.preventDefault(),t&&P0(y,{select:!0})):d===f&&E.preventDefault()}},[t,i,c.paused]);return IA(Gt.div,{tabIndex:-1,...g,ref:l,onKeyDown:B})});S0A.displayName=Rri;function xri(A,{select:e=!1}={}){const t=document.activeElement;for(const i of A)if(P0(i,{select:e}),document.activeElement!==t)return}function Fri(A){const e=mue(A),t=pue(e,A),i=pue(e.reverse(),A);return[t,i]}function mue(A){const e=[],t=document.createTreeWalker(A,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const n=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||n?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function pue(A,e){for(const t of A)if(!Mri(t,{upTo:e}))return t}function Mri(A,{upTo:e}){if(getComputedStyle(A).visibility==="hidden")return!0;for(;A;){if(e!==void 0&&A===e)return!1;if(getComputedStyle(A).display==="none")return!0;A=A.parentElement}return!1}function vri(A){return A instanceof HTMLInputElement&&"select"in A}function P0(A,{select:e=!1}={}){if(A&&A.focus){const t=document.activeElement;A.focus({preventScroll:!0}),A!==t&&vri(A)&&e&&A.select()}}var fue=Lri();function Lri(){let A=[];return{add(e){const t=A[0];e!==t&&(t==null||t.pause()),A=yue(A,e),A.unshift(e)},remove(e){var t;A=yue(A,e),(t=A[0])==null||t.resume()}}}function yue(A,e){const t=[...A],i=t.indexOf(e);return i!==-1&&t.splice(i,1),t}function Sri(A){return A.filter(e=>e.tagName!=="A")}var Hri="Portal",H0A=p.forwardRef((A,e)=>{var a;const{container:t,...i}=A,[n,o]=p.useState(!1);Ta(()=>o(!0),[]);const g=t||n&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return g?bP.createPortal(IA(Gt.div,{...i,ref:e}),g):null});H0A.displayName=Hri;var Z0A=0;function bue(){p.useEffect(()=>{const A=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",A[0]??wue()),document.body.insertAdjacentElement("beforeend",A[1]??wue()),Z0A++,()=>{Z0A===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Z0A--}},[])}function wue(){const A=document.createElement("span");return A.setAttribute("data-radix-focus-guard",""),A.tabIndex=0,A.style.outline="none",A.style.opacity="0",A.style.position="fixed",A.style.pointerEvents="none",A}var v6="right-scroll-bar-position",L6="width-before-scroll-bar",Zri="with-scroll-bars-hidden",Wri="--removed-body-scroll-bar-size";function W0A(A,e){return typeof A=="function"?A(e):A&&(A.current=e),A}function Kri(A,e){var t=p.useState(function(){return{value:A,callback:e,facade:{get current(){return t.value},set current(i){var n=t.value;n!==i&&(t.value=i,t.callback(i,n))}}}})[0];return t.callback=e,t.facade}var Uri=typeof window<"u"?p.useLayoutEffect:p.useEffect,Due=new WeakMap;function Vri(A,e){var t=Kri(e||null,function(i){return A.forEach(function(n){return W0A(n,i)})});return Uri(function(){var i=Due.get(t);if(i){var n=new Set(i),o=new Set(A),g=t.current;n.forEach(function(a){o.has(a)||W0A(a,null)}),o.forEach(function(a){n.has(a)||W0A(a,g)})}Due.set(t,A)},[A]),t}function Xri(A){return A}function zri(A,e){e===void 0&&(e=Xri);var t=[],i=!1,n={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:A},useMedium:function(o){var g=e(o,i);return t.push(g),function(){t=t.filter(function(a){return a!==g})}},assignSyncMedium:function(o){for(i=!0;t.length;){var g=t;t=[],g.forEach(o)}t={push:function(a){return o(a)},filter:function(){return t}}},assignMedium:function(o){i=!0;var g=[];if(t.length){var a=t;t=[],a.forEach(o),g=t}var s=function(){var r=g;g=[],r.forEach(o)},I=function(){return Promise.resolve().then(s)};I(),t={push:function(r){g.push(r),I()},filter:function(r){return g=g.filter(r),t}}}};return n}function Tri(A){A===void 0&&(A={});var e=zri(null);return e.options=vA({async:!0,ssr:!1},A),e}var Gue=function(A){var e=A.sideCar,t=xj(A,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return p.createElement(i,vA({},t))};Gue.isSideCarExport=!0;function _ri(A,e){return A.useMedium(e),Gue}var kue=Tri(),K0A=function(){},S6=p.forwardRef(function(A,e){var t=p.useRef(null),i=p.useState({onScrollCapture:K0A,onWheelCapture:K0A,onTouchMoveCapture:K0A}),n=i[0],o=i[1],g=A.forwardProps,a=A.children,s=A.className,I=A.removeScrollBar,r=A.enabled,C=A.shards,l=A.sideCar,c=A.noRelative,B=A.noIsolation,E=A.inert,u=A.allowPinchZoom,d=A.as,f=d===void 0?"div":d,w=A.gapMode,y=xj(A,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),G=l,R=Vri([t,e]),x=vA(vA({},y),n);return p.createElement(p.Fragment,null,r&&p.createElement(G,{sideCar:kue,removeScrollBar:I,shards:C,noRelative:c,noIsolation:B,inert:E,setCallbacks:o,allowPinchZoom:!!u,lockRef:t,gapMode:w}),g?p.cloneElement(p.Children.only(a),vA(vA({},x),{ref:R})):p.createElement(f,vA({},x,{className:s,ref:R}),a))});S6.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},S6.classNames={fullWidth:L6,zeroRight:v6};var Jue,Ori=function(){if(Jue)return Jue;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qri(){if(!document)return null;var A=document.createElement("style");A.type="text/css";var e=Ori();return e&&A.setAttribute("nonce",e),A}function jri(A,e){A.styleSheet?A.styleSheet.cssText=e:A.appendChild(document.createTextNode(e))}function Pri(A){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(A)}var $ri=function(){var A=0,e=null;return{add:function(t){A==0&&(e=qri())&&(jri(e,t),Pri(e)),A++},remove:function(){A--,!A&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},AIi=function(){var A=$ri();return function(e,t){p.useEffect(function(){return A.add(e),function(){A.remove()}},[e&&t])}},Nue=function(){var A=AIi(),e=function(t){var i=t.styles,n=t.dynamic;return A(i,n),null};return e},eIi={left:0,top:0,right:0,gap:0},U0A=function(A){return parseInt(A||"",10)||0},tIi=function(A){var e=window.getComputedStyle(document.body),t=e[A==="padding"?"paddingLeft":"marginLeft"],i=e[A==="padding"?"paddingTop":"marginTop"],n=e[A==="padding"?"paddingRight":"marginRight"];return[U0A(t),U0A(i),U0A(n)]},iIi=function(A){if(A===void 0&&(A="margin"),typeof window>"u")return eIi;var e=tIi(A),t=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-t+e[2]-e[0])}},nIi=Nue(),TY="data-scroll-locked",oIi=function(A,e,t,i){var n=A.left,o=A.top,g=A.right,a=A.gap;return t===void 0&&(t="margin"),`
  .`.concat(Zri,` {
   overflow: hidden `).concat(i,`;
   padding-right: `).concat(a,"px ").concat(i,`;
  }
  body[`).concat(TY,`] {
    overflow: hidden `).concat(i,`;
    overscroll-behavior: contain;
    `).concat([e&&"position: relative ".concat(i,";"),t==="margin"&&`
    padding-left: `.concat(n,`px;
    padding-top: `).concat(o,`px;
    padding-right: `).concat(g,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(a,"px ").concat(i,`;
    `),t==="padding"&&"padding-right: ".concat(a,"px ").concat(i,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(v6,` {
    right: `).concat(a,"px ").concat(i,`;
  }
  
  .`).concat(L6,` {
    margin-right: `).concat(a,"px ").concat(i,`;
  }
  
  .`).concat(v6," .").concat(v6,` {
    right: 0 `).concat(i,`;
  }
  
  .`).concat(L6," .").concat(L6,` {
    margin-right: 0 `).concat(i,`;
  }
  
  body[`).concat(TY,`] {
    `).concat(Wri,": ").concat(a,`px;
  }
`)},Yue=function(){var A=parseInt(document.body.getAttribute(TY)||"0",10);return isFinite(A)?A:0},gIi=function(){p.useEffect(function(){return document.body.setAttribute(TY,(Yue()+1).toString()),function(){var A=Yue()-1;A<=0?document.body.removeAttribute(TY):document.body.setAttribute(TY,A.toString())}},[])},aIi=function(A){var e=A.noRelative,t=A.noImportant,i=A.gapMode,n=i===void 0?"margin":i;gIi();var o=p.useMemo(function(){return iIi(n)},[n]);return p.createElement(nIi,{styles:oIi(o,!e,n,t?"":"!important")})},V0A=!1;if(typeof window<"u")try{var H6=Object.defineProperty({},"passive",{get:function(){return V0A=!0,!0}});window.addEventListener("test",H6,H6),window.removeEventListener("test",H6,H6)}catch{V0A=!1}var _Y=V0A?{passive:!1}:!1,sIi=function(A){return A.tagName==="TEXTAREA"},Rue=function(A,e){if(!(A instanceof Element))return!1;var t=window.getComputedStyle(A);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!sIi(A)&&t[e]==="visible")},rIi=function(A){return Rue(A,"overflowY")},IIi=function(A){return Rue(A,"overflowX")},xue=function(A,e){var t=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var n=Fue(A,i);if(n){var o=Mue(A,i),g=o[1],a=o[2];if(g>a)return!0}i=i.parentNode}while(i&&i!==t.body);return!1},CIi=function(A){var e=A.scrollTop,t=A.scrollHeight,i=A.clientHeight;return[e,t,i]},lIi=function(A){var e=A.scrollLeft,t=A.scrollWidth,i=A.clientWidth;return[e,t,i]},Fue=function(A,e){return A==="v"?rIi(e):IIi(e)},Mue=function(A,e){return A==="v"?CIi(e):lIi(e)},cIi=function(A,e){return A==="h"&&e==="rtl"?-1:1},BIi=function(A,e,t,i,n){var o=cIi(A,window.getComputedStyle(e).direction),g=o*i,a=t.target,s=e.contains(a),I=!1,r=g>0,C=0,l=0;do{if(!a)break;var c=Mue(A,a),B=c[0],E=c[1],u=c[2],d=E-u-o*B;(B||d)&&Fue(A,a)&&(C+=d,l+=B);var f=a.parentNode;a=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!s&&a!==document.body||s&&(e.contains(a)||e===a));return(r&&(n&&Math.abs(C)<1||!n&&g>C)||!r&&(n&&Math.abs(l)<1||!n&&-g>l))&&(I=!0),I},Z6=function(A){return"changedTouches"in A?[A.changedTouches[0].clientX,A.changedTouches[0].clientY]:[0,0]},vue=function(A){return[A.deltaX,A.deltaY]},Lue=function(A){return A&&"current"in A?A.current:A},QIi=function(A,e){return A[0]===e[0]&&A[1]===e[1]},EIi=function(A){return`
  .block-interactivity-`.concat(A,` {pointer-events: none;}
  .allow-interactivity-`).concat(A,` {pointer-events: all;}
`)},uIi=0,OY=[];function dIi(A){var e=p.useRef([]),t=p.useRef([0,0]),i=p.useRef(),n=p.useState(uIi++)[0],o=p.useState(Nue)[0],g=p.useRef(A);p.useEffect(function(){g.current=A},[A]),p.useEffect(function(){if(A.inert){document.body.classList.add("block-interactivity-".concat(n));var E=$n([A.lockRef.current],(A.shards||[]).map(Lue),!0).filter(Boolean);return E.forEach(function(u){return u.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),E.forEach(function(u){return u.classList.remove("allow-interactivity-".concat(n))})}}},[A.inert,A.lockRef.current,A.shards]);var a=p.useCallback(function(E,u){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!g.current.allowPinchZoom;var d=Z6(E),f=t.current,w="deltaX"in E?E.deltaX:f[0]-d[0],y="deltaY"in E?E.deltaY:f[1]-d[1],G,R=E.target,x=Math.abs(w)>Math.abs(y)?"h":"v";if("touches"in E&&x==="h"&&R.type==="range")return!1;var F=window.getSelection(),Q=F&&F.anchorNode,k=Q?Q===R||Q.contains(R):!1;if(k)return!1;var h=xue(x,R);if(!h)return!0;if(h?G=x:(G=x==="v"?"h":"v",h=xue(x,R)),!h)return!1;if(!i.current&&"changedTouches"in E&&(w||y)&&(i.current=G),!G)return!0;var N=i.current||G;return BIi(N,u,E,N==="h"?w:y,!0)},[]),s=p.useCallback(function(E){var u=E;if(!(!OY.length||OY[OY.length-1]!==o)){var d="deltaY"in u?vue(u):Z6(u),f=e.current.filter(function(G){return G.name===u.type&&(G.target===u.target||u.target===G.shadowParent)&&QIi(G.delta,d)})[0];if(f&&f.should){u.cancelable&&u.preventDefault();return}if(!f){var w=(g.current.shards||[]).map(Lue).filter(Boolean).filter(function(G){return G.contains(u.target)}),y=w.length>0?a(u,w[0]):!g.current.noIsolation;y&&u.cancelable&&u.preventDefault()}}},[]),I=p.useCallback(function(E,u,d,f){var w={name:E,delta:u,target:d,should:f,shadowParent:hIi(d)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(y){return y!==w})},1)},[]),r=p.useCallback(function(E){t.current=Z6(E),i.current=void 0},[]),C=p.useCallback(function(E){I(E.type,vue(E),E.target,a(E,A.lockRef.current))},[]),l=p.useCallback(function(E){I(E.type,Z6(E),E.target,a(E,A.lockRef.current))},[]);p.useEffect(function(){return OY.push(o),A.setCallbacks({onScrollCapture:C,onWheelCapture:C,onTouchMoveCapture:l}),document.addEventListener("wheel",s,_Y),document.addEventListener("touchmove",s,_Y),document.addEventListener("touchstart",r,_Y),function(){OY=OY.filter(function(E){return E!==o}),document.removeEventListener("wheel",s,_Y),document.removeEventListener("touchmove",s,_Y),document.removeEventListener("touchstart",r,_Y)}},[]);var c=A.removeScrollBar,B=A.inert;return p.createElement(p.Fragment,null,B?p.createElement(o,{styles:EIi(n)}):null,c?p.createElement(aIi,{noRelative:A.noRelative,gapMode:A.gapMode}):null)}function hIi(A){for(var e=null;A!==null;)A instanceof ShadowRoot&&(e=A.host,A=A.host),A=A.parentNode;return e}const mIi=_ri(kue,dIi);var Sue=p.forwardRef(function(A,e){return p.createElement(S6,vA({},A,{ref:e,sideCar:mIi}))});Sue.classNames=S6.classNames;const Hue=Sue;var pIi=function(A){if(typeof document>"u")return null;var e=Array.isArray(A)?A[0]:A;return e.ownerDocument.body},qY=new WeakMap,W6=new WeakMap,K6={},X0A=0,Zue=function(A){return A&&(A.host||Zue(A.parentNode))},fIi=function(A,e){return e.map(function(t){if(A.contains(t))return t;var i=Zue(t);return i&&A.contains(i)?i:(console.error("aria-hidden",t,"in not contained inside",A,". Doing nothing"),null)}).filter(function(t){return Boolean(t)})},yIi=function(A,e,t,i){var n=fIi(e,Array.isArray(A)?A:[A]);K6[t]||(K6[t]=new WeakMap);var o=K6[t],g=[],a=new Set,s=new Set(n),I=function(C){!C||a.has(C)||(a.add(C),I(C.parentNode))};n.forEach(I);var r=function(C){!C||s.has(C)||Array.prototype.forEach.call(C.children,function(l){if(a.has(l))r(l);else try{var c=l.getAttribute(i),B=c!==null&&c!=="false",E=(qY.get(l)||0)+1,u=(o.get(l)||0)+1;qY.set(l,E),o.set(l,u),g.push(l),E===1&&B&&W6.set(l,!0),u===1&&l.setAttribute(t,"true"),B||l.setAttribute(i,"true")}catch(d){console.error("aria-hidden: cannot operate on ",l,d)}})};return r(e),a.clear(),X0A++,function(){g.forEach(function(C){var l=qY.get(C)-1,c=o.get(C)-1;qY.set(C,l),o.set(C,c),l||(W6.has(C)||C.removeAttribute(i),W6.delete(C)),c||C.removeAttribute(t)}),X0A--,X0A||(qY=new WeakMap,qY=new WeakMap,W6=new WeakMap,K6={})}},Wue=function(A,e,t){t===void 0&&(t="data-aria-hidden");var i=Array.from(Array.isArray(A)?A:[A]),n=e||pIi(A);return n?(i.push.apply(i,Array.from(n.querySelectorAll("[aria-live], script"))),yIi(i,n,t,"aria-hidden")):function(){return null}};function bIi(A){const e=wIi(A),t=p.forwardRef((i,n)=>{const{children:o,...g}=i,a=p.Children.toArray(o),s=a.find(GIi);if(s){const I=s.props.children,r=a.map(C=>C===s?p.Children.count(I)>1?p.Children.only(null):p.isValidElement(I)?I.props.children:null:C);return IA(e,{...g,ref:n,children:p.isValidElement(I)?p.cloneElement(I,void 0,r):null})}return IA(e,{...g,ref:n,children:o})});return t.displayName=`${A}.Slot`,t}function wIi(A){const e=p.forwardRef((t,i)=>{const{children:n,...o}=t;if(p.isValidElement(n)){const g=JIi(n),a=kIi(o,n.props);return n.type!==p.Fragment&&(a.ref=i?bY(i,g):g),p.cloneElement(n,a)}return p.Children.count(n)>1?p.Children.only(null):null});return e.displayName=`${A}.SlotClone`,e}var DIi=Symbol("radix.slottable");function GIi(A){return p.isValidElement(A)&&typeof A.type=="function"&&"__radixId"in A.type&&A.type.__radixId===DIi}function kIi(A,e){const t={...e};for(const i in e){const n=A[i],o=e[i];/^on[A-Z]/.test(i)?n&&o?t[i]=(...a)=>{const s=o(...a);return n(...a),s}:n&&(t[i]=n):i==="style"?t[i]={...n,...o}:i==="className"&&(t[i]=[n,o].filter(Boolean).join(" "))}return{...A,...t}}function JIi(A){var i,n;let e=(i=Object.getOwnPropertyDescriptor(A.props,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?A.ref:(e=(n=Object.getOwnPropertyDescriptor(A,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?A.props.ref:A.props.ref||A.ref)}var U6="Dialog",[Kue,ifi]=N0(U6),[NIi,dB]=Kue(U6),Uue=A=>{const{__scopeDialog:e,children:t,open:i,defaultOpen:n,onOpenChange:o,modal:g=!0}=A,a=p.useRef(null),s=p.useRef(null),[I,r]=Ah({prop:i,defaultProp:n??!1,onChange:o,caller:U6});return IA(NIi,{scope:e,triggerRef:a,contentRef:s,contentId:Y0(),titleId:Y0(),descriptionId:Y0(),open:I,onOpenChange:r,onOpenToggle:p.useCallback(()=>r(C=>!C),[r]),modal:g,children:t})};Uue.displayName=U6;var Vue="DialogTrigger",YIi=p.forwardRef((A,e)=>{const{__scopeDialog:t,...i}=A,n=dB(Vue,t),o=Un(e,n.triggerRef);return IA(Gt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":_0A(n.open),...i,ref:o,onClick:Ft(A.onClick,n.onOpenToggle)})});YIi.displayName=Vue;var z0A="DialogPortal",[RIi,Xue]=Kue(z0A,{forceMount:void 0}),zue=A=>{const{__scopeDialog:e,forceMount:t,children:i,container:n}=A,o=dB(z0A,e);return IA(RIi,{scope:e,forceMount:t,children:p.Children.map(i,g=>IA(wY,{present:t||o.open,children:IA(H0A,{asChild:!0,container:n,children:g})}))})};zue.displayName=z0A;var V6="DialogOverlay",Tue=p.forwardRef((A,e)=>{const t=Xue(V6,A.__scopeDialog),{forceMount:i=t.forceMount,...n}=A,o=dB(V6,A.__scopeDialog);return o.modal?IA(wY,{present:i||o.open,children:IA(FIi,{...n,ref:e})}):null});Tue.displayName=V6;var xIi=bIi("DialogOverlay.RemoveScroll"),FIi=p.forwardRef((A,e)=>{const{__scopeDialog:t,...i}=A,n=dB(V6,t);return IA(Hue,{as:xIi,allowPinchZoom:!0,shards:[n.contentRef],children:IA(Gt.div,{"data-state":_0A(n.open),...i,ref:e,style:{pointerEvents:"auto",...i.style}})})}),Pw="DialogContent",_ue=p.forwardRef((A,e)=>{const t=Xue(Pw,A.__scopeDialog),{forceMount:i=t.forceMount,...n}=A,o=dB(Pw,A.__scopeDialog);return IA(wY,{present:i||o.open,children:o.modal?IA(MIi,{...n,ref:e}):IA(vIi,{...n,ref:e})})});_ue.displayName=Pw;var MIi=p.forwardRef((A,e)=>{const t=dB(Pw,A.__scopeDialog),i=p.useRef(null),n=Un(e,t.contentRef,i);return p.useEffect(()=>{const o=i.current;if(o)return Wue(o)},[]),IA(Oue,{...A,ref:n,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ft(A.onCloseAutoFocus,o=>{var g;o.preventDefault(),(g=t.triggerRef.current)==null||g.focus()}),onPointerDownOutside:Ft(A.onPointerDownOutside,o=>{const g=o.detail.originalEvent,a=g.button===0&&g.ctrlKey===!0;(g.button===2||a)&&o.preventDefault()}),onFocusOutside:Ft(A.onFocusOutside,o=>o.preventDefault())})}),vIi=p.forwardRef((A,e)=>{const t=dB(Pw,A.__scopeDialog),i=p.useRef(!1),n=p.useRef(!1);return IA(Oue,{...A,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var g,a;(g=A.onCloseAutoFocus)==null||g.call(A,o),o.defaultPrevented||(i.current||(a=t.triggerRef.current)==null||a.focus(),o.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:o=>{var s,I;(s=A.onInteractOutside)==null||s.call(A,o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const g=o.target;((I=t.triggerRef.current)==null?void 0:I.contains(g))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&n.current&&o.preventDefault()}})}),Oue=p.forwardRef((A,e)=>{const{__scopeDialog:t,trapFocus:i,onOpenAutoFocus:n,onCloseAutoFocus:o,...g}=A,a=dB(Pw,t),s=p.useRef(null),I=Un(e,s);return bue(),PA(ua,{children:[IA(S0A,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:n,onUnmountAutoFocus:o,children:IA(M0A,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":_0A(a.open),...g,ref:I,onDismiss:()=>a.onOpenChange(!1)})}),PA(ua,{children:[IA(LIi,{titleId:a.titleId}),IA(HIi,{contentRef:s,descriptionId:a.descriptionId})]})]})}),T0A="DialogTitle",que=p.forwardRef((A,e)=>{const{__scopeDialog:t,...i}=A,n=dB(T0A,t);return IA(Gt.h2,{id:n.titleId,...i,ref:e})});que.displayName=T0A;var jue="DialogDescription",Pue=p.forwardRef((A,e)=>{const{__scopeDialog:t,...i}=A,n=dB(jue,t);return IA(Gt.p,{id:n.descriptionId,...i,ref:e})});Pue.displayName=jue;var $ue="DialogClose",Ade=p.forwardRef((A,e)=>{const{__scopeDialog:t,...i}=A,n=dB($ue,t);return IA(Gt.button,{type:"button",...i,ref:e,onClick:Ft(A.onClick,()=>n.onOpenChange(!1))})});Ade.displayName=$ue;function _0A(A){return A?"open":"closed"}var ede="DialogTitleWarning",[nfi,tde]=eii(ede,{contentName:Pw,titleName:T0A,docsSlug:"dialog"}),LIi=({titleId:A})=>{const e=tde(ede),t=`\`${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 p.useEffect(()=>{A&&(document.getElementById(A)||console.error(t))},[t,A]),null},SIi="DialogDescriptionWarning",HIi=({contentRef:A,descriptionId:e})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tde(SIi).contentName}}.`;return p.useEffect(()=>{var o;const n=(o=A.current)==null?void 0:o.getAttribute("aria-describedby");e&&n&&(document.getElementById(e)||console.warn(i))},[i,A,e]),null},ZIi=Uue,WIi=zue,ide=Tue,nde=_ue,ode=que,gde=Pue,KIi=Ade;function FE(A,e){if(A==null)return{};var t={},i=Object.keys(A),n,o;for(o=0;o<i.length;o++)n=i[o],!(e.indexOf(n)>=0)&&(t[n]=A[n]);return t}var UIi=["color"],VIi=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=FE(A,UIi);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),XIi=["color"],ade=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=FE(A,XIi);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),zIi=["color"],TIi=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=FE(A,zIi);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),_Ii=["color"],OIi=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=FE(A,_Ii);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),qIi=["color"],jIi=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=FE(A,qIi);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),PIi=["color"],$Ii=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=FE(A,PIi);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),ACi=["color"],eCi=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=FE(A,ACi);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),tCi=["color"],iCi=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=FE(A,tCi);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M1 3.25C1 3.11193 1.11193 3 1.25 3H13.75C13.8881 3 14 3.11193 14 3.25V10.75C14 10.8881 13.8881 11 13.75 11H1.25C1.11193 11 1 10.8881 1 10.75V3.25ZM1.25 2C0.559643 2 0 2.55964 0 3.25V10.75C0 11.4404 0.559644 12 1.25 12H5.07341L4.82991 13.2986C4.76645 13.6371 5.02612 13.95 5.37049 13.95H9.62951C9.97389 13.95 10.2336 13.6371 10.1701 13.2986L9.92659 12H13.75C14.4404 12 15 11.4404 15 10.75V3.25C15 2.55964 14.4404 2 13.75 2H1.25ZM9.01091 12H5.98909L5.79222 13.05H9.20778L9.01091 12Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),nCi=["color"],oCi=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=FE(A,nCi);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M2.89998 0.499976C2.89998 0.279062 2.72089 0.0999756 2.49998 0.0999756C2.27906 0.0999756 2.09998 0.279062 2.09998 0.499976V1.09998H1.49998C1.27906 1.09998 1.09998 1.27906 1.09998 1.49998C1.09998 1.72089 1.27906 1.89998 1.49998 1.89998H2.09998V2.49998C2.09998 2.72089 2.27906 2.89998 2.49998 2.89998C2.72089 2.89998 2.89998 2.72089 2.89998 2.49998V1.89998H3.49998C3.72089 1.89998 3.89998 1.72089 3.89998 1.49998C3.89998 1.27906 3.72089 1.09998 3.49998 1.09998H2.89998V0.499976ZM5.89998 3.49998C5.89998 3.27906 5.72089 3.09998 5.49998 3.09998C5.27906 3.09998 5.09998 3.27906 5.09998 3.49998V4.09998H4.49998C4.27906 4.09998 4.09998 4.27906 4.09998 4.49998C4.09998 4.72089 4.27906 4.89998 4.49998 4.89998H5.09998V5.49998C5.09998 5.72089 5.27906 5.89998 5.49998 5.89998C5.72089 5.89998 5.89998 5.72089 5.89998 5.49998V4.89998H6.49998C6.72089 4.89998 6.89998 4.72089 6.89998 4.49998C6.89998 4.27906 6.72089 4.09998 6.49998 4.09998H5.89998V3.49998ZM1.89998 6.49998C1.89998 6.27906 1.72089 6.09998 1.49998 6.09998C1.27906 6.09998 1.09998 6.27906 1.09998 6.49998V7.09998H0.499976C0.279062 7.09998 0.0999756 7.27906 0.0999756 7.49998C0.0999756 7.72089 0.279062 7.89998 0.499976 7.89998H1.09998V8.49998C1.09998 8.72089 1.27906 8.89997 1.49998 8.89997C1.72089 8.89997 1.89998 8.72089 1.89998 8.49998V7.89998H2.49998C2.72089 7.89998 2.89998 7.72089 2.89998 7.49998C2.89998 7.27906 2.72089 7.09998 2.49998 7.09998H1.89998V6.49998ZM8.54406 0.98184L8.24618 0.941586C8.03275 0.917676 7.90692 1.1655 8.02936 1.34194C8.17013 1.54479 8.29981 1.75592 8.41754 1.97445C8.91878 2.90485 9.20322 3.96932 9.20322 5.10022C9.20322 8.37201 6.82247 11.0878 3.69887 11.6097C3.45736 11.65 3.20988 11.6772 2.96008 11.6906C2.74563 11.702 2.62729 11.9535 2.77721 12.1072C2.84551 12.1773 2.91535 12.2458 2.98667 12.3128L3.05883 12.3795L3.31883 12.6045L3.50684 12.7532L3.62796 12.8433L3.81491 12.9742L3.99079 13.089C4.11175 13.1651 4.23536 13.2375 4.36157 13.3059L4.62496 13.4412L4.88553 13.5607L5.18837 13.6828L5.43169 13.7686C5.56564 13.8128 5.70149 13.8529 5.83857 13.8885C5.94262 13.9155 6.04767 13.9401 6.15405 13.9622C6.27993 13.9883 6.40713 14.0109 6.53544 14.0298L6.85241 14.0685L7.11934 14.0892C7.24637 14.0965 7.37436 14.1002 7.50322 14.1002C11.1483 14.1002 14.1032 11.1453 14.1032 7.50023C14.1032 7.25044 14.0893 7.00389 14.0623 6.76131L14.0255 6.48407C13.991 6.26083 13.9453 6.04129 13.8891 5.82642C13.8213 5.56709 13.7382 5.31398 13.6409 5.06881L13.5279 4.80132L13.4507 4.63542L13.3766 4.48666C13.2178 4.17773 13.0353 3.88295 12.8312 3.60423L12.6782 3.40352L12.4793 3.16432L12.3157 2.98361L12.1961 2.85951L12.0355 2.70246L11.8134 2.50184L11.4925 2.24191L11.2483 2.06498L10.9562 1.87446L10.6346 1.68894L10.3073 1.52378L10.1938 1.47176L9.95488 1.3706L9.67791 1.2669L9.42566 1.1846L9.10075 1.09489L8.83599 1.03486L8.54406 0.98184ZM10.4032 5.30023C10.4032 4.27588 10.2002 3.29829 9.83244 2.40604C11.7623 3.28995 13.1032 5.23862 13.1032 7.50023C13.1032 10.593 10.596 13.1002 7.50322 13.1002C6.63646 13.1002 5.81597 12.9036 5.08355 12.5522C6.5419 12.0941 7.81081 11.2082 8.74322 10.0416C8.87963 10.2284 9.10028 10.3497 9.34928 10.3497C9.76349 10.3497 10.0993 10.0139 10.0993 9.59971C10.0993 9.24256 9.84965 8.94373 9.51535 8.86816C9.57741 8.75165 9.63653 8.63334 9.6926 8.51332C9.88358 8.63163 10.1088 8.69993 10.35 8.69993C11.0403 8.69993 11.6 8.14028 11.6 7.44993C11.6 6.75976 11.0406 6.20024 10.3505 6.19993C10.3853 5.90487 10.4032 5.60464 10.4032 5.30023Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),gCi=["color"],aCi=p.forwardRef(function(A,e){var t=A.color,i=t===void 0?"currentColor":t,n=FE(A,gCi);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:e}),p.createElement("path",{d:"M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))});const X6=ZIi,sCi=WIi,sde=p.forwardRef(({className:A,...e},t)=>IA(ide,{ref:t,className:Vn("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",A),...e}));sde.displayName=ide.displayName;const jY=p.forwardRef(({className:A,children:e,hideClose:t,...i},n)=>PA(sCi,{container:p.useContext(x0A),children:[IA(sde,{}),PA(nde,{ref:n,className:Vn("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",A),...i,children:[e,!t&&PA(KIi,{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:[IA(eCi,{className:"h-4 w-4"}),IA("span",{className:"sr-only",children:"Close"})]})]})]}));jY.displayName=nde.displayName;const MZ=({className:A,...e})=>IA("div",{className:Vn("flex flex-col space-y-1.5 text-center sm:text-left",A),...e});MZ.displayName="DialogHeader";const PY=p.forwardRef(({className:A,...e},t)=>IA(ode,{ref:t,className:Vn("text-lg font-semibold leading-none tracking-tight text-muted-foreground",A),...e}));PY.displayName=ode.displayName;const z6=p.forwardRef(({className:A,...e},t)=>IA(gde,{ref:t,className:Vn("text-sm text-muted-foreground",A),...e}));z6.displayName=gde.displayName;function O0A(A,e,t){e.split&&(e=e.split("."));for(var i=0,n=e.length,o=A,g,a;i<n&&(a=""+e[i++],!(a==="__proto__"||a==="constructor"||a==="prototype"));)o=o[a]=i===n?t:typeof(g=o[a])==typeof e?g:e[i]*0!==0||~(""+e[i]).indexOf(".")?{}:[]}var rCi=function(A,e){return Object.keys(A).filter(function(t){return e(t,A[t])}).reduce(function(t,i){return t[i]=A[i],t},{})},$w=function(A){Nr(e,A);function e(t,i){var n=A.call(this,"".concat(t," ").concat(i))||this;return n.field=t,n}return e}(Error);function $0(A){return typeof A=="string"}function q0A(A){return typeof A=="number"}function $Y(A){return typeof A=="function"}function ICi(A){return A!=null}function Zr(A){return Object.prototype.toString.call(A).slice(8,-1).toLowerCase()==="object"}var j0A="is not a string",P0A="is not an object",CCi="is nil";function lCi(A){if(!ICi(A))throw new $w("Event",CCi);if(typeof A!="object")throw new $w("Event",P0A)}function cCi(A){if(!$0(A.type))throw new $w(".type",j0A)}function BCi(A){if(!$0(A.event))throw new $w(".event",j0A)}function QCi(A){if(!Zr(A.properties))throw new $w(".properties",P0A)}function ECi(A){if(!Zr(A.traits))throw new $w(".traits",P0A)}function uCi(A){if(!$0(A.messageId))throw new $w(".messageId",j0A)}function dCi(A){lCi(A),cCi(A),uCi(A),A.type==="track"&&(BCi(A),QCi(A)),["group","identify"].includes(A.type)&&ECi(A)}var hCi=function(){function A(e){var t,i;this.settings=e,this.createMessageId=e.createMessageId,this.onEventMethodCall=(t=e.onEventMethodCall)!==null&&t!==void 0?t:function(){},this.onFinishedEvent=(i=e.onFinishedEvent)!==null&&i!==void 0?i:function(){}}return A}(),mCi=function(){function A(e){this.settings=new hCi(e)}return A.prototype.track=function(e,t,i,n){return this.settings.onEventMethodCall({type:"track",options:i}),this.normalize(vA(vA({},this.baseEvent()),{event:e,type:"track",properties:t??{},options:vA({},i),integrations:vA({},n)}))},A.prototype.page=function(e,t,i,n,o){var g;this.settings.onEventMethodCall({type:"page",options:n});var a={type:"page",properties:vA({},i),options:vA({},n),integrations:vA({},o)};return e!==null&&(a.category=e,a.properties=(g=a.properties)!==null&&g!==void 0?g:{},a.properties.category=e),t!==null&&(a.name=t),this.normalize(vA(vA({},this.baseEvent()),a))},A.prototype.screen=function(e,t,i,n,o){this.settings.onEventMethodCall({type:"screen",options:n});var g={type:"screen",properties:vA({},i),options:vA({},n),integrations:vA({},o)};return e!==null&&(g.category=e),t!==null&&(g.name=t),this.normalize(vA(vA({},this.baseEvent()),g))},A.prototype.identify=function(e,t,i,n){return this.settings.onEventMethodCall({type:"identify",options:i}),this.normalize(vA(vA({},this.baseEvent()),{type:"identify",userId:e,traits:t??{},options:vA({},i),integrations:n}))},A.prototype.group=function(e,t,i,n){return this.settings.onEventMethodCall({type:"group",options:i}),this.normalize(vA(vA({},this.baseEvent()),{type:"group",traits:t??{},options:vA({},i),integrations:vA({},n),groupId:e}))},A.prototype.alias=function(e,t,i,n){this.settings.onEventMethodCall({type:"alias",options:i});var o={userId:e,type:"alias",options:vA({},i),integrations:vA({},n)};return t!==null&&(o.previousId=t),e===void 0?this.normalize(vA(vA({},o),this.baseEvent())):this.normalize(vA(vA({},this.baseEvent()),o))},A.prototype.baseEvent=function(){return{integrations:{},options:{}}},A.prototype.context=function(e){var t,i=["userId","anonymousId","timestamp","messageId"];delete e.integrations;var n=Object.keys(e),o=(t=e.context)!==null&&t!==void 0?t:{},g={};return n.forEach(function(a){a!=="context"&&(i.includes(a)?O0A(g,a,e[a]):O0A(o,a,e[a]))}),[o,g]},A.prototype.normalize=function(e){var t,i,n=Object.keys((t=e.integrations)!==null&&t!==void 0?t:{}).reduce(function(l,c){var B,E;return vA(vA({},l),(B={},B[c]=Boolean((E=e.integrations)===null||E===void 0?void 0:E[c]),B))},{});e.options=rCi(e.options||{},function(l,c){return c!==void 0});var o=vA(vA({},n),(i=e.options)===null||i===void 0?void 0:i.integrations),g=e.options?this.context(e.options):[],a=g[0],s=g[1],I=e.options,r=xj(e,["options"]),C=vA(vA(vA(vA({timestamp:new Date},r),{context:a,integrations:o}),s),{messageId:I.messageId||this.settings.createMessageId()});return this.settings.onFinishedEvent(C),dCi(C),C},A}();function $0A(A,e){return new Promise(function(t,i){var n=setTimeout(function(){i(Error("Promise timed out"))},e);A.then(function(o){return clearTimeout(n),t(o)}).catch(i)})}function pCi(A){return new Promise(function(e){return setTimeout(e,A)})}function fCi(A,e,t){var i=function(){try{return Promise.resolve(e(A))}catch(n){return Promise.reject(n)}};return pCi(t).then(function(){return $0A(i(),1e3)}).catch(function(n){A==null||A.log("warn","Callback Error",{error:n}),A==null||A.stats.increment("callback_error")}).then(function(){return A})}var AfA=function(){var A,e,t=!1,i=new Promise(function(n,o){A=function(){for(var g=[],a=0;a<arguments.length;a++)g[a]=arguments[a];t=!0,n.apply(void 0,g)},e=function(){for(var g=[],a=0;a<arguments.length;a++)g[a]=arguments[a];t=!0,o.apply(void 0,g)}});return{resolve:A,reject:e,promise:i,isSettled:function(){return t}}},efA=function(){function A(e){var t;this.callbacks={},this.warned=!1,this.maxListeners=(t=e==null?void 0:e.maxListeners)!==null&&t!==void 0?t:10}return A.prototype.warnIfPossibleMemoryLeak=function(e){this.warned||this.maxListeners&&this.callbacks[e].length>this.maxListeners&&(console.warn("Event Emitter: Possible memory leak detected; ".concat(String(e)," has exceeded ").concat(this.maxListeners," listeners.")),this.warned=!0)},A.prototype.on=function(e,t){return this.callbacks[e]?(this.callbacks[e].push(t),this.warnIfPossibleMemoryLeak(e)):this.callbacks[e]=[t],this},A.prototype.once=function(e,t){var i=this,n=function(){for(var o=[],g=0;g<arguments.length;g++)o[g]=arguments[g];i.off(e,n),t.apply(i,o)};return this.on(e,n),this},A.prototype.off=function(e,t){var i,n=(i=this.callbacks[e])!==null&&i!==void 0?i:[],o=n.filter(function(g){return g!==t});return this.callbacks[e]=o,this},A.prototype.emit=function(e){for(var t=this,i,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var g=(i=this.callbacks[e])!==null&&i!==void 0?i:[];return g.forEach(function(a){a.apply(t,n)}),this},A}();function yCi(A){var e=Math.random()+1,t=A.minTimeout,i=t===void 0?500:t,n=A.factor,o=n===void 0?2:n,g=A.attempt,a=A.maxTimeout,s=a===void 0?1/0:a;return Math.min(e*i*Math.pow(o,g),s)}for(var rde="onRemoveFromFuture",T6=function(A){Nr(e,A);function e(t,i,n){var o=A.call(this)||this;return o.future=[],o.maxAttempts=t,o.queue=i,o.seen=n??{},o}return e.prototype.push=function(){for(var t=this,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var o=i.map(function(g){var a=t.updateAttempts(g);return a>t.maxAttempts||t.includes(g)?!1:(t.queue.push(g),!0)});return this.queue=this.queue.sort(function(g,a){return t.getAttempts(g)-t.getAttempts(a)}),o},e.prototype.pushWithBackoff=function(t,i){var n=this;if(i===void 0&&(i=0),i==0&&this.getAttempts(t)===0)return this.push(t)[0];var o=this.updateAttempts(t);if(o>this.maxAttempts||this.includes(t))return!1;var g=yCi({attempt:o-1});return i>0&&g<i&&(g=i),setTimeout(function(){n.queue.push(t),n.future=n.future.filter(function(a){return a.id!==t.id}),n.emit(rde)},g),this.future.push(t),!0},e.prototype.getAttempts=function(t){var i;return(i=this.seen[t.id])!==null&&i!==void 0?i:0},e.prototype.updateAttempts=function(t){return this.seen[t.id]=this.getAttempts(t)+1,this.getAttempts(t)},e.prototype.includes=function(t){return this.queue.includes(t)||this.future.includes(t)||Boolean(this.queue.find(function(i){return i.id===t.id}))||Boolean(this.future.find(function(i){return i.id===t.id}))},e.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(e.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),e}(efA),AD=256,_6=[],O6;AD--;)_6[AD]=(AD+256).toString(16).substring(1);function tfA(){var A=0,e,t="";if(!O6||AD+16>256){for(O6=Array(A=256);A--;)O6[A]=256*Math.random()|0;A=AD=0}for(;A<16;A++)e=O6[AD+A],A==6?t+=_6[e&15|64]:A==8?t+=_6[e&63|128]:t+=_6[e],A&1&&A>1&&A<11&&(t+="-");return AD++,t}var bCi=function(){function A(){this._logs=[]}return A.prototype.log=function(e,t,i){var n=new Date;this._logs.push({level:e,message:t,time:n,extras:i})},Object.defineProperty(A.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),A.prototype.flush=function(){if(this.logs.length>1){var e=this._logs.reduce(function(t,i){var n,o,g,a=vA(vA({},i),{json:JSON.stringify(i.extras,null," "),extras:i.extras});delete a.time;var s=(g=(o=i.time)===null||o===void 0?void 0:o.toISOString())!==null&&g!==void 0?g:"";return t[s]&&(s="".concat(s,"-").concat(Math.random())),vA(vA({},t),(n={},n[s]=a,n))},{});console.table?console.table(e):console.log(e)}else this.logs.forEach(function(t){var i=t.level,n=t.message,o=t.extras;i==="info"||i==="debug"?console.log(n,o??""):console[i](n,o??"")});this._logs=[]},A}(),wCi=function(A){var e={gauge:"g",counter:"c"};return e[A]},Ide=function(){function A(){this.metrics=[]}return A.prototype.increment=function(e,t,i){t===void 0&&(t=1),this.metrics.push({metric:e,value:t,tags:i??[],type:"counter",timestamp:Date.now()})},A.prototype.gauge=function(e,t,i){this.metrics.push({metric:e,value:t,tags:i??[],type:"gauge",timestamp:Date.now()})},A.prototype.flush=function(){var e=this.metrics.map(function(t){return vA(vA({},t),{tags:t.tags.join(",")})});console.table?console.table(e):console.log(e),this.metrics=[]},A.prototype.serialize=function(){return this.metrics.map(function(e){return{m:e.metric,v:e.value,t:e.tags,k:wCi(e.type),e:e.timestamp}})},A}(),DCi=function(A){Nr(e,A);function e(){return A!==null&&A.apply(this,arguments)||this}return e.prototype.gauge=function(){},e.prototype.increment=function(){},e.prototype.flush=function(){},e.prototype.serialize=function(){return[]},e}(Ide),Af=function(){function A(e){var t,i,n;this.retry=(t=e.retry)!==null&&t!==void 0?t:!0,this.type=(i=e.type)!==null&&i!==void 0?i:"plugin Error",this.reason=(n=e.reason)!==null&&n!==void 0?n:""}return A}(),q6=function(){function A(e,t,i,n){t===void 0&&(t=tfA()),i===void 0&&(i=new DCi),n===void 0&&(n=new bCi),this.attempts=0,this.event=e,this._id=t,this.logger=n,this.stats=i}return A.system=function(){},A.prototype.isSame=function(e){return e.id===this.id},A.prototype.cancel=function(e){throw e||new Af({reason:"Context Cancel"})},A.prototype.log=function(e,t,i){this.logger.log(e,t,i)},Object.defineProperty(A.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),A.prototype.updateEvent=function(e,t){var i;if(e.split(".")[0]==="integrations"){var n=e.split(".")[1];if(((i=this.event.integrations)===null||i===void 0?void 0:i[n])===!1)return this.event}return O0A(this.event,e,t),this.event},A.prototype.failedDelivery=function(){return this._failedDelivery},A.prototype.setFailedDelivery=function(e){this._failedDelivery=e},A.prototype.logs=function(){return this.logger.logs},A.prototype.flush=function(){this.logger.flush(),this.stats.flush()},A.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},A}();function GCi(A,e){var t={};return A.forEach(function(i){var n,o=void 0;if(typeof e=="string"){var g=i[e];o=typeof g!="string"?JSON.stringify(g):g}else e instanceof Function&&(o=e(i));o!==void 0&&(t[o]=$n($n([],(n=t[o])!==null&&n!==void 0?n:[],!0),[i],!1))}),t}var kCi=function(A){return typeof A=="object"&&A!==null&&"then"in A&&typeof A.then=="function"},JCi=function(){var A,e,t=0;return{done:function(){return A},run:function(i){var n=i();return kCi(n)&&(++t===1&&(A=new Promise(function(o){return e=o})),n.finally(function(){return--t===0&&e()})),n}}};function NCi(A){return xA(this,void 0,void 0,function(){var e;return ge(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,A()];case 1:return[2,t.sent()];case 2:return e=t.sent(),[2,Promise.reject(e)];case 3:return[2]}})})}function AR(A,e){A.log("debug","plugin",{plugin:e.name});var t=new Date().getTime(),i=e[A.event.type];if(i===void 0)return Promise.resolve(A);var n=NCi(function(){return i.apply(e,[A])}).then(function(o){var g=new Date().getTime()-t;return o.stats.gauge("plugin_time",g,["plugin:".concat(e.name)]),o}).catch(function(o){if(o instanceof Af&&o.type==="middleware_cancellation")throw o;return o instanceof Af?(A.log("warn",o.type,{plugin:e.name,error:o}),o):(A.log("error","plugin Error",{plugin:e.name,error:o}),A.stats.increment("plugin_error",1,["plugin:".concat(e.name)]),o)});return n}function YCi(A,e){return AR(A,e).then(function(t){if(t instanceof q6)return t;A.log("debug","Context canceled"),A.stats.increment("context_canceled"),A.cancel(t)})}var RCi=function(A){Nr(e,A);function e(t){var i=A.call(this)||this;return i.criticalTasks=JCi(),i.plugins=[],i.failedInitializations=[],i.flushing=!1,i.queue=t,i.queue.on(rde,function(){i.scheduleFlush(0)}),i}return e.prototype.register=function(t,i,n){return xA(this,void 0,void 0,function(){var o,g,a=this;return ge(this,function(s){switch(s.label){case 0:return this.plugins.push(i),o=function(I){a.failedInitializations.push(i.name),a.emit("initialization_failure",i),console.warn(i.name,I),t.log("warn","Failed to load destination",{plugin:i.name,error:I}),a.plugins=a.plugins.filter(function(r){return r!==i})},i.type==="destination"&&i.name!=="Segment.io"?(i.load(t,n).catch(o),[3,4]):[3,1];case 1:return s.trys.push([1,3,,4]),[4,i.load(t,n)];case 2:return s.sent(),[3,4];case 3:return g=s.sent(),o(g),[3,4];case 4:return[2]}})})},e.prototype.deregister=function(t,i,n){return xA(this,void 0,void 0,function(){var o;return ge(this,function(g){switch(g.label){case 0:return g.trys.push([0,3,,4]),i.unload?[4,Promise.resolve(i.unload(t,n))]:[3,2];case 1:g.sent(),g.label=2;case 2:return this.plugins=this.plugins.filter(function(a){return a.name!==i.name}),[3,4];case 3:return o=g.sent(),t.log("warn","Failed to unload destination",{plugin:i.name,error:o}),[3,4];case 4:return[2]}})})},e.prototype.dispatch=function(t){return xA(this,void 0,void 0,function(){var i;return ge(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.push(t),i=this.subscribeToDelivery(t),this.scheduleFlush(0),[2,i]})})},e.prototype.subscribeToDelivery=function(t){return xA(this,void 0,void 0,function(){var i=this;return ge(this,function(n){return[2,new Promise(function(o){var g=function(a,s){a.isSame(t)&&(i.off("flush",g),o(a))};i.on("flush",g)})]})})},e.prototype.dispatchSingle=function(t){return xA(this,void 0,void 0,function(){var i=this;return ge(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.updateAttempts(t),t.attempts=1,[2,this.deliver(t).catch(function(o){var g=i.enqueuRetry(o,t);return g?i.subscribeToDelivery(t):(t.setFailedDelivery({reason:o}),t)})]})})},e.prototype.isEmpty=function(){return this.queue.length===0},e.prototype.scheduleFlush=function(t){var i=this;t===void 0&&(t=500),!this.flushing&&(this.flushing=!0,setTimeout(function(){i.flush().then(function(){setTimeout(function(){i.flushing=!1,i.queue.length&&i.scheduleFlush(0)},0)})},t))},e.prototype.deliver=function(t){return xA(this,void 0,void 0,function(){var i,n,o,g;return ge(this,function(a){switch(a.label){case 0:return[4,this.criticalTasks.done()];case 1:a.sent(),i=Date.now(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.flushOne(t)];case 3:return t=a.sent(),n=Date.now()-i,this.emit("delivery_success",t),t.stats.gauge("delivered",n),t.log("debug","Delivered",t.event),[2,t];case 4:throw o=a.sent(),g=o,t.log("error","Failed to deliver",g),this.emit("delivery_failure",t,g),t.stats.increment("delivery_failed"),o;case 5:return[2]}})})},e.prototype.enqueuRetry=function(t,i){var n=!(t instanceof Af)||t.retry;return n?this.queue.pushWithBackoff(i):!1},e.prototype.flush=function(){return xA(this,void 0,void 0,function(){var t,i,n;return ge(this,function(o){switch(o.label){case 0:if(this.queue.length===0)return[2,[]];if(t=this.queue.pop(),!t)return[2,[]];t.attempts=this.queue.getAttempts(t),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.deliver(t)];case 2:return t=o.sent(),this.emit("flush",t,!0),[3,4];case 3:return i=o.sent(),n=this.enqueuRetry(i,t),n||(t.setFailedDelivery({reason:i}),this.emit("flush",t,!1)),[2,[]];case 4:return[2,[t]]}})})},e.prototype.isReady=function(){return!0},e.prototype.availableExtensions=function(t){var i=this.plugins.filter(function(c){var B,E,u;if(c.type!=="destination"&&c.name!=="Segment.io")return!0;var d=void 0;return(B=c.alternativeNames)===null||B===void 0||B.forEach(function(f){t[f]!==void 0&&(d=t[f])}),(u=(E=t[c.name])!==null&&E!==void 0?E:d)!==null&&u!==void 0?u:(c.name==="Segment.io"?!0:t.All)!==!1}),n=GCi(i,"type"),o=n.before,g=o===void 0?[]:o,a=n.enrichment,s=a===void 0?[]:a,I=n.destination,r=I===void 0?[]:I,C=n.after,l=C===void 0?[]:C;return{before:g,enrichment:s,destinations:r,after:l}},e.prototype.flushOne=function(t){var i,n;return xA(this,void 0,void 0,function(){var o,g,a,s,I,r,B,C,l,c,B,E,u,d,f;return ge(this,function(w){switch(w.label){case 0:if(!this.isReady())throw new Error("Not ready");t.attempts>1&&this.emit("delivery_retry",t),o=this.availableExtensions((i=t.event.integrations)!==null&&i!==void 0?i:{}),g=o.before,a=o.enrichment,s=0,I=g,w.label=1;case 1:return s<I.length?(r=I[s],[4,YCi(t,r)]):[3,4];case 2:B=w.sent(),B instanceof q6&&(t=B),this.emit("message_enriched",t,r),w.label=3;case 3:return s++,[3,1];case 4:C=0,l=a,w.label=5;case 5:return C<l.length?(c=l[C],[4,AR(t,c)]):[3,8];case 6:B=w.sent(),B instanceof q6&&(t=B),this.emit("message_enriched",t,c),w.label=7;case 7:return C++,[3,5];case 8:return E=this.availableExtensions((n=t.event.integrations)!==null&&n!==void 0?n:{}),u=E.destinations,d=E.after,[4,new Promise(function(y,G){setTimeout(function(){var R=u.map(function(x){return AR(t,x)});Promise.all(R).then(y).catch(G)},0)})];case 9:return w.sent(),t.stats.increment("message_delivered"),this.emit("message_delivered",t),f=d.map(function(y){return AR(t,y)}),[4,Promise.all(f)];case 10:return w.sent(),[2,t]}})})},e}(efA),xCi=function(A,e){var t=Date.now()-A;return Math.max((e??300)-t,0)};function FCi(A,e,t,i){return xA(this,void 0,void 0,function(){var n,o;return ge(this,function(g){switch(g.label){case 0:return t.emit("dispatch_start",A),n=Date.now(),e.isEmpty()?[4,e.dispatchSingle(A)]:[3,2];case 1:return o=g.sent(),[3,4];case 2:return[4,e.dispatch(A)];case 3:o=g.sent(),g.label=4;case 4:return i!=null&&i.callback?[4,fCi(o,i.callback,xCi(n,i.timeout))]:[3,6];case 5:o=g.sent(),g.label=6;case 6:return i!=null&&i.debug&&o.flush(),[2,o]}})})}function MCi(A,e,t,i){var n,o=[A,e,t,i],g=Zr(A)?A.event:A;if(!g||!$0(g))throw new Error("Event missing");var a=Zr(A)?(n=A.properties)!==null&&n!==void 0?n:{}:Zr(e)?e:{},s={};$Y(t)||(s=t??{}),Zr(A)&&!$Y(e)&&(s=e??{});var I=o.find($Y);return[g,a,s,I]}function Cde(A,e,t,i,n){var o,g,a=null,s=null,I=[A,e,t,i,n],r=I.filter($0);r.length===1?$0(I[1])?(s=I[1],a=null):(s=r[0],a=null):r.length===2&&(typeof I[0]=="string"&&(a=I[0]),typeof I[1]=="string"&&(s=I[1]));var C=I.find($Y),l=I.filter(Zr);return l.length===1?Zr(I[2])?(g={},o=I[2]):Zr(I[3])?(o={},g=I[3]):(o=l[0],g={}):l.length===2&&(o=l[0],g=l[1]),[a,s,o??(o={}),g??(g={}),C]}var lde=function(A){return function(){for(var e,t,i,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];for(var g={},a=["callback","options","traits","id"],s=0,I=n;s<I.length;s++){var r=I[s],C=a.pop();if(C==="id"){if($0(r)||q0A(r)){g.id=r.toString();continue}if(r==null)continue;C=a.pop()}if((C==="traits"||C==="options")&&(r==null||Zr(r))&&(g[C]=r),$Y(r)){g.callback=r;break}}return[(e=g.id)!==null&&e!==void 0?e:A.id(),(t=g.traits)!==null&&t!==void 0?t:{},(i=g.options)!==null&&i!==void 0?i:{},g.callback]}};function vCi(A,e,t,i){q0A(A)&&(A=A.toString()),q0A(e)&&(e=e.toString());var n=[A,e,t,i],o=n.filter($0),g=o[0],a=g===void 0?A:g,s=o[1],I=s===void 0?null:s,r=n.filter(Zr)[0],C=r===void 0?{}:r,l=n.find($Y);return[a,I,C,l]}function ifA(){return typeof window<"u"}function cde(){return!ifA()}function Bde(){return ifA()?window.navigator.onLine:!0}function ef(){return!Bde()}function LCi(A,e){return e=e||{},new Promise(function(t,i){var n=new XMLHttpRequest,o=[],g=[],a={},s=function(){return{ok:(n.status/100|0)==2,statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(n.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:s,headers:{keys:function(){return o},entries:function(){return g},get:function(r){return a[r.toLowerCase()]},has:function(r){return r.toLowerCase()in a}}}};for(var I in n.open(e.method||"get",A,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(r,C,l){o.push(C=C.toLowerCase()),g.push([C,l]),a[C]=a[C]?a[C]+","+l:l}),t(s())},n.onerror=i,n.withCredentials=e.credentials=="include",e.headers)n.setRequestHeader(I,e.headers[I]);n.send(e.body||null)})}var nfA=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:null},j6=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=nfA();return(t&&t.fetch||LCi).apply(void 0,A)},vZ="1.81.1",SCi="npm";function ofA(){return SCi}var Qde="api.segment.io/v1",HCi=function(A,e,t){var i=e.reduce(function(n,o){var g=o.split(":"),a=g[0],s=g[1];return n[a]=s,n},{});return{type:"Counter",metric:A,value:1,tags:vA(vA({},i),{library:"analytics.js",library_version:t==="web"?"next-".concat(vZ):"npm:next-".concat(vZ)})}};function gfA(A){console.error("Error sending segment performance metrics",A)}var ZCi=function(){function A(e){var t=this,i,n,o,g,a;if(this.host=(i=e==null?void 0:e.host)!==null&&i!==void 0?i:Qde,this.sampleRate=(n=e==null?void 0:e.sampleRate)!==null&&n!==void 0?n:1,this.flushTimer=(o=e==null?void 0:e.flushTimer)!==null&&o!==void 0?o:30*1e3,this.maxQueueSize=(g=e==null?void 0:e.maxQueueSize)!==null&&g!==void 0?g:20,this.protocol=(a=e==null?void 0:e.protocol)!==null&&a!==void 0?a:"https",this.queue=[],this.sampleRate>0){var s=!1,I=function(){s||(s=!0,t.flush().catch(gfA),s=!1,setTimeout(I,t.flushTimer))};I()}}return A.prototype.increment=function(e,t){if(e.includes("analytics_js.")&&t.length!==0&&!(Math.random()>this.sampleRate)&&!(this.queue.length>=this.maxQueueSize)){var i=HCi(e,t,ofA());this.queue.push(i),e.includes("error")&&this.flush().catch(gfA)}},A.prototype.flush=function(){return xA(this,void 0,void 0,function(){var e=this;return ge(this,function(t){switch(t.label){case 0:return this.queue.length<=0?[2]:[4,this.send().catch(function(i){gfA(i),e.sampleRate=0})];case 1:return t.sent(),[2]}})})},A.prototype.send=function(){return xA(this,void 0,void 0,function(){var e,t,i;return ge(this,function(n){return e={series:this.queue},this.queue=[],t={"Content-Type":"text/plain"},i="".concat(this.protocol,"://").concat(this.host,"/m"),[2,j6(i,{headers:t,body:JSON.stringify(e),method:"POST"})]})})},A}(),P6,Ede=function(A){Nr(e,A);function e(){return A!==null&&A.apply(this,arguments)||this}return e.initRemoteMetrics=function(t){P6=new ZCi(t)},e.prototype.increment=function(t,i,n){A.prototype.increment.call(this,t,i,n),P6==null||P6.increment(t,n??[])},e}(Ide),ME=function(A){Nr(e,A);function e(t,i){return A.call(this,t,i,new Ede)||this}return e.system=function(){return new this({type:"track",event:"system"})},e}(q6);function WCi(A){return Object.prototype.toString.call(A).slice(8,-1).toLowerCase()==="object"}var ude="bpc",dde=function(A,e,t,i,n,o){return{__t:ude,c:e,p:i,u:A,s:t,t:n,r:o}},KCi=Object.keys(dde("","","","","",""));function UCi(A){if(!WCi(A)||A.__t!==ude)return!1;for(var e in A)if(!KCi.includes(e))return!1;return!0}var VCi=function(A,e){return A.indexOf("?")>-1?A:A+e},XCi=function(A){var e=A.indexOf("#");return e===-1?A:A.slice(0,e)},zCi=function(A){try{return new URL(A).pathname}catch{return A[0]==="/"?A:"/"+A}},hde=function(A){var e=A.c,t=A.p,i=A.s,n=A.u,o=A.r,g=A.t,a=e?zCi(e):t,s=e?VCi(e,i):XCi(n);return{path:a,referrer:o,search:i,title:g,url:s}},mde=function(){var A=document.querySelector("link[rel='canonical']");return dde(location.href,A&&A.getAttribute("href")||void 0,location.search,location.pathname,document.title,document.referrer)},TCi=function(){return hde(mde())};function _Ci(A,e){return Object.assign.apply(Object,$n([{}],e.map(function(t){var i;if(A&&Object.prototype.hasOwnProperty.call(A,t))return i={},i[t]=A[t],i}),!1))}var eR=function(A,e){e===void 0&&(e=TCi());var t=A.context,i;A.type==="page"&&(i=A.properties&&_Ci(A.properties,Object.keys(e)),A.properties=vA(vA(vA({},e),A.properties),A.name?{name:A.name}:{})),t.page=vA(vA(vA({},e),i),t.page)},OCi=function(A){Nr(e,A);function e(t){var i=A.call(this,{createMessageId:function(){return"ajs-next-".concat(Date.now(),"-").concat(tfA())},onEventMethodCall:function(n){var o=n.options;i.maybeUpdateAnonId(o)},onFinishedEvent:function(n){return i.addIdentity(n),n}})||this;return i.user=t,i}return e.prototype.maybeUpdateAnonId=function(t){t!=null&&t.anonymousId&&this.user.anonymousId(t.anonymousId)},e.prototype.addIdentity=function(t){this.user.id()&&(t.userId=this.user.id()),this.user.anonymousId()&&(t.anonymousId=this.user.anonymousId())},e.prototype.track=function(t,i,n,o,g){var a=A.prototype.track.call(this,t,i,n,o);return eR(a,g),a},e.prototype.page=function(t,i,n,o,g,a){var s=A.prototype.page.call(this,t,i,n,o,g);return eR(s,a),s},e.prototype.screen=function(t,i,n,o,g,a){var s=A.prototype.screen.call(this,t,i,n,o,g);return eR(s,a),s},e.prototype.identify=function(t,i,n,o,g){var a=A.prototype.identify.call(this,t,i,n,o);return eR(a,g),a},e.prototype.group=function(t,i,n,o,g){var a=A.prototype.group.call(this,t,i,n,o);return eR(a,g),a},e.prototype.alias=function(t,i,n,o,g){var a=A.prototype.alias.call(this,t,i,n,o);return eR(a,g),a},e}(mCi),qCi=function(A){return"addMiddleware"in A&&A.type==="destination"},vE={getItem:function(){},setItem:function(){},removeItem:function(){}};try{vE=ifA()&&window.localStorage?window.localStorage:vE}catch(A){console.warn("Unable to access localStorage",A)}function pde(A){var e=vE.getItem(A);return(e?JSON.parse(e):[]).map(function(t){return new ME(t.event,t.id)})}function jCi(A,e){var t=pde(A),i=$n($n([],e,!0),t,!0),n=i.reduce(function(o,g){var a;return vA(vA({},o),(a={},a[g.id]=g,a))},{});vE.setItem(A,JSON.stringify(Object.values(n)))}function fde(A){var e=vE.getItem(A);return e?JSON.parse(e):{}}function PCi(A,e){var t=fde(A);vE.setItem(A,JSON.stringify(vA(vA({},t),e)))}function yde(A){vE.removeItem(A)}var $Ci=function(){return new Date().getTime()};function afA(A,e,t){t===void 0&&(t=0);var i=50,n="persisted-queue:v1:".concat(A,":lock"),o=function(I){return new Date().getTime()>I},g=vE.getItem(n),a=g?JSON.parse(g):null,s=a===null||o(a);if(s){vE.setItem(n,JSON.stringify($Ci()+i)),e(),vE.removeItem(n);return}!s&&t<3?setTimeout(function(){afA(A,e,t+1)},i):console.error("Unable to retrieve lock")}var $6=function(A){Nr(e,A);function e(t,i){var n=A.call(this,t,[])||this,o="persisted-queue:v1:".concat(i,":items"),g="persisted-queue:v1:".concat(i,":seen"),a=[],s={};return afA(i,function(){try{a=pde(o),s=fde(g),yde(o),yde(g),n.queue=$n($n([],a,!0),n.queue,!0),n.seen=vA(vA({},s),n.seen)}catch(I){console.error(I)}}),window.addEventListener("pagehide",function(){if(n.todo>0){var I=$n($n([],n.queue,!0),n.future,!0);try{afA(i,function(){jCi(o,I),PCi(g,n.seen)})}catch(r){console.error(r)}}}),n}return e}(T6),Ali=function(A){Nr(e,A);function e(t){return A.call(this,typeof t=="string"?new $6(4,t):t)||this}return e.prototype.flush=function(){return xA(this,void 0,void 0,function(){return ge(this,function(t){return ef()?[2,[]]:[2,A.prototype.flush.call(this)]})})},e}(RCi);function sfA(A){for(var e=A.constructor.prototype,t=0,i=Object.getOwnPropertyNames(e);t<i.length;t++){var n=i[t];if(n!=="constructor"){var o=Object.getOwnPropertyDescriptor(A.constructor.prototype,n);o&&typeof o.value=="function"&&(A[n]=A[n].bind(A))}}return A}/*! js-cookie v3.0.1 | MIT */function A8(A){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)A[i]=t[i]}return A}var eli={read:function(A){return A[0]==='"'&&(A=A.slice(1,-1)),A.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(A){return encodeURIComponent(A).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function rfA(A,e){function t(n,o,g){if(!(typeof document>"u")){g=A8({},e,g),typeof g.expires=="number"&&(g.expires=new Date(Date.now()+g.expires*864e5)),g.expires&&(g.expires=g.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var s in g)g[s]&&(a+="; "+s,g[s]!==!0&&(a+="="+g[s].split(";")[0]));return document.cookie=n+"="+A.write(o,n)+a}}function i(n){if(!(typeof document>"u"||arguments.length&&!n)){for(var o=document.cookie?document.cookie.split("; "):[],g={},a=0;a<o.length;a++){var s=o[a].split("="),I=s.slice(1).join("=");try{var r=decodeURIComponent(s[0]);if(g[r]=A.read(I,r),n===r)break}catch{}}return n?g[n]:g}}return Object.create({set:t,get:i,remove:function(n,o){t(n,"",A8({},o,{expires:-1}))},withAttributes:function(n){return rfA(this.converter,A8({},this.attributes,n))},withConverter:function(n){return rfA(A8({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(A)}})}var ch=rfA(eli,{path:"/"});function tli(A){var e=A.hostname,t=e.split("."),i=t[t.length-1],n=[];if(t.length===4&&parseInt(i,10)>0||t.length<=1)return n;for(var o=t.length-2;o>=0;--o)n.push(t.slice(o).join("."));return n}function ili(A){try{return new URL(A)}catch{return}}function bde(A){var e=ili(A);if(e)for(var t=tli(e),i=0;i<t.length;++i){var n="__tld__",o=t[i],g={domain:"."+o};try{if(ch.set(n,"1",g),ch.get(n))return ch.remove(n,g),o}catch{return}}}var nli=365,wde=function(){function A(e){e===void 0&&(e=A.defaults),this.options=vA(vA({},A.defaults),e)}return Object.defineProperty(A,"defaults",{get:function(){return{maxage:nli,domain:bde(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),A.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},A.prototype.get=function(e){var t;try{var i=ch.get(e);if(i==null)return null;try{return(t=JSON.parse(i))!==null&&t!==void 0?t:null}catch{return i??null}}catch{return null}},A.prototype.set=function(e,t){typeof t=="string"?ch.set(e,t,this.opts()):t===null?ch.remove(e,this.opts()):ch.set(e,JSON.stringify(t),this.opts())},A.prototype.remove=function(e){return ch.remove(e,this.opts())},A}(),oli=function(){function A(){}return A.prototype.localStorageWarning=function(e,t){console.warn("Unable to access ".concat(e,", localStorage may be ").concat(t))},A.prototype.get=function(e){var t;try{var i=localStorage.getItem(e);if(i===null)return null;try{return(t=JSON.parse(i))!==null&&t!==void 0?t:null}catch{return i??null}}catch{return this.localStorageWarning(e,"unavailable"),null}},A.prototype.set=function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{this.localStorageWarning(e,"full")}},A.prototype.remove=function(e){try{return localStorage.removeItem(e)}catch{this.localStorageWarning(e,"unavailable")}},A}(),IfA=function(){function A(){this.cache={}}return A.prototype.get=function(e){var t;return(t=this.cache[e])!==null&&t!==void 0?t:null},A.prototype.set=function(e,t){this.cache[e]=t},A.prototype.remove=function(e){delete this.cache[e]},A}(),Wr={Cookie:"cookie",LocalStorage:"localStorage",Memory:"memory"};function Dde(A){return A&&A.stores&&Array.isArray(A.stores)&&A.stores.every(function(e){return Object.values(Wr).includes(e)})}function gli(A){return typeof A=="object"&&A.name!==void 0}var CfA=function(A,e,t,i){console.warn("".concat(A.constructor.name,": Can't ").concat(e,' key "').concat(t,'" | Err: ').concat(i))},eD=function(){function A(e){this.stores=e}return A.prototype.get=function(e){for(var t=null,i=0,n=this.stores;i<n.length;i++){var o=n[i];try{if(t=o.get(e),t!=null)return t}catch(g){CfA(o,"get",e,g)}}return null},A.prototype.set=function(e,t){this.stores.forEach(function(i){try{i.set(e,t)}catch(n){CfA(i,"set",e,n)}})},A.prototype.clear=function(e){this.stores.forEach(function(t){try{t.remove(e)}catch(i){CfA(t,"remove",e,i)}})},A.prototype.getAndSync=function(e){var t=this.get(e),i=typeof t=="number"?t.toString():t;return this.set(e,i),i},A}();function lfA(A){var e=A.map(function(t){var i,n;switch(gli(t)?(i=t.name,n=t.settings):i=t,i){case Wr.Cookie:return new wde(n);case Wr.LocalStorage:return new oli;case Wr.Memory:return new IfA;default:throw new Error("Unknown Store Type: ".concat(t))}});return e}function Gde(A,e){return A.map(function(t){return e&&t===Wr.Cookie?{name:t,settings:e}:t})}var tD={persist:!0,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}},kde=function(){function A(e,t){e===void 0&&(e=tD);var i=this,n,o,g,a;this.options={},this.id=function(I){if(i.options.disable)return null;var r=i.identityStore.getAndSync(i.idKey);if(I!==void 0){i.identityStore.set(i.idKey,I);var C=I!==r&&r!==null&&I!==null;C&&i.anonymousId(null)}var l=i.identityStore.getAndSync(i.idKey);if(l)return l;var c=i.legacyUserStore.get(tD.cookie.oldKey);return c?typeof c=="object"?c.id:c:null},this.anonymousId=function(I){var r,C;if(i.options.disable)return null;if(I===void 0){var l=(r=i.identityStore.getAndSync(i.anonKey))!==null&&r!==void 0?r:(C=i.legacySIO())===null||C===void 0?void 0:C[0];if(l)return l}return I===null?(i.identityStore.set(i.anonKey,null),i.identityStore.getAndSync(i.anonKey)):(i.identityStore.set(i.anonKey,I??tfA()),i.identityStore.getAndSync(i.anonKey))},this.traits=function(I){var r;if(!i.options.disable)return I===null&&(I={}),I&&i.traitsStore.set(i.traitsKey,I??{}),(r=i.traitsStore.get(i.traitsKey))!==null&&r!==void 0?r:{}},this.options=vA(vA({},tD),e),this.cookieOptions=t,this.idKey=(o=(n=e.cookie)===null||n===void 0?void 0:n.key)!==null&&o!==void 0?o:tD.cookie.key,this.traitsKey=(a=(g=e.localStorage)===null||g===void 0?void 0:g.key)!==null&&a!==void 0?a:tD.localStorage.key,this.anonKey="ajs_anonymous_id",this.identityStore=this.createStorage(this.options,t),this.legacyUserStore=this.createStorage(this.options,t,function(I){return I===Wr.Cookie}),this.traitsStore=this.createStorage(this.options,t,function(I){return I!==Wr.Cookie});var s=this.legacyUserStore.get(tD.cookie.oldKey);s&&typeof s=="object"&&(s.id&&this.id(s.id),s.traits&&this.traits(s.traits)),sfA(this)}return A.prototype.legacySIO=function(){var e=this.legacyUserStore.get("_sio");if(!e)return null;var t=e.split("----"),i=t[0],n=t[1];return[i,n]},A.prototype.identify=function(e,t){if(!this.options.disable){t=t??{};var i=this.id();(i===null||i===e)&&(t=vA(vA({},this.traits()),t)),e&&this.id(e),this.traits(t)}},A.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},A.prototype.reset=function(){this.logout(),this.identityStore.clear(this.idKey),this.identityStore.clear(this.anonKey),this.traitsStore.clear(this.traitsKey)},A.prototype.load=function(){return new A(this.options,this.cookieOptions)},A.prototype.save=function(){return!0},A.prototype.createStorage=function(e,t,i){var n=[Wr.LocalStorage,Wr.Cookie,Wr.Memory];return e.disable?new eD([]):e.persist?(e.storage!==void 0&&e.storage!==null&&Dde(e.storage)&&(n=e.storage.stores),e.localStorageFallbackDisabled&&(n=n.filter(function(o){return o!==Wr.LocalStorage})),i&&(n=n.filter(i)),new eD(lfA(Gde(n,t)))):new eD([new IfA])},A.defaults=tD,A}(),Jde={persist:!0,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}},ali=function(A){Nr(e,A);function e(t,i){t===void 0&&(t=Jde);var n=A.call(this,vA(vA({},Jde),t),i)||this;return n.anonymousId=function(o){},sfA(n),n}return e}(kde),cfA="analytics";function BfA(){return window[cfA]}function sli(A){cfA=A}function rli(A){window[cfA]=A}var Ili=function(A){return typeof A=="object"&&A!==null&&"then"in A&&typeof A.then=="function"},Nde=function(A,e,t){t.getAndRemove(A).forEach(function(i){t8(e,i).catch(console.error)})},Cli=function(A,e){return xA(void 0,void 0,void 0,function(){var t,i,n;return ge(this,function(o){switch(o.label){case 0:t=0,i=e.getAndRemove("addSourceMiddleware"),o.label=1;case 1:return t<i.length?(n=i[t],[4,t8(A,n).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},lli=function(A,e){return xA(void 0,void 0,void 0,function(){var t,i,n;return ge(this,function(o){switch(o.label){case 0:t=0,i=e.getAndRemove("register"),o.label=1;case 1:return t<i.length?(n=i[t],[4,t8(A,n).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},cli=Nde.bind(globalThis,"on"),Bli=Nde.bind(globalThis,"setAnonymousId"),Qli=function(A,e){Object.keys(e.calls).forEach(function(t){e.getAndRemove(t).forEach(function(i){setTimeout(function(){t8(A,i).catch(console.error)},0)})})},tR=function(A){if(Yde(A)){var e=A.pop();return hde(e)}},Yde=function(A){var e=A[A.length-1];return UCi(e)},e8=function(){function A(e,t,i,n){i===void 0&&(i=function(){}),n===void 0&&(n=console.error),this.method=e,this.resolve=i,this.reject=n,this.called=!1,this.args=t}return A}(),Eli=function(){function A(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._callMap={},this.add.apply(this,e)}return Object.defineProperty(A.prototype,"calls",{get:function(){return this._pushSnippetWindowBuffer(),this._callMap},set:function(e){this._callMap=e},enumerable:!1,configurable:!0}),A.prototype.get=function(e){var t;return(t=this.calls[e])!==null&&t!==void 0?t:[]},A.prototype.getAndRemove=function(e){var t=this.get(e);return this.calls[e]=[],t},A.prototype.add=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];t.forEach(function(n){var o=["track","screen","alias","group","page","identify"];o.includes(n.method)&&!Yde(n.args)&&(n.args=$n($n([],n.args,!0),[mde()],!1)),e.calls[n.method]?e.calls[n.method].push(n):e.calls[n.method]=[n]})},A.prototype.clear=function(){this._pushSnippetWindowBuffer(),this.calls={}},A.prototype.toArray=function(){var e;return(e=[]).concat.apply(e,Object.values(this.calls))},A.prototype._pushSnippetWindowBuffer=function(){if(ofA()!=="npm"){var e=BfA();if(Array.isArray(e)){var t=e.splice(0,e.length),i=t.map(function(n){var o=n[0],g=n.slice(1);return new e8(o,g)});this.add.apply(this,i)}}},A}();function t8(A,e){return xA(this,void 0,void 0,function(){var t,i;return ge(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),e.called?[2,void 0]:(e.called=!0,t=A[e.method].apply(A,e.args),Ili(t)?[4,t]:[3,2]);case 1:n.sent(),n.label=2;case 2:return e.resolve(t),[3,4];case 3:return i=n.sent(),e.reject(i),[3,4];case 4:return[2]}})})}var uli=function(){function A(e){var t=this;this.trackSubmit=this._createMethod("trackSubmit"),this.trackClick=this._createMethod("trackClick"),this.trackLink=this._createMethod("trackLink"),this.pageView=this._createMethod("pageview"),this.identify=this._createMethod("identify"),this.reset=this._createMethod("reset"),this.group=this._createMethod("group"),this.track=this._createMethod("track"),this.ready=this._createMethod("ready"),this.alias=this._createMethod("alias"),this.debug=this._createChainableMethod("debug"),this.page=this._createMethod("page"),this.once=this._createChainableMethod("once"),this.off=this._createChainableMethod("off"),this.on=this._createChainableMethod("on"),this.addSourceMiddleware=this._createMethod("addSourceMiddleware"),this.setAnonymousId=this._createMethod("setAnonymousId"),this.addDestinationMiddleware=this._createMethod("addDestinationMiddleware"),this.screen=this._createMethod("screen"),this.register=this._createMethod("register"),this.deregister=this._createMethod("deregister"),this.user=this._createMethod("user"),this.VERSION=vZ,this._preInitBuffer=new Eli,this._promise=e(this._preInitBuffer),this._promise.then(function(i){var n=i[0],o=i[1];t.instance=n,t.ctx=o}).catch(function(){})}return A.prototype.then=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return(e=this._promise).then.apply(e,t)},A.prototype.catch=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return(e=this._promise).catch.apply(e,t)},A.prototype.finally=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return(e=this._promise).finally.apply(e,t)},A.prototype._createMethod=function(e){var t=this;return function(){for(var i,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(t.instance){var g=(i=t.instance)[e].apply(i,n);return Promise.resolve(g)}return new Promise(function(a,s){t._preInitBuffer.add(new e8(e,n,a,s))})}},A.prototype._createChainableMethod=function(e){var t=this;return function(){for(var i,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return t.instance?((i=t.instance)[e].apply(i,n),t):(t._preInitBuffer.add(new e8(e,n)),t)}},A}(),eC={},LE={},QfA={},iR={},dli={get exports(){return iR},set exports(A){iR=A}};(function(A){A.exports=e(t),A.exports.find=A.exports,A.exports.replace=function(a,s,I,r){return e(n).call(this,a,s,I,r),a},A.exports.del=function(a,s,I){return e(i).call(this,a,s,null,I),a};function e(a){return function(s,I,r,C){var l=C&&g(C.normalizer)?C.normalizer:o;I=l(I);for(var c,B=!1;!B;)E();function E(){for(c in s){var u=l(c);if(I.indexOf(u)===0){var d=I.substr(u.length);if(d.charAt(0)==="."||d.length===0){I=d.substr(1);var f=s[c];if(f==null){B=!0;return}if(!I.length){B=!0;return}s=f;return}}}c=void 0,B=!0}if(c)return s==null?s:a(s,c,r)}}function t(a,s){if(a.hasOwnProperty(s))return a[s]}function i(a,s){return a.hasOwnProperty(s)&&delete a[s],a}function n(a,s,I){return a.hasOwnProperty(s)&&(a[s]=I),a}function o(a){return a.replace(/[^a-zA-Z0-9\.]+/g,"").toLowerCase()}function g(a){return typeof a=="function"}})(dli);var hli=hi&&hi.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(QfA,"__esModule",{value:!0});var tf=hli(iR);function nR(A,e){return function(){var t=this.traits(),i=this.properties?this.properties():{};return tf.default(t,"address."+A)||tf.default(t,A)||(e?tf.default(t,"address."+e):null)||(e?tf.default(t,e):null)||tf.default(i,"address."+A)||tf.default(i,A)||(e?tf.default(i,"address."+e):null)||(e?tf.default(i,e):null)}}function mli(A){A.zip=nR("postalCode","zip"),A.country=nR("country"),A.street=nR("street"),A.state=nR("state"),A.city=nR("city"),A.region=nR("region")}QfA.default=mli;var i8={};Object.defineProperty(i8,"__esModule",{value:!0}),i8.clone=void 0;function EfA(A){if(typeof A!="object")return A;if(Object.prototype.toString.call(A)==="[object Object]"){var e={};for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=EfA(A[t]));return e}else return Array.isArray(A)?A.map(EfA):A}i8.clone=EfA;var ufA={};Object.defineProperty(ufA,"__esModule",{value:!0});var pli={Salesforce:!0};function fli(A){return!pli[A]}ufA.default=fli;var n8={},Rde=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;n8.parse=function(A){var e=[1,5,6,7,11,12],t=Rde.exec(A),i=0;if(!t)return new Date(A);for(var n=0,o;o=e[n];n++)t[o]=parseInt(t[o],10)||0;t[2]=parseInt(t[2],10)||1,t[3]=parseInt(t[3],10)||1,t[2]--,t[8]=t[8]?(t[8]+"00").substring(0,3):0,t[4]===" "?i=new Date().getTimezoneOffset():t[9]!=="Z"&&t[10]&&(i=t[11]*60+t[12],t[10]==="+"&&(i=0-i));var g=Date.UTC(t[1],t[2],t[3],t[5],t[6]+i,t[7],t[8]);return new Date(g)},n8.is=function(A,e){return typeof A!="string"||e&&/^\d{4}-\d{2}-\d{2}/.test(A)===!1?!1:Rde.test(A)};var dfA={},yli=/\d{13}/;dfA.is=function(A){return yli.test(A)},dfA.parse=function(A){return A=parseInt(A,10),new Date(A)};var hfA={},bli=/\d{10}/;hfA.is=function(A){return bli.test(A)},hfA.parse=function(A){var e=parseInt(A,10)*1e3;return new Date(e)};var xde=n8,Fde=dfA,Mde=hfA,wli=Object.prototype,vde=wli.toString;function Dli(A){return vde.call(A)==="[object Date]"}function Gli(A){return vde.call(A)==="[object Number]"}var mfA=function(e){return Dli(e)?e:Gli(e)?new Date(kli(e)):xde.is(e)?xde.parse(e):Fde.is(e)?Fde.parse(e):Mde.is(e)?Mde.parse(e):new Date(e)};function kli(A){return A<315576e5?A*1e3:A}var Lde=n8,Jli=pfA;function pfA(A,e){return e===void 0&&(e=!0),A&&typeof A=="object"?Nli(A,e):Array.isArray(A)?Yli(A,e):Lde.is(A,e)?Lde.parse(A):A}function Nli(A,e){return Object.keys(A).forEach(function(t){A[t]=pfA(A[t],e)}),A}function Yli(A,e){return A.forEach(function(t,i){A[i]=pfA(t,e)}),A}var LZ=hi&&hi.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(LE,"__esModule",{value:!0}),LE.Facade=void 0;var Rli=LZ(QfA),oR=i8,xli=LZ(ufA),Fli=LZ(mfA),ffA=LZ(iR),Mli=LZ(Jli);function tC(A,e){e=e||{},this.raw=oR.clone(A),"clone"in e||(e.clone=!0),e.clone&&(A=oR.clone(A)),"traverse"in e||(e.traverse=!0),"timestamp"in A?A.timestamp=Fli.default(A.timestamp):A.timestamp=new Date,e.traverse&&Mli.default(A),this.opts=e,this.obj=A}LE.Facade=tC;var Xn=tC.prototype;Xn.proxy=function(A){var e=A.split(".");A=e.shift();var t=this[A]||this.obj[A];return t&&(typeof t=="function"&&(t=t.call(this)||{}),e.length===0?this.opts.clone?yfA(t):t:(t=ffA.default(t,e.join(".")),this.opts.clone?yfA(t):t))},Xn.field=function(A){var e=this.obj[A];return this.opts.clone?yfA(e):e},tC.proxy=function(A){return function(){return this.proxy(A)}},tC.field=function(A){return function(){return this.field(A)}},tC.multi=function(A){return function(){var e=this.proxy(A+"s");if(Array.isArray(e))return e;var t=this.proxy(A);return t&&(t=[this.opts.clone?oR.clone(t):t]),t||[]}},tC.one=function(A){return function(){var e=this.proxy(A);if(e)return e;var t=this.proxy(A+"s");if(Array.isArray(t))return t[0]}},Xn.json=function(){var A=this.opts.clone?oR.clone(this.obj):this.obj;return this.type&&(A.type=this.type()),A},Xn.rawEvent=function(){return this.raw},Xn.options=function(A){var e=this.obj.options||this.obj.context||{},t=this.opts.clone?oR.clone(e):e;if(!A)return t;if(this.enabled(A)){var i=this.integrations(),n=i[A]||ffA.default(i,A);return typeof n!="object"&&(n=ffA.default(this.options(),A)),typeof n=="object"?n:{}}},Xn.context=Xn.options,Xn.enabled=function(A){var e=this.proxy("options.providers.all");typeof e!="boolean"&&(e=this.proxy("options.all")),typeof e!="boolean"&&(e=this.proxy("integrations.all")),typeof e!="boolean"&&(e=!0);var t=e&&xli.default(A),i=this.integrations();if(i.providers&&i.providers.hasOwnProperty(A)&&(t=i.providers[A]),i.hasOwnProperty(A)){var n=i[A];typeof n=="boolean"?t=n:t=!0}return!!t},Xn.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()},Xn.active=function(){var A=this.proxy("options.active");return A==null&&(A=!0),A},Xn.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")},Xn.sessionId=Xn.anonymousId,Xn.groupId=tC.proxy("options.groupId"),Xn.traits=function(A){var e=this.proxy("options.traits")||{},t=this.userId();A=A||{},t&&(e.id=t);for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var n=this[i]==null?this.proxy("options.traits."+i):this[i]();if(n==null)continue;e[A[i]]=n,delete e[i]}return e},Xn.library=function(){var A=this.proxy("options.library");return A?typeof A=="string"?{name:A,version:null}:A:{name:"unknown",version:null}},Xn.device=function(){var A=this.proxy("context.device");(typeof A!="object"||A===null)&&(A={});var e=this.library().name;return A.type||(e.indexOf("ios")>-1&&(A.type="ios"),e.indexOf("android")>-1&&(A.type="android")),A},Xn.userAgent=tC.proxy("context.userAgent"),Xn.timezone=tC.proxy("context.timezone"),Xn.timestamp=tC.field("timestamp"),Xn.channel=tC.field("channel"),Xn.ip=tC.proxy("context.ip"),Xn.userId=tC.field("userId"),Rli.default(Xn);function yfA(A){return oR.clone(A)}var o8={},Bh={},Sde={get exports(){return Bh},set exports(A){Bh=A}};typeof Object.create=="function"?Sde.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Sde.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}};var vli=hi&&hi.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(o8,"__esModule",{value:!0}),o8.Alias=void 0;var Lli=vli(Bh),Hde=LE;function hB(A,e){Hde.Facade.call(this,A,e)}o8.Alias=hB,Lli.default(hB,Hde.Facade),hB.prototype.action=function(){return"alias"},hB.prototype.type=hB.prototype.action,hB.prototype.previousId=function(){return this.field("previousId")||this.field("from")},hB.prototype.from=hB.prototype.previousId,hB.prototype.userId=function(){return this.field("userId")||this.field("to")},hB.prototype.to=hB.prototype.userId;var g8={},gR={};Object.defineProperty(gR,"__esModule",{value:!0});var Sli=/.+\@.+\..+/;function Hli(A){return Sli.test(A)}gR.default=Hli;var bfA=hi&&hi.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(g8,"__esModule",{value:!0}),g8.Group=void 0;var Zli=bfA(Bh),Wli=bfA(gR),Kli=bfA(mfA),aR=LE;function wfA(A,e){aR.Facade.call(this,A,e)}g8.Group=wfA,Zli.default(wfA,aR.Facade);var mB=wfA.prototype;mB.action=function(){return"group"},mB.type=mB.action,mB.groupId=aR.Facade.field("groupId"),mB.created=function(){var A=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(A)return Kli.default(A)},mB.email=function(){var A=this.proxy("traits.email");if(A)return A;var e=this.groupId();if(Wli.default(e))return e},mB.traits=function(A){var e=this.properties(),t=this.groupId();A=A||{},t&&(e.id=t);for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var n=this[i]==null?this.proxy("traits."+i):this[i]();if(n==null)continue;e[A[i]]=n,delete e[i]}return e},mB.name=aR.Facade.proxy("traits.name"),mB.industry=aR.Facade.proxy("traits.industry"),mB.employees=aR.Facade.proxy("traits.employees"),mB.properties=function(){return this.field("traits")||this.field("properties")||{}};var SZ={},a8=hi&&hi.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(SZ,"__esModule",{value:!0}),SZ.Identify=void 0;var SE=LE,sR=a8(iR),Uli=a8(Bh),Vli=a8(gR),Zde=a8(mfA),iD=function(A){return A.trim()};function DfA(A,e){SE.Facade.call(this,A,e)}SZ.Identify=DfA,Uli.default(DfA,SE.Facade);var zn=DfA.prototype;zn.action=function(){return"identify"},zn.type=zn.action,zn.traits=function(A){var e=this.field("traits")||{},t=this.userId();A=A||{},t&&(e.id=t);for(var i in A){var n=this[i]==null?this.proxy("traits."+i):this[i]();n!=null&&(e[A[i]]=n,i!==A[i]&&delete e[i])}return e},zn.email=function(){var A=this.proxy("traits.email");if(A)return A;var e=this.userId();if(Vli.default(e))return e},zn.created=function(){var A=this.proxy("traits.created")||this.proxy("traits.createdAt");if(A)return Zde.default(A)},zn.companyCreated=function(){var A=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(A)return Zde.default(A)},zn.companyName=function(){return this.proxy("traits.company.name")},zn.name=function(){var A=this.proxy("traits.name");if(typeof A=="string")return iD(A);var e=this.firstName(),t=this.lastName();if(e&&t)return iD(e+" "+t)},zn.firstName=function(){var A=this.proxy("traits.firstName");if(typeof A=="string")return iD(A);var e=this.proxy("traits.name");if(typeof e=="string")return iD(e).split(" ")[0]},zn.lastName=function(){var A=this.proxy("traits.lastName");if(typeof A=="string")return iD(A);var e=this.proxy("traits.name");if(typeof e=="string"){var t=iD(e).indexOf(" ");if(t!==-1)return iD(e.substr(t+1))}},zn.uid=function(){return this.userId()||this.username()||this.email()},zn.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")},zn.age=function(){var A=this.birthday(),e=sR.default(this.traits(),"age");if(e!=null)return e;if(A instanceof Date){var t=new Date;return t.getFullYear()-A.getFullYear()}},zn.avatar=function(){var A=this.traits();return sR.default(A,"avatar")||sR.default(A,"photoUrl")||sR.default(A,"avatarUrl")},zn.position=function(){var A=this.traits();return sR.default(A,"position")||sR.default(A,"jobTitle")},zn.username=SE.Facade.proxy("traits.username"),zn.website=SE.Facade.one("traits.website"),zn.websites=SE.Facade.multi("traits.website"),zn.phone=SE.Facade.one("traits.phone"),zn.phones=SE.Facade.multi("traits.phone"),zn.address=SE.Facade.proxy("traits.address"),zn.gender=SE.Facade.proxy("traits.gender"),zn.birthday=SE.Facade.proxy("traits.birthday");var rR={},GfA=hi&&hi.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(rR,"__esModule",{value:!0}),rR.Track=void 0;var Xli=GfA(Bh),Yg=LE,zli=SZ,Tli=GfA(gR),Wde=GfA(iR);function kfA(A,e){Yg.Facade.call(this,A,e)}rR.Track=kfA,Xli.default(kfA,Yg.Facade);var ht=kfA.prototype;ht.action=function(){return"track"},ht.type=ht.action,ht.event=Yg.Facade.field("event"),ht.value=Yg.Facade.proxy("properties.value"),ht.category=Yg.Facade.proxy("properties.category"),ht.id=Yg.Facade.proxy("properties.id"),ht.productId=function(){return this.proxy("properties.product_id")||this.proxy("properties.productId")},ht.promotionId=function(){return this.proxy("properties.promotion_id")||this.proxy("properties.promotionId")},ht.cartId=function(){return this.proxy("properties.cart_id")||this.proxy("properties.cartId")},ht.checkoutId=function(){return this.proxy("properties.checkout_id")||this.proxy("properties.checkoutId")},ht.paymentId=function(){return this.proxy("properties.payment_id")||this.proxy("properties.paymentId")},ht.couponId=function(){return this.proxy("properties.coupon_id")||this.proxy("properties.couponId")},ht.wishlistId=function(){return this.proxy("properties.wishlist_id")||this.proxy("properties.wishlistId")},ht.reviewId=function(){return this.proxy("properties.review_id")||this.proxy("properties.reviewId")},ht.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.order_id")||this.proxy("properties.orderId")},ht.sku=Yg.Facade.proxy("properties.sku"),ht.tax=Yg.Facade.proxy("properties.tax"),ht.name=Yg.Facade.proxy("properties.name"),ht.price=Yg.Facade.proxy("properties.price"),ht.total=Yg.Facade.proxy("properties.total"),ht.repeat=Yg.Facade.proxy("properties.repeat"),ht.coupon=Yg.Facade.proxy("properties.coupon"),ht.shipping=Yg.Facade.proxy("properties.shipping"),ht.discount=Yg.Facade.proxy("properties.discount"),ht.shippingMethod=function(){return this.proxy("properties.shipping_method")||this.proxy("properties.shippingMethod")},ht.paymentMethod=function(){return this.proxy("properties.payment_method")||this.proxy("properties.paymentMethod")},ht.description=Yg.Facade.proxy("properties.description"),ht.plan=Yg.Facade.proxy("properties.plan"),ht.subtotal=function(){var A=Wde.default(this.properties(),"subtotal"),e=this.total()||this.revenue();if(A)return A;if(!e)return 0;if(this.total()){var t=this.tax();t&&(e-=t),t=this.shipping(),t&&(e-=t),t=this.discount(),t&&(e+=t)}return e},ht.products=function(){var A=this.properties(),e=Wde.default(A,"products");return Array.isArray(e)?e.filter(function(t){return t!==null}):[]},ht.quantity=function(){var A=this.obj.properties||{};return A.quantity||1},ht.currency=function(){var A=this.obj.properties||{};return A.currency||"USD"},ht.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},ht.query=Yg.Facade.proxy("options.query"),ht.properties=function(A){var e=this.field("properties")||{};A=A||{};for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var i=this[t]==null?this.proxy("properties."+t):this[t]();if(i==null)continue;e[A[t]]=i,delete e[t]}return e},ht.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()},ht.email=function(){var A=this.proxy("traits.email")||this.proxy("properties.email")||this.proxy("options.traits.email");if(A)return A;var e=this.userId();if(Tli.default(e))return e},ht.revenue=function(){var A=this.proxy("properties.revenue"),e=this.event(),t=/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i;return!A&&e&&e.match(t)&&(A=this.proxy("properties.total")),_li(A)},ht.cents=function(){var A=this.revenue();return typeof A!="number"?this.value()||0:A*100},ht.identify=function(){var A=this.json();return A.traits=this.traits(),new zli.Identify(A,this.opts)};function _li(A){if(A){if(typeof A=="number")return A;if(typeof A=="string"&&(A=A.replace(/\$/g,""),A=parseFloat(A),!isNaN(A)))return A}}var HZ={},Kde=hi&&hi.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(HZ,"__esModule",{value:!0}),HZ.Page=void 0;var Oli=Kde(Bh),nD=LE,qli=rR,jli=Kde(gR);function JfA(A,e){nD.Facade.call(this,A,e)}HZ.Page=JfA,Oli.default(JfA,nD.Facade);var Kr=JfA.prototype;Kr.action=function(){return"page"},Kr.type=Kr.action,Kr.category=nD.Facade.field("category"),Kr.name=nD.Facade.field("name"),Kr.title=nD.Facade.proxy("properties.title"),Kr.path=nD.Facade.proxy("properties.path"),Kr.url=nD.Facade.proxy("properties.url"),Kr.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},Kr.properties=function(A){var e=this.field("properties")||{},t=this.category(),i=this.name();A=A||{},t&&(e.category=t),i&&(e.name=i);for(var n in A)if(Object.prototype.hasOwnProperty.call(A,n)){var o=this[n]==null?this.proxy("properties."+n):this[n]();if(o==null)continue;e[A[n]]=o,n!==A[n]&&delete e[n]}return e},Kr.email=function(){var A=this.proxy("context.traits.email")||this.proxy("properties.email");if(A)return A;var e=this.userId();if(jli.default(e))return e},Kr.fullName=function(){var A=this.category(),e=this.name();return e&&A?A+" "+e:e},Kr.event=function(A){return A?"Viewed "+A+" Page":"Loaded a Page"},Kr.track=function(A){var e=this.json();return e.event=this.event(A),e.timestamp=this.timestamp(),e.properties=this.properties(),new qli.Track(e,this.opts)};var s8={},Pli=hi&&hi.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(s8,"__esModule",{value:!0}),s8.Screen=void 0;var $li=Pli(Bh),Ude=HZ,Aci=rR;function oD(A,e){Ude.Page.call(this,A,e)}s8.Screen=oD,$li.default(oD,Ude.Page),oD.prototype.action=function(){return"screen"},oD.prototype.type=oD.prototype.action,oD.prototype.event=function(A){return A?"Viewed "+A+" Screen":"Loaded a Screen"},oD.prototype.track=function(A){var e=this.json();return e.event=this.event(A),e.timestamp=this.timestamp(),e.properties=this.properties(),new Aci.Track(e,this.opts)};var r8={},eci=hi&&hi.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(r8,"__esModule",{value:!0}),r8.Delete=void 0;var tci=eci(Bh),Vde=LE;function NfA(A,e){Vde.Facade.call(this,A,e)}r8.Delete=NfA,tci.default(NfA,Vde.Facade),NfA.prototype.type=function(){return"delete"},function(A){var e=hi&&hi.__assign||function(){return e=Object.assign||function(r){for(var C,l=1,c=arguments.length;l<c;l++){C=arguments[l];for(var B in C)Object.prototype.hasOwnProperty.call(C,B)&&(r[B]=C[B])}return r},e.apply(this,arguments)};Object.defineProperty(A,"__esModule",{value:!0}),A.Delete=A.Screen=A.Page=A.Track=A.Identify=A.Group=A.Alias=A.Facade=void 0;var t=LE;Object.defineProperty(A,"Facade",{enumerable:!0,get:function(){return t.Facade}});var i=o8;Object.defineProperty(A,"Alias",{enumerable:!0,get:function(){return i.Alias}});var n=g8;Object.defineProperty(A,"Group",{enumerable:!0,get:function(){return n.Group}});var o=SZ;Object.defineProperty(A,"Identify",{enumerable:!0,get:function(){return o.Identify}});var g=rR;Object.defineProperty(A,"Track",{enumerable:!0,get:function(){return g.Track}});var a=HZ;Object.defineProperty(A,"Page",{enumerable:!0,get:function(){return a.Page}});var s=s8;Object.defineProperty(A,"Screen",{enumerable:!0,get:function(){return s.Screen}});var I=r8;Object.defineProperty(A,"Delete",{enumerable:!0,get:function(){return I.Delete}}),A.default=e(e({},t.Facade),{Alias:i.Alias,Group:n.Group,Identify:o.Identify,Track:g.Track,Page:a.Page,Screen:s.Screen,Delete:I.Delete})}(eC);function I8(A,e){var t=new eC.Facade(A,e);return A.type==="track"&&(t=new eC.Track(A,e)),A.type==="identify"&&(t=new eC.Identify(A,e)),A.type==="page"&&(t=new eC.Page(A,e)),A.type==="alias"&&(t=new eC.Alias(A,e)),A.type==="group"&&(t=new eC.Group(A,e)),A.type==="screen"&&(t=new eC.Screen(A,e)),Object.defineProperty(t,"obj",{value:A,writable:!0}),t}var ici=function(A){var e=!1;window.addEventListener("pagehide",function(){e||(e=!0,A(e))}),document.addEventListener("visibilitychange",function(){if(document.visibilityState=="hidden"){if(e)return;e=!0}else e=!1;A(e)})},Xde=function(A){Nr(e,A);function e(t,i){var n=A.call(this,t)||this;return n.retryTimeout=i,n.name="RateLimitError",n}return e}(Error),zde=function(A){return vA({"Content-Type":"text/plain"},typeof A=="function"?A():A)},nci=500,oci=64;function YfA(A){var e=encodeURI(JSON.stringify(A)).split(/%..|./).length-1;return e/1024}function gci(A){return YfA(A)>=nci-50}function aci(A){return YfA(A)>=oci-10}function sci(A){var e=[],t=0;return A.forEach(function(i){var n=YfA(e[t]);n>=64&&t++,e[t]?e[t].push(i):e[t]=[i]}),e}function rci(A,e){var t,i,n=[],o=!1,g=(t=e==null?void 0:e.size)!==null&&t!==void 0?t:10,a=(i=e==null?void 0:e.timeout)!==null&&i!==void 0?i:5e3,s=0;function I(B){var E;if(B.length!==0){var u=(E=B[0])===null||E===void 0?void 0:E.writeKey,d=B.map(function(f){var w=f;w.sentAt;var y=xj(w,["sentAt"]);return y});return j6("https://".concat(A,"/b"),{credentials:e==null?void 0:e.credentials,keepalive:(e==null?void 0:e.keepalive)||o,headers:zde(e==null?void 0:e.headers),method:"post",body:JSON.stringify({writeKey:u,batch:d,sentAt:new Date().toISOString()}),priority:e==null?void 0:e.priority}).then(function(f){var w;if(f.status>=500)throw new Error("Bad response from server: ".concat(f.status));if(f.status===429){var y=(w=f.headers)===null||w===void 0?void 0:w.get("x-ratelimit-reset"),G=typeof y=="string"?parseInt(y)*1e3:a;throw new Xde("Rate limit exceeded: ".concat(f.status),G)}})}}function r(B){var E;return B===void 0&&(B=1),xA(this,void 0,void 0,function(){var u;return ge(this,function(d){return n.length?(u=n,n=[],[2,(E=I(u))===null||E===void 0?void 0:E.catch(function(f){var w,y=ME.system();y.log("error","Error sending batch",f),B<=((w=e==null?void 0:e.maxRetries)!==null&&w!==void 0?w:10)&&(f.name==="RateLimitError"&&(s=f.retryTimeout),n.push.apply(n,u),n.map(function(G){if("_metadata"in G){var R=G;R._metadata=vA(vA({},R._metadata),{retryCount:B})}}),l(B+1))})]):[2]})})}var C;function l(B){B===void 0&&(B=1),!C&&(C=setTimeout(function(){C=void 0,r(B).catch(console.error)},s||a),s=0)}ici(function(B){if(o=B,o&&n.length){var E=sci(n).map(I);Promise.all(E).catch(console.error)}});function c(B,E){return xA(this,void 0,void 0,function(){var u;return ge(this,function(d){return n.push(E),u=n.length>=g||gci(n)||(e==null?void 0:e.keepalive)&&aci(n),[2,u||o?r():l()]})})}return{dispatch:c}}function Ici(A){function e(t,i){return j6(t,{credentials:A==null?void 0:A.credentials,keepalive:A==null?void 0:A.keepalive,headers:zde(A==null?void 0:A.headers),method:"post",body:JSON.stringify(i),priority:A==null?void 0:A.priority}).then(function(n){var o;if(n.status>=500)throw new Error("Bad response from server: ".concat(n.status));if(n.status===429){var g=(o=n.headers)===null||o===void 0?void 0:o.get("x-ratelimit-reset"),a=g?parseInt(g)*1e3:5e3;throw new Xde("Rate limit exceeded: ".concat(n.status),a)}})}return{dispatch:e}}function Cci(A,e,t,i,n){var o,g=A.user();delete e.options,e.writeKey=t==null?void 0:t.apiKey,e.userId=e.userId||g.id(),e.anonymousId=e.anonymousId||g.anonymousId(),e.sentAt=new Date;var a=A.queue.failedInitializations||[];a.length>0&&(e._metadata={failedInitializations:a}),n!=null&&(n.attempts>1&&(e._metadata=vA(vA({},e._metadata),{retryCount:n.attempts})),n.attempts++);var s=[],I=[];for(var r in i){var C=i[r];r==="Segment.io"&&s.push(r),C.bundlingStatus==="bundled"&&s.push(r),C.bundlingStatus==="unbundled"&&I.push(r)}for(var l=0,c=(t==null?void 0:t.unbundledIntegrations)||[];l<c.length;l++){var B=c[l];I.includes(B)||I.push(B)}var E=(o=t==null?void 0:t.maybeBundledConfigIds)!==null&&o!==void 0?o:{},u=[];return s.sort().forEach(function(d){var f;((f=E[d])!==null&&f!==void 0?f:[]).forEach(function(w){u.push(w)})}),(t==null?void 0:t.addBundledMetadata)!==!1&&(e._metadata=vA(vA({},e._metadata),{bundled:s.sort(),unbundled:I.sort(),bundledIds:u})),e}var Tde=function(A,e){return xA(void 0,void 0,void 0,function(){var t;return ge(this,function(i){return t=function(n){return xA(void 0,void 0,void 0,function(){var o;return ge(this,function(g){switch(g.label){case 0:return A(n)?(o=t,[4,e()]):[3,2];case 1:return[2,o.apply(void 0,[g.sent()])];case 2:return[2]}})})},[2,t(void 0)]})})};function lci(A,e){return xA(this,void 0,void 0,function(){var t,i=this;return ge(this,function(n){switch(n.label){case 0:return t=[],ef()?[2,e]:[4,Tde(function(){return e.length>0&&!ef()},function(){return xA(i,void 0,void 0,function(){var o,g,a;return ge(this,function(s){switch(s.label){case 0:return o=e.pop(),o?[4,AR(o,A)]:[2];case 1:return g=s.sent(),a=g instanceof ME,a||t.push(o),[2]}})})})];case 1:return n.sent(),t.map(function(o){return e.pushWithBackoff(o)}),[2,e]}})})}function IR(A,e,t,i){var n=this;A||setTimeout(function(){return xA(n,void 0,void 0,function(){var o,g;return ge(this,function(a){switch(a.label){case 0:return o=!0,[4,lci(t,e)];case 1:return g=a.sent(),o=!1,e.todo>0&&i(o,g,t,i),[2]}})})},Math.random()*5e3)}function cci(A,e){var t,i,n,o,g=A.user();return e.previousId=(n=(i=(t=e.previousId)!==null&&t!==void 0?t:e.from)!==null&&i!==void 0?i:g.id())!==null&&n!==void 0?n:g.anonymousId(),e.userId=(o=e.userId)!==null&&o!==void 0?o:e.to,delete e.from,delete e.to,e}var Bci=function(A){return A.name==="Segment.io"};function Qci(A,e,t){var i,n,o;window.addEventListener("pagehide",function(){a.push.apply(a,Array.from(s)),s.clear()});var g=(i=e==null?void 0:e.apiKey)!==null&&i!==void 0?i:"",a=A.options.disableClientPersistence?new T6(A.queue.queue.maxAttempts,[]):new $6(A.queue.queue.maxAttempts,"".concat(g,":dest-Segment.io")),s=new Set,I=!1,r=(n=e==null?void 0:e.apiHost)!==null&&n!==void 0?n:Qde,C=(o=e==null?void 0:e.protocol)!==null&&o!==void 0?o:"https",l="".concat(C,"://").concat(r),c=e==null?void 0:e.deliveryStrategy,B=c&&"strategy"in c&&c.strategy==="batching"?rci(r,c.config):Ici(c==null?void 0:c.config);function E(d){return xA(this,void 0,void 0,function(){var f,w;return ge(this,function(y){return ef()?(a.push(d),IR(I,a,u,IR),[2,d]):(s.add(d),f=d.event.type.charAt(0),w=I8(d.event).json(),d.event.type==="track"&&delete w.traits,d.event.type==="alias"&&(w=cci(A,w)),a.getAttempts(d)>=a.maxAttempts?(s.delete(d),[2,d]):[2,B.dispatch("".concat(l,"/").concat(f),Cci(A,w,e,t,d)).then(function(){return d}).catch(function(G){if(d.log("error","Error sending event",G),G.name==="RateLimitError"){var R=G.retryTimeout;a.pushWithBackoff(d,R)}else a.pushWithBackoff(d);return IR(I,a,u,IR),d}).finally(function(){s.delete(d)})])})})}var u={metadata:{writeKey:g,apiHost:r,protocol:C},name:"Segment.io",type:"destination",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:E,identify:E,page:E,alias:E,group:E,screen:E};return a.todo&&IR(I,a,u,IR),u}var nf="This is being deprecated and will be not be available in future releases of Analytics JS",RfA=nfA(),xfA=RfA==null?void 0:RfA.analytics;function Eci(A,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=e?10:1,n=t?new T6(i,[]):new $6(i,A);return new Ali(n)}var uci=function(){function A(e,t){var i;this.timeout=300,this._getSegmentPluginMetadata=function(){var o;return(o=t.plugins.find(Bci))===null||o===void 0?void 0:o.metadata},this.writeKey=e.writeKey;var n={integrations:{"Segment.io":{apiKey:""}}};this.cdnSettings=(i=e.cdnSettings)!==null&&i!==void 0?i:n,this.cdnURL=e.cdnURL}return Object.defineProperty(A.prototype,"apiHost",{get:function(){var e,t;return(t=(e=this._getSegmentPluginMetadata)===null||e===void 0?void 0:e.call(this))===null||t===void 0?void 0:t.apiHost},enumerable:!1,configurable:!0}),A}();function HE(){console.warn(nf)}var _de=function(A){Nr(e,A);function e(t,i,n,o,g){var a=this,s,I;a=A.call(this)||this,a._debug=!1,a.initialized=!1,a.user=function(){return a._user},a.init=a.initialize.bind(a),a.log=HE,a.addIntegrationMiddleware=HE,a.listeners=HE,a.addEventListener=HE,a.removeAllListeners=HE,a.removeListener=HE,a.removeEventListener=HE,a.hasListeners=HE,a.add=HE,a.addIntegration=HE;var r=i==null?void 0:i.cookie,C=(s=i==null?void 0:i.disableClientPersistence)!==null&&s!==void 0?s:!1;a.queue=n??Eci("".concat(t.writeKey,":event-queue"),i==null?void 0:i.retryQueue,C),a.settings=new uci(t,a.queue);var l=i==null?void 0:i.storage;return a._universalStorage=a.createStore(C,l,r),a._user=o??new kde(vA({persist:!C,storage:i==null?void 0:i.storage},i==null?void 0:i.user),r).load(),a._group=g??new ali(vA({persist:!C,storage:i==null?void 0:i.storage},i==null?void 0:i.group),r).load(),a.eventFactory=new OCi(a._user),a.integrations=(I=i==null?void 0:i.integrations)!==null&&I!==void 0?I:{},a.options=i??{},sfA(a),a}return e.prototype.createStore=function(t,i,n){return t?new eD([new IfA]):i&&Dde(i)?new eD(lfA(Gde(i.stores,n))):new eD(lfA([Wr.LocalStorage,{name:Wr.Cookie,settings:n},Wr.Memory]))},Object.defineProperty(e.prototype,"storage",{get:function(){return this._universalStorage},enumerable:!1,configurable:!0}),e.prototype.track=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xA(this,void 0,void 0,function(){var n,o,g,a,s,I,r,C=this;return ge(this,function(l){return n=tR(t),o=MCi.apply(void 0,t),g=o[0],a=o[1],s=o[2],I=o[3],r=this.eventFactory.track(g,a,s,this.integrations,n),[2,this._dispatch(r,I).then(function(c){return C.emit("track",g,c.event.properties,c.event.options),c})]})})},e.prototype.page=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xA(this,void 0,void 0,function(){var n,o,g,a,s,I,r,C,l=this;return ge(this,function(c){return n=tR(t),o=Cde.apply(void 0,t),g=o[0],a=o[1],s=o[2],I=o[3],r=o[4],C=this.eventFactory.page(g,a,s,I,this.integrations,n),[2,this._dispatch(C,r).then(function(B){return l.emit("page",g,a,B.event.properties,B.event.options),B})]})})},e.prototype.identify=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xA(this,void 0,void 0,function(){var n,o,g,a,s,I,r,C=this;return ge(this,function(l){return n=tR(t),o=lde(this._user).apply(void 0,t),g=o[0],a=o[1],s=o[2],I=o[3],this._user.identify(g,a),r=this.eventFactory.identify(this._user.id(),this._user.traits(),s,this.integrations,n),[2,this._dispatch(r,I).then(function(c){return C.emit("identify",c.event.userId,c.event.traits,c.event.options),c})]})})},e.prototype.group=function(){for(var t=this,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var o=tR(i);if(i.length===0)return this._group;var g=lde(this._group).apply(void 0,i),a=g[0],s=g[1],I=g[2],r=g[3];this._group.identify(a,s);var C=this._group.id(),l=this._group.traits(),c=this.eventFactory.group(C,l,I,this.integrations,o);return this._dispatch(c,r).then(function(B){return t.emit("group",B.event.groupId,B.event.traits,B.event.options),B})},e.prototype.alias=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xA(this,void 0,void 0,function(){var n,o,g,a,s,I,r,C=this;return ge(this,function(l){return n=tR(t),o=vCi.apply(void 0,t),g=o[0],a=o[1],s=o[2],I=o[3],r=this.eventFactory.alias(g,a,s,this.integrations,n),[2,this._dispatch(r,I).then(function(c){return C.emit("alias",g,a,c.event.options),c})]})})},e.prototype.screen=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xA(this,void 0,void 0,function(){var n,o,g,a,s,I,r,C,l=this;return ge(this,function(c){return n=tR(t),o=Cde.apply(void 0,t),g=o[0],a=o[1],s=o[2],I=o[3],r=o[4],C=this.eventFactory.screen(g,a,s,I,this.integrations,n),[2,this._dispatch(C,r).then(function(B){return l.emit("screen",g,a,B.event.properties,B.event.options),B})]})})},e.prototype.trackClick=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xA(this,void 0,void 0,function(){var n,o;return ge(this,function(g){switch(g.label){case 0:return[4,Promise.resolve().then(()=>eP)];case 1:return n=g.sent(),[2,(o=n.link).call.apply(o,$n([this],t,!1))]}})})},e.prototype.trackLink=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xA(this,void 0,void 0,function(){var n,o;return ge(this,function(g){switch(g.label){case 0:return[4,Promise.resolve().then(()=>eP)];case 1:return n=g.sent(),[2,(o=n.link).call.apply(o,$n([this],t,!1))]}})})},e.prototype.trackSubmit=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xA(this,void 0,void 0,function(){var n,o;return ge(this,function(g){switch(g.label){case 0:return[4,Promise.resolve().then(()=>eP)];case 1:return n=g.sent(),[2,(o=n.form).call.apply(o,$n([this],t,!1))]}})})},e.prototype.trackForm=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xA(this,void 0,void 0,function(){var n,o;return ge(this,function(g){switch(g.label){case 0:return[4,Promise.resolve().then(()=>eP)];case 1:return n=g.sent(),[2,(o=n.form).call.apply(o,$n([this],t,!1))]}})})},e.prototype.register=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xA(this,void 0,void 0,function(){var n,o,g=this;return ge(this,function(a){switch(a.label){case 0:return n=ME.system(),o=t.map(function(s){return g.queue.register(n,s,g)}),[4,Promise.all(o)];case 1:return a.sent(),[2,n]}})})},e.prototype.deregister=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xA(this,void 0,void 0,function(){var n,o,g=this;return ge(this,function(a){switch(a.label){case 0:return n=ME.system(),o=t.map(function(s){var I=g.queue.plugins.find(function(r){return r.name===s});if(I)return g.queue.deregister(n,I,g);n.log("warn","plugin ".concat(s," not found"))}),[4,Promise.all(o)];case 1:return a.sent(),[2,n]}})})},e.prototype.debug=function(t){return t===!1&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=t,this},e.prototype.reset=function(){this._user.reset(),this._group.reset(),this.emit("reset")},e.prototype.timeout=function(t){this.settings.timeout=t},e.prototype._dispatch=function(t,i){return xA(this,void 0,void 0,function(){var n;return ge(this,function(o){return n=new ME(t),n.stats.increment("analytics_js.invoke",1,[t.type]),ef()&&!this.options.retryQueue?[2,n]:[2,FCi(n,this.queue,this,{callback:i,debug:this._debug,timeout:this.settings.timeout})]})})},e.prototype.addSourceMiddleware=function(t){return xA(this,void 0,void 0,function(){var i=this;return ge(this,function(n){switch(n.label){case 0:return[4,this.queue.criticalTasks.run(function(){return xA(i,void 0,void 0,function(){var o,g,a;return ge(this,function(s){switch(s.label){case 0:return[4,Promise.resolve().then(()=>xci)];case 1:return o=s.sent().sourceMiddlewarePlugin,g={},this.queue.plugins.forEach(function(I){if(I.type==="destination")return g[I.name]=!0}),a=o(t,g),[4,this.register(a)];case 2:return s.sent(),[2]}})})})];case 1:return n.sent(),[2,this]}})})},e.prototype.addDestinationMiddleware=function(t){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];return this.queue.plugins.filter(qCi).forEach(function(o){(t==="*"||o.name.toLowerCase()===t.toLowerCase())&&o.addMiddleware.apply(o,i)}),Promise.resolve(this)},e.prototype.setAnonymousId=function(t){return this._user.anonymousId(t)},e.prototype.queryString=function(t){return xA(this,void 0,void 0,function(){var i;return ge(this,function(n){switch(n.label){case 0:return this.options.useQueryString===!1?[2,[]]:[4,Promise.resolve().then(()=>Cmi)];case 1:return i=n.sent().queryString,[2,i(this,t)]}})})},e.prototype.use=function(t){return t(this),this},e.prototype.ready=function(t){return t===void 0&&(t=function(i){return i}),xA(this,void 0,void 0,function(){return ge(this,function(i){return[2,Promise.all(this.queue.plugins.map(function(n){return n.ready?n.ready():Promise.resolve()})).then(function(n){return t(n),n})]})})},e.prototype.noConflict=function(){return console.warn(nf),rli(xfA??this),this},e.prototype.normalize=function(t){return console.warn(nf),this.eventFactory.normalize(t)},Object.defineProperty(e.prototype,"failedInitializations",{get:function(){return console.warn(nf),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"VERSION",{get:function(){return vZ},enumerable:!1,configurable:!0}),e.prototype.initialize=function(t,i){return xA(this,void 0,void 0,function(){return ge(this,function(n){return console.warn(nf),[2,Promise.resolve(this)]})})},e.prototype.pageview=function(t){return xA(this,void 0,void 0,function(){return ge(this,function(i){switch(i.label){case 0:return console.warn(nf),[4,this.page({path:t})];case 1:return i.sent(),[2,this]}})})},Object.defineProperty(e.prototype,"plugins",{get:function(){var t;return console.warn(nf),(t=this._plugins)!==null&&t!==void 0?t:{}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Integrations",{get:function(){console.warn(nf);var t=this.queue.plugins.filter(function(i){return i.type==="destination"}).reduce(function(i,n){var o="".concat(n.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),g=window[o];if(!g)return i;var a=g.Integration;return a?(i[n.name]=a,i):(i[n.name]=g,i)},{});return t},enumerable:!1,configurable:!0}),e.prototype.push=function(t){var i=this,n=t.shift();n&&!i[n]||i[n].apply(this,t)},e}(efA),Ode=function(A){Nr(e,A);function e(){var t=A.call(this,{writeKey:""},{disableClientPersistence:!0})||this;return t.initialized=!0,t}return e}(_de);function qde(){return typeof process>"u"||!process.env?{}:process.env}var dci=/(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/,hci=function(){var A,e=Array.prototype.slice.call(document.querySelectorAll("script"));return e.forEach(function(t){var i,n=(i=t.getAttribute("src"))!==null&&i!==void 0?i:"",o=dci.exec(n);o&&o[1]&&(A=o[1])}),A},C8,mci=function(){var A,e=C8??((A=BfA())===null||A===void 0?void 0:A._cdn);return e},pci=function(A){var e=BfA();e&&(e._cdn=A),C8=A},FfA=function(){var A=mci();if(A)return A;var e=hci();return e||"https://cdn.segment.com"},MfA=function(){var A=FfA();return"".concat(A,"/next-integrations")};function jde(A,e){var t,i=Object.entries((t=e.integrations)!==null&&t!==void 0?t:{}).reduce(function(n,o){var g,a,s=o[0],I=o[1];return typeof I=="object"?vA(vA({},n),(g={},g[s]=I,g)):vA(vA({},n),(a={},a[s]={},a))},{});return Object.entries(A.integrations).reduce(function(n,o){var g,a=o[0],s=o[1];return vA(vA({},n),(g={},g[a]=vA(vA({},s),i[a]),g))},{})}function Pde(A){try{return decodeURIComponent(A.replace(/\+/g," "))}catch{return A}}function fci(A){return xA(this,void 0,void 0,function(){var e;return ge(this,function(t){return e=navigator.userAgentData,e?A?[2,e.getHighEntropyValues(A).catch(function(){return e.toJSON()})]:[2,e.toJSON()]:[2,void 0]})})}var ZZ;function yci(){if(ZZ)return ZZ;var A=bde(window.location.href);return ZZ={expires:31536e6,secure:!1,path:"/"},A&&(ZZ.domain=A),ZZ}function bci(A){var e={btid:"dataxu",urid:"millennial-media"};A.startsWith("?")&&(A=A.substring(1)),A=A.replace(/\?/g,"&");for(var t=A.split("&"),i=0,n=t;i<n.length;i++){var o=n[i],g=o.split("="),a=g[0],s=g[1];if(e[a])return{id:s,type:e[a]}}}function wci(A){return A.startsWith("?")&&(A=A.substring(1)),A=A.replace(/\?/g,"&"),A.split("&").reduce(function(e,t){var i=t.split("="),n=i[0],o=i[1],g=o===void 0?"":o;if(n.includes("utm_")&&n.length>4){var a=n.slice(4);a==="campaign"&&(a="name"),e[a]=Pde(g)}return e},{})}function Dci(){var A=ch.get("_ga");if(A&&A.startsWith("amp"))return A}function Gci(A,e,t){var i,n=new eD(t?[]:[new wde(yci())]),o=n.get("s:context.referrer"),g=(i=bci(A))!==null&&i!==void 0?i:o;g&&(e&&(e.referrer=vA(vA({},e.referrer),g)),n.set("s:context.referrer",g))}var kci=function(A){try{var e=new URLSearchParams;return Object.entries(A).forEach(function(t){var i=t[0],n=t[1];Array.isArray(n)?n.forEach(function(o){return e.append(i,o)}):e.append(i,n)}),e.toString()}catch{return""}},Jci=function(){function A(){var e=this;this.name="Page Enrichment",this.type="before",this.version="0.1.0",this.isLoaded=function(){return!0},this.load=function(t,i){return xA(e,void 0,void 0,function(){var n;return ge(this,function(o){switch(o.label){case 0:this.instance=i,o.label=1;case 1:return o.trys.push([1,3,,4]),n=this,[4,fci(this.instance.options.highEntropyValuesClientHints)];case 2:return n.userAgentData=o.sent(),[3,4];case 3:return o.sent(),[3,4];case 4:return[2,Promise.resolve()]}})})},this.enrich=function(t){var i,n,o=t.event.context,g=o.page.search||"",a=typeof g=="object"?kci(g):g;o.userAgent=navigator.userAgent,o.userAgentData=e.userAgentData;var s=navigator.userLanguage||navigator.language;typeof o.locale>"u"&&typeof s<"u"&&(o.locale=s),(i=o.library)!==null&&i!==void 0||(o.library={name:"analytics.js",version:"".concat(ofA()==="web"?"next":"npm:next","-").concat(vZ)}),a&&!o.campaign&&(o.campaign=wci(a));var I=Dci();I&&(o.amp={id:I}),Gci(a,o,(n=e.instance.options.disableClientPersistence)!==null&&n!==void 0?n:!1);try{o.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}return t},this.track=this.enrich,this.identify=this.enrich,this.page=this.enrich,this.group=this.enrich,this.alias=this.enrich,this.screen=this.enrich}return A}(),Nci=new Jci;function $de(A){var e=Array.prototype.slice.call(window.document.querySelectorAll("script"));return e.find(function(t){return t.src===A})}function CR(A,e){var t=$de(A);if(t!==void 0){var i=t==null?void 0:t.getAttribute("status");if(i==="loaded")return Promise.resolve(t);if(i==="loading")return new Promise(function(n,o){t.addEventListener("load",function(){return n(t)}),t.addEventListener("error",function(g){return o(g)})})}return new Promise(function(n,o){var g,a=window.document.createElement("script");a.type="text/javascript",a.src=A,a.async=!0,a.setAttribute("status","loading");for(var s=0,I=Object.entries(e??{});s<I.length;s++){var r=I[s],C=r[0],l=r[1];a.setAttribute(C,l)}a.onload=function(){a.onerror=a.onload=null,a.setAttribute("status","loaded"),n(a)},a.onerror=function(){a.onerror=a.onload=null,a.setAttribute("status","error"),o(new Error("Failed to load ".concat(A)))};var c=window.document.querySelector("script");c?(g=c.parentElement)===null||g===void 0||g.insertBefore(a,c):window.document.head.appendChild(a)})}function Yci(A){var e=$de(A);return e!==void 0&&e.remove(),Promise.resolve()}function vfA(A,e,t){return xA(this,void 0,void 0,function(){function i(I,r){return xA(this,void 0,void 0,function(){var C,l,c;return ge(this,function(B){switch(B.label){case 0:return C=!1,l=null,[4,r({payload:I8(I,{clone:!0,traverse:!1}),integration:A,next:function(E){C=!0,E===null&&(l=null),E&&(l=E.obj)}})];case 1:return B.sent(),!C&&l!==null&&(l=l,l.integrations=vA(vA({},I.integrations),(c={},c[A]=!1,c))),[2,l]}})})}var n,o,g,a,s;return ge(this,function(I){switch(I.label){case 0:n=I8(e,{clone:!0,traverse:!1}).rawEvent(),o=0,g=t,I.label=1;case 1:return o<g.length?(a=g[o],[4,i(n,a)]):[3,4];case 2:if(s=I.sent(),s===null)return[2,null];n=s,I.label=3;case 3:return o++,[3,1];case 4:return[2,n]}})})}function Rci(A,e){function t(i){return xA(this,void 0,void 0,function(){var n;return ge(this,function(o){switch(o.label){case 0:return n=!1,[4,A({payload:I8(i.event,{clone:!0,traverse:!1}),integrations:e??{},next:function(g){n=!0,g&&(i.event=g.obj)}})];case 1:if(o.sent(),!n)throw new Af({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,i]}})})}return{name:"Source Middleware ".concat(A.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(i){return Promise.resolve(i)},track:t,page:t,screen:t,identify:t,alias:t,group:t}}const xci=Object.freeze(Object.defineProperty({__proto__:null,applyDestinationMiddleware:vfA,sourceMiddlewarePlugin:Rci},Symbol.toStringTag,{value:"Module"}));function of(A,e){var t=e.methodName,i=e.integrationName,n=e.type,o=e.didError,g=o===void 0?!1:o;A.stats.increment("analytics_js.integration.invoke".concat(g?".error":""),1,["method:".concat(t),"integration_name:".concat(i),"type:".concat(n)])}var Fci=function(){function A(e,t){this.version="1.0.0",this.alternativeNames=[],this.loadPromise=AfA(),this.middleware=[],this.alias=this._createMethod("alias"),this.group=this._createMethod("group"),this.identify=this._createMethod("identify"),this.page=this._createMethod("page"),this.screen=this._createMethod("screen"),this.track=this._createMethod("track"),this.action=t,this.name=e,this.type=t.type,this.alternativeNames.push(t.name)}return A.prototype.addMiddleware=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.type==="destination"&&(e=this.middleware).push.apply(e,t)},A.prototype.transform=function(e){return xA(this,void 0,void 0,function(){var t;return ge(this,function(i){switch(i.label){case 0:return[4,vfA(this.name,e.event,this.middleware)];case 1:return t=i.sent(),t===null&&e.cancel(new Af({retry:!1,reason:"dropped by destination middleware"})),[2,new ME(t)]}})})},A.prototype._createMethod=function(e){var t=this;return function(i){return xA(t,void 0,void 0,function(){var n,o;return ge(this,function(g){switch(g.label){case 0:return this.action[e]?(n=i,this.type!=="destination"?[3,2]:[4,this.transform(i)]):[2,i];case 1:n=g.sent(),g.label=2;case 2:return g.trys.push([2,5,,6]),[4,this.ready()];case 3:if(!g.sent())throw new Error("Something prevented the destination from getting ready");return of(i,{integrationName:this.action.name,methodName:e,type:"action"}),[4,this.action[e](n)];case 4:return g.sent(),[3,6];case 5:throw o=g.sent(),of(i,{integrationName:this.action.name,methodName:e,type:"action",didError:!0}),o;case 6:return[2,i]}})})}},A.prototype.isLoaded=function(){return this.action.isLoaded()},A.prototype.ready=function(){return xA(this,void 0,void 0,function(){return ge(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.loadPromise.promise];case 1:return e.sent(),[2,!0];case 2:return e.sent(),[2,!1];case 3:return[2]}})})},A.prototype.load=function(e,t){return xA(this,void 0,void 0,function(){var i,n,o,g;return ge(this,function(a){switch(a.label){case 0:if(this.loadPromise.isSettled())return[2,this.loadPromise.promise];a.label=1;case 1:return a.trys.push([1,3,,4]),of(e,{integrationName:this.action.name,methodName:"load",type:"action"}),i=this.action.load(e,t),o=(n=this.loadPromise).resolve,[4,i];case 2:return o.apply(n,[a.sent()]),[2,i];case 3:throw g=a.sent(),of(e,{integrationName:this.action.name,methodName:"load",type:"action",didError:!0}),this.loadPromise.reject(g),g;case 4:return[2]}})})},A.prototype.unload=function(e,t){var i,n;return(n=(i=this.action).unload)===null||n===void 0?void 0:n.call(i,e,t)},A}();function Mci(A){if(!Array.isArray(A))throw new Error("Not a valid list of plugins");var e=["load","isLoaded","name","version","type"];return A.forEach(function(t){e.forEach(function(i){var n;if(t[i]===void 0)throw new Error("Plugin: ".concat((n=t.name)!==null&&n!==void 0?n:"unknown"," missing required function ").concat(i))})}),!0}function vci(A,e){var t=A[e.creationName],i=A[e.name];return A.All===!1&&!t&&!i||t===!1||i===!1}function Lci(A,e){return xA(this,void 0,void 0,function(){var t,i,n,o,g,a;return ge(this,function(s){switch(s.label){case 0:if(s.trys.push([0,9,,10]),t=new RegExp("https://cdn.segment.(com|build)"),i=FfA(),!e)return[3,6];n=A.url.split("/"),o=n[n.length-2],g=A.url.replace(o,btoa(o).replace(/=/g,"")),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,CR(g.replace(t,i))];case 2:return s.sent(),[3,5];case 3:return s.sent(),[4,CR(A.url.replace(t,i))];case 4:return s.sent(),[3,5];case 5:return[3,8];case 6:return[4,CR(A.url.replace(t,i))];case 7:s.sent(),s.label=8;case 8:return typeof window[A.libraryName]=="function"?[2,window[A.libraryName]]:[3,10];case 9:throw a=s.sent(),console.error("Failed to create PluginFactory",A),a;case 10:return[2]}})})}function Sci(A,e,t,i,n,o){var g,a,s;return xA(this,void 0,void 0,function(){var I,r,C,l=this;return ge(this,function(c){switch(c.label){case 0:return I=[],r=(a=(g=A.middlewareSettings)===null||g===void 0?void 0:g.routingRules)!==null&&a!==void 0?a:[],C=((s=A.remotePlugins)!==null&&s!==void 0?s:[]).map(function(B){return xA(l,void 0,void 0,function(){var E,u,d,f,w,y,G;return ge(this,function(R){switch(R.label){case 0:if(vci(e,B))return[2];R.label=1;case 1:return R.trys.push([1,6,,7]),u=o==null?void 0:o.find(function(x){var F=x.pluginName;return F===B.name}),u?[3,3]:[4,Lci(B,i==null?void 0:i.obfuscate)];case 2:u=R.sent(),R.label=3;case 3:return E=u,E?(d=t[B.name],[4,E(vA(vA({},B.settings),d))]):[3,5];case 4:f=R.sent(),w=Array.isArray(f)?f:[f],Mci(w),y=r.filter(function(x){return x.destinationName===B.creationName}),w.forEach(function(x){var F=new Fci(B.creationName,x);y.length&&n&&F.addMiddleware(n),I.push(F)}),R.label=5;case 5:return[3,7];case 6:return G=R.sent(),console.warn("Failed to load Remote Plugin",G),[3,7];case 7:return[2]}})})}),[4,Promise.all(C)];case 1:return c.sent(),[2,I.filter(Boolean)]}})})}var LfA,Ahe,Hci=nfA(),ehe=(LfA=(Ahe=Hci).__SEGMENT_INSPECTOR__)!==null&&LfA!==void 0?LfA:Ahe.__SEGMENT_INSPECTOR__={},Zci=function(A){var e;return(e=ehe.attach)===null||e===void 0?void 0:e.call(ehe,A)};function Wci(A,e){return j6("".concat(e,"/v1/projects/").concat(A,"/settings")).then(function(t){return t.ok?t.json():t.text().then(function(i){throw new Error(i)})}).catch(function(t){throw console.error(t.message),t})}function Kci(A){return qde().NODE_ENV!=="test"&&Object.keys(A.integrations).length>1}function Uci(A){var e,t,i;return qde().NODE_ENV!=="test"&&((i=(t=(e=A.middlewareSettings)===null||e===void 0?void 0:e.routingRules)===null||t===void 0?void 0:t.length)!==null&&i!==void 0?i:0)>0}function Vci(A,e){Bli(A,e),cli(A,e)}function Xci(A,e,t){return xA(this,void 0,void 0,function(){return ge(this,function(i){switch(i.label){case 0:return[4,Tci(A,e)];case 1:return i.sent(),Qli(A,t),[2]}})})}var zci=function(){var A,e,t=(A=window.location.hash)!==null&&A!==void 0?A:"",i=(e=window.location.search)!==null&&e!==void 0?e:"",n=i.length?i:t.replace(/(?=#).*(?=\?)/,"");return n},Tci=function(A,e){return xA(void 0,void 0,void 0,function(){return ge(this,function(t){switch(t.label){case 0:return e.includes("ajs_")?[4,A.queryString(e).catch(console.error)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})};function _ci(A,e,t,i,n,o,g){var a,s,I;return n===void 0&&(n=[]),xA(this,void 0,void 0,function(){var r,C,l,c,B,E,u,d,f,w,y,G,R,x,F,Q=this;return ge(this,function(k){switch(k.label){case 0:return Vci(t,g),r=n==null?void 0:n.filter(function(h){return typeof h=="object"}),C=n==null?void 0:n.filter(function(h){return typeof h=="function"&&typeof h.pluginName=="string"}),Uci(e)?[4,Promise.resolve().then(()=>Bmi).then(function(h){return h.tsubMiddleware(e.middlewareSettings.routingRules)})]:[3,2];case 1:return c=k.sent(),[3,3];case 2:c=void 0,k.label=3;case 3:return l=c,Kci(e)||o.length>0?[4,Promise.resolve().then(()=>wmi).then(function(h){return h.ajsDestinations(A,e,t.integrations,i,l,o)})]:[3,5];case 4:return E=k.sent(),[3,6];case 5:E=[],k.label=6;case 6:return B=E,e.legacyVideoPluginsEnabled?[4,Promise.resolve().then(()=>Gmi).then(function(h){return h.loadLegacyVideoPlugins(t)})]:[3,8];case 7:k.sent(),k.label=8;case 8:return!((a=i.plan)===null||a===void 0)&&a.track?[4,Promise.resolve().then(()=>Nmi).then(function(h){var N;return h.schemaFilter((N=i.plan)===null||N===void 0?void 0:N.track,e)})]:[3,10];case 9:return d=k.sent(),[3,11];case 10:d=void 0,k.label=11;case 11:return u=d,f=jde(e,i),[4,Sci(e,t.integrations,f,i,l,C).catch(function(){return[]})];case 12:return w=k.sent(),y=$n($n([Nci],B,!0),w,!0),u&&y.push(u),G=((s=i.integrations)===null||s===void 0?void 0:s.All)===!1&&!i.integrations["Segment.io"]||i.integrations&&i.integrations["Segment.io"]===!1,G?[3,14]:(x=(R=y).push,[4,Qci(t,f["Segment.io"],e.integrations)]);case 13:x.apply(R,[k.sent()]),k.label=14;case 14:return[4,t.register.apply(t,$n($n([],y,!1),r,!1))];case 15:return F=k.sent(),[4,lli(t,g)];case 16:return k.sent(),Object.entries((I=e.enabledMiddleware)!==null&&I!==void 0?I:{}).some(function(h){var N=h[1];return N})?[4,Promise.resolve().then(()=>Rmi).then(function(h){var N=h.remoteMiddlewares;return xA(Q,void 0,void 0,function(){var v,K;return ge(this,function(U){switch(U.label){case 0:return[4,N(F,e,i.obfuscate)];case 1:return v=U.sent(),K=v.map(function(V){return t.addSourceMiddleware(V)}),[2,Promise.all(K)]}})})})]:[3,18];case 17:k.sent(),k.label=18;case 18:return[4,Cli(t,g)];case 19:return k.sent(),[2,F]}})})}function Oci(A,e,t){var i,n,o,g,a,s,I,r,C;return e===void 0&&(e={}),xA(this,void 0,void 0,function(){var l,c,B,E,u,d,f,w,y,G,R;return ge(this,function(x){switch(x.label){case 0:return e.disable===!0?[2,[new Ode,ME.system()]]:(e.globalAnalyticsKey&&sli(e.globalAnalyticsKey),A.cdnURL&&pci(A.cdnURL),e.initialPageview&&t.add(new e8("page",[])),l=zci(),c=(i=A.cdnURL)!==null&&i!==void 0?i:FfA(),(n=A.cdnSettings)!==null&&n!==void 0?(E=n,[3,3]):[3,1]);case 1:return[4,Wci(A.writeKey,c)];case 2:E=x.sent(),x.label=3;case 3:return B=E,e.updateCDNSettings&&(B=e.updateCDNSettings(B)),typeof e.disable!="function"?[3,5]:[4,e.disable(B)];case 4:if(u=x.sent(),u)return[2,[new Ode,ME.system()]];x.label=5;case 5:return d=(g=(o=B.integrations["Segment.io"])===null||o===void 0?void 0:o.retryQueue)!==null&&g!==void 0?g:!0,e=vA({retryQueue:d},e),f=new _de(vA(vA({},A),{cdnSettings:B,cdnURL:c}),e),Zci(f),w=(a=A.plugins)!==null&&a!==void 0?a:[],y=(s=A.classicIntegrations)!==null&&s!==void 0?s:[],G=(I=e.integrations)===null||I===void 0?void 0:I["Segment.io"],Ede.initRemoteMetrics(vA(vA({},B.metrics),{host:(r=G==null?void 0:G.apiHost)!==null&&r!==void 0?r:(C=B.metrics)===null||C===void 0?void 0:C.host,protocol:G==null?void 0:G.protocol})),[4,_ci(A.writeKey,B,f,e,w,y,t)];case 6:return R=x.sent(),f.initialized=!0,f.emit("initialize",A,e),[4,Xci(f,l,t)];case 7:return x.sent(),[2,[f,R]]}})})}var qci=function(A){Nr(e,A);function e(){var t=this,i=AfA(),n=i.promise,o=i.resolve;return t=A.call(this,function(g){return n.then(function(a){var s=a[0],I=a[1];return Oci(s,I,g)})})||this,t._resolveLoadStart=function(g,a){return o([g,a])},t}return e.prototype.load=function(t,i){return i===void 0&&(i={}),this._resolveLoadStart(t,i),this},e.load=function(t,i){return i===void 0&&(i={}),new e().load(t,i)},e.standalone=function(t,i){return e.load({writeKey:t},i).then(function(n){return n[0]})},e}(uli);const vs=(()=>{var A="",e=!1,t;return{setUserId:g=>{A=g},setOpen:g=>{g&&(t=qci.load({writeKey:"9gxTNvl6Pl4WaZ5aymeHEBqNN8K4Op0U"})),e=g},track:(g,a)=>{e&&t.track(g,{...a,userId:A})}}})();function jci(A){if(Array.isArray(A))return A}function Pci(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ci(A){return jci(A)||FEe(A)||MEe(A)||Pci()}function the(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function ihe(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?the(Object(t),!0).forEach(function(i){JE(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):the(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}var ABi={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},eBi=function(){function A(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};YE(this,A),this.init(e,t)}return RE(A,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=t||ABi,this.options=i,this.debug=i.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,i,n,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]="".concat(n).concat(this.prefix," ").concat(t[0])),this.logger[i](t))}},{key:"create",value:function(t){return new A(this.logger,ihe(ihe({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new A(this.logger,t)}}]),A}(),ZE=new eBi,gf=function(){function A(){YE(this,A),this.observers={}}return RE(A,[{key:"on",value:function(t,i){var n=this;return t.split(" ").forEach(function(o){n.observers[o]=n.observers[o]||[],n.observers[o].push(i)}),this}},{key:"off",value:function(t,i){if(this.observers[t]){if(!i){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(function(n){return n!==i})}}},{key:"emit",value:function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];if(this.observers[t]){var g=[].concat(this.observers[t]);g.forEach(function(s){s.apply(void 0,n)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(s){s.apply(s,[t].concat(n))})}}}]),A}();function WZ(){var A,e,t=new Promise(function(i,n){A=i,e=n});return t.resolve=A,t.reject=e,t}function nhe(A){return A==null?"":""+A}function tBi(A,e,t){A.forEach(function(i){e[i]&&(t[i]=e[i])})}function SfA(A,e,t){function i(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function n(){return!A||typeof A=="string"}for(var o=typeof e!="string"?[].concat(e):e.split(".");o.length>1;){if(n())return{};var g=i(o.shift());!A[g]&&t&&(A[g]=new t),Object.prototype.hasOwnProperty.call(A,g)?A=A[g]:A={}}return n()?{}:{obj:A,k:i(o.shift())}}function ohe(A,e,t){var i=SfA(A,e,Object),n=i.obj,o=i.k;n[o]=t}function iBi(A,e,t,i){var n=SfA(A,e,Object),o=n.obj,g=n.k;o[g]=o[g]||[],i&&(o[g]=o[g].concat(t)),i||o[g].push(t)}function l8(A,e){var t=SfA(A,e),i=t.obj,n=t.k;if(i)return i[n]}function ghe(A,e,t){var i=l8(A,t);return i!==void 0?i:l8(e,t)}function ahe(A,e,t){for(var i in e)i!=="__proto__"&&i!=="constructor"&&(i in A?typeof A[i]=="string"||A[i]instanceof String||typeof e[i]=="string"||e[i]instanceof String?t&&(A[i]=e[i]):ahe(A[i],e[i],t):A[i]=e[i]);return A}function lR(A){return A.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var nBi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function oBi(A){return typeof A=="string"?A.replace(/[&<>"'\/]/g,function(e){return nBi[e]}):A}var c8=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,gBi=[" ",",","?","!",";"];function aBi(A,e,t){e=e||"",t=t||"";var i=gBi.filter(function(a){return e.indexOf(a)<0&&t.indexOf(a)<0});if(i.length===0)return!0;var n=new RegExp("(".concat(i.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!n.test(A);if(!o){var g=A.indexOf(t);g>0&&!n.test(A.substring(0,g))&&(o=!0)}return o}function she(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function B8(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?she(Object(t),!0).forEach(function(i){JE(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):she(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function sBi(A){var e=rBi();return function(){var i=xE(A),n;if(e){var o=xE(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return FZ(this,n)}}function rBi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rhe(A,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(A){if(A[e])return A[e];for(var i=e.split(t),n=A,o=0;o<i.length;++o){if(!n||typeof n[i[o]]=="string"&&o+1<i.length)return;if(n[i[o]]===void 0){for(var g=2,a=i.slice(o,o+g).join(t),s=n[a];s===void 0&&i.length>o+g;)g++,a=i.slice(o,o+g).join(t),s=n[a];if(s===void 0)return;if(s===null)return null;if(e.endsWith(a)){if(typeof s=="string")return s;if(a&&typeof s[a]=="string")return s[a]}var I=i.slice(o+g).join(t);return I?rhe(s,I,t):void 0}n=n[i[o]]}return n}}var IBi=function(A){R6(t,A);var e=sBi(t);function t(i){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return YE(this,t),n=e.call(this),c8&&gf.call(q0(n)),n.data=i||{},n.options=o,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.options.ignoreJSONStructure===void 0&&(n.options.ignoreJSONStructure=!0),n}return RE(t,[{key:"addNamespaces",value:function(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}},{key:"removeNamespaces",value:function(n){var o=this.options.ns.indexOf(n);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(n,o,g){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,I=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,r=[n,o];g&&typeof g!="string"&&(r=r.concat(g)),g&&typeof g=="string"&&(r=r.concat(s?g.split(s):g)),n.indexOf(".")>-1&&(r=n.split("."));var C=l8(this.data,r);return C||!I||typeof g!="string"?C:rhe(this.data&&this.data[n]&&this.data[n][o],g,s)}},{key:"addResource",value:function(n,o,g,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},I=this.options.keySeparator;I===void 0&&(I=".");var r=[n,o];g&&(r=r.concat(I?g.split(I):g)),n.indexOf(".")>-1&&(r=n.split("."),a=o,o=r[1]),this.addNamespaces(o),ohe(this.data,r,a),s.silent||this.emit("added",n,o,g,a)}},{key:"addResources",value:function(n,o,g){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var s in g)(typeof g[s]=="string"||Object.prototype.toString.apply(g[s])==="[object Array]")&&this.addResource(n,o,s,g[s],{silent:!0});a.silent||this.emit("added",n,o,g)}},{key:"addResourceBundle",value:function(n,o,g,a,s){var I=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},r=[n,o];n.indexOf(".")>-1&&(r=n.split("."),a=g,g=o,o=r[1]),this.addNamespaces(o);var C=l8(this.data,r)||{};a?ahe(C,g,s):C=B8(B8({},C),g),ohe(this.data,r,C),I.silent||this.emit("added",n,o,g)}},{key:"removeResourceBundle",value:function(n,o){this.hasResourceBundle(n,o)&&delete this.data[n][o],this.removeNamespaces(o),this.emit("removed",n,o)}},{key:"hasResourceBundle",value:function(n,o){return this.getResource(n,o)!==void 0}},{key:"getResourceBundle",value:function(n,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?B8(B8({},{}),this.getResource(n,o)):this.getResource(n,o)}},{key:"getDataByLanguage",value:function(n){return this.data[n]}},{key:"hasLanguageSomeTranslations",value:function(n){var o=this.getDataByLanguage(n),g=o&&Object.keys(o)||[];return!!g.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),t}(gf),Ihe={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,i,n,o){var g=this;return e.forEach(function(a){g.processors[a]&&(t=g.processors[a].process(t,i,n,o))}),t}};function Che(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function Ls(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Che(Object(t),!0).forEach(function(i){JE(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Che(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function CBi(A){var e=lBi();return function(){var i=xE(A),n;if(e){var o=xE(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return FZ(this,n)}}function lBi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var lhe={},che=function(A){R6(t,A);var e=CBi(t);function t(i){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return YE(this,t),n=e.call(this),c8&&gf.call(q0(n)),tBi(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,q0(n)),n.options=o,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.logger=ZE.create("translator"),n}return RE(t,[{key:"changeLanguage",value:function(n){n&&(this.language=n)}},{key:"exists",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(n==null)return!1;var g=this.resolve(n,o);return g&&g.res!==void 0}},{key:"extractFromKey",value:function(n,o){var g=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ns||this.options.defaultNS||[],I=g&&n.indexOf(g)>-1,r=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!aBi(n,g,a);if(I&&!r){var C=n.match(this.interpolator.nestingRegexp);if(C&&C.length>0)return{key:n,namespaces:s};var l=n.split(g);(g!==a||g===a&&this.options.ns.indexOf(l[0])>-1)&&(s=l.shift()),n=l.join(a)}return typeof s=="string"&&(s=[s]),{key:n,namespaces:s}}},{key:"translate",value:function(n,o,g){var a=this;if(uB(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),n==null)return"";Array.isArray(n)||(n=[String(n)]);var s=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,I=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,r=this.extractFromKey(n[n.length-1],o),C=r.key,l=r.namespaces,c=l[l.length-1],B=o.lng||this.language,E=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(B&&B.toLowerCase()==="cimode"){if(E){var u=o.nsSeparator||this.options.nsSeparator;return s?(d.res="".concat(c).concat(u).concat(C),d):"".concat(c).concat(u).concat(C)}return s?(d.res=C,d):C}var d=this.resolve(n,o),f=d&&d.res,w=d&&d.usedKey||C,y=d&&d.exactUsedKey||C,G=Object.prototype.toString.apply(f),R=["[object Number]","[object Function]","[object RegExp]"],x=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,F=!this.i18nFormat||this.i18nFormat.handleAsObject,Q=typeof f!="string"&&typeof f!="boolean"&&typeof f!="number";if(F&&f&&Q&&R.indexOf(G)<0&&!(typeof x=="string"&&G==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(w,f,Ls(Ls({},o),{},{ns:l})):"key '".concat(C," (").concat(this.language,")' returned an object instead of string.");return s?(d.res=k,d):k}if(I){var h=G==="[object Array]",N=h?[]:{},v=h?y:w;for(var K in f)if(Object.prototype.hasOwnProperty.call(f,K)){var U="".concat(v).concat(I).concat(K);N[K]=this.translate(U,Ls(Ls({},o),{joinArrays:!1,ns:l})),N[K]===U&&(N[K]=f[K])}f=N}}else if(F&&typeof x=="string"&&G==="[object Array]")f=f.join(x),f&&(f=this.extendTranslation(f,n,o,g));else{var V=!1,X=!1,_=o.count!==void 0&&typeof o.count!="string",q=t.hasDefaultValue(o),$=_?this.pluralResolver.getSuffix(B,o.count,o):"",nA=o["defaultValue".concat($)]||o.defaultValue;!this.isValidLookup(f)&&q&&(V=!0,f=nA),this.isValidLookup(f)||(X=!0,f=C);var j=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,O=j&&X?void 0:f,eA=q&&nA!==f&&this.options.updateMissing;if(X||V||eA){if(this.logger.log(eA?"updateKey":"missingKey",B,c,C,eA?nA:f),I){var oA=this.resolve(C,Ls(Ls({},o),{},{keySeparator:!1}));oA&&oA.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var tA=[],sA=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&sA&&sA[0])for(var gA=0;gA<sA.length;gA++)tA.push(sA[gA]);else this.options.saveMissingTo==="all"?tA=this.languageUtils.toResolveHierarchy(o.lng||this.language):tA.push(o.lng||this.language);var iA=function(lA,CA,QA){var uA=q&&QA!==f?QA:O;a.options.missingKeyHandler?a.options.missingKeyHandler(lA,c,CA,uA,eA,o):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(lA,c,CA,uA,eA,o),a.emit("missingKey",lA,c,CA,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&_?tA.forEach(function(aA){a.pluralResolver.getSuffixes(aA,o).forEach(function(lA){iA([aA],C+lA,o["defaultValue".concat(lA)]||nA)})}):iA(tA,C,nA))}f=this.extendTranslation(f,n,o,d,g),X&&f===C&&this.options.appendNamespaceToMissingKey&&(f="".concat(c,":").concat(C)),(X||V)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(c,":").concat(C):C,V?f:void 0):f=this.options.parseMissingKeyHandler(f))}return s?(d.res=f,d):f}},{key:"extendTranslation",value:function(n,o,g,a,s){var I=this;if(this.i18nFormat&&this.i18nFormat.parse)n=this.i18nFormat.parse(n,Ls(Ls({},this.options.interpolation.defaultVariables),g),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!g.skipInterpolation){g.interpolation&&this.interpolator.init(Ls(Ls({},g),{interpolation:Ls(Ls({},this.options.interpolation),g.interpolation)}));var r=typeof n=="string"&&(g&&g.interpolation&&g.interpolation.skipOnVariables!==void 0?g.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),C;if(r){var l=n.match(this.interpolator.nestingRegexp);C=l&&l.length}var c=g.replace&&typeof g.replace!="string"?g.replace:g;if(this.options.interpolation.defaultVariables&&(c=Ls(Ls({},this.options.interpolation.defaultVariables),c)),n=this.interpolator.interpolate(n,c,g.lng||this.language,g),r){var B=n.match(this.interpolator.nestingRegexp),E=B&&B.length;C<E&&(g.nest=!1)}g.nest!==!1&&(n=this.interpolator.nest(n,function(){for(var f=arguments.length,w=new Array(f),y=0;y<f;y++)w[y]=arguments[y];return s&&s[0]===w[0]&&!g.context?(I.logger.warn("It seems you are nesting recursively key: ".concat(w[0]," in key: ").concat(o[0])),null):I.translate.apply(I,w.concat([o]))},g)),g.interpolation&&this.interpolator.reset()}var u=g.postProcess||this.options.postProcess,d=typeof u=="string"?[u]:u;return n!=null&&d&&d.length&&g.applyPostProcessor!==!1&&(n=Ihe.handle(d,n,o,this.options&&this.options.postProcessPassResolved?Ls({i18nResolved:a},g):g,this)),n}},{key:"resolve",value:function(n){var o=this,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,s,I,r,C;return typeof n=="string"&&(n=[n]),n.forEach(function(l){if(!o.isValidLookup(a)){var c=o.extractFromKey(l,g),B=c.key;s=B;var E=c.namespaces;o.options.fallbackNS&&(E=E.concat(o.options.fallbackNS));var u=g.count!==void 0&&typeof g.count!="string",d=u&&!g.ordinal&&g.count===0&&o.pluralResolver.shouldUseIntlApi(),f=g.context!==void 0&&(typeof g.context=="string"||typeof g.context=="number")&&g.context!=="",w=g.lngs?g.lngs:o.languageUtils.toResolveHierarchy(g.lng||o.language,g.fallbackLng);E.forEach(function(y){o.isValidLookup(a)||(C=y,!lhe["".concat(w[0],"-").concat(y)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(C)&&(lhe["".concat(w[0],"-").concat(y)]=!0,o.logger.warn('key "'.concat(s,'" for languages "').concat(w.join(", "),`" won't get resolved as namespace "`).concat(C,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),w.forEach(function(G){if(!o.isValidLookup(a)){r=G;var R=[B];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(R,B,G,y,g);else{var x;u&&(x=o.pluralResolver.getSuffix(G,g.count,g));var F="".concat(o.options.pluralSeparator,"zero");if(u&&(R.push(B+x),d&&R.push(B+F)),f){var Q="".concat(B).concat(o.options.contextSeparator).concat(g.context);R.push(Q),u&&(R.push(Q+x),d&&R.push(Q+F))}}for(var k;k=R.pop();)o.isValidLookup(a)||(I=k,a=o.getResource(G,y,k,g))}}))})}}),{res:a,usedKey:s,exactUsedKey:I,usedLng:r,usedNS:C}}},{key:"isValidLookup",value:function(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}},{key:"getResource",value:function(n,o,g){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(n,o,g,a):this.resourceStore.getResource(n,o,g,a)}}],[{key:"hasDefaultValue",value:function(n){var o="defaultValue";for(var g in n)if(Object.prototype.hasOwnProperty.call(n,g)&&o===g.substring(0,o.length)&&n[g]!==void 0)return!0;return!1}}]),t}(gf);function HfA(A){return A.charAt(0).toUpperCase()+A.slice(1)}var cBi=function(){function A(e){YE(this,A),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ZE.create("languageUtils")}return RE(A,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var i=t.split("-");return this.formatLanguageCode(i[0])}},{key:"formatLanguageCode",value:function(t){if(typeof t=="string"&&t.indexOf("-")>-1){var i=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map(function(o){return o.toLowerCase()}):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=HfA(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=HfA(n[1].toLowerCase())),i.indexOf(n[2].toLowerCase())>-1&&(n[2]=HfA(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var i=this;if(!t)return null;var n;return t.forEach(function(o){if(!n){var g=i.formatLanguageCode(o);(!i.options.supportedLngs||i.isSupportedCode(g))&&(n=g)}}),!n&&this.options.supportedLngs&&t.forEach(function(o){if(!n){var g=i.getLanguagePartFromCode(o);if(i.isSupportedCode(g))return n=g;n=i.options.supportedLngs.find(function(a){if(a.indexOf(g)===0)return a})}}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}},{key:"getFallbackCodes",value:function(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!i)return t.default||[];var n=t[i];return n||(n=t[this.getScriptPartFromCode(i)]),n||(n=t[this.formatLanguageCode(i)]),n||(n=t[this.getLanguagePartFromCode(i)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,i){var n=this,o=this.getFallbackCodes(i||this.options.fallbackLng||[],t),g=[],a=function(I){I&&(n.isSupportedCode(I)?g.push(I):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(I)))};return typeof t=="string"&&t.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):typeof t=="string"&&a(this.formatLanguageCode(t)),o.forEach(function(s){g.indexOf(s)<0&&a(n.formatLanguageCode(s))}),g}}]),A}(),BBi=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],QBi={1:function(e){return Number(e>1)},2:function(e){return Number(e!=1)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(e==1?0:e>=2&&e<=4?1:2)},7:function(e){return Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(e==1?0:e==2?1:e!=8&&e!=11?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(e==1?0:e==2?1:e<7?2:e<11?3:4)},11:function(e){return Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(e!==0)},14:function(e){return Number(e==1?0:e==2?1:e==3?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:e!==0?1:2)},17:function(e){return Number(e==1||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(e==0?0:e==1?1:2)},19:function(e){return Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(e==1?0:e==0||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)}},EBi=["v1","v2","v3"],Bhe={zero:0,one:1,two:2,few:3,many:4,other:5};function uBi(){var A={};return BBi.forEach(function(e){e.lngs.forEach(function(t){A[t]={numbers:e.nr,plurals:QBi[e.fc]}})}),A}var dBi=function(){function A(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};YE(this,A),this.languageUtils=e,this.options=t,this.logger=ZE.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=uBi()}return RE(A,[{key:"addRule",value:function(t,i){this.rules[t]=i}},{key:"getRule",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:i.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(t,i);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(function(o){return"".concat(i).concat(o)})}},{key:"getSuffixes",value:function(t){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(t,n);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(g,a){return Bhe[g]-Bhe[a]}).map(function(g){return"".concat(i.options.prepend).concat(g)}):o.numbers.map(function(g){return i.getSuffix(t,g,n)}):[]}},{key:"getSuffix",value:function(t,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(t,n);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(i)):this.getSuffixRetroCompatible(o,i):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,i){var n=this,o=t.noAbs?t.plurals(i):t.plurals(Math.abs(i)),g=t.numbers[o];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(g===2?g="plural":g===1&&(g=""));var a=function(){return n.options.prepend&&g.toString()?n.options.prepend+g.toString():g.toString()};return this.options.compatibilityJSON==="v1"?g===1?"":typeof g=="number"?"_plural_".concat(g.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!EBi.includes(this.options.compatibilityJSON)}}]),A}();function Qhe(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function pB(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qhe(Object(t),!0).forEach(function(i){JE(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Qhe(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}var hBi=function(){function A(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};YE(this,A),this.logger=ZE.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return RE(A,[{key:"init",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var i=t.interpolation;this.escape=i.escape!==void 0?i.escape:oBi,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?lR(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?lR(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?lR(i.nestingPrefix):i.nestingPrefixEscaped||lR("$t("),this.nestingSuffix=i.nestingSuffix?lR(i.nestingSuffix):i.nestingSuffixEscaped||lR(")"),this.nestingOptionsSeparator=i.nestingOptionsSeparator?i.nestingOptionsSeparator:i.nestingOptionsSeparator||",",this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.alwaysFormat=i.alwaysFormat!==void 0?i.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var i="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(i,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,i,n,o){var g=this,a,s,I,r=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function C(u){return u.replace(/\$/g,"$$$$")}var l=function(d){if(d.indexOf(g.formatSeparator)<0){var f=ghe(i,r,d);return g.alwaysFormat?g.format(f,void 0,n,pB(pB(pB({},o),i),{},{interpolationkey:d})):f}var w=d.split(g.formatSeparator),y=w.shift().trim(),G=w.join(g.formatSeparator).trim();return g.format(ghe(i,r,y),G,n,pB(pB(pB({},o),i),{},{interpolationkey:y}))};this.resetRegExp();var c=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,B=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,E=[{regex:this.regexpUnescape,safeValue:function(d){return C(d)}},{regex:this.regexp,safeValue:function(d){return g.escapeValue?C(g.escape(d)):C(d)}}];return E.forEach(function(u){for(I=0;a=u.regex.exec(t);){var d=a[1].trim();if(s=l(d),s===void 0)if(typeof c=="function"){var f=c(t,a,o);s=typeof f=="string"?f:""}else if(o&&o.hasOwnProperty(d))s="";else if(B){s=a[0];continue}else g.logger.warn("missed to pass in variable ".concat(d," for interpolating ").concat(t)),s="";else typeof s!="string"&&!g.useRawValueToEscape&&(s=nhe(s));var w=u.safeValue(s);if(t=t.replace(a[0],w),B?(u.regex.lastIndex+=s.length,u.regex.lastIndex-=a[0].length):u.regex.lastIndex=0,I++,I>=g.maxReplaces)break}}),t}},{key:"nest",value:function(t,i){var n=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},g,a,s=pB({},o);s.applyPostProcessor=!1,delete s.defaultValue;function I(c,B){var E=this.nestingOptionsSeparator;if(c.indexOf(E)<0)return c;var u=c.split(new RegExp("".concat(E,"[ ]*{"))),d="{".concat(u[1]);c=u[0],d=this.interpolate(d,s);var f=d.match(/'/g),w=d.match(/"/g);(f&&f.length%2===0&&!w||w.length%2!==0)&&(d=d.replace(/'/g,'"'));try{s=JSON.parse(d),B&&(s=pB(pB({},B),s))}catch(y){return this.logger.warn("failed parsing options string in nesting for key ".concat(c),y),"".concat(c).concat(E).concat(d)}return delete s.defaultValue,c}for(;g=this.nestingRegexp.exec(t);){var r=[],C=!1;if(g[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(g[1])){var l=g[1].split(this.formatSeparator).map(function(c){return c.trim()});g[1]=l.shift(),r=l,C=!0}if(a=i(I.call(this,g[1].trim(),s),s),a&&g[0]===t&&typeof a!="string")return a;typeof a!="string"&&(a=nhe(a)),a||(this.logger.warn("missed to resolve ".concat(g[1]," for nesting ").concat(t)),a=""),C&&(a=r.reduce(function(c,B){return n.format(c,B,o.lng,pB(pB({},o),{},{interpolationkey:g[1].trim()}))},a.trim())),t=t.replace(g[0],a),this.regexp.lastIndex=0}return t}}]),A}();function Ehe(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function af(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ehe(Object(t),!0).forEach(function(i){JE(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Ehe(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function mBi(A){var e=A.toLowerCase().trim(),t={};if(A.indexOf("(")>-1){var i=A.split("(");e=i[0].toLowerCase().trim();var n=i[1].substring(0,i[1].length-1);if(e==="currency"&&n.indexOf(":")<0)t.currency||(t.currency=n.trim());else if(e==="relativetime"&&n.indexOf(":")<0)t.range||(t.range=n.trim());else{var o=n.split(";");o.forEach(function(g){if(g){var a=g.split(":"),s=$ci(a),I=s[0],r=s.slice(1),C=r.join(":").trim().replace(/^'+|'+$/g,"");t[I.trim()]||(t[I.trim()]=C),C==="false"&&(t[I.trim()]=!1),C==="true"&&(t[I.trim()]=!0),isNaN(C)||(t[I.trim()]=parseInt(C,10))}})}}return{formatName:e,formatOptions:t}}function cR(A){var e={};return function(i,n,o){var g=n+JSON.stringify(o),a=e[g];return a||(a=A(n,o),e[g]=a),a(i)}}var pBi=function(){function A(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};YE(this,A),this.logger=ZE.create("formatter"),this.options=e,this.formats={number:cR(function(t,i){var n=new Intl.NumberFormat(t,i);return function(o){return n.format(o)}}),currency:cR(function(t,i){var n=new Intl.NumberFormat(t,af(af({},i),{},{style:"currency"}));return function(o){return n.format(o)}}),datetime:cR(function(t,i){var n=new Intl.DateTimeFormat(t,af({},i));return function(o){return n.format(o)}}),relativetime:cR(function(t,i){var n=new Intl.RelativeTimeFormat(t,af({},i));return function(o){return n.format(o,i.range||"day")}}),list:cR(function(t,i){var n=new Intl.ListFormat(t,af({},i));return function(o){return n.format(o)}})},this.init(e)}return RE(A,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},n=i.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(t,i){this.formats[t.toLowerCase().trim()]=i}},{key:"addCached",value:function(t,i){this.formats[t.toLowerCase().trim()]=cR(i)}},{key:"format",value:function(t,i,n,o){var g=this,a=i.split(this.formatSeparator),s=a.reduce(function(I,r){var C=mBi(r),l=C.formatName,c=C.formatOptions;if(g.formats[l]){var B=I;try{var E=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},u=E.locale||E.lng||o.locale||o.lng||n;B=g.formats[l](I,u,af(af(af({},c),o),E))}catch(d){g.logger.warn(d)}return B}else g.logger.warn("there was no format function for ".concat(l));return I},t);return s}}]),A}();function uhe(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function dhe(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uhe(Object(t),!0).forEach(function(i){JE(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):uhe(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function fBi(A){var e=yBi();return function(){var i=xE(A),n;if(e){var o=xE(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return FZ(this,n)}}function yBi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function bBi(A,e){A.pending[e]!==void 0&&(delete A.pending[e],A.pendingCount--)}var wBi=function(A){R6(t,A);var e=fBi(t);function t(i,n,o){var g,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return YE(this,t),g=e.call(this),c8&&gf.call(q0(g)),g.backend=i,g.store=n,g.services=o,g.languageUtils=o.languageUtils,g.options=a,g.logger=ZE.create("backendConnector"),g.waitingReads=[],g.maxParallelReads=a.maxParallelReads||10,g.readingCalls=0,g.maxRetries=a.maxRetries>=0?a.maxRetries:5,g.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,g.state={},g.queue=[],g.backend&&g.backend.init&&g.backend.init(o,a.backend,a),g}return RE(t,[{key:"queueLoad",value:function(n,o,g,a){var s=this,I={},r={},C={},l={};return n.forEach(function(c){var B=!0;o.forEach(function(E){var u="".concat(c,"|").concat(E);!g.reload&&s.store.hasResourceBundle(c,E)?s.state[u]=2:s.state[u]<0||(s.state[u]===1?r[u]===void 0&&(r[u]=!0):(s.state[u]=1,B=!1,r[u]===void 0&&(r[u]=!0),I[u]===void 0&&(I[u]=!0),l[E]===void 0&&(l[E]=!0)))}),B||(C[c]=!0)}),(Object.keys(I).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(I),pending:Object.keys(r),toLoadLanguages:Object.keys(C),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(n,o,g){var a=n.split("|"),s=a[0],I=a[1];o&&this.emit("failedLoading",s,I,o),g&&this.store.addResourceBundle(s,I,g),this.state[n]=o?-1:2;var r={};this.queue.forEach(function(C){iBi(C.loaded,[s],I),bBi(C,n),o&&C.errors.push(o),C.pendingCount===0&&!C.done&&(Object.keys(C.loaded).forEach(function(l){r[l]||(r[l]={});var c=C.loaded[l];c.length&&c.forEach(function(B){r[l][B]===void 0&&(r[l][B]=!0)})}),C.done=!0,C.errors.length?C.callback(C.errors):C.callback())}),this.emit("loaded",r),this.queue=this.queue.filter(function(C){return!C.done})}},{key:"read",value:function(n,o,g){var a=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,r=arguments.length>5?arguments[5]:void 0;if(!n.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:n,ns:o,fcName:g,tried:s,wait:I,callback:r});return}return this.readingCalls++,this.backend[g](n,o,function(C,l){if(a.readingCalls--,a.waitingReads.length>0){var c=a.waitingReads.shift();a.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(C&&l&&s<a.maxRetries){setTimeout(function(){a.read.call(a,n,o,g,s+1,I*2,r)},I);return}r(C,l)})}},{key:"prepareLoading",value:function(n,o){var g=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof n=="string"&&(n=this.languageUtils.toResolveHierarchy(n)),typeof o=="string"&&(o=[o]);var I=this.queueLoad(n,o,a,s);if(!I.toLoad.length)return I.pending.length||s(),null;I.toLoad.forEach(function(r){g.loadOne(r)})}},{key:"load",value:function(n,o,g){this.prepareLoading(n,o,{},g)}},{key:"reload",value:function(n,o,g){this.prepareLoading(n,o,{reload:!0},g)}},{key:"loadOne",value:function(n){var o=this,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=n.split("|"),s=a[0],I=a[1];this.read(s,I,"read",void 0,void 0,function(r,C){r&&o.logger.warn("".concat(g,"loading namespace ").concat(I," for language ").concat(s," failed"),r),!r&&C&&o.logger.log("".concat(g,"loaded namespace ").concat(I," for language ").concat(s),C),o.loaded(n,r,C)})}},{key:"saveMissing",value:function(n,o,g,a,s){var I=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(g,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}g==null||g===""||(this.backend&&this.backend.create&&this.backend.create(n,o,g,a,null,dhe(dhe({},I),{},{isUpdate:s})),!(!n||!n[0])&&this.store.addResource(n[0],o,g,a))}}]),t}(gf);function DBi(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if(uB(e[1])==="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),uB(e[2])==="object"||uB(e[3])==="object"){var i=e[3]||e[2];Object.keys(i).forEach(function(n){t[n]=i[n]})}return t},interpolation:{escapeValue:!0,format:function(e,t,i,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function hhe(A){return typeof A.ns=="string"&&(A.ns=[A.ns]),typeof A.fallbackLng=="string"&&(A.fallbackLng=[A.fallbackLng]),typeof A.fallbackNS=="string"&&(A.fallbackNS=[A.fallbackNS]),A.supportedLngs&&A.supportedLngs.indexOf("cimode")<0&&(A.supportedLngs=A.supportedLngs.concat(["cimode"])),A}function mhe(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,i)}return t}function WE(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mhe(Object(t),!0).forEach(function(i){JE(A,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):mhe(Object(t)).forEach(function(i){Object.defineProperty(A,i,Object.getOwnPropertyDescriptor(t,i))})}return A}function GBi(A){var e=kBi();return function(){var i=xE(A),n;if(e){var o=xE(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return FZ(this,n)}}function kBi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Q8(){}function JBi(A){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(A));e.forEach(function(t){typeof A[t]=="function"&&(A[t]=A[t].bind(A))})}var E8=function(A){R6(t,A);var e=GBi(t);function t(){var i,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(YE(this,t),i=e.call(this),c8&&gf.call(q0(i)),i.options=hhe(n),i.services={},i.logger=ZE,i.modules={external:[]},JBi(q0(i)),o&&!i.isInitialized&&!n.isClone){if(!i.options.initImmediate)return i.init(n,o),FZ(i,q0(i));setTimeout(function(){i.init(n,o)},0)}return i}return RE(t,[{key:"init",value:function(){var n=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(g=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=DBi();this.options=WE(WE(WE({},a),this.options),hhe(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=WE(WE({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function s(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?ZE.init(s(this.modules.logger),this.options):ZE.init(null,this.options);var I;this.modules.formatter?I=this.modules.formatter:typeof Intl<"u"&&(I=pBi);var r=new cBi(this.options);this.store=new IBi(this.options.resources,this.options);var C=this.services;C.logger=ZE,C.resourceStore=this.store,C.languageUtils=r,C.pluralResolver=new dBi(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),I&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(C.formatter=s(I),C.formatter.init(C,this.options),this.options.interpolation.format=C.formatter.format.bind(C.formatter)),C.interpolator=new hBi(this.options),C.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},C.backendConnector=new wBi(s(this.modules.backend),C.resourceStore,C,this.options),C.backendConnector.on("*",function(d){for(var f=arguments.length,w=new Array(f>1?f-1:0),y=1;y<f;y++)w[y-1]=arguments[y];n.emit.apply(n,[d].concat(w))}),this.modules.languageDetector&&(C.languageDetector=s(this.modules.languageDetector),C.languageDetector.init(C,this.options.detection,this.options)),this.modules.i18nFormat&&(C.i18nFormat=s(this.modules.i18nFormat),C.i18nFormat.init&&C.i18nFormat.init(this)),this.translator=new che(this.services,this.options),this.translator.on("*",function(d){for(var f=arguments.length,w=new Array(f>1?f-1:0),y=1;y<f;y++)w[y-1]=arguments[y];n.emit.apply(n,[d].concat(w))}),this.modules.external.forEach(function(d){d.init&&d.init(n)})}if(this.format=this.options.interpolation.format,g||(g=Q8),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach(function(d){n[d]=function(){var f;return(f=n.store)[d].apply(f,arguments)}});var B=["addResource","addResources","addResourceBundle","removeResourceBundle"];B.forEach(function(d){n[d]=function(){var f;return(f=n.store)[d].apply(f,arguments),n}});var E=WZ(),u=function(){var f=function(y,G){n.isInitialized&&!n.initializedStoreOnce&&n.logger.warn("init: i18next is already initialized. You should call init just once!"),n.isInitialized=!0,n.options.isClone||n.logger.log("initialized",n.options),n.emit("initialized",n.options),E.resolve(G),g(y,G)};if(n.languages&&n.options.compatibilityAPI!=="v1"&&!n.isInitialized)return f(null,n.t.bind(n));n.changeLanguage(n.options.lng,f)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),E}},{key:"loadResources",value:function(n){var o=this,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q8,a=g,s=typeof n=="string"?n:this.language;if(typeof n=="function"&&(a=n),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode")return a();var I=[],r=function(c){if(c){var B=o.services.languageUtils.toResolveHierarchy(c);B.forEach(function(E){I.indexOf(E)<0&&I.push(E)})}};if(s)r(s);else{var C=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);C.forEach(function(l){return r(l)})}this.options.preload&&this.options.preload.forEach(function(l){return r(l)}),this.services.backendConnector.load(I,this.options.ns,function(l){!l&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(l)})}else a(null)}},{key:"reloadResources",value:function(n,o,g){var a=WZ();return n||(n=this.languages),o||(o=this.options.ns),g||(g=Q8),this.services.backendConnector.reload(n,o,function(s){a.resolve(),g(s)}),a}},{key:"use",value:function(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&Ihe.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}},{key:"setResolvedLanguage",value:function(n){if(!(!n||!this.languages)&&!(["cimode","dev"].indexOf(n)>-1))for(var o=0;o<this.languages.length;o++){var g=this.languages[o];if(!(["cimode","dev"].indexOf(g)>-1)&&this.store.hasLanguageSomeTranslations(g)){this.resolvedLanguage=g;break}}}},{key:"changeLanguage",value:function(n,o){var g=this;this.isLanguageChangingTo=n;var a=WZ();this.emit("languageChanging",n);var s=function(l){g.language=l,g.languages=g.services.languageUtils.toResolveHierarchy(l),g.resolvedLanguage=void 0,g.setResolvedLanguage(l)},I=function(l,c){c?(s(c),g.translator.changeLanguage(c),g.isLanguageChangingTo=void 0,g.emit("languageChanged",c),g.logger.log("languageChanged",c)):g.isLanguageChangingTo=void 0,a.resolve(function(){return g.t.apply(g,arguments)}),o&&o(l,function(){return g.t.apply(g,arguments)})},r=function(l){!n&&!l&&g.services.languageDetector&&(l=[]);var c=typeof l=="string"?l:g.services.languageUtils.getBestMatchFromCodes(l);c&&(g.language||s(c),g.translator.language||g.translator.changeLanguage(c),g.services.languageDetector&&g.services.languageDetector.cacheUserLanguage(c)),g.loadResources(c,function(B){I(B,c)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?r(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(r):r(n),a}},{key:"getFixedT",value:function(n,o,g){var a=this,s=function I(r,C){var l;if(uB(C)!=="object"){for(var c=arguments.length,B=new Array(c>2?c-2:0),E=2;E<c;E++)B[E-2]=arguments[E];l=a.options.overloadTranslationOptionHandler([r,C].concat(B))}else l=WE({},C);l.lng=l.lng||I.lng,l.lngs=l.lngs||I.lngs,l.ns=l.ns||I.ns,l.keyPrefix=l.keyPrefix||g||I.keyPrefix;var u=a.options.keySeparator||".",d=l.keyPrefix?"".concat(l.keyPrefix).concat(u).concat(r):r;return a.t(d,l)};return typeof n=="string"?s.lng=n:s.lngs=n,s.ns=o,s.keyPrefix=g,s}},{key:"t",value:function(){var n;return this.translator&&(n=this.translator).translate.apply(n,arguments)}},{key:"exists",value:function(){var n;return this.translator&&(n=this.translator).exists.apply(n,arguments)}},{key:"setDefaultNamespace",value:function(n){this.options.defaultNS=n}},{key:"hasLoadedNamespace",value:function(n){var o=this,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,I=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var r=function(c,B){var E=o.services.backendConnector.state["".concat(c,"|").concat(B)];return E===-1||E===2};if(g.precheck){var C=g.precheck(this,r);if(C!==void 0)return C}return!!(this.hasResourceBundle(a,n)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||r(a,n)&&(!s||r(I,n)))}},{key:"loadNamespaces",value:function(n,o){var g=this,a=WZ();return this.options.ns?(typeof n=="string"&&(n=[n]),n.forEach(function(s){g.options.ns.indexOf(s)<0&&g.options.ns.push(s)}),this.loadResources(function(s){a.resolve(),o&&o(s)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(n,o){var g=WZ();typeof n=="string"&&(n=[n]);var a=this.options.preload||[],s=n.filter(function(I){return a.indexOf(I)<0});return s.length?(this.options.preload=a.concat(s),this.loadResources(function(I){g.resolve(),o&&o(I)}),g):(o&&o(),Promise.resolve())}},{key:"dir",value:function(n){if(n||(n=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!n)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var n=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q8,a=WE(WE(WE({},this.options),o),{isClone:!0}),s=new t(a);(o.debug!==void 0||o.prefix!==void 0)&&(s.logger=s.logger.clone(o));var I=["store","services","language"];return I.forEach(function(r){s[r]=n[r]}),s.services=WE({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new che(s.services,s.options),s.translator.on("*",function(r){for(var C=arguments.length,l=new Array(C>1?C-1:0),c=1;c<C;c++)l[c-1]=arguments[c];s.emit.apply(s,[r].concat(l))}),s.init(a,g),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),t}(gf);JE(E8,"createInstance",function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new E8(A,e)});var Ur=E8.createInstance();Ur.createInstance=E8.createInstance,Ur.createInstance,Ur.init,Ur.loadResources,Ur.reloadResources,Ur.use,Ur.changeLanguage,Ur.getFixedT,Ur.t,Ur.exists,Ur.setDefaultNamespace,Ur.hasLoadedNamespace,Ur.loadNamespaces,Ur.loadLanguages;const NBi="gw_count_fid",u8="gw_mea_key_fid",BR="gw_mea_val_fid",gD="gw_paint_fid";function ZfA(A,e){return!e||e==="expr"?A:`${A}_${e}`}function YBi(A){return A.enableAgg&&A.aggName?ZfA(A.fid,A.aggName):A.fid}function RBi({rows:A,columns:e}){return A.length&&!A.find(t=>t.analyticType==="measure")?A[A.length-1].sort||"none":e.length&&!e.find(t=>t.analyticType==="measure")&&e[e.length-1].sort||"none"}const phe=A=>A!=null;function fhe(A,e){if(A.length!==e.length)return!1;for(let t=0;t<A.length;t++)if(A[t]!==e[t])return!1;return!0}const WfA={AGGREGATOR_LIST:["sum","mean","median","count","min","max","variance","stdev"],CHART_LAYOUT_TYPE:["auto","fixed","full"],COORD_TYPES:["generic","geographic"],GEOM_TYPES:{generic:["auto","bar","line","area","trail","point","circle","tick","rect","arc","text","boxplot","table"],geographic:["poi","choropleth"]},MAX_HISTORY_SIZE:20,STACK_MODE:["none","stack","normalize","center"],META_FIELD_KEYS:["dimensions","measures"],CHANNEL_LIMIT:{rows:1/0,columns:1/0,color:1,opacity:1,size:1,shape:1,theta:1,radius:1,details:1/0,text:1},POSITION_CHANNEL_CONFIG_LIST:["x","y"],NON_POSITION_CHANNEL_CONFIG_LIST:["color","opacity","shape","size"],EMBEDED_MENU_LIST:["data_interpretation","data_view"],RENDERER_TYPES:["vega-lite","observable-plot"],PAINT_MAP_SIZE:128,PAINT_SIZE_FACTOR:4,PAINT_MIN_BRUSH_SIZE:1,PAINT_DEFAULT_BRUSH_SIZE:9,PAINT_MAX_BRUSH_SIZE:36,KEYWORD_DEBOUNCE_SETTING:{timeout:300,leading:!0,trailing:!0}};function xBi(){return{dimensions:[],measures:[],rows:[],columns:[],color:[],opacity:[],size:[],shape:[],radius:[],theta:[],longitude:[],latitude:[],geoId:[],details:[],filters:[],text:[]}}function FBi(){const[A]=WfA.GEOM_TYPES.generic;return{defaultAggregated:!0,geoms:[A],showTableSummary:!1,coordSystem:"generic",stack:"stack",showActions:!1,interactiveScale:!1,sorted:"none",zeroScale:!0,scaleIncludeUnmatchedChoropleth:!1,background:void 0,size:{mode:"auto",width:320,height:200},format:{numberFormat:void 0,timeFormat:void 0,normalizedNumberFormat:void 0},geoKey:"name",resolve:{x:!1,y:!1,color:!1,opacity:!1,shape:!1,size:!1},limit:-1}}const yhe={showActions:!1,showTableSummary:!1,stack:"stack",interactiveScale:!1,zeroScale:!0,background:void 0,size:{mode:"auto",width:320,height:200},format:{numberFormat:void 0,timeFormat:void 0,normalizedNumberFormat:void 0},geoKey:"name",resolve:{x:!1,y:!1,color:!1,opacity:!1,shape:!1,size:!1},renderer:"vega-lite"},bhe={defaultAggregated:!0,geoms:[WfA.GEOM_TYPES.generic[0]],coordSystem:"generic",limit:-1},MBi={dimensions:[],measures:[],rows:[],columns:[],color:[],opacity:[],size:[],shape:[],radius:[],theta:[],longitude:[],latitude:[],geoId:[],details:[],filters:[],text:[]};function vBi(A){return{...A,encodings:{...xBi(),...A.encodings}}}const LBi=A=>({...A,config:{...FBi(),...A.config}});let whe=(A=21)=>crypto.getRandomValues(new Uint8Array(A)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");function SBi(){return"gw_"+whe(4)}const d8=(A,e,t)=>t===A.length?A.concat([e]):A.flatMap((i,n)=>n===t?[e,i]:[i]),Dhe=(A,e)=>A.filter((t,i)=>i!==e),sf=(A,e,t)=>A.map((i,n)=>n===e?t(i):i);function ni(A,e,t){const i=(n,o,g)=>{const[a,...s]=o;return s.length===0?{...n,[a]:g(n[a])}:{...n,[a]:i(n[a],s,g)}};return i(A,e.split("."),t)}const HBi=A=>Math.floor(Math.sqrt(2*A));function ZBi(A){return(e,t)=>{const{base:i,cache:n,cursor:o,now:g,timeline:a}=e;return{base:i,now:A(g,t),cursor:o+1,cache:o-n.cursor>HBi(o)?{value:A(n.value,a[n.cursor]),cursor:n.cursor+1}:n,timeline:a.slice(0,o).concat([t])}}}const KE={measureAfterDimension(A){return A.filter(e=>e.analyticType==="dimension").concat(A.filter(e=>e.analyticType==="measure"))},crossLimit(A){return function(e){let t=0;return e.reduce((i,n)=>(n.analyticType==="dimension"&&t<A&&(i.push(n),t++),n.analyticType==="measure"&&i.push(n),i),[])}},forceAnalyticType(A){return function(e){return e.map(t=>({...t,analyticType:A}))}},forceSemanticType(A){return function(e){return e.map(t=>({...t,semanticType:A}))}}};function h8(A,e){return e.reduce((t,i)=>i(t),A)}function Ghe(A,e){const t={};return e.rows&&e.rows.length>0&&(t.rows=h8(e.rows,[KE.measureAfterDimension,KE.crossLimit(A==="table"?1/0:2)])),e.columns&&e.columns.length>0&&(t.columns=h8(e.columns,[KE.measureAfterDimension,KE.crossLimit(A==="table"?1/0:2)])),e.latitude&&e.latitude.length>0&&(t.latitude=h8(e.latitude,[KE.forceAnalyticType("dimension"),KE.forceSemanticType("quantitative"),KE.crossLimit(1)])),e.longitude&&e.longitude.length>0&&(t.longitude=h8(e.longitude,[KE.forceAnalyticType("dimension"),KE.forceSemanticType("quantitative"),KE.crossLimit(1)])),t}var KZ={},m8={},WBi={get exports(){return m8},set exports(A){m8=A}},khe;function KBi(){return khe||(khe=1,function(A){(function(e,t){A.exports?A.exports=t():e.moo=t()})(hi,function(){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,i=typeof new RegExp().sticky=="boolean";function n(h){return h&&t.call(h)==="[object RegExp]"}function o(h){return h&&typeof h=="object"&&!n(h)&&!Array.isArray(h)}function g(h){return h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(h){var N=new RegExp("|"+h);return N.exec("").length-1}function s(h){return"("+h+")"}function I(h){if(!h.length)return"(?!)";var N=h.map(function(v){return"(?:"+v+")"}).join("|");return"(?:"+N+")"}function r(h){if(typeof h=="string")return"(?:"+g(h)+")";if(n(h)){if(h.ignoreCase)throw new Error("RegExp /i flag not allowed");if(h.global)throw new Error("RegExp /g flag is implied");if(h.sticky)throw new Error("RegExp /y flag is implied");if(h.multiline)throw new Error("RegExp /m flag is implied");return h.source}else throw new Error("Not a pattern: "+h)}function C(h,N){return h.length>N?h:Array(N-h.length+1).join(" ")+h}function l(h,N){for(var v=h.length,K=0;;){var U=h.lastIndexOf(`
`,v-1);if(U===-1||(K++,v=U,K===N)||v===0)break}var V=K<N?0:v+1;return h.substring(V).split(`
`)}function c(h){for(var N=Object.getOwnPropertyNames(h),v=[],K=0;K<N.length;K++){var U=N[K],V=h[U],X=[].concat(V);if(U==="include"){for(var _=0;_<X.length;_++)v.push({include:X[_]});continue}var q=[];X.forEach(function($){o($)?(q.length&&v.push(E(U,q)),v.push(E(U,$)),q=[]):q.push($)}),q.length&&v.push(E(U,q))}return v}function B(h){for(var N=[],v=0;v<h.length;v++){var K=h[v];if(K.include){for(var U=[].concat(K.include),V=0;V<U.length;V++)N.push({include:U[V]});continue}if(!K.type)throw new Error("Rule has no type: "+JSON.stringify(K));N.push(E(K.type,K))}return N}function E(h,N){if(o(N)||(N={match:N}),N.include)throw new Error("Matching rules cannot also include states");var v={defaultType:h,lineBreaks:!!N.error||!!N.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var K in N)e.call(N,K)&&(v[K]=N[K]);if(typeof v.type=="string"&&h!==v.type)throw new Error("Type transform cannot be a string (type '"+v.type+"' for token '"+h+"')");var U=v.match;return v.match=Array.isArray(U)?U:U?[U]:[],v.match.sort(function(V,X){return n(V)&&n(X)?0:n(X)?-1:n(V)?1:X.length-V.length}),v}function u(h){return Array.isArray(h)?B(h):c(h)}var d=E("error",{lineBreaks:!0,shouldThrow:!0});function f(h,N){for(var v=null,K=Object.create(null),U=!0,V=null,X=[],_=[],q=0;q<h.length;q++)h[q].fallback&&(U=!1);for(var q=0;q<h.length;q++){var $=h[q];if($.include)throw new Error("Inheritance is not allowed in stateless lexers");if($.error||$.fallback){if(v)throw!$.fallback==!v.fallback?new Error("Multiple "+($.fallback?"fallback":"error")+" rules not allowed (for token '"+$.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+$.defaultType+"')");v=$}var nA=$.match.slice();if(U)for(;nA.length&&typeof nA[0]=="string"&&nA[0].length===1;){var j=nA.shift();K[j.charCodeAt(0)]=$}if($.pop||$.push||$.next){if(!N)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+$.defaultType+"')");if($.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+$.defaultType+"')")}if(nA.length!==0){U=!1,X.push($);for(var O=0;O<nA.length;O++){var eA=nA[O];if(n(eA)){if(V===null)V=eA.unicode;else if(V!==eA.unicode&&$.fallback===!1)throw new Error("If one rule is /u then all must be")}}var oA=I(nA.map(r)),tA=new RegExp(oA);if(tA.test(""))throw new Error("RegExp matches empty string: "+tA);var sA=a(oA);if(sA>0)throw new Error("RegExp has capture groups: "+tA+`
Use (?: … ) instead`);if(!$.lineBreaks&&tA.test(`
`))throw new Error("Rule should declare lineBreaks: "+tA);_.push(s(oA))}}var gA=v&&v.fallback,iA=i&&!gA?"ym":"gm",aA=i||gA?"":"|";V===!0&&(iA+="u");var lA=new RegExp(I(_)+aA,iA);return{regexp:lA,groups:X,fast:K,error:v||d}}function w(h){var N=f(u(h));return new x({start:N},"start")}function y(h,N,v){var K=h&&(h.push||h.next);if(K&&!v[K])throw new Error("Missing state '"+K+"' (in token '"+h.defaultType+"' of state '"+N+"')");if(h&&h.pop&&+h.pop!=1)throw new Error("pop must be 1 (in token '"+h.defaultType+"' of state '"+N+"')")}function G(h,N){var v=h.$all?u(h.$all):[];delete h.$all;var K=Object.getOwnPropertyNames(h);N||(N=K[0]);for(var U=Object.create(null),V=0;V<K.length;V++){var X=K[V];U[X]=u(h[X]).concat(v)}for(var V=0;V<K.length;V++)for(var X=K[V],_=U[X],q=Object.create(null),$=0;$<_.length;$++){var nA=_[$];if(nA.include){var j=[$,1];if(nA.include!==X&&!q[nA.include]){q[nA.include]=!0;var O=U[nA.include];if(!O)throw new Error("Cannot include nonexistent state '"+nA.include+"' (in state '"+X+"')");for(var eA=0;eA<O.length;eA++){var oA=O[eA];_.indexOf(oA)===-1&&j.push(oA)}}_.splice.apply(_,j),$--}}for(var tA=Object.create(null),V=0;V<K.length;V++){var X=K[V];tA[X]=f(U[X],!0)}for(var V=0;V<K.length;V++){for(var sA=K[V],gA=tA[sA],iA=gA.groups,$=0;$<iA.length;$++)y(iA[$],sA,tA);for(var aA=Object.getOwnPropertyNames(gA.fast),$=0;$<aA.length;$++)y(gA.fast[aA[$]],sA,tA)}return new x(tA,N)}function R(h){for(var N=typeof Map<"u",v=N?new Map:Object.create(null),K=Object.getOwnPropertyNames(h),U=0;U<K.length;U++){var V=K[U],X=h[V],_=Array.isArray(X)?X:[X];_.forEach(function(q){if(typeof q!="string")throw new Error("keyword must be string (in keyword '"+V+"')");N?v.set(q,V):v[q]=V})}return function(q){return N?v.get(q):v[q]}}var x=function(h,N){this.startState=N,this.states=h,this.buffer="",this.stack=[],this.reset()};x.prototype.reset=function(h,N){return this.buffer=h||"",this.index=0,this.line=N?N.line:1,this.col=N?N.col:1,this.queuedToken=N?N.queuedToken:null,this.queuedText=N?N.queuedText:"",this.queuedThrow=N?N.queuedThrow:null,this.setState(N?N.state:this.startState),this.stack=N&&N.stack?N.stack.slice():[],this},x.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},x.prototype.setState=function(h){if(!(!h||this.state===h)){this.state=h;var N=this.states[h];this.groups=N.groups,this.error=N.error,this.re=N.regexp,this.fast=N.fast}},x.prototype.popState=function(){this.setState(this.stack.pop())},x.prototype.pushState=function(h){this.stack.push(this.state),this.setState(h)};var F=i?function(h,N){return h.exec(N)}:function(h,N){var v=h.exec(N);return v[0].length===0?null:v};x.prototype._getGroup=function(h){for(var N=this.groups.length,v=0;v<N;v++)if(h[v+1]!==void 0)return this.groups[v];throw new Error("Cannot find token type for matched text")};function Q(){return this.value}if(x.prototype.next=function(){var h=this.index;if(this.queuedGroup){var N=this._token(this.queuedGroup,this.queuedText,h);return this.queuedGroup=null,this.queuedText="",N}var v=this.buffer;if(h!==v.length){var X=this.fast[v.charCodeAt(h)];if(X)return this._token(X,v.charAt(h),h);var K=this.re;K.lastIndex=h;var U=F(K,v),V=this.error;if(U==null)return this._token(V,v.slice(h,v.length),h);var X=this._getGroup(U),_=U[0];return V.fallback&&U.index!==h?(this.queuedGroup=X,this.queuedText=_,this._token(V,v.slice(h,U.index),h)):this._token(X,_,h)}},x.prototype._token=function(h,N,v){var K=0;if(h.lineBreaks){var U=/\n/g,V=1;if(N===`
`)K=1;else for(;U.exec(N);)K++,V=U.lastIndex}var X={type:typeof h.type=="function"&&h.type(N)||h.defaultType,value:typeof h.value=="function"?h.value(N):N,text:N,toString:Q,offset:v,lineBreaks:K,line:this.line,col:this.col},_=N.length;if(this.index+=_,this.line+=K,K!==0?this.col=_-V+1:this.col+=_,h.shouldThrow){var q=new Error(this.formatError(X,"invalid syntax"));throw q}return h.pop?this.popState():h.push?this.pushState(h.push):h.next&&this.setState(h.next),X},typeof Symbol<"u"&&Symbol.iterator){var k=function(h){this.lexer=h};k.prototype.next=function(){var h=this.lexer.next();return{value:h,done:!h}},k.prototype[Symbol.iterator]=function(){return this},x.prototype[Symbol.iterator]=function(){return new k(this)}}return x.prototype.formatError=function(h,N){if(h==null)var v=this.buffer.slice(this.index),h={text:v,offset:this.index,lineBreaks:v.indexOf(`
`)===-1?0:1,line:this.line,col:this.col};var K=2,U=Math.max(h.line-K,1),V=h.line+K,X=String(V).length,_=l(this.buffer,this.line-h.line+K+1).slice(0,5),q=[];q.push(N+" at line "+h.line+" col "+h.col+":"),q.push("");for(var $=0;$<_.length;$++){var nA=_[$],j=U+$;q.push(C(String(j),X)+"  "+nA),j===h.line&&q.push(C("",X+h.col+1)+"^")}return q.join(`
`)},x.prototype.clone=function(){return new x(this.states,this.state)},x.prototype.has=function(h){return!0},{compile:w,states:G,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:R}})}(WBi)),m8}var p8={},UBi={get exports(){return p8},set exports(A){p8=A}},Jhe;function VBi(){return Jhe||(Jhe=1,function(A){(function(e,t){A.exports?A.exports=t():e.nearley=t()})(hi,function(){function e(I,r,C){return this.id=++e.highestId,this.name=I,this.symbols=r,this.postprocess=C,this}e.highestId=0,e.prototype.toString=function(I){var r=typeof I>"u"?this.symbols.map(s).join(" "):this.symbols.slice(0,I).map(s).join(" ")+" ● "+this.symbols.slice(I).map(s).join(" ");return this.name+" → "+r};function t(I,r,C,l){this.rule=I,this.dot=r,this.reference=C,this.data=[],this.wantedBy=l,this.isComplete=this.dot===I.symbols.length}t.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},t.prototype.nextState=function(I){var r=new t(this.rule,this.dot+1,this.reference,this.wantedBy);return r.left=this,r.right=I,r.isComplete&&(r.data=r.build(),r.right=void 0),r},t.prototype.build=function(){var I=[],r=this;do I.push(r.right.data),r=r.left;while(r.left);return I.reverse(),I},t.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,g.fail))};function i(I,r){this.grammar=I,this.index=r,this.states=[],this.wants={},this.scannable=[],this.completed={}}i.prototype.process=function(I){for(var r=this.states,C=this.wants,l=this.completed,c=0;c<r.length;c++){var B=r[c];if(B.isComplete){if(B.finish(),B.data!==g.fail){for(var E=B.wantedBy,u=E.length;u--;){var d=E[u];this.complete(d,B)}if(B.reference===this.index){var f=B.rule.name;(this.completed[f]=this.completed[f]||[]).push(B)}}}else{var f=B.rule.symbols[B.dot];if(typeof f!="string"){this.scannable.push(B);continue}if(C[f]){if(C[f].push(B),l.hasOwnProperty(f))for(var w=l[f],u=0;u<w.length;u++){var y=w[u];this.complete(B,y)}}else C[f]=[B],this.predict(f)}}},i.prototype.predict=function(I){for(var r=this.grammar.byName[I]||[],C=0;C<r.length;C++){var l=r[C],c=this.wants[I],B=new t(l,0,this.index,c);this.states.push(B)}},i.prototype.complete=function(I,r){var C=I.nextState(r);this.states.push(C)};function n(I,r){this.rules=I,this.start=r||this.rules[0].name;var C=this.byName={};this.rules.forEach(function(l){C.hasOwnProperty(l.name)||(C[l.name]=[]),C[l.name].push(l)})}n.fromCompiled=function(l,r){var C=l.Lexer;l.ParserStart&&(r=l.ParserStart,l=l.ParserRules);var l=l.map(function(B){return new e(B.name,B.symbols,B.postprocess)}),c=new n(l,r);return c.lexer=C,c};function o(){this.reset("")}o.prototype.reset=function(I,r){this.buffer=I,this.index=0,this.line=r?r.line:1,this.lastLineBreak=r?-r.col:0},o.prototype.next=function(){if(this.index<this.buffer.length){var I=this.buffer[this.index++];return I===`
`&&(this.line+=1,this.lastLineBreak=this.index),{value:I}}},o.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},o.prototype.formatError=function(I,r){var C=this.buffer;if(typeof C=="string"){var l=C.split(`
`).slice(Math.max(0,this.line-5),this.line),c=C.indexOf(`
`,this.index);c===-1&&(c=C.length);var B=this.index-this.lastLineBreak,E=String(this.line).length;return r+=" at line "+this.line+" col "+B+`:

`,r+=l.map(function(d,f){return u(this.line-l.length+f+1,E)+" "+d},this).join(`
`),r+=`
`+u("",E+B)+`^
`,r}else return r+" at index "+(this.index-1);function u(d,f){var w=String(d);return Array(f-w.length+1).join(" ")+w}};function g(I,r,C){if(I instanceof n)var l=I,C=r;else var l=n.fromCompiled(I,r);this.grammar=l,this.options={keepHistory:!1,lexer:l.lexer||new o};for(var c in C||{})this.options[c]=C[c];this.lexer=this.options.lexer,this.lexerState=void 0;var B=new i(l,0);this.table=[B],B.wants[l.start]=[],B.predict(l.start),B.process(),this.current=0}g.fail={},g.prototype.feed=function(I){var r=this.lexer;r.reset(I,this.lexerState);for(var C;;){try{if(C=r.next(),!C)break}catch(x){var E=new i(this.grammar,this.current+1);this.table.push(E);var l=new Error(this.reportLexerError(x));throw l.offset=this.current,l.token=x.token,l}var c=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var B=this.current+1,E=new i(this.grammar,B);this.table.push(E);for(var u=C.text!==void 0?C.text:C.value,d=r.constructor===o?C.value:C,f=c.scannable,w=f.length;w--;){var y=f[w],G=y.rule.symbols[y.dot];if(G.test?G.test(d):G.type?G.type===C.type:G.literal===u){var R=y.nextState({data:d,token:C,isToken:!0,reference:B-1});E.states.push(R)}}if(E.process(),E.states.length===0){var l=new Error(this.reportError(C));throw l.offset=this.current,l.token=C,l}this.options.keepHistory&&(c.lexerState=r.save()),this.current++}return c&&(this.lexerState=r.save()),this.results=this.finish(),this},g.prototype.reportLexerError=function(I){var r,C,l=I.token;return l?(r="input "+JSON.stringify(l.text[0])+" (lexer error)",C=this.lexer.formatError(l,"Syntax error")):(r="input (lexer error)",C=I.message),this.reportErrorCommon(C,r)},g.prototype.reportError=function(I){var r=(I.type?I.type+" token: ":"")+JSON.stringify(I.value!==void 0?I.value:I),C=this.lexer.formatError(I,"Syntax error");return this.reportErrorCommon(C,r)},g.prototype.reportErrorCommon=function(I,r){var C=[];C.push(I);var l=this.table.length-2,c=this.table[l],B=c.states.filter(function(u){var d=u.rule.symbols[u.dot];return d&&typeof d!="string"});if(B.length===0)C.push("Unexpected "+r+`. I did not expect any more input. Here is the state of my parse table:
`),this.displayStateStack(c.states,C);else{C.push("Unexpected "+r+`. Instead, I was expecting to see one of the following:
`);var E=B.map(function(u){return this.buildFirstStateStack(u,[])||[u]},this);E.forEach(function(u){var d=u[0],f=d.rule.symbols[d.dot],w=this.getSymbolDisplay(f);C.push("A "+w+" based on:"),this.displayStateStack(u,C)},this)}return C.push(""),C.join(`
`)},g.prototype.displayStateStack=function(I,r){for(var C,l=0,c=0;c<I.length;c++){var B=I[c],E=B.rule.toString(B.dot);E===C?l++:(l>0&&r.push("    ^ "+l+" more lines identical to this"),l=0,r.push("    "+E)),C=E}},g.prototype.getSymbolDisplay=function(I){return a(I)},g.prototype.buildFirstStateStack=function(I,r){if(r.indexOf(I)!==-1)return null;if(I.wantedBy.length===0)return[I];var C=I.wantedBy[0],l=[I].concat(r),c=this.buildFirstStateStack(C,l);return c===null?null:[I].concat(c)},g.prototype.save=function(){var I=this.table[this.current];return I.lexerState=this.lexerState,I},g.prototype.restore=function(I){var r=I.index;this.current=r,this.table[r]=I,this.table.splice(r+1),this.lexerState=I.lexerState,this.results=this.finish()},g.prototype.rewind=function(I){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[I])},g.prototype.finish=function(){var I=[],r=this.grammar.start,C=this.table[this.table.length-1];return C.states.forEach(function(l){l.rule.name===r&&l.dot===l.rule.symbols.length&&l.reference===0&&l.data!==g.fail&&I.push(l)}),I.map(function(l){return l.data})};function a(I){var r=typeof I;if(r==="string")return I;if(r==="object"){if(I.literal)return JSON.stringify(I.literal);if(I instanceof RegExp)return"character matching "+I;if(I.type)return I.type+" token";if(I.test)return"token matching "+String(I.test);throw new Error("Unknown symbol type: "+I)}}function s(I){var r=typeof I;if(r==="string")return I;if(r==="object"){if(I.literal)return JSON.stringify(I.literal);if(I instanceof RegExp)return I.toString();if(I.type)return"%"+I.type;if(I.test)return"<"+String(I.test)+">";throw new Error("Unknown symbol type: "+I)}}return{Parser:g,Grammar:n,Rule:e}})}(UBi)),p8}(function(A){(function(e,t){for(var i in t)e[i]=t[i]})(A,function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=e,i.c=t,i.d=function(n,o,g){i.o(n,o)||Object.defineProperty(n,o,{enumerable:!0,get:g})},i.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},i.t=function(n,o){if(o&1&&(n=i(n)),o&8||o&4&&typeof n=="object"&&n&&n.__esModule)return n;var g=Object.create(null);if(i.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:n}),o&2&&typeof n!="string")for(var a in n)i.d(g,a,function(s){return n[s]}.bind(null,a));return g},i.n=function(n){var o=n&&n.__esModule?function(){return n.default}:function(){return n};return i.d(o,"a",o),o},i.o=function(n,o){return Object.prototype.hasOwnProperty.call(n,o)},i.p="",i(i.s=7)}([function(e,t){e.exports=KBi()},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.unbox=t.doubleQuoted=t.box=t.track=t.tracking=t.trackingComments=t.lexerAny=t.lexer=void 0;const n=i(0),o=i(3),g={};for(const G of o.sqlKeywords)g["kw_"+G.toLowerCase()]=G;const a=G=>{const R=(0,n.keywords)(G);return x=>R(x.toUpperCase())};t.lexer=(0,n.compile)({word:{match:/[eE](?!')[A-Za-z0-9_]*|[a-df-zA-DF-Z_][A-Za-z0-9_]*/,type:a(g),value:G=>G.toLowerCase()},wordQuoted:{match:/"(?:[^"\*]|"")+"/,type:()=>"quoted_word",value:G=>G.substring(1,G.length-1)},string:{match:/'(?:[^']|\'\')*'/,value:G=>G.substring(1,G.length-1).replace(/''/g,"'")},eString:{match:/\b(?:e|E)'(?:[^'\\]|[\r\n\s]|(?:\\\s)|(?:\\\n)|(?:\\.)|(?:\'\'))+'/,value:G=>G.substring(2,G.length-1).replace(/''/g,"'").replace(/\\([\s\n])/g,(R,x)=>x).replace(/\\./g,R=>JSON.parse('"'+R+'"'))},qparam:{match:/\$\d+/},commentLine:/\-\-.*?$[\s\r\n]*/,commentFullOpen:/\/\*/,commentFullClose:/\*\/[\s\r\n]*/,star:"*",comma:",",space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},int:/\-?\d+(?![\.\d])/,float:/\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,lparen:"(",rparen:")",lbracket:"[",rbracket:"]",semicolon:";",dot:/\.(?!\d)/,op_cast:"::",op_colon:":",op_plus:"+",op_eq:"=",op_neq:{match:/(?:!=)|(?:\<\>)/,value:()=>"!="},op_membertext:"->>",op_member:"->",op_minus:"-",op_div:/\//,op_not_ilike:/\!~~\*/,op_not_like:/\!~~/,op_ilike:/~~\*/,op_like:/~~/,op_mod:"%",op_exp:"^",op_additive:{match:["||","-","#-","&&"]},op_compare:{match:[">",">=","<","<=","@>","<@","?","?|","?&","#>>",">>","<<","~","~*","!~","!~*","@@"]},ops_others:{match:["|","&","^","#"]},codeblock:{match:/\$\$(?:.|[\s\t\n\v\f\r])*?\$\$/s,lineBreaks:!0,value:G=>G.substring(2,G.length-2)}}),t.lexer.next=(G=>()=>{let R,x=null;for(;R=G.call(t.lexer);){if(R.type==="commentFullOpen"){if(x===null){x={nested:0,offset:R.offset,text:R.text};continue}x.nested++}if(x!=null){if(x.text+=R.text,R.type==="commentFullClose"){if(x.nested===0){s==null||s.push(I(x)),x=null;continue}x.nested--}continue}if(R.type!=="space"){if(R.type==="commentLine"){s==null||s.push(I(R));continue}break}}if(C&&R){const F=R.offset,Q={start:F,end:F+R.text.length};R._location=Q}return R})(t.lexer.next),t.lexerAny=t.lexer;let s=null;const I=({offset:G,text:R})=>({_location:{start:G,end:G+R.length},comment:R});function r(G){if(s)throw new Error("WAT ? Recursive comments tracking 🤔🤨 ?");try{s=[];const R=G();return{comments:s,ast:R}}finally{s=null}}t.trackingComments=r;let C=!1;function l(G){if(C)return G();try{return C=!0,G()}finally{C=!1}}t.tracking=l;function c(G,R){if(!C||!R||typeof R!="object")return R;const x=y(G,!0),F=y(G,!1);if(!x||!F)return R;if(x===F)R._location=x;else{const Q={start:x.start,end:F.end};R._location=Q}return R}t.track=c;const B=Symbol("_literal"),E=Symbol("_doublequoted");function u(G,R,x){return!C&&!x?R:c(G,{[B]:R,[E]:x})}t.box=u;function d(G){return Array.isArray(G)&&G.length===1&&(G=d(G[0])),Array.isArray(G)&&!G.length?null:G}function f(G){const R=d(G);if(typeof G=="object"&&(R!=null&&R[E]))return{doubleQuoted:!0}}t.doubleQuoted=f;function w(G){var R;return typeof G=="object"&&(R=G==null?void 0:G[B])!==null&&R!==void 0?R:G}t.unbox=w;function y(G,R){if(!G)return null;if(Array.isArray(G)){const x=R?1:-1;for(let F=R?0:G.length-1;F>=0&&F<G.length;F+=x){const Q=y(G[F],R);if(Q)return Q}return null}return typeof G!="object"?null:G._location}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.AstDefaultMapper=t.arrayNilMap=t.assignChanged=t.astMapper=void 0;const n=i(6);function o(l){const c=new I;return c.wrapped=l(c),c}t.astMapper=o;function g(l,c){if(!l)return l;let B=!1;for(const E of Object.keys(c))if(l[E]!==c[E]){B=!0;break}return B?(0,n.trimNullish)({...l,...c},0):l}t.assignChanged=g;function a(l,c){if(!(l!=null&&l.length))return l;let B=!1,E=l;for(let u=0;u<l.length;u++){const d=l[u],f=c(d);!B&&(!f||f!==d)&&(B=!0,E=l.slice(0,u)),f&&B&&E.push(f)}return E}t.arrayNilMap=a;function s(l){switch(l==null?void 0:l.type){case"select":case"delete":case"insert":case"update":case"union":case"union all":case"with":return!0;default:return!1}}class I{super(){return new C(this)}statement(c){switch(c.type){case"alter table":return this.alterTable(c);case"alter index":return this.alterIndex(c);case"commit":case"start transaction":case"rollback":return this.transaction(c);case"create index":return this.createIndex(c);case"create table":return this.createTable(c);case"truncate table":return this.truncateTable(c);case"delete":return this.delete(c);case"insert":return this.insert(c);case"with":return this.with(c);case"with recursive":return this.withRecursive(c);case"select":return this.selection(c);case"update":return this.update(c);case"create extension":return this.createExtension(c);case"tablespace":return this.tablespace(c);case"set":return this.setGlobal(c);case"set timezone":return this.setTimezone(c);case"set names":return this.setNames(c);case"create sequence":return this.createSequence(c);case"alter sequence":return this.alterSequence(c);case"begin":return this.begin(c);case"drop table":case"drop index":case"drop sequence":case"drop type":case"drop trigger":return this.drop(c);case"create enum":return this.createEnum(c);case"create composite type":return this.createCompositeType(c);case"union":case"union all":return this.union(c);case"show":return this.show(c);case"prepare":return this.prepare(c);case"deallocate":return this.deallocate(c);case"create view":return this.createView(c);case"create materialized view":return this.createMaterializedView(c);case"refresh materialized view":return this.refreshMaterializedView(c);case"create schema":return this.createSchema(c);case"raise":return this.raise(c);case"comment":return this.comment(c);case"do":return this.do(c);case"create function":return this.createFunction(c);case"drop function":return this.dropFunction(c);case"values":return this.values(c);default:throw n.NotSupported.never(c)}}comment(c){return c}createView(c){const B=this.select(c.query);if(!B)return null;const E=this.tableRef(c.name);return E?g(c,{query:B,name:E}):null}createMaterializedView(c){const B=this.select(c.query);if(!B)return null;const E=this.tableRef(c.name);return E?g(c,{query:B,name:E}):null}refreshMaterializedView(c){return c}do(c){return c}createFunction(c){const B=a(c.arguments,u=>{const d=this.dataType(u.type);return g(u,{type:d})});let E;if(c.returns)switch(c.returns.kind){case"table":E=g(c.returns,{columns:a(c.returns.columns,u=>{const d=this.dataType(u.type);return d&&g(u,{type:d})})});break;case void 0:case null:case"array":E=this.dataType(c.returns);break;default:throw n.NotSupported.never(c.returns)}return g(c,{returns:E,arguments:B})}dropFunction(c){const B=a(c.arguments,E=>{const u=this.dataType(E.type);return g(E,{type:u})});return g(c,{arguments:B})}show(c){return c}createEnum(c){return c}createCompositeType(c){const B=a(c.attributes,E=>g(E,{dataType:this.dataType(E.dataType)}));return g(c,{attributes:B})}drop(c){return c}alterSequence(c){return c.change.type==="set options"&&c.change.as&&this.dataType(c.change.as),c}begin(c){return c}createSequence(c){return c.options.as&&this.dataType(c.options.as),c}tablespace(c){return c}setGlobal(c){return c}setTimezone(c){return c}setNames(c){return c}update(c){if(!c)return c;const B=this.tableRef(c.table);if(!B)return null;const E=c.from&&this.from(c.from),u=c.where&&this.expr(c.where),d=a(c.sets,w=>this.set(w));if(!(d!=null&&d.length))return null;const f=a(c.returning,w=>this.selectionColumn(w));return g(c,{table:B,where:u,sets:d,from:E,returning:f})}insert(c){var B,E;const u=this.tableRef(c.into);if(!u)return null;const d=c.insert&&this.select(c.insert);if(!d)return null;const f=a(c.returning,G=>this.selectionColumn(G));let w=(B=c.onConflict)===null||B===void 0?void 0:B.on;switch(w==null?void 0:w.type){case"on constraint":break;case"on expr":w=g(w,{exprs:a(w.exprs,G=>this.expr(G))});break;case null:case void 0:break;default:throw n.NotSupported.never(w)}let y=(E=c.onConflict)===null||E===void 0?void 0:E.do;if(y&&y!=="do nothing"){const G=a(y.sets,R=>this.set(R));G!=null&&G.length?y.sets!==G&&(y={sets:G}):y="do nothing"}return g(c,{into:u,insert:d,returning:f,onConflict:y?g(c.onConflict,{do:y,on:w}):c.onConflict})}raise(c){return g(c,{formatExprs:c.formatExprs&&a(c.formatExprs,B=>this.expr(B)),using:c.using&&a(c.using,B=>g(B,{value:this.expr(B.value)}))})}delete(c){const B=this.tableRef(c.from);if(!B)return null;const E=c.where&&this.expr(c.where),u=a(c.returning,d=>this.selectionColumn(d));return g(c,{where:E,returning:u,from:B})}createSchema(c){return c}createTable(c){const B=a(c.columns,E=>{switch(E.kind){case"column":return this.createColumn(E);case"like table":return this.likeTable(E);default:throw n.NotSupported.never(E)}});return B!=null&&B.length?g(c,{columns:B}):null}likeTable(c){const B=this.tableRef(c.like);return B?g(c,{like:B}):null}truncateTable(c){return c}constraint(c){switch(c.type){case"not null":case"null":case"primary key":case"unique":case"add generated":return c;case"default":{const B=this.expr(c.default);return B?g(c,{default:B}):null}case"check":{const B=this.expr(c.expr);return B?g(c,{expr:B}):null}case"reference":{const B=this.tableRef(c.foreignTable);return B?g(c,{foreignTable:B}):null}default:throw n.NotSupported.never(c)}}set(c){const B=this.expr(c.value);return B?g(c,{value:B}):null}dataType(c){return c}tableRef(c){return c}transaction(c){return c}createExtension(c){return c}createIndex(c){const B=a(c.expressions,E=>{const u=this.expr(E.expression);return u===E.expression?E:u?{...E,expression:u}:null});return B!=null&&B.length?g(c,{expressions:B}):null}prepare(c){const B=this.statement(c.statement);return B?g(c,{args:a(c.args,E=>this.dataType(E)),statement:B}):null}deallocate(c){return c}alterIndex(c){return c}alterTable(c){var B;const E=this.tableRef(c.table);if(!E)return null;let u=[],d=!1;for(let f=0;f<(((B=c.changes)===null||B===void 0?void 0:B.length)||0);f++){const w=c.changes[f],y=this.tableAlteration(w,c.table);d=d||y!=w,y&&u.push(y)}return u.length?d?g(c,{table:E,changes:u}):c:null}tableAlteration(c,B){switch(c.type){case"add column":return this.addColumn(c,B);case"add constraint":return this.addConstraint(c,B);case"alter column":return this.alterColumn(c,B);case"rename":return this.renameTable(c,B);case"rename column":return this.renameColumn(c,B);case"rename constraint":return this.renameConstraint(c,B);case"drop column":return this.dropColumn(c,B);case"drop constraint":return this.dropConstraint(c,B);case"owner":return this.setTableOwner(c,B);default:throw n.NotSupported.never(c)}}dropColumn(c,B){return c}dropConstraint(c,B){return c}setTableOwner(c,B){return c}renameConstraint(c,B){return c}renameColumn(c,B){return c}renameTable(c,B){return c}alterColumn(c,B){let E;switch(c.alter.type){case"set default":E=this.setColumnDefault(c.alter,B,c.column);break;case"set type":E=this.setColumnType(c.alter,B,c.column);break;case"drop default":case"set not null":case"drop not null":E=this.alterColumnSimple(c.alter,B,c.column);break;case"add generated":E=this.alterColumnAddGenerated(c.alter,B,c.column);break;default:throw n.NotSupported.never(c.alter)}return E?g(c,{alter:E}):null}setColumnType(c,B,E){const u=this.dataType(c.dataType);return g(c,{dataType:u})}alterColumnAddGenerated(c,B,E){return c}alterColumnSimple(c,B,E){return c}setColumnDefault(c,B,E){const u=this.expr(c.default);return u?g(c,{default:u}):null}addConstraint(c,B){return c}addColumn(c,B){const E=this.createColumn(c.column);return E?g(c,{column:E}):null}createColumn(c){var B;const E=this.dataType(c.dataType);if(!E)return null;const u=(B=a(c.constraints,d=>this.constraint(d)))!==null&&B!==void 0?B:void 0;return g(c,{dataType:E,constraints:u})}select(c){switch(c.type){case"select":return this.selection(c);case"union":case"union all":return this.union(c);case"with":return this.with(c);case"values":return this.values(c);case"with recursive":return this.withRecursive(c);default:throw n.NotSupported.never(c)}}selection(c){var B,E;const u=a(c.from,x=>this.from(x)),d=a(c.columns,x=>this.selectionColumn(x)),f=c.where&&this.expr(c.where),w=a(c.groupBy,x=>this.expr(x)),y=c.having&&this.expr(c.having),G=this.orderBy(c.orderBy),R=g(c.limit,{limit:this.expr((B=c.limit)===null||B===void 0?void 0:B.limit),offset:this.expr((E=c.limit)===null||E===void 0?void 0:E.offset)});return g(c,{from:u,columns:d,where:f,groupBy:w,having:y,orderBy:G,limit:R})}orderBy(c){return a(c,B=>{const E=this.expr(B.by);return E?E===B.by?B:{...B,by:E}:null})}union(c){const B=this.select(c.left),E=this.select(c.right);return!B||!E?B??E:g(c,{left:B,right:E})}with(c){const B=a(c.bind,u=>{const d=this.statement(u.statement);return s(d)?g(u,{statement:d}):null});if(!B)return null;const E=this.statement(c.in);return s(E)?g(c,{bind:B,in:E}):null}withRecursive(c){const B=this.union(c.bind);if(!B||B.type!=="union"&&B.type!=="union all")return null;const E=this.statement(c.in);return s(E)?g(c,{bind:B,in:E}):null}from(c){switch(c.type){case"table":return this.fromTable(c);case"statement":return this.fromStatement(c);case"call":return this.fromCall(c);default:throw n.NotSupported.never(c)}}fromCall(c){const B=this.call(c);return!B||B.type!=="call"?null:g(c,B)}fromStatement(c){const B=this.select(c.statement);if(!B)return null;const E=c.join&&this.join(c.join);return g(c,{statement:B,join:E})}values(c){const B=a(c.values,E=>a(E,u=>this.expr(u)));return B!=null&&B.length?g(c,{values:B}):null}join(c){const B=c.on&&this.expr(c.on);return!B&&!c.using?c:g(c,{on:B})}fromTable(c){const B=this.tableRef(c.name);if(!B)return null;const E=c.join&&this.join(c.join);return g(c,{name:B,join:E})}selectionColumn(c){const B=this.expr(c.expr);return B?g(c,{expr:B}):null}expr(c){if(!c)return c;switch(c.type){case"binary":return this.binary(c);case"unary":return this.unary(c);case"ref":return this.ref(c);case"string":case"numeric":case"integer":case"boolean":case"constant":case"null":return this.constant(c);case"list":case"array":return this.array(c);case"array select":return this.arraySelect(c);case"call":return this.call(c);case"cast":return this.cast(c);case"case":return this.case(c);case"member":return this.member(c);case"arrayIndex":return this.arrayIndex(c);case"ternary":return this.ternary(c);case"select":case"union":case"union all":case"with":case"with recursive":return this.select(c);case"keyword":return this.valueKeyword(c);case"parameter":return this.parameter(c);case"extract":return this.extract(c);case"overlay":return this.callOverlay(c);case"substring":return this.callSubstring(c);case"values":return this.values(c);case"default":return this.default(c);default:throw n.NotSupported.never(c)}}arraySelect(c){const B=this.select(c.select);return B?g(c,{select:B}):null}extract(c){const B=this.expr(c.from);return B?g(c,{from:B}):null}valueKeyword(c){return c}ternary(c){const B=this.expr(c.value),E=this.expr(c.lo),u=this.expr(c.hi);return!B||!E||!u?null:g(c,{value:B,lo:E,hi:u})}parameter(c){return c}arrayIndex(c){const B=this.expr(c.array),E=this.expr(c.index);return!B||!E?null:g(c,{array:B,index:E})}member(c){const B=this.expr(c.operand);return B?g(c,{operand:B}):null}case(c){const B=c.value&&this.expr(c.value),E=a(c.whens,d=>{const f=this.expr(d.when),w=this.expr(d.value);return!f||!w?null:g(d,{value:w,when:f})});if(!(E!=null&&E.length))return null;const u=c.else&&this.expr(c.else);return g(c,{value:B,whens:E,else:u})}cast(c){const B=this.expr(c.operand);return B?g(c,{operand:B}):null}call(c){const B=a(c.args,d=>this.expr(d));if(!B)return null;const E=this.orderBy(c.orderBy),u=this.expr(c.filter);return g(c,{args:B,orderBy:E,filter:u})}callSubstring(c){return g(c,{value:this.expr(c.value),from:this.expr(c.from),for:this.expr(c.for)})}callOverlay(c){return g(c,{value:this.expr(c.value),placing:this.expr(c.placing),from:this.expr(c.from),for:this.expr(c.for)})}array(c){const B=a(c.expressions,E=>this.expr(E));return B?g(c,{expressions:B}):null}constant(c){return c}default(c){return c}ref(c){return c}unary(c){const B=this.expr(c.operand);return B?g(c,{operand:B}):null}binary(c){const B=this.expr(c.left),E=this.expr(c.right);return!B||!E?null:g(c,{left:B,right:E})}}t.AstDefaultMapper=I;const r=I.prototype;for(const l of Object.getOwnPropertyNames(r)){const c=r[l];l==="constructor"||l==="super"||typeof c!="function"||Object.defineProperty(r,l,{configurable:!1,get(){return function(...B){var E;if(this.skipNext)return this.skipNext=!1,c.apply(this,B);const u=(E=this.wrapped)===null||E===void 0?void 0:E[l];return u?u.apply(this.wrapped,B):c.apply(this,B)}}})}class C extends I{constructor(c){super(),this.parent=c}}for(const l of Object.getOwnPropertyNames(r)){const c=r[l];l==="constructor"||l==="super"||typeof c!="function"||Object.defineProperty(C.prototype,l,{configurable:!1,get(){return function(...B){return this.parent.skipNext=!0,c.apply(this.parent,B)}}})}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.sqlKeywords=void 0,t.sqlKeywords=["ALL","ANALYSE","ANALYZE","AND","ANY","ARRAY","AS","ASC","ASYMMETRIC","AUTHORIZATION","BINARY","BOTH","CASE","CAST","CHECK","COLLATE","COLLATION","CONCURRENTLY","CONSTRAINT","CREATE","CROSS","CURRENT_CATALOG","CURRENT_DATE","CURRENT_ROLE","CURRENT_SCHEMA","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","DEFAULT","DEFERRABLE","DESC","DISTINCT","DO","ELSE","END","EXCEPT","FALSE","FETCH","FOR","FOREIGN","FREEZE","FROM","FULL","GRANT","GROUP","HAVING","ILIKE","IN","INITIALLY","INNER","INTERSECT","INTO","IS","ISNULL","JOIN","LATERAL","LEADING","LEFT","LIKE","LIMIT","LOCALTIME","LOCALTIMESTAMP","NATURAL","NOT","NOTNULL","NULL","OFFSET","ON","ONLY","OR","ORDER","OUTER","OVERLAPS","PLACING","PRIMARY","REFERENCES","RETURNING","RIGHT","SELECT","SESSION_USER","SIMILAR","SOME","SYMMETRIC","TABLE","TABLESAMPLE","THEN","TO","TRAILING","TRUE","UNION","UNIQUE","USER","USING","VARIADIC","VERBOSE","WHEN","WHERE","WINDOW","WITH","PRECISION"]},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.intervalToString=t.normalizeInterval=t.buildInterval=void 0;const n=[["years",12],["months",30],["days",24],["hours",60],["minutes",60],["seconds",1e3],["milliseconds",0]];function*o(C){if(typeof C[1]=="number")yield C;else for(const l of C)yield*o(l)}function g(C,l){var c;const B={};if(l==="invalid")throw new Error(`invalid input syntax for type interval: "${C}"`);for(const[E,u]of o(l))B[E]=((c=B[E])!==null&&c!==void 0?c:0)+u;return B}t.buildInterval=g;function a(C){var l,c,B,E,u,d,f,w,y;const G={...C};for(let F=0;F<n.length;F++){const[Q,k]=n[F],h=(l=G[Q])!==null&&l!==void 0?l:0,N=h>=0?Math.floor(h):Math.ceil(h);if(!h||N===h)continue;const v=(c=n[F+1])===null||c===void 0?void 0:c[0];v&&(G[v]=((B=G[v])!==null&&B!==void 0?B:0)+k*(h-N)),G[Q]=N}if(G.months||G.years){const F=((E=G.months)!==null&&E!==void 0?E:0)+((u=G.years)!==null&&u!==void 0?u:0)*12;G.months=F%12,G.years=(F-G.months)/12}let R=((d=G.hours)!==null&&d!==void 0?d:0)*3600+((f=G.minutes)!==null&&f!==void 0?f:0)*60+((w=G.seconds)!==null&&w!==void 0?w:0)+((y=G.milliseconds)!==null&&y!==void 0?y:0)/1e3,x=1;R<0&&(x=-1,R=-R),R>=3600?(G.hours=x*Math.floor(R/3600),R-=x*G.hours*3600):delete G.hours,R>=60?(G.minutes=x*Math.floor(R/60),R-=x*G.minutes*60):delete G.minutes,R>0?(G.seconds=x*Math.floor(R),R-=x*G.seconds):delete G.seconds,R>0?G.milliseconds=x*Math.round(R*1e3):delete G.milliseconds;for(const[F]of n)G[F]||delete G[F];return G}t.normalizeInterval=a;function s(C){var l,c,B;C=a(C);const E=[];if(C.years&&E.push(C.years===1?"1 year":C.years+" years"),C.months&&E.push(C.months===1?"1 month":C.months+" months"),C.days&&E.push(C.days===1?"1 day":C.days+" days"),C.hours||C.minutes||C.seconds||C.milliseconds){let u=`${I((l=C.hours)!==null&&l!==void 0?l:0)}:${I((c=C.minutes)!==null&&c!==void 0?c:0)}:${I((B=C.seconds)!==null&&B!==void 0?B:0)}`;C.milliseconds&&(u=u+(C.milliseconds/1e3).toString().substr(1)),(r(C.hours)||r(C.minutes)||r(C.seconds)||r(C.milliseconds))&&(u="-"+u),E.push(u)}return E.join(" ")}t.intervalToString=s;function I(C){return C=Math.abs(C),C<10?"0"+C:C.toString()}function r(C){return C&&C<0}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.astVisitor=void 0;const n=i(2);class o{super(){return new a(this)}}const g=n.AstDefaultMapper.prototype;for(const I of Object.getOwnPropertyNames(g)){const r=g[I];I==="constructor"||I==="super"||typeof r!="function"||Object.defineProperty(o.prototype,I,{configurable:!1,get(){return function(...C){const l=this.visitor[I];return l?(l.apply(this.visitor,C),C[0]):r.apply(this,C)}}})}class a{constructor(r){this.parent=r}}for(const I of Object.getOwnPropertyNames(g)){const r=g[I];I==="constructor"||I==="super"||typeof r!="function"||Object.defineProperty(a.prototype,I,{configurable:!1,get(){return function(...C){return r.apply(this.parent,C)}}})}function s(I){return(0,n.astMapper)(r=>{const C=new o;return C.mapper=r,C.visitor=I(C),C})}t.astVisitor=s},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.trimNullish=t.NotSupported=void 0;class n extends Error{constructor(a){super("Not supported"+(a?": "+a:""))}static never(a,s){return new n(`${s??""} ${JSON.stringify(a)}`)}}t.NotSupported=n;function o(g,a=5){if(a<0||(g instanceof Array&&g.forEach(s=>o(s,a-1)),typeof g!="object"||g instanceof Date)||!g)return g;for(const s of Object.keys(g)){const I=g[s];I==null?delete g[s]:o(I,a-1)}return g}t.trimNullish=o},function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(C,l,c,B){B===void 0&&(B=c);var E=Object.getOwnPropertyDescriptor(l,c);(!E||("get"in E?!l.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return l[c]}}),Object.defineProperty(C,B,E)}:function(C,l,c,B){B===void 0&&(B=c),C[B]=l[c]}),o=this&&this.__exportStar||function(C,l){for(var c in C)c!=="default"&&!Object.prototype.hasOwnProperty.call(l,c)&&n(l,C,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeInterval=t.intervalToString=t.toSql=t.astMapper=t.assignChanged=t.arrayNilMap=t.astVisitor=t.parseWithComments=t.parseIntervalLiteral=t.parseGeometricLiteral=t.parseArrayLiteral=t.parseFirst=t.parse=void 0;var g=i(8);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return g.parse}}),Object.defineProperty(t,"parseFirst",{enumerable:!0,get:function(){return g.parseFirst}}),Object.defineProperty(t,"parseArrayLiteral",{enumerable:!0,get:function(){return g.parseArrayLiteral}}),Object.defineProperty(t,"parseGeometricLiteral",{enumerable:!0,get:function(){return g.parseGeometricLiteral}}),Object.defineProperty(t,"parseIntervalLiteral",{enumerable:!0,get:function(){return g.parseIntervalLiteral}}),Object.defineProperty(t,"parseWithComments",{enumerable:!0,get:function(){return g.parseWithComments}});var a=i(5);Object.defineProperty(t,"astVisitor",{enumerable:!0,get:function(){return a.astVisitor}});var s=i(2);Object.defineProperty(t,"arrayNilMap",{enumerable:!0,get:function(){return s.arrayNilMap}}),Object.defineProperty(t,"assignChanged",{enumerable:!0,get:function(){return s.assignChanged}}),Object.defineProperty(t,"astMapper",{enumerable:!0,get:function(){return s.astMapper}});var I=i(19);Object.defineProperty(t,"toSql",{enumerable:!0,get:function(){return I.toSql}}),o(i(21),t);var r=i(4);Object.defineProperty(t,"intervalToString",{enumerable:!0,get:function(){return r.intervalToString}}),Object.defineProperty(t,"normalizeInterval",{enumerable:!0,get:function(){return r.normalizeInterval}})},function(e,t,i){var n=this&&this.__importDefault||function(Q){return Q&&Q.__esModule?Q:{default:Q}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseGeometricLiteral=t.parseIntervalLiteral=t.parseArrayLiteral=t.parse=t.parseWithComments=t.parseFirst=void 0;const o=i(9),g=n(i(10)),a=n(i(11)),s=n(i(13)),I=n(i(15)),r=n(i(17)),C=i(4),l=i(1);let c,B,E,u,d;function f(Q){return y(Q)[0]}t.parseFirst=f;function w(Q,k){return(0,l.trackingComments)(()=>y(Q,k))}t.parseWithComments=w;function y(Q,k){c||(c=o.Grammar.fromCompiled(g.default));const h=typeof k=="string"?k:k==null?void 0:k.entry,N=typeof k=="string"?null:k,v=()=>F(Q,c,h);let K=N!=null&&N.locationTracking?(0,l.tracking)(v):v();return typeof k!="string"&&!Array.isArray(K)&&(K=[K]),K}t.parse=y;function G(Q){return B||(B=o.Grammar.fromCompiled(a.default)),F(Q,B)}t.parseArrayLiteral=G;function R(Q){if(Q.startsWith("P"))return d||(d=o.Grammar.fromCompiled(r.default)),(0,C.buildInterval)(Q,F(Q,d));{u||(u=o.Grammar.fromCompiled(I.default));const k=Q.toLowerCase();return(0,C.buildInterval)(Q,F(k,u))}}t.parseIntervalLiteral=R;function x(Q,k){return E||(E=o.Grammar.fromCompiled(s.default)),F(Q,E,k)}t.parseGeometricLiteral=x;function F(Q,k,h){try{k.start=h??"main";const N=new o.Parser(k);N.feed(Q);const v=N.finish();if(v.length){if(v.length!==1)throw new Error(`💀 Ambiguous SQL syntax: Please file an issue stating the request that has failed at https://github.com/oguimbal/pgsql-ast-parser:

        ${Q}

        `)}else throw new Error("Unexpected end of input");return v[0]}catch(N){if(typeof(N==null?void 0:N.message)!="string")throw N;let v=N.message,K=null;const U=[],V=/A (.+) token based on:/g;let X;for(;X=V.exec(v);)K=K??v.substr(0,X.index),U.push(`    - A "${X[1]}" token`);throw K&&(v=K+U.join(`
`)+`

`),N.message=v,N}}},function(e,t){e.exports=VBi()},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});function n(Q){return Q[0]}const o=i(1),g=i(1);function a(Q){return s(Q,void 0)}function s(Q,k){const h=u(Q);return!k||k.length===0?(0,g.track)(Q,{name:h}):(0,g.track)(Q,{name:h,columns:k.map(N=>({name:u(N)}))})}function I(Q){const k=u(Q);return(0,g.track)(Q,{value:k})}function r(Q){return Array.isArray(Q)&&Q.length===1&&(Q=r(Q[0])),Array.isArray(Q)&&!Q.length?null:(0,g.unbox)(Q)}const C=Q=>k=>(0,g.track)(k,k[Q]),l=Q=>Array.isArray(Q)?(0,g.track)(Q[Q.length-1],Q[Q.length-1]):Q;function c(Q){if(Array.isArray(Q)){const k=[];for(const h of Q)k.push(...c(h));return k}return Q?[Q]:[]}function B(Q){var k;return Q=(0,g.unbox)(Q),(k=Q==null?void 0:Q.value)!==null&&k!==void 0?k:Q}function E(Q){return c((0,g.unbox)(Q)).filter(h=>!!h).map(h=>B(h)).filter(h=>typeof h=="string").map(h=>h.trim()).filter(h=>!!h)}function u(Q,k){return E(Q).join(k||"")}function d(Q){const k={};for(const[h,N]of Q)k[h]=N;return k}const f={sensitivity:"accent"},w=(Q,k)=>Q.localeCompare(k,void 0,f)===0,y=Q=>(k,h,N)=>{const v=B(k[0]);return w(v,Q)?(0,g.box)(k,Q):N},G=y,R=(...Q)=>{const k=new Set(Q);return(h,N,v)=>{const K=typeof h[0]=="string"?h[0]:h[0].value;return k.has(K)?K:v}};function x(Q,k){const h=new Set,N=k.map(g.unbox);for(const[v,K]of N){if(h.has(v))throw new Error("conflicting or redundant options");h.add(v),Q[v]=(0,g.unbox)(K)}}const F={Lexer:o.lexerAny,ParserRules:[{name:"lparen",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen]},{name:"rparen",symbols:[o.lexerAny.has("rparen")?{type:"rparen"}:rparen]},{name:"number$subexpression$1",symbols:["float"]},{name:"number$subexpression$1",symbols:["int"]},{name:"number",symbols:["number$subexpression$1"],postprocess:r},{name:"dot",symbols:[o.lexerAny.has("dot")?{type:"dot"}:dot],postprocess:n},{name:"float",symbols:[o.lexerAny.has("float")?{type:"float"}:float],postprocess:Q=>(0,g.box)(Q,parseFloat(r(Q)))},{name:"int",symbols:[o.lexerAny.has("int")?{type:"int"}:int],postprocess:Q=>(0,g.box)(Q,parseInt(r(Q),10))},{name:"comma",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma],postprocess:n},{name:"star",symbols:[o.lexerAny.has("star")?{type:"star"}:star],postprocess:Q=>(0,g.box)(Q,Q[0].value)},{name:"string$subexpression$1",symbols:[o.lexerAny.has("string")?{type:"string"}:string]},{name:"string$subexpression$1",symbols:[o.lexerAny.has("eString")?{type:"eString"}:eString]},{name:"string",symbols:["string$subexpression$1"],postprocess:Q=>(0,g.box)(Q,r(Q[0]).value)},{name:"ident",symbols:["word"],postprocess:C(0)},{name:"word",symbols:[o.lexerAny.has("kw_primary")?{type:"kw_primary"}:kw_primary],postprocess:Q=>(0,g.box)(Q,"primary")},{name:"word",symbols:[o.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique],postprocess:Q=>(0,g.box)(Q,"unique")},{name:"word",symbols:[o.lexerAny.has("quoted_word")?{type:"quoted_word"}:quoted_word],postprocess:Q=>(0,g.box)(Q,Q[0].value,!0)},{name:"word",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:Q=>(0,g.box)(Q,Q[0].value)},{name:"collist_paren",symbols:["lparen","collist","rparen"],postprocess:C(1)},{name:"collist$ebnf$1",symbols:[]},{name:"collist$ebnf$1$subexpression$1",symbols:["comma","ident"],postprocess:l},{name:"collist$ebnf$1",symbols:["collist$ebnf$1","collist$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"collist",symbols:["ident","collist$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"kw_between",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("between")},{name:"kw_conflict",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("conflict")},{name:"kw_nothing",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("nothing")},{name:"kw_begin",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("begin")},{name:"kw_if",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("if")},{name:"kw_exists",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("exists")},{name:"kw_key",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("key")},{name:"kw_index",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("index")},{name:"kw_extension",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("extension")},{name:"kw_schema",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("schema")},{name:"kw_nulls",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("nulls")},{name:"kw_first",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("first")},{name:"kw_last",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("last")},{name:"kw_start",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("start")},{name:"kw_restart",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("restart")},{name:"kw_filter",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("filter")},{name:"kw_commit",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("commit")},{name:"kw_tablespace",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("tablespace")},{name:"kw_transaction",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("transaction")},{name:"kw_work",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("work")},{name:"kw_read",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("read")},{name:"kw_write",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("write")},{name:"kw_isolation",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("isolation")},{name:"kw_level",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("level")},{name:"kw_serializable",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("serializable")},{name:"kw_rollback",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("rollback")},{name:"kw_insert",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("insert")},{name:"kw_value",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("value")},{name:"kw_values",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("values")},{name:"kw_update",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("update")},{name:"kw_column",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("column")},{name:"kw_set",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("set")},{name:"kw_version",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("version")},{name:"kw_alter",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("alter")},{name:"kw_rename",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("rename")},{name:"kw_sequence",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("sequence")},{name:"kw_temp",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("temp")},{name:"kw_temporary",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("temporary")},{name:"kw_add",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("add")},{name:"kw_owner",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("owner")},{name:"kw_owned",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("owned")},{name:"kw_including",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("including")},{name:"kw_excluding",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("excluding")},{name:"kw_none",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("none")},{name:"kw_drop",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("drop")},{name:"kw_operator",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("operator")},{name:"kw_minvalue",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("minvalue")},{name:"kw_maxvalue",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("maxvalue")},{name:"kw_data",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("data")},{name:"kw_type",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("type")},{name:"kw_trigger",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("trigger")},{name:"kw_delete",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("delete")},{name:"kw_cache",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("cache")},{name:"kw_cascade",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("cascade")},{name:"kw_no",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("no")},{name:"kw_timestamp",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("timestamp")},{name:"kw_cycle",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("cycle")},{name:"kw_function",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("function")},{name:"kw_returns",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("returns")},{name:"kw_language",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("language")},{name:"kw_out",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("out")},{name:"kw_inout",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("inout")},{name:"kw_variadic",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("variadic")},{name:"kw_action",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("action")},{name:"kw_restrict",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("restrict")},{name:"kw_truncate",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("truncate")},{name:"kw_increment",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("increment")},{name:"kw_by",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("by")},{name:"kw_row",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("row")},{name:"kw_rows",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("rows")},{name:"kw_next",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("next")},{name:"kw_match",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("match")},{name:"kw_replace",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("replace")},{name:"kw_recursive",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("recursive")},{name:"kw_view",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("view")},{name:"kw_cascaded",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("cascaded")},{name:"kw_unlogged",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("unlogged")},{name:"kw_global",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("global")},{name:"kw_option",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("option")},{name:"kw_materialized",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("materialized")},{name:"kw_partial",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("partial")},{name:"kw_partition",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("partition")},{name:"kw_simple",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("simple")},{name:"kw_generated",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("generated")},{name:"kw_always",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("always")},{name:"kw_identity",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("identity")},{name:"kw_name",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("name")},{name:"kw_enum",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("enum")},{name:"kw_show",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("show")},{name:"kw_ordinality",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("ordinality")},{name:"kw_overriding",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("overriding")},{name:"kw_over",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("over")},{name:"kw_system",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("system")},{name:"kw_comment",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("comment")},{name:"kw_time",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("time")},{name:"kw_names",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("names")},{name:"kw_at",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("at")},{name:"kw_zone",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("zone")},{name:"kw_interval",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("interval")},{name:"kw_hour",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("hour")},{name:"kw_minute",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("minute")},{name:"kw_local",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("local")},{name:"kw_prepare",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("prepare")},{name:"kw_deallocate",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("deallocate")},{name:"kw_raise",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("raise")},{name:"kw_continue",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("continue")},{name:"kw_share",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("share")},{name:"kw_refresh",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("refresh")},{name:"kw_nowait",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("nowait")},{name:"kw_skip",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("skip")},{name:"kw_locked",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:y("locked")},{name:"kw_ifnotexists",symbols:["kw_if",o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not,"kw_exists"]},{name:"kw_ifexists",symbols:["kw_if","kw_exists"]},{name:"kw_withordinality",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"kw_ordinality"]},{name:"kw_not_null",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not,o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"kw_primary_key",symbols:[o.lexerAny.has("kw_primary")?{type:"kw_primary"}:kw_primary,"kw_key"]},{name:"data_type$ebnf$1$subexpression$1$macrocall$2",symbols:["int"]},{name:"data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1",symbols:[]},{name:"data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"data_type$ebnf$1$subexpression$1$macrocall$2"],postprocess:l},{name:"data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1",symbols:["data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1","data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"data_type$ebnf$1$subexpression$1$macrocall$1",symbols:["data_type$ebnf$1$subexpression$1$macrocall$2","data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"data_type$ebnf$1$subexpression$1",symbols:["lparen","data_type$ebnf$1$subexpression$1$macrocall$1","rparen"],postprocess:C(1)},{name:"data_type$ebnf$1",symbols:["data_type$ebnf$1$subexpression$1"],postprocess:n},{name:"data_type$ebnf$1",symbols:[],postprocess:()=>null},{name:"data_type$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1",symbols:["data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1"]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$2",symbols:[o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1",symbols:["data_type$ebnf$2$subexpression$1$ebnf$1","data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$2"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"data_type$ebnf$2$subexpression$1",symbols:["data_type$ebnf$2$subexpression$1$ebnf$1"]},{name:"data_type$ebnf$2",symbols:["data_type$ebnf$2$subexpression$1"],postprocess:n},{name:"data_type$ebnf$2",symbols:[],postprocess:()=>null},{name:"data_type",symbols:["data_type_simple","data_type$ebnf$1","data_type$ebnf$2"],postprocess:Q=>{let k=Q[2];const h=r(Q[0]);let N;if(N={...h,...Array.isArray(Q[1])&&Q[1].length?{config:Q[1].map(r)}:{}},k){k[0].type==="kw_array"&&(k=[["array"]]);for(const v of k[0])N={kind:"array",arrayOf:N}}return(0,g.track)(Q,N)}},{name:"data_type_list$ebnf$1",symbols:[]},{name:"data_type_list$ebnf$1$subexpression$1",symbols:["comma","data_type"],postprocess:l},{name:"data_type_list$ebnf$1",symbols:["data_type_list$ebnf$1","data_type_list$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"data_type_list",symbols:["data_type","data_type_list$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"data_type_simple",symbols:["data_type_text"],postprocess:Q=>(0,g.track)(Q,{name:u(Q," ")})},{name:"data_type_simple",symbols:["data_type_numeric"],postprocess:Q=>(0,g.track)(Q,{name:u(Q," ")})},{name:"data_type_simple",symbols:["data_type_date"]},{name:"data_type_simple",symbols:["qualified_name_mark_quotes"]},{name:"data_type_numeric$subexpression$1",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("double")},{name:"data_type_numeric",symbols:["data_type_numeric$subexpression$1",o.lexerAny.has("kw_precision")?{type:"kw_precision"}:kw_precision]},{name:"data_type_text$subexpression$1",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("character","bit")},{name:"data_type_text$subexpression$2",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("varying")},{name:"data_type_text",symbols:["data_type_text$subexpression$1","data_type_text$subexpression$2"]},{name:"data_type_date$subexpression$1",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("timestamp","time")},{name:"data_type_date$subexpression$2",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with]},{name:"data_type_date$subexpression$2",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("without")},{name:"data_type_date$subexpression$3",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("time")},{name:"data_type_date$subexpression$4",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("zone")},{name:"data_type_date",symbols:["data_type_date$subexpression$1","data_type_date$subexpression$2","data_type_date$subexpression$3","data_type_date$subexpression$4"],postprocess:Q=>(0,g.track)(Q,{name:u(Q," ")})},{name:"data_type_date$subexpression$5",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("timestamp","time")},{name:"data_type_date$subexpression$6",symbols:["lparen","int","rparen"],postprocess:C(1)},{name:"data_type_date$subexpression$7",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with]},{name:"data_type_date$subexpression$7",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("without")},{name:"data_type_date$subexpression$8",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("time")},{name:"data_type_date$subexpression$9",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:G("zone")},{name:"data_type_date",symbols:["data_type_date$subexpression$5","data_type_date$subexpression$6","data_type_date$subexpression$7","data_type_date$subexpression$8","data_type_date$subexpression$9"],postprocess:Q=>(0,g.track)(Q,{name:`timestamp ${u(Q[2])} time zone`,config:[(0,g.unbox)(Q[1])]})},{name:"ident_aliased$subexpression$1",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"ident"],postprocess:l},{name:"ident_aliased",symbols:["ident_aliased$subexpression$1"]},{name:"ident_aliased",symbols:["ident"],postprocess:r},{name:"table_ref",symbols:["qualified_name"],postprocess:r},{name:"qcolumn$ebnf$1$subexpression$1",symbols:["dot","ident"],postprocess:l},{name:"qcolumn$ebnf$1",symbols:["qcolumn$ebnf$1$subexpression$1"],postprocess:n},{name:"qcolumn$ebnf$1",symbols:[],postprocess:()=>null},{name:"qcolumn",symbols:["ident","dot","ident","qcolumn$ebnf$1"],postprocess:Q=>Q[3]?(0,g.track)(Q,{schema:(0,g.unbox)(Q[0]),table:(0,g.unbox)(Q[2]),column:(0,g.unbox)(Q[3])}):(0,g.track)(Q,{table:(0,g.unbox)(Q[0]),column:(0,g.unbox)(Q[2])})},{name:"table_ref_aliased$ebnf$1",symbols:["ident_aliased"],postprocess:n},{name:"table_ref_aliased$ebnf$1",symbols:[],postprocess:()=>null},{name:"table_ref_aliased",symbols:["table_ref","table_ref_aliased$ebnf$1"],postprocess:Q=>{const k=r(Q[1]);return(0,g.track)(Q,{...r(Q[0]),...k?{alias:k}:{}})}},{name:"qualified_name",symbols:["qname_ident"],postprocess:Q=>(0,g.track)(Q,{name:u(Q)})},{name:"qualified_name",symbols:["ident","dot","ident_extended"],postprocess:Q=>{const k=u(Q[0]),h=u(Q[2]);return(0,g.track)(Q,{schema:k,name:h})}},{name:"qualified_name",symbols:[o.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema],postprocess:Q=>(0,g.track)(Q,{name:"current_schema"})},{name:"qualified_name_mark_quotes",symbols:["qname_ident"],postprocess:Q=>(0,g.track)(Q,{name:u(Q),...(0,g.doubleQuoted)(Q)})},{name:"qualified_name_mark_quotes",symbols:["ident","dot","ident_extended"],postprocess:Q=>{const k=u(Q[0]),h=u(Q[2]);return(0,g.track)(Q,{schema:k,name:h,...(0,g.doubleQuoted)(Q[2])})}},{name:"qualified_name_mark_quotes",symbols:[o.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema],postprocess:Q=>(0,g.track)(Q,{name:"current_schema"})},{name:"qname_ident",symbols:["ident"]},{name:"qname_ident",symbols:[o.lexerAny.has("kw_precision")?{type:"kw_precision"}:kw_precision]},{name:"qname",symbols:["qualified_name"],postprocess:r},{name:"any_keyword",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_analyse")?{type:"kw_analyse"}:kw_analyse]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_analyze")?{type:"kw_analyze"}:kw_analyze]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_and")?{type:"kw_and"}:kw_and]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_any")?{type:"kw_any"}:kw_any]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_asc")?{type:"kw_asc"}:kw_asc]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_asymmetric")?{type:"kw_asymmetric"}:kw_asymmetric]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_authorization")?{type:"kw_authorization"}:kw_authorization]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_binary")?{type:"kw_binary"}:kw_binary]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_both")?{type:"kw_both"}:kw_both]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_case")?{type:"kw_case"}:kw_case]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_cast")?{type:"kw_cast"}:kw_cast]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_collate")?{type:"kw_collate"}:kw_collate]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_collation")?{type:"kw_collation"}:kw_collation]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_concurrently")?{type:"kw_concurrently"}:kw_concurrently]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_cross")?{type:"kw_cross"}:kw_cross]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_catalog")?{type:"kw_current_catalog"}:kw_current_catalog]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_date")?{type:"kw_current_date"}:kw_current_date]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_role")?{type:"kw_current_role"}:kw_current_role]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_time")?{type:"kw_current_time"}:kw_current_time]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_timestamp")?{type:"kw_current_timestamp"}:kw_current_timestamp]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_current_user")?{type:"kw_current_user"}:kw_current_user]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_deferrable")?{type:"kw_deferrable"}:kw_deferrable]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_desc")?{type:"kw_desc"}:kw_desc]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_distinct")?{type:"kw_distinct"}:kw_distinct]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_else")?{type:"kw_else"}:kw_else]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_end")?{type:"kw_end"}:kw_end]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_except")?{type:"kw_except"}:kw_except]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_fetch")?{type:"kw_fetch"}:kw_fetch]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_foreign")?{type:"kw_foreign"}:kw_foreign]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_freeze")?{type:"kw_freeze"}:kw_freeze]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_full")?{type:"kw_full"}:kw_full]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_grant")?{type:"kw_grant"}:kw_grant]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_group")?{type:"kw_group"}:kw_group]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_having")?{type:"kw_having"}:kw_having]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_ilike")?{type:"kw_ilike"}:kw_ilike]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_in")?{type:"kw_in"}:kw_in]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_initially")?{type:"kw_initially"}:kw_initially]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_inner")?{type:"kw_inner"}:kw_inner]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_intersect")?{type:"kw_intersect"}:kw_intersect]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_into")?{type:"kw_into"}:kw_into]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_isnull")?{type:"kw_isnull"}:kw_isnull]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_join")?{type:"kw_join"}:kw_join]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_lateral")?{type:"kw_lateral"}:kw_lateral]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_leading")?{type:"kw_leading"}:kw_leading]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_left")?{type:"kw_left"}:kw_left]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_like")?{type:"kw_like"}:kw_like]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_limit")?{type:"kw_limit"}:kw_limit]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_localtime")?{type:"kw_localtime"}:kw_localtime]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_localtimestamp")?{type:"kw_localtimestamp"}:kw_localtimestamp]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_natural")?{type:"kw_natural"}:kw_natural]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_notnull")?{type:"kw_notnull"}:kw_notnull]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_offset")?{type:"kw_offset"}:kw_offset]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_order")?{type:"kw_order"}:kw_order]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_overlaps")?{type:"kw_overlaps"}:kw_overlaps]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_placing")?{type:"kw_placing"}:kw_placing]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_primary")?{type:"kw_primary"}:kw_primary]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_references")?{type:"kw_references"}:kw_references]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_right")?{type:"kw_right"}:kw_right]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_select")?{type:"kw_select"}:kw_select]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_session_user")?{type:"kw_session_user"}:kw_session_user]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_similar")?{type:"kw_similar"}:kw_similar]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_some")?{type:"kw_some"}:kw_some]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_symmetric")?{type:"kw_symmetric"}:kw_symmetric]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_tablesample")?{type:"kw_tablesample"}:kw_tablesample]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_then")?{type:"kw_then"}:kw_then]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_trailing")?{type:"kw_trailing"}:kw_trailing]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_union")?{type:"kw_union"}:kw_union]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_user")?{type:"kw_user"}:kw_user]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_variadic")?{type:"kw_variadic"}:kw_variadic]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_verbose")?{type:"kw_verbose"}:kw_verbose]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_when")?{type:"kw_when"}:kw_when]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_window")?{type:"kw_window"}:kw_window]},{name:"any_keyword",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with]},{name:"ident_extended",symbols:["ident"]},{name:"ident_extended",symbols:["any_keyword"]},{name:"select_statement$ebnf$1",symbols:["select_from"],postprocess:n},{name:"select_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$2",symbols:["select_where"],postprocess:n},{name:"select_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$3$subexpression$1$ebnf$1",symbols:["select_having"],postprocess:n},{name:"select_statement$ebnf$3$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$3$subexpression$1",symbols:["select_groupby","select_statement$ebnf$3$subexpression$1$ebnf$1"]},{name:"select_statement$ebnf$3",symbols:["select_statement$ebnf$3$subexpression$1"],postprocess:n},{name:"select_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$4",symbols:["select_order_by"],postprocess:n},{name:"select_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$5",symbols:["select_limit_offset"],postprocess:n},{name:"select_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$6$subexpression$1$ebnf$1",symbols:["select_skip"],postprocess:n},{name:"select_statement$ebnf$6$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$6$subexpression$1",symbols:["select_for","select_statement$ebnf$6$subexpression$1$ebnf$1"]},{name:"select_statement$ebnf$6",symbols:["select_statement$ebnf$6$subexpression$1"],postprocess:n},{name:"select_statement$ebnf$6",symbols:[],postprocess:()=>null},{name:"select_statement",symbols:["select_what","select_statement$ebnf$1","select_statement$ebnf$2","select_statement$ebnf$3","select_statement$ebnf$4","select_statement$ebnf$5","select_statement$ebnf$6"],postprocess:Q=>{let[k,h,N,v,K,U,V]=Q;h=r(h);let X=v&&v[0],_=v&&v[1];X=X&&(X.length===1&&X[0].type==="list"?X[0].expressions:X),_=_&&r(_);let q=V&&V[0],$=V&&V[1];return $=r($),(0,g.track)(Q,{...k,...h?{from:Array.isArray(h)?h:[h]}:{},...X?{groupBy:X}:{},..._?{having:_}:{},...U?{limit:r(U)}:{},...K?{orderBy:K}:{},...N?{where:N}:{},...q?{for:q[1]}:{},...$?{skip:$}:{},type:"select"})}},{name:"select_from",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"select_from_items"],postprocess:l},{name:"select_from_items$ebnf$1",symbols:[]},{name:"select_from_items$ebnf$1$subexpression$1",symbols:["comma","select_from_item"],postprocess:l},{name:"select_from_items$ebnf$1",symbols:["select_from_items$ebnf$1","select_from_items$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"select_from_items",symbols:["select_from_item","select_from_items$ebnf$1"],postprocess:([Q,k])=>[...Q,...c(k)||[]]},{name:"select_from_item",symbols:["select_from_subject"]},{name:"select_from_item",symbols:["select_from_item_joins"],postprocess:C(0)},{name:"select_from_item_joins$subexpression$1",symbols:["select_from_item"],postprocess:C(0)},{name:"select_from_item_joins",symbols:["select_from_item_joins$subexpression$1","select_table_join"],postprocess:c},{name:"select_from_item_joins",symbols:["lparen","select_from_item_joins","rparen"],postprocess:C(1)},{name:"select_from_subject",symbols:["stb_table"],postprocess:r},{name:"select_from_subject",symbols:["stb_statement"],postprocess:r},{name:"select_from_subject",symbols:["stb_call"],postprocess:r},{name:"stb_opts$ebnf$1",symbols:["collist_paren"],postprocess:n},{name:"stb_opts$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_opts",symbols:["ident_aliased","stb_opts$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{alias:u(Q[0]),...Q[1]&&{columnNames:(0,g.unbox)(Q[1]).map(a)}})},{name:"stb_table$ebnf$1",symbols:["stb_opts"],postprocess:n},{name:"stb_table$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_table",symbols:["table_ref","stb_table$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{type:"table",name:(0,g.track)(Q,{...Q[0],...Q[1]})})},{name:"stb_statement",symbols:["selection_paren","stb_opts"],postprocess:Q=>(0,g.track)(Q,{type:"statement",statement:r(Q[0]),...Q[1]})},{name:"select_values",symbols:["kw_values","insert_values"],postprocess:Q=>(0,g.track)(Q,{type:"values",values:Q[1]})},{name:"stb_call$ebnf$1",symbols:["kw_withordinality"],postprocess:n},{name:"stb_call$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_call$ebnf$2",symbols:["stb_call_alias"],postprocess:n},{name:"stb_call$ebnf$2",symbols:[],postprocess:()=>null},{name:"stb_call",symbols:["expr_function_call","stb_call$ebnf$1","stb_call$ebnf$2"],postprocess:Q=>{const k=Q[1],h=Q[2];return!k&&!h?Q[0]:(0,g.track)(Q,{...Q[0],...k&&{withOrdinality:!0},alias:h?s(h[0],h[1]):void 0})}},{name:"stb_call_alias$subexpression$1$ebnf$1",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as],postprocess:n},{name:"stb_call_alias$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_call_alias$subexpression$1",symbols:["stb_call_alias$subexpression$1$ebnf$1","ident"],postprocess:l},{name:"stb_call_alias$ebnf$1",symbols:["stb_call_alias_list"],postprocess:n},{name:"stb_call_alias$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_call_alias",symbols:["stb_call_alias$subexpression$1","stb_call_alias$ebnf$1"]},{name:"stb_call_alias_list",symbols:["lparen","stb_call_alias_list_raw","rparen"],postprocess:C(1)},{name:"stb_call_alias_list_raw$ebnf$1",symbols:[]},{name:"stb_call_alias_list_raw$ebnf$1$subexpression$1",symbols:["comma","ident"],postprocess:l},{name:"stb_call_alias_list_raw$ebnf$1",symbols:["stb_call_alias_list_raw$ebnf$1","stb_call_alias_list_raw$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"stb_call_alias_list_raw",symbols:["ident","stb_call_alias_list_raw$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"select_table_join$ebnf$1",symbols:["select_table_join_clause"],postprocess:n},{name:"select_table_join$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_table_join",symbols:["select_join_op",o.lexerAny.has("kw_join")?{type:"kw_join"}:kw_join,"select_from_subject","select_table_join$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{...r(Q[2]),join:{type:u(Q[0]," "),...Q[3]&&r(Q[3])}})},{name:"select_table_join_clause",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"expr"],postprocess:Q=>(0,g.track)(Q,{on:l(Q)})},{name:"select_table_join_clause$macrocall$2",symbols:["ident"]},{name:"select_table_join_clause$macrocall$1$ebnf$1",symbols:[]},{name:"select_table_join_clause$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"select_table_join_clause$macrocall$2"],postprocess:l},{name:"select_table_join_clause$macrocall$1$ebnf$1",symbols:["select_table_join_clause$macrocall$1$ebnf$1","select_table_join_clause$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"select_table_join_clause$macrocall$1",symbols:["select_table_join_clause$macrocall$2","select_table_join_clause$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"select_table_join_clause",symbols:[o.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using,"lparen","select_table_join_clause$macrocall$1","rparen"],postprocess:Q=>(0,g.track)(Q,{using:Q[2].map(a)})},{name:"select_join_op$subexpression$1$ebnf$1",symbols:[o.lexerAny.has("kw_inner")?{type:"kw_inner"}:kw_inner],postprocess:n},{name:"select_join_op$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$1",symbols:["select_join_op$subexpression$1$ebnf$1"],postprocess:Q=>(0,g.box)(Q,"INNER JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$1"]},{name:"select_join_op$subexpression$2",symbols:[o.lexerAny.has("kw_cross")?{type:"kw_cross"}:kw_cross],postprocess:Q=>(0,g.box)(Q,"CROSS JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$2"]},{name:"select_join_op$subexpression$3$ebnf$1",symbols:[o.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer],postprocess:n},{name:"select_join_op$subexpression$3$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$3",symbols:[o.lexerAny.has("kw_left")?{type:"kw_left"}:kw_left,"select_join_op$subexpression$3$ebnf$1"],postprocess:Q=>(0,g.box)(Q,"LEFT JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$3"]},{name:"select_join_op$subexpression$4$ebnf$1",symbols:[o.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer],postprocess:n},{name:"select_join_op$subexpression$4$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$4",symbols:[o.lexerAny.has("kw_right")?{type:"kw_right"}:kw_right,"select_join_op$subexpression$4$ebnf$1"],postprocess:Q=>(0,g.box)(Q,"RIGHT JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$4"]},{name:"select_join_op$subexpression$5$ebnf$1",symbols:[o.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer],postprocess:n},{name:"select_join_op$subexpression$5$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$5",symbols:[o.lexerAny.has("kw_full")?{type:"kw_full"}:kw_full,"select_join_op$subexpression$5$ebnf$1"],postprocess:Q=>(0,g.box)(Q,"FULL JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$5"]},{name:"select_what$ebnf$1",symbols:["select_distinct"],postprocess:n},{name:"select_what$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_what$ebnf$2",symbols:["select_expr_list_aliased"],postprocess:n},{name:"select_what$ebnf$2",symbols:[],postprocess:()=>null},{name:"select_what",symbols:[o.lexerAny.has("kw_select")?{type:"kw_select"}:kw_select,"select_what$ebnf$1","select_what$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{columns:Q[2],...Q[1]&&{distinct:(0,g.unbox)(Q[1])}})},{name:"select_expr_list_aliased$ebnf$1",symbols:[]},{name:"select_expr_list_aliased$ebnf$1$subexpression$1",symbols:["comma","select_expr_list_item"],postprocess:l},{name:"select_expr_list_aliased$ebnf$1",symbols:["select_expr_list_aliased$ebnf$1","select_expr_list_aliased$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"select_expr_list_aliased",symbols:["select_expr_list_item","select_expr_list_aliased$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"select_expr_list_item$ebnf$1",symbols:["ident_aliased"],postprocess:n},{name:"select_expr_list_item$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_expr_list_item",symbols:["expr","select_expr_list_item$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{expr:Q[0],...Q[1]?{alias:a(Q[1])}:{}})},{name:"select_distinct",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all],postprocess:Q=>(0,g.box)(Q,"all")},{name:"select_distinct$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"lparen","expr_list_raw","rparen"],postprocess:C(2)},{name:"select_distinct$ebnf$1",symbols:["select_distinct$ebnf$1$subexpression$1"],postprocess:n},{name:"select_distinct$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_distinct",symbols:[o.lexerAny.has("kw_distinct")?{type:"kw_distinct"}:kw_distinct,"select_distinct$ebnf$1"],postprocess:Q=>(0,g.box)(Q,Q[1]||"distinct")},{name:"select_where",symbols:[o.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr"],postprocess:l},{name:"select_groupby",symbols:[o.lexerAny.has("kw_group")?{type:"kw_group"}:kw_group,"kw_by","expr_list_raw"],postprocess:l},{name:"select_having",symbols:[o.lexerAny.has("kw_having")?{type:"kw_having"}:kw_having,"expr"],postprocess:l},{name:"select_limit_offset$ebnf$1$subexpression$1",symbols:["select_offset"]},{name:"select_limit_offset$ebnf$1$subexpression$1",symbols:["select_limit"]},{name:"select_limit_offset$ebnf$1",symbols:["select_limit_offset$ebnf$1$subexpression$1"]},{name:"select_limit_offset$ebnf$1$subexpression$2",symbols:["select_offset"]},{name:"select_limit_offset$ebnf$1$subexpression$2",symbols:["select_limit"]},{name:"select_limit_offset$ebnf$1",symbols:["select_limit_offset$ebnf$1","select_limit_offset$ebnf$1$subexpression$2"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"select_limit_offset",symbols:["select_limit_offset$ebnf$1"],postprocess:(Q,k)=>{const h=r(Q);if(!Array.isArray(h))return(0,g.track)(Q,h);if(h.length!=2)return k;const N=r(h[0]),v=r(h[1]);return N.offset&&v.offset||N.limit&&v.limit?k:(0,g.track)(Q,{...N,...v})}},{name:"select_offset$ebnf$1$subexpression$1",symbols:["kw_row"]},{name:"select_offset$ebnf$1$subexpression$1",symbols:["kw_rows"]},{name:"select_offset$ebnf$1",symbols:["select_offset$ebnf$1$subexpression$1"],postprocess:n},{name:"select_offset$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_offset",symbols:[o.lexerAny.has("kw_offset")?{type:"kw_offset"}:kw_offset,"expr_nostar","select_offset$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{offset:r(Q[1])})},{name:"select_limit$subexpression$1",symbols:["select_limit_1"]},{name:"select_limit$subexpression$1",symbols:["select_limit_2"]},{name:"select_limit",symbols:["select_limit$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{limit:r(Q)})},{name:"select_limit_1",symbols:[o.lexerAny.has("kw_limit")?{type:"kw_limit"}:kw_limit,"expr_nostar"],postprocess:l},{name:"select_limit_2$ebnf$1$subexpression$1",symbols:["kw_first"]},{name:"select_limit_2$ebnf$1$subexpression$1",symbols:["kw_next"]},{name:"select_limit_2$ebnf$1",symbols:["select_limit_2$ebnf$1$subexpression$1"],postprocess:n},{name:"select_limit_2$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_limit_2$subexpression$1",symbols:["kw_row"]},{name:"select_limit_2$subexpression$1",symbols:["kw_rows"]},{name:"select_limit_2",symbols:[o.lexerAny.has("kw_fetch")?{type:"kw_fetch"}:kw_fetch,"select_limit_2$ebnf$1","expr_nostar","select_limit_2$subexpression$1",o.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only],postprocess:C(2)},{name:"select_for$subexpression$1",symbols:["kw_update"],postprocess:Q=>(0,g.track)(Q,{type:"update"})},{name:"select_for$subexpression$1",symbols:["kw_no","kw_key","kw_update"],postprocess:Q=>(0,g.track)(Q,{type:"no key update"})},{name:"select_for$subexpression$1",symbols:["kw_share"],postprocess:Q=>(0,g.track)(Q,{type:"share"})},{name:"select_for$subexpression$1",symbols:["kw_key","kw_share"],postprocess:Q=>(0,g.track)(Q,{type:"key share"})},{name:"select_for",symbols:[o.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for,"select_for$subexpression$1"]},{name:"select_skip$subexpression$1",symbols:["kw_nowait"],postprocess:Q=>(0,g.track)(Q,{type:"nowait"})},{name:"select_skip$subexpression$1",symbols:["kw_skip","kw_locked"],postprocess:Q=>(0,g.track)(Q,{type:"skip locked"})},{name:"select_skip",symbols:["select_skip$subexpression$1"]},{name:"select_order_by$subexpression$1",symbols:[o.lexerAny.has("kw_order")?{type:"kw_order"}:kw_order,"kw_by"]},{name:"select_order_by$ebnf$1",symbols:[]},{name:"select_order_by$ebnf$1$subexpression$1",symbols:["comma","select_order_by_expr"],postprocess:l},{name:"select_order_by$ebnf$1",symbols:["select_order_by$ebnf$1","select_order_by$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"select_order_by",symbols:["select_order_by$subexpression$1","select_order_by_expr","select_order_by$ebnf$1"],postprocess:([Q,k,h])=>[k,...h||[]]},{name:"select_order_by_expr$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_asc")?{type:"kw_asc"}:kw_asc]},{name:"select_order_by_expr$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_desc")?{type:"kw_desc"}:kw_desc]},{name:"select_order_by_expr$ebnf$1",symbols:["select_order_by_expr$ebnf$1$subexpression$1"],postprocess:n},{name:"select_order_by_expr$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_order_by_expr$ebnf$2$subexpression$1$subexpression$1",symbols:["kw_first"]},{name:"select_order_by_expr$ebnf$2$subexpression$1$subexpression$1",symbols:["kw_last"]},{name:"select_order_by_expr$ebnf$2$subexpression$1",symbols:["kw_nulls","select_order_by_expr$ebnf$2$subexpression$1$subexpression$1"],postprocess:l},{name:"select_order_by_expr$ebnf$2",symbols:["select_order_by_expr$ebnf$2$subexpression$1"],postprocess:n},{name:"select_order_by_expr$ebnf$2",symbols:[],postprocess:()=>null},{name:"select_order_by_expr",symbols:["expr","select_order_by_expr$ebnf$1","select_order_by_expr$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{by:Q[0],...Q[1]&&{order:u(Q[1]).toUpperCase()},...Q[2]&&{nulls:u(Q[2]).toUpperCase()}})},{name:"expr",symbols:["expr_nostar"],postprocess:r},{name:"expr",symbols:["expr_star"],postprocess:r},{name:"expr_nostar",symbols:["expr_paren"],postprocess:r},{name:"expr_nostar",symbols:["expr_or"],postprocess:r},{name:"expr_paren$subexpression$1",symbols:["expr_or_select"]},{name:"expr_paren$subexpression$1",symbols:["expr_list_many"]},{name:"expr_paren",symbols:["lparen","expr_paren$subexpression$1","rparen"],postprocess:C(1)},{name:"expr_or$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or]},{name:"expr_or$macrocall$2$macrocall$1",symbols:["expr_or$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_or$macrocall$2",symbols:["expr_or$macrocall$2$macrocall$1"]},{name:"expr_or$macrocall$3",symbols:["expr_or"]},{name:"expr_or$macrocall$4",symbols:["expr_and"]},{name:"expr_or$macrocall$1$subexpression$1",symbols:["expr_or$macrocall$3"]},{name:"expr_or$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_or$macrocall$1$subexpression$2",symbols:["expr_or$macrocall$4"]},{name:"expr_or$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_or$macrocall$1",symbols:["expr_or$macrocall$1$subexpression$1","expr_or$macrocall$2","expr_or$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_or$macrocall$1",symbols:["expr_or$macrocall$4"],postprocess:r},{name:"expr_or",symbols:["expr_or$macrocall$1"]},{name:"expr_and$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("kw_and")?{type:"kw_and"}:kw_and]},{name:"expr_and$macrocall$2$macrocall$1",symbols:["expr_and$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_and$macrocall$2",symbols:["expr_and$macrocall$2$macrocall$1"]},{name:"expr_and$macrocall$3",symbols:["expr_and"]},{name:"expr_and$macrocall$4",symbols:["expr_not"]},{name:"expr_and$macrocall$1$subexpression$1",symbols:["expr_and$macrocall$3"]},{name:"expr_and$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_and$macrocall$1$subexpression$2",symbols:["expr_and$macrocall$4"]},{name:"expr_and$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_and$macrocall$1",symbols:["expr_and$macrocall$1$subexpression$1","expr_and$macrocall$2","expr_and$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_and$macrocall$1",symbols:["expr_and$macrocall$4"],postprocess:r},{name:"expr_and",symbols:["expr_and$macrocall$1"]},{name:"expr_not$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not]},{name:"expr_not$macrocall$2$macrocall$1",symbols:["expr_not$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_not$macrocall$2",symbols:["expr_not$macrocall$2$macrocall$1"]},{name:"expr_not$macrocall$3",symbols:["expr_not"]},{name:"expr_not$macrocall$4",symbols:["expr_eq"]},{name:"expr_not$macrocall$1$subexpression$1",symbols:["expr_not$macrocall$3"]},{name:"expr_not$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_not$macrocall$1",symbols:["expr_not$macrocall$2","expr_not$macrocall$1$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"unary",...r(Q[0]),operand:r(Q[1])})},{name:"expr_not$macrocall$1",symbols:["expr_not$macrocall$4"],postprocess:r},{name:"expr_not",symbols:["expr_not$macrocall$1"]},{name:"expr_eq$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq]},{name:"expr_eq$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_neq")?{type:"op_neq"}:op_neq]},{name:"expr_eq$macrocall$2$macrocall$2",symbols:["expr_eq$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_eq$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_eq$macrocall$2$macrocall$2"]},{name:"expr_eq$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_eq$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_eq$macrocall$2$macrocall$1",symbols:["expr_eq$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_eq$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_eq$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_eq$macrocall$2",symbols:["expr_eq$macrocall$2$macrocall$1"]},{name:"expr_eq$macrocall$3",symbols:["expr_eq"]},{name:"expr_eq$macrocall$4",symbols:["expr_is"]},{name:"expr_eq$macrocall$1$subexpression$1",symbols:["expr_eq$macrocall$3"]},{name:"expr_eq$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_eq$macrocall$1$subexpression$2",symbols:["expr_eq$macrocall$4"]},{name:"expr_eq$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_eq$macrocall$1",symbols:["expr_eq$macrocall$1$subexpression$1","expr_eq$macrocall$2","expr_eq$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_eq$macrocall$1",symbols:["expr_eq$macrocall$4"],postprocess:r},{name:"expr_eq",symbols:["expr_eq$macrocall$1"]},{name:"expr_star",symbols:["star"],postprocess:Q=>(0,g.track)(Q,{type:"ref",name:"*"})},{name:"expr_is$subexpression$1",symbols:["expr_is"]},{name:"expr_is$subexpression$1",symbols:["expr_paren"]},{name:"expr_is$subexpression$2",symbols:[o.lexerAny.has("kw_isnull")?{type:"kw_isnull"}:kw_isnull]},{name:"expr_is$subexpression$2",symbols:[o.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"expr_is",symbols:["expr_is$subexpression$1","expr_is$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"unary",op:"IS NULL",operand:r(Q[0])})},{name:"expr_is$subexpression$3",symbols:["expr_is"]},{name:"expr_is$subexpression$3",symbols:["expr_paren"]},{name:"expr_is$subexpression$4",symbols:[o.lexerAny.has("kw_notnull")?{type:"kw_notnull"}:kw_notnull]},{name:"expr_is$subexpression$4",symbols:[o.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,"kw_not_null"]},{name:"expr_is",symbols:["expr_is$subexpression$3","expr_is$subexpression$4"],postprocess:Q=>(0,g.track)(Q,{type:"unary",op:"IS NOT NULL",operand:r(Q[0])})},{name:"expr_is$subexpression$5",symbols:["expr_is"]},{name:"expr_is$subexpression$5",symbols:["expr_paren"]},{name:"expr_is$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"expr_is$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_is$subexpression$6",symbols:[o.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true]},{name:"expr_is$subexpression$6",symbols:[o.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false]},{name:"expr_is",symbols:["expr_is$subexpression$5",o.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,"expr_is$ebnf$1","expr_is$subexpression$6"],postprocess:Q=>(0,g.track)(Q,{type:"unary",op:"IS "+E([Q[2],Q[3]]).join(" ").toUpperCase(),operand:r(Q[0])})},{name:"expr_is",symbols:["expr_compare"],postprocess:r},{name:"expr_compare$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("op_compare")?{type:"op_compare"}:op_compare]},{name:"expr_compare$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_compare$macrocall$2$macrocall$2"]},{name:"expr_compare$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_compare$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_compare$macrocall$2$macrocall$1",symbols:["expr_compare$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_compare$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_compare$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_compare$macrocall$2",symbols:["expr_compare$macrocall$2$macrocall$1"]},{name:"expr_compare$macrocall$3",symbols:["expr_compare"]},{name:"expr_compare$macrocall$4",symbols:["expr_range"]},{name:"expr_compare$macrocall$1$subexpression$1",symbols:["expr_compare$macrocall$3"]},{name:"expr_compare$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_compare$macrocall$1$subexpression$2",symbols:["expr_compare$macrocall$4"]},{name:"expr_compare$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_compare$macrocall$1",symbols:["expr_compare$macrocall$1$subexpression$1","expr_compare$macrocall$2","expr_compare$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_compare$macrocall$1",symbols:["expr_compare$macrocall$4"],postprocess:r},{name:"expr_compare",symbols:["expr_compare$macrocall$1"]},{name:"expr_range$macrocall$2",symbols:["ops_between"]},{name:"expr_range$macrocall$3",symbols:[o.lexerAny.has("kw_and")?{type:"kw_and"}:kw_and]},{name:"expr_range$macrocall$4",symbols:["expr_range"]},{name:"expr_range$macrocall$5",symbols:["expr_others"]},{name:"expr_range$macrocall$1$subexpression$1",symbols:["expr_range$macrocall$4"]},{name:"expr_range$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_range$macrocall$1$subexpression$2",symbols:["expr_range$macrocall$4"]},{name:"expr_range$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_range$macrocall$1$subexpression$3",symbols:["expr_range$macrocall$5"]},{name:"expr_range$macrocall$1$subexpression$3",symbols:["expr_paren"]},{name:"expr_range$macrocall$1",symbols:["expr_range$macrocall$1$subexpression$1","expr_range$macrocall$2","expr_range$macrocall$1$subexpression$2","expr_range$macrocall$3","expr_range$macrocall$1$subexpression$3"],postprocess:Q=>(0,g.track)(Q,{type:"ternary",value:r(Q[0]),lo:r(Q[2]),hi:r(Q[4]),op:(E(Q[1]).join(" ")||"<error>").toUpperCase()})},{name:"expr_range$macrocall$1",symbols:["expr_range$macrocall$5"],postprocess:r},{name:"expr_range",symbols:["expr_range$macrocall$1"]},{name:"expr_others$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("ops_others")?{type:"ops_others"}:ops_others]},{name:"expr_others$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_others$macrocall$2$macrocall$2"]},{name:"expr_others$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_others$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_others$macrocall$2$macrocall$1",symbols:["expr_others$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_others$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_others$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_others$macrocall$2",symbols:["expr_others$macrocall$2$macrocall$1"]},{name:"expr_others$macrocall$3",symbols:["expr_others"]},{name:"expr_others$macrocall$4",symbols:["expr_like"]},{name:"expr_others$macrocall$1$subexpression$1",symbols:["expr_others$macrocall$3"]},{name:"expr_others$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_others$macrocall$1$subexpression$2",symbols:["expr_others$macrocall$4"]},{name:"expr_others$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_others$macrocall$1",symbols:["expr_others$macrocall$1$subexpression$1","expr_others$macrocall$2","expr_others$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_others$macrocall$1",symbols:["expr_others$macrocall$4"],postprocess:r},{name:"expr_others",symbols:["expr_others$macrocall$1"]},{name:"expr_like$macrocall$2$macrocall$2",symbols:["ops_like"]},{name:"expr_like$macrocall$2$macrocall$1",symbols:["expr_like$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_like$macrocall$2",symbols:["expr_like$macrocall$2$macrocall$1"]},{name:"expr_like$macrocall$3",symbols:["expr_like"]},{name:"expr_like$macrocall$4",symbols:["expr_in"]},{name:"expr_like$macrocall$1$subexpression$1",symbols:["expr_like$macrocall$3"]},{name:"expr_like$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_like$macrocall$1$subexpression$2",symbols:["expr_like$macrocall$4"]},{name:"expr_like$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_like$macrocall$1",symbols:["expr_like$macrocall$1$subexpression$1","expr_like$macrocall$2","expr_like$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_like$macrocall$1",symbols:["expr_like$macrocall$4"],postprocess:r},{name:"expr_like",symbols:["expr_like$macrocall$1"]},{name:"expr_in$macrocall$2$macrocall$2",symbols:["ops_in"]},{name:"expr_in$macrocall$2$macrocall$1",symbols:["expr_in$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_in$macrocall$2",symbols:["expr_in$macrocall$2$macrocall$1"]},{name:"expr_in$macrocall$3",symbols:["expr_in"]},{name:"expr_in$macrocall$4",symbols:["expr_add"]},{name:"expr_in$macrocall$1$subexpression$1",symbols:["expr_in$macrocall$3"]},{name:"expr_in$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_in$macrocall$1$subexpression$2",symbols:["expr_in$macrocall$4"]},{name:"expr_in$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_in$macrocall$1",symbols:["expr_in$macrocall$1$subexpression$1","expr_in$macrocall$2","expr_in$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_in$macrocall$1",symbols:["expr_in$macrocall$4"],postprocess:r},{name:"expr_in",symbols:["expr_in$macrocall$1"]},{name:"expr_add$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_plus")?{type:"op_plus"}:op_plus]},{name:"expr_add$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_minus")?{type:"op_minus"}:op_minus]},{name:"expr_add$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_additive")?{type:"op_additive"}:op_additive]},{name:"expr_add$macrocall$2$macrocall$2",symbols:["expr_add$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_add$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_add$macrocall$2$macrocall$2"]},{name:"expr_add$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_add$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_add$macrocall$2$macrocall$1",symbols:["expr_add$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_add$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_add$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_add$macrocall$2",symbols:["expr_add$macrocall$2$macrocall$1"]},{name:"expr_add$macrocall$3",symbols:["expr_add"]},{name:"expr_add$macrocall$4",symbols:["expr_mult"]},{name:"expr_add$macrocall$1$subexpression$1",symbols:["expr_add$macrocall$3"]},{name:"expr_add$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_add$macrocall$1$subexpression$2",symbols:["expr_add$macrocall$4"]},{name:"expr_add$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_add$macrocall$1",symbols:["expr_add$macrocall$1$subexpression$1","expr_add$macrocall$2","expr_add$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_add$macrocall$1",symbols:["expr_add$macrocall$4"],postprocess:r},{name:"expr_add",symbols:["expr_add$macrocall$1"]},{name:"expr_mult$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("star")?{type:"star"}:star]},{name:"expr_mult$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_div")?{type:"op_div"}:op_div]},{name:"expr_mult$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_mod")?{type:"op_mod"}:op_mod]},{name:"expr_mult$macrocall$2$macrocall$2",symbols:["expr_mult$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_mult$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_mult$macrocall$2$macrocall$2"]},{name:"expr_mult$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_mult$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_mult$macrocall$2$macrocall$1",symbols:["expr_mult$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_mult$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_mult$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_mult$macrocall$2",symbols:["expr_mult$macrocall$2$macrocall$1"]},{name:"expr_mult$macrocall$3",symbols:["expr_mult"]},{name:"expr_mult$macrocall$4",symbols:["expr_exp"]},{name:"expr_mult$macrocall$1$subexpression$1",symbols:["expr_mult$macrocall$3"]},{name:"expr_mult$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_mult$macrocall$1$subexpression$2",symbols:["expr_mult$macrocall$4"]},{name:"expr_mult$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_mult$macrocall$1",symbols:["expr_mult$macrocall$1$subexpression$1","expr_mult$macrocall$2","expr_mult$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_mult$macrocall$1",symbols:["expr_mult$macrocall$4"],postprocess:r},{name:"expr_mult",symbols:["expr_mult$macrocall$1"]},{name:"expr_exp$macrocall$2$macrocall$2",symbols:[o.lexerAny.has("op_exp")?{type:"op_exp"}:op_exp]},{name:"expr_exp$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_exp$macrocall$2$macrocall$2"]},{name:"expr_exp$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_exp$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_exp$macrocall$2$macrocall$1",symbols:["expr_exp$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_exp$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_exp$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_exp$macrocall$2",symbols:["expr_exp$macrocall$2$macrocall$1"]},{name:"expr_exp$macrocall$3",symbols:["expr_exp"]},{name:"expr_exp$macrocall$4",symbols:["expr_unary_add"]},{name:"expr_exp$macrocall$1$subexpression$1",symbols:["expr_exp$macrocall$3"]},{name:"expr_exp$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_exp$macrocall$1$subexpression$2",symbols:["expr_exp$macrocall$4"]},{name:"expr_exp$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_exp$macrocall$1",symbols:["expr_exp$macrocall$1$subexpression$1","expr_exp$macrocall$2","expr_exp$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_exp$macrocall$1",symbols:["expr_exp$macrocall$4"],postprocess:r},{name:"expr_exp",symbols:["expr_exp$macrocall$1"]},{name:"expr_unary_add$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_plus")?{type:"op_plus"}:op_plus]},{name:"expr_unary_add$macrocall$2$macrocall$2$subexpression$1",symbols:[o.lexerAny.has("op_minus")?{type:"op_minus"}:op_minus]},{name:"expr_unary_add$macrocall$2$macrocall$2",symbols:["expr_unary_add$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_unary_add$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_unary_add$macrocall$2$macrocall$2"]},{name:"expr_unary_add$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_unary_add$macrocall$2$macrocall$1$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_unary_add$macrocall$2$macrocall$1",symbols:["expr_unary_add$macrocall$2$macrocall$1$macrocall$1"],postprocess:r},{name:"expr_unary_add$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_unary_add$macrocall$2$macrocall$2","rparen"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q[4]," ")||"<error>").toUpperCase(),opSchema:u(Q[2])})},{name:"expr_unary_add$macrocall$2",symbols:["expr_unary_add$macrocall$2$macrocall$1"]},{name:"expr_unary_add$macrocall$3",symbols:["expr_unary_add"]},{name:"expr_unary_add$macrocall$4",symbols:["expr_various_constructs"]},{name:"expr_unary_add$macrocall$1$subexpression$1",symbols:["expr_unary_add$macrocall$3"]},{name:"expr_unary_add$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_unary_add$macrocall$1",symbols:["expr_unary_add$macrocall$2","expr_unary_add$macrocall$1$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"unary",...r(Q[0]),operand:r(Q[1])})},{name:"expr_unary_add$macrocall$1",symbols:["expr_unary_add$macrocall$4"],postprocess:r},{name:"expr_unary_add",symbols:["expr_unary_add$macrocall$1"]},{name:"expr_various_constructs$macrocall$2$macrocall$2",symbols:["various_binaries"]},{name:"expr_various_constructs$macrocall$2$macrocall$1",symbols:["expr_various_constructs$macrocall$2$macrocall$2"],postprocess:Q=>(0,g.track)(Q,{op:(u(Q," ")||"<error>").toUpperCase()})},{name:"expr_various_constructs$macrocall$2",symbols:["expr_various_constructs$macrocall$2$macrocall$1"]},{name:"expr_various_constructs$macrocall$3",symbols:["expr_various_constructs"]},{name:"expr_various_constructs$macrocall$4",symbols:["expr_array_index"]},{name:"expr_various_constructs$macrocall$1$subexpression$1",symbols:["expr_various_constructs$macrocall$3"]},{name:"expr_various_constructs$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_various_constructs$macrocall$1$subexpression$2",symbols:["expr_various_constructs$macrocall$4"]},{name:"expr_various_constructs$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_various_constructs$macrocall$1",symbols:["expr_various_constructs$macrocall$1$subexpression$1","expr_various_constructs$macrocall$2","expr_various_constructs$macrocall$1$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"binary",left:r(Q[0]),right:r(Q[2]),...r(Q[1])})},{name:"expr_various_constructs$macrocall$1",symbols:["expr_various_constructs$macrocall$4"],postprocess:r},{name:"expr_various_constructs",symbols:["expr_various_constructs$macrocall$1"]},{name:"expr_array_index$subexpression$1",symbols:["expr_array_index"]},{name:"expr_array_index$subexpression$1",symbols:["expr_paren"]},{name:"expr_array_index",symbols:["expr_array_index$subexpression$1",o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,"expr_nostar",o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket],postprocess:Q=>(0,g.track)(Q,{type:"arrayIndex",array:r(Q[0]),index:r(Q[2])})},{name:"expr_array_index",symbols:["expr_member"],postprocess:r},{name:"expr_member$subexpression$1",symbols:["expr_member"]},{name:"expr_member$subexpression$1",symbols:["expr_paren"]},{name:"expr_member$subexpression$2",symbols:["string"]},{name:"expr_member$subexpression$2",symbols:["int"]},{name:"expr_member",symbols:["expr_member$subexpression$1","ops_member","expr_member$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"member",operand:r(Q[0]),op:Q[1],member:r(Q[2])})},{name:"expr_member$subexpression$3",symbols:["expr_member"]},{name:"expr_member$subexpression$3",symbols:["expr_paren"]},{name:"expr_member",symbols:["expr_member$subexpression$3",o.lexerAny.has("op_cast")?{type:"op_cast"}:op_cast,"data_type"],postprocess:Q=>(0,g.track)(Q,{type:"cast",operand:r(Q[0]),to:Q[2]})},{name:"expr_member",symbols:[o.lexerAny.has("kw_cast")?{type:"kw_cast"}:kw_cast,"lparen","expr_nostar",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"data_type","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"cast",operand:r(Q[2]),to:Q[4]})},{name:"expr_member",symbols:["data_type","string"],postprocess:Q=>(0,g.track)(Q,{type:"cast",operand:(0,g.track)(Q[1],{type:"string",value:(0,g.unbox)(Q[1])}),to:(0,g.unbox)(Q[0])})},{name:"expr_member",symbols:["expr_dot"],postprocess:r},{name:"expr_dot$subexpression$1",symbols:["word"]},{name:"expr_dot$subexpression$1",symbols:["star"]},{name:"expr_dot",symbols:["qname",o.lexerAny.has("dot")?{type:"dot"}:dot,"expr_dot$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"ref",table:r(Q[0]),name:u(Q[2])})},{name:"expr_dot",symbols:["expr_final"],postprocess:r},{name:"expr_final",symbols:["expr_basic"]},{name:"expr_final",symbols:["expr_primary"]},{name:"expr_basic",symbols:["expr_special_calls"]},{name:"expr_basic",symbols:["expr_call"]},{name:"expr_basic",symbols:["expr_array"]},{name:"expr_basic",symbols:["expr_case"]},{name:"expr_basic",symbols:["expr_extract"]},{name:"expr_basic",symbols:["word"],postprocess:Q=>(0,g.track)(Q,{type:"ref",name:r(Q[0])})},{name:"expr_array$ebnf$1",symbols:["expr_subarray_items"],postprocess:n},{name:"expr_array$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_array",symbols:[o.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array,o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,"expr_array$ebnf$1",o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket],postprocess:Q=>(0,g.track)(Q,{type:"array",expressions:Q[2]||[]})},{name:"expr_array",symbols:[o.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array,"lparen","selection","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"array select",select:r(Q[2])})},{name:"expr_subarray$ebnf$1",symbols:["expr_subarray_items"],postprocess:n},{name:"expr_subarray$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_subarray",symbols:[o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,"expr_subarray$ebnf$1",o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket],postprocess:C(1)},{name:"expr_subarray_items$macrocall$2",symbols:["expr_list_item"]},{name:"expr_subarray_items$macrocall$1$ebnf$1",symbols:[]},{name:"expr_subarray_items$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"expr_subarray_items$macrocall$2"],postprocess:l},{name:"expr_subarray_items$macrocall$1$ebnf$1",symbols:["expr_subarray_items$macrocall$1$ebnf$1","expr_subarray_items$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"expr_subarray_items$macrocall$1",symbols:["expr_subarray_items$macrocall$2","expr_subarray_items$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"expr_subarray_items",symbols:["expr_subarray_items$macrocall$1"],postprocess:Q=>Q[0].map(r)},{name:"expr_subarray_items$macrocall$4",symbols:["expr_subarray"]},{name:"expr_subarray_items$macrocall$3$ebnf$1",symbols:[]},{name:"expr_subarray_items$macrocall$3$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"expr_subarray_items$macrocall$4"],postprocess:l},{name:"expr_subarray_items$macrocall$3$ebnf$1",symbols:["expr_subarray_items$macrocall$3$ebnf$1","expr_subarray_items$macrocall$3$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"expr_subarray_items$macrocall$3",symbols:["expr_subarray_items$macrocall$4","expr_subarray_items$macrocall$3$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"expr_subarray_items",symbols:["expr_subarray_items$macrocall$3"],postprocess:Q=>Q[0].map(k=>(0,g.track)(k,{type:"array",expressions:k[0].map(r)}))},{name:"expr_function_call$ebnf$1",symbols:["expr_list_raw"],postprocess:n},{name:"expr_function_call$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_function_call",symbols:["expr_fn_name","lparen","expr_function_call$ebnf$1","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"call",function:r(Q[0]),args:Q[2]||[]})},{name:"expr_call$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"expr_call$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_distinct")?{type:"kw_distinct"}:kw_distinct]},{name:"expr_call$ebnf$1",symbols:["expr_call$ebnf$1$subexpression$1"],postprocess:n},{name:"expr_call$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$2",symbols:["expr_list_raw"],postprocess:n},{name:"expr_call$ebnf$2",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$3",symbols:["select_order_by"],postprocess:n},{name:"expr_call$ebnf$3",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$4$subexpression$1",symbols:["kw_filter","lparen",o.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr","rparen"],postprocess:C(3)},{name:"expr_call$ebnf$4",symbols:["expr_call$ebnf$4$subexpression$1"],postprocess:n},{name:"expr_call$ebnf$4",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$5",symbols:["expr_call_over"],postprocess:n},{name:"expr_call$ebnf$5",symbols:[],postprocess:()=>null},{name:"expr_call",symbols:["expr_fn_name","lparen","expr_call$ebnf$1","expr_call$ebnf$2","expr_call$ebnf$3","rparen","expr_call$ebnf$4","expr_call$ebnf$5"],postprocess:Q=>(0,g.track)(Q,{type:"call",function:r(Q[0]),...Q[2]&&{distinct:u(Q[2])},args:Q[3]||[],...Q[4]&&{orderBy:Q[4]},...Q[6]&&{filter:r(Q[6])},...Q[7]&&{over:r(Q[7])}})},{name:"expr_call_over$ebnf$1$subexpression$1",symbols:["kw_partition","kw_by","expr_list_raw"],postprocess:l},{name:"expr_call_over$ebnf$1",symbols:["expr_call_over$ebnf$1$subexpression$1"],postprocess:n},{name:"expr_call_over$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_call_over$ebnf$2",symbols:["select_order_by"],postprocess:n},{name:"expr_call_over$ebnf$2",symbols:[],postprocess:()=>null},{name:"expr_call_over",symbols:["kw_over","lparen","expr_call_over$ebnf$1","expr_call_over$ebnf$2","rparen"],postprocess:Q=>(0,g.track)(Q,{...Q[2]&&{partitionBy:Q[2]},...Q[3]&&{orderBy:Q[3]}})},{name:"expr_extract$subexpression$1",symbols:["word"],postprocess:G("extract")},{name:"expr_extract",symbols:["expr_extract$subexpression$1","lparen","word",o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"expr","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"extract",field:a(Q[2]),from:Q[4]})},{name:"expr_primary",symbols:["float"],postprocess:Q=>(0,g.track)(Q,{type:"numeric",value:(0,g.unbox)(Q[0])})},{name:"expr_primary",symbols:["int"],postprocess:Q=>(0,g.track)(Q,{type:"integer",value:(0,g.unbox)(Q[0])})},{name:"expr_primary",symbols:["string"],postprocess:Q=>(0,g.track)(Q,{type:"string",value:(0,g.unbox)(Q[0])})},{name:"expr_primary",symbols:[o.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true],postprocess:Q=>(0,g.track)(Q,{type:"boolean",value:!0})},{name:"expr_primary",symbols:[o.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false],postprocess:Q=>(0,g.track)(Q,{type:"boolean",value:!1})},{name:"expr_primary",symbols:[o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null],postprocess:Q=>(0,g.track)(Q,{type:"null"})},{name:"expr_primary",symbols:["value_keyword"],postprocess:Q=>(0,g.track)(Q,{type:"keyword",keyword:u(Q)})},{name:"expr_primary",symbols:[o.lexerAny.has("qparam")?{type:"qparam"}:qparam],postprocess:Q=>(0,g.track)(Q,{type:"parameter",name:u(Q[0])})},{name:"expr_primary",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:Q=>(0,g.track)(Q,{type:"default"})},{name:"ops_like",symbols:["ops_like_keywors"]},{name:"ops_like",symbols:["ops_like_operators"]},{name:"ops_like_keywors$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"ops_like_keywors$ebnf$1",symbols:[],postprocess:()=>null},{name:"ops_like_keywors$subexpression$1",symbols:[o.lexerAny.has("kw_like")?{type:"kw_like"}:kw_like]},{name:"ops_like_keywors$subexpression$1",symbols:[o.lexerAny.has("kw_ilike")?{type:"kw_ilike"}:kw_ilike]},{name:"ops_like_keywors",symbols:["ops_like_keywors$ebnf$1","ops_like_keywors$subexpression$1"]},{name:"ops_like_operators$subexpression$1",symbols:[o.lexerAny.has("op_like")?{type:"op_like"}:op_like],postprocess:()=>"LIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$1"]},{name:"ops_like_operators$subexpression$2",symbols:[o.lexerAny.has("op_ilike")?{type:"op_ilike"}:op_ilike],postprocess:()=>"ILIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$2"]},{name:"ops_like_operators$subexpression$3",symbols:[o.lexerAny.has("op_not_like")?{type:"op_not_like"}:op_not_like],postprocess:()=>"NOT LIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$3"]},{name:"ops_like_operators$subexpression$4",symbols:[o.lexerAny.has("op_not_ilike")?{type:"op_not_ilike"}:op_not_ilike],postprocess:()=>"NOT ILIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$4"]},{name:"ops_in$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"ops_in$ebnf$1",symbols:[],postprocess:()=>null},{name:"ops_in",symbols:["ops_in$ebnf$1",o.lexerAny.has("kw_in")?{type:"kw_in"}:kw_in]},{name:"ops_between$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"ops_between$ebnf$1",symbols:[],postprocess:()=>null},{name:"ops_between",symbols:["ops_between$ebnf$1","kw_between"]},{name:"ops_member$subexpression$1",symbols:[o.lexerAny.has("op_member")?{type:"op_member"}:op_member]},{name:"ops_member$subexpression$1",symbols:[o.lexerAny.has("op_membertext")?{type:"op_membertext"}:op_membertext]},{name:"ops_member",symbols:["ops_member$subexpression$1"],postprocess:Q=>{var k;return(k=r(Q))===null||k===void 0?void 0:k.value}},{name:"expr_list_item",symbols:["expr_or_select"],postprocess:r},{name:"expr_list_item",symbols:["expr_star"],postprocess:r},{name:"expr_list_raw$macrocall$2",symbols:["expr_list_item"]},{name:"expr_list_raw$macrocall$1$ebnf$1",symbols:[]},{name:"expr_list_raw$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"expr_list_raw$macrocall$2"],postprocess:l},{name:"expr_list_raw$macrocall$1$ebnf$1",symbols:["expr_list_raw$macrocall$1$ebnf$1","expr_list_raw$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"expr_list_raw$macrocall$1",symbols:["expr_list_raw$macrocall$2","expr_list_raw$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"expr_list_raw",symbols:["expr_list_raw$macrocall$1"],postprocess:([Q])=>Q.map(r)},{name:"expr_list_raw_many$macrocall$2",symbols:["expr_list_item"]},{name:"expr_list_raw_many$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"expr_list_raw_many$macrocall$2"],postprocess:l},{name:"expr_list_raw_many$macrocall$1$ebnf$1",symbols:["expr_list_raw_many$macrocall$1$ebnf$1$subexpression$1"]},{name:"expr_list_raw_many$macrocall$1$ebnf$1$subexpression$2",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"expr_list_raw_many$macrocall$2"],postprocess:l},{name:"expr_list_raw_many$macrocall$1$ebnf$1",symbols:["expr_list_raw_many$macrocall$1$ebnf$1","expr_list_raw_many$macrocall$1$ebnf$1$subexpression$2"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"expr_list_raw_many$macrocall$1",symbols:["expr_list_raw_many$macrocall$2","expr_list_raw_many$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"expr_list_raw_many",symbols:["expr_list_raw_many$macrocall$1"],postprocess:([Q])=>Q.map(r)},{name:"expr_or_select",symbols:["expr_nostar"],postprocess:r},{name:"expr_or_select",symbols:["selection"],postprocess:r},{name:"expr_list_many",symbols:["expr_list_raw_many"],postprocess:Q=>(0,g.track)(Q,{type:"list",expressions:Q[0]})},{name:"expr_case$ebnf$1",symbols:["expr_nostar"],postprocess:n},{name:"expr_case$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_case$ebnf$2",symbols:[]},{name:"expr_case$ebnf$2",symbols:["expr_case$ebnf$2","expr_case_whens"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"expr_case$ebnf$3",symbols:["expr_case_else"],postprocess:n},{name:"expr_case$ebnf$3",symbols:[],postprocess:()=>null},{name:"expr_case",symbols:[o.lexerAny.has("kw_case")?{type:"kw_case"}:kw_case,"expr_case$ebnf$1","expr_case$ebnf$2","expr_case$ebnf$3",o.lexerAny.has("kw_end")?{type:"kw_end"}:kw_end],postprocess:Q=>(0,g.track)(Q,{type:"case",value:Q[1],whens:Q[2],else:Q[3]})},{name:"expr_case_whens",symbols:[o.lexerAny.has("kw_when")?{type:"kw_when"}:kw_when,"expr_nostar",o.lexerAny.has("kw_then")?{type:"kw_then"}:kw_then,"expr_nostar"],postprocess:Q=>(0,g.track)(Q,{when:Q[1],value:Q[3]})},{name:"expr_case_else",symbols:[o.lexerAny.has("kw_else")?{type:"kw_else"}:kw_else,"expr_nostar"],postprocess:l},{name:"expr_fn_name$subexpression$1$ebnf$1$subexpression$1",symbols:["word",o.lexerAny.has("dot")?{type:"dot"}:dot]},{name:"expr_fn_name$subexpression$1$ebnf$1",symbols:["expr_fn_name$subexpression$1$ebnf$1$subexpression$1"],postprocess:n},{name:"expr_fn_name$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_fn_name$subexpression$1",symbols:["expr_fn_name$subexpression$1$ebnf$1","word_or_keyword"],postprocess:Q=>(0,g.track)(Q,{name:(0,g.unbox)(r(Q[1])),...Q[0]&&{schema:u(Q[0][0])}})},{name:"expr_fn_name",symbols:["expr_fn_name$subexpression$1"]},{name:"expr_fn_name$subexpression$2$subexpression$1",symbols:[o.lexerAny.has("kw_any")?{type:"kw_any"}:kw_any]},{name:"expr_fn_name$subexpression$2$subexpression$1",symbols:[o.lexerAny.has("kw_some")?{type:"kw_some"}:kw_some]},{name:"expr_fn_name$subexpression$2$subexpression$1",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"expr_fn_name$subexpression$2",symbols:["expr_fn_name$subexpression$2$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{name:u(r(Q))})},{name:"expr_fn_name",symbols:["expr_fn_name$subexpression$2"]},{name:"word_or_keyword",symbols:["word"]},{name:"word_or_keyword",symbols:["value_keyword"],postprocess:Q=>(0,g.box)(Q,u(Q))},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_catalog")?{type:"kw_current_catalog"}:kw_current_catalog]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_date")?{type:"kw_current_date"}:kw_current_date]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_role")?{type:"kw_current_role"}:kw_current_role]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_timestamp")?{type:"kw_current_timestamp"}:kw_current_timestamp]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_time")?{type:"kw_current_time"}:kw_current_time]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_localtimestamp")?{type:"kw_localtimestamp"}:kw_localtimestamp]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_localtime")?{type:"kw_localtime"}:kw_localtime]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_session_user")?{type:"kw_session_user"}:kw_session_user]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_user")?{type:"kw_user"}:kw_user]},{name:"value_keyword",symbols:[o.lexerAny.has("kw_current_user")?{type:"kw_current_user"}:kw_current_user]},{name:"expr_special_calls",symbols:["spe_overlay"]},{name:"expr_special_calls",symbols:["spe_substring"]},{name:"spe_overlay$subexpression$1",symbols:["word"],postprocess:G("overlay")},{name:"spe_overlay$subexpression$2",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen,"expr_nostar"]},{name:"spe_overlay$subexpression$3",symbols:[o.lexerAny.has("kw_placing")?{type:"kw_placing"}:kw_placing,"expr_nostar"]},{name:"spe_overlay$subexpression$4",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"expr_nostar"]},{name:"spe_overlay$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for,"expr_nostar"]},{name:"spe_overlay$ebnf$1",symbols:["spe_overlay$ebnf$1$subexpression$1"],postprocess:n},{name:"spe_overlay$ebnf$1",symbols:[],postprocess:()=>null},{name:"spe_overlay",symbols:["spe_overlay$subexpression$1","spe_overlay$subexpression$2","spe_overlay$subexpression$3","spe_overlay$subexpression$4","spe_overlay$ebnf$1",o.lexerAny.has("rparen")?{type:"rparen"}:rparen],postprocess:Q=>(0,g.track)(Q,{type:"overlay",value:Q[1][1],placing:Q[2][1],from:Q[3][1],...Q[4]&&{for:Q[4][1]}})},{name:"spe_substring$subexpression$1",symbols:["word"],postprocess:G("substring")},{name:"spe_substring$subexpression$2",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen,"expr_nostar"]},{name:"spe_substring$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"expr_nostar"]},{name:"spe_substring$ebnf$1",symbols:["spe_substring$ebnf$1$subexpression$1"],postprocess:n},{name:"spe_substring$ebnf$1",symbols:[],postprocess:()=>null},{name:"spe_substring$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for,"expr_nostar"]},{name:"spe_substring$ebnf$2",symbols:["spe_substring$ebnf$2$subexpression$1"],postprocess:n},{name:"spe_substring$ebnf$2",symbols:[],postprocess:()=>null},{name:"spe_substring",symbols:["spe_substring$subexpression$1","spe_substring$subexpression$2","spe_substring$ebnf$1","spe_substring$ebnf$2",o.lexerAny.has("rparen")?{type:"rparen"}:rparen],postprocess:Q=>(0,g.track)(Q,{type:"substring",value:Q[1][1],...Q[2]&&{from:Q[2][1]},...Q[3]&&{for:Q[3][1]}})},{name:"various_binaries",symbols:["kw_at","kw_time","kw_zone"],postprocess:()=>"AT TIME ZONE"},{name:"createtable_statement$ebnf$1",symbols:["createtable_modifiers"],postprocess:n},{name:"createtable_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_statement$ebnf$2",symbols:["kw_ifnotexists"],postprocess:n},{name:"createtable_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"createtable_statement$ebnf$3",symbols:["createtable_opts"],postprocess:n},{name:"createtable_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"createtable_statement",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"createtable_statement$ebnf$1",o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table,"createtable_statement$ebnf$2","qname","lparen","createtable_declarationlist","rparen","createtable_statement$ebnf$3"],postprocess:Q=>{const k=Q[6].filter(N=>"kind"in N),h=Q[6].filter(N=>!("kind"in N));return(0,g.track)(Q,{type:"create table",...Q[3]?{ifNotExists:!0}:{},name:Q[4],columns:k,...r(Q[1]),...h.length?{constraints:h}:{},...l(Q)})}},{name:"createtable_modifiers",symbols:["kw_unlogged"],postprocess:Q=>Q[0]?{unlogged:!0}:{}},{name:"createtable_modifiers",symbols:["m_locglob"]},{name:"createtable_modifiers",symbols:["m_tmp"]},{name:"createtable_modifiers",symbols:["m_locglob","m_tmp"],postprocess:([Q,k])=>({...Q,...k})},{name:"m_locglob$subexpression$1",symbols:["kw_local"]},{name:"m_locglob$subexpression$1",symbols:["kw_global"]},{name:"m_locglob",symbols:["m_locglob$subexpression$1"],postprocess:Q=>({locality:u(Q)})},{name:"m_tmp$subexpression$1",symbols:["kw_temp"]},{name:"m_tmp$subexpression$1",symbols:["kw_temporary"]},{name:"m_tmp",symbols:["m_tmp$subexpression$1"],postprocess:Q=>({temporary:!0})},{name:"createtable_declarationlist$ebnf$1",symbols:[]},{name:"createtable_declarationlist$ebnf$1$subexpression$1",symbols:["comma","createtable_declaration"],postprocess:l},{name:"createtable_declarationlist$ebnf$1",symbols:["createtable_declarationlist$ebnf$1","createtable_declarationlist$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_declarationlist",symbols:["createtable_declaration","createtable_declarationlist$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"createtable_declaration$subexpression$1",symbols:["createtable_constraint"]},{name:"createtable_declaration$subexpression$1",symbols:["createtable_column"]},{name:"createtable_declaration$subexpression$1",symbols:["createtable_like"]},{name:"createtable_declaration",symbols:["createtable_declaration$subexpression$1"],postprocess:r},{name:"createtable_constraint$macrocall$2",symbols:["createtable_constraint_def"]},{name:"createtable_constraint$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"word"]},{name:"createtable_constraint$macrocall$1$ebnf$1",symbols:["createtable_constraint$macrocall$1$ebnf$1$subexpression$1"],postprocess:n},{name:"createtable_constraint$macrocall$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_constraint$macrocall$1",symbols:["createtable_constraint$macrocall$1$ebnf$1","createtable_constraint$macrocall$2"],postprocess:Q=>{const k=Q[0]&&a(Q[0][1]);return k?(0,g.track)(Q,{constraintName:k,...r(Q[1])}):(0,g.track)(Q,r(Q[1]))}},{name:"createtable_constraint",symbols:["createtable_constraint$macrocall$1"],postprocess:r},{name:"createtable_constraint_def",symbols:["createtable_constraint_def_unique"]},{name:"createtable_constraint_def",symbols:["createtable_constraint_def_check"]},{name:"createtable_constraint_def",symbols:["createtable_constraint_foreignkey"]},{name:"createtable_constraint_def_unique$subexpression$1",symbols:[o.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique]},{name:"createtable_constraint_def_unique$subexpression$1",symbols:["kw_primary_key"]},{name:"createtable_constraint_def_unique",symbols:["createtable_constraint_def_unique$subexpression$1","lparen","createtable_collist","rparen"],postprocess:Q=>(0,g.track)(Q,{type:u(Q[0]," "),columns:Q[2].map(a)})},{name:"createtable_constraint_def_check",symbols:[o.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check,"expr_paren"],postprocess:Q=>(0,g.track)(Q,{type:"check",expr:r(Q[1])})},{name:"createtable_constraint_foreignkey",symbols:[o.lexerAny.has("kw_foreign")?{type:"kw_foreign"}:kw_foreign,"kw_key","collist_paren","createtable_references"],postprocess:Q=>(0,g.track)(Q,{type:"foreign key",localColumns:Q[2].map(a),...Q[3]})},{name:"createtable_references$ebnf$1",symbols:[]},{name:"createtable_references$ebnf$1",symbols:["createtable_references$ebnf$1","createtable_constraint_foreignkey_onsometing"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_references",symbols:[o.lexerAny.has("kw_references")?{type:"kw_references"}:kw_references,"table_ref","collist_paren","createtable_references$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{foreignTable:r(Q[1]),foreignColumns:Q[2].map(a),...Q[3].reduce((k,h)=>({...k,...h}),{})})},{name:"createtable_constraint_foreignkey_onsometing",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"kw_delete","createtable_constraint_on_action"],postprocess:Q=>(0,g.track)(Q,{onDelete:l(Q)})},{name:"createtable_constraint_foreignkey_onsometing",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"kw_update","createtable_constraint_on_action"],postprocess:Q=>(0,g.track)(Q,{onUpdate:l(Q)})},{name:"createtable_constraint_foreignkey_onsometing$subexpression$1",symbols:[o.lexerAny.has("kw_full")?{type:"kw_full"}:kw_full]},{name:"createtable_constraint_foreignkey_onsometing$subexpression$1",symbols:["kw_partial"]},{name:"createtable_constraint_foreignkey_onsometing$subexpression$1",symbols:["kw_simple"]},{name:"createtable_constraint_foreignkey_onsometing",symbols:["kw_match","createtable_constraint_foreignkey_onsometing$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{match:u(l(Q))})},{name:"createtable_constraint_on_action$subexpression$1",symbols:["kw_cascade"]},{name:"createtable_constraint_on_action$subexpression$1$subexpression$1",symbols:["kw_no","kw_action"]},{name:"createtable_constraint_on_action$subexpression$1",symbols:["createtable_constraint_on_action$subexpression$1$subexpression$1"]},{name:"createtable_constraint_on_action$subexpression$1",symbols:["kw_restrict"]},{name:"createtable_constraint_on_action$subexpression$1$subexpression$2",symbols:[o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"createtable_constraint_on_action$subexpression$1$subexpression$2",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default]},{name:"createtable_constraint_on_action$subexpression$1",symbols:["kw_set","createtable_constraint_on_action$subexpression$1$subexpression$2"]},{name:"createtable_constraint_on_action",symbols:["createtable_constraint_on_action$subexpression$1"],postprocess:Q=>u(Q," ")},{name:"createtable_collist$ebnf$1",symbols:[]},{name:"createtable_collist$ebnf$1$subexpression$1",symbols:["comma","ident"],postprocess:l},{name:"createtable_collist$ebnf$1",symbols:["createtable_collist$ebnf$1","createtable_collist$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_collist",symbols:["ident","createtable_collist$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"createtable_column$ebnf$1",symbols:["createtable_collate"],postprocess:n},{name:"createtable_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_column$ebnf$2",symbols:[]},{name:"createtable_column$ebnf$2",symbols:["createtable_column$ebnf$2","createtable_column_constraint"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_column",symbols:["word","data_type","createtable_column$ebnf$1","createtable_column$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{kind:"column",name:a(Q[0]),dataType:Q[1],...Q[2]?{collate:Q[2][1]}:{},...Q[3]&&Q[3].length?{constraints:Q[3]}:{}})},{name:"createtable_like$ebnf$1",symbols:[]},{name:"createtable_like$ebnf$1",symbols:["createtable_like$ebnf$1","createtable_like_opt"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_like",symbols:[o.lexerAny.has("kw_like")?{type:"kw_like"}:kw_like,"qname","createtable_like$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{kind:"like table",like:Q[1],options:Q[2]})},{name:"createtable_like_opt$subexpression$1",symbols:["kw_including"]},{name:"createtable_like_opt$subexpression$1",symbols:["kw_excluding"]},{name:"createtable_like_opt",symbols:["createtable_like_opt$subexpression$1","createtable_like_opt_val"],postprocess:Q=>(0,g.track)(Q,{verb:u(Q[0]),option:u(Q[1])})},{name:"createtable_like_opt_val",symbols:["word"],postprocess:R("defaults","constraints","indexes","storage","comments")},{name:"createtable_like_opt_val",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"createtable_column_constraint$macrocall$2",symbols:["createtable_column_constraint_def"]},{name:"createtable_column_constraint$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"word"]},{name:"createtable_column_constraint$macrocall$1$ebnf$1",symbols:["createtable_column_constraint$macrocall$1$ebnf$1$subexpression$1"],postprocess:n},{name:"createtable_column_constraint$macrocall$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_column_constraint$macrocall$1",symbols:["createtable_column_constraint$macrocall$1$ebnf$1","createtable_column_constraint$macrocall$2"],postprocess:Q=>{const k=Q[0]&&a(Q[0][1]);return k?(0,g.track)(Q,{constraintName:k,...r(Q[1])}):(0,g.track)(Q,r(Q[1]))}},{name:"createtable_column_constraint",symbols:["createtable_column_constraint$macrocall$1"],postprocess:r},{name:"createtable_column_constraint_def",symbols:[o.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique],postprocess:Q=>(0,g.track)(Q,{type:"unique"})},{name:"createtable_column_constraint_def",symbols:["kw_primary_key"],postprocess:Q=>(0,g.track)(Q,{type:"primary key"})},{name:"createtable_column_constraint_def",symbols:["kw_not_null"],postprocess:Q=>(0,g.track)(Q,{type:"not null"})},{name:"createtable_column_constraint_def",symbols:[o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null],postprocess:Q=>(0,g.track)(Q,{type:"null"})},{name:"createtable_column_constraint_def",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default,"expr"],postprocess:Q=>(0,g.track)(Q,{type:"default",default:r(Q[1])})},{name:"createtable_column_constraint_def",symbols:[o.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check,"expr_paren"],postprocess:Q=>(0,g.track)(Q,{type:"check",expr:r(Q[1])})},{name:"createtable_column_constraint_def",symbols:["createtable_references"],postprocess:Q=>(0,g.track)(Q,{type:"reference",...r(Q)})},{name:"createtable_column_constraint_def",symbols:["altercol_generated"]},{name:"createtable_collate",symbols:[o.lexerAny.has("kw_collate")?{type:"kw_collate"}:kw_collate,"qualified_name"]},{name:"createtable_opts$subexpression$1",symbols:["word"],postprocess:G("inherits")},{name:"createtable_opts$macrocall$2",symbols:["qname"]},{name:"createtable_opts$macrocall$1$ebnf$1",symbols:[]},{name:"createtable_opts$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"createtable_opts$macrocall$2"],postprocess:l},{name:"createtable_opts$macrocall$1$ebnf$1",symbols:["createtable_opts$macrocall$1$ebnf$1","createtable_opts$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtable_opts$macrocall$1",symbols:["createtable_opts$macrocall$2","createtable_opts$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"createtable_opts",symbols:["createtable_opts$subexpression$1","lparen","createtable_opts$macrocall$1","rparen"],postprocess:Q=>(0,g.track)(Q,{inherits:Q[2]})},{name:"createindex_statement$ebnf$1",symbols:[o.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique],postprocess:n},{name:"createindex_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$2",symbols:["kw_ifnotexists"],postprocess:n},{name:"createindex_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$3",symbols:["word"],postprocess:n},{name:"createindex_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$4$subexpression$1",symbols:[o.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using,"ident"],postprocess:l},{name:"createindex_statement$ebnf$4",symbols:["createindex_statement$ebnf$4$subexpression$1"],postprocess:n},{name:"createindex_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$5",symbols:["createindex_with"],postprocess:n},{name:"createindex_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$6",symbols:["createindex_tblspace"],postprocess:n},{name:"createindex_statement$ebnf$6",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$7",symbols:["createindex_predicate"],postprocess:n},{name:"createindex_statement$ebnf$7",symbols:[],postprocess:()=>null},{name:"createindex_statement",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"createindex_statement$ebnf$1","kw_index","createindex_statement$ebnf$2","createindex_statement$ebnf$3",o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"table_ref","createindex_statement$ebnf$4","lparen","createindex_expressions","rparen","createindex_statement$ebnf$5","createindex_statement$ebnf$6","createindex_statement$ebnf$7"],postprocess:Q=>(0,g.track)(Q,{type:"create index",...Q[1]&&{unique:!0},...Q[3]&&{ifNotExists:!0},...Q[4]&&{indexName:a(Q[4])},table:Q[6],...Q[7]&&{using:a(Q[7])},expressions:Q[9],...Q[11]&&{with:Q[11]},...Q[12]&&{tablespace:r(Q[12])},...Q[13]&&{where:r(Q[13])}})},{name:"createindex_expressions$ebnf$1",symbols:[]},{name:"createindex_expressions$ebnf$1$subexpression$1",symbols:["comma","createindex_expression"],postprocess:l},{name:"createindex_expressions$ebnf$1",symbols:["createindex_expressions$ebnf$1","createindex_expressions$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createindex_expressions",symbols:["createindex_expression","createindex_expressions$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"createindex_expression$subexpression$1",symbols:["expr_basic"]},{name:"createindex_expression$subexpression$1",symbols:["expr_paren"]},{name:"createindex_expression$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_collate")?{type:"kw_collate"}:kw_collate,"qualified_name"],postprocess:l},{name:"createindex_expression$ebnf$1",symbols:["createindex_expression$ebnf$1$subexpression$1"],postprocess:n},{name:"createindex_expression$ebnf$1",symbols:[],postprocess:()=>null},{name:"createindex_expression$ebnf$2",symbols:["qualified_name"],postprocess:n},{name:"createindex_expression$ebnf$2",symbols:[],postprocess:()=>null},{name:"createindex_expression$ebnf$3$subexpression$1",symbols:[o.lexerAny.has("kw_asc")?{type:"kw_asc"}:kw_asc]},{name:"createindex_expression$ebnf$3$subexpression$1",symbols:[o.lexerAny.has("kw_desc")?{type:"kw_desc"}:kw_desc]},{name:"createindex_expression$ebnf$3",symbols:["createindex_expression$ebnf$3$subexpression$1"],postprocess:n},{name:"createindex_expression$ebnf$3",symbols:[],postprocess:()=>null},{name:"createindex_expression$ebnf$4$subexpression$1$subexpression$1",symbols:["kw_first"]},{name:"createindex_expression$ebnf$4$subexpression$1$subexpression$1",symbols:["kw_last"]},{name:"createindex_expression$ebnf$4$subexpression$1",symbols:["kw_nulls","createindex_expression$ebnf$4$subexpression$1$subexpression$1"],postprocess:l},{name:"createindex_expression$ebnf$4",symbols:["createindex_expression$ebnf$4$subexpression$1"],postprocess:n},{name:"createindex_expression$ebnf$4",symbols:[],postprocess:()=>null},{name:"createindex_expression",symbols:["createindex_expression$subexpression$1","createindex_expression$ebnf$1","createindex_expression$ebnf$2","createindex_expression$ebnf$3","createindex_expression$ebnf$4"],postprocess:Q=>(0,g.track)(Q,{expression:r(Q[0]),...Q[1]&&{collate:r(Q[1])},...Q[2]&&{opclass:r(Q[2])},...Q[3]&&{order:r(Q[3]).value},...Q[4]&&{nulls:r(Q[4])}})},{name:"createindex_predicate",symbols:[o.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr"],postprocess:l},{name:"createindex_with$macrocall$2",symbols:["createindex_with_item"]},{name:"createindex_with$macrocall$1$ebnf$1",symbols:[]},{name:"createindex_with$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"createindex_with$macrocall$2"],postprocess:l},{name:"createindex_with$macrocall$1$ebnf$1",symbols:["createindex_with$macrocall$1$ebnf$1","createindex_with$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createindex_with$macrocall$1",symbols:["createindex_with$macrocall$2","createindex_with$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"createindex_with",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"lparen","createindex_with$macrocall$1","rparen"],postprocess:C(2)},{name:"createindex_with_item$subexpression$1",symbols:["string"]},{name:"createindex_with_item$subexpression$1",symbols:["int"]},{name:"createindex_with_item",symbols:["ident",o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"createindex_with_item$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{parameter:u(Q[0]),value:r(Q[2]).toString()})},{name:"createindex_tblspace",symbols:["kw_tablespace","ident"],postprocess:l},{name:"createextension_statement$ebnf$1",symbols:["kw_ifnotexists"],postprocess:n},{name:"createextension_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$2",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with],postprocess:n},{name:"createextension_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$3$subexpression$1",symbols:["kw_schema","word"],postprocess:l},{name:"createextension_statement$ebnf$3",symbols:["createextension_statement$ebnf$3$subexpression$1"],postprocess:n},{name:"createextension_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$4$subexpression$1",symbols:["kw_version","string"],postprocess:l},{name:"createextension_statement$ebnf$4",symbols:["createextension_statement$ebnf$4$subexpression$1"],postprocess:n},{name:"createextension_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$5$subexpression$1",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"string"],postprocess:l},{name:"createextension_statement$ebnf$5",symbols:["createextension_statement$ebnf$5$subexpression$1"],postprocess:n},{name:"createextension_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"createextension_statement",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_extension","createextension_statement$ebnf$1","word","createextension_statement$ebnf$2","createextension_statement$ebnf$3","createextension_statement$ebnf$4","createextension_statement$ebnf$5"],postprocess:Q=>(0,g.track)(Q,{type:"create extension",...Q[2]?{ifNotExists:!0}:{},extension:a(Q[3]),...Q[5]?{schema:a(Q[5])}:{},...Q[6]?{version:I(Q[6])}:{},...Q[7]?{from:I(Q[7])}:{}})},{name:"simplestatements_all",symbols:["simplestatements_start_transaction"]},{name:"simplestatements_all",symbols:["simplestatements_commit"]},{name:"simplestatements_all",symbols:["simplestatements_rollback"]},{name:"simplestatements_all",symbols:["simplestatements_tablespace"]},{name:"simplestatements_all",symbols:["simplestatements_set"]},{name:"simplestatements_all",symbols:["simplestatements_show"]},{name:"simplestatements_all",symbols:["simplestatements_begin"]},{name:"simplestatements_start_transaction$subexpression$1",symbols:["kw_start","kw_transaction"]},{name:"simplestatements_start_transaction",symbols:["simplestatements_start_transaction$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"start transaction"})},{name:"simplestatements_commit",symbols:["kw_commit"],postprocess:Q=>(0,g.track)(Q,{type:"commit"})},{name:"simplestatements_rollback",symbols:["kw_rollback"],postprocess:Q=>(0,g.track)(Q,{type:"rollback"})},{name:"simplestatements_tablespace",symbols:["kw_tablespace","word"],postprocess:Q=>(0,g.track)(Q,{type:"tablespace",tablespace:a(Q[1])})},{name:"simplestatements_set$subexpression$1",symbols:["simplestatements_set_simple"]},{name:"simplestatements_set$subexpression$1",symbols:["simplestatements_set_timezone"]},{name:"simplestatements_set$subexpression$1",symbols:["simplestatements_set_names"]},{name:"simplestatements_set",symbols:["kw_set","simplestatements_set$subexpression$1"],postprocess:l},{name:"simplestatements_set_timezone",symbols:["kw_time","kw_zone","simplestatements_set_timezone_val"],postprocess:Q=>(0,g.track)(Q,{type:"set timezone",to:Q[2]})},{name:"simplestatements_set_timezone_val$subexpression$1",symbols:["string"]},{name:"simplestatements_set_timezone_val$subexpression$1",symbols:["int"]},{name:"simplestatements_set_timezone_val",symbols:["simplestatements_set_timezone_val$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"value",value:r(Q[0])})},{name:"simplestatements_set_timezone_val",symbols:["kw_local"],postprocess:Q=>(0,g.track)(Q,{type:"local"})},{name:"simplestatements_set_timezone_val",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:Q=>(0,g.track)(Q,{type:"default"})},{name:"simplestatements_set_timezone_val",symbols:["kw_interval","string","kw_hour",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"kw_minute"],postprocess:Q=>(0,g.track)(Q,{type:"interval",value:(0,g.unbox)(Q[1])})},{name:"simplestatements_set_names",symbols:["kw_names","simplestatements_set_names_val"],postprocess:Q=>(0,g.track)(Q,{type:"set names",to:Q[1]})},{name:"simplestatements_set_names_val$subexpression$1",symbols:["string"]},{name:"simplestatements_set_names_val",symbols:["simplestatements_set_names_val$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"value",value:r(Q[0])})},{name:"simplestatements_set_simple$subexpression$1",symbols:[o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq]},{name:"simplestatements_set_simple$subexpression$1",symbols:[o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to]},{name:"simplestatements_set_simple",symbols:["ident","simplestatements_set_simple$subexpression$1","simplestatements_set_val"],postprocess:Q=>(0,g.track)(Q,{type:"set",variable:a(Q[0]),set:(0,g.unbox)(Q[2])})},{name:"simplestatements_set_val",symbols:["simplestatements_set_val_raw"],postprocess:r},{name:"simplestatements_set_val",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:Q=>(0,g.track)(Q,{type:"default"})},{name:"simplestatements_set_val$ebnf$1$subexpression$1",symbols:["comma","simplestatements_set_val_raw"]},{name:"simplestatements_set_val$ebnf$1",symbols:["simplestatements_set_val$ebnf$1$subexpression$1"]},{name:"simplestatements_set_val$ebnf$1$subexpression$2",symbols:["comma","simplestatements_set_val_raw"]},{name:"simplestatements_set_val$ebnf$1",symbols:["simplestatements_set_val$ebnf$1","simplestatements_set_val$ebnf$1$subexpression$2"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"simplestatements_set_val",symbols:["simplestatements_set_val_raw","simplestatements_set_val$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{type:"list",values:[Q[0],...Q[1]||[]]})},{name:"simplestatements_set_val_raw$subexpression$1",symbols:["string"]},{name:"simplestatements_set_val_raw$subexpression$1",symbols:["int"]},{name:"simplestatements_set_val_raw",symbols:["simplestatements_set_val_raw$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"value",value:r(Q)})},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[o.lexerAny.has("word")?{type:"word"}:word]},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on]},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[o.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true]},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[o.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false]},{name:"simplestatements_set_val_raw",symbols:["simplestatements_set_val_raw$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{type:"identifier",name:r(Q).value})},{name:"simplestatements_set_val_raw",symbols:[o.lexerAny.has("quoted_word")?{type:"quoted_word"}:quoted_word],postprocess:Q=>(0,g.track)(Q,{type:"identifier",doubleQuoted:!0,name:r(Q).value})},{name:"simplestatements_show",symbols:["kw_show","ident"],postprocess:Q=>(0,g.track)(Q,{type:"show",variable:a(Q[1])})},{name:"create_schema$subexpression$1",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_schema"]},{name:"create_schema$ebnf$1",symbols:["kw_ifnotexists"],postprocess:n},{name:"create_schema$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_schema",symbols:["create_schema$subexpression$1","create_schema$ebnf$1","ident"],postprocess:Q=>(0,g.track)(Q,{type:"create schema",name:a(Q[2]),...Q[1]?{ifNotExists:!0}:{}})},{name:"raise_statement$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("debug","log","info","notice","warning","exception")},{name:"raise_statement$ebnf$1",symbols:["raise_statement$ebnf$1$subexpression$1"],postprocess:n},{name:"raise_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"raise_statement$ebnf$2$subexpression$1",symbols:["comma","expr_list_raw"],postprocess:l},{name:"raise_statement$ebnf$2",symbols:["raise_statement$ebnf$2$subexpression$1"],postprocess:n},{name:"raise_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"raise_statement$ebnf$3",symbols:["raise_using"],postprocess:n},{name:"raise_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"raise_statement",symbols:["kw_raise","raise_statement$ebnf$1","string","raise_statement$ebnf$2","raise_statement$ebnf$3"],postprocess:Q=>(0,g.track)(Q,{type:"raise",format:u(Q[2]),...Q[1]&&{level:u(Q[1])},...Q[3]&&Q[3].length&&{formatExprs:Q[3]},...Q[4]&&Q[4].length&&{using:Q[4]}})},{name:"raise_using$macrocall$2",symbols:["raise_using_one"]},{name:"raise_using$macrocall$1$ebnf$1",symbols:[]},{name:"raise_using$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"raise_using$macrocall$2"],postprocess:l},{name:"raise_using$macrocall$1$ebnf$1",symbols:["raise_using$macrocall$1$ebnf$1","raise_using$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"raise_using$macrocall$1",symbols:["raise_using$macrocall$2","raise_using$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"raise_using",symbols:[o.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using,"raise_using$macrocall$1"],postprocess:l},{name:"raise_using_one",symbols:["raise_using_what",o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"expr"],postprocess:Q=>(0,g.track)(Q,{type:u(Q[0]),value:Q[2]})},{name:"raise_using_what",symbols:[o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table]},{name:"raise_using_what",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("message","detail","hint","errcode","column","constraint","datatype","schema")},{name:"comment_statement",symbols:["kw_comment",o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"comment_what",o.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,"string"],postprocess:Q=>(0,g.track)(Q,{type:"comment",comment:(0,g.unbox)(l(Q)),on:r(Q[2])})},{name:"comment_what",symbols:["comment_what_col"]},{name:"comment_what",symbols:["comment_what_nm"]},{name:"comment_what_nm$subexpression$1",symbols:[o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table]},{name:"comment_what_nm$subexpression$1",symbols:["kw_materialized","kw_view"]},{name:"comment_what_nm$subexpression$1",symbols:[o.lexerAny.has("word")?{type:"word"}:word],postprocess:R("database","index","trigger","type","view")},{name:"comment_what_nm",symbols:["comment_what_nm$subexpression$1","qualified_name"],postprocess:Q=>(0,g.track)(Q,{type:u(Q[0]),name:Q[1]})},{name:"comment_what_col",symbols:["kw_column","qcolumn"],postprocess:Q=>(0,g.track)(Q,{type:"column",column:l(Q)})},{name:"simplestatements_begin$ebnf$1$subexpression$1",symbols:["kw_transaction"]},{name:"simplestatements_begin$ebnf$1$subexpression$1",symbols:["kw_work"]},{name:"simplestatements_begin$ebnf$1",symbols:["simplestatements_begin$ebnf$1$subexpression$1"],postprocess:n},{name:"simplestatements_begin$ebnf$1",symbols:[],postprocess:()=>null},{name:"simplestatements_begin$ebnf$2",symbols:[]},{name:"simplestatements_begin$ebnf$2$subexpression$1",symbols:["simplestatements_begin_isol"]},{name:"simplestatements_begin$ebnf$2$subexpression$1",symbols:["simplestatements_begin_writ"]},{name:"simplestatements_begin$ebnf$2$subexpression$1",symbols:["simplestatements_begin_def"]},{name:"simplestatements_begin$ebnf$2",symbols:["simplestatements_begin$ebnf$2","simplestatements_begin$ebnf$2$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"simplestatements_begin",symbols:["kw_begin","simplestatements_begin$ebnf$1","simplestatements_begin$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"begin",...Q[2].reduce((k,h)=>({...r(k),...r(h)}),{})})},{name:"simplestatements_begin_isol$subexpression$1",symbols:["kw_isolation","kw_level"]},{name:"simplestatements_begin_isol$subexpression$2",symbols:["kw_serializable"]},{name:"simplestatements_begin_isol$subexpression$2$subexpression$1",symbols:["word"],postprocess:G("repeatable")},{name:"simplestatements_begin_isol$subexpression$2",symbols:["simplestatements_begin_isol$subexpression$2$subexpression$1","kw_read"]},{name:"simplestatements_begin_isol$subexpression$2$subexpression$2",symbols:["word"],postprocess:G("committed")},{name:"simplestatements_begin_isol$subexpression$2",symbols:["kw_read","simplestatements_begin_isol$subexpression$2$subexpression$2"]},{name:"simplestatements_begin_isol$subexpression$2$subexpression$3",symbols:["word"],postprocess:G("uncommitted")},{name:"simplestatements_begin_isol$subexpression$2",symbols:["kw_read","simplestatements_begin_isol$subexpression$2$subexpression$3"]},{name:"simplestatements_begin_isol",symbols:["simplestatements_begin_isol$subexpression$1","simplestatements_begin_isol$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{isolationLevel:u(Q[1]," ")})},{name:"simplestatements_begin_writ$subexpression$1",symbols:["kw_read","kw_write"]},{name:"simplestatements_begin_writ$subexpression$1",symbols:["kw_read",o.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only]},{name:"simplestatements_begin_writ",symbols:["simplestatements_begin_writ$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{writeable:u(Q," ")})},{name:"simplestatements_begin_def$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"simplestatements_begin_def$ebnf$1",symbols:[],postprocess:()=>null},{name:"simplestatements_begin_def",symbols:["simplestatements_begin_def$ebnf$1",o.lexerAny.has("kw_deferrable")?{type:"kw_deferrable"}:kw_deferrable],postprocess:Q=>(0,g.track)(Q,{deferrable:!Q[0]})},{name:"insert_statement$subexpression$1",symbols:["kw_insert",o.lexerAny.has("kw_into")?{type:"kw_into"}:kw_into]},{name:"insert_statement$ebnf$1",symbols:["collist_paren"],postprocess:n},{name:"insert_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$2$subexpression$1$subexpression$1",symbols:["kw_system"]},{name:"insert_statement$ebnf$2$subexpression$1$subexpression$1",symbols:[o.lexerAny.has("kw_user")?{type:"kw_user"}:kw_user]},{name:"insert_statement$ebnf$2$subexpression$1",symbols:["kw_overriding","insert_statement$ebnf$2$subexpression$1$subexpression$1","kw_value"],postprocess:C(1)},{name:"insert_statement$ebnf$2",symbols:["insert_statement$ebnf$2$subexpression$1"],postprocess:n},{name:"insert_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$3$subexpression$1",symbols:["selection"]},{name:"insert_statement$ebnf$3$subexpression$1",symbols:["selection_paren"]},{name:"insert_statement$ebnf$3",symbols:["insert_statement$ebnf$3$subexpression$1"],postprocess:n},{name:"insert_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$4$subexpression$1",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"kw_conflict","insert_on_conflict"],postprocess:l},{name:"insert_statement$ebnf$4",symbols:["insert_statement$ebnf$4$subexpression$1"],postprocess:n},{name:"insert_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$5$subexpression$1",symbols:[o.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning,"select_expr_list_aliased"],postprocess:l},{name:"insert_statement$ebnf$5",symbols:["insert_statement$ebnf$5$subexpression$1"],postprocess:n},{name:"insert_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"insert_statement",symbols:["insert_statement$subexpression$1","table_ref_aliased","insert_statement$ebnf$1","insert_statement$ebnf$2","insert_statement$ebnf$3","insert_statement$ebnf$4","insert_statement$ebnf$5"],postprocess:Q=>{const k=Q[2]&&Q[2].map(a),h=u(Q[3]),N=r(Q[4]),v=Q[5],K=Q[6];return(0,g.track)(Q,{type:"insert",into:r(Q[1]),insert:N,...h&&{overriding:h},...k&&{columns:k},...K&&{returning:K},...v&&{onConflict:v}})}},{name:"insert_values$ebnf$1",symbols:[]},{name:"insert_values$ebnf$1$subexpression$1",symbols:["comma","insert_value"],postprocess:l},{name:"insert_values$ebnf$1",symbols:["insert_values$ebnf$1","insert_values$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"insert_values",symbols:["insert_value","insert_values$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"insert_value",symbols:["lparen","insert_expr_list_raw","rparen"],postprocess:C(1)},{name:"insert_expr_list_raw$ebnf$1",symbols:[]},{name:"insert_expr_list_raw$ebnf$1$subexpression$1",symbols:["comma","expr_or_select"],postprocess:l},{name:"insert_expr_list_raw$ebnf$1",symbols:["insert_expr_list_raw$ebnf$1","insert_expr_list_raw$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"insert_expr_list_raw",symbols:["expr_or_select","insert_expr_list_raw$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"insert_on_conflict$ebnf$1",symbols:["insert_on_conflict_what"],postprocess:n},{name:"insert_on_conflict$ebnf$1",symbols:[],postprocess:()=>null},{name:"insert_on_conflict",symbols:["insert_on_conflict$ebnf$1","insert_on_conflict_do"],postprocess:Q=>(0,g.track)(Q,{...Q[0]?{on:r(Q[0])}:{},...Q[1]})},{name:"insert_on_conflict_what",symbols:["lparen","expr_list_raw","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"on expr",exprs:Q[1]})},{name:"insert_on_conflict_what",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"qname"],postprocess:Q=>(0,g.track)(Q,{type:"on constraint",constraint:l(Q)})},{name:"insert_on_conflict_do",symbols:[o.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do,"kw_nothing"],postprocess:Q=>({do:"do nothing"})},{name:"insert_on_conflict_do$subexpression$1",symbols:[o.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do,"kw_update","kw_set"]},{name:"insert_on_conflict_do$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr"],postprocess:l},{name:"insert_on_conflict_do$ebnf$1",symbols:["insert_on_conflict_do$ebnf$1$subexpression$1"],postprocess:n},{name:"insert_on_conflict_do$ebnf$1",symbols:[],postprocess:()=>null},{name:"insert_on_conflict_do",symbols:["insert_on_conflict_do$subexpression$1","update_set_list","insert_on_conflict_do$ebnf$1"],postprocess:Q=>({do:{sets:Q[1]},...Q[2]&&{where:Q[2]}})},{name:"update_statement$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"select_from_subject"],postprocess:l},{name:"update_statement$ebnf$1",symbols:["update_statement$ebnf$1$subexpression$1"],postprocess:n},{name:"update_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"update_statement$ebnf$2",symbols:["select_where"],postprocess:n},{name:"update_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"update_statement$ebnf$3$subexpression$1",symbols:[o.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning,"select_expr_list_aliased"],postprocess:l},{name:"update_statement$ebnf$3",symbols:["update_statement$ebnf$3$subexpression$1"],postprocess:n},{name:"update_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"update_statement",symbols:["kw_update","table_ref_aliased","kw_set","update_set_list","update_statement$ebnf$1","update_statement$ebnf$2","update_statement$ebnf$3"],postprocess:Q=>{const k=r(Q[4]),h=r(Q[5]),N=Q[6];return(0,g.track)(Q,{type:"update",table:r(Q[1]),sets:Q[3],...h?{where:h}:{},...k?{from:k}:{},...N?{returning:N}:{}})}},{name:"update_set_list$ebnf$1",symbols:[]},{name:"update_set_list$ebnf$1$subexpression$1",symbols:["comma","update_set"],postprocess:l},{name:"update_set_list$ebnf$1",symbols:["update_set_list$ebnf$1","update_set_list$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"update_set_list",symbols:["update_set","update_set_list$ebnf$1"],postprocess:([Q,k])=>{const h=[];for(const N of[Q,...k||[]]){const v=r(N);Array.isArray(v)?h.push(...v):h.push(v)}return h}},{name:"update_set",symbols:["update_set_one"]},{name:"update_set",symbols:["update_set_multiple"]},{name:"update_set_one",symbols:["ident",o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"expr"],postprocess:Q=>(0,g.box)(Q,{column:a(Q[0]),value:r(Q[2])})},{name:"update_set_multiple$subexpression$1",symbols:["lparen","expr_list_raw","rparen"],postprocess:C(1)},{name:"update_set_multiple",symbols:["collist_paren",o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"update_set_multiple$subexpression$1"],postprocess:Q=>{const k=Q[0],h=Q[2];if(k.length!==h.length)throw new Error("number of columns does not match number of values");return(0,g.box)(Q,k.map((N,v)=>({column:a(N),value:r(h[v])})))}},{name:"altertable_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:n},{name:"altertable_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_statement$ebnf$2",symbols:[o.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only],postprocess:n},{name:"altertable_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_statement",symbols:["kw_alter",o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table,"altertable_statement$ebnf$1","altertable_statement$ebnf$2","table_ref","altertable_actions"],postprocess:Q=>(0,g.track)(Q,{type:"alter table",...Q[2]?{ifExists:!0}:{},...Q[3]?{only:!0}:{},table:r(Q[4]),changes:(0,g.unbox)(Q[5]).map(r)})},{name:"altertable_actions$ebnf$1",symbols:[]},{name:"altertable_actions$ebnf$1$subexpression$1",symbols:["comma","altertable_action"],postprocess:l},{name:"altertable_actions$ebnf$1",symbols:["altertable_actions$ebnf$1","altertable_actions$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"altertable_actions",symbols:["altertable_action","altertable_actions$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"altertable_action",symbols:["altertable_rename_table"]},{name:"altertable_action",symbols:["altertable_rename_column"]},{name:"altertable_action",symbols:["altertable_rename_constraint"]},{name:"altertable_action",symbols:["altertable_add_column"]},{name:"altertable_action",symbols:["altertable_drop_column"]},{name:"altertable_action",symbols:["altertable_alter_column"]},{name:"altertable_action",symbols:["altertable_add_constraint"]},{name:"altertable_action",symbols:["altertable_drop_constraint"]},{name:"altertable_action",symbols:["altertable_owner"]},{name:"altertable_rename_table",symbols:["kw_rename",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"word"],postprocess:Q=>(0,g.track)(Q,{type:"rename",to:a(l(Q))})},{name:"altertable_rename_column$ebnf$1",symbols:["kw_column"],postprocess:n},{name:"altertable_rename_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_rename_column",symbols:["kw_rename","altertable_rename_column$ebnf$1","ident",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:Q=>(0,g.track)(Q,{type:"rename column",column:a(Q[2]),to:a(l(Q))})},{name:"altertable_rename_constraint",symbols:["kw_rename",o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"ident",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:Q=>(0,g.track)(Q,{type:"rename constraint",constraint:a(Q[2]),to:a(l(Q))})},{name:"altertable_add_column$ebnf$1",symbols:["kw_column"],postprocess:n},{name:"altertable_add_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_add_column$ebnf$2",symbols:["kw_ifnotexists"],postprocess:n},{name:"altertable_add_column$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_add_column",symbols:["kw_add","altertable_add_column$ebnf$1","altertable_add_column$ebnf$2","createtable_column"],postprocess:Q=>(0,g.track)(Q,{type:"add column",...Q[2]?{ifNotExists:!0}:{},column:r(Q[3])})},{name:"altertable_drop_column$ebnf$1",symbols:["kw_column"],postprocess:n},{name:"altertable_drop_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_drop_column$ebnf$2",symbols:["kw_ifexists"],postprocess:n},{name:"altertable_drop_column$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_drop_column$ebnf$3$subexpression$1",symbols:["kw_restrict"]},{name:"altertable_drop_column$ebnf$3$subexpression$1",symbols:["kw_cascade"]},{name:"altertable_drop_column$ebnf$3",symbols:["altertable_drop_column$ebnf$3$subexpression$1"],postprocess:n},{name:"altertable_drop_column$ebnf$3",symbols:[],postprocess:()=>null},{name:"altertable_drop_column",symbols:["kw_drop","altertable_drop_column$ebnf$1","altertable_drop_column$ebnf$2","ident","altertable_drop_column$ebnf$3"],postprocess:Q=>(0,g.track)(Q,{type:"drop column",...Q[2]?{ifExists:!0}:{},column:a(Q[3]),...Q[4]?{behaviour:u(Q[4]," ")}:{}})},{name:"altertable_alter_column$ebnf$1",symbols:["kw_column"],postprocess:n},{name:"altertable_alter_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_alter_column",symbols:["kw_alter","altertable_alter_column$ebnf$1","ident","altercol"],postprocess:Q=>(0,g.track)(Q,{type:"alter column",column:a(Q[2]),alter:r(Q[3])})},{name:"altercol$ebnf$1$subexpression$1",symbols:["kw_set","kw_data"]},{name:"altercol$ebnf$1",symbols:["altercol$ebnf$1$subexpression$1"],postprocess:n},{name:"altercol$ebnf$1",symbols:[],postprocess:()=>null},{name:"altercol",symbols:["altercol$ebnf$1","kw_type","data_type"],postprocess:Q=>(0,g.track)(Q,{type:"set type",dataType:r(l(Q))})},{name:"altercol",symbols:["kw_set",o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default,"expr"],postprocess:Q=>(0,g.track)(Q,{type:"set default",default:r(l(Q))})},{name:"altercol",symbols:["kw_drop",o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:Q=>(0,g.track)(Q,{type:"drop default"})},{name:"altercol$subexpression$1",symbols:["kw_set"]},{name:"altercol$subexpression$1",symbols:["kw_drop"]},{name:"altercol",symbols:["altercol$subexpression$1","kw_not_null"],postprocess:Q=>(0,g.track)(Q,{type:u(Q," ")})},{name:"altercol",symbols:["altercol_generated_add"],postprocess:r},{name:"altertable_add_constraint",symbols:["kw_add","createtable_constraint"],postprocess:Q=>(0,g.track)(Q,{type:"add constraint",constraint:r(l(Q))})},{name:"altertable_drop_constraint$ebnf$1",symbols:["kw_ifexists"],postprocess:n},{name:"altertable_drop_constraint$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_drop_constraint$ebnf$2$subexpression$1",symbols:["kw_restrict"]},{name:"altertable_drop_constraint$ebnf$2$subexpression$1",symbols:["kw_cascade"]},{name:"altertable_drop_constraint$ebnf$2",symbols:["altertable_drop_constraint$ebnf$2$subexpression$1"],postprocess:n},{name:"altertable_drop_constraint$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_drop_constraint",symbols:["kw_drop",o.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"altertable_drop_constraint$ebnf$1","ident","altertable_drop_constraint$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"drop constraint",...Q[2]?{ifExists:!0}:{},constraint:a(Q[3]),...Q[4]?{behaviour:u(Q[4]," ")}:{}})},{name:"altertable_owner",symbols:["kw_owner",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:Q=>(0,g.track)(Q,{type:"owner",to:a(l(Q))})},{name:"altercol_generated_add",symbols:["kw_add","altercol_generated"],postprocess:l},{name:"altercol_generated$ebnf$1$subexpression$1",symbols:["kw_always"]},{name:"altercol_generated$ebnf$1$subexpression$1",symbols:["kw_by",o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default]},{name:"altercol_generated$ebnf$1",symbols:["altercol_generated$ebnf$1$subexpression$1"],postprocess:n},{name:"altercol_generated$ebnf$1",symbols:[],postprocess:()=>null},{name:"altercol_generated$subexpression$1",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"kw_identity"]},{name:"altercol_generated$ebnf$2$subexpression$1",symbols:["lparen","altercol_generated_seq","rparen"],postprocess:C(1)},{name:"altercol_generated$ebnf$2",symbols:["altercol_generated$ebnf$2$subexpression$1"],postprocess:n},{name:"altercol_generated$ebnf$2",symbols:[],postprocess:()=>null},{name:"altercol_generated",symbols:["kw_generated","altercol_generated$ebnf$1","altercol_generated$subexpression$1","altercol_generated$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"add generated",...Q[1]&&{always:u(Q[1]," ")},...Q[3]&&{sequence:r(Q[3])}})},{name:"altercol_generated_seq$ebnf$1$subexpression$1",symbols:["kw_sequence","kw_name","qualified_name"]},{name:"altercol_generated_seq$ebnf$1",symbols:["altercol_generated_seq$ebnf$1$subexpression$1"],postprocess:n},{name:"altercol_generated_seq$ebnf$1",symbols:[],postprocess:()=>null},{name:"altercol_generated_seq$ebnf$2",symbols:[]},{name:"altercol_generated_seq$ebnf$2",symbols:["altercol_generated_seq$ebnf$2","create_sequence_option"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"altercol_generated_seq",symbols:["altercol_generated_seq$ebnf$1","altercol_generated_seq$ebnf$2"],postprocess:Q=>{const k={...Q[0]&&{name:r(l(Q[0]))}};return x(k,Q[1]),(0,g.track)(Q,k)}},{name:"alterindex_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:n},{name:"alterindex_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"alterindex_statement",symbols:["kw_alter","kw_index","alterindex_statement$ebnf$1","table_ref","alterindex_action"],postprocess:Q=>(0,g.track)(Q,{type:"alter index",...Q[2]?{ifExists:!0}:{},index:r(Q[3]),change:r(Q[4])})},{name:"alterindex_action",symbols:["alterindex_rename"]},{name:"alterindex_action",symbols:["alterindex_set_tablespace"]},{name:"alterindex_rename",symbols:["kw_rename",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"word"],postprocess:Q=>(0,g.track)(Q,{type:"rename",to:a(l(Q))})},{name:"alterindex_set_tablespace",symbols:["kw_set","kw_tablespace","word"],postprocess:Q=>(0,g.track)(Q,{type:"set tablespace",tablespace:a(l(Q))})},{name:"delete_statement",symbols:["delete_delete"]},{name:"delete_statement",symbols:["delete_truncate"]},{name:"delete_delete$subexpression$1",symbols:["kw_delete",o.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from]},{name:"delete_delete$ebnf$1",symbols:["select_where"],postprocess:n},{name:"delete_delete$ebnf$1",symbols:[],postprocess:()=>null},{name:"delete_delete$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning,"select_expr_list_aliased"],postprocess:l},{name:"delete_delete$ebnf$2",symbols:["delete_delete$ebnf$2$subexpression$1"],postprocess:n},{name:"delete_delete$ebnf$2",symbols:[],postprocess:()=>null},{name:"delete_delete",symbols:["delete_delete$subexpression$1","table_ref_aliased","delete_delete$ebnf$1","delete_delete$ebnf$2"],postprocess:Q=>{const k=Q[2],h=Q[3];return(0,g.track)(Q,{type:"delete",from:r(Q[1]),...k?{where:k}:{},...h?{returning:h}:{}})}},{name:"delete_truncate$subexpression$1$ebnf$1",symbols:[o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table],postprocess:n},{name:"delete_truncate$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"delete_truncate$subexpression$1",symbols:["kw_truncate","delete_truncate$subexpression$1$ebnf$1"]},{name:"delete_truncate$macrocall$2",symbols:["table_ref"]},{name:"delete_truncate$macrocall$1$ebnf$1",symbols:[]},{name:"delete_truncate$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"delete_truncate$macrocall$2"],postprocess:l},{name:"delete_truncate$macrocall$1$ebnf$1",symbols:["delete_truncate$macrocall$1$ebnf$1","delete_truncate$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"delete_truncate$macrocall$1",symbols:["delete_truncate$macrocall$2","delete_truncate$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"delete_truncate$ebnf$1$subexpression$1$subexpression$1",symbols:["kw_restart"]},{name:"delete_truncate$ebnf$1$subexpression$1$subexpression$1",symbols:["kw_continue"]},{name:"delete_truncate$ebnf$1$subexpression$1",symbols:["delete_truncate$ebnf$1$subexpression$1$subexpression$1","kw_identity"]},{name:"delete_truncate$ebnf$1",symbols:["delete_truncate$ebnf$1$subexpression$1"],postprocess:n},{name:"delete_truncate$ebnf$1",symbols:[],postprocess:()=>null},{name:"delete_truncate$ebnf$2$subexpression$1",symbols:["kw_restrict"]},{name:"delete_truncate$ebnf$2$subexpression$1",symbols:["kw_cascade"]},{name:"delete_truncate$ebnf$2",symbols:["delete_truncate$ebnf$2$subexpression$1"],postprocess:n},{name:"delete_truncate$ebnf$2",symbols:[],postprocess:()=>null},{name:"delete_truncate",symbols:["delete_truncate$subexpression$1","delete_truncate$macrocall$1","delete_truncate$ebnf$1","delete_truncate$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"truncate table",tables:Q[1],...Q[2]&&{identity:u(Q[2][0])},...Q[3]&&{cascade:u(Q[3])}})},{name:"create_sequence_statement$ebnf$1$subexpression$1",symbols:["kw_temp"]},{name:"create_sequence_statement$ebnf$1$subexpression$1",symbols:["kw_temporary"]},{name:"create_sequence_statement$ebnf$1",symbols:["create_sequence_statement$ebnf$1$subexpression$1"],postprocess:n},{name:"create_sequence_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_sequence_statement$ebnf$2",symbols:["kw_ifnotexists"],postprocess:n},{name:"create_sequence_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_sequence_statement$ebnf$3",symbols:[]},{name:"create_sequence_statement$ebnf$3",symbols:["create_sequence_statement$ebnf$3","create_sequence_option"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_sequence_statement",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"create_sequence_statement$ebnf$1","kw_sequence","create_sequence_statement$ebnf$2","qualified_name","create_sequence_statement$ebnf$3"],postprocess:Q=>{const k={type:"create sequence",...Q[1]&&{temp:!0},...Q[3]&&{ifNotExists:!0},name:r(Q[4]),options:{}};return x(k.options,Q[5]),(0,g.track)(Q,k)}},{name:"create_sequence_option",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"data_type"],postprocess:Q=>(0,g.box)(Q,["as",Q[1]])},{name:"create_sequence_option$ebnf$1",symbols:["kw_by"],postprocess:n},{name:"create_sequence_option$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_sequence_option",symbols:["kw_increment","create_sequence_option$ebnf$1","int"],postprocess:Q=>(0,g.box)(Q,["incrementBy",Q[2]])},{name:"create_sequence_option",symbols:["create_sequence_minvalue"],postprocess:Q=>(0,g.box)(Q,["minValue",Q[0]])},{name:"create_sequence_option",symbols:["create_sequence_maxvalue"],postprocess:Q=>(0,g.box)(Q,["maxValue",Q[0]])},{name:"create_sequence_option$ebnf$2",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with],postprocess:n},{name:"create_sequence_option$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_sequence_option",symbols:["kw_start","create_sequence_option$ebnf$2","int"],postprocess:Q=>(0,g.box)(Q,["startWith",Q[2]])},{name:"create_sequence_option",symbols:["kw_cache","int"],postprocess:Q=>(0,g.box)(Q,["cache",Q[1]])},{name:"create_sequence_option$ebnf$3",symbols:["kw_no"],postprocess:n},{name:"create_sequence_option$ebnf$3",symbols:[],postprocess:()=>null},{name:"create_sequence_option",symbols:["create_sequence_option$ebnf$3","kw_cycle"],postprocess:Q=>(0,g.box)(Q,["cycle",u(Q," ")])},{name:"create_sequence_option",symbols:["create_sequence_owned_by"],postprocess:Q=>(0,g.box)(Q,["ownedBy",r(Q)])},{name:"create_sequence_minvalue",symbols:["kw_minvalue","int"],postprocess:l},{name:"create_sequence_minvalue",symbols:["kw_no","kw_minvalue"],postprocess:Q=>(0,g.box)(Q,"no minvalue")},{name:"create_sequence_maxvalue",symbols:["kw_maxvalue","int"],postprocess:l},{name:"create_sequence_maxvalue",symbols:["kw_no","kw_maxvalue"],postprocess:Q=>(0,g.box)(Q,"no maxvalue")},{name:"create_sequence_owned_by$subexpression$1",symbols:["kw_none"]},{name:"create_sequence_owned_by$subexpression$1",symbols:["qcolumn"]},{name:"create_sequence_owned_by",symbols:["kw_owned","kw_by","create_sequence_owned_by$subexpression$1"],postprocess:Q=>(0,g.box)(Q,r(l(Q)))},{name:"alter_sequence_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:n},{name:"alter_sequence_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"alter_sequence_statement",symbols:["kw_alter","kw_sequence","alter_sequence_statement$ebnf$1","qualified_name","alter_sequence_statement_body"],postprocess:Q=>{const k={type:"alter sequence",...Q[2]&&{ifExists:!0},name:r(Q[3]),change:Q[4]};return(0,g.track)(Q,k)}},{name:"alter_sequence_statement_body$ebnf$1",symbols:["alter_sequence_option"]},{name:"alter_sequence_statement_body$ebnf$1",symbols:["alter_sequence_statement_body$ebnf$1","alter_sequence_option"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"alter_sequence_statement_body",symbols:["alter_sequence_statement_body$ebnf$1"],postprocess:Q=>{const k={type:"set options"};return x(k,Q[0]),(0,g.track)(Q,k)}},{name:"alter_sequence_statement_body$subexpression$1",symbols:["ident"]},{name:"alter_sequence_statement_body$subexpression$1",symbols:[o.lexerAny.has("kw_session_user")?{type:"kw_session_user"}:kw_session_user]},{name:"alter_sequence_statement_body$subexpression$1",symbols:[o.lexerAny.has("kw_current_user")?{type:"kw_current_user"}:kw_current_user]},{name:"alter_sequence_statement_body",symbols:["kw_owner",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"alter_sequence_statement_body$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{type:"owner to",owner:a(l(Q))})},{name:"alter_sequence_statement_body",symbols:["kw_rename",o.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:Q=>(0,g.track)(Q,{type:"rename",newName:a(l(Q))})},{name:"alter_sequence_statement_body",symbols:["kw_set","kw_schema","ident"],postprocess:Q=>(0,g.track)(Q,{type:"set schema",newSchema:a(l(Q))})},{name:"alter_sequence_option",symbols:["create_sequence_option"],postprocess:r},{name:"alter_sequence_option$ebnf$1$subexpression$1$ebnf$1",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with],postprocess:n},{name:"alter_sequence_option$ebnf$1$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"alter_sequence_option$ebnf$1$subexpression$1",symbols:["alter_sequence_option$ebnf$1$subexpression$1$ebnf$1","int"],postprocess:l},{name:"alter_sequence_option$ebnf$1",symbols:["alter_sequence_option$ebnf$1$subexpression$1"],postprocess:n},{name:"alter_sequence_option$ebnf$1",symbols:[],postprocess:()=>null},{name:"alter_sequence_option",symbols:["kw_restart","alter_sequence_option$ebnf$1"],postprocess:Q=>(0,g.box)(Q,["restart",typeof(0,g.unbox)(Q[1])=="number"?(0,g.unbox)(Q[1]):!0])},{name:"drop_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:n},{name:"drop_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_statement$macrocall$2",symbols:["qualified_name"]},{name:"drop_statement$macrocall$1$ebnf$1",symbols:[]},{name:"drop_statement$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"drop_statement$macrocall$2"],postprocess:l},{name:"drop_statement$macrocall$1$ebnf$1",symbols:["drop_statement$macrocall$1$ebnf$1","drop_statement$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"drop_statement$macrocall$1",symbols:["drop_statement$macrocall$2","drop_statement$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"drop_statement$ebnf$2$subexpression$1",symbols:["kw_cascade"]},{name:"drop_statement$ebnf$2$subexpression$1",symbols:["kw_restrict"]},{name:"drop_statement$ebnf$2",symbols:["drop_statement$ebnf$2$subexpression$1"],postprocess:n},{name:"drop_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"drop_statement",symbols:["kw_drop","drop_what","drop_statement$ebnf$1","drop_statement$macrocall$1","drop_statement$ebnf$2"],postprocess:(Q,k)=>{const h=r(Q[1]);return(0,g.track)(Q,{...h,...Q[2]&&{ifExists:!0},names:Q[3],...Q[4]&&{cascade:u(Q[4])}})}},{name:"drop_what",symbols:[o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table],postprocess:Q=>(0,g.track)(Q,{type:"drop table"})},{name:"drop_what",symbols:["kw_sequence"],postprocess:Q=>(0,g.track)(Q,{type:"drop sequence"})},{name:"drop_what",symbols:["kw_type"],postprocess:Q=>(0,g.track)(Q,{type:"drop type"})},{name:"drop_what",symbols:["kw_trigger"],postprocess:Q=>(0,g.track)(Q,{type:"drop trigger"})},{name:"drop_what$ebnf$1",symbols:[o.lexerAny.has("kw_concurrently")?{type:"kw_concurrently"}:kw_concurrently],postprocess:n},{name:"drop_what$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_what",symbols:["kw_index","drop_what$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{type:"drop index",...Q[1]&&{concurrently:!0}})},{name:"with_statement",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"with_statement_bindings","with_statement_statement"],postprocess:Q=>(0,g.track)(Q,{type:"with",bind:Q[1],in:r(Q[2])})},{name:"with_recursive_statement$subexpression$1",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"kw_recursive"]},{name:"with_recursive_statement",symbols:["with_recursive_statement$subexpression$1","ident","collist_paren",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"lparen","union_statement","rparen","with_statement_statement"],postprocess:Q=>(0,g.track)(Q,{type:"with recursive",alias:a(Q[1]),columnNames:Q[2].map(a),bind:Q[5],in:r(Q[7])})},{name:"with_statement_bindings$ebnf$1",symbols:[]},{name:"with_statement_bindings$ebnf$1$subexpression$1",symbols:["comma","with_statement_binding"],postprocess:l},{name:"with_statement_bindings$ebnf$1",symbols:["with_statement_bindings$ebnf$1","with_statement_bindings$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"with_statement_bindings",symbols:["with_statement_binding","with_statement_bindings$ebnf$1"],postprocess:([Q,k])=>[Q,...k||[]]},{name:"with_statement_binding",symbols:["word",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"lparen","with_statement_statement","rparen"],postprocess:Q=>(0,g.track)(Q,{alias:a(Q[0]),statement:r(Q[3])})},{name:"with_statement_statement",symbols:["selection"]},{name:"with_statement_statement",symbols:["insert_statement"]},{name:"with_statement_statement",symbols:["update_statement"]},{name:"with_statement_statement",symbols:["delete_statement"]},{name:"createtype_statement$subexpression$1",symbols:["createtype_enum"]},{name:"createtype_statement$subexpression$1",symbols:["createtype_composite"]},{name:"createtype_statement",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_type","qualified_name","createtype_statement$subexpression$1"],postprocess:Q=>(0,g.track)(Q,{name:Q[2],...r(Q[3])})},{name:"createtype_enum$macrocall$2",symbols:["enum_value"]},{name:"createtype_enum$macrocall$1$ebnf$1",symbols:[]},{name:"createtype_enum$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"createtype_enum$macrocall$2"],postprocess:l},{name:"createtype_enum$macrocall$1$ebnf$1",symbols:["createtype_enum$macrocall$1$ebnf$1","createtype_enum$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtype_enum$macrocall$1",symbols:["createtype_enum$macrocall$2","createtype_enum$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"createtype_enum",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"kw_enum","lparen","createtype_enum$macrocall$1","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"create enum",values:Q[3]})},{name:"enum_value",symbols:["string"],postprocess:Q=>(0,g.track)(Q,{value:u(Q)})},{name:"createtype_composite$macrocall$2",symbols:["createtype_composite_attr"]},{name:"createtype_composite$macrocall$1$ebnf$1",symbols:[]},{name:"createtype_composite$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"createtype_composite$macrocall$2"],postprocess:l},{name:"createtype_composite$macrocall$1$ebnf$1",symbols:["createtype_composite$macrocall$1$ebnf$1","createtype_composite$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"createtype_composite$macrocall$1",symbols:["createtype_composite$macrocall$2","createtype_composite$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"createtype_composite",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"lparen","createtype_composite$macrocall$1","rparen"],postprocess:Q=>(0,g.track)(Q,{type:"create composite type",attributes:Q[2]})},{name:"createtype_composite_attr$ebnf$1",symbols:["createtable_collate"],postprocess:n},{name:"createtype_composite_attr$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtype_composite_attr",symbols:["word","data_type","createtype_composite_attr$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{name:a(Q[0]),dataType:Q[1],...Q[2]?{collate:Q[2][1]}:{}})},{name:"union_left",symbols:["select_statement"]},{name:"union_left",symbols:["select_values"]},{name:"union_left",symbols:["selection_paren"]},{name:"union_right",symbols:["selection"]},{name:"union_right",symbols:["selection_paren"]},{name:"union_statement$subexpression$1$ebnf$1",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all],postprocess:n},{name:"union_statement$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"union_statement$subexpression$1",symbols:[o.lexerAny.has("kw_union")?{type:"kw_union"}:kw_union,"union_statement$subexpression$1$ebnf$1"]},{name:"union_statement",symbols:["union_left","union_statement$subexpression$1","union_right"],postprocess:Q=>(0,g.track)(Q,{type:u(Q[1]," "),left:r(Q[0]),right:r(Q[2])})},{name:"prepare$ebnf$1$subexpression$1",symbols:["lparen","data_type_list","rparen"],postprocess:C(1)},{name:"prepare$ebnf$1",symbols:["prepare$ebnf$1$subexpression$1"],postprocess:n},{name:"prepare$ebnf$1",symbols:[],postprocess:()=>null},{name:"prepare",symbols:["kw_prepare","ident","prepare$ebnf$1",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"statement_noprep"],postprocess:Q=>(0,g.track)(Q,{type:"prepare",name:a(Q[1]),...Q[2]&&{args:Q[2]},statement:r(l(Q))})},{name:"deallocate$ebnf$1",symbols:["kw_prepare"],postprocess:n},{name:"deallocate$ebnf$1",symbols:[],postprocess:()=>null},{name:"deallocate",symbols:["kw_deallocate","deallocate$ebnf$1","deallocate_target"],postprocess:Q=>(0,g.track)(Q,{type:"deallocate",target:Q[2]})},{name:"deallocate_target",symbols:["deallocate_all"],postprocess:r},{name:"deallocate_target",symbols:["deallocate_name"],postprocess:r},{name:"deallocate_name",symbols:["ident"],postprocess:Q=>(0,g.track)(Q,a(Q[0]))},{name:"deallocate_all",symbols:[o.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all],postprocess:Q=>(0,g.track)(Q,{option:"all"})},{name:"create_view_statements",symbols:["create_view"]},{name:"create_view_statements",symbols:["create_materialized_view"]},{name:"create_view$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or,"kw_replace"]},{name:"create_view$ebnf$1",symbols:["create_view$ebnf$1$subexpression$1"],postprocess:n},{name:"create_view$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$2$subexpression$1",symbols:["kw_temp"]},{name:"create_view$ebnf$2$subexpression$1",symbols:["kw_temporary"]},{name:"create_view$ebnf$2",symbols:["create_view$ebnf$2$subexpression$1"],postprocess:n},{name:"create_view$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$3",symbols:["kw_recursive"],postprocess:n},{name:"create_view$ebnf$3",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$4$subexpression$1$macrocall$2",symbols:["ident"]},{name:"create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1",symbols:[]},{name:"create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"create_view$ebnf$4$subexpression$1$macrocall$2"],postprocess:l},{name:"create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1",symbols:["create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1","create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_view$ebnf$4$subexpression$1$macrocall$1",symbols:["create_view$ebnf$4$subexpression$1$macrocall$2","create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"create_view$ebnf$4$subexpression$1",symbols:["lparen","create_view$ebnf$4$subexpression$1$macrocall$1","rparen"],postprocess:C(1)},{name:"create_view$ebnf$4",symbols:["create_view$ebnf$4$subexpression$1"],postprocess:n},{name:"create_view$ebnf$4",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$5",symbols:["create_view_opts"],postprocess:n},{name:"create_view$ebnf$5",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$6$subexpression$1$subexpression$1",symbols:["kw_local"]},{name:"create_view$ebnf$6$subexpression$1$subexpression$1",symbols:["kw_cascaded"]},{name:"create_view$ebnf$6$subexpression$1",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"create_view$ebnf$6$subexpression$1$subexpression$1",o.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check,"kw_option"],postprocess:C(1)},{name:"create_view$ebnf$6",symbols:["create_view$ebnf$6$subexpression$1"],postprocess:n},{name:"create_view$ebnf$6",symbols:[],postprocess:()=>null},{name:"create_view",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"create_view$ebnf$1","create_view$ebnf$2","create_view$ebnf$3","kw_view","qualified_name","create_view$ebnf$4","create_view$ebnf$5",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"selection","create_view$ebnf$6"],postprocess:Q=>(0,g.track)(Q,{type:"create view",...Q[1]&&{orReplace:!0},...Q[2]&&{temp:!0},...Q[3]&&{recursive:!0},name:Q[5],...Q[6]&&{columnNames:Q[6].map(a)},...Q[7]&&{parameters:d(Q[7])},query:Q[9],...Q[10]&&{checkOption:u(Q[10])}})},{name:"create_view_opt",symbols:["ident",o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"ident"],postprocess:([Q,k,h])=>[u(Q),u(h)]},{name:"create_view_opts$macrocall$2",symbols:["create_view_opt"]},{name:"create_view_opts$macrocall$1$ebnf$1",symbols:[]},{name:"create_view_opts$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"create_view_opts$macrocall$2"],postprocess:l},{name:"create_view_opts$macrocall$1$ebnf$1",symbols:["create_view_opts$macrocall$1$ebnf$1","create_view_opts$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_view_opts$macrocall$1",symbols:["create_view_opts$macrocall$2","create_view_opts$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"create_view_opts",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"create_view_opts$macrocall$1"],postprocess:l},{name:"create_materialized_view$ebnf$1",symbols:["kw_ifnotexists"],postprocess:n},{name:"create_materialized_view$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$2",symbols:["ident"]},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1",symbols:[]},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"create_materialized_view$ebnf$2$subexpression$1$macrocall$2"],postprocess:l},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1",symbols:["create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1","create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1",symbols:["create_materialized_view$ebnf$2$subexpression$1$macrocall$2","create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"create_materialized_view$ebnf$2$subexpression$1",symbols:["lparen","create_materialized_view$ebnf$2$subexpression$1$macrocall$1","rparen"],postprocess:C(1)},{name:"create_materialized_view$ebnf$2",symbols:["create_materialized_view$ebnf$2$subexpression$1"],postprocess:n},{name:"create_materialized_view$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$3",symbols:["create_view_opts"],postprocess:n},{name:"create_materialized_view$ebnf$3",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$4$subexpression$1",symbols:["kw_tablespace","ident"],postprocess:l},{name:"create_materialized_view$ebnf$4",symbols:["create_materialized_view$ebnf$4$subexpression$1"],postprocess:n},{name:"create_materialized_view$ebnf$4",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$5$subexpression$1$ebnf$1",symbols:["kw_no"],postprocess:n},{name:"create_materialized_view$ebnf$5$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$5$subexpression$1",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"create_materialized_view$ebnf$5$subexpression$1$ebnf$1","kw_data"]},{name:"create_materialized_view$ebnf$5",symbols:["create_materialized_view$ebnf$5$subexpression$1"],postprocess:n},{name:"create_materialized_view$ebnf$5",symbols:[],postprocess:()=>null},{name:"create_materialized_view",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_materialized","kw_view","create_materialized_view$ebnf$1","qualified_name","create_materialized_view$ebnf$2","create_materialized_view$ebnf$3","create_materialized_view$ebnf$4",o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"selection","create_materialized_view$ebnf$5"],postprocess:Q=>(0,g.track)(Q,{type:"create materialized view",...Q[3]&&{ifNotExists:!0},name:Q[4],...Q[5]&&{columnNames:Q[6].map(a)},...Q[6]&&{parameters:d(Q[6])},...Q[7]&&{tablespace:a(Q[7])},query:Q[9],...Q[10]&&{withData:u(Q[10][1])!=="no"}})},{name:"refresh_view_statements$ebnf$1",symbols:[o.lexerAny.has("kw_concurrently")?{type:"kw_concurrently"}:kw_concurrently],postprocess:n},{name:"refresh_view_statements$ebnf$1",symbols:[],postprocess:()=>null},{name:"refresh_view_statements$ebnf$2$subexpression$1$ebnf$1",symbols:["kw_no"],postprocess:n},{name:"refresh_view_statements$ebnf$2$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"refresh_view_statements$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"refresh_view_statements$ebnf$2$subexpression$1$ebnf$1","kw_data"]},{name:"refresh_view_statements$ebnf$2",symbols:["refresh_view_statements$ebnf$2$subexpression$1"],postprocess:n},{name:"refresh_view_statements$ebnf$2",symbols:[],postprocess:()=>null},{name:"refresh_view_statements",symbols:["kw_refresh","kw_materialized","kw_view","refresh_view_statements$ebnf$1","qname","refresh_view_statements$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"refresh materialized view",...Q[3]?{concurrently:!0}:{},name:Q[4],...Q[5]?{withData:u(Q[5][1])!=="no"}:{}})},{name:"functions_statements",symbols:["create_func"]},{name:"functions_statements",symbols:["do_stm"]},{name:"functions_statements",symbols:["drop_func"]},{name:"create_func$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or,"kw_replace"]},{name:"create_func$ebnf$1",symbols:["create_func$ebnf$1$subexpression$1"],postprocess:n},{name:"create_func$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_func$subexpression$1$ebnf$1$macrocall$2",symbols:["func_argdef"]},{name:"create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1",symbols:[]},{name:"create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"create_func$subexpression$1$ebnf$1$macrocall$2"],postprocess:l},{name:"create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1",symbols:["create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1","create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_func$subexpression$1$ebnf$1$macrocall$1",symbols:["create_func$subexpression$1$ebnf$1$macrocall$2","create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"create_func$subexpression$1$ebnf$1",symbols:["create_func$subexpression$1$ebnf$1$macrocall$1"],postprocess:n},{name:"create_func$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_func$subexpression$1",symbols:["lparen","create_func$subexpression$1$ebnf$1","rparen"],postprocess:C(1)},{name:"create_func$ebnf$2",symbols:["func_spec"]},{name:"create_func$ebnf$2",symbols:["create_func$ebnf$2","func_spec"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"create_func",symbols:[o.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"create_func$ebnf$1","kw_function","qname","create_func$subexpression$1","create_func$ebnf$2"],postprocess:(Q,k)=>{var h;const N={};for(const v of Q[5]){for(const K in v)if(K[0]!=="_"&&K in N)throw new Error("conflicting or redundant options "+K);Object.assign(N,v)}return(0,g.track)(Q,{type:"create function",...Q[1]&&{orReplace:!0},name:Q[3],arguments:(h=Q[4])!==null&&h!==void 0?h:[],...N})}},{name:"func_argdef$ebnf$1",symbols:["func_argopts"],postprocess:n},{name:"func_argdef$ebnf$1",symbols:[],postprocess:()=>null},{name:"func_argdef$ebnf$2",symbols:["func_argdefault"],postprocess:n},{name:"func_argdef$ebnf$2",symbols:[],postprocess:()=>null},{name:"func_argdef",symbols:["func_argdef$ebnf$1","data_type","func_argdef$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{default:Q[2],type:Q[1],...Q[0]})},{name:"func_argdefault",symbols:[o.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default,"expr"],postprocess:Q=>Q[1]},{name:"func_argdefault",symbols:[o.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"expr"],postprocess:Q=>Q[1]},{name:"func_argopts$ebnf$1",symbols:["word"],postprocess:n},{name:"func_argopts$ebnf$1",symbols:[],postprocess:()=>null},{name:"func_argopts",symbols:["func_argmod","func_argopts$ebnf$1"],postprocess:Q=>(0,g.track)(Q,{mode:u(Q[0]),...Q[1]&&{name:a(Q[1])}})},{name:"func_argopts",symbols:["word"],postprocess:(Q,k)=>{const h=a(Q);return h==="out"||h==="inout"||h==="variadic"?k:(0,g.track)(Q,{name:h})}},{name:"func_argmod",symbols:[o.lexerAny.has("kw_in")?{type:"kw_in"}:kw_in]},{name:"func_argmod",symbols:["kw_out"]},{name:"func_argmod",symbols:["kw_inout"]},{name:"func_argmod",symbols:["kw_variadic"]},{name:"func_spec",symbols:["kw_language","word"],postprocess:Q=>(0,g.track)(Q,{language:a(l(Q))})},{name:"func_spec",symbols:["func_purity"],postprocess:Q=>(0,g.track)(Q,{purity:u(Q)})},{name:"func_spec$subexpression$1",symbols:[o.lexerAny.has("codeblock")?{type:"codeblock"}:codeblock]},{name:"func_spec$subexpression$1",symbols:["string"]},{name:"func_spec",symbols:[o.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"func_spec$subexpression$1"],postprocess:Q=>({code:u(l(Q))})},{name:"func_spec$ebnf$1",symbols:[o.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:n},{name:"func_spec$ebnf$1",symbols:[],postprocess:()=>null},{name:"func_spec$subexpression$2",symbols:["word"],postprocess:G("leakproof")},{name:"func_spec",symbols:["func_spec$ebnf$1","func_spec$subexpression$2"],postprocess:Q=>(0,g.track)(Q,{leakproof:!Q[0]})},{name:"func_spec",symbols:["func_returns"],postprocess:Q=>(0,g.track)(Q,{returns:r(Q)})},{name:"func_spec$subexpression$3",symbols:["word"],postprocess:G("called")},{name:"func_spec",symbols:["func_spec$subexpression$3","oninp"],postprocess:()=>({onNullInput:"call"})},{name:"func_spec$subexpression$4",symbols:["word"],postprocess:G("returns")},{name:"func_spec",symbols:["func_spec$subexpression$4",o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null,"oninp"],postprocess:()=>({onNullInput:"null"})},{name:"func_spec$subexpression$5",symbols:["word"],postprocess:G("strict")},{name:"func_spec",symbols:["func_spec$subexpression$5"],postprocess:()=>({onNullInput:"strict"})},{name:"func_purity",symbols:["word"],postprocess:G("immutable")},{name:"func_purity",symbols:["word"],postprocess:G("stable")},{name:"func_purity",symbols:["word"],postprocess:G("volatile")},{name:"oninp$subexpression$1",symbols:["word"],postprocess:G("input")},{name:"oninp",symbols:[o.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,o.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null,"oninp$subexpression$1"]},{name:"func_returns",symbols:["kw_returns","data_type"],postprocess:l},{name:"func_returns$macrocall$2",symbols:["func_ret_table_col"]},{name:"func_returns$macrocall$1$ebnf$1",symbols:[]},{name:"func_returns$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"func_returns$macrocall$2"],postprocess:l},{name:"func_returns$macrocall$1$ebnf$1",symbols:["func_returns$macrocall$1$ebnf$1","func_returns$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"func_returns$macrocall$1",symbols:["func_returns$macrocall$2","func_returns$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"func_returns",symbols:["kw_returns",o.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table,"lparen","func_returns$macrocall$1","rparen"],postprocess:Q=>(0,g.track)(Q,{kind:"table",columns:Q[3]})},{name:"func_ret_table_col",symbols:["word","data_type"],postprocess:Q=>(0,g.track)(Q,{name:a(Q[0]),type:Q[1]})},{name:"do_stm$ebnf$1$subexpression$1",symbols:["kw_language","word"],postprocess:l},{name:"do_stm$ebnf$1",symbols:["do_stm$ebnf$1$subexpression$1"],postprocess:n},{name:"do_stm$ebnf$1",symbols:[],postprocess:()=>null},{name:"do_stm",symbols:[o.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do,"do_stm$ebnf$1",o.lexerAny.has("codeblock")?{type:"codeblock"}:codeblock],postprocess:Q=>(0,g.track)(Q,{type:"do",...Q[1]&&{language:a(Q[1])},code:Q[2].value})},{name:"drop_func$ebnf$1$subexpression$1",symbols:["kw_if","kw_exists"]},{name:"drop_func$ebnf$1",symbols:["drop_func$ebnf$1$subexpression$1"],postprocess:n},{name:"drop_func$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_func$ebnf$2",symbols:["drop_func_overload"],postprocess:n},{name:"drop_func$ebnf$2",symbols:[],postprocess:()=>null},{name:"drop_func",symbols:["kw_drop","kw_function","drop_func$ebnf$1","qname","drop_func$ebnf$2"],postprocess:Q=>(0,g.track)(Q,{type:"drop function",...Q[2]&&{ifExists:!0},name:Q[3],...Q[4]&&{arguments:Q[4]}})},{name:"drop_func_overload$macrocall$2",symbols:["drop_func_overload_col"]},{name:"drop_func_overload$macrocall$1$ebnf$1",symbols:[]},{name:"drop_func_overload$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"drop_func_overload$macrocall$2"],postprocess:l},{name:"drop_func_overload$macrocall$1$ebnf$1",symbols:["drop_func_overload$macrocall$1$ebnf$1","drop_func_overload$macrocall$1$ebnf$1$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"drop_func_overload$macrocall$1",symbols:["drop_func_overload$macrocall$2","drop_func_overload$macrocall$1$ebnf$1"],postprocess:([Q,k])=>[r(Q),...k.map(r)||[]]},{name:"drop_func_overload",symbols:["lparen","drop_func_overload$macrocall$1","rparen"],postprocess:C(1)},{name:"drop_func_overload_col$ebnf$1",symbols:["word"],postprocess:n},{name:"drop_func_overload_col$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_func_overload_col",symbols:["drop_func_overload_col$ebnf$1","qname"],postprocess:Q=>(0,g.track)(Q,{type:Q[1],...Q[0]&&{name:a(Q[0])}})},{name:"main$ebnf$1",symbols:[]},{name:"main$ebnf$1",symbols:["main$ebnf$1","statement_separator"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"main$ebnf$2",symbols:[]},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["statement_separator"]},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["main$ebnf$2$subexpression$1$ebnf$1","statement_separator"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"main$ebnf$2$subexpression$1",symbols:["main$ebnf$2$subexpression$1$ebnf$1","statement"]},{name:"main$ebnf$2",symbols:["main$ebnf$2","main$ebnf$2$subexpression$1"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"main$ebnf$3",symbols:[]},{name:"main$ebnf$3",symbols:["main$ebnf$3","statement_separator"],postprocess:Q=>Q[0].concat([Q[1]])},{name:"main",symbols:["main$ebnf$1","statement","main$ebnf$2","main$ebnf$3"],postprocess:([Q,k,h])=>{const N=h,v=[r(k),...N.map(K=>r(K[1]))];return v.length===1?v[0]:v}},{name:"statement_separator",symbols:[o.lexerAny.has("semicolon")?{type:"semicolon"}:semicolon]},{name:"statement",symbols:["statement_noprep"]},{name:"statement",symbols:["prepare"]},{name:"statement",symbols:["deallocate"]},{name:"statement_noprep",symbols:["selection"]},{name:"statement_noprep",symbols:["createtable_statement"]},{name:"statement_noprep",symbols:["createextension_statement"]},{name:"statement_noprep",symbols:["createindex_statement"]},{name:"statement_noprep",symbols:["simplestatements_all"]},{name:"statement_noprep",symbols:["insert_statement"]},{name:"statement_noprep",symbols:["update_statement"]},{name:"statement_noprep",symbols:["altertable_statement"]},{name:"statement_noprep",symbols:["alterindex_statement"]},{name:"statement_noprep",symbols:["delete_statement"]},{name:"statement_noprep",symbols:["create_sequence_statement"]},{name:"statement_noprep",symbols:["alter_sequence_statement"]},{name:"statement_noprep",symbols:["drop_statement"]},{name:"statement_noprep",symbols:["createtype_statement"]},{name:"statement_noprep",symbols:["create_view_statements"]},{name:"statement_noprep",symbols:["refresh_view_statements"]},{name:"statement_noprep",symbols:["create_schema"]},{name:"statement_noprep",symbols:["raise_statement"]},{name:"statement_noprep",symbols:["comment_statement"]},{name:"statement_noprep",symbols:["functions_statements"]},{name:"selection",symbols:["select_statement"],postprocess:r},{name:"selection",symbols:["select_values"],postprocess:r},{name:"selection",symbols:["with_statement"],postprocess:r},{name:"selection",symbols:["with_recursive_statement"],postprocess:r},{name:"selection",symbols:["union_statement"],postprocess:r},{name:"selection_paren",symbols:["lparen","selection","rparen"],postprocess:C(1)}],ParserStart:"main"};t.default=F},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});function n(s){return s[0]}const o=i(12),g=s=>s&&s[s.length-1],a={Lexer:o.lexerAny,ParserRules:[{name:"main$ebnf$1",symbols:["elements"],postprocess:n},{name:"main$ebnf$1",symbols:[],postprocess:()=>null},{name:"main",symbols:[o.lexerAny.has("start_list")?{type:"start_list"}:start_list,"main$ebnf$1",o.lexerAny.has("end_list")?{type:"end_list"}:end_list],postprocess:s=>s[1]||[]},{name:"elements$ebnf$1",symbols:[]},{name:"elements$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"elt"],postprocess:g},{name:"elements$ebnf$1",symbols:["elements$ebnf$1","elements$ebnf$1$subexpression$1"],postprocess:s=>s[0].concat([s[1]])},{name:"elements",symbols:["elt","elements$ebnf$1"],postprocess:([s,I])=>[s,...I||[]]},{name:"elt",symbols:[o.lexerAny.has("value")?{type:"value"}:value],postprocess:s=>s[0].value},{name:"elt",symbols:["main"],postprocess:s=>s[0]}],ParserStart:"main"};t.default=a},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.lexerAny=t.lexer=void 0;const n=i(0);t.lexer=(0,n.compile)({valueString:{match:/"(?:\\["\\]|[^\n"\\])*"/,value:o=>JSON.parse(o),type:o=>"value"},valueRaw:{match:/[^\s,\{\}"](?:[^,\{\}"]*[^\s,\{\}"])?/,type:()=>"value"},comma:",",space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},start_list:"{",end_list:"}"}),t.lexer.next=(o=>()=>{let g;for(;(g=o.call(t.lexer))&&g.type==="space";);return g})(t.lexer.next),t.lexerAny=t.lexer},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});function n(r){return r[0]}const o=i(14),g=r=>C=>C[r],a=r=>r&&r[r.length-1];function s(r){return Array.isArray(r)&&r.length===1&&(r=s(r[0])),Array.isArray(r)&&!r.length?null:r}const I={Lexer:o.lexerAny,ParserRules:[{name:"number$subexpression$1",symbols:["float"]},{name:"number$subexpression$1",symbols:["int"]},{name:"number",symbols:["number$subexpression$1"],postprocess:s},{name:"float",symbols:[o.lexerAny.has("float")?{type:"float"}:float],postprocess:r=>parseFloat(s(r))},{name:"int",symbols:[o.lexerAny.has("int")?{type:"int"}:int],postprocess:r=>parseInt(s(r),10)},{name:"comma",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma],postprocess:n},{name:"point$macrocall$2",symbols:["point_content"]},{name:"point$macrocall$1$subexpression$1",symbols:["point$macrocall$2"]},{name:"point$macrocall$1$subexpression$1",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen,"point$macrocall$2",o.lexerAny.has("rparen")?{type:"rparen"}:rparen],postprocess:g(1)},{name:"point$macrocall$1",symbols:["point$macrocall$1$subexpression$1"],postprocess:s},{name:"point",symbols:["point$macrocall$1"],postprocess:s},{name:"point_content",symbols:["number","comma","number"],postprocess:r=>({x:r[0],y:r[2]})},{name:"line",symbols:[o.lexerAny.has("lcurl")?{type:"lcurl"}:lcurl,"number","comma","number","comma","number",o.lexerAny.has("rcurl")?{type:"rcurl"}:rcurl],postprocess:r=>({a:r[1],b:r[3],c:r[5]})},{name:"box",symbols:["closed_path"],postprocess:([r],C)=>r.length!==2?C:r},{name:"lseg",symbols:["path"],postprocess:([r],C)=>r.path.length!==2?C:r.path},{name:"path",symbols:["open_path"],postprocess:([r])=>({closed:!1,path:r})},{name:"path",symbols:["closed_path"],postprocess:([r])=>({closed:!0,path:r})},{name:"open_path$macrocall$2",symbols:[o.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket]},{name:"open_path$macrocall$3",symbols:[o.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket]},{name:"open_path$macrocall$1$macrocall$2",symbols:["point"]},{name:"open_path$macrocall$1$macrocall$1$ebnf$1",symbols:[]},{name:"open_path$macrocall$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"open_path$macrocall$1$macrocall$2"],postprocess:a},{name:"open_path$macrocall$1$macrocall$1$ebnf$1",symbols:["open_path$macrocall$1$macrocall$1$ebnf$1","open_path$macrocall$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:r=>r[0].concat([r[1]])},{name:"open_path$macrocall$1$macrocall$1",symbols:["open_path$macrocall$1$macrocall$2","open_path$macrocall$1$macrocall$1$ebnf$1"],postprocess:([r,C])=>[s(r),...C.map(s)||[]]},{name:"open_path$macrocall$1",symbols:["open_path$macrocall$2","open_path$macrocall$1$macrocall$1","open_path$macrocall$3"],postprocess:g(1)},{name:"open_path",symbols:["open_path$macrocall$1"],postprocess:a},{name:"closed_path$subexpression$1$macrocall$2",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen]},{name:"closed_path$subexpression$1$macrocall$3",symbols:[o.lexerAny.has("rparen")?{type:"rparen"}:rparen]},{name:"closed_path$subexpression$1$macrocall$1$macrocall$2",symbols:["point"]},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1",symbols:[]},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"closed_path$subexpression$1$macrocall$1$macrocall$2"],postprocess:a},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1",symbols:["closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1","closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:r=>r[0].concat([r[1]])},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1",symbols:["closed_path$subexpression$1$macrocall$1$macrocall$2","closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1"],postprocess:([r,C])=>[s(r),...C.map(s)||[]]},{name:"closed_path$subexpression$1$macrocall$1",symbols:["closed_path$subexpression$1$macrocall$2","closed_path$subexpression$1$macrocall$1$macrocall$1","closed_path$subexpression$1$macrocall$3"],postprocess:g(1)},{name:"closed_path$subexpression$1",symbols:["closed_path$subexpression$1$macrocall$1"],postprocess:a},{name:"closed_path$subexpression$1$macrocall$5",symbols:["point"]},{name:"closed_path$subexpression$1$macrocall$4$ebnf$1",symbols:[]},{name:"closed_path$subexpression$1$macrocall$4$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("comma")?{type:"comma"}:comma,"closed_path$subexpression$1$macrocall$5"],postprocess:a},{name:"closed_path$subexpression$1$macrocall$4$ebnf$1",symbols:["closed_path$subexpression$1$macrocall$4$ebnf$1","closed_path$subexpression$1$macrocall$4$ebnf$1$subexpression$1"],postprocess:r=>r[0].concat([r[1]])},{name:"closed_path$subexpression$1$macrocall$4",symbols:["closed_path$subexpression$1$macrocall$5","closed_path$subexpression$1$macrocall$4$ebnf$1"],postprocess:([r,C])=>[s(r),...C.map(s)||[]]},{name:"closed_path$subexpression$1",symbols:["closed_path$subexpression$1$macrocall$4"],postprocess:a},{name:"closed_path",symbols:["closed_path$subexpression$1"],postprocess:g(0)},{name:"polygon",symbols:["closed_path"],postprocess:g(0)},{name:"circle_body",symbols:["point","comma","number"],postprocess:r=>({c:r[0],r:r[2]})},{name:"circle$subexpression$1$macrocall$2",symbols:[o.lexerAny.has("lcomp")?{type:"lcomp"}:lcomp]},{name:"circle$subexpression$1$macrocall$3",symbols:[o.lexerAny.has("rcomp")?{type:"rcomp"}:rcomp]},{name:"circle$subexpression$1$macrocall$1",symbols:["circle$subexpression$1$macrocall$2","circle_body","circle$subexpression$1$macrocall$3"],postprocess:g(1)},{name:"circle$subexpression$1",symbols:["circle$subexpression$1$macrocall$1"]},{name:"circle$subexpression$1$macrocall$5",symbols:[o.lexerAny.has("lparen")?{type:"lparen"}:lparen]},{name:"circle$subexpression$1$macrocall$6",symbols:[o.lexerAny.has("rparen")?{type:"rparen"}:rparen]},{name:"circle$subexpression$1$macrocall$4",symbols:["circle$subexpression$1$macrocall$5","circle_body","circle$subexpression$1$macrocall$6"],postprocess:g(1)},{name:"circle$subexpression$1",symbols:["circle$subexpression$1$macrocall$4"]},{name:"circle$subexpression$1",symbols:["circle_body"]},{name:"circle",symbols:["circle$subexpression$1"],postprocess:s}],ParserStart:"number"};t.default=I},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.lexerAny=t.lexer=void 0;const n=i(0);t.lexer=(0,n.compile)({comma:",",space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},int:/\-?\d+(?![\.\d])/,float:/\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,lcurl:"{",rcurl:"}",lparen:"(",rparen:")",lbracket:"[",rbracket:"]",lcomp:"<",rcomp:">"}),t.lexer.next=(o=>()=>{let g;for(;(g=o.call(t.lexer))&&g.type==="space";);return g})(t.lexer.next),t.lexerAny=t.lexer},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});function n(a){return a[0]}const o=i(16),g={Lexer:o.lexerAny,ParserRules:[{name:"main$ebnf$1",symbols:["elt"]},{name:"main$ebnf$1",symbols:["main$ebnf$1","elt"],postprocess:a=>a[0].concat([a[1]])},{name:"main",symbols:["main$ebnf$1"],postprocess:([a])=>{const s=new Set;for(const I of a){const r=typeof I[1]=="number"?I[0]:"time";if(s.has(r))return"invalid";s.add(r)}return a}},{name:"elt",symbols:["time"]},{name:"elt",symbols:["num","unit"],postprocess:([[a],s])=>(s=s[0].type,[s,a])},{name:"unit",symbols:[o.lexerAny.has("years")?{type:"years"}:years]},{name:"unit",symbols:[o.lexerAny.has("months")?{type:"months"}:months]},{name:"unit",symbols:[o.lexerAny.has("days")?{type:"days"}:days]},{name:"unit",symbols:[o.lexerAny.has("hours")?{type:"hours"}:hours]},{name:"unit",symbols:[o.lexerAny.has("minutes")?{type:"minutes"}:minutes]},{name:"unit",symbols:[o.lexerAny.has("seconds")?{type:"seconds"}:seconds]},{name:"unit",symbols:[o.lexerAny.has("milliseconds")?{type:"milliseconds"}:milliseconds]},{name:"num",symbols:["int"]},{name:"num",symbols:["float"]},{name:"uint",symbols:[o.lexerAny.has("int")?{type:"int"}:int],postprocess:([a])=>parseInt(a,10)},{name:"int$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("neg")?{type:"neg"}:neg]},{name:"int$ebnf$1",symbols:["int$ebnf$1$subexpression$1"],postprocess:n},{name:"int$ebnf$1",symbols:[],postprocess:()=>null},{name:"int",symbols:["int$ebnf$1",o.lexerAny.has("int")?{type:"int"}:int],postprocess:([a,s])=>parseInt(s,10)*(a?-1:1)},{name:"float$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("neg")?{type:"neg"}:neg]},{name:"float$ebnf$1",symbols:["float$ebnf$1$subexpression$1"],postprocess:n},{name:"float$ebnf$1",symbols:[],postprocess:()=>null},{name:"float$ebnf$2",symbols:[o.lexerAny.has("int")?{type:"int"}:int],postprocess:n},{name:"float$ebnf$2",symbols:[],postprocess:()=>null},{name:"float",symbols:["float$ebnf$1","float$ebnf$2",o.lexerAny.has("dot")?{type:"dot"}:dot,o.lexerAny.has("int")?{type:"int"}:int],postprocess:([a,...s])=>parseFloat(s.map(I=>I?I.text:"0").join(""))*(a?-1:1)},{name:"time$ebnf$1$subexpression$1",symbols:[o.lexerAny.has("colon")?{type:"colon"}:colon,"uint"]},{name:"time$ebnf$1",symbols:["time$ebnf$1$subexpression$1"],postprocess:n},{name:"time$ebnf$1",symbols:[],postprocess:()=>null},{name:"time$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("dot")?{type:"dot"}:dot,o.lexerAny.has("int")?{type:"int"}:int]},{name:"time$ebnf$2",symbols:["time$ebnf$2$subexpression$1"],postprocess:n},{name:"time$ebnf$2",symbols:[],postprocess:()=>null},{name:"time",symbols:["uint",o.lexerAny.has("colon")?{type:"colon"}:colon,"uint","time$ebnf$1","time$ebnf$2"],postprocess:([a,s,I,r,C])=>{r=r&&r[1],C=C&&C[1];const l=typeof r=="number"?[["hours",a],["minutes",I],["seconds",r]]:[["minutes",a],["seconds",I]];return C&&l.push(["milliseconds",parseFloat("0."+C)*1e3]),l}}],ParserStart:"main"};t.default=g},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.lexerAny=t.lexer=void 0;const n=i(0);t.lexer=(0,n.compile)({int:/\d+/,neg:"-",dot:".",years:/(?:y|yrs?|years?)\b/,months:/(?:mon(?:th)?s?)\b/,days:/(?:d|days?)\b/,hours:/(?:h|hrs?|hours?)\b/,minutes:/(?:m|mins?|minutes?)\b/,seconds:/(?:s|secs?|seconds?)\b/,milliseconds:/(?:ms|milliseconds?)\b/,space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},colon:":"}),t.lexer.next=(o=>()=>{let g;for(;(g=o.call(t.lexer))&&g.type==="space";);return g})(t.lexer.next),t.lexerAny=t.lexer},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});function n(a){return a[0]}const o=i(18),g={Lexer:o.lexerAny,ParserRules:[{name:"num",symbols:[o.lexerAny.has("int")?{type:"int"}:int]},{name:"num",symbols:[o.lexerAny.has("float")?{type:"float"}:float]},{name:"main$ebnf$1",symbols:[]},{name:"main$ebnf$1",symbols:["main$ebnf$1","long"],postprocess:a=>a[0].concat([a[1]])},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["short"]},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["main$ebnf$2$subexpression$1$ebnf$1","short"],postprocess:a=>a[0].concat([a[1]])},{name:"main$ebnf$2$subexpression$1",symbols:[o.lexerAny.has("T")?{type:"T"}:T,"main$ebnf$2$subexpression$1$ebnf$1"]},{name:"main$ebnf$2",symbols:["main$ebnf$2$subexpression$1"],postprocess:n},{name:"main$ebnf$2",symbols:[],postprocess:()=>null},{name:"main",symbols:[o.lexerAny.has("P")?{type:"P"}:P,"main$ebnf$1","main$ebnf$2"],postprocess:([a,s,I],r)=>(I=I?I[1]:[],!s.length&&!I.length?r:s.length?I.length?[...s,...I]:s:I)},{name:"long$subexpression$1",symbols:[o.lexerAny.has("Y")?{type:"Y"}:Y]},{name:"long$subexpression$1",symbols:[o.lexerAny.has("M")?{type:"M"}:M]},{name:"long$subexpression$1",symbols:[o.lexerAny.has("W")?{type:"W"}:W]},{name:"long$subexpression$1",symbols:[o.lexerAny.has("D")?{type:"D"}:D]},{name:"long",symbols:["num","long$subexpression$1"],postprocess:([a,s])=>{switch(a=parseFloat(a[0].value),s=s[0].type,s){case"Y":return["years",a];case"M":return["months",a];case"W":return["days",a*7];case"D":return["days",a];default:throw new Error("Unexpected unit "+s)}}},{name:"short$ebnf$1",symbols:[o.lexerAny.has("T")?{type:"T"}:T],postprocess:n},{name:"short$ebnf$1",symbols:[],postprocess:()=>null},{name:"short$subexpression$1",symbols:[o.lexerAny.has("H")?{type:"H"}:H]},{name:"short$subexpression$1",symbols:[o.lexerAny.has("M")?{type:"M"}:M]},{name:"short$subexpression$1",symbols:[o.lexerAny.has("S")?{type:"S"}:S]},{name:"short",symbols:["short$ebnf$1","num","short$subexpression$1"],postprocess:([a,s,I])=>{switch(s=parseFloat(s[0].value),I=I[0].type,I){case"H":return["hours",s];case"M":return["minutes",s];case"S":return["seconds",s];default:throw new Error("Unexpected unit "+I)}}}],ParserStart:"num"};t.default=g},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.lexerAny=t.lexer=void 0;const n=i(0);t.lexer=(0,n.compile)({int:/\-?\d+(?![\.\d])/,float:/\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,P:"P",Y:"Y",M:"M",W:"W",D:"D",H:"H",S:"S",T:"T"}),t.lexerAny=t.lexer},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.toSql=void 0;const n=i(2),o=i(5),g=i(6),a=i(20),s=i(3),I=new Set(s.sqlKeywords.map(k=>k.toLowerCase()));let r=[];function C(k){return l(k.name)}function l(k,h){if(!h){const N=k.toLowerCase();if(N===k&&!I.has(N)&&/^[a-z][a-z0-9_]*$/.test(N))return k}return'"'+k+'"'}function c(k,h,N){N&&r.push("(");let v=!0;for(const K of k)v||r.push(", "),v=!1,h(K);N&&r.push(")")}function B(k,h){switch(k.type){case"foreign key":r.push(" foreign key (",...k.localColumns.map(C).join(", "),")");case"reference":r.push(" REFERENCES "),h.tableRef(k.foreignTable),r.push("(",...k.foreignColumns.map(C).join(", "),") "),k.match&&r.push(" MATCH ",k.match.toUpperCase()),k.onDelete&&r.push(" ON DELETE ",k.onDelete),k.onUpdate&&r.push(" ON UPDATE ",k.onUpdate);break;case"primary key":case"unique":r.push(" ",k.type," "),"columns"in k&&r.push("(",...k.columns.map(C).join(", "),") ");break;case"check":r.push(" check "),h.expr(k.expr);break;case"not null":case"null":r.push(" ",k.type," ");break;case"default":r.push(" default "),h.expr(k.default);break;case"add generated":r.push(" GENERATED "),w(h,k);break;default:throw g.NotSupported.never(k)}r.push(" ")}function E(k,h){k.schema&&r.push(l(k.schema),"."),r.push(l(k.name,h)," ")}function u(k){E(k),k.alias&&r.push(" AS ",l(k.alias)," ")}function d(k,h){r.push(" ORDER BY "),c(h,N=>{k.expr(N.by),N.order&&r.push(" ",N.order," "),N.nulls&&r.push(" NULLS ",N.nulls," ")},!1)}function f(k){switch(k.type){case"default":r.push("DEFAULT ");break;case"identifier":r.push(k.name);break;case"list":let h=!0;for(const N of k.values)h||r.push(", "),h=!1,f(N);break;case"value":r.push(typeof k.value=="number"?k.value.toString():(0,a.literal)(k.value));break;default:throw g.NotSupported.never(k)}}function w(k,h){h.always&&r.push(h.always.toUpperCase()," "),r.push("AS IDENTITY "),h.sequence&&(r.push("("),h.sequence.name&&(r.push("SEQUENCE NAME "),E(h.sequence.name),r.push(" ")),y(k,h.sequence),r.push(") "))}function y(k,h){h.as&&(r.push("AS "),k.dataType(h.as),r.push(" ")),typeof h.incrementBy=="number"&&r.push("INCREMENT BY ",h.incrementBy.toString()," "),h.minValue==="no minvalue"&&r.push("NO MINVALUE "),typeof h.minValue=="number"&&r.push("MINVALUE ",h.minValue.toString()," "),h.maxValue==="no maxvalue"&&r.push("NO MAXVALUE "),typeof h.maxValue=="number"&&r.push("MAXVALUE ",h.maxValue.toString()," "),typeof h.startWith=="number"&&r.push("START WITH ",h.startWith.toString()," "),typeof h.cache=="number"&&r.push("CACHE ",h.cache.toString()," "),h.cycle&&r.push(h.cycle," "),h.ownedBy==="none"?r.push("OWNED BY NONE "):h.ownedBy&&(r.push("OWNED BY "),G(h.ownedBy)),"restart"in h&&(h.restart===!0?r.push("RESTART "):h.restart&&r.push("RESTART WITH ",h.restart.toString()," "))}function G(k){k.schema&&r.push(l(k.schema),"."),r.push(l(k.table),".",l(k.column)," ")}function R(k,h,N){if(!h){N();return}r.push(h.type," "),N(),h.on&&(r.push("ON "),k.expr(h.on)),h.using&&(r.push("USING ("),c(h.using,v=>r.push(C(v)),!1),r.push(") ")),r.push(" ")}function x(k){k.opSchema?r.push(" operator(",l(k.opSchema),".",k.op,") "):r.push(" ",k.op," ")}const F=(0,o.astVisitor)(k=>({addColumn:(...h)=>{r.push(" ADD COLUMN "),h[0].ifNotExists&&r.push("IF NOT EXISTS "),k.super().addColumn(...h)},createExtension:h=>{r.push("CREATE EXTENSION "),h.ifNotExists&&r.push(" IF NOT EXISTS "),r.push(C(h.extension)),!(!h.from&&!h.version&&!h.schema)&&(r.push(" WITH"),h.schema&&r.push(" SCHEMA ",C(h.schema)),h.version&&r.push(" VERSION ",(0,a.literal)(h.version.value)),h.from&&r.push(" FROM ",(0,a.literal)(h.from.value)))},tablespace:h=>{r.push("TABLESPACE ",C(h.tablespace))},addConstraint:h=>{r.push(" ADD ");const N=h.constraint.constraintName;N&&r.push(" CONSTRAINT ",C(N)," "),B(h.constraint,k)},alterColumn:(h,N)=>{r.push(" ALTER COLUMN ",C(h.column)," "),k.super().alterColumn(h,N)},setColumnDefault:(h,N,v)=>{if(r.push(" SET DEFAULT "),k.expr(h.default),h.updateExisting)throw new Error("Not implemented: updateExisting on set column default")},createEnum:h=>{r.push("CREATE TYPE "),E(h.name),r.push(" AS ENUM "),c(h.values,N=>r.push((0,a.literal)(N.value)),!0),r.push(" ")},createCompositeType:h=>{r.push("CREATE TYPE "),E(h.name),r.push(" AS "),c(h.attributes,N=>{r.push(C(N.name)," "),k.dataType(N.dataType),N.collate&&(r.push("COLLATE "),E(N.collate))},!0),r.push(" ")},setTableOwner:h=>{r.push(" OWNER TO ",C(h.to))},alterColumnSimple:h=>r.push(h.type),alterColumnAddGenerated:h=>{r.push(" ADD GENERATED "),w(k,h)},setColumnType:h=>{r.push(" SET DATA TYPE "),k.dataType(h.dataType),r.push(" ")},alterTable:h=>{r.push("ALTER TABLE "),h.ifExists&&r.push(" IF EXISTS "),h.only&&r.push(" ONLY "),u(h.table),c(h.changes,N=>k.tableAlteration(N,h.table),!1)},alterIndex:h=>{switch(r.push("ALTER INDEX "),h.ifExists&&r.push(" IF EXISTS "),u(h.index),h.change.type){case"rename":r.push(" RENAME TO "),E(h.change.to),r.push(" ");break;case"set tablespace":r.push(" SET TABLESPACE "),E(h.change.tablespace),r.push(" ");break;default:throw g.NotSupported.never(h.change,"Alter index type not supported: ")}},tableAlteration:(h,N)=>{switch(h.type){case"add column":return k.addColumn(h,N);case"add constraint":return k.addConstraint(h,N);case"alter column":return k.alterColumn(h,N);case"rename":return k.renameTable(h,N);case"rename column":return k.renameColumn(h,N);case"rename constraint":return k.renameConstraint(h,N);case"drop column":return k.dropColumn(h,N);case"drop constraint":return k.dropConstraint(h,N);case"owner":return k.setTableOwner(h,N);default:throw g.NotSupported.never(h)}},array:h=>{r.push(h.type==="array"?"ARRAY[":"("),c(h.expressions,N=>k.expr(N),!1),r.push(h.type==="array"?"]":")")},arrayIndex:h=>{k.expr(h.array),r.push("["),k.expr(h.index),r.push("] ")},expr:h=>{if(h.type==="ref"){k.ref(h);return}if(h.type==="list"){k.super().expr(h);return}r.push("("),k.super().expr(h),r.push(")")},callOverlay:h=>{r.push("OVERLAY("),k.expr(h.value),r.push(" PLACING "),k.expr(h.placing),r.push(" FROM "),k.expr(h.from),h.for&&(r.push(" FOR "),k.expr(h.for)),r.push(")")},callSubstring:h=>{r.push("SUBSTRING("),k.expr(h.value),h.from&&(r.push(" FROM "),k.expr(h.from)),h.for&&(r.push(" FOR "),k.expr(h.for)),r.push(")")},binary:h=>{k.expr(h.left),x(h),k.expr(h.right)},call:h=>{E(h.function),r.push("("),h.distinct&&r.push(h.distinct," "),c(h.args,N=>k.expr(N),!1),h.orderBy&&d(k,h.orderBy),r.push(") "),h.filter&&(r.push("filter (where "),k.expr(h.filter),r.push(") ")),h.over&&(r.push("over ("),h.over.partitionBy&&(r.push("PARTITION BY "),c(h.over.partitionBy,N=>k.expr(N),!1),r.push(" ")),h.over.orderBy&&(d(k,h.over.orderBy),r.push(" ")),r.push(") "))},case:h=>{r.push("CASE "),h.value&&k.expr(h.value);for(const N of h.whens)r.push(" WHEN "),k.expr(N.when),r.push(" THEN "),k.expr(N.value);h.else&&(r.push(" ELSE "),k.expr(h.else)),r.push(" END ")},cast:h=>{k.expr(h.operand),r.push("::"),k.dataType(h.to)},constant:h=>{switch(h.type){case"boolean":r.push(h.value?"true":"false");break;case"integer":r.push(h.value.toString(10));break;case"numeric":r.push(h.value.toString()),Number.isInteger(h.value)&&r.push(".");break;case"null":r.push("null");break;case"constant":break;case"string":r.push((0,a.literal)(h.value));break;default:throw g.NotSupported.never(h)}},valueKeyword:h=>{r.push(h.keyword," ")},comment:h=>{switch(r.push("COMMENT ON ",h.on.type.toUpperCase()," "),h.on.type){case"column":G(h.on.column);break;default:E(h.on.name);break}r.push(" IS ",(0,a.literal)(h.comment)," ")},extract:h=>{r.push("EXTRACT (",h.field.name.toUpperCase()," FROM "),k.expr(h.from),r.push(") ")},createColumn:h=>{var N;r.push(C(h.name)," "),k.dataType(h.dataType),r.push(" "),h.collate&&(r.push("COLLATE "),E(h.collate));for(const v of(N=h.constraints)!==null&&N!==void 0?N:[])k.constraint(v)},begin:h=>{r.push("BEGIN "),h.isolationLevel&&r.push("ISOLATION LEVEL ",h.isolationLevel.toUpperCase()," "),h.writeable&&r.push(h.writeable.toUpperCase()," "),typeof h.deferrable=="boolean"&&(h.deferrable||r.push("NOT "),r.push("DEFERRABLE "))},alterSequence:h=>{switch(r.push("ALTER SEQUENCE "),h.ifExists&&r.push("IF EXISTS "),E(h.name),h.change.type){case"set options":y(k,h.change);break;case"rename":r.push("RENAME TO ",C(h.change.newName)," ");break;case"set schema":r.push("SET SCHEMA ",C(h.change.newSchema)," ");break;case"owner to":h.change.owner,r.push("OWNER TO ",C(h.change.owner)," ");break;default:throw g.NotSupported.never(h.change)}},createSequence:h=>{r.push("CREATE "),h.temp&&r.push("TEMPORARY "),r.push("SEQUENCE "),h.ifNotExists&&r.push("IF NOT EXISTS "),E(h.name),y(k,h.options)},drop:h=>{r.push(h.type.toUpperCase()," "),h.concurrently&&r.push("CONCURRENTLY "),h.ifExists&&r.push("IF EXISTS "),c(h.names,N=>k.tableRef(N),!1),h.cascade&&r.push(h.cascade.toUpperCase()," ")},constraint:h=>{h.constraintName&&r.push(" CONSTRAINT ",C(h.constraintName)," "),B(h,k)},do:h=>{r.push("DO"),h.language&&r.push(" LANGUAGE ",h.language.name),r.push(" $$",h.code,"$$")},createFunction:h=>{var N;if(r.push(h.orReplace?"CREATE OR REPLACE FUNCTION ":"CREATE FUNCTION "),E(h.name),c(h.arguments,v=>{v.mode&&r.push(v.mode," "),v.name&&r.push(C(v.name)," "),k.dataType(v.type),v.default&&(r.push(" = "),k.expr(v.default))},!0),h.returns)switch(h.returns.kind){case"table":r.push(" RETURNS TABLE "),c(h.returns.columns,v=>{r.push(C(v.name)," "),k.dataType(v.type)},!0);break;case void 0:case null:case"array":r.push(" RETURNS "),k.dataType(h.returns);break;default:throw g.NotSupported.never(h.returns)}switch(r.push(" AS $$",(N=h.code)!==null&&N!==void 0?N:"","$$"),h.language&&r.push("LANGUAGE ",h.language.name," "),h.purity&&r.push(h.purity.toUpperCase()," "),typeof h.leakproof=="boolean"&&r.push(h.leakproof?"LEAKPROOF ":"NOT LEAKPROOF "),h.onNullInput){case"call":r.push("CALLED ON NULL INPUT ");break;case"null":r.push("RETURNS NULL ON NULL INPUT ");break;case"strict":r.push("STRICT ");break;case null:case void 0:break;default:throw g.NotSupported.never(h.onNullInput)}},dropFunction:h=>{r.push("DROP FUNCTION "),h.ifExists&&r.push("IF EXISTS "),E(h.name),h.arguments&&c(h.arguments,N=>{N.name&&(E(N.name),r.push(" ")),k.dataType(N.type)},!0),r.push(" ")},with:h=>{r.push("WITH "),c(h.bind,N=>{r.push(C(N.alias)," AS ("),k.statement(N.statement),r.push(") ")},!1),k.statement(h.in)},withRecursive:h=>{r.push("WITH RECURSIVE ",C(h.alias),"(",...h.columnNames.map(C).join(", "),") AS ("),k.union(h.bind),r.push(") "),k.statement(h.in)},setGlobal:h=>{r.push("SET ",C(h.variable)," = "),f(h.set)},setTimezone:h=>{switch(r.push("SET TIME ZONE "),h.to.type){case"default":case"local":r.push(h.to.type.toUpperCase()," ");break;case"value":r.push(typeof h.to.value=="string"?(0,a.literal)(h.to.value):h.to.value.toString(10));break;case"interval":r.push("INTERVAL ",(0,a.literal)(h.to.value)," HOUR TO MINUTE");break;default:throw g.NotSupported.never(h.to)}},setNames:h=>{switch(r.push("SET NAMES "),h.to.type){case"value":r.push((0,a.literal)(h.to.value));break}},dataType:h=>{var N,v;if((h==null?void 0:h.kind)==="array"){k.dataType(h.arrayOf),r.push("[]");return}if(!(h!=null&&h.name)){r.push("unkown");return}let K=!0;if(h.schema)E(h,h.doubleQuoted);else if(h.doubleQuoted)E(h,!0);else switch(h.name){case"double precision":case"character varying":case"bit varying":r.push(h.name," ");break;case"time without time zone":case"timestamp without time zone":case"time with time zone":case"timestamp with time zone":const U=h.name.split(" ");r.push(U.shift()),!((N=h.config)===null||N===void 0)&&N.length&&c(h.config,V=>r.push(V.toString(10)),!0),r.push(" "),r.push(U.join(" ")," "),K=!1;break;default:E(h);break}K&&(!((v=h.config)===null||v===void 0)&&v.length)&&c(h.config,U=>r.push(U.toString(10)),!0)},createIndex:h=>{r.push(h.unique?"CREATE UNIQUE INDEX ":"CREATE INDEX "),h.ifNotExists&&r.push(" IF NOT EXISTS "),h.indexName&&r.push(C(h.indexName)," "),r.push("ON "),k.tableRef(h.table),h.using&&r.push("USING ",C(h.using)," "),c(h.expressions,N=>{k.expr(N.expression),r.push(" "),N.collate&&(r.push("COLLATE "),E(N.collate)),N.opclass&&E(N.opclass),N.order&&r.push(N.order," "),N.nulls&&r.push("nulls ",N.nulls," ")},!0),h.with&&(r.push("WITH "),c(h.with,N=>{r.push(N.parameter," = ",(0,a.literal)(N.value))},!0)),h.tablespace&&r.push("TABLESPACE ",l(h.tablespace)),h.where&&(r.push(" WHERE "),k.expr(h.where)),r.push(" ")},createTable:h=>{var N;r.push("CREATE "),h.locality&&r.push(h.locality.toUpperCase()," "),h.temporary&&r.push("TEMPORARY "),h.unlogged&&r.push("UNLOGGED "),r.push(h.ifNotExists?"TABLE IF NOT EXISTS ":"TABLE "),k.tableRef(h.name),r.push("("),c(h.columns,v=>{switch(v.kind){case"column":return k.createColumn(v);case"like table":return k.likeTable(v);default:throw g.NotSupported.never(v)}},!1),h.constraints&&(r.push(", "),c(h.constraints,v=>{const K=v.constraintName;K&&r.push("CONSTRAINT ",C(K)," "),B(v,k)},!1)),r.push(") "),!((N=h.inherits)===null||N===void 0)&&N.length&&(r.push(" INHERITS "),c(h.inherits,v=>E(v),!0))},likeTable:h=>{r.push(" LIKE "),k.tableRef(h.like),r.push(" ");for(const{verb:N,option:v}of h.options)r.push(N.toUpperCase()," ",v.toUpperCase()," ")},createSchema:h=>{r.push(h.ifNotExists?"CREATE SCHEMA IF NOT EXISTS ":"CREATE SCHEMA "),r.push(C(h.name))},truncateTable:h=>{r.push("TRUNCATE TABLE ");let N=!0;for(const v of h.tables)N||r.push(", "),N=!1,k.tableRef(v);if(h.identity)switch(h.identity){case"restart":r.push(" RESTART IDENTITY ");break;case"continue":r.push(" CONTINUE IDENTITY ");break}h.cascade&&r.push(" ",h.cascade," ")},delete:h=>{r.push("DELETE FROM "),k.tableRef(h.from),h.where&&(r.push(" WHERE "),k.expr(h.where)),h.returning&&(r.push(" RETURNING "),c(h.returning,N=>k.selectionColumn(N),!1)),r.push(" ")},dropColumn:h=>{r.push(" DROP COLUMN "),h.ifExists&&r.push(" IF EXISTS "),r.push(C(h.column)),h.behaviour&&r.push(" ",h.behaviour),r.push(" ")},dropConstraint:h=>{r.push(" DROP CONSTRAINT "),h.ifExists&&r.push(" IF EXISTS "),r.push(C(h.constraint)),h.behaviour&&r.push(" ",h.behaviour.toUpperCase()," ")},from:h=>k.super().from(h),fromCall:h=>{R(k,h.join,()=>{var N,v;if(k.call(h),h.withOrdinality&&r.push(" WITH ORDINALITY"),h.alias){r.push(" AS ",C(h.alias)," ");const K=(v=(N=h.alias.columns)===null||N===void 0?void 0:N.length)!==null&&v!==void 0?v:0;if(K>0){r.push("(");for(let U=0;U<K;++U)U!==0&&r.push(", "),r.push(C(h.alias.columns[U]));r.push(")")}}}),r.push(" ")},fromStatement:h=>{R(k,h.join,()=>{r.push("("),k.select(h.statement),r.push(") "),h.alias&&(r.push(" AS ",l(h.alias)),h.columnNames&&c(h.columnNames,N=>r.push(C(N)),!0),r.push(" "))}),r.push(" ")},values:h=>{r.push("VALUES "),c(h.values,N=>{c(N,v=>{k.expr(v)},!0)},!1)},fromTable:h=>{R(k,h.join,()=>{if(k.tableRef(h.name),h.name.columnNames){if(!h.name.alias)throw new Error("Cannot specify aliased column names without an alias");c(h.name.columnNames,N=>r.push(C(N)),!0)}})},join:h=>{throw new Error("Should not happen 💀")},insert:h=>{if(r.push("INSERT INTO "),k.tableRef(h.into),h.columns&&r.push("(",h.columns.map(C).join(", "),")"),r.push(" "),h.overriding&&r.push("OVERRIDING ",h.overriding.toUpperCase()," VALUE "),k.select(h.insert),r.push(" "),h.onConflict){r.push("ON CONFLICT ");const N=h.onConflict.on;switch(N==null?void 0:N.type){case"on expr":c(N.exprs,v=>k.expr(v),!0);break;case"on constraint":r.push("ON CONSTRAINT "),E(N.constraint);case null:case void 0:break;default:throw g.NotSupported.never(N)}h.onConflict.do==="do nothing"?r.push(" DO NOTHING"):(r.push(" DO UPDATE SET "),c(h.onConflict.do.sets,v=>k.set(v),!1),h.onConflict.where&&(r.push(" WHERE "),k.expr(h.onConflict.where))),r.push(" ")}h.returning&&(r.push(" RETURNING "),c(h.returning,N=>k.selectionColumn(N),!1))},raise:h=>{var N,v;r.push("RAISE "),h.level&&r.push(h.level.toUpperCase()," "),r.push((0,a.literal)(h.format)," "),!((N=h.formatExprs)===null||N===void 0)&&N.length&&(r.push(", "),c(h.formatExprs,K=>k.expr(K),!1)),!((v=h.using)===null||v===void 0)&&v.length&&(r.push(" USING "),c(h.using,({type:K,value:U})=>{r.push(K.toUpperCase(),"="),k.expr(U)},!1)),r.push(" ")},default:()=>{r.push(" DEFAULT ")},member:h=>{k.expr(h.operand),r.push(h.op),r.push(typeof h.member=="number"?h.member.toString(10):(0,a.literal)(h.member))},ref:h=>{h.table&&(E(h.table),r.push(".")),r.push(h.name==="*"?"*":l(h.name))},parameter:h=>{r.push(h.name)},renameColumn:h=>{r.push(" RENAME COLUMN ",C(h.column)," TO ",C(h.to))},renameConstraint:h=>{r.push(" RENAME CONSTRAINT ",C(h.constraint)," TO ",C(h.to))},renameTable:h=>{r.push(" RENAME TO ",C(h.to))},createView:h=>{r.push("CREATE "),h.orReplace&&r.push("OR REPLACE "),h.temp&&r.push("TEMP "),h.recursive&&r.push("RECURSIVE "),r.push("VIEW "),k.tableRef(h.name),h.columnNames&&c(h.columnNames,v=>r.push(C(v)),!0);const N=h.parameters&&Object.entries(h.parameters);N!=null&&N.length&&(r.push(" WITH "),c(N,([v,K])=>r.push(v,"=",K),!1)),r.push(" AS "),k.select(h.query),h.checkOption&&r.push(" WITH ",h.checkOption.toUpperCase()," CHECK OPTION")},createMaterializedView:h=>{r.push("CREATE MATERIALIZED VIEW "),h.ifNotExists&&r.push("IF NOT EXISTS "),k.tableRef(h.name),h.columnNames&&c(h.columnNames,v=>r.push(C(v)),!0);const N=h.parameters&&Object.entries(h.parameters);N!=null&&N.length&&(r.push(" WITH "),c(N,([v,K])=>r.push(v,"=",K),!1)),h.tablespace&&r.push(" TABLESPACE ",C(h.tablespace)),r.push(" AS "),k.select(h.query),typeof h.withData=="boolean"&&r.push(h.withData?" WITH DATA":" WITH NO DATA")},refreshMaterializedView:h=>{r.push("REFRESH MATERIALIZED VIEW "),h.concurrently&&r.push("CONCURRENTLY "),k.tableRef(h.name),typeof h.withData=="boolean"&&r.push(h.withData?" WITH DATA":" WITH NO DATA")},select:h=>k.super().select(h),selection:h=>{if(r.push("SELECT "),h.distinct&&(typeof h.distinct=="string"?r.push(h.distinct.toUpperCase()):(r.push(" DISTINCT ON "),c(h.distinct,N=>k.expr(N),!0)),r.push(" ")),h.columns&&c(h.columns,N=>k.selectionColumn(N),!1),r.push(" "),h.from){r.push("FROM ");const N=h.from.length;for(let v=0;v<N;v++){const K=h.from[v];v>0&&!K.join&&r.push(","),k.from(K)}r.push(" ")}h.where&&(r.push("WHERE "),k.expr(h.where),r.push(" ")),h.groupBy&&(r.push("GROUP BY "),c(h.groupBy,N=>k.expr(N),!1),r.push(" "),h.having&&(r.push(" HAVING "),k.expr(h.having),r.push(" "))),h.orderBy&&(d(k,h.orderBy),r.push(" ")),h.limit&&(h.limit.offset&&(r.push("OFFSET "),k.expr(h.limit.offset)),h.limit.limit&&(r.push("LIMIT "),k.expr(h.limit.limit))),h.for&&(r.push("FOR ",h.for.type.toUpperCase()),h.skip&&r.push(" ",h.skip.type.toUpperCase()))},show:h=>{r.push("SHOW ",C(h.variable))},prepare:h=>{var N;r.push("PREPARE ",C(h.name)),!((N=h.args)===null||N===void 0)&&N.length&&c(h.args,v=>k.dataType(v),!0),r.push(" AS "),k.statement(h.statement)},deallocate:h=>{if(r.push("DEALLOCATE "),"name"in h.target){r.push(h.target.name);return}r.push("ALL")},arraySelect:h=>{r.push("array("),k.select(h.select),r.push(")")},union:h=>{r.push("("),k.statement(h.left),r.push(") ",h.type.toUpperCase()," "),h.right.type==="union"||h.right.type==="union all"?k.union(h.right):(r.push("("),k.statement(h.right),r.push(")"))},selectionColumn:h=>{k.expr(h.expr),h.alias&&r.push(" AS ",C(h.alias)),r.push(" ")},set:h=>{r.push(C(h.column)," = "),k.expr(h.value),r.push(" ")},statement:h=>k.super().statement(h),tableRef:h=>{E(h),h.alias&&r.push(" AS ",l(h.alias)),r.push(" ")},ternary:h=>{k.expr(h.value),r.push(" ",h.op," "),k.expr(h.lo),r.push(" AND "),k.expr(h.hi),r.push(" ")},transaction:h=>{r.push(h.type)},unary:h=>{switch(h.op){case"+":case"-":x(h),k.expr(h.operand);break;case"NOT":r.push(h.op),r.push(" "),k.expr(h.operand);break;default:k.expr(h.operand),r.push(" "),r.push(h.op)}},update:h=>{r.push("UPDATE "),k.tableRef(h.table),r.push(" SET "),c(h.sets,N=>k.set(N),!1),r.push(" "),h.from&&(r.push("FROM "),k.from(h.from),r.push(" ")),h.where&&(r.push("WHERE "),k.expr(h.where),r.push(" ")),h.returning&&(r.push(" RETURNING "),c(h.returning,N=>k.selectionColumn(N),!1),r.push(" "))}}));t.toSql={};const Q=n.AstDefaultMapper.prototype;for(const k of Object.getOwnPropertyNames(Q)){const h=Q[k];k==="constructor"||k==="super"||typeof h!="function"||(t.toSql[k]=function(...N){try{return F[k].apply(F,N),r.join("").trim()}finally{r=[]}})}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.literal=void 0;function n(o){if(o==null)return"NULL";if(Array.isArray(o)){var g=o.map(n);return"("+g.join(", ")+")"}var a=~o.indexOf("\\"),s=a?"E":"";return o=o.replace(/'/g,"''"),o=o.replace(/\\/g,"\\\\"),s+"'"+o+"'"}t.literal=n},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.locationOf=void 0;function n(o){const g=o._location;if(!g)throw new Error("This statement has not been parsed using location tracking (which has a small performance hit). ");return g}t.locationOf=n}]))})(KZ);function KfA(A){return KZ.parse(A,"expr")}const XBi=new Set(["any_value","arg_max","max_by","arg_min","argMin","min_by","avg","mean","bit_and","bit_or","bit_xor","bitstring_agg","bool_and","bool_or","count","favg","first","arbitrary","fsum","kahan_sum","geomean","geometric_mean","histogram","last","list","array_agg","max","min","product","string_agg","group_concat","listagg","sum","approx_count_distinct","approx_quantile","reservoir_quantile","corr","covar_pop","covar_samp","entropy","kurtosis","mad","median","mode","quantile_cont","quantile_disc","quantile","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","skewness","stddev_pop","stddev_samp","stddev","var_pop","var_samp","variance"]);function zBi(A,e){const t=new Map;e.forEach(n=>{t.set(n.name??n.fid,n)});const i=n=>{switch(n.type){case"integer":case"numeric":return["quantitative",!1];case"null":case"string":case"boolean":return["nominal",!1];case"unary":const[o,g]=i(n.operand);switch(n.op){case"+":case"-":return["quantitative",g];default:return["nominal",g]}case"ref":{const a=t.get(n.name);return a?[a.semanticType,!1]:["nominal",!1]}case"case":return n.else?i(n.else):i(n.whens[0].value);case"array":case"list":return n.expressions.length?i(n.expressions[0]):["nominal",!1];case"binary":return i(n.left);case"call":{if(n.function.name==="count")return["quantitative",!0];const[a]=i(n.args[0]);return[a,XBi.has(n.function.name.toLowerCase())]}case"cast":{const[a,s]=i(n.operand);if("name"in n.to)switch(n.to.name.toLowerCase()){case"date":case"timestamp":case"timestamp with time zone":case"time":case"time with time zone":case"interval":return["temporal",s];case"smallint":case"integer":case"bigint":case"decimal":case"numeric":case"real":case"double precision":case"smallserial":case"serial":case"bigserial":return["quantitative",s]}return["nominal",s]}default:return["nominal",!1]}};return i(A)}function TBi(A){const e=new Set,t=i=>{i.type==="ref"?e.add(i.name):Object.values(i).forEach(n=>{n!==null&&typeof n=="object"&&"type"in n&&t(n)})};return t(KfA(A)),Array.from(e)}function Nhe(A,e){const t=new Map;e.forEach(o=>{t.set((o.name??o.fid).toLowerCase(),o)});const i=KfA(A),n=KZ.astMapper(()=>({ref:o=>{var g;return KZ.assignChanged(o,{name:((g=t.get(o.name.toLowerCase()))==null?void 0:g.fid)||o.name})}}));return KZ.toSql.expr(n.expr(i))}function fB(A){for(var e=arguments.length,t=Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];throw Error("[Immer] minified error nr: "+A+(t.length?" "+t.map(function(n){return"'"+n+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function QR(A){return!!A&&!!A[iC]}function aD(A){var e;return!!A&&(function(t){if(!t||typeof t!="object")return!1;var i=Object.getPrototypeOf(t);if(i===null)return!0;var n=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return n===Object||typeof n=="function"&&Function.toString.call(n)===eQi}(A)||Array.isArray(A)||!!A[Zhe]||!!(!((e=A.constructor)===null||e===void 0)&&e[Zhe])||VfA(A)||XfA(A))}function UZ(A,e,t){t===void 0&&(t=!1),ER(A)===0?(t?Object.keys:iyA)(A).forEach(function(i){t&&typeof i=="symbol"||e(i,A[i],A)}):A.forEach(function(i,n){return e(n,i,A)})}function ER(A){var e=A[iC];return e?e.i>3?e.i-4:e.i:Array.isArray(A)?1:VfA(A)?2:XfA(A)?3:0}function UfA(A,e){return ER(A)===2?A.has(e):Object.prototype.hasOwnProperty.call(A,e)}function _Bi(A,e){return ER(A)===2?A.get(e):A[e]}function Yhe(A,e,t){var i=ER(A);i===2?A.set(e,t):i===3?A.add(t):A[e]=t}function OBi(A,e){return A===e?A!==0||1/A==1/e:A!=A&&e!=e}function VfA(A){return $Bi&&A instanceof Map}function XfA(A){return AQi&&A instanceof Set}function sD(A){return A.o||A.t}function zfA(A){if(Array.isArray(A))return Array.prototype.slice.call(A);var e=tQi(A);delete e[iC];for(var t=iyA(e),i=0;i<t.length;i++){var n=t[i],o=e[n];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[n]={configurable:!0,writable:!0,enumerable:o.enumerable,value:A[n]})}return Object.create(Object.getPrototypeOf(A),e)}function TfA(A,e){return e===void 0&&(e=!1),_fA(A)||QR(A)||!aD(A)||(ER(A)>1&&(A.set=A.add=A.clear=A.delete=qBi),Object.freeze(A),e&&UZ(A,function(t,i){return TfA(i,!0)},!0)),A}function qBi(){fB(2)}function _fA(A){return A==null||typeof A!="object"||Object.isFrozen(A)}function UE(A){var e=iQi[A];return e||fB(18,A),e}function Rhe(){return VZ}function OfA(A,e){e&&(UE("Patches"),A.u=[],A.s=[],A.v=e)}function f8(A){qfA(A),A.p.forEach(jBi),A.p=null}function qfA(A){A===VZ&&(VZ=A.l)}function xhe(A){return VZ={p:[],l:VZ,h:A,m:!0,_:0}}function jBi(A){var e=A[iC];e.i===0||e.i===1?e.j():e.g=!0}function jfA(A,e){e._=e.p.length;var t=e.p[0],i=A!==void 0&&A!==t;return e.h.O||UE("ES5").S(e,A,i),i?(t[iC].P&&(f8(e),fB(4)),aD(A)&&(A=y8(e,A),e.l||b8(e,A)),e.u&&UE("Patches").M(t[iC].t,A,e.u,e.s)):A=y8(e,t,[]),f8(e),e.u&&e.v(e.u,e.s),A!==Hhe?A:void 0}function y8(A,e,t){if(_fA(e))return e;var i=e[iC];if(!i)return UZ(e,function(a,s){return Fhe(A,i,e,a,s,t)},!0),e;if(i.A!==A)return e;if(!i.P)return b8(A,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var n=i.i===4||i.i===5?i.o=zfA(i.k):i.o,o=n,g=!1;i.i===3&&(o=new Set(n),n.clear(),g=!0),UZ(o,function(a,s){return Fhe(A,i,n,a,s,t,g)}),b8(A,n,!1),t&&A.u&&UE("Patches").N(i,t,A.u,A.s)}return i.o}function Fhe(A,e,t,i,n,o,g){if(QR(n)){var a=y8(A,n,o&&e&&e.i!==3&&!UfA(e.R,i)?o.concat(i):void 0);if(Yhe(t,i,a),!QR(a))return;A.m=!1}else g&&t.add(n);if(aD(n)&&!_fA(n)){if(!A.h.D&&A._<1)return;y8(A,n),e&&e.A.l||b8(A,n)}}function b8(A,e,t){t===void 0&&(t=!1),!A.l&&A.h.D&&A.m&&TfA(e,t)}function PfA(A,e){var t=A[iC];return(t?sD(t):A)[e]}function Mhe(A,e){if(e in A)for(var t=Object.getPrototypeOf(A);t;){var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}}function $fA(A){A.P||(A.P=!0,A.l&&$fA(A.l))}function AyA(A){A.o||(A.o=zfA(A.t))}function eyA(A,e,t){var i=VfA(e)?UE("MapSet").F(e,t):XfA(e)?UE("MapSet").T(e,t):A.O?function(n,o){var g=Array.isArray(n),a={i:g?1:0,A:o?o.A:Rhe(),P:!1,I:!1,R:{},l:o,t:n,k:null,o:null,j:null,C:!1},s=a,I=nyA;g&&(s=[a],I=XZ);var r=Proxy.revocable(s,I),C=r.revoke,l=r.proxy;return a.k=l,a.j=C,l}(e,t):UE("ES5").J(e,t);return(t?t.A:Rhe()).p.push(i),i}function PBi(A){return QR(A)||fB(22,A),function e(t){if(!aD(t))return t;var i,n=t[iC],o=ER(t);if(n){if(!n.P&&(n.i<4||!UE("ES5").K(n)))return n.t;n.I=!0,i=vhe(t,o),n.I=!1}else i=vhe(t,o);return UZ(i,function(g,a){n&&_Bi(n.t,g)===a||Yhe(i,g,e(a))}),o===3?new Set(i):i}(A)}function vhe(A,e){switch(e){case 2:return new Map(A);case 3:return Array.from(A)}return zfA(A)}var Lhe,VZ,tyA=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",$Bi=typeof Map<"u",AQi=typeof Set<"u",She=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Hhe=tyA?Symbol.for("immer-nothing"):((Lhe={})["immer-nothing"]=!0,Lhe),Zhe=tyA?Symbol.for("immer-draftable"):"__$immer_draftable",iC=tyA?Symbol.for("immer-state"):"__$immer_state",eQi=""+Object.prototype.constructor,iyA=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:Object.getOwnPropertyNames,tQi=Object.getOwnPropertyDescriptors||function(A){var e={};return iyA(A).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(A,t)}),e},iQi={},nyA={get:function(A,e){if(e===iC)return A;var t=sD(A);if(!UfA(t,e))return function(n,o,g){var a,s=Mhe(o,g);return s?"value"in s?s.value:(a=s.get)===null||a===void 0?void 0:a.call(n.k):void 0}(A,t,e);var i=t[e];return A.I||!aD(i)?i:i===PfA(A.t,e)?(AyA(A),A.o[e]=eyA(A.A.h,i,A)):i},has:function(A,e){return e in sD(A)},ownKeys:function(A){return Reflect.ownKeys(sD(A))},set:function(A,e,t){var i=Mhe(sD(A),e);if(i!=null&&i.set)return i.set.call(A.k,t),!0;if(!A.P){var n=PfA(sD(A),e),o=n==null?void 0:n[iC];if(o&&o.t===t)return A.o[e]=t,A.R[e]=!1,!0;if(OBi(t,n)&&(t!==void 0||UfA(A.t,e)))return!0;AyA(A),$fA(A)}return A.o[e]===t&&(t!==void 0||e in A.o)||Number.isNaN(t)&&Number.isNaN(A.o[e])||(A.o[e]=t,A.R[e]=!0),!0},deleteProperty:function(A,e){return PfA(A.t,e)!==void 0||e in A.t?(A.R[e]=!1,AyA(A),$fA(A)):delete A.R[e],A.o&&delete A.o[e],!0},getOwnPropertyDescriptor:function(A,e){var t=sD(A),i=Reflect.getOwnPropertyDescriptor(t,e);return i&&{writable:!0,configurable:A.i!==1||e!=="length",enumerable:i.enumerable,value:t[e]}},defineProperty:function(){fB(11)},getPrototypeOf:function(A){return Object.getPrototypeOf(A.t)},setPrototypeOf:function(){fB(12)}},XZ={};UZ(nyA,function(A,e){XZ[A]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),XZ.deleteProperty=function(A,e){return XZ.set.call(this,A,e,void 0)},XZ.set=function(A,e,t){return nyA.set.call(this,A[0],e,t,A[0])};var nQi=function(){function A(t){var i=this;this.O=She,this.D=!0,this.produce=function(n,o,g){if(typeof n=="function"&&typeof o!="function"){var a=o;o=n;var s=i;return function(E){var u=this;E===void 0&&(E=a);for(var d=arguments.length,f=Array(d>1?d-1:0),w=1;w<d;w++)f[w-1]=arguments[w];return s.produce(E,function(y){var G;return(G=o).call.apply(G,[u,y].concat(f))})}}var I;if(typeof o!="function"&&fB(6),g!==void 0&&typeof g!="function"&&fB(7),aD(n)){var r=xhe(i),C=eyA(i,n,void 0),l=!0;try{I=o(C),l=!1}finally{l?f8(r):qfA(r)}return typeof Promise<"u"&&I instanceof Promise?I.then(function(E){return OfA(r,g),jfA(E,r)},function(E){throw f8(r),E}):(OfA(r,g),jfA(I,r))}if(!n||typeof n!="object"){if((I=o(n))===void 0&&(I=n),I===Hhe&&(I=void 0),i.D&&TfA(I,!0),g){var c=[],B=[];UE("Patches").M(n,I,c,B),g(c,B)}return I}fB(21,n)},this.produceWithPatches=function(n,o){if(typeof n=="function")return function(I){for(var r=arguments.length,C=Array(r>1?r-1:0),l=1;l<r;l++)C[l-1]=arguments[l];return i.produceWithPatches(I,function(c){return n.apply(void 0,[c].concat(C))})};var g,a,s=i.produce(n,o,function(I,r){g=I,a=r});return typeof Promise<"u"&&s instanceof Promise?s.then(function(I){return[I,g,a]}):[s,g,a]},typeof(t==null?void 0:t.useProxies)=="boolean"&&this.setUseProxies(t.useProxies),typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze)}var e=A.prototype;return e.createDraft=function(t){aD(t)||fB(8),QR(t)&&(t=PBi(t));var i=xhe(this),n=eyA(this,t,void 0);return n[iC].C=!0,qfA(i),n},e.finishDraft=function(t,i){var n=t&&t[iC],o=n.A;return OfA(o,i),jfA(void 0,o)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!She&&fB(20),this.O=t},e.applyPatches=function(t,i){var n;for(n=i.length-1;n>=0;n--){var o=i[n];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}n>-1&&(i=i.slice(n+1));var g=UE("Patches").$;return QR(t)?g(t,i):this.produce(t,function(a){return g(a,i)})},A}(),nC=new nQi,oQi=nC.produce;nC.produceWithPatches.bind(nC),nC.setAutoFreeze.bind(nC),nC.setUseProxies.bind(nC),nC.applyPatches.bind(nC),nC.createDraft.bind(nC),nC.finishDraft.bind(nC);const gQi=oQi;var oi;(function(A){A[A.setConfig=0]="setConfig",A[A.removeField=1]="removeField",A[A.reorderField=2]="reorderField",A[A.moveField=3]="moveField",A[A.cloneField=4]="cloneField",A[A.createBinlogField=5]="createBinlogField",A[A.appendFilter=6]="appendFilter",A[A.modFilter=7]="modFilter",A[A.writeFilter=8]="writeFilter",A[A.setName=9]="setName",A[A.applySort=10]="applySort",A[A.transpose=11]="transpose",A[A.setLayout=12]="setLayout",A[A.setFieldAggregator=13]="setFieldAggregator",A[A.setGeoData=14]="setGeoData",A[A.setCoordSystem=15]="setCoordSystem",A[A.createDateDrillField=16]="createDateDrillField",A[A.createDateFeatureField=17]="createDateFeatureField",A[A.changeSemanticType=18]="changeSemanticType",A[A.setFilterAggregator=19]="setFilterAggregator",A[A.addFoldField=20]="addFoldField",A[A.upsertPaintField=21]="upsertPaintField",A[A.addSQLComputedField=22]="addSQLComputedField",A[A.removeAllField=23]="removeAllField",A[A.editAllField=24]="editAllField",A[A.replaceWithNLPQuery=25]="replaceWithNLPQuery"})(oi||(oi={}));const w8={[oi.setConfig]:(A,e,t)=>ni(A,"config",i=>({...i,[e]:t})),[oi.removeField]:(A,e,t)=>ni(A,`encodings.${e}`,i=>Dhe(i,t)),[oi.reorderField]:(A,e,t,i)=>ni(A,`encodings.${e}`,n=>n.map((o,g,a)=>g===t?a[i]:g===i?a[t]:o)),[oi.moveField]:(A,e,t,i,n,o)=>{const g=A.encodings[e][t],a=i==="dimensions"?ni(g,"analyticType",()=>"dimension"):i==="measures"?ni(g,"analyticType",()=>"measure"):g;return ni(A,"encodings",s=>({...s,[e]:Dhe(A.encodings[e],t),[i]:d8(A.encodings[i],a,n).slice(0,o??1/0)}))},[oi.cloneField]:(A,e,t,i,n,o,g)=>{const a={...A.encodings[e][t]};return ni(A,"encodings",s=>({...s,[i]:d8(A.encodings[i],a,n).slice(0,g??1/0)}))},[oi.createBinlogField]:(A,e,t,i,n,o)=>{const g=A.encodings[e][t],a=i.startsWith("bin"),s=a?"dimensions":e,I=a?`${i}${o}`:`log${o}`,r={fid:n,name:`${I}(${g.name})`,semanticType:a?"ordinal":"quantitative",analyticType:a?"dimension":g.analyticType,computed:!0,expression:{op:i,as:n,params:[{type:"field",value:g.fid}],num:o}};return a||(r.aggName="sum"),ni(A,`encodings.${s}`,C=>C.concat(r))},[oi.appendFilter]:(A,e,t,i,n)=>{const o=A.encodings[t][i];return ni(A,"encodings.filters",g=>d8(g,{...o,rule:null},e))},[oi.modFilter]:(A,e,t,i)=>ni(A,"encodings.filters",n=>{const o=A.encodings[t][i];return sf(n,e,g=>({...o,rule:null}))}),[oi.writeFilter]:(A,e,t)=>ni(A,"encodings.filters",i=>sf(i,e,n=>({...n,rule:t}))),[oi.setName]:(A,e)=>({...A,name:e}),[oi.applySort]:(A,e)=>{const{rows:t,columns:i}=A.encodings,n=t.length>0?t[t.length-1]:null,o=i.length>0?i[i.length-1]:null;return o!==null&&o.analyticType==="dimension"&&n!==null&&n.analyticType==="measure"?ni(A,"encodings.columns",g=>sf(g,g.length-1,a=>({...a,sort:e}))):o!==null&&o.analyticType==="measure"&&n!==null&&n.analyticType==="dimension"?ni(A,"encodings.rows",g=>sf(g,g.length-1,a=>({...a,sort:e}))):A},[oi.transpose]:A=>ni(A,"encodings",e=>({...e,columns:e.rows,rows:e.columns})),[oi.setLayout]:(A,e)=>ni(A,"layout",t=>Object.assign({},t,Object.fromEntries(e))),[oi.setFieldAggregator]:(A,e,t,i)=>ni(A,`encodings.${e}`,n=>sf(n,t,o=>({...o,aggName:i}))),[oi.setGeoData]:(A,e,t,i)=>ni(A,"layout",n=>({...n,geojson:e,geoKey:t,geoUrl:i})),[oi.setCoordSystem]:(A,e)=>ni(A,"config",t=>({...t,coordSystem:e,geoms:[WfA.GEOM_TYPES[e][0]]})),[oi.createDateDrillField]:(A,e,t,i,n,o,g,a)=>{const s=A.encodings[e][t],I={fid:n,name:o,semanticType:"temporal",analyticType:s.analyticType,aggName:"sum",computed:!0,timeUnit:i,expression:{op:"dateTimeDrill",as:n,params:[{type:"field",value:s.fid},{type:"value",value:i},...g?[{type:"format",value:g}]:[],...phe(a)?[{type:"offset",value:a}]:[]]}};return ni(A,`encodings.${e}`,r=>r.concat(I))},[oi.createDateFeatureField]:(A,e,t,i,n,o,g,a)=>{const s=A.encodings[e][t],I={fid:n,name:o,semanticType:"ordinal",analyticType:s.analyticType,aggName:"sum",computed:!0,expression:{op:"dateTimeFeature",as:n,params:[{type:"field",value:s.fid},{type:"value",value:i},...g?[{type:"format",value:g}]:[],...phe(a)?[{type:"offset",value:a}]:[]]}};return ni(A,`encodings.${e}`,r=>r.concat(I))},[oi.changeSemanticType]:(A,e,t,i)=>ni(A,`encodings.${e}`,n=>sf(n,t,o=>({...o,semanticType:i}))),[oi.setFilterAggregator]:(A,e,t)=>ni(A,"encodings.filters",i=>sf(i,e,n=>({...n,aggName:t||"sum",enableAgg:!!t,rule:null}))),[oi.addFoldField]:(A,e,t,i,n,o,g)=>{let a=A;const s=a.encodings[e][t];if(!a.config.folds){const I=[...a.encodings.measures,...a.encodings.details].filter(r=>r.analyticType==="measure"&&r.fid!==BR);a=w8[oi.setConfig](a,"folds",I.filter((r,C)=>C===0).map(r=>r.fid))}if(s.fid===BR){const I=Object.keys(a.encodings).filter(r=>r!=="filters").map(r=>[r,a.encodings[r].findIndex(C=>C.fid===u8)]).filter(([r,C])=>C>=0);if(I.length===1){const[r,C]=I[0];a=w8[oi.cloneField](a,r,C,"details",0,`${o}_auto`,1/0)}}return w8[oi.cloneField](a,e,t,i,n,o,g)},[oi.upsertPaintField]:(A,e,t)=>{if(!e)return ni(A,"encodings",o=>Object.fromEntries(Object.entries(o).map(([g,a])=>[g,a.filter(s=>s.fid!==gD)])));const i="facets"in e?{op:"paint",as:gD,params:[{type:"newmap",value:e}]}:{op:"paint",as:gD,params:[{type:"map",value:e}]},n=e.usedColor.includes(255);return ni(A,"encodings",o=>{let g=!1,a=!1;const s=Object.entries(o).map(([l,c])=>{const B=c.findIndex(E=>E.fid===gD);return B>-1?(g=!0,l==="filters"&&(a=!0),[l,sf(c,B,E=>({...E,expression:i}))]):[l,c]}),I={fid:gD,analyticType:"dimension",name:t,semanticType:"nominal",computed:!0,expression:i,rule:{type:"not in",value:[""]}};if(g)return!a&&n?ni(Object.fromEntries(s),"filters",l=>l.concat(I)):Object.fromEntries(s);const r={fid:gD,analyticType:"dimension",name:t,semanticType:"nominal",computed:!0,expression:i},C=ni(ni(o,"dimensions",l=>d8(l,r,l.length)),"color",()=>[{...r}]);return n?ni(C,"filters",l=>l.concat(I)):C})},[oi.addSQLComputedField]:(A,e,t,i)=>{const[n,o]=zBi(KfA(i),A.encodings.dimensions.concat(A.encodings.measures)),g=n==="quantitative"?"measure":"dimension";return ni(A,`encodings.${g}s`,a=>a.concat({analyticType:g,fid:e,name:t,semanticType:n,computed:!0,aggName:o?"expr":g==="dimension"?void 0:"sum",expression:{op:"expr",as:e,params:[{type:"sql",value:i}]}}))},[oi.removeAllField]:(A,e)=>ni(A,"encodings",t=>Object.fromEntries(Object.entries(t).map(([i,n])=>{const o=n.filter(g=>g.fid!==e);return n.length===o.length?[i,n]:[i,o]}))),[oi.editAllField]:(A,e,t)=>{if(Object.keys(t).includes("name")){const i=A.encodings.dimensions.concat(A.encodings.measures).find(n=>n.fid===e);return gQi(A,n=>{i&&Object.values(n.encodings).forEach(o=>o.forEach((g,a)=>{var s;if(g.fid===e)o[a]={...g,...t};else if(((s=g.expression)==null?void 0:s.op)==="expr"){const I=g.expression.params.find(r=>r.type==="sql");if(I){const r=Nhe(I.value,[{...i,fid:t.name,name:i.name??i.fid}]);r!==I.value&&(I.value=r)}}}))})}return ni(A,"encodings",i=>Object.fromEntries(Object.entries(i).map(([n,o])=>o.find(a=>a.fid===e)?[n,o.map(a=>a.fid===e?{...a,...t}:a)]:[n,o])))},[oi.replaceWithNLPQuery]:(A,e,t)=>({...JSON.parse(t),visId:A.visId,name:A.name})},aQi=(A,e)=>{const t={};return Object.keys(e.encodings).forEach(i=>{e.encodings[i]!==A.encodings[i]&&(t[i]=e.encodings[i])}),t};function Whe(A,e){const t=[],i=new Array(e.length).fill(null).map(()=>[]);return A.forEach(n=>{const o=e.findIndex(g=>g(n));o>=0?i[o].push(n):t.push(n)}),t.concat(i.flat())}function Khe(A){const e={};return A.dimensions&&A.dimensions.length>0&&(e.dimensions=Whe(A.dimensions,[t=>t.fid===gD,t=>t.fid===u8])),A.measures&&A.measures.length>0&&(e.measures=Whe(A.measures,[t=>t.fid===NBi,t=>t.fid===BR])),e}const sQi=[(A,e)=>{const t=aQi(e,A),i=A.config.geoms[0];return Object.keys(t).length===0&&fhe(A.config.geoms,e.config.geoms)?A:fhe(A.config.geoms,e.config.geoms)?ni(A,"encodings",n=>({...n,...Ghe(i,t),...Khe(t)})):ni(A,"encodings",n=>({...n,...Ghe(i,n),...Khe(n)}))}];function rQi(A,e){const[t,...i]=e,n=w8[t](A,...i);return sQi.reduce((o,g)=>g(o,A),n)}const IQi=ZBi(rQi);Object.fromEntries(Object.keys(oi).map(A=>[A,(e,...t)=>IQi(e,[oi[A],...t])]));function Uhe(A,e,t){return{config:t!=null&&t.config?{...bhe,...t.config}:bhe,encodings:MBi,layout:t!=null&&t.layout?{...yhe,...t.layout}:yhe,visId:A,name:e}}function CQi(A){var t;const e=Uhe(A.visId||SBi(),A.name||"Chart");return e.config={...e.config,...A.config},e.encodings={...e.encodings,...A.encodings},e.layout={...e.layout,...A.layout,size:{...e.layout.size,...(t=A.layout)==null?void 0:t.size}},e}function lQi(A){var t,i,n,o,g,a,s,I,r,C,l,c,B,E,u,d,f;const e=Uhe(A.visId,A.name||"Chart");return e.config={...e.config,defaultAggregated:A.config.defaultAggregated,geoms:((t=A.config.geoms)==null?void 0:t.slice())??[],limit:A.config.limit,coordSystem:A.config.coordSystem,folds:A.config.folds},e.encodings={...e.encodings,dimensions:((i=A.encodings.dimensions)==null?void 0:i.slice())??[],measures:((n=A.encodings.measures)==null?void 0:n.slice())??[],rows:((o=A.encodings.rows)==null?void 0:o.slice())??[],columns:((g=A.encodings.columns)==null?void 0:g.slice())??[],color:((a=A.encodings.color)==null?void 0:a.slice())??[],opacity:((s=A.encodings.opacity)==null?void 0:s.slice())??[],size:((I=A.encodings.size)==null?void 0:I.slice())??[],shape:((r=A.encodings.shape)==null?void 0:r.slice())??[],theta:((C=A.encodings.theta)==null?void 0:C.slice())??[],radius:((l=A.encodings.radius)==null?void 0:l.slice())??[],longitude:((c=A.encodings.longitude)==null?void 0:c.slice())??[],latitude:((B=A.encodings.latitude)==null?void 0:B.slice())??[],geoId:((E=A.encodings.geoId)==null?void 0:E.slice())??[],details:((u=A.encodings.details)==null?void 0:u.slice())??[],filters:((d=A.encodings.filters)==null?void 0:d.slice())??[],text:((f=A.encodings.text)==null?void 0:f.slice())??[]},e.layout={...e.layout,background:A.config.background,format:A.config.format,interactiveScale:A.config.interactiveScale,resolve:A.config.resolve,showActions:A.config.showActions,stack:A.config.stack,zeroScale:A.config.zeroScale,size:{...e.layout.size,...A.config.size},colorPalette:A.config.colorPalette,geojson:A.config.geojson,geoKey:A.config.geoKey,geoUrl:A.config.geoUrl,primaryColor:A.config.primaryColor,scale:A.config.scale,scaleIncludeUnmatchedChoropleth:A.config.scaleIncludeUnmatchedChoropleth,showTableSummary:A.config.showTableSummary,useSvg:A.config.useSvg},e}function cQi(A){return"layout"in A?A:lQi(vBi(LBi(A)))}function BQi(A,e){return A.aggName==="expr"?A:{...A,aggName:e}}const QQi=A=>{switch(A){case"choropleth":return["geoId","color","opacity","text","details"];case"poi":return["longitude","latitude","color","opacity","size","details"];case"arc":return["radius","theta","color","opacity","size","details","text"];case"bar":case"tick":case"line":case"area":case"boxplot":return["columns","rows","color","opacity","size","details","text"];case"text":return["columns","rows","color","opacity","size","text"];case"table":return["columns","rows"];default:return["columns","rows","color","opacity","size","details","shape"]}},Vhe=(A,e)=>{for(const t of A.params)t.type==="field"?e(t.value):t.type==="expression"?Vhe(t.value,e):t.type==="sql"?TBi(t.value).forEach(e):t.type==="map"?(e(t.value.x),e(t.value.y)):t.type==="newmap"&&t.value.facets.flatMap(i=>i.dimensions).forEach(i=>e(i.fid))},Xhe=(A,e)=>{const t=new Map;return A.forEach(i=>t.set(e(i),i)),[...t.values()]},zhe=(A,e)=>{const t=new Set(e);let i=A.filter(g=>t.has(g.key)),n=i.slice(),o=A.filter(g=>!t.has(g.key));for(;n.length&&o.length;){const g=new Set;for(const I of n)Vhe(I.expression,r=>g.add(r));const a=o.filter(I=>g.has(I.key));i=A.filter(I=>g.has(I.key)).concat(i.filter(I=>!g.has(I.key))),n=a,o=o.filter(I=>!g.has(I.key))}return i},EQi=A=>{const e=YBi(A),t=A.rule;return t.type==="one of"?{fid:e,rule:{type:"one of",value:[...t.value]}}:t.type==="temporal range"?{fid:e,rule:{type:"temporal range",value:t.value,offset:t.offset,format:t.format}}:t.type==="not in"?{fid:e,rule:{type:"not in",value:[...t.value]}}:t.type==="range"?{fid:e,rule:{type:"range",value:[t.value[0]?Number(t.value[0]):t.value[0],t.value[1]?Number(t.value[1]):t.value[1]]}}:t.type==="regexp"?{fid:e,rule:{type:"regexp",value:t.value,caseSensitive:t.caseSensitive}}:(console.error("unknown rule",t),{fid:e,rule:t})},uQi=(A,e,t,i,n,o,g=[],a,s)=>{const I=t.find(N=>N.fid===u8)&&i.find(N=>N.fid===BR),r=t.filter(N=>N.fid!==u8),C=i.filter(N=>N.fid!==BR);if(I){const N=i.find(K=>K.fid===BR).aggName,v=g.map(K=>e.find(U=>U.fid===K)).filter(Boolean).map(K=>BQi(K,N));r.push(...v.filter(K=>(K==null?void 0:K.analyticType)==="dimension")),C.push(...v.filter(K=>(K==null?void 0:K.analyticType)==="measure"))}const l=new Set([...r,...C,...A].map(N=>N.fid));let c=null,B=null,E=null,u=null,d=null,f=null;const w=N=>{const v=EQi(N);return l.add(v.fid),v},y=A.filter(N=>!N.computed&&N.rule&&!N.enableAgg).map(w);y.length&&(c={type:"filter",filters:y});const G=zhe(e.filter(N=>N.computed&&N.expression&&!(N.expression.op==="expr"&&N.aggName==="expr")).map(N=>({key:N.fid,expression:_he(N.expression,e,{timezoneDisplayOffset:s})})),[...l]);G.length&&(B={type:"transform",transform:G});const R=A.filter(N=>N.computed&&N.rule&&!N.enableAgg).map(w);R.length&&(E={type:"filter",filters:R});const x=A.filter(N=>N.enableAgg&&N.aggName&&N.rule),F=zhe(e.filter(N=>N.computed&&N.expression&&N.expression.op==="expr"&&N.aggName==="expr").map(N=>({key:N.fid,expression:_he(N.expression,e,{timezoneDisplayOffset:s})})),[...l]),Q=C.filter(N=>N.aggName).map(N=>[N.fid,N.aggName]).concat(x.map(N=>[N.fid,N.aggName])).concat(F.map(N=>[N.expression.params[0].value,"expr"])),k=n&&(Q.length||C.length===0&&r.length>0);return k?u={type:"view",query:[{op:"aggregate",groupBy:Xhe(r.map(N=>N.fid),N=>N),measures:Xhe(C.concat(x).map(N=>({field:N.fid,agg:N.aggName,asFieldKey:ZfA(N.fid,N.aggName)})).concat(F.map(N=>({field:N.expression.params[0].value,agg:"expr",asFieldKey:N.key}))),N=>N.asFieldKey)}]}:u={type:"view",query:[{op:"raw",fields:[...new Set([...r,...C])].filter(N=>N.aggName!=="expr").map(N=>N.fid)}]},k&&r.length>0&&x.length>0&&(f={type:"filter",filters:x.map(w)}),o!=="none"&&a&&a!==-1&&(d={type:"sort",by:C.map(N=>k?ZfA(N.fid,N.aggName):N.fid),sort:o}),[c,B,E,u,f,d].filter(Boolean)},The=dQi;function dQi(A){var g,a,s,I,r,C,l,c,B,E,u;const e=cQi(A),t=QQi(((a=(g=e.config)==null?void 0:g.geoms)==null?void 0:a[0])??"auto").flatMap(d=>{var f;return((f=e.encodings)==null?void 0:f[d])??[]}),i=((s=e.encodings)==null?void 0:s.rows)??[],n=((I=e.encodings)==null?void 0:I.columns)??[],o=((r=e.config)==null?void 0:r.limit)??-1;return{workflow:uQi(((C=e.encodings)==null?void 0:C.filters)??[],[...((l=e.encodings)==null?void 0:l.dimensions)??[],...((c=e.encodings)==null?void 0:c.measures)??[]],t.filter(d=>d.analyticType==="dimension"),t.filter(d=>d.analyticType==="measure"),((B=e.config)==null?void 0:B.defaultAggregated)??!0,RBi({rows:i,columns:n}),((E=e.config)==null?void 0:E.folds)??[],o,(u=e.config)==null?void 0:u.timezoneDisplayOffset),limit:o>0?o:void 0}}const _he=(A,e,t)=>(A==null?void 0:A.op)==="expr"?{...A,params:[{type:"sql",value:Nhe(A.params.find(i=>i.type==="sql").value,e).trim()}]}:A.op==="dateTimeDrill"||A.op==="dateTimeFeature"?{...A,params:[...A.params,{type:"displayOffset",value:t.timezoneDisplayOffset??new Date().getTimezoneOffset()}]}:A.op==="paint"?{...A,params:A.params.map(i=>{if(i.type==="map"){const n={...i.value.dict,255:{name:""}};return{type:"map",value:{x:i.value.x,y:i.value.y,domainX:i.value.domainX,domainY:i.value.domainY,map:i.value.map,dict:Object.fromEntries(i.value.usedColor.map(o=>[o,{name:n[o].name}])),mapwidth:i.value.mapwidth}}}else if(i.type==="newmap"){const n={...i.value.dict,255:{name:""}},o=Array.from(new Set(i.value.usedColor.concat(1)));return{type:"newmap",value:{facets:i.value.facets.map(({dimensions:g,map:a})=>({dimensions:g,map:a})),dict:Object.fromEntries(o.map(g=>[g,{name:n[g].name}]))}}}else return i})}:A;function hQi(A){const{sourceCode:e,visSpec:t,version:i}=A,n=p.useMemo(()=>JSON.stringify({config:t,chart_map:{},workflow_list:t.map(g=>The(g)),version:i}),[t]);return{pyCode:p.useMemo(()=>{const g=e.replace("'____pyg_walker_spec_params____'","vis_spec");return`vis_spec = r"""${n}"""
${g}`},[e,n])}}x6.registerLanguage("json",gri),x6.registerLanguage("python",lri);const mQi=Gu(A=>{const{globalStore:e,sourceCode:t,open:i,setOpen:n}=A,[o,g]=p.useState([]),[a,s]=p.useState(""),I=b.useContext(j0),{pyCode:r}=hQi({sourceCode:t,visSpec:o,version:Me.version}),C=p.useCallback(()=>{n(!1)},[n]),l=async c=>{try{navigator.clipboard.writeText(c),n(!1)}catch{s("The Clipboard API has been blocked in this environment. Please copy manully.")}};return p.useEffect(()=>{if(i&&e.current){const c=e.current.exportCode();g(c)}},[i]),IA(X6,{open:i,modal:!1,onOpenChange:c=>{n(c)},children:PA(jY,{className:"sm:max-w-[90%] lg:max-w-[900px]",children:[PA(MZ,{children:[IA(PY,{children:"Code Export"}),IA(z6,{children:"Export the code of all charts in PyGWalker."})]}),IA("div",{className:"text-sm max-h-64 overflow-auto p-1",children:PA(ypA,{defaultValue:"python",className:"w-full",children:[PA(Rj,{children:[IA(aZ,{value:"python",children:"Python"}),IA(aZ,{value:"json",children:"JSON(Graphic Walker)"})]}),PA(sZ,{className:"py-4",value:"python",children:[IA("h3",{className:"text-sm font-medium mb-2",children:"PyGWalker Code"}),IA(x6,{showLineNumbers:!0,language:"python",style:I==="dark"?Iue:rue,children:r}),IA("div",{className:"text-xs max-h-56 mt-2",children:IA("p",{children:a})}),PA("div",{className:"mt-4 flex justify-start gap-2",children:[IA(lh,{onClick:()=>{l(r)},children:"Copy to Clipboard"}),IA(lh,{variant:"outline",onClick:C,children:"Cancel"})]})]}),PA(sZ,{value:"json",children:[IA("h3",{className:"text-sm font-medium mb-2",children:"Graphic Walker Specification"}),IA(x6,{showLineNumbers:!0,language:"json",style:I==="dark"?Iue:rue,children:JSON.stringify(o,null,2)}),IA("div",{className:"text-xs max-h-56 mt-2",children:IA("p",{children:a})}),PA("div",{className:"mt-4 flex justify-start gap-2",children:[IA(lh,{onClick:()=>{l(JSON.stringify(o,null,2)),vs.track("click",{entity:"copy_code_button"})},children:"Copy to Clipboard"}),IA(lh,{variant:"outline",onClick:C,children:"Cancel"})]})]})]})})]})})}),Ohe=`*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type="button"]),input:where([type="reset"]),input:where([type="submit"]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden="until-found"])){display:none}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 240 10% 3.9%;--radius: .5rem}.dark{--background: 240 10% 3.9%;--foreground: 0 0% 98%;--card: 240 10% 3.9%;--card-foreground: 0 0% 98%;--popover: 240 10% 3.9%;--popover-foreground: 0 0% 98%;--primary: 0 0% 98%;--primary-foreground: 240 5.9% 10%;--secondary: 240 3.7% 15.9;--secondary-foreground: 0 0% 98%;--muted: 240 3.7% 15.9%;--muted-foreground: 240 5% 64.9%;--accent: 240 3.7% 15.9%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 0% 98%;--border: 240 3.7% 15.9%;--input: 240 3.7% 15.9%;--ring: 240 4.9% 83.9%}.\\!container{width:100%!important;margin-right:auto!important;margin-left:auto!important;padding-right:2rem!important;padding-left:2rem!important}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.\\!container{max-width:1400px!important}.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0px}.left-\\[50\\%\\]{left:50%}.right-2{right:.5rem}.right-4{right:1rem}.top-4{top:1rem}.top-\\[50\\%\\]{top:50%}.z-50{z-index:50}.z-\\[25539\\]{z-index:25539}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-\\[20px\\]{margin-bottom:20px}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.h-10{height:2.5rem}.h-2\\.5{height:.625rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[160px\\]{height:160px}.h-\\[30px\\]{height:30px}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-56{max-height:14rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.w-0{width:0px}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-9{width:2.25rem}.w-\\[140px\\]{width:140px}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-x-\\[-50\\%\\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-2{--tw-translate-y: .5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[-50\\%\\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-t{border-top-width:1px}.border-border{border-color:hsl(var(--border))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-purple-200{--tw-border-opacity: 1;border-color:rgb(233 213 255 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\\/80{background-color:#000c}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-white\\/80{background-color:#fffc}.bg-zinc-700{--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity, 1))}.bg-zinc-900{--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-purple-50{--tw-gradient-from: #faf5ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(250 245 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-blue-50{--tw-gradient-to: #eff6ff var(--tw-gradient-to-position)}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pl-2{padding-left:.5rem}.pr-8{padding-right:2rem}.pt-0\\.5{padding-top:.125rem}.text-left{text-align:left}.text-center{text-align:center}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-current{color:currentColor}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity, 1))}.ring-opacity-5{--tw-ring-opacity: .05}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-100{animation-duration:.1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-destructive\\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\\:bg-primary\\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-gray-300:hover{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\\:opacity-70{opacity:.7}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=active\\]\\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\\[state\\=on\\]\\:bg-accent[data-state=on],.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\\[state\\=active\\]\\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\\[state\\=checked\\]\\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\\[state\\=on\\]\\:text-accent-foreground[data-state=on]{color:hsl(var(--accent-foreground))}.data-\\[state\\=open\\]\\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\\[state\\=closed\\]\\:slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\\[state\\=closed\\]\\:slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\\[state\\=open\\]\\:slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\\[state\\=open\\]\\:slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y: -48%}.dark\\:border-purple-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(107 33 168 / var(--tw-border-opacity, 1))}.dark\\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\\:from-purple-950\\/30:is(.dark *){--tw-gradient-from: rgb(59 7 100 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 7 100 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\\:to-blue-950\\/30:is(.dark *){--tw-gradient-to: rgb(23 37 84 / .3) var(--tw-gradient-to-position)}.dark\\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\\:hover\\:text-gray-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\\:max-w-\\[90\\%\\]{max-width:90%}.sm\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\\:translate-x-2{--tw-translate-x: .5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\\:flex-row{flex-direction:row}.sm\\:items-start{align-items:flex-start}.sm\\:items-end{align-items:flex-end}.sm\\:justify-end{justify-content:flex-end}.sm\\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\\:rounded-lg{border-radius:var(--radius)}.sm\\:p-6{padding:1.5rem}.sm\\:text-left{text-align:left}}@media (min-width: 1024px){.lg\\:max-w-\\[900px\\]{max-width:900px}.lg\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\\:grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}
`,pQi=Gu(A=>{const{charts:e,themeKey:t}=A;return IA(b.StrictMode,{children:PA("div",{className:"bg-background text-foreground",children:[IA("style",{children:Ohe}),PA(ypA,{defaultValue:"0",className:"w-full",children:[IA("div",{className:"overflow-x-auto max-w-full",children:IA(Rj,{children:e.map((i,n)=>IA(aZ,{value:n.toString(),children:i.visSpec.name},n))})}),e.map((i,n)=>IA(sZ,{value:n.toString(),children:IA(EpA,{vizThemeConfig:t,name:i.visSpec.name,visualConfig:i.visSpec.config,visualLayout:i.visSpec.layout,visualState:i.visSpec.encodings,type:"remote",computation:async o=>i.data,appearance:A.dark})},n))]})]})})}),fQi=Gu(A=>IA(b.StrictMode,{children:PA("div",{children:[IA("h1",{style:{marginTop:"1rem",color:"#333",fontSize:"1.1rem",marginBottom:"0.5rem",paddingInlineStart:"1rem"},children:A.title}),IA("p",{style:{color:"#666",fontWeight:300,paddingInlineStart:"1rem"},children:A.desc}),IA(EpA,{vizThemeConfig:A.themeKey,name:A.visSpec.name,visualConfig:A.visSpec.config,visualLayout:A.visSpec.layout,visualState:A.visSpec.encodings,type:"remote",computation:async e=>A.data,appearance:A.dark})]})})),zZ=p.forwardRef(({className:A,type:e,...t},i)=>IA("input",{type:e,className:Vn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",A),ref:i,...t}));zZ.displayName="Input";var yQi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bQi=yQi.reduce((A,e)=>{const t=lue(`Primitive.${e}`),i=p.forwardRef((n,o)=>{const{asChild:g,...a}=n,s=g?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),IA(s,{...a,ref:o})});return i.displayName=`Primitive.${e}`,{...A,[e]:i}},{}),wQi="Label",qhe=p.forwardRef((A,e)=>IA(bQi.label,{...A,ref:e,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||((n=A.onMouseDown)==null||n.call(A,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));qhe.displayName=wQi;var jhe=qhe;const DQi=M6("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),uR=p.forwardRef(({className:A,...e},t)=>IA(jhe,{ref:t,className:Vn(DQi(),A),...e}));uR.displayName=jhe.displayName;function Phe(A){const e=p.useRef({value:A,previous:A});return p.useMemo(()=>(e.current.value!==A&&(e.current.previous=e.current.value,e.current.value=A),e.current.previous),[A])}function $he(A){const[e,t]=p.useState(void 0);return Ta(()=>{if(A){t({width:A.offsetWidth,height:A.offsetHeight});const i=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const o=n[0];let g,a;if("borderBoxSize"in o){const s=o.borderBoxSize,I=Array.isArray(s)?s[0]:s;g=I.inlineSize,a=I.blockSize}else g=A.offsetWidth,a=A.offsetHeight;t({width:g,height:a})});return i.observe(A,{box:"border-box"}),()=>i.unobserve(A)}else t(void 0)},[A]),e}var D8="Checkbox",[GQi,dfi]=N0(D8),[kQi,oyA]=GQi(D8);function JQi(A){const{__scopeCheckbox:e,checked:t,children:i,defaultChecked:n,disabled:o,form:g,name:a,onCheckedChange:s,required:I,value:r="on",internal_do_not_use_render:C}=A,[l,c]=Ah({prop:t,defaultProp:n??!1,onChange:s,caller:D8}),[B,E]=p.useState(null),[u,d]=p.useState(null),f=p.useRef(!1),w=B?!!g||!!B.closest("form"):!0,y={checked:l,disabled:o,setChecked:c,control:B,setControl:E,name:a,form:g,value:r,hasConsumerStoppedPropagationRef:f,required:I,defaultChecked:rf(n)?!1:n,isFormControl:w,bubbleInput:u,setBubbleInput:d};return IA(kQi,{scope:e,...y,children:NQi(C)?C(y):i})}var Ame="CheckboxTrigger",eme=p.forwardRef(({__scopeCheckbox:A,onKeyDown:e,onClick:t,...i},n)=>{const{control:o,value:g,disabled:a,checked:s,required:I,setControl:r,setChecked:C,hasConsumerStoppedPropagationRef:l,isFormControl:c,bubbleInput:B}=oyA(Ame,A),E=Un(n,r),u=p.useRef(s);return p.useEffect(()=>{const d=o==null?void 0:o.form;if(d){const f=()=>C(u.current);return d.addEventListener("reset",f),()=>d.removeEventListener("reset",f)}},[o,C]),IA(Gt.button,{type:"button",role:"checkbox","aria-checked":rf(s)?"mixed":s,"aria-required":I,"data-state":gme(s),"data-disabled":a?"":void 0,disabled:a,value:g,...i,ref:E,onKeyDown:Ft(e,d=>{d.key==="Enter"&&d.preventDefault()}),onClick:Ft(t,d=>{C(f=>rf(f)?!0:!f),B&&c&&(l.current=d.isPropagationStopped(),l.current||d.stopPropagation())})})});eme.displayName=Ame;var gyA=p.forwardRef((A,e)=>{const{__scopeCheckbox:t,name:i,checked:n,defaultChecked:o,required:g,disabled:a,value:s,onCheckedChange:I,form:r,...C}=A;return IA(JQi,{__scopeCheckbox:t,checked:n,defaultChecked:o,disabled:a,required:g,onCheckedChange:I,name:i,form:r,value:s,internal_do_not_use_render:({isFormControl:l})=>PA(ua,{children:[IA(eme,{...C,ref:e,__scopeCheckbox:t}),l&&IA(ome,{__scopeCheckbox:t})]})})});gyA.displayName=D8;var tme="CheckboxIndicator",ime=p.forwardRef((A,e)=>{const{__scopeCheckbox:t,forceMount:i,...n}=A,o=oyA(tme,t);return IA(wY,{present:i||rf(o.checked)||o.checked===!0,children:IA(Gt.span,{"data-state":gme(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:e,style:{pointerEvents:"none",...A.style}})})});ime.displayName=tme;var nme="CheckboxBubbleInput",ome=p.forwardRef(({__scopeCheckbox:A,...e},t)=>{const{control:i,hasConsumerStoppedPropagationRef:n,checked:o,defaultChecked:g,required:a,disabled:s,name:I,value:r,form:C,bubbleInput:l,setBubbleInput:c}=oyA(nme,A),B=Un(t,c),E=Phe(o),u=$he(i);p.useEffect(()=>{const f=l;if(!f)return;const w=window.HTMLInputElement.prototype,G=Object.getOwnPropertyDescriptor(w,"checked").set,R=!n.current;if(E!==o&&G){const x=new Event("click",{bubbles:R});f.indeterminate=rf(o),G.call(f,rf(o)?!1:o),f.dispatchEvent(x)}},[l,E,o,n]);const d=p.useRef(rf(o)?!1:o);return IA(Gt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:g??d.current,required:a,disabled:s,name:I,value:r,form:C,...e,tabIndex:-1,ref:B,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ome.displayName=nme;function NQi(A){return typeof A=="function"}function rf(A){return A==="indeterminate"}function gme(A){return rf(A)?"indeterminate":A?"checked":"unchecked"}const G8=p.forwardRef(({className:A,...e},t)=>IA(gyA,{ref:t,className:Vn("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",A),...e,children:IA(ime,{className:Vn("flex items-center justify-center text-current"),children:IA(ade,{className:"h-4 w-4"})})}));G8.displayName=gyA.displayName;const YQi=M6("inline-flex items-center rounded-md 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 shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),RQi=Gu(A=>{const[e,t]=p.useState(!1),[i,n]=p.useState(""),[o,g]=p.useState(!1),[a,s]=p.useState(""),[I,r]=p.useState("onboarding"),C=d=>{Me.setNotification({type:"success",title:"Success",message:PA(ua,{children:[IA("p",{className:"py-1",children:"upload spec success, please use"}),PA("p",{className:"font-semibold px-1 py-1",children:['`pyg.walk(df, spec="ksf://',d,'")`']}),IA("p",{className:"py-1",children:"to rerun pygwalker."})]})},3e4)},l=async()=>{var d;if(!e){vs.track("click",{entity:"upload_spec_to_cloud_button"}),t(!0);try{const f=await((d=Hr.comm)==null?void 0:d.sendMsg("upload_spec_to_cloud",{fileName:i,newToken:o?a:""},3e4));Me.setUploadSpecModalOpen(!1),C(f==null?void 0:f.data.specFilePath),A.setGwIsChanged(!1)}finally{t(!1)}}},c=d=>{g(d),s("")},B=()=>{var R;vs.track("click",{entity:"save_spec_to_local_file_button"});const d=(R=A.storeRef.current)==null?void 0:R.exportCode(),f={config:d,chart_map:{},version:Me.version,workflow_list:d==null?void 0:d.map(x=>The(x).workflow)},w=new Blob([JSON.stringify(f)],{type:"text/plain;charset=utf-8"}),y=URL.createObjectURL(w),G=document.createElement("a");G.href=y,G.download=`pygwalker_spec_${new Date().getTime()}.json`,G.click(),URL.revokeObjectURL(y),Me.setUploadSpecModalOpen(!1),A.setGwIsChanged(!1)};p.useEffect(()=>{r("onboarding")},[Me.uploadSpecModalOpen]);const E=PA(jY,{children:[IA(MZ,{children:IA(PY,{children:"Save Spec"})}),PA("div",{className:"grid h-full grid-rows-2 gap-6 lg:grid-cols-2 lg:grid-rows-1",children:[IA("button",{className:"flex flex-col items-start gap-2 rounded-lg border p-3 text-left text-sm transition-all hover:bg-accent",onClick:()=>{r("upload"),vs.track("click",{entity:"select_upload_spec_to_cloud_button"})},children:IA("div",{className:"flex items-center justify-center h-[160px] w-full",children:IA("span",{className:"font-semibold",children:"upload as cloud file"})})}),IA("button",{className:"flex flex-col items-start gap-2 rounded-lg border p-3 text-left text-sm transition-all hover:bg-accent",onClick:B,children:IA("div",{className:"flex items-center justify-center h-[160px] w-full",children:IA("span",{className:"font-semibold",children:"save as local file"})})})]})]}),u=PA(jY,{children:[PA(MZ,{children:[IA(PY,{children:"Upload Sepc"}),PA(z6,{children:[IA("p",{className:"py-1",children:"Because you currently don't pass in the spec parameter or the passed in spec parameter is not a writable spec file."}),IA("p",{className:"py-1",children:"Currently the spec configuration is already in your ui cache, you may need to upload kanaries cloud to save it."}),PA("p",{className:"py-1",children:["If you don't have kanaries_token, you need to get it: ",IA("a",{className:YQi({variant:"outline"}),href:"https://kanaries.net/analytics/settings?tab=apikey",target:"_blank",children:"Kanaries"})]})]})]}),PA("div",{children:[IA("div",{className:"text-sm max-h-64 overflow-auto p-1",children:IA(zZ,{value:i,onChange:d=>{n(d.target.value)},type:"text",placeholder:"please input spec file name",id:"chart-name-input",className:"mb-1"})}),PA("div",{className:"flex items-center justify-end mt-2",children:[IA(G8,{id:"link-checkbox",checked:o,onCheckedChange:d=>{c(d)}}),IA(uR,{className:"ml-2",children:"Set a new kanaries_token?"})]}),o&&IA("div",{className:"text-sm max-h-64 overflow-auto p-1 mt-2",children:IA(zZ,{value:a,onChange:d=>{s(d.target.value)},type:"text",autoComplete:"off",placeholder:"please input new kanaries token",id:"token-input"})}),IA("div",{className:"mt-4 flex justify-end",children:IA(lh,{variant:"outline",className:"mr-2 px-6",disabled:e,onClick:l,children:e?"uploading..":"upload"})})]})]});return PA(X6,{open:Me.uploadSpecModalOpen,modal:!1,onOpenChange:d=>{Me.setUploadSpecModalOpen(d)},children:[I==="upload"&&u,I==="onboarding"&&E]})}),xQi=Gu(A=>{const[e,t]=p.useState(!1),[i,n]=p.useState(""),[o,g]=p.useState(""),[a,s]=p.useState(!0),[I,r]=p.useState(!0),[C,l]=p.useState("");p.useEffect(()=>{var E;if(Me.uploadChartModalOpen){const u=(((E=A.storeRef.current)==null?void 0:E.exportCode().length)||0)>1?"dashboard":"chart";n(`${u}-${new Date().getTime().toString(16).padStart(16,"0")}`),g(`dataset-${new Date().getTime().toString(16).padStart(16,"0")}`),s(!0),l(u)}},[Me.uploadChartModalOpen]);const c=(E,u,d)=>{const f=E==="chart"?`https://kanaries.net/analytics/c/${u}`:`https://kanaries.net/analytics/d/${u}`,w=E==="chart"?`https://kanaries.net/analytics/chart/${u}/share?theme=${A.dark}`:`https://kanaries.net/analytics/dashboard/${u}/share?theme=${A.dark}`,y=`https://kanaries.net/analytics/detail/${d}`;E==="dashboard"&&u===""?Me.setNotification({type:"success",title:"Success",message:IA(ua,{children:PA("p",{children:["Upload success, you can view and manager it at:",IA("a",{className:"font-semibold",href:y,target:"_blank",children:y})]})})},3e4):Me.setNotification({type:"success",title:"Success",message:PA(ua,{children:[PA("p",{children:["Upload success, you can view and manager it at:",IA("a",{className:"font-semibold",href:f,target:"_blank",children:f})]}),IA("br",{}),a&&PA("p",{children:["Since you set the ",E," to public, you can also share it with others by:",IA("a",{className:"font-semibold",href:w,target:"_blank",children:w})]})]})},3e4)},B=async()=>{var u,d,f;if(e)return;t(!0),vs.track("click",{entity:"upload_chart_button"});const E=(u=A.storeRef.current)==null?void 0:u.exportCode();try{if(C==="dashboard"){const w=await((d=Hr.comm)==null?void 0:d.sendMsg("upload_to_cloud_dashboard",{chartName:i,datasetName:o,isPublic:a,isCreateDashboard:I,visSpec:E,workflowList:E.map(y=>QnA(y).workflow)},12e4));c(C,w==null?void 0:w.data.dashboardId,w==null?void 0:w.data.datasetId)}else{const w=await((f=Hr.comm)==null?void 0:f.sendMsg("upload_to_cloud_charts",{chartName:i,datasetName:o,isPublic:a,visSpec:E,workflow:QnA(E[0]).workflow},12e4));c(C,w==null?void 0:w.data.chartId,w==null?void 0:w.data.datasetId)}Me.setUploadChartModalOpen(!1)}finally{t(!1)}};return IA(X6,{open:Me.uploadChartModalOpen,modal:!1,onOpenChange:E=>{Me.setUploadChartModalOpen(E)},children:PA(jY,{children:[PA(MZ,{children:[IA(PY,{children:"Upload Chart"}),IA(z6,{children:"upload your charts to dashboard of kanaries cloud."})]}),PA("div",{children:[PA("div",{className:"text-sm max-h-64 overflow-auto p-1 flex flex-col space-y-2",children:[PA("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[IA(uR,{htmlFor:"dataset-name-input",children:"Dataset Name"}),IA(zZ,{value:o,onChange:E=>{g(E.target.value)},type:"text",placeholder:"please input dataset name",id:"dataset-name-input",className:"mb-1"})]}),PA("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[IA(uR,{htmlFor:"chart-name-input",children:C==="dashboard"?"Dashboard Name":"Chart Name"}),IA(zZ,{value:i,onChange:E=>{n(E.target.value)},disabled:!I,type:"text",placeholder:"please input chart name",id:"chart-name-input",className:"mb-1"})]}),PA("div",{className:"items-top flex space-x-2",children:[IA(G8,{id:"public-checkbox",checked:a,onCheckedChange:E=>{s(E)}}),PA("div",{className:"grid gap-1.5 leading-none",children:[IA(uR,{htmlFor:"public-checkbox",children:"Is Public?"}),PA("p",{className:"text-sm text-muted-foreground",children:["Make ",C," publicly accessible."]})]})]}),C==="dashboard"&&PA("div",{className:"items-top flex space-x-2",children:[IA(G8,{id:"create-dashboard-checkbox",checked:I,onCheckedChange:E=>{r(E)}}),PA("div",{className:"grid gap-1.5 leading-none",children:[IA(uR,{htmlFor:"create-dashboard-checkbox",children:"Create Dashboard?"}),IA("p",{className:"text-sm text-muted-foreground",children:"Create a dashboard containing all charts, or upload charts individually."})]})]})]}),IA("div",{className:"mt-4 flex justify-end",children:IA(lh,{variant:"outline",className:"mr-2 px-6",disabled:e,onClick:B,children:e?"uploading..":"upload"})})]})]})})}),FQi=Gu(A=>IA(X6,{open:Me.initModalOpen,modal:!0,children:PA(jY,{hideClose:!0,children:[IA(PY,{className:"sr-only",children:Me.initModalInfo.title}),PA("div",{className:"flex justify-between mb-1",children:[IA("span",{className:"text-base font-medium text-blue-700 dark:text-white",children:Me.initModalInfo.title}),PA("span",{className:"text-sm font-medium text-blue-700 dark:text-white",children:[Me.initModalInfo.curIndex," / ",Me.initModalInfo.total]})]}),IA("div",{className:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700",children:IA("div",{className:"bg-blue-600 h-2.5 rounded-full",style:{width:`${Math.floor(Me.initModalInfo.curIndex/Me.initModalInfo.total*100)}%`}})})]})}));function MQi(A,e){if(A.match(/^[a-z]+:\/\//i))return A;if(A.match(/^\/\//))return window.location.protocol+A;if(A.match(/^[a-z]+:/i))return A;const t=document.implementation.createHTMLDocument(),i=t.createElement("base"),n=t.createElement("a");return t.head.appendChild(i),t.body.appendChild(n),e&&(i.href=e),n.href=A,n.href}const vQi=(()=>{let A=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(A+=1,`u${e()}${A}`)})();function If(A){const e=[];for(let t=0,i=A.length;t<i;t++)e.push(A[t]);return e}let dR=null;function ame(A={}){return dR||(A.includeStyleProperties?(dR=A.includeStyleProperties,dR):(dR=If(window.getComputedStyle(document.documentElement)),dR))}function k8(A,e){const i=(A.ownerDocument.defaultView||window).getComputedStyle(A).getPropertyValue(e);return i?parseFloat(i.replace("px","")):0}function LQi(A){const e=k8(A,"border-left-width"),t=k8(A,"border-right-width");return A.clientWidth+e+t}function SQi(A){const e=k8(A,"border-top-width"),t=k8(A,"border-bottom-width");return A.clientHeight+e+t}function sme(A,e={}){const t=e.width||LQi(A),i=e.height||SQi(A);return{width:t,height:i}}function HQi(){let A,e;try{e=process}catch{}const t=e&&e.env?e.env.devicePixelRatio:null;return t&&(A=parseInt(t,10),Number.isNaN(A)&&(A=1)),A||window.devicePixelRatio||1}const oC=16384;function ZQi(A){(A.width>oC||A.height>oC)&&(A.width>oC&&A.height>oC?A.width>A.height?(A.height*=oC/A.width,A.width=oC):(A.width*=oC/A.height,A.height=oC):A.width>oC?(A.height*=oC/A.width,A.width=oC):(A.width*=oC/A.height,A.height=oC))}function J8(A){return new Promise((e,t)=>{const i=new Image;i.onload=()=>{i.decode().then(()=>{requestAnimationFrame(()=>e(i))})},i.onerror=t,i.crossOrigin="anonymous",i.decoding="async",i.src=A})}async function WQi(A){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(A)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function KQi(A,e,t){const i="http://www.w3.org/2000/svg",n=document.createElementNS(i,"svg"),o=document.createElementNS(i,"foreignObject");return n.setAttribute("width",`${e}`),n.setAttribute("height",`${t}`),n.setAttribute("viewBox",`0 0 ${e} ${t}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),n.appendChild(o),o.appendChild(A),WQi(n)}const Vr=(A,e)=>{if(A instanceof e)return!0;const t=Object.getPrototypeOf(A);return t===null?!1:t.constructor.name===e.name||Vr(t,e)};function UQi(A){const e=A.getPropertyValue("content");return`${A.cssText} content: '${e.replace(/'|"/g,"")}';`}function VQi(A,e){return ame(e).map(t=>{const i=A.getPropertyValue(t),n=A.getPropertyPriority(t);return`${t}: ${i}${n?" !important":""};`}).join(" ")}function XQi(A,e,t,i){const n=`.${A}:${e}`,o=t.cssText?UQi(t):VQi(t,i);return document.createTextNode(`${n}{${o}}`)}function rme(A,e,t,i){const n=window.getComputedStyle(A,t),o=n.getPropertyValue("content");if(o===""||o==="none")return;const g=vQi();try{e.className=`${e.className} ${g}`}catch{return}const a=document.createElement("style");a.appendChild(XQi(g,t,n,i)),e.appendChild(a)}function zQi(A,e,t){rme(A,e,":before",t),rme(A,e,":after",t)}const Ime="application/font-woff",Cme="image/jpeg",TQi={woff:Ime,woff2:Ime,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Cme,jpeg:Cme,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function _Qi(A){const e=/\.([^./]*?)$/g.exec(A);return e?e[1]:""}function ayA(A){const e=_Qi(A).toLowerCase();return TQi[e]||""}function OQi(A){return A.split(/,/)[1]}function syA(A){return A.search(/^(data:)/)!==-1}function lme(A,e){return`data:${e};base64,${A}`}async function cme(A,e,t){const i=await fetch(A,e);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);const n=await i.blob();return new Promise((o,g)=>{const a=new FileReader;a.onerror=g,a.onloadend=()=>{try{o(t({res:i,result:a.result}))}catch(s){g(s)}},a.readAsDataURL(n)})}const ryA={};function qQi(A,e,t){let i=A.replace(/\?.*/,"");return t&&(i=A),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),e?`[${e}]${i}`:i}async function IyA(A,e,t){const i=qQi(A,e,t.includeQueryParams);if(ryA[i]!=null)return ryA[i];t.cacheBust&&(A+=(/\?/.test(A)?"&":"?")+new Date().getTime());let n;try{const o=await cme(A,t.fetchRequestInit,({res:g,result:a})=>(e||(e=g.headers.get("Content-Type")||""),OQi(a)));n=lme(o,e)}catch(o){n=t.imagePlaceholder||"";let g=`Failed to fetch resource: ${A}`;o&&(g=typeof o=="string"?o:o.message),g&&console.warn(g)}return ryA[i]=n,n}async function jQi(A){const e=A.toDataURL();return e==="data:,"?A.cloneNode(!1):J8(e)}async function PQi(A,e){if(A.currentSrc){const o=document.createElement("canvas"),g=o.getContext("2d");o.width=A.clientWidth,o.height=A.clientHeight,g==null||g.drawImage(A,0,0,o.width,o.height);const a=o.toDataURL();return J8(a)}const t=A.poster,i=ayA(t),n=await IyA(t,i,e);return J8(n)}async function $Qi(A,e){var t;try{if(!((t=A==null?void 0:A.contentDocument)===null||t===void 0)&&t.body)return await N8(A.contentDocument.body,e,!0)}catch{}return A.cloneNode(!1)}async function AEi(A,e){return Vr(A,HTMLCanvasElement)?jQi(A):Vr(A,HTMLVideoElement)?PQi(A,e):Vr(A,HTMLIFrameElement)?$Qi(A,e):A.cloneNode(Bme(A))}const eEi=A=>A.tagName!=null&&A.tagName.toUpperCase()==="SLOT",Bme=A=>A.tagName!=null&&A.tagName.toUpperCase()==="SVG";async function tEi(A,e,t){var i,n;if(Bme(e))return e;let o=[];return eEi(A)&&A.assignedNodes?o=If(A.assignedNodes()):Vr(A,HTMLIFrameElement)&&(!((i=A.contentDocument)===null||i===void 0)&&i.body)?o=If(A.contentDocument.body.childNodes):o=If(((n=A.shadowRoot)!==null&&n!==void 0?n:A).childNodes),o.length===0||Vr(A,HTMLVideoElement)||await o.reduce((g,a)=>g.then(()=>N8(a,t)).then(s=>{s&&e.appendChild(s)}),Promise.resolve()),e}function iEi(A,e,t){const i=e.style;if(!i)return;const n=window.getComputedStyle(A);n.cssText?(i.cssText=n.cssText,i.transformOrigin=n.transformOrigin):ame(t).forEach(o=>{let g=n.getPropertyValue(o);o==="font-size"&&g.endsWith("px")&&(g=`${Math.floor(parseFloat(g.substring(0,g.length-2)))-.1}px`),Vr(A,HTMLIFrameElement)&&o==="display"&&g==="inline"&&(g="block"),o==="d"&&e.getAttribute("d")&&(g=`path(${e.getAttribute("d")})`),i.setProperty(o,g,n.getPropertyPriority(o))})}function nEi(A,e){Vr(A,HTMLTextAreaElement)&&(e.innerHTML=A.value),Vr(A,HTMLInputElement)&&e.setAttribute("value",A.value)}function oEi(A,e){if(Vr(A,HTMLSelectElement)){const t=e,i=Array.from(t.children).find(n=>A.value===n.getAttribute("value"));i&&i.setAttribute("selected","")}}function gEi(A,e,t){return Vr(e,Element)&&(iEi(A,e,t),zQi(A,e,t),nEi(A,e),oEi(A,e)),e}async function aEi(A,e){const t=A.querySelectorAll?A.querySelectorAll("use"):[];if(t.length===0)return A;const i={};for(let o=0;o<t.length;o++){const a=t[o].getAttribute("xlink:href");if(a){const s=A.querySelector(a),I=document.querySelector(a);!s&&I&&!i[a]&&(i[a]=await N8(I,e,!0))}}const n=Object.values(i);if(n.length){const o="http://www.w3.org/1999/xhtml",g=document.createElementNS(o,"svg");g.setAttribute("xmlns",o),g.style.position="absolute",g.style.width="0",g.style.height="0",g.style.overflow="hidden",g.style.display="none";const a=document.createElementNS(o,"defs");g.appendChild(a);for(let s=0;s<n.length;s++)a.appendChild(n[s]);A.appendChild(g)}return A}async function N8(A,e,t){return!t&&e.filter&&!e.filter(A)?null:Promise.resolve(A).then(i=>AEi(i,e)).then(i=>tEi(A,i,e)).then(i=>gEi(A,i,e)).then(i=>aEi(i,e))}const Qme=/url\((['"]?)([^'"]+?)\1\)/g,sEi=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,rEi=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function IEi(A){const e=A.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function CEi(A){const e=[];return A.replace(Qme,(t,i,n)=>(e.push(n),t)),e.filter(t=>!syA(t))}async function lEi(A,e,t,i,n){try{const o=t?MQi(e,t):e,g=ayA(e);let a;if(n){const s=await n(o);a=lme(s,g)}else a=await IyA(o,g,i);return A.replace(IEi(e),`$1${a}$3`)}catch{}return A}function cEi(A,{preferredFontFormat:e}){return e?A.replace(rEi,t=>{for(;;){const[i,,n]=sEi.exec(t)||[];if(!n)return"";if(n===e)return`src: ${i};`}}):A}function Eme(A){return A.search(Qme)!==-1}async function ume(A,e,t){if(!Eme(A))return A;const i=cEi(A,t);return CEi(i).reduce((o,g)=>o.then(a=>lEi(a,g,e,t)),Promise.resolve(i))}async function hR(A,e,t){var i;const n=(i=e.style)===null||i===void 0?void 0:i.getPropertyValue(A);if(n){const o=await ume(n,null,t);return e.style.setProperty(A,o,e.style.getPropertyPriority(A)),!0}return!1}async function BEi(A,e){await hR("background",A,e)||await hR("background-image",A,e),await hR("mask",A,e)||await hR("-webkit-mask",A,e)||await hR("mask-image",A,e)||await hR("-webkit-mask-image",A,e)}async function QEi(A,e){const t=Vr(A,HTMLImageElement);if(!(t&&!syA(A.src))&&!(Vr(A,SVGImageElement)&&!syA(A.href.baseVal)))return;const i=t?A.src:A.href.baseVal,n=await IyA(i,ayA(i),e);await new Promise((o,g)=>{A.onload=o,A.onerror=e.onImageErrorHandler?(...s)=>{try{o(e.onImageErrorHandler(...s))}catch(I){g(I)}}:g;const a=A;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),t?(A.srcset="",A.src=n):A.href.baseVal=n})}async function EEi(A,e){const i=If(A.childNodes).map(n=>dme(n,e));await Promise.all(i).then(()=>A)}async function dme(A,e){Vr(A,Element)&&(await BEi(A,e),await QEi(A,e),await EEi(A,e))}function uEi(A,e){const{style:t}=A;e.backgroundColor&&(t.backgroundColor=e.backgroundColor),e.width&&(t.width=`${e.width}px`),e.height&&(t.height=`${e.height}px`);const i=e.style;return i!=null&&Object.keys(i).forEach(n=>{t[n]=i[n]}),A}const hme={};async function mme(A){let e=hme[A];if(e!=null)return e;const i=await(await fetch(A)).text();return e={url:A,cssText:i},hme[A]=e,e}async function pme(A,e){let t=A.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,o=(t.match(/url\([^)]+\)/g)||[]).map(async g=>{let a=g.replace(i,"$1");return a.startsWith("https://")||(a=new URL(a,A.url).href),cme(a,e.fetchRequestInit,({result:s})=>(t=t.replace(g,`url(${s})`),[g,s]))});return Promise.all(o).then(()=>t)}function fme(A){if(A==null)return[];const e=[],t=/(\/\*[\s\S]*?\*\/)/gi;let i=A.replace(t,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const s=n.exec(i);if(s===null)break;e.push(s[0])}i=i.replace(n,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,g="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(g,"gi");for(;;){let s=o.exec(i);if(s===null){if(s=a.exec(i),s===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;e.push(s[0])}return e}async function dEi(A,e){const t=[],i=[];return A.forEach(n=>{if("cssRules"in n)try{If(n.cssRules||[]).forEach((o,g)=>{if(o.type===CSSRule.IMPORT_RULE){let a=g+1;const s=o.href,I=mme(s).then(r=>pme(r,e)).then(r=>fme(r).forEach(C=>{try{n.insertRule(C,C.startsWith("@import")?a+=1:n.cssRules.length)}catch(l){console.error("Error inserting rule from remote css",{rule:C,error:l})}})).catch(r=>{console.error("Error loading remote css",r.toString())});i.push(I)}})}catch(o){const g=A.find(a=>a.href==null)||document.styleSheets[0];n.href!=null&&i.push(mme(n.href).then(a=>pme(a,e)).then(a=>fme(a).forEach(s=>{g.insertRule(s,g.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(i).then(()=>(A.forEach(n=>{if("cssRules"in n)try{If(n.cssRules||[]).forEach(o=>{t.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${n.href}`,o)}}),t))}function hEi(A){return A.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>Eme(e.style.getPropertyValue("src")))}async function mEi(A,e){if(A.ownerDocument==null)throw new Error("Provided element is not within a Document");const t=If(A.ownerDocument.styleSheets),i=await dEi(t,e);return hEi(i)}function yme(A){return A.trim().replace(/["']/g,"")}function pEi(A){const e=new Set;function t(i){(i.style.fontFamily||getComputedStyle(i).fontFamily).split(",").forEach(o=>{e.add(yme(o))}),Array.from(i.children).forEach(o=>{o instanceof HTMLElement&&t(o)})}return t(A),e}async function fEi(A,e){const t=await mEi(A,e),i=pEi(A);return(await Promise.all(t.filter(o=>i.has(yme(o.style.fontFamily))).map(o=>{const g=o.parentStyleSheet?o.parentStyleSheet.href:null;return ume(o.cssText,g,e)}))).join(`
`)}async function yEi(A,e){const t=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await fEi(A,e);if(t){const i=document.createElement("style"),n=document.createTextNode(t);i.appendChild(n),A.firstChild?A.insertBefore(i,A.firstChild):A.appendChild(i)}}async function bEi(A,e={}){const{width:t,height:i}=sme(A,e),n=await N8(A,e,!0);return await yEi(n,e),await dme(n,e),uEi(n,e),await KQi(n,t,i)}async function wEi(A,e={}){const{width:t,height:i}=sme(A,e),n=await bEi(A,e),o=await J8(n),g=document.createElement("canvas"),a=g.getContext("2d"),s=e.pixelRatio||HQi(),I=e.canvasWidth||t,r=e.canvasHeight||i;return g.width=I*s,g.height=r*s,e.skipAutoScale||ZQi(g),g.style.width=`${I}`,g.style.height=`${r}`,e.backgroundColor&&(a.fillStyle=e.backgroundColor,a.fillRect(0,0,g.width,g.height)),a.drawImage(o,0,0,g.width,g.height),g}async function DEi(A,e={}){return(await wEi(A,e)).toDataURL()}async function bme(A){const e=A.container();if(e===null)return{...A,singleChart:""};if(A.charts.length===0)return{...A,nCols:1,nRows:1,charts:[{colIndex:0,rowIndex:0,width:e==null?void 0:e.clientWidth,height:e==null?void 0:e.clientHeight,canvasWidth:e==null?void 0:e.clientWidth,canvasHeight:e==null?void 0:e.clientHeight,data:"",canvas:()=>null}],singleChart:""};{const t=await DEi(e,{width:e==null?void 0:e.scrollWidth,height:e==null?void 0:e.scrollHeight});return{...A,singleChart:t}}}function GEi({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const CyA=p.forwardRef(GEi);function kEi({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 9.75 16.5 12l-2.25 2.25m-4.5 0L7.5 12l2.25-2.25M6 20.25h12A2.25 2.25 0 0 0 20.25 18V6A2.25 2.25 0 0 0 18 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25Z"}))}const JEi=p.forwardRef(kEi);function NEi({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"}))}const YEi=p.forwardRef(NEi);function REi({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m.75 12 3 3m0 0 3-3m-3 3v-6m-1.5-9H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const xEi=p.forwardRef(REi);function FEi({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const wme=p.forwardRef(FEi);/**
 * @license lucide-react v0.341.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var MEi={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.341.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vEi=A=>A.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),LEi=(A,e)=>{const t=p.forwardRef(({color:i="currentColor",size:n=24,strokeWidth:o=2,absoluteStrokeWidth:g,className:a="",children:s,...I},r)=>p.createElement("svg",{ref:r,...MEi,width:n,height:n,stroke:i,strokeWidth:g?Number(o)*24/Number(n):o,className:["lucide",`lucide-${vEi(A)}`,a].join(" "),...I},[...e.map(([C,l])=>p.createElement(C,l)),...Array.isArray(s)?s:[s]]));return t.displayName=`${A}`,t};/**
 * @license lucide-react v0.341.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dme=LEi("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);function SEi(A){return PA("div",{style:{position:"relative"},children:[IA(wme,{...A}),IA("div",{style:{position:"absolute",top:"-2px",right:"-2px",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:"red"}})]})}function HEi(A,e,t,i,n){const[o,g]=p.useState(!1),a=p.useMemo(()=>xEe()&&Me.showCloudTool,[Me.showCloudTool]),s=()=>{Me.setNotification({type:"success",title:"Tips",message:"save success."},4e3),setTimeout(()=>{g(!1)},500)},I=async C=>{var c,B,E,u,d,f,w,y;if(o)return;if(g(!0),vs.track("click",{entity:`save_${C}`,spec_type:A.specType}),((c=e.current)==null?void 0:c.exportChart)===void 0){s();return}let l=await((B=e.current)==null?void 0:B.exportChart("data-url"));try{const G=(E=t.current)==null?void 0:E.exportCode();if(G===void 0)throw new Error("visSpec is undefined");if(((u=t.current)==null?void 0:u.visIndex)!==void 0){const R=G[(d=t.current)==null?void 0:d.visIndex];R.layout.size.mode==="auto"&&(R.layout.size.width=((f=l.container())==null?void 0:f.clientWidth)||320,R.layout.size.height=((w=l.container())==null?void 0:w.clientHeight)||200)}await((y=Hr.comm)==null?void 0:y.sendMsg("update_spec",{visSpec:G,chartData:await bme(l),workflowList:G.map(R=>QnA(R))}))}finally{g(!1)}["json_file","json_ksf"].indexOf(A.specType)===-1?xEe()&&Me.showCloudTool?Me.setUploadSpecModalOpen(!0):Me.setNotification({type:"warning",title:"Tips",message:"spec params is not 'json_file', save is not supported."},4e3):(n(!1),s())},r=()=>{Me.setUploadChartModalOpen(!0),vs.track("click",{entity:"save_icon_form_upload",spec_type:A.specType})};return p.useEffect(()=>{let C=!1;document.addEventListener("keydown",l=>{if((l.metaKey||l.ctrlKey)&&l.key==="s"){if(l.preventDefault(),C)return;C=!0,I("from_keyboard").then(()=>{C=!1})}})},[]),{key:"save",label:"save",icon:C=>o?IA(Dme,{className:"animate-spin"}):i?IA(SEi,{...C}):IA(wme,{...C}),form:PA("div",{className:"flex flex-col",children:[IA(lh,{variant:"ghost","aria-label":"save spec",onClick:()=>I("icon_form_save"),children:"save spec"}),a&&IA(lh,{variant:"ghost","aria-label":"upload chart",onClick:r,children:"upload chart"})]}),onClick:()=>I("icon")}}function ZEi(A){return{key:"export_pygwalker_code",label:"export_code",icon:t=>IA(JEi,{...t}),onClick:()=>{A(!0),vs.track("click",{entity:"export_code_icon"})}}}function WEi(A,e){const[t,i]=p.useState(!1),n=()=>{Me.setNotification({type:"success",title:"Tips",message:PA(ua,{children:[IA("p",{className:"py-1",children:"export success, created new dataframe: "}),IA("p",{className:"font-semibold py-1",children:"`walker.last_exported_dataframe`"}),IA("p",{className:"py-1",children:"if you forgot set variable walker, you can use"}),IA("p",{className:"font-semibold py-1",children:"`pyg.GlobalVarManager.last_exported_dataframe`"}),IA("p",{className:"py-1",children:"to get current exported dataframe"})]})},2e4),setTimeout(()=>{i(!1)},500)};return{key:"export_dataframe",label:"export_dataframe",icon:g=>t?IA(Dme,{className:"animate-spin"}):IA(xEi,{...g}),onClick:async()=>{var g,a,s,I,r,C;if(!t){i(!0),vs.track("click",{entity:"export_dataframe_icon"});try{if(A.parseDslType==="server")await((s=Hr.comm)==null?void 0:s.sendMsg("export_dataframe_by_payload",{payload:{workflow:(g=e.current)==null?void 0:g.workflow},encodings:(a=e.current)==null?void 0:a.currentVis.encodings}));else{const l=JEe("pygwalker_mid_table",JSON.stringify({workflow:(I=e.current)==null?void 0:I.workflow}),JSON.stringify({pygwalker_mid_table:A.fieldMetas}));await((C=Hr.comm)==null?void 0:C.sendMsg("export_dataframe_by_sql",{sql:l,encodings:(r=e.current)==null?void 0:r.currentVis.encodings}))}n()}catch{i(!1)}}}}}const KEi="https://www.runcell.dev/runcell-logo.svg",UEi="https://www.runcell.dev?utm_source=pygwalker";function VEi(){return{key:"runcell",label:"AI Agent",icon:e=>IA("img",{src:KEi,alt:"Jupyter AI Agent",style:{width:(e==null?void 0:e.width)||20,height:(e==null?void 0:e.height)||20}}),onClick:()=>{vs.track("click",{entity:"runcell_icon"}),window.open(UEi,"_blank")}}}var XEi=Object.defineProperty,zEi=(A,e,t)=>e in A?XEi(A,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):A[e]=t,lyA=(A,e,t)=>(zEi(A,typeof e!="symbol"?e+"":e,t),t);let TEi=class{constructor(){lyA(this,"current",this.detect()),lyA(this,"handoffState","pending"),lyA(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Y8=new TEi,TZ=(A,e)=>{Y8.isServer?p.useEffect(A,e):p.useLayoutEffect(A,e)};function mR(A){let e=p.useRef(A);return TZ(()=>{e.current=A},[A]),e}let Qh=function(A){let e=mR(A);return b.useCallback((...t)=>e.current(...t),[e])};function _Ei(A){typeof queueMicrotask=="function"?queueMicrotask(A):Promise.resolve().then(A).catch(e=>setTimeout(()=>{throw e}))}function _Z(){let A=[],e={addEventListener(t,i,n,o){return t.addEventListener(i,n,o),e.add(()=>t.removeEventListener(i,n,o))},requestAnimationFrame(...t){let i=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(i))},nextFrame(...t){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...t))},setTimeout(...t){let i=setTimeout(...t);return e.add(()=>clearTimeout(i))},microTask(...t){let i={current:!0};return _Ei(()=>{i.current&&t[0]()}),e.add(()=>{i.current=!1})},style(t,i,n){let o=t.style.getPropertyValue(i);return Object.assign(t.style,{[i]:n}),this.add(()=>{Object.assign(t.style,{[i]:o})})},group(t){let i=_Z();return t(i),this.add(()=>i.dispose())},add(t){return A.push(t),()=>{let i=A.indexOf(t);if(i>=0)for(let n of A.splice(i,1))n()}},dispose(){for(let t of A.splice(0))t()}};return e}function Gme(){let[A]=p.useState(_Z);return p.useEffect(()=>()=>A.dispose(),[A]),A}function OEi(){let A=typeof document>"u";return"useSyncExternalStore"in bf?(e=>e.useSyncExternalStore)(bf)(()=>()=>{},()=>!1,()=>!A):!1}function kme(){let A=OEi(),[e,t]=p.useState(Y8.isHandoffComplete);return e&&Y8.isHandoffComplete===!1&&t(!1),p.useEffect(()=>{e!==!0&&t(!0)},[e]),p.useEffect(()=>Y8.handoff(),[]),A?!1:e}function VE(A,e,...t){if(A in e){let n=e[A];return typeof n=="function"?n(...t):n}let i=new Error(`Tried to handle "${A}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(n=>`"${n}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,VE),i}let qEi=Symbol();function Jme(...A){let e=p.useRef(A);p.useEffect(()=>{e.current=A},[A]);let t=Qh(i=>{for(let n of e.current)n!=null&&(typeof n=="function"?n(i):n.current=i)});return A.every(i=>i==null||(i==null?void 0:i[qEi]))?void 0:t}function R8(...A){return Array.from(new Set(A.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}var Nme=(A=>(A[A.None=0]="None",A[A.RenderStrategy=1]="RenderStrategy",A[A.Static=2]="Static",A))(Nme||{}),Cf=(A=>(A[A.Unmount=0]="Unmount",A[A.Hidden=1]="Hidden",A))(Cf||{});function Yme({ourProps:A,theirProps:e,slot:t,defaultTag:i,features:n,visible:o=!0,name:g,mergeRefs:a}){a=a??jEi;let s=Rme(e,A);if(o)return x8(s,t,i,g,a);let I=n??0;if(I&2){let{static:r=!1,...C}=s;if(r)return x8(C,t,i,g,a)}if(I&1){let{unmount:r=!0,...C}=s;return VE(r?0:1,{[0](){return null},[1](){return x8({...C,hidden:!0,style:{display:"none"}},t,i,g,a)}})}return x8(s,t,i,g,a)}function x8(A,e={},t,i,n){let{as:o=t,children:g,refName:a="ref",...s}=ByA(A,["unmount","static"]),I=A.ref!==void 0?{[a]:A.ref}:{},r=typeof g=="function"?g(e):g;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(e));let C={};if(e){let l=!1,c=[];for(let[B,E]of Object.entries(e))typeof E=="boolean"&&(l=!0),E===!0&&c.push(B);l&&(C["data-headlessui-state"]=c.join(" "))}if(o===p.Fragment&&Object.keys(xme(s)).length>0){if(!p.isValidElement(r)||Array.isArray(r)&&r.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(E=>`  - ${E}`).join(`
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(E=>`  - ${E}`).join(`
`)].join(`
`));let l=r.props,c=typeof(l==null?void 0:l.className)=="function"?(...E)=>R8(l==null?void 0:l.className(...E),s.className):R8(l==null?void 0:l.className,s.className),B=c?{className:c}:{};return p.cloneElement(r,Object.assign({},Rme(r.props,xme(ByA(s,["ref"]))),C,I,{ref:n(r.ref,I.ref)},B))}return p.createElement(o,Object.assign({},ByA(s,["ref"]),o!==p.Fragment&&I,o!==p.Fragment&&C),r)}function jEi(...A){return A.every(e=>e==null)?void 0:e=>{for(let t of A)t!=null&&(typeof t=="function"?t(e):t.current=e)}}function Rme(...A){if(A.length===0)return{};if(A.length===1)return A[0];let e={},t={};for(let i of A)for(let n in i)n.startsWith("on")&&typeof i[n]=="function"?(t[n]!=null||(t[n]=[]),t[n].push(i[n])):e[n]=i[n];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(t).map(i=>[i,void 0])));for(let i in t)Object.assign(e,{[i](n,...o){let g=t[i];for(let a of g){if((n instanceof Event||(n==null?void 0:n.nativeEvent)instanceof Event)&&n.defaultPrevented)return;a(n,...o)}}});return e}function cyA(A){var e;return Object.assign(p.forwardRef(A),{displayName:(e=A.displayName)!=null?e:A.name})}function xme(A){let e=Object.assign({},A);for(let t in e)e[t]===void 0&&delete e[t];return e}function ByA(A,e=[]){let t=Object.assign({},A);for(let i of e)i in t&&delete t[i];return t}let QyA=p.createContext(null);QyA.displayName="OpenClosedContext";var Eh=(A=>(A[A.Open=1]="Open",A[A.Closed=2]="Closed",A[A.Closing=4]="Closing",A[A.Opening=8]="Opening",A))(Eh||{});function Fme(){return p.useContext(QyA)}function PEi({value:A,children:e}){return b.createElement(QyA.Provider,{value:A},e)}function EyA(){let A=p.useRef(!1);return TZ(()=>(A.current=!0,()=>{A.current=!1}),[]),A}function $Ei(A=0){let[e,t]=p.useState(A),i=EyA(),n=p.useCallback(s=>{i.current&&t(I=>I|s)},[e,i]),o=p.useCallback(s=>Boolean(e&s),[e]),g=p.useCallback(s=>{i.current&&t(I=>I&~s)},[t,i]),a=p.useCallback(s=>{i.current&&t(I=>I^s)},[t]);return{flags:e,addFlag:n,hasFlag:o,removeFlag:g,toggleFlag:a}}function Aui(A){let e={called:!1};return(...t)=>{if(!e.called)return e.called=!0,A(...t)}}function uyA(A,...e){A&&e.length>0&&A.classList.add(...e)}function dyA(A,...e){A&&e.length>0&&A.classList.remove(...e)}function eui(A,e){let t=_Z();if(!A)return t.dispose;let{transitionDuration:i,transitionDelay:n}=getComputedStyle(A),[o,g]=[i,n].map(s=>{let[I=0]=s.split(",").filter(Boolean).map(r=>r.includes("ms")?parseFloat(r):parseFloat(r)*1e3).sort((r,C)=>C-r);return I}),a=o+g;if(a!==0){t.group(I=>{I.setTimeout(()=>{e(),I.dispose()},a),I.addEventListener(A,"transitionrun",r=>{r.target===r.currentTarget&&I.dispose()})});let s=t.addEventListener(A,"transitionend",I=>{I.target===I.currentTarget&&(e(),s())})}else e();return t.add(()=>e()),t.dispose}function tui(A,e,t,i){let n=t?"enter":"leave",o=_Z(),g=i!==void 0?Aui(i):()=>{};n==="enter"&&(A.removeAttribute("hidden"),A.style.display="");let a=VE(n,{enter:()=>e.enter,leave:()=>e.leave}),s=VE(n,{enter:()=>e.enterTo,leave:()=>e.leaveTo}),I=VE(n,{enter:()=>e.enterFrom,leave:()=>e.leaveFrom});return dyA(A,...e.base,...e.enter,...e.enterTo,...e.enterFrom,...e.leave,...e.leaveFrom,...e.leaveTo,...e.entered),uyA(A,...e.base,...a,...I),o.nextFrame(()=>{dyA(A,...e.base,...a,...I),uyA(A,...e.base,...a,...s),eui(A,()=>(dyA(A,...e.base,...a),uyA(A,...e.base,...e.entered),g()))}),o.dispose}function iui({immediate:A,container:e,direction:t,classes:i,onStart:n,onStop:o}){let g=EyA(),a=Gme(),s=mR(t);TZ(()=>{A&&(s.current="enter")},[A]),TZ(()=>{let I=_Z();a.add(I.dispose);let r=e.current;if(r&&s.current!=="idle"&&g.current)return I.dispose(),n.current(s.current),I.add(tui(r,i.current,s.current==="enter",()=>{I.dispose(),o.current(s.current)})),I.dispose},[t])}function lf(A=""){return A.split(/\s+/).filter(e=>e.length>1)}let F8=p.createContext(null);F8.displayName="TransitionContext";var nui=(A=>(A.Visible="visible",A.Hidden="hidden",A))(nui||{});function oui(){let A=p.useContext(F8);if(A===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return A}function gui(){let A=p.useContext(M8);if(A===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return A}let M8=p.createContext(null);M8.displayName="NestingContext";function v8(A){return"children"in A?v8(A.children):A.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function Mme(A,e){let t=mR(A),i=p.useRef([]),n=EyA(),o=Gme(),g=Qh((c,B=Cf.Hidden)=>{let E=i.current.findIndex(({el:u})=>u===c);E!==-1&&(VE(B,{[Cf.Unmount](){i.current.splice(E,1)},[Cf.Hidden](){i.current[E].state="hidden"}}),o.microTask(()=>{var u;!v8(i)&&n.current&&((u=t.current)==null||u.call(t))}))}),a=Qh(c=>{let B=i.current.find(({el:E})=>E===c);return B?B.state!=="visible"&&(B.state="visible"):i.current.push({el:c,state:"visible"}),()=>g(c,Cf.Unmount)}),s=p.useRef([]),I=p.useRef(Promise.resolve()),r=p.useRef({enter:[],leave:[],idle:[]}),C=Qh((c,B,E)=>{s.current.splice(0),e&&(e.chains.current[B]=e.chains.current[B].filter(([u])=>u!==c)),e==null||e.chains.current[B].push([c,new Promise(u=>{s.current.push(u)})]),e==null||e.chains.current[B].push([c,new Promise(u=>{Promise.all(r.current[B].map(([d,f])=>f)).then(()=>u())})]),B==="enter"?I.current=I.current.then(()=>e==null?void 0:e.wait.current).then(()=>E(B)):E(B)}),l=Qh((c,B,E)=>{Promise.all(r.current[B].splice(0).map(([u,d])=>d)).then(()=>{var u;(u=s.current.shift())==null||u()}).then(()=>E(B))});return p.useMemo(()=>({children:i,register:a,unregister:g,onStart:C,onStop:l,wait:I,chains:r}),[a,g,i,C,l,r,I])}function aui(){}let sui=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function vme(A){var e;let t={};for(let i of sui)t[i]=(e=A[i])!=null?e:aui;return t}function rui(A){let e=p.useRef(vme(A));return p.useEffect(()=>{e.current=vme(A)},[A]),e}let Iui="div",Lme=Nme.RenderStrategy;function Cui(A,e){var t,i;let{beforeEnter:n,afterEnter:o,beforeLeave:g,afterLeave:a,enter:s,enterFrom:I,enterTo:r,entered:C,leave:l,leaveFrom:c,leaveTo:B,...E}=A,u=p.useRef(null),d=Jme(u,e),f=(t=E.unmount)==null||t?Cf.Unmount:Cf.Hidden,{show:w,appear:y,initial:G}=oui(),[R,x]=p.useState(w?"visible":"hidden"),F=gui(),{register:Q,unregister:k}=F;p.useEffect(()=>Q(u),[Q,u]),p.useEffect(()=>{if(f===Cf.Hidden&&u.current){if(w&&R!=="visible"){x("visible");return}return VE(R,{hidden:()=>k(u),visible:()=>Q(u)})}},[R,u,Q,k,w,f]);let h=mR({base:lf(E.className),enter:lf(s),enterFrom:lf(I),enterTo:lf(r),entered:lf(C),leave:lf(l),leaveFrom:lf(c),leaveTo:lf(B)}),N=rui({beforeEnter:n,afterEnter:o,beforeLeave:g,afterLeave:a}),v=kme();p.useEffect(()=>{if(v&&R==="visible"&&u.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[u,R,v]);let K=G&&!y,U=y&&w&&G,V=(()=>!v||K?"idle":w?"enter":"leave")(),X=$Ei(0),_=Qh(eA=>VE(eA,{enter:()=>{X.addFlag(Eh.Opening),N.current.beforeEnter()},leave:()=>{X.addFlag(Eh.Closing),N.current.beforeLeave()},idle:()=>{}})),q=Qh(eA=>VE(eA,{enter:()=>{X.removeFlag(Eh.Opening),N.current.afterEnter()},leave:()=>{X.removeFlag(Eh.Closing),N.current.afterLeave()},idle:()=>{}})),$=Mme(()=>{x("hidden"),k(u)},F),nA=p.useRef(!1);iui({immediate:U,container:u,classes:h,direction:V,onStart:mR(eA=>{nA.current=!0,$.onStart(u,eA,_)}),onStop:mR(eA=>{nA.current=!1,$.onStop(u,eA,q),eA==="leave"&&!v8($)&&(x("hidden"),k(u))})});let j=E,O={ref:d};return U?j={...j,className:R8(E.className,...h.current.enter,...h.current.enterFrom)}:nA.current&&(j.className=R8(E.className,(i=u.current)==null?void 0:i.className),j.className===""&&delete j.className),b.createElement(M8.Provider,{value:$},b.createElement(PEi,{value:VE(R,{visible:Eh.Open,hidden:Eh.Closed})|X.flags},Yme({ourProps:O,theirProps:j,defaultTag:Iui,features:Lme,visible:R==="visible",name:"Transition.Child"})))}function lui(A,e){let{show:t,appear:i=!1,unmount:n=!0,...o}=A,g=p.useRef(null),a=Jme(g,e);kme();let s=Fme();if(t===void 0&&s!==null&&(t=(s&Eh.Open)===Eh.Open),![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[I,r]=p.useState(t?"visible":"hidden"),C=Mme(()=>{r("hidden")}),[l,c]=p.useState(!0),B=p.useRef([t]);TZ(()=>{l!==!1&&B.current[B.current.length-1]!==t&&(B.current.push(t),c(!1))},[B,t]);let E=p.useMemo(()=>({show:t,appear:i,initial:l}),[t,i,l]);p.useEffect(()=>{if(t)r("visible");else if(!v8(C))r("hidden");else{let w=g.current;if(!w)return;let y=w.getBoundingClientRect();y.x===0&&y.y===0&&y.width===0&&y.height===0&&r("hidden")}},[t,C]);let u={unmount:n},d=Qh(()=>{var w;l&&c(!1),(w=A.beforeEnter)==null||w.call(A)}),f=Qh(()=>{var w;l&&c(!1),(w=A.beforeLeave)==null||w.call(A)});return b.createElement(M8.Provider,{value:C},b.createElement(F8.Provider,{value:E},Yme({ourProps:{...u,as:p.Fragment,children:b.createElement(Sme,{ref:a,...u,...o,beforeEnter:d,beforeLeave:f})},theirProps:{},defaultTag:p.Fragment,features:Lme,visible:I==="visible",name:"Transition"})))}function cui(A,e){let t=p.useContext(F8)!==null,i=Fme()!==null;return b.createElement(b.Fragment,null,!t&&i?b.createElement(hyA,{ref:e,...A}):b.createElement(Sme,{ref:e,...A}))}let hyA=cyA(lui),Sme=cyA(Cui),Bui=cyA(cui),Qui=Object.assign(hyA,{Child:Bui,Root:hyA});function Eui({title:A,titleId:e,...t},i){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},t),A?p.createElement("title",{id:e},A):null,p.createElement("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"}))}const Hme=p.forwardRef(Eui);function uui(A){switch(A){case"success":return IA(CyA,{className:"h-6 w-6 text-green-400","aria-hidden":"true"});case"error":return IA(Hme,{className:"h-6 w-6 text-red-400","aria-hidden":"true"});case"info":return IA(CyA,{className:"h-6 w-6 text-blue-400","aria-hidden":"true"});case"warning":return IA(CyA,{className:"h-6 w-6 text-yellow-400","aria-hidden":"true"})}}const dui=Gu(()=>IA("div",{children:Me.notification&&IA("div",{"aria-live":"assertive",className:"pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-[25539]",children:IA("div",{className:"flex w-full flex-col items-center space-y-4 sm:items-end",children:IA(Qui,{show:Me.notification!=null,as:p.Fragment,enter:"transform ease-out duration-300 transition",enterFrom:"translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2",enterTo:"translate-y-0 opacity-100 sm:translate-x-0",leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:IA("div",{className:"pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-zinc-700 shadow-lg ring-1 ring-black ring-opacity-5",children:IA("div",{className:"p-4",children:PA("div",{className:"flex items-start",children:[IA("div",{className:"flex-shrink-0",children:uui(Me.notification.type)}),PA("div",{className:"ml-3 w-0 flex-1 pt-0.5",children:[IA("p",{className:"text-sm font-medium text-gray-50",children:Me.notification.title}),IA("p",{className:"mt-1 text-sm text-gray-300",children:Me.notification.message})]}),IA("div",{className:"ml-4 flex flex-shrink-0",children:PA("button",{type:"button",className:"inline-flex rounded-md bg-zinc-900 text-gray-400 hover:text-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",onClick:()=>{Me.setNotification(null)},children:[IA("span",{className:"sr-only",children:"Close"}),IA(Hme,{className:"h-5 w-5","aria-hidden":"true"})]})})]})})})})})})}));function Zme(A,[e,t]){return Math.min(t,Math.max(e,A))}const hui=["top","right","bottom","left"],cf=Math.min,gC=Math.max,L8=Math.round,S8=Math.floor,XE=A=>({x:A,y:A}),mui={left:"right",right:"left",bottom:"top",top:"bottom"},pui={start:"end",end:"start"};function myA(A,e,t){return gC(A,cf(e,t))}function uh(A,e){return typeof A=="function"?A(e):A}function dh(A){return A.split("-")[0]}function pR(A){return A.split("-")[1]}function pyA(A){return A==="x"?"y":"x"}function fyA(A){return A==="y"?"height":"width"}const fui=new Set(["top","bottom"]);function zE(A){return fui.has(dh(A))?"y":"x"}function yyA(A){return pyA(zE(A))}function yui(A,e,t){t===void 0&&(t=!1);const i=pR(A),n=yyA(A),o=fyA(n);let g=n==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(g=H8(g)),[g,H8(g)]}function bui(A){const e=H8(A);return[byA(A),e,byA(e)]}function byA(A){return A.replace(/start|end/g,e=>pui[e])}const Wme=["left","right"],Kme=["right","left"],wui=["top","bottom"],Dui=["bottom","top"];function Gui(A,e,t){switch(A){case"top":case"bottom":return t?e?Kme:Wme:e?Wme:Kme;case"left":case"right":return e?wui:Dui;default:return[]}}function kui(A,e,t,i){const n=pR(A);let o=Gui(dh(A),t==="start",i);return n&&(o=o.map(g=>g+"-"+n),e&&(o=o.concat(o.map(byA)))),o}function H8(A){return A.replace(/left|right|bottom|top/g,e=>mui[e])}function Jui(A){return{top:0,right:0,bottom:0,left:0,...A}}function Ume(A){return typeof A!="number"?Jui(A):{top:A,right:A,bottom:A,left:A}}function Z8(A){const{x:e,y:t,width:i,height:n}=A;return{width:i,height:n,top:t,left:e,right:e+i,bottom:t+n,x:e,y:t}}function Vme(A,e,t){let{reference:i,floating:n}=A;const o=zE(e),g=yyA(e),a=fyA(g),s=dh(e),I=o==="y",r=i.x+i.width/2-n.width/2,C=i.y+i.height/2-n.height/2,l=i[a]/2-n[a]/2;let c;switch(s){case"top":c={x:r,y:i.y-n.height};break;case"bottom":c={x:r,y:i.y+i.height};break;case"right":c={x:i.x+i.width,y:C};break;case"left":c={x:i.x-n.width,y:C};break;default:c={x:i.x,y:i.y}}switch(pR(e)){case"start":c[g]-=l*(t&&I?-1:1);break;case"end":c[g]+=l*(t&&I?-1:1);break}return c}const Nui=async(A,e,t)=>{const{placement:i="bottom",strategy:n="absolute",middleware:o=[],platform:g}=t,a=o.filter(Boolean),s=await(g.isRTL==null?void 0:g.isRTL(e));let I=await g.getElementRects({reference:A,floating:e,strategy:n}),{x:r,y:C}=Vme(I,i,s),l=i,c={},B=0;for(let E=0;E<a.length;E++){const{name:u,fn:d}=a[E],{x:f,y:w,data:y,reset:G}=await d({x:r,y:C,initialPlacement:i,placement:l,strategy:n,middlewareData:c,rects:I,platform:g,elements:{reference:A,floating:e}});r=f??r,C=w??C,c={...c,[u]:{...c[u],...y}},G&&B<=50&&(B++,typeof G=="object"&&(G.placement&&(l=G.placement),G.rects&&(I=G.rects===!0?await g.getElementRects({reference:A,floating:e,strategy:n}):G.rects),{x:r,y:C}=Vme(I,l,s)),E=-1)}return{x:r,y:C,placement:l,strategy:n,middlewareData:c}};async function OZ(A,e){var t;e===void 0&&(e={});const{x:i,y:n,platform:o,rects:g,elements:a,strategy:s}=A,{boundary:I="clippingAncestors",rootBoundary:r="viewport",elementContext:C="floating",altBoundary:l=!1,padding:c=0}=uh(e,A),B=Ume(c),u=a[l?C==="floating"?"reference":"floating":C],d=Z8(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(u)))==null||t?u:u.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:I,rootBoundary:r,strategy:s})),f=C==="floating"?{x:i,y:n,width:g.floating.width,height:g.floating.height}:g.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),y=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},G=Z8(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:f,offsetParent:w,strategy:s}):f);return{top:(d.top-G.top+B.top)/y.y,bottom:(G.bottom-d.bottom+B.bottom)/y.y,left:(d.left-G.left+B.left)/y.x,right:(G.right-d.right+B.right)/y.x}}const Yui=A=>({name:"arrow",options:A,async fn(e){const{x:t,y:i,placement:n,rects:o,platform:g,elements:a,middlewareData:s}=e,{element:I,padding:r=0}=uh(A,e)||{};if(I==null)return{};const C=Ume(r),l={x:t,y:i},c=yyA(n),B=fyA(c),E=await g.getDimensions(I),u=c==="y",d=u?"top":"left",f=u?"bottom":"right",w=u?"clientHeight":"clientWidth",y=o.reference[B]+o.reference[c]-l[c]-o.floating[B],G=l[c]-o.reference[c],R=await(g.getOffsetParent==null?void 0:g.getOffsetParent(I));let x=R?R[w]:0;(!x||!await(g.isElement==null?void 0:g.isElement(R)))&&(x=a.floating[w]||o.floating[B]);const F=y/2-G/2,Q=x/2-E[B]/2-1,k=cf(C[d],Q),h=cf(C[f],Q),N=k,v=x-E[B]-h,K=x/2-E[B]/2+F,U=myA(N,K,v),V=!s.arrow&&pR(n)!=null&&K!==U&&o.reference[B]/2-(K<N?k:h)-E[B]/2<0,X=V?K<N?K-N:K-v:0;return{[c]:l[c]+X,data:{[c]:U,centerOffset:K-U-X,...V&&{alignmentOffset:X}},reset:V}}}),Rui=function(A){return A===void 0&&(A={}),{name:"flip",options:A,async fn(e){var t,i;const{placement:n,middlewareData:o,rects:g,initialPlacement:a,platform:s,elements:I}=e,{mainAxis:r=!0,crossAxis:C=!0,fallbackPlacements:l,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:B="none",flipAlignment:E=!0,...u}=uh(A,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const d=dh(n),f=zE(a),w=dh(a)===a,y=await(s.isRTL==null?void 0:s.isRTL(I.floating)),G=l||(w||!E?[H8(a)]:bui(a)),R=B!=="none";!l&&R&&G.push(...kui(a,E,B,y));const x=[a,...G],F=await OZ(e,u),Q=[];let k=((i=o.flip)==null?void 0:i.overflows)||[];if(r&&Q.push(F[d]),C){const K=yui(n,g,y);Q.push(F[K[0]],F[K[1]])}if(k=[...k,{placement:n,overflows:Q}],!Q.every(K=>K<=0)){var h,N;const K=(((h=o.flip)==null?void 0:h.index)||0)+1,U=x[K];if(U&&(!(C==="alignment"?f!==zE(U):!1)||k.every(_=>zE(_.placement)===f?_.overflows[0]>0:!0)))return{data:{index:K,overflows:k},reset:{placement:U}};let V=(N=k.filter(X=>X.overflows[0]<=0).sort((X,_)=>X.overflows[1]-_.overflows[1])[0])==null?void 0:N.placement;if(!V)switch(c){case"bestFit":{var v;const X=(v=k.filter(_=>{if(R){const q=zE(_.placement);return q===f||q==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(q=>q>0).reduce((q,$)=>q+$,0)]).sort((_,q)=>_[1]-q[1])[0])==null?void 0:v[0];X&&(V=X);break}case"initialPlacement":V=a;break}if(n!==V)return{reset:{placement:V}}}return{}}}};function Xme(A,e){return{top:A.top-e.height,right:A.right-e.width,bottom:A.bottom-e.height,left:A.left-e.width}}function zme(A){return hui.some(e=>A[e]>=0)}const xui=function(A){return A===void 0&&(A={}),{name:"hide",options:A,async fn(e){const{rects:t}=e,{strategy:i="referenceHidden",...n}=uh(A,e);switch(i){case"referenceHidden":{const o=await OZ(e,{...n,elementContext:"reference"}),g=Xme(o,t.reference);return{data:{referenceHiddenOffsets:g,referenceHidden:zme(g)}}}case"escaped":{const o=await OZ(e,{...n,altBoundary:!0}),g=Xme(o,t.floating);return{data:{escapedOffsets:g,escaped:zme(g)}}}default:return{}}}}},Tme=new Set(["left","top"]);async function Fui(A,e){const{placement:t,platform:i,elements:n}=A,o=await(i.isRTL==null?void 0:i.isRTL(n.floating)),g=dh(t),a=pR(t),s=zE(t)==="y",I=Tme.has(g)?-1:1,r=o&&s?-1:1,C=uh(e,A);let{mainAxis:l,crossAxis:c,alignmentAxis:B}=typeof C=="number"?{mainAxis:C,crossAxis:0,alignmentAxis:null}:{mainAxis:C.mainAxis||0,crossAxis:C.crossAxis||0,alignmentAxis:C.alignmentAxis};return a&&typeof B=="number"&&(c=a==="end"?B*-1:B),s?{x:c*r,y:l*I}:{x:l*I,y:c*r}}const Mui=function(A){return A===void 0&&(A=0),{name:"offset",options:A,async fn(e){var t,i;const{x:n,y:o,placement:g,middlewareData:a}=e,s=await Fui(e,A);return g===((t=a.offset)==null?void 0:t.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:n+s.x,y:o+s.y,data:{...s,placement:g}}}}},vui=function(A){return A===void 0&&(A={}),{name:"shift",options:A,async fn(e){const{x:t,y:i,placement:n}=e,{mainAxis:o=!0,crossAxis:g=!1,limiter:a={fn:u=>{let{x:d,y:f}=u;return{x:d,y:f}}},...s}=uh(A,e),I={x:t,y:i},r=await OZ(e,s),C=zE(dh(n)),l=pyA(C);let c=I[l],B=I[C];if(o){const u=l==="y"?"top":"left",d=l==="y"?"bottom":"right",f=c+r[u],w=c-r[d];c=myA(f,c,w)}if(g){const u=C==="y"?"top":"left",d=C==="y"?"bottom":"right",f=B+r[u],w=B-r[d];B=myA(f,B,w)}const E=a.fn({...e,[l]:c,[C]:B});return{...E,data:{x:E.x-t,y:E.y-i,enabled:{[l]:o,[C]:g}}}}}},Lui=function(A){return A===void 0&&(A={}),{options:A,fn(e){const{x:t,y:i,placement:n,rects:o,middlewareData:g}=e,{offset:a=0,mainAxis:s=!0,crossAxis:I=!0}=uh(A,e),r={x:t,y:i},C=zE(n),l=pyA(C);let c=r[l],B=r[C];const E=uh(a,e),u=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(s){const w=l==="y"?"height":"width",y=o.reference[l]-o.floating[w]+u.mainAxis,G=o.reference[l]+o.reference[w]-u.mainAxis;c<y?c=y:c>G&&(c=G)}if(I){var d,f;const w=l==="y"?"width":"height",y=Tme.has(dh(n)),G=o.reference[C]-o.floating[w]+(y&&((d=g.offset)==null?void 0:d[C])||0)+(y?0:u.crossAxis),R=o.reference[C]+o.reference[w]+(y?0:((f=g.offset)==null?void 0:f[C])||0)-(y?u.crossAxis:0);B<G?B=G:B>R&&(B=R)}return{[l]:c,[C]:B}}}},Sui=function(A){return A===void 0&&(A={}),{name:"size",options:A,async fn(e){var t,i;const{placement:n,rects:o,platform:g,elements:a}=e,{apply:s=()=>{},...I}=uh(A,e),r=await OZ(e,I),C=dh(n),l=pR(n),c=zE(n)==="y",{width:B,height:E}=o.floating;let u,d;C==="top"||C==="bottom"?(u=C,d=l===(await(g.isRTL==null?void 0:g.isRTL(a.floating))?"start":"end")?"left":"right"):(d=C,u=l==="end"?"top":"bottom");const f=E-r.top-r.bottom,w=B-r.left-r.right,y=cf(E-r[u],f),G=cf(B-r[d],w),R=!e.middlewareData.shift;let x=y,F=G;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(F=w),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(x=f),R&&!l){const k=gC(r.left,0),h=gC(r.right,0),N=gC(r.top,0),v=gC(r.bottom,0);c?F=B-2*(k!==0||h!==0?k+h:gC(r.left,r.right)):x=E-2*(N!==0||v!==0?N+v:gC(r.top,r.bottom))}await s({...e,availableWidth:F,availableHeight:x});const Q=await g.getDimensions(a.floating);return B!==Q.width||E!==Q.height?{reset:{rects:!0}}:{}}}};function W8(){return typeof window<"u"}function fR(A){return _me(A)?(A.nodeName||"").toLowerCase():"#document"}function aC(A){var e;return(A==null||(e=A.ownerDocument)==null?void 0:e.defaultView)||window}function TE(A){var e;return(e=(_me(A)?A.ownerDocument:A.document)||window.document)==null?void 0:e.documentElement}function _me(A){return W8()?A instanceof Node||A instanceof aC(A).Node:!1}function yB(A){return W8()?A instanceof Element||A instanceof aC(A).Element:!1}function _E(A){return W8()?A instanceof HTMLElement||A instanceof aC(A).HTMLElement:!1}function Ome(A){return!W8()||typeof ShadowRoot>"u"?!1:A instanceof ShadowRoot||A instanceof aC(A).ShadowRoot}const Hui=new Set(["inline","contents"]);function qZ(A){const{overflow:e,overflowX:t,overflowY:i,display:n}=bB(A);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!Hui.has(n)}const Zui=new Set(["table","td","th"]);function Wui(A){return Zui.has(fR(A))}const Kui=[":popover-open",":modal"];function K8(A){return Kui.some(e=>{try{return A.matches(e)}catch{return!1}})}const Uui=["transform","translate","scale","rotate","perspective"],Vui=["transform","translate","scale","rotate","perspective","filter"],Xui=["paint","layout","strict","content"];function wyA(A){const e=DyA(),t=yB(A)?bB(A):A;return Uui.some(i=>t[i]?t[i]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||Vui.some(i=>(t.willChange||"").includes(i))||Xui.some(i=>(t.contain||"").includes(i))}function zui(A){let e=Bf(A);for(;_E(e)&&!yR(e);){if(wyA(e))return e;if(K8(e))return null;e=Bf(e)}return null}function DyA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Tui=new Set(["html","body","#document"]);function yR(A){return Tui.has(fR(A))}function bB(A){return aC(A).getComputedStyle(A)}function U8(A){return yB(A)?{scrollLeft:A.scrollLeft,scrollTop:A.scrollTop}:{scrollLeft:A.scrollX,scrollTop:A.scrollY}}function Bf(A){if(fR(A)==="html")return A;const e=A.assignedSlot||A.parentNode||Ome(A)&&A.host||TE(A);return Ome(e)?e.host:e}function qme(A){const e=Bf(A);return yR(e)?A.ownerDocument?A.ownerDocument.body:A.body:_E(e)&&qZ(e)?e:qme(e)}function jZ(A,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const n=qme(A),o=n===((i=A.ownerDocument)==null?void 0:i.body),g=aC(n);if(o){const a=GyA(g);return e.concat(g,g.visualViewport||[],qZ(n)?n:[],a&&t?jZ(a):[])}return e.concat(n,jZ(n,[],t))}function GyA(A){return A.parent&&Object.getPrototypeOf(A.parent)?A.frameElement:null}function jme(A){const e=bB(A);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const n=_E(A),o=n?A.offsetWidth:t,g=n?A.offsetHeight:i,a=L8(t)!==o||L8(i)!==g;return a&&(t=o,i=g),{width:t,height:i,$:a}}function kyA(A){return yB(A)?A:A.contextElement}function bR(A){const e=kyA(A);if(!_E(e))return XE(1);const t=e.getBoundingClientRect(),{width:i,height:n,$:o}=jme(e);let g=(o?L8(t.width):t.width)/i,a=(o?L8(t.height):t.height)/n;return(!g||!Number.isFinite(g))&&(g=1),(!a||!Number.isFinite(a))&&(a=1),{x:g,y:a}}const _ui=XE(0);function Pme(A){const e=aC(A);return!DyA()||!e.visualViewport?_ui:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Oui(A,e,t){return e===void 0&&(e=!1),!t||e&&t!==aC(A)?!1:e}function rD(A,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const n=A.getBoundingClientRect(),o=kyA(A);let g=XE(1);e&&(i?yB(i)&&(g=bR(i)):g=bR(A));const a=Oui(o,t,i)?Pme(o):XE(0);let s=(n.left+a.x)/g.x,I=(n.top+a.y)/g.y,r=n.width/g.x,C=n.height/g.y;if(o){const l=aC(o),c=i&&yB(i)?aC(i):i;let B=l,E=GyA(B);for(;E&&i&&c!==B;){const u=bR(E),d=E.getBoundingClientRect(),f=bB(E),w=d.left+(E.clientLeft+parseFloat(f.paddingLeft))*u.x,y=d.top+(E.clientTop+parseFloat(f.paddingTop))*u.y;s*=u.x,I*=u.y,r*=u.x,C*=u.y,s+=w,I+=y,B=aC(E),E=GyA(B)}}return Z8({width:r,height:C,x:s,y:I})}function V8(A,e){const t=U8(A).scrollLeft;return e?e.left+t:rD(TE(A)).left+t}function $me(A,e){const t=A.getBoundingClientRect(),i=t.left+e.scrollLeft-V8(A,t),n=t.top+e.scrollTop;return{x:i,y:n}}function qui(A){let{elements:e,rect:t,offsetParent:i,strategy:n}=A;const o=n==="fixed",g=TE(i),a=e?K8(e.floating):!1;if(i===g||a&&o)return t;let s={scrollLeft:0,scrollTop:0},I=XE(1);const r=XE(0),C=_E(i);if((C||!C&&!o)&&((fR(i)!=="body"||qZ(g))&&(s=U8(i)),_E(i))){const c=rD(i);I=bR(i),r.x=c.x+i.clientLeft,r.y=c.y+i.clientTop}const l=g&&!C&&!o?$me(g,s):XE(0);return{width:t.width*I.x,height:t.height*I.y,x:t.x*I.x-s.scrollLeft*I.x+r.x+l.x,y:t.y*I.y-s.scrollTop*I.y+r.y+l.y}}function jui(A){return Array.from(A.getClientRects())}function Pui(A){const e=TE(A),t=U8(A),i=A.ownerDocument.body,n=gC(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=gC(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let g=-t.scrollLeft+V8(A);const a=-t.scrollTop;return bB(i).direction==="rtl"&&(g+=gC(e.clientWidth,i.clientWidth)-n),{width:n,height:o,x:g,y:a}}const Ape=25;function $ui(A,e){const t=aC(A),i=TE(A),n=t.visualViewport;let o=i.clientWidth,g=i.clientHeight,a=0,s=0;if(n){o=n.width,g=n.height;const r=DyA();(!r||r&&e==="fixed")&&(a=n.offsetLeft,s=n.offsetTop)}const I=V8(i);if(I<=0){const r=i.ownerDocument,C=r.body,l=getComputedStyle(C),c=r.compatMode==="CSS1Compat"&&parseFloat(l.marginLeft)+parseFloat(l.marginRight)||0,B=Math.abs(i.clientWidth-C.clientWidth-c);B<=Ape&&(o-=B)}else I<=Ape&&(o+=I);return{width:o,height:g,x:a,y:s}}const Adi=new Set(["absolute","fixed"]);function edi(A,e){const t=rD(A,!0,e==="fixed"),i=t.top+A.clientTop,n=t.left+A.clientLeft,o=_E(A)?bR(A):XE(1),g=A.clientWidth*o.x,a=A.clientHeight*o.y,s=n*o.x,I=i*o.y;return{width:g,height:a,x:s,y:I}}function epe(A,e,t){let i;if(e==="viewport")i=$ui(A,t);else if(e==="document")i=Pui(TE(A));else if(yB(e))i=edi(e,t);else{const n=Pme(A);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Z8(i)}function tpe(A,e){const t=Bf(A);return t===e||!yB(t)||yR(t)?!1:bB(t).position==="fixed"||tpe(t,e)}function tdi(A,e){const t=e.get(A);if(t)return t;let i=jZ(A,[],!1).filter(a=>yB(a)&&fR(a)!=="body"),n=null;const o=bB(A).position==="fixed";let g=o?Bf(A):A;for(;yB(g)&&!yR(g);){const a=bB(g),s=wyA(g);!s&&a.position==="fixed"&&(n=null),(o?!s&&!n:!s&&a.position==="static"&&!!n&&Adi.has(n.position)||qZ(g)&&!s&&tpe(A,g))?i=i.filter(r=>r!==g):n=a,g=Bf(g)}return e.set(A,i),i}function idi(A){let{element:e,boundary:t,rootBoundary:i,strategy:n}=A;const g=[...t==="clippingAncestors"?K8(e)?[]:tdi(e,this._c):[].concat(t),i],a=g[0],s=g.reduce((I,r)=>{const C=epe(e,r,n);return I.top=gC(C.top,I.top),I.right=cf(C.right,I.right),I.bottom=cf(C.bottom,I.bottom),I.left=gC(C.left,I.left),I},epe(e,a,n));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function ndi(A){const{width:e,height:t}=jme(A);return{width:e,height:t}}function odi(A,e,t){const i=_E(e),n=TE(e),o=t==="fixed",g=rD(A,!0,o,e);let a={scrollLeft:0,scrollTop:0};const s=XE(0);function I(){s.x=V8(n)}if(i||!i&&!o)if((fR(e)!=="body"||qZ(n))&&(a=U8(e)),i){const c=rD(e,!0,o,e);s.x=c.x+e.clientLeft,s.y=c.y+e.clientTop}else n&&I();o&&!i&&n&&I();const r=n&&!i&&!o?$me(n,a):XE(0),C=g.left+a.scrollLeft-s.x-r.x,l=g.top+a.scrollTop-s.y-r.y;return{x:C,y:l,width:g.width,height:g.height}}function JyA(A){return bB(A).position==="static"}function ipe(A,e){if(!_E(A)||bB(A).position==="fixed")return null;if(e)return e(A);let t=A.offsetParent;return TE(A)===t&&(t=t.ownerDocument.body),t}function npe(A,e){const t=aC(A);if(K8(A))return t;if(!_E(A)){let n=Bf(A);for(;n&&!yR(n);){if(yB(n)&&!JyA(n))return n;n=Bf(n)}return t}let i=ipe(A,e);for(;i&&Wui(i)&&JyA(i);)i=ipe(i,e);return i&&yR(i)&&JyA(i)&&!wyA(i)?t:i||zui(A)||t}const gdi=async function(A){const e=this.getOffsetParent||npe,t=this.getDimensions,i=await t(A.floating);return{reference:odi(A.reference,await e(A.floating),A.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function adi(A){return bB(A).direction==="rtl"}const sdi={convertOffsetParentRelativeRectToViewportRelativeRect:qui,getDocumentElement:TE,getClippingRect:idi,getOffsetParent:npe,getElementRects:gdi,getClientRects:jui,getDimensions:ndi,getScale:bR,isElement:yB,isRTL:adi};function ope(A,e){return A.x===e.x&&A.y===e.y&&A.width===e.width&&A.height===e.height}function rdi(A,e){let t=null,i;const n=TE(A);function o(){var a;clearTimeout(i),(a=t)==null||a.disconnect(),t=null}function g(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),o();const I=A.getBoundingClientRect(),{left:r,top:C,width:l,height:c}=I;if(a||e(),!l||!c)return;const B=S8(C),E=S8(n.clientWidth-(r+l)),u=S8(n.clientHeight-(C+c)),d=S8(r),w={rootMargin:-B+"px "+-E+"px "+-u+"px "+-d+"px",threshold:gC(0,cf(1,s))||1};let y=!0;function G(R){const x=R[0].intersectionRatio;if(x!==s){if(!y)return g();x?g(!1,x):i=setTimeout(()=>{g(!1,1e-7)},1e3)}x===1&&!ope(I,A.getBoundingClientRect())&&g(),y=!1}try{t=new IntersectionObserver(G,{...w,root:n.ownerDocument})}catch{t=new IntersectionObserver(G,w)}t.observe(A)}return g(!0),o}function Idi(A,e,t,i){i===void 0&&(i={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:g=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=i,I=kyA(A),r=n||o?[...I?jZ(I):[],...jZ(e)]:[];r.forEach(d=>{n&&d.addEventListener("scroll",t,{passive:!0}),o&&d.addEventListener("resize",t)});const C=I&&a?rdi(I,t):null;let l=-1,c=null;g&&(c=new ResizeObserver(d=>{let[f]=d;f&&f.target===I&&c&&(c.unobserve(e),cancelAnimationFrame(l),l=requestAnimationFrame(()=>{var w;(w=c)==null||w.observe(e)})),t()}),I&&!s&&c.observe(I),c.observe(e));let B,E=s?rD(A):null;s&&u();function u(){const d=rD(A);E&&!ope(E,d)&&t(),E=d,B=requestAnimationFrame(u)}return t(),()=>{var d;r.forEach(f=>{n&&f.removeEventListener("scroll",t),o&&f.removeEventListener("resize",t)}),C==null||C(),(d=c)==null||d.disconnect(),c=null,s&&cancelAnimationFrame(B)}}const Cdi=Mui,ldi=vui,cdi=Rui,Bdi=Sui,Qdi=xui,gpe=Yui,Edi=Lui,udi=(A,e,t)=>{const i=new Map,n={platform:sdi,...t},o={...n.platform,_c:i};return Nui(A,e,{...n,platform:o})};var ddi=typeof document<"u",hdi=function(){},X8=ddi?p.useLayoutEffect:hdi;function z8(A,e){if(A===e)return!0;if(typeof A!=typeof e)return!1;if(typeof A=="function"&&A.toString()===e.toString())return!0;let t,i,n;if(A&&e&&typeof A=="object"){if(Array.isArray(A)){if(t=A.length,t!==e.length)return!1;for(i=t;i--!==0;)if(!z8(A[i],e[i]))return!1;return!0}if(n=Object.keys(A),t=n.length,t!==Object.keys(e).length)return!1;for(i=t;i--!==0;)if(!{}.hasOwnProperty.call(e,n[i]))return!1;for(i=t;i--!==0;){const o=n[i];if(!(o==="_owner"&&A.$$typeof)&&!z8(A[o],e[o]))return!1}return!0}return A!==A&&e!==e}function ape(A){return typeof window>"u"?1:(A.ownerDocument.defaultView||window).devicePixelRatio||1}function spe(A,e){const t=ape(A);return Math.round(e*t)/t}function NyA(A){const e=p.useRef(A);return X8(()=>{e.current=A}),e}function mdi(A){A===void 0&&(A={});const{placement:e="bottom",strategy:t="absolute",middleware:i=[],platform:n,elements:{reference:o,floating:g}={},transform:a=!0,whileElementsMounted:s,open:I}=A,[r,C]=p.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[l,c]=p.useState(i);z8(l,i)||c(i);const[B,E]=p.useState(null),[u,d]=p.useState(null),f=p.useCallback(_=>{_!==R.current&&(R.current=_,E(_))},[]),w=p.useCallback(_=>{_!==x.current&&(x.current=_,d(_))},[]),y=o||B,G=g||u,R=p.useRef(null),x=p.useRef(null),F=p.useRef(r),Q=s!=null,k=NyA(s),h=NyA(n),N=NyA(I),v=p.useCallback(()=>{if(!R.current||!x.current)return;const _={placement:e,strategy:t,middleware:l};h.current&&(_.platform=h.current),udi(R.current,x.current,_).then(q=>{const $={...q,isPositioned:N.current!==!1};K.current&&!z8(F.current,$)&&(F.current=$,bt.flushSync(()=>{C($)}))})},[l,e,t,h,N]);X8(()=>{I===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,C(_=>({..._,isPositioned:!1})))},[I]);const K=p.useRef(!1);X8(()=>(K.current=!0,()=>{K.current=!1}),[]),X8(()=>{if(y&&(R.current=y),G&&(x.current=G),y&&G){if(k.current)return k.current(y,G,v);v()}},[y,G,v,k,Q]);const U=p.useMemo(()=>({reference:R,floating:x,setReference:f,setFloating:w}),[f,w]),V=p.useMemo(()=>({reference:y,floating:G}),[y,G]),X=p.useMemo(()=>{const _={position:t,left:0,top:0};if(!V.floating)return _;const q=spe(V.floating,r.x),$=spe(V.floating,r.y);return a?{..._,transform:"translate("+q+"px, "+$+"px)",...ape(V.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:q,top:$}},[t,a,V.floating,r.x,r.y]);return p.useMemo(()=>({...r,update:v,refs:U,elements:V,floatingStyles:X}),[r,v,U,V,X])}const pdi=A=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:A,fn(t){const{element:i,padding:n}=typeof A=="function"?A(t):A;return i&&e(i)?i.current!=null?gpe({element:i.current,padding:n}).fn(t):{}:i?gpe({element:i,padding:n}).fn(t):{}}}},fdi=(A,e)=>({...Cdi(A),options:[A,e]}),ydi=(A,e)=>({...ldi(A),options:[A,e]}),bdi=(A,e)=>({...Edi(A),options:[A,e]}),wdi=(A,e)=>({...cdi(A),options:[A,e]}),Ddi=(A,e)=>({...Bdi(A),options:[A,e]}),Gdi=(A,e)=>({...Qdi(A),options:[A,e]}),kdi=(A,e)=>({...pdi(A),options:[A,e]});var Jdi="Arrow",rpe=p.forwardRef((A,e)=>{const{children:t,width:i=10,height:n=5,...o}=A;return IA(Gt.svg,{...o,ref:e,width:i,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:A.asChild?t:IA("polygon",{points:"0,0 30,0 15,10"})})});rpe.displayName=Jdi;var Ndi=rpe,YyA="Popper",[Ipe,Cpe]=N0(YyA),[Ydi,lpe]=Ipe(YyA),cpe=A=>{const{__scopePopper:e,children:t}=A,[i,n]=p.useState(null);return IA(Ydi,{scope:e,anchor:i,onAnchorChange:n,children:t})};cpe.displayName=YyA;var Bpe="PopperAnchor",Qpe=p.forwardRef((A,e)=>{const{__scopePopper:t,virtualRef:i,...n}=A,o=lpe(Bpe,t),g=p.useRef(null),a=Un(e,g),s=p.useRef(null);return p.useEffect(()=>{const I=s.current;s.current=(i==null?void 0:i.current)||g.current,I!==s.current&&o.onAnchorChange(s.current)}),i?null:IA(Gt.div,{...n,ref:a})});Qpe.displayName=Bpe;var RyA="PopperContent",[Rdi,xdi]=Ipe(RyA),Epe=p.forwardRef((A,e)=>{var sA,gA,iA,aA,lA,CA;const{__scopePopper:t,side:i="bottom",sideOffset:n=0,align:o="center",alignOffset:g=0,arrowPadding:a=0,avoidCollisions:s=!0,collisionBoundary:I=[],collisionPadding:r=0,sticky:C="partial",hideWhenDetached:l=!1,updatePositionStrategy:c="optimized",onPlaced:B,...E}=A,u=lpe(RyA,t),[d,f]=p.useState(null),w=Un(e,QA=>f(QA)),[y,G]=p.useState(null),R=$he(y),x=(R==null?void 0:R.width)??0,F=(R==null?void 0:R.height)??0,Q=i+(o!=="center"?"-"+o:""),k=typeof r=="number"?r:{top:0,right:0,bottom:0,left:0,...r},h=Array.isArray(I)?I:[I],N=h.length>0,v={padding:k,boundary:h.filter(Mdi),altBoundary:N},{refs:K,floatingStyles:U,placement:V,isPositioned:X,middlewareData:_}=mdi({strategy:"fixed",placement:Q,whileElementsMounted:(...QA)=>Idi(...QA,{animationFrame:c==="always"}),elements:{reference:u.anchor},middleware:[fdi({mainAxis:n+F,alignmentAxis:g}),s&&ydi({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?bdi():void 0,...v}),s&&wdi({...v}),Ddi({...v,apply:({elements:QA,rects:uA,availableWidth:fA,availableHeight:hA})=>{const{width:yA,height:mA}=uA.reference,LA=QA.floating.style;LA.setProperty("--radix-popper-available-width",`${fA}px`),LA.setProperty("--radix-popper-available-height",`${hA}px`),LA.setProperty("--radix-popper-anchor-width",`${yA}px`),LA.setProperty("--radix-popper-anchor-height",`${mA}px`)}}),y&&kdi({element:y,padding:a}),vdi({arrowWidth:x,arrowHeight:F}),l&&Gdi({strategy:"referenceHidden",...v})]}),[q,$]=hpe(V),nA=R0(B);Ta(()=>{X&&(nA==null||nA())},[X,nA]);const j=(sA=_.arrow)==null?void 0:sA.x,O=(gA=_.arrow)==null?void 0:gA.y,eA=((iA=_.arrow)==null?void 0:iA.centerOffset)!==0,[oA,tA]=p.useState();return Ta(()=>{d&&tA(window.getComputedStyle(d).zIndex)},[d]),IA("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:X?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oA,["--radix-popper-transform-origin"]:[(aA=_.transformOrigin)==null?void 0:aA.x,(lA=_.transformOrigin)==null?void 0:lA.y].join(" "),...((CA=_.hide)==null?void 0:CA.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:A.dir,children:IA(Rdi,{scope:t,placedSide:q,onArrowChange:G,arrowX:j,arrowY:O,shouldHideArrow:eA,children:IA(Gt.div,{"data-side":q,"data-align":$,...E,ref:w,style:{...E.style,animation:X?void 0:"none"}})})})});Epe.displayName=RyA;var upe="PopperArrow",Fdi={top:"bottom",right:"left",bottom:"top",left:"right"},dpe=p.forwardRef(function(e,t){const{__scopePopper:i,...n}=e,o=xdi(upe,i),g=Fdi[o.placedSide];return IA("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[g]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:IA(Ndi,{...n,ref:t,style:{...n.style,display:"block"}})})});dpe.displayName=upe;function Mdi(A){return A!==null}var vdi=A=>({name:"transformOrigin",options:A,fn(e){var u,d,f;const{placement:t,rects:i,middlewareData:n}=e,g=((u=n.arrow)==null?void 0:u.centerOffset)!==0,a=g?0:A.arrowWidth,s=g?0:A.arrowHeight,[I,r]=hpe(t),C={start:"0%",center:"50%",end:"100%"}[r],l=(((d=n.arrow)==null?void 0:d.x)??0)+a/2,c=(((f=n.arrow)==null?void 0:f.y)??0)+s/2;let B="",E="";return I==="bottom"?(B=g?C:`${l}px`,E=`${-s}px`):I==="top"?(B=g?C:`${l}px`,E=`${i.floating.height+s}px`):I==="right"?(B=`${-s}px`,E=g?C:`${c}px`):I==="left"&&(B=`${i.floating.width+s}px`,E=g?C:`${c}px`),{data:{x:B,y:E}}}});function hpe(A){const[e,t="center"]=A.split("-");return[e,t]}var Ldi=cpe,Sdi=Qpe,Hdi=Epe,Zdi=dpe;function Wdi(A){const e=Kdi(A),t=p.forwardRef((i,n)=>{const{children:o,...g}=i,a=p.Children.toArray(o),s=a.find(Vdi);if(s){const I=s.props.children,r=a.map(C=>C===s?p.Children.count(I)>1?p.Children.only(null):p.isValidElement(I)?I.props.children:null:C);return IA(e,{...g,ref:n,children:p.isValidElement(I)?p.cloneElement(I,void 0,r):null})}return IA(e,{...g,ref:n,children:o})});return t.displayName=`${A}.Slot`,t}function Kdi(A){const e=p.forwardRef((t,i)=>{const{children:n,...o}=t;if(p.isValidElement(n)){const g=zdi(n),a=Xdi(o,n.props);return n.type!==p.Fragment&&(a.ref=i?bY(i,g):g),p.cloneElement(n,a)}return p.Children.count(n)>1?p.Children.only(null):null});return e.displayName=`${A}.SlotClone`,e}var Udi=Symbol("radix.slottable");function Vdi(A){return p.isValidElement(A)&&typeof A.type=="function"&&"__radixId"in A.type&&A.type.__radixId===Udi}function Xdi(A,e){const t={...e};for(const i in e){const n=A[i],o=e[i];/^on[A-Z]/.test(i)?n&&o?t[i]=(...a)=>{const s=o(...a);return n(...a),s}:n&&(t[i]=n):i==="style"?t[i]={...n,...o}:i==="className"&&(t[i]=[n,o].filter(Boolean).join(" "))}return{...A,...t}}function zdi(A){var i,n;let e=(i=Object.getOwnPropertyDescriptor(A.props,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?A.ref:(e=(n=Object.getOwnPropertyDescriptor(A,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?A.props.ref:A.props.ref||A.ref)}var mpe=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"}),Tdi="VisuallyHidden",_di=p.forwardRef((A,e)=>IA(Gt.span,{...A,ref:e,style:{...mpe,...A.style}}));_di.displayName=Tdi;var Odi=[" ","Enter","ArrowUp","ArrowDown"],qdi=[" ","Enter"],ID="Select",[T8,_8,jdi]=Hce(ID),[wR,wfi]=N0(ID,[jdi,Cpe]),O8=Cpe(),[Pdi,Qf]=wR(ID),[$di,Ahi]=wR(ID),ppe=A=>{const{__scopeSelect:e,children:t,open:i,defaultOpen:n,onOpenChange:o,value:g,defaultValue:a,onValueChange:s,dir:I,name:r,autoComplete:C,disabled:l,required:c,form:B}=A,E=O8(e),[u,d]=p.useState(null),[f,w]=p.useState(null),[y,G]=p.useState(!1),R=Gj(I),[x,F]=Ah({prop:i,defaultProp:n??!1,onChange:o,caller:ID}),[Q,k]=Ah({prop:g,defaultProp:a,onChange:s,caller:ID}),h=p.useRef(null),N=u?B||!!u.closest("form"):!0,[v,K]=p.useState(new Set),U=Array.from(v).map(V=>V.props.value).join(";");return IA(Ldi,{...E,children:PA(Pdi,{required:c,scope:e,trigger:u,onTriggerChange:d,valueNode:f,onValueNodeChange:w,valueNodeHasChildren:y,onValueNodeHasChildrenChange:G,contentId:Y0(),value:Q,onValueChange:k,open:x,onOpenChange:F,dir:R,triggerPointerDownPosRef:h,disabled:l,children:[IA(T8.Provider,{scope:e,children:IA($di,{scope:A.__scopeSelect,onNativeOptionAdd:p.useCallback(V=>{K(X=>new Set(X).add(V))},[]),onNativeOptionRemove:p.useCallback(V=>{K(X=>{const _=new Set(X);return _.delete(V),_})},[]),children:t})}),N?PA(Xpe,{"aria-hidden":!0,required:c,tabIndex:-1,name:r,autoComplete:C,value:Q,onChange:V=>k(V.target.value),disabled:l,form:B,children:[Q===void 0?IA("option",{value:""}):null,Array.from(v)]},U):null]})})};ppe.displayName=ID;var fpe="SelectTrigger",ype=p.forwardRef((A,e)=>{const{__scopeSelect:t,disabled:i=!1,...n}=A,o=O8(t),g=Qf(fpe,t),a=g.disabled||i,s=Un(e,g.onTriggerChange),I=_8(t),r=p.useRef("touch"),[C,l,c]=Tpe(E=>{const u=I().filter(w=>!w.disabled),d=u.find(w=>w.value===g.value),f=_pe(u,E,d);f!==void 0&&g.onValueChange(f.value)}),B=E=>{a||(g.onOpenChange(!0),c()),E&&(g.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return IA(Sdi,{asChild:!0,...o,children:IA(Gt.button,{type:"button",role:"combobox","aria-controls":g.contentId,"aria-expanded":g.open,"aria-required":g.required,"aria-autocomplete":"none",dir:g.dir,"data-state":g.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":zpe(g.value)?"":void 0,...n,ref:s,onClick:Ft(n.onClick,E=>{E.currentTarget.focus(),r.current!=="mouse"&&B(E)}),onPointerDown:Ft(n.onPointerDown,E=>{r.current=E.pointerType;const u=E.target;u.hasPointerCapture(E.pointerId)&&u.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(B(E),E.preventDefault())}),onKeyDown:Ft(n.onKeyDown,E=>{const u=C.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&l(E.key),!(u&&E.key===" ")&&Odi.includes(E.key)&&(B(),E.preventDefault())})})})});ype.displayName=fpe;var bpe="SelectValue",wpe=p.forwardRef((A,e)=>{const{__scopeSelect:t,className:i,style:n,children:o,placeholder:g="",...a}=A,s=Qf(bpe,t),{onValueNodeHasChildrenChange:I}=s,r=o!==void 0,C=Un(e,s.onValueNodeChange);return Ta(()=>{I(r)},[I,r]),IA(Gt.span,{...a,ref:C,style:{pointerEvents:"none"},children:zpe(s.value)?IA(ua,{children:g}):o})});wpe.displayName=bpe;var ehi="SelectIcon",Dpe=p.forwardRef((A,e)=>{const{__scopeSelect:t,children:i,...n}=A;return IA(Gt.span,{"aria-hidden":!0,...n,ref:e,children:i||"▼"})});Dpe.displayName=ehi;var thi="SelectPortal",Gpe=A=>IA(H0A,{asChild:!0,...A});Gpe.displayName=thi;var CD="SelectContent",kpe=p.forwardRef((A,e)=>{const t=Qf(CD,A.__scopeSelect),[i,n]=p.useState();if(Ta(()=>{n(new DocumentFragment)},[]),!t.open){const o=i;return o?bt.createPortal(IA(Jpe,{scope:A.__scopeSelect,children:IA(T8.Slot,{scope:A.__scopeSelect,children:IA("div",{children:A.children})})}),o):null}return IA(Npe,{...A,ref:e})});kpe.displayName=CD;var wB=10,[Jpe,Ef]=wR(CD),ihi="SelectContentImpl",nhi=Wdi("SelectContent.RemoveScroll"),Npe=p.forwardRef((A,e)=>{const{__scopeSelect:t,position:i="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:o,onPointerDownOutside:g,side:a,sideOffset:s,align:I,alignOffset:r,arrowPadding:C,collisionBoundary:l,collisionPadding:c,sticky:B,hideWhenDetached:E,avoidCollisions:u,...d}=A,f=Qf(CD,t),[w,y]=p.useState(null),[G,R]=p.useState(null),x=Un(e,sA=>y(sA)),[F,Q]=p.useState(null),[k,h]=p.useState(null),N=_8(t),[v,K]=p.useState(!1),U=p.useRef(!1);p.useEffect(()=>{if(w)return Wue(w)},[w]),bue();const V=p.useCallback(sA=>{const[gA,...iA]=N().map(CA=>CA.ref.current),[aA]=iA.slice(-1),lA=document.activeElement;for(const CA of sA)if(CA===lA||(CA==null||CA.scrollIntoView({block:"nearest"}),CA===gA&&G&&(G.scrollTop=0),CA===aA&&G&&(G.scrollTop=G.scrollHeight),CA==null||CA.focus(),document.activeElement!==lA))return},[N,G]),X=p.useCallback(()=>V([F,w]),[V,F,w]);p.useEffect(()=>{v&&X()},[v,X]);const{onOpenChange:_,triggerPointerDownPosRef:q}=f;p.useEffect(()=>{if(w){let sA={x:0,y:0};const gA=aA=>{var lA,CA;sA={x:Math.abs(Math.round(aA.pageX)-(((lA=q.current)==null?void 0:lA.x)??0)),y:Math.abs(Math.round(aA.pageY)-(((CA=q.current)==null?void 0:CA.y)??0))}},iA=aA=>{sA.x<=10&&sA.y<=10?aA.preventDefault():w.contains(aA.target)||_(!1),document.removeEventListener("pointermove",gA),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",gA),document.addEventListener("pointerup",iA,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",gA),document.removeEventListener("pointerup",iA,{capture:!0})}}},[w,_,q]),p.useEffect(()=>{const sA=()=>_(!1);return window.addEventListener("blur",sA),window.addEventListener("resize",sA),()=>{window.removeEventListener("blur",sA),window.removeEventListener("resize",sA)}},[_]);const[$,nA]=Tpe(sA=>{const gA=N().filter(lA=>!lA.disabled),iA=gA.find(lA=>lA.ref.current===document.activeElement),aA=_pe(gA,sA,iA);aA&&setTimeout(()=>aA.ref.current.focus())}),j=p.useCallback((sA,gA,iA)=>{const aA=!U.current&&!iA;(f.value!==void 0&&f.value===gA||aA)&&(Q(sA),aA&&(U.current=!0))},[f.value]),O=p.useCallback(()=>w==null?void 0:w.focus(),[w]),eA=p.useCallback((sA,gA,iA)=>{const aA=!U.current&&!iA;(f.value!==void 0&&f.value===gA||aA)&&h(sA)},[f.value]),oA=i==="popper"?xyA:Ype,tA=oA===xyA?{side:a,sideOffset:s,align:I,alignOffset:r,arrowPadding:C,collisionBoundary:l,collisionPadding:c,sticky:B,hideWhenDetached:E,avoidCollisions:u}:{};return IA(Jpe,{scope:t,content:w,viewport:G,onViewportChange:R,itemRefCallback:j,selectedItem:F,onItemLeave:O,itemTextRefCallback:eA,focusSelectedItem:X,selectedItemText:k,position:i,isPositioned:v,searchRef:$,children:IA(Hue,{as:nhi,allowPinchZoom:!0,children:IA(S0A,{asChild:!0,trapped:f.open,onMountAutoFocus:sA=>{sA.preventDefault()},onUnmountAutoFocus:Ft(n,sA=>{var gA;(gA=f.trigger)==null||gA.focus({preventScroll:!0}),sA.preventDefault()}),children:IA(M0A,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:g,onFocusOutside:sA=>sA.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:IA(oA,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:sA=>sA.preventDefault(),...d,...tA,onPlaced:()=>K(!0),ref:x,style:{display:"flex",flexDirection:"column",outline:"none",...d.style},onKeyDown:Ft(d.onKeyDown,sA=>{const gA=sA.ctrlKey||sA.altKey||sA.metaKey;if(sA.key==="Tab"&&sA.preventDefault(),!gA&&sA.key.length===1&&nA(sA.key),["ArrowUp","ArrowDown","Home","End"].includes(sA.key)){let aA=N().filter(lA=>!lA.disabled).map(lA=>lA.ref.current);if(["ArrowUp","End"].includes(sA.key)&&(aA=aA.slice().reverse()),["ArrowUp","ArrowDown"].includes(sA.key)){const lA=sA.target,CA=aA.indexOf(lA);aA=aA.slice(CA+1)}setTimeout(()=>V(aA)),sA.preventDefault()}})})})})})})});Npe.displayName=ihi;var ohi="SelectItemAlignedPosition",Ype=p.forwardRef((A,e)=>{const{__scopeSelect:t,onPlaced:i,...n}=A,o=Qf(CD,t),g=Ef(CD,t),[a,s]=p.useState(null),[I,r]=p.useState(null),C=Un(e,x=>r(x)),l=_8(t),c=p.useRef(!1),B=p.useRef(!0),{viewport:E,selectedItem:u,selectedItemText:d,focusSelectedItem:f}=g,w=p.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&I&&E&&u&&d){const x=o.trigger.getBoundingClientRect(),F=I.getBoundingClientRect(),Q=o.valueNode.getBoundingClientRect(),k=d.getBoundingClientRect();if(o.dir!=="rtl"){const lA=k.left-F.left,CA=Q.left-lA,QA=x.left-CA,uA=x.width+QA,fA=Math.max(uA,F.width),hA=window.innerWidth-wB,yA=Zme(CA,[wB,Math.max(wB,hA-fA)]);a.style.minWidth=uA+"px",a.style.left=yA+"px"}else{const lA=F.right-k.right,CA=window.innerWidth-Q.right-lA,QA=window.innerWidth-x.right-CA,uA=x.width+QA,fA=Math.max(uA,F.width),hA=window.innerWidth-wB,yA=Zme(CA,[wB,Math.max(wB,hA-fA)]);a.style.minWidth=uA+"px",a.style.right=yA+"px"}const h=l(),N=window.innerHeight-wB*2,v=E.scrollHeight,K=window.getComputedStyle(I),U=parseInt(K.borderTopWidth,10),V=parseInt(K.paddingTop,10),X=parseInt(K.borderBottomWidth,10),_=parseInt(K.paddingBottom,10),q=U+V+v+_+X,$=Math.min(u.offsetHeight*5,q),nA=window.getComputedStyle(E),j=parseInt(nA.paddingTop,10),O=parseInt(nA.paddingBottom,10),eA=x.top+x.height/2-wB,oA=N-eA,tA=u.offsetHeight/2,sA=u.offsetTop+tA,gA=U+V+sA,iA=q-gA;if(gA<=eA){const lA=h.length>0&&u===h[h.length-1].ref.current;a.style.bottom="0px";const CA=I.clientHeight-E.offsetTop-E.offsetHeight,QA=Math.max(oA,tA+(lA?O:0)+CA+X),uA=gA+QA;a.style.height=uA+"px"}else{const lA=h.length>0&&u===h[0].ref.current;a.style.top="0px";const QA=Math.max(eA,U+E.offsetTop+(lA?j:0)+tA)+iA;a.style.height=QA+"px",E.scrollTop=gA-eA+E.offsetTop}a.style.margin=`${wB}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=N+"px",i==null||i(),requestAnimationFrame(()=>c.current=!0)}},[l,o.trigger,o.valueNode,a,I,E,u,d,o.dir,i]);Ta(()=>w(),[w]);const[y,G]=p.useState();Ta(()=>{I&&G(window.getComputedStyle(I).zIndex)},[I]);const R=p.useCallback(x=>{x&&B.current===!0&&(w(),f==null||f(),B.current=!1)},[w,f]);return IA(ahi,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:c,onScrollButtonChange:R,children:IA("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:y},children:IA(Gt.div,{...n,ref:C,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Ype.displayName=ohi;var ghi="SelectPopperPosition",xyA=p.forwardRef((A,e)=>{const{__scopeSelect:t,align:i="start",collisionPadding:n=wB,...o}=A,g=O8(t);return IA(Hdi,{...g,...o,ref:e,align:i,collisionPadding:n,style:{boxSizing:"border-box",...o.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)"}})});xyA.displayName=ghi;var[ahi,FyA]=wR(CD,{}),MyA="SelectViewport",Rpe=p.forwardRef((A,e)=>{const{__scopeSelect:t,nonce:i,...n}=A,o=Ef(MyA,t),g=FyA(MyA,t),a=Un(e,o.onViewportChange),s=p.useRef(0);return PA(ua,{children:[IA("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:i}),IA(T8.Slot,{scope:t,children:IA(Gt.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:Ft(n.onScroll,I=>{const r=I.currentTarget,{contentWrapper:C,shouldExpandOnScrollRef:l}=g;if(l!=null&&l.current&&C){const c=Math.abs(s.current-r.scrollTop);if(c>0){const B=window.innerHeight-wB*2,E=parseFloat(C.style.minHeight),u=parseFloat(C.style.height),d=Math.max(E,u);if(d<B){const f=d+c,w=Math.min(B,f),y=f-w;C.style.height=w+"px",C.style.bottom==="0px"&&(r.scrollTop=y>0?y:0,C.style.justifyContent="flex-end")}}}s.current=r.scrollTop})})})]})});Rpe.displayName=MyA;var xpe="SelectGroup",[shi,rhi]=wR(xpe),Ihi=p.forwardRef((A,e)=>{const{__scopeSelect:t,...i}=A,n=Y0();return IA(shi,{scope:t,id:n,children:IA(Gt.div,{role:"group","aria-labelledby":n,...i,ref:e})})});Ihi.displayName=xpe;var Fpe="SelectLabel",Mpe=p.forwardRef((A,e)=>{const{__scopeSelect:t,...i}=A,n=rhi(Fpe,t);return IA(Gt.div,{id:n.id,...i,ref:e})});Mpe.displayName=Fpe;var q8="SelectItem",[Chi,vpe]=wR(q8),Lpe=p.forwardRef((A,e)=>{const{__scopeSelect:t,value:i,disabled:n=!1,textValue:o,...g}=A,a=Qf(q8,t),s=Ef(q8,t),I=a.value===i,[r,C]=p.useState(o??""),[l,c]=p.useState(!1),B=Un(e,f=>{var w;return(w=s.itemRefCallback)==null?void 0:w.call(s,f,i,n)}),E=Y0(),u=p.useRef("touch"),d=()=>{n||(a.onValueChange(i),a.onOpenChange(!1))};if(i==="")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 IA(Chi,{scope:t,value:i,disabled:n,textId:E,isSelected:I,onItemTextChange:p.useCallback(f=>{C(w=>w||((f==null?void 0:f.textContent)??"").trim())},[]),children:IA(T8.ItemSlot,{scope:t,value:i,disabled:n,textValue:r,children:IA(Gt.div,{role:"option","aria-labelledby":E,"data-highlighted":l?"":void 0,"aria-selected":I&&l,"data-state":I?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...g,ref:B,onFocus:Ft(g.onFocus,()=>c(!0)),onBlur:Ft(g.onBlur,()=>c(!1)),onClick:Ft(g.onClick,()=>{u.current!=="mouse"&&d()}),onPointerUp:Ft(g.onPointerUp,()=>{u.current==="mouse"&&d()}),onPointerDown:Ft(g.onPointerDown,f=>{u.current=f.pointerType}),onPointerMove:Ft(g.onPointerMove,f=>{var w;u.current=f.pointerType,n?(w=s.onItemLeave)==null||w.call(s):u.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ft(g.onPointerLeave,f=>{var w;f.currentTarget===document.activeElement&&((w=s.onItemLeave)==null||w.call(s))}),onKeyDown:Ft(g.onKeyDown,f=>{var y;((y=s.searchRef)==null?void 0:y.current)!==""&&f.key===" "||(qdi.includes(f.key)&&d(),f.key===" "&&f.preventDefault())})})})})});Lpe.displayName=q8;var PZ="SelectItemText",Spe=p.forwardRef((A,e)=>{const{__scopeSelect:t,className:i,style:n,...o}=A,g=Qf(PZ,t),a=Ef(PZ,t),s=vpe(PZ,t),I=Ahi(PZ,t),[r,C]=p.useState(null),l=Un(e,d=>C(d),s.onItemTextChange,d=>{var f;return(f=a.itemTextRefCallback)==null?void 0:f.call(a,d,s.value,s.disabled)}),c=r==null?void 0:r.textContent,B=p.useMemo(()=>IA("option",{value:s.value,disabled:s.disabled,children:c},s.value),[s.disabled,s.value,c]),{onNativeOptionAdd:E,onNativeOptionRemove:u}=I;return Ta(()=>(E(B),()=>u(B)),[E,u,B]),PA(ua,{children:[IA(Gt.span,{id:s.textId,...o,ref:l}),s.isSelected&&g.valueNode&&!g.valueNodeHasChildren?bt.createPortal(o.children,g.valueNode):null]})});Spe.displayName=PZ;var Hpe="SelectItemIndicator",Zpe=p.forwardRef((A,e)=>{const{__scopeSelect:t,...i}=A;return vpe(Hpe,t).isSelected?IA(Gt.span,{"aria-hidden":!0,...i,ref:e}):null});Zpe.displayName=Hpe;var vyA="SelectScrollUpButton",Wpe=p.forwardRef((A,e)=>{const t=Ef(vyA,A.__scopeSelect),i=FyA(vyA,A.__scopeSelect),[n,o]=p.useState(!1),g=Un(e,i.onScrollButtonChange);return Ta(()=>{if(t.viewport&&t.isPositioned){let a=function(){const I=s.scrollTop>0;o(I)};const s=t.viewport;return a(),s.addEventListener("scroll",a),()=>s.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?IA(Upe,{...A,ref:g,onAutoScroll:()=>{const{viewport:a,selectedItem:s}=t;a&&s&&(a.scrollTop=a.scrollTop-s.offsetHeight)}}):null});Wpe.displayName=vyA;var LyA="SelectScrollDownButton",Kpe=p.forwardRef((A,e)=>{const t=Ef(LyA,A.__scopeSelect),i=FyA(LyA,A.__scopeSelect),[n,o]=p.useState(!1),g=Un(e,i.onScrollButtonChange);return Ta(()=>{if(t.viewport&&t.isPositioned){let a=function(){const I=s.scrollHeight-s.clientHeight,r=Math.ceil(s.scrollTop)<I;o(r)};const s=t.viewport;return a(),s.addEventListener("scroll",a),()=>s.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?IA(Upe,{...A,ref:g,onAutoScroll:()=>{const{viewport:a,selectedItem:s}=t;a&&s&&(a.scrollTop=a.scrollTop+s.offsetHeight)}}):null});Kpe.displayName=LyA;var Upe=p.forwardRef((A,e)=>{const{__scopeSelect:t,onAutoScroll:i,...n}=A,o=Ef("SelectScrollButton",t),g=p.useRef(null),a=_8(t),s=p.useCallback(()=>{g.current!==null&&(window.clearInterval(g.current),g.current=null)},[]);return p.useEffect(()=>()=>s(),[s]),Ta(()=>{var r;const I=a().find(C=>C.ref.current===document.activeElement);(r=I==null?void 0:I.ref.current)==null||r.scrollIntoView({block:"nearest"})},[a]),IA(Gt.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:Ft(n.onPointerDown,()=>{g.current===null&&(g.current=window.setInterval(i,50))}),onPointerMove:Ft(n.onPointerMove,()=>{var I;(I=o.onItemLeave)==null||I.call(o),g.current===null&&(g.current=window.setInterval(i,50))}),onPointerLeave:Ft(n.onPointerLeave,()=>{s()})})}),lhi="SelectSeparator",Vpe=p.forwardRef((A,e)=>{const{__scopeSelect:t,...i}=A;return IA(Gt.div,{"aria-hidden":!0,...i,ref:e})});Vpe.displayName=lhi;var SyA="SelectArrow",chi=p.forwardRef((A,e)=>{const{__scopeSelect:t,...i}=A,n=O8(t),o=Qf(SyA,t),g=Ef(SyA,t);return o.open&&g.position==="popper"?IA(Zdi,{...n,...i,ref:e}):null});chi.displayName=SyA;var Bhi="SelectBubbleInput",Xpe=p.forwardRef(({__scopeSelect:A,value:e,...t},i)=>{const n=p.useRef(null),o=Un(i,n),g=Phe(e);return p.useEffect(()=>{const a=n.current;if(!a)return;const s=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(s,"value").set;if(g!==e&&r){const C=new Event("change",{bubbles:!0});r.call(a,e),a.dispatchEvent(C)}},[g,e]),IA(Gt.select,{...t,style:{...mpe,...t.style},ref:o,defaultValue:e})});Xpe.displayName=Bhi;function zpe(A){return A===""||A===void 0}function Tpe(A){const e=R0(A),t=p.useRef(""),i=p.useRef(0),n=p.useCallback(g=>{const a=t.current+g;e(a),function s(I){t.current=I,window.clearTimeout(i.current),I!==""&&(i.current=window.setTimeout(()=>s(""),1e3))}(a)},[e]),o=p.useCallback(()=>{t.current="",window.clearTimeout(i.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(i.current),[]),[t,n,o]}function _pe(A,e,t){const n=e.length>1&&Array.from(e).every(I=>I===e[0])?e[0]:e,o=t?A.indexOf(t):-1;let g=Qhi(A,Math.max(o,0));n.length===1&&(g=g.filter(I=>I!==t));const s=g.find(I=>I.textValue.toLowerCase().startsWith(n.toLowerCase()));return s!==t?s:void 0}function Qhi(A,e){return A.map((t,i)=>A[(e+i)%A.length])}var Ehi=ppe,Ope=ype,uhi=wpe,dhi=Dpe,hhi=Gpe,qpe=kpe,mhi=Rpe,jpe=Mpe,Ppe=Lpe,phi=Spe,fhi=Zpe,$pe=Wpe,A0e=Kpe,e0e=Vpe;const yhi=Ehi,bhi=uhi,t0e=p.forwardRef(({className:A,children:e,...t},i)=>PA(Ope,{ref:i,className:Vn("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",A),...t,children:[e,IA(dhi,{asChild:!0,children:IA(VIi,{className:"h-4 w-4 opacity-50"})})]}));t0e.displayName=Ope.displayName;const i0e=p.forwardRef(({className:A,...e},t)=>IA($pe,{ref:t,className:Vn("flex cursor-default items-center justify-center py-1",A),...e,children:IA($Ii,{})}));i0e.displayName=$pe.displayName;const n0e=p.forwardRef(({className:A,...e},t)=>IA(A0e,{ref:t,className:Vn("flex cursor-default items-center justify-center py-1",A),...e,children:IA(TIi,{})}));n0e.displayName=A0e.displayName;const o0e=p.forwardRef(({className:A,children:e,position:t="popper",...i},n)=>IA(hhi,{container:p.useContext(x0A),children:PA(qpe,{ref:n,className:Vn("relative z-50 max-h-96 min-w-[8rem] overflow-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",t==="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",A),position:t,...i,children:[IA(i0e,{}),IA(mhi,{className:Vn("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),IA(n0e,{})]})}));o0e.displayName=qpe.displayName;const whi=p.forwardRef(({className:A,...e},t)=>IA(jpe,{ref:t,className:Vn("px-2 py-1.5 text-sm font-semibold",A),...e}));whi.displayName=jpe.displayName;const HyA=p.forwardRef(({className:A,children:e,...t},i)=>PA(Ppe,{ref:i,className:Vn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",A),...t,children:[IA("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:IA(fhi,{children:IA(ade,{className:"h-4 w-4"})})}),IA(phi,{children:e})]}));HyA.displayName=Ppe.displayName;const Dhi=p.forwardRef(({className:A,...e},t)=>IA(e0e,{ref:t,className:Vn("-mx-1 my-1 h-px bg-muted",A),...e}));Dhi.displayName=e0e.displayName;var g0e="Toggle",ZyA=p.forwardRef((A,e)=>{const{pressed:t,defaultPressed:i,onPressedChange:n,...o}=A,[g,a]=Ah({prop:t,onChange:n,defaultProp:i??!1,caller:g0e});return IA(Gt.button,{type:"button","aria-pressed":g,"data-state":g?"on":"off","data-disabled":A.disabled?"":void 0,...o,ref:e,onClick:Ft(A.onClick,()=>{A.disabled||a(!g)})})});ZyA.displayName=g0e;var a0e=ZyA,uf="ToggleGroup",[s0e,Dfi]=N0(uf,[kj]),r0e=kj(),WyA=b.forwardRef((A,e)=>{const{type:t,...i}=A;if(t==="single")return IA(Ghi,{...i,ref:e});if(t==="multiple")return IA(khi,{...i,ref:e});throw new Error(`Missing prop \`type\` expected on \`${uf}\``)});WyA.displayName=uf;var[I0e,C0e]=s0e(uf),Ghi=b.forwardRef((A,e)=>{const{value:t,defaultValue:i,onValueChange:n=()=>{},...o}=A,[g,a]=Ah({prop:t,defaultProp:i??"",onChange:n,caller:uf});return IA(I0e,{scope:A.__scopeToggleGroup,type:"single",value:b.useMemo(()=>g?[g]:[],[g]),onItemActivate:a,onItemDeactivate:b.useCallback(()=>a(""),[a]),children:IA(l0e,{...o,ref:e})})}),khi=b.forwardRef((A,e)=>{const{value:t,defaultValue:i,onValueChange:n=()=>{},...o}=A,[g,a]=Ah({prop:t,defaultProp:i??[],onChange:n,caller:uf}),s=b.useCallback(r=>a((C=[])=>[...C,r]),[a]),I=b.useCallback(r=>a((C=[])=>C.filter(l=>l!==r)),[a]);return IA(I0e,{scope:A.__scopeToggleGroup,type:"multiple",value:g,onItemActivate:s,onItemDeactivate:I,children:IA(l0e,{...o,ref:e})})});WyA.displayName=uf;var[Jhi,Nhi]=s0e(uf),l0e=b.forwardRef((A,e)=>{const{__scopeToggleGroup:t,disabled:i=!1,rovingFocus:n=!0,orientation:o,dir:g,loop:a=!0,...s}=A,I=r0e(t),r=Gj(g),C={role:"group",dir:r,...s};return IA(Jhi,{scope:t,rovingFocus:n,disabled:i,children:n?IA(Xce,{asChild:!0,...I,orientation:o,dir:r,loop:a,children:IA(Gt.div,{...C,ref:e})}):IA(Gt.div,{...C,ref:e})})}),j8="ToggleGroupItem",c0e=b.forwardRef((A,e)=>{const t=C0e(j8,A.__scopeToggleGroup),i=Nhi(j8,A.__scopeToggleGroup),n=r0e(A.__scopeToggleGroup),o=t.value.includes(A.value),g=i.disabled||A.disabled,a={...A,pressed:o,disabled:g},s=b.useRef(null);return i.rovingFocus?IA(zce,{asChild:!0,...n,focusable:!g,active:o,ref:s,children:IA(B0e,{...a,ref:e})}):IA(B0e,{...a,ref:e})});c0e.displayName=j8;var B0e=b.forwardRef((A,e)=>{const{__scopeToggleGroup:t,value:i,...n}=A,o=C0e(j8,t),g={role:"radio","aria-checked":A.pressed,"aria-pressed":void 0},a=o.type==="single"?g:void 0;return IA(ZyA,{...a,...n,ref:e,onPressedChange:s=>{s?o.onItemActivate(i):o.onItemDeactivate(i)}})}),Q0e=WyA,E0e=c0e;const u0e=M6("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-3",sm:"h-8 px-2",lg:"h-10 px-3"}},defaultVariants:{variant:"default",size:"default"}}),Yhi=p.forwardRef(({className:A,variant:e,size:t,...i},n)=>IA(a0e,{ref:n,className:Vn(u0e({variant:e,size:t,className:A})),...i}));Yhi.displayName=a0e.displayName;const d0e=p.createContext({size:"default",variant:"default"}),h0e=p.forwardRef(({className:A,variant:e,size:t,children:i,...n},o)=>IA(Q0e,{ref:o,className:Vn("flex items-center justify-center gap-1",A),...n,children:IA(d0e.Provider,{value:{variant:e,size:t},children:i})}));h0e.displayName=Q0e.displayName;const P8=p.forwardRef(({className:A,children:e,variant:t,size:i,...n},o)=>{const g=p.useContext(d0e);return IA(E0e,{ref:o,className:Vn(u0e({variant:g.variant||t,size:g.size||i}),A),...n,children:e})});P8.displayName=E0e.displayName;function KyA(A){return A==="media"?window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":A}const Rhi=new Set(["column","row","color","opacity","shape","size","details","theta","x","y","facet","order","radius"]),xhi=A=>Rhi.has(A),Fhi=new Set(["sum","count","max","min","mean","median","variance","stdev"]),Mhi=A=>!!A&&Fhi.has(A),$Z={fid:"gw_count_fid",name:"Row count",analyticType:"measure",semanticType:"quantitative",aggName:"sum",computed:!0,expression:{op:"one",params:[],as:"gw_count_fid"}},vhi=A=>A==="zero"||A===!0?"stack":A===null?"none":A;function m0e(A){let e="none";if(typeof A=="string"?e=A:A&&A instanceof Object&&(e=A.order??"ascending"),e!=="none"){const t=["x","y","color","size","opacity"];if(e.startsWith("-")||e==="descending")return"descending";if(t.indexOf(e)>-1||e==="ascending")return"ascending"}}const Lhi={row:"facetY",facet:"facetY",column:"facetX",x:"column",y:"row",opacity:"opacity",size:"size",shape:"shape",radius:"radius",theta:"theta",details:"details",text:"text",color:"color"},p0e=new Set(["theta","x","y"]);function Shi(A){const e=`gw_${whe(4)}`;return{fid:e,name:`bin(${A.name})`,semanticType:"ordinal",analyticType:"dimension",computed:!0,expression:{op:"bin",as:e,params:[{type:"field",value:A.fid}]}}}function Hhi(A,e,t){switch(A){case"order":return{sort:m0e(e.sort)};default:const i=p0e.has(A),n=t.get(e.field)??$Z,o=e.bin?Shi(n):n,g=o===$Z?"count":Mhi(e.aggregate)&&i?e.aggregate:void 0;let a;return o===$Z||g?a="measure":o.analyticType==="measure"&&p0e.has(A)?a="auto":a="dimension",{dimension:o,binDimension:e.bin?o:void 0,dimensionType:Lhi[A],analyticType:a,aggregate:g,stack:vhi(e.stack),sort:e.sort?m0e(e.sort):void 0}}}const DR=A=>Object.keys(A).map(e=>({name:e,value:A[e]}));function AW(A){function e(t){switch(t){case"interval":case"bar":return"bar";case"line":return"line";case"boxplot":return"boxplot";case"area":return"area";case"point":return"point";case"arc":return"arc";case"circle":return"circle";case"heatmap":return"circle";case"rect":return"rect";case"tick":default:return"tick"}}return e(typeof A=="string"?A:A.type)}const f0e=A=>{switch(A){case"==":case"===":case"equal":case"oneOf":return"one of";case"!=":case"!==":return"not in";case">":case">=":case"<":case"<=":case"lt":case"lte":case"gt":case"gte":case"range":return"range"}return"one of"};function y0e(A,e){const t=new Set,i=[];return A.forEach(n=>{const o=e(n);t.has(o)||(t.add(o),i.push(n))}),i}function Zhi(A,e,t,i){let n="tick";const o=[];A.facet&&o.push(...DR(A.facet)),A.encoding&&o.push(...DR(A.encoding)),A.mark&&(n=AW(A.mark)),A.spec&&(n=AW(A.spec.mark),A.spec.encoding&&o.push(...DR(A.spec.encoding))),A.concat&&A.concat.forEach(y=>{n=AW(y.mark),y.encoding&&o.push(...DR(y.encoding))}),A.hconcat&&A.hconcat.forEach(y=>{n=AW(y.mark),y.encoding&&o.push(...DR(y.encoding))}),A.vconcat&&A.vconcat.forEach(y=>{n=AW(y.mark),y.encoding&&o.push(...DR(y.encoding))});const g={},a=new Map,s=new Map;e.forEach(y=>{s.set(y.name,y)});const I=(y,G,R)=>{const x=`${y}|${f0e(G)}`;a.has(x)||a.set(x,{field:y,rule:f0e(G),value:[]}),G.startsWith(">")||G.startsWith("gt")?a.get(x).value=[R,a.get(x).value[1]??null]:G.startsWith("<")||G.startsWith("lt")?a.get(x).value=[a.get(x).value[0]??null,R]:G==="range"?a.get(x).value=R:G==="oneOf"?a.get(x).value.push(...R):a.get(x).value.push(R)};A.transform&&A.transform.forEach(y=>{if(y.fold&&(g.folds=y.fold.map(G=>{var R;return((R=s.get(G))==null?void 0:R.fid)??G})),y.filter&&(typeof y.filter=="string"&&y.filter.split(/[\&\&|\|\|]/g).forEach(R=>{const x=/datum(\.[A-z_]+|\[['"][A-z\s_]+['"]\])\s*((\!=|==|>|<)=?)\s*(.*)/.exec(R);if(x){const F=/(?:\.|\[["'])([A-z\s_]*)(?:["']\])?/.exec(x[1]),Q=/["'](.*)["']/.exec(x[4]);if(!F||!Q)return;const k=x[2];I(F[1],k,Q[1])}}),typeof y.filter=="object"))if(y.filter.field==="rank")y.filter.lte?g.limit=y.filter.lte:y.filter.lt&&(g.limit=Math.floor(y.filter.lt),g.limit==y.filter.lt&&(g.limit-=1));else{const G=Object.keys(y.filter).find(R=>["equal","oneOf","lt","lte","gt","gte","range"].includes(R));G&&I(y.filter.field,G,y.filter[G])}});const r=Array.from(a.values()).map(({field:y,rule:G,value:R})=>({fid:y,rule:{type:G,value:R}})),C=o.flatMap(({name:y,value:G})=>xhi(y)?[Hhi(y,G,s)]:[]),l=C.reduce((y,G)=>y||!!G.aggregate,!1),c=C.reduce((y,G)=>G.sort??y,"none"),B=C.reduce((y,G)=>G.stack??y,["bar","area","arc"].includes(n)?"stack":"none"),E=C.reduce((y,G)=>G.binDimension&&!y.has(G.binDimension.name)?y.set(G.binDimension.name,G.binDimension):y,new Map),u=C.flatMap(y=>{if(y.dimension&&y.dimensionType){if(y.binDimension)return[{name:y.dimensionType,value:E.get(y.binDimension.name)??y.binDimension}];const G=y.analyticType==="auto"?l?"dimension":"measure":y.analyticType;return[{name:y.dimensionType,value:{...y.dimension,analyticType:G,...y.aggregate?{aggName:y.aggregate}:{},...c&&c!=="none"&&(y.dimensionType==="column"||y.dimensionType==="row")&&G==="dimension"?{sort:c}:{}}}]}return[]}),d=y=>G=>G.name===y,f=y=>y.value,w=y=>y0e(y,G=>G.fid);return CQi({visId:t,name:i,encodings:{dimensions:e.filter(y=>y.analyticType==="dimension").concat(...E.values()),measures:e.filter(y=>y.analyticType==="measure"&&y.fid!==$Z.fid).concat($Z),columns:w(u.filter(d("facetX")).concat(u.filter(d("column"))).map(f)),rows:w(u.filter(d("facetY")).concat(u.filter(d("row"))).map(f)),details:w(u.filter(d("details")).map(f)),opacity:w(u.filter(d("opacity")).map(f)),radius:w(u.filter(d("radius")).map(f)),shape:w(u.filter(d("shape")).map(f)),size:w(u.filter(d("size")).map(f)),text:w(u.filter(d("text")).map(f)),theta:w(u.filter(d("theta")).map(f)),color:w(u.filter(d("color")).map(f)),filters:y0e(r.map(y=>({...s.get(y.fid),rule:y.rule})),y=>{var G;return`${y.fid}_${(G=y.rule)==null?void 0:G.type}`})},layout:{stack:B},config:{defaultAggregated:l,geoms:[n],...g}})}function GR(A,e){return A.map((t,i)=>["config","encodings","visId"].every(n=>t.hasOwnProperty(n))?t:Zhi(t,e,Math.random().toString(16).split(".").at(1),`Chart ${i+1}`))}function Whi(A,e){return{key:"open_in_desktop",label:"open_desktop",icon:i=>IA(YEi,{...i}),onClick:async()=>{var i,n,o;vs.track("click",{entity:"open_desktop_icon"}),await((o=Hr.comm)==null?void 0:o.sendMsg("open_in_desktop",{spec:JSON.parse(JSON.stringify((i=e.current)==null?void 0:i.visList)),fields:JSON.parse(JSON.stringify((n=e.current)==null?void 0:n.meta))}))}}}const Khi="https://www.runcell.dev/runcell-logo.svg",Uhi="https://www.runcell.dev?utm_source=pygwalker",Vhi=["https://www.runcell.dev/llm-icons/openai.svg","https://www.runcell.dev/llm-icons/claude-color.svg","https://www.runcell.dev/llm-icons/gemini-color.svg","https://www.runcell.dev/llm-icons/deepseek-color.svg"],Xhi=()=>{try{return window.parent.localStorage.getItem("plugin_auth_user_v2")!==null}catch{return!1}},zhi=({env:A})=>{const[e,t]=p.useState(!1);if(A!=="jupyter_widgets"&&A!=="anywidget"||Xhi()||e)return null;const i=()=>{vs.track("click",{entity:"runcell_banner"}),window.open(Uhi,"_blank")},n=o=>{o.stopPropagation(),vs.track("click",{entity:"runcell_banner_dismiss"}),t(!0)};return PA("div",{className:"flex items-center justify-between gap-3 px-4 py-2 mb-2 rounded-md bg-gradient-to-r from-purple-50 to-blue-50 dark:from-purple-950/30 dark:to-blue-950/30 border border-purple-200 dark:border-purple-800 cursor-pointer hover:shadow-md transition-shadow",onClick:i,children:[PA("div",{className:"flex items-center gap-3",children:[IA("img",{src:Khi,alt:"Runcell",className:"w-6 h-6"}),IA("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Enable AI Agent for data analysis with pip install runcell"})]}),PA("div",{className:"flex items-center gap-2",children:[IA("div",{className:"flex items-center gap-1 px-2 py-1 rounded-full bg-white/80",children:Vhi.map((o,g)=>IA("img",{src:o,alt:"LLM",className:"w-4 h-4"},g))}),IA("button",{onClick:n,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 text-lg leading-none px-1","aria-label":"Dismiss",children:"×"})]})]})},Thi=async(A,e,t)=>{var i,n;if(t.needInitChart&&t.env==="jupyter_widgets"&&e!==0){Me.setInitModalOpen(!0),Me.setInitModalInfo({title:"Recover Charts",curIndex:0,total:e});for await(const o of(i=A.current)==null?void 0:i.exportChartList("data-url"))await((n=Hr.comm)==null?void 0:n.sendMsg("save_chart",await bme(o.data))),Me.setInitModalInfo({title:"Recover Charts",curIndex:o.index+1,total:o.total})}Me.setInitModalOpen(!1)},$8=A=>{if(A.useKernelCalc&&A.parseDslType==="client")return hai(A.fieldMetas);if(A.useKernelCalc&&A.parseDslType==="server")return mai},eW=Gu(A=>{const[e,t]=p.useState(null),[i,n]=p.useState(A.darkMode),[o,g]=p.useState(KyA(A.darkMode)),a=p.useCallback(s=>{A.sendMessage&&window.parent.postMessage({action:"changeAppearance",gid:A.gid,appearance:s},"*")},[A.gid,A.sendMessage]);return p.useEffect(()=>{if(i==="media"){g(KyA(i)),a(KyA(i));const s=window.matchMedia("(prefers-color-scheme: dark)"),I=r=>{g(r.matches?"dark":"light")};return s.addEventListener("change",I),()=>s.removeEventListener("change",I)}else a(i),g(i)},[i]),IA(Bri,{portalContainerContext:e,darkModeContext:o,children:IA("div",{className:`${o==="dark"?"dark":""} bg-background text-foreground`,children:PA("div",{className:"p-2",children:[IA("style",{children:Ohe}),IA("div",{className:"overflow-y-auto",children:A.children}),!A.hideToolBar&&IA("div",{className:"flex w-full mt-1 p-1 overflow-hidden border-t border-border",children:PA(h0e,{type:"single",value:i,onValueChange:s=>{s&&n(s)},children:[IA(P8,{value:"dark",children:IA(oCi,{className:"h-4 w-4"})}),IA(P8,{value:"light",children:IA(aCi,{className:"h-4 w-4"})}),IA(P8,{value:"media",children:IA(iCi,{className:"h-4 w-4"})})]})}),IA(FQi,{}),IA("div",{ref:t})]})})})}),_hi=A=>{const e=b.useRef(null),{userConfig:t}=A,[i,n]=p.useState(!1),[o,g]=p.useState("walker"),[a,s]=p.useState(A.visSpec),[I,r]=p.useState(!0),[C,l]=p.useState(!1),c=b.useRef(null),B=b.useRef(),E=b.useMemo(()=>new Proxy(c,{set(F,Q,k){var h;if(Q==="current"&&k){(h=B.current)==null||h.call(B);const N=k;B.current=vDe(()=>N.currentVis,()=>{l(k.canUndo),Nai({event:"spec_change",data:N.exportCode()})})}return Reflect.set(F,Q,k)}}),[]);Me.setVersion(A.version),p.useEffect(()=>{Me.setShowCloudTool(A.showCloudTool),vs.setUserId(A.hashcode??""),t&&(Rai(t),vs.setOpen(t.privacy==="events"))},[]),p.useEffect(()=>{A.initChartFlag&&setTimeout(()=>{Thi(e,a.length,A)},0)},[A.initChartFlag]),p.useEffect(()=>{setTimeout(()=>{var F;(F=c.current)==null||F.setSegmentKey(A.defaultTab)},0)},[o]);const u=VEi(),d=ZEi(n),f=Whi(A,c),w=[u,d,f];if(A.env&&["jupyter_widgets","streamlit","gradio","marimo","anywidget","web_server"].indexOf(A.env)!==-1&&A.useSaveTool){const F=HEi(A,e,c,C,l);w.push(F)}if(A.isExportDataFrame){const F=WEi(A,c);w.push(F)}const y={exclude:["export_code"],extra:w},G=b.useMemo(()=>{if(A.showCloudTool){const F={};if(A.enableAskViz&&(F.askviz=async(Q,k)=>{var N;const h=await((N=Hr.comm)==null?void 0:N.sendMsg("get_spec_by_text",{metas:Q,query:k}));return h==null?void 0:h.data.data}),A.enableVlChat&&(F.vlChat=async(Q,k)=>{var N;const h=await((N=Hr.comm)==null?void 0:N.sendMsg("get_chart_by_chats",{metas:Q,chats:k}));return h==null?void 0:h.data.data}),Object.keys(F).length>0)return{features:F}}},[A.showCloudTool,A.enableAskViz,A.enableVlChat]),R=b.useMemo(()=>$8(A),[]),x=F=>{var Q;o==="walker"&&s((Q=c.current)==null?void 0:Q.exportCode()),g(F)};return PA(b.StrictMode,{children:[IA(dui,{}),IA(RQi,{storeRef:c,setGwIsChanged:l}),IA(xQi,{gwRef:e,storeRef:c,dark:p.useContext(j0)}),IA(mQi,{open:i,setOpen:n,globalStore:c,sourceCode:A.sourceInvokeCode||""}),!I&&PA(yhi,{onValueChange:x,defaultValue:"walker",children:[PA(t0e,{className:"w-[140px] h-[30px] mb-[20px] text-xs",children:[IA("span",{className:"text-muted-foreground",children:"Mode: "}),IA(bhi,{className:"",placeholder:"Mode"})]}),PA(o0e,{children:[IA(HyA,{value:"walker",children:"Walker"}),IA(HyA,{value:"renderer",children:"Renderer"})]})]}),o==="walker"?IA(Jce,{...A.extraConfig,appearance:p.useContext(j0),vizThemeConfig:A.themeKey,fieldkeyGuard:A.fieldkeyGuard,fields:A.rawFields,data:A.useKernelCalc?void 0:A.dataSource,storeRef:E,ref:e,toolbar:y,computation:R,enhanceAPI:G,chart:a.length===0?void 0:a,experimentalFeatures:{computedField:A.useKernelCalc},defaultConfig:{config:{timezoneDisplayOffset:0}}}):IA(w0e,{...A,dataSource:A.dataSource,visSpec:a}),IA(gai,{...A})]})},Ohi=Gu(A=>{const e=$8(A),t=A.visSpec[0],[i,n]=p.useState(!1);return IA(b.StrictMode,{children:PA("div",{className:"flex",children:[!i&&IA(EpA,{...A.extraConfig,appearance:p.useContext(j0),vizThemeConfig:A.themeKey,name:t.name,visualConfig:t.config,visualLayout:t.layout,visualState:t.encodings,type:"remote",computation:e}),i&&Me.isStreamlitComponent&&IA("div",{style:{minWidth:"96%"},children:IA(Jce,{...A.extraConfig,appearance:p.useContext(j0),vizThemeConfig:A.themeKey,fieldkeyGuard:A.fieldkeyGuard,fields:A.rawFields,data:A.useKernelCalc?void 0:A.dataSource,computation:e,chart:A.visSpec,experimentalFeatures:{computedField:A.useKernelCalc},defaultConfig:{config:{timezoneDisplayOffset:0}}})}),Me.isStreamlitComponent&&i&&IA(OIi,{className:"h-6 w-6 cursor-pointer border border-black-600 rounded-full",onClick:()=>n(!1)}),Me.isStreamlitComponent&&!i&&IA(jIi,{className:"h-6 w-6 cursor-pointer border border-black-600 rounded-full",onClick:()=>n(!0)})]})})}),qhi=async A=>{const e=Gai(A.id);if(e.registerEndpoint("postData",Qai),e.registerEndpoint("finishData",Eai),Hr.setComm(e),A.needLoadLastSpec){const t=await e.sendMsg("get_latest_vis_spec",{});A.visSpec=GR(t.data.visSpec,A.rawFields)}A.needLoadDatas&&e.sendMsgAsync("request_data",{},null),await b6()},AP=async A=>{const e=await Jai(A.id,A.communicationUrl);if(Hr.setComm(e),(A.gwMode==="explore"||A.gwMode==="filter_renderer")&&A.needLoadLastSpec){const t=await e.sendMsg("get_latest_vis_spec",{});A.visSpec=t.data.visSpec}await b6()},jhi=async(A,e)=>{const t=await Yai(A.id,e);if(Hr.setComm(t),(A.gwMode==="explore"||A.gwMode==="filter_renderer")&&A.needLoadLastSpec){const i=await t.sendMsg("get_latest_vis_spec",{});A.visSpec=i.data.visSpec}await b6()},b0e=async A=>{};function UyA(A){const[e,t]=p.useState(!1),[i,n]=p.useState(A.dataSource);return p.useEffect(()=>{A.needLoadDatas?Bai(A.dataSourceProps).then(o=>{n(o),t(!0),Me.setInitModalOpen(!1)}):t(!0)},[]),PA(b.StrictMode,{children:[IA(zhi,{env:A.env}),A.gwMode==="explore"&&IA(_hi,{...A,dataSource:i,initChartFlag:e}),A.gwMode==="renderer"&&IA(Ohi,{...A,dataSource:i}),A.gwMode==="filter_renderer"&&IA(w0e,{...A,dataSource:i}),A.gwMode==="table"&&IA(emi,{...A,dataSource:i})]})}function Phi(A,e){A.visSpec=GR(A.visSpec,A.rawFields);let t=b0e;switch(A.env){case"jupyter_widgets":t=qhi;break;case"streamlit":t=AP;break;case"gradio":t=AP;break;case"web_server":t=AP;break;default:t=b0e}t(A).then(()=>{var n;const i=document.getElementById(e);i&&wf.createRoot(i).render(IA(eW,{darkMode:A.dark,gid:A.id,sendMessage:(n=A.env)==null?void 0:n.startsWith("jupyter"),children:IA(UyA,{...A})}))})}function $hi(A,e){var i;A.charts=GR(A.charts.map(n=>n.visSpec),[]).map((n,o)=>({...A.charts[o],visSpec:n})),window.document.getElementById(`gwalker-${A.gid}`)&&((i=window.document.getElementById(e))==null||i.remove());const t=document.getElementById(e);t&&wf.createRoot(t).render(IA(eW,{darkMode:A.dark,hideToolBar:!0,children:IA(pQi,{...A})}))}function Ami(A,e){A.visSpec=GR([A.visSpec],[])[0];const t=document.getElementById(e);t&&wf.createRoot(t).render(IA(eW,{darkMode:A.dark,hideToolBar:!0,children:IA(fQi,{...A})}))}function w0e(A){const e=$8(A),t=A.containerSize??[null,null],i={rawFields:A.rawFields,containerStyle:{height:t[1]?`${t[1]-200}px`:"700px",width:t[0]?`${t[0]-20}px`:"60%"},themeKey:A.themeKey,dark:p.useContext(j0)};return IA(b.StrictMode,{children:PA(ypA,{defaultValue:"0",className:"w-full",children:[IA("div",{className:"overflow-x-auto max-w-full",children:IA(Rj,{children:A.visSpec.map((n,o)=>IA(aZ,{value:o.toString(),children:n.name},o))})}),A.visSpec.map((n,o)=>IA(sZ,{value:o.toString(),children:A.useKernelCalc?IA(Nce,{...i,computation:e,chart:[n]}):IA(Nce,{...i,data:A.dataSource,chart:[n]})},o))]})})}function emi(A){const e=$8(A),t={rawFields:A.rawFields,themeKey:A.themeKey,dark:p.useContext(j0)};return IA(b.StrictMode,{children:A.useKernelCalc?IA(Yce,{...t,computation:e}):IA(Yce,{...t,data:A.dataSource})})}function tmi(A){const e=A.args,[t,i]=p.useState(!1),n=b.useRef(null);return e.visSpec=GR(e.visSpec,e.rawFields),p.useEffect(()=>{Me.setIsStreamlitComponent(!0),AP(e).then(()=>{i(!0)})},[]),p.useEffect(()=>{if(!n.current)return;const o=new ResizeObserver(()=>{var g;kE.setFrameHeight((((g=n.current)==null?void 0:g.clientHeight)??0)+20)});return o.observe(n.current),()=>o.disconnect()},[t]),IA(b.StrictMode,{children:t&&IA("div",{ref:n,children:IA(eW,{darkMode:e.dark,children:IA(UyA,{...e})})})})}const imi=()=>{const A=Pgi(tmi),e=document.getElementById("root");e&&wf.createRoot(e).render(IA(b.StrictMode,{children:IA(A,{})}))};function nmi(){const[A,e]=p.useState(!1),t=Aai(),i=JSON.parse(t.get("props"));return i.visSpec=GR(i.visSpec,i.rawFields),p.useEffect(()=>{jhi(i,t).then(()=>{e(!0)})},[]),PA(b.StrictMode,{children:[!A&&IA("div",{children:"Loading..."}),A&&IA(eW,{darkMode:i.dark,children:IA(UyA,{...i})})]})}const omi={GWalker:Phi,PreviewApp:$hi,ChartPreviewApp:Ami,StreamlitGWalker:imi,render:eai(nmi)};function gmi(A){var e=A;return!!(e.ctrlKey||e.shiftKey||e.metaKey||e.button&&e.button==1)}function ami(A,e){return!!(A.target==="_blank"&&e)}function smi(A,e,t,i){var n=this,o=[];return A?(A instanceof Element?o=[A]:"toArray"in A?o=A.toArray():o=A,o.forEach(function(g){g.addEventListener("click",function(a){var s,I,r=e instanceof Function?e(g):e,C=t instanceof Function?t(g):t,l=g.getAttribute("href")||g.getAttributeNS("http://www.w3.org/1999/xlink","href")||g.getAttribute("xlink:href")||((s=g.getElementsByTagName("a")[0])===null||s===void 0?void 0:s.getAttribute("href")),c=$0A(n.track(r,C,i??{}),(I=n.settings.timeout)!==null&&I!==void 0?I:500);!ami(g,l)&&!gmi(a)&&l&&(a.preventDefault?a.preventDefault():a.returnValue=!1,c.catch(console.error).then(function(){window.location.href=l}).catch(console.error))},!1)}),this):this}function rmi(A,e,t,i){var n=this;if(!A)return this;A instanceof HTMLFormElement&&(A=[A]);var o=A;return o.forEach(function(g){if(!(g instanceof Element))throw new TypeError("Must pass HTMLElement to trackForm/trackSubmit.");var a=function(I){var r;I.preventDefault?I.preventDefault():I.returnValue=!1;var C=e instanceof Function?e(g):e,l=t instanceof Function?t(g):t,c=$0A(n.track(C,l,i??{}),(r=n.settings.timeout)!==null&&r!==void 0?r:500);c.catch(console.error).then(function(){g.submit()}).catch(console.error)},s=window.jQuery||window.Zepto;s?s(g).submit(a):g.addEventListener("submit",a,!1)}),this}const eP=Object.freeze(Object.defineProperty({__proto__:null,form:rmi,link:smi},Symbol.toStringTag,{value:"Module"}));function D0e(A,e){return Object.keys(e).reduce(function(t,i){if(i.startsWith(A)){var n=i.substr(A.length);t[n]=e[i]}return t},{})}function Imi(A,e){var t=document.createElement("a");t.href=e;var i=t.search.slice(1),n=i.split("&").reduce(function(w,y){var G=y.split("="),R=G[0],x=G[1];return w[R]=Pde(x),w},{}),o=[],g=n.ajs_uid,a=n.ajs_event,s=n.ajs_aid,I=Zr(A.options.useQueryString)?A.options.useQueryString:{},r=I.aid,C=r===void 0?/.+/:r,l=I.uid,c=l===void 0?/.+/:l;if(s){var B=Array.isArray(n.ajs_aid)?n.ajs_aid[0]:n.ajs_aid;C.test(B)&&A.setAnonymousId(B)}if(g){var E=Array.isArray(n.ajs_uid)?n.ajs_uid[0]:n.ajs_uid;if(c.test(E)){var u=D0e("ajs_trait_",n);o.push(A.identify(E,u))}}if(a){var d=Array.isArray(n.ajs_event)?n.ajs_event[0]:n.ajs_event,f=D0e("ajs_prop_",n);o.push(A.track(d,f))}return Promise.all(o)}const Cmi=Object.freeze(Object.defineProperty({__proto__:null,queryString:Imi},Symbol.toStringTag,{value:"Module"}));var tW={},lmi={get exports(){return tW},set exports(A){tW=A}};(function(A,e){/*! For license information please see tsub.js.LICENSE.txt */(function(t,i){A.exports=i()})(self,function(){return function(){var t={2870:function(o,g,a){var s=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(g,"__esModule",{value:!0}),g.Store=g.matches=g.transform=void 0;var I=a(4303);Object.defineProperty(g,"transform",{enumerable:!0,get:function(){return s(I).default}});var r=a(2370);Object.defineProperty(g,"matches",{enumerable:!0,get:function(){return s(r).default}});var C=a(1444);Object.defineProperty(g,"Store",{enumerable:!0,get:function(){return s(C).default}})},2370:function(o,g,a){var s=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(g,"__esModule",{value:!0});var I=s(a(7843));function r(u,d){if(!Array.isArray(u))return C(u,d)===!0;var f,w,y,G,R=u[0];switch(R){case"!":return!r(u[1],d);case"or":for(var x=1;x<u.length;x++)if(r(u[x],d))return!0;return!1;case"and":for(x=1;x<u.length;x++)if(!r(u[x],d))return!1;return!0;case"=":case"!=":return function(Q,k,h,N){switch(l(Q)&&(Q=r(Q,N)),l(k)&&(k=r(k,N)),typeof Q=="object"&&typeof k=="object"&&(Q=JSON.stringify(Q),k=JSON.stringify(k)),h){case"=":return Q===k;case"!=":return Q!==k;default:throw new Error("Invalid operator in compareItems: ".concat(h))}}(C(u[1],d),C(u[2],d),R,d);case"<=":case"<":case">":case">=":return function(Q,k,h,N){if(l(Q)&&(Q=r(Q,N)),l(k)&&(k=r(k,N)),typeof Q!="number"||typeof k!="number")return!1;switch(h){case"<=":return Q<=k;case">=":return Q>=k;case"<":return Q<k;case">":return Q>k;default:throw new Error("Invalid operator in compareNumbers: ".concat(h))}}(C(u[1],d),C(u[2],d),R,d);case"in":return function(Q,k,h){return k.find(function(N){return C(N,h)===Q})!==void 0}(C(u[1],d),C(u[2],d),d);case"contains":return y=C(u[1],d),G=C(u[2],d),typeof y=="string"&&typeof G=="string"&&y.indexOf(G)!==-1;case"match":return f=C(u[1],d),w=C(u[2],d),typeof f=="string"&&typeof w=="string"&&function(Q,k){var h,N;A:for(;Q.length>0;){var v,K;if(v=(h=c(Q)).star,K=h.chunk,Q=h.pattern,v&&K==="")return!0;var U=B(K,k),V=U.t,X=U.ok,_=U.err;if(_)return!1;if(!X||!(V.length===0||Q.length>0)){if(v)for(var q=0;q<k.length;q++){if(V=(N=B(K,k.slice(q+1))).t,X=N.ok,_=N.err,X){if(Q.length===0&&V.length>0)continue;k=V;continue A}if(_)return!1}return!1}k=V}return k.length===0}(w,f);case"lowercase":var F=C(u[1],d);return typeof F!="string"?null:F.toLowerCase();case"typeof":return typeof C(u[1],d);case"length":return function(Q){return Q===null?0:Array.isArray(Q)||typeof Q=="string"?Q.length:NaN}(C(u[1],d));default:throw new Error("FQL IR could not evaluate for token: ".concat(R))}}function C(u,d){return Array.isArray(u)?u:typeof u=="object"?u.value:(0,I.default)(d,u)}function l(u){return!!Array.isArray(u)&&((u[0]==="lowercase"||u[0]==="length"||u[0]==="typeof")&&u.length===2||(u[0]==="contains"||u[0]==="match")&&u.length===3)}function c(u){for(var d={star:!1,chunk:"",pattern:""};u.length>0&&u[0]==="*";)u=u.slice(1),d.star=!0;var f,w=!1;A:for(f=0;f<u.length;f++)switch(u[f]){case"\\":f+1<u.length&&f++;break;case"[":w=!0;break;case"]":w=!1;break;case"*":if(!w)break A}return d.chunk=u.slice(0,f),d.pattern=u.slice(f),d}function B(u,d){for(var f,w,y={t:"",ok:!1,err:!1};u.length>0;){if(d.length===0)return y;switch(u[0]){case"[":var G=d[0];d=d.slice(1);var R=!0;(u=u.slice(1)).length>0&&u[0]==="^"&&(R=!1,u=u.slice(1));for(var x=!1,F=0;;){if(u.length>0&&u[0]==="]"&&F>0){u=u.slice(1);break}var Q,k="";if(Q=(f=E(u)).char,u=f.newChunk,f.err||(k=Q,u[0]==="-"&&(k=(w=E(u.slice(1))).char,u=w.newChunk,w.err)))return y;Q<=G&&G<=k&&(x=!0),F++}if(x!==R)return y;break;case"?":d=d.slice(1),u=u.slice(1);break;case"\\":if((u=u.slice(1)).length===0)return y.err=!0,y;default:if(u[0]!==d[0])return y;d=d.slice(1),u=u.slice(1)}}return y.t=d,y.ok=!0,y.err=!1,y}function E(u){var d={char:"",newChunk:"",err:!1};return u.length===0||u[0]==="-"||u[0]==="]"||u[0]==="\\"&&(u=u.slice(1)).length===0?(d.err=!0,d):(d.char=u[0],d.newChunk=u.slice(1),d.newChunk.length===0&&(d.err=!0),d)}g.default=function(u,d){if(!d)throw new Error("No matcher supplied!");switch(d.type){case"all":return!0;case"fql":return function(f,w){if(!f)return!1;try{f=JSON.parse(f)}catch(G){throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(f,'": ').concat(G))}var y=r(f,w);return typeof y=="boolean"&&y}(d.ir,u);default:throw new Error("Matcher of type ".concat(d.type," unsupported."))}}},1444:function(o,g){Object.defineProperty(g,"__esModule",{value:!0});var a=function(){function s(I){this.rules=[],this.rules=I||[]}return s.prototype.getRulesByDestinationName=function(I){for(var r=[],C=0,l=this.rules;C<l.length;C++){var c=l[C];c.destinationName!==I&&c.destinationName!==void 0||r.push(c)}return r},s}();g.default=a},4303:function(o,g,a){var s=this&&this.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(g,"__esModule",{value:!0});var I=s(a(374)),r=s(a(7843)),C=s(a(5500)),l=a(9014),c=a(4966);function B(y,G){u(y,G.drop,function(R,x){x.forEach(function(F){return delete R[F]})})}function E(y,G){u(y,G.allow,function(R,x){Object.keys(R).forEach(function(F){x.includes(F)||delete R[F]})})}function u(y,G,R){Object.entries(G).forEach(function(x){var F=x[0],Q=x[1],k=function(N){typeof N=="object"&&N!==null&&R(N,Q)},h=F===""?y:(0,r.default)(y,F);Array.isArray(h)?h.forEach(k):k(h)})}function d(y,G){var R=JSON.parse(JSON.stringify(y));for(var x in G.map)if(G.map.hasOwnProperty(x)){var F=G.map[x],Q=x.split("."),k=void 0;if(Q.length>1?(Q.pop(),k=(0,r.default)(R,Q.join("."))):k=y,typeof k=="object"){if(F.copy){var h=(0,r.default)(R,F.copy);h!==void 0&&(0,l.dset)(y,x,h)}else if(F.move){var N=(0,r.default)(R,F.move);N!==void 0&&(0,l.dset)(y,x,N),(0,c.unset)(y,F.move)}else F.hasOwnProperty("set")&&(0,l.dset)(y,x,F.set);if(F.to_string){var v=(0,r.default)(y,x);if(typeof v=="string"||typeof v=="object"&&v!==null)continue;v!==void 0?(0,l.dset)(y,x,JSON.stringify(v)):(0,l.dset)(y,x,"undefined")}}}}function f(y,G){return!(G.sample.percent<=0)&&(G.sample.percent>=1||(G.sample.path?function(x,F){var Q=(0,r.default)(x,F.sample.path),k=(0,I.default)(JSON.stringify(Q)),h=-64,N=[];w(k.slice(0,8),N);for(var v=0,K=0;K<64&&N[K]!==1;K++)v++;if(v!==0){var U=[];w(k.slice(9,16),U),h-=v,N.splice(0,v),U.splice(64-v),N=N.concat(U)}return N[63]=N[63]===0?1:0,(0,C.default)(parseInt(N.join(""),2),h)<F.sample.percent}(y,G):(R=G.sample.percent,Math.random()<=R)));var R}function w(y,G){for(var R=0;R<8;R++)for(var x=y[R],F=128;F>=1;F/=2)x-F>=0?(x-=F,G.push(1)):G.push(0)}g.default=function(y,G){for(var R=y,x=0,F=G;x<F.length;x++){var Q=F[x];switch(Q.type){case"drop":return null;case"drop_properties":B(R,Q.config);break;case"allow_properties":E(R,Q.config);break;case"sample_event":if(f(R,Q.config))break;return null;case"map_properties":d(R,Q.config);break;case"hash_properties":break;default:throw new Error('Transformer of type "'.concat(Q.type,'" is unsupported.'))}}return R}},4966:function(o,g,a){var s=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(g,"__esModule",{value:!0}),g.unset=void 0;var I=s(a(7843));g.unset=function(r,C){if((0,I.default)(r,C)){for(var l=C.split("."),c=l.pop();l.length&&l[l.length-1].slice(-1)==="\\";)c=l.pop().slice(0,-1)+"."+c;for(;l.length;)r=r[C=l.shift()];return delete r[c]}return!0}},9014:function(o,g){g.dset=function(a,s,I){s.split&&(s=s.split("."));for(var r,C,l=0,c=s.length,B=a;l<c&&(C=s[l++])!=="__proto__"&&C!=="constructor"&&C!=="prototype";)B=B[C]=l===c?I:typeof(r=B[C])==typeof s?r:0*s[l]!=0||~(""+s[l]).indexOf(".")?{}:[]}},3304:function(o){var g=typeof Float64Array=="function"?Float64Array:void 0;o.exports=g},7382:function(o,g,a){var s,I=a(5569),r=a(3304),C=a(8482);s=I()?r:C,o.exports=s},8482:function(o){o.exports=function(){throw new Error("not implemented")}},6322:function(o,g,a){var s,I=a(2508),r=a(5679),C=a(882);s=I()?r:C,o.exports=s},882:function(o){o.exports=function(){throw new Error("not implemented")}},5679:function(o){var g=typeof Uint16Array=="function"?Uint16Array:void 0;o.exports=g},4773:function(o,g,a){var s,I=a(9773),r=a(3004),C=a(3078);s=I()?r:C,o.exports=s},3078:function(o){o.exports=function(){throw new Error("not implemented")}},3004:function(o){var g=typeof Uint32Array=="function"?Uint32Array:void 0;o.exports=g},7980:function(o,g,a){var s,I=a(8114),r=a(6737),C=a(3357);s=I()?r:C,o.exports=s},3357:function(o){o.exports=function(){throw new Error("not implemented")}},6737:function(o){var g=typeof Uint8Array=="function"?Uint8Array:void 0;o.exports=g},2684:function(o){var g=typeof Float64Array=="function"?Float64Array:null;o.exports=g},5569:function(o,g,a){var s=a(3876);o.exports=s},3876:function(o,g,a){var s=a(1448),I=a(2684);o.exports=function(){var r,C;if(typeof I!="function")return!1;try{C=new I([1,3.14,-3.14,NaN]),r=s(C)&&C[0]===1&&C[1]===3.14&&C[2]===-3.14&&C[3]!=C[3]}catch{r=!1}return r}},9048:function(o,g,a){var s=a(3763);o.exports=s},3763:function(o){var g=Object.prototype.hasOwnProperty;o.exports=function(a,s){return a!=null&&g.call(a,s)}},7009:function(o,g,a){var s=a(6784);o.exports=s},6784:function(o){o.exports=function(){return typeof Symbol=="function"&&typeof Symbol("foo")=="symbol"}},3123:function(o,g,a){var s=a(8481);o.exports=s},8481:function(o,g,a){var s=a(7009)();o.exports=function(){return s&&typeof Symbol.toStringTag=="symbol"}},2508:function(o,g,a){var s=a(3403);o.exports=s},3403:function(o,g,a){var s=a(768),I=a(9668),r=a(187);o.exports=function(){var C,l;if(typeof r!="function")return!1;try{l=new r(l=[1,3.14,-3.14,I+1,I+2]),C=s(l)&&l[0]===1&&l[1]===3&&l[2]===I-2&&l[3]===0&&l[4]===1}catch{C=!1}return C}},187:function(o){var g=typeof Uint16Array=="function"?Uint16Array:null;o.exports=g},9773:function(o,g,a){var s=a(2822);o.exports=s},2822:function(o,g,a){var s=a(2744),I=a(3899),r=a(746);o.exports=function(){var C,l;if(typeof r!="function")return!1;try{l=new r(l=[1,3.14,-3.14,I+1,I+2]),C=s(l)&&l[0]===1&&l[1]===3&&l[2]===I-2&&l[3]===0&&l[4]===1}catch{C=!1}return C}},746:function(o){var g=typeof Uint32Array=="function"?Uint32Array:null;o.exports=g},8114:function(o,g,a){var s=a(8066);o.exports=s},8066:function(o,g,a){var s=a(8279),I=a(3443),r=a(2731);o.exports=function(){var C,l;if(typeof r!="function")return!1;try{l=new r(l=[1,3.14,-3.14,I+1,I+2]),C=s(l)&&l[0]===1&&l[1]===3&&l[2]===I-2&&l[3]===0&&l[4]===1}catch{C=!1}return C}},2731:function(o){var g=typeof Uint8Array=="function"?Uint8Array:null;o.exports=g},1448:function(o,g,a){var s=a(1453);o.exports=s},1453:function(o,g,a){var s=a(6208),I=typeof Float64Array=="function";o.exports=function(r){return I&&r instanceof Float64Array||s(r)==="[object Float64Array]"}},9331:function(o,g,a){var s=a(7980),I={uint16:a(6322),uint8:s};o.exports=I},5902:function(o,g,a){var s=a(4106);o.exports=s},4106:function(o,g,a){var s,I,r=a(9331);(I=new r.uint16(1))[0]=4660,s=new r.uint8(I.buffer)[0]===52,o.exports=s},768:function(o,g,a){var s=a(3823);o.exports=s},3823:function(o,g,a){var s=a(6208),I=typeof Uint16Array=="function";o.exports=function(r){return I&&r instanceof Uint16Array||s(r)==="[object Uint16Array]"}},2744:function(o,g,a){var s=a(2326);o.exports=s},2326:function(o,g,a){var s=a(6208),I=typeof Uint32Array=="function";o.exports=function(r){return I&&r instanceof Uint32Array||s(r)==="[object Uint32Array]"}},8279:function(o,g,a){var s=a(208);o.exports=s},208:function(o,g,a){var s=a(6208),I=typeof Uint8Array=="function";o.exports=function(r){return I&&r instanceof Uint8Array||s(r)==="[object Uint8Array]"}},6315:function(o){o.exports=1023},1686:function(o){o.exports=2147483647},3105:function(o){o.exports=2146435072},3449:function(o){o.exports=2147483648},6988:function(o){o.exports=-1023},9777:function(o){o.exports=1023},3690:function(o){o.exports=-1074},2918:function(o,g,a){var s=a(4772).NEGATIVE_INFINITY;o.exports=s},4165:function(o){var g=Number.POSITIVE_INFINITY;o.exports=g},6488:function(o){o.exports=22250738585072014e-324},9668:function(o){o.exports=65535},3899:function(o){o.exports=4294967295},3443:function(o){o.exports=255},7011:function(o,g,a){var s=a(812);o.exports=s},812:function(o,g,a){var s=a(4165),I=a(2918);o.exports=function(r){return r===s||r===I}},1883:function(o,g,a){var s=a(1797);o.exports=s},1797:function(o){o.exports=function(g){return g!=g}},513:function(o,g,a){var s=a(5760);o.exports=s},5760:function(o){o.exports=function(g){return Math.abs(g)}},5848:function(o,g,a){var s=a(677);o.exports=s},677:function(o,g,a){var s=a(3449),I=a(1686),r=a(7838),C=a(1921),l=a(2490),c=[0,0];o.exports=function(B,E){var u,d;return r.assign(B,c,1,0),u=c[0],u&=I,d=C(E),l(u|=d&=s,c[1])}},5500:function(o,g,a){var s=a(8397);o.exports=s},8397:function(o,g,a){var s=a(4165),I=a(2918),r=a(6315),C=a(9777),l=a(6988),c=a(3690),B=a(1883),E=a(7011),u=a(5848),d=a(4948),f=a(8478),w=a(7838),y=a(2490),G=[0,0],R=[0,0];o.exports=function(x,F){var Q,k;return x===0||B(x)||E(x)?x:(d(G,x),F+=G[1],(F+=f(x=G[0]))<c?u(0,x):F>C?x<0?I:s:(F<=l?(F+=52,k=2220446049250313e-31):k=1,w(R,x),Q=R[0],Q&=2148532223,k*y(Q|=F+r<<20,R[1])))}},4772:function(o,g,a){var s=a(7548);o.exports=s},7548:function(o){o.exports=Number},8478:function(o,g,a){var s=a(4500);o.exports=s},4500:function(o,g,a){var s=a(1921),I=a(3105),r=a(6315);o.exports=function(C){var l=s(C);return(l=(l&I)>>>20)-r|0}},2490:function(o,g,a){var s=a(9639);o.exports=s},4445:function(o,g,a){var s,I,r;a(5902)===!0?(I=1,r=0):(I=0,r=1),s={HIGH:I,LOW:r},o.exports=s},9639:function(o,g,a){var s=a(4773),I=a(7382),r=a(4445),C=new I(1),l=new s(C.buffer),c=r.HIGH,B=r.LOW;o.exports=function(E,u){return l[c]=E,l[B]=u,C[0]}},5646:function(o,g,a){var s;s=a(5902)===!0?1:0,o.exports=s},1921:function(o,g,a){var s=a(6285);o.exports=s},6285:function(o,g,a){var s=a(4773),I=a(7382),r=a(5646),C=new I(1),l=new s(C.buffer);o.exports=function(c){return C[0]=c,l[r]}},9024:function(o,g,a){var s=a(6488),I=a(7011),r=a(1883),C=a(513);o.exports=function(l,c,B,E){return r(l)||I(l)?(c[E]=l,c[E+B]=0,c):l!==0&&C(l)<s?(c[E]=4503599627370496*l,c[E+B]=-52,c):(c[E]=l,c[E+B]=0,c)}},4948:function(o,g,a){var s=a(7576),I=a(9422);s(I,"assign",a(9024)),o.exports=I},9422:function(o,g,a){var s=a(9024);o.exports=function(I){return s(I,[0,0],1,0)}},5239:function(o,g,a){var s=a(4773),I=a(7382),r=a(5782),C=new I(1),l=new s(C.buffer),c=r.HIGH,B=r.LOW;o.exports=function(E,u,d,f){return C[0]=E,u[f]=l[c],u[f+d]=l[B],u}},7838:function(o,g,a){var s=a(7576),I=a(4010);s(I,"assign",a(5239)),o.exports=I},5782:function(o,g,a){var s,I,r;a(5902)===!0?(I=1,r=0):(I=0,r=1),s={HIGH:I,LOW:r},o.exports=s},4010:function(o,g,a){var s=a(5239);o.exports=function(I){return s(I,[0,0],1,0)}},7576:function(o,g,a){var s=a(7063);o.exports=s},7063:function(o,g,a){var s=a(6691);o.exports=function(I,r,C){s(I,r,{configurable:!1,enumerable:!1,writable:!1,value:C})}},2073:function(o){var g=Object.defineProperty;o.exports=g},1680:function(o){var g=typeof Object.defineProperty=="function"?Object.defineProperty:null;o.exports=g},1471:function(o,g,a){var s=a(1680);o.exports=function(){try{return s({},"x",{}),!0}catch{return!1}}},6691:function(o,g,a){var s,I=a(1471),r=a(2073),C=a(1309);s=I()?r:C,o.exports=s},1309:function(o){var g=Object.prototype,a=g.toString,s=g.__defineGetter__,I=g.__defineSetter__,r=g.__lookupGetter__,C=g.__lookupSetter__;o.exports=function(l,c,B){var E,u,d,f;if(typeof l!="object"||l===null||a.call(l)==="[object Array]")throw new TypeError("invalid argument. First argument must be an object. Value: `"+l+"`.");if(typeof B!="object"||B===null||a.call(B)==="[object Array]")throw new TypeError("invalid argument. Property descriptor must be an object. Value: `"+B+"`.");if((u="value"in B)&&(r.call(l,c)||C.call(l,c)?(E=l.__proto__,l.__proto__=g,delete l[c],l[c]=B.value,l.__proto__=E):l[c]=B.value),d="get"in B,f="set"in B,u&&(d||f))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return d&&s&&s.call(l,c,B.get),f&&I&&I.call(l,c,B.set),l}},6208:function(o,g,a){var s,I=a(3123),r=a(7407),C=a(4210);s=I()?C:r,o.exports=s},7407:function(o,g,a){var s=a(173);o.exports=function(I){return s.call(I)}},4210:function(o,g,a){var s=a(9048),I=a(1403),r=a(173);o.exports=function(C){var l,c,B;if(C==null)return r.call(C);c=C[I],l=s(C,I);try{C[I]=void 0}catch{return r.call(C)}return B=r.call(C),l?C[I]=c:delete C[I],B}},173:function(o){var g=Object.prototype.toString;o.exports=g},1403:function(o){var g=typeof Symbol=="function"?Symbol.toStringTag:"";o.exports=g},7843:function(o){o.exports=function(g,a,s,I,r){for(a=a.split?a.split("."):a,I=0;I<a.length;I++)g=g?g[a[I]]:r;return g===r?s:g}},374:function(o,g,a){a.r(g),a.d(g,{default:function(){return r}});for(var s=[],I=0;I<64;)s[I]=0|4294967296*Math.sin(++I%Math.PI);function r(C){var l,c,B,E=[l=1732584193,c=4023233417,~l,~c],u=[],d=unescape(encodeURI(C))+"",f=d.length;for(C=--f/4+2|15,u[--C]=8*f;~f;)u[f>>2]|=d.charCodeAt(f)<<8*f--;for(I=d=0;I<C;I+=16){for(f=E;d<64;f=[B=f[3],l+((B=f[0]+[l&c|~l&B,B&l|~B&c,l^c^B,c^(l|~B)][f=d>>4]+s[d]+~~u[I|15&[d,5*d+1,3*d+5,7*d][f]])<<(f=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*f+d++%4])|B>>>-f),l,c])l=0|f[1],c=f[2];for(d=4;d;)E[--d]+=f[d]}for(C="";d<32;)C+=(E[d>>3]>>4*(1^d++)&15).toString(16);return C}}},i={};function n(o){var g=i[o];if(g!==void 0)return g.exports;var a=i[o]={exports:{}};return t[o].call(a.exports,a,a.exports,n),a.exports}return n.d=function(o,g){for(var a in g)n.o(g,a)&&!n.o(o,a)&&Object.defineProperty(o,a,{enumerable:!0,get:g[a]})},n.o=function(o,g){return Object.prototype.hasOwnProperty.call(o,g)},n.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},n(2870)}()})})(lmi);var cmi=function(A){return function(e){var t=e.payload,i=e.integration,n=e.next,o=new tW.Store(A),g=o.getRulesByDestinationName(i);g.forEach(function(a){for(var s=a.matchers,I=a.transformers,r=0;r<s.length;r++)if(tW.matches(t.obj,s[r])&&(t.obj=tW.transform(t.obj,I[r]),t.obj===null))return n(null)}),n(t)}};const Bmi=Object.freeze(Object.defineProperty({__proto__:null,tsubMiddleware:cmi},Symbol.toStringTag,{value:"Module"}));function G0e(A,e){var t,i;return typeof(e==null?void 0:e.enabled)=="boolean"?e.enabled:(i=(t=A==null?void 0:A.__default)===null||t===void 0?void 0:t.enabled)!==null&&i!==void 0?i:!0}function k0e(A){return A.toLowerCase().replace(".","").replace(/\s+/g,"-")}function J0e(A,e){return e===void 0&&(e=!1),e?btoa(A).replace(/=/g,""):void 0}function Qmi(A){return("Integration"in A?A.Integration:A).prototype.name}function Emi(A,e,t){var i,n;try{var o=((n=(i=window==null?void 0:window.performance)===null||i===void 0?void 0:i.getEntriesByName(A,"resource"))!==null&&n!==void 0?n:[])[0];o&&e.stats.gauge("legacy_destination_time",Math.round(o.duration),$n([t],o.duration<100?["cached"]:[],!0))}catch{}}function umi(A,e,t){var i;if("Integration"in A){var n={user:function(){return t.user()},addIntegration:function(){}};A(n),i=A.Integration}else i=A;var o=new i(e);return o.analytics=t,o}function dmi(A,e,t,i){return xA(this,void 0,void 0,function(){var n,o,g,a,s,I;return ge(this,function(r){switch(r.label){case 0:n=k0e(e),o=J0e(n,i),g=MfA(),a="".concat(g,"/integrations/").concat(o??n,"/").concat(t,"/").concat(o??n,".dynamic.js.gz"),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,CR(a)];case 2:return r.sent(),Emi(a,A,e),[3,4];case 3:throw s=r.sent(),A.stats.gauge("legacy_destination_time",-1,["plugin:".concat(e),"failed"]),s;case 4:return I=window["".concat(n,"Deps")],[4,Promise.all(I.map(function(C){return CR(g+C+".gz")}))];case 5:return r.sent(),window["".concat(n,"Loader")](),[2,window["".concat(n,"Integration")]]}})})}function hmi(A,e,t){return xA(this,void 0,void 0,function(){var i,n,o,g;return ge(this,function(a){return i=MfA(),n=k0e(A),o=J0e(A,t),g="".concat(i,"/integrations/").concat(o??n,"/").concat(e,"/").concat(o??n,".dynamic.js.gz"),[2,Yci(g)]})})}function mmi(A){var e,t,i,n;return(n=(t=(e=A==null?void 0:A.versionSettings)===null||e===void 0?void 0:e.override)!==null&&t!==void 0?t:(i=A==null?void 0:A.versionSettings)===null||i===void 0?void 0:i.version)!==null&&n!==void 0?n:"latest"}var pmi=function(A,e){var t,i=e.type,n=e.bundlingStatus,o=e.versionSettings,g=n!=="unbundled"&&(i==="browser"||((t=o==null?void 0:o.componentTypes)===null||t===void 0?void 0:t.includes("browser")));return!A.startsWith("Segment")&&A!=="Iterable"&&g},fmi=function(A,e){var t=e.All===!1&&e[A]===void 0;return e[A]===!1||t};function ymi(A,e){return xA(this,void 0,void 0,function(){var t,i=this;return ge(this,function(n){switch(n.label){case 0:return t=[],ef()?[2,e]:[4,Tde(function(){return e.length>0&&Bde()},function(){return xA(i,void 0,void 0,function(){var o,g,a;return ge(this,function(s){switch(s.label){case 0:return o=e.pop(),o?[4,AR(o,A)]:[2];case 1:return g=s.sent(),a=g instanceof ME,a||t.push(o),[2]}})})})];case 1:return n.sent(),t.map(function(o){return e.pushWithBackoff(o)}),[2,e]}})})}var N0e=function(){function A(e,t,i,n,o,g){n===void 0&&(n={});var a=this;this.options={},this.type="destination",this.middleware=[],this.initializePromise=AfA(),this.flushing=!1,this.name=e,this.version=t,this.settings=vA({},n),this.disableAutoISOConversion=o.disableAutoISOConversion||!1,this.integrationSource=g,this.settings.type&&this.settings.type==="browser"&&delete this.settings.type,this.initializePromise.promise.then(function(s){return a._initialized=s},function(){}),this.options=o,this.buffer=o.disableClientPersistence?new T6(4,[]):new $6(4,"".concat(i,":dest-").concat(e)),this.scheduleFlush()}return A.prototype.isLoaded=function(){return!!this._ready},A.prototype.ready=function(){var e=this;return this.initializePromise.promise.then(function(){var t;return(t=e.onReady)!==null&&t!==void 0?t:Promise.resolve()})},A.prototype.load=function(e,t){var i;return xA(this,void 0,void 0,function(){var n,o,g=this;return ge(this,function(a){switch(a.label){case 0:return this._ready||this.onReady!==void 0?[2]:(i=this.integrationSource)!==null&&i!==void 0?(o=i,[3,3]):[3,1];case 1:return[4,dmi(e,this.name,this.version,this.options.obfuscate)];case 2:o=a.sent(),a.label=3;case 3:n=o,this.integration=umi(n,this.settings,t),this.onReady=new Promise(function(s){var I=function(){g._ready=!0,s(!0)};g.integration.once("ready",I)}),this.integration.on("initialize",function(){g.initializePromise.resolve(!0)});try{of(e,{integrationName:this.name,methodName:"initialize",type:"classic"}),this.integration.initialize()}catch(s){throw of(e,{integrationName:this.name,methodName:"initialize",type:"classic",didError:!0}),this.initializePromise.resolve(!1),s}return[2]}})})},A.prototype.unload=function(e,t){return hmi(this.name,this.version,this.options.obfuscate)},A.prototype.addMiddleware=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.middleware=(e=this.middleware).concat.apply(e,t)},A.prototype.shouldBuffer=function(e){return e.event.type!=="page"&&(ef()||this._ready!==!0||this._initialized!==!0)},A.prototype.send=function(e,t,i){var n,o;return xA(this,void 0,void 0,function(){var g,a,s,I,r,C;return ge(this,function(l){switch(l.label){case 0:return this.shouldBuffer(e)?(this.buffer.push(e),this.scheduleFlush(),[2,e]):(g=(o=(n=this.options)===null||n===void 0?void 0:n.plan)===null||o===void 0?void 0:o.track,a=e.event.event,g&&a&&this.name!=="Segment.io"&&(s=g[a],G0e(g,s)?e.updateEvent("integrations",vA(vA({},e.event.integrations),s==null?void 0:s.integrations)):(e.updateEvent("integrations",vA(vA({},e.event.integrations),{All:!1,"Segment.io":!0})),e.cancel(new Af({retry:!1,reason:"Event ".concat(a," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),s!=null&&s.enabled&&(s==null?void 0:s.integrations[this.name])===!1&&e.cancel(new Af({retry:!1,reason:"Event ".concat(a," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),[4,vfA(this.name,e.event,this.middleware)]);case 1:if(I=l.sent(),I===null)return[2,e];r=new t(I,{traverse:!this.disableAutoISOConversion}),of(e,{integrationName:this.name,methodName:i,type:"classic"}),l.label=2;case 2:return l.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,i,r)]:[3,4];case 3:l.sent(),l.label=4;case 4:return[3,6];case 5:throw C=l.sent(),of(e,{integrationName:this.name,methodName:i,type:"classic",didError:!0}),C;case 6:return[2,e]}})})},A.prototype.track=function(e){return xA(this,void 0,void 0,function(){return ge(this,function(t){return[2,this.send(e,eC.Track,"track")]})})},A.prototype.page=function(e){var t;return xA(this,void 0,void 0,function(){return ge(this,function(i){switch(i.label){case 0:return!((t=this.integration)===null||t===void 0)&&t._assumesPageview&&!this._initialized&&this.integration.initialize(),[4,this.initializePromise.promise];case 1:return i.sent(),[2,this.send(e,eC.Page,"page")]}})})},A.prototype.identify=function(e){return xA(this,void 0,void 0,function(){return ge(this,function(t){return[2,this.send(e,eC.Identify,"identify")]})})},A.prototype.alias=function(e){return xA(this,void 0,void 0,function(){return ge(this,function(t){return[2,this.send(e,eC.Alias,"alias")]})})},A.prototype.group=function(e){return xA(this,void 0,void 0,function(){return ge(this,function(t){return[2,this.send(e,eC.Group,"group")]})})},A.prototype.scheduleFlush=function(){var e=this;this.flushing||setTimeout(function(){return xA(e,void 0,void 0,function(){var t;return ge(this,function(i){switch(i.label){case 0:return ef()||this._ready!==!0||this._initialized!==!0?(this.scheduleFlush(),[2]):(this.flushing=!0,t=this,[4,ymi(this,this.buffer)]);case 1:return t.buffer=i.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}})})},Math.random()*5e3)},A}();function bmi(A,e,t,i,n,o){var g,a;if(t===void 0&&(t={}),i===void 0&&(i={}),cde())return[];e.plan&&(i=i??{},i.plan=e.plan);var s=(a=(g=e.middlewareSettings)===null||g===void 0?void 0:g.routingRules)!==null&&a!==void 0?a:[],I=e.integrations,r=i.integrations,C=jde(e,i??{}),l=o==null?void 0:o.reduce(function(B,E){var u;return vA(vA({},B),(u={},u[Qmi(E)]=E,u))},{}),c=new Set($n($n([],Object.keys(I).filter(function(B){return pmi(B,I[B])}),!0),Object.keys(l||{}).filter(function(B){return Zr(I[B])||Zr(r==null?void 0:r[B])}),!0));return Array.from(c).filter(function(B){return!fmi(B,t)}).map(function(B){var E=I[B],u=mmi(E),d=new N0e(B,u,A,C[B],i,l==null?void 0:l[B]),f=s.filter(function(w){return w.destinationName===B});return f.length>0&&n&&d.addMiddleware(n),d})}const wmi=Object.freeze(Object.defineProperty({__proto__:null,LegacyDestination:N0e,ajsDestinations:bmi},Symbol.toStringTag,{value:"Module"}));function Dmi(A){return xA(this,void 0,void 0,function(){var e;return ge(this,function(t){switch(t.label){case 0:return[4,Promise.resolve().then(()=>Fmi)];case 1:return e=t.sent(),A._plugins=e,[2]}})})}const Gmi=Object.freeze(Object.defineProperty({__proto__:null,loadLegacyVideoPlugins:Dmi},Symbol.toStringTag,{value:"Module"}));function kmi(A,e){var t,i;if(!A||!Object.keys(A))return{};var n=A.integrations?Object.keys(A.integrations).filter(function(g){return A.integrations[g]===!1}):[],o=[];return((t=e.remotePlugins)!==null&&t!==void 0?t:[]).forEach(function(g){n.forEach(function(a){g.creationName==a&&o.push(g.name)})}),((i=e.remotePlugins)!==null&&i!==void 0?i:[]).reduce(function(g,a){return a.settings.subscriptions&&o.includes(a.name)&&a.settings.subscriptions.forEach(function(s){return g["".concat(a.name," ").concat(s.partnerAction)]=!1}),g},{})}function Jmi(A,e){function t(i){var n=A,o=i.event.event;if(n&&o){var g=n[o];if(G0e(n,g)){var a=kmi(g,e);i.updateEvent("integrations",vA(vA(vA({},i.event.integrations),g==null?void 0:g.integrations),a))}else return i.updateEvent("integrations",vA(vA({},i.event.integrations),{All:!1,"Segment.io":!0})),i}return i}return{name:"Schema Filter",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:t,alias:t,track:t,identify:t,group:t}}const Nmi=Object.freeze(Object.defineProperty({__proto__:null,schemaFilter:Jmi},Symbol.toStringTag,{value:"Module"}));function Ymi(A,e,t){var i;return xA(this,void 0,void 0,function(){var n,o,g,a,s,I=this;return ge(this,function(r){switch(r.label){case 0:return cde()?[2,[]]:(n=MfA(),o=(i=e.enabledMiddleware)!==null&&i!==void 0?i:{},g=Object.entries(o).filter(function(C){C[0];var l=C[1];return l}).map(function(C){var l=C[0];return l}),a=g.map(function(C){return xA(I,void 0,void 0,function(){var l,c,B,E;return ge(this,function(u){switch(u.label){case 0:l=C.replace("@segment/",""),c=l,t&&(c=btoa(l).replace(/=/g,"")),B="".concat(n,"/middleware/").concat(c,"/latest/").concat(c,".js.gz"),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,CR(B)];case 2:return u.sent(),[2,window["".concat(l,"Middleware")]];case 3:return E=u.sent(),A.log("error",E),A.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}})})}),[4,Promise.all(a)]);case 1:return s=r.sent(),s=s.filter(Boolean),[2,s]}})})}const Rmi=Object.freeze(Object.defineProperty({__proto__:null,remoteMiddlewares:Ymi},Symbol.toStringTag,{value:"Module"}));var tP={},xmi={get exports(){return tP},set exports(A){tP=A}};(function(A,e){(function(t,i){A.exports=i()})(window,function(){return function(t){var i={};function n(o){if(i[o])return i[o].exports;var g=i[o]={i:o,l:!1,exports:{}};return t[o].call(g.exports,g,g.exports,n),g.l=!0,g.exports}return n.m=t,n.c=i,n.d=function(o,g,a){n.o(o,g)||Object.defineProperty(o,g,{enumerable:!0,get:a})},n.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},n.t=function(o,g){if(1&g&&(o=n(o)),8&g||4&g&&typeof o=="object"&&o&&o.__esModule)return o;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:o}),2&g&&typeof o!="string")for(var s in o)n.d(a,s,function(I){return o[I]}.bind(null,s));return a},n.n=function(o){var g=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(g,"a",g),g},n.o=function(o,g){return Object.prototype.hasOwnProperty.call(o,g)},n.p="",n(n.s=2)}([function(t,i,n){n.r(i);var o=typeof fetch=="function"?fetch.bind():function(g,a){return a=a||{},new Promise(function(s,I){var r=new XMLHttpRequest;for(var C in r.open(a.method||"get",g,!0),a.headers)r.setRequestHeader(C,a.headers[C]);function l(){var c,B=[],E=[],u={};return r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,f,w){B.push(f=f.toLowerCase()),E.push([f,w]),c=u[f],u[f]=c?c+","+w:w}),{ok:(r.status/100|0)==2,status:r.status,statusText:r.statusText,url:r.responseURL,clone:l,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},headers:{keys:function(){return B},entries:function(){return E},get:function(d){return u[d.toLowerCase()]},has:function(d){return d.toLowerCase()in u}}}}r.withCredentials=a.credentials=="include",r.onload=function(){s(l())},r.onerror=I,r.send(a.body)})};i.default=o},function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var o=function(){function a(s,I){for(var r=0;r<I.length;r++){var C=I[r];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(s,C.key,C)}}return function(s,I,r){return I&&a(s.prototype,I),r&&a(s,r),s}}(),g=function(){function a(s,I){(function(r,C){if(!(r instanceof C))throw new TypeError("Cannot call a class as a function")})(this,a),this.pluginName=s}return o(a,[{key:"track",value:function(s,I){window.analytics.track(s,I,{integration:{name:this.pluginName}})}}]),a}();i.default=g},function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0}),i.YouTubeAnalytics=i.VimeoAnalytics=void 0;var o=a(n(3)),g=a(n(4));function a(s){return s&&s.__esModule?s:{default:s}}i.VimeoAnalytics=o.default,i.YouTubeAnalytics=g.default},function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var o=function(){function I(r,C){for(var l=0;l<C.length;l++){var c=C[l];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(r,c.key,c)}}return function(r,C,l){return C&&I(r.prototype,C),l&&I(r,l),r}}(),g=a(n(0));function a(I){return I&&I.__esModule?I:{default:I}}var s=function(I){function r(C,l){(function(B,E){if(!(B instanceof E))throw new TypeError("Cannot call a class as a function")})(this,r);var c=function(B,E){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!E||typeof E!="object"&&typeof E!="function"?B:E}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,"VimeoAnalytics"));return c.authToken=l,c.player=C,c.metadata={content:{},playback:{videoPlayer:"Vimeo"}},c.mostRecentHeartbeat=0,c.isPaused=!1,c}return function(C,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);C.prototype=Object.create(l&&l.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(C,l):C.__proto__=l)}(r,I),o(r,[{key:"initialize",value:function(){var C=this,l={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var c in l)this.registerHandler(c,l[c]);this.player.getVideoId().then(function(B){C.retrieveMetadata({id:B})}).catch(console.error)}},{key:"registerHandler",value:function(C,l){var c=this;this.player.on(C,function(B){c.updateMetadata(B),l.call(c,B)})}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var C=this.mostRecentHeartbeat,l=this.metadata.playback.position;l!==C&&l-C>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(l))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(C){var l=this;return new Promise(function(c,B){var E=C.id;(0,g.default)("https://api.vimeo.com/videos/"+E,{headers:{Authorization:"Bearer "+l.authToken}}).then(function(u){return u.ok?u.json():B(u)}).then(function(u){l.metadata.content.title=u.name,l.metadata.content.description=u.description,l.metadata.content.publisher=u.user.name,l.metadata.playback.position=0,l.metadata.playback.totalLength=u.duration}).catch(function(u){return console.error("Request to Vimeo API Failed with: ",u),B(u)})})}},{key:"updateMetadata",value:function(C){var l=this;return new Promise(function(c,B){l.player.getVolume().then(function(E){E&&(l.metadata.playback.sound=100*E),l.metadata.playback.position=C.seconds,c()}).catch(B)})}}]),r}(a(n(1)).default);i.default=s},function(t,i,n){Object.defineProperty(i,"__esModule",{value:!0});var o=function(){function C(l,c){for(var B=0;B<c.length;B++){var E=c[B];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(l,E.key,E)}}return function(l,c,B){return c&&C(l.prototype,c),B&&C(l,B),l}}(),g=s(n(0)),a=s(n(1));function s(C){return C&&C.__esModule?C:{default:C}}var I=function(C){function l(c,B){(function(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")})(this,l);var E=function(u,d){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||typeof d!="object"&&typeof d!="function"?u:d}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,"YoutubeAnalytics"));return E.player=c,E.apiKey=B,E.playerLoaded=!1,E.playbackStarted=!1,E.contentStarted=!1,E.isPaused=!1,E.isBuffering=!1,E.isSeeking=!1,E.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},E.metadata=[{playback:{video_player:"youtube"},content:{}}],E.playlistIndex=0,E}return function(c,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof B);c.prototype=Object.create(B&&B.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),B&&(Object.setPrototypeOf?Object.setPrototypeOf(c,B):c.__proto__=B)}(l,C),o(l,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(c){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(c){var B=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=B,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),c.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var c=this;return new Promise(function(B,E){var u=c.player.getVideoData(),d=c.player.getPlaylist()||[u.video_id],f=d.join();(0,g.default)("https://www.googleapis.com/youtube/v3/videos?id="+f+"&part=snippet,contentDetails&key="+c.apiKey).then(function(w){if(!w.ok){var y=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw y.response=w,y}return w.json()}).then(function(w){c.metadata=[];for(var y=0,G=0;G<d.length;G++){var R=w.items[G];c.metadata.push({content:{title:R.snippet.title,description:R.snippet.description,keywords:R.snippet.tags,channel:R.snippet.channelTitle,airdate:R.snippet.publishedAt}}),y+=r(R.contentDetails.duration)}for(G=0;G<d.length;G++)c.metadata[G].playback={total_length:y,video_player:"youtube"};B()}).catch(function(w){c.metadata=d.map(function(y){return{playback:{video_player:"youtube"},content:{}}}),E(w)})})}},{key:"handleBuffer",value:function(){var c=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),c&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var B=this.player.getPlaylist();B&&this.player.getCurrentTime()===0&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===B.length-1&&this.player.getPlaylistIndex()===0&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),this.playlistIndex===-1&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var c=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(c?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var c=this.player.getPlaylistIndex(),B=this.player.getPlaylist();(B&&c===B.length-1||c===-1)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var c=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,B=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(c-B)>2e3}}]),l}(a.default);function r(C){var l=C.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return l=l.slice(1).map(function(c){if(c!=null)return c.replace(/\D/,"")}),3600*(parseInt(l[0])||0)+60*(parseInt(l[1])||0)+(parseInt(l[2])||0)}i.default=I}])})})(xmi);const Fmi=kh({__proto__:null,default:iu(tP)},[tP]);return omi}();
